Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 6 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 21 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 36 ), |
76 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 7 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 8 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 40 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 10 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 52 ), |
— | — | @@ -81,10 +81,10 @@ |
82 | 82 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ), |
83 | 83 | ), |
84 | 84 | 'combined' => array( |
85 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 119 ), |
| 85 | + array( 'src' => 'js/plugins.combined.js', 'version' => 120 ), |
86 | 86 | ), |
87 | 87 | 'minified' => array( |
88 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 119 ), |
| 88 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 120 ), |
89 | 89 | ), |
90 | 90 | ), |
91 | 91 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2130,6 +2130,12 @@ |
2131 | 2131 | ( function( $ ) { $.wikiEditor.modules.highlight = { |
2132 | 2132 | |
2133 | 2133 | /** |
| 2134 | + * Configuration |
| 2135 | + */ |
| 2136 | +cfg: { |
| 2137 | + 'styleVersion': 2 |
| 2138 | +}, |
| 2139 | +/** |
2134 | 2140 | * Internally used event handlers |
2135 | 2141 | */ |
2136 | 2142 | evt: { |
— | — | @@ -2168,7 +2174,8 @@ |
2169 | 2175 | context.$content.parent().find( 'head' ).append( $j( '<link />' ).attr( { |
2170 | 2176 | 'rel': 'stylesheet', |
2171 | 2177 | 'type': 'text/css', |
2172 | | - 'href': wgScriptPath + '/extensions/UsabilityInitiative/css/wikiEditor.highlight.css?1', |
| 2178 | + 'href': wgScriptPath + '/extensions/UsabilityInitiative/css/wikiEditor.highlight.css?' + |
| 2179 | + $.wikiEditor.modules.highlight.cfg.styleVersion, |
2173 | 2180 | } ) ); |
2174 | 2181 | // Highlight stuff for the first time |
2175 | 2182 | $.wikiEditor.modules.highlight.fn.scan( context, "" ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -119,7 +119,8 @@ |
120 | 120 | configuration.newButtons[gM(msg)]=configuration.buttons[msg];configuration.buttons=configuration.newButtons;var dialogDiv=$('<div /> ').attr('id',module.id).html(module.html).data('context',context).appendTo($('body')).each(module.init).dialog(configuration);if(!('resizeme'in module)||module.resizeme){dialogDiv.bind('dialogopen',$.wikiEditor.modules.dialogs.fn.resize).find('.ui-tabs').bind('tabsshow',function(){$(this).closest('.ui-dialog-content').each($.wikiEditor.modules.dialogs.fn.resize);});} |
121 | 121 | var maxTI=0;$j('[tabindex]').each(function(){var ti=parseInt($j(this).attr('tabindex'));if(ti>maxTI) |
122 | 122 | maxTI=ti;});var tabIndex=maxTI+1;$j('.ui-dialog input, .ui-dialog button').not('[tabindex]').each(function(){$j(this).attr('tabindex',tabIndex++);});}}});},resize:function(){var wrapper=$(this).closest('.ui-dialog');var oldWidth=wrapper.width();var oldHidden=$(this).find('*').not(':visible');oldHidden.each(function(){$(this).data('oldstyle',$(this).attr('style'));});oldHidden.show();var oldWS=$(this).css('white-space');$(this).css('white-space','nowrap');if(wrapper.width()<=$(this).get(0).scrollWidth){var thisWidth=$(this).data('thisWidth')?$(this).data('thisWidth'):0;thisWidth=Math.max($(this).get(0).scrollWidth,thisWidth);$(this).width(thisWidth);$(this).data('thisWidth',thisWidth);var wrapperWidth=$(this).data('wrapperWidth')?$(this).data('wrapperWidth'):0;wrapperWidth=Math.max(wrapper.get(0).scrollWidth,wrapperWidth);wrapper.width(wrapperWidth);$(this).data('wrapperWidth',wrapperWidth);$(this).dialog({'width':wrapper.width()});wrapper.css('left',parseInt(wrapper.css('left'))-(wrapper.width()-oldWidth)/2);} |
123 | | -$(this).css('white-space',oldWS);oldHidden.each(function(){$(this).attr('style',$(this).data('oldstyle'));});}},modules:{},quickDialog:function(body,settings){$('<div />').text(body).appendTo($('body')).dialog($.extend({bgiframe:true,modal:true},settings)).dialog('open');}};})(jQuery);(function($){$.wikiEditor.modules.highlight={evt:{change:function(context,event){if(event.data.scope=='keydown'){$.wikiEditor.modules.highlight.fn.scan(context,"");$.wikiEditor.modules.highlight.fn.mark(context,"","");}},ready:function(context,event){context.$content.parent().find('head').append($j('<link />').attr({'rel':'stylesheet','type':'text/css','href':wgScriptPath+'/extensions/UsabilityInitiative/css/wikiEditor.highlight.css?1',}));$.wikiEditor.modules.highlight.fn.scan(context,"");$.wikiEditor.modules.highlight.fn.mark(context,"","");}},fn:{create:function(context,config){},divide:function(context){},isolate:function(context){return[];},strip:function(context,division){return $('<div />').html(division.html().replace(/\<br[^\>]*\>/g,"\n")).text();},scan:function(context,division){function Token(offset,label){this.offset=offset;this.label=label;} |
| 123 | +$(this).css('white-space',oldWS);oldHidden.each(function(){$(this).attr('style',$(this).data('oldstyle'));});}},modules:{},quickDialog:function(body,settings){$('<div />').text(body).appendTo($('body')).dialog($.extend({bgiframe:true,modal:true},settings)).dialog('open');}};})(jQuery);(function($){$.wikiEditor.modules.highlight={cfg:{'styleVersion':2},evt:{change:function(context,event){if(event.data.scope=='keydown'){$.wikiEditor.modules.highlight.fn.scan(context,"");$.wikiEditor.modules.highlight.fn.mark(context,"","");}},ready:function(context,event){context.$content.parent().find('head').append($j('<link />').attr({'rel':'stylesheet','type':'text/css','href':wgScriptPath+'/extensions/UsabilityInitiative/css/wikiEditor.highlight.css?'+ |
| 124 | +$.wikiEditor.modules.highlight.cfg.styleVersion,}));$.wikiEditor.modules.highlight.fn.scan(context,"");$.wikiEditor.modules.highlight.fn.mark(context,"","");}},fn:{create:function(context,config){},divide:function(context){},isolate:function(context){return[];},strip:function(context,division){return $('<div />').html(division.html().replace(/\<br[^\>]*\>/g,"\n")).text();},scan:function(context,division){function Token(offset,label){this.offset=offset;this.label=label;} |
124 | 125 | var tokenArray=context.modules.highlight.tokenArray=[];var text=context.fn.getContents();for(module in $.wikiEditor.modules){if('exp'in $.wikiEditor.modules[module]){for(var i=0;i<$.wikiEditor.modules[module].exp.length;i++){var regex=$.wikiEditor.modules[module].exp[i].regex;var label=$.wikiEditor.modules[module].exp[i].label;var markAfter=false;if(typeof $.wikiEditor.modules[module].exp[i].markAfter!='undefined'){markAfter=true;} |
125 | 126 | match=text.match(regex);var oldOffset=0;while(match!=null){var markOffset=0;if(markAfter){markOffset+=match[0].length;} |
126 | 127 | tokenArray.push(new Token(match.index+oldOffset+markOffset,label));oldOffset+=match.index+match[0].length;newSubstring=text.substring(oldOffset);match=newSubstring.match(regex);}}}} |