* Since this is proxy server set a pre-append debug flag to know which debug msgs are coming from where
*/
-$mw.conf['debug_pre'] = 'Proxy';
+mw.conf['debug_pre'] = 'Proxy';
if( !mwApiProxyConfig )
var mwApiProxyConfig = {};
<script type="text/javascript" src="../mv_embed.js?debug=true"></script>
<!--<script type="text/javascript" src="../jsScriptLoader.php?class=window.jQuery,mv_embed,remoteSearchDriver,$j.ui,$j.ui.resizable,$j.ui.draggable,$j.ui.dialog,$j.ui.tabs,$j.ui.sortable,$j.cookie,baseRemoteSearch&urid=1257728132531&debug=true&uselang=en"></script> -->
<script type="text/javascript">
- js2AddOnloadHook(function(){
+ js2AddOnloadHook(function(){
$j('#add_media_link').addMediaWiz( {
'profile':'html_edit',
'target_textbox': '#wpTextbox1',
break;
}
- if(typestr=='unk')
+ if(typestr=='unk'){
js_log("unkown ftype: " + mimetype );
+ return '';
+ }
return '<div class="rsd_file_type ui-corner-all ui-state-default ui-widget-content" title="' + gM('mwe-ftype-' + typestr) + '">' +
typestr +
//@@todo we should instead support the wiki number format template system instead of inline calls
if( cp.sObj.num_results != 0 ){
if( cp.sObj.num_results > cp.limit){
- out+= gM( 'rsd_results_desc_total', [(cp.offset+1), to_num, $mw.lang.formatNumber( cp.sObj.num_results )] );
+ out+= gM( 'rsd_results_desc_total', [(cp.offset+1), to_num, mw.lang.formatNumber( cp.sObj.num_results )] );
}else{
out+= gM( 'rsd_results_desc', [(cp.offset+1), to_num] );
}
return this.init( iObj );
}
archiveOrgSearch.prototype = {
- //archive.org constants:
+ // Archive.org constants:
dnUrl:'http://www.archive.org/download/',
dtUrl:'http://www.archive.org/details/',
init:function( iObj ){
- //init base class and inherit:
+ // Init base class and inherit:
var baseSearch = new baseRemoteSearch( iObj );
for(var i in baseSearch){
if(typeof this[i] =='undefined'){
this['parent_'+i] = baseSearch[i];
}
}
- //inherit the cp settings for
+ // Inherit the cp settings for
},
getSearchResults:function(){
//call parent:
var resource = data.photos.photo[resource_id];
var rObj = {
- 'titleKey' : resource.title + '.jpg',
- 'resourceKey': resource.id,
+ 'titleKey' : resource.title + '.jpg',
+ 'resourceKey': resource.id,
'link' : _this.dtUrl + resource.pathalias + '/'+ resource.id,
'title' : resource.title,
'thumbwidth' : resource.width_t,
};
/*
//to use once we get the wiki-text parser in shape
- var pObj = $mw.parser.pNew( rObj.desc );
+ var pObj = mw.parser.pNew( rObj.desc );
//structured data on commons is based on the "information" template:
var tmplInfo = pObj.templates( 'information' );
*/
"mwe-copy-code" : "Copy code"
});
-//set the globals:
-var commons_api_url = 'http://commons.wikimedia.org/w/api.php';
-
var default_video_attributes = {
"id" : null,
"class" : null,
mvEmbed.flist.push( swap_done_callback );
//get mv_embed location if it has not been set
- js_log('mv_video_embed:: ' + $mw.version);
+ js_log('mv_video_embed:: ' + mw.version);
var loadPlaylistLib=false;
js_log( "Do SWAP: " + $j(this_elm).attr("id") + ' tag: '+ this_elm.tagName.toLowerCase() );
if( $j(this_elm).attr("id") == '' ){
- $j(this_elm).attr("id", 'v'+ $mw.player_list.length);
+ $j(this_elm).attr("id", 'v'+ mw.player_list.length);
}
//store a global reference to the id
- $mw.player_list.push( $j(this_elm).attr("id") );
+ mw.player_list.push( $j(this_elm).attr("id") );
//if video doSwap
switch( this_elm.tagName.toLowerCase()){
$j('#'+embed_video.id).get(0).init_with_sources_loaded();
}
- js_log('done with child: ' + embed_video.id + ' len:' + $mw.player_list.length);
+ js_log('done with child: ' + embed_video.id + ' len:' + mw.player_list.length);
return true;
},
//this should not be needed.
checkClipsReady : function(){
//js_log('checkClipsReady');
var is_ready=true;
- for(var i=0; i < $mw.player_list.length; i++){
- if( $j('#'+$mw.player_list[i]).length !=0){
- var cur_vid = $j('#'+$mw.player_list[i]).get(0);
+ for(var i=0; i < mw.player_list.length; i++){
+ if( $j('#'+mw.player_list[i]).length !=0){
+ var cur_vid = $j('#'+mw.player_list[i]).get(0);
is_ready = ( cur_vid.ready_to_play ) ? is_ready : false;
if( !is_ready && cur_vid.load_error ){
is_ready=true;
//set the skin name from the class
var sn = element.getAttribute('class');
if( sn && sn != ''){
- for(var n=0;n< $mw.valid_skins.length;n++){
- if( sn.indexOf($mw.valid_skins[n]) !== -1){
- this.skin_name = $mw.valid_skins[n];
+ for(var n=0;n< mw.valid_skins.length;n++){
+ if( sn.indexOf(mw.valid_skins[n]) !== -1){
+ this.skin_name = mw.valid_skins[n];
}
}
}
//set the default if unset:
if(!this.skin_name)
- this.skin_name = $mw.conf.skin_name;
+ this.skin_name = mw.conf.skin_name;
//make sure startOffset is cast as an int
if( this.startOffset && this.startOffset.split(':').length >= 2)
js_log("duration is: " + this.duration);
//get defaults
- var dwh = $mw.conf['video_size'].split('x');
+ var dwh = mw.conf['video_size'].split('x');
this.width = element.style.width ? element.style.width : dwh[0];
if( element.tagName == 'AUDIO' ){
this.height = element.style.height ? element.style.height : 0;
};
do_api_req({
'data':reqObj,
- 'url': commons_api_url
+ 'url': mw.commons_api_url
}, function(data){
//empty the videos:
$j('#dc_'+ _this.id + ' .related_vids ul').html(' ');
}
if( selected_player )
{
- for(var i=0; i < $mw.player_list.length; i++)
+ for(var i=0; i < mw.player_list.length; i++)
{
- var embed = $j('#'+$mw.player_list[i]).get(0);
+ var embed = $j('#'+mw.player_list[i]).get(0);
if(embed.media_element.selected_source && (embed.media_element.selected_source.mime_type == mime_type))
{
embed.selectPlayer(selected_player);
}
},
monitor : function(){
- this.getVID(); //make shure we have .vid obj
+ this.getVID(); //make sure we have .vid obj
if(!this.vid){
js_log('could not find video embed: '+this.id + ' stop monitor');
this.stopMonitor();
return false;
}
- //don't update status if we are not the current clip (playlist leekage?) .. should move to playlist overwite of monitor?
+ //don't update status if we are not the current clip
+ //(playlist leakage?) .. should move to playlist overwrite of monitor?
if(this.pc){
if(this.pc.pp.cur_clip.id != this.pc.id)
return true;
}
}
-})(window.$mw);
+})(window.mw);
//init a new availableTracks obj:
this.availableTracks = new Array();
//set the parent embed object:
- this.pe=parentEmbed;
+ this.pe = parentEmbed;
//parse roe if not already done:
- this.getTimedTextTracks();
+ this.getTextTracks();
},
//@@todo separate out data loader & data display
- getTimedTextTracks:function(){
+ getTextTracks:function(){
//js_log("load timed text from roe: "+ this.pe.roe);
var _this = this;
- var apiUrl = mwGetLocalApiUrl();
//if roe not yet loaded do load it:
if(this.pe.roe || _this.pe.wikiTitleKey ){
if(!this.pe.media_element.addedROEData){
_this.pe.media_element.addROE(data);
_this.getParseTimedText_rowReady();
});
- }else if( _this.pe.wikiTitleKey ){
+ }else if( _this.pe.wikiTitleKey ){
//check for a clear namespace key:
- var timedtext_ns = 102;
- if( wgNamespaceIds && wgNamespaceIds['timedtext']){
- timedtext_ns = wgNamespaceIds['timedtext'];
- }
- do_api_req({
- 'url' : apiUrl,
- 'data': {
- 'list' : 'allpages',
- 'apprefix' : _this.pe.wikiTitleKey,
- 'apnamespace' : timedtext_ns,
- 'prop':'revisions'
- }
- }, function( subData ) {
- if( subData.error && subData.error.code == 'apunknown_apnamespace'){
- do_api_req({
- 'url' : apiUrl,
- 'data': {
- 'list' : 'allpages',
- 'apprefix' : 'TimedText:' + _this.pe.wikiTitleKey,
- }
- }, function( subData ) {
- _this.doProcSubPages( subData, wgServer + wgScriptPath);
- });
- }else{
- _this.doProcSubPages( subData, wgServer + wgScriptPath);
- }
- });
+ _this.getTextTracksWikiTitle()
}
}else{
js_log('row data ready (no roe request)');
}
}
},
+ getTextTracksWikiTitle:function(){
+ var apiUrl = mw.getLocalApiUrl();
+ var _this = this;
+
+ var timedtext_ns = 102;
+ if( typeof wgNamespaceIds != 'undefined' && wgNamespaceIds['timedtext']){
+ timedtext_ns = wgNamespaceIds['timedtext'];
+ }
+ do_api_req({
+ 'url' : apiUrl,
+ 'data': {
+ 'list' : 'allpages',
+ 'apprefix' : _this.pe.wikiTitleKey,
+ 'apnamespace' : timedtext_ns,
+ 'prop':'revisions'
+ }
+ }, function( subData ) {
+ if( subData.error && subData.error.code == 'apunknown_apnamespace'){
+ do_api_req({
+ 'url' : apiUrl,
+ 'data': {
+ 'list' : 'allpages',
+ 'apprefix' : 'TimedText:' + _this.pe.wikiTitleKey,
+ }
+ }, function( subData ) {
+ _this.doProcSubPages( subData, wgServer + wgScriptPath);
+ });
+ }else{
+ _this.doProcSubPages( subData, wgServer + wgScriptPath);
+ }
+ });
+ },
doProcSubPages: function( subData, hostPath ){
var _this = this;
//look for text tracks:
js_log('image is shared checking commons for subtitles');
//found shared repo assume commons:
do_api_req({
- 'url': 'http://commons.wikimedia.org/w/api.php',
+ 'url': mw.commons_api_url,
'data':{
'list' : 'allpages',
'apprefix' : _this.pe.wikiTitleKey,
return false;
}
}
+
if( typeof mvCssPaths == 'undefined' )
mvCssPaths = {};
"$j.Jcrop" : "libClipEdit/Jcrop/js/jquery.Jcrop.js",
"$j.fn.simpleUploadForm" : "libAddMedia/simpleUploadForm.js",
- "$mw.proxy" : "libMwApi/mw.proxy.js",
+ "mw.proxy" : "libMwApi/mw.proxy.js",
- "$mw.testLang" : "tests/testLang.js",
+ "mw.testLang" : "tests/testLang.js",
"ctrlBuilder" : "skins/ctrlBuilder.js",
"kskinConfig" : "skins/kskin/kskin.js",
// For use when mv_embed with script-loader is in the root MediaWiki path
var mediaWiki_mvEmbed_path = 'js2/mwEmbed/';
-//The global scope: will be depreciated once we get everything into $mw
+//The global scope: will be depreciated once we get everything into mw
var _global = this;
/*
-* setup the empty global $mw object
+* setup the empty global mw object
* will ensure all our functions and variables are properly namespaced
* reducing chance of conflicts
*/
-if(!window['$mw']){
- window['$mw'] = {}
+if(!window['mw']){
+ window['mw'] = {}
}
-//@@todo move these into $mw
+//@@todo move these into mw
var global_req_cb = new Array(); // The global request callback array
// Get the mv_embed location if it has not been set
var mv_embed_path = getMvEmbedPath();
}
/**
-* The global $mw object:
+* The global mw object:
*
* Any global functions/classes that are not jQuery plugins should make
-* there way into the $mw namespace
+* there way into the mw namespace
*/
(function( $ ) {
/*
// the version of mwEmbed
$.version = '1.0r21';
+ //special case of commons api url
+ //(used for default subtitles server for media with a "wikiTitleKey" atm)
+ //(@@todo eventually we should have wikiTitleKey be namespaced with interwiki ns
+ $.commons_api_url = 'http://commons.wikimedia.org/w/api.php';
/*
* some global containers flags
*/
$.req_cb = new Array() // The global request callback array
/*
- * Language classes $mw.lang
+ * Language classes mw.lang
*
* Localized Language support attempts to mirror the functionality of Language.php in MediaWiki
* It contains methods for loading and transforming msg text
// ~ probably a better algorithm out there / should mirror php parser flow ~
// (we are already running white-space issues ie php parse strips whitespace differently)
+ // or at least expose something similar to: http://www.mediawiki.org/wiki/Extension:Page_Object_Model
// ... but I am having fun with recursion so here it is...
- // or at least mirror: http://www.mediawiki.org/wiki/Extension:Page_Object_Model
function rdpp ( txt , cn){
var node = {};
//inspect each char
tObj["name"] = tname.split(':').shift();
tObj["arg"] = tname.split(':').pop();
}
-
- //js_log("TNAME::" + tObj["name"] + ' from:: ' + ts);
+
var pSet = ts.split('\|');
pSet.splice(0,1);
if( pSet.length ){
//return the parserObj
return new parseObj( wikiText, opt) ;
}
-
-})(window.$mw);
+
+ /*
+ * API and request functions
+ */
+ $.getLocalApiUrl = function() {
+ if ( typeof wgServer != 'undefined' && typeof wgScriptPath != 'undefined') {
+ return wgServer + wgScriptPath + '/api.php';
+ }
+ return false;
+ }
+
+})(window.mw);
//load in js2 stopgap into proper location:
if( typeof gMsg != 'undefined'){
- $mw.lang.loadGM( gMsg )
+ mw.lang.loadGM( gMsg )
}
//setup legacy global shortcuts:
-var loadGM = $mw.lang.loadGM;
-var loadRS = $mw.lang.loadRS;
-var gM = $mw.lang.gM;
+var loadGM = mw.lang.loadGM;
+var loadRS = mw.lang.loadRS;
+var gM = mw.lang.gM;
// All default messages in [English] should be overwritten by the CMS language message system.
-$mw.lang.loadGM({
+mw.lang.loadGM({
"mwe-loading_txt" : "Loading ...",
"mwe-size-gigabytes" : "$1 GB",
"mwe-size-megabytes" : "$1 MB",
* checks for jQuery and adds the $j noConflict var
*/
jQueryCheck: function( callback ) {
- //js_log( 'jQueryCheck::' );
+ //js_log( 'jQueryCheck::' + this.jQuerySetupFlag);
var _this = this;
// Skip stuff if $j is already loaded:
if( _global['$j'] ){
callback(); //call the callback now
callback=null;
- // Check if we have jquery-ui css loaded and assigned skin globals
+ // This is tricky because js2stopgap registers $j without doing the "setup"
if( _this.jQuerySetupFlag )
return ;
}
// Setup our global settings using the (jQuery helper)
// Set up the skin path
- _global['mv_jquery_skin_path'] = mv_embed_path + 'jquery/jquery.ui/themes/' + $mw.conf['jui_skin'] + '/';
- _global['mv_skin_img_path'] = mv_embed_path + 'skins/' + $mw.conf['skin_name'] + '/images/';
+ _global['mv_jquery_skin_path'] = mv_embed_path + 'jquery/jquery.ui/themes/' + mw.conf['jui_skin'] + '/';
+ _global['mv_skin_img_path'] = mv_embed_path + 'skins/' + mw.conf['skin_name'] + '/images/';
_global['mv_default_thumb_url'] = mv_skin_img_path + 'vid_default_thumb.jpg';
// Make sure the skin/style sheets are always available:
loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
- loadExternalCss( mv_embed_path + 'skins/' + $mw.conf['skin_name'] + '/styles.css' );
+ loadExternalCss( mv_embed_path + 'skins/' + mw.conf['skin_name'] + '/styles.css' );
// Set up AJAX to not send dynamic URLs for loading scripts (we control that with
// the scriptLoader)
mv_jqueryBindings();
_this.jQuerySetupFlag = true;
+ //js_log('should run callback: ' + callback);
// Run the callback if not already run above
if( callback ) {
callback();
];
//add any requested skins (supports multiple skins per single page)
- if( $mw.skin_list ){
- for(var i in $mw.skin_list ){
- depReq[0].push( $mw.skin_list[i] + 'Config' );
+ if( mw.skin_list ){
+ for(var i in mw.skin_list ){
+ depReq[0].push( mw.skin_list[i] + 'Config' );
}
}
function mwLoad( loadSet, callback ) {
mvJsLoader.doLoad( loadSet, callback );
}
-//$mw.shortcut
-$mw.load = mwLoad;
+//mw.shortcut
+mw.load = mwLoad;
// Load an external JS file. Similar to jquery .require plugin,
// but checks for object availability rather than load state.
* $j(document).ready( function(){ */
function mwdomReady( force ) {
js_log( 'f:mwdomReady:' );
- if( !force && $mw.init_done ) {
+ if( !force && mw.init_done ) {
js_log( "mw done, do nothing..." );
return false;
}
- $mw.init_done = true;
+ mw.init_done = true;
// Handle the execution of queued functions with jQuery "ready"
// Check if this page has a video, audio or playlist tag
if(e[j][k] && typeof( e[j][k]) == 'object'){
var sn = e[j][k].getAttribute('class');
if( sn && sn != ''){
- for(var n=0;n< $mw.valid_skins.length;n++){
- if( sn.indexOf($mw.valid_skins[n]) !== -1){
- $mw.skin_list.push( $mw.valid_skins[n] );
+ for(var n=0;n< mw.valid_skins.length;n++){
+ if( sn.indexOf(mw.valid_skins[n]) !== -1){
+ mw.skin_list.push( mw.valid_skins[n] );
}
}
}
//js2AddOnloadHook: ensure jQuery and the DOM are ready
function js2AddOnloadHook( func ) {
//js_log('js2AddOnloadHook:: jquery:' +func);
- //check for jQuery then add the load event (to run after video tag rewrites (if present)
- mvJsLoader.jQueryCheck( function() {
- if( mvJsLoader.doneReadyEvents ) {
- //js_log('run queued event: ' + func);
- func();
- } else {
- mvJsLoader.addLoadEvent( func );
- }
- });
+ // If we are ready run directly else add load event:
+ if( mvJsLoader.doneReadyEvents ) {
+ js_log('run queued event: ' + func);
+ func();
+ } else {
+ js_log('add to load event: ' + func);
+ mvJsLoader.addLoadEvent( func );
+ }
}
// Deprecated mwAddOnloadHook in favour of js2 naming (for clear separation of js2 code from old MW code
var mwAddOnloadHook = js2AddOnloadHook;
if( this.selector ){
var _this = this;
//load the dragger and "setup"
- $mw.load( ['$j.fn.dragDropFile'], function(){
+ mw.load( ['$j.fn.dragDropFile'], function(){
$j(_this.selector).dragDropFile();
});
}
$.apiProxy = function( mode, pConf, callback ){
js_log('do apiProxy setup');
mvJsLoader.doLoad( [
- '$mw.proxy',
+ 'mw.proxy',
'JSON'
], function(){
//do the proxy setup or
if( mode == 'client'){
//just do the setup (no callbcak for client setup)
- $mw.proxy.client( pConf );
+ mw.proxy.client( pConf );
if( callback )
callback();
}else if( mode=='server' ){
//do the request with the callback
- $mw.proxy.server( pConf , callback );
+ mw.proxy.server( pConf , callback );
}
});
}
// Load the mv_embed_base skin:
loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
- loadExternalCss( mv_embed_path + 'skins/' + $mw.conf['skin_name'] + '/styles.css' );
+ loadExternalCss( mv_embed_path + 'skins/' + mw.conf['skin_name'] + '/styles.css' );
// Load all the required libs:
mvJsLoader.jQueryCheck( function() {
// Load with staged dependencies (for IE that does not execute in order)
iObj['target_sequence_container'] = this.selector;
// Issue a request to get the CSS file (if not already included):
loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
- loadExternalCss( mv_embed_path + 'skins/' + $mw.conf['skin_name'] + '/mv_sequence.css' );
+ loadExternalCss( mv_embed_path + 'skins/' + mw.conf['skin_name'] + '/mv_sequence.css' );
// Make sure we have the required mv_embed libs (they are not loaded when no video
// element is on the page)
mvJsLoader.embedVideoCheck( function() {
iObj = {};
// Add the base theme CSS:
loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
- loadExternalCss( mv_embed_path + 'skins/' + $mw.conf['skin_name'] + '/styles.css' );
+ loadExternalCss( mv_embed_path + 'skins/' + mw.conf['skin_name'] + '/styles.css' );
// Check if we already have Firefogg loaded (the call just updates the element's
// properties)
}
$.mwProxy = function( apiConf ){
- mvJsLoader.doLoad( ['$mw.apiProxy'],
+ mvJsLoader.doLoad( ['mw.apiProxy'],
function(){
- $mw.apiProxy( apiConf );
+ mw.apiProxy( apiConf );
});
}
})(jQuery);
}
// Generate the URL if it's missing
if( typeof options.url == 'undefined' || !options.url ) {
- if( !wgServer || ! wgScriptPath ) {
+ if( typeof wgServer == 'undefined' ) {
return js_error('Error: no api url for api request');
}
- options.url = mwGetLocalApiUrl();
+ options.url = mw.getLocalApiUrl();
}
if( typeof options.data == 'undefined' )
options.data = {};
options.data['action'] = 'query';
// js_log('do api req: ' + options.url +'?' + jQuery.param(options.data) );
- if( options.url == 'proxy' && $mw.proxy){
- //assume the proxy is already "setup" since $mw.proxy is defined.
+ if( options.url == 'proxy' && mw.proxy){
+ //assume the proxy is already "setup" since mw.proxy is defined.
// @@todo we probably integrate that setup into the api call
- $mw.proxy.doRequest( options.data, callback);
+ mw.proxy.doRequest( options.data, callback);
}else if( parseUri( document.URL ).host == parseUri( options.url ).host ) {
// Local request: do API request directly
$j.ajax({
req_url += paramAnd + encodeURIComponent( i ) + '=' + encodeURIComponent( options.data[i] );
paramAnd = '&';
}
- var fname = 'mycpfn_' + ( $mw.cb_count++ );
+ var fname = 'mycpfn_' + ( mw.cb_count++ );
_global[ fname ] = callback;
req_url += '&' + options.jsonCB + '=' + fname;
loadExternalJs( req_url );
}
}
-function mwGetLocalApiUrl( url ) {
- if ( typeof wgServer != 'undefined' && typeof wgScriptPath != 'undefined') {
- return wgServer + wgScriptPath + '/api.php';
- }
- return false;
-}
// Do a "normal" request
function do_request( req_url, callback ) {
js_log( 'do_request::req_url:' + req_url + ' != ' + parseUri( req_url ).host );
req_param += 'urid=' + urid;
}else{
// Otherwise, just use the mv_embed version
- req_param += 'urid=' + $mw.version;
+ req_param += 'urid=' + mw.version;
}
//add the lang param:
var langKey = parseUri( mv_embed_url ).queryKey['uselang'];
*/
function js_log( string ) {
// Add any prepend debug strings if necessary (used for cross browser)
- if( $mw.conf['debug_pre'] )
- string = $mw.conf['debug_pre']+ string;
+ if( mw.conf['debug_pre'] )
+ string = mw.conf['debug_pre']+ string;
if( window.console ) {
window.console.log( string );
start: function(event, ui){
var id = (embedObj.pc!=null)?embedObj.pc.pp.id:embedObj.id;
embedObj.userSlide=true;
- $j(id + ' .play-btn-large').fadeOut('fast');
+ $j( id + ' .play-btn-large').fadeOut('fast');
//if playlist always start at 0
embedObj.start_time_sec = (embedObj.instanceOf == 'mvPlayList')?0:
npt2seconds(embedObj.getTimeReq().split('/')[0]);
},
change:function(event, ui){
//only run the onChange event if done by a user slide:
- if(embedObj.userSlide){
+ if( embedObj.userSlide ){
embedObj.userSlide=false;
embedObj.seeking=true;
//stop the monitor timer (if we can)
//up the z-index of the default status indicator:
$tp.find('.play_head .ui-slider-handle').css('z-index', 4);
$tp.find('.play_head .ui-slider-range').addClass('ui-corner-all').css('z-index', 2);
- //extended class list for jQuery ui themeing (we can probably refactor this with custom buffering highliter)
+ //extended class list for jQuery ui themeing (we can probably refactor this with custom buffering highlighter)
$tp.find('.play_head').append( this.getMvBufferHtml() );
$opt = $j('#mv_vid_options_'+embedObj.id);
var kskinConfig = {
pClass: 'k-player',
- //display time progres
+ //display time progress
long_time_disp: false,
body_options: false,
volume_layout: 'horizontal',
'<a href="#" title="' + gM( 'mwe-' + mk ) +'">' + gM( 'mwe-' + mk ) +'</a></li>';
}
o+='</ul>' +
- //we have to substract the width of the k-menu-bar
+ // We have to subtract the width of the k-menu-bar
'<div class="k-menu-screens" style="width:' + ( embedObj.playerPixelWidth() -75) +
'px; height:' + (embedObj.playerPixelHeight() - ctrlBuilder.height) + 'px;">';
- //output menu item containers:
+ // Output menu item containers:
for(i=0; i < ctrlObj.menu_items.length; i++){
o+= '<div class="menu-screen menu-' + ctrlObj.menu_items[i] + '"></div>';
}
var _this = this;
var $tp=$j('#' + embedObj.id);
- //adds options and bindings: (we do this onClick for faster vidoe tag startup times)
+ // Adds options and bindings: (we do this onClick )
var addMvOptions = function(){
- if($j('#' + embedObj.id + ' .k-menu').length != 0 )
+ if( $j('#' + embedObj.id + ' .k-menu').length != 0 )
return false;
- $j('#' + embedObj.id + ' .' + _this.pClass).prepend( _this.components['mv_embedded_options'].o( $tp.get(0).ctrlBuilder ));
+ $j('#' + embedObj.id + ' .' + _this.pClass).prepend(
+ _this.components['mv_embedded_options'].o( $tp.get(0).ctrlBuilder )
+ );
- //by default its hidden:
+ // By default its hidden:
$tp.find('.k-menu').hide();
- //output menu-items:
+ // Output menu-items:
for(i=0; i < _this.menu_items.length ; i++){
$tp.find('.k-' + _this.menu_items[i] + '-btn').click(function(){
var mk = $j(this).attr('rel');
$target = $j('#' + embedObj.id + ' .menu-'+mk).hide();
- //gennerate the menu html not already done:
+ // Generate the menu html not already done:
if( $target.children().length == 0 ){
//call the function show{Menuitem} with target:
embedObj['show' + mk.charAt(0).toUpperCase() + mk.substring(1)](
$j('#' + embedObj.id + ' .menu-'+mk)
);
}
- //slide out the others
+ // Slide out the others
$j('#' + embedObj.id + ' .menu-screen').hide();
$target.fadeIn("fast");
//don't follow the # link
return false;
});
}
- }
- //options menu display:
+ }
+
+ // Options menu display:
$tp.find('.k-options').click(function(){
if($j('#' + embedObj.id + ' .k-menu').length == 0 ){
//stop the player if it does not support overlays:
if(!embedObj.supports['overlays'])
$tp.get(0).stop();
- //add the options
+ // Add the options
addMvOptions();
}
- //set up the text and menu:
+ // Set up the text and menu:
var $ktxt = $j(this);
var $kmenu = $tp.find('.k-menu');
if( $kmenu.is(':visible') ){
font-size:20px;
margin:4px 0px 4px 11px;
padding:0;
- color:#F0F0F0;
+ color:#FFF;
font-family:arial,sans-serif;
}
"mwe-upload-multi" : "Upload {{PLURAL:$1|file|files}}"
});
-$mw.lang.loadRS({
+mw.lang.loadRS({
'PLURAL' : { "one" : 1 }
});
//define a class by the name of this file:
-$mw.testLang = {};
\ No newline at end of file
+mw.testLang = {};
\ No newline at end of file
if(wgPageName.indexOf("TimedText") === 0){
load_mv_embed(function(){
// Load with mw loader to get localized interface:
- $mw.load( ['mvTimeTextEdit'],function(){
+ mw.load( ['mvTimeTextEdit'],function(){
//could run init here (but mvTimeTextEdit included onLoad actions)
});
});
}
function load_mv_embed( callback ) {
// Inject mv_embed if needed
- if( typeof $mw == 'undefined' ) {
+ 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:
}
function check_for_mv_embed( callback ) {
- if( typeof $mw == 'undefined' ) {
+ if( typeof mw == 'undefined' ) {
setTimeout( function(){
check_for_mv_embed( callback );
}, 25 );