Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 11 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 30 ), |
76 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 183 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 184 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 52 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 59 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 24 ), |
— | — | @@ -82,10 +82,10 @@ |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 387 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 388 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 387 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 388 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -21,10 +21,10 @@ |
22 | 22 | array( 'src' => 'Modules/AddMediaWizard/AddMediaWizard.js', 'version' => 6 ), |
23 | 23 | ), |
24 | 24 | 'combined' => array( |
25 | | - array( 'src' => 'WikiEditor.combined.js', 'version' => 87 ), |
| 25 | + array( 'src' => 'WikiEditor.combined.js', 'version' => 88 ), |
26 | 26 | ), |
27 | 27 | 'minified' => array( |
28 | | - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 87 ), |
| 28 | + array( 'src' => 'WikiEditor.combined.min.js', 'version' => 88 ), |
29 | 29 | ), |
30 | 30 | ); |
31 | 31 | static $messages = array( |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js |
— | — | @@ -2078,3 +2078,13 @@ |
2079 | 2079 | $j( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'templateEditor' ); |
2080 | 2080 | } |
2081 | 2081 | }); |
| 2082 | +/* JavaScript for AddMediaWizard gadget */ |
| 2083 | +if ( wgWikiEditorEnabledModules.addMediaWizard ) { |
| 2084 | + if( typeof mwAddMediaConfig == 'undefined' ) { |
| 2085 | + mwAddMediaConfig = {}; |
| 2086 | + } |
| 2087 | + mwAddMediaConfig['enabled_providers'] = [ 'wiki_commons', 'upload' ]; |
| 2088 | + |
| 2089 | + // Transclude mwEmbed support |
| 2090 | + importScriptURI( 'http://prototype.wikimedia.org/s-2/js/mwEmbed/remotes/mediaWiki.js?&uselang=' + wgUserLanguage ); |
| 2091 | +} |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js |
— | — | @@ -191,4 +191,5 @@ |
192 | 192 | $textarea.textSelection('scrollToCaretPosition');$textarea.textSelection('setSelection',{'start':start,'end':mode=='replace'?newEnd:end});$j(this).data('offset',mode=='replace'?newEnd:end);var textbox=typeof context.$iframe!='undefined'?context.$iframe[0].contentWindow:$textarea;textbox.focus();}});},dialog:{width:500,dialogClass:'wikiEditor-toolbar-dialog',buttons:{'wikieditor-toolbar-tool-replace-button-findnext':function(e){$j(this).closest('.ui-dialog').data('dialogaction',e.target);$j(this).data('replaceCallback').call(this,'find');},'wikieditor-toolbar-tool-replace-button-replacenext':function(e){$j(this).closest('.ui-dialog').data('dialogaction',e.target);$j(this).data('replaceCallback').call(this,'replace');},'wikieditor-toolbar-tool-replace-button-replaceall':function(e){$j(this).closest('.ui-dialog').data('dialogaction',e.target);$j(this).data('replaceCallback').call(this,'replaceAll');},'wikieditor-toolbar-tool-replace-close':function(){$j(this).dialog('close');}},open:function(){$j(this).data('offset',0);$j('#wikieditor-toolbar-replace-search').focus();$j('#wikieditor-toolbar-replace-nomatch, #wikieditor-toolbar-replace-success, #wikieditor-toolbar-replace-emptysearch, #wikieditor-toolbar-replace-invalidregex').hide();if(!($j(this).data('onetimeonlystuff'))){$j(this).data('onetimeonlystuff',true);$j(this).closest('.ui-dialog').keypress(function(e){if((e.keyCode||e.which)==13){var button=$j(this).data('dialogaction')||$j(this).find('button:first');button.click();e.preventDefault();}});$j(this).closest('.ui-dialog').find('button').focus(function(){$j(this).closest('.ui-dialog').data('dialogaction',this);});} |
193 | 193 | var dialog=$j(this).closest('.ui-dialog');var that=this;var context=$j(this).data('context');var textbox=typeof context.$iframe!='undefined'?context.$iframe[0].contentWindow.document:context.$textarea;$j(textbox).bind('keypress.srdialog',function(e){if((e.keyCode||e.which)==13){var button=dialog.data('dialogaction')||dialog.find('button:first');button.click();e.preventDefault();}else if((e.keyCode||e.which)==27){$j(that).dialog('close');}});},close:function(){var context=$j(this).data('context');var textbox=typeof context.$iframe!='undefined'?context.$iframe[0].contentWindow.document:context.$textarea;$j(textbox).unbind('keypress.srdialog');$j(this).closest('.ui-dialog').data('dialogaction',false);}}}}});}});$j(document).ready(function(){if(!wgWikiEditorEnabledModules.templateEditor){return true;} |
194 | 194 | if(wgNamespaceNumber==10){return true;} |
195 | | -if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule','templateEditor');}}); |
\ No newline at end of file |
| 195 | +if($j.fn.wikiEditor){$j('textarea#wpTextbox1').wikiEditor('addModule','templateEditor');}});if(wgWikiEditorEnabledModules.addMediaWizard){if(typeof mwAddMediaConfig=='undefined'){mwAddMediaConfig={};} |
| 196 | +mwAddMediaConfig['enabled_providers']=['wiki_commons','upload'];importScriptURI('http://prototype.wikimedia.org/s-2/js/mwEmbed/remotes/mediaWiki.js?&uselang='+wgUserLanguage);} |
\ No newline at end of file |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/AddMediaWizard/AddMediaWizard.js |
— | — | @@ -1,11 +1,10 @@ |
2 | | - |
3 | 2 | /* JavaScript for AddMediaWizard gadget */ |
4 | | -if ( wgWikiEditorEnabledModules.addMediaWizard ) { |
5 | | - if( typeof mwAddMediaConfig == 'undefined'){ |
| 3 | +if ( wgWikiEditorEnabledModules.addMediaWizard ) { |
| 4 | + if( typeof mwAddMediaConfig == 'undefined' ) { |
6 | 5 | mwAddMediaConfig = {}; |
7 | 6 | } |
8 | 7 | mwAddMediaConfig['enabled_providers'] = [ 'wiki_commons', 'upload' ]; |
9 | 8 | |
10 | 9 | // Transclude mwEmbed support |
11 | | - importScriptURI('http://prototype.wikimedia.org/s-2/js/mwEmbed/remotes/mediaWiki.js?&uselang=' + wgUserLanguage ); |
| 10 | + importScriptURI( 'http://prototype.wikimedia.org/s-2/js/mwEmbed/remotes/mediaWiki.js?&uselang=' + wgUserLanguage ); |
12 | 11 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -446,12 +446,12 @@ |
447 | 447 | |
448 | 448 | // If the pasted content is plain text then wrap it in a <p> and adjust the <br> accordingly |
449 | 449 | var pasteContent = context.fn.getOffset( cursorPos[0] ).node; |
450 | | - var removeNextBR = false |
451 | | - while ( pasteContent != null && ! $( pasteContent ).hasClass( 'wikiEditor' ) ) { |
| 450 | + var removeNextBR = false; |
| 451 | + while ( pasteContent != null && !$( pasteContent ).hasClass( 'wikiEditor' ) ) { |
452 | 452 | var currentNode = pasteContent; |
453 | 453 | pasteContent = pasteContent.nextSibling; |
454 | 454 | if ( currentNode.nodeName == '#text' && currentNode.nodeValue == currentNode.wholeText ) { |
455 | | - var pWrapper = $( '<p></p>' ).addClass( 'wikiEditor' ); |
| 455 | + var pWrapper = $( '<p />' ).addClass( 'wikiEditor' ); |
456 | 456 | $( currentNode ).wrap( pWrapper ); |
457 | 457 | $( currentNode ).addClass( 'wikiEditor' ); |
458 | 458 | removeNextBR = true; |
— | — | @@ -472,25 +472,25 @@ |
473 | 473 | var $newElement; |
474 | 474 | if ( $currentElement.is( 'p' ) || $currentElement.is( 'div' ) || $currentElement.is( 'pre' ) ) { |
475 | 475 | //Convert all <div>, <p> and <pre> that was pasted into a <p> element |
476 | | - $newElement = $( '<p></p>' ); |
| 476 | + $newElement = $( '<p />' ); |
477 | 477 | } else { |
478 | 478 | // everything else becomes a <span> |
479 | | - $newElement = $( '<span></span>' ).addClass( 'wikiEditor' ); |
| 479 | + $newElement = $( '<span />' ).addClass( 'wikiEditor' ); |
480 | 480 | } |
481 | 481 | |
482 | 482 | // If the pasted content was html, just convert it into text and <br> |
483 | | - var text = $.trim( $currentElement.text() ); |
484 | | - var pieces = text.split('\n'); |
| 483 | + var pieces = $.trim( $currentElement.text() ).split( '\n' ); |
| 484 | + var newElementHTML = ''; |
485 | 485 | for ( var i = 0; i < pieces.length; i++ ) { |
486 | | - if ( pieces[i] ) { |
487 | | - $newElement.html( $newElement.html() + $.trim( pieces[i] ) ); |
| 486 | + if ( pieces[i] ) { |
| 487 | + newElementHTML += $.trim( pieces[i] ); |
488 | 488 | } else { |
489 | | - var $brElement = $( '<span></span>' ).html( '<br class = "wikiEditor" />' ); |
490 | | - $newElement.html( $newElement.html() + $brElement.html() ); |
| 489 | + newElementHTML += '<span><br class="wikiEditor" /></span>'; |
491 | 490 | } |
492 | | - } |
493 | | - $newElement.insertAfter( $currentElement ); |
494 | | - $newElement.addClass( 'wikiEditor' ); |
| 491 | + } |
| 492 | + $newElement.html( newElementHTML ) |
| 493 | + .addClass( 'wikiEditor' ) |
| 494 | + .insertAfter( $currentElement ); |
495 | 495 | $currentElement.remove(); |
496 | 496 | |
497 | 497 | $selection = context.$content.find( ':not(.wikiEditor)' ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -7031,12 +7031,12 @@ |
7032 | 7032 | |
7033 | 7033 | // If the pasted content is plain text then wrap it in a <p> and adjust the <br> accordingly |
7034 | 7034 | var pasteContent = context.fn.getOffset( cursorPos[0] ).node; |
7035 | | - var removeNextBR = false |
7036 | | - while ( pasteContent != null && ! $( pasteContent ).hasClass( 'wikiEditor' ) ) { |
| 7035 | + var removeNextBR = false; |
| 7036 | + while ( pasteContent != null && !$( pasteContent ).hasClass( 'wikiEditor' ) ) { |
7037 | 7037 | var currentNode = pasteContent; |
7038 | 7038 | pasteContent = pasteContent.nextSibling; |
7039 | 7039 | if ( currentNode.nodeName == '#text' && currentNode.nodeValue == currentNode.wholeText ) { |
7040 | | - var pWrapper = $( '<p></p>' ).addClass( 'wikiEditor' ); |
| 7040 | + var pWrapper = $( '<p />' ).addClass( 'wikiEditor' ); |
7041 | 7041 | $( currentNode ).wrap( pWrapper ); |
7042 | 7042 | $( currentNode ).addClass( 'wikiEditor' ); |
7043 | 7043 | removeNextBR = true; |
— | — | @@ -7057,25 +7057,25 @@ |
7058 | 7058 | var $newElement; |
7059 | 7059 | if ( $currentElement.is( 'p' ) || $currentElement.is( 'div' ) || $currentElement.is( 'pre' ) ) { |
7060 | 7060 | //Convert all <div>, <p> and <pre> that was pasted into a <p> element |
7061 | | - $newElement = $( '<p></p>' ); |
| 7061 | + $newElement = $( '<p />' ); |
7062 | 7062 | } else { |
7063 | 7063 | // everything else becomes a <span> |
7064 | | - $newElement = $( '<span></span>' ).addClass( 'wikiEditor' ); |
| 7064 | + $newElement = $( '<span />' ).addClass( 'wikiEditor' ); |
7065 | 7065 | } |
7066 | 7066 | |
7067 | 7067 | // If the pasted content was html, just convert it into text and <br> |
7068 | | - var text = $.trim( $currentElement.text() ); |
7069 | | - var pieces = text.split('\n'); |
| 7068 | + var pieces = $.trim( $currentElement.text() ).split( '\n' ); |
| 7069 | + var newElementHTML = ''; |
7070 | 7070 | for ( var i = 0; i < pieces.length; i++ ) { |
7071 | | - if ( pieces[i] ) { |
7072 | | - $newElement.html( $newElement.html() + $.trim( pieces[i] ) ); |
| 7071 | + if ( pieces[i] ) { |
| 7072 | + newElementHTML += $.trim( pieces[i] ); |
7073 | 7073 | } else { |
7074 | | - var $brElement = $( '<span></span>' ).html( '<br class = "wikiEditor" />' ); |
7075 | | - $newElement.html( $newElement.html() + $brElement.html() ); |
| 7074 | + newElementHTML += '<span><br class="wikiEditor" /></span>'; |
7076 | 7075 | } |
7077 | | - } |
7078 | | - $newElement.insertAfter( $currentElement ); |
7079 | | - $newElement.addClass( 'wikiEditor' ); |
| 7076 | + } |
| 7077 | + $newElement.html( newElementHTML ) |
| 7078 | + .addClass( 'wikiEditor' ) |
| 7079 | + .insertAfter( $currentElement ); |
7080 | 7080 | $currentElement.remove(); |
7081 | 7081 | |
7082 | 7082 | $selection = context.$content.find( ':not(.wikiEditor)' ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -467,12 +467,11 @@ |
468 | 468 | if(context.$content.children().length==0){context.$content.append('<p></p>');} |
469 | 469 | return true;},'delayedChange':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldDelayedHTML!=newHTML){context.oldDelayedHTML=newHTML;event.data.scope='realchange';var cursorPos=context.fn.getCaretPosition();var t=context.fn.getOffset(cursorPos[0]);if(t&&t.node.nodeName=='#text'&&t.node.parentNode.nodeName.toLowerCase()=='body'){$(t.node).wrap("<p></p>");context.fn.purgeOffsets();context.fn.setSelection({start:cursorPos[0],end:cursorPos[1]});}} |
470 | 470 | context.fn.updateHistory(event.data.scope=='realchange');return true;},'cut':function(event){setTimeout(function(){context.$content.find('br').each(function(){if($(this).parent().is('body')){$(this).wrap($('<p></p>'));}});},100);return true;},'paste':function(event){var cursorPos=context.fn.getCaretPosition();var oldLength=context.fn.getContents().length-(cursorPos[1]-cursorPos[0]);context.$content.find(':not(.wikiEditor)').addClass('wikiEditor');if($.layout.name!=='webkit'){context.$content.addClass('pasting');} |
471 | | -setTimeout(function(){context.$content.find('script,style,img,input,select,textarea,hr,button,link,meta').remove();context.$content.find('*').each(function(){if($(this).children().length==0&&this.childNodes.length>0){$(this).text($(this).text());}});context.$content.find('p:not(.wikiEditor) p:not(.wikiEditor)').each(function(){var outerParent=$(this).parent();outerParent.replaceWith(outerParent.childNodes);});context.$content.find('span.Apple-style-span').each(function(){$(this).replaceWith(this.childNodes);});var pasteContent=context.fn.getOffset(cursorPos[0]).node;var removeNextBR=false |
472 | | -while(pasteContent!=null&&!$(pasteContent).hasClass('wikiEditor')){var currentNode=pasteContent;pasteContent=pasteContent.nextSibling;if(currentNode.nodeName=='#text'&¤tNode.nodeValue==currentNode.wholeText){var pWrapper=$('<p></p>').addClass('wikiEditor');$(currentNode).wrap(pWrapper);$(currentNode).addClass('wikiEditor');removeNextBR=true;}else if(currentNode.nodeName=='BR'&&removeNextBR){$(currentNode).remove();removeNextBR=false;}else{removeNextBR=false;}} |
| 471 | +setTimeout(function(){context.$content.find('script,style,img,input,select,textarea,hr,button,link,meta').remove();context.$content.find('*').each(function(){if($(this).children().length==0&&this.childNodes.length>0){$(this).text($(this).text());}});context.$content.find('p:not(.wikiEditor) p:not(.wikiEditor)').each(function(){var outerParent=$(this).parent();outerParent.replaceWith(outerParent.childNodes);});context.$content.find('span.Apple-style-span').each(function(){$(this).replaceWith(this.childNodes);});var pasteContent=context.fn.getOffset(cursorPos[0]).node;var removeNextBR=false;while(pasteContent!=null&&!$(pasteContent).hasClass('wikiEditor')){var currentNode=pasteContent;pasteContent=pasteContent.nextSibling;if(currentNode.nodeName=='#text'&¤tNode.nodeValue==currentNode.wholeText){var pWrapper=$('<p />').addClass('wikiEditor');$(currentNode).wrap(pWrapper);$(currentNode).addClass('wikiEditor');removeNextBR=true;}else if(currentNode.nodeName=='BR'&&removeNextBR){$(currentNode).remove();removeNextBR=false;}else{removeNextBR=false;}} |
473 | 472 | 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();} |
474 | | -var $newElement;if($currentElement.is('p')||$currentElement.is('div')||$currentElement.is('pre')){$newElement=$('<p></p>');}else{$newElement=$('<span></span>').addClass('wikiEditor');} |
475 | | -var text=$.trim($currentElement.text());var pieces=text.split('\n');for(var i=0;i<pieces.length;i++){if(pieces[i]){$newElement.html($newElement.html()+$.trim(pieces[i]));}else{var $brElement=$('<span></span>').html('<br class = "wikiEditor" />');$newElement.html($newElement.html()+$brElement.html());}} |
476 | | -$newElement.insertAfter($currentElement);$newElement.addClass('wikiEditor');$currentElement.remove();$selection=context.$content.find(':not(.wikiEditor)');} |
| 473 | +var $newElement;if($currentElement.is('p')||$currentElement.is('div')||$currentElement.is('pre')){$newElement=$('<p />');}else{$newElement=$('<span />').addClass('wikiEditor');} |
| 474 | +var pieces=$.trim($currentElement.text()).split('\n');var newElementHTML='';for(var i=0;i<pieces.length;i++){if(pieces[i]){newElementHTML+=$.trim(pieces[i]);}else{newElementHTML+='<span><br class="wikiEditor" /></span>';}} |
| 475 | +$newElement.html(newElementHTML).addClass('wikiEditor').insertAfter($currentElement);$currentElement.remove();$selection=context.$content.find(':not(.wikiEditor)');} |
477 | 476 | context.$content.find('.wikiEditor').removeClass('wikiEditor');if($.layout.name!=='webkit'){context.$content.removeClass('pasting');} |
478 | 477 | context.fn.purgeOffsets();var newLength=context.fn.getContents().length;var restoreTo=cursorPos[0]+newLength-oldLength;context.fn.setSelection({start:restoreTo,end:restoreTo});},0);return true;},'ready':function(event){context.history.push({'html':context.$content.html(),'sel':context.fn.getCaretPosition()});return true;}};context.fn={'trigger':function(name,event){if(typeof event=='undefined'){event={'type':'custom'};} |
479 | 478 | if(typeof event.data=='undefined'){event.data={};} |
Index: trunk/extensions/UsabilityInitiative/Makefile |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | js/plugins/jquery.wikiEditor.highlight.js\ |
35 | 35 | js/plugins/jquery.wikiEditor.preview.js\ |
36 | 36 | js/plugins/jquery.wikiEditor.publish.js\ |
37 | | - js/plugins/jquery.wikiEditor.templateEditor.js\ |
| 37 | + js/plugins/jquery.wikiEditor.templateEditor.js\ |
38 | 38 | js/plugins/jquery.wikiEditor.toc.js\ |
39 | 39 | js/plugins/jquery.wikiEditor.toolbar.js |
40 | 40 | |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | WikiEditor/Modules/Publish/Publish.js\ |
45 | 45 | WikiEditor/Modules/Toc/Toc.js\ |
46 | 46 | WikiEditor/Modules/Toolbar/Toolbar.js\ |
47 | | - WikiEditor/Modules/TemplateEditor/TemplateEditor.js |
| 47 | + WikiEditor/Modules/TemplateEditor/TemplateEditor.js\ |
48 | 48 | WikiEditor/Modules/AddMediaWizard/AddMediaWizard.js |
49 | 49 | |
50 | 50 | VECTOR_MODULES := \ |