r56151 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56150‎ | r56151 | r56152 >
Date:21:06, 10 September 2009
Author:dale
Status:deferred (Comments)
Tags:
Comment:
* some style updates to add-media-wizard
* minor js code style cleanup
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js
@@ -52,8 +52,8 @@
5353 'url':this.cp.api_url
5454 },function(data){
5555 var titleSet = {};
56 - var titleStr=''
57 - var pound='';
 56+ var titleStr = ''
 57+ var pound = '';
5858 //loop over the data and group by title
5959 if(data.query && data.query.recentchanges){
6060 for(var i in data.query.recentchanges){
@@ -65,13 +65,14 @@
6666 }
6767 }
6868 }
69 - //now run the actual query ( too bad we cant use recentchanges as a gennerator
 69+ //now run the actual query ( too bad we can't use recentchanges as a generator )
 70+ //bug 20563
7071 do_api_req({
7172 'data' : {
72 - 'action':'query',
73 - 'titles':titleStr,
74 - 'prop':'imageinfo|revisions|categories',
75 - 'iiprop':'url|mime|size',
 73+ 'action' : 'query',
 74+ 'titles' : titleStr,
 75+ 'prop' : 'imageinfo|revisions|categories',
 76+ 'iiprop' : 'url|mime|size',
7677 'iiurlwidth': parseInt( _this.rsd.thumb_width ),
7778 'rvprop':'content'
7879 },
@@ -124,7 +125,7 @@
125126 _this.loading = false;
126127 });
127128 },
128 - //same as below but returns your rObj for convience
 129+ //same as below but returns your rObj for convenience
129130 addSingleResult:function( data ){
130131 return this.addResults(data, true);
131132 },
@@ -174,7 +175,7 @@
175176 'categories':page.categories
176177 }
177178 };
178 - //attempt to parse out some stuff from the teplate:
 179+ //attempt to parse out some stuff from the template:
179180 var desc = rObj.desc.match(/\|Description=(([^\n]*\n)*)\|Source=/)
180181 if( desc && desc[1] ){
181182 rObj.desc = $j.trim( desc[1] );
@@ -227,7 +228,7 @@
228229 return false;
229230 }
230231 }
231 - //assuming svg or size is in range: give them requeted size
 232+ //assuming svg or size is in range: give them requested size
232233 callback({
233234 'url' : baseImgUrl + '?f=' + rObj.titleKey + '&w='+ size.width,
234235 'width' : size.width,
@@ -331,8 +332,8 @@
332333 return desc;
333334 }
334335 //else return the title since we could not find the desc:
335 - js_log('we could not find the Description tag in :' + desc );
336 - return rObj.title;
 336+ js_log('Error: No Description Tag, Using::' + desc );
 337+ return desc;
337338 },
338339 parseWikiTemplate: function( text ){
339340 //@@todo parse wiki Template return object with properties and values
Index: trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js
@@ -1,5 +1,5 @@
22 //archive.org uses solr engine:
3 -//more about solr here:
 3+//more about solr here:
44 //http://lucene.apache.org/solr/
55
66 var archiveOrgSearch = function ( iObj){
@@ -72,7 +72,7 @@
7373 'desc' : resource.description,
7474 'src' : _this.dnUrl + resource.identifier+'/format=Ogg+video',
7575 'mime' : 'application/ogg',
76 - //set the licence: (rsd is a pointer to the parent remoteSearchDriver )
 76+ //set the license: (rsd is a pointer to the parent remoteSearchDriver )
7777 'license' : this.rsd.getLicenceFromUrl( resource.licenseurl ),
7878 'pSobj' :_this
7979
Index: trunk/phase3/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js
@@ -1,5 +1,5 @@
22 /*the sequence remote search driver
3 - extends the base remote search driver with sequence specific stuff. could seperate this out into seperate lib.
 3+ extends the base remote search driver with sequence specific stuff
44 */
55
66 var seqRemoteSearchDriver = function(iObj){
@@ -95,7 +95,7 @@
9696 if(tClip)
9797 var target_order = tClip.order;
9898 }
99 - //@@todo show watting of sorts.
 99+ //@@todo show wating of sorts.
100100
101101 //get target order:
102102 var cat = rObj;
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -443,7 +443,7 @@
444444 var _this = this;
445445 //add the parent target_container if not provided or missing
446446 if(!_this.target_container || $j(_this.target_container).length==0){
447 - $j('body').append('<div id="rsd_modal_target" style="position:absolute;top:30px;left:0px;bottom:33px;right:0px;" title="' + gM('mwe-add_media_wizard') + '" ></div>');
 447+ $j('body').append('<div id="rsd_modal_target" style="position:absolute;top:3em;left:0px;bottom:3em;right:0px;" title="' + gM('mwe-add_media_wizard') + '" ></div>');
448448 _this.target_container = '#rsd_modal_target';
449449 //js_log('appended: #rsd_modal_target' + $j(_this.target_container).attr('id'));
450450 //js_log('added target id:' + $j(_this.target_container).attr('id'));
@@ -1074,7 +1074,7 @@
10751075 $j( _this.target_container ).find('#rsd_resource_edit').remove();
10761076 //add the edit layout window with loading place holders
10771077 $j( _this.target_container ).append('<div id="rsd_resource_edit" '+
1078 - 'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' +
 1078+ 'style="position:absolute;top:0px;left:0px;bottom:0px;right:4px;background-color:#FFF;">' +
10791079 '<div id="clip_edit_disp" style="position:absolute;' + overflow_style + 'width:100%;height:100%;padding:5px;'+
10801080 'width:' + (maxWidth) + 'px;" >' +
10811081 mv_get_loading_img('position:absolute;top:30px;left:30px') +
@@ -1123,18 +1123,14 @@
11241124 'cursor':'default',
11251125 'opacity':0
11261126 });
1127 -
1128 -
1129 - //try and keep aspect ratio for the thumbnail that we clicked:
1130 - var rh = $j('#rsd_edit_img').height();
1131 - var rw = $j('#rsd_edit_img').width();
11321127
1133 - var tRatio = rh / rw;
 1128+ //try and keep aspect ratio for the thumbnail that we clicked:
 1129+ var tRatio = rObj.orgheight / rObj.orgwidth;
11341130
11351131 if( ! tRatio )
11361132 var tRatio = 1; //set ratio to 1 if tRatio did not work.
11371133
1138 - //js_log('set from ' + $j('#rsd_edit_img').width() + 'x' + $j('#rsd_edit_img').height() + ' to init thumbimage to ' + maxWidth + ' x ' + parseInt( tRatio * maxWidth) );
 1134+ //js_log('set from ' + tRatio + ' to init thumbimage to ' + maxWidth + ' x ' + parseInt( tRatio * maxWidth) );
11391135 //scale up image and to swap with high res version
11401136 $j('#rsd_edit_img').animate({
11411137 'opacity':1,
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvFirefoggRender.js
@@ -52,7 +52,7 @@
5353 this.renderOptions[ i ] = default_render_options[i];
5454 }
5555 }
56 - //setup the application options (with defaults)
 56+ //Setup the application options (with defaults)
5757 for(var i in default_FirefoggRender_options ){
5858 if( iObj[ i ] ){
5959 this[ i ] = iObj[ i ];
@@ -60,8 +60,7 @@
6161 this[ i ] = default_FirefoggRender_options[i];
6262 }
6363 }
64 - //set up targets and local vars
65 -
 64+ //Set up targets and local vars
6665 if( iObj.target_startRender ){
6766 $j(iObj.target_startRender).click(function(){
6867 js_log("Start render");
Index: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
@@ -27,7 +27,7 @@
2828 "mwe-set_in_out_points" : "Set in-out points",
2929 "mwe-start_time" : "Start time",
3030 "mwe-end_time" : "End time",
31 - "mwe-preview_inout" : "Preview\/play in-out points"
 31+ "mwe-preview_inout" : "Preview in-out points"
3232 });
3333
3434 var default_clipedit_values = {
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -5,8 +5,7 @@
66 loadGM({
77 "mwe-loading_plugin" : "loading plugin <blink>...<\/blink>",
88 "mwe-select_playback" : "Set playback preference",
9 - "mwe-link_back" : "Link back",
10 - "mwe-error_load_lib" : "Error: JavaScript $1 was not retrievable or does not define $2",
 9+ "mwe-link_back" : "Link back",
1110 "mwe-error_swap_vid" : "Error: mv_embed was unable to swap the video tag for the mv_embed interface",
1211 "mwe-add_to_end_of_sequence" : "Add to end of sequence",
1312 "mwe-missing_video_stream" : "The video file for this stream is missing",
@@ -2154,7 +2153,7 @@
21552154 return this.media_element.selected_source.URLTimeEncoding;
21562155 },
21572156 setSliderValue: function(perc, hide_progress){
2158 - if(this.controls){
 2157+ if(this.controls && $j('#mv_play_head_'+this_id).length != 0){
21592158 var this_id = (this.pc)?this.pc.pp.id:this.id;
21602159 var val = parseInt( perc*1000 );
21612160 $j('#mv_play_head_'+this_id).slider('value', val);

Comments

#Comment by Siebrand (talk | contribs)   22:14, 10 September 2009

Commit msg. does not mention changes in loadGM() of embedVideo.js and mvClipEdit.js. In particular the removal of "mwe-error_load_lib"; was that intended or by accident?

#Comment by Mdale (talk | contribs)   03:13, 11 September 2009

mwe-error_load_lib was moved to mv_embed.js because its a loading error msg which can happen before embed-video is loaded.

Status & tagging log