r63823 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63822‎ | r63823 | r63824 >
Date:18:47, 16 March 2010
Author:tparscal
Status:ok
Tags:
Comment:
Improved on the performance tweak in r63784 by using the raw HTML mode of jQuery.fn.prepend()
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -78,14 +78,14 @@
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 21 ),
8080 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 97 ),
8181 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ),
82 - array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 63 ),
 82+ array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 64 ),
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 344 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 345 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 344 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 345 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -217,14 +217,14 @@
218218 .addClass( 'wikiEditor-template-text wikiEditor-nodisplay' )
219219 .parent()
220220 .addClass( 'wikiEditor-template-collapsed' )
221 - .prepend( $(
 221+ .prepend(
222222 '<span class="wikiEditor-template-expand wikiEditor-noinclude"></span>' +
223223 '<span class="wikiEditor-template-name wikiEditor-noinclude">' +
224224 '<span class="wikiEditor-template-label wikiEditor-noinclude">' +
225225 $.wikiEditor.modules.templateEditor.fn.getTemplateDisplayName( model ) + '</span>' +
226226 '<span class="wikiEditor-template-dialog wikiEditor-noinclude"></span>' +
227227 '</span>'
228 - ) );
 228+ );
229229 },
230230 /**
231231 * Turn a complex template wrapper back into a simple one
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -9411,14 +9411,14 @@
94129412 .addClass( 'wikiEditor-template-text wikiEditor-nodisplay' )
94139413 .parent()
94149414 .addClass( 'wikiEditor-template-collapsed' )
9415 - .prepend( $(
 9415+ .prepend(
94169416 '<span class="wikiEditor-template-expand wikiEditor-noinclude"></span>' +
94179417 '<span class="wikiEditor-template-name wikiEditor-noinclude">' +
94189418 '<span class="wikiEditor-template-label wikiEditor-noinclude">' +
94199419 $.wikiEditor.modules.templateEditor.fn.getTemplateDisplayName( model ) + '</span>' +
94209420 '<span class="wikiEditor-template-dialog wikiEditor-noinclude"></span>' +
94219421 '</span>'
9422 - ) );
 9422+ );
94239423 },
94249424 /**
94259425 * Turn a complex template wrapper back into a simple one
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -646,8 +646,8 @@
647647 var model=$.wikiEditor.modules.templateEditor.fn.updateModel($(node));if($(node).parent().hasClass('wikiEditor-template')){var $label=$(node).parent().find('.wikiEditor-template-label');var displayName=$.wikiEditor.modules.templateEditor.fn.getTemplateDisplayName(model);if($label.text()!=displayName){$label.text(displayName);}}
648648 if($(node).parent().hasClass('wikiEditor-template')&&!model.isCollapsible()){$.wikiEditor.modules.templateEditor.fn.unwrapTemplate($(node));}else if(!$(node).parent().hasClass('wikiEditor-template')&&model.isCollapsible()){$.wikiEditor.modules.templateEditor.fn.wrapTemplate($(node));$.wikiEditor.modules.templateEditor.fn.bindTemplateEvents($(node));}},getAnchor:function(ca1,ca2){return $(ca1.parentNode).is('span.wikiEditor-template-text')?ca1.parentNode:null;},context:context,skipDivision:"realchange"});}else{tokenArray[beginIndex].label='TEMPLATE_FALSE_BEGIN';tokenIndex=beginIndex;}}}},keydown:function(context,event){if(context.$iframe.data('ignoreKeypress')){context.$iframe.data('ignoreKeypress',false);}
649649 var $evtElem=event.jQueryNode;if($evtElem.hasClass('wikiEditor-template-label')){if(event.ctrlKey||event.metaKey)return true;switch(event.which){case 13:$evtElem.click();return false;case 32:$evtElem.parent().siblings('.wikiEditor-template-expand').click();return false;case 37:case 38:case 39:case 40:return true;default:context.$iframe.data('ignoreKeypress',true);return false;}}else if($evtElem.hasClass('wikiEditor-template-text')){switch(event.which){case 13:context.$iframe.data('ignoreKeypress',true);context.fn.encapsulateSelection({'pre':'\n','peri':'','post':''});return false;default:return true;}}},keyup:function(context,event){if(context.$iframe.data('ignoreKeypress')){context.$iframe.data('ignoreKeypress',false);}
650 -return true;},keypress:function(context,event){return(context.$iframe.data('ignoreKeypress')?false:true);}},exp:[{'regex':/{{/,'label':"TEMPLATE_BEGIN"},{'regex':/}}/,'label':"TEMPLATE_END",'markAfter':true}],cfg:{},fn:{create:function(context,config){context.modules.templateEditor={};},wrapTemplate:function($wrapper){var model=$wrapper.data('model');var context=$wrapper.data('marker').context;var $template=$wrapper.wrap('<span class="wikiEditor-template"></span>').addClass('wikiEditor-template-text wikiEditor-nodisplay').parent().addClass('wikiEditor-template-collapsed').prepend($('<span class="wikiEditor-template-expand wikiEditor-noinclude"></span>'+'<span class="wikiEditor-template-name wikiEditor-noinclude">'+'<span class="wikiEditor-template-label wikiEditor-noinclude">'+
651 -$.wikiEditor.modules.templateEditor.fn.getTemplateDisplayName(model)+'</span>'+'<span class="wikiEditor-template-dialog wikiEditor-noinclude"></span>'+'</span>'));},unwrapTemplate:function($wrapper){$wrapper.parent().replaceWith($wrapper);},bindTemplateEvents:function($wrapper){var $template=$wrapper.parent('.wikiEditor-template');$template.find('.wikiEditor-template-name').click(function(){$.wikiEditor.modules.templateEditor.fn.createDialog($wrapper);return false;}).mousedown(function(){return false;});$template.find('.wikiEditor-template-expand').click(function(){$.wikiEditor.modules.templateEditor.fn.toggleWikiTextEditor($wrapper);return false;}).mousedown(function(){return false;});},toggleWikiTextEditor:function($wrapper){var context=$wrapper.data('marker').context;var $template=$wrapper.parent('.wikiEditor-template');context.fn.purgeOffsets();$template.toggleClass('wikiEditor-template-expanded').toggleClass('wikiEditor-template-collapsed').find('.wikiEditor-template-text').toggleClass('wikiEditor-nodisplay');},createDialog:function($wrapper){var context=$wrapper.data('marker').context;var $template=$wrapper.parent('.wikiEditor-template');var dialog={'titleMsg':'wikieditor-template-editor-dialog-title','id':'wikiEditor-template-dialog','html':'\
 650+return true;},keypress:function(context,event){return(context.$iframe.data('ignoreKeypress')?false:true);}},exp:[{'regex':/{{/,'label':"TEMPLATE_BEGIN"},{'regex':/}}/,'label':"TEMPLATE_END",'markAfter':true}],cfg:{},fn:{create:function(context,config){context.modules.templateEditor={};},wrapTemplate:function($wrapper){var model=$wrapper.data('model');var context=$wrapper.data('marker').context;var $template=$wrapper.wrap('<span class="wikiEditor-template"></span>').addClass('wikiEditor-template-text wikiEditor-nodisplay').parent().addClass('wikiEditor-template-collapsed').prepend('<span class="wikiEditor-template-expand wikiEditor-noinclude"></span>'+'<span class="wikiEditor-template-name wikiEditor-noinclude">'+'<span class="wikiEditor-template-label wikiEditor-noinclude">'+
 651+$.wikiEditor.modules.templateEditor.fn.getTemplateDisplayName(model)+'</span>'+'<span class="wikiEditor-template-dialog wikiEditor-noinclude"></span>'+'</span>');},unwrapTemplate:function($wrapper){$wrapper.parent().replaceWith($wrapper);},bindTemplateEvents:function($wrapper){var $template=$wrapper.parent('.wikiEditor-template');$template.find('.wikiEditor-template-name').click(function(){$.wikiEditor.modules.templateEditor.fn.createDialog($wrapper);return false;}).mousedown(function(){return false;});$template.find('.wikiEditor-template-expand').click(function(){$.wikiEditor.modules.templateEditor.fn.toggleWikiTextEditor($wrapper);return false;}).mousedown(function(){return false;});},toggleWikiTextEditor:function($wrapper){var context=$wrapper.data('marker').context;var $template=$wrapper.parent('.wikiEditor-template');context.fn.purgeOffsets();$template.toggleClass('wikiEditor-template-expanded').toggleClass('wikiEditor-template-collapsed').find('.wikiEditor-template-text').toggleClass('wikiEditor-nodisplay');},createDialog:function($wrapper){var context=$wrapper.data('marker').context;var $template=$wrapper.parent('.wikiEditor-template');var dialog={'titleMsg':'wikieditor-template-editor-dialog-title','id':'wikiEditor-template-dialog','html':'\
652652 <fieldset>\
653653 <div class="wikiEditor-template-dialog-title" />\
654654 <div class="wikiEditor-template-dialog-fields" />\

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63784Improved performance a bit by reducing the jquery-based dom buildout for temp...tparscal21:56, 15 March 2010

Status & tagging log