r76901 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76900‎ | r76901 | r76902 >
Date:20:03, 17 November 2010
Author:dale
Status:deferred (Comments)
Tags:
Comment:
fixed thumb overlay for audio ( previous commit r76900 just updated the revision number )
also minor fix to domReady check
whitespace update for kplayer
Modified paths:
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerKplayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbed.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/mwEmbed.js
@@ -2571,23 +2571,16 @@
25722572 * that mwEmbed interfaces can support async built out and the include of
25732573 * jQuery.
25742574 */
2575 -var mwDomIsReady = false;
2576 -function runMwDomReady(){
2577 - mwDomIsReady = true;
2578 - if( mw.domReady ){
2579 - mw.domReady();
2580 - }
2581 -}
25822575 // Check if already ready:
25832576 if ( document.readyState === "complete" ) {
2584 - runMwDomReady();
 2577+ mw.domReady();
25852578 }
25862579
25872580 // Cleanup functions for the document ready method
25882581 if ( document.addEventListener ) {
25892582 DOMContentLoaded = function() {
25902583 document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
2591 - runMwDomReady();
 2584+ mw.domReady();
25922585 };
25932586
25942587 } else if ( document.attachEvent ) {
@@ -2596,7 +2589,7 @@
25972590 // (ticket #5443).
25982591 if ( document.readyState === "complete" ) {
25992592 document.detachEvent( "onreadystatechange", DOMContentLoaded );
2600 - runMwDomReady();
 2593+ mw.domReady();
26012594 }
26022595 };
26032596 }
@@ -2615,7 +2608,7 @@
26162609 document.attachEvent("onreadystatechange", DOMContentLoaded);
26172610
26182611 // A fallback to window.onload, that will always work
2619 - window.attachEvent( "onload", runMwDomReady );
 2612+ window.attachEvent( "onload", mw.domReady );
26202613
26212614 // If IE and not a frame
26222615 // continually check to see if the document is ready
@@ -2631,10 +2624,6 @@
26322625 }
26332626 // The DOM ready check for Internet Explorer
26342627 function doScrollCheck() {
2635 - if ( mwDomIsReady ) {
2636 - return;
2637 - }
2638 -
26392628 try {
26402629 // If IE is used, use the trick by Diego Perini
26412630 // http://javascript.nwbox.com/IEContentLoaded/
@@ -2643,9 +2632,7 @@
26442633 setTimeout( doScrollCheck, 1 );
26452634 return;
26462635 }
2647 -
2648 - // and execute any waiting functions
2649 - runMwDomReady();
 2636+ mw.domReady();
26502637 }
26512638
26522639
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -1516,7 +1516,7 @@
15171517 //
15181518 // NOTE: browsers that do support height width should set "waitForMeta"
15191519 // flag in addElement
1520 - if( ( isNaN( this.height ) && isNaN( this.width ) ) ||
 1520+ if( ( isNaN( this.height )|| isNaN( this.width ) ) ||
15211521 ( this.height == -1 || this.width == -1 ) ||
15221522 // Check for firefox defaults
15231523 // Note: ideally firefox would not do random guesses at css
@@ -1524,7 +1524,9 @@
15251525 ( (this.height == 150 || this.height == 64 ) && this.width == 300 )
15261526 ) {
15271527 var defaultSize = mw.getConfig( 'EmbedPlayer.DefaultSize' ).split( 'x' );
1528 - this.width = defaultSize[0];
 1528+ if( isNaN( this.width ) ){
 1529+ this.width = defaultSize[0];
 1530+ }
15291531
15301532 // Special height default for audio tag ( if not set )
15311533 if( element.tagName.toLowerCase() == 'audio' ) {
@@ -1532,8 +1534,7 @@
15331535 }else{
15341536 this.height = defaultSize[1];
15351537 }
1536 - }
1537 -
 1538+ }
15381539 },
15391540 /**
15401541 * Resize the player to a new size preserving aspect ratio Wraps the
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerKplayer.js
@@ -1,50 +1,49 @@
22 /*
3 -* The "kaltura player" embedPlayer interface for fallback h.264 and flv video format support
4 -*/
 3+ * The "kaltura player" embedPlayer interface for fallback h.264 and flv video format support
 4+ */
55
66 // Called from the kdp.swf
7 -function jsInterfaceReadyFunc(){
 7+function jsInterfaceReadyFunc() {
88 return true;
99 }
1010
11 -
1211 mw.EmbedPlayerKplayer = {
13 -
14 - // Instance name:
15 - instanceOf:'Kplayer',
16 -
17 - // List of supported features:
18 - supports: {
 12+
 13+ // Instance name:
 14+ instanceOf : 'Kplayer',
 15+
 16+ // List of supported features:
 17+ supports : {
1918 'playHead' : true,
20 - 'pause' : true,
 19+ 'pause' : true,
2120 'stop' : true,
2221 'timeDisplay' : true,
2322 'volumeControl' : true,
2423 'overlays' : true,
2524 'fullscreen' : true
2625 },
27 -
 26+
2827 // Stores the current time as set from flash
2928 flashCurrentTime : 0,
30 -
 29+
3130 /*
32 - * Write the Embed html to the target
33 - */
34 - doEmbedHTML : function () {
35 - var _this = this;
36 -
37 - mw.log("kPlayer:: embed src::" + _this.getSrc() );
 31+ * Write the Embed html to the target
 32+ */
 33+ doEmbedHTML : function() {
 34+ var _this = this;
 35+
 36+ mw.log("kPlayer:: embed src::" + _this.getSrc());
3837 var flashvars = {};
3938 flashvars.autoPlay = "true";
40 - var playerPath = mw.getMwEmbedPath() + 'modules/EmbedPlayer/binPlayers/kaltura-player';
41 - flashvars.entryId = mw.absoluteUrl( _this.getSrc() );
42 -
43 - // Use a relative url if the protocal is file://
44 - if( mw.parseUri( document.URL).protocol == 'file' ) {
45 - playerPath = mw.getRelativeMwEmbedPath() + 'modules/EmbedPlayer/binPlayers/kaltura-player';
46 - flashvars.entryId = _this.getSrc();
 39+ var playerPath = mw.getMwEmbedPath() + 'modules/EmbedPlayer/binPlayers/kaltura-player';
 40+ flashvars.entryId = mw.absoluteUrl(_this.getSrc());
 41+
 42+ // Use a relative url if the protocal is file://
 43+ if (mw.parseUri(document.URL).protocol == 'file') {
 44+ playerPath = mw.getRelativeMwEmbedPath() + 'modules/EmbedPlayer/binPlayers/kaltura-player';
 45+ flashvars.entryId = _this.getSrc();
4746 }
48 -
 47+
4948 flashvars.debugMode = "true";
5049 flashvars.fileSystemMode = "true";
5150 flashvars.widgetId = "_7463";
@@ -53,439 +52,456 @@
5453 flashvars.kml = "local";
5554 flashvars.kmlPath = playerPath + '/config.xml';
5655 flashvars.sourceType = "url";
57 -
58 - //flashvars.host = "www.kaltura.com";
 56+
 57+ // flashvars.host = "www.kaltura.com";
5958 flashvars.externalInterfaceDisabled = 'false';
6059 flashvars.skinPath = playerPath + '/skin.swf';
61 -
 60+
6261 flashvars["full.skinPath"] = playerPath + '/LightDoodleskin.swf';
63 -
64 - var params = { };
 62+
 63+ var params = {};
6564 params.quality = "best";
6665 params.wmode = "opaque";
6766 params.allowfullscreen = "true";
6867 params.allowscriptaccess = "always";
69 -
 68+
7069 var attributes = {};
7170 attributes.id = this.pid;
7271 attributes.name = this.pid;
73 -
 72+
7473 mw.log(" about to add the pid container");
75 - $j( this ).html(
76 - $j('<div />')
77 - .attr( 'id', this.pid + '_container' )
78 - );
79 - // call swm dom loaded function:
 74+ $j(this).html($j('<div />').attr('id', this.pid + '_container'));
 75+ // call swm dom loaded function:
8076 swfobject.callDomLoadFunctions();
81 - // Do the flash embedding with embedSWF
82 - swfobject.embedSWF(
83 - playerPath + "/kdp3.swf",
84 - this.pid + '_container',
85 - '100%',
86 - '100%',
87 - "10.0.0",
88 - playerPath + "/expressInstall.swf",
89 - flashvars,
90 - params,
91 - attributes
92 - );
93 -
 77+ // Do the flash embedding with embedSWF
 78+ swfobject.embedSWF(playerPath + "/kdp3.swf", this.pid + '_container',
 79+ '100%', '100%', "10.0.0", playerPath + "/expressInstall.swf",
 80+ flashvars, params, attributes);
 81+
9482 // Direct object embed
95 - /*$j( this ).html(
96 - '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">'+
97 - '<param name="movie" value="myContent.swf" />'+
98 - '<!--[if !IE]>-->'+
99 - '<object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420">'+
100 - '<!--<![endif]-->'+
101 - '<p> error with flash embed</p>'
102 - '<!--[if !IE]>-->'+
103 - '</object>'+
104 - '<!--<![endif]-->'+
105 - '</object>'
106 - )*/
107 -
108 - setTimeout( function() {
109 - _this.postEmbedJS();
110 - }, 100 );
111 -
 83+ /*
 84+ * $j( this ).html( '<object
 85+ * classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780"
 86+ * height="420">'+ '<param name="movie" value="myContent.swf" />'+ '<!--[if
 87+ * !IE]>-->'+ '<object type="application/x-shockwave-flash"
 88+ * data="myContent.swf" width="780" height="420">'+ '<!--<![endif]-->'+ '<p>
 89+ * error with flash embed</p>' '<!--[if !IE]>-->'+ '</object>'+ '<!--<![endif]-->'+ '</object>' )
 90+ */
 91+
 92+ setTimeout(function() {
 93+ _this.postEmbedJS();
 94+ }, 100);
 95+
11296 // Flash player loses its bindings once it changes sizes::
113 - $j( _this ).bind ( 'closeFullScreenEvent', function(){
 97+ $j(_this).bind('closeFullScreenEvent', function() {
11498 _this.postEmbedJS();
11599 });
116 - $j( _this ).bind ( 'openFullScreenEvent', function(){
 100+ $j(_this).bind('openFullScreenEvent', function() {
117101 _this.postEmbedJS();
118102 })
119 -
120 - },
121 -
 103+
 104+ },
 105+
122106 /**
123 - * javascript run post player embedding
124 - */
125 - postEmbedJS:function() {
 107+ * javascript run post player embedding
 108+ */
 109+ postEmbedJS : function() {
126110 var _this = this;
127 - this.getPlayerElement();
128 -
129 - if( this.playerElement && this.playerElement.addJsListener ) {
130 -
131 - // Add KDP listeners
132 - _this.bindPlayerFunction( 'doPause', 'onPause' );
133 - _this.bindPlayerFunction( 'doPlay', 'onPlay' );
134 - _this.bindPlayerFunction( 'durationChange', 'onDurationChange');
135 - _this.bindPlayerFunction( 'playerPlayEnd', 'onClipDone' );
136 - _this.bindPlayerFunction( 'playerUpdatePlayhead', 'onUpdatePlayhead' );
137 -
138 - // Buffering
139 - _this.bindPlayerFunction( 'bytesTotalChange', "onBytesTotalChange" );
140 - _this.bindPlayerFunction( 'bytesDownloadedChange', "onBytesDownloadedChange" );
141 -
 111+ this.getPlayerElement();
 112+
 113+ var bindEventMap = {
 114+ 'doPause' : 'onPause',
 115+ 'doPlay' : 'onPlay',
 116+ 'durationChange' : 'onDurationChange',
 117+ 'playerPlayEnd' : 'onClipDone',
 118+ 'playerUpdatePlayhead' : 'onUpdatePlayhead',
 119+ 'bytesTotalChange' : 'onBytesTotalChange',
 120+ 'bytesDownloadedChange' : 'onBytesDownloadedChange'
 121+ }
 122+
 123+ if (this.playerElement && this.playerElement.addJsListener) {
 124+ $j.each(bindEventMap, function(bindName, localMethod) {
 125+ _this.bindPlayerFunction(bindName, localMethod);
 126+ });
142127 // Start the monitor
143128 this.monitor();
144 - }else{
 129+ } else {
145130 // Keep trying to get the player element
146 - //mw.log('insert media: not defined:' + typeof this.playerElement.insertMedia );
147 - setTimeout( function() {
 131+ // mw.log('insert media: not defined:' + typeof
 132+ // this.playerElement.insertMedia );
 133+ setTimeout(function() {
148134 _this.postEmbedJS();
149135 }, 250);
150 - }
151 - },
152 -
 136+ }
 137+ },
 138+
153139 /**
154 - * Bind a Player Function,
155 - *
156 - * Does some tricker to bind to "this" player instance:
157 - *
158 - * @param {String} flash binding name
159 - * @param {String} function callback name
160 - */
161 - bindPlayerFunction: function( bName, fName ) {
162 - var cbid = fName + '_cb_' + this.id.replace(' ', '_');
163 - eval( 'window[ \'' + cbid +'\' ] = function( data ) {$j(\'#' + this.id + '\').get(0).'+ fName +'( data );}' );
164 - this.playerElement.addJsListener( bName , cbid);
 140+ * Bind a Player Function,
 141+ *
 142+ * Does some tricker to bind to "this" player instance:
 143+ *
 144+ * @param {String}
 145+ * flash binding name
 146+ * @param {String}
 147+ * function callback name
 148+ */
 149+ bindPlayerFunction : function(bindName, methodName) {
 150+ // The kaltura kdp can only call a global function by given name
 151+ var gKdpCallbackName = methodName + '_cb_' + this.id;
 152+
 153+ // Create an anonymous function with local player scope
 154+ var createGlobalCB = function(cName, embedPlayer) {
 155+ window[cName] = function(data) {
 156+ if (embedPlayer._propagateEvents) {
 157+ embedPlayer[methodName](data);
 158+ }
 159+ };
 160+ }(gKdpCallbackName, this);
 161+
 162+ // Add the listener to the KDP flash player:
 163+ this.playerElement.addJsListener(bindName, gKdpCallbackName);
165164 },
166 -
 165+
167166 /**
168 - * on Pause callback from the kaltura flash player
169 - * calls parent_pause to update the interface
170 - */
171 - onPause: function() {
 167+ * on Pause callback from the kaltura flash player calls parent_pause to
 168+ * update the interface
 169+ */
 170+ onPause : function() {
172171 this.parent_pause();
173172 },
174 -
 173+
175174 /**
176 - * onPlay function callback from the kaltura flash player
177 - * directly call the parent_play
 175+ * onPlay function callback from the kaltura flash player directly call the
 176+ * parent_play
178177 */
179 - onPlay: function(){
 178+ onPlay : function() {
180179 this.parent_play();
181180 },
182 -
183 - onDurationChange: function(data, id) {
 181+
 182+ onDurationChange : function(data, id) {
184183 mw.log(" onDurationChange: " + data.newValue);
185 - // update the duration:
 184+ // update the duration:
186185 this.duration = data.newValue;
187186 },
188 -
 187+
189188 /**
190 - * play method
191 - * calls parent_play to update the interface
192 - */
193 - play: function() {
194 - if( this.playerElement && this.playerElement.sendNotification ){
195 - this.playerElement.sendNotification( 'doPlay' );
 189+ * play method calls parent_play to update the interface
 190+ */
 191+ play : function() {
 192+ if (this.playerElement && this.playerElement.sendNotification) {
 193+ this.playerElement.sendNotification('doPlay');
196194 }
197195 this.parent_play();
198196 },
199 -
 197+
200198 /**
201 - * pause method
202 - * calls parent_pause to update the interface
203 - */
204 - pause: function() {
205 - if( this.playerElement && this.playerElement.sendNotification ){
 199+ * pause method calls parent_pause to update the interface
 200+ */
 201+ pause : function() {
 202+ if (this.playerElement && this.playerElement.sendNotification) {
206203 this.playerElement.sendNotification('doPause');
207204 }
208205 this.parent_pause();
209206 },
210 -
 207+
211208 /**
212 - * Issues a seek to the playerElement
213 - * @param {Float} percentage Percentage of total stream length to seek to
214 - */
215 - doSeek: function( percentage ) {
 209+ * Issues a seek to the playerElement
 210+ *
 211+ * @param {Float}
 212+ * percentage Percentage of total stream length to seek to
 213+ */
 214+ doSeek : function(percentage) {
216215 var _this = this;
217 - if ( this.supportsURLTimeEncoding() ){
218 -
219 - // Make sure we could not do a local seek instead:
220 - if ( !( percentage < this.bufferedPercent && this.playerElement.duration && !this.didSeekJump )) {
221 - // We support URLTimeEncoding call parent seek:
222 - this.parent_doSeek( percentage );
 216+ if (this.supportsURLTimeEncoding()) {
 217+
 218+ // Make sure we could not do a local seek instead:
 219+ if (!(percentage < this.bufferedPercent
 220+ && this.playerElement.duration && !this.didSeekJump)) {
 221+ // We support URLTimeEncoding call parent seek:
 222+ this.parent_doSeek(percentage);
223223 return;
224224 }
225 - }
 225+ }
226226
227 - if( this.playerElement ) {
228 - var seekTime = percentage * this.getDuration();
 227+ if (this.playerElement) {
 228+ var seekTime = percentage * this.getDuration();
229229 // Issue the seek to the flash player:
230230 this.playerElement.sendNotification('doSeek', seekTime);
231 -
 231+
232232 // Kdp is missing seek done callback
233233 setTimeout(function() {
234 - _this.seeking= false;
235 - },500);
 234+ _this.seeking = false;
 235+ }, 500);
236236 } else {
237 - // try to do a play then seek:
238 - this.doPlayThenSeek( percentage )
239 - }
 237+ // try to do a play then seek:
 238+ this.doPlayThenSeek(percentage)
 239+ }
240240 // Run the onSeeking interface update
241 - this.controlBuilder.onSeek();
 241+ this.controlBuilder.onSeek();
242242 },
243 -
 243+
244244 /**
245 - * Seek in a existing stream
246 - *
247 - * @param {Float} percentage Percentage of the stream to seek to between 0 and 1
248 - */
249 - doPlayThenSeek: function( percentage ) {
250 - mw.log( 'flash::doPlayThenSeek::' );
 245+ * Seek in a existing stream
 246+ *
 247+ * @param {Float}
 248+ * percentage Percentage of the stream to seek to between 0 and 1
 249+ */
 250+ doPlayThenSeek : function(percentage) {
 251+ mw.log('flash::doPlayThenSeek::');
251252 var _this = this;
252253 // issue the play request
253 - this.play();
254 -
255 - // let the player know we are seeking
256 - _this.seeking = true;
257 -
258 - var getPlayerCount = 0;
259 - var readyForSeek = function() {
260 - _this.getPlayerElement();
261 - // if we have duration then we are ready to do the seek ( flash can't seek untill there is some buffer )
262 - if ( _this.playerElement && _this.playerElement.sendNotification && _this.getDuration() && _this.bufferedPercent ) {
263 - var seekTime = percentage * _this.getDuration();
264 - // Issue the seek to the flash player:
265 - _this.playerElement.sendNotification('doSeek', seekTime);
 254+ this.play();
 255+
 256+ // let the player know we are seeking
 257+ _this.seeking = true;
 258+
 259+ var getPlayerCount = 0;
 260+ var readyForSeek = function() {
 261+ _this.getPlayerElement();
 262+ // if we have duration then we are ready to do the seek ( flash can't
 263+ // seek untill there is some buffer )
 264+ if (_this.playerElement && _this.playerElement.sendNotification
 265+ && _this.getDuration() && _this.bufferedPercent) {
 266+ var seekTime = percentage * _this.getDuration();
 267+ // Issue the seek to the flash player:
 268+ _this.playerElement.sendNotification('doSeek', seekTime);
 269+ } else {
 270+ // Try to get player for 20 seconds:
 271+ if (getPlayerCount < 400) {
 272+ setTimeout(readyForSeek, 50);
 273+ getPlayerCount++;
266274 } else {
267 - // Try to get player for 20 seconds:
268 - if ( getPlayerCount < 400 ) {
269 - setTimeout( readyForSeek, 50 );
270 - getPlayerCount++;
271 - } else {
272 - mw.log( 'Error:doPlayThenSeek failed' );
273 - }
 275+ mw.log('Error:doPlayThenSeek failed');
274276 }
275277 }
276 - readyForSeek();
277 - },
278 -
279 - /**
280 - * Issues a volume update to the playerElement
281 - * @param {Float} percentage Percentage to update volume to
282 - */
283 - setPlayerElementVolume: function( percentage ) {
284 - if( this.playerElement && this.playerElement.sendNotification ){
285 - this.playerElement.sendNotification('changeVolume', percentage);
286 - }
287 - },
288 -
289 - /**
290 - * function called by flash at set interval to update the playhead.
291 - */
292 - onUpdatePlayhead : function ( playheadValue ){
293 - this.flashCurrentTime = playheadValue;
294 - },
295 -
296 - /**
297 - * function called by flash when the total media size changes
298 - */
299 - onBytesTotalChange: function(data, id) {
300 - this.bytesTotal = data.newValue ;
301 - },
302 -
303 - /**
304 - * function called by flash applet when download bytes changes
305 - */
306 - onBytesDownloadedChange: function( data, id){
307 - mw.log( 'onBytesDownloadedChange');
308 - this.bytesLoaded = data.newValue;
309 - this.bufferedPercent = this.bytesLoaded / this.bytesTotal;
310 -
311 - // Fire the parent html5 action
312 - $j( this ).trigger( 'progress', {
313 - 'loaded' : this.bytesLoaded,
314 - 'total' : this.bytesTotal
315 - } );
316 - },
317 -
318 - /**
319 - * Get the embed player time
320 - */
321 - getPlayerElementTime: function(){
322 - // update currentTime
323 - return this.flashCurrentTime;
324 - },
325 -
326 - /**
327 - * Get the embed fla object player Element
328 - */
329 - getPlayerElement: function () {
330 - this.playerElement = document.getElementById( this.pid );
331 - return this.playerElement;
332278 }
 279+ readyForSeek();
 280+},
 281+
 282+/**
 283+ * Issues a volume update to the playerElement
 284+ *
 285+ * @param {Float}
 286+ * percentage Percentage to update volume to
 287+ */
 288+setPlayerElementVolume : function(percentage) {
 289+ if (this.playerElement && this.playerElement.sendNotification) {
 290+ this.playerElement.sendNotification('changeVolume', percentage);
 291+ }
 292+},
 293+
 294+/**
 295+ * function called by flash at set interval to update the playhead.
 296+ */
 297+onUpdatePlayhead : function(playheadValue) {
 298+ this.flashCurrentTime = playheadValue;
 299+},
 300+
 301+/**
 302+ * function called by flash when the total media size changes
 303+ */
 304+onBytesTotalChange : function(data, id) {
 305+ this.bytesTotal = data.newValue;
 306+},
 307+
 308+/**
 309+ * function called by flash applet when download bytes changes
 310+ */
 311+onBytesDownloadedChange : function(data, id) {
 312+ mw.log('onBytesDownloadedChange');
 313+ this.bytesLoaded = data.newValue;
 314+ this.bufferedPercent = this.bytesLoaded / this.bytesTotal;
 315+
 316+ // Fire the parent html5 action
 317+ $j(this).trigger('progress', {
 318+ 'loaded' : this.bytesLoaded,
 319+ 'total' : this.bytesTotal
 320+ });
 321+},
 322+
 323+/**
 324+ * Get the embed player time
 325+ */
 326+getPlayerElementTime : function() {
 327+ // update currentTime
 328+ return this.flashCurrentTime;
 329+},
 330+
 331+/**
 332+ * Get the embed fla object player Element
 333+ */
 334+getPlayerElement : function() {
 335+ this.playerElement = document.getElementById(this.pid);
 336+ return this.playerElement;
333337 }
 338+}
334339
335340 /**
336 -* function called once player is ready.
337 -*
338 -* NOTE: playerID is not always passed so we can't use this:
339 -*/
340 -function onKdpReady( playerId ) {
341 - mw.log( "player is ready::" + playerId);
 341+ * function called once player is ready.
 342+ *
 343+ * NOTE: playerID is not always passed so we can't use this:
 344+ */
 345+function onKdpReady(playerId) {
 346+ mw.log("player is ready::" + playerId);
342347 }
343348
 349+/*
 350+ * ! SWFObject v2.2 <http://code.google.com/p/swfobject/> is released under the
 351+ * MIT License <http://www.opensource.org/licenses/mit-license.php>
 352+ */
344353
 354+var swfobject = function() {
345355
346 -/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
347 - is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
348 -*/
 356+ var UNDEF = "undefined", OBJECT = "object", SHOCKWAVE_FLASH = "Shockwave Flash", SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", FLASH_MIME_TYPE = "application/x-shockwave-flash", EXPRESS_INSTALL_ID = "SWFObjectExprInst", ON_READY_STATE_CHANGE = "onreadystatechange",
349357
350 -var swfobject = function() {
351 -
352 - var UNDEF = "undefined",
353 - OBJECT = "object",
354 - SHOCKWAVE_FLASH = "Shockwave Flash",
355 - SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
356 - FLASH_MIME_TYPE = "application/x-shockwave-flash",
357 - EXPRESS_INSTALL_ID = "SWFObjectExprInst",
358 - ON_READY_STATE_CHANGE = "onreadystatechange",
359 -
360 - win = window,
361 - doc = document,
362 - nav = navigator,
363 -
364 - plugin = false,
365 - domLoadFnArr = [main],
366 - regObjArr = [],
367 - objIdArr = [],
368 - listenersArr = [],
369 - storedAltContent,
370 - storedAltContentId,
371 - storedCallbackFn,
372 - storedCallbackObj,
373 - isDomLoaded = false,
374 - isExpressInstallActive = false,
375 - dynamicStylesheet,
376 - dynamicStylesheetMedia,
377 - autoHideShow = true,
378 -
379 - /* Centralized function for browser feature detection
380 - - User agent string detection is only used when no good alternative is possible
381 - - Is executed directly for optimal performance
382 - */
 358+ win = window, doc = document, nav = navigator,
 359+
 360+ plugin = false, domLoadFnArr = [ main ], regObjArr = [], objIdArr = [], listenersArr = [], storedAltContent, storedAltContentId, storedCallbackFn, storedCallbackObj, isDomLoaded = false, isExpressInstallActive = false, dynamicStylesheet, dynamicStylesheetMedia, autoHideShow = true,
 361+
 362+ /*
 363+ * Centralized function for browser feature detection - User agent string
 364+ * detection is only used when no good alternative is possible - Is executed
 365+ * directly for optimal performance
 366+ */
383367 ua = function() {
384 - var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
385 - u = nav.userAgent.toLowerCase(),
386 - p = nav.platform.toLowerCase(),
387 - windows = p ? /win/.test(p) : /win/.test(u),
388 - mac = p ? /mac/.test(p) : /mac/.test(u),
389 - webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
390 - ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
391 - playerVersion = [0,0,0],
392 - d = null;
393 - if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
 368+ var w3cdom = typeof doc.getElementById != UNDEF
 369+ && typeof doc.getElementsByTagName != UNDEF
 370+ && typeof doc.createElement != UNDEF, u = nav.userAgent
 371+ .toLowerCase(), p = nav.platform.toLowerCase(), windows = p ? /win/
 372+ .test(p)
 373+ : /win/.test(u), mac = p ? /mac/.test(p) : /mac/.test(u), webkit = /webkit/
 374+ .test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,
 375+ "$1")) : false, // returns either the webkit version or false if
 376+ // not webkit
 377+ ie = !+"\v1", // feature detection based on Andrea Giammarchi's
 378+ // solution:
 379+ // http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
 380+ playerVersion = [ 0, 0, 0 ], d = null;
 381+ if (typeof nav.plugins != UNDEF
 382+ && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
394383 d = nav.plugins[SHOCKWAVE_FLASH].description;
395 - if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
 384+ if (d
 385+ && !(typeof nav.mimeTypes != UNDEF
 386+ && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin
 387+ // indicates
 388+ // whether
 389+ // plug-ins
 390+ // are
 391+ // enabled
 392+ // or
 393+ // disabled
 394+ // in
 395+ // Safari
 396+ // 3+
396397 plugin = true;
397398 ie = false; // cascaded feature detection for Internet Explorer
398399 d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
399400 playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
400 - playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
401 - playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
 401+ playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"),
 402+ 10);
 403+ playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(
 404+ /^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
402405 }
403 - }
404 - else if (typeof win.ActiveXObject != UNDEF) {
 406+ } else if (typeof win.ActiveXObject != UNDEF) {
405407 try {
406408 var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
407409 if (a) { // a will return null when ActiveX is disabled
408410 d = a.GetVariable("$version");
409411 if (d) {
410 - ie = true; // cascaded feature detection for Internet Explorer
 412+ ie = true; // cascaded feature detection for Internet
 413+ // Explorer
411414 d = d.split(" ")[1].split(",");
412 - playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
 415+ playerVersion = [ parseInt(d[0], 10),
 416+ parseInt(d[1], 10), parseInt(d[2], 10) ];
413417 }
414418 }
 419+ } catch (e) {
415420 }
416 - catch(e) {}
417421 }
418 - return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
 422+ return {
 423+ w3 : w3cdom,
 424+ pv : playerVersion,
 425+ wk : webkit,
 426+ ie : ie,
 427+ win : windows,
 428+ mac : mac
 429+ };
419430 }();
420 -
421 -
 431+
422432 function callDomLoadFunctions() {
423 - if (isDomLoaded) { return; }
424 - try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
425 - var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
 433+ if (isDomLoaded) {
 434+ return;
 435+ }
 436+ try { // test if we can really add/remove elements to/from the DOM; we
 437+ // don't want to fire it too early
 438+ var t = doc.getElementsByTagName("body")[0]
 439+ .appendChild(createElement("span"));
426440 t.parentNode.removeChild(t);
 441+ } catch (e) {
 442+ return;
427443 }
428 - catch (e) { return; }
429444 isDomLoaded = true;
430445 var dl = domLoadFnArr.length;
431 - for (var i = 0; i < dl; i++) {
 446+ for ( var i = 0; i < dl; i++) {
432447 domLoadFnArr[i]();
433448 }
434449 }
435 -
 450+
436451 function addDomLoadEvent(fn) {
437452 if (isDomLoaded) {
438453 fn();
 454+ } else {
 455+ domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only
 456+ // available in IE5.5+
439457 }
440 - else {
441 - domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
442 - }
443458 }
444 -
445 - /* Cross-browser onload
446 - - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
447 - - Will fire an event as soon as a web page including all of its assets are loaded
 459+
 460+ /*
 461+ * Cross-browser onload - Based on James Edwards' solution:
 462+ * http://brothercake.com/site/resources/scripts/onload/ - Will fire an
 463+ * event as soon as a web page including all of its assets are loaded
448464 */
449465 function addLoadEvent(fn) {
450466 if (typeof win.addEventListener != UNDEF) {
451467 win.addEventListener("load", fn, false);
452 - }
453 - else if (typeof doc.addEventListener != UNDEF) {
 468+ } else if (typeof doc.addEventListener != UNDEF) {
454469 doc.addEventListener("load", fn, false);
455 - }
456 - else if (typeof win.attachEvent != UNDEF) {
 470+ } else if (typeof win.attachEvent != UNDEF) {
457471 addListener(win, "onload", fn);
458 - }
459 - else if (typeof win.onload == "function") {
 472+ } else if (typeof win.onload == "function") {
460473 var fnOld = win.onload;
461474 win.onload = function() {
462475 fnOld();
463476 fn();
464477 };
465 - }
466 - else {
 478+ } else {
467479 win.onload = fn;
468480 }
469481 }
470 -
471 - /* Main function
472 - - Will preferably execute onDomLoad, otherwise onload (as a fallback)
473 - */
474 - function main() {
 482+
 483+ /*
 484+ * Main function - Will preferably execute onDomLoad, otherwise onload (as a
 485+ * fallback)
 486+ */
 487+ function main() {
475488 if (plugin) {
476489 testPlayerVersion();
477 - }
478 - else {
 490+ } else {
479491 matchVersions();
480492 }
481493 }
482 -
483 - /* Detect the Flash Player version for non-Internet Explorer browsers
484 - - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
485 - a. Both release and build numbers can be detected
486 - b. Avoid wrong descriptions by corrupt installers provided by Adobe
487 - c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
488 - - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
489 - */
 494+
 495+ /*
 496+ * Detect the Flash Player version for non-Internet Explorer browsers -
 497+ * Detecting the plug-in version via the object element is more precise than
 498+ * using the plugins collection item's description: a. Both release and
 499+ * build numbers can be detected b. Avoid wrong descriptions by corrupt
 500+ * installers provided by Adobe c. Avoid wrong descriptions by multiple
 501+ * Flash Player entries in the plugin Array, caused by incorrect browser
 502+ * imports - Disadvantage of this method is that it depends on the
 503+ * availability of the DOM, while the plugins collection is immediately
 504+ * available
 505+ */
490506 function testPlayerVersion() {
491507 var b = doc.getElementsByTagName("body")[0];
492508 var o = createElement(OBJECT);
@@ -493,19 +509,19 @@
494510 var t = b.appendChild(o);
495511 if (t) {
496512 var counter = 0;
497 - (function(){
 513+ (function() {
498514 if (typeof t.GetVariable != UNDEF) {
499 - try{
 515+ try {
500516 var d = t.GetVariable("$version");
501517 if (d) {
502518 d = d.split(" ")[1].split(",");
503 - ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
 519+ ua.pv = [ parseInt(d[0], 10), parseInt(d[1], 10),
 520+ parseInt(d[2], 10) ];
504521 }
505 - } catch( e ){
506 - // error in grabbing flash version
 522+ } catch (e) {
 523+ // error in grabbing flash version
507524 }
508 - }
509 - else if (counter < 10) {
 525+ } else if (counter < 10) {
510526 counter++;
511527 setTimeout(arguments.callee, 10);
512528 return;
@@ -514,61 +530,91 @@
515531 t = null;
516532 matchVersions();
517533 })();
518 - }
519 - else {
 534+ } else {
520535 matchVersions();
521536 }
522537 }
523 -
524 - /* Perform Flash Player and SWF version matching; static publishing only
525 - */
 538+
 539+ /*
 540+ * Perform Flash Player and SWF version matching; static publishing only
 541+ */
526542 function matchVersions() {
527543 var rl = regObjArr.length;
528544 if (rl > 0) {
529 - for (var i = 0; i < rl; i++) { // for each registered object element
 545+ for ( var i = 0; i < rl; i++) { // for each registered object
 546+ // element
530547 var id = regObjArr[i].id;
531548 var cb = regObjArr[i].callbackFn;
532 - var cbObj = {success:false, id:id};
 549+ var cbObj = {
 550+ success : false,
 551+ id : id
 552+ };
533553 if (ua.pv[0] > 0) {
534554 var obj = getElementById(id);
535555 if (obj) {
536 - if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
 556+ if (hasPlayerVersion(regObjArr[i].swfVersion)
 557+ && !(ua.wk && ua.wk < 312)) { // Flash Player
 558+ // version >=
 559+ // published SWF
 560+ // version:
 561+ // Houston, we
 562+ // have a match!
537563 setVisibility(id, true);
538564 if (cb) {
539565 cbObj.success = true;
540566 cbObj.ref = getObjectById(id);
541567 cb(cbObj);
542568 }
543 - }
544 - else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
 569+ } else if (regObjArr[i].expressInstall
 570+ && canExpressInstall()) { // show the Adobe
 571+ // Express Install
 572+ // dialog if set by
 573+ // the web page
 574+ // author and if
 575+ // supported
545576 var att = {};
546577 att.data = regObjArr[i].expressInstall;
547578 att.width = obj.getAttribute("width") || "0";
548579 att.height = obj.getAttribute("height") || "0";
549 - if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
550 - if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
551 - // parse HTML object param element's name-value pairs
 580+ if (obj.getAttribute("class")) {
 581+ att.styleclass = obj.getAttribute("class");
 582+ }
 583+ if (obj.getAttribute("align")) {
 584+ att.align = obj.getAttribute("align");
 585+ }
 586+ // parse HTML object param element's name-value
 587+ // pairs
552588 var par = {};
553589 var p = obj.getElementsByTagName("param");
554590 var pl = p.length;
555 - for (var j = 0; j < pl; j++) {
 591+ for ( var j = 0; j < pl; j++) {
556592 if (p[j].getAttribute("name").toLowerCase() != "movie") {
557 - par[p[j].getAttribute("name")] = p[j].getAttribute("value");
 593+ par[p[j].getAttribute("name")] = p[j]
 594+ .getAttribute("value");
558595 }
559596 }
560597 showExpressInstall(att, par, id, cb);
561 - }
562 - else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
 598+ } else { // Flash Player and SWF version mismatch or
 599+ // an older Webkit engine that ignores the
 600+ // HTML object element's nested param
 601+ // elements: display alternative content
 602+ // instead of SWF
563603 displayAltContent(obj);
564 - if (cb) { cb(cbObj); }
 604+ if (cb) {
 605+ cb(cbObj);
 606+ }
565607 }
566608 }
567 - }
568 - else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
 609+ } else { // if no Flash Player is installed or the fp version
 610+ // cannot be detected we let the HTML object element
 611+ // do its job (either show a SWF or alternative
 612+ // content)
569613 setVisibility(id, true);
570614 if (cb) {
571 - var o = getObjectById(id); // test whether there is an HTML object element or not
572 - if (o && typeof o.SetVariable != UNDEF) {
 615+ var o = getObjectById(id); // test whether there is an
 616+ // HTML object element or
 617+ // not
 618+ if (o && typeof o.SetVariable != UNDEF) {
573619 cbObj.success = true;
574620 cbObj.ref = o;
575621 }
@@ -578,15 +624,14 @@
579625 }
580626 }
581627 }
582 -
 628+
583629 function getObjectById(objectIdStr) {
584630 var r = null;
585631 var o = getElementById(objectIdStr);
586632 if (o && o.nodeName == "OBJECT") {
587633 if (typeof o.SetVariable != UNDEF) {
588634 r = o;
589 - }
590 - else {
 635+ } else {
591636 var n = o.getElementsByTagName(OBJECT)[0];
592637 if (n) {
593638 r = n;
@@ -595,59 +640,77 @@
596641 }
597642 return r;
598643 }
599 -
600 - /* Requirements for Adobe Express Install
601 - - only one instance can be active at a time
602 - - fp 6.0.65 or higher
603 - - Win/Mac OS only
604 - - no Webkit engines older than version 312
605 - */
 644+
 645+ /*
 646+ * Requirements for Adobe Express Install - only one instance can be active
 647+ * at a time - fp 6.0.65 or higher - Win/Mac OS only - no Webkit engines
 648+ * older than version 312
 649+ */
606650 function canExpressInstall() {
607 - return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
 651+ return !isExpressInstallActive && hasPlayerVersion("6.0.65")
 652+ && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
608653 }
609 -
610 - /* Show the Adobe Express Install dialog
611 - - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
612 - */
 654+
 655+ /*
 656+ * Show the Adobe Express Install dialog - Reference:
 657+ * http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
 658+ */
613659 function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
614660 isExpressInstallActive = true;
615661 storedCallbackFn = callbackFn || null;
616 - storedCallbackObj = {success:false, id:replaceElemIdStr};
 662+ storedCallbackObj = {
 663+ success : false,
 664+ id : replaceElemIdStr
 665+ };
617666 var obj = getElementById(replaceElemIdStr);
618667 if (obj) {
619668 if (obj.nodeName == "OBJECT") { // static publishing
620669 storedAltContent = abstractAltContent(obj);
621670 storedAltContentId = null;
622 - }
623 - else { // dynamic publishing
 671+ } else { // dynamic publishing
624672 storedAltContent = obj;
625673 storedAltContentId = replaceElemIdStr;
626674 }
627675 att.id = EXPRESS_INSTALL_ID;
628 - if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
629 - if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
 676+ if (typeof att.width == UNDEF
 677+ || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) {
 678+ att.width = "310";
 679+ }
 680+ if (typeof att.height == UNDEF
 681+ || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) {
 682+ att.height = "137";
 683+ }
630684 doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
631 - var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
632 - fv = "MMredirectURL=" + win.location.toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
 685+ var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", fv = "MMredirectURL="
 686+ + win.location.toString().replace(/&/g, "%26")
 687+ + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
633688 if (typeof par.flashvars != UNDEF) {
634689 par.flashvars += "&" + fv;
635 - }
636 - else {
 690+ } else {
637691 par.flashvars = fv;
638692 }
639 - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
640 - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
 693+ // IE only: when a SWF is loading (AND: not available in cache) wait
 694+ // for the readyState of the object element to become 4 before
 695+ // removing it,
 696+ // because you cannot properly cancel a loading SWF file without
 697+ // breaking browser load references, also obj.onreadystatechange
 698+ // doesn't work
641699 if (ua.ie && ua.win && obj.readyState != 4) {
642700 var newObj = createElement("div");
643701 replaceElemIdStr += "SWFObjectNew";
644702 newObj.setAttribute("id", replaceElemIdStr);
645 - obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
 703+ obj.parentNode.insertBefore(newObj, obj); // insert
 704+ // placeholder div
 705+ // that will be
 706+ // replaced by the
 707+ // object element
 708+ // that loads
 709+ // expressinstall.swf
646710 obj.style.display = "none";
647 - (function(){
 711+ (function() {
648712 if (obj.readyState == 4) {
649713 obj.parentNode.removeChild(obj);
650 - }
651 - else {
 714+ } else {
652715 setTimeout(arguments.callee, 10);
653716 }
654717 })();
@@ -655,44 +718,49 @@
656719 createSWF(att, par, replaceElemIdStr);
657720 }
658721 }
659 -
660 - /* Functions to abstract and display alternative content
661 - */
 722+
 723+ /*
 724+ * Functions to abstract and display alternative content
 725+ */
662726 function displayAltContent(obj) {
663727 if (ua.ie && ua.win && obj.readyState != 4) {
664 - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
665 - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
 728+ // IE only: when a SWF is loading (AND: not available in cache) wait
 729+ // for the readyState of the object element to become 4 before
 730+ // removing it,
 731+ // because you cannot properly cancel a loading SWF file without
 732+ // breaking browser load references, also obj.onreadystatechange
 733+ // doesn't work
666734 var el = createElement("div");
667 - obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
 735+ obj.parentNode.insertBefore(el, obj); // insert placeholder div
 736+ // that will be replaced by
 737+ // the alternative content
668738 el.parentNode.replaceChild(abstractAltContent(obj), el);
669739 obj.style.display = "none";
670 - (function(){
 740+ (function() {
671741 if (obj.readyState == 4) {
672742 obj.parentNode.removeChild(obj);
673 - }
674 - else {
 743+ } else {
675744 setTimeout(arguments.callee, 10);
676745 }
677746 })();
678 - }
679 - else {
 747+ } else {
680748 obj.parentNode.replaceChild(abstractAltContent(obj), obj);
681749 }
682 - }
 750+ }
683751
684752 function abstractAltContent(obj) {
685753 var ac = createElement("div");
686754 if (ua.win && ua.ie) {
687755 ac.innerHTML = obj.innerHTML;
688 - }
689 - else {
 756+ } else {
690757 var nestedObj = obj.getElementsByTagName(OBJECT)[0];
691758 if (nestedObj) {
692759 var c = nestedObj.childNodes;
693760 if (c) {
694761 var cl = c.length;
695 - for (var i = 0; i < cl; i++) {
696 - if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
 762+ for ( var i = 0; i < cl; i++) {
 763+ if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM")
 764+ && !(c[i].nodeType == 8)) {
697765 ac.appendChild(c[i].cloneNode(true));
698766 }
699767 }
@@ -701,56 +769,95 @@
702770 }
703771 return ac;
704772 }
705 -
706 - /* Cross-browser dynamic SWF creation
707 - */
 773+
 774+ /*
 775+ * Cross-browser dynamic SWF creation
 776+ */
708777 function createSWF(attObj, parObj, id) {
709778 var r, el = getElementById(id);
710 - if (ua.wk && ua.wk < 312) { return r; }
 779+ if (ua.wk && ua.wk < 312) {
 780+ return r;
 781+ }
711782 if (el) {
712 - if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
 783+ if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the
 784+ // object element, it will
 785+ // inherit the 'id' from the
 786+ // alternative content
713787 attObj.id = id;
714788 }
715 - if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
 789+ if (ua.ie && ua.win) { // Internet Explorer + the HTML object
 790+ // element + W3C DOM methods do not combine:
 791+ // fall back to outerHTML
716792 var att = "";
717 - for (var i in attObj) {
718 - if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
 793+ for ( var i in attObj) {
 794+ if (attObj[i] != Object.prototype[i]) { // filter out
 795+ // prototype
 796+ // additions from
 797+ // other potential
 798+ // libraries
719799 if (i.toLowerCase() == "data") {
720800 parObj.movie = attObj[i];
721 - }
722 - else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
 801+ } else if (i.toLowerCase() == "styleclass") { // 'class'
 802+ // is an
 803+ // ECMA4
 804+ // reserved
 805+ // keyword
723806 att += ' class="' + attObj[i] + '"';
724 - }
725 - else if (i.toLowerCase() != "classid") {
 807+ } else if (i.toLowerCase() != "classid") {
726808 att += ' ' + i + '="' + attObj[i] + '"';
727809 }
728810 }
729811 }
730812 var par = "";
731 - for (var j in parObj) {
732 - if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
733 - par += '<param name="' + j + '" value="' + parObj[j] + '" />';
 813+ for ( var j in parObj) {
 814+ if (parObj[j] != Object.prototype[j]) { // filter out
 815+ // prototype
 816+ // additions from
 817+ // other potential
 818+ // libraries
 819+ par += '<param name="' + j + '" value="' + parObj[j]
 820+ + '" />';
734821 }
735822 }
736 - el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
737 - objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
738 - r = getElementById(attObj.id);
739 - }
740 - else { // well-behaving browsers
 823+ el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
 824+ + att + '>' + par + '</object>';
 825+ objIdArr[objIdArr.length] = attObj.id; // stored to fix object
 826+ // 'leaks' on unload
 827+ // (dynamic publishing
 828+ // only)
 829+ r = getElementById(attObj.id);
 830+ } else { // well-behaving browsers
741831 var o = createElement(OBJECT);
742832 o.setAttribute("type", FLASH_MIME_TYPE);
743 - for (var m in attObj) {
744 - if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
745 - if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
 833+ for ( var m in attObj) {
 834+ if (attObj[m] != Object.prototype[m]) { // filter out
 835+ // prototype
 836+ // additions from
 837+ // other potential
 838+ // libraries
 839+ if (m.toLowerCase() == "styleclass") { // 'class' is an
 840+ // ECMA4
 841+ // reserved
 842+ // keyword
746843 o.setAttribute("class", attObj[m]);
747 - }
748 - else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
 844+ } else if (m.toLowerCase() != "classid") { // filter
 845+ // out IE
 846+ // specific
 847+ // attribute
749848 o.setAttribute(m, attObj[m]);
750849 }
751850 }
752851 }
753 - for (var n in parObj) {
754 - if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
 852+ for ( var n in parObj) {
 853+ if (parObj[n] != Object.prototype[n]
 854+ && n.toLowerCase() != "movie") { // filter out
 855+ // prototype
 856+ // additions
 857+ // from other
 858+ // potential
 859+ // libraries and
 860+ // IE specific
 861+ // param element
755862 createObjParam(o, n, parObj[n]);
756863 }
757864 }
@@ -760,41 +867,40 @@
761868 }
762869 return r;
763870 }
764 -
 871+
765872 function createObjParam(el, pName, pValue) {
766873 var p = createElement("param");
767 - p.setAttribute("name", pName);
 874+ p.setAttribute("name", pName);
768875 p.setAttribute("value", pValue);
769876 el.appendChild(p);
770877 }
771 -
772 - /* Cross-browser SWF removal
773 - - Especially needed to safely and completely remove a SWF in Internet Explorer
774 - */
 878+
 879+ /*
 880+ * Cross-browser SWF removal - Especially needed to safely and completely
 881+ * remove a SWF in Internet Explorer
 882+ */
775883 function removeSWF(id) {
776884 var obj = getElementById(id);
777885 if (obj && obj.nodeName == "OBJECT") {
778886 if (ua.ie && ua.win) {
779887 obj.style.display = "none";
780 - (function(){
 888+ (function() {
781889 if (obj.readyState == 4) {
782890 removeObjectInIE(id);
783 - }
784 - else {
 891+ } else {
785892 setTimeout(arguments.callee, 10);
786893 }
787894 })();
788 - }
789 - else {
 895+ } else {
790896 obj.parentNode.removeChild(obj);
791897 }
792898 }
793899 }
794 -
 900+
795901 function removeObjectInIE(id) {
796902 var obj = getElementById(id);
797903 if (obj) {
798 - for (var i in obj) {
 904+ for ( var i in obj) {
799905 if (typeof obj[i] == "function") {
800906 obj[i] = null;
801907 }
@@ -802,59 +908,72 @@
803909 obj.parentNode.removeChild(obj);
804910 }
805911 }
806 -
807 - /* Functions to optimize JavaScript compression
808 - */
 912+
 913+ /*
 914+ * Functions to optimize JavaScript compression
 915+ */
809916 function getElementById(id) {
810917 var el = null;
811918 try {
812919 el = doc.getElementById(id);
 920+ } catch (e) {
813921 }
814 - catch (e) {}
815922 return el;
816923 }
817 -
 924+
818925 function createElement(el) {
819926 return doc.createElement(el);
820927 }
821 -
822 - /* Updated attachEvent function for Internet Explorer
823 - - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
824 - */
 928+
 929+ /*
 930+ * Updated attachEvent function for Internet Explorer - Stores attachEvent
 931+ * information in an Array, so on unload the detachEvent functions can be
 932+ * called to avoid memory leaks
 933+ */
825934 function addListener(target, eventType, fn) {
826935 target.attachEvent(eventType, fn);
827 - listenersArr[listenersArr.length] = [target, eventType, fn];
 936+ listenersArr[listenersArr.length] = [ target, eventType, fn ];
828937 }
829 -
830 - /* Flash Player and SWF content version matching
831 - */
 938+
 939+ /*
 940+ * Flash Player and SWF content version matching
 941+ */
832942 function hasPlayerVersion(rv) {
833943 var pv = ua.pv, v = rv.split(".");
834944 v[0] = parseInt(v[0], 10);
835 - v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
 945+ v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9"
 946+ // instead of "9.0.0"
836947 v[2] = parseInt(v[2], 10) || 0;
837 - return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
 948+ return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0]
 949+ && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
838950 }
839 -
840 - /* Cross-browser dynamic CSS creation
841 - - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
842 - */
 951+
 952+ /*
 953+ * Cross-browser dynamic CSS creation - Based on Bobby van der Sluis'
 954+ * solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
 955+ */
843956 function createCSS(sel, decl, media, newStyle) {
844 - if (ua.ie && ua.mac) { return; }
 957+ if (ua.ie && ua.mac) {
 958+ return;
 959+ }
845960 var h = doc.getElementsByTagName("head")[0];
846 - if (!h) { return; } // to also support badly authored HTML pages that lack a head element
 961+ if (!h) {
 962+ return;
 963+ } // to also support badly authored HTML pages that lack a head
 964+ // element
847965 var m = (media && typeof media == "string") ? media : "screen";
848966 if (newStyle) {
849967 dynamicStylesheet = null;
850968 dynamicStylesheetMedia = null;
851969 }
852 - if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
 970+ if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
853971 // create dynamic stylesheet + get a global reference to it
854972 var s = createElement("style");
855973 s.setAttribute("type", "text/css");
856974 s.setAttribute("media", m);
857975 dynamicStylesheet = h.appendChild(s);
858 - if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
 976+ if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF
 977+ && doc.styleSheets.length > 0) {
859978 dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
860979 }
861980 dynamicStylesheetMedia = m;
@@ -864,66 +983,77 @@
865984 if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
866985 dynamicStylesheet.addRule(sel, decl);
867986 }
868 - }
869 - else {
 987+ } else {
870988 if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
871 - dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
 989+ dynamicStylesheet.appendChild(doc.createTextNode(sel + " {"
 990+ + decl + "}"));
872991 }
873992 }
874993 }
875 -
 994+
876995 function setVisibility(id, isVisible) {
877 - if (!autoHideShow) { return; }
 996+ if (!autoHideShow) {
 997+ return;
 998+ }
878999 var v = isVisible ? "visible" : "hidden";
8791000 if (isDomLoaded && getElementById(id)) {
8801001 getElementById(id).style.visibility = v;
881 - }
882 - else {
 1002+ } else {
8831003 createCSS("#" + id, "visibility:" + v);
8841004 }
8851005 }
8861006
887 - /* Filter to avoid XSS attacks
888 - */
 1007+ /*
 1008+ * Filter to avoid XSS attacks
 1009+ */
8891010 function urlEncodeIfNecessary(s) {
8901011 var regex = /[\\\"<>\.;]/;
8911012 var hasBadChars = regex.exec(s) != null;
892 - return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
 1013+ return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s)
 1014+ : s;
8931015 }
894 -
895 - /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
896 - */
 1016+
 1017+ /*
 1018+ * Release memory to avoid memory leaks caused by closures, fix hanging
 1019+ * audio/video threads and force open sockets/NetConnections to disconnect
 1020+ * (Internet Explorer only)
 1021+ */
8971022 var cleanup = function() {
8981023 if (ua.ie && ua.win) {
8991024 window.attachEvent("onunload", function() {
9001025 // remove listeners to avoid memory leaks
901 - var ll = listenersArr.length;
902 - for (var i = 0; i < ll; i++) {
903 - listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
904 - }
905 - // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
906 - var il = objIdArr.length;
907 - for (var j = 0; j < il; j++) {
908 - removeSWF(objIdArr[j]);
909 - }
910 - // cleanup library's main closures to avoid memory leaks
911 - for (var k in ua) {
912 - ua[k] = null;
913 - }
914 - ua = null;
915 - for (var l in swfobject) {
916 - swfobject[l] = null;
917 - }
918 - swfobject = null;
919 - });
 1026+ var ll = listenersArr.length;
 1027+ for ( var i = 0; i < ll; i++) {
 1028+ listenersArr[i][0].detachEvent(listenersArr[i][1],
 1029+ listenersArr[i][2]);
 1030+ }
 1031+ // cleanup dynamically embedded objects to fix audio/video
 1032+ // threads and force open sockets and NetConnections to
 1033+ // disconnect
 1034+ var il = objIdArr.length;
 1035+ for ( var j = 0; j < il; j++) {
 1036+ removeSWF(objIdArr[j]);
 1037+ }
 1038+ // cleanup library's main closures to avoid memory leaks
 1039+ for ( var k in ua) {
 1040+ ua[k] = null;
 1041+ }
 1042+ ua = null;
 1043+ for ( var l in swfobject) {
 1044+ swfobject[l] = null;
 1045+ }
 1046+ swfobject = null;
 1047+ });
9201048 }
9211049 }();
922 -
 1050+
9231051 return {
924 - /* Public API
925 - - Reference: http://code.google.com/p/swfobject/wiki/documentation
926 - */
927 - registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
 1052+ /*
 1053+ * Public API - Reference:
 1054+ * http://code.google.com/p/swfobject/wiki/documentation
 1055+ */
 1056+ registerObject : function(objectIdStr, swfVersionStr, xiSwfUrlStr,
 1057+ callbackFn) {
9281058 if (ua.w3 && objectIdStr && swfVersionStr) {
9291059 var regObj = {};
9301060 regObj.id = objectIdStr;
@@ -932,51 +1062,73 @@
9331063 regObj.callbackFn = callbackFn;
9341064 regObjArr[regObjArr.length] = regObj;
9351065 setVisibility(objectIdStr, false);
 1066+ } else if (callbackFn) {
 1067+ callbackFn( {
 1068+ success : false,
 1069+ id : objectIdStr
 1070+ });
9361071 }
937 - else if (callbackFn) {
938 - callbackFn({success:false, id:objectIdStr});
939 - }
9401072 },
941 -
942 - getObjectById: function(objectIdStr) {
 1073+
 1074+ getObjectById : function(objectIdStr) {
9431075 if (ua.w3) {
9441076 return getObjectById(objectIdStr);
9451077 }
9461078 },
9471079 // XXX added by mdale ( since we know the dom is ready,
948 - // this works better.
949 - callDomLoadFunctions: function(){
950 - callDomLoadFunctions();
 1080+ // this works better.
 1081+ callDomLoadFunctions : function() {
 1082+ callDomLoadFunctions();
9511083 },
952 -
953 - embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
954 - var callbackObj = {success:false, id:replaceElemIdStr};
955 - if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
 1084+
 1085+ embedSWF : function(swfUrlStr, replaceElemIdStr, widthStr, heightStr,
 1086+ swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj,
 1087+ callbackFn) {
 1088+ var callbackObj = {
 1089+ success : false,
 1090+ id : replaceElemIdStr
 1091+ };
 1092+ if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr
 1093+ && replaceElemIdStr && widthStr && heightStr
 1094+ && swfVersionStr) {
9561095 setVisibility(replaceElemIdStr, false);
9571096 addDomLoadEvent(function() {
9581097 widthStr += ""; // auto-convert to string
9591098 heightStr += "";
9601099 var att = {};
9611100 if (attObj && typeof attObj === OBJECT) {
962 - for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
 1101+ for ( var i in attObj) { // copy object to avoid the
 1102+ // use of references,
 1103+ // because web authors often
 1104+ // reuse attObj for multiple
 1105+ // SWFs
9631106 att[i] = attObj[i];
9641107 }
9651108 }
9661109 att.data = swfUrlStr;
9671110 att.width = widthStr;
9681111 att.height = heightStr;
969 - var par = {};
 1112+ var par = {};
9701113 if (parObj && typeof parObj === OBJECT) {
971 - for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
 1114+ for ( var j in parObj) { // copy object to avoid the
 1115+ // use of references,
 1116+ // because web authors often
 1117+ // reuse parObj for multiple
 1118+ // SWFs
9721119 par[j] = parObj[j];
9731120 }
9741121 }
9751122 if (flashvarsObj && typeof flashvarsObj === OBJECT) {
976 - for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
 1123+ for ( var k in flashvarsObj) { // copy object to avoid
 1124+ // the use of
 1125+ // references, because
 1126+ // web authors often
 1127+ // reuse flashvarsObj
 1128+ // for multiple SWFs
9771129 if (typeof par.flashvars != UNDEF) {
978 - par.flashvars += "&" + k + "=" + flashvarsObj[k];
979 - }
980 - else {
 1130+ par.flashvars += "&" + k + "="
 1131+ + flashvarsObj[k];
 1132+ } else {
9811133 par.flashvars = k + "=" + flashvarsObj[k];
9821134 }
9831135 }
@@ -988,95 +1140,110 @@
9891141 }
9901142 callbackObj.success = true;
9911143 callbackObj.ref = obj;
992 - }
993 - else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
 1144+ } else if (xiSwfUrlStr && canExpressInstall()) { // show
 1145+ // Adobe
 1146+ // Express
 1147+ // Install
9941148 att.data = xiSwfUrlStr;
995 - showExpressInstall(att, par, replaceElemIdStr, callbackFn);
 1149+ showExpressInstall(att, par, replaceElemIdStr,
 1150+ callbackFn);
9961151 return;
997 - }
998 - else { // show alternative content
 1152+ } else { // show alternative content
9991153 setVisibility(replaceElemIdStr, true);
10001154 }
1001 - if (callbackFn) { callbackFn(callbackObj); }
 1155+ if (callbackFn) {
 1156+ callbackFn(callbackObj);
 1157+ }
10021158 });
 1159+ } else if (callbackFn) {
 1160+ callbackFn(callbackObj);
10031161 }
1004 - else if (callbackFn) { callbackFn(callbackObj); }
10051162 },
1006 -
1007 - switchOffAutoHideShow: function() {
 1163+
 1164+ switchOffAutoHideShow : function() {
10081165 autoHideShow = false;
10091166 },
1010 -
1011 - ua: ua,
1012 -
1013 - getFlashPlayerVersion: function() {
1014 - return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
 1167+
 1168+ ua : ua,
 1169+
 1170+ getFlashPlayerVersion : function() {
 1171+ return {
 1172+ major : ua.pv[0],
 1173+ minor : ua.pv[1],
 1174+ release : ua.pv[2]
 1175+ };
10151176 },
1016 -
1017 - hasFlashPlayerVersion: hasPlayerVersion,
1018 -
1019 - createSWF: function(attObj, parObj, replaceElemIdStr) {
 1177+
 1178+ hasFlashPlayerVersion : hasPlayerVersion,
 1179+
 1180+ createSWF : function(attObj, parObj, replaceElemIdStr) {
10201181 if (ua.w3) {
10211182 return createSWF(attObj, parObj, replaceElemIdStr);
1022 - }
1023 - else {
 1183+ } else {
10241184 return undefined;
10251185 }
10261186 },
1027 -
1028 - showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
 1187+
 1188+ showExpressInstall : function(att, par, replaceElemIdStr, callbackFn) {
10291189 if (ua.w3 && canExpressInstall()) {
10301190 showExpressInstall(att, par, replaceElemIdStr, callbackFn);
10311191 }
10321192 },
1033 -
1034 - removeSWF: function(objElemIdStr) {
 1193+
 1194+ removeSWF : function(objElemIdStr) {
10351195 if (ua.w3) {
10361196 removeSWF(objElemIdStr);
10371197 }
10381198 },
1039 -
1040 - createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
 1199+
 1200+ createCSS : function(selStr, declStr, mediaStr, newStyleBoolean) {
10411201 if (ua.w3) {
10421202 createCSS(selStr, declStr, mediaStr, newStyleBoolean);
10431203 }
10441204 },
1045 -
1046 - addDomLoadEvent: addDomLoadEvent,
1047 -
1048 - addLoadEvent: addLoadEvent,
1049 -
1050 - getQueryParamValue: function(param) {
 1205+
 1206+ addDomLoadEvent : addDomLoadEvent,
 1207+
 1208+ addLoadEvent : addLoadEvent,
 1209+
 1210+ getQueryParamValue : function(param) {
10511211 var q = doc.location.search || doc.location.hash;
10521212 if (q) {
1053 - if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
1054 - if (param == null) {
1055 - return urlEncodeIfNecessary(q);
1056 - }
1057 - var pairs = q.split("&");
1058 - for (var i = 0; i < pairs.length; i++) {
1059 - if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
1060 - return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
1061 - }
1062 - }
 1213+ if (/\?/.test(q)) {
 1214+ q = q.split("?")[1];
 1215+ } // strip question mark
 1216+ if (param == null) {
 1217+ return urlEncodeIfNecessary(q);
 1218+ }
 1219+ var pairs = q.split("&");
 1220+ for ( var i = 0; i < pairs.length; i++) {
 1221+ if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
 1222+ return urlEncodeIfNecessary(pairs[i].substring((pairs[i]
 1223+ .indexOf("=") + 1)));
10631224 }
1064 - return "";
1065 - },
1066 -
1067 - // For internal usage only
1068 - expressInstallCallback: function() {
 1225+ }
 1226+ }
 1227+ return "";
 1228+},
 1229+
 1230+// For internal usage only
 1231+ expressInstallCallback : function() {
10691232 if (isExpressInstallActive) {
10701233 var obj = getElementById(EXPRESS_INSTALL_ID);
10711234 if (obj && storedAltContent) {
10721235 obj.parentNode.replaceChild(storedAltContent, obj);
10731236 if (storedAltContentId) {
10741237 setVisibility(storedAltContentId, true);
1075 - if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
 1238+ if (ua.ie && ua.win) {
 1239+ storedAltContent.style.display = "block";
 1240+ }
10761241 }
1077 - if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
 1242+ if (storedCallbackFn) {
 1243+ storedCallbackFn(storedCallbackObj);
 1244+ }
10781245 }
10791246 isExpressInstallActive = false;
1080 - }
 1247+ }
10811248 }
10821249 };
10831250 }();
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76900fixed thumb overlay for audiodale20:02, 17 November 2010

Comments

#Comment by Nikerabbit (talk | contribs)   20:54, 17 November 2010
-				for (var n in parObj) {
-					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+				for ( var n in parObj) {
+					if (parObj[n] != Object.prototype[n]
+							&& n.toLowerCase() != "movie") { // filter out
+																// prototype
+																// additions
+																// from other
+																// potential
+																// libraries and
+																// IE specific
+																// param element

This kind of indentation doesn't really make sense either.

#Comment by Mdale (talk | contribs)   23:33, 17 November 2010

The auto formatting feature is not working exactly how I want. Working on fixing that.

Status & tagging log