Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 6 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 21 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 42 ), |
77 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 11 ), |
| 77 | + array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 12 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 40 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 10 ), |
80 | 80 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 55 ), |
— | — | @@ -82,10 +82,10 @@ |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 132 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 133 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 132 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 133 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/css/wikiEditor.highlight.css |
— | — | @@ -1,38 +0,0 @@ |
2 | | -/* CSS for highlight module. Note that this CSS is loaded in the iframe, |
3 | | - * not in the main document. For that reason, it's also not in the combined and |
4 | | - * minified files. |
5 | | - * |
6 | | - * When you edit this please update the style version in js/plugins/jquery.wikiEditor.highlight.js |
7 | | - */ |
8 | | - |
9 | | -/* Wikitext that's folded away and shouldn't be displayed */ |
10 | | -.wikiEditor-nodisplay { |
11 | | - display: none; |
12 | | -} |
13 | | - |
14 | | -/* A collapsed template */ |
15 | | -.wikiEditor-template-collapsed { |
16 | | - background-color:#DDEEFF; |
17 | | - border:1px outset #DDEEFF; |
18 | | - color:#333333; |
19 | | - cursor:pointer; |
20 | | - display:inline; |
21 | | - padding:0 0.25em; |
22 | | - text-decoration:none; |
23 | | -} |
24 | | - |
25 | | -/* An expanded template */ |
26 | | -.wikiEditor-template-expanded { |
27 | | - background:#DDEEFF none repeat scroll 0 0; |
28 | | - border:1px inset #DDEEFF; |
29 | | - color:black; |
30 | | - cursor:pointer; |
31 | | - display:inline; |
32 | | - padding:0 0.25em; |
33 | | -} |
34 | | - |
35 | | -/* == Header == */ |
36 | | -.wikiEditor-toc-header { /* TODO: move parsing to highlight module and rename this */ |
37 | | - display: inline; |
38 | | - font-weight: bold; |
39 | | -} |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.html |
— | — | @@ -3,6 +3,46 @@ |
4 | 4 | <head> |
5 | 5 | <title>WikiEditor</title> |
6 | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 7 | + <style> |
| 8 | + /* CSS for highlight module. Note that this CSS is loaded in the iframe, |
| 9 | + * not in the main document. For that reason, it's also not in the combined and |
| 10 | + * minified files. |
| 11 | + * |
| 12 | + * When you edit this please update the style version in js/plugins/jquery.wikiEditor.highlight.js |
| 13 | + */ |
| 14 | + |
| 15 | + /* Wikitext that's folded away and shouldn't be displayed */ |
| 16 | + .wikiEditor-nodisplay { |
| 17 | + display: none; |
| 18 | + } |
| 19 | + |
| 20 | + /* A collapsed template */ |
| 21 | + .wikiEditor-template-collapsed { |
| 22 | + background-color:#DDEEFF; |
| 23 | + border:1px outset #DDEEFF; |
| 24 | + color:#333333; |
| 25 | + cursor:pointer; |
| 26 | + display:inline; |
| 27 | + padding:0 0.25em; |
| 28 | + text-decoration:none; |
| 29 | + } |
| 30 | + |
| 31 | + /* An expanded template */ |
| 32 | + .wikiEditor-template-expanded { |
| 33 | + background:#DDEEFF none repeat scroll 0 0; |
| 34 | + border:1px inset #DDEEFF; |
| 35 | + color:black; |
| 36 | + cursor:pointer; |
| 37 | + display:inline; |
| 38 | + padding:0 0.25em; |
| 39 | + } |
| 40 | + |
| 41 | + /* == Header == */ |
| 42 | + .wikiEditor-toc-header { /* TODO: move parsing to highlight module and rename this */ |
| 43 | + display: inline; |
| 44 | + font-weight: bold; |
| 45 | + } |
| 46 | + </style> |
7 | 47 | <script type="text/javascript"> |
8 | 48 | parent.inherit( window )( function() { |
9 | 49 | function get( name ) { |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.highlight.js |
— | — | @@ -40,6 +40,7 @@ |
41 | 41 | } |
42 | 42 | }, |
43 | 43 | ready: function( context, event ) { |
| 44 | + /* |
44 | 45 | // Add our CSS to the iframe |
45 | 46 | // Style version for wikiEditor.highlight.css is here |
46 | 47 | // FIXME: That's not ideal |
— | — | @@ -49,6 +50,7 @@ |
50 | 51 | 'href': wgScriptPath + '/extensions/UsabilityInitiative/css/wikiEditor.highlight.css?' + |
51 | 52 | $.wikiEditor.modules.highlight.cfg.styleVersion, |
52 | 53 | } ) ); |
| 54 | + */ |
53 | 55 | // Highlight stuff for the first time |
54 | 56 | $.wikiEditor.modules.highlight.fn.scan( context, "" ); |
55 | 57 | $.wikiEditor.modules.highlight.fn.mark( context, "", "" ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2216,6 +2216,7 @@ |
2217 | 2217 | } |
2218 | 2218 | }, |
2219 | 2219 | ready: function( context, event ) { |
| 2220 | + /* |
2220 | 2221 | // Add our CSS to the iframe |
2221 | 2222 | // Style version for wikiEditor.highlight.css is here |
2222 | 2223 | // FIXME: That's not ideal |
— | — | @@ -2225,6 +2226,7 @@ |
2226 | 2227 | 'href': wgScriptPath + '/extensions/UsabilityInitiative/css/wikiEditor.highlight.css?' + |
2227 | 2228 | $.wikiEditor.modules.highlight.cfg.styleVersion, |
2228 | 2229 | } ) ); |
| 2230 | + */ |
2229 | 2231 | // Highlight stuff for the first time |
2230 | 2232 | $.wikiEditor.modules.highlight.fn.scan( context, "" ); |
2231 | 2233 | $.wikiEditor.modules.highlight.fn.mark( context, "", "" ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -126,8 +126,7 @@ |
127 | 127 | 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);});} |
128 | 128 | var maxTI=0;$j('[tabindex]').each(function(){var ti=parseInt($j(this).attr('tabindex'));if(ti>maxTI) |
129 | 129 | 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);} |
130 | | -$(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:{delayedChange:function(context,event){if(event.data.scope=='none'){$.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?'+ |
131 | | -$.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,tokenStart,match){this.offset=offset;this.label=label;this.tokenStart=tokenStart;this.match=match;} |
| 130 | +$(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:{delayedChange:function(context,event){if(event.data.scope=='none'){$.wikiEditor.modules.highlight.fn.scan(context,"");$.wikiEditor.modules.highlight.fn.mark(context,"","");}},ready:function(context,event){$.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,tokenStart,match){this.offset=offset;this.label=label;this.tokenStart=tokenStart;this.match=match;} |
132 | 131 | 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;} |
133 | 132 | match=text.match(regex);var oldOffset=0;while(match!=null){var markOffset=0;var tokenStart=match.index+oldOffset+markOffset;if(markAfter){markOffset+=match[0].length;} |
134 | 133 | tokenArray.push(new Token(match.index+oldOffset+markOffset,label,tokenStart,match));oldOffset+=match.index+match[0].length;newSubstring=text.substring(oldOffset);match=newSubstring.match(regex);}}}} |