From: Michael Dale Date: Thu, 10 Sep 2009 21:06:51 +0000 (+0000) Subject: * some style updates to add-media-wizard X-Git-Tag: 1.31.0-rc.0~39800 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=7525ca1b489b178c6b03c41b214d949e95eec517;p=lhc%2Fweb%2Fwiklou.git * some style updates to add-media-wizard * minor js code style cleanup --- diff --git a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js index c6841511e1..3384abbe12 100644 --- a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js @@ -443,7 +443,7 @@ remoteSearchDriver.prototype = { var _this = this; //add the parent target_container if not provided or missing if(!_this.target_container || $j(_this.target_container).length==0){ - $j('body').append('
'); + $j('body').append('
'); _this.target_container = '#rsd_modal_target'; //js_log('appended: #rsd_modal_target' + $j(_this.target_container).attr('id')); //js_log('added target id:' + $j(_this.target_container).attr('id')); @@ -1074,7 +1074,7 @@ remoteSearchDriver.prototype = { $j( _this.target_container ).find('#rsd_resource_edit').remove(); //add the edit layout window with loading place holders $j( _this.target_container ).append('
' + + 'style="position:absolute;top:0px;left:0px;bottom:0px;right:4px;background-color:#FFF;">' + '
' + mv_get_loading_img('position:absolute;top:30px;left:30px') + @@ -1123,18 +1123,14 @@ remoteSearchDriver.prototype = { 'cursor':'default', 'opacity':0 }); - - - //try and keep aspect ratio for the thumbnail that we clicked: - var rh = $j('#rsd_edit_img').height(); - var rw = $j('#rsd_edit_img').width(); - var tRatio = rh / rw; + //try and keep aspect ratio for the thumbnail that we clicked: + var tRatio = rObj.orgheight / rObj.orgwidth; if( ! tRatio ) var tRatio = 1; //set ratio to 1 if tRatio did not work. - //js_log('set from ' + $j('#rsd_edit_img').width() + 'x' + $j('#rsd_edit_img').height() + ' to init thumbimage to ' + maxWidth + ' x ' + parseInt( tRatio * maxWidth) ); + //js_log('set from ' + tRatio + ' to init thumbimage to ' + maxWidth + ' x ' + parseInt( tRatio * maxWidth) ); //scale up image and to swap with high res version $j('#rsd_edit_img').animate({ 'opacity':1, diff --git a/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js b/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js index 83d211132b..2829c5553f 100644 --- a/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js +++ b/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js @@ -1,5 +1,5 @@ //archive.org uses solr engine: -//more about solr here: +//more about solr here: //http://lucene.apache.org/solr/ var archiveOrgSearch = function ( iObj){ @@ -72,7 +72,7 @@ archiveOrgSearch.prototype = { 'desc' : resource.description, 'src' : _this.dnUrl + resource.identifier+'/format=Ogg+video', 'mime' : 'application/ogg', - //set the licence: (rsd is a pointer to the parent remoteSearchDriver ) + //set the license: (rsd is a pointer to the parent remoteSearchDriver ) 'license' : this.rsd.getLicenceFromUrl( resource.licenseurl ), 'pSobj' :_this diff --git a/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js b/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js index b1c14adb7e..d9c537dd31 100644 --- a/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js +++ b/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js @@ -52,8 +52,8 @@ mediaWikiSearch.prototype = { 'url':this.cp.api_url },function(data){ var titleSet = {}; - var titleStr='' - var pound=''; + var titleStr = '' + var pound = ''; //loop over the data and group by title if(data.query && data.query.recentchanges){ for(var i in data.query.recentchanges){ @@ -65,13 +65,14 @@ mediaWikiSearch.prototype = { } } } - //now run the actual query ( too bad we cant use recentchanges as a gennerator + //now run the actual query ( too bad we can't use recentchanges as a generator ) + //bug 20563 do_api_req({ 'data' : { - 'action':'query', - 'titles':titleStr, - 'prop':'imageinfo|revisions|categories', - 'iiprop':'url|mime|size', + 'action' : 'query', + 'titles' : titleStr, + 'prop' : 'imageinfo|revisions|categories', + 'iiprop' : 'url|mime|size', 'iiurlwidth': parseInt( _this.rsd.thumb_width ), 'rvprop':'content' }, @@ -124,7 +125,7 @@ mediaWikiSearch.prototype = { _this.loading = false; }); }, - //same as below but returns your rObj for convience + //same as below but returns your rObj for convenience addSingleResult:function( data ){ return this.addResults(data, true); }, @@ -174,7 +175,7 @@ mediaWikiSearch.prototype = { 'categories':page.categories } }; - //attempt to parse out some stuff from the teplate: + //attempt to parse out some stuff from the template: var desc = rObj.desc.match(/\|Description=(([^\n]*\n)*)\|Source=/) if( desc && desc[1] ){ rObj.desc = $j.trim( desc[1] ); @@ -227,7 +228,7 @@ mediaWikiSearch.prototype = { return false; } } - //assuming svg or size is in range: give them requeted size + //assuming svg or size is in range: give them requested size callback({ 'url' : baseImgUrl + '?f=' + rObj.titleKey + '&w='+ size.width, 'width' : size.width, @@ -331,8 +332,8 @@ mediaWikiSearch.prototype = { return desc; } //else return the title since we could not find the desc: - js_log('we could not find the Description tag in :' + desc ); - return rObj.title; + js_log('Error: No Description Tag, Using::' + desc ); + return desc; }, parseWikiTemplate: function( text ){ //@@todo parse wiki Template return object with properties and values diff --git a/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js b/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js index 2d994a6f4c..90d73e2316 100644 --- a/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js @@ -1,5 +1,5 @@ /*the sequence remote search driver - extends the base remote search driver with sequence specific stuff. could seperate this out into seperate lib. + extends the base remote search driver with sequence specific stuff */ var seqRemoteSearchDriver = function(iObj){ @@ -95,7 +95,7 @@ seqRemoteSearchDriver.prototype = { if(tClip) var target_order = tClip.order; } - //@@todo show watting of sorts. + //@@todo show wating of sorts. //get target order: var cat = rObj; diff --git a/js2/mwEmbed/libClipEdit/mvClipEdit.js b/js2/mwEmbed/libClipEdit/mvClipEdit.js index 788f954a5e..ced5f6df2b 100644 --- a/js2/mwEmbed/libClipEdit/mvClipEdit.js +++ b/js2/mwEmbed/libClipEdit/mvClipEdit.js @@ -27,7 +27,7 @@ loadGM({ "mwe-set_in_out_points" : "Set in-out points", "mwe-start_time" : "Start time", "mwe-end_time" : "End time", - "mwe-preview_inout" : "Preview\/play in-out points" + "mwe-preview_inout" : "Preview in-out points" }); var default_clipedit_values = { diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index 8690411899..885e185407 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -5,8 +5,7 @@ loadGM({ "mwe-loading_plugin" : "loading plugin ...<\/blink>", "mwe-select_playback" : "Set playback preference", - "mwe-link_back" : "Link back", - "mwe-error_load_lib" : "Error: JavaScript $1 was not retrievable or does not define $2", + "mwe-link_back" : "Link back", "mwe-error_swap_vid" : "Error: mv_embed was unable to swap the video tag for the mv_embed interface", "mwe-add_to_end_of_sequence" : "Add to end of sequence", "mwe-missing_video_stream" : "The video file for this stream is missing", @@ -2154,7 +2153,7 @@ embedVideo.prototype = { return this.media_element.selected_source.URLTimeEncoding; }, setSliderValue: function(perc, hide_progress){ - if(this.controls){ + if(this.controls && $j('#mv_play_head_'+this_id).length != 0){ var this_id = (this.pc)?this.pc.pp.id:this.id; var val = parseInt( perc*1000 ); $j('#mv_play_head_'+this_id).slider('value', val); diff --git a/js2/mwEmbed/libSequencer/mvFirefoggRender.js b/js2/mwEmbed/libSequencer/mvFirefoggRender.js index 2f5fd2d99c..cd6c0da861 100644 --- a/js2/mwEmbed/libSequencer/mvFirefoggRender.js +++ b/js2/mwEmbed/libSequencer/mvFirefoggRender.js @@ -52,7 +52,7 @@ mvFirefoggRender.prototype = { this.renderOptions[ i ] = default_render_options[i]; } } - //setup the application options (with defaults) + //Setup the application options (with defaults) for(var i in default_FirefoggRender_options ){ if( iObj[ i ] ){ this[ i ] = iObj[ i ]; @@ -60,8 +60,7 @@ mvFirefoggRender.prototype = { this[ i ] = default_FirefoggRender_options[i]; } } - //set up targets and local vars - + //Set up targets and local vars if( iObj.target_startRender ){ $j(iObj.target_startRender).click(function(){ js_log("Start render");