Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php |
— | — | @@ -348,17 +348,16 @@ |
349 | 349 | if( $mvgJSDebug ){ |
350 | 350 | $unique_req_param = time(); |
351 | 351 | }else{ |
352 | | - //@@could just read from the svn version file info |
| 352 | + //@@todo should read form svn version file info |
353 | 353 | $unique_req_param = MV_VERSION; |
354 | 354 | } |
355 | 355 | |
356 | 356 | /* (moved to on_dom ready) but here as well*/ |
357 | 357 | if( $wgEnableScriptLoader ){ |
358 | | - $debug_param = ($mvgJSDebug)?'&debug=true':false; |
| 358 | + $debug_param = ($mvgJSDebug) ? '&debug=true' : ''; |
359 | 359 | $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/mvwScriptLoader.php?" . |
360 | 360 | "class=window.jQuery,j.fn.autocomplete,j.fn.hoverIntent,mv_embed,mv_allpages,mv_search" . |
361 | | - '&urid=' .$unique_req_param . |
362 | | - $debug_param . "\"></script>" |
| 361 | + '&urid=' .$unique_req_param . $debug_param . "\"></script>" |
363 | 362 | ); |
364 | 363 | }else{ |
365 | 364 | $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/jquery-1.2.6.min.js?{$unique_req_param}\"></script>" ); |
Index: trunk/extensions/MetavidWiki/languages/MV_Messages.php |
— | — | @@ -11,6 +11,138 @@ |
12 | 12 | * @author Michael Dale |
13 | 13 | */ |
14 | 14 | $messages['en'] = array( |
| 15 | + |
| 16 | +#javascript mappings per file: |
| 17 | + |
| 18 | +#mv_embed.js |
| 19 | + "loading_txt"=>"loading <blink>...</blink>", |
| 20 | + "loading_plugin" => "loading plugin<blink>...</blink>", |
| 21 | + "select_playback" => "Set Playback Preference", |
| 22 | + "link_back" => "Link Back", |
| 23 | + "error_load_lib" => "mv_embed=> Unable to load required javascript libraries\n insert script via DOM has failed, try reloading? ", |
| 24 | + |
| 25 | + "error_swap_vid" => "Error=>mv_embed was unable to swap the video tag for the mv_embed interface", |
| 26 | + |
| 27 | + "download_segment" => "Download Selection:", |
| 28 | + "download_full" => "Download Full Video File:", |
| 29 | + "download_clip" => "Download the Clip", |
| 30 | + "download_text" => "Download Text (<a style=\"color=>white\" title=\"cmml\" href=\"http=>//wiki.xiph.org/index.php/CMML\">cmml</a> xml:", |
| 31 | + |
| 32 | + "clip_linkback" => "Clip Source Page", |
| 33 | + |
| 34 | + "ogg-player-vlc-mozilla" => "VLC Plugin", |
| 35 | + "ogg-player-videoElement" => "Native Ogg Video Support", |
| 36 | + "ogg-player-vlc-activex" => "VLC ActiveX", |
| 37 | + "ogg-player-oggPlay" => "Annodex OggPlay Plugin", |
| 38 | + "ogg-player-oggPlugin" => "Generic Ogg Plugin", |
| 39 | + "ogg-player-quicktime-mozilla" => "Quicktime Plugin", |
| 40 | + "ogg-player-quicktime-activex" => "Quicktime ActiveX", |
| 41 | + "ogg-player-cortado" => "Java Cortado", |
| 42 | + "ogg-player-flowplayer" => "Flowplayer", |
| 43 | + "ogg-player-selected" => " (selected)", |
| 44 | + "generic_missing_plugin" => "You browser does not appear to support playback type=> <b>$1</b><br> visit the <a href=\"http=>//metavid.org/wiki/Client_Playback\">Playback Methods</a> page to download a player<br>", |
| 45 | + |
| 46 | + "add_to_end_of_sequence" => "Add to End of Sequence", |
| 47 | + |
| 48 | + "missing_video_stream" => "The video file for this stream is missing", |
| 49 | + |
| 50 | + "select_transcript_set" => "Select Text Layers", |
| 51 | + "auto_scroll" => "auto scroll", |
| 52 | + "close" => "close", |
| 53 | + "improve_transcript" => "Improve Transcript", |
| 54 | + |
| 55 | + "next_clip_msg" => "Play Next Clip", |
| 56 | + "prev_clip_msg" => "Play Previous Clip", |
| 57 | + "current_clip_msg" => "Continue Playing this Clip", |
| 58 | + "seek_to" => "Seek to", |
| 59 | + |
| 60 | +#mvUploader.js |
| 61 | + "upload-enable-converter"=>"Enable video converter (to upload source video not yet converted to theora format) <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">more info</a>", |
| 62 | + "upload-fogg_not_installed"=>"If you want to upload video consider installing <a href=\"http://firefogg.org\">firefogg.org</a>, <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">more info</a>", |
| 63 | + "upload-in-progress"=>"Doing Transcode & Upload (do not close this window)", |
| 64 | + "upload-transcoded-status"=>"Transcoded", |
| 65 | + "uploaded-status"=>"Uploaded", |
| 66 | + "upload-select-file"=>"Select File...", |
| 67 | + "wgfogg_wrong_version"=>"You have firefogg installed but its outdated, <a href=\"http://firefogg.org\">please upgrade</a> ", |
| 68 | + "wgfogg_waring_ogg_upload"=>"You have selected an ogg file for conversion to ogg (this is probably unnessesary). Maybe disable the video converter?", |
| 69 | + |
| 70 | +#remoteSearchDriver.js |
| 71 | + "mv_media_search"=>"Media Search why test test", |
| 72 | + "rsd_box_layout"=>"Box layout", |
| 73 | + "rsd_list_layout"=>"List Layout", |
| 74 | + "rsd_results_desc"=>"Results some ", |
| 75 | + "rsd_results_next"=>"next ", |
| 76 | + "rsd_results_prev"=>"previous ", |
| 77 | + "upload"=>"Upload", |
| 78 | + "rsd_layout"=>"Layout:", |
| 79 | + "rsd_resource_edit"=>"Edit Resource:", |
| 80 | + |
| 81 | +#mvClipEdit.js |
| 82 | + "mv_crop"=>"Crop Image", |
| 83 | + "mv_apply_crop"=>"Apply Crop to Image", |
| 84 | + "mv_reset_crop"=>"Rest Crop", |
| 85 | + "mv_insert_image_page"=>"Insert Into page", |
| 86 | + "mv_preview_insert"=>"Preview Insert", |
| 87 | + "mv_cancel_image_insert"=>"Cancel Image Insert", |
| 88 | + |
| 89 | + "sc_fileopts"=>"Clip Detail Edit", |
| 90 | + "sc_inoutpoints"=>"Set In-Out points", |
| 91 | + "sc_panzoom"=>"Pan Zoom Crop", |
| 92 | + "sc_overlays"=>"Overlays", |
| 93 | + "sc_audio"=>"Audio Control", |
| 94 | + "sc_duration"=>"Duration", |
| 95 | + |
| 96 | + "mv_template_properties"=>"Template Properties", |
| 97 | + "mv_custom_title"=>"Custom Title", |
| 98 | + "mv_edit_properties"=>"Edit Properties", |
| 99 | + "mv_other_properties"=>"Other Properties", |
| 100 | + "mv_resource_page"=>"Resource Page", |
| 101 | + |
| 102 | +#mvSequencer.js |
| 103 | + "menu_clipedit"=>"Edit Selected Resource", |
| 104 | + "menu_cliplib"=>"Add Resource", |
| 105 | + "menu_transition"=>"Transitions Effects", |
| 106 | + "menu_resource_overview"=>"Resource Overview", |
| 107 | + "menu_options"=>"Options", |
| 108 | + |
| 109 | + "loading_timeline"=>"Loading TimeLine <blink>...</blink>", |
| 110 | + "loading_user_rights"=>"Loading user rights <blink>...</blink>", |
| 111 | + |
| 112 | + "no_edit_permissions"=>"You don\'t have permissions to save changes to this sequence", |
| 113 | + |
| 114 | + |
| 115 | + "edit_clip"=>"Edit Clip", |
| 116 | + "edit_save"=>"Save Changes", |
| 117 | + "edit_cancel"=>"Cancel Edit", |
| 118 | + "edit_cancel_confirm"=>"Are you sure you want to cancel your edit, changes will be lost", |
| 119 | + |
| 120 | + "zoom_in"=>"Zoom In", |
| 121 | + "zoom_out"=>"Zoom Out", |
| 122 | + "cut_clip"=>"Cut Clips", |
| 123 | + "expand_track"=>"Expand Track", |
| 124 | + "colapse_track"=>"Collapse Track", |
| 125 | + "play_clip"=>"Play From Playline Position", |
| 126 | + "pixle2sec"=>"pixles to seconds", |
| 127 | + "rmclip"=>"Remove Clip", |
| 128 | + "clip_in"=>"clip in", |
| 129 | + "clip_out"=>"clip out", |
| 130 | + |
| 131 | + "mv_welcome_to_sequencer"=>"<h3>Welcome to the sequencer demo</h3>"+ |
| 132 | + "very <b>limited</b> functionality right now. Not much documentation yet either", |
| 133 | + |
| 134 | + "no_selected_resource"=>"<h3>No Resource selected</h3> Select a Clip to enable resource editing", |
| 135 | + "error_edit_multiple"=>"<h3>Multiple Resources Selected</h3> Select a single clip to edit it", |
| 136 | + |
| 137 | + "mv_editor_options"=>"Editor options", |
| 138 | + "mv_editor_mode"=>"Editor mode", |
| 139 | + "mv_simple_editor_desc"=>"simple editor (iMovie style)", |
| 140 | + "mv_advanced_editor_desc"=>"advanced editor (Final Cut style)", |
| 141 | + "mv_other_options"=>"Other Options", |
| 142 | + "mv_contextmenu_opt"=>"Enable Context Menus", |
| 143 | + |
| 144 | + |
| 145 | +#normal php based msg keys: |
| 146 | + |
15 | 147 | 'metavid' => 'Metavid page', |
16 | 148 | 'mv_missing_stream' => 'Missing stream: $1', |
17 | 149 | 'specialpages-group-mv_group' => 'MetaVidWiki special pages', |
Index: trunk/extensions/MetavidWiki/skins/mv_search.js |
— | — | @@ -1,4 +1,4 @@ |
2 | | -mv_addLoadEvent(mv_pre_setup_search); |
| 2 | +mv_addLoadEvent( mv_pre_setup_search); |
3 | 3 | var mvSearchSetupFlag =false; |
4 | 4 | var maxFilters = 8; |
5 | 5 | var mv_search_action=''; |
— | — | @@ -454,52 +454,52 @@ |
455 | 455 | function add_highlight_function(){ |
456 | 456 | $j(function() { |
457 | 457 | jQuery.highlight = document.body.createTextRange ? |
458 | | -/* |
459 | | -Version for IE using TextRanges. |
460 | | -*/ |
461 | | - function(node, te) { |
462 | | - var r = document.body.createTextRange(); |
463 | | - r.moveToElementText(node); |
464 | | - for (var i = 0; r.findText(te); i++) { |
465 | | - r.pasteHTML('<span class="searchmatch">' + r.text + '<\/span>'); |
466 | | - r.collapse(false); |
467 | | - } |
468 | | - } |
469 | | - : |
470 | | -/* |
471 | | - (Complicated) version for Mozilla and Opera using span tags. |
472 | | -*/ |
473 | | - function(node, te) { |
474 | | - js_log('hl:'+ te + ' nt:'+node.nodeType + ' tn:' + node.tagName); |
475 | | - var pos, skip, spannode, middlebit, endbit, middleclone; |
476 | | - skip = 0; |
477 | | - if (node.nodeType == 3) { |
478 | | - pos = node.data.toUpperCase().indexOf(te); |
479 | | - if (pos >= 0) { |
480 | | - spannode = document.createElement('span'); |
481 | | - spannode.className = 'searchmatch'; |
482 | | - middlebit = node.splitText(pos); |
483 | | - endbit = middlebit.splitText(te.length); |
484 | | - middleclone = middlebit.cloneNode(true); |
485 | | - spannode.appendChild(middleclone); |
486 | | - middlebit.parentNode.replaceChild(spannode, middlebit); |
487 | | - skip = 1; |
488 | | - } |
489 | | - } |
490 | | - else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) { |
491 | | - for (var i = 0; i < node.childNodes.length; ++i) { |
492 | | - i += $j.highlight(node.childNodes[i], te); |
493 | | - } |
494 | | - } |
495 | | - return skip; |
496 | | - } |
497 | | - |
498 | | - ; |
499 | | -}); |
500 | | - |
501 | | -jQuery.fn.removeHighlight = function() { |
502 | | - return this.find("span.highlight").each(function() { |
503 | | - this.parentNode.replaceChild(this.firstChild, this).normalize(); |
504 | | - }); |
505 | | -}; |
| 458 | + /* |
| 459 | + Version for IE using TextRanges. |
| 460 | + */ |
| 461 | + function(node, te) { |
| 462 | + var r = document.body.createTextRange(); |
| 463 | + r.moveToElementText(node); |
| 464 | + for (var i = 0; r.findText(te); i++) { |
| 465 | + r.pasteHTML('<span class="searchmatch">' + r.text + '<\/span>'); |
| 466 | + r.collapse(false); |
| 467 | + } |
| 468 | + } |
| 469 | + : |
| 470 | + /* |
| 471 | + (Complicated) version for Mozilla and Opera using span tags. |
| 472 | + */ |
| 473 | + function(node, te) { |
| 474 | + js_log('hl:'+ te + ' nt:'+node.nodeType + ' tn:' + node.tagName); |
| 475 | + var pos, skip, spannode, middlebit, endbit, middleclone; |
| 476 | + skip = 0; |
| 477 | + if (node.nodeType == 3) { |
| 478 | + pos = node.data.toUpperCase().indexOf(te); |
| 479 | + if (pos >= 0) { |
| 480 | + spannode = document.createElement('span'); |
| 481 | + spannode.className = 'searchmatch'; |
| 482 | + middlebit = node.splitText(pos); |
| 483 | + endbit = middlebit.splitText(te.length); |
| 484 | + middleclone = middlebit.cloneNode(true); |
| 485 | + spannode.appendChild(middleclone); |
| 486 | + middlebit.parentNode.replaceChild(spannode, middlebit); |
| 487 | + skip = 1; |
| 488 | + } |
| 489 | + } |
| 490 | + else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) { |
| 491 | + for (var i = 0; i < node.childNodes.length; ++i) { |
| 492 | + i += $j.highlight(node.childNodes[i], te); |
| 493 | + } |
| 494 | + } |
| 495 | + return skip; |
| 496 | + } |
| 497 | + |
| 498 | + ; |
| 499 | + }); |
| 500 | + |
| 501 | + jQuery.fn.removeHighlight = function() { |
| 502 | + return this.find("span.highlight").each(function() { |
| 503 | + this.parentNode.replaceChild(this.firstChild, this).normalize(); |
| 504 | + }); |
| 505 | + }; |
506 | 506 | } |
Index: trunk/extensions/MetavidWiki/skins/mv_allpages.js |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | '$j.fn.hoverIntent':'jquery/plugins/jquery.hoverIntent.js' |
27 | 27 | }, function(){ |
28 | 28 | //js_log('allpage_ auto and hover check'+mv_setup_allpage_flag); |
29 | | - if( !mv_setup_allpage_flag ){ |
| 29 | + if( ! mv_setup_allpage_flag ){ |
30 | 30 | mv_setup_search_ac(); |
31 | 31 | mv_do_mvd_link_rewrite(); |
32 | 32 | mv_page_specific_rewrites(); |
Index: trunk/extensions/MetavidWiki/skins/mv_stream.js |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | |
55 | 55 | function mv_load_interface_libs(){ |
56 | 56 | js_log('f:mv_load_interface_libs'); |
57 | | - //we will need mv_embed stuff: |
| 57 | + //make sure the mv_embed stuff is loaded |
58 | 58 | mvJsLoader.loadBaseLibs(function(){ |
59 | 59 | js_log('load stream js'); |
60 | 60 | //load some additional plugins/components: |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mvSequencer.js |
— | — | @@ -29,7 +29,6 @@ |
30 | 30 | |
31 | 31 | "no_edit_permissions" : "You don\'t have permissions to save changes to this sequence", |
32 | 32 | |
33 | | - |
34 | 33 | "edit_clip" : "Edit Clip", |
35 | 34 | "edit_save" : "Save Changes", |
36 | 35 | "edit_cancel" : "Cancel Edit", |
— | — | @@ -46,7 +45,6 @@ |
47 | 46 | "clip_in" : "clip in", |
48 | 47 | "clip_out" : "clip out", |
49 | 48 | |
50 | | - //menu items display helper: |
51 | 49 | "mv_welcome_to_sequencer" : "<h3>Welcome to the sequencer demo</h3>"+ |
52 | 50 | "very <b>limited</b> functionality right now. Not much documentation yet either", |
53 | 51 | |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | var mv_default_video_size = '400x300'; |
44 | 44 | |
45 | 45 | var global_player_list = new Array(); |
46 | | -var global_req_cb = new Array();//the global request callback array |
| 46 | +var global_req_cb = new Array(); //the global request callback array |
47 | 47 | var _global = this; |
48 | 48 | var mv_init_done=false; |
49 | 49 | var global_cb_count =0; |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | var mv_embed_urid = getMvUniqueReqId(); |
61 | 61 | } |
62 | 62 | |
| 63 | +var mvLoadEvent = new Array() //the onReady global event.. @@todo should be depricated for jquery style document.ready stuff |
63 | 64 | //the default thumbnail for missing images: |
64 | 65 | var mv_default_thumb_url = mv_embed_path + 'images/vid_default_thumb.jpg'; |
65 | 66 | |
— | — | @@ -144,30 +145,24 @@ |
145 | 146 | '</div>'); |
146 | 147 | } |
147 | 148 | |
148 | | -/** |
149 | | - * mvJsLoader class handles initialization and js file loads |
150 | | - */ |
151 | | -var mvJsLoader = { |
152 | | - libreq:{}, |
153 | | - libs:{}, |
154 | | - //to keep consistency across threads: |
155 | | - ptime:0, |
156 | | - ctime:0, |
157 | | - load_error:false,//load error flag (false by default) |
158 | | - calledloadBaseLibs:false,//flag for base load lib |
159 | | - load_time:0, |
160 | | - callbacks:new Array(), |
161 | | - |
162 | | - flist:new Array(), |
163 | | - loadBaseLibs : function( callback ){ |
164 | | - //queue the callback: |
| 149 | +var mvBaseLoader = { |
| 150 | + calledloadBaseLibs:false, |
| 151 | + callbacks:new Array(), |
| 152 | + done:false, |
| 153 | + load:function( callback){ |
| 154 | + //if we are done loading the libs just jump directly to the callback |
| 155 | + if(this.done==true){ |
| 156 | + callback(); |
| 157 | + return ; |
| 158 | + } |
| 159 | + //queue the callback: |
165 | 160 | if(callback) |
166 | | - mvJsLoader.addLoadEvent(callback); |
| 161 | + mvBaseLoader.addLoadEvent(callback); |
167 | 162 | //run if not already running: |
168 | | - if( ! mvJsLoader.calledloadBaseLibs ){ |
| 163 | + if( ! mvBaseLoader.calledloadBaseLibs ){ |
169 | 164 | js_log("called loadBaseLibs"); |
170 | 165 | //only call load base libs once |
171 | | - mvJsLoader.calledloadBaseLibs=true; |
| 166 | + mvBaseLoader.calledloadBaseLibs=true; |
172 | 167 | //issue a style sheet request can come in whenever: |
173 | 168 | if(!styleSheetPresent(mv_embed_path+'skins/'+mv_skin_name+'/styles.css')) |
174 | 169 | loadExternalCss(mv_embed_path+'skins/'+mv_skin_name+'/styles.css'); |
— | — | @@ -177,36 +172,54 @@ |
178 | 173 | mvJsLoader.doLoad({ |
179 | 174 | 'window.jQuery' :'jquery/jquery-1.2.6.js', |
180 | 175 | 'embedVideo' :'libEmbedObj/mv_baseEmbed.js' |
181 | | - },function(){ |
| 176 | + },function(){ |
182 | 177 | //once jQuery is loaded set up no conflict & load plugins: |
183 | 178 | _global['$j'] = jQuery.noConflict(); |
184 | 179 | //set up ajax to not send dynamic urls for loading scripts |
185 | 180 | $j.ajaxSetup({ |
186 | | - cache: true |
187 | | - }); |
188 | | - js_log('jquery loaded'); |
189 | | - //load the jQuery dependent plugins: |
190 | | - mvJsLoader.doLoad({ |
191 | | - '$j.ui.mouse' :'jquery/jquery.ui-1.5.2/ui/minified/ui.core.min.js', |
192 | | - '$j.ui.droppable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.droppable.min.js', |
193 | | - '$j.ui.draggable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.draggable.min.js' |
194 | | - },function(){ |
195 | | - js_log('plugins loaded'); |
196 | | - // run queued functions |
197 | | - while (mvJsLoader.flist.length){ |
198 | | - mvJsLoader.flist.shift()(); |
199 | | - } |
| 181 | + cache: true |
200 | 182 | }); |
201 | | - }); |
| 183 | + js_log('jquery loaded'); |
| 184 | + //load the jQuery dependent plugins: |
| 185 | + mvJsLoader.doLoad({ |
| 186 | + '$j.ui.mouse' :'jquery/jquery.ui-1.5.2/ui/minified/ui.core.min.js', |
| 187 | + '$j.ui.droppable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.droppable.min.js', |
| 188 | + '$j.ui.draggable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.draggable.min.js' |
| 189 | + },function(){ |
| 190 | + js_log('plugins loaded: '); |
| 191 | + mvBaseLoader.done = true; |
| 192 | + // run queued functions from (addLoadEvent) |
| 193 | + mvBaseLoader.runQuededFunctions(); |
| 194 | + }); |
| 195 | + }); |
202 | 196 | } |
203 | | - }, |
| 197 | + }, |
| 198 | + runQuededFunctions:function(){ |
| 199 | + js_log('runQuededFunctions::'); |
| 200 | + while( mvBaseLoader.callbacks.length ){ |
| 201 | + mvBaseLoader.callbacks.shift()(); |
| 202 | + } |
| 203 | + }, |
204 | 204 | addLoadEvent:function(fn){ |
205 | | - this.flist.push(fn); |
206 | | - }, |
| 205 | + mvBaseLoader.callbacks.push(fn); |
| 206 | + } |
| 207 | +} |
| 208 | + |
| 209 | +/** |
| 210 | + * mvJsLoader class handles initialization and js file loads |
| 211 | + */ |
| 212 | +var mvJsLoader = { |
| 213 | + libreq:{}, |
| 214 | + libs:{}, |
| 215 | + //to keep consistency across threads: |
| 216 | + ptime:0, |
| 217 | + ctime:0, |
| 218 | + load_error:false,//load error flag (false by default) |
| 219 | + load_time:0, |
| 220 | + callbacks:new Array(), |
207 | 221 | doLoad:function(libs, callback){ |
208 | 222 | this.ctime++; |
209 | | - if(libs){ //setup this.libs: |
210 | | - |
| 223 | + if(libs){ //setup this.libs: |
211 | 224 | //first check if we already have this lib loaded |
212 | 225 | var all_libs_loaded=true; |
213 | 226 | for(var i in libs){ |
— | — | @@ -216,11 +229,11 @@ |
217 | 230 | } |
218 | 231 | } |
219 | 232 | if( all_libs_loaded ){ |
220 | | - //jump directly to the call back; do not pass go do not issue load request |
| 233 | + js_log('all libs already loaded skiping...' + libs); |
221 | 234 | callback(); |
222 | 235 | return ; |
223 | | - } |
224 | | - |
| 236 | + } |
| 237 | + debug_attr = (getMvEmbedURL().indexOf('debug=') !== false)?'&debug=true':''; |
225 | 238 | //check if we should use the script loader to combine all the requests into one: |
226 | 239 | if( MV_USE_SCRIPT_LOADER ){ |
227 | 240 | var class_set = ''; |
— | — | @@ -233,14 +246,16 @@ |
234 | 247 | last_class=i; |
235 | 248 | coma=','; |
236 | 249 | } |
237 | | - } |
| 250 | + } |
238 | 251 | this.libs[ last_class ] = 'mvwScriptLoader.php?class=' + class_set + |
239 | | - '&urid='+ mv_embed_urid; |
| 252 | + '&urid='+ getMvUniqueReqId()+ |
| 253 | + debug_attr; |
240 | 254 | }else{ |
241 | 255 | //do many requests: |
242 | 256 | for(var i in libs){ //for in loop oky on object |
243 | | - //js_log('add lib: '+i + ' = ' + libs[i]); |
244 | | - this.libs[i]=libs[i]; |
| 257 | + // do a direct load of the file (pass along unique id from request or mv_embed Version ) |
| 258 | + var qmark = (libs[i].indexOf('?')!==true)?'?':'&'; |
| 259 | + this.libs[i]=libs[i] + qmark + 'urid='+ getMvUniqueReqId(); |
245 | 260 | } |
246 | 261 | } |
247 | 262 | } |
— | — | @@ -255,6 +270,7 @@ |
256 | 271 | setTimeout( 'mvJsLoader.doLoad()', 25 ); |
257 | 272 | } |
258 | 273 | }else{ |
| 274 | + js_log('checkLoading passed for: do run callbacks'); |
259 | 275 | //only do callback if we are in the same instance (weird concurency issue) |
260 | 276 | var cb_count=0; |
261 | 277 | for(var i=0; i < this.callbacks.length; i++) |
— | — | @@ -271,7 +287,7 @@ |
272 | 288 | //func(); |
273 | 289 | }else{ |
274 | 290 | //re-issue doLoad ( ptime will be set to ctime so we should catch up) |
275 | | - setTimeout('mvJsLoader.doLoad()',25); |
| 291 | + setTimeout( 'mvJsLoader.doLoad()', 25 ); |
276 | 292 | break; |
277 | 293 | } |
278 | 294 | } |
— | — | @@ -302,7 +318,11 @@ |
303 | 319 | } |
304 | 320 | this.cur_path = cur_path; |
305 | 321 | return true; |
| 322 | + }, |
| 323 | + loadBaseLibs:function( callback ){ |
| 324 | + mvBaseLoader.load( callback); |
306 | 325 | } |
| 326 | + |
307 | 327 | } |
308 | 328 | |
309 | 329 | |
— | — | @@ -726,13 +746,17 @@ |
727 | 747 | js_log('we have vids to process'); |
728 | 748 | //load libs and proccess: |
729 | 749 | mvJsLoader.loadBaseLibs(function(){ |
730 | | - mv_embed(); |
| 750 | + //run any queded global events: |
| 751 | + mv_embed( function(){ |
| 752 | + while(mvLoadEvent.length){ |
| 753 | + mvLoadEvent.pop()(); |
| 754 | + } |
| 755 | + }); |
731 | 756 | }); |
732 | 757 | }else{ |
733 | | - js_log('no video or playlist on the page... (done)'); |
734 | | - //run any queued functions: |
735 | | - while (mvJsLoader.flist.length){ |
736 | | - mvJsLoader.flist.shift()(); |
| 758 | + //run any queded global events: |
| 759 | + while(mvLoadEvent.length){ |
| 760 | + mvLoadEvent.pop()(); |
737 | 761 | } |
738 | 762 | } |
739 | 763 | } |
— | — | @@ -1038,7 +1062,7 @@ |
1039 | 1063 | |
1040 | 1064 | //addLoadEvent for adding functions to be run when the page DOM is done loading |
1041 | 1065 | function mv_addLoadEvent(func) { |
1042 | | - mvJsLoader.addLoadEvent(func); |
| 1066 | + mvLoadEvent.push(func); |
1043 | 1067 | } |
1044 | 1068 | |
1045 | 1069 | //does a remote or local api request based on request url |
— | — | @@ -1157,14 +1181,8 @@ |
1158 | 1182 | //load external js via dom injection |
1159 | 1183 | //@@todo swich over to jQuery injection |
1160 | 1184 | function loadExternalJs(url, callback){ |
1161 | | - //add a unique request id to ensure fresh copies where appropriate |
1162 | | - if( url.indexOf('?')==-1 ){ |
1163 | | - url+='?'+mv_embed_urid; |
1164 | | - } |
1165 | 1185 | js_log('load js: '+ url); |
1166 | | - //if(window['$j']) |
1167 | | - //have to use direct ajax call instead of $j.getScript() |
1168 | | - //since you can't send "cache" option to $j.getScript() |
| 1186 | + //if(window['$j']) //use jquery call: |
1169 | 1187 | /*$j.ajax({ |
1170 | 1188 | type: "GET", |
1171 | 1189 | url: url, |