Index: trunk/extensions/WikiBhasha/src/lang/en/strings.js |
— | — | @@ -88,8 +88,10 @@ |
89 | 89 | shareMessage: "edited {0} in {1} Wikipedia using WikiBhasha http://www.wikibhasha.org.", |
90 | 90 | shareMesgTitle: "Share Message", |
91 | 91 | shareToolTip: "Share On", |
92 | | - copyToClipboard: "(Copy to clipboard)", |
93 | | - |
| 92 | + newWindowMessage: "<center><h2>Your edited content has been loaded into a Wikipedia edit page in the new window. <br>Please use that new window to save the content. Once you save the content to Wikipedia, you will be redirected back here.</h2></center>", |
| 93 | + transleteButton: "Translate {0} to {1}", |
| 94 | + copyToClipboard: "(Copy to clipboard)", |
| 95 | + pasteMessage: "To use the WikiBhasha Copy/Paste feature in mozilla/firefox you need to use scratchpad.\nDo you want to invoke scratchpad?", |
94 | 96 | //tooptip strings |
95 | 97 | searchInputTooltip: "Search", |
96 | 98 | collapseTooltip: "Collapse", |
— | — | @@ -117,7 +119,7 @@ |
118 | 120 | waitUntilTranslationComplete: "Please wait till the translation completes.", |
119 | 121 | thanksMessage: "Thank you for your contribution to Wikipedia. Would you like to give feedback?", |
120 | 122 | nonEditableMessage: "WikiBhasha may be invoked only on editable articles; this article is protected in Wikipedia." |
121 | | - }; |
| 123 | + } |
122 | 124 | |
123 | 125 | //short cut to call local strings |
124 | 126 | wbLocal = wikiBhasha.localStrings; |
Index: trunk/extensions/WikiBhasha/src/lang/de/strings.js |
— | — | @@ -87,7 +87,10 @@ |
88 | 88 | shareMessage: "edited {0} in {1} Wikipedia using WikiBhasha http://www.wikibhasha.org.", |
89 | 89 | shareMesgTitle: "Share Message", |
90 | 90 | shareToolTip: "Share On", |
| 91 | + newWindowMessage: "<center><h2>Your edited content has been loaded into a Wikipedia edit page in the new window. <br>Please use that new window to save the content. Once you save the content to Wikipedia, you will be redirected back here.</h2></center>", |
| 92 | + transleteButton: "Translate {0} to {1}", |
91 | 93 | copyToClipboard: "(Copy to clipboard)", |
| 94 | + pasteMessage: "To use the WikiBhasha Copy/Paste feature in mozilla/firefox you need to use scratchpad.\nDo you want to invoke scratchpad?", |
92 | 95 | |
93 | 96 | //tooptip strings |
94 | 97 | searchInputTooltip: "Search", |
— | — | @@ -116,7 +119,7 @@ |
117 | 120 | waitUntilTranslationComplete: "Please wait till the translation completes.", |
118 | 121 | thanksMessage: "Thank you for your contribution to Wikipedia. Would you like to give feedback?", |
119 | 122 | nonEditableMessage: "WikiBhasha may be invoked only on editable articles; this article is protected in Wikipedia." |
120 | | - }; |
| 123 | + } |
121 | 124 | |
122 | 125 | //short cut to call local strings |
123 | 126 | wbLocal = wikiBhasha.localStrings; |
Index: trunk/extensions/WikiBhasha/src/styles/wikiBhasha.css |
— | — | @@ -449,7 +449,6 @@ |
450 | 450 | display:none; |
451 | 451 | float:left; |
452 | 452 | height: 25px; |
453 | | - |
454 | 453 | font-size:12px; |
455 | 454 | font-weight :bold; |
456 | 455 | } |
— | — | @@ -783,4 +782,59 @@ |
784 | 783 | padding-left:4px; |
785 | 784 | float:left; |
786 | 785 | text-align:left; |
| 786 | +} |
| 787 | + |
| 788 | +/* scratchpad */ |
| 789 | + |
| 790 | +#wbScratchPadWindow { |
| 791 | + visibility: visible; |
| 792 | + z-index: 100000; |
| 793 | + position: absolute; |
| 794 | + width:700px; |
| 795 | + direction:ltr; |
| 796 | +} |
| 797 | +.scratchTopLayout |
| 798 | +{ |
| 799 | + float:left; |
| 800 | + width:250px; |
| 801 | + min-width:250px; |
| 802 | +} |
| 803 | +.scratchTopButtonLayout |
| 804 | +{ |
| 805 | + text-align:center; |
| 806 | + float:left; |
| 807 | + margin:5px; |
| 808 | + width:75px; |
| 809 | + display:block; |
| 810 | +} |
| 811 | +.scratchContentLayout{ |
| 812 | + float:left; |
| 813 | + width:240px; |
| 814 | + min-width:240px; |
| 815 | + border:1px solid #DDE1E3; |
| 816 | + height:50px; |
| 817 | + overflow:auto; |
| 818 | +} |
| 819 | +#scratchPadLimitNoteHolder |
| 820 | +{ |
| 821 | + clear:both; |
| 822 | +} |
| 823 | +.wbScratchPadSection { |
| 824 | + margin:10px 5px 10px 5px; |
| 825 | +} |
| 826 | +.wbScratchPadSectionContent { |
| 827 | + padding:0px; |
| 828 | + width:100%; |
| 829 | + float:left; |
| 830 | + clear:left; |
| 831 | + margin-bottom:2px; |
| 832 | +} |
| 833 | +.scratchContentLayoutRow |
| 834 | +{ |
| 835 | + margin:5px; |
| 836 | + overflow:hidden; |
| 837 | +} |
| 838 | +.scratchTopButtonLayout INPUT |
| 839 | +{ |
| 840 | + width: 75px !important; |
787 | 841 | } |
\ No newline at end of file |
Index: trunk/extensions/WikiBhasha/src/styles/themes/wikiBhasha.silver.css |
— | — | @@ -25,13 +25,6 @@ |
26 | 26 | font-size:12px; |
27 | 27 | direction:ltr; |
28 | 28 | } |
29 | | -#wbScratchPadWindow { |
30 | | - visibility: visible; |
31 | | - z-index: 100000; |
32 | | - position: absolute; |
33 | | - width:300px; |
34 | | - direction:ltr; |
35 | | -} |
36 | 29 | #wbSplitHelperDiv |
37 | 30 | { |
38 | 31 | opacity:0.0; |
— | — | @@ -41,9 +34,9 @@ |
42 | 35 | position:absolute; |
43 | 36 | z-index:1000; |
44 | 37 | } |
45 | | -#wbWrapperContextMenu |
| 38 | +#wbWrapperScratchPad |
46 | 39 | { |
47 | | - width:300px; |
| 40 | + width:700px; |
48 | 41 | } |
49 | 42 | #wbSplitter { |
50 | 43 | height: 480px; |
— | — | @@ -192,13 +185,6 @@ |
193 | 186 | height:35px; |
194 | 187 | border-left:1px solid #90a9b8; |
195 | 188 | } |
196 | | -.wbWindowToolbarCenter { |
197 | | - background-image: url('../../images/themes/silver/toolbarBg.png'); |
198 | | - background-repeat:repeat-x; |
199 | | - background-position:top; |
200 | | - height:35px; |
201 | | - border:1px solid #dde1e3; |
202 | | -} |
203 | 189 | .wbWindowToolbarRight { |
204 | 190 | background-image: url('../../images/themes/silver/toolbarBg.png'); |
205 | 191 | background-repeat:repeat-x; |
— | — | @@ -334,12 +320,22 @@ |
335 | 321 | display:block; |
336 | 322 | width:22px; |
337 | 323 | height:17px; |
338 | | - background: url('../../images/themes/blue/delete.png') no-repeat; |
| 324 | + background: url('../../images/themes/silver/delete.png') no-repeat; |
339 | 325 | float:left; |
340 | 326 | padding:0px 0px 0px 0px; |
341 | 327 | cursor:pointer; |
342 | 328 | font-size:1px; |
343 | 329 | } |
| 330 | +a.wbEdit { |
| 331 | + display:block; |
| 332 | + width:22px; |
| 333 | + height:17px; |
| 334 | + background: url('../../images/icnLoad.jpg') no-repeat; |
| 335 | + float:left; |
| 336 | + padding:0px 0px 0px 0px; |
| 337 | + cursor:pointer; |
| 338 | + font-size:1px; |
| 339 | +} |
344 | 340 | /* mouseover state */ |
345 | 341 | a.wbHelp:hover |
346 | 342 | { |
— | — | @@ -508,8 +504,22 @@ |
509 | 505 | { |
510 | 506 | background-position: -22px -22px; |
511 | 507 | } |
| 508 | +.wbTranslatedAreaHead |
| 509 | +{ |
| 510 | + background-image: url('../../images/themes/silver/toolbarBg.png'); |
| 511 | + background-repeat:repeat-x; |
| 512 | + background-position:top; |
| 513 | + height:25px; |
| 514 | + border:1px solid #dde1e3; |
| 515 | +} |
512 | 516 | /*top right icon layout END*/ |
513 | | - |
| 517 | +.wbWindowToolbarCenter { |
| 518 | + background-image: url("../../images/themes/blue/toolbarBg.png"); |
| 519 | + background-position: center top; |
| 520 | + background-repeat: repeat-x; |
| 521 | + border: 1px solid #DDE1E3; |
| 522 | + height: 35px; |
| 523 | +} |
514 | 524 | input.wbTranslateButton |
515 | 525 | { |
516 | 526 | padding: 2px 10px 2px 30px; |
— | — | @@ -605,11 +615,6 @@ |
606 | 616 | border-top-color: #9ea3a7; |
607 | 617 | border-left-color: #9ea3a7; |
608 | 618 | } |
609 | | -#wbSourceText |
610 | | -{ |
611 | | - width: 441px; |
612 | | - height: 90px; |
613 | | -} |
614 | 619 | .wbAddAletnateTable { |
615 | 620 | margin-bottom:5px; |
616 | 621 | width:100%; |
— | — | @@ -787,32 +792,6 @@ |
788 | 793 | .wbContextMenu LI.delete A { background-image: url('../../images/page_white_delete.png'); } |
789 | 794 | .wbContextMenu LI.quit A { background-image: url('../../images/door.png'); } |
790 | 795 | |
791 | | -.wbScratchPadRowDeleteRow { |
792 | | - padding:5px; |
793 | | - vertical-align:top; |
794 | | - width:10%; |
795 | | - border-left:1px solid #dde1e3; |
796 | | - border-bottom:1px solid #dde1e3; |
797 | | - border-right:1px solid #dde1e3; |
798 | | -} |
799 | | - |
800 | | -.wbScratchPadRow { |
801 | | - padding:5px; |
802 | | - vertical-align:top; |
803 | | - width:45%; |
804 | | - border:1px solid #dde1e3; |
805 | | -} |
806 | | -.wbScratchPadSectionContent { |
807 | | - padding:0px; |
808 | | - width:450px; |
809 | | - float:left; |
810 | | - clear:left; |
811 | | - margin-bottom:2px; |
812 | | -} |
813 | | -.wbScratchPadSection { |
814 | | - margin:10px 5px 10px 5px; |
815 | | - width:450px; |
816 | | -} |
817 | 796 | .wbTutorial |
818 | 797 | { |
819 | 798 | float:left; |
Index: trunk/extensions/WikiBhasha/src/styles/themes/wikiBhasha.blue.css |
— | — | @@ -24,13 +24,6 @@ |
25 | 25 | font-size:12px; |
26 | 26 | direction:ltr; |
27 | 27 | } |
28 | | -#wbScratchPadWindow { |
29 | | - visibility: visible; |
30 | | - z-index: 100000; |
31 | | - position: absolute; |
32 | | - width:300px; |
33 | | - direction:ltr; |
34 | | -} |
35 | 28 | #wbSplitHelperDiv |
36 | 29 | { |
37 | 30 | opacity:0.0; |
— | — | @@ -40,9 +33,9 @@ |
41 | 34 | position:absolute; |
42 | 35 | z-index:1000; |
43 | 36 | } |
44 | | -#wbWrapperContextMenu |
| 37 | +#wbWrapperScratchPad |
45 | 38 | { |
46 | | - width:300px; |
| 39 | + width:700px; |
47 | 40 | } |
48 | 41 | #wbSplitter { |
49 | 42 | height: 480px; |
— | — | @@ -191,13 +184,6 @@ |
192 | 185 | height:35px; |
193 | 186 | border-left:1px solid #90a9b8; |
194 | 187 | } |
195 | | -.wbWindowToolbarCenter { |
196 | | - background-image: url('../../images/themes/blue/toolbarBg.png'); |
197 | | - background-repeat:repeat-x; |
198 | | - background-position:top; |
199 | | - height:35px; |
200 | | - border:1px solid #dde1e3; |
201 | | -} |
202 | 188 | .wbWindowToolbarRight { |
203 | 189 | background-image: url('../../images/themes/blue/toolbarBg.png'); |
204 | 190 | background-repeat:repeat-x; |
— | — | @@ -339,6 +325,16 @@ |
340 | 326 | cursor:pointer; |
341 | 327 | font-size:1px; |
342 | 328 | } |
| 329 | +a.wbEdit { |
| 330 | + display:block; |
| 331 | + width:22px; |
| 332 | + height:17px; |
| 333 | + background: url('../../images/icnLoad.jpg') no-repeat; |
| 334 | + float:left; |
| 335 | + padding:0px 0px 0px 0px; |
| 336 | + cursor:pointer; |
| 337 | + font-size:1px; |
| 338 | +} |
343 | 339 | /* mouseover state */ |
344 | 340 | a.wbHelp:hover |
345 | 341 | { |
— | — | @@ -507,8 +503,22 @@ |
508 | 504 | { |
509 | 505 | background-position: -22px -22px; |
510 | 506 | } |
| 507 | +.wbTranslatedAreaHead |
| 508 | +{ |
| 509 | + background-image: url('../../images/themes/blue/toolbarBg.png'); |
| 510 | + background-repeat:repeat-x; |
| 511 | + background-position:top; |
| 512 | + height:25px; |
| 513 | + border:1px solid #dde1e3; |
| 514 | +} |
511 | 515 | /*top right icon layout END*/ |
512 | | - |
| 516 | +.wbWindowToolbarCenter { |
| 517 | + background-image: url("../../images/themes/blue/toolbarBg.png"); |
| 518 | + background-position: center top; |
| 519 | + background-repeat: repeat-x; |
| 520 | + border: 1px solid #DDE1E3; |
| 521 | + height: 35px; |
| 522 | +} |
513 | 523 | input.wbTranslateButton |
514 | 524 | { |
515 | 525 | padding: 2px 10px 2px 30px; |
— | — | @@ -604,11 +614,6 @@ |
605 | 615 | border-top-color: #9ea3a7; |
606 | 616 | border-left-color: #9ea3a7; |
607 | 617 | } |
608 | | -#wbSourceText |
609 | | -{ |
610 | | - width: 441px; |
611 | | - height: 90px; |
612 | | -} |
613 | 618 | .wbAddAletnateTable { |
614 | 619 | margin-bottom:5px; |
615 | 620 | width:100%; |
— | — | @@ -787,32 +792,6 @@ |
788 | 793 | .wbContextMenu LI.delete A { background-image: url('../../images/page_white_delete.png'); } |
789 | 794 | .wbContextMenu LI.quit A { background-image: url('../../images/door.png'); } |
790 | 795 | |
791 | | -.wbScratchPadRowDeleteRow { |
792 | | - padding:5px; |
793 | | - vertical-align:top; |
794 | | - width:10%; |
795 | | - border-left:1px solid #dde1e3; |
796 | | - border-bottom:1px solid #dde1e3; |
797 | | - border-right:1px solid #dde1e3; |
798 | | -} |
799 | | - |
800 | | -.wbScratchPadRow { |
801 | | - padding:5px; |
802 | | - vertical-align:top; |
803 | | - width:45%; |
804 | | - border:1px solid #dde1e3; |
805 | | -} |
806 | | -.wbScratchPadSectionContent { |
807 | | - padding:0px; |
808 | | - width:450px; |
809 | | - float:left; |
810 | | - clear:left; |
811 | | - margin-bottom:2px; |
812 | | -} |
813 | | -.wbScratchPadSection { |
814 | | - margin:10px 5px 10px 5px; |
815 | | - width:450px; |
816 | | -} |
817 | 796 | .wbTutorial |
818 | 797 | { |
819 | 798 | float:left; |
Index: trunk/extensions/WikiBhasha/src/styles/themes/wikiBhasha.black.css |
— | — | @@ -24,13 +24,6 @@ |
25 | 25 | font-size:12px; |
26 | 26 | direction:ltr; |
27 | 27 | } |
28 | | -#wbScratchPadWindow { |
29 | | - visibility: visible; |
30 | | - z-index: 100000; |
31 | | - position: absolute; |
32 | | - width:300px; |
33 | | - direction:ltr; |
34 | | -} |
35 | 28 | #wbSplitHelperDiv |
36 | 29 | { |
37 | 30 | opacity:0.0; |
— | — | @@ -40,9 +33,9 @@ |
41 | 34 | position:absolute; |
42 | 35 | z-index:1000; |
43 | 36 | } |
44 | | -#wbWrapperContextMenu |
| 37 | +#wbWrapperScratchPad |
45 | 38 | { |
46 | | - width:300px; |
| 39 | + width:700px; |
47 | 40 | } |
48 | 41 | #wbSplitter { |
49 | 42 | height: 480px; |
— | — | @@ -191,13 +184,6 @@ |
192 | 185 | height:35px; |
193 | 186 | border-left:1px solid #90a9b8; |
194 | 187 | } |
195 | | -.wbWindowToolbarCenter { |
196 | | - background-image: url('../../images/themes/black/toolbarBg.png'); |
197 | | - background-repeat:repeat-x; |
198 | | - background-position:top; |
199 | | - height:35px; |
200 | | - border:1px solid #dde1e3; |
201 | | -} |
202 | 188 | .wbWindowToolbarRight { |
203 | 189 | background-image: url('../../images/themes/black/toolbarBg.png'); |
204 | 190 | background-repeat:repeat-x; |
— | — | @@ -333,12 +319,22 @@ |
334 | 320 | display:block; |
335 | 321 | width:22px; |
336 | 322 | height:17px; |
337 | | - background: url('../../images/themes/blue/delete.png') no-repeat; |
| 323 | + background: url('../../images/themes/black/delete.png') no-repeat; |
338 | 324 | float:left; |
339 | 325 | padding:0px 0px 0px 0px; |
340 | 326 | cursor:pointer; |
341 | 327 | font-size:1px; |
342 | 328 | } |
| 329 | +a.wbEdit { |
| 330 | + display:block; |
| 331 | + width:22px; |
| 332 | + height:17px; |
| 333 | + background: url('../../images/icnLoad.jpg') no-repeat; |
| 334 | + float:left; |
| 335 | + padding:0px 0px 0px 0px; |
| 336 | + cursor:pointer; |
| 337 | + font-size:1px; |
| 338 | +} |
343 | 339 | /* mouseover state */ |
344 | 340 | a.wbHelp:hover |
345 | 341 | { |
— | — | @@ -507,8 +503,22 @@ |
508 | 504 | { |
509 | 505 | background-position: -22px -22px; |
510 | 506 | } |
| 507 | +.wbTranslatedAreaHead |
| 508 | +{ |
| 509 | + background-image: url('../../images/themes/black/toolbarBg.png'); |
| 510 | + background-repeat:repeat-x; |
| 511 | + background-position:top; |
| 512 | + height:25px; |
| 513 | + border:1px solid #dde1e3; |
| 514 | +} |
511 | 515 | /*top right icon layout END*/ |
512 | | - |
| 516 | +.wbWindowToolbarCenter { |
| 517 | + background-image: url("../../images/themes/blue/toolbarBg.png"); |
| 518 | + background-position: center top; |
| 519 | + background-repeat: repeat-x; |
| 520 | + border: 1px solid #DDE1E3; |
| 521 | + height: 35px; |
| 522 | +} |
513 | 523 | input.wbTranslateButton |
514 | 524 | { |
515 | 525 | padding: 2px 10px 2px 30px; |
— | — | @@ -603,11 +613,6 @@ |
604 | 614 | border-top-color: #9ea3a7; |
605 | 615 | border-left-color: #9ea3a7; |
606 | 616 | } |
607 | | -#wbSourceText |
608 | | -{ |
609 | | - width: 441px; |
610 | | - height: 90px; |
611 | | -} |
612 | 617 | .wbAddAletnateTable { |
613 | 618 | margin-bottom:5px; |
614 | 619 | width:100%; |
— | — | @@ -787,32 +792,6 @@ |
788 | 793 | .wbContextMenu LI.delete A { background-image: url('../../images/page_white_delete.png'); } |
789 | 794 | .wbContextMenu LI.quit A { background-image: url('../../images/door.png'); } |
790 | 795 | |
791 | | -.wbScratchPadRowDeleteRow { |
792 | | - padding:5px; |
793 | | - vertical-align:top; |
794 | | - width:10%; |
795 | | - border-left:1px solid #dde1e3; |
796 | | - border-bottom:1px solid #dde1e3; |
797 | | - border-right:1px solid #dde1e3; |
798 | | -} |
799 | | - |
800 | | -.wbScratchPadRow { |
801 | | - padding:5px; |
802 | | - vertical-align:top; |
803 | | - width:45%; |
804 | | - border:1px solid #dde1e3; |
805 | | -} |
806 | | -.wbScratchPadSectionContent { |
807 | | - padding:0px; |
808 | | - width:450px; |
809 | | - float:left; |
810 | | - clear:left; |
811 | | - margin-bottom:2px; |
812 | | -} |
813 | | -.wbScratchPadSection { |
814 | | - margin:10px 5px 10px 5px; |
815 | | - width:450px; |
816 | | -} |
817 | 796 | .wbTutorial |
818 | 797 | { |
819 | 798 | float:left; |
Index: trunk/extensions/WikiBhasha/src/images/icnLoad.jpg |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/WikiBhasha/src/images/icnLoad.jpg |
___________________________________________________________________ |
Added: svn:mime-type |
820 | 799 | + application/octet-stream |
Index: trunk/extensions/WikiBhasha/src/js/core/scratchpadWindow.js |
— | — | @@ -45,6 +45,7 @@ |
46 | 46 | |
47 | 47 | $clearAllButton: null, |
48 | 48 | $sourceTextBox: null, |
| 49 | + $targetTextBox: null, |
49 | 50 | |
50 | 51 | //initializes scratchpad window |
51 | 52 | initialize: function() { |
— | — | @@ -70,9 +71,13 @@ |
71 | 72 | $scratchPadWindowElement = $("#" + this.windowId); |
72 | 73 | this.$clearAllButton = $("#wbClearAllBtn"); |
73 | 74 | this.$sourceTextBox = $("#wbSourceText"); |
| 75 | + this.$targetTextBox = $("#wbTargetText"); |
74 | 76 | |
75 | 77 | $("#scratchPadLimitNoteText").html(wbUtil.stringFormat(wbLocal.scratchPadTextLimitNote, wbGlobalSettings.scratchpadTextMaxLength)); |
76 | | - |
| 78 | + $("#wbScratchpadHeadLabelLeft").html(wbUtil.stringFormat("<h4>{0} Text</h4>", wbLocal.english)); |
| 79 | + $("#wbScratchpadHeadLabelRight").html(wbUtil.stringFormat("<h4>{0} Text</h4>", wbGlobalSettings.targetLanguageDisplayName)); |
| 80 | + $('#wbSourceToTargetBtn').val(wbUtil.stringFormat("{0} >> {1}", wbGlobalSettings.sourceLanguageCode, wbGlobalSettings.mtTargetLanguageCode)); |
| 81 | + $('#wbTargetToSourceBtn').val(wbUtil.stringFormat("{0} << {1}", wbGlobalSettings.sourceLanguageCode, wbGlobalSettings.mtTargetLanguageCode)); |
77 | 82 | wbUIHelper.makeDraggable(this.windowId, "wbSPDraggableHandle"); |
78 | 83 | |
79 | 84 | //set focus on text area |
— | — | @@ -84,6 +89,10 @@ |
85 | 90 | wbScratchPad.hide(); |
86 | 91 | }); |
87 | 92 | |
| 93 | + $("#wbSaveScratchPadContentBtn").click(function() { |
| 94 | + wbScratchPad.saveScratchPadText(wbGlobalSettings.sourceLanguageCode, wbGlobalSettings.mtTargetLanguageCode); |
| 95 | + }); |
| 96 | + |
88 | 97 | //clear the text area when user clicks on 'clearAll' button |
89 | 98 | this.$clearAllButton.click(function() { |
90 | 99 | wbScratchPad.clearAll(); |
— | — | @@ -99,14 +108,18 @@ |
100 | 109 | $("#wbSourceToTargetBtn").click(function() { |
101 | 110 | wbScratchPad.translateScratchPadText("wbSourceText", wbGlobalSettings.sourceLanguageCode, wbGlobalSettings.mtTargetLanguageCode); |
102 | 111 | }); |
| 112 | + //set title for the button |
| 113 | + $("#wbSourceToTargetBtn").attr("Title", wbUtil.stringFormat(wbLocal.transleteButton, wbLocal.english, wbGlobalSettings.targetLanguageDisplayName)); |
| 114 | + //when user clicks, translates the given string from target to source language |
103 | 115 | |
104 | | - //when user clicks, translates the given string from target to source language |
105 | 116 | $("#wbTargetToSourceBtn").click(function() { |
106 | | - wbScratchPad.translateScratchPadText("wbSourceText", wbGlobalSettings.mtTargetLanguageCode, wbGlobalSettings.sourceLanguageCode); |
| 117 | + wbScratchPad.translateScratchPadText("wbTargetText", wbGlobalSettings.mtTargetLanguageCode, wbGlobalSettings.sourceLanguageCode); |
107 | 118 | }); |
| 119 | + //set title for the button |
| 120 | + $("#wbTargetToSourceBtn").attr("Title", wbUtil.stringFormat(wbLocal.transleteButton, wbGlobalSettings.targetLanguageDisplayName, wbLocal.english)); |
108 | 121 | |
109 | 122 | //handle the resizing for scratchpad window |
110 | | - var scratchPad = $("#wbWrapperContextMenu"), |
| 123 | + var scratchPad = $("#wbWrapperScratchPad"), |
111 | 124 | $scratchPadTableElement = $("#scratchPadTable"); |
112 | 125 | //assign the width and height. |
113 | 126 | scratchPad.css("width", $scratchPadTableElement.width()); |
— | — | @@ -133,6 +146,7 @@ |
134 | 147 | resize: function() { |
135 | 148 | var $translateArea = $("#wbTranslatedArea"), |
136 | 149 | sourceTextArea = wbScratchPad.$sourceTextBox, |
| 150 | + targetTextArea = wbScratchPad.$targetTextBox, |
137 | 151 | offset = $translateArea.offset(), |
138 | 152 | $scratchPadTableElement = $("#scratchPadTable"), |
139 | 153 | |
— | — | @@ -140,12 +154,12 @@ |
141 | 155 | contentMargin = 32, |
142 | 156 | contentHeightMargin = 136; |
143 | 157 | |
144 | | - // resize the text area width |
145 | | - sourceTextArea.css("width", $scratchPadTableElement.width() - contentMargin); |
146 | | - // resize the translated table height and width |
147 | | - $translateArea.css({ "width": $scratchPadTableElement.width() - contentMargin, |
148 | | - "height": ($("#wbWrapperContextMenu").height() - sourceTextArea.height() - contentHeightMargin) |
149 | | - }); |
| 158 | + // resize the textarea and listint div width |
| 159 | + $(".scratchTopLayout").css({"width": ($scratchPadTableElement.width()/2)-120,"display":"block"}); |
| 160 | + $(".scratchContentLayout").css({"width": ($scratchPadTableElement.width()/2)-120,"display":"block"}); |
| 161 | + |
| 162 | + // resize the translated div height |
| 163 | + $translateArea.css({"height": ($("#wbWrapperScratchPad").height() - sourceTextArea.height() - contentHeightMargin)}); |
150 | 164 | }, |
151 | 165 | // this event is fired while resizing of the scratchpad is stopped |
152 | 166 | stop: function() { |
— | — | @@ -178,19 +192,28 @@ |
179 | 193 | |
180 | 194 | //deletes given row from the translation history |
181 | 195 | deleteRow: function(rowId) { |
182 | | - $(rowId).remove(); |
| 196 | + $('#wbTargetRow'+rowId).remove(); |
183 | 197 | this.rowCount = this.rowCount - 1; |
184 | 198 | if (this.rowCount === 1) { |
185 | 199 | this.$clearAllButton.attr("disabled", "true"); |
186 | 200 | } |
| 201 | + return true; |
187 | 202 | }, |
188 | 203 | |
| 204 | + //loads given row from the translation history to the edit/add form |
| 205 | + editRow: function(rowId) { |
| 206 | + this.$sourceTextBox.val($('#wbSourceCol'+rowId).text()); |
| 207 | + this.$targetTextBox.val($('#wbTargetCol'+rowId).text()); |
| 208 | + return true; |
| 209 | + }, |
| 210 | + |
189 | 211 | //clears text from the scratchpad text area and translation history |
190 | 212 | clearAll: function() { |
191 | 213 | this.$sourceTextBox.val(""); |
| 214 | + this.$targetTextBox.val(""); |
192 | 215 | //disable clear button |
193 | 216 | this.$clearAllButton.attr("disabled", "true"); |
194 | | - $("#wbTargetTable tr:gt(0)").remove(); |
| 217 | + $('#wbTranslatedArea').html(""); |
195 | 218 | this.rowCount = 1; |
196 | 219 | this.currentRowId = 1; |
197 | 220 | }, |
— | — | @@ -221,16 +244,14 @@ |
222 | 245 | //call the translate function to translate the given text |
223 | 246 | wbLanguageServices.translate($sourceText, sourceCode, targetCode, function(translatedText) { |
224 | 247 | if (translatedText && translatedText.length) { |
225 | | - //add new row with source text and translated text |
226 | | - wbScratchPad.addRow($sourceText, translatedText, sourceCode, targetCode); |
227 | | - wbScratchPad.$clearAllButton.removeAttr("disabled"); |
228 | | - wbUIHelper.hideElement("wbTranslationLoading"); |
229 | | - return; |
| 248 | + if(sourceCode!='en'){ |
| 249 | + $('#wbSourceText').val(translatedText); |
| 250 | + }else{ |
| 251 | + $('#wbTargetText').val(translatedText); |
| 252 | + } |
230 | 253 | } |
231 | | - else { |
232 | | - wbUIHelper.hideElement("wbTranslationLoading"); |
233 | | - return; |
234 | | - } |
| 254 | + wbUIHelper.hideElement("wbTranslationLoading"); |
| 255 | + return; |
235 | 256 | }); |
236 | 257 | } |
237 | 258 | else { |
— | — | @@ -240,6 +261,20 @@ |
241 | 262 | } |
242 | 263 | }, |
243 | 264 | |
| 265 | + //saves the scratchpad text for future use |
| 266 | + saveScratchPadText: function(sourceCode, targetCode){ |
| 267 | + //add new row with source text and translated text |
| 268 | + if($.trim($('#wbSourceText').val()).length === 0 && $.trim($('#wbTargetText').val()).length === 0){ |
| 269 | + window.alert(wbLocal.emptyInputText, wbGlobalSettings.applicationName); |
| 270 | + }else{ |
| 271 | + wbScratchPad.addRow($('#wbSourceText').val(), $('#wbTargetText').val(), sourceCode, targetCode); |
| 272 | + $('#wbSourceText').val(""); |
| 273 | + $('#wbTargetText').val("") |
| 274 | + wbScratchPad.$clearAllButton.removeAttr("disabled"); |
| 275 | + } |
| 276 | + return; |
| 277 | + }, |
| 278 | + |
244 | 279 | //adds row in to the scratchpad's translation history table |
245 | 280 | addRow: function($sourceText, translatedText, sourceCode, targetCode) { |
246 | 281 | //target row element id |
— | — | @@ -250,25 +285,27 @@ |
251 | 286 | targetColId = "wbTargetCol" + this.currentRowId, |
252 | 287 | //delete image row element id |
253 | 288 | deleteRowBtn = "wbDeleteRowBtn" + this.currentRowId, |
254 | | - |
| 289 | + //load image row element id |
| 290 | + editRowBtn = "wbEditRowBtn" + this.currentRowId, |
| 291 | + //scratchpad content box element |
| 292 | + $scratchPadTableElement = $("#scratchPadTable"), |
255 | 293 | //create new translation history row |
256 | | - newRow = wbUtil.stringFormat("<tr id={0} class='wbScratchPadTarget'><td class='wbScratchPadRow'" + |
257 | | - "id={1}></td><td class='wbScratchPadRow' id={2} style='vertical-align:top;'></td>" + |
258 | | - "<td class='wbScratchPadRowDeleteRow' style='vertical-align:top;'>" + |
259 | | - "<a id={3} class='wbDelete' href='#' name='{0}' title='Delete this row' >" + |
260 | | - "</a></td></tr>", targetRowId, sourceColId, targetColId, deleteRowBtn); |
| 294 | + newRow = wbUtil.stringFormat("<div id={0} class='scratchContentLayoutRow'><div class='scratchContentLayout' id={1}></div>"+ |
| 295 | + "<div class='scratchTopButtonLayout'> </div>"+ |
| 296 | + "<div class='scratchContentLayout' id={2} ></div>" + |
| 297 | + "<div class='scratchTopButtonLayout'>" + |
| 298 | + "<a id={3} class='wbDelete' href='#' name='{5}' title='Delete this row' class='scratchContentLayout'></a>" + |
| 299 | + "<a id={4} class='wbEdit' href='#' name='{5}' title='Load this row' class='scratchContentLayout'></a>" + |
| 300 | + "</div></div>", targetRowId, sourceColId, targetColId, deleteRowBtn, editRowBtn, this.currentRowId); |
261 | 301 | |
262 | | - //show scratchpad target area header |
263 | | - $("#wbHeaderRow").css({ 'visibility': 'visible' }); |
| 302 | + |
264 | 303 | //append row if the row contained in scratchpad is equal to 1 |
265 | 304 | if (this.rowCount === 1) { |
266 | | - $("#wbTargetTable").append(newRow); |
| 305 | + $("#wbTranslatedArea").append(newRow); |
267 | 306 | } |
268 | 307 | else if (this.rowCount > 1) { |
269 | | - // find the second TR (1st TR is for header of the table) |
270 | | - var $targetTable = $("#wbTargetTable"), |
271 | | - $secondRow = $targetTable.get(0).getElementsByTagName("tr")[1]; |
272 | | - $(newRow).insertBefore("#" + $secondRow.id); |
| 308 | + // find the second TR (1st TR is for header of the table) |
| 309 | + $(newRow).insertBefore("#" + $("#wbTranslatedArea").get(0).getElementsByTagName("div")[0].id); |
273 | 310 | } |
274 | 311 | |
275 | 312 | // Warning! Do not use html() or innerHTML, which could cause script injection. |
— | — | @@ -288,9 +325,17 @@ |
289 | 326 | this.$sourceTextBox.val(""); |
290 | 327 | //delete the row when user clicks on delete image |
291 | 328 | $("#" + deleteRowBtn).bind('click', function() { |
292 | | - wbScratchPad.deleteRow("#" + this.name); |
| 329 | + wbScratchPad.deleteRow(this.name); |
293 | 330 | }); |
294 | 331 | |
| 332 | + //Load the row when user clicks on load image |
| 333 | + $("#" + editRowBtn).bind('click', function() { |
| 334 | + wbScratchPad.editRow(this.name); |
| 335 | + }); |
| 336 | + // resize the textarea and listint div width |
| 337 | + $(".scratchTopLayout").css({"width": ($scratchPadTableElement.width()/2)-120,"display":"block"}); |
| 338 | + $(".scratchContentLayout").css({"width": ($scratchPadTableElement.width()/2)-120,"display":"block"}); |
| 339 | + |
295 | 340 | this.rowCount = this.rowCount + 1; |
296 | 341 | this.currentRowId = this.currentRowId + 1; |
297 | 342 | this.$clearAllButton.removeAttr("disabled"); |
— | — | @@ -299,8 +344,6 @@ |
300 | 345 | |
301 | 346 | //applies localization on scratchpad window |
302 | 347 | applyLocalization: function() { |
303 | | - $("#wbSourceToTargetBtn").attr("value", wbUtil.stringFormat("{1}{0}{2}{0}{3}", wbLocal.space, wbLocal.english, wbLocal.toText, wbGlobalSettings.$targetLanguageName)); |
304 | | - $("#wbTargetToSourceBtn").attr("value", wbUtil.stringFormat("{1}{0}{2}{0}{3}", wbLocal.space, wbGlobalSettings.$targetLanguageName, wbLocal.toText, wbLocal.english)); |
305 | 348 | $("#wbScratchPadHeader").html(wbLocal.scratchPad); |
306 | 349 | wbScratchPad.$clearAllButton.attr("value", wbLocal.clearAll); |
307 | 350 | $("#wbSourceTextHeader").html(wbLocal.sourceTextHeader); |
Index: trunk/extensions/WikiBhasha/src/js/core/mainWindow.js |
— | — | @@ -52,9 +52,11 @@ |
53 | 53 | wbUIHelper.hideScroll(); |
54 | 54 | |
55 | 55 | wbUIHelper.createWindow(this.windowId, wbGlobalSettings.applicationWindowHTML); |
| 56 | + |
56 | 57 | this.adjustWindowPosition(); |
57 | 58 | wbMainWindow.applyLocalization(); |
58 | | - |
| 59 | + |
| 60 | + |
59 | 61 | //initialize various UI components |
60 | 62 | wikiBhasha.windowManagement.resizeManager.initialize(); |
61 | 63 | wikiBhasha.windowManagement.splitterManager.initialize(); |
— | — | @@ -109,7 +111,7 @@ |
110 | 112 | }); |
111 | 113 | |
112 | 114 | //restrict user from selecting text from UI elements as IE doesn't have any predefined HTML attribute to do the same. |
113 | | - $(".wbWindowToolbarCenter, .wbHeader, .wbLeftWindowCollapsed, .wbRightWindowCollapsed, .wbLogoContainer, .wbTopButtonsDiv, .workflowNavigationBtns, .wbWindowContentLeft, .wbWindowContentRight").each(function() { |
| 115 | + $("#wbSPDraggableHandle, #wbTranslationTable, #wbWrapperScratchPad, #wbScratchPadWindow, #scratchPadTable, .scratchContentLayoutRow, .scratchTopButtonLayout, .wbScratchPadSection, .scratchContentLayout, .scratchTopLayout, .wbWindowToolbarCenter, .wbHeader, .wbLeftWindowCollapsed, .wbRightWindowCollapsed, .wbLogoContainer, .wbTopButtonsDiv, .workflowNavigationBtns, .wbWindowContentLeft, .wbWindowContentRight").each(function() { |
114 | 116 | this.onselectstart = function() { return false; }; |
115 | 117 | }); |
116 | 118 | } |
— | — | @@ -435,7 +437,23 @@ |
436 | 438 | $documentBodyElement.bind("paste", function(event) { |
437 | 439 | //if cut/copy events are not registered earlier from this window or user trying to paste the content other than scratch pad text area then prevent this action. |
438 | 440 | if (!isCopyFromCurrentApp) { |
439 | | - return (wbScratchPad.$sourceTextBox) ? (event.target.id === wbScratchPad.$sourceTextBox.attr("id")) : false; |
| 441 | + if((wbScratchPad.$sourceTextBox && event.target.id === wbScratchPad.$sourceTextBox.attr("id")) || (wbScratchPad.$targetTextBox && event.target.id === wbScratchPad.$targetTextBox.attr("id"))){ |
| 442 | + return true; |
| 443 | + }else{ |
| 444 | + var paneDivID = wbDisplayPaneManager.getPaneForId(wbDisplayPaneHelper.getElementsPaneDivId(event.target)); |
| 445 | + if(paneDivID.paneConfigInfo.isContentEditable){ |
| 446 | + if ($.browser.msie) { |
| 447 | + var copiedtext=window.clipboardData.getData("Text"); |
| 448 | + window.clipboardData.setData("Text", wbUtil.stripTags(copiedtext)); |
| 449 | + return true; |
| 450 | + }else{ |
| 451 | + if(confirm(wbLocal.pasteMessage)){ |
| 452 | + wbScratchPad.show(); |
| 453 | + } |
| 454 | + } |
| 455 | + } |
| 456 | + return false; |
| 457 | + } |
440 | 458 | } |
441 | 459 | return true; |
442 | 460 | }); |
— | — | @@ -461,7 +479,7 @@ |
462 | 480 | |
463 | 481 | //removes cloned HTML elements(during Drag-Drop or Copy-Paste) from the element"#wbRightWindowContentDiv" |
464 | 482 | removeNonContentElements: function() { |
465 | | - var $elementsToBeRemoved = $("#wbTranslationTable, .wbExit, .wbLeftWindowContent, .wbLogoContainer, .wbContentContainer, #wbTwoPaneOuterWrapper, #wbLeftWindow, .wbTableBackground, .wbTopButtonsDiv, #wbTopIcons, #wbHistoryInfo, .workflowNavigationBtns, #workFlowStepBtns, .wbTable, .wbHeader, #wbWorkingArticleLabel, .tabs_li, .wbWikiMarkupEditBottomLinks, .tab_content", $("#wbRightWindowContentDiv")); |
| 483 | + var $elementsToBeRemoved = $("#wbTranslationTable, #wbScratchPadWindow, #scratchPadTable, .scratchContentLayoutRow, .scratchTopButtonLayout, .wbScratchPadSection, .scratchContentLayout, .scratchTopLayout, .wbExit, .wbLeftWindowContent, .wbLogoContainer, .wbContentContainer, #wbTwoPaneOuterWrapper, #wbLeftWindow, .wbTableBackground, .wbTopButtonsDiv, #wbTopIcons, #wbHistoryInfo, .workflowNavigationBtns, #workFlowStepBtns, .wbTable, .wbHeader, #wbWorkingArticleLabel, .tabs_li, .wbWikiMarkupEditBottomLinks, .tab_content", $("#wbRightWindowContentDiv")); |
466 | 484 | var removeCloneNodes = function() { |
467 | 485 | //jQuery '.remove()' method actually removes the events on original elements |
468 | 486 | //to avoid this we need to use native DOM method to remove only the cloned elements |
Index: trunk/extensions/WikiBhasha/src/js/core/paneManagement.js |
— | — | @@ -136,12 +136,12 @@ |
137 | 137 | }, |
138 | 138 | loadWikiEditPage : function () { |
139 | 139 | wbDisplayPaneHelper.setPaneTitleFromConfig(wbPublishDisplayPane.$contentElem, wbPublishDisplayPane.paneConfigInfo); |
140 | | - wbPublishDisplayPane.$contentElem.html("<center><h2>Your edited content has been loaded into a Wikipedia edit page in the new window. <br>Please use that new window to save the content. Once you save the content to Wikipedia, you will be redirected back here.</h2></center>"); |
141 | | - // get the existance of the text area in the iFrame. |
| 140 | + wbPublishDisplayPane.$contentElem.html(wbLocal.newWindowMessage); |
| 141 | + // get the existance of the text area in the child window. |
142 | 142 | var noOfTextAreas = wbPublishDisplayPane.getWikiTextareaElement().length; |
143 | 143 | |
144 | 144 | // Check the state of the content and the text area. If the content is already moved to |
145 | | - // Wikipedia and there is no text area present in the iFrame, then close the application |
| 145 | + // Wikipedia and there is no text area present in the window, then close the application |
146 | 146 | // and load the updated Wikipedia page. |
147 | 147 | if (wbPublishDisplayPane.isContentMovedToWikipedia && (noOfTextAreas === 0)) { |
148 | 148 | var currentPageUrl = window.location.href; |
— | — | @@ -149,8 +149,6 @@ |
150 | 150 | wbPublishDisplayPane.wbChildWikipedia.close(); |
151 | 151 | clearTimeout(wbPublishDisplayPane.timeoutObj); |
152 | 152 | wbPublishDisplayPane.$contentElem.html(" "); |
153 | | - //window.location.href = currentPageUrl; |
154 | | - //wbMainWindow.hide(); |
155 | 153 | //show WikiBhasha share exit popup. |
156 | 154 | wbShareOnExternSystem.show(); |
157 | 155 | return; |
— | — | @@ -174,10 +172,10 @@ |
175 | 173 | // into wikipedia article content when user clicks the save button. |
176 | 174 | addSnippetInjectCodeToSaveButton : function () { |
177 | 175 | |
178 | | - // get the iFrame which contains the wikipedia text area and the save button |
179 | | - var iFrameDoc = wbPublishDisplayPane.wbChildWikipedia.document, |
180 | | - // get the save button from the iFrame |
181 | | - saveButton = iFrameDoc.getElementById(wbWikiSite.wikiSaveButton); |
| 176 | + // get the child window which contains the wikipedia text area and the save button |
| 177 | + var childWindowDoc = wbPublishDisplayPane.wbChildWikipedia.document, |
| 178 | + // get the save button from the childWindowDoc |
| 179 | + saveButton = childWindowDoc.getElementById(wbWikiSite.wikiSaveButton); |
182 | 180 | if (saveButton) { |
183 | 181 | // bind the click event to the save button |
184 | 182 | saveButton.onclick = function() { |
— | — | @@ -1042,15 +1040,15 @@ |
1043 | 1041 | |
1044 | 1042 | //configures the compose area for wikipedia edit page pane |
1045 | 1043 | configureComposeArea: function() { |
1046 | | - //iframe document object |
1047 | | - var iframeDoc = wbPublishDisplayPane.wbChildWikipedia.document; |
| 1044 | + //child window document object |
| 1045 | + var childWindowDoc = wbPublishDisplayPane.wbChildWikipedia.document; |
1048 | 1046 | |
1049 | 1047 | //removing unwanted divs from compose area |
1050 | | - $(wbWikiSite.wikiEditPageNonCriticalDivs, iframeDoc).hide(); |
| 1048 | + $(wbWikiSite.wikiEditPageNonCriticalDivs, childWindowDoc).hide(); |
1051 | 1049 | //set margin |
1052 | | - $(wbWikiSite.wikiComposeDiv, iframeDoc).css("margin-left", 0).css("margin-right", 0); |
| 1050 | + $(wbWikiSite.wikiComposeDiv, childWindowDoc).css("margin-left", 0).css("margin-right", 0); |
1053 | 1051 | //disable links inside compose area |
1054 | | - $(wbWikiSite.wikiComposeLinks, iframeDoc).click(function() { return false; }); |
| 1052 | + $(wbWikiSite.wikiComposeLinks, childWindowDoc).click(function() { return false; }); |
1055 | 1053 | }, |
1056 | 1054 | |
1057 | 1055 | //checks the translateion status and returns true if it was done otherwise it returns false. |
Index: trunk/extensions/WikiBhasha/src/js/core/globalSettings.js |
— | — | @@ -86,7 +86,7 @@ |
87 | 87 | |
88 | 88 | //cutoff length to be used for pane titles |
89 | 89 | paneTitleCutoffLength: 100, |
90 | | - |
| 90 | + |
91 | 91 | //cutoff length to be used for edit page summery field |
92 | 92 | summeryFieldCutoffLength: 200, |
93 | 93 | |
— | — | @@ -136,6 +136,7 @@ |
137 | 137 | |
138 | 138 | //array of microsoft translator supported languages. [language name, language code, display text] |
139 | 139 | mtlLanguages: [ ['Arabic', 'ar', 'العربية'], |
| 140 | + ['Bangala', 'bn', 'বাংলা'], |
140 | 141 | ['Bulgarian', 'bg', 'български'], |
141 | 142 | ['Czech', 'cs', 'čeština'], |
142 | 143 | ['Danish', 'da', 'Dansk'], |
— | — | @@ -165,6 +166,7 @@ |
166 | 167 | ['Slovenian', 'sl', 'Slovenščina'], |
167 | 168 | ['Finnish', 'fi', 'Suomi'], |
168 | 169 | ['Swedish', 'sv', 'Svenska'], |
| 170 | + ['Tamil', 'ta', 'தமிழ்'], |
169 | 171 | ['Thai', 'th', 'ไทย'], |
170 | 172 | ['Turkish', 'tr', 'Türkçe'], |
171 | 173 | ['Ukrainian', 'uk', 'Українська'], |
— | — | @@ -736,8 +738,8 @@ |
737 | 739 | </div>', |
738 | 740 | |
739 | 741 | |
740 | | -scratchpadWindowHTML:'<div id="wbWrapperContextMenu" >\ |
741 | | -<table height="100%" border="0" cellspacing="0" cellpadding="0" id="scratchPadTable" class="wbTableBackground">\ |
| 742 | +scratchpadWindowHTML:'<div id="wbWrapperScratchPad" >\ |
| 743 | +<table height="100%" border="0" cellspacing="0" cellpadding="0" id="scratchPadTable" width="100%">\ |
742 | 744 | <tr>\ |
743 | 745 | <td class="wbWindowTopLeft"><img src="../images/trans.gif" width="4" height="4" alt="" /></td>\ |
744 | 746 | <td class="wbWindowTopCenter"><img src="../images/trans.gif" width="4" height="3" alt="" /></td>\ |
— | — | @@ -759,50 +761,36 @@ |
760 | 762 | <td class="wbWindowContentLeft"><img src="../images/trans.gif" width="3" height="3" alt="" /></td>\ |
761 | 763 | <td class="wbWindowContentCenter">\ |
762 | 764 | <div class="wbScratchPadSection">\ |
763 | | -<div class="wbScratchPadSectionContent">\ |
764 | | -<table border="0" cellspacing="0" cellpadding="0" class="wbAddAletnateTable">\ |
765 | | -<tr valign="top">\ |
766 | | -<td width="100%">\ |
767 | | -<textarea id="wbSourceText" rows="5" cols="25" tabindex="0" style="resize:none;">\ |
| 765 | +<form><div class="wbTranslatedAreaHead" id="wbHeaderRow"><div class="scratchTopLayout" id="wbScratchpadHeadLabelLeft"><h4>Source Text</h4></div>\ |
| 766 | +<div class="scratchTopButtonLayout"><div style="float:left;width:75px;display:none;text-align:center" id="wbTranslationLoading">\ |
| 767 | +<img src="../images/loading.gif" alt="Translating"/>\ |
| 768 | +</div></div>\ |
| 769 | +<div class="scratchTopLayout" id="wbScratchpadHeadLabelRight"><h4>Translated Text</h4></div><div class="scratchTopButtonLayout"> </div></div>\ |
| 770 | +<div><div class="scratchTopLayout">\ |
| 771 | +<textarea id="wbSourceText" rows="5" tabindex="0">\ |
768 | 772 | </textarea>\ |
769 | | -</td>\ |
770 | | -</tr>\ |
771 | | -<tr valign="top">\ |
772 | | -<td width="100%">\ |
| 773 | +</div><div class="scratchTopButtonLayout">\ |
| 774 | +<input id="wbSourceToTargetBtn" type="button" value=">>" /><br />\ |
| 775 | +<input id="wbTargetToSourceBtn" type="button" value="<<" />\ |
| 776 | +</div><div class="scratchTopLayout">\ |
| 777 | +<textarea id="wbTargetText" rows="5" tabindex="0">\ |
| 778 | +</textarea>\ |
| 779 | +</div>\ |
| 780 | +<div class="scratchTopButtonLayout">\ |
| 781 | +<input id="wbSaveScratchPadContentBtn" type="button" value="Save" tabindex="0"/><br/>\ |
| 782 | +<input type="reset" value="Reset" tabindex="0"/><br/>\ |
| 783 | +<input id="wbClearAllBtn" type="button" value="Clear All" tabindex="0" />\ |
| 784 | +</div>\ |
| 785 | +</div></form>\ |
773 | 786 | <div id="scratchPadLimitNoteHolder">\ |
774 | 787 | <span class="scratchPadLimitNotePrefix">Note: </span><span id="scratchPadLimitNoteText"></span>\ |
775 | 788 | </div>\ |
776 | | -</td>\ |
777 | | -</tr>\ |
778 | | -</table>\ |
779 | 789 | </div>\ |
780 | | -</div>\ |
781 | | -<div class="wbScratchPadSection">\ |
782 | | -<div>\ |
783 | | -<div>\ |
784 | | -<div style="float:left;padding-right:6px;"><input id="wbSourceToTargetBtn" type="button" value="English to German" class="wbTranslateButton" tabindex="0"/></div>\ |
785 | | -<div style="float:left;padding-right:6px;"><input id="wbTargetToSourceBtn" type="button" value="German to English" class="wbTranslateButton" tabindex="0"/></div>\ |
786 | | -<div style="float:left;padding-right:6px;"><input id="wbClearAllBtn" type="button" value="Clear All" class="wbClearButton" tabindex="0" /></div>\ |
787 | | -<div style="float:left;" id="wbTranslationLoading" class="wbLoadingDiv">\ |
788 | | -<img src="../images/loading.gif" alt="Translating"/>\ |
789 | | -</div>\ |
790 | | -</div>\ |
791 | | -</div>\ |
792 | | -</div>\ |
793 | 790 | <div class="wbScratchPadSectionContent">\ |
794 | | -<table width="100%" border="0" cellspacing="0" cellpadding="0" >\ |
795 | | -<tr valign="top"><td width="50%" ></td></tr>\ |
796 | | -</table>\ |
797 | | -<div id="wbTranslatedArea" style="height:155px; overflow-x: auto; overflow-y: auto;">\ |
798 | | -<table id="wbTargetTable" width="98%" border="0" cellspacing="0" cellpadding="0" style="margin-left:3px">\ |
799 | | -<tr id="wbHeaderRow" style="visibility:visible;height:3px" class="wbWindowToolbarCenter">\ |
800 | | -<td style="border-right:1px solid #dde1e3;width:45%"><h4 id="wbSourceTextHeader" style="text-align:center">Source Text</h4></td>\ |
801 | | -<td style="border-right:1px solid #dde1e3;width:45%"><h4 id="wbTranslatedTextHeader" style="text-align:center">Translated Text</h4></td>\ |
802 | | -<td style="width:10%"></td>\ |
803 | | -</tr>\ |
804 | | -</table>\ |
| 791 | +<div id="wbTranslatedArea" style="clear:both;overflow-x: auto; overflow-y: auto; height:150px">\ |
805 | 792 | </div>\ |
806 | 793 | </div>\ |
| 794 | +</div>\ |
807 | 795 | </td>\ |
808 | 796 | <td class="wbWindowContentRight"><img src="../images/trans.gif" width="3" height="3" alt="" /></td>\ |
809 | 797 | </tr>\ |
Index: trunk/extensions/WikiBhasha/src/js/core/utils.js |
— | — | @@ -136,6 +136,16 @@ |
137 | 137 | } else { |
138 | 138 | return false; |
139 | 139 | } |
| 140 | + }, |
| 141 | + |
| 142 | + //remove html tags from the target object content |
| 143 | + stripTags: function (htmlContent) { |
| 144 | + $("body").append("<div id='tmpData'></div>"); |
| 145 | + $('#tmpData').hide(); |
| 146 | + $('#tmpData').html(htmlContent); |
| 147 | + var text = $('#tmpData').text(); |
| 148 | + $('#tmpData').remove(); |
| 149 | + return text |
140 | 150 | } |
141 | 151 | }; |
142 | 152 | |