Index: branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/WikiEditor.i18n.php |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | 'wikieditor' => 'Advanced wikitext editing interface', |
17 | 17 | 'wikieditor-desc' => 'Provides an extendable wikitext editing interface and many feature-providing modules', |
18 | 18 | 'wikieditor-wikitext-tab' => 'Wikitext', |
| 19 | + 'wikieditor-loading' => 'Loading', |
19 | 20 | ); |
20 | 21 | |
21 | 22 | /** Message documentation (Message documentation) |
— | — | @@ -26,6 +27,7 @@ |
27 | 28 | |
28 | 29 | I guess that 'feature-providing modules' means the same as 'modules providing features'.", |
29 | 30 | 'wikieditor-wikitext-tab' => 'Caption of the tab containing the edit box', |
| 31 | + 'wikieditor-loading' => 'Explanatory text for the temporary cover placed over the wikiediort while it\'s being assembled', |
30 | 32 | ); |
31 | 33 | |
32 | 34 | /** Afrikaans (Afrikaans) |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -16,18 +16,19 @@ |
17 | 17 | array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ), |
18 | 18 | array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ), |
19 | 19 | array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ), |
20 | | - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 46 ), |
| 20 | + array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 48 ), |
21 | 21 | array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 4 ), |
22 | 22 | ), |
23 | 23 | 'combined' => array( |
24 | | - array( 'src' => 'WikiEditor.combined.js', 'version' => 48 ), |
| 24 | + array( 'src' => 'WikiEditor.combined.js', 'version' => 50 ), |
25 | 25 | ), |
26 | 26 | 'minified' => array( |
27 | | - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 48 ), |
| 27 | + array( 'src' => 'WikiEditor.combined.min.js', 'version' => 50 ), |
28 | 28 | ), |
29 | 29 | ); |
30 | 30 | static $messages = array( |
31 | 31 | 'wikieditor-wikitext-tab', |
| 32 | + 'wikieditor-loading', |
32 | 33 | ); |
33 | 34 | static $modules = array( |
34 | 35 | 'global' => array( |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js |
— | — | @@ -1032,26 +1032,30 @@ |
1033 | 1033 | if ( $j( this ).val() == '' ) |
1034 | 1034 | $j( this ) |
1035 | 1035 | .addClass( 'wikieditor-toolbar-dialog-hint' ) |
1036 | | - .val( $j( this ).data( 'tooltip' ) ); |
| 1036 | + .val( $j( this ).data( 'tooltip' ) ) |
| 1037 | + .data( 'tooltip-mode', true ); |
1037 | 1038 | } ) |
1038 | 1039 | .focus( function() { |
1039 | 1040 | if( $j( this ).val() == $j( this ).data( 'tooltip' ) ) { |
1040 | 1041 | $j( this ) |
1041 | 1042 | .val( '' ) |
1042 | | - .removeClass( 'wikieditor-toolbar-dialog-hint' ); |
| 1043 | + .removeClass( 'wikieditor-toolbar-dialog-hint' ) |
| 1044 | + .data( 'tooltip-mode', false ); |
1043 | 1045 | } |
1044 | 1046 | }) |
1045 | 1047 | .bind( 'change', function() { |
1046 | 1048 | if ( $j( this ).val() != $j( this ).data( 'tooltip' ) ) { |
1047 | 1049 | $j( this ) |
1048 | | - .removeClass( 'wikieditor-toolbar-dialog-hint' ); |
| 1050 | + .removeClass( 'wikieditor-toolbar-dialog-hint' ) |
| 1051 | + .data( 'tooltip-mode', false ); |
1049 | 1052 | } |
1050 | 1053 | }) |
1051 | 1054 | .bind( 'blur', function() { |
1052 | 1055 | if ( $j( this ).val() == '' ) { |
1053 | 1056 | $j( this ) |
1054 | 1057 | .addClass( 'wikieditor-toolbar-dialog-hint' ) |
1055 | | - .val( $j( this ).data( 'tooltip' ) ); |
| 1058 | + .val( $j( this ).data( 'tooltip' ) ) |
| 1059 | + .data( 'tooltip-mode', true ); |
1056 | 1060 | } |
1057 | 1061 | }); |
1058 | 1062 | |
— | — | @@ -1209,9 +1213,9 @@ |
1210 | 1214 | var target = $j( '#wikieditor-toolbar-link-int-target' ).val(); |
1211 | 1215 | var text = $j( '#wikieditor-toolbar-link-int-text' ).val(); |
1212 | 1216 | // check if the tooltips were passed as target or text |
1213 | | - if ( target == $j( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) ) |
| 1217 | + if ( $j( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip-mode' ) ) |
1214 | 1218 | target = ""; |
1215 | | - if ( text == $j( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) ) |
| 1219 | + if ( $j( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip-mode' ) ) |
1216 | 1220 | text = ""; |
1217 | 1221 | var u = mw.usability; |
1218 | 1222 | if ( target == '' ) { |
— | — | @@ -1299,8 +1303,8 @@ |
1300 | 1304 | // Pre-fill the text fields based on the current selection |
1301 | 1305 | var selection = $j(this).data( 'context' ).$textarea.textSelection( 'getSelection' ); |
1302 | 1306 | $j( '#wikieditor-toolbar-link-int-target' ).focus(); |
1303 | | - // Hide any status indicators that may be visible |
1304 | | - $j( '#wikieditor-toolbar-link-int-target-status > div:visible').hide(); |
| 1307 | + // Trigger the change event, so the link status indicator is up to date |
| 1308 | + $j( '#wikieditor-toolbar-link-int-target' ).change(); |
1305 | 1309 | $j( '#wikieditor-toolbar-link-dialog' ).data( 'whitespace', [ '', '' ] ); |
1306 | 1310 | if ( selection != '' ) { |
1307 | 1311 | var target, text, type; |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | $j('#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext').click(function(){if($j('#wikieditor-toolbar-link-type-ext').is(':checked')) |
44 | 44 | updateWidget('external');if($j('#wikieditor-toolbar-link-type-int').is(':checked')) |
45 | 45 | updateExistence();});var u=mw.usability;$j(this).find('[rel]').each(function(){$j(this).text(u.getMsg($j(this).attr('rel')));});$j('#wikieditor-toolbar-link-int-target').data('tooltip',u.getMsg('wikieditor-toolbar-tool-link-int-target-tooltip'));$j('#wikieditor-toolbar-link-int-text').data('tooltip',u.getMsg('wikieditor-toolbar-tool-link-int-text-tooltip'));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').each(function(){var tooltip=u.getMsg($j(this).attr('id')+'-tooltip');if($j(this).val()=='') |
46 | | -$j(this).addClass('wikieditor-toolbar-dialog-hint').val($j(this).data('tooltip'));}).focus(function(){if($j(this).val()==$j(this).data('tooltip')){$j(this).val('').removeClass('wikieditor-toolbar-dialog-hint');}}).bind('change',function(){if($j(this).val()!=$j(this).data('tooltip')){$j(this).removeClass('wikieditor-toolbar-dialog-hint');}}).bind('blur',function(){if($j(this).val()==''){$j(this).addClass('wikieditor-toolbar-dialog-hint').val($j(this).data('tooltip'));}});$j('#wikieditor-toolbar-link-int-target').bind('change keydown paste cut',function(){setTimeout(function(){if(isExternalLink($j('#wikieditor-toolbar-link-int-target').val())) |
| 46 | +$j(this).addClass('wikieditor-toolbar-dialog-hint').val($j(this).data('tooltip')).data('tooltip-mode',true);}).focus(function(){if($j(this).val()==$j(this).data('tooltip')){$j(this).val('').removeClass('wikieditor-toolbar-dialog-hint').data('tooltip-mode',false);}}).bind('change',function(){if($j(this).val()!=$j(this).data('tooltip')){$j(this).removeClass('wikieditor-toolbar-dialog-hint').data('tooltip-mode',false);}}).bind('blur',function(){if($j(this).val()==''){$j(this).addClass('wikieditor-toolbar-dialog-hint').val($j(this).data('tooltip')).data('tooltip-mode',true);}});$j('#wikieditor-toolbar-link-int-target').bind('change keydown paste cut',function(){setTimeout(function(){if(isExternalLink($j('#wikieditor-toolbar-link-int-target').val())) |
47 | 47 | $j('#wikieditor-toolbar-link-type-ext').attr('checked','checked');else |
48 | 48 | $j('#wikieditor-toolbar-link-type-int').attr('checked','checked');if($j('#wikieditor-toolbar-link-int-text').data('untouched')) |
49 | 49 | if($j('#wikieditor-toolbar-link-int-target').val()==$j('#wikieditor-toolbar-link-int-target').data('tooltip')){$j('#wikieditor-toolbar-link-int-text').addClass('wikieditor-toolbar-dialog-hint').val($j('#wikieditor-toolbar-link-int-text').data('tooltip')).change();}else{$j('#wikieditor-toolbar-link-int-text').val($j('#wikieditor-toolbar-link-int-target').val()).change();}},0);});$j('#wikieditor-toolbar-link-int-text').bind('change keydown paste cut',function(){var oldVal=$j(this).val();var that=this;setTimeout(function(){if($j(that).val()!=oldVal) |
— | — | @@ -54,8 +54,8 @@ |
55 | 55 | request.abort();}});},dialog:{width:500,dialogClass:'wikiEditor-toolbar-dialog',buttons:{'wikieditor-toolbar-tool-link-insert':function(){function escapeInternalText(s){return s.replace(/(]{2,})/g,'<nowiki>$1</nowiki>');} |
56 | 56 | function escapeExternalTarget(s){return s.replace(/ /g,'%20').replace(/\[/g,'%5B').replace(/]/g,'%5D');} |
57 | 57 | function escapeExternalText(s){return s.replace(/(]+)/g,'<nowiki>$1</nowiki>');} |
58 | | -var insertText='';var whitespace=$j('#wikieditor-toolbar-link-dialog').data('whitespace');var target=$j('#wikieditor-toolbar-link-int-target').val();var text=$j('#wikieditor-toolbar-link-int-text').val();if(target==$j('#wikieditor-toolbar-link-int-target').data('tooltip')) |
59 | | -target="";if(text==$j('#wikieditor-toolbar-link-int-text').data('tooltip')) |
| 58 | +var insertText='';var whitespace=$j('#wikieditor-toolbar-link-dialog').data('whitespace');var target=$j('#wikieditor-toolbar-link-int-target').val();var text=$j('#wikieditor-toolbar-link-int-text').val();if($j('#wikieditor-toolbar-link-int-target').data('tooltip-mode')) |
| 59 | +target="";if($j('#wikieditor-toolbar-link-int-text').data('tooltip-mode')) |
60 | 60 | text="";var u=mw.usability;if(target==''){alert(u.getMsg('wikieditor-toolbar-tool-link-empty'));return;} |
61 | 61 | if($j.trim(text)==''){text='';} |
62 | 62 | if($j('#wikieditor-toolbar-link-type-int').is(':checked')){if($j('#wikieditor-toolbar-link-int-target-status-invalid').is(':visible')){alert(u.getMsg('wikieditor-toolbar-tool-link-int-invalid'));return;} |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | insertText=escTarget;else if(text=='') |
69 | 69 | insertText='['+escTarget+']';else |
70 | 70 | insertText='['+escTarget+' '+escText+']';} |
71 | | -if(whitespace)insertText=whitespace[0]+insertText+whitespace[1];$j.wikiEditor.modules.toolbar.fn.doAction($j(this).data('context'),{type:'replace',options:{pre:insertText}},$j(this));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').val('');$j('#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext').attr('checked','');$j(this).dialog('close');},'wikieditor-toolbar-tool-link-cancel':function(){$j(this).dialog('close');}},open:function(){$j(this).data('articlePathRegex',new RegExp('^'+RegExp.escape(wgServer+wgArticlePath).replace(/\\\$1/g,'(.*)')+'$'));var selection=$j(this).data('context').$textarea.textSelection('getSelection');$j('#wikieditor-toolbar-link-int-target').focus();$j('#wikieditor-toolbar-link-int-target-status > div:visible').hide();$j('#wikieditor-toolbar-link-dialog').data('whitespace',['','']);if(selection!=''){var target,text,type;var matches;if((matches=selection.match(/^(\s*)\[\[([^\]\|]+)(\|([^\]\|]*))?\]\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:matches[2]);type='int';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else if((matches=selection.match(/^(\s*)\[([^\] ]+)( ([^\]]+))?\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:'');type='ext';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else{target=text=selection;} |
| 71 | +if(whitespace)insertText=whitespace[0]+insertText+whitespace[1];$j.wikiEditor.modules.toolbar.fn.doAction($j(this).data('context'),{type:'replace',options:{pre:insertText}},$j(this));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').val('');$j('#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext').attr('checked','');$j(this).dialog('close');},'wikieditor-toolbar-tool-link-cancel':function(){$j(this).dialog('close');}},open:function(){$j(this).data('articlePathRegex',new RegExp('^'+RegExp.escape(wgServer+wgArticlePath).replace(/\\\$1/g,'(.*)')+'$'));var selection=$j(this).data('context').$textarea.textSelection('getSelection');$j('#wikieditor-toolbar-link-int-target').focus();$j('#wikieditor-toolbar-link-int-target').change();$j('#wikieditor-toolbar-link-dialog').data('whitespace',['','']);if(selection!=''){var target,text,type;var matches;if((matches=selection.match(/^(\s*)\[\[([^\]\|]+)(\|([^\]\|]*))?\]\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:matches[2]);type='int';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else if((matches=selection.match(/^(\s*)\[([^\] ]+)( ([^\]]+))?\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:'');type='ext';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else{target=text=selection;} |
72 | 72 | if(typeof text!='undefined') |
73 | 73 | $j('#wikieditor-toolbar-link-int-text').val(text).change();if(typeof target!='undefined') |
74 | 74 | $j('#wikieditor-toolbar-link-int-target').val(target).change();if(typeof type!='undefined') |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.i18n.php |
— | — | @@ -2430,7 +2430,7 @@ |
2431 | 2431 | 'wikieditor-toolbar-tool-link-title' => 'Mewnosod cyswllt', |
2432 | 2432 | 'wikieditor-toolbar-tool-link-int' => 'At dudalen wici', |
2433 | 2433 | 'wikieditor-toolbar-tool-link-int-target' => 'Teitl y dudalen:', |
2434 | | - 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Gosodwch deitl y dudalen', |
| 2434 | + 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Teitl y dudalen neu ei URL', |
2435 | 2435 | 'wikieditor-toolbar-tool-link-int-text' => 'Testun y cyswllt:', |
2436 | 2436 | 'wikieditor-toolbar-tool-link-int-text-tooltip' => "Gosodwch yr ysgrifen a fydd i'w weld", |
2437 | 2437 | 'wikieditor-toolbar-tool-link-ext' => 'At dudalen we allanol', |
— | — | @@ -6319,7 +6319,7 @@ |
6320 | 6320 | 'wikieditor-toolbar-tool-link-title' => 'Ավելացնել հղում', |
6321 | 6321 | 'wikieditor-toolbar-tool-link-int' => 'Վիքիի էջին', |
6322 | 6322 | 'wikieditor-toolbar-tool-link-int-target' => 'Էջի վերնագիր․', |
6323 | | - 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Ներմուծեք էջի վերնագիրը', |
| 6323 | + 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Էջի վերնագիր կամ URL', |
6324 | 6324 | 'wikieditor-toolbar-tool-link-int-text' => 'Հղման տեսքստ․', |
6325 | 6325 | 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'Ներմուծեք տեքստը, որ պետք է ցուցադրվի', |
6326 | 6326 | 'wikieditor-toolbar-tool-link-ext' => 'Արտաքին վեբ էջին', |
— | — | @@ -6424,6 +6424,8 @@ |
6425 | 6425 | 'wikieditor-toolbar-characters-page-arabic' => 'Արաբերեն', |
6426 | 6426 | 'wikieditor-toolbar-characters-page-hebrew' => 'Եբրայերեն', |
6427 | 6427 | 'wikieditor-toolbar-characters-page-telugu' => 'Տելուգու', |
| 6428 | + 'wikieditor-toolbar-characters-page-sinhala' => 'Սինհալերեն', |
| 6429 | + 'wikieditor-toolbar-characters-page-gujarati' => 'Գուջարատի', |
6428 | 6430 | 'wikieditor-toolbar-section-help' => 'Օգնություն', |
6429 | 6431 | 'wikieditor-toolbar-help-heading-description' => 'Նկարագրություն', |
6430 | 6432 | 'wikieditor-toolbar-help-heading-syntax' => 'Ինչ եք հավաքում', |
— | — | @@ -10273,7 +10275,7 @@ |
10274 | 10276 | 'wikieditor-toolbar-tool-link-title' => 'Wstaw link', |
10275 | 10277 | 'wikieditor-toolbar-tool-link-int' => 'Do strony wiki', |
10276 | 10278 | 'wikieditor-toolbar-tool-link-int-target' => 'Tytuł strony –', |
10277 | | - 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Wpisz tytuł strony', |
| 10279 | + 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Tytuł lub adres URL strony', |
10278 | 10280 | 'wikieditor-toolbar-tool-link-int-text' => 'Tekst linku', |
10279 | 10281 | 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'Wprowadź tekst, który powinien być wyświetlany', |
10280 | 10282 | 'wikieditor-toolbar-tool-link-ext' => 'Do zewnętrznej strony internetowej', |
— | — | @@ -12850,6 +12852,7 @@ |
12851 | 12853 | */ |
12852 | 12854 | $messages['sw'] = array( |
12853 | 12855 | 'wikieditor-toolbar' => 'Mwambaa zana wa kuhariri', |
| 12856 | + 'wikieditor-toolbar-preference' => 'Tumia mwambaa zana wa kuhariri uliozidishwa', |
12854 | 12857 | 'wikieditor-toolbar-loading' => 'Inapakizwa...', |
12855 | 12858 | 'wikieditor-toolbar-tool-bold' => 'Koze', |
12856 | 12859 | 'wikieditor-toolbar-tool-bold-example' => 'Maandishi ya kooze', |
— | — | @@ -12863,7 +12866,7 @@ |
12864 | 12867 | 'wikieditor-toolbar-tool-link-title' => 'Kuweka kiungo', |
12865 | 12868 | 'wikieditor-toolbar-tool-link-int' => 'Kwa ukurasa mwingine wa wiki', |
12866 | 12869 | 'wikieditor-toolbar-tool-link-int-target' => 'Jina la ukurasa:', |
12867 | | - 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Andika jina la ukurasa', |
| 12870 | + 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Andika jina la ukurasa au URL', |
12868 | 12871 | 'wikieditor-toolbar-tool-link-int-text' => 'Maandishi ya kiungo:', |
12869 | 12872 | 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'Andika maandishi yatakayoonekana', |
12870 | 12873 | 'wikieditor-toolbar-tool-link-ext' => 'Kwa gombo wavu la nje', |
— | — | @@ -12879,6 +12882,8 @@ |
12880 | 12883 | 'wikieditor-toolbar-tool-link-int-invalid' => 'Jina la ukurasa uliloliandika ni batili.', |
12881 | 12884 | 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Kiungo cha ndani', |
12882 | 12885 | 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Kiungo cha nje', |
| 12886 | + 'wikieditor-toolbar-tool-link-empty' => 'Hukuandika kitu cha kuunganisha naye.', |
| 12887 | + 'wikieditor-toolbar-tool-file' => 'Faili futike', |
12883 | 12888 | 'wikieditor-toolbar-tool-file-example' => 'Mfano.jpg', |
12884 | 12889 | 'wikieditor-toolbar-tool-reference' => 'Tiniwayo', |
12885 | 12890 | 'wikieditor-toolbar-tool-reference-example' => 'Weka maneno ya tiniwayo hapa', |
— | — | @@ -12892,6 +12897,10 @@ |
12893 | 12898 | 'wikieditor-toolbar-tool-heading-5' => 'Kiwango cha 5', |
12894 | 12899 | 'wikieditor-toolbar-tool-heading-example' => 'Maandishi ya kichwa', |
12895 | 12900 | 'wikieditor-toolbar-group-list' => 'Orodha', |
| 12901 | + 'wikieditor-toolbar-tool-ulist' => 'Orodha zenye alama', |
| 12902 | + 'wikieditor-toolbar-tool-ulist-example' => 'Aya ya orodha zenye alama', |
| 12903 | + 'wikieditor-toolbar-tool-olist' => 'Orodha zenye namba', |
| 12904 | + 'wikieditor-toolbar-tool-olist-example' => 'Aya ya orodha zenye namba', |
12896 | 12905 | 'wikieditor-toolbar-tool-indent' => 'Kijongezo', |
12897 | 12906 | 'wikieditor-toolbar-tool-indent-example' => 'Mstari uliojongezwa ndani', |
12898 | 12907 | 'wikieditor-toolbar-group-size' => 'Ukubwa', |
— | — | @@ -12904,19 +12913,36 @@ |
12905 | 12914 | 'wikieditor-toolbar-tool-subscript' => 'Herufi za chini', |
12906 | 12915 | 'wikieditor-toolbar-tool-subscript-example' => 'Maandishi ya chini', |
12907 | 12916 | 'wikieditor-toolbar-group-insert' => 'Kuweka', |
| 12917 | + 'wikieditor-toolbar-tool-gallery' => 'Mkusanyiko wa picha', |
12908 | 12918 | 'wikieditor-toolbar-tool-newline' => 'Mstari mpya', |
12909 | 12919 | 'wikieditor-toolbar-tool-table' => 'Jedwali', |
| 12920 | + 'wikieditor-toolbar-tool-table-example-old' => '- |
| 12921 | +! kichwa 1 |
| 12922 | +! kichwa 2 |
| 12923 | +! kichwa 3 |
| 12924 | +|- |
| 12925 | +| mstari 1, kisanduku 1 |
| 12926 | +| mstari 1, kisanduku 2 |
| 12927 | +| mstari 1, kisanduku 3 |
| 12928 | +|- |
| 12929 | +| mstari 2, kisanduku 1 |
| 12930 | +| mstari 2, kisanduku 2 |
| 12931 | +| mstari 2, kisanduku 3', |
| 12932 | + 'wikieditor-toolbar-tool-table-example-cell-text' => 'Maandishi ya kisanduku jedwali', |
12910 | 12933 | 'wikieditor-toolbar-tool-table-example-header' => 'Maandiko ya kichwa', |
12911 | 12934 | 'wikieditor-toolbar-tool-table-title' => 'Weka jedwali', |
12912 | 12935 | 'wikieditor-toolbar-tool-table-dimensions-rows' => 'Mistari', |
12913 | 12936 | 'wikieditor-toolbar-tool-table-dimensions-columns' => 'Safu', |
12914 | 12937 | 'wikieditor-toolbar-tool-table-dimensions-header' => 'Weka mstari wa vichwa', |
12915 | | - 'wikieditor-toolbar-tool-table-wikitable' => 'Mtindo unaochora mipaka', |
12916 | | - 'wikieditor-toolbar-tool-table-sortable' => 'Uwezeshe jedwali ipangishwe', |
| 12938 | + 'wikieditor-toolbar-tool-table-wikitable' => 'Mtindo wenye mipaka', |
| 12939 | + 'wikieditor-toolbar-tool-table-sortable' => 'Tengeneza jedwali linalopangika', |
12917 | 12940 | 'wikieditor-toolbar-tool-table-example' => 'Mfano', |
12918 | 12941 | 'wikieditor-toolbar-tool-table-preview' => 'Hakiki', |
12919 | 12942 | 'wikieditor-toolbar-tool-table-insert' => 'Weka', |
12920 | 12943 | 'wikieditor-toolbar-tool-table-cancel' => 'Batilisha', |
| 12944 | + 'wikieditor-toolbar-tool-table-toomany' => 'Huwezi kutengeneza jedwali yenye visanduku zaidi na $1 kwa kutumia zana hii.', |
| 12945 | + 'wikieditor-toolbar-tool-table-invalidnumber' => 'You have not entered a valid number of rows or columns. |
| 12946 | +Idadi ya mistari au ya safu si halali.', |
12921 | 12947 | 'wikieditor-toolbar-tool-table-zero' => 'Huwezi kuweka jedwali ambalo halina mistari wala safu zozote.', |
12922 | 12948 | 'wikieditor-toolbar-tool-replace' => 'Kutafuta na kubadilisha maandishi', |
12923 | 12949 | 'wikieditor-toolbar-tool-replace-title' => 'Kutafuta na kubadilisha maandishi', |
— | — | @@ -12944,6 +12970,7 @@ |
12945 | 12971 | 'wikieditor-toolbar-help-heading-description' => 'Elezo', |
12946 | 12972 | 'wikieditor-toolbar-help-heading-syntax' => 'Ukiandika haya', |
12947 | 12973 | 'wikieditor-toolbar-help-heading-result' => 'Utapata huu', |
| 12974 | + 'wikieditor-toolbar-help-page-format' => 'Kufomati', |
12948 | 12975 | 'wikieditor-toolbar-help-page-link' => 'Viungo', |
12949 | 12976 | 'wikieditor-toolbar-help-page-heading' => 'Vichwa', |
12950 | 12977 | 'wikieditor-toolbar-help-page-list' => 'Orodha', |
— | — | @@ -12956,8 +12983,14 @@ |
12957 | 12984 | 'wikieditor-toolbar-help-content-bold-description' => 'Koze', |
12958 | 12985 | 'wikieditor-toolbar-help-content-bold-syntax' => "'''Maandishi ya kooze'''", |
12959 | 12986 | 'wikieditor-toolbar-help-content-bold-result' => '<strong>Maandishi ya kooze</strong>', |
| 12987 | + 'wikieditor-toolbar-help-content-bolditalic-description' => 'Koze na italiki', |
| 12988 | + 'wikieditor-toolbar-help-content-bolditalic-syntax' => "'''''Maandishi ya koze na italiki'''''", |
| 12989 | + 'wikieditor-toolbar-help-content-bolditalic-result' => '<strong><em>Maandishi ya koze na italiki</em></strong>', |
12960 | 12990 | 'wikieditor-toolbar-help-content-ilink-description' => 'Kiungo cha ndani ya wiki', |
| 12991 | + 'wikieditor-toolbar-help-content-ilink-syntax' => '[[Jina la ukurasa|Maandishi ya kiungo]]<br />[[Jina la ukurasa]]', |
| 12992 | + 'wikieditor-toolbar-help-content-ilink-result' => "<a href='#'>Maandishi ya kiungo</a><br /><a href='#'>Jina la ukurasa</a>", |
12961 | 12993 | 'wikieditor-toolbar-help-content-xlink-description' => 'Kiungo cha nje', |
| 12994 | + 'wikieditor-toolbar-help-content-xlink-syntax' => '[http://www.example.org Maandishi ya kiungo]<br />[http://www.example.org]<br />http://www.example.org', |
12962 | 12995 | 'wikieditor-toolbar-help-content-heading1-description' => 'Kichwa cha kiwango cha 1', |
12963 | 12996 | 'wikieditor-toolbar-help-content-heading1-syntax' => '= Kichwa cha habari=', |
12964 | 12997 | 'wikieditor-toolbar-help-content-heading1-result' => '<h1>Kichwa cha habari</h1>', |
— | — | @@ -12973,8 +13006,15 @@ |
12974 | 13007 | 'wikieditor-toolbar-help-content-heading5-description' => 'Kichwa cha kiwango cha 5', |
12975 | 13008 | 'wikieditor-toolbar-help-content-heading5-syntax' => '===== Kichwa cha habari =====', |
12976 | 13009 | 'wikieditor-toolbar-help-content-heading5-result' => '<h5>Kichwa cha habari</h5>', |
| 13010 | + 'wikieditor-toolbar-help-content-ulist-description' => 'Orodha zenye alama', |
| 13011 | + 'wikieditor-toolbar-help-content-ulist-syntax' => '* Aya<br />* Aya', |
| 13012 | + 'wikieditor-toolbar-help-content-ulist-result' => '<ul><li>Aya</li><li>Aya</li></ul>', |
| 13013 | + 'wikieditor-toolbar-help-content-olist-description' => 'Orodha zenye namba', |
| 13014 | + 'wikieditor-toolbar-help-content-olist-syntax' => '# Aya<br /># Aya', |
| 13015 | + 'wikieditor-toolbar-help-content-olist-result' => '<ol><li>Aya</li><li>Aya</li></ol>', |
12977 | 13016 | 'wikieditor-toolbar-help-content-file-description' => 'Faili futike', |
12978 | 13017 | 'wikieditor-toolbar-help-content-reference-description' => 'Tiniwayo', |
| 13018 | + 'wikieditor-toolbar-help-content-reference-syntax' => 'Maandishi ya ukurasa.<ref name="mfano">[http://www.example.org Maandishi ya kiungo], maandishi mengine.</ref>', |
12979 | 13019 | 'wikieditor-toolbar-help-content-reference-result' => "Maandiko.<sup><a href='#'>[1]</a></sup>", |
12980 | 13020 | 'wikieditor-toolbar-help-content-rereference-result' => "Maandiko.<sup><a href='#'>[1]</a></sup>", |
12981 | 13021 | 'wikieditor-toolbar-help-content-showreferences-description' => 'Onyesha tiniwayo', |
— | — | @@ -14784,7 +14824,7 @@ |
14785 | 14825 | 'wikieditor-toolbar-tool-link-title' => '插入链接', |
14786 | 14826 | 'wikieditor-toolbar-tool-link-int' => '链往wiki页面', |
14787 | 14827 | 'wikieditor-toolbar-tool-link-int-target' => '目标页面或网址:', |
14788 | | - 'wikieditor-toolbar-tool-link-int-target-tooltip' => '输入页面标题', |
| 14828 | + 'wikieditor-toolbar-tool-link-int-target-tooltip' => '页面标题或URL', |
14789 | 14829 | 'wikieditor-toolbar-tool-link-int-text' => '显示文本:', |
14790 | 14830 | 'wikieditor-toolbar-tool-link-int-text-tooltip' => '输入应该显示的文字', |
14791 | 14831 | 'wikieditor-toolbar-tool-link-ext' => '链往外部网页', |
— | — | @@ -14942,7 +14982,7 @@ |
14943 | 14983 | 'wikieditor-toolbar-help-content-file-syntax' => '[[{{ns:file}}:Example.png|thumb|标题文本]]', |
14944 | 14984 | 'wikieditor-toolbar-help-content-file-result' => "<div style='width:104px;' class='thumbinner'><a title='标题文本' class='image' href='#'><img height='50' width='100' border='0' class='thumbimage' src='extensions/UsabilityInitiative/images/wikiEditor/toolbar/example-image.png' alt=''/></a><div class='thumbcaption'><div class='magnify'><a title='放大' class='internal' href='#'><img height='11' width='15' alt='' src='$1/common/images/magnify-clip.png'/></a></div>标题文本</div></div>", |
14945 | 14985 | 'wikieditor-toolbar-help-content-reference-description' => '参考', |
14946 | | - 'wikieditor-toolbar-help-content-reference-syntax' => '页面文本。<ref name="test">[http://www.example.org 链接文本],附加文本。</ref>', |
| 14986 | + 'wikieditor-toolbar-help-content-reference-syntax' => '页面文本。<ref name="测试">[http://www.example.org 链接文本],附加文本。</ref>', |
14947 | 14987 | 'wikieditor-toolbar-help-content-reference-result' => "页面文本。<sup><a href='#'>[1]</a></sup>", |
14948 | 14988 | 'wikieditor-toolbar-help-content-rereference-description' => '同项参考', |
14949 | 14989 | 'wikieditor-toolbar-help-content-rereference-syntax' => '<ref name="测试" />', |
— | — | @@ -14982,7 +15022,7 @@ |
14983 | 15023 | 'wikieditor-toolbar-tool-link-title' => '插入鏈接', |
14984 | 15024 | 'wikieditor-toolbar-tool-link-int' => '鏈往wiki頁面', |
14985 | 15025 | 'wikieditor-toolbar-tool-link-int-target' => '目標頁面或網址:', |
14986 | | - 'wikieditor-toolbar-tool-link-int-target-tooltip' => '輸入頁面標題', |
| 15026 | + 'wikieditor-toolbar-tool-link-int-target-tooltip' => '頁面標題或URL', |
14987 | 15027 | 'wikieditor-toolbar-tool-link-int-text' => '顯示文本:', |
14988 | 15028 | 'wikieditor-toolbar-tool-link-int-text-tooltip' => '輸入應該顯示的文字', |
14989 | 15029 | 'wikieditor-toolbar-tool-link-ext' => '鏈往外部網頁', |
— | — | @@ -15162,7 +15202,7 @@ |
15163 | 15203 | 'wikieditor-toolbar-help-content-file-syntax' => '[[{{ns:file}}:Example.png|thumb|標題文字]]', |
15164 | 15204 | 'wikieditor-toolbar-help-content-file-result' => "<div style='width:104px;' class='thumbinner'><a title='標題文字' class='image' href='#'><img height='50' width='100' border='0' class='thumbimage' src='extensions/UsabilityInitiative/images/wikiEditor/toolbar/example-image.png' alt=''/></a><div class='thumbcaption'><div class='magnify'><a title='放大' class='internal' href='#'><img height='11' width='15' alt='' src='$1/common/images/magnify-clip.png'/></a></div>標題文字</div></div>", |
15165 | 15205 | 'wikieditor-toolbar-help-content-reference-description' => '參考', |
15166 | | - 'wikieditor-toolbar-help-content-reference-syntax' => '頁面文字。<ref name="test">[http://www.example.org 連結文字],附加文字。</ref>', |
| 15206 | + 'wikieditor-toolbar-help-content-reference-syntax' => '頁面文字。<ref name="測試">[http://www.example.org 連結文字],附加文字。</ref>', |
15167 | 15207 | 'wikieditor-toolbar-help-content-reference-result' => "頁面文字。<sup><a href='#'>[1]</a></sup>", |
15168 | 15208 | 'wikieditor-toolbar-help-content-rereference-description' => '同參考附加用途', |
15169 | 15209 | 'wikieditor-toolbar-help-content-rereference-syntax' => '<ref name="測試" />', |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js |
— | — | @@ -983,26 +983,30 @@ |
984 | 984 | if ( $j( this ).val() == '' ) |
985 | 985 | $j( this ) |
986 | 986 | .addClass( 'wikieditor-toolbar-dialog-hint' ) |
987 | | - .val( $j( this ).data( 'tooltip' ) ); |
| 987 | + .val( $j( this ).data( 'tooltip' ) ) |
| 988 | + .data( 'tooltip-mode', true ); |
988 | 989 | } ) |
989 | 990 | .focus( function() { |
990 | 991 | if( $j( this ).val() == $j( this ).data( 'tooltip' ) ) { |
991 | 992 | $j( this ) |
992 | 993 | .val( '' ) |
993 | | - .removeClass( 'wikieditor-toolbar-dialog-hint' ); |
| 994 | + .removeClass( 'wikieditor-toolbar-dialog-hint' ) |
| 995 | + .data( 'tooltip-mode', false ); |
994 | 996 | } |
995 | 997 | }) |
996 | 998 | .bind( 'change', function() { |
997 | 999 | if ( $j( this ).val() != $j( this ).data( 'tooltip' ) ) { |
998 | 1000 | $j( this ) |
999 | | - .removeClass( 'wikieditor-toolbar-dialog-hint' ); |
| 1001 | + .removeClass( 'wikieditor-toolbar-dialog-hint' ) |
| 1002 | + .data( 'tooltip-mode', false ); |
1000 | 1003 | } |
1001 | 1004 | }) |
1002 | 1005 | .bind( 'blur', function() { |
1003 | 1006 | if ( $j( this ).val() == '' ) { |
1004 | 1007 | $j( this ) |
1005 | 1008 | .addClass( 'wikieditor-toolbar-dialog-hint' ) |
1006 | | - .val( $j( this ).data( 'tooltip' ) ); |
| 1009 | + .val( $j( this ).data( 'tooltip' ) ) |
| 1010 | + .data( 'tooltip-mode', true ); |
1007 | 1011 | } |
1008 | 1012 | }); |
1009 | 1013 | |
— | — | @@ -1160,9 +1164,9 @@ |
1161 | 1165 | var target = $j( '#wikieditor-toolbar-link-int-target' ).val(); |
1162 | 1166 | var text = $j( '#wikieditor-toolbar-link-int-text' ).val(); |
1163 | 1167 | // check if the tooltips were passed as target or text |
1164 | | - if ( target == $j( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) ) |
| 1168 | + if ( $j( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip-mode' ) ) |
1165 | 1169 | target = ""; |
1166 | | - if ( text == $j( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) ) |
| 1170 | + if ( $j( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip-mode' ) ) |
1167 | 1171 | text = ""; |
1168 | 1172 | var u = mw.usability; |
1169 | 1173 | if ( target == '' ) { |
— | — | @@ -1250,8 +1254,8 @@ |
1251 | 1255 | // Pre-fill the text fields based on the current selection |
1252 | 1256 | var selection = $j(this).data( 'context' ).$textarea.textSelection( 'getSelection' ); |
1253 | 1257 | $j( '#wikieditor-toolbar-link-int-target' ).focus(); |
1254 | | - // Hide any status indicators that may be visible |
1255 | | - $j( '#wikieditor-toolbar-link-int-target-status > div:visible').hide(); |
| 1258 | + // Trigger the change event, so the link status indicator is up to date |
| 1259 | + $j( '#wikieditor-toolbar-link-int-target' ).change(); |
1256 | 1260 | $j( '#wikieditor-toolbar-link-dialog' ).data( 'whitespace', [ '', '' ] ); |
1257 | 1261 | if ( selection != '' ) { |
1258 | 1262 | var target, text, type; |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/Modules/Toc/Toc.i18n.php |
— | — | @@ -135,8 +135,8 @@ |
136 | 136 | */ |
137 | 137 | $messages['de'] = array( |
138 | 138 | 'wikieditor-toc-preference' => 'Inhaltsverzeichnis im Bearbeiten-Fenster aktivieren', |
139 | | - 'wikieditor-toc-show' => 'Inhalte anzeigen', |
140 | | - 'wikieditor-toc-hide' => 'Inhalte verbergen', |
| 139 | + 'wikieditor-toc-show' => 'Inhaltsverzeichnis einblenden', |
| 140 | + 'wikieditor-toc-hide' => 'Inhaltsverzeichnis ausblenden', |
141 | 141 | ); |
142 | 142 | |
143 | 143 | /** Zazaki (Zazaki) |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -6738,7 +6738,7 @@ |
6739 | 6739 | */ |
6740 | 6740 | // Intercept all tab events to provide consisten behavior across browsers |
6741 | 6741 | // Webkit browsers insert tab characters by default into the iframe rather than changing input focus |
6742 | | - case 9: |
| 6742 | + case 9: //tab |
6743 | 6743 | // if any modifier keys are pressed, allow the browser to do it's thing |
6744 | 6744 | if ( event.ctrlKey || event.altKey || event.shiftKey ) { |
6745 | 6745 | return true; |
— | — | @@ -6755,8 +6755,15 @@ |
6756 | 6756 | return false; |
6757 | 6757 | } |
6758 | 6758 | break; |
| 6759 | + case 86: //v |
| 6760 | + if ( event.ctrlKey ){ |
| 6761 | + //paste, intercepted for IE |
| 6762 | + context.evt.paste( event ); |
| 6763 | + } |
| 6764 | + break; |
6759 | 6765 | } |
6760 | 6766 | return true; |
| 6767 | + |
6761 | 6768 | }, |
6762 | 6769 | 'change': function( event ) { |
6763 | 6770 | event.data.scope = 'division'; |
— | — | @@ -6794,6 +6801,29 @@ |
6795 | 6802 | } |
6796 | 6803 | } |
6797 | 6804 | return true; |
| 6805 | + }, |
| 6806 | + 'paste': function( event ) { |
| 6807 | + context.$content.find( ':not(.wikiEditor)' ).addClass( 'wikiEditor' ); |
| 6808 | + setTimeout( function() { |
| 6809 | + var $selection = context.$content.find( ':not(.wikiEditor)' ); |
| 6810 | + while ( $selection.length && $selection.length > 0 ) { |
| 6811 | + var $currentElement = $selection.eq( 0 ); |
| 6812 | + while ( !$currentElement.parent().is( 'body' ) && !$currentElement.parent().is( '.wikiEditor' ) ) { |
| 6813 | + $currentElement = $currentElement.parent(); |
| 6814 | + } |
| 6815 | + if ( $currentElement.is( 'br' ) ) { |
| 6816 | + $currentElement.addClass( 'wikiEditor' ); |
| 6817 | + } else { |
| 6818 | + $( '<p></p>' ) |
| 6819 | + .text( $currentElement.text() ) |
| 6820 | + .addClass( 'wikiEditor' ) |
| 6821 | + .insertAfter( $currentElement ); |
| 6822 | + $currentElement.remove(); |
| 6823 | + } |
| 6824 | + $selection = context.$content.find( ':not(.wikiEditor)' ); |
| 6825 | + } |
| 6826 | + }, 0 ); |
| 6827 | + return true; |
6798 | 6828 | } |
6799 | 6829 | }; |
6800 | 6830 | |
— | — | @@ -6858,6 +6888,10 @@ |
6859 | 6889 | .addClass( context.view == options.name ? 'current' : null ) |
6860 | 6890 | .append( $( '<a></a>' ) |
6861 | 6891 | .attr( 'href', '#' ) |
| 6892 | + .mousedown( function() { |
| 6893 | + // No dragging! |
| 6894 | + return false; |
| 6895 | + } ) |
6862 | 6896 | .click( function( event ) { |
6863 | 6897 | context.$ui.find( '.wikiEditor-ui-view' ).hide(); |
6864 | 6898 | context.$ui.find( '.' + $(this).parent().attr( 'rel' ) ).show(); |
— | — | @@ -6916,30 +6950,30 @@ |
6917 | 6951 | // Converting <p>s is wrong if there's nothing before them, so check that. |
6918 | 6952 | // .find( '* + p' ) isn't good enough because textnodes aren't considered |
6919 | 6953 | $pre.find( 'p' ).each( function() { |
6920 | | - var text = $( this ).text(); |
6921 | | - // If this <p> is preceded by some text, add a \n at the beginning, and if |
6922 | | - // it's followed by a textnode, add a \n at the end |
6923 | | - // We need the traverser because there can be other weird stuff in between |
6924 | | - |
6925 | | - // Check for preceding text |
6926 | | - var t = new context.fn.rawTraverser( this.firstChild, 0, this, $pre.get( 0 ) ).prev(); |
6927 | | - while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { |
6928 | | - t = t.prev(); |
6929 | | - } |
6930 | | - if ( t ) { |
6931 | | - text = "\n" + text; |
6932 | | - } |
6933 | | - |
6934 | | - // Check for following text |
6935 | | - t = new context.fn.rawTraverser( this.lastChild, 0, this, $pre.get( 0 ) ).next(); |
6936 | | - while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { |
6937 | | - t = t.next(); |
6938 | | - } |
6939 | | - if ( t && !t.inP && t.node.nodeName == '#text' && t.node.nodeValue.charAt( 0 ) != '\n' |
6940 | | - && t.node.nodeValue.charAt( 0 ) != '\r' ) { |
6941 | | - text += "\n"; |
6942 | | - } |
6943 | | - $( this ).text( text ); |
| 6954 | + var text = $( this ).text(); |
| 6955 | + // If this <p> is preceded by some text, add a \n at the beginning, and if |
| 6956 | + // it's followed by a textnode, add a \n at the end |
| 6957 | + // We need the traverser because there can be other weird stuff in between |
| 6958 | + |
| 6959 | + // Check for preceding text |
| 6960 | + var t = new context.fn.rawTraverser( this.firstChild, 0, this, $pre.get( 0 ) ).prev(); |
| 6961 | + while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { |
| 6962 | + t = t.prev(); |
| 6963 | + } |
| 6964 | + if ( t ) { |
| 6965 | + text = "\n" + text; |
| 6966 | + } |
| 6967 | + |
| 6968 | + // Check for following text |
| 6969 | + t = new context.fn.rawTraverser( this.lastChild, 0, this, $pre.get( 0 ) ).next(); |
| 6970 | + while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { |
| 6971 | + t = t.next(); |
| 6972 | + } |
| 6973 | + if ( t && !t.inP && t.node.nodeName == '#text' && t.node.nodeValue.charAt( 0 ) != '\n' |
| 6974 | + && t.node.nodeValue.charAt( 0 ) != '\r' ) { |
| 6975 | + text += "\n"; |
| 6976 | + } |
| 6977 | + $( this ).text( text ); |
6944 | 6978 | } ); |
6945 | 6979 | var retval; |
6946 | 6980 | if ( $.browser.msie ) { |
— | — | @@ -7023,6 +7057,7 @@ |
7024 | 7058 | var selText = $(this).textSelection( 'getSelection' ); |
7025 | 7059 | var selTextArr; |
7026 | 7060 | var selectAfter = false; |
| 7061 | + var setSelectionTo = null; |
7027 | 7062 | var pre = options.pre, post = options.post; |
7028 | 7063 | if ( !selText ) { |
7029 | 7064 | selText = options.peri; |
— | — | @@ -7092,16 +7127,57 @@ |
7093 | 7128 | range.extractContents(); |
7094 | 7129 | // Insert the contents one line at a time - insertNode() inserts at the beginning, so this has to happen |
7095 | 7130 | // in reverse order |
7096 | | - var lastNode; |
| 7131 | + // Track the first and last inserted node, and if we need to also track where the text we need to select |
| 7132 | + // afterwards starts and ends |
| 7133 | + var firstNode = null, lastNode = null; |
| 7134 | + var selSC = null, selEC = null, selSO = null, selEO = null, offset = 0; |
7097 | 7135 | for ( var i = insertLines.length - 1; i >= 0; i-- ) { |
7098 | | - range.insertNode( context.$iframe[0].contentWindow.document.createTextNode( insertLines[i] ) ); |
| 7136 | + firstNode = context.$iframe[0].contentWindow.document.createTextNode( insertLines[i] ); |
| 7137 | + range.insertNode( firstNode ); |
| 7138 | + lastNode = lastNode || firstNode; |
| 7139 | + var newOffset = offset + insertLines[i].length; |
| 7140 | + if ( !selSC && pre.length < newOffset ) { |
| 7141 | + selSC = firstNode; |
| 7142 | + selSO = pre.length - offset; |
| 7143 | + } |
| 7144 | + if ( selSC && insertText.length - post.length < newOffset ) { |
| 7145 | + selEC = firstNode; |
| 7146 | + selEO = insertText.length - pre.length - offset; |
| 7147 | + } |
| 7148 | + offset = newOffset; |
7099 | 7149 | if ( i > 0 ) { |
7100 | | - lastNode = range.insertNode( context.$iframe[0].contentWindow.document.createElement( 'br' ) ); |
| 7150 | + firstNode = context.$iframe[0].contentWindow.document.createElement( 'br' ); |
| 7151 | + range.insertNode( firstNode ); |
| 7152 | + newOffset = offset + 1; |
| 7153 | + if ( !selSC && pre.length < newOffset ) { |
| 7154 | + selSC = firstNode; |
| 7155 | + selSO = pre.length - offset; |
| 7156 | + } |
| 7157 | + if ( selSC && insertText.length - post.length < newOffset ) { |
| 7158 | + selEC = firstNode; |
| 7159 | + selEO = insertText.length - pre.length - offset; |
| 7160 | + } |
| 7161 | + offset = newOffset; |
7101 | 7162 | } |
7102 | 7163 | } |
7103 | | - if ( lastNode ) { |
7104 | | - context.fn.scrollToTop( lastNode ); |
| 7164 | + if ( firstNode ) { |
| 7165 | + context.fn.scrollToTop( $( firstNode.parentNode ) ); |
7105 | 7166 | } |
| 7167 | + if ( selectAfter ) { |
| 7168 | + setSelectionTo = { |
| 7169 | + startContainer: selSC, |
| 7170 | + endContainer: selEC, |
| 7171 | + start: selSO, |
| 7172 | + end: selEO |
| 7173 | + }; |
| 7174 | + } else if ( lastNode ) { |
| 7175 | + setSelectionTo = { |
| 7176 | + startContainer: lastNode, |
| 7177 | + endContainer: lastNode, |
| 7178 | + start: lastNode.nodeValue.length, |
| 7179 | + end: lastNode.nodeValue.length |
| 7180 | + }; |
| 7181 | + } |
7106 | 7182 | } else if ( context.$iframe[0].contentWindow.document.selection ) { |
7107 | 7183 | // IE |
7108 | 7184 | context.$iframe[0].contentWindow.focus(); |
— | — | @@ -7144,7 +7220,16 @@ |
7145 | 7221 | .replace( />/g, '>' ) |
7146 | 7222 | .replace( /\r?\n/g, '<br />' ) |
7147 | 7223 | ); |
| 7224 | + if ( selectAfter ) { |
| 7225 | + range.moveStart( 'character', -post.length - selText.length ); |
| 7226 | + range.moveEnd( 'character', -post.length ); |
| 7227 | + range.select(); |
| 7228 | + } |
7148 | 7229 | } |
| 7230 | + |
| 7231 | + if ( setSelectionTo ) { |
| 7232 | + context.fn.setSelection( setSelectionTo ); |
| 7233 | + } |
7149 | 7234 | // Trigger the encapsulateSelection event (this might need to get named something else/done differently) |
7150 | 7235 | $( context.$iframe[0].contentWindow.document ).trigger( |
7151 | 7236 | 'encapsulateSelection', [ pre, options.peri, post, options.ownline, options.replace ] |
— | — | @@ -7573,13 +7658,20 @@ |
7574 | 7659 | * as a response to the "resize" event. |
7575 | 7660 | */ |
7576 | 7661 | |
| 7662 | + // Assemble a temporary div to place over the wikiEditor while it's being constructed |
| 7663 | + var $loader = $( '<div></div>' ) |
| 7664 | + .addClass( 'wikiEditor-ui-loading' ) |
| 7665 | + .append( $( '<span>' + mw.usability.getMsg( 'wikieditor-loading' ) + '</span>' ) |
| 7666 | + .css( 'marginTop', context.$textarea.height() / 2 ) ); |
7577 | 7667 | // Encapsulate the textarea with some containers for layout |
7578 | 7668 | context.$textarea |
7579 | | - .wrap( $( '<div></div>' ).addClass( 'wikiEditor-ui' ) ) |
7580 | | - .wrap( $( '<div></div>' ).addClass( 'wikiEditor-ui-view wikiEditor-ui-view-wikitext' ) ) |
7581 | | - .wrap( $( '<div></div>' ).addClass( 'wikiEditor-ui-left' ) ) |
7582 | | - .wrap( $( '<div></div>' ).addClass( 'wikiEditor-ui-bottom' ) ) |
7583 | | - .wrap( $( '<div></div>' ).addClass( 'wikiEditor-ui-text' ) ); |
| 7669 | + .after( $loader ) |
| 7670 | + .add( $loader ) |
| 7671 | + .wrapAll( $( '<div></div>' ).addClass( 'wikiEditor-ui' ) ) |
| 7672 | + .wrapAll( $( '<div></div>' ).addClass( 'wikiEditor-ui-view wikiEditor-ui-view-wikitext' ) ) |
| 7673 | + .wrapAll( $( '<div></div>' ).addClass( 'wikiEditor-ui-left' ) ) |
| 7674 | + .wrapAll( $( '<div></div>' ).addClass( 'wikiEditor-ui-bottom' ) ) |
| 7675 | + .wrapAll( $( '<div></div>' ).addClass( 'wikiEditor-ui-text' ) ); |
7584 | 7676 | // Get references to some of the newly created containers |
7585 | 7677 | context.$ui = context.$textarea.parent().parent().parent().parent().parent(); |
7586 | 7678 | context.$wikitext = context.$textarea.parent().parent().parent().parent(); |
— | — | @@ -7667,11 +7759,11 @@ |
7668 | 7760 | // We also need to unescape the doubly-escaped things mentioned above |
7669 | 7761 | html = $( '<div />' ).text( '<p>' + html.replace( /\r?\n/g, '</p><p>' ) + '</p>' ).html() |
7670 | 7762 | .replace( /&nbsp;/g, ' ' ) |
7671 | | - // Allow p tags to survive encoding |
| 7763 | + // Allow <p> tags to survive encoding |
7672 | 7764 | .replace( /<p>/g, '<p>' ) |
7673 | 7765 | .replace( /<\/p>/g, '</p>' ) |
7674 | | - // Empty p tags should just be br tags |
7675 | | - .replace( /<p><\/p>/g, '<br>' ) |
| 7766 | + // Empty <p> tags need <br> tags in them |
| 7767 | + .replace( /<p><\/p>/g, '<p><br></p>' ) |
7676 | 7768 | // Unescape &esc; stuff |
7677 | 7769 | .replace( /&esc;&amp;nbsp;/g, '&nbsp;' ) |
7678 | 7770 | .replace( /&esc;&lt;p&gt;/g, '<p>' ) |
— | — | @@ -7693,15 +7785,22 @@ |
7694 | 7786 | context.$iframe.show(); |
7695 | 7787 | // Let modules know we're ready to start working with the content |
7696 | 7788 | context.fn.trigger( 'ready' ); |
| 7789 | + //remove our temporary loading |
| 7790 | + $( '.wikiEditor-ui-loading' ).fadeOut( 'fast', function() { |
| 7791 | + $( this ).remove(); |
| 7792 | + } ); |
7697 | 7793 | // Setup event handling on the iframe |
7698 | 7794 | $( context.$iframe[0].contentWindow.document ) |
7699 | 7795 | .bind( 'keydown', function( event ) { |
7700 | 7796 | return context.fn.trigger( 'keydown', event ); |
7701 | 7797 | } ) |
7702 | | - .bind( 'keyup mouseup paste cut encapsulateSelection', function( event ) { |
| 7798 | + .bind( 'paste', function( event ) { |
| 7799 | + return context.fn.trigger( 'paste', event ); |
| 7800 | + } ) |
| 7801 | + .bind( 'keyup paste mouseup cut encapsulateSelection', function( event ) { |
7703 | 7802 | return context.fn.trigger( 'change', event ); |
7704 | 7803 | } ) |
7705 | | - .delayedBind( 250, 'keyup mouseup paste cut encapsulateSelection', function( event ) { |
| 7804 | + .delayedBind( 250, 'keyup paste mouseup cut encapsulateSelection', function( event ) { |
7706 | 7805 | context.fn.trigger( 'delayedChange', event ); |
7707 | 7806 | } ); |
7708 | 7807 | } ); |
— | — | @@ -9139,6 +9238,8 @@ |
9140 | 9239 | minimumWidth: '70px', |
9141 | 9240 | // Minimum width of the wikiText area |
9142 | 9241 | textMinimumWidth: '450px', |
| 9242 | + // The style property to be used for positioning the flexible module in regular mode |
| 9243 | + flexProperty: 'marginRight', |
9143 | 9244 | // Boolean var indicating text direction |
9144 | 9245 | rtl: false |
9145 | 9246 | }, |
— | — | @@ -9271,7 +9372,7 @@ |
9272 | 9373 | return; |
9273 | 9374 | } |
9274 | 9375 | $.wikiEditor.modules.toc.cfg.rtl = config.rtl; |
9275 | | - |
| 9376 | + $.wikiEditor.modules.toc.cfg.flexProperty = config.rtl ? 'marginLeft' : 'marginRight'; |
9276 | 9377 | var height = context.$ui.find( '.wikiEditor-ui-left' ).height(); |
9277 | 9378 | context.modules.toc.$toc = $( '<div />' ) |
9278 | 9379 | .addClass( 'wikiEditor-ui-toc' ) |
— | — | @@ -9293,9 +9394,9 @@ |
9294 | 9395 | context.$ui.find( '.wikiEditor-ui-right' ) |
9295 | 9396 | .css( 'width', fixedWidth + 'px' ); |
9296 | 9397 | context.$ui.find( '.wikiEditor-ui-left' ) |
9297 | | - .css( 'marginRight', ( -1 * fixedWidth ) + 'px' ) |
| 9398 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, ( -1 * fixedWidth ) + 'px' ) |
9298 | 9399 | .children() |
9299 | | - .css( 'marginRight', fixedWidth + 'px' ); |
| 9400 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, fixedWidth + 'px' ); |
9300 | 9401 | } else if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { |
9301 | 9402 | context.$ui.find( '.wikiEditor-ui-left' ) |
9302 | 9403 | .css( 'width', fixedWidth ); |
— | — | @@ -9317,11 +9418,12 @@ |
9318 | 9419 | width = $.wikiEditor.modules.toc.cfg.textMinimumWidth; |
9319 | 9420 | // set our styles for goofy mode |
9320 | 9421 | context.$ui.find( '.wikiEditor-ui-left' ) |
9321 | | - .css( { 'marginRight': '', 'position': 'absolute', 'float': 'none', |
| 9422 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, '') |
| 9423 | + .css( { 'position': 'absolute', 'float': 'none', |
9322 | 9424 | 'left': $.wikiEditor.modules.toc.cfg.rtl ? 'auto': 0, |
9323 | 9425 | 'right' : $.wikiEditor.modules.toc.cfg.rtl ? 0 : 'auto' } ) |
9324 | 9426 | .children() |
9325 | | - .css( 'marginRight', '' ); |
| 9427 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, '' ); |
9326 | 9428 | context.$ui.find( '.wikiEditor-ui-right' ) |
9327 | 9429 | .css( { 'width': 'auto', 'position': 'absolute', 'float': 'none', |
9328 | 9430 | 'right': $.wikiEditor.modules.toc.cfg.rtl ? 'auto': 0, |
— | — | @@ -9340,7 +9442,8 @@ |
9341 | 9443 | context.$wikitext |
9342 | 9444 | .css( { 'position': '', 'height': '' } ); |
9343 | 9445 | context.$ui.find( '.wikiEditor-ui-right' ) |
9344 | | - .css( { 'marginRight': '', 'position': '', 'left': '', 'right': '', 'float': '', 'top': '', 'height': '' } ); |
| 9446 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, '' ) |
| 9447 | + .css( { 'position': '', 'left': '', 'right': '', 'float': '', 'top': '', 'height': '' } ); |
9345 | 9448 | context.$ui.find( '.wikiEditor-ui-left' ) |
9346 | 9449 | .css( { 'width': '', 'position': '', 'left': '', 'float': '', 'right': '' } ); |
9347 | 9450 | } |
— | — | @@ -9355,9 +9458,9 @@ |
9356 | 9459 | } |
9357 | 9460 | context.$ui.find( '.wikiEditor-ui-right' ).hide(); |
9358 | 9461 | context.$ui.find( '.wikiEditor-ui-left' ) |
9359 | | - .css( 'marginRight', '' ) |
| 9462 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, '' ) |
9360 | 9463 | .children() |
9361 | | - .css( 'marginRight', '' ); |
| 9464 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, '' ); |
9362 | 9465 | } |
9363 | 9466 | context.modules.toc.$toc.data( 'positionMode', 'disabled' ); |
9364 | 9467 | }, |
— | — | @@ -9424,13 +9527,16 @@ |
9425 | 9528 | } |
9426 | 9529 | var pT = $this.parent().position().top - 1; |
9427 | 9530 | context.modules.toc.$toc.data( 'collapsed', true ); |
| 9531 | + var leftParam = {}, leftChildParam = {}; |
| 9532 | + leftParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = '-1px'; |
| 9533 | + leftChildParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = '1px'; |
9428 | 9534 | context.$ui.find( '.wikiEditor-ui-left' ) |
9429 | | - .animate( { 'marginRight': '-1px' }, 'fast', function() { |
9430 | | - $( this ).css( 'marginRight', 0 ); |
| 9535 | + .animate( leftParam, 'fast', function() { |
| 9536 | + $( this ).css( $.wikiEditor.modules.toc.cfg.flexProperty, 0 ); |
9431 | 9537 | } ) |
9432 | 9538 | .children() |
9433 | | - .animate( { 'marginRight': '1px' }, 'fast', function() { |
9434 | | - $( this ).css( 'marginRight', 0 ); |
| 9539 | + .animate( leftChildParam, 'fast', function() { |
| 9540 | + $( this ).css( $.wikiEditor.modules.toc.cfg.flexProperty, 0 ); |
9435 | 9541 | } ); |
9436 | 9542 | context.$ui.find( '.wikiEditor-ui-right' ) |
9437 | 9543 | .css( { |
— | — | @@ -9467,10 +9573,13 @@ |
9468 | 9574 | // check if we've got enough room to open to our stored width |
9469 | 9575 | if ( availableSpace < openWidth ) openWidth = availableSpace; |
9470 | 9576 | context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).hide(); |
| 9577 | + var leftParam = {}, leftChildParam = {}; |
| 9578 | + leftParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = parseFloat( openWidth ) * -1; |
| 9579 | + leftChildParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = openWidth; |
9471 | 9580 | context.$ui.find( '.wikiEditor-ui-left' ) |
9472 | | - .animate( { 'marginRight': ( parseFloat( openWidth ) * -1 ) }, 'fast' ) |
| 9581 | + .animate( leftParam, 'fast' ) |
9473 | 9582 | .children() |
9474 | | - .animate( { 'marginRight': openWidth }, 'fast' ); |
| 9583 | + .animate( leftChildParam, 'fast' ); |
9475 | 9584 | context.$ui.find( '.wikiEditor-ui-right' ) |
9476 | 9585 | .show() |
9477 | 9586 | .css( 'marginTop', '1px' ) |
— | — | @@ -9528,6 +9637,10 @@ |
9529 | 9638 | var div = $( '<div />' ) |
9530 | 9639 | .addClass( 'section-' + structure[i].index ) |
9531 | 9640 | .data( 'index', structure[i].index ) |
| 9641 | + .mousedown( function() { |
| 9642 | + // No dragging! |
| 9643 | + return false; |
| 9644 | + } ) |
9532 | 9645 | .click( function( event ) { |
9533 | 9646 | var wrapper = context.$content.find( |
9534 | 9647 | '.wikiEditor-toc-section-' + $( this ).data( 'index' ) ); |
— | — | @@ -9567,6 +9680,10 @@ |
9568 | 9681 | .addClass( 'tab' ) |
9569 | 9682 | .addClass( 'tab-toc' ) |
9570 | 9683 | .append( '<a href="#" />' ) |
| 9684 | + .mousedown( function() { |
| 9685 | + // No dragging! |
| 9686 | + return false; |
| 9687 | + } ) |
9571 | 9688 | .bind( 'click.wikiEditor-toc', function() { |
9572 | 9689 | context.modules.toc.$toc.trigger( 'collapse.wikiEditor-toc' ); return false; |
9573 | 9690 | } ) |
— | — | @@ -9575,6 +9692,10 @@ |
9576 | 9693 | $expandControl |
9577 | 9694 | .addClass( 'wikiEditor-ui-toc-expandControl' ) |
9578 | 9695 | .append( '<a href="#" />' ) |
| 9696 | + .mousedown( function() { |
| 9697 | + // No dragging! |
| 9698 | + return false; |
| 9699 | + } ) |
9579 | 9700 | .bind( 'click.wikiEditor-toc', function() { |
9580 | 9701 | context.modules.toc.$toc.trigger( 'expand.wikiEditor-toc' ); return false; |
9581 | 9702 | } ) |
— | — | @@ -9620,8 +9741,9 @@ |
9621 | 9742 | // for some odd reason, ui.size.width seems a step ahead of what the *actual* width of |
9622 | 9743 | // the resizable is |
9623 | 9744 | $( this ).css( { 'width': ui.size.width, 'top': 'auto', 'height': 'auto' } ) |
9624 | | - .data( 'wikiEditor-ui-left' ).css( 'marginRight', ( -1 * ui.size.width ) ) |
9625 | | - .children().css( 'marginRight', ui.size.width ); |
| 9745 | + .data( 'wikiEditor-ui-left' ) |
| 9746 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, ( -1 * ui.size.width ) ) |
| 9747 | + .children().css( $.wikiEditor.modules.toc.cfg.flexProperty, ui.size.width ); |
9626 | 9748 | // Let the UI know things have moved around |
9627 | 9749 | context.fn.trigger( 'resize' ); |
9628 | 9750 | }, |
— | — | @@ -10025,6 +10147,10 @@ |
10026 | 10148 | $button |
10027 | 10149 | .data( 'action', tool.action ) |
10028 | 10150 | .data( 'context', context ) |
| 10151 | + .mousedown( function() { |
| 10152 | + // No dragging! |
| 10153 | + return false; |
| 10154 | + } ) |
10029 | 10155 | .click( function() { |
10030 | 10156 | $.wikiEditor.modules.toolbar.fn.doAction( |
10031 | 10157 | $(this).data( 'context' ), $(this).data( 'action' ), $(this) |
— | — | @@ -10044,6 +10170,10 @@ |
10045 | 10171 | $( '<a />' ) |
10046 | 10172 | .data( 'action', tool.list[option].action ) |
10047 | 10173 | .data( 'context', context ) |
| 10174 | + .mousedown( function() { |
| 10175 | + // No dragging! |
| 10176 | + return false; |
| 10177 | + } ) |
10048 | 10178 | .click( function() { |
10049 | 10179 | $.wikiEditor.modules.toolbar.fn.doAction( |
10050 | 10180 | $(this).data( 'context' ), $(this).data( 'action' ), $(this) |
— | — | @@ -10068,6 +10198,10 @@ |
10069 | 10199 | .text( label ) |
10070 | 10200 | .data( 'options', $options ) |
10071 | 10201 | .attr( 'href', '#' ) |
| 10202 | + .mousedown( function() { |
| 10203 | + // No dragging! |
| 10204 | + return false; |
| 10205 | + } ) |
10072 | 10206 | .click( function() { |
10073 | 10207 | $(this).data( 'options' ).animate( { 'opacity': 'toggle' }, 'fast' ); |
10074 | 10208 | return false; |
— | — | @@ -10085,23 +10219,27 @@ |
10086 | 10220 | .text( label ) |
10087 | 10221 | .attr( 'rel', id ) |
10088 | 10222 | .data( 'context', context ) |
10089 | | - .bind( 'mousedown', function() { |
| 10223 | + .mousedown( function() { |
| 10224 | + // No dragging! |
| 10225 | + return false; |
| 10226 | + } ) |
| 10227 | + .click( function( event ) { |
10090 | 10228 | $(this).parent().parent().find( '.page' ).hide(); |
10091 | 10229 | $(this).parent().parent().find( '.page-' + $(this).attr( 'rel' ) ).show(); |
10092 | 10230 | $(this).siblings().removeClass( 'current' ); |
10093 | 10231 | $(this).addClass( 'current' ); |
10094 | 10232 | var section = $(this).parent().parent().attr( 'rel' ); |
10095 | | - |
10096 | | - //click tracking |
10097 | | - if($.trackAction != undefined){ |
10098 | | - $.trackAction(section + '.' + $(this).attr('rel')); |
10099 | | - } |
10100 | | - |
10101 | 10233 | $.cookie( |
10102 | 10234 | 'wikiEditor-' + $(this).data( 'context' ).instance + '-booklet-' + section + '-page', |
10103 | 10235 | $(this).attr( 'rel' ) |
10104 | 10236 | ); |
10105 | | - } ); |
| 10237 | + // Click tracking |
| 10238 | + if($.trackAction != undefined){ |
| 10239 | + $.trackAction(section + '.' + $(this).attr('rel')); |
| 10240 | + } |
| 10241 | + // No dragging! |
| 10242 | + return false; |
| 10243 | + } ) |
10106 | 10244 | }, |
10107 | 10245 | buildPage : function( context, id, page ) { |
10108 | 10246 | var $page = $( '<div />' ).attr( { |
— | — | @@ -10141,6 +10279,10 @@ |
10142 | 10280 | $characters |
10143 | 10281 | .html( html ) |
10144 | 10282 | .children() |
| 10283 | + .mousedown( function() { |
| 10284 | + // No dragging! |
| 10285 | + return false; |
| 10286 | + } ) |
10145 | 10287 | .click( function() { |
10146 | 10288 | $.wikiEditor.modules.toolbar.fn.doAction( |
10147 | 10289 | $(this).parent().data( 'context' ), |
— | — | @@ -10208,10 +10350,14 @@ |
10209 | 10351 | .attr( 'href', '#' ) |
10210 | 10352 | .text( $.wikiEditor.autoMsg( section, 'label' ) ) |
10211 | 10353 | .data( 'context', context ) |
10212 | | - .bind( 'mouseup', function( e ) { |
| 10354 | + .mouseup( function( e ) { |
10213 | 10355 | $(this).blur(); |
10214 | 10356 | } ) |
10215 | | - .bind( 'click', function( e ) { |
| 10357 | + .mousedown( function() { |
| 10358 | + // No dragging! |
| 10359 | + return false; |
| 10360 | + } ) |
| 10361 | + .click( function( e ) { |
10216 | 10362 | var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); |
10217 | 10363 | var $section = |
10218 | 10364 | $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -446,16 +446,19 @@ |
447 | 447 | for(var module in modules){if(typeof module=='string'&&module in $.wikiEditor.modules){if('api'in $.wikiEditor.modules[module]){for(var call in $.wikiEditor.modules[module].api){if(!(call in context.api)){context.api[call]=$.wikiEditor.modules[module].api[call];}}} |
448 | 448 | if('fn'in $.wikiEditor.modules[module]&&'create'in $.wikiEditor.modules[module].fn){context.modules[module]={};$.wikiEditor.modules[module].fn.create(context,modules[module]);}}}}};context.evt={'keydown':function(event){switch(event.which){case 9:if(event.ctrlKey||event.altKey||event.shiftKey){return true;}else{var $tabindexList=$j('[tabindex]:visible').sort(function(a,b){return a.tabIndex-b.tabIndex;});for(var i=0;i<$tabindexList.length;i++){if($tabindexList.eq(i).attr('id')==context.$iframe.attr('id')){$tabindexList.get(i+1).focus();break;}} |
449 | 449 | return false;} |
| 450 | +break;case 86:if(event.ctrlKey){context.evt.paste(event);} |
450 | 451 | break;} |
451 | 452 | return true;},'change':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldHTML!=newHTML){context.fn.purgeOffsets();context.oldHTML=newHTML;event.data.scope='realchange';} |
452 | 453 | switch(event.which){case 8:break;} |
453 | 454 | return true;},'delayedChange':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldDelayedHTML!=newHTML){context.fn.purgeOffsets();context.oldDelayedHTML=newHTML;event.data.scope='realchange';if(newHTML!==context.history[context.history.length+context.historyPosition].html){context.historyPosition=-1;} |
454 | 455 | context.history.push({'html':newHTML});while(context.history.length>10){context.history.shift();}} |
455 | | -return true;}};context.fn={'trigger':function(name,event){if(typeof event=='undefined'){event={'type':'custom'};} |
| 456 | +return true;},'paste':function(event){context.$content.find(':not(.wikiEditor)').addClass('wikiEditor');setTimeout(function(){var $selection=context.$content.find(':not(.wikiEditor)');while($selection.length&&$selection.length>0){var $currentElement=$selection.eq(0);while(!$currentElement.parent().is('body')&&!$currentElement.parent().is('.wikiEditor')){$currentElement=$currentElement.parent();} |
| 457 | +if($currentElement.is('br')){$currentElement.addClass('wikiEditor');}else{$('<p></p>').text($currentElement.text()).addClass('wikiEditor').insertAfter($currentElement);$currentElement.remove();} |
| 458 | +$selection=context.$content.find(':not(.wikiEditor)');}},0);return true;}};context.fn={'trigger':function(name,event){if(typeof event=='undefined'){event={'type':'custom'};} |
456 | 459 | if(typeof event.data=='undefined'){event.data={};} |
457 | 460 | if(name in context.evt){if(!context.evt[name](event)){return false;}} |
458 | 461 | for(var module in context.modules){if(module in $.wikiEditor.modules&&'evt'in $.wikiEditor.modules[module]&&name in $.wikiEditor.modules[module].evt){$.wikiEditor.modules[module].evt[name](context,event);}} |
459 | | -return true;},'addButton':function(options){context.$controls.show();context.$buttons.show();return $('<button />').text($.wikiEditor.autoMsg(options,'caption')).click(options.action).appendTo(context.$buttons);},'addView':function(options){function addTab(options){context.$controls.show();context.$tabs.show();return $('<div></div>').attr('rel','wikiEditor-ui-view-'+options.name).addClass(context.view==options.name?'current':null).append($('<a></a>').attr('href','#').click(function(event){context.$ui.find('.wikiEditor-ui-view').hide();context.$ui.find('.'+$(this).parent().attr('rel')).show();context.$tabs.find('div').removeClass('current');$(this).parent().addClass('current');$(this).blur();if('init'in options&&typeof options.init=='function'){options.init(context);} |
| 462 | +return true;},'addButton':function(options){context.$controls.show();context.$buttons.show();return $('<button />').text($.wikiEditor.autoMsg(options,'caption')).click(options.action).appendTo(context.$buttons);},'addView':function(options){function addTab(options){context.$controls.show();context.$tabs.show();return $('<div></div>').attr('rel','wikiEditor-ui-view-'+options.name).addClass(context.view==options.name?'current':null).append($('<a></a>').attr('href','#').mousedown(function(){return false;}).click(function(event){context.$ui.find('.wikiEditor-ui-view').hide();context.$ui.find('.'+$(this).parent().attr('rel')).show();context.$tabs.find('div').removeClass('current');$(this).parent().addClass('current');$(this).blur();if('init'in options&&typeof options.init=='function'){options.init(context);} |
460 | 463 | event.preventDefault();return false;}).text($.wikiEditor.autoMsg(options,'title'))).appendTo(context.$tabs);} |
461 | 464 | if(!context.$tabs.children().size()){addTab({'name':'wikitext','titleMsg':'wikieditor-wikitext-tab'});} |
462 | 465 | addTab(options);return $('<div></div>').addClass('wikiEditor-ui-view wikiEditor-ui-view-'+options.name).hide().appendTo(context.$ui);},'htmlToText':function(html){if(html in context.htmlToTextMap){return context.htmlToTextMap[html];} |
— | — | @@ -467,18 +470,24 @@ |
468 | 471 | return context.htmlToTextMap[origHTML]=leading+retval+trailing;},'getContents':function(){var html;if($.browser.msie){var $c=$(context.$content.get(0).cloneNode(true));$c.find('p').each(function(){if($(this).html()==''){$(this).replaceWith('<p></p>');}});html=$c.html();}else{html=context.$content.html();} |
469 | 472 | return context.fn.htmlToText(html);},'getSelection':function(){var retval;if(context.$iframe[0].contentWindow.getSelection){retval=context.$iframe[0].contentWindow.getSelection();if($.browser.opera){if(retval.rangeCount>0){retval=context.fn.htmlToText($('<pre />').append(retval.getRangeAt(0).cloneContents()).html());}else{retval='';}}}else if(context.$iframe[0].contentWindow.document.selection){retval=context.$iframe[0].contentWindow.document.selection.createRange();} |
470 | 473 | if(typeof retval.text!='undefined'){retval=context.fn.htmlToText(retval.htmlText);}else if(typeof retval.toString!='undefined'){retval=retval.toString();} |
471 | | -return retval;},'encapsulateSelection':function(options){var selText=$(this).textSelection('getSelection');var selTextArr;var selectAfter=false;var pre=options.pre,post=options.post;if(!selText){selText=options.peri;selectAfter=true;}else if(options.replace){selText=options.peri;}else if(selText.charAt(selText.length-1)==' '){selText=selText.substring(0,selText.length-1);post+=' ';} |
| 474 | +return retval;},'encapsulateSelection':function(options){var selText=$(this).textSelection('getSelection');var selTextArr;var selectAfter=false;var setSelectionTo=null;var pre=options.pre,post=options.post;if(!selText){selText=options.peri;selectAfter=true;}else if(options.replace){selText=options.peri;}else if(selText.charAt(selText.length-1)==' '){selText=selText.substring(0,selText.length-1);post+=' ';} |
472 | 475 | if(options.splitlines){selTextArr=selText.split(/\n/);} |
473 | 476 | if(context.$iframe[0].contentWindow.getSelection){var range=context.$iframe[0].contentWindow.getSelection().getRangeAt(0);if(options.ownline){var atStart=false,atEnd=false;var body=context.$content.get(0);if(range.startOffset==0){atStart=true;}else if(range.startContainer==body){var n=body.firstChild;for(var i=0;i<range.startOffset-1&&n;i++){n=n.nextSibling;} |
474 | 477 | if(n&&n.nodeName=='BR'){atStart=true;}else{atEnd=true;}}else if(range.startContainer.nodeName=='#text'&&range.startOffset==range.startContainer.nodeValue.length){atEnd=true;} |
475 | 478 | if(!atStart){pre="\n"+options.pre;} |
476 | 479 | if(!atEnd){post+="\n";}} |
477 | 480 | var insertText="";if(options.splitlines){for(var j=0;j<selTextArr.length;j++){insertText=insertText+pre+selTextArr[j]+post;if(j!=selTextArr.length-1){insertText+="\n";}}}else{insertText=pre+selText+post;} |
478 | | -var insertLines=insertText.split("\n");range.extractContents();var lastNode;for(var i=insertLines.length-1;i>=0;i--){range.insertNode(context.$iframe[0].contentWindow.document.createTextNode(insertLines[i]));if(i>0){lastNode=range.insertNode(context.$iframe[0].contentWindow.document.createElement('br'));}} |
479 | | -if(lastNode){context.fn.scrollToTop(lastNode);}}else if(context.$iframe[0].contentWindow.document.selection){context.$iframe[0].contentWindow.focus();var range=context.$iframe[0].contentWindow.document.selection.createRange();if(options.ownline&&range.moveStart){var range2=context.$iframe[0].contentWindow.document.selection.createRange();range2.collapse();range2.moveStart('character',-1);if(range2.text!="\r"&&range2.text!="\n"&&range2.text!=""){pre="\n"+pre;} |
| 481 | +var insertLines=insertText.split("\n");range.extractContents();var firstNode=null,lastNode=null;var selSC=null,selEC=null,selSO=null,selEO=null,offset=0;for(var i=insertLines.length-1;i>=0;i--){firstNode=context.$iframe[0].contentWindow.document.createTextNode(insertLines[i]);range.insertNode(firstNode);lastNode=lastNode||firstNode;var newOffset=offset+insertLines[i].length;if(!selSC&&pre.length<newOffset){selSC=firstNode;selSO=pre.length-offset;} |
| 482 | +if(selSC&&insertText.length-post.length<newOffset){selEC=firstNode;selEO=insertText.length-pre.length-offset;} |
| 483 | +offset=newOffset;if(i>0){firstNode=context.$iframe[0].contentWindow.document.createElement('br');range.insertNode(firstNode);newOffset=offset+1;if(!selSC&&pre.length<newOffset){selSC=firstNode;selSO=pre.length-offset;} |
| 484 | +if(selSC&&insertText.length-post.length<newOffset){selEC=firstNode;selEO=insertText.length-pre.length-offset;} |
| 485 | +offset=newOffset;}} |
| 486 | +if(firstNode){context.fn.scrollToTop($(firstNode.parentNode));} |
| 487 | +if(selectAfter){setSelectionTo={startContainer:selSC,endContainer:selEC,start:selSO,end:selEO};}else if(lastNode){setSelectionTo={startContainer:lastNode,endContainer:lastNode,start:lastNode.nodeValue.length,end:lastNode.nodeValue.length};}}else if(context.$iframe[0].contentWindow.document.selection){context.$iframe[0].contentWindow.focus();var range=context.$iframe[0].contentWindow.document.selection.createRange();if(options.ownline&&range.moveStart){var range2=context.$iframe[0].contentWindow.document.selection.createRange();range2.collapse();range2.moveStart('character',-1);if(range2.text!="\r"&&range2.text!="\n"&&range2.text!=""){pre="\n"+pre;} |
480 | 488 | var range3=context.$iframe[0].contentWindow.document.selection.createRange();range3.collapse(false);range3.moveEnd('character',1);if(range3.text!="\r"&&range3.text!="\n"&&range3.text!=""){post+="\n";}} |
481 | 489 | var insertText="";if(options.splitlines){for(var j=0;j<selTextArr.length;j++){insertText=insertText+pre+selTextArr[j]+post;if(j!=selTextArr.length-1){insertText+="\n";}}}else{insertText=pre+selText+post;} |
482 | | -range.pasteHTML(insertText.replace(/\</g,'<').replace(/>/g,'>').replace(/\r?\n/g,'<br />'));} |
| 490 | +range.pasteHTML(insertText.replace(/\</g,'<').replace(/>/g,'>').replace(/\r?\n/g,'<br />'));if(selectAfter){range.moveStart('character',-post.length-selText.length);range.moveEnd('character',-post.length);range.select();}} |
| 491 | +if(setSelectionTo){context.fn.setSelection(setSelectionTo);} |
483 | 492 | $(context.$iframe[0].contentWindow.document).trigger('encapsulateSelection',[pre,options.peri,post,options.ownline,options.replace]);return context.$textarea;},'getCaretPosition':function(options){},'setSelection':function(options){var sc=options.startContainer,ec=options.endContainer;sc=sc&&sc.jquery?sc[0]:sc;ec=ec&&ec.jquery?ec[0]:ec;if(context.$iframe[0].contentWindow.getSelection){var start=options.start,end=options.end;if(!sc||!ec){var s=context.fn.getOffset(start);var e=context.fn.getOffset(end);sc=s?s.node:null;ec=e?e.node:null;start=s?s.offset:null;end=e?e.offset:null;} |
484 | 493 | if(!sc||!ec){return context.$textarea;} |
485 | 494 | var sel=context.$iframe[0].contentWindow.getSelection();while(sc.firstChild&&sc.nodeName!='#text'){sc=sc.firstChild;} |
— | — | @@ -522,10 +531,10 @@ |
523 | 532 | pos=nextPos+(leavingP?1:0);if(t.node.nodeName=='#text'){lastTextNode=t.node;lastTextNodeDepth=t.depth;} |
524 | 533 | t=nextT;}},'saveSelection':function(){if(!$.browser.msie){return;} |
525 | 534 | context.$iframe[0].contentWindow.focus();context.savedSelection=context.$iframe[0].contentWindow.document.selection.createRange();},'restoreSelection':function(){if(!$.browser.msie||context.savedSelection===null){return;} |
526 | | -context.$iframe[0].contentWindow.focus();context.savedSelection.select();context.savedSelection=null;}};context.$textarea.wrap($('<div></div>').addClass('wikiEditor-ui')).wrap($('<div></div>').addClass('wikiEditor-ui-view wikiEditor-ui-view-wikitext')).wrap($('<div></div>').addClass('wikiEditor-ui-left')).wrap($('<div></div>').addClass('wikiEditor-ui-bottom')).wrap($('<div></div>').addClass('wikiEditor-ui-text'));context.$ui=context.$textarea.parent().parent().parent().parent().parent();context.$wikitext=context.$textarea.parent().parent().parent().parent();context.$wikitext.before($('<div></div>').addClass('wikiEditor-ui-controls').append($('<div></div>').addClass('wikiEditor-ui-tabs').hide()).append($('<div></div>').addClass('wikiEditor-ui-buttons'))).before($('<div style="clear:both;"></div>'));context.$controls=context.$ui.find('.wikiEditor-ui-buttons').hide();context.$buttons=context.$ui.find('.wikiEditor-ui-buttons');context.$tabs=context.$ui.find('.wikiEditor-ui-tabs');context.$ui.after($('<div style="clear:both;"></div>'));context.$wikitext.append($('<div></div>').addClass('wikiEditor-ui-right'));context.$wikitext.find('.wikiEditor-ui-left').prepend($('<div></div>').addClass('wikiEditor-ui-top'));context.view='wikitext';$(window).resize(function(event){context.fn.trigger('resize',event);});context.$iframe=$('<iframe></iframe>').attr({'frameBorder':0,'border':0,'tabindex':1,'src':wgScriptPath+'/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.html?'+'instance='+context.instance+'&ts='+(new Date()).getTime(),'id':'wikiEditor-iframe-'+context.instance}).css({'backgroundColor':'white','width':'100%','height':context.$textarea.height(),'display':'none','overflow-y':'scroll','overflow-x':'hidden'}).insertAfter(context.$textarea).load(function(){if(!this.isSecondRun){context.$iframe[0].contentWindow.document.designMode='on';if($.browser.msie){this.isSecondRun=true;return;}} |
| 535 | +context.$iframe[0].contentWindow.focus();context.savedSelection.select();context.savedSelection=null;}};var $loader=$('<div></div>').addClass('wikiEditor-ui-loading').append($('<span>'+mw.usability.getMsg('wikieditor-loading')+'</span>').css('marginTop',context.$textarea.height()/2));context.$textarea.after($loader).add($loader).wrapAll($('<div></div>').addClass('wikiEditor-ui')).wrapAll($('<div></div>').addClass('wikiEditor-ui-view wikiEditor-ui-view-wikitext')).wrapAll($('<div></div>').addClass('wikiEditor-ui-left')).wrapAll($('<div></div>').addClass('wikiEditor-ui-bottom')).wrapAll($('<div></div>').addClass('wikiEditor-ui-text'));context.$ui=context.$textarea.parent().parent().parent().parent().parent();context.$wikitext=context.$textarea.parent().parent().parent().parent();context.$wikitext.before($('<div></div>').addClass('wikiEditor-ui-controls').append($('<div></div>').addClass('wikiEditor-ui-tabs').hide()).append($('<div></div>').addClass('wikiEditor-ui-buttons'))).before($('<div style="clear:both;"></div>'));context.$controls=context.$ui.find('.wikiEditor-ui-buttons').hide();context.$buttons=context.$ui.find('.wikiEditor-ui-buttons');context.$tabs=context.$ui.find('.wikiEditor-ui-tabs');context.$ui.after($('<div style="clear:both;"></div>'));context.$wikitext.append($('<div></div>').addClass('wikiEditor-ui-right'));context.$wikitext.find('.wikiEditor-ui-left').prepend($('<div></div>').addClass('wikiEditor-ui-top'));context.view='wikitext';$(window).resize(function(event){context.fn.trigger('resize',event);});context.$iframe=$('<iframe></iframe>').attr({'frameBorder':0,'border':0,'tabindex':1,'src':wgScriptPath+'/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.html?'+'instance='+context.instance+'&ts='+(new Date()).getTime(),'id':'wikiEditor-iframe-'+context.instance}).css({'backgroundColor':'white','width':'100%','height':context.$textarea.height(),'display':'none','overflow-y':'scroll','overflow-x':'hidden'}).insertAfter(context.$textarea).load(function(){if(!this.isSecondRun){context.$iframe[0].contentWindow.document.designMode='on';if($.browser.msie){this.isSecondRun=true;return;}} |
527 | 536 | context.$content=$(context.$iframe[0].contentWindow.document.body);var html=context.$textarea.val().replace(/&esc;/g,'&esc;esc;').replace(/\<p\>/g,'&esc;<p>').replace(/\<\/p\>/g,'&esc;</p>').replace(/\<span class="wikiEditor-tab"\>\<\/span\>/g,'&esc;<span class="wikiEditor-tab"></span>').replace(/ /g,'&esc;&nbsp;');if($.browser.msie){html=html.replace(/\t/g,'<span class="wikiEditor-tab"></span>');if($.browser.versionNumber<=7){html=html.replace(/ /g," ");}else{html=html.replace(/(^|\n) /g,"$1 ");}} |
528 | | -html=$('<div />').text('<p>'+html.replace(/\r?\n/g,'</p><p>')+'</p>').html().replace(/&nbsp;/g,' ').replace(/<p>/g,'<p>').replace(/<\/p>/g,'</p>').replace(/<p><\/p>/g,'<br>').replace(/&esc;&amp;nbsp;/g,'&nbsp;').replace(/&esc;&lt;p&gt;/g,'<p>').replace(/&esc;&lt;\/p&gt;/g,'</p>').replace(/&esc;&lt;span&nbsp;class=&quot;wikiEditor-tab&quot;&gt;&lt;\/span&gt;/g,'<span class="wikiEditor-tab"><\/span>').replace(/&esc;esc;/g,'&esc;');context.$content.html(html);context.oldHTML=html;context.history.push({'html':html});if($('body').is('.rtl')){context.$content.addClass('rtl').attr('dir','rtl');} |
529 | | -context.$textarea.attr('disabled',true);context.$textarea.hide();context.$iframe.show();context.fn.trigger('ready');$(context.$iframe[0].contentWindow.document).bind('keydown',function(event){return context.fn.trigger('keydown',event);}).bind('keyup mouseup paste cut encapsulateSelection',function(event){return context.fn.trigger('change',event);}).delayedBind(250,'keyup mouseup paste cut encapsulateSelection',function(event){context.fn.trigger('delayedChange',event);});});context.$textarea.closest('form').submit(function(){context.$textarea.attr('disabled',false);context.$textarea.val(context.$textarea.textSelection('getContents'));});context.fallbackWindowOnBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){context.$textarea.val(context.$textarea.textSelection('getContents'));if(context.fallbackWindowOnBeforeUnload){return context.fallbackWindowOnBeforeUnload();}};} |
| 537 | +html=$('<div />').text('<p>'+html.replace(/\r?\n/g,'</p><p>')+'</p>').html().replace(/&nbsp;/g,' ').replace(/<p>/g,'<p>').replace(/<\/p>/g,'</p>').replace(/<p><\/p>/g,'<p><br></p>').replace(/&esc;&amp;nbsp;/g,'&nbsp;').replace(/&esc;&lt;p&gt;/g,'<p>').replace(/&esc;&lt;\/p&gt;/g,'</p>').replace(/&esc;&lt;span&nbsp;class=&quot;wikiEditor-tab&quot;&gt;&lt;\/span&gt;/g,'<span class="wikiEditor-tab"><\/span>').replace(/&esc;esc;/g,'&esc;');context.$content.html(html);context.oldHTML=html;context.history.push({'html':html});if($('body').is('.rtl')){context.$content.addClass('rtl').attr('dir','rtl');} |
| 538 | +context.$textarea.attr('disabled',true);context.$textarea.hide();context.$iframe.show();context.fn.trigger('ready');$('.wikiEditor-ui-loading').fadeOut('fast',function(){$(this).remove();});$(context.$iframe[0].contentWindow.document).bind('keydown',function(event){return context.fn.trigger('keydown',event);}).bind('paste',function(event){return context.fn.trigger('paste',event);}).bind('keyup paste mouseup cut encapsulateSelection',function(event){return context.fn.trigger('change',event);}).delayedBind(250,'keyup paste mouseup cut encapsulateSelection',function(event){context.fn.trigger('delayedChange',event);});});context.$textarea.closest('form').submit(function(){context.$textarea.attr('disabled',false);context.$textarea.val(context.$textarea.textSelection('getContents'));});context.fallbackWindowOnBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){context.$textarea.val(context.$textarea.textSelection('getContents'));if(context.fallbackWindowOnBeforeUnload){return context.fallbackWindowOnBeforeUnload();}};} |
530 | 539 | var args=$.makeArray(arguments);if(args.length>0){var call=args.shift();if(call in context.api){context.api[call](context,typeof args[0]=='undefined'?{}:args[0]);}} |
531 | 540 | return $(this).data('wikiEditor-context',context);};})(jQuery);RegExp.escape=function(s){return s.replace(/([.*+?^${}()|\/\\[\]])/g,'\\$1');};(function($){$.wikiEditor.modules.dialogs={api:{addDialog:function(context,data){$.wikiEditor.modules.dialogs.fn.create(context,data)},openDialog:function(context,module){if(module in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[module].id).dialog('open');}},closeDialog:function(context,data){if(module in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[module].id).dialog('close');}}},fn:{create:function(context,config){for(module in config){$.wikiEditor.modules.dialogs.modules[module]=config[module];} |
532 | 541 | mw.usability.load(['$j.ui','$j.ui.dialog','$j.ui.draggable','$j.ui.resizable'],function(){for(module in $.wikiEditor.modules.dialogs.modules){var module=$.wikiEditor.modules.dialogs.modules[module];if($('#'+module.id).size()==0){var configuration=module.dialog;configuration.bgiframe=true;configuration.autoOpen=false;configuration.modal=true;configuration.title=$.wikiEditor.autoMsg(module,'title');configuration.newButtons={};for(msg in configuration.buttons) |
— | — | @@ -623,7 +632,7 @@ |
624 | 633 | nameEndIndex=nameEnd.index+oldDivider+2;ranges.push(new Range(ranges[ranges.length-1].end,nameBeginIndex));nameIndex=ranges.push(new Range(nameBeginIndex,nameEndIndex))-1;currentValue=currentField.substring(currentField.indexOf('=')+1);oldDivider+=currentField.indexOf('=')+1;valueBegin=currentValue.match(/\S+/);if(valueBegin==null){continue;} |
625 | 634 | valueBeginIndex=valueBegin.index+oldDivider+1;valueEnd=currentValue.match(/[^\s]\s*$/);if(valueEnd==null){continue;} |
626 | 635 | valueEndIndex=valueEnd.index+oldDivider+2;equalsIndex=ranges.push(new Range(ranges[ranges.length-1].end,valueBeginIndex))-1;valueIndex=ranges.push(new Range(valueBeginIndex,valueEndIndex))-1;params.push(new Param(wikitext.substring(nameBeginIndex,nameEndIndex),wikitext.substring(valueBeginIndex,valueEndIndex),currentParamNumber,nameIndex,equalsIndex,valueIndex));paramsByName[wikitext.substring(nameBeginIndex,nameEndIndex)]=currentParamNumber;}} |
627 | | -ranges.push(new Range(valueEndIndex,wikitext.length));this.ranges=ranges;this.wikitext=wikitext;this.params=params;this.paramsByName=paramsByName;this.templateNameIndex=templateNameIndex;}}};})(jQuery);(function($){$.wikiEditor.modules.toc={cfg:{defaultWidth:'166px',minimumWidth:'70px',textMinimumWidth:'450px',rtl:false},api:{},evt:{change:function(context,event){$.wikiEditor.modules.toc.fn.update(context);},ready:function(context,event){$.wikiEditor.modules.toc.fn.build(context);context.$content.parent().blur(function(){var context=event.data.context;$.wikiEditor.modules.toc.fn.unhighlight(context);});$.wikiEditor.modules.toc.evt.resize(context);},resize:function(context,event){var availableWidth=context.$wikitext.width()-parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth),totalMinWidth=parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)+ |
| 636 | +ranges.push(new Range(valueEndIndex,wikitext.length));this.ranges=ranges;this.wikitext=wikitext;this.params=params;this.paramsByName=paramsByName;this.templateNameIndex=templateNameIndex;}}};})(jQuery);(function($){$.wikiEditor.modules.toc={cfg:{defaultWidth:'166px',minimumWidth:'70px',textMinimumWidth:'450px',flexProperty:'marginRight',rtl:false},api:{},evt:{change:function(context,event){$.wikiEditor.modules.toc.fn.update(context);},ready:function(context,event){$.wikiEditor.modules.toc.fn.build(context);context.$content.parent().blur(function(){var context=event.data.context;$.wikiEditor.modules.toc.fn.unhighlight(context);});$.wikiEditor.modules.toc.evt.resize(context);},resize:function(context,event){var availableWidth=context.$wikitext.width()-parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth),totalMinWidth=parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)+ |
628 | 637 | parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth);context.$ui.find('.wikiEditor-ui-right').resizable('option','maxWidth',availableWidth);if(context.modules.toc.$toc.data('positionMode')!='disabled'&&context.$wikitext.width()<totalMinWidth){$.wikiEditor.modules.toc.fn.disable(context);}else if(context.modules.toc.$toc.data('positionMode')=='disabled'&&context.$wikitext.width()>totalMinWidth){$.wikiEditor.modules.toc.fn.enable(context);}else if(context.modules.toc.$toc.data('positionMode')=='regular'&&context.$ui.find('.wikiEditor-ui-right').width()>availableWidth){$.wikiEditor.modules.toc.fn.switchLayout(context);}else if(context.modules.toc.$toc.data('positionMode')=='goofy'&&context.modules.toc.$toc.data('previousWidth')<context.$wikitext.width()){$.wikiEditor.modules.toc.fn.switchLayout(context);} |
629 | 638 | if(context.modules.toc.$toc.data('positionMode')=='goofy'){context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true,'restoreText':true});} |
630 | 639 | if(!context.modules.toc.$toc.data('collapsed')){context.modules.toc.$toc.height(context.$ui.find('.wikiEditor-ui-left').height()- |
— | — | @@ -631,26 +640,26 @@ |
632 | 641 | context.modules.toc.$toc.data('previousWidth',context.$wikitext.width());},mark:function(context,event){var hash='';var markers=context.modules.highlight.markers;var tokenArray=context.modules.highlight.tokenArray;var outline=context.data.outline=[];var h=0;for(var i=0;i<tokenArray.length;i++){if(tokenArray[i].label!='TOC_HEADER'){continue;} |
633 | 642 | h++;markers.push({index:h,start:tokenArray[i].tokenStart,end:tokenArray[i].offset,type:'toc',anchor:'before',afterWrap:function(node){var marker=$(node).data('marker');$(node).addClass('wikiEditor-toc-header').addClass('wikiEditor-toc-section-'+marker.index).data('section',marker.index);},onSkip:function(node){var marker=$(node).data('marker');if($(node).data('section')!=marker.index){$(node).removeClass('wikiEditor-toc-section-'+$(node).data('section')).addClass('wikiEditor-toc-section-'+marker.index).data('section',marker.index);}},getAnchor:function(ca1,ca2){return $(ca1.parentNode.previousSibling).is('div.wikiEditor-toc-header')?ca1.parentNode.previousSibling:null;}});hash+=tokenArray[i].match[2]+'\n';outline.push({'text':tokenArray[i].match[2],'level':tokenArray[i].match[1].length,'index':h});} |
634 | 643 | if(typeof context.modules.toc.lastHash=='undefined'||context.modules.toc.lastHash!==hash){$.wikiEditor.modules.toc.fn.build(context);$.wikiEditor.modules.toc.fn.update(context);context.modules.toc.lastHash=hash;}}},exp:[{'regex':/^(={1,6})([^\r\n]+?)\1\s*$/m,'label':'TOC_HEADER','markAfter':true}],fn:{create:function(context,config){if('$toc'in context.modules.toc){return;} |
635 | | -$.wikiEditor.modules.toc.cfg.rtl=config.rtl;var height=context.$ui.find('.wikiEditor-ui-left').height();context.modules.toc.$toc=$('<div />').addClass('wikiEditor-ui-toc').data('context',context).data('positionMode','regular').data('collapsed',false);context.$ui.find('.wikiEditor-ui-right').append(context.modules.toc.$toc);context.modules.toc.$toc.height(context.$ui.find('.wikiEditor-ui-left').height());$.wikiEditor.modules.toc.fn.redraw(context,$.wikiEditor.modules.toc.cfg.defaultWidth);},redraw:function(context,fixedWidth){var fixedWidth=parseFloat(fixedWidth);if(context.modules.toc.$toc.data('positionMode')=='regular'){context.$ui.find('.wikiEditor-ui-right').css('width',fixedWidth+'px');context.$ui.find('.wikiEditor-ui-left').css('marginRight',(-1*fixedWidth)+'px').children().css('marginRight',fixedWidth+'px');}else if(context.modules.toc.$toc.data('positionMode')=='goofy'){context.$ui.find('.wikiEditor-ui-left').css('width',fixedWidth);context.$ui.find('.wikiEditor-ui-right').css($.wikiEditor.modules.toc.cfg.rtl?'right':'left',fixedWidth);context.$wikitext.css('height',context.$ui.find('.wikiEditor-ui-right').height());}},switchLayout:function(context){var width,height=context.$ui.find('.wikiEditor-ui-right').height();if(context.modules.toc.$toc.data('positionMode')=='regular'&&!context.modules.toc.$toc.data('collapsed')){context.modules.toc.$toc.data('positionMode','goofy');context.modules.toc.$toc.data('positionModeChangeAt',context.$ui.find('.wikiEditor-ui-right').width());width=$.wikiEditor.modules.toc.cfg.textMinimumWidth;context.$ui.find('.wikiEditor-ui-left').css({'marginRight':'','position':'absolute','float':'none','left':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'right':$.wikiEditor.modules.toc.cfg.rtl?0:'auto'}).children().css('marginRight','');context.$ui.find('.wikiEditor-ui-right').css({'width':'auto','position':'absolute','float':'none','right':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'left':$.wikiEditor.modules.toc.cfg.rtl?0:'auto'});context.$wikitext.css('position','relative');}else if(context.modules.toc.$toc.data('positionMode')=='goofy'){context.modules.toc.$toc.data('positionMode','regular');width=context.$wikitext.width()-context.$ui.find('.wikiEditor-ui-left').width();if(width>context.modules.toc.$toc.data('positionModeChangeAt')){width=context.modules.toc.$toc.data('positionModeChangeAt');} |
636 | | -context.$wikitext.css({'position':'','height':''});context.$ui.find('.wikiEditor-ui-right').css({'marginRight':'','position':'','left':'','right':'','float':'','top':'','height':''});context.$ui.find('.wikiEditor-ui-left').css({'width':'','position':'','left':'','float':'','right':''});} |
| 644 | +$.wikiEditor.modules.toc.cfg.rtl=config.rtl;$.wikiEditor.modules.toc.cfg.flexProperty=config.rtl?'marginLeft':'marginRight';var height=context.$ui.find('.wikiEditor-ui-left').height();context.modules.toc.$toc=$('<div />').addClass('wikiEditor-ui-toc').data('context',context).data('positionMode','regular').data('collapsed',false);context.$ui.find('.wikiEditor-ui-right').append(context.modules.toc.$toc);context.modules.toc.$toc.height(context.$ui.find('.wikiEditor-ui-left').height());$.wikiEditor.modules.toc.fn.redraw(context,$.wikiEditor.modules.toc.cfg.defaultWidth);},redraw:function(context,fixedWidth){var fixedWidth=parseFloat(fixedWidth);if(context.modules.toc.$toc.data('positionMode')=='regular'){context.$ui.find('.wikiEditor-ui-right').css('width',fixedWidth+'px');context.$ui.find('.wikiEditor-ui-left').css($.wikiEditor.modules.toc.cfg.flexProperty,(-1*fixedWidth)+'px').children().css($.wikiEditor.modules.toc.cfg.flexProperty,fixedWidth+'px');}else if(context.modules.toc.$toc.data('positionMode')=='goofy'){context.$ui.find('.wikiEditor-ui-left').css('width',fixedWidth);context.$ui.find('.wikiEditor-ui-right').css($.wikiEditor.modules.toc.cfg.rtl?'right':'left',fixedWidth);context.$wikitext.css('height',context.$ui.find('.wikiEditor-ui-right').height());}},switchLayout:function(context){var width,height=context.$ui.find('.wikiEditor-ui-right').height();if(context.modules.toc.$toc.data('positionMode')=='regular'&&!context.modules.toc.$toc.data('collapsed')){context.modules.toc.$toc.data('positionMode','goofy');context.modules.toc.$toc.data('positionModeChangeAt',context.$ui.find('.wikiEditor-ui-right').width());width=$.wikiEditor.modules.toc.cfg.textMinimumWidth;context.$ui.find('.wikiEditor-ui-left').css($.wikiEditor.modules.toc.cfg.flexProperty,'').css({'position':'absolute','float':'none','left':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'right':$.wikiEditor.modules.toc.cfg.rtl?0:'auto'}).children().css($.wikiEditor.modules.toc.cfg.flexProperty,'');context.$ui.find('.wikiEditor-ui-right').css({'width':'auto','position':'absolute','float':'none','right':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'left':$.wikiEditor.modules.toc.cfg.rtl?0:'auto'});context.$wikitext.css('position','relative');}else if(context.modules.toc.$toc.data('positionMode')=='goofy'){context.modules.toc.$toc.data('positionMode','regular');width=context.$wikitext.width()-context.$ui.find('.wikiEditor-ui-left').width();if(width>context.modules.toc.$toc.data('positionModeChangeAt')){width=context.modules.toc.$toc.data('positionModeChangeAt');} |
| 645 | +context.$wikitext.css({'position':'','height':''});context.$ui.find('.wikiEditor-ui-right').css($.wikiEditor.modules.toc.cfg.flexProperty,'').css({'position':'','left':'','right':'','float':'','top':'','height':''});context.$ui.find('.wikiEditor-ui-left').css({'width':'','position':'','left':'','float':'','right':''});} |
637 | 646 | $.wikiEditor.modules.toc.fn.redraw(context,width);},disable:function(context){if(context.modules.toc.$toc.data('collapsed')){context.$ui.find('.wikiEditor-ui-toc-expandControl').hide();}else{if(context.modules.toc.$toc.data('positionMode')=='goofy'){$.wikiEditor.modules.toc.fn.switchLayout(context);} |
638 | | -context.$ui.find('.wikiEditor-ui-right').hide();context.$ui.find('.wikiEditor-ui-left').css('marginRight','').children().css('marginRight','');} |
| 647 | +context.$ui.find('.wikiEditor-ui-right').hide();context.$ui.find('.wikiEditor-ui-left').css($.wikiEditor.modules.toc.cfg.flexProperty,'').children().css($.wikiEditor.modules.toc.cfg.flexProperty,'');} |
639 | 648 | context.modules.toc.$toc.data('positionMode','disabled');},enable:function(context){context.modules.toc.$toc.data('positionMode','regular');if(context.modules.toc.$toc.data('collapsed')){context.$ui.find('.wikiEditor-ui-toc-expandControl').show();}else{context.$ui.find('.wikiEditor-ui-right').show();$.wikiEditor.modules.toc.fn.redraw(context,$.wikiEditor.modules.toc.cfg.minimumWidth);context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true,'restoreText':true});}},unhighlight:function(context){if(context){context.modules.toc.$toc.find('div').removeClass('current');}},update:function(context){var div=context.fn.beforeSelection('wikiEditor-toc-header');if(div===null){return;} |
640 | 649 | $.wikiEditor.modules.toc.fn.unhighlight(context);var section=div.data('section')||0;if(context.data.outline.length>0){var sectionLink=context.modules.toc.$toc.find('div.section-'+section);sectionLink.addClass('current');var relTop=sectionLink.offset().top-context.modules.toc.$toc.offset().top;var scrollTop=context.modules.toc.$toc.scrollTop();var divHeight=context.modules.toc.$toc.height();var sectionHeight=sectionLink.height();if(relTop<0) |
641 | 650 | context.modules.toc.$toc.scrollTop(scrollTop+relTop);else if(relTop+sectionHeight>divHeight) |
642 | 651 | context.modules.toc.$toc.scrollTop(scrollTop+relTop+sectionHeight-divHeight);}},collapse:function(event){var $this=$(this),context=$this.data('context');if(context.modules.toc.$toc.data('positionMode')=='goofy'){$.wikiEditor.modules.toc.fn.switchLayout(context);} |
643 | | -var pT=$this.parent().position().top-1;context.modules.toc.$toc.data('collapsed',true);context.$ui.find('.wikiEditor-ui-left').animate({'marginRight':'-1px'},'fast',function(){$(this).css('marginRight',0);}).children().animate({'marginRight':'1px'},'fast',function(){$(this).css('marginRight',0);});context.$ui.find('.wikiEditor-ui-right').css({'marginTop':'1px','position':'absolute','left':$.wikiEditor.modules.toc.cfg.rtl?0:'auto','right':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'top':pT}).fadeOut('fast',function(){$(this).hide().css({'marginTop':'0','width':'1px'});context.$ui.find('.wikiEditor-ui-toc-expandControl').fadeIn('fast');context.fn.trigger('tocCollapse');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',0);return false;},expand:function(event){var $this=$(this),context=$this.data('context'),openWidth=parseFloat(context.modules.toc.$toc.data('openWidth')),availableSpace=context.$wikitext.width()-parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth);if(availableSpace<$.wikiEditor.modules.toc.cfg.textMinmumWidth)return false;context.modules.toc.$toc.data('collapsed',false);if(availableSpace<openWidth)openWidth=availableSpace;context.$ui.find('.wikiEditor-ui-toc-expandControl').hide();context.$ui.find('.wikiEditor-ui-left').animate({'marginRight':(parseFloat(openWidth)*-1)},'fast').children().animate({'marginRight':openWidth},'fast');context.$ui.find('.wikiEditor-ui-right').show().css('marginTop','1px').animate({'width':openWidth},'fast',function(){context.$content.trigger('mouseup');$(this).css({'marginTop':'0','position':'relative','right':'auto','left':'auto','top':'auto'});context.fn.trigger('tocExpand');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',context.modules.toc.$toc.data('openWidth'));return false;},build:function(context){function buildStructure(outline,offset,level){if(offset==undefined)offset=0;if(level==undefined)level=1;var sections=[];for(var i=offset;i<outline.length;i++){if(outline[i].nLevel==level){var sub=buildStructure(outline,i+1,level+1);if(sub.length){outline[i].sections=sub;} |
| 652 | +var pT=$this.parent().position().top-1;context.modules.toc.$toc.data('collapsed',true);var leftParam={},leftChildParam={};leftParam[$.wikiEditor.modules.toc.cfg.flexProperty]='-1px';leftChildParam[$.wikiEditor.modules.toc.cfg.flexProperty]='1px';context.$ui.find('.wikiEditor-ui-left').animate(leftParam,'fast',function(){$(this).css($.wikiEditor.modules.toc.cfg.flexProperty,0);}).children().animate(leftChildParam,'fast',function(){$(this).css($.wikiEditor.modules.toc.cfg.flexProperty,0);});context.$ui.find('.wikiEditor-ui-right').css({'marginTop':'1px','position':'absolute','left':$.wikiEditor.modules.toc.cfg.rtl?0:'auto','right':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'top':pT}).fadeOut('fast',function(){$(this).hide().css({'marginTop':'0','width':'1px'});context.$ui.find('.wikiEditor-ui-toc-expandControl').fadeIn('fast');context.fn.trigger('tocCollapse');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',0);return false;},expand:function(event){var $this=$(this),context=$this.data('context'),openWidth=parseFloat(context.modules.toc.$toc.data('openWidth')),availableSpace=context.$wikitext.width()-parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth);if(availableSpace<$.wikiEditor.modules.toc.cfg.textMinmumWidth)return false;context.modules.toc.$toc.data('collapsed',false);if(availableSpace<openWidth)openWidth=availableSpace;context.$ui.find('.wikiEditor-ui-toc-expandControl').hide();var leftParam={},leftChildParam={};leftParam[$.wikiEditor.modules.toc.cfg.flexProperty]=parseFloat(openWidth)*-1;leftChildParam[$.wikiEditor.modules.toc.cfg.flexProperty]=openWidth;context.$ui.find('.wikiEditor-ui-left').animate(leftParam,'fast').children().animate(leftChildParam,'fast');context.$ui.find('.wikiEditor-ui-right').show().css('marginTop','1px').animate({'width':openWidth},'fast',function(){context.$content.trigger('mouseup');$(this).css({'marginTop':'0','position':'relative','right':'auto','left':'auto','top':'auto'});context.fn.trigger('tocExpand');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',context.modules.toc.$toc.data('openWidth'));return false;},build:function(context){function buildStructure(outline,offset,level){if(offset==undefined)offset=0;if(level==undefined)level=1;var sections=[];for(var i=offset;i<outline.length;i++){if(outline[i].nLevel==level){var sub=buildStructure(outline,i+1,level+1);if(sub.length){outline[i].sections=sub;} |
644 | 653 | sections[sections.length]=outline[i];}else if(outline[i].nLevel<level){break;}} |
645 | 654 | return sections;} |
646 | | -function buildList(structure){var list=$('<ul />');for(i in structure){var div=$('<div />').addClass('section-'+structure[i].index).data('index',structure[i].index).click(function(event){var wrapper=context.$content.find('.wikiEditor-toc-section-'+$(this).data('index'));if(wrapper.size()==0) |
| 655 | +function buildList(structure){var list=$('<ul />');for(i in structure){var div=$('<div />').addClass('section-'+structure[i].index).data('index',structure[i].index).mousedown(function(){return false;}).click(function(event){var wrapper=context.$content.find('.wikiEditor-toc-section-'+$(this).data('index'));if(wrapper.size()==0) |
647 | 656 | wrapper=context.$content;context.fn.scrollToTop(wrapper,true);context.$textarea.textSelection('setSelection',{'start':0,'startContainer':wrapper});$.wikiEditor.modules.toc.fn.unhighlight(context);$(this).addClass('current');if(typeof $.trackAction!='undefined') |
648 | 657 | $.trackAction('ntoc.heading');event.preventDefault();}).text(structure[i].text);if(structure[i].text=='') |
649 | 658 | div.html(' ');var item=$('<li />').append(div);if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));} |
650 | 659 | list.append(item);} |
651 | 660 | return list;} |
652 | | -function buildCollapseControls(){var $collapseControl=$('<div />'),$expandControl=$('<div />');$collapseControl.addClass('tab').addClass('tab-toc').append('<a href="#" />').bind('click.wikiEditor-toc',function(){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc');return false;}).find('a').text(mw.usability.getMsg('wikieditor-toc-hide'));$expandControl.addClass('wikiEditor-ui-toc-expandControl').append('<a href="#" />').bind('click.wikiEditor-toc',function(){context.modules.toc.$toc.trigger('expand.wikiEditor-toc');return false;}).hide().find('a').text(mw.usability.getMsg('wikieditor-toc-show'));$collapseControl.insertBefore(context.modules.toc.$toc);context.$ui.find('.wikiEditor-ui-left .wikiEditor-ui-top').append($expandControl);} |
| 661 | +function buildCollapseControls(){var $collapseControl=$('<div />'),$expandControl=$('<div />');$collapseControl.addClass('tab').addClass('tab-toc').append('<a href="#" />').mousedown(function(){return false;}).bind('click.wikiEditor-toc',function(){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc');return false;}).find('a').text(mw.usability.getMsg('wikieditor-toc-hide'));$expandControl.addClass('wikiEditor-ui-toc-expandControl').append('<a href="#" />').mousedown(function(){return false;}).bind('click.wikiEditor-toc',function(){context.modules.toc.$toc.trigger('expand.wikiEditor-toc');return false;}).hide().find('a').text(mw.usability.getMsg('wikieditor-toc-show'));$collapseControl.insertBefore(context.modules.toc.$toc);context.$ui.find('.wikiEditor-ui-left .wikiEditor-ui-top').append($expandControl);} |
653 | 662 | function buildResizeControls(){context.$ui.data('resizableDone',true).find('.wikiEditor-ui-right').data('wikiEditor-ui-left',context.$ui.find('.wikiEditor-ui-left')).resizable({handles:'w,e',preventPositionLeftChange:true,minWidth:parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth),start:function(e,ui){var $this=$(this);$('<div />').addClass('wikiEditor-ui-resize-mask').css({'position':'absolute','z-index':2,'left':0,'top':0,'bottom':0,'right':0}).appendTo(context.$ui.find('.wikiEditor-ui-left'));$this.resizable('option','maxWidth',$this.parent().width()- |
654 | | -parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth));if(context.modules.toc.$toc.data('positionMode')=='goofy'){$.wikiEditor.modules.toc.fn.switchLayout(context);}},resize:function(e,ui){$(this).css({'width':ui.size.width,'top':'auto','height':'auto'}).data('wikiEditor-ui-left').css('marginRight',(-1*ui.size.width)).children().css('marginRight',ui.size.width);context.fn.trigger('resize');},stop:function(e,ui){context.$ui.find('.wikiEditor-ui-resize-mask').remove();context.$content.trigger('mouseup');if(ui.size.width<=parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc');}else{context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true,'restoreText':true});context.modules.toc.$toc.data('openWidth',ui.size.width);$.cookie('wikiEditor-'+context.instance+'-toc-width',ui.size.width);} |
| 663 | +parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth));if(context.modules.toc.$toc.data('positionMode')=='goofy'){$.wikiEditor.modules.toc.fn.switchLayout(context);}},resize:function(e,ui){$(this).css({'width':ui.size.width,'top':'auto','height':'auto'}).data('wikiEditor-ui-left').css($.wikiEditor.modules.toc.cfg.flexProperty,(-1*ui.size.width)).children().css($.wikiEditor.modules.toc.cfg.flexProperty,ui.size.width);context.fn.trigger('resize');},stop:function(e,ui){context.$ui.find('.wikiEditor-ui-resize-mask').remove();context.$content.trigger('mouseup');if(ui.size.width<=parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc');}else{context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true,'restoreText':true});context.modules.toc.$toc.data('openWidth',ui.size.width);$.cookie('wikiEditor-'+context.instance+'-toc-width',ui.size.width);} |
655 | 664 | context.fn.trigger('resize');}});var handle=$.wikiEditor.modules.toc.cfg.rtl?'w':'e';context.$ui.find('.ui-resizable-'+handle).removeClass('ui-resizable-'+handle).addClass('ui-resizable-'+(handle=='w'?'e':'w')).addClass('wikiEditor-ui-toc-resize-grip');context.modules.toc.$toc.bind('collapse.wikiEditor-toc',$.wikiEditor.modules.toc.fn.collapse).bind('expand.wikiEditor-toc',$.wikiEditor.modules.toc.fn.expand);context.modules.toc.$toc.data('openWidth',$.wikiEditor.modules.toc.cfg.defaultWidth);if($.cookie('wikiEditor-'+context.instance+'-toc-width')==0){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc',{data:context});}else if($.cookie('wikiEditor-'+context.instance+'-toc-width')>0){var initialWidth=$.cookie('wikiEditor-'+context.instance+'-toc-width');if(initialWidth<parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)) |
656 | 665 | initialWidth=parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)+1;context.modules.toc.$toc.data('openWidth',initialWidth+'px');$.wikiEditor.modules.toc.fn.redraw(context,initialWidth);}} |
657 | 666 | if(context.data.outline){var outline=context.data.outline;var lastLevel=0;var nLevel=0;for(var i=0;i<outline.length;i++){if(outline[i].level>lastLevel){nLevel++;} |
— | — | @@ -683,22 +692,22 @@ |
684 | 693 | break;case'dialog':context.fn.saveSelection();context.$textarea.wikiEditor('openDialog',action.module);break;default:break;}},buildGroup:function(context,id,group){var $group=$('<div />').attr({'class':'group group-'+id,'rel':id});var label=$.wikiEditor.autoMsg(group,'label');if(label){$group.append('<div class="label">'+label+'</div>')} |
685 | 694 | var empty=true;if('tools'in group){for(tool in group.tools){var tool=$.wikiEditor.modules.toolbar.fn.buildTool(context,tool,group.tools[tool]);if(tool){empty=false;$group.append(tool);}}} |
686 | 695 | return empty?null:$group;},buildTool:function(context,id,tool){if('filters'in tool){for(filter in tool.filters){if($(tool.filters[filter]).size()==0){return null;}}} |
687 | | -var label=$.wikiEditor.autoMsg(tool,'label');switch(tool.type){case'button':var src=$.wikiEditor.autoIcon(tool.icon,$.wikiEditor.imgPath+'toolbar/');$button=$('<img />').attr({'src':src,'width':22,'height':22,'alt':label,'title':label,'rel':id,'class':'tool tool-button'});if('action'in tool){$button.data('action',tool.action).data('context',context).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));return false;});} |
688 | | -return $button;case'select':var $select=$('<div />').attr({'rel':id,'class':'tool tool-select'});$options=$('<div />').addClass('options');if('list'in tool){for(option in tool.list){var optionLabel=$.wikiEditor.autoMsg(tool.list[option],'label');$options.append($('<a />').data('action',tool.list[option].action).data('context',context).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));if($(this).parent().is(':visible')){$(this).parent().animate({'opacity':'toggle'},'fast');} |
| 696 | +var label=$.wikiEditor.autoMsg(tool,'label');switch(tool.type){case'button':var src=$.wikiEditor.autoIcon(tool.icon,$.wikiEditor.imgPath+'toolbar/');$button=$('<img />').attr({'src':src,'width':22,'height':22,'alt':label,'title':label,'rel':id,'class':'tool tool-button'});if('action'in tool){$button.data('action',tool.action).data('context',context).mousedown(function(){return false;}).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));return false;});} |
| 697 | +return $button;case'select':var $select=$('<div />').attr({'rel':id,'class':'tool tool-select'});$options=$('<div />').addClass('options');if('list'in tool){for(option in tool.list){var optionLabel=$.wikiEditor.autoMsg(tool.list[option],'label');$options.append($('<a />').data('action',tool.list[option].action).data('context',context).mousedown(function(){return false;}).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));if($(this).parent().is(':visible')){$(this).parent().animate({'opacity':'toggle'},'fast');} |
689 | 698 | return false;}).text(optionLabel).addClass('option').attr({'rel':option,'href':'#'}));}} |
690 | | -$select.append($('<div />').addClass('menu').append($options));$select.append($('<a />').addClass('label').text(label).data('options',$options).attr('href','#').click(function(){$(this).data('options').animate({'opacity':'toggle'},'fast');return false;}));return $select;default:return null;}},buildBookmark:function(context,id,page){var label=$.wikiEditor.autoMsg(page,'label');return $('<div />').text(label).attr('rel',id).data('context',context).bind('mousedown',function(){$(this).parent().parent().find('.page').hide();$(this).parent().parent().find('.page-'+$(this).attr('rel')).show();$(this).siblings().removeClass('current');$(this).addClass('current');var section=$(this).parent().parent().attr('rel');if($.trackAction!=undefined){$.trackAction(section+'.'+$(this).attr('rel'));} |
691 | | -$.cookie('wikiEditor-'+$(this).data('context').instance+'-booklet-'+section+'-page',$(this).attr('rel'));});},buildPage:function(context,id,page){var $page=$('<div />').attr({'class':'page page-'+id,'rel':id});switch(page.layout){case'table':$page.addClass('page-table');var html='<table cellpadding=0 cellspacing=0 '+'border=0 width="100%" class="table table-"'+id+'">';if('headings'in page){html+=$.wikiEditor.modules.toolbar.fn.buildHeading(context,page.headings)} |
| 699 | +$select.append($('<div />').addClass('menu').append($options));$select.append($('<a />').addClass('label').text(label).data('options',$options).attr('href','#').mousedown(function(){return false;}).click(function(){$(this).data('options').animate({'opacity':'toggle'},'fast');return false;}));return $select;default:return null;}},buildBookmark:function(context,id,page){var label=$.wikiEditor.autoMsg(page,'label');return $('<div />').text(label).attr('rel',id).data('context',context).mousedown(function(){return false;}).click(function(event){$(this).parent().parent().find('.page').hide();$(this).parent().parent().find('.page-'+$(this).attr('rel')).show();$(this).siblings().removeClass('current');$(this).addClass('current');var section=$(this).parent().parent().attr('rel');$.cookie('wikiEditor-'+$(this).data('context').instance+'-booklet-'+section+'-page',$(this).attr('rel'));if($.trackAction!=undefined){$.trackAction(section+'.'+$(this).attr('rel'));} |
| 700 | +return false;})},buildPage:function(context,id,page){var $page=$('<div />').attr({'class':'page page-'+id,'rel':id});switch(page.layout){case'table':$page.addClass('page-table');var html='<table cellpadding=0 cellspacing=0 '+'border=0 width="100%" class="table table-"'+id+'">';if('headings'in page){html+=$.wikiEditor.modules.toolbar.fn.buildHeading(context,page.headings)} |
692 | 701 | if('rows'in page){for(row in page.rows){html+=$.wikiEditor.modules.toolbar.fn.buildRow(context,page.rows[row])}} |
693 | 702 | $page.html(html);break;case'characters':$page.addClass('page-characters');$characters=$('<div />').data('context',context).data('actions',{});var actions=$characters.data('actions');if('language'in page){$characters.attr('lang',page.language);} |
694 | 703 | if('direction'in page){$characters.attr('dir',page.direction);} |
695 | 704 | if('characters'in page){var html='';for(character in page.characters){html+=$.wikiEditor.modules.toolbar.fn.buildCharacter(page.characters[character],actions);} |
696 | | -$characters.html(html).children().click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')],$(this));return false;});} |
| 705 | +$characters.html(html).children().mousedown(function(){return false;}).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')],$(this));return false;});} |
697 | 706 | $page.append($characters);break;} |
698 | 707 | return $page;},buildHeading:function(context,headings){var html='<tr>';for(heading in headings){html+='<th>'+$.wikiEditor.autoMsg(headings[heading],['html','text'])+'</th>';} |
699 | 708 | return html;},buildRow:function(context,row){var html='<tr>';for(cell in row){html+='<td class="cell cell-'+cell+'" valign="top"><span>'+ |
700 | 709 | $.wikiEditor.autoMsg(row[cell],['html','text'])+'</span></td>';} |
701 | 710 | html+='</tr>';return html;},buildCharacter:function(character,actions){if(typeof character=='string'){character={'label':character,'action':{'type':'encapsulate','options':{'pre':character}}};}else if(0 in character&&1 in character){character={'label':character[0],'action':{'type':'encapsulate','options':{'pre':character[1]}}};} |
702 | | -if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).bind('mouseup',function(e){$(this).blur();}).bind('click',function(e){var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.fadeIn('fast');$sections.css('display','block').animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');context.fn.trigger('resize');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':'hide'},$section.outerHeight()*2,function(){$(this).css({'overflow':'visible','height':0});context.fn.trigger('resize');});} |
| 711 | +if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).mouseup(function(e){$(this).blur();}).mousedown(function(){return false;}).click(function(e){var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.fadeIn('fast');$sections.css('display','block').animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');context.fn.trigger('resize');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':'hide'},$section.outerHeight()*2,function(){$(this).css({'overflow':'visible','height':0});context.fn.trigger('resize');});} |
703 | 712 | if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));} |
704 | 713 | $.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);return false;}));},buildSection:function(context,id,section){context.$textarea.trigger('wikiEditor-toolbar-buildSection-'+id,[section]);var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');var $section;switch(section.type){case'toolbar':var $section=$('<div />').attr({'class':'toolbar section section-'+id,'rel':id});if('groups'in section){for(group in section.groups){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,section.groups[group]));}} |
705 | 714 | break;case'booklet':var $pages=$('<div />').addClass('pages');var $index=$('<div />').addClass('index');if('pages'in section){for(page in section.pages){$pages.append($.wikiEditor.modules.toolbar.fn.buildPage(context,page,section.pages[page]));$index.append($.wikiEditor.modules.toolbar.fn.buildBookmark(context,page,section.pages[page]));}} |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -305,7 +305,7 @@ |
306 | 306 | */ |
307 | 307 | // Intercept all tab events to provide consisten behavior across browsers |
308 | 308 | // Webkit browsers insert tab characters by default into the iframe rather than changing input focus |
309 | | - case 9: |
| 309 | + case 9: //tab |
310 | 310 | // if any modifier keys are pressed, allow the browser to do it's thing |
311 | 311 | if ( event.ctrlKey || event.altKey || event.shiftKey ) { |
312 | 312 | return true; |
— | — | @@ -322,8 +322,15 @@ |
323 | 323 | return false; |
324 | 324 | } |
325 | 325 | break; |
| 326 | + case 86: //v |
| 327 | + if ( event.ctrlKey ){ |
| 328 | + //paste, intercepted for IE |
| 329 | + context.evt.paste( event ); |
| 330 | + } |
| 331 | + break; |
326 | 332 | } |
327 | 333 | return true; |
| 334 | + |
328 | 335 | }, |
329 | 336 | 'change': function( event ) { |
330 | 337 | event.data.scope = 'division'; |
— | — | @@ -361,6 +368,29 @@ |
362 | 369 | } |
363 | 370 | } |
364 | 371 | return true; |
| 372 | + }, |
| 373 | + 'paste': function( event ) { |
| 374 | + context.$content.find( ':not(.wikiEditor)' ).addClass( 'wikiEditor' ); |
| 375 | + setTimeout( function() { |
| 376 | + var $selection = context.$content.find( ':not(.wikiEditor)' ); |
| 377 | + while ( $selection.length && $selection.length > 0 ) { |
| 378 | + var $currentElement = $selection.eq( 0 ); |
| 379 | + while ( !$currentElement.parent().is( 'body' ) && !$currentElement.parent().is( '.wikiEditor' ) ) { |
| 380 | + $currentElement = $currentElement.parent(); |
| 381 | + } |
| 382 | + if ( $currentElement.is( 'br' ) ) { |
| 383 | + $currentElement.addClass( 'wikiEditor' ); |
| 384 | + } else { |
| 385 | + $( '<p></p>' ) |
| 386 | + .text( $currentElement.text() ) |
| 387 | + .addClass( 'wikiEditor' ) |
| 388 | + .insertAfter( $currentElement ); |
| 389 | + $currentElement.remove(); |
| 390 | + } |
| 391 | + $selection = context.$content.find( ':not(.wikiEditor)' ); |
| 392 | + } |
| 393 | + }, 0 ); |
| 394 | + return true; |
365 | 395 | } |
366 | 396 | }; |
367 | 397 | |
— | — | @@ -425,6 +455,10 @@ |
426 | 456 | .addClass( context.view == options.name ? 'current' : null ) |
427 | 457 | .append( $( '<a></a>' ) |
428 | 458 | .attr( 'href', '#' ) |
| 459 | + .mousedown( function() { |
| 460 | + // No dragging! |
| 461 | + return false; |
| 462 | + } ) |
429 | 463 | .click( function( event ) { |
430 | 464 | context.$ui.find( '.wikiEditor-ui-view' ).hide(); |
431 | 465 | context.$ui.find( '.' + $(this).parent().attr( 'rel' ) ).show(); |
— | — | @@ -483,30 +517,30 @@ |
484 | 518 | // Converting <p>s is wrong if there's nothing before them, so check that. |
485 | 519 | // .find( '* + p' ) isn't good enough because textnodes aren't considered |
486 | 520 | $pre.find( 'p' ).each( function() { |
487 | | - var text = $( this ).text(); |
488 | | - // If this <p> is preceded by some text, add a \n at the beginning, and if |
489 | | - // it's followed by a textnode, add a \n at the end |
490 | | - // We need the traverser because there can be other weird stuff in between |
491 | | - |
492 | | - // Check for preceding text |
493 | | - var t = new context.fn.rawTraverser( this.firstChild, 0, this, $pre.get( 0 ) ).prev(); |
494 | | - while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { |
495 | | - t = t.prev(); |
496 | | - } |
497 | | - if ( t ) { |
498 | | - text = "\n" + text; |
499 | | - } |
500 | | - |
501 | | - // Check for following text |
502 | | - t = new context.fn.rawTraverser( this.lastChild, 0, this, $pre.get( 0 ) ).next(); |
503 | | - while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { |
504 | | - t = t.next(); |
505 | | - } |
506 | | - if ( t && !t.inP && t.node.nodeName == '#text' && t.node.nodeValue.charAt( 0 ) != '\n' |
507 | | - && t.node.nodeValue.charAt( 0 ) != '\r' ) { |
508 | | - text += "\n"; |
509 | | - } |
510 | | - $( this ).text( text ); |
| 521 | + var text = $( this ).text(); |
| 522 | + // If this <p> is preceded by some text, add a \n at the beginning, and if |
| 523 | + // it's followed by a textnode, add a \n at the end |
| 524 | + // We need the traverser because there can be other weird stuff in between |
| 525 | + |
| 526 | + // Check for preceding text |
| 527 | + var t = new context.fn.rawTraverser( this.firstChild, 0, this, $pre.get( 0 ) ).prev(); |
| 528 | + while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { |
| 529 | + t = t.prev(); |
| 530 | + } |
| 531 | + if ( t ) { |
| 532 | + text = "\n" + text; |
| 533 | + } |
| 534 | + |
| 535 | + // Check for following text |
| 536 | + t = new context.fn.rawTraverser( this.lastChild, 0, this, $pre.get( 0 ) ).next(); |
| 537 | + while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { |
| 538 | + t = t.next(); |
| 539 | + } |
| 540 | + if ( t && !t.inP && t.node.nodeName == '#text' && t.node.nodeValue.charAt( 0 ) != '\n' |
| 541 | + && t.node.nodeValue.charAt( 0 ) != '\r' ) { |
| 542 | + text += "\n"; |
| 543 | + } |
| 544 | + $( this ).text( text ); |
511 | 545 | } ); |
512 | 546 | var retval; |
513 | 547 | if ( $.browser.msie ) { |
— | — | @@ -590,6 +624,7 @@ |
591 | 625 | var selText = $(this).textSelection( 'getSelection' ); |
592 | 626 | var selTextArr; |
593 | 627 | var selectAfter = false; |
| 628 | + var setSelectionTo = null; |
594 | 629 | var pre = options.pre, post = options.post; |
595 | 630 | if ( !selText ) { |
596 | 631 | selText = options.peri; |
— | — | @@ -659,16 +694,57 @@ |
660 | 695 | range.extractContents(); |
661 | 696 | // Insert the contents one line at a time - insertNode() inserts at the beginning, so this has to happen |
662 | 697 | // in reverse order |
663 | | - var lastNode; |
| 698 | + // Track the first and last inserted node, and if we need to also track where the text we need to select |
| 699 | + // afterwards starts and ends |
| 700 | + var firstNode = null, lastNode = null; |
| 701 | + var selSC = null, selEC = null, selSO = null, selEO = null, offset = 0; |
664 | 702 | for ( var i = insertLines.length - 1; i >= 0; i-- ) { |
665 | | - range.insertNode( context.$iframe[0].contentWindow.document.createTextNode( insertLines[i] ) ); |
| 703 | + firstNode = context.$iframe[0].contentWindow.document.createTextNode( insertLines[i] ); |
| 704 | + range.insertNode( firstNode ); |
| 705 | + lastNode = lastNode || firstNode; |
| 706 | + var newOffset = offset + insertLines[i].length; |
| 707 | + if ( !selSC && pre.length < newOffset ) { |
| 708 | + selSC = firstNode; |
| 709 | + selSO = pre.length - offset; |
| 710 | + } |
| 711 | + if ( selSC && insertText.length - post.length < newOffset ) { |
| 712 | + selEC = firstNode; |
| 713 | + selEO = insertText.length - pre.length - offset; |
| 714 | + } |
| 715 | + offset = newOffset; |
666 | 716 | if ( i > 0 ) { |
667 | | - lastNode = range.insertNode( context.$iframe[0].contentWindow.document.createElement( 'br' ) ); |
| 717 | + firstNode = context.$iframe[0].contentWindow.document.createElement( 'br' ); |
| 718 | + range.insertNode( firstNode ); |
| 719 | + newOffset = offset + 1; |
| 720 | + if ( !selSC && pre.length < newOffset ) { |
| 721 | + selSC = firstNode; |
| 722 | + selSO = pre.length - offset; |
| 723 | + } |
| 724 | + if ( selSC && insertText.length - post.length < newOffset ) { |
| 725 | + selEC = firstNode; |
| 726 | + selEO = insertText.length - pre.length - offset; |
| 727 | + } |
| 728 | + offset = newOffset; |
668 | 729 | } |
669 | 730 | } |
670 | | - if ( lastNode ) { |
671 | | - context.fn.scrollToTop( lastNode ); |
| 731 | + if ( firstNode ) { |
| 732 | + context.fn.scrollToTop( $( firstNode.parentNode ) ); |
672 | 733 | } |
| 734 | + if ( selectAfter ) { |
| 735 | + setSelectionTo = { |
| 736 | + startContainer: selSC, |
| 737 | + endContainer: selEC, |
| 738 | + start: selSO, |
| 739 | + end: selEO |
| 740 | + }; |
| 741 | + } else if ( lastNode ) { |
| 742 | + setSelectionTo = { |
| 743 | + startContainer: lastNode, |
| 744 | + endContainer: lastNode, |
| 745 | + start: lastNode.nodeValue.length, |
| 746 | + end: lastNode.nodeValue.length |
| 747 | + }; |
| 748 | + } |
673 | 749 | } else if ( context.$iframe[0].contentWindow.document.selection ) { |
674 | 750 | // IE |
675 | 751 | context.$iframe[0].contentWindow.focus(); |
— | — | @@ -711,7 +787,16 @@ |
712 | 788 | .replace( />/g, '>' ) |
713 | 789 | .replace( /\r?\n/g, '<br />' ) |
714 | 790 | ); |
| 791 | + if ( selectAfter ) { |
| 792 | + range.moveStart( 'character', -post.length - selText.length ); |
| 793 | + range.moveEnd( 'character', -post.length ); |
| 794 | + range.select(); |
| 795 | + } |
715 | 796 | } |
| 797 | + |
| 798 | + if ( setSelectionTo ) { |
| 799 | + context.fn.setSelection( setSelectionTo ); |
| 800 | + } |
716 | 801 | // Trigger the encapsulateSelection event (this might need to get named something else/done differently) |
717 | 802 | $( context.$iframe[0].contentWindow.document ).trigger( |
718 | 803 | 'encapsulateSelection', [ pre, options.peri, post, options.ownline, options.replace ] |
— | — | @@ -1140,13 +1225,20 @@ |
1141 | 1226 | * as a response to the "resize" event. |
1142 | 1227 | */ |
1143 | 1228 | |
| 1229 | + // Assemble a temporary div to place over the wikiEditor while it's being constructed |
| 1230 | + var $loader = $( '<div></div>' ) |
| 1231 | + .addClass( 'wikiEditor-ui-loading' ) |
| 1232 | + .append( $( '<span>' + mw.usability.getMsg( 'wikieditor-loading' ) + '</span>' ) |
| 1233 | + .css( 'marginTop', context.$textarea.height() / 2 ) ); |
1144 | 1234 | // Encapsulate the textarea with some containers for layout |
1145 | 1235 | context.$textarea |
1146 | | - .wrap( $( '<div></div>' ).addClass( 'wikiEditor-ui' ) ) |
1147 | | - .wrap( $( '<div></div>' ).addClass( 'wikiEditor-ui-view wikiEditor-ui-view-wikitext' ) ) |
1148 | | - .wrap( $( '<div></div>' ).addClass( 'wikiEditor-ui-left' ) ) |
1149 | | - .wrap( $( '<div></div>' ).addClass( 'wikiEditor-ui-bottom' ) ) |
1150 | | - .wrap( $( '<div></div>' ).addClass( 'wikiEditor-ui-text' ) ); |
| 1236 | + .after( $loader ) |
| 1237 | + .add( $loader ) |
| 1238 | + .wrapAll( $( '<div></div>' ).addClass( 'wikiEditor-ui' ) ) |
| 1239 | + .wrapAll( $( '<div></div>' ).addClass( 'wikiEditor-ui-view wikiEditor-ui-view-wikitext' ) ) |
| 1240 | + .wrapAll( $( '<div></div>' ).addClass( 'wikiEditor-ui-left' ) ) |
| 1241 | + .wrapAll( $( '<div></div>' ).addClass( 'wikiEditor-ui-bottom' ) ) |
| 1242 | + .wrapAll( $( '<div></div>' ).addClass( 'wikiEditor-ui-text' ) ); |
1151 | 1243 | // Get references to some of the newly created containers |
1152 | 1244 | context.$ui = context.$textarea.parent().parent().parent().parent().parent(); |
1153 | 1245 | context.$wikitext = context.$textarea.parent().parent().parent().parent(); |
— | — | @@ -1234,11 +1326,11 @@ |
1235 | 1327 | // We also need to unescape the doubly-escaped things mentioned above |
1236 | 1328 | html = $( '<div />' ).text( '<p>' + html.replace( /\r?\n/g, '</p><p>' ) + '</p>' ).html() |
1237 | 1329 | .replace( /&nbsp;/g, ' ' ) |
1238 | | - // Allow p tags to survive encoding |
| 1330 | + // Allow <p> tags to survive encoding |
1239 | 1331 | .replace( /<p>/g, '<p>' ) |
1240 | 1332 | .replace( /<\/p>/g, '</p>' ) |
1241 | | - // Empty p tags should just be br tags |
1242 | | - .replace( /<p><\/p>/g, '<br>' ) |
| 1333 | + // Empty <p> tags need <br> tags in them |
| 1334 | + .replace( /<p><\/p>/g, '<p><br></p>' ) |
1243 | 1335 | // Unescape &esc; stuff |
1244 | 1336 | .replace( /&esc;&amp;nbsp;/g, '&nbsp;' ) |
1245 | 1337 | .replace( /&esc;&lt;p&gt;/g, '<p>' ) |
— | — | @@ -1260,15 +1352,22 @@ |
1261 | 1353 | context.$iframe.show(); |
1262 | 1354 | // Let modules know we're ready to start working with the content |
1263 | 1355 | context.fn.trigger( 'ready' ); |
| 1356 | + //remove our temporary loading |
| 1357 | + $( '.wikiEditor-ui-loading' ).fadeOut( 'fast', function() { |
| 1358 | + $( this ).remove(); |
| 1359 | + } ); |
1264 | 1360 | // Setup event handling on the iframe |
1265 | 1361 | $( context.$iframe[0].contentWindow.document ) |
1266 | 1362 | .bind( 'keydown', function( event ) { |
1267 | 1363 | return context.fn.trigger( 'keydown', event ); |
1268 | 1364 | } ) |
1269 | | - .bind( 'keyup mouseup paste cut encapsulateSelection', function( event ) { |
| 1365 | + .bind( 'paste', function( event ) { |
| 1366 | + return context.fn.trigger( 'paste', event ); |
| 1367 | + } ) |
| 1368 | + .bind( 'keyup paste mouseup cut encapsulateSelection', function( event ) { |
1270 | 1369 | return context.fn.trigger( 'change', event ); |
1271 | 1370 | } ) |
1272 | | - .delayedBind( 250, 'keyup mouseup paste cut encapsulateSelection', function( event ) { |
| 1371 | + .delayedBind( 250, 'keyup paste mouseup cut encapsulateSelection', function( event ) { |
1273 | 1372 | context.fn.trigger( 'delayedChange', event ); |
1274 | 1373 | } ); |
1275 | 1374 | } ); |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js |
— | — | @@ -307,6 +307,10 @@ |
308 | 308 | $button |
309 | 309 | .data( 'action', tool.action ) |
310 | 310 | .data( 'context', context ) |
| 311 | + .mousedown( function() { |
| 312 | + // No dragging! |
| 313 | + return false; |
| 314 | + } ) |
311 | 315 | .click( function() { |
312 | 316 | $.wikiEditor.modules.toolbar.fn.doAction( |
313 | 317 | $(this).data( 'context' ), $(this).data( 'action' ), $(this) |
— | — | @@ -326,6 +330,10 @@ |
327 | 331 | $( '<a />' ) |
328 | 332 | .data( 'action', tool.list[option].action ) |
329 | 333 | .data( 'context', context ) |
| 334 | + .mousedown( function() { |
| 335 | + // No dragging! |
| 336 | + return false; |
| 337 | + } ) |
330 | 338 | .click( function() { |
331 | 339 | $.wikiEditor.modules.toolbar.fn.doAction( |
332 | 340 | $(this).data( 'context' ), $(this).data( 'action' ), $(this) |
— | — | @@ -350,6 +358,10 @@ |
351 | 359 | .text( label ) |
352 | 360 | .data( 'options', $options ) |
353 | 361 | .attr( 'href', '#' ) |
| 362 | + .mousedown( function() { |
| 363 | + // No dragging! |
| 364 | + return false; |
| 365 | + } ) |
354 | 366 | .click( function() { |
355 | 367 | $(this).data( 'options' ).animate( { 'opacity': 'toggle' }, 'fast' ); |
356 | 368 | return false; |
— | — | @@ -367,23 +379,27 @@ |
368 | 380 | .text( label ) |
369 | 381 | .attr( 'rel', id ) |
370 | 382 | .data( 'context', context ) |
371 | | - .bind( 'mousedown', function() { |
| 383 | + .mousedown( function() { |
| 384 | + // No dragging! |
| 385 | + return false; |
| 386 | + } ) |
| 387 | + .click( function( event ) { |
372 | 388 | $(this).parent().parent().find( '.page' ).hide(); |
373 | 389 | $(this).parent().parent().find( '.page-' + $(this).attr( 'rel' ) ).show(); |
374 | 390 | $(this).siblings().removeClass( 'current' ); |
375 | 391 | $(this).addClass( 'current' ); |
376 | 392 | var section = $(this).parent().parent().attr( 'rel' ); |
377 | | - |
378 | | - //click tracking |
379 | | - if($.trackAction != undefined){ |
380 | | - $.trackAction(section + '.' + $(this).attr('rel')); |
381 | | - } |
382 | | - |
383 | 393 | $.cookie( |
384 | 394 | 'wikiEditor-' + $(this).data( 'context' ).instance + '-booklet-' + section + '-page', |
385 | 395 | $(this).attr( 'rel' ) |
386 | 396 | ); |
387 | | - } ); |
| 397 | + // Click tracking |
| 398 | + if($.trackAction != undefined){ |
| 399 | + $.trackAction(section + '.' + $(this).attr('rel')); |
| 400 | + } |
| 401 | + // No dragging! |
| 402 | + return false; |
| 403 | + } ) |
388 | 404 | }, |
389 | 405 | buildPage : function( context, id, page ) { |
390 | 406 | var $page = $( '<div />' ).attr( { |
— | — | @@ -423,6 +439,10 @@ |
424 | 440 | $characters |
425 | 441 | .html( html ) |
426 | 442 | .children() |
| 443 | + .mousedown( function() { |
| 444 | + // No dragging! |
| 445 | + return false; |
| 446 | + } ) |
427 | 447 | .click( function() { |
428 | 448 | $.wikiEditor.modules.toolbar.fn.doAction( |
429 | 449 | $(this).parent().data( 'context' ), |
— | — | @@ -490,10 +510,14 @@ |
491 | 511 | .attr( 'href', '#' ) |
492 | 512 | .text( $.wikiEditor.autoMsg( section, 'label' ) ) |
493 | 513 | .data( 'context', context ) |
494 | | - .bind( 'mouseup', function( e ) { |
| 514 | + .mouseup( function( e ) { |
495 | 515 | $(this).blur(); |
496 | 516 | } ) |
497 | | - .bind( 'click', function( e ) { |
| 517 | + .mousedown( function() { |
| 518 | + // No dragging! |
| 519 | + return false; |
| 520 | + } ) |
| 521 | + .click( function( e ) { |
498 | 522 | var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); |
499 | 523 | var $section = |
500 | 524 | $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -11,6 +11,8 @@ |
12 | 12 | minimumWidth: '70px', |
13 | 13 | // Minimum width of the wikiText area |
14 | 14 | textMinimumWidth: '450px', |
| 15 | + // The style property to be used for positioning the flexible module in regular mode |
| 16 | + flexProperty: 'marginRight', |
15 | 17 | // Boolean var indicating text direction |
16 | 18 | rtl: false |
17 | 19 | }, |
— | — | @@ -143,7 +145,7 @@ |
144 | 146 | return; |
145 | 147 | } |
146 | 148 | $.wikiEditor.modules.toc.cfg.rtl = config.rtl; |
147 | | - |
| 149 | + $.wikiEditor.modules.toc.cfg.flexProperty = config.rtl ? 'marginLeft' : 'marginRight'; |
148 | 150 | var height = context.$ui.find( '.wikiEditor-ui-left' ).height(); |
149 | 151 | context.modules.toc.$toc = $( '<div />' ) |
150 | 152 | .addClass( 'wikiEditor-ui-toc' ) |
— | — | @@ -165,9 +167,9 @@ |
166 | 168 | context.$ui.find( '.wikiEditor-ui-right' ) |
167 | 169 | .css( 'width', fixedWidth + 'px' ); |
168 | 170 | context.$ui.find( '.wikiEditor-ui-left' ) |
169 | | - .css( 'marginRight', ( -1 * fixedWidth ) + 'px' ) |
| 171 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, ( -1 * fixedWidth ) + 'px' ) |
170 | 172 | .children() |
171 | | - .css( 'marginRight', fixedWidth + 'px' ); |
| 173 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, fixedWidth + 'px' ); |
172 | 174 | } else if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { |
173 | 175 | context.$ui.find( '.wikiEditor-ui-left' ) |
174 | 176 | .css( 'width', fixedWidth ); |
— | — | @@ -189,11 +191,12 @@ |
190 | 192 | width = $.wikiEditor.modules.toc.cfg.textMinimumWidth; |
191 | 193 | // set our styles for goofy mode |
192 | 194 | context.$ui.find( '.wikiEditor-ui-left' ) |
193 | | - .css( { 'marginRight': '', 'position': 'absolute', 'float': 'none', |
| 195 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, '') |
| 196 | + .css( { 'position': 'absolute', 'float': 'none', |
194 | 197 | 'left': $.wikiEditor.modules.toc.cfg.rtl ? 'auto': 0, |
195 | 198 | 'right' : $.wikiEditor.modules.toc.cfg.rtl ? 0 : 'auto' } ) |
196 | 199 | .children() |
197 | | - .css( 'marginRight', '' ); |
| 200 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, '' ); |
198 | 201 | context.$ui.find( '.wikiEditor-ui-right' ) |
199 | 202 | .css( { 'width': 'auto', 'position': 'absolute', 'float': 'none', |
200 | 203 | 'right': $.wikiEditor.modules.toc.cfg.rtl ? 'auto': 0, |
— | — | @@ -212,7 +215,8 @@ |
213 | 216 | context.$wikitext |
214 | 217 | .css( { 'position': '', 'height': '' } ); |
215 | 218 | context.$ui.find( '.wikiEditor-ui-right' ) |
216 | | - .css( { 'marginRight': '', 'position': '', 'left': '', 'right': '', 'float': '', 'top': '', 'height': '' } ); |
| 219 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, '' ) |
| 220 | + .css( { 'position': '', 'left': '', 'right': '', 'float': '', 'top': '', 'height': '' } ); |
217 | 221 | context.$ui.find( '.wikiEditor-ui-left' ) |
218 | 222 | .css( { 'width': '', 'position': '', 'left': '', 'float': '', 'right': '' } ); |
219 | 223 | } |
— | — | @@ -227,9 +231,9 @@ |
228 | 232 | } |
229 | 233 | context.$ui.find( '.wikiEditor-ui-right' ).hide(); |
230 | 234 | context.$ui.find( '.wikiEditor-ui-left' ) |
231 | | - .css( 'marginRight', '' ) |
| 235 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, '' ) |
232 | 236 | .children() |
233 | | - .css( 'marginRight', '' ); |
| 237 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, '' ); |
234 | 238 | } |
235 | 239 | context.modules.toc.$toc.data( 'positionMode', 'disabled' ); |
236 | 240 | }, |
— | — | @@ -296,13 +300,16 @@ |
297 | 301 | } |
298 | 302 | var pT = $this.parent().position().top - 1; |
299 | 303 | context.modules.toc.$toc.data( 'collapsed', true ); |
| 304 | + var leftParam = {}, leftChildParam = {}; |
| 305 | + leftParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = '-1px'; |
| 306 | + leftChildParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = '1px'; |
300 | 307 | context.$ui.find( '.wikiEditor-ui-left' ) |
301 | | - .animate( { 'marginRight': '-1px' }, 'fast', function() { |
302 | | - $( this ).css( 'marginRight', 0 ); |
| 308 | + .animate( leftParam, 'fast', function() { |
| 309 | + $( this ).css( $.wikiEditor.modules.toc.cfg.flexProperty, 0 ); |
303 | 310 | } ) |
304 | 311 | .children() |
305 | | - .animate( { 'marginRight': '1px' }, 'fast', function() { |
306 | | - $( this ).css( 'marginRight', 0 ); |
| 312 | + .animate( leftChildParam, 'fast', function() { |
| 313 | + $( this ).css( $.wikiEditor.modules.toc.cfg.flexProperty, 0 ); |
307 | 314 | } ); |
308 | 315 | context.$ui.find( '.wikiEditor-ui-right' ) |
309 | 316 | .css( { |
— | — | @@ -339,10 +346,13 @@ |
340 | 347 | // check if we've got enough room to open to our stored width |
341 | 348 | if ( availableSpace < openWidth ) openWidth = availableSpace; |
342 | 349 | context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).hide(); |
| 350 | + var leftParam = {}, leftChildParam = {}; |
| 351 | + leftParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = parseFloat( openWidth ) * -1; |
| 352 | + leftChildParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = openWidth; |
343 | 353 | context.$ui.find( '.wikiEditor-ui-left' ) |
344 | | - .animate( { 'marginRight': ( parseFloat( openWidth ) * -1 ) }, 'fast' ) |
| 354 | + .animate( leftParam, 'fast' ) |
345 | 355 | .children() |
346 | | - .animate( { 'marginRight': openWidth }, 'fast' ); |
| 356 | + .animate( leftChildParam, 'fast' ); |
347 | 357 | context.$ui.find( '.wikiEditor-ui-right' ) |
348 | 358 | .show() |
349 | 359 | .css( 'marginTop', '1px' ) |
— | — | @@ -400,6 +410,10 @@ |
401 | 411 | var div = $( '<div />' ) |
402 | 412 | .addClass( 'section-' + structure[i].index ) |
403 | 413 | .data( 'index', structure[i].index ) |
| 414 | + .mousedown( function() { |
| 415 | + // No dragging! |
| 416 | + return false; |
| 417 | + } ) |
404 | 418 | .click( function( event ) { |
405 | 419 | var wrapper = context.$content.find( |
406 | 420 | '.wikiEditor-toc-section-' + $( this ).data( 'index' ) ); |
— | — | @@ -439,6 +453,10 @@ |
440 | 454 | .addClass( 'tab' ) |
441 | 455 | .addClass( 'tab-toc' ) |
442 | 456 | .append( '<a href="#" />' ) |
| 457 | + .mousedown( function() { |
| 458 | + // No dragging! |
| 459 | + return false; |
| 460 | + } ) |
443 | 461 | .bind( 'click.wikiEditor-toc', function() { |
444 | 462 | context.modules.toc.$toc.trigger( 'collapse.wikiEditor-toc' ); return false; |
445 | 463 | } ) |
— | — | @@ -447,6 +465,10 @@ |
448 | 466 | $expandControl |
449 | 467 | .addClass( 'wikiEditor-ui-toc-expandControl' ) |
450 | 468 | .append( '<a href="#" />' ) |
| 469 | + .mousedown( function() { |
| 470 | + // No dragging! |
| 471 | + return false; |
| 472 | + } ) |
451 | 473 | .bind( 'click.wikiEditor-toc', function() { |
452 | 474 | context.modules.toc.$toc.trigger( 'expand.wikiEditor-toc' ); return false; |
453 | 475 | } ) |
— | — | @@ -492,8 +514,9 @@ |
493 | 515 | // for some odd reason, ui.size.width seems a step ahead of what the *actual* width of |
494 | 516 | // the resizable is |
495 | 517 | $( this ).css( { 'width': ui.size.width, 'top': 'auto', 'height': 'auto' } ) |
496 | | - .data( 'wikiEditor-ui-left' ).css( 'marginRight', ( -1 * ui.size.width ) ) |
497 | | - .children().css( 'marginRight', ui.size.width ); |
| 518 | + .data( 'wikiEditor-ui-left' ) |
| 519 | + .css( $.wikiEditor.modules.toc.cfg.flexProperty, ( -1 * ui.size.width ) ) |
| 520 | + .children().css( $.wikiEditor.modules.toc.cfg.flexProperty, ui.size.width ); |
498 | 521 | // Let the UI know things have moved around |
499 | 522 | context.fn.trigger( 'resize' ); |
500 | 523 | }, |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -21,19 +21,19 @@ |
22 | 22 | array( 'src' => 'css/suggestions.css', 'version' => 6 ), |
23 | 23 | array( 'src' => 'css/vector.collapsibleNav.css', 'version' => 7 ), |
24 | 24 | array( 'src' => 'css/vector.footerCleanup.css', 'version' => 1 ), |
25 | | - array( 'src' => 'css/wikiEditor.css', 'version' => 9 ), |
| 25 | + array( 'src' => 'css/wikiEditor.css', 'version' => 11 ), |
26 | 26 | array( 'src' => 'css/wikiEditor.dialogs.css', 'version' => 19 ), |
27 | 27 | array( 'src' => 'css/wikiEditor.preview.css', 'version' => 1 ), |
28 | 28 | array( 'src' => 'css/wikiEditor.toc.css', 'version' => 28 ), |
29 | | - array( 'src' => 'css/wikiEditor.toolbar.css', 'version' => 10 ), |
| 29 | + array( 'src' => 'css/wikiEditor.toolbar.css', 'version' => 11 ), |
30 | 30 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
31 | 31 | ), |
32 | 32 | 'combined' => array( |
33 | | - array( 'src' => 'css/combined.css', 'version' => 63 ), |
| 33 | + array( 'src' => 'css/combined.css', 'version' => 66 ), |
34 | 34 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
35 | 35 | ), |
36 | 36 | 'minified' => array( |
37 | | - array( 'src' => 'css/combined.min.css', 'version' => 63 ), |
| 37 | + array( 'src' => 'css/combined.min.css', 'version' => 66 ), |
38 | 38 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
39 | 39 | ), |
40 | 40 | ) |
— | — | @@ -72,20 +72,20 @@ |
73 | 73 | array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ), |
76 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 112 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 118 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 29 ), |
78 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 47 ), |
| 78 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 48 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 12 ), |
80 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 80 ), |
| 80 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 81 ), |
81 | 81 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 10 ), |
82 | 82 | array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 17 ), |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 230 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 238 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 230 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 238 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/ClickTracking/ClickTracking.i18n.php |
— | — | @@ -1111,7 +1111,16 @@ |
1112 | 1112 | 'clicktracking-desc' => 'Pengesanan klik, bertujuan untuk mengesan peristiwa-peristiwa yang tidak menyebabkan penyegaran semula sebuah laman.', |
1113 | 1113 | 'ct-title' => 'Klik pengguna teragregat', |
1114 | 1114 | 'ct-event-name' => 'Nama peristiwa', |
| 1115 | + 'ct-expert-header' => 'Klik "pakar"', |
| 1116 | + 'ct-intermediate-header' => 'Klik "pertengahan"', |
| 1117 | + 'ct-beginner-header' => 'Klik "pemula"', |
1115 | 1118 | 'ct-total-header' => 'Jumlah klik', |
| 1119 | + 'ct-change-graph' => 'Tukar graf', |
| 1120 | + 'ct-beginner' => 'Pemula', |
| 1121 | + 'ct-intermediate' => 'Pertengahan', |
| 1122 | + 'ct-expert' => 'Pakar', |
| 1123 | + 'ct-date-range' => 'Julat tarikh', |
| 1124 | + 'ct-editing' => 'Sedang menyunting:', |
1116 | 1125 | 'ct-anon-users' => 'Pengguna tanpa nama', |
1117 | 1126 | ); |
1118 | 1127 | |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/css/combined.css |
— | — | @@ -225,7 +225,26 @@ |
226 | 226 | .wikiEditor-view-wikitext { |
227 | 227 | line-height: 1em; |
228 | 228 | } |
229 | | -/* wikiEditor dialogs module */ |
| 229 | +.wikiEditor-ui-loading { |
| 230 | + background: #f3f3f3; |
| 231 | + z-index: 10; |
| 232 | + position: absolute; |
| 233 | + top: 0; |
| 234 | + left: 0; |
| 235 | + text-align: center; |
| 236 | + height: 100%; |
| 237 | + width: 100%; |
| 238 | + border: 1px solid silver; |
| 239 | + margin: -1px; |
| 240 | +} |
| 241 | +.wikiEditor-ui-loading span { |
| 242 | + display: block; |
| 243 | + height: 24px; |
| 244 | + width: 24px; |
| 245 | + background: url( ../images/wikiEditor/toolbar/loading.gif ) 0 0 no-repeat; |
| 246 | + text-indent: -9999px; |
| 247 | + margin: 0 auto; |
| 248 | +}/* wikiEditor dialogs module */ |
230 | 249 | |
231 | 250 | .wikiEditor-toolbar-dialog table { |
232 | 251 | margin-top: 0.75em; |
— | — | @@ -921,7 +940,7 @@ |
922 | 941 | white-space: nowrap; |
923 | 942 | } |
924 | 943 | .wikiEditor-ui-toolbar .group .tool-select .options .option:hover { |
925 | | - background-color: #f3f3f3; |
| 944 | + background-color: #E0EEf7; |
926 | 945 | } |
927 | 946 | .wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-2] { |
928 | 947 | font-size: 150%; |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/css/combined.min.css |
— | — | @@ -215,6 +215,26 @@ |
216 | 216 | .wikiEditor-view-wikitext{ |
217 | 217 | line-height:1em; |
218 | 218 | } |
| 219 | +.wikiEditor-ui-loading{ |
| 220 | +background:#f3f3f3; |
| 221 | +z-index:10; |
| 222 | +position:absolute; |
| 223 | +top:0; |
| 224 | +left:0; |
| 225 | +text-align:center; |
| 226 | +height:100%; |
| 227 | +width:100%; |
| 228 | +border:1px solid silver; |
| 229 | +margin:-1px; |
| 230 | +} |
| 231 | +.wikiEditor-ui-loading span{ |
| 232 | +display:block; |
| 233 | +height:24px; |
| 234 | +width:24px; |
| 235 | +background:url( ../images/wikiEditor/toolbar/loading.gif ) 0 0 no-repeat; |
| 236 | +text-indent:-9999px; |
| 237 | +margin:0 auto; |
| 238 | +} |
219 | 239 | .wikiEditor-toolbar-dialog table{ |
220 | 240 | margin-top:0.75em; |
221 | 241 | } |
— | — | @@ -866,7 +886,7 @@ |
867 | 887 | white-space:nowrap; |
868 | 888 | } |
869 | 889 | .wikiEditor-ui-toolbar .group .tool-select .options .option:hover{ |
870 | | -background-color:#f3f3f3; |
| 890 | +background-color:#E0EEf7; |
871 | 891 | } |
872 | 892 | .wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-2]{ |
873 | 893 | font-size:150%; |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/css/wikiEditor.css |
— | — | @@ -112,3 +112,23 @@ |
113 | 113 | .wikiEditor-view-wikitext { |
114 | 114 | line-height: 1em; |
115 | 115 | } |
| 116 | +.wikiEditor-ui-loading { |
| 117 | + background: #f3f3f3; |
| 118 | + z-index: 10; |
| 119 | + position: absolute; |
| 120 | + top: 0; |
| 121 | + left: 0; |
| 122 | + text-align: center; |
| 123 | + height: 100%; |
| 124 | + width: 100%; |
| 125 | + border: 1px solid silver; |
| 126 | + margin: -1px; |
| 127 | +} |
| 128 | +.wikiEditor-ui-loading span { |
| 129 | + display: block; |
| 130 | + height: 24px; |
| 131 | + width: 24px; |
| 132 | + background: url( ../images/wikiEditor/toolbar/loading.gif ) 0 0 no-repeat; |
| 133 | + text-indent: -9999px; |
| 134 | + margin: 0 auto; |
| 135 | +} |
\ No newline at end of file |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/css/wikiEditor.toolbar.css |
— | — | @@ -234,7 +234,7 @@ |
235 | 235 | white-space: nowrap; |
236 | 236 | } |
237 | 237 | .wikiEditor-ui-toolbar .group .tool-select .options .option:hover { |
238 | | - background-color: #f3f3f3; |
| 238 | + background-color: #E0EEf7; |
239 | 239 | } |
240 | 240 | .wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-2] { |
241 | 241 | font-size: 150%; |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/OptIn/OptIn.i18n.php |
— | — | @@ -1017,6 +1017,7 @@ |
1018 | 1018 | * @author Lloffiwr |
1019 | 1019 | */ |
1020 | 1020 | $messages['cy'] = array( |
| 1021 | + 'optin' => "Ymuno â'r Cynllun Defnyddioldeb", |
1021 | 1022 | 'optin-desc' => "Yn gadael i ddefnyddwyr arbrofi gyda'r fersiwn Beta, sy'n cynnwys gwelliannau diweddaraf y Cynllun Defnyddioldeb.", |
1022 | 1023 | 'optin-title-optedout' => 'Rhowch gynnig ar Beta', |
1023 | 1024 | 'optin-title-optedin' => 'Gadael Beta', |
— | — | @@ -1047,6 +1048,7 @@ |
1048 | 1049 | 'optin-survey-question-whyoptout' => "Pam ydych chi'n gadael Beta? (Dewiswch pob rheswm perthnasol.)", |
1049 | 1050 | 'optin-survey-answer-whyoptout-hard' => "Roedd yn rhy annodd i'w ddefnyddio.", |
1050 | 1051 | 'optin-survey-answer-whyoptout-didntwork' => "Doedd e ddim yn gweithio'n iawn.", |
| 1052 | + 'optin-survey-answer-whyoptout-notpredictable' => "Roedd yn gweithredu'n fympwyol.", |
1051 | 1053 | 'optin-survey-answer-whyoptout-didntlike-look' => 'Doeddwn i ddim yn hoffi golwg Beta.', |
1052 | 1054 | 'optin-survey-answer-whyoptout-didntlike-layout' => "Doeddwn i ddim yn hoffi'r tabiau a'r gosodiad newydd.", |
1053 | 1055 | 'optin-survey-answer-whyoptout-didntlike-toolbar' => "Doeddwn i ddim yn hoffi'r bar offer newydd.", |
— | — | @@ -1062,6 +1064,7 @@ |
1063 | 1065 | 'optin-survey-answer-changes-nav' => "Gwneud yr offer llywio ar y wefan yn haws i'w defnyddio.", |
1064 | 1066 | 'optin-survey-answer-changes-edittools' => "Cynyddu a gwella'r offer golygu.", |
1065 | 1067 | 'optin-survey-answer-changes-upload' => 'Gwella uwchlwytho ffeiliau lluniau ag ati.', |
| 1068 | + 'optin-survey-answer-changes-predictability' => 'Gwneud iddo weithredu yn y modd mwyaf dibynadwy posib.', |
1066 | 1069 | 'optin-survey-answer-changes-custom' => "Ehangu'r nifer o ddewisiadau y gall defnyddiwr eu gosod fel ag a myn.", |
1067 | 1070 | 'optin-improvements' => "== Beth sydd wedi ei wella? == |
1068 | 1071 | [[File:UsabilityNavigation.png|left|link=|Llun o'r tabiau llywio newydd]] |
— | — | @@ -5230,6 +5233,7 @@ |
5231 | 5234 | 'optin-survey-answer-whyoptout-didntlike-layout' => 'නව ටැබ හා වින්යාස සැලැස්ම මා සිත් ගත්තේ නැත.', |
5232 | 5235 | 'optin-survey-answer-whyoptout-didntlike-toolbar' => 'නව මෙවලම්-පටිය මා සිත් ගත්තේ නැත.', |
5233 | 5236 | 'optin-survey-answer-whyoptout-other' => 'වෙනත් හේතුවක්:', |
| 5237 | + 'optin-survey-answer-changes-other' => 'වෙනත්:', |
5234 | 5238 | ); |
5235 | 5239 | |
5236 | 5240 | /** Slovak (Slovenčina) |
Index: branches/wmf-deployment/extensions/UsabilityInitiative/OptIn/OptInLink.i18n.php |
— | — | @@ -186,6 +186,7 @@ |
187 | 187 | 'tooltip-pt-optin-try' => 'Rhoi cynnig ar y nodweddion newydd', |
188 | 188 | 'optin-leave' => 'Gadael Beta', |
189 | 189 | 'tooltip-pt-optin-leave' => "Gadael llonydd i'r nodweddion newydd", |
| 190 | + 'optin-feedback' => 'Adborth Beta', |
190 | 191 | 'tooltip-pt-optin-feedback' => "Cynnig adborth ynghylch eich profiad o ddefnyddio'r nodweddion newydd", |
191 | 192 | ); |
192 | 193 | |