Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | ) { |
82 | 82 | UsabilityInitiativeHooks::initialize(); |
83 | 83 | // Messages |
84 | | - if ( isset( self::$modules[$module]['i18n'], self::$modules[$module]['messages'] ) ) { |
| 84 | + if ( isset( self::$modules[$module]['i18n'], self::$modules[$module]['messages'] ) ) { |
85 | 85 | wfLoadExtensionMessages( self::$modules[$module]['i18n'] ); |
86 | 86 | UsabilityInitiativeHooks::addMessages( self::$modules[$module]['messages'] ); |
87 | 87 | } |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | // Preferences |
98 | 98 | if ( isset( self::$modules[$module]['preferences'] ) ) { |
99 | 99 | foreach ( self::$modules[$module]['preferences'] as $name => $preference ) { |
100 | | - if ( !isset( $preferences[$module] ) ) { |
| 100 | + if ( !isset( $preferences[$module] ) ) { |
101 | 101 | $preferences[$module] = array(); |
102 | 102 | } |
103 | 103 | $preferences[$module][$name] = $wgUser->getOption( $preference['key'] ); |
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ), |
72 | 72 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 6 ), |
73 | 73 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 20 ), |
74 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 21 ), |
| 74 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 22 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 1 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 33 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 9 ), |
— | — | @@ -79,10 +79,10 @@ |
80 | 80 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 0 ), |
81 | 81 | ), |
82 | 82 | 'combined' => array( |
83 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 90 ), |
| 83 | + array( 'src' => 'js/plugins.combined.js', 'version' => 91 ), |
84 | 84 | ), |
85 | 85 | 'minified' => array( |
86 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 90 ), |
| 86 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 91 ), |
87 | 87 | ), |
88 | 88 | ), |
89 | 89 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -58,9 +58,13 @@ |
59 | 59 | return $.browser.name in $.wikiEditor.browsers[$( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr']; |
60 | 60 | }, |
61 | 61 | 'isSupported': function() { |
| 62 | + // Cache the return value |
| 63 | + if ( $.wikiEditor.supported != undefined ) |
| 64 | + return $.wikiEditor.supported; |
| 65 | + |
62 | 66 | if ( !$.wikiEditor.isSupportKnown ) { |
63 | 67 | // Assume good faith :) |
64 | | - return true; |
| 68 | + return $.wikiEditor.supported = true; |
65 | 69 | } |
66 | 70 | var browser = $.wikiEditor.browsers[$( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'][$.browser.name]; |
67 | 71 | for ( condition in browser ) { |
— | — | @@ -68,15 +72,15 @@ |
69 | 73 | var val = browser[condition][1]; |
70 | 74 | if ( typeof val == 'string' ) { |
71 | 75 | if ( !( eval( '$.browser.version' + op + '"' + val + '"' ) ) ) { |
72 | | - return false; |
| 76 | + return $.wikiEditor.supported = false; |
73 | 77 | } |
74 | 78 | } else if ( typeof val == 'number' ) { |
75 | 79 | if ( !( eval( '$.browser.versionNumber' + op + val ) ) ) { |
76 | | - return false; |
| 80 | + return $.wikiEditor.supported = false; |
77 | 81 | } |
78 | 82 | } |
79 | 83 | } |
80 | | - return true; |
| 84 | + return $.wikiEditor.supported = true; |
81 | 85 | }, |
82 | 86 | // Wraps gM from js2, but allows raw text to supercede |
83 | 87 | 'autoMsg': function( object, property ) { |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -1364,9 +1364,13 @@ |
1365 | 1365 | return $.browser.name in $.wikiEditor.browsers[$( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr']; |
1366 | 1366 | }, |
1367 | 1367 | 'isSupported': function() { |
| 1368 | + // Cache the return value |
| 1369 | + if ( $.wikiEditor.supported != undefined ) |
| 1370 | + return $.wikiEditor.supported; |
| 1371 | + |
1368 | 1372 | if ( !$.wikiEditor.isSupportKnown ) { |
1369 | 1373 | // Assume good faith :) |
1370 | | - return true; |
| 1374 | + return $.wikiEditor.supported = true; |
1371 | 1375 | } |
1372 | 1376 | var browser = $.wikiEditor.browsers[$( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'][$.browser.name]; |
1373 | 1377 | for ( condition in browser ) { |
— | — | @@ -1374,15 +1378,15 @@ |
1375 | 1379 | var val = browser[condition][1]; |
1376 | 1380 | if ( typeof val == 'string' ) { |
1377 | 1381 | if ( !( eval( '$.browser.version' + op + '"' + val + '"' ) ) ) { |
1378 | | - return false; |
| 1382 | + return $.wikiEditor.supported = false; |
1379 | 1383 | } |
1380 | 1384 | } else if ( typeof val == 'number' ) { |
1381 | 1385 | if ( !( eval( '$.browser.versionNumber' + op + val ) ) ) { |
1382 | | - return false; |
| 1386 | + return $.wikiEditor.supported = false; |
1383 | 1387 | } |
1384 | 1388 | } |
1385 | 1389 | } |
1386 | | - return true; |
| 1390 | + return $.wikiEditor.supported = true; |
1387 | 1391 | }, |
1388 | 1392 | // Wraps gM from js2, but allows raw text to supercede |
1389 | 1393 | 'autoMsg': function( object, property ) { |
— | — | @@ -2186,50 +2190,50 @@ |
2187 | 2191 | */ |
2188 | 2192 | create: function( context, config ) { |
2189 | 2193 | // Build the dialog behind the Publish button |
2190 | | - var dialogID = 'wikiEditor-' + context.instance + '-savedialog'; |
| 2194 | + var dialogID = 'wikiEditor-' + context.instance + '-dialog'; |
2191 | 2195 | $.wikiEditor.modules.dialogs.fn.create( |
2192 | 2196 | context, |
2193 | 2197 | { |
2194 | 2198 | previewsave: { |
2195 | 2199 | id: dialogID, |
2196 | | - titleMsg: 'wikieditor-publish-savedialog-title', |
| 2200 | + titleMsg: 'wikieditor-publish-dialog-title', |
2197 | 2201 | html: '\ |
2198 | | - <div class="wikiEditor-savedialog-copywarn"></div>\ |
2199 | | - <div class="wikiEditor-savedialog-editoptions">\ |
| 2202 | + <div class="wikiEditor-dialog-copywarn"></div>\ |
| 2203 | + <div class="wikiEditor-dialog-editoptions">\ |
2200 | 2204 | <form>\ |
2201 | | - <label for="wikiEditor-' + context.instance + '-savedialog-summary"\ |
2202 | | - rel="wikieditor-publish-savedialog-summary"></label>\ |
| 2205 | + <label for="wikiEditor-' + context.instance + '-dialog-summary"\ |
| 2206 | + rel="wikieditor-publish-dialog-summary"></label>\ |
2203 | 2207 | <br />\ |
2204 | | - <input type="text" id="wikiEditor-' + context.instance + '-savedialog-summary"\ |
| 2208 | + <input type="text" id="wikiEditor-' + context.instance + '-dialog-summary"\ |
2205 | 2209 | style="width: 100%;" />\ |
2206 | 2210 | <br />\ |
2207 | 2211 | <input type="checkbox"\ |
2208 | | - id="wikiEditor-' + context.instance + '-savedialog-minor" />\ |
2209 | | - <label for="wikiEditor-' + context.instance + '-savedialog-minor"\ |
2210 | | - rel="wikieditor-publish-savedialog-minor"></label>\ |
| 2212 | + id="wikiEditor-' + context.instance + '-dialog-minor" />\ |
| 2213 | + <label for="wikiEditor-' + context.instance + '-dialog-minor"\ |
| 2214 | + rel="wikieditor-publish-dialog-minor"></label>\ |
2211 | 2215 | <br />\ |
2212 | 2216 | <input type="checkbox"\ |
2213 | | - id="wikiEditor-' + context.instance + '-savedialog-watch" />\ |
2214 | | - <label for="wikiEditor-' + context.instance + '-savedialog-watch"\ |
2215 | | - rel="wikieditor-publish-savedialog-watch"></label>\ |
| 2217 | + id="wikiEditor-' + context.instance + '-dialog-watch" />\ |
| 2218 | + <label for="wikiEditor-' + context.instance + '-dialog-watch"\ |
| 2219 | + rel="wikieditor-publish-dialog-watch"></label>\ |
2216 | 2220 | </form>\ |
2217 | 2221 | </div>', |
2218 | 2222 | init: function() { |
2219 | 2223 | $(this).find( '[rel]' ).each( function() { |
2220 | 2224 | $(this).text( gM( $(this).attr( 'rel' ) ) ); |
2221 | 2225 | }); |
2222 | | - $(this).find( '.wikiEditor-savedialog-copywarn' ) |
| 2226 | + $(this).find( '.wikiEditor-dialog-copywarn' ) |
2223 | 2227 | .html( $( '#editpage-copywarn' ).html() ); |
2224 | 2228 | |
2225 | 2229 | if ( $( '#wpMinoredit' ).size() == 0 ) |
2226 | | - $( '#wikiEditor-' + context.instance + '-savedialog-minor' ).hide(); |
| 2230 | + $( '#wikiEditor-' + context.instance + '-dialog-minor' ).hide(); |
2227 | 2231 | else if ( $( '#wpMinoredit' ).is( ':checked' ) ) |
2228 | | - $( '#wikiEditor-' + context.instance + '-savedialog-minor' ) |
| 2232 | + $( '#wikiEditor-' + context.instance + '-dialog-minor' ) |
2229 | 2233 | .attr( 'checked', 'checked' ); |
2230 | 2234 | if ( $( '#wpWatchthis' ).size() == 0 ) |
2231 | | - $( '#wikiEditor-' + context.instance + '-savedialog-watch' ).hide(); |
| 2235 | + $( '#wikiEditor-' + context.instance + '-dialog-watch' ).hide(); |
2232 | 2236 | else if ( $( '#wpWatchthis' ).is( ':checked' ) ) |
2233 | | - $( '#wikiEditor-' + context.instance + '-savedialog-watch' ) |
| 2237 | + $( '#wikiEditor-' + context.instance + '-dialog-watch' ) |
2234 | 2238 | .attr( 'checked', 'checked' ); |
2235 | 2239 | |
2236 | 2240 | $(this).find( 'form' ).submit( function( e ) { |
— | — | @@ -2239,25 +2243,25 @@ |
2240 | 2244 | }, |
2241 | 2245 | dialog: { |
2242 | 2246 | buttons: { |
2243 | | - 'wikieditor-publish-savedialog-publish': function() { |
| 2247 | + 'wikieditor-publish-dialog-publish': function() { |
2244 | 2248 | var minorChecked = $( '#wikiEditor-' + context.instance + |
2245 | | - '-savedialog-minor' ).is( ':checked' ) ? |
| 2249 | + '-dialog-minor' ).is( ':checked' ) ? |
2246 | 2250 | 'checked' : ''; |
2247 | 2251 | var watchChecked = $( '#wikiEditor-' + context.instance + |
2248 | | - '-savedialog-watch' ).is( ':checked' ) ? |
| 2252 | + '-dialog-watch' ).is( ':checked' ) ? |
2249 | 2253 | 'checked' : ''; |
2250 | 2254 | $( '#wpMinoredit' ).attr( 'checked', minorChecked ); |
2251 | 2255 | $( '#wpWatchthis' ).attr( 'checked', watchChecked ); |
2252 | 2256 | $( '#wpSummary' ).val( $j( '#wikiEditor-' + context.instance + |
2253 | | - '-savedialog-summary' ).val() ); |
| 2257 | + '-dialog-summary' ).val() ); |
2254 | 2258 | $( '#editform' ).submit(); |
2255 | 2259 | }, |
2256 | | - 'wikieditor-publish-savedialog-goback': function() { |
| 2260 | + 'wikieditor-publish-dialog-goback': function() { |
2257 | 2261 | $(this).dialog( 'close' ); |
2258 | 2262 | } |
2259 | 2263 | }, |
2260 | 2264 | open: function() { |
2261 | | - $( '#wikiEditor-' + context.instance + '-savedialog-summary' ).focus(); |
| 2265 | + $( '#wikiEditor-' + context.instance + '-dialog-summary' ).focus(); |
2262 | 2266 | }, |
2263 | 2267 | width: 500 |
2264 | 2268 | }, |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -81,9 +81,10 @@ |
82 | 82 | this.scrollTop+=range.offsetTop;else if(options.force){range.move('character',-1);range.select();}} |
83 | 83 | $(this).trigger('scrollToPosition');});}};switch(command){case'encapsulateSelection':options=$.extend({'pre':'','peri':'','post':'','ownline':false,'replace':false},options);break;case'getCaretPosition':options=$.extend({'startAndEnd':false,},options);break;case'setSelection':options=$.extend({'start':undefined,'end':undefined},options);if(options.end===undefined) |
84 | 84 | options.end=options.start;break;case'scrollToCaretPosition':options=$.extend({'force':false},options);break;} |
85 | | -var context=$(this).data('wikiEditor-context');var hasIframe=context!==undefined&&context.$iframe!==undefined;return(hasIframe?context.fn:fn)[command].call(this,options);};})(jQuery);(function($){$.wikiEditor={'modules':{},'instances':[],'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',2],['!=','2.0'],['!=','2.0.0.1'],['!=','2.0.0.2'],['!=','2.0.0.3'],['!=','2.0.0.4']],'opera':[['>=',9.6]],'safari':[['>=',3.1]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',2],['!=','2.0'],['!=','2.0.0.1'],['!=','2.0.0.2'],['!=','2.0.0.3'],['!=','2.0.0.4']],'opera':[['>=',9.6]],'safari':[['>=',3.1]]}},'imgPath':wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/','isSupportKnown':function(){return $.browser.name in $.wikiEditor.browsers[$('body').is('.rtl')?'rtl':'ltr'];},'isSupported':function(){if(!$.wikiEditor.isSupportKnown){return true;} |
86 | | -var browser=$.wikiEditor.browsers[$('body').is('.rtl')?'rtl':'ltr'][$.browser.name];for(condition in browser){var op=browser[condition][0];var val=browser[condition][1];if(typeof val=='string'){if(!(eval('$.browser.version'+op+'"'+val+'"'))){return false;}}else if(typeof val=='number'){if(!(eval('$.browser.versionNumber'+op+val))){return false;}}} |
87 | | -return true;},'autoMsg':function(object,property){if(typeof property=='object'){for(i in property){if(property[i]in object||property[i]+'Msg'in object){property=property[i];break;}}} |
| 85 | +var context=$(this).data('wikiEditor-context');var hasIframe=context!==undefined&&context.$iframe!==undefined;return(hasIframe?context.fn:fn)[command].call(this,options);};})(jQuery);(function($){$.wikiEditor={'modules':{},'instances':[],'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',2],['!=','2.0'],['!=','2.0.0.1'],['!=','2.0.0.2'],['!=','2.0.0.3'],['!=','2.0.0.4']],'opera':[['>=',9.6]],'safari':[['>=',3.1]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',2],['!=','2.0'],['!=','2.0.0.1'],['!=','2.0.0.2'],['!=','2.0.0.3'],['!=','2.0.0.4']],'opera':[['>=',9.6]],'safari':[['>=',3.1]]}},'imgPath':wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/','isSupportKnown':function(){return $.browser.name in $.wikiEditor.browsers[$('body').is('.rtl')?'rtl':'ltr'];},'isSupported':function(){if($.wikiEditor.supported!=undefined) |
| 86 | +return $.wikiEditor.supported;if(!$.wikiEditor.isSupportKnown){return $.wikiEditor.supported=true;} |
| 87 | +var browser=$.wikiEditor.browsers[$('body').is('.rtl')?'rtl':'ltr'][$.browser.name];for(condition in browser){var op=browser[condition][0];var val=browser[condition][1];if(typeof val=='string'){if(!(eval('$.browser.version'+op+'"'+val+'"'))){return $.wikiEditor.supported=false;}}else if(typeof val=='number'){if(!(eval('$.browser.versionNumber'+op+val))){return $.wikiEditor.supported=false;}}} |
| 88 | +return $.wikiEditor.supported=true;},'autoMsg':function(object,property){if(typeof property=='object'){for(i in property){if(property[i]in object||property[i]+'Msg'in object){property=property[i];break;}}} |
88 | 89 | if(property in object){return object[property];}else if(property+'Msg'in object){return gM(object[property+'Msg']);}else{return'';}},'fixOperaBrokenness':function(s){return s;}};$.fn.wikiEditor=function(){if($j.wikiEditor.isSupportKnown()&&!$j.wikiEditor.isSupported()){return $(this);} |
89 | 90 | var context=$(this).data('wikiEditor-context');if(typeof context=='undefined'){var instance=$.wikiEditor.instances.length;context={'$textarea':$(this),'views':{},'modules':{},'data':{},'instance':instance};$.wikiEditor.instances[instance]=$(this);context.api={'addModule':function(context,data){function callModuleApi(module,call,data){if(module in $.wikiEditor.modules&&'fn'in $.wikiEditor.modules[module]&&call in $.wikiEditor.modules[module].fn){$.wikiEditor.modules[module].fn[call](context,data);}} |
90 | 91 | if(typeof data=='string'){callModuleApi(data,'create',{});}else if(typeof data=='object'){for(module in data){if(typeof module=='string'){callModuleApi(module,'create',data[module]);}}}}};for(module in $.wikiEditor.modules){if('api'in $.wikiEditor.modules[module]){for(call in $.wikiEditor.modules[module].api){if(!(call in context.api)){context.api[call]=$.wikiEditor.modules[module].api[call];}}}} |
— | — | @@ -115,31 +116,31 @@ |
116 | 117 | $(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={api:{},evt:{change:function(event){}},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){return[];},mark:function(context,division,tokens){}}};})(jQuery);(function($){$.wikiEditor.modules.preview={api:{},fn:{create:function(context,config){if('preview'in context.modules){return;} |
117 | 118 | context.modules.preview={'previousText':null};context.$preview=context.fn.addView({'name':'preview','titleMsg':'wikieditor-preview-tab','init':function(context){var wikitext=context.fn.getContents();if(context.modules.preview.previousText==wikitext){return;} |
118 | 119 | context.$preview.find('.wikiEditor-preview-contents').empty();context.$preview.find('.wikiEditor-preview-loading').show();$.post(wgScriptPath+'/api.php',{'action':'parse','title':wgPageName,'text':wikitext,'prop':'text','pst':'','format':'json'},function(data){if(data.parse==undefined||data.parse.text==undefined||data.parse.text['*']==undefined){return;} |
119 | | -context.modules.preview.previousText=wikitext;context.$preview.find('.wikiEditor-preview-loading').hide();context.$preview.find('.wikiEditor-preview-contents').html(data.parse.text['*']);},'json');}});var loadingMsg=gM('wikieditor-preview-loading');context.$preview.append($('<div />').addClass('wikiEditor-preview-loading').append($('<img />').addClass('wikiEditor-preview-spinner').attr({'src':$.wikiEditor.imgPath+'dialogs/loading.gif','valign':'absmiddle','alt':loadingMsg,'title':loadingMsg})).append($('<span></span>').text(loadingMsg))).append($('<div />').addClass('wikiEditor-preview-contents'));}}};})(jQuery);(function($){$.wikiEditor.modules.publish={api:{},fn:{create:function(context,config){var dialogID='wikiEditor-'+context.instance+'-savedialog';$.wikiEditor.modules.dialogs.fn.create(context,{previewsave:{id:dialogID,titleMsg:'wikieditor-publish-savedialog-title',html:'\ |
120 | | - <div class="wikiEditor-savedialog-copywarn"></div>\ |
121 | | - <div class="wikiEditor-savedialog-editoptions">\ |
| 120 | +context.modules.preview.previousText=wikitext;context.$preview.find('.wikiEditor-preview-loading').hide();context.$preview.find('.wikiEditor-preview-contents').html(data.parse.text['*']);},'json');}});var loadingMsg=gM('wikieditor-preview-loading');context.$preview.append($('<div />').addClass('wikiEditor-preview-loading').append($('<img />').addClass('wikiEditor-preview-spinner').attr({'src':$.wikiEditor.imgPath+'dialogs/loading.gif','valign':'absmiddle','alt':loadingMsg,'title':loadingMsg})).append($('<span></span>').text(loadingMsg))).append($('<div />').addClass('wikiEditor-preview-contents'));}}};})(jQuery);(function($){$.wikiEditor.modules.publish={api:{},fn:{create:function(context,config){var dialogID='wikiEditor-'+context.instance+'-dialog';$.wikiEditor.modules.dialogs.fn.create(context,{previewsave:{id:dialogID,titleMsg:'wikieditor-publish-dialog-title',html:'\ |
| 121 | + <div class="wikiEditor-dialog-copywarn"></div>\ |
| 122 | + <div class="wikiEditor-dialog-editoptions">\ |
122 | 123 | <form>\ |
123 | | - <label for="wikiEditor-'+context.instance+'-savedialog-summary"\ |
124 | | - rel="wikieditor-publish-savedialog-summary"></label>\ |
| 124 | + <label for="wikiEditor-'+context.instance+'-dialog-summary"\ |
| 125 | + rel="wikieditor-publish-dialog-summary"></label>\ |
125 | 126 | <br />\ |
126 | | - <input type="text" id="wikiEditor-'+context.instance+'-savedialog-summary"\ |
| 127 | + <input type="text" id="wikiEditor-'+context.instance+'-dialog-summary"\ |
127 | 128 | style="width: 100%;" />\ |
128 | 129 | <br />\ |
129 | 130 | <input type="checkbox"\ |
130 | | - id="wikiEditor-'+context.instance+'-savedialog-minor" />\ |
131 | | - <label for="wikiEditor-'+context.instance+'-savedialog-minor"\ |
132 | | - rel="wikieditor-publish-savedialog-minor"></label>\ |
| 131 | + id="wikiEditor-'+context.instance+'-dialog-minor" />\ |
| 132 | + <label for="wikiEditor-'+context.instance+'-dialog-minor"\ |
| 133 | + rel="wikieditor-publish-dialog-minor"></label>\ |
133 | 134 | <br />\ |
134 | 135 | <input type="checkbox"\ |
135 | | - id="wikiEditor-'+context.instance+'-savedialog-watch" />\ |
136 | | - <label for="wikiEditor-'+context.instance+'-savedialog-watch"\ |
137 | | - rel="wikieditor-publish-savedialog-watch"></label>\ |
| 136 | + id="wikiEditor-'+context.instance+'-dialog-watch" />\ |
| 137 | + <label for="wikiEditor-'+context.instance+'-dialog-watch"\ |
| 138 | + rel="wikieditor-publish-dialog-watch"></label>\ |
138 | 139 | </form>\ |
139 | | - </div>',init:function(){$(this).find('[rel]').each(function(){$(this).text(gM($(this).attr('rel')));});$(this).find('.wikiEditor-savedialog-copywarn').html($('#editpage-copywarn').html());if($('#wpMinoredit').size()==0) |
140 | | -$('#wikiEditor-'+context.instance+'-savedialog-minor').hide();else if($('#wpMinoredit').is(':checked')) |
141 | | -$('#wikiEditor-'+context.instance+'-savedialog-minor').attr('checked','checked');if($('#wpWatchthis').size()==0) |
142 | | -$('#wikiEditor-'+context.instance+'-savedialog-watch').hide();else if($('#wpWatchthis').is(':checked')) |
143 | | -$('#wikiEditor-'+context.instance+'-savedialog-watch').attr('checked','checked');$(this).find('form').submit(function(e){$(this).closest('.ui-dialog').find('button:first').click();e.preventDefault();});},dialog:{buttons:{'wikieditor-publish-savedialog-publish':function(){var minorChecked=$('#wikiEditor-'+context.instance+'-savedialog-minor').is(':checked')?'checked':'';var watchChecked=$('#wikiEditor-'+context.instance+'-savedialog-watch').is(':checked')?'checked':'';$('#wpMinoredit').attr('checked',minorChecked);$('#wpWatchthis').attr('checked',watchChecked);$('#wpSummary').val($j('#wikiEditor-'+context.instance+'-savedialog-summary').val());$('#editform').submit();},'wikieditor-publish-savedialog-goback':function(){$(this).dialog('close');}},open:function(){$('#wikiEditor-'+context.instance+'-savedialog-summary').focus();},width:500},resizeme:false}});context.fn.addButton({'captionMsg':'wikieditor-publish-button-publish','action':function(){$('#'+dialogID).dialog('open');return false;}});context.fn.addButton({'captionMsg':'wikieditor-publish-button-cancel','action':function(){}});}}};})(jQuery);(function($){$.wikiEditor.modules.toc={api:{},defaultWidth:'166px',minimumWidth:'70px',fn:{create:function(context,config){if('$toc'in context.modules){return;} |
| 140 | + </div>',init:function(){$(this).find('[rel]').each(function(){$(this).text(gM($(this).attr('rel')));});$(this).find('.wikiEditor-dialog-copywarn').html($('#editpage-copywarn').html());if($('#wpMinoredit').size()==0) |
| 141 | +$('#wikiEditor-'+context.instance+'-dialog-minor').hide();else if($('#wpMinoredit').is(':checked')) |
| 142 | +$('#wikiEditor-'+context.instance+'-dialog-minor').attr('checked','checked');if($('#wpWatchthis').size()==0) |
| 143 | +$('#wikiEditor-'+context.instance+'-dialog-watch').hide();else if($('#wpWatchthis').is(':checked')) |
| 144 | +$('#wikiEditor-'+context.instance+'-dialog-watch').attr('checked','checked');$(this).find('form').submit(function(e){$(this).closest('.ui-dialog').find('button:first').click();e.preventDefault();});},dialog:{buttons:{'wikieditor-publish-dialog-publish':function(){var minorChecked=$('#wikiEditor-'+context.instance+'-dialog-minor').is(':checked')?'checked':'';var watchChecked=$('#wikiEditor-'+context.instance+'-dialog-watch').is(':checked')?'checked':'';$('#wpMinoredit').attr('checked',minorChecked);$('#wpWatchthis').attr('checked',watchChecked);$('#wpSummary').val($j('#wikiEditor-'+context.instance+'-dialog-summary').val());$('#editform').submit();},'wikieditor-publish-dialog-goback':function(){$(this).dialog('close');}},open:function(){$('#wikiEditor-'+context.instance+'-dialog-summary').focus();},width:500},resizeme:false}});context.fn.addButton({'captionMsg':'wikieditor-publish-button-publish','action':function(){$('#'+dialogID).dialog('open');return false;}});context.fn.addButton({'captionMsg':'wikieditor-publish-button-cancel','action':function(){}});}}};})(jQuery);(function($){$.wikiEditor.modules.toc={api:{},defaultWidth:'166px',minimumWidth:'70px',fn:{create:function(context,config){if('$toc'in context.modules){return;} |
144 | 145 | var height=context.$ui.find('.wikiEditor-ui-left').height();context.modules.$toc=$('<div />').addClass('wikiEditor-ui-toc').data('context',context);context.$ui.find('.wikiEditor-ui-right').css('width',$.wikiEditor.modules.toc.defaultWidth).append(context.modules.$toc);context.modules.$toc.height(context.$ui.find('.wikiEditor-ui-left').height());context.$ui.find('.wikiEditor-ui-left').css('marginRight',"-"+$.wikiEditor.modules.toc.defaultWidth).children().css('marginRight',$.wikiEditor.modules.toc.defaultWidth);$.wikiEditor.modules.toc.fn.build(context,config);context.$content.parent().delayedBind(250,'mouseup scrollToTop keyup change',function(){$(this).eachAsync({bulk:0,loop:function(){$.wikiEditor.modules.toc.fn.build(context);$.wikiEditor.modules.toc.fn.update(context);}});}).blur(function(event){var context=event.data.context;context.$textarea.delayedBindCancel(250,'mouseup scrollToTop keyup change');$.wikiEditor.modules.toc.fn.unhighlight(context);});},unhighlight:function(context){context.modules.$toc.find('div').removeClass('current');},update:function(context){$.wikiEditor.modules.toc.fn.unhighlight(context);var position=context.$textarea.textSelection('getCaretPosition');var section=0;if(context.data.outline.length>0){if(!(position<context.data.outline[0].position-1)){while(section<context.data.outline.length&&context.data.outline[section].position-1<position){section++;} |
145 | 146 | section=Math.max(0,section);} |
146 | 147 | var sectionLink=context.modules.$toc.find('div.section-'+section);sectionLink.addClass('current');var relTop=sectionLink.offset().top-context.modules.$toc.offset().top;var scrollTop=context.modules.$toc.scrollTop();var divHeight=context.modules.$toc.height();var sectionHeight=sectionLink.height();if(relTop<0) |