Index: branches/js2-work/phase3/js/mwEmbed/modules/ClipEdit/mw.ClipEdit.js |
— | — | @@ -97,6 +97,7 @@ |
98 | 98 | * initialises a clipEdit object with provided options. |
99 | 99 | */ |
100 | 100 | init:function( options ) { |
| 101 | + mw.log(' mw.ClipEdit' ); |
101 | 102 | // init object: |
102 | 103 | for ( var i in default_clipedit_values ) { |
103 | 104 | if ( options[i] ) { |
— | — | @@ -777,10 +778,10 @@ |
778 | 779 | showImageControls:function() { |
779 | 780 | var _this = this; |
780 | 781 | var $tool_target = $j( '#' + this.target_control_display ); |
781 | | - |
| 782 | + mw.log( 'tool target len: ' + $tool_target.length ); |
782 | 783 | // By default apply Crop tool |
783 | 784 | if ( _this.enabled_tools == 'all' || _this.enabled_tools.length > 0 ) { |
784 | | - $tool_target.append( '<h3>' + gM( 'mwe-edit-tools' ) + '</h3>' ); |
| 785 | + $tool_target.html( '<h3>' + gM( 'mwe-edit-tools' ) + '</h3>' ); |
785 | 786 | for ( var i in _this.toolset ) { |
786 | 787 | var toolid = _this.toolset[i]; |
787 | 788 | if ( $j.inArray( toolid, _this.enabled_tools ) != -1 || _this.enabled_tools == 'all' ) |
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js |
— | — | @@ -1026,8 +1026,9 @@ |
1027 | 1027 | loadDone = false; |
1028 | 1028 | } |
1029 | 1029 | // Run the parent scope callback for "loadMany" |
1030 | | - if( loadDone && callback ){ |
| 1030 | + if( loadDone && callback && mwLoadDoneCB[ loadName ] != 'done' ){ |
1031 | 1031 | callback( loadName ); |
| 1032 | + mwLoadDoneCB[ loadName ] = 'done'; |
1032 | 1033 | } |
1033 | 1034 | } ); |
1034 | 1035 | } |
— | — | @@ -1178,8 +1179,11 @@ |
1179 | 1180 | if(! mw.isset( className ) && callback){ |
1180 | 1181 | mw.log( 'Possible Error: ' + className +' not set in time, or not defined in:' + "\n" + _this.classPaths[ className ] ); |
1181 | 1182 | } |
1182 | | - if( callback ) |
1183 | | - callback( className ); |
| 1183 | + // make sure callback is avaliable and mwLoadDoneCB has not been called |
| 1184 | + if( callback && mwLoadDoneCB[className] != 'done'){ |
| 1185 | + mwLoadDoneCB[className] = 'done'; |
| 1186 | + callback( className ); |
| 1187 | + } |
1184 | 1188 | callback = null; |
1185 | 1189 | } ); |
1186 | 1190 | //mw.log( 'done with running getScript request ' ); |
— | — | @@ -1266,8 +1270,9 @@ |
1267 | 1271 | */ |
1268 | 1272 | mw.loadDone = function( requestName ) { |
1269 | 1273 | mw.log( "LoadDone: " + requestName ); |
1270 | | - if( mwLoadDoneCB[ requestName ] ){ |
| 1274 | + if( mwLoadDoneCB[ requestName ] && mwLoadDoneCB[ requestName ] != 'done'){ |
1271 | 1275 | mwLoadDoneCB[ requestName ]( requestName ); |
| 1276 | + mwLoadDoneCB[ requestName ] = 'done'; |
1272 | 1277 | } |
1273 | 1278 | }, |
1274 | 1279 | |
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | */ |
6 | 6 | var urlparts = getRemoteEmbedPath(); |
7 | 7 | var mwEmbedHostPath = urlparts[0]; |
8 | | -var mwRemoteVersion = 'r76'; |
| 8 | +var mwRemoteVersion = 'r77'; |
9 | 9 | var mwUseScriptLoader = true; |
10 | 10 | |
11 | 11 | // Setup up request Params: |