return this.getLicenceFromKey( jL , license_url );
}
};
- // could not find it return mwe-unknown_license
+ // Could not find it return mwe-unknown_license
return {
'title' : gM( 'mwe-unknown_license' ),
'img_html' : '<span>' + gM( 'mwe-unknown_license' ) + '</span>',
_this.addResourceEditLoader();
// @@note: we have most of what we need in resultData imageinfo
cp.sObj.addByTitle( wTitle, function( rObj ) {
- // redraw ( with added result if new )
+ // Redraw ( with added result if new )
_this.drawOutputResults();
- // pull up resource editor:
+ // Pull up resource editor:
_this.resourceEdit( rObj, $j( '#res_upload__' + rObj.id ).get( 0 ) );
} );
- // return false to close progress window:
+ // Return false to close progress window:
return false;
}
} );
},
// @@todo we could load the id with the content provider id to find the object faster...
getResourceFromId:function( rid ) {
- // js_log('getResourceFromId:' + rid );
+ js_log('getResourceFromId:' + rid );
// strip out /res/ if preset:
- rid = rid.replace( / res_ / , '' );
+ rid = rid.replace( /res_/ , '' );
// js_log("looking at: " + rid);
p = rid.split( '__' );
var cp_id = p[0];
var _this = this;
// Update base target_resource_title:
- rObj.target_resource_title = rObj.titleKey.replace( / File: | Image: / , '' )
+ rObj.target_resource_title = rObj.titleKey.replace( /File:|Image:/ , '' )
// check if local repository
// or if import mode if just "linking" (we should already have the 'url'
// @@todo maybe update poster too?
rObj.local_poster = imagePage['imageinfo'][0].thumburl;
// update the title:
- rObj.target_resource_title = imagePage.title.replace( / File: | Image: / , '' );
+ rObj.target_resource_title = imagePage.title.replace(/File:|Image:/ , '' );
cir_callback( rObj );
} else {
// close the dialog and display the import interface:
if ( node != null && attr_name == null ) {
if ( node.childNodes[0] != null ) {
// trim and strip html:
- tag_val = $j.trim( node.firstChild.nodeValue ).replace( / ( < ( [ ^ > ] + ) > ) / ig, "" );
+ tag_val = $j.trim( node.firstChild.nodeValue ).replace(/(<([^>]+)>)/ig,"");
}
}
if ( node != null && attr_name != null ) {
var attr_vals = { };
for ( var j in attr_name ) {
if ( $j( node ).attr( attr_name[j] ).length != 0 )
- attr_vals[ attr_name[j] ] = $j.trim( $j( node ).attr( attr_name[j] ) ).replace( / ( < ( [ ^ > ] + ) > ) / ig, "" );
+ attr_vals[ attr_name[j] ] = $j.trim( $j(node).attr( attr_name[j]) ).replace(/(<([^>]+)>)/ig,"");
}
tag_val = attr_vals ;
}
getInlineDescWiki:function( rObj ) {
// return striped html & trim white space
if ( rObj.desc )
- return $j.trim( rObj.desc.replace( / ( < ( [ ^ > ] + ) > ) / ig, "" ) );
+ return $j.trim( rObj.desc.replace(/(<([^>]+)>)/ig,"") );
// no desc avaliable:
return '';
},
'id' : page_id,
'titleKey' : page.title,
'link' : page.imageinfo[0].descriptionurl,
- 'title' : page.title.replace( / File: | .jpg | .png | .svg | .ogg | .ogv | .oga / ig, '' ),
+ 'title' : page.title.replace(/File:.jpg|.png|.svg|.ogg|.ogv|.oga/ig, ''),
'poster' : page.imageinfo[0].thumburl,
'thumbwidth' : page.imageinfo[0].thumbwidth,
'thumbheight': page.imageinfo[0].thumbheight,
} );
},
getTitleKey:function( rObj ) {
- return rObj['stream_name'] + '_part_' + rObj['start_time'].replace( / : / g, '.' ) + '_to_' + rObj['end_time'].replace( / : / g, '.' ) + '.ogv';
+ return rObj['stream_name'] + '_part_' + rObj['start_time'].replace(/:/ g, '.' ) + '_to_' + rObj['end_time'].replace(/:/g, '.' ) + '.ogv';
},
getTitle:function( rObj ) {
- var sn = rObj['stream_name'].replace( / _ / g, ' ' );
+ var sn = rObj['stream_name'].replace( /_/ g, ' ' );
sn = sn.charAt( 0 ).toUpperCase() + sn.substr( 1 );
return gM( 'mwe-stream_title', [ sn, rObj.start_time, rObj.end_time ] );
},
} else {
fname = path.substring( backslash + 1, 10000 );
}
- fname = fname.charAt( 0 ).toUpperCase().concat( fname.substring( 1, 10000 ) ).replace( / / g, '_' );
+ fname = fname.charAt( 0 ).toUpperCase().concat( fname.substring( 1, 10000 ) ).replace( / /g, '_' );
// Output result
$j( "#wpDestFile" ).val( fname );
// do destination check
if ( !npt2seconds( end_ntp ) )
end_ntp = this.end_ntp;
- this.src = getURLParamReplace( this.src, { 't': start_ntp + '/' + end_ntp } );
+ this.src = getURLParamReplace( this.src, {
+ 't': start_ntp + '/' + end_ntp
+ });
// update the duration
this.parseURLDuration();
if ( typeof s != 'String' ) {
s = s.toString();
}
- return s.replace( / & / g, '&' )
- . replace( / < / g, '<' )
- . replace( / > / g, '>' );
+ return s.replace( /&/g, '&' )
+ . replace( /</g, '<' )
+ . replace( />/g, '>' );
},
hq : function ( s ) {
return '"' + this.hx( s ) + '"';
local_poster = page['imageinfo'][0].thumburl;
}
var descriptionurl = page['imageinfo'][0].descriptionurl;
- var title_str = page.title.replace( / File: | .ogv$ | .oga$ | .ogg$ / gi, "" );
+ var title_str = page.title.replace( /File:|.ogv$|.oga$|.ogg$/gi, "" );
// only link to other videos:
if ( descriptionurl.match( /\.ogg$|\.ogv$|\.oga$/gi ) != null) {
var liout = '<li>' +
var clip = this.anno_data_cache[link_id];
var title_msg = '';
for ( var j in clip['meta'] ) {
- title_msg += j.replace( / _ / g, ' ' ) + ': ' + clip['meta'][j].replace( / _ / g, ' ' ) + " <br>";
+ title_msg += j.replace( /_/g, ' ' ) + ': ' + clip['meta'][j].replace( /_/g, ' ' ) + " <br>";
}
var time_req = clip.time_req;
if ( link_type == 'current' ) // if current start from end of current clip play to end of current meta:
// check if our thumbnail has a time attribute:
if ( my_thumb_src.indexOf( 't=' ) !== - 1 ) {
var time_ntp = seconds2npt ( options.time + parseInt( this.start_offset ) );
- my_thumb_src = getURLParamReplace( my_thumb_src, { 't':time_ntp, 'size': options.size } );
+ my_thumb_src = getURLParamReplace( my_thumb_src, {
+ 't':time_ntp,
+ 'size': options.size
+ });
}
var thumb_class = ( typeof options['thumb_class'] != 'undefined' ) ? options['thumb_class'] : '';
return '<div class="ui-corner-all ' + thumb_class + '" src="' + my_thumb_src + '" ' +
}
if ( this.org_thum_src.indexOf( 't=' ) !== - 1 ) {
this.last_thumb_url = getURLParamReplace( this.org_thum_src,
- { 't' : seconds2npt( float_sec + parseInt( this.start_offset ) ) } );
+ {
+ 't' : seconds2npt( float_sec + parseInt( this.start_offset ) )
+ }
+ );
if ( !this.thumbnail_updating ) {
this.updateThumbnail( this.last_thumb_url , false );
this.last_thumb_url = null;
// Set up the click bindings:
$target.find( "[rel='sel_source']" ).each( function() {
$j( this ).click( function() {
- var iparts = $j( this ).attr( 'id' ).replace( / sc_ / , '' ).split( '_' );
+ var iparts = $j( this ).attr( 'id' ).replace(/sc_/ , '' ).split( '_' );
var source_id = iparts[0];
var default_player_id = iparts[1];
js_log( 'source id: ' + source_id + ' player id: ' + default_player_id );
if ( typeof _d != "undefined" ) {
_d = _d.replace( /^.*\s+(\S+\s+\S+$ )/, "$1" );
var _m = parseInt( _d.replace( /^(.*)\..*$/, "$1" ), 10 );
- var _r = / r / .test( _d ) ? parseInt( _d.replace( / ^ . * r( . * )$ / , "$1" ), 10 ) : 0;
+ var _r = / r / .test( _d ) ? parseInt( _d.replace( /^.*r(.*)$/ , "$1" ), 10 ) : 0;
version = [_m, _r];
}
js_log( 'no playhead so we can\'t get playhead pos' );
return 0;
}
- var track_len = $j( '#mv_seeker_' + this.id ).css( 'width' ).replace( / px / , '' );
+ var track_len = $j( '#mv_seeker_' + this.id ).css( 'width' ).replace( /px/ , '' );
// assume the duration is static and present at .duration during playback
var clip_perc = this.cur_clip.embed.duration / this.getDuration();
var perc_offset = time_offset = 0;
js_log( "time is: " + time );
this.img = this.img.replace( /t\=[^&]*/gi, "t=" + time );
if ( this.img.indexOf( '&size=' ) != - 1 ) {
- this.img = this.img.replace( / size = [ ^ &] * / gi, "size=" + size );
+ this.img = this.img.replace( /size=[^&]*/gi, "size=" + size );
} else {
this.img += '&size=' + size;
}
} else {
// @@we need a api entry point to store a "clipboard"
if ( this_seq.clipboardEditToken && this_seq.plObj.interface_url ) {
- var req_url = this_seq.plObj.interface_url.replace( / api.php / , 'index.php' ) + '?action=ajax&rs=mv_seqtool_clipboard&rsargs[]=copy';
+ var req_url = this_seq.plObj.interface_url.replace( /api.php/, 'index.php' ) + '?action=ajax&rs=mv_seqtool_clipboard&rsargs[]=copy';
$j.ajax( {
type: "POST",
url:req_url,
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
-function parseUri ( str ) {
+function parseUri (str) {
var o = parseUri.options,
- m = o.parser[o.strictMode ? "strict" : "loose"].exec( str ),
- uri = { },
+ m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
+ uri = {},
i = 14;
- while ( i-- ) uri[o.key[i]] = m[i] || "";
+ while (i--) uri[o.key[i]] = m[i] || "";
- uri[o.q.name] = { };
- uri[o.key[12]].replace( o.q.parser, function ( $0, $1, $2 ) {
- if ( $1 ) uri[o.q.name][$1] = $2;
- } );
+ uri[o.q.name] = {};
+ uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
+ if ($1) uri[o.q.name][$1] = $2;
+ });
return uri;
};
parseUri.options = {
strictMode: false,
- key: ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"],
+ key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
q: {
name: "queryKey",
- parser: / ( ? : ^ | & )( [ ^ &= ] * ) = ? ( [ ^ &] * ) / g
+ parser: /(?:^|&)([^&=]*)=?([^&]*)/g
},
parser: {
strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,