r57644 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57643‎ | r57644 | r57645 >
Date:19:39, 11 October 2009
Author:catrope
Status:deferred
Tags:
Comment:
Remove trailing whitespace from some JS2 files. These are just the worst offenders
Modified paths:
  • /trunk/phase3/js2/editPage.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/mv_embed.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js (modified) (history)
  • /trunk/phase3/js2/remoteMwEmbed.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js
@@ -5,7 +5,7 @@
66 * Msg text is inherited from embedVideo (we should move it here (although can't load ctrlBuilder without parent EmbedVideo obj)
77 /
88
9 -/**
 9+/**
1010 * base ctrlBuilder object
1111 * @param the embedVideo element we are targeting
1212 */
@@ -13,104 +13,104 @@
1414 return this.init( embedObj );
1515 };
1616
17 -/*
 17+/*
1818 * controlsBuilder prototype:
1919 */
2020 ctrlBuilder.prototype = {
2121 init:function( embedObj, opt ){
22 - this.embedObj = embedObj;
23 -
 22+ this.embedObj = embedObj;
 23+
2424 //check for skin overrides for ctrlBuilder
2525 if( _global[ embedObj.skin_name + 'Config'] )
2626 $j.extend(this, _global[ embedObj.skin_name + 'Config']);
27 -
 27+
2828 },
2929 pClass:'videoPlayer',
3030 height:29,
3131 supports:{
32 - 'options':true,
33 - 'borders':true
34 - },
35 - getControls:function(){
 32+ 'options':true,
 33+ 'borders':true
 34+ },
 35+ getControls:function(){
3636 //set up local pointer to the embedObj
3737 var embedObj = this.embedObj;
3838 //set up loadl ctrlBuilder ref
3939 var _this = this;
40 -
41 - js_log('f:controlsBuilder:: opt:' + this.options);
 40+
 41+ js_log('f:controlsBuilder:: opt:' + this.options);
4242 this.id = (embedObj.pc)?embedObj.pc.pp.id:embedObj.id;
4343 this.available_width = embedObj.playerPixelWidth();
4444 //make pointer to the embedObj
4545 this.embedObj =embedObj;
46 - var _this = this;
47 - for(var i in embedObj.supports){
 46+ var _this = this;
 47+ for(var i in embedObj.supports){
4848 _this.supports[i] = embedObj.supports[i];
4949 };
50 -
51 - //special case vars:
52 - if( ( embedObj.roe ||
53 - (embedObj.media_element.timedTextSources &&
54 - embedObj.media_element.timedTextSources() )
 50+
 51+ //special case vars:
 52+ if( ( embedObj.roe ||
 53+ (embedObj.media_element.timedTextSources &&
 54+ embedObj.media_element.timedTextSources() )
5555 ) && embedObj.show_meta_link )
56 - this.supports['closed_captions']=true;
57 -
58 -
 56+ this.supports['closed_captions']=true;
 57+
 58+
5959 //append options to body (if not already there)
6060 if($j('#mv_vid_options_' + this.id).length==0)
61 - $j('body').append( this.components['mv_embedded_options'].o( this ) );
62 -
63 - var o='';
 61+ $j('body').append( this.components['mv_embedded_options'].o( this ) );
 62+
 63+ var o='';
6464 for( var i in this.components ){
6565 if( this.supports[i] ){
6666 if( this.available_width > this.components[i].w ){
6767 //special case with playhead don't add unless we have 60px
6868 if( i == 'play_head' && this.available_width < 60 )
69 - continue;
 69+ continue;
7070 o+=this.components[i].o( this );
7171 this.available_width -= this.components[i].w;
7272 }else{
7373 js_log('not enough space for control component:' + i);
7474 }
7575 }
76 - }
 76+ }
7777 return o;
7878 },
7979 /*
8080 * addControlHooks
8181 * to be run once controls are attached to the dom
8282 */
83 - addControlHooks:function(){
 83+ addControlHooks:function(){
8484 //set up local pointer to the embedObj
85 - var embedObj = this.embedObj;
86 - var _this = this;
87 - //add in drag/seek hooks:
 85+ var embedObj = this.embedObj;
 86+ var _this = this;
 87+ //add in drag/seek hooks:
8888 if(!embedObj.base_seeker_slider_offset && $j('#mv_seeker_slider_'+embedObj.id).get(0))
89 - embedObj.base_seeker_slider_offset = $j('#mv_seeker_slider_'+embedObj.id).get(0).offsetLeft;
90 -
 89+ embedObj.base_seeker_slider_offset = $j('#mv_seeker_slider_'+embedObj.id).get(0).offsetLeft;
 90+
9191 //js_log('looking for: #mv_seeker_slider_'+embedObj.id + "\n " +
9292 // 'start sec: '+embedObj.start_time_sec + ' base offset: '+embedObj.base_seeker_slider_offset);
93 -
94 - //add play hook:
 93+
 94+ //add play hook:
9595 $j('#mv_play_pause_button_' + embedObj.id ).unbind().btnBind().click(function(){
9696 $j('#' + embedObj.id).get(0).play();
97 - })
98 -
99 - //do play-btn-large binding:
 97+ })
 98+
 99+ //do play-btn-large binding:
100100 $j('#' + embedObj.id + ' .play-btn-large' ).unbind().btnBind().click(function(){
101101 $j('#' + embedObj.id).get(0).play();
102 - });
103 -
 102+ });
 103+
104104 //add recommend firefox if non-native playback:
105 - if( embedObj.doNativeWarningCheck() ){
 105+ if( embedObj.doNativeWarningCheck() ){
106106 $j('#dc_'+ embedObj.id).hover(
107 - function(){
 107+ function(){
108108 if($j('#gnp_' + embedObj.id).length==0){
109109 $j(this).append('<div id="gnp_' + embedObj.id + '" class="ui-state-highlight ui-corner-all" ' +
110110 'style="position:absolute;display:none;background:#FFF;top:10px;left:10px;right:10px;">' +
111 - gM('mwe-for_best_experience') +
112 - '<br><input id="ffwarn_'+embedObj.id+'" type=\"checkbox\">' +
113 - gM('mwe-do_not_warn_again') +
114 - '</div>');
 111+ gM('mwe-for_best_experience') +
 112+ '<br><input id="ffwarn_'+embedObj.id+'" type=\"checkbox\">' +
 113+ gM('mwe-do_not_warn_again') +
 114+ '</div>');
115115 $j('#ffwarn_'+embedObj.id).click(function(){
116116 if( $j(this).is(':checked') ){
117117 //set up a cookie for 7 days:
@@ -122,9 +122,9 @@
123123 _global['adismissNativeWarn'] = false;
124124 $j.cookie('dismissNativeWarn', false);
125125 }
126 -
127 - });
128 - }
 126+
 127+ });
 128+ }
129129 if( ($j.cookie('dismissNativeWarn') !== true) &&
130130 _global['dismissNativeWarn'] === false ){
131131 $j('#gnp_' + embedObj.id).fadeIn('slow');
@@ -135,27 +135,27 @@
136136 }
137137 );
138138 }
139 -
140 - if( $j.browser.msie && $j.browser.version <= 6){
 139+
 140+ if( $j.browser.msie && $j.browser.version <= 6){
141141 $j( embedObj.id + ' .play-btn-large' ).pngFix();
142142 }
143 -
144 -
 143+
 144+
145145 //captions binding:
146146 $j('#timed_text_' + embedObj.id).unbind().btnBind().click(function(){
147147 $j('#' + embedObj.id).get(0).showTextInterface();
148148 });
149 -
150 - //options binding:
 149+
 150+ //options binding:
151151 $j('#options_button_' + embedObj.id).unbind().btnBind().click(function(){
152152 $j('#' +embedObj.id).get(0).doOptionsHTML();
153153 });
154 -
155 - //fullscreen binding:
 154+
 155+ //fullscreen binding:
156156 $j('#fullscreen_'+embedObj.id).unbind().btnBind().click(function(){
157157 $j('#' +embedObj.id).get(0).fullscreen();
158 - });
159 -
 158+ });
 159+
160160 js_log(" should add slider binding: " + $j('#mv_play_head_'+embedObj.id).length) ;
161161 $j('#mv_play_head_'+embedObj.id).slider({
162162 range: "min",
@@ -168,42 +168,42 @@
169169 $j(id + ' .play-btn-large').fadeOut('fast');
170170 //if playlist always start at 0
171171 embedObj.start_time_sec = (embedObj.instanceOf == 'mvPlayList')?0:
172 - npt2seconds(embedObj.getTimeReq().split('/')[0]);
 172+ npt2seconds(embedObj.getTimeReq().split('/')[0]);
173173 },
174 - slide: function(event, ui) {
175 - var perc = ui.value/1000;
176 - embedObj.jump_time = seconds2npt( parseFloat( parseFloat(embedObj.getDuration()) * perc ) + embedObj.start_time_sec);
 174+ slide: function(event, ui) {
 175+ var perc = ui.value/1000;
 176+ embedObj.jump_time = seconds2npt( parseFloat( parseFloat(embedObj.getDuration()) * perc ) + embedObj.start_time_sec);
177177 //js_log('perc:' + perc + ' * ' + embedObj.getDuration() + ' jt:'+ this.jump_time);
178 - embedObj.setStatus( gM('mwe-seek_to')+' '+embedObj.jump_time );
179 - //update the thumbnail / frame
 178+ embedObj.setStatus( gM('mwe-seek_to')+' '+embedObj.jump_time );
 179+ //update the thumbnail / frame
180180 if(embedObj.isPlaying==false){
181181 embedObj.updateThumbPerc( perc );
182182 }
183183 },
184184 change:function(event, ui){
185 - //only run the onChange event if done by a user slide:
 185+ //only run the onChange event if done by a user slide:
186186 if(embedObj.userSlide){
187187 embedObj.userSlide=false;
188188 embedObj.seeking=true;
189189 //stop the monitor timer (if we can)
190 - if(embedObj.stopMonitor)
191 - embedObj.stopMonitor();
192 -
193 - var perc = ui.value/1000;
194 - //set seek time (in case we have to do a url seek)
195 - embedObj.seek_time_sec = npt2seconds( embedObj.jump_time, true );
196 - js_log('do jump to: '+embedObj.jump_time + ' perc:' +perc + ' sts:' + embedObj.seek_time_sec);
 190+ if(embedObj.stopMonitor)
 191+ embedObj.stopMonitor();
 192+
 193+ var perc = ui.value/1000;
 194+ //set seek time (in case we have to do a url seek)
 195+ embedObj.seek_time_sec = npt2seconds( embedObj.jump_time, true );
 196+ js_log('do jump to: '+embedObj.jump_time + ' perc:' +perc + ' sts:' + embedObj.seek_time_sec);
197197 embedObj.doSeek(perc);
198198 }
199 - }
 199+ }
200200 });
201 - //up the z-index of the default status indicator:
 201+ //up the z-index of the default status indicator:
202202 $j('#mv_play_head_'+embedObj.id + ' .ui-slider-handle').css('z-index', 4);
203203 $j('#mv_play_head_'+embedObj.id + ' .ui-slider-range').addClass('ui-corner-all').css('z-index', 2);
204 - //extended class list for jQuery ui themeing (we can probably refactor this with custom buffering highliter)
 204+ //extended class list for jQuery ui themeing (we can probably refactor this with custom buffering highliter)
205205 $j('#mv_play_head_'+embedObj.id).append( this.getMvBufferHtml() );
206 -
207 - //videoOptions:
 206+
 207+ //videoOptions:
208208 $j('#mv_vid_options_' + this.id + ' .vo_selection').click(function(){
209209 embedObj.selectPlaybackMethod();
210210 $j('#mv_vid_options_' + embedObj.id).hide();
@@ -213,73 +213,73 @@
214214 embedObj.showVideoDownload();
215215 $j('#mv_vid_options_'+embedObj.id).hide();
216216 return false;
217 - })
 217+ })
218218 $j('#mv_vid_options_'+ctrlBuilder.id+' .vo_showcode').click(function(){
219219 embedObj.showEmbedCode();
220220 $j('#mv_vid_options_'+embedObj.id).hide();
221221 return false;
222 - });
223 -
 222+ });
 223+
224224 //volume binding:
225225 var hoverOverDelay=false;
226226 $j('#volume_control_'+embedObj.id).unbind().btnBind().click(function(){
227227 $j('#' +embedObj.id).get(0).toggleMute();
228228 }).hover(
229 - function(){
 229+ function(){
230230 $j('#vol_container_' + embedObj.id).addClass('vol_container_top');
231231 //set to "below" if playing and embedType != native
232232 if(embedObj && embedObj.isPlaying && embedObj.isPlaying() && !embedObj.supports['overlays']){
233233 $j('#vol_container_' + embedObj.id).removeClass('vol_container_top').addClass('vol_container_below');
234234 }
235 -
 235+
236236 $j('#vol_container_' + embedObj.id).fadeIn('fast');
237237 hoverOverDelay = true;
238238 },
239 - function(){
240 - hoverOverDelay= false;
 239+ function(){
 240+ hoverOverDelay= false;
241241 setTimeout(function doHideVolume(){
242242 if(!hoverOverDelay){
243243 $j('#vol_container_' + embedObj.id).fadeOut('fast');
244244 }
245 - }, 500);
 245+ }, 500);
246246 }
247247 );
248248 //Volumen Slider
249249 $j('#volume_bar_'+embedObj.id).slider({
250 - orientation: "vertical",
 250+ orientation: "vertical",
251251 range: "min",
252252 value: 80,
253253 min: 0,
254 - max: 100,
255 - slide: function(event, ui) {
256 - var perc = ui.value/100;
 254+ max: 100,
 255+ slide: function(event, ui) {
 256+ var perc = ui.value/100;
257257 //js_log('update volume:' + perc);
258 - embedObj.updateVolumen(perc);
 258+ embedObj.updateVolumen(perc);
259259 },
260260 change:function(event, ui){
261 - var perc = ui.value/100;
 261+ var perc = ui.value/100;
262262 if (perc==0) {
263 - $j('#volume_control_'+embedObj.id + ' span').removeClass('ui-icon-volume-on').addClass('ui-icon-volume-off');
264 - }else{
 263+ $j('#volume_control_'+embedObj.id + ' span').removeClass('ui-icon-volume-on').addClass('ui-icon-volume-off');
 264+ }else{
265265 $j('#volume_control_'+embedObj.id + ' span').removeClass('ui-icon-volume-off').addClass('ui-icon-volume-on');
266266 }
267 - //only run the onChange event if done by a user slide:
 267+ //only run the onChange event if done by a user slide:
268268 if(embedObj.userSlide){
269269 embedObj.userSlide=false;
270 - embedObj.seeking=true;
271 - var perc = ui.value/100;
272 - embedObj.updateVolumen(perc);
 270+ embedObj.seeking=true;
 271+ var perc = ui.value/100;
 272+ embedObj.updateVolumen(perc);
273273 }
274 - }
275 - });
276 -
277 - },
 274+ }
 275+ });
 276+
 277+ },
278278 getMvBufferHtml:function(){
279279 return '<div class="ui-slider-range ui-slider-range-min ui-widget-header ' +
280280 'ui-state-highlight ui-corner-all '+
281281 'mv_buffer" style="width:0px;height:100%;z-index:1;top:0px" />';
282282 },
283 - getComponent:function( component ) {
 283+ getComponent:function( component ) {
284284 if( this.components[ component ] ){
285285 return this.components[ component ].o( this );
286286 }else{
@@ -287,7 +287,7 @@
288288 }
289289 },
290290 /*
291 - * components take in the embedObj and return some html for the given component.
 291+ * components take in the embedObj and return some html for the given component.
292292 * components can be overwritten by skin javascript
293293 */
294294 components:{
@@ -300,8 +300,8 @@
301301 'play-btn-large':{
302302 'w' : 130,
303303 'h' : 96,
304 - 'o':function( ctrlObj ){
305 - //get dynamic position for big play button (@@todo maybe use margin:auto ? )
 304+ 'o':function( ctrlObj ){
 305+ //get dynamic position for big play button (@@todo maybe use margin:auto ? )
306306 return $j('<div/>').attr({
307307 'title' : gM('mwe-play_clip'),
308308 'class' : "ui-state-default play-btn-large",
@@ -310,8 +310,8 @@
311311 'left' : ((ctrlObj.embedObj.playerPixelWidth() - this.w)/2),
312312 'top' : ((ctrlObj.embedObj.playerPixelHeight() - this.h)/2)
313313 })
314 - //quick and dirty way to get at jquery html (might be a short cut I am missing?)
315 - .wrap('<div/>').parent().html();
 314+ //quick and dirty way to get at jquery html (might be a short cut I am missing?)
 315+ .wrap('<div/>').parent().html();
316316 }
317317 },
318318 'mv_embedded_options':{
@@ -327,14 +327,14 @@
328328 '<p class="short_match vo_selection"><a href="#"><span>'+gM('mwe-chose_player')+'</span></a></p>'+
329329 '<p class="short_match vo_download"><a href="#"><span>'+gM('mwe-download')+'</span></a></p>'+
330330 '<p class="short_match vo_showcode"><a href="#"><span>'+gM('mwe-share')+'</span></a></p>';
331 -
332 - //link to the stream page if we are not already there:
 331+
 332+ //link to the stream page if we are not already there:
333333 if( ctrlObj.embedObj.roe && typeof mv_stream_interface == 'undefined' )
334334 o+='<p class="short_match"><a href="javascript:$j(\'#'+ctrlObj.id+'\').get(0).doLinkBack()"><span><strong>Source Page</strong></span></a></p>';
335 -
336 - o+='</div>'+
337 - '</div><!--videoOptionsInner-->' +
338 - '<div class="videoOptionsBot"></div>' +
 335+
 336+ o+='</div>'+
 337+ '</div><!--videoOptionsInner-->' +
 338+ '<div class="videoOptionsBot"></div>' +
339339 '</div><!--videoOptions-->';
340340 return o;
341341 }
@@ -348,7 +348,7 @@
349349 'options':{
350350 'w':26,
351351 'o':function( ctrlObj ){
352 - return '<div title="'+ gM('mwe-player_options') + '" id="options_button_'+ctrlObj.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton"><span class="ui-icon ui-icon-wrench"></span></div>';
 352+ return '<div title="'+ gM('mwe-player_options') + '" id="options_button_'+ctrlObj.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton"><span class="ui-icon ui-icon-wrench"></span></div>';
353353 }
354354 },
355355 'pause':{
@@ -361,7 +361,7 @@
362362 'w':23,
363363 'o':function( ctrlObj ){
364364 return '<div title="' + gM('mwe-closed_captions') + '" id="timed_text_'+ctrlObj.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton"><span class="ui-icon ui-icon-comment"></span></div>'
365 - }
 365+ }
366366 },
367367 'volume_control':{
368368 'w':23,
@@ -371,7 +371,7 @@
372372 '<div style="position:absolute;display:none;" id="vol_container_'+ctrlObj.id+'" class="vol_container ui-corner-all">' +
373373 '<div class="volume_bar" id="volume_bar_' + ctrlObj.id + '"></div>' +
374374 '</div>'+
375 - '</div>';
 375+ '</div>';
376376 }
377377 },
378378 'time_display':{
@@ -381,10 +381,10 @@
382382 }
383383 },
384384 'play_head':{
385 - 'w':0, //special case (takes up remaining space)
 385+ 'w':0, //special case (takes up remaining space)
386386 'o':function( ctrlObj ){
387387 return '<div class="play_head" id="mv_play_head_' + ctrlObj.id + '" style="width: ' + ( ctrlObj.available_width - 30 ) + 'px;"></div>';
388388 }
389 - }
390 - }
 389+ }
 390+ }
391391 };
Index: trunk/phase3/js2/mwEmbed/mv_embed.js
@@ -19,12 +19,12 @@
2020 if( MV_EMBED_VERSION ){
2121 MV_DO_INIT=false;
2222 }
23 -// Used to grab fresh copies of scripts.
 23+// Used to grab fresh copies of scripts.
2424 var MV_EMBED_VERSION = '1.0r20';
2525
2626 /*
2727 * Configuration variables should be set by extending mwConfigOptions
28 - * here is the default config:
 28+ * here is the default config:
2929 */
3030 var mwDefaultConfig = {
3131 'skin_name': 'mvpcf',
@@ -70,10 +70,10 @@
7171 // For use when mv_embed with script-loader is in the root MediaWiki path
7272 var mediaWiki_mvEmbed_path = 'js2/mwEmbed/';
7373
74 -var _global = this; // Global obj (depreciate use window)
 74+var _global = this; // Global obj (depreciate use window)
7575
7676 /*
77 -* setup the empty global $mw object
 77+* setup the empty global $mw object
7878 * will ensure all our functions are properly namespaced
7979 */
8080 if(!window['$mw']){
@@ -94,35 +94,35 @@
9595 * wrap the global $mw object here:
9696 *
9797 * Any global functions/classes that are not jQuery plugins should make
98 -* there way into the $mw namespace
 98+* there way into the $mw namespace
9999 */
100100 (function( $ ) {
101101 /*
102102 * Language classes $mw.lang
103 - *
 103+ *
104104 * Localized Language support attempts to mirror the functionality of Language.php in MediaWiki
105105 * It contains methods for loading and transforming msg text
106 - *
 106+ *
107107 */
108108 $.lang = {};
109109 /**
110110 * Setup the lang object
111111 */
112112 var gMsg = {};
113 - var gRuleSet = {};
114 -
 113+ var gRuleSet = {};
 114+
115115 /**
116116 * loadGM function
117 - * Loads a set of json messages into the lng object.
 117+ * Loads a set of json messages into the lng object.
118118 *
119 - * @param json msgSet The set of msgs to be loaded
 119+ * @param json msgSet The set of msgs to be loaded
120120 */
121121 $.lang.loadGM = function( msgSet ){
122122 for( var i in msgSet ) {
123123 gMsg[ i ] = msgSet[i];
124124 }
125125 },
126 -
 126+
127127 /**
128128 * loadRS function
129129 * Loads a ruleset by given template key ie PLURAL : { //ruleSetObj }
@@ -134,55 +134,55 @@
135135 gRuleSet[ i ] = ruleSet[ i ];
136136 }
137137 }
138 -
 138+
139139 /**
140140 * Returns a transformed msg string
141141 *
142142 * it take a msg key and array of replacement values of form
143 - * $1, $2 and does relevant msgkey transformation returning
144 - * the user msg.
 143+ * $1, $2 and does relevant msgkey transformation returning
 144+ * the user msg.
145145 *
146146 * @param string key The msg key as set by loadGm
147147 * @param [mixed] args An array of replacement strings
148 - * @return string
 148+ * @return string
149149 */
150 - $.lang.gM = function( key , args ) {
 150+ $.lang.gM = function( key , args ) {
151151 if(! gMsg[ key ])
152152 return '&lt;' + key + '&gt;';// Missing key placeholder
153 -
 153+
154154 //swap in the arg values
155 - var ms = $.lang.gMsgSwap( key, args) ;
156 -
 155+ var ms = $.lang.gMsgSwap( key, args) ;
 156+
157157 //a quick check to see if we need to send the msg via the 'parser'
158158 //(we can add more detailed check once we support more wiki syntax)
159159 if(ms.indexOf('{{')==-1){
160160 return ms;
161161 //return ms;
162162 }
163 -
164 - //make sure we have the lagMagic setup:
 163+
 164+ //make sure we have the lagMagic setup:
165165 $.lang.magicSetup();
166 - //send the msg key through the parser
 166+ //send the msg key through the parser
167167 pObj = $.parser.pNew( ms );
168168 //return the transformed msg
169 - return pObj.getHTML();
 169+ return pObj.getHTML();
170170 }
171171 /**
172172 * gMsgSwap
173 - *
 173+ *
174174 * @param string key The msg key as set by loadGm
175175 * @param [mixed] args An array or string to be replaced
176 - * @return string
 176+ * @return string
177177 */
178178 $.lang.gMsgSwap = function( key , args ){
179179 if(! gMsg[ key ])
180180 return '&lt;' + key + '&gt;';// Missing key placeholder
181181 //get the messege string:
182182 var ms = gMsg[ key ];
183 -
184 - //replace values
 183+
 184+ //replace values
185185 if( typeof args == 'object' || typeof args == 'array' ) {
186 - for( var v in args ) {
 186+ for( var v in args ) {
187187 // Message test replace arguments start at 1 instead of zero:
188188 var rep = new RegExp('\\$'+ ( parseInt(v) + 1 ), 'g');
189189 ms = ms.replace( rep, args[v] );
@@ -192,70 +192,70 @@
193193 }
194194 return ms;
195195 }
196 -
 196+
197197 /**
198198 * gMsgNoTrans
199 - *
 199+ *
200200 * @returns string The msg key without transforming it
201201 */
202202 $.lang.gMsgNoTrans = function( key ){
203203 if( gMsg[ key ] )
204204 return gMsg[ key ]
205 -
 205+
206206 // Missing key placeholder
207207 return '&lt;' + key + '&gt;';
208208 }
209209 /**
210 - * Add Supported Magic Words to parser
 210+ * Add Supported Magic Words to parser
211211 */
212212 //set the setupflag to false:
213 - $.lang.doneSetup=false;
 213+ $.lang.doneSetup=false;
214214 $.lang.magicSetup = function(){
215215 if(!$.lang.doneSetup){
216216 $.parser.addMagic ( {
217217 'PLURAL' : $.lang.procPLURAL
218218 })
219 -
 219+
220220 $.lang.doneSetup = true;
221221 }
222 -
 222+
223223 }
224224 /**
225225 * Process the PLURAL special language template key:
226226 */
227227 $.lang.procPLURAL = function( tObj ){
228 - //setup shortcuts
 228+ //setup shortcuts
229229 // (gRuleSet is loaded from script-loader to contains local ruleset)
230 - var rs = gRuleSet['PLURAL'];
231 -
 230+ var rs = gRuleSet['PLURAL'];
 231+
232232 /*
233233 * Plural matchRuleTest
234234 */
235235 function matchRuleTest(cRule, val){
236236 js_log("matchRuleTest:: " + typeof cRule + ' ' + cRule + ' == ' + val );
237 -
 237+
238238 function checkValue(compare, val){
239239 if(typeof compare == 'string'){
240 - range = compare.split('-');
 240+ range = compare.split('-');
241241 if( range.length >= 1 ){
242242 if( val >= range[0] && val <= range[1] )
243 - return true;
 243+ return true;
244244 }
245245 }
246246 //else do a direct compare
247247 if(compare == val){
248 - return true;
 248+ return true;
249249 }
250250 return false;
251 - }
 251+ }
252252 //check for simple cRule type:
253 - if( typeof cRule == 'number'){
254 - return ( parseInt( val ) == parseInt( cRule) );
 253+ if( typeof cRule == 'number'){
 254+ return ( parseInt( val ) == parseInt( cRule) );
255255 }else if( typeof cRule == 'object' ){
256 - var cmatch = {};
 256+ var cmatch = {};
257257 //if a list we need to match all for rule match
258258 for(var i in cRule){
259 - var cr = cRule[i];
 259+ var cr = cRule[i];
260260 //set cr type
261261 var crType = '';
262262 for( var j in cr ){
@@ -264,9 +264,9 @@
265265 }
266266 switch(crType){
267267 case 'mod':
268 - if( cr ['is'] ){
 268+ if( cr ['is'] ){
269269 if( checkValue( val % cr['mod'], cr ['is'] ) )
270 - cmatch[i] = true;
 270+ cmatch[i] = true;
271271 }else if( cr['not']){
272272 if( ! checkValue( val % cr['mod'], cr ['not'] ) )
273273 cmatch[i] = true;
@@ -274,46 +274,46 @@
275275 break;
276276 }
277277 }
278 - //check all the matches (taking into consideration "or" order)
279 - for(var i in cRule){
 278+ //check all the matches (taking into consideration "or" order)
 279+ for(var i in cRule){
280280 if( ! cmatch[i] )
281 - return false;
 281+ return false;
282282 }
283283 return true;
284 -
 284+
285285 }
286286 }
287287 /**
288288 * Maps a given rule Index to template params:
289 - *
 289+ *
290290 * if index is out of range return last param
291 - * @param
292 - */
293 - function getTempParamFromRuleInx(tObj, ruleInx ){
 291+ * @param
 292+ */
 293+ function getTempParamFromRuleInx(tObj, ruleInx ){
294294 //js_log('getTempParamFromRuleInx: ruleInx: ' + ruleInx + ' tempParamLength ' + tObj.param.length );
295295 if( ruleInx >= tObj.param.length )
296296 return tObj.param[ tObj.param.length -1 ];
297297 //else return the requested index:
298298 return tObj.param[ ruleInx ];
299 - }
 299+ }
300300 var rCount=0
301 - //run the actual rule lookup:
 301+ //run the actual rule lookup:
302302 for(var ruleInx in rs){
303 - cRule = rs[ruleInx];
 303+ cRule = rs[ruleInx];
304304 if( matchRuleTest( cRule, tObj.arg ) ){
305 - js_log("matched rule: " + ruleInx );
306 - return getTempParamFromRuleInx(tObj, rCount );
 305+ js_log("matched rule: " + ruleInx );
 306+ return getTempParamFromRuleInx(tObj, rCount );
307307 }
308308 rCount ++;
309 - }
 309+ }
310310 js_log('no match found for: ' + tObj.arg + ' using last/other : ' + tObj.param [ tObj.param.length -1 ] );
311 - //return the last /"other" template param
312 - return tObj.param [ tObj.param.length -1 ];
313 - }
314 -
 311+ //return the last /"other" template param
 312+ return tObj.param [ tObj.param.length -1 ];
 313+ }
 314+
315315 /**
316316 * gMsgLoadRemote loads remote msg strings
317 - *
 317+ *
318318 * @param mixed msgSet the set of msg to load remotely
319319 * @param function callback the callback to issue once string is ready
320320 */
@@ -327,7 +327,7 @@
328328 ammessages += msgSet;
329329 }
330330 if( ammessages == '' ) {
331 - js_log( 'gMsgLoadRemote: no message set requested' );
 331+ js_log( 'gMsgLoadRemote: no message set requested' );
332332 return false;
333333 }
334334 do_api_req({
@@ -382,95 +382,95 @@
383383 //@@todo we need a formatNum and we need to request some special packaged info to deal with that case.
384384 return gM( msg , size );
385385 };
386 -
387 -
 386+
 387+
388388 /**
389389 * MediaWiki wikitext "Parser"
390390 *
391 - * This is not feature complete but we need a way to get at template properties
392 - *
393 - *
 391+ * This is not feature complete but we need a way to get at template properties
 392+ *
 393+ *
394394 * @param wikiText the wikitext to be parsed
395 - * @return parserObj returns a parser object that has methods for getting at
396 - * things you would want
397 - */
 395+ * @return parserObj returns a parser object that has methods for getting at
 396+ * things you would want
 397+ */
398398 $.parser = {};
399399 var pMagicSet = {};
400400 /**
401 - * parser addMagic
402 - *
 401+ * parser addMagic
 402+ *
403403 * lets you add a set of magic keys and associated callback funcions
404 - * callback: @param ( Object Template )
 404+ * callback: @param ( Object Template )
405405 * callback: @return the transformed template output
406 - *
 406+ *
407407 * @param object magicSet key:callback
408408 */
409409 $.parser.addMagic = function( magicSet ){
410410 for(var i in magicSet)
411411 pMagicSet[ i ] = magicSet[i];
412412 }
413 -
 413+
414414 //actual parse call (returns parser object)
415415 $.parser.pNew = function( wikiText, opt ){
416416 var parseObj = function( wikiText, opt){
417417 return this.init( wikiText, opt )
418 - }
 418+ }
419419 parseObj.prototype = {
420420 //the wikiText "DOM"... stores the parsed wikiText structure
421421 //wtDOM : {}, (not yet supported )
422 -
423 - pOut : '', //the parser output string container
 422+
 423+ pOut : '', //the parser output string container
424424 init :function( wikiText ){
425 - this.wikiText = wikiText;
 425+ this.wikiText = wikiText;
426426 },
427427 updateText : function( wikiText ){
428428 this.wikiText = wikiText;
429 - //invalidate the output (will force a reparse)
430 - this.pOut = '';
 429+ //invalidate the output (will force a reparse)
 430+ this.pOut = '';
431431 },
432 - parse : function(){
 432+ parse : function(){
433433 this.pObj = {};
434434 this.pObj.tmpl = new Array();
435 -
436 - //refrences for swap key
 435+
 436+ //refrences for swap key
437437 this.pObj.tmpl_text = new Array();
438 - this.pObj.tmpl_key = new Array();
439 - this.pObj.tmpl_ns = '' ; // wikiText with place-holder
440 -
 438+ this.pObj.tmpl_key = new Array();
 439+ this.pObj.tmpl_ns = '' ; // wikiText with place-holder
 440+
441441 //get templates losly based on Magnus_Manske/tmpl.js code:
442442 var tcnt = 0 ;
443 - var ts = '' ;
 443+ var ts = '' ;
444444 var curt = 0 ;
445 - var schar = 0;
446 -
447 -
 445+ var schar = 0;
 446+
 447+
448448 //build out nested template holders:
449449 var depth = 0;
450 - var tKey = 0;
451 - var ns = '';
452 -
 450+ var tKey = 0;
 451+ var ns = '';
 452+
453453 /*
454454 * quickly recursive / parse out templates with top down recurse decent
455 - */
456 -
 455+ */
 456+
457457 // ~ probably a better algorithm out there / should mirror php parser flow ~
458 - // ... but I am having fun with recursion so here it is...
459 - function rdpp ( txt ){
 458+ // ... but I am having fun with recursion so here it is...
 459+ function rdpp ( txt ){
460460 var node = {};
461461 //if we should output node text
462 - var ont = true;
463 - //inspect each char
464 - for(var a=0; a < txt.length; a++){
 462+ var ont = true;
 463+ //inspect each char
 464+ for(var a=0; a < txt.length; a++){
465465 if( txt[a] == '{' && txt[a+1] == '{' ){
466466 a=a+2;
467 - node['p'] = node;
 467+ node['p'] = node;
468468 if(!node['c'])
469469 node['c'] = new Array();
470 -
471 - node['c'].push( rdpp( txt.substr( a ) ) );
472 - ont=true;
 470+
 471+ node['c'].push( rdpp( txt.substr( a ) ) );
 472+ ont=true;
473473 }else if( txt[a] == '}' && txt[a+1] == '}'){
474 - if( !node['p'] ){
 474+ if( !node['p'] ){
475475 return node;
476476 }
477477 node = node['p'];
@@ -484,37 +484,37 @@
485485 node['t']+=txt[a];
486486 }
487487 return node;
488 - }
 488+ }
489489 /**
490490 * parse template text as template name and named params
491491 */
492492 function parseTmplTxt( ts ){
493493 var tObj = {};
494 - //Get template name:
 494+ //Get template name:
495495 tname = ts.split('\|').shift() ;
496 - tname = tname.split('\{').shift() ;
497 - tname = tname.replace( /^\s+|\s+$/g, "" ); //trim
498 -
499 - //check for arguments:
500 - if( tname.split(':').length == 1 ){
 496+ tname = tname.split('\{').shift() ;
 497+ tname = tname.replace( /^\s+|\s+$/g, "" ); //trim
 498+
 499+ //check for arguments:
 500+ if( tname.split(':').length == 1 ){
501501 tObj["name"] = tname;
502502 }else{
503503 tObj["name"] = tname.split(':').shift();
504504 tObj["arg"] = tname.split(':').pop();
505505 }
506 -
507 - js_log("TNAME::" + tObj["arg"] + ' from:: ' + ts);
508 -
 506+
 507+ js_log("TNAME::" + tObj["arg"] + ' from:: ' + ts);
 508+
509509 var pSet = ts.split('\|');
510 - pSet.splice(0,1);
511 - if( pSet.length ){
 510+ pSet.splice(0,1);
 511+ if( pSet.length ){
512512 tObj.param = new Array();
513513 for(var pInx in pSet){
514514 var tStr = pSet[ pInx ];
515515 for(var b=0 ; b < tStr.length ; b++){
516516 if(tStr[b] == '=' && b>0 && b<tStr.length && tStr[b-1]!='\\'){
517517 //named param
518 - tObj.param[ tStr.split('=').shift() ] = tStr.split('=').pop();
 518+ tObj.param[ tStr.split('=').shift() ] = tStr.split('=').pop();
519519 }else{
520520 //indexed param
521521 tObj.param[ pInx ] = tStr;
@@ -527,84 +527,84 @@
528528 function getMagicTxtFromTempNode( node ){
529529 node.tObj = parseTmplTxt ( node.t );
530530 //do magic swap if templet key found in pMagicSet
531 - if( node.tObj.name in pMagicSet){
532 - var nt = pMagicSet[ node.tObj.name ]( node.tObj );
 531+ if( node.tObj.name in pMagicSet){
 532+ var nt = pMagicSet[ node.tObj.name ]( node.tObj );
533533 return nt;
534534 }else{
535535 //don't swap just return text
536536 return node.t;
537 - }
 537+ }
538538 }
539539 /**
540540 * recurse_magic_swap
541 - *
542 - * go last child first swap upward: (could probably be integrated above somehow)
543 - */
544 - var pNode = null;
545 - function recurse_magic_swap( node ){
 541+ *
 542+ * go last child first swap upward: (could probably be integrated above somehow)
 543+ */
 544+ var pNode = null;
 545+ function recurse_magic_swap( node ){
546546 if( !pNode )
547 - pNode = node;
548 -
549 - if( node['c'] ){
550 - //swap all the kids:
551 - for(var i in node['c']){
552 - var nt = recurse_magic_swap( node['c'][i] );
 547+ pNode = node;
 548+
 549+ if( node['c'] ){
 550+ //swap all the kids:
 551+ for(var i in node['c']){
 552+ var nt = recurse_magic_swap( node['c'][i] );
553553 //swap it into current
554 - if( node.t ){
555 - node.t = node.t.replace( node['c'][i].t, nt);
556 - }
 554+ if( node.t ){
 555+ node.t = node.t.replace( node['c'][i].t, nt);
 556+ }
557557 //swap into parent
558 - pNode.t = pNode.t.replace( node['c'][i].t, nt);
 558+ pNode.t = pNode.t.replace( node['c'][i].t, nt);
559559 }
560 - //do the current node:
561 - var nt = getMagicTxtFromTempNode( node );
562 - pNode.t = pNode.t.replace(node.t , nt);
563 - //run the swap for the outer most node
 560+ //do the current node:
 561+ var nt = getMagicTxtFromTempNode( node );
 562+ pNode.t = pNode.t.replace(node.t , nt);
 563+ //run the swap for the outer most node
564564 return node.t;
565 - }else{
566 - //node.t = getMagicFromTempObj( node.t )
 565+ }else{
 566+ //node.t = getMagicFromTempObj( node.t )
567567 return getMagicTxtFromTempNode( node );
568568 }
569 - }
570 - //get text node system:
571 - var node = rdpp ( this.wikiText );
572 - //debugger;
573 - //parse out stuff:
574 -
575 - this.pOut = recurse_magic_swap( node);
576 -
 569+ }
 570+ //get text node system:
 571+ var node = rdpp ( this.wikiText );
 572+ //debugger;
 573+ //parse out stuff:
 574+
 575+ this.pOut = recurse_magic_swap( node);
 576+
577577 },
578578 /**
579579 * Returns the transformed wikitext
580 - *
581 - * Build output from swapable index
582 - * (all transforms must be expanded in parse stage and linerarly rebuilt)
583 - * Alternativly we could build output using a placeholder & replace system
 580+ *
 581+ * Build output from swapable index
 582+ * (all transforms must be expanded in parse stage and linerarly rebuilt)
 583+ * Alternativly we could build output using a placeholder & replace system
584584 * (this lets us be slightly more slopty with ordering and indexes, but probably slower)
585 - *
586 - * Ideal: we build a 'wiki DOM'
 585+ *
 586+ * Ideal: we build a 'wiki DOM'
587587 * When editing you update the data structure directly
588 - * Then in output time you just go DOM->html-ish output without re-parsing anything
 588+ * Then in output time you just go DOM->html-ish output without re-parsing anything
589589 */
590590 getHTML : function(){
591591 //wikiText updates should invalidate pOut
592592 if( this.pOut == ''){
593593 this.parse();
594594 }
595 - return this.pOut;
 595+ return this.pOut;
596596 }
597597 };
598598 //return the parserObj
599599 return new parseObj( wikiText, opt) ;
600 - }
601 -
 600+ }
 601+
602602 })(window.$mw);
603 -//setup legacy global shortcuts:
 603+//setup legacy global shortcuts:
604604 var loadGM = $mw.lang.loadGM;
605605 var loadRS = $mw.lang.loadRS;
606606 var gM = $mw.lang.gM;
607607
608 -//if some no-js2 script defined and loaded gMsg in global space:
 608+//if some no-js2 script defined and loaded gMsg in global space:
609609 if( _global['gMsg'] ){
610610 loadGM( _global['gMsg'] );
611611 }
@@ -838,11 +838,11 @@
839839 coma = ',';
840840 }
841841 }
842 - //Build the url to the scriptServer striping its request paramaters:
 842+ //Build the url to the scriptServer striping its request paramaters:
843843 var puri = parseUri( getMvEmbedURL() );
844844 if( ( getMvEmbedURL().indexOf('://') != -1 )
845845 && puri.host != parseUri( document.URL ).host )
846 - {
 846+ {
847847 var scriptPath = puri.protocol + '://' + puri.authority + puri.path;
848848 }else{
849849 var scriptPath = puri.path;
@@ -870,10 +870,10 @@
871871 this.callbacks.push( callback );
872872 }
873873 if( this.checkLoading() ) {
874 - //@@todo we should check the <script> Element .onLoad property to
875 - //make sure its just not a very slow connection or we can run the callback
876 - //(even though the class is not loaded)
877 -
 874+ //@@todo we should check the <script> Element .onLoad property to
 875+ //make sure its just not a very slow connection or we can run the callback
 876+ //(even though the class is not loaded)
 877+
878878 if( this.load_time++ > 4000 ){ // Time out after ~80 seconds
879879 js_log( gM('mwe-error_load_lib', [mvGetClassPath(this.missing_path), this.missing_path]) );
880880 this.load_error = true;
@@ -952,7 +952,7 @@
953953 cur_path = (cur_path == '') ? cur_path + objPath[p] : cur_path + '.' + objPath[p];
954954 eval( 'var ptest = typeof ( '+ cur_path + ' ); ');
955955 if( ptest == 'undefined' ) {
956 - this.missing_path = cur_path;
 956+ this.missing_path = cur_path;
957957 return false;
958958 }
959959 }
@@ -966,39 +966,39 @@
967967 //js_log( 'jQueryCheck::' );
968968 // Skip stuff if $j is already loaded:
969969 if( _global['$j'] && callback )
970 - callback();
 970+ callback();
971971 var _this = this;
972972 // Load jQuery
973973 _this.doLoad([
974974 'window.jQuery'
975975 ], function() {
976 - //only do the $j setup once:
 976+ //only do the $j setup once:
977977 if(!_global['$j']){
978978 _global['$j'] = jQuery.noConflict();
979979 }
980980 if( _this.jQuerySetupFlag == false){
981981 js_log('setup mv_embed jQuery bindings');
982 - //setup our global settings using the (jQuery helper)
983 - mwConfig = $j.extend( mwDefaultConfig, mwConfig);
984 -
 982+ //setup our global settings using the (jQuery helper)
 983+ mwConfig = $j.extend( mwDefaultConfig, mwConfig);
 984+
985985 // Set up the skin path
986986 _global['mv_jquery_skin_path'] = mv_embed_path + 'jquery/jquery.ui/themes/' +mwConfig['jui_skin'] + '/';
987987 _global['mv_skin_img_path'] = mv_embed_path + 'skins/' + mwConfig['skin_name'] + '/images/';
988988 _global['mv_default_thumb_url'] = mv_skin_img_path + 'vid_default_thumb.jpg';
989 -
990 - //setup skin dependent dependencies
991 - lcCssPath({'embedVideo' : 'skins/' + mwConfig['skin_name'] + '/playerSkin.css'});
992 -
 989+
 990+ //setup skin dependent dependencies
 991+ lcCssPath({'embedVideo' : 'skins/' + mwConfig['skin_name'] + '/playerSkin.css'});
 992+
993993 // Make sure the skin/style sheets are always available:
994994 loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
995995 loadExternalCss( mv_embed_path + 'skins/' + mwConfig['skin_name'] + '/styles.css' );
996 -
 996+
997997 // Set up AJAX to not send dynamic URLs for loading scripts (we control that with
998998 // the scriptLoader)
999999 $j.ajaxSetup({
10001000 cache: true
10011001 });
1002 -
 1002+
10031003 js_log( 'jQuery loaded into $j' );
10041004 // Set up mvEmbed jQuery bindings and config based dependencies
10051005 mv_jqueryBindings();
@@ -1012,32 +1012,32 @@
10131013 },
10141014 embedVideoCheck:function( callback ) {
10151015 var _this = this;
1016 - js_log( 'embedVideoCheck:' );
 1016+ js_log( 'embedVideoCheck:' );
10171017 // Make sure we have jQuery
10181018 _this.jQueryCheck( function() {
10191019 //set class videonojs to hidden
10201020 $j('.videonojs').html( gM('mwe-loading_txt') );
1021 - //Set up the embed video player class request: (include the skin js as well)
 1021+ //Set up the embed video player class request: (include the skin js as well)
10221022 var depReq = [
10231023 [
10241024 '$j.ui',
10251025 'embedVideo',
10261026 'ctrlBuilder',
1027 - '$j.cookie'
 1027+ '$j.cookie'
10281028 ],
10291029 [
10301030 '$j.ui.slider'
10311031 ]
1032 - ];
1033 - //add skin if set:
 1032+ ];
 1033+ //add skin if set:
10341034 if( mwConfig['skin_name'] )
10351035 depReq[0].push( mwConfig['skin_name'] + 'Config' );
1036 -
 1036+
10371037 // Add PNG fix if needed:
10381038 if( $j.browser.msie || $j.browser.version < 7 )
10391039 depReq[0].push( '$j.fn.pngFix' );
1040 -
1041 - //load the video libs:
 1040+
 1041+ //load the video libs:
10421042 _this.doLoadDepMode( depReq, function() {
10431043 embedTypes.init();
10441044 callback();
@@ -1052,7 +1052,7 @@
10531053 // unless js2AddOnloadHook was used or there is video on the page.
10541054 runQueuedFunctions: function() {
10551055 var _this = this;
1056 - this.doneReadyEvents = true;
 1056+ this.doneReadyEvents = true;
10571057 this.jQueryCheck( function() {
10581058 _this.runReadyEvents();
10591059 });
@@ -1114,7 +1114,7 @@
11151115 //}
11161116 }
11171117 //js2AddOnloadHook: ensure jQuery and the DOM are ready
1118 -function js2AddOnloadHook( func ) {
 1118+function js2AddOnloadHook( func ) {
11191119 // If we have already run the DOM-ready function, just run the function directly:
11201120 if( mvJsLoader.doneReadyEvents ) {
11211121 // Make sure jQuery is there:
@@ -1154,7 +1154,7 @@
11551155 */
11561156 function mv_write_modal( content, speed ) {
11571157 $j( '#modalbox,#mv_overlay' ).remove();
1158 - $j( 'body' ).append(
 1158+ $j( 'body' ).append(
11591159 '<div id="modalbox" style="background:#DDD;border:3px solid #666666;font-size:115%;' +
11601160 'top:30px;left:20px;right:20px;bottom:30px;position:fixed;z-index:100;">' +
11611161 content +
@@ -1218,7 +1218,7 @@
12191219 // Issue a request to get the CSS file (if not already included):
12201220 loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
12211221 loadExternalCss( mv_embed_path + 'skins/' + mwConfig['skin_name'] + '/mv_sequence.css' );
1222 - // Make sure we have the required mv_embed libs (they are not loaded when no video
 1222+ // Make sure we have the required mv_embed libs (they are not loaded when no video
12231223 // element is on the page)
12241224 mvJsLoader.embedVideoCheck( function() {
12251225 // Load the playlist object and then the jQuery UI stuff:
@@ -1243,7 +1243,7 @@
12441244 ]
12451245 ], function() {
12461246 js_log( 'calling new mvSequencer' );
1247 - // Initialise the sequence object (it will take over from there)
 1247+ // Initialise the sequence object (it will take over from there)
12481248 // No more than one mvSeq obj for now:
12491249 if( !_global['mvSeq'] ) {
12501250 _global['mvSeq'] = new mvSequencer( iObj );
@@ -1264,12 +1264,12 @@
12651265 loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
12661266 loadExternalCss( mv_embed_path + 'skins/'+mwConfig['skin_name'] + '/styles.css' );
12671267
1268 - // Check if we already have Firefogg loaded (the call just updates the element's
 1268+ // Check if we already have Firefogg loaded (the call just updates the element's
12691269 // properties)
12701270 var sElm = $j( this.selector ).get( 0 );
12711271 if( sElm['firefogg'] ) {
12721272 if( sElm['firefogg'] == 'loading' ) {
1273 - js_log( "Error: called firefogg operations on Firefogg selector that is " +
 1273+ js_log( "Error: called firefogg operations on Firefogg selector that is " +
12741274 "not done loading" );
12751275 return false;
12761276 }
@@ -1310,7 +1310,7 @@
13111311 // Make sure we have everything loaded that we need:
13121312 mvJsLoader.doLoadDepMode( loadSet, function() {
13131313 js_log( 'firefogg libs loaded. target select:' + iObj.selector );
1314 - // Select interface provider based on whether we want to include the
 1314+ // Select interface provider based on whether we want to include the
13151315 // encoder interface or not
13161316 if( iObj.encoder_interface ) {
13171317 var myFogg = new mvAdvFirefogg( iObj );
@@ -1371,15 +1371,15 @@
13721372 var href = (opt.href) ? opt.href : '#';
13731373 var target_attr = (opt.target) ? ' target="' + opt.target + '" ' : '';
13741374 var style_attr = (opt.style) ? ' style="' + opt.style + '" ' : '';
1375 - return '<a href="' + href + '" ' + target_attr + style_attr +
 1375+ return '<a href="' + href + '" ' + target_attr + style_attr +
13761376 ' class="ui-state-default ui-corner-all ui-icon_link ' +
13771377 className + '"><span class="ui-icon ui-icon-' + iconId + '" />' +
13781378 '<span class="btnText">'+ msg +'<span></a>';
13791379 }
13801380 // Shortcut to bind hover state
1381 - $.fn.btnBind = function() {
 1381+ $.fn.btnBind = function() {
13821382 $j( this ).hover(
1383 - function() {
 1383+ function() {
13841384 $j( this ).addClass( 'ui-state-hover' );
13851385 },
13861386 function() {
@@ -1390,28 +1390,28 @@
13911391 }
13921392 /**
13931393 * addLoaderDialog
1394 - * small helper for putting a loading dialog box on top of everything
 1394+ * small helper for putting a loading dialog box on top of everything
13951395 * (helps block for request that
1396 - *
 1396+ *
13971397 * @param msg text text of the loader msg
13981398 */
1399 - $.addLoaderDialog = function( msg_txt ){
 1399+ $.addLoaderDialog = function( msg_txt ){
14001400 if( $('#mwe_tmp_loader').length != 0 )
14011401 $('#mwe_tmp_loader').remove();
1402 -
1403 - $('body').append('<div id="mwe_tmp_loader" title="' + msg_txt + '" >' +
1404 - gM('mwe-checking-resource') + '<br>' +
 1402+
 1403+ $('body').append('<div id="mwe_tmp_loader" title="' + msg_txt + '" >' +
 1404+ gM('mwe-checking-resource') + '<br>' +
14051405 mv_get_loading_img() +
14061406 '</div>');
1407 -
 1407+
14081408 mvJsLoader.doLoadDepMode([
1409 - [
 1409+ [
14101410 '$j.ui'
14111411 ],
14121412 [
14131413 '$j.ui.dialog'
14141414 ]
1415 - ], function() {
 1415+ ], function() {
14161416 $('#mwe_tmp_loader').dialog({
14171417 bgiframe: true,
14181418 height: 140,
@@ -1649,7 +1649,7 @@
16501650 } else {
16511651 // Get data via DOM injection with callback
16521652 global_req_cb.push( callback );
1653 - // Prepend json_ to feed_format if not already requesting json format (metavid specific)
 1653+ // Prepend json_ to feed_format if not already requesting json format (metavid specific)
16541654 if( req_url.indexOf( "feed_format=" ) != -1 && req_url.indexOf( "feed_format=json" ) == -1 )
16551655 req_url = req_url.replace( /feed_format=/, 'feed_format=json_' );
16561656 loadExternalJs( req_url + '&cb=mv_jsdata_cb&cb_inx=' + (global_req_cb.length - 1) );
@@ -1803,7 +1803,7 @@
18041804 mv_embed_path = mv_embed_url.substr( 0, mv_embed_url.indexOf( 'mv_embed.js' ) );
18051805 } else if( mv_embed_url.indexOf( 'mwScriptLoader.php' ) !== -1 ) {
18061806 // Script loader is in the root of MediaWiki, so include the default mv_embed extension path
1807 - mv_embed_path = mv_embed_url.substr( 0, mv_embed_url.indexOf( 'mwScriptLoader.php' ) )
 1807+ mv_embed_path = mv_embed_url.substr( 0, mv_embed_url.indexOf( 'mwScriptLoader.php' ) )
18081808 + mediaWiki_mvEmbed_path;
18091809 } else {
18101810 mv_embed_path = mv_embed_url.substr( 0, mv_embed_url.indexOf( 'jsScriptLoader.php' ) );
Index: trunk/phase3/js2/remoteMwEmbed.js
@@ -2,19 +2,19 @@
33 * this file exposes some of the functionality of mwEmbed to wikis
44 * that do not yet have js2 enabled
55 */
6 -
 6+
77 var urlparts = getRemoteEmbedPath();
88 var mwEmbedHostPath = urlparts[0];
99 var reqAguments = urlparts[1];
1010
11 -addOnloadHook( function(){
 11+addOnloadHook( function(){
1212 //only do rewrites if MV_EMBED / js2 is "off"
1313 if( typeof MV_EMBED_VERSION == 'undefined' ) {
1414 doPageSpecificRewrite();
1515 }
1616 });
1717
18 -function doPageSpecificRewrite() {
 18+function doPageSpecificRewrite() {
1919 // Add media wizard
2020 if( wgAction == 'edit' || wgAction == 'submit' ) {
2121 load_mv_embed( function() {
@@ -23,23 +23,23 @@
2424 }
2525
2626 // Firefogg integration
27 - if( wgPageName == "Special:Upload" ){
 27+ if( wgPageName == "Special:Upload" ){
2828 load_mv_embed( function() {
2929 importScriptURI( mwEmbedHostPath + '/uploadPage.js' + reqAguments );
3030 } );
31 - }
32 -
 31+ }
 32+
3333 // OggHandler rewrite for view pages:
3434 var vidIdList = [];
3535 var divs = document.getElementsByTagName( 'div' );
3636 for( var i = 0; i < divs.length; i++ ) {
3737 if( divs[i].id && divs[i].id.substring( 0, 11 ) == 'ogg_player_' ) {
38 - vidIdList.push( divs[i].getAttribute( "id" ) );
 38+ vidIdList.push( divs[i].getAttribute( "id" ) );
3939 }
40 - }
 40+ }
4141 if( vidIdList.length > 0 ) {
4242 load_mv_embed( function() {
43 - mvJsLoader.embedVideoCheck( function() {
 43+ mvJsLoader.embedVideoCheck( function() {
4444 // Do utility rewrite of OggHandler content:
4545 rewrite_for_OggHandler( vidIdList );
4646 } );
@@ -49,7 +49,7 @@
5050 // will be deprecated in favor of updates to OggHandler
5151 function rewrite_for_OggHandler( vidIdList ){
5252 for( var i = 0; i < vidIdList.length; i++ ) {
53 - var vidId = vidIdList[i];
 53+ var vidId = vidIdList[i];
5454 // Grab the thumbnail and src of the video
5555 var pimg = $j( '#' + vidId + ' img' );
5656 var poster_attr = 'poster = "' + pimg.attr( 'src' ) + '" ';
@@ -69,7 +69,7 @@
7070 // Parsed values:
7171 var src = '';
7272 var duration = '';
73 -
 73+
7474 var re = new RegExp( /videoUrl(&quot;:?\s*)*([^&]*)/ );
7575 src = re.exec( $j( '#'+vidId).html() )[2];
7676
@@ -80,8 +80,8 @@
8181 offset = re.exec( $j( '#'+vidId).html() )[2];
8282 var offset_attr = offset ? 'startOffset="' + offset + '"' : '';
8383
84 - // Rewrite that video id (do async calls to avoid locking)
85 - if( src ) {
 84+ // Rewrite that video id (do async calls to avoid locking)
 85+ if( src ) {
8686 // Replace the top div with the mv_embed based player:
8787 var vid_html = '<video id="vid_' + i +'" '+
8888 'src="' + src + '" ' +
@@ -91,13 +91,13 @@
9292 'duration="' + duration + '" ' +
9393 'style="width:' + pwidth + 'px;height:' +
9494 pheight + 'px;"></video>';
95 - //set the video tag inner html and update the height
 95+ //set the video tag inner html and update the height
9696 $j( '#' + vidId ).html( vid_html )
9797 .css('height', pheight + 30);
98 -
 98+
9999 }
100 -
101 - rewrite_by_id( 'vid_' + i );
 100+
 101+ rewrite_by_id( 'vid_' + i );
102102 }
103103 }
104104
Index: trunk/phase3/js2/editPage.js
@@ -1,9 +1,9 @@
22 /*
33 * JS2-style replacement for MediaWiki edit.js
4 - * (right now it just supports the toolbar)
 4+ * (right now it just supports the toolbar)
55 */
66
7 -// Setup configuration vars (if not set already)
 7+// Setup configuration vars (if not set already)
88 if( !mwAddMediaConfig )
99 var mwAddMediaConfig = {};
1010
@@ -15,28 +15,28 @@
1616 'default_query': wgTitle,
1717 'target_title': wgPageName,
1818 // Here we can setup the content provider overrides
19 - 'enabled_cps':['wiki_commons'],
 19+ 'enabled_cps':['wiki_commons'],
2020 // The local wiki API URL:
2121 'local_wiki_api_url': wgServer + wgScriptPath + '/api.php'
2222 };
23 -
2423
 24+
2525 js2AddOnloadHook( function() {
2626 var amwConf = $j.extend( true, defaultAddMediaConfig, mwAddMediaConfig );
2727 // kind of tricky, it would be nice to use run on ready "loader" call here
2828 if( typeof $j.wikiEditor != 'undefined' ) {
29 - setTimeout( function() {
 29+ setTimeout( function() {
3030 $j( '.wikiEditor-ui [rel=file]' ).unbind().addMediaWiz(
3131 amwConf
3232 );
3333 }, 100 );
3434 }
35 - //add to the old-toolbar all the time:
 35+ //add to the old-toolbar all the time:
3636 if( $j('#btn-add-media-wiz').length == 0 ){
3737 $j( '#toolbar' ).append( '<img style="cursor:pointer" id="btn-add-media-wiz" src="' +
3838 mv_skin_img_path + 'Button_add_media.png">' );
3939 $j( '#btn-add-media-wiz' ).addMediaWiz(
4040 amwConf
4141 );
42 - }
 42+ }
4343 });

Status & tagging log