Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -1175,8 +1175,8 @@ |
1176 | 1176 | } |
1177 | 1177 | |
1178 | 1178 | //js2AddOnloadHook: ensure jQuery and the DOM are ready |
1179 | | -function js2AddOnloadHook( func ) { |
1180 | | - //js_log('js2AddOnloadHook:: jquery:' + typeof window.jQuery + ' $j: ' + typeof $j); |
| 1179 | +function js2AddOnloadHook( func ) { |
| 1180 | + js_log('js2AddOnloadHook:: jquery:' +func); |
1181 | 1181 | //check for jQuery then add the load event (to run after video tag rewrites (if present) |
1182 | 1182 | mvJsLoader.jQueryCheck( function() { |
1183 | 1183 | if( mvJsLoader.doneReadyEvents ) { |
Index: trunk/phase3/js2/remoteMwEmbed.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | reqArguments = urlparts[1]; |
12 | 12 | |
13 | 13 | //setup up request Params: |
14 | | -var reqParts = urlparts[1].split('&'); |
| 14 | +var reqParts = urlparts[1].substring(1).split('&'); |
15 | 15 | var reqParam={}; |
16 | 16 | for(var i=0;i< reqParts.length; i++){ |
17 | 17 | var p = reqParts[i].split('='); |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | function doPageSpecificRewrite() { |
30 | 30 | // Add media wizard |
31 | 31 | if( wgAction == 'edit' || wgAction == 'submit' ) { |
32 | | - load_mv_embed( function() { |
| 32 | + load_mv_embed( function() { |
33 | 33 | loadExternalJs( mwEmbedHostPath + '/editPage.js' + reqArguments ); |
34 | 34 | } ); |
35 | 35 | } |
— | — | @@ -177,8 +177,12 @@ |
178 | 178 | }else{ |
179 | 179 | rurl+='&urid=' + mwRemoteVersion; |
180 | 180 | } |
| 181 | + if(reqParam['debug']) |
| 182 | + rurl+='&debug=true'; |
| 183 | + |
181 | 184 | if(reqParam['uselang'] ) |
182 | 185 | rurl+='&uselang=' + reqParam['uselang']; |
| 186 | + |
183 | 187 | //do import url: |
184 | 188 | importScriptURI(rurl); |
185 | 189 | }else{ |
Index: trunk/phase3/js2/editPage.js |
— | — | @@ -23,13 +23,14 @@ |
24 | 24 | js2AddOnloadHook( function() { |
25 | 25 | var amwConf = $j.extend( true, defaultAddMediaConfig, mwAddMediaConfig ); |
26 | 26 | // kind of tricky, it would be nice to use run on ready "loader" call here |
27 | | - var didWikiEditorBind = false; |
| 27 | + var didWikiEditorBind = false; |
28 | 28 | |
29 | 29 | //setup the drag drop binding (will only work for html5 upload browsers) |
30 | | - //$j( 'textarea#wpTextbox1' ).dragFileUpload(); |
| 30 | + //$j('textarea#wpTextbox1').dragFileUpload(); |
31 | 31 | |
32 | 32 | //set up the add-media-wizard binding: |
33 | 33 | if( typeof $j.wikiEditor != 'undefined' ) { |
| 34 | + //the below seems to be broken :( |
34 | 35 | $j( 'textarea#wpTextbox1' ).bind( 'wikiEditor-toolbar-buildSection-main', |
35 | 36 | function( e, section ) { |
36 | 37 | didWikiEditorBind = true; |
— | — | @@ -46,19 +47,20 @@ |
47 | 48 | ); |
48 | 49 | } |
49 | 50 | //add to old toolbar if wikiEditor did not remove '#toolbar' from the page: |
50 | | - setTimeout(function(){ |
| 51 | + setTimeout(function(){ |
51 | 52 | if( $j('#btn-add-media-wiz').length == 0 && $j( '#toolbar' ).length != 0 ){ |
| 53 | + js_log(' old toolbar bind:'); |
52 | 54 | $j( '#toolbar' ).append( '<img style="cursor:pointer" id="btn-add-media-wiz" src="' + |
53 | 55 | mv_skin_img_path + 'Button_add_media.png">' ); |
54 | 56 | $j( '#btn-add-media-wiz' ).addMediaWiz( |
55 | 57 | amwConf |
56 | 58 | ); |
57 | 59 | }else{ |
| 60 | + js_log('failed to bind via build section bind via target:'); |
58 | 61 | //make sure the wikieditor got binded: |
59 | 62 | if( !didWikiEditorBind ) |
60 | | - $j(".tool [rel='file']").addMediaWiz( amwConf ); |
| 63 | + $j(".tool[rel='file']").unbind().addMediaWiz( amwConf ); |
61 | 64 | } |
62 | 65 | }, 120) |
63 | | - //drag drop for editbar: |
64 | | - //$j('textarea#wpTextbox1').dragFileUpload(); |
| 66 | + |
65 | 67 | }); |