r103544 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103543‎ | r103544 | r103545 >
Date:00:44, 18 November 2011
Author:dale
Status:ok
Tags:
Comment:
more camel case fixes
Modified paths:
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
@@ -159,7 +159,7 @@
160160
161161 // Thumbnail updating flag ( to avoid rewriting an thumbnail thats already
162162 // being updated)
163 - 'thumbnail_updating' : false,
 163+ 'thumbnailUpdatingFlag' : false,
164164
165165 // Poster display flag
166166 'posterDisplayed' : true,
@@ -1024,7 +1024,7 @@
10251025 't' : mw.seconds2npt( floatSeconds + parseInt( this.startOffset ) )
10261026 }
10271027 );
1028 - if ( !this.thumbnail_updating ) {
 1028+ if ( !this.thumbnailUpdatingFlag ) {
10291029 this.updatePoster( this.lastThumbUrl , false );
10301030 this.lastThumbUrl = null;
10311031 }
@@ -1047,64 +1047,65 @@
10481048 * @param {String}
10491049 * src New src of thumbnail
10501050 * @param {Boolean}
1051 - * quick_switch true switch happens instantly false / undefined
 1051+ * quickSwitch true switch happens instantly false / undefined
10521052 * animated cross fade
10531053 */
1054 - updatePosterSrc: function( src, quick_switch ) {
 1054+ updatePosterSrc: function( src, quickSwitch ) {
10551055 // make sure we don't go to the same url if we are not already updating:
1056 - if ( !this.thumbnail_updating && $( '#img_thumb_' + this.id ).attr( 'src' ) == src )
 1056+ if ( !this.thumbnailUpdatingFlag && $( '#img_thumb_' + this.id ).attr( 'src' ) == src )
10571057 return false;
10581058 // if we are already updating don't issue a new update:
1059 - if ( this.thumbnail_updating && $( '#new_img_thumb_' + this.id ).attr( 'src' ) == src )
 1059+ if ( this.thumbnailUpdatingFlag && $( '#new_img_thumb_' + this.id ).attr( 'src' ) == src )
10601060 return false;
10611061
10621062 mw.log( 'update thumb: ' + src );
10631063
1064 - if ( quick_switch ) {
 1064+ if ( quickSwitch ) {
10651065 $( '#img_thumb_' + this.id ).attr( 'src', src );
1066 - } else {
1067 - var _this = this;
1068 - // if still animating remove new_img_thumb_
1069 - if ( this.thumbnail_updating == true )
1070 - $( '#new_img_thumb_' + this.id ).stop().remove();
 1066+ return ;
 1067+ }
 1068+ var _this = this;
 1069+ // if still animating remove new_img_thumb_
 1070+ if ( this.thumbnailUpdatingFlag == true )
 1071+ $( '#new_img_thumb_' + this.id ).stop().remove();
10711072
1072 - if ( this.posterDisplayed ) {
1073 - mw.log( 'set to thumb:' + src );
1074 - this.thumbnail_updating = true;
1075 - $( this ).append(
1076 - $('<img />')
1077 - .attr({
1078 - 'src' : src,
1079 - 'id' : 'new_img_thumb_' + this.id,
1080 - 'width' : this.width,
1081 - 'height': this.height
1082 - })
1083 - .css( {
1084 - 'display' : 'none',
1085 - 'position' : 'absolute',
1086 - 'z-index' : 2,
1087 - 'top' : '0px',
1088 - 'left' : '0px'
1089 - })
1090 - );
1091 - // mw.log('appended: new_img_thumb_');
1092 - $( '#new_img_thumb_' + this.id ).fadeIn( "slow", function() {
1093 - // once faded in remove org and rename new:
1094 - $( '#img_thumb_' + _this.id ).remove();
1095 - $( '#new_img_thumb_' + _this.id ).attr( 'id', 'img_thumb_' + _this.id );
1096 - $( '#img_thumb_' + _this.id ).css( 'z-index', '1' );
1097 - _this.thumbnail_updating = false;
 1073+ if ( this.posterDisplayed ) {
 1074+ mw.log( 'set to thumb:' + src );
 1075+ this.thumbnailUpdatingFlag = true;
 1076+ $( this ).append(
 1077+ $('<img />')
 1078+ .attr({
 1079+ 'src' : src,
 1080+ 'id' : 'new_img_thumb_' + this.id,
 1081+ 'width' : this.width,
 1082+ 'height': this.height
 1083+ })
 1084+ .css( {
 1085+ 'display' : 'none',
 1086+ 'position' : 'absolute',
 1087+ 'z-index' : 2,
 1088+ 'top' : '0px',
 1089+ 'left' : '0px'
 1090+ })
 1091+ );
 1092+ // mw.log('appended: new_img_thumb_');
 1093+ $( '#new_img_thumb_' + this.id ).fadeIn( "slow", function() {
 1094+ // once faded in remove org and rename new:
 1095+ $( '#img_thumb_' + _this.id ).remove();
 1096+ $( '#new_img_thumb_' + _this.id ).attr( 'id', 'img_thumb_' + _this.id );
 1097+ $( '#img_thumb_' + _this.id ).css( 'z-index', '1' );
 1098+ _this.thumbnailUpdatingFlag = false;
10981099
1099 - // if we have a thumb queued update to that
1100 - if ( _this.lastThumbUrl ) {
1101 - var src_url = _this.lastThumbUrl;
1102 - _this.lastThumbUrl = null;
1103 - _this.updatePosterSrc( src_url );
1104 - }
1105 - } );
1106 - }
 1100+ // if we have a thumb queued update to that
 1101+ if ( _this.lastThumbUrl ) {
 1102+ var src_url = _this.lastThumbUrl;
 1103+ _this.lastThumbUrl = null;
 1104+ _this.updatePosterSrc( src_url );
 1105+ }
 1106+ } );
11071107 }
11081108 },
 1109+
11091110 /**
11101111 * Update the poster source
11111112 * @param {String} url to poster src

Status & tagging log