var o = '<div class="rsd_control_container" style="width:100%">' +
'<form id="rsd_form" action="javascript:return false;" method="GET">' +
'<input class="ui-widget-content ui-corner-all" type="text" tabindex="1" value="' + dq + '" maxlength="512" id="rsd_q" name="rsd_q" ' +
- 'size="20" autocomplete="off"/> ' +
- $j.btnHtml( gM( 'mwe-media_search' ), 'rms_search_button', 'search' ) +
+ 'size="20" autocomplete="off" />' +
+ $j.btnHtml( gM( 'mwe-media_search' ), 'rms_search_button', 'search' ) +
'</form>';
// close up the control container:
o += '</div>';
-
+
// search provider tabs based on "checked" and "enabled" and "combined tab"
o += '<div id="rsd_results_container" style="top:0px;bottom:0px;left:0px;right:0px;"></div>';
$j( this.target_container ).html( o );
-
// add simple styles:
$j( this.target_container + ' .rms_search_button' ).btnBind().click( function() {
_this.runSearch();
if ( !overflow_style )overflow_style = 'overflow:auto;';
// Remove any old instance:
$j( _this.target_container ).find( '#rsd_resource_edit' ).remove();
+
+ // Hide the results container
+ $j( '#rsd_results_container' ).hide();
+
+ var pt = $j( _this.target_container ).html();
// Add the edit layout window with loading place holders
$j( _this.target_container ).append( '<div id="rsd_resource_edit" ' +
- 'style="position:absolute;top:0px;left:0px;bottom:0px;right:4px;background-color:#FFF;">' +
+ 'style="position:absolute;top:0px;left:0px;bottom:0px;right:4px;background-color:#FFF;"> ' +
'<div id="clip_edit_ctrl" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;' +
- 'left:2px;top:5px;bottom:10px;width:' + ( maxWidth + 5 ) + 'px;overflow:auto;padding:5px;">' +
- '</div>' +
+ 'left:2px;top:5px;bottom:10px;width:' + ( maxWidth + 5 ) + 'px;overflow:auto;padding:5px;" >' +
+ '</div>' +
'<div id="clip_edit_disp" class="ui-widget ui-widget-content ui-corner-all"' +
- 'style="position:absolute;' + overflow_style + ';left:' + ( maxWidth + 20 ) + 'px;right:0px;top:5px;bottom:10px;padding:5px;>' +
+ 'style="position:absolute;' + overflow_style + ';left:' + ( maxWidth + 20 ) + 'px;right:0px;top:5px;bottom:10px;padding:5px;" >' +
mv_get_loading_img( 'position:absolute;top:30px;left:30px' ) +
- '</div>' +
- '</div>' );
+ '</div>' +
+ '</div>' );
},
resourceEdit:function( rObj, rsdElement ) {
js_log( 'f:resourceEdit:' + rObj.title );
);
js_log( "about to call rewrite_by_id::embed_vid" );
// Rewrite by id
- rewrite_by_id( 'embed_vid', function() {
+ rewrite_by_id( 'embed_vid', function() {
// Grab any information that we got from the ROE xml or parsed from the media file
rObj.pSobj.getEmbedObjParsedInfo( rObj, 'embed_vid' );
// Add the re-sizable to the doLoad request:
// @@ show user dialog to import the resource
$j( _this.target_container ).append( '<div id="rsd_resource_import" ' +
- 'class="ui-widget-content" ' +
- 'style="position:absolute;top:0px;left:0px;right:0px;bottom:0px;z-index:5">' +
+ 'class="ui-widget-content" style="position:absolute;top:0px;left:0px;right:0px;bottom:0px;z-index:5">' +
'<h3 style="color:red;padding:5px;">' + gM( 'mwe-resource-needs-import', [rObj.title, _this.upload_api_name] ) + '</h3>' +
'<div id="rsd_preview_import_container" style="position:absolute;width:50%;bottom:0px;left:5px;overflow:auto;top:30px;">' +
rObj.pSobj.getEmbedHTML( rObj, {
'max_height':'220',
'only_poster':true
} ) + // get embedHTML with small thumb:
- '<br style="clear both">' +
+ '<br style="clear both"/>' +
'<strong>' + gM( 'mwe-resource_page_desc' ) + '</strong>' +
'<div id="rsd_import_desc" style="display:inline;">' +
mv_get_loading_img( 'position:absolute;top:5px;left:5px' ) +
'<div id="rds_edit_import_container" style="position:absolute;left:50%;' +
'bottom:0px;top:30px;right:0px;overflow:auto;">' +
'<strong>' + gM( 'mwe-local_resource_title' ) + '</strong><br>' +
- '<input type="text" size="30" value="' + rObj.target_resource_title + '" /><br>' +
+ '<input type="text" size="30" value="' + rObj.target_resource_title + '" /></br>' +
'<strong>' + gM( 'mwe-edit_resource_desc' ) + '</strong>' +
'<textarea id="rsd_import_ta" id="mv_img_desc" style="width:90%;" rows="8" cols="50">' +
wt +
- '</textarea><br>' +
- '<input type="checkbox" value="true" id="wpWatchthis" name="wpWatchthis" tabindex="7"/>' +
- '<label for="wpWatchthis">' + gM( 'mwe-watch_this_page' ) + '</label><br><br><br>' +
+ '</textarea></br>' +
+ '<input type="checkbox" value="true" id="wpWatchthis" name="wpWatchthis" tabindex="7" />' +
+ '<label for="wpWatchthis">' + gM( 'mwe-watch_this_page' ) + '</label></br></br></br>' +
$j.btnHtml( gM( 'mwe-update_preview' ), 'rsd_import_apreview', 'refresh' ) + ' ' +
'</div>' +
// output the rendered and non-rendered version of description for easy switching:
// enable sequencer? (only display top frame no navigation or accompanying text
"sequencer":false
}
-// the call back rate for animations and internal timers in ms: 33 is about 30 frames a second:
+// The call back rate for animations and internal timers in ms: 33 is about 30 frames a second:
var MV_ANIMATION_CB_RATE = 33;
// globals:
// 10 possible colors for clips: (can be in hexadecimal)
var mv_clip_colors = new Array( 'aqua', 'blue', 'fuchsia', 'green', 'lime', 'maroon', 'navy', 'olive', 'purple', 'red' );
-// the base url for requesting stream metadata
+// The base url for requesting stream metadata
if ( typeof wgServer == 'undefined' ) {
var defaultMetaDataProvider = 'http://metavid.org/overlay/archive_browser/export_cmml?stream_name=';
} else {
userSlide:false,
loading:true,
loading_external_data:true, // if we are loading external data (set to loading by default)
+ //set initial state to "paused"
+ paused:true,
activeClipList:null,
playlist_buffer_time: 20, // how many seconds of future clips we should buffer
embed_code += 'src="' + this.src + '" />';
} else {
embed_code += '>' + "\n";
- embed_code += this.data.htmlEntities();
+ embed_code += escape( this.data );
embed_code += '<playlist/>';
}
this.cur_clip.embed.showShare( embed_code );
// update the title and status bar
this.updateBaseStatus();
- this.doSmilActions( true );
+ this.doSmilActions();
},
setupClipDisplay:function() {
js_log( 'mvPlaylist:setupClipDisplay:: clip len:' + this.default_track.clips.length );
this.cur_clip.embed.seek_time_sec = ( float_sec - pl_sum_time );
// render effects ontop: (handled by doSmilActions)
- this.doSmilActions( true );
+ this.doSmilActions();
},
updateBaseStatus:function() {
var _this = this;
var relative_perc = _this.updateClipByTime();
var clip_time = relative_perc * _this.cur_clip.embed.getDuration();
_this.cur_clip.embed.setCurrentTime( clip_time, function() {
- //update the smil actions:
- _this.doSmilActions( true );
+ //update the smil actions now that the seek is done
+ _this.doSmilActions();
//say we are "ready"
if ( callback )
callback();
}
}
}
+
// handles the rendering of overlays load of future clips (if necessary)
// @@todo could be lazy loaded if necessary
-mvPlayList.prototype.doSmilActions = function( single_frame ) {
+mvPlayList.prototype.doSmilActions = function( callback ) {
+ var _this = this;
// js_log('f:doSmilActions: ' + this.cur_clip.id + ' tid: ' + this.cur_clip.transOut );
var offSetTime = 0; // offset time should let us start a transition later on if we have to.
var _clip = this.cur_clip; // setup a local pointer to cur_clip
// do any smil time actions that may change the current clip
if ( this.userSlide ) {
- // current clip set is set via updateThumbTime function
+ // current clip set is updated mannually outside the scope of smil Actions
} else {
- // assume playing and go to next:
+ // Assume playing and go to next:
if ( _clip.dur <= _clip.embed.currentTime
&& _clip.order != _clip.pp.getClipCount() - 1 ) {
// force next clip
}
// @@todo could maybe generalize transIn with trasOut into one "flow" with a few scattered if statements
// update/setup all transitions (will render current transition state)
- var in_range = false;
- // pretty similar actions per transition types so group into a loop:
- var tran_types = {
- 'transIn' : true,
- 'transOut':true
- };
- for ( var tid in tran_types ) {
- eval( 'var tObj = _clip.' + tid );
- if ( !tObj )
- continue;
- // js_log('f:doSmilActions: ' + _clip.id + ' tid:'+tObj.id + ' tclip_id:'+ tObj.pClip.id);
- // make sue we are in range:
- if ( tid == 'transIn' )
- in_range = ( _clip.embed.currentTime <= tObj.dur ) ? true:false;
-
- if ( tid == 'transOut' )
- in_range = ( _clip.embed.currentTime >= ( _clip.dur - tObj.dur ) ) ? true:false;
-
- if ( in_range ) {
- if ( this.userSlide || single_frame ) {
- if ( tid == 'transIn' )
- mvTransLib.doUpdate( tObj, ( _clip.embed.currentTime / tObj.dur ) );
-
- if ( tid == 'transOut' )
- mvTransLib.doUpdate( tObj, ( _clip.embed.currentTime - ( _clip.dur - tObj.dur ) ) / tObj.dur );
-
- } else {
- if ( tObj.animation_state == 0 ) {
- js_log( 'init/run_transition ' );
- tObj.run_transition();
- }
- }
- } else {
- // close up transition if done & still onDispaly
- if ( tObj.overlay_selector_id ) {
- js_log( 'close up transition :' + tObj.overlay_selector_id );
- mvTransLib.doCloseTransition( tObj );
+
+ // process actions per transition types:
+ _this.procTranType( 'transIn', callback);
+ _this.procTranType( 'transOut', callback);
+}
+
+/*
+* procTranType
+* @param {string} tid the transition type [transIn|transOut]
+* @param {function} callback the callback function passed onto doUPdate
+*/
+mvPlayList.prototype.procTranType = function( tid, callback){
+ // Setup local clip pointer:
+ var _clip = this.cur_clip;
+
+ eval( 'var tObj = _clip.' + tid );
+ if ( !tObj )
+ return;
+ // js_log('f:doSmilActions: ' + _clip.id + ' tid:'+tObj.id + ' tclip_id:'+ tObj.pClip.id);
+ // Check if we are in range:
+ if ( tid == 'transIn' )
+ in_range = ( _clip.embed.currentTime <= tObj.dur ) ? true : false;
+
+ if ( tid == 'transOut' )
+ in_range = ( _clip.embed.currentTime >= ( _clip.dur - tObj.dur ) ) ? true : false;
+
+ if ( in_range ) {
+ if ( this.userSlide || this.paused ) {
+ if ( tid == 'transIn' ){
+ mvTransLib.doUpdate( tObj,
+ ( _clip.embed.currentTime / tObj.dur ),
+ callback );
+ }
+ if ( tid == 'transOut' ){
+ mvTransLib.doUpdate( tObj,
+ ( ( _clip.embed.currentTime - ( _clip.dur - tObj.dur ) ) / tObj.dur ),
+ callback );
}
+ } else if ( tObj.animation_state == 0 ) {
+ js_log( 'init/run_transition ' );
+ tObj.run_transition();
+ }
+ } else {
+ // Close up transition if done & still onDispaly
+ if ( tObj.overlay_selector_id ) {
+ js_log( 'close up transition :' + tObj.overlay_selector_id );
+ mvTransLib.doCloseTransition( tObj );
}
}
+ // Run the callback::
+ if( callback )
+ callback();
}
/*
* @param offSetTime default value 0 if we need to start rendering from a given time
*/
doInitTransition:function( tObj ) {
- js_log( 'mvTransLib:f:doInitTransition' );
+ js_log( 'mvTransLib:f:doInitTransition' );
if ( !tObj.type ) {
js_log( 'transition is missing type attribute' );
return false;
if ( typeof( other_pClip ) == 'undefined' || other_pClip === false || other_pClip.id == tObj.pClip.pp.cur_clip.id )
js_log( 'Error: crossfade without target media asset' );
// if not sliding start playback:
- if ( !tObj.pClip.pp.userSlide ) {
- other_pClip.embed.play();
- // manualy ad the extra layer to the activeClipList
- tObj.pClip.pp.activeClipList.add( other_pClip );
+ if ( !tObj.pClip.pp.userSlide && !tObj.pClip.pp.paused) {
+ other_pClip.embed.play();
+ }else{
+ //issue a load request:
+ other_pClip.embed.load();
}
+ // manualy ad the extra layer to the activeClipList
+ tObj.pClip.pp.activeClipList.add( other_pClip );
tObj.overlay_selector_id = 'clipDesc_' + other_pClip.id;
} else {
tObj.overlay_selector_id = this.getOverlaySelector( tObj );
}
return overlay_selector_id;
},
- doUpdate:function( tObj, percent ) {
+ doUpdate:function( tObj, percent, callback ) {
// init the transition if necessary:
if ( !tObj.overlay_selector_id )
this.doInitTransition( tObj );
// @@todo we should ensure viability outside of doUpate loop
if ( !$j( '#' + tObj.overlay_selector_id ).is( ':visible' ) )
$j( '#' + tObj.overlay_selector_id ).show();
-
+
// do update:
- /*js_log('doing update for: '+ tObj.pClip.id +
+ /* js_log('doing update for: '+ tObj.pClip.id +
' type:' + tObj.transAttrType +
' t_type:'+ tObj.type +
' subypte:'+ tObj.subtype +
' percent:' + percent);*/
- this['type'][tObj.type][tObj.subtype].u( tObj, percent );
+ this[ 'type' ][ tObj.type ][ tObj.subtype ].u( tObj, percent, callback);
},
getTransitionIcon:function( type, subtype ) {
return mv_embed_path + '/skins/common/transition_images/' + type + '_' + subtype + '.png';
* mvTransLib: functional library mapping:
*/
type: {
- // types:
+ // Types:
fade: {
fadeFromColor: {
- 'attr':['fadeColor'],
- 'init':function( tObj ) {
+ 'attr' : ['fadeColor'],
+ 'init' : function( tObj ) {
// js_log('f:fadeFromColor: '+tObj.overlay_selector_id +' to color: '+ tObj.fadeColor);
if ( !tObj.fadeColor )
js_log( 'missing fadeColor' );
'opacity':"1"
} );
},
- 'u':function( tObj, percent ) {
+ 'u' : function( tObj, percent ) {
// js_log(':fadeFromColor:update: '+ percent);
// fade from color (invert the percent)
var percent = 1 - percent;
},
// corssFade
crossfade: {
- "attr":[],
- "init":function( tObj ) {
+ "attr" : [],
+ "init" : function( tObj ) {
js_log( 'f:crossfade: ' + tObj.overlay_selector_id );
if ( $j( '#' + tObj.overlay_selector_id ).length == 0 )
js_log( "ERROR overlay selector not found: " + tObj.overlay_selector_id );
$j( '#' + tObj.overlay_selector_id ).css( { 'opacity':0 } ).show();
},
'u':function( tObj, percent ) {
+ // Do the relative seek:
$j( '#' + tObj.overlay_selector_id ).css( {
"opacity" : percent
} );
var elmObj = { };
for ( var i in this.supported_attributes ) {
var attr = this.supported_attributes[i];
- if ( this[attr] )
- elmObj[ attr ] = this[attr];
+ if ( this[ attr ] )
+ elmObj[ attr ] = this[ attr ];
}
return elmObj;
},
// this.interValCount=0;
// }
// }
- // start_time =asigned by doSmilActions
+
+ // start_time =assigned by doSmilActions
// base_cur_time = pClip.embed.currentTime;
- // dur = asigned by attribute
+ // dur = assigned by attribute
if ( this.animation_state == 0 ) {
mvTransLib.doInitTransition( this );
this.animation_state = 1;
}
- // set percentage include difrence of currentTime to prev_curTime
+ // set percentage include diffrence of currentTime to prev_curTime
// ie updated in-between currentTime updates)
if ( this.transAttrType == 'transIn' )
}
return { x:oLeft, y:oTop };
}
-String.prototype.htmlEntities = function() {
- var chars = new Array ( '&', 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é',
- 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô',
- 'õ', 'ö', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ', 'À',
- 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë',
- 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö',
- 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'Þ', '€', '\"', 'ß', '<',
- '>', '¢', '£', '¤', '¥', '¦', '§', '¨', '©', 'ª', '«',
- '¬', '', '®', '¯', '°', '±', '²', '³', '´', 'µ', '¶',
- '·', '¸', '¹', 'º', '»', '¼', '½', '¾' );
-
- var entities = new Array ( 'amp', 'agrave', 'aacute', 'acirc', 'atilde', 'auml', 'aring',
- 'aelig', 'ccedil', 'egrave', 'eacute', 'ecirc', 'euml', 'igrave',
- 'iacute', 'icirc', 'iuml', 'eth', 'ntilde', 'ograve', 'oacute',
- 'ocirc', 'otilde', 'ouml', 'oslash', 'ugrave', 'uacute', 'ucirc',
- 'uuml', 'yacute', 'thorn', 'yuml', 'Agrave', 'Aacute', 'Acirc',
- 'Atilde', 'Auml', 'Aring', 'AElig', 'Ccedil', 'Egrave', 'Eacute',
- 'Ecirc', 'Euml', 'Igrave', 'Iacute', 'Icirc', 'Iuml', 'ETH', 'Ntilde',
- 'Ograve', 'Oacute', 'Ocirc', 'Otilde', 'Ouml', 'Oslash', 'Ugrave',
- 'Uacute', 'Ucirc', 'Uuml', 'Yacute', 'THORN', 'euro', 'quot', 'szlig',
- 'lt', 'gt', 'cent', 'pound', 'curren', 'yen', 'brvbar', 'sect', 'uml',
- 'copy', 'ordf', 'laquo', 'not', 'shy', 'reg', 'macr', 'deg', 'plusmn',
- 'sup2', 'sup3', 'acute', 'micro', 'para', 'middot', 'cedil', 'sup1',
- 'ordm', 'raquo', 'frac14', 'frac12', 'frac34' );
-
- newString = this;
- for ( var i = 0; i < chars.length; i++ )
- {
- myRegExp = new RegExp();
- myRegExp.compile( chars[i], 'g' )
- newString = newString.replace ( myRegExp, '&' + entities[i] + ';' );
- }
- return newString;
-};
var urlparts = getRemoteEmbedPath();
var mwEmbedHostPath = urlparts[0];
-var mwRemoteVersion = '1.08';
+var mwRemoteVersion = '1.09';
var mwUseScriptLoader = true;
// setup up request Params:
}
} );
-function doPageSpecificRewrite() {
+function doPageSpecificRewrite() {
// Add media wizard
- if ( wgAction == 'edit' || wgAction == 'submit' ) {
- load_mv_embed( function() {
+ if ( wgAction == 'edit' || wgAction == 'submit' ) {
+ var jsSetEdit = [ 'remoteSearchDriver', '$j.fn.textSelection', '$j.ui', '$j.ui.sortable' ]
+ mwr_load_mv_embed( jsSetEdit, function() {
loadExternalJs( mwEmbedHostPath + '/editPage.js?' + mwGetReqArgs() );
} );
}
// Timed text display:
if ( wgPageName.indexOf( "TimedText" ) === 0 ) {
- load_mv_embed( function() {
+ mwr_load_mv_embed( function() {
// Load with mw loader to get localized interface:
mw.load( ['mvTimeTextEdit'], function() {
- // could run init here (but mvTimeTextEdit included onLoad actions)
+ // could run init here (but mvTimeTextEdit already included onLoad actions)
} );
} );
}
// Firefogg integration
- if ( wgPageName == "Special:Upload" ) {
- load_mv_embed( function() {
+ if ( wgPageName == "Special:Upload" ) {
+ var jsSetUpload = [ 'mvBaseUploadInterface', 'mvFirefogg' , '$j.ui',
+ '$j.ui.progressbar', '$j.ui.dialog', '$j.ui.draggable' ];
+ mwr_load_mv_embed( jsSetUpload, function() {
loadExternalJs( mwEmbedHostPath + '/uploadPage.js?' + mwGetReqArgs() );
} );
}
// Special api proxy page
if ( wgPageName == 'MediaWiki:ApiProxy' ) {
var wgEnableIframeApiProxy = true;
- load_mv_embed( function() {
- js_log( "Wiki:ApiProxy::" );
+ mwr_load_mv_embed( [ 'mw.proxy' ], function() {
loadExternalJs( mwEmbedHostPath + '/apiProxyPage.js?' + mwGetReqArgs() );
} );
}
}
}
if ( vidIdList.length > 0 ) {
- load_mv_embed( function() {
+
+ var jsSetVideo = [ 'embedVideo', '$j.ui', 'ctrlBuilder', '$j.cookie', '$j.ui.slider' ];
+
+ // Quick sniff use java if IE and native if firefox
+ // ( other browsers will run detect and get on-demand )
+ if (navigator.userAgent.indexOf("MSIE") != -1)
+ jsSetVideo.push( 'javaEmbed' );
+
+ if ( navigator.userAgent && navigator.userAgent.indexOf("Firefox") != -1 )
+ jsSetVideo.push( 'nativeEmbed' );
+
+ mwr_load_mv_embed( jsSetVideo, function() {
mvJsLoader.embedVideoCheck( function() {
// Do utility rewrite of OggHandler content:
rewrite_for_OggHandler( vidIdList );
var pimg = $j( '#' + vidId + ' img' );
var poster_attr = 'poster = "' + pimg.attr( 'src' ) + '" ';
var pwidth = $j( '#' + vidId ).width();
- var pheight = $j( '#' + vidId + ' img' ).height();
- var tag_type = 'video';
+ var pheight = $j( '#' + vidId + ' img :first' ).attr( 'height' );
+ if(!pheight)
+ pheight = parseInt( pwidth * .75 );
+ var tag_type = 'video';
// Check for audio
if ( pheight == '22' || pheight == '52' ) {
}
return rurl;
}
-function load_mv_embed( callback ) {
+/**
+* @param {mixed} function or classSet to preload
+* classSet saves round trips to the server by grabbing things we will likely need in the first request.
+* ( this is essentially a shortcut to mv_jqueryBindings in mv_embed.js )
+* @param {callback} function callback to be called once mv_embed is ready
+*/
+function mwr_load_mv_embed( classSet, callback ) {
+ if( typeof classSet == 'function')
+ callback = classSet;
// Inject mv_embed if needed
if ( typeof mw == 'undefined' ) {
if ( ( mwReqParam['uselang'] || mwReqParam['useloader'] ) && mwUseScriptLoader ) {
var rurl = mwEmbedHostPath + '/mwEmbed/jsScriptLoader.php?class=mv_embed';
+
// Add jQuery too if we need it:
if ( typeof window.jQuery == 'undefined' ) {
rurl += ',window.jQuery';
+ }
+
+ // Add requested classSet
+ for( var i=0; i < classSet.length; i++ ){
+ var cName = classSet[i];
+ if( !mwr_check_obj_path( cName ) ){
+ rurl += ',' + cName;
+ }
}
+
+ // Add the remaining arguments
rurl += '&' + mwGetReqArgs();
importScriptURI( rurl );
- } else {
+ } else {
+ // Ingore classSet (will be loaded onDemand )
importScriptURI( mwEmbedHostPath + '/mwEmbed/mv_embed.js?' + mwGetReqArgs() );
}
}
- check_for_mv_embed( callback );
+ mwr_check_for_mv_embed( callback );
}
-function check_for_mv_embed( callback ) {
+function mwr_check_for_mv_embed( callback ) {
if ( typeof mw == 'undefined' ) {
setTimeout( function() {
- check_for_mv_embed( callback );
+ mwr_check_for_mv_embed( callback );
}, 25 );
} else {
callback();
}
}
+
+function mwr_check_obj_path ( libVar ) {
+ if ( !libVar )
+ return false;
+ var objPath = libVar.split( '.' )
+ var cur_path = '';
+ for ( var p = 0; p < objPath.length; p++ ) {
+ cur_path = ( cur_path == '' ) ? cur_path + objPath[p] : cur_path + '.' + objPath[p];
+ eval( 'var ptest = typeof ( ' + cur_path + ' ); ' );
+ if ( ptest == 'undefined' ) {
+ this.missing_path = cur_path;
+ return false;
+ }
+ }
+ this.cur_path = cur_path;
+ return true;
+};