r71182 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71181‎ | r71182 | r71183 >
Date:01:03, 17 August 2010
Author:tparscal
Status:ok
Tags:
Comment:
Fixed syntax errors
Modified paths:
  • /branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.mwsuggest.js (modified) (history)
  • /branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.prefs.js (modified) (history)
  • /branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.preview.js (modified) (history)
  • /branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.rightclickedit.js (modified) (history)
  • /branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.upload.js (modified) (history)
  • /branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.wikibits.js (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.prefs.js
@@ -62,7 +62,7 @@
6363 }
6464 var a = document.createElement( 'a' );
6565 a.href = '#' + sections[i].secid;
66 - a.onmousedown = a.onclick = uncoversection;
 66+ a.onmousedown = a.onclick = mw.legacy.uncoversection;
6767 a.appendChild( document.createTextNode( sections[i].text ) );
6868 a.secid = sections[i].secid;
6969 li.appendChild( a );
@@ -107,11 +107,11 @@
108108 var tzTextbox = document.getElementById( 'mw-input-timecorrection-other' );
109109
110110 if ( tzSelect && tzTextbox ) {
111 - addHandler( tzSelect, 'change', function( e ) { updateTimezoneSelection( false ); } );
112 - addHandler( tzTextbox, 'blur', function( e ) { updateTimezoneSelection( true ); } );
 111+ addHandler( tzSelect, 'change', function( e ) { mw.legacy.updateTimezoneSelection( false ); } );
 112+ addHandler( tzTextbox, 'blur', function( e ) { mw.legacy.updateTimezoneSelection( true ); } );
113113 }
114114
115 - updateTimezoneSelection( false );
 115+ mw.legacy.updateTimezoneSelection( false );
116116 },
117117 /**
118118 * Timezone stuff tz in format [-]HH:MM - won't yet work with non-even tzs
@@ -132,15 +132,15 @@
133133 var selector = document.getElementById( 'mw-input-timecorrection' );
134134
135135 selector.value = 'other';
136 - textbox.value = fetchTimezone();
 136+ textbox.value = mw.legacy.fetchTimezone();
137137 textbox.disabled = false; // The changed handler doesn't trip, obviously.
138 - updateTimezoneSelection( true );
 138+ mw.legacy.updateTimezoneSelection( true );
139139 },
140140 'updateTimezoneSelection': function( force_offset ) {
141141 var selector = document.getElementById( 'mw-input-timecorrection' );
142142
143143 if ( selector.value == 'guess' ) {
144 - return guessTimezone();
 144+ return mw.legacy.guessTimezone();
145145 }
146146
147147 var textbox = document.getElementById( 'mw-input-timecorrection-other' );
Index: branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.preview.js
@@ -14,18 +14,18 @@
1515
1616 'doLivePreview': function( e ) {
1717 e.preventDefault();
18 - $j( mw ).trigger( 'LivePreviewPrepare' );
19 - var postData = $j('#editform').formToArray();
 18+ $( mw ).trigger( 'LivePreviewPrepare' );
 19+ var postData = $('#editform').formToArray();
2020 postData.push( { 'name' : 'wpPreview', 'value' : '1' } );
2121 // Hide active diff, used templates, old preview if shown
2222 var copyElements = ['#wikiPreview', '.templatesUsed', '.hiddencats', '#catlinks'];
2323 var copySelector = copyElements.join(',');
24 - $j.each( copyElements, function(k,v) { $j(v).fadeOut('fast'); } );
 24+ $.each( copyElements, function(k,v) { $(v).fadeOut('fast'); } );
2525 // Display a loading graphic
26 - var loadSpinner = $j('<div class="mw-ajax-loader"/>');
27 - $j('#wikiPreview').before( loadSpinner );
28 - var page = $j('<div/>');
29 - var target = $j('#editform').attr('action');
 26+ var loadSpinner = $('<div class="mw-ajax-loader"/>');
 27+ $('#wikiPreview').before( loadSpinner );
 28+ var page = $('<div/>');
 29+ var target = $('#editform').attr('action');
3030 if ( !target ) {
3131 target = window.location.href;
3232 }
@@ -35,16 +35,16 @@
3636 // and the real page, empty the element in the real page, and fill it
3737 // with the content of the loaded page
3838 var copyContent = page.find( copyElements[i] ).contents();
39 - $j(copyElements[i]).empty().append( copyContent );
 39+ $(copyElements[i]).empty().append( copyContent );
4040 var newClasses = page.find( copyElements[i] ).attr('class');
41 - $j(copyElements[i]).attr( 'class', newClasses );
 41+ $(copyElements[i]).attr( 'class', newClasses );
4242 }
43 - $j.each( copyElements, function(k,v) {
 43+ $.each( copyElements, function(k,v) {
4444 // Don't belligerently show elements that are supposed to be hidden
45 - $j(v).fadeIn( 'fast', function() { $j(this).css('display', ''); } );
 45+ $(v).fadeIn( 'fast', function() { $(this).css('display', ''); } );
4646 } );
4747 loadSpinner.remove();
48 - $j( mw ).trigger( 'LivePreviewDone', [copyElements] );
 48+ $( mw ).trigger( 'LivePreviewDone', [copyElements] );
4949 } );
5050 }
5151 } );
@@ -54,7 +54,7 @@
5555 $( document ).ready( function() {
5656 // Shamelessly stolen from the jQuery form plugin, which is licensed under the GPL.
5757 // http://jquery.malsup.com/form/#download
58 - $j.fn.formToArray = function() {
 58+ $.fn.formToArray = function() {
5959 var a = [];
6060 if (this.length == 0) return a;
6161 var form = this[0];
@@ -64,7 +64,7 @@
6565 var el = els[i];
6666 var n = el.name;
6767 if (!n) continue;
68 - var v = $j.fieldValue(el, true);
 68+ var v = $.fieldValue(el, true);
6969 if (v && v.constructor == Array) {
7070 for(var j=0, jmax=v.length; j < jmax; j++)
7171 a.push({name: n, value: v[j]});
@@ -85,7 +85,7 @@
8686 /**
8787 * Returns the value of the field element.
8888 */
89 - $j.fieldValue = function(el, successful) {
 89+ $.fieldValue = function(el, successful) {
9090 var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
9191 if (typeof successful == 'undefined') successful = true;
9292 if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
@@ -115,7 +115,7 @@
116116 }
117117 return el.value;
118118 };
119 - $j('#wpPreview').click( doLivePreview );
 119+ $('#wpPreview').click( mw.legacy.doLivePreview );
120120 } );
121121
122122 } )( jQuery, mediaWiki );
\ No newline at end of file
Index: branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.upload.js
@@ -41,7 +41,7 @@
4242 return;
4343 }
4444 }
45 - this.timeoutID = window.setTimeout( 'wgUploadWarningObj.timeout()', this.delay );
 45+ this.timeoutID = window.setTimeout( 'mw.legacy.wgUploadWarningObj.timeout()', this.delay );
4646 },
4747 'checkNow': function ( fname ) {
4848 if ( !wgAjaxUploadDestCheck || !sajax_init_object() ) return;
@@ -118,7 +118,7 @@
119119 var req = sajax_init_object();
120120 req.onreadystatechange = function() {
121121 if ( req.readyState == 4 && req.status == 200 )
122 - wgUploadLicenseObj.processResult( eval( '( ' + req.responseText + ' )' ), license );
 122+ mw.legacy.wgUploadLicenseObj.processResult( eval( '( ' + req.responseText + ' )' ), license );
123123 };
124124 req.open( 'GET', url, true );
125125 req.send( '' );
@@ -147,7 +147,7 @@
148148 }
149149 }
150150 // We might show a preview
151 - wgUploadLicenseObj.fetchPreview( selection );
 151+ mw.legacy.wgUploadLicenseObj.fetchPreview( selection );
152152 },
153153 'wgUploadSetup': function() {
154154 // Disable URL box if the URL copy upload source type is not selected
@@ -174,14 +174,14 @@
175175 // Toggle source type
176176 var sourceTypeCheckboxes = document.getElementsByName( 'wpSourceType' );
177177 for ( var i = 0; i < sourceTypeCheckboxes.length; i++ ) {
178 - sourceTypeCheckboxes[i].onchange = toggleUploadInputs;
 178+ sourceTypeCheckboxes[i].onchange = mw.legacy.toggleUploadInputs;
179179 }
180180 // AJAX wpDestFile warnings
181 - if ( wgAjaxUploadDestCheck ) {
 181+ if ( typeof wgAjaxUploadDestCheck !== 'undefined' && wgAjaxUploadDestCheck ) {
182182 // Insert an event handler that fetches upload warnings when wpDestFile
183183 // has been changed
184184 document.getElementById( 'wpDestFile' ).onchange = function ( e ) {
185 - wgUploadWarningObj.checkNow( this.value );
 185+ mw.legacy.wgUploadWarningObj.checkNow( this.value );
186186 };
187187 // Insert a row where the warnings will be displayed just below the
188188 // wpDestFile row
@@ -192,9 +192,9 @@
193193 td.colSpan = 2;
194194 row.appendChild( td );
195195 }
196 - if ( wgAjaxLicensePreview ) {
 196+ if ( typeof wgAjaxLicensePreview !== 'undefined' && wgAjaxLicensePreview ) {
197197 // License selector check
198 - document.getElementById( 'wpLicense' ).onchange = licenseSelectorCheck;
 198+ document.getElementById( 'wpLicense' ).onchange = mw.legacy.licenseSelectorCheck;
199199 // License selector table row
200200 var wpLicense = document.getElementById( 'wpLicense' );
201201 var wpLicenseRow = wpLicense.parentNode.parentNode;
@@ -208,9 +208,10 @@
209209 wpLicenseTbody.insertBefore( row, wpLicenseRow.nextSibling );
210210 }
211211 // fillDestFile setup
 212+ if ( typeof wgUploadSourceIds !== 'undefined' && wgUploadSourceIds )
212213 for ( var i = 0; i < wgUploadSourceIds.length; i++ )
213214 document.getElementById( wgUploadSourceIds[i] ).onchange = function ( e ) {
214 - fillDestFilename( this.id );
 215+ mw.legacy.fillDestFilename( this.id );
215216 };
216217 },
217218 /**
@@ -309,7 +310,7 @@
310311 var destFile = document.getElementById( 'wpDestFile' );
311312 if ( destFile ) {
312313 destFile.value = fname;
313 - wgUploadWarningObj.checkNow( fname ) ;
 314+ mw.legacy.wgUploadWarningObj.checkNow( fname ) ;
314315 }
315316 },
316317 'toggleFilenameFiller': function() {
Index: branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.wikibits.js
@@ -149,9 +149,9 @@
150150 // set this before running any hooks, since any errors below
151151 // might cause the function to terminate prematurely
152152 mw.legacy.doneOnloadHook = true;
153 - updateTooltipAccessKeys( null );
154 - setupCheckboxShiftClick();
155 - sortables_init();
 153+ mw.legacy.updateTooltipAccessKeys( null );
 154+ mw.legacy.setupCheckboxShiftClick();
 155+ mw.legacy.sortables_init();
156156 // Run any added-on functions
157157 for ( var i = 0; i < mw.legacy.onloadFuncts.length; i++ ) {
158158 mw.legacy.onloadFuncts[i]();
@@ -260,12 +260,12 @@
261261 for ( var i in linkContainers ) {
262262 var linkContainer = document.getElementById( linkContainers[i] );
263263 if ( linkContainer ) {
264 - updateTooltipAccessKeys( linkContainer.getElementsByTagName( 'a' ) );
 264+ mw.legacy.updateTooltipAccessKeys( linkContainer.getElementsByTagName( 'a' ) );
265265 }
266266 }
267267 // these are rare enough that no such optimization is needed
268 - updateTooltipAccessKeys( document.getElementsByTagName( 'input' ) );
269 - updateTooltipAccessKeys( document.getElementsByTagName( 'label' ) );
 268+ mw.legacy.updateTooltipAccessKeys( document.getElementsByTagName( 'input' ) );
 269+ mw.legacy.updateTooltipAccessKeys( document.getElementsByTagName( 'label' ) );
270270 return;
271271 }
272272 for ( var i = 0; i < nodeList.length; i++ ) {
@@ -296,7 +296,7 @@
297297 mw.legacy.checkboxes = [];
298298 mw.legacy.lastCheckbox = null;
299299 var inputs = document.getElementsByTagName( 'input' );
300 - addCheckboxClickHandlers( inputs );
 300+ mw.legacy.addCheckboxClickHandlers( inputs );
301301 },
302302 'addCheckboxClickHandlers': function( inputs, start ) {
303303 if ( !start ) {
@@ -314,11 +314,11 @@
315315 var end = mw.legacy.checkboxes.length;
316316 mw.legacy.checkboxes[end] = cb;
317317 cb.index = end;
318 - addClickHandler( cb, checkboxClickHandler );
 318+ mw.legacy.addClickHandler( cb, checkboxClickHandler );
319319 }
320320 if ( finish < inputs.length ) {
321321 setTimeout( function() {
322 - addCheckboxClickHandlers( inputs, finish );
 322+ mw.legacy.addCheckboxClickHandlers( inputs, finish );
323323 }, 200 );
324324 }
325325 },
@@ -431,7 +431,7 @@
432432 'sortables_init': function() {
433433 var idnum = 0;
434434 // Find all tables with class sortable and make them sortable
435 - var tables = getElementsByClassName( document, 'table', 'sortable' );
 435+ var tables = mw.legacy.getElementsByClassName( document, 'table', 'sortable' );
436436 for ( var ti = 0; ti < tables.length ; ti++ ) {
437437 if ( !tables[ti].id ) {
438438 tables[ti].setAttribute( 'id', 'sortable_table_id_' + idnum );
@@ -1061,7 +1061,7 @@
10621062 /* Initialization */
10631063
10641064 $( document ).ready( function() {
1065 - if ( wgBreakFrames ) {
 1065+ if ( typeof wgBreakFrames !== 'undefined' && wgBreakFrames ) {
10661066 // Un-trap us from framesets
10671067 if ( window.top != window ) {
10681068 window.top.location = window.location;
@@ -1070,23 +1070,23 @@
10711071 // Special stylesheet links for Monobook only (see bug 14717)
10721072 if ( typeof stylepath != 'undefined' && skin == 'monobook' ) {
10731073 if ( mw.legacy.opera6_bugs ) {
1074 - importStylesheetURI( stylepath + '/' + skin + '/Opera6Fixes.css' );
 1074+ mw.legacy.importStylesheetURI( stylepath + '/' + skin + '/Opera6Fixes.css' );
10751075 } else if ( mw.legacy.opera7_bugs ) {
1076 - importStylesheetURI( stylepath + '/' + skin + '/Opera7Fixes.css' );
 1076+ mw.legacy.importStylesheetURI( stylepath + '/' + skin + '/Opera7Fixes.css' );
10771077 } else if ( mw.legacy.opera95_bugs ) {
1078 - importStylesheetURI( stylepath + '/' + skin + '/Opera9Fixes.css' );
 1078+ mw.legacy.importStylesheetURI( stylepath + '/' + skin + '/Opera9Fixes.css' );
10791079 } else if ( mw.legacy.ff2_bugs ) {
1080 - importStylesheetURI( stylepath + '/' + skin + '/FF2Fixes.css' );
 1080+ mw.legacy.importStylesheetURI( stylepath + '/' + skin + '/FF2Fixes.css' );
10811081 }
10821082 }
10831083 if ( mw.legacy.ie6_bugs ) {
1084 - importScriptURI( mw.legacy.stylepath + '/common/IEFixes.js' );
 1084+ mw.legacy.importScriptURI( mw.legacy.stylepath + '/common/IEFixes.js' );
10851085 }
10861086
1087 - showTocToggle();
 1087+ mw.legacy.showTocToggle();
10881088
10891089 // NOTE: This replaces the runOnloadHook() call formerly placed at the end of the HTML output
1090 - runOnloadHook();
 1090+ mw.legacy.runOnloadHook();
10911091 } );
10921092
10931093 } )( jQuery, mediaWiki );
\ No newline at end of file
Index: branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.mwsuggest.js
@@ -96,12 +96,12 @@
9797 'os_AnimationTimer': function( r, target ) {
9898 this.r = r;
9999 var current = document.getElementById(r.container).offsetWidth;
100 - this.inc = Math.round( ( target - current ) / os_animation_steps );
101 - if( this.inc < os_animation_min_step && this.inc >=0 ) {
102 - this.inc = os_animation_min_step; // minimal animation step
 100+ this.inc = Math.round( ( target - current ) / mw.legacy.os_animation_steps );
 101+ if( this.inc < mw.legacy.os_animation_min_step && this.inc >=0 ) {
 102+ this.inc = mw.legacy.os_animation_min_step; // minimal animation step
103103 }
104 - if( this.inc > -os_animation_min_step && this.inc < 0 ) {
105 - this.inc = -os_animation_min_step;
 104+ if( this.inc > -mw.legacy.os_animation_min_step && this.inc < 0 ) {
 105+ this.inc = -mw.legacy.os_animation_min_step;
106106 }
107107 this.target = target;
108108 },
@@ -112,12 +112,12 @@
113113 * Initialization, call upon page onload
114114 */
115115 'os_MWSuggestInit': function() {
116 - for( i = 0; i < os_autoload_inputs.length; i++ ) {
117 - var id = os_autoload_inputs[i];
118 - var form = os_autoload_forms[i];
 116+ for( i = 0; i < mw.legacy.os_autoload_inputs.length; i++ ) {
 117+ var id = mw.legacy.os_autoload_inputs[i];
 118+ var form = mw.legacy.os_autoload_forms[i];
119119 element = document.getElementById( id );
120120 if( element != null ) {
121 - os_initHandlers( id, form, element );
 121+ mw.legacy.os_initHandlers( id, form, element );
122122 }
123123 }
124124 },
@@ -125,39 +125,39 @@
126126 * Init Result objects and event handlers
127127 */
128128 'os_initHandlers': function( name, formname, element ) {
129 - var r = new os_Results( name, formname );
 129+ var r = new mw.legacy.os_Results( name, formname );
130130 var formElement = document.getElementById( formname );
131131 if( !formElement ) {
132132 // Older browsers (Opera 8) cannot get form elements
133133 return;
134134 }
135135 // event handler
136 - os_hookEvent( element, 'keyup', function( event ) { os_eventKeyup( event ); } );
137 - os_hookEvent( element, 'keydown', function( event ) { os_eventKeydown( event ); } );
138 - os_hookEvent( element, 'keypress', function( event ) { os_eventKeypress( event ); } );
139 - if ( !os_use_datalist ) {
 136+ mw.legacy.os_hookEvent( element, 'keyup', function( event ) { mw.legacy.os_eventKeyup( event ); } );
 137+ mw.legacy.os_hookEvent( element, 'keydown', function( event ) { mw.legacy.os_eventKeydown( event ); } );
 138+ mw.legacy.os_hookEvent( element, 'keypress', function( event ) { mw.legacy.os_eventKeypress( event ); } );
 139+ if ( !mw.legacy.os_use_datalist ) {
140140 // These are needed for the div hack to hide it if the user blurs.
141 - os_hookEvent( element, 'blur', function( event ) { os_eventBlur( event ); } );
142 - os_hookEvent( element, 'focus', function( event ) { os_eventFocus( event ); } );
 141+ mw.legacy.os_hookEvent( element, 'blur', function( event ) { mw.legacy.os_eventBlur( event ); } );
 142+ mw.legacy.os_hookEvent( element, 'focus', function( event ) { mw.legacy.os_eventFocus( event ); } );
143143 // We don't want browser auto-suggestions interfering with our div, but
144144 // autocomplete must be on for datalist to work (at least in Opera
145145 // 10.10).
146146 element.setAttribute( 'autocomplete', 'off' );
147147 }
148148 // stopping handler
149 - os_hookEvent( formElement, 'submit', function( event ) { return os_eventOnsubmit( event ); } );
150 - os_map[name] = r;
 149+ mw.legacy.os_hookEvent( formElement, 'submit', function( event ) { return mw.legacy.os_eventOnsubmit( event ); } );
 150+ mw.legacy.os_map[name] = r;
151151 // toggle link
152152 if( document.getElementById( r.toggle ) == null ) {
153153 // TODO: disable this while we figure out a way for this to work in all browsers
154154 /* if( name == 'searchInput' ) {
155155 // special case: place above the main search box
156 - var t = os_createToggle( r, 'os-suggest-toggle' );
 156+ var t = mw.legacy.os_createToggle( r, 'os-suggest-toggle' );
157157 var searchBody = document.getElementById( 'searchBody' );
158158 var first = searchBody.parentNode.firstChild.nextSibling.appendChild(t);
159159 } else {
160160 // default: place below search box to the right
161 - var t = os_createToggle( r, 'os-suggest-toggle-def' );
 161+ var t = mw.legacy.os_createToggle( r, 'os-suggest-toggle-def' );
162162 var top = element.offsetTop + element.offsetHeight;
163163 var left = element.offsetLeft + element.offsetWidth;
164164 t.style.position = 'absolute';
@@ -185,64 +185,64 @@
186186 * Event handler that will fetch results on keyup
187187 */
188188 'os_eventKeyup': function( e ) {
189 - var targ = os_getTarget( e );
190 - var r = os_map[targ.id];
 189+ var targ = mw.legacy.os_getTarget( e );
 190+ var r = mw.legacy.os_map[targ.id];
191191 if( r == null ) {
192192 return; // not our event
193193 }
194194
195195 // some browsers won't generate keypressed for arrow keys, catch it
196 - if( os_keypressed_count == 0 ) {
197 - os_processKey( r, os_cur_keypressed, targ );
 196+ if( mw.legacy.os_keypressed_count == 0 ) {
 197+ mw.legacy.os_processKey( r, mw.legacy.os_cur_keypressed, targ );
198198 }
199199 var query = targ.value;
200 - os_fetchResults( r, query, os_search_timeout );
 200+ mw.legacy.os_fetchResults( r, query, mw.legacy.os_search_timeout );
201201 },
202202 /**
203203 * Catch arrows up/down and escape to hide the suggestions
204204 */
205205 'os_processKey': function( r, keypressed, targ ) {
206 - if ( keypressed == 40 && !r.visible && os_timer == null ) {
 206+ if ( keypressed == 40 && !r.visible && mw.legacy.os_timer == null ) {
207207 // If the user hits the down arrow, fetch results immediately if none
208208 // are already displayed.
209209 r.query = '';
210 - os_fetchResults( r, targ.value, 0 );
 210+ mw.legacy.os_fetchResults( r, targ.value, 0 );
211211 }
212212 // Otherwise, if we're not using datalist, we need to handle scrolling and
213213 // so on.
214 - if ( os_use_datalist ) {
 214+ if ( mw.legacy.os_use_datalist ) {
215215 return;
216216 }
217217 if ( keypressed == 40 ) { // Arrow Down
218218 if ( r.visible ) {
219 - os_changeHighlight( r, r.selected, r.selected + 1, true );
 219+ mw.legacy.os_changeHighlight( r, r.selected, r.selected + 1, true );
220220 }
221221 } else if ( keypressed == 38 ) { // Arrow Up
222222 if ( r.visible ) {
223 - os_changeHighlight( r, r.selected, r.selected - 1, true );
 223+ mw.legacy.os_changeHighlight( r, r.selected, r.selected - 1, true );
224224 }
225225 } else if( keypressed == 27 ) { // Escape
226226 document.getElementById( r.searchbox ).value = r.original;
227227 r.query = r.original;
228 - os_hideResults( r );
 228+ mw.legacy.os_hideResults( r );
229229 } else if( r.query != document.getElementById( r.searchbox ).value ) {
230 - // os_hideResults( r ); // don't show old suggestions
 230+ // mw.legacy.os_hideResults( r ); // don't show old suggestions
231231 }
232232 },
233233 /**
234234 * When keys is held down use a timer to output regular events
235235 */
236236 'os_eventKeypress': function( e ) {
237 - var targ = os_getTarget( e );
238 - var r = os_map[targ.id];
 237+ var targ = mw.legacy.os_getTarget( e );
 238+ var r = mw.legacy.os_map[targ.id];
239239 if( r == null ) {
240240 return; // not our event
241241 }
242242
243 - var keypressed = os_cur_keypressed;
 243+ var keypressed = mw.legacy.os_cur_keypressed;
244244
245 - os_keypressed_count++;
246 - os_processKey( r, keypressed, targ );
 245+ mw.legacy.os_keypressed_count++;
 246+ mw.legacy.os_processKey( r, keypressed, targ );
247247 },
248248 /**
249249 * Catch the key code (Firefox bug)
@@ -251,39 +251,39 @@
252252 if ( !e ) {
253253 e = window.event;
254254 }
255 - var targ = os_getTarget( e );
256 - var r = os_map[targ.id];
 255+ var targ = mw.legacy.os_getTarget( e );
 256+ var r = mw.legacy.os_map[targ.id];
257257 if( r == null ) {
258258 return; // not our event
259259 }
260260
261 - os_mouse_moved = false;
 261+ mw.legacy.os_mouse_moved = false;
262262
263 - os_cur_keypressed = ( e.keyCode == undefined ) ? e.which : e.keyCode;
264 - os_keypressed_count = 0;
 263+ mw.legacy.os_cur_keypressed = ( e.keyCode == undefined ) ? e.which : e.keyCode;
 264+ mw.legacy.os_keypressed_count = 0;
265265 },
266266 /**
267267 * When the form is submitted hide everything, cancel updates...
268268 */
269269 'os_eventOnsubmit': function( e ) {
270 - var targ = os_getTarget( e );
 270+ var targ = mw.legacy.os_getTarget( e );
271271
272 - os_is_stopped = true;
 272+ mw.legacy.os_is_stopped = true;
273273 // kill timed requests
274 - if( os_timer != null && os_timer.id != null ) {
275 - clearTimeout( os_timer.id );
276 - os_timer = null;
 274+ if( mw.legacy.os_timer != null && mw.legacy.os_timer.id != null ) {
 275+ clearTimeout( mw.legacy.os_timer.id );
 276+ mw.legacy.os_timer = null;
277277 }
278278 // Hide all suggestions
279 - for( i = 0; i < os_autoload_inputs.length; i++ ) {
280 - var r = os_map[os_autoload_inputs[i]];
 279+ for( i = 0; i < mw.legacy.os_autoload_inputs.length; i++ ) {
 280+ var r = mw.legacy.os_map[mw.legacy.os_autoload_inputs[i]];
281281 if( r != null ) {
282282 var b = document.getElementById( r.searchform );
283283 if( b != null && b == targ ) {
284284 // set query value so the handler won't try to fetch additional results
285285 r.query = document.getElementById( r.searchbox ).value;
286286 }
287 - os_hideResults( r );
 287+ mw.legacy.os_hideResults( r );
288288 }
289289 }
290290 return true;
@@ -292,7 +292,7 @@
293293 * Hide results from the user, either making the div visibility=hidden or detaching the datalist from the input.
294294 */
295295 'os_hideResults': function( r ) {
296 - if ( os_use_datalist ) {
 296+ if ( mw.legacy.os_use_datalist ) {
297297 document.getElementById( r.searchbox ).setAttribute( 'list', '' );
298298 } else {
299299 var c = document.getElementById( r.container );
@@ -325,38 +325,38 @@
326326 * Handles data from XMLHttpRequest, and updates the suggest results
327327 */
328328 'os_updateResults': function( r, query, text, cacheKey ) {
329 - os_cache[cacheKey] = text;
 329+ mw.legacy.os_cache[cacheKey] = text;
330330 r.query = query;
331331 r.original = query;
332332 if( text == '' ) {
333333 r.results = null;
334334 r.resultCount = 0;
335 - os_hideResults( r );
 335+ mw.legacy.os_hideResults( r );
336336 } else {
337337 try {
338338 var p = eval( '(' + text + ')' ); // simple json parse, could do a safer one
339339 if( p.length < 2 || p[1].length == 0 ) {
340340 r.results = null;
341341 r.resultCount = 0;
342 - os_hideResults( r );
 342+ mw.legacy.os_hideResults( r );
343343 return;
344344 }
345 - if ( os_use_datalist ) {
346 - os_setupDatalist( r, p[1] );
 345+ if ( mw.legacy.os_use_datalist ) {
 346+ mw.legacy.os_setupDatalist( r, p[1] );
347347 } else {
348 - os_setupDiv( r, p[1] );
 348+ mw.legacy.os_setupDiv( r, p[1] );
349349 }
350350 } catch( e ) {
351351 // bad response from server or such
352 - os_hideResults( r );
353 - os_cache[cacheKey] = null;
 352+ mw.legacy.os_hideResults( r );
 353+ mw.legacy.os_cache[cacheKey] = null;
354354 }
355355 }
356356 },
357357 /**
358358 * Create and populate a <datalist>.
359359 *
360 - * @param r os_Result object
 360+ * @param r mw.legacy.os_Result object
361361 * @param results Array of the new results to replace existing ones
362362 */
363363 'os_setupDatalist': function( r, results ) {
@@ -375,7 +375,7 @@
376376 r.resultCount = results.length;
377377 r.visible = true;
378378 for ( i = 0; i < results.length; i++ ) {
379 - var title = os_decodeValue( results[i] );
 379+ var title = mw.legacy.os_decodeValue( results[i] );
380380 var opt = document.createElement( 'option' );
381381 opt.value = title;
382382 r.results[i] = title;
@@ -414,7 +414,7 @@
415415 'os_updateIfRelevant': function( r, query, text, cacheKey ) {
416416 var t = document.getElementById( r.searchbox );
417417 if( t != null && t.value == query ) { // check if response is still relevant
418 - os_updateResults( r, query, text, cacheKey );
 418+ mw.legacy.os_updateResults( r, query, text, cacheKey );
419419 }
420420 r.query = query;
421421 },
@@ -422,27 +422,27 @@
423423 * Fetch results after some timeout
424424 */
425425 'os_delayedFetch': function() {
426 - if( os_timer == null ) {
 426+ if( mw.legacy.os_timer == null ) {
427427 return;
428428 }
429 - var r = os_timer.r;
430 - var query = os_timer.query;
431 - os_timer = null;
432 - var path = wgMWSuggestTemplate.replace( '{namespaces}', os_getNamespaces( r ) )
 429+ var r = mw.legacy.os_timer.r;
 430+ var query = mw.legacy.os_timer.query;
 431+ mw.legacy.os_timer = null;
 432+ var path = wgMWSuggestTemplate.replace( '{namespaces}', mw.legacy.os_getNamespaces( r ) )
433433 .replace( '{dbname}', wgDBname )
434 - .replace( '{searchTerms}', os_encodeQuery( query ) );
 434+ .replace( '{searchTerms}', mw.legacy.os_encodeQuery( query ) );
435435 // try to get from cache, if not fetch using ajax
436 - var cached = os_cache[path];
 436+ var cached = mw.legacy.os_cache[path];
437437 if( cached != null && cached != undefined ) {
438 - os_updateIfRelevant( r, query, cached, path );
 438+ mw.legacy.os_updateIfRelevant( r, query, cached, path );
439439 } else {
440440 var xmlhttp = sajax_init_object();
441441 if( xmlhttp ) {
442442 try {
443443 xmlhttp.open( 'GET', path, true );
444444 xmlhttp.onreadystatechange = function() {
445 - if ( xmlhttp.readyState == 4 && typeof os_updateIfRelevant == 'function' ) {
446 - os_updateIfRelevant( r, query, xmlhttp.responseText, path );
 445+ if ( xmlhttp.readyState == 4 && typeof mw.legacy.os_updateIfRelevant == 'function' ) {
 446+ mw.legacy.os_updateIfRelevant( r, query, xmlhttp.responseText, path );
447447 }
448448 };
449449 xmlhttp.send( null );
@@ -456,29 +456,29 @@
457457 }
458458 },
459459 /**
460 - * Init timed update via os_delayedUpdate()
 460+ * Init timed update via mw.legacy.os_delayedUpdate()
461461 */
462462 'os_fetchResults': function( r, query, timeout ) {
463463 if( query == '' ) {
464464 r.query = '';
465 - os_hideResults( r );
 465+ mw.legacy.os_hideResults( r );
466466 return;
467467 } else if( query == r.query ) {
468468 return; // no change
469469 }
470470
471 - os_is_stopped = false; // make sure we're running
 471+ mw.legacy.os_is_stopped = false; // make sure we're running
472472
473473 // cancel any pending fetches
474 - if( os_timer != null && os_timer.id != null ) {
475 - clearTimeout( os_timer.id );
 474+ if( mw.legacy.os_timer != null && mw.legacy.os_timer.id != null ) {
 475+ clearTimeout( mw.legacy.os_timer.id );
476476 }
477477 // schedule delayed fetching of results
478478 if( timeout != 0 ) {
479 - os_timer = new os_Timer( setTimeout( 'os_delayedFetch()', timeout ), r, query );
 479+ mw.legacy.os_timer = new mw.legacy.os_Timer( setTimeout( 'mw.legacy.os_delayedFetch()', timeout ), r, query );
480480 } else {
481 - os_timer = new os_Timer( null, r, query );
482 - os_delayedFetch(); // do it now!
 481+ mw.legacy.os_timer = new mw.legacy.os_Timer( null, r, query );
 482+ mw.legacy.os_delayedFetch(); // do it now!
483483 }
484484 },
485485 /**
@@ -515,27 +515,27 @@
516516 * Call this to enable suggestions on input (id=inputId), on a form (name=formName)
517517 */
518518 'os_enableSuggestionsOn': function( inputId, formName ) {
519 - os_initHandlers( inputId, formName, document.getElementById( inputId ) );
 519+ mw.legacy.os_initHandlers( inputId, formName, document.getElementById( inputId ) );
520520 },
521521 /**
522522 * Call this to disable suggestios on input box (id=inputId)
523523 */
524524 'os_disableSuggestionsOn': function( inputId ) {
525 - r = os_map[inputId];
 525+ r = mw.legacy.os_map[inputId];
526526 if( r != null ) {
527527 // cancel/hide results
528 - os_timer = null;
529 - os_hideResults( r );
 528+ mw.legacy.os_timer = null;
 529+ mw.legacy.os_hideResults( r );
530530 // turn autocomplete on !
531531 document.getElementById( inputId ).setAttribute( 'autocomplete', 'on' );
532532 // remove descriptor
533 - os_map[inputId] = null;
 533+ mw.legacy.os_map[inputId] = null;
534534 }
535535
536 - // Remove the element from the os_autoload_* arrays
537 - var index = os_autoload_inputs.indexOf( inputId );
 536+ // Remove the element from the mw.legacy.os_autoload_* arrays
 537+ var index = mw.legacy.os_autoload_inputs.indexOf( inputId );
538538 if ( index >= 0 ) {
539 - os_autoload_inputs[index] = os_autoload_forms[index] = '';
 539+ mw.legacy.os_autoload_inputs[index] = mw.legacy.os_autoload_forms[index] = '';
540540 }
541541 },
542542
@@ -545,28 +545,28 @@
546546 * Event: loss of focus of input box
547547 */
548548 'os_eventBlur': function( e ) {
549 - var targ = os_getTarget( e );
550 - var r = os_map[targ.id];
 549+ var targ = mw.legacy.os_getTarget( e );
 550+ var r = mw.legacy.os_map[targ.id];
551551 if( r == null ) {
552552 return; // not our event
553553 }
554 - if( !os_mouse_pressed ) {
555 - os_hideResults( r );
 554+ if( !mw.legacy.os_mouse_pressed ) {
 555+ mw.legacy.os_hideResults( r );
556556 // force canvas to stay hidden
557557 r.stayHidden = true;
558558 // cancel any pending fetches
559 - if( os_timer != null && os_timer.id != null ) {
560 - clearTimeout( os_timer.id );
 559+ if( mw.legacy.os_timer != null && mw.legacy.os_timer.id != null ) {
 560+ clearTimeout( mw.legacy.os_timer.id );
561561 }
562 - os_timer = null;
 562+ mw.legacy.os_timer = null;
563563 }
564564 },
565565 /**
566566 * Event: focus (catch only when stopped)
567567 */
568568 'os_eventFocus': function( e ) {
569 - var targ = os_getTarget( e );
570 - var r = os_map[targ.id];
 569+ var targ = mw.legacy.os_getTarget( e );
 570+ var r = mw.legacy.os_map[targ.id];
571571 if( r == null ) {
572572 return; // not our event
573573 }
@@ -575,34 +575,34 @@
576576 /**
577577 * Create and populate a <div>, for non-<datalist>-supporting browsers.
578578 *
579 - * @param r os_Result object
 579+ * @param r mw.legacy.os_Result object
580580 * @param results Array of the new results to replace existing ones
581581 */
582582 'os_setupDiv': function( r, results ) {
583583 var c = document.getElementById( r.container );
584584 if ( c == null ) {
585 - c = os_createContainer( r );
 585+ c = mw.legacy.os_createContainer( r );
586586 }
587 - c.innerHTML = os_createResultTable( r, results );
 587+ c.innerHTML = mw.legacy.os_createResultTable( r, results );
588588 // init container table sizes
589589 var t = document.getElementById( r.resultTable );
590590 r.containerTotal = t.offsetHeight;
591591 r.containerRow = t.offsetHeight / r.resultCount;
592 - os_fitContainer( r );
593 - os_trimResultText( r );
594 - os_showResults( r );
 592+ mw.legacy.os_fitContainer( r );
 593+ mw.legacy.os_trimResultText( r );
 594+ mw.legacy.os_showResults( r );
595595 },
596596 /**
597597 * Create the result table to be placed in the container div
598598 */
599599 'os_createResultTable': function( r, results ) {
600600 var c = document.getElementById( r.container );
601 - var width = c.offsetWidth - os_operaWidthFix( c.offsetWidth );
 601+ var width = c.offsetWidth - mw.legacy.os_operaWidthFix( c.offsetWidth );
602602 var html = '<table class="os-suggest-results" id="' + r.resultTable + '" style="width: ' + width + 'px;">';
603603 r.results = new Array();
604604 r.resultCount = results.length;
605605 for( i = 0; i < results.length; i++ ) {
606 - var title = os_decodeValue( results[i] );
 606+ var title = mw.legacy.os_decodeValue( results[i] );
607607 r.results[i] = title;
608608 html += '<tr><td class="os-suggest-result" id="' + r.resultTable + i + '"><span id="' + r.resultText + i + '">' + title + '</span></td></tr>';
609609 }
@@ -613,13 +613,13 @@
614614 * Show results div
615615 */
616616 'os_showResults': function( r ) {
617 - if( os_is_stopped ) {
 617+ if( mw.legacy.os_is_stopped ) {
618618 return;
619619 }
620620 if( r.stayHidden ) {
621621 return;
622622 }
623 - os_fitContainer( r );
 623+ mw.legacy.os_fitContainer( r );
624624 var c = document.getElementById( r.container );
625625 r.selected = -1;
626626 if( c != null ) {
@@ -708,7 +708,7 @@
709709 'os_createContainer': function( r ) {
710710 var c = document.createElement( 'div' );
711711 var s = document.getElementById( r.searchbox );
712 - var pos = os_getElementPosition( r.searchbox );
 712+ var pos = mw.legacy.os_getElementPosition( r.searchbox );
713713 var left = pos.left;
714714 var top = pos.top + s.offsetHeight;
715715 c.className = 'os-suggest';
@@ -723,10 +723,10 @@
724724 c.style.width = s.offsetWidth + 'px';
725725
726726 // mouse event handlers
727 - c.onmouseover = function( event ) { os_eventMouseover( r.searchbox, event ); };
728 - c.onmousemove = function( event ) { os_eventMousemove( r.searchbox, event ); };
729 - c.onmousedown = function( event ) { return os_eventMousedown( r.searchbox, event ); };
730 - c.onmouseup = function( event ) { os_eventMouseup( r.searchbox, event ); };
 727+ c.onmouseover = function( event ) { mw.legacy.os_eventMouseover( r.searchbox, event ); };
 728+ c.onmousemove = function( event ) { mw.legacy.os_eventMousemove( r.searchbox, event ); };
 729+ c.onmousedown = function( event ) { return mw.legacy.os_eventMousedown( r.searchbox, event ); };
 730+ c.onmouseup = function( event ) { mw.legacy.os_eventMouseup( r.searchbox, event ); };
731731 return c;
732732 },
733733 /**
@@ -734,14 +734,14 @@
735735 */
736736 'os_fitContainer': function( r ) {
737737 var c = document.getElementById( r.container );
738 - var h = os_availableHeight( r ) - 20;
 738+ var h = mw.legacy.os_availableHeight( r ) - 20;
739739 var inc = r.containerRow;
740740 h = parseInt( h / inc ) * inc;
741741 if( h < ( 2 * inc ) && r.resultCount > 1 ) { // min: two results
742742 h = 2 * inc;
743743 }
744 - if( ( h / inc ) > os_max_lines_per_suggest ) {
745 - h = inc * os_max_lines_per_suggest;
 744+ if( ( h / inc ) > mw.legacy.os_max_lines_per_suggest ) {
 745+ h = inc * mw.legacy.os_max_lines_per_suggest;
746746 }
747747 if( h < r.containerTotal ) {
748748 c.style.height = h + 'px';
@@ -768,7 +768,7 @@
769769 if( r.containerCount < r.resultCount ) {
770770 fix = 20; // give 20px for scrollbar
771771 } else {
772 - fix = os_operaWidthFix( w );
 772+ fix = mw.legacy.os_operaWidthFix( w );
773773 }
774774 if( fix < 4 ) {
775775 fix = 4; // basic padding
@@ -778,19 +778,19 @@
779779 // resize container to fit more data if permitted
780780 var normW = document.getElementById( r.searchbox ).offsetWidth;
781781 var prop = maxW / normW;
782 - if( prop > os_container_max_width ) {
783 - prop = os_container_max_width;
 782+ if( prop > mw.legacy.os_container_max_width ) {
 783+ prop = mw.legacy.os_container_max_width;
784784 } else if( prop < 1 ) {
785785 prop = 1;
786786 }
787787 var newW = Math.round( normW * prop );
788788 if( w != newW ) {
789789 w = newW;
790 - if( os_animation_timer != null ) {
791 - clearInterval( os_animation_timer.id );
 790+ if( mw.legacy.os_animation_timer != null ) {
 791+ clearInterval( mw.legacy.os_animation_timer.id );
792792 }
793 - os_animation_timer = new os_AnimationTimer( r, w );
794 - os_animation_timer.id = setInterval( 'os_animateChangeWidth()', os_animation_delay );
 793+ mw.legacy.os_animation_timer = new mw.legacy.os_AnimationTimer( r, w );
 794+ mw.legacy.os_animation_timer.id = setInterval( 'mw.legacy.os_animateChangeWidth()', mw.legacy.os_animation_delay );
795795 w -= fix; // this much is reserved
796796 }
797797
@@ -822,24 +822,24 @@
823823 * Invoked on timer to animate change in container width
824824 */
825825 'os_animateChangeWidth': function() {
826 - var r = os_animation_timer.r;
 826+ var r = mw.legacy.os_animation_timer.r;
827827 var c = document.getElementById( r.container );
828828 var w = c.offsetWidth;
829829 var normW = document.getElementById( r.searchbox ).offsetWidth;
830 - var normL = os_getElementPosition( r.searchbox ).left;
831 - var inc = os_animation_timer.inc;
832 - var target = os_animation_timer.target;
 830+ var normL = mw.legacy.os_getElementPosition( r.searchbox ).left;
 831+ var inc = mw.legacy.os_animation_timer.inc;
 832+ var target = mw.legacy.os_animation_timer.target;
833833 var nw = w + inc;
834834 if( ( inc > 0 && nw >= target ) || ( inc <= 0 && nw <= target ) ) {
835835 // finished !
836836 c.style.width = target + 'px';
837 - clearInterval( os_animation_timer.id );
838 - os_animation_timer = null;
 837+ clearInterval( mw.legacy.os_animation_timer.id );
 838+ mw.legacy.os_animation_timer = null;
839839 } else {
840840 // in-progress
841841 c.style.width = nw + 'px';
842842 if( document.documentElement.dir == 'rtl' ) {
843 - c.style.left = ( normL + normW + ( target - nw ) - os_animation_timer.target - 1 ) + 'px';
 843+ c.style.left = ( normL + normW + ( target - nw ) - mw.legacy.os_animation_timer.target - 1 ) + 'px';
844844 }
845845 }
846846 },
@@ -868,7 +868,7 @@
869869 if( next >= 0 ) {
870870 var nextRow = document.getElementById( r.resultTable + next );
871871 if( nextRow != null ) {
872 - nextRow.className = os_HighlightClass();
 872+ nextRow.className = mw.legacy.os_HighlightClass();
873873 }
874874 newText = r.results[next];
875875 } else {
@@ -889,7 +889,7 @@
890890
891891 // update the contents of the search box
892892 if( updateSearchBox ) {
893 - os_updateSearchQuery( r, newText );
 893+ mw.legacy.os_updateSearchQuery( r, newText );
894894 }
895895 },
896896 'os_HighlightClass': function() {
@@ -916,14 +916,14 @@
917917 * Mouse over the container
918918 */
919919 'os_eventMouseover': function( srcId, e ) {
920 - var targ = os_getTarget( e );
921 - var r = os_map[srcId];
922 - if( r == null || !os_mouse_moved ) {
 920+ var targ = mw.legacy.os_getTarget( e );
 921+ var r = mw.legacy.os_map[srcId];
 922+ if( r == null || !mw.legacy.os_mouse_moved ) {
923923 return; // not our event
924924 }
925 - var num = os_getNumberSuffix( targ.id );
 925+ var num = mw.legacy.os_getNumberSuffix( targ.id );
926926 if( num >= 0 ) {
927 - os_changeHighlight( r, r.selected, num, false );
 927+ mw.legacy.os_changeHighlight( r, r.selected, num, false );
928928 }
929929 },
930930 /**
@@ -934,7 +934,7 @@
935935 if( !( num.charAt( 0 ) >= '0' && num.charAt( 0 ) <= '9' ) ) {
936936 num = num.substring( 1 );
937937 }
938 - if( os_isNumber( num ) ) {
 938+ if( mw.legacy.os_isNumber( num ) ) {
939939 return parseInt( num );
940940 } else {
941941 return -1;
@@ -944,23 +944,23 @@
945945 * Save mouse move as last action
946946 */
947947 'os_eventMousemove': function( srcId, e ) {
948 - os_mouse_moved = true;
 948+ mw.legacy.os_mouse_moved = true;
949949 },
950950 /**
951951 * Mouse button held down, register possible click
952952 */
953953 'os_eventMousedown': function( srcId, e ) {
954 - var targ = os_getTarget( e );
955 - var r = os_map[srcId];
 954+ var targ = mw.legacy.os_getTarget( e );
 955+ var r = mw.legacy.os_map[srcId];
956956 if( r == null ) {
957957 return; // not our event
958958 }
959 - var num = os_getNumberSuffix( targ.id );
 959+ var num = mw.legacy.os_getNumberSuffix( targ.id );
960960
961 - os_mouse_pressed = true;
 961+ mw.legacy.os_mouse_pressed = true;
962962 if( num >= 0 ) {
963 - os_mouse_num = num;
964 - // os_updateSearchQuery( r, r.results[num] );
 963+ mw.legacy.os_mouse_num = num;
 964+ // mw.legacy.os_updateSearchQuery( r, r.results[num] );
965965 }
966966 // keep the focus on the search field
967967 document.getElementById( r.searchbox ).focus();
@@ -971,19 +971,19 @@
972972 * Mouse button released, check for click on some row
973973 */
974974 'os_eventMouseup': function( srcId, e ) {
975 - var targ = os_getTarget( e );
976 - var r = os_map[srcId];
 975+ var targ = mw.legacy.os_getTarget( e );
 976+ var r = mw.legacy.os_map[srcId];
977977 if( r == null ) {
978978 return; // not our event
979979 }
980 - var num = os_getNumberSuffix( targ.id );
 980+ var num = mw.legacy.os_getNumberSuffix( targ.id );
981981
982 - if( num >= 0 && os_mouse_num == num ) {
983 - os_updateSearchQuery( r, r.results[num] );
984 - os_hideResults( r );
 982+ if( num >= 0 && mw.legacy.os_mouse_num == num ) {
 983+ mw.legacy.os_updateSearchQuery( r, r.results[num] );
 984+ mw.legacy.os_hideResults( r );
985985 document.getElementById( r.searchform ).submit();
986986 }
987 - os_mouse_pressed = false;
 987+ mw.legacy.os_mouse_pressed = false;
988988 // keep the focus on the search field
989989 document.getElementById( r.searchbox ).focus();
990990 },
@@ -996,7 +996,7 @@
997997 t.setAttribute( 'id', r.toggle );
998998 var link = document.createElement( 'a' );
999999 link.setAttribute( 'href', 'javascript:void(0);' );
1000 - link.onclick = function() { os_toggle( r.searchbox, r.searchform ); };
 1000+ link.onclick = function() { mw.legacy.os_toggle( r.searchbox, r.searchform ); };
10011001 var msg = document.createTextNode( wgMWSuggestMessages[0] );
10021002 link.appendChild( msg );
10031003 t.appendChild( link );
@@ -1006,14 +1006,14 @@
10071007 * Call when user clicks on some of the toggle links (dead code?)
10081008 */
10091009 'os_toggle': function( inputId, formName ) {
1010 - r = os_map[inputId];
 1010+ r = mw.legacy.os_map[inputId];
10111011 var msg = '';
10121012 if( r == null ) {
1013 - os_enableSuggestionsOn( inputId, formName );
1014 - r = os_map[inputId];
 1013+ mw.legacy.os_enableSuggestionsOn( inputId, formName );
 1014+ r = mw.legacy.os_map[inputId];
10151015 msg = wgMWSuggestMessages[0];
10161016 } else{
1017 - os_disableSuggestionsOn( inputId, formName );
 1017+ mw.legacy.os_disableSuggestionsOn( inputId, formName );
10181018 msg = wgMWSuggestMessages[1];
10191019 }
10201020 // change message
Index: branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.rightclickedit.js
@@ -20,7 +20,7 @@
2121 }
2222 }
2323 }
24 - }
 24+ },
2525 'addRightClickEditHandler': function(el) {
2626 for (var i = 0; i < el.childNodes.length; i++) {
2727 var link = el.childNodes[i];

Status & tagging log