r47173 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47172‎ | r47173 | r47174 >
Date:01:07, 12 February 2009
Author:dale
Status:deferred
Tags:
Comment:
fixes for IE display of tabs in add_media_wizard.js

(have switch them over to divs was too css complex to use ul with different site styles overwriting ul in different ways)
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvUploader.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/seqRemoteSearchDriver.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mvSequencer.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/seqRemoteSearchDriver.js
@@ -18,14 +18,47 @@
1919 }
2020 },
2121 addResultBindings:function(){
22 - //setup the default bindings
 22+ //set up seq:
 23+ var _this = this;
 24+ //setup parent bindings:
2325 this.parent_addResultBindings();
 26+
2427 //add an additional drag binding
25 - $j('.rsd_res_item').draggable({
26 -
 28+ var source_pos = null;
 29+ var insert_key='na';
 30+ var clip_key ='';
 31+
 32+ //@@todo support multiple tracks
 33+ $j('.mv_clip_box_result').draggable({
 34+ start:function(){
 35+ source_pos = $j(this).offset();
 36+ js_log("update pos of: #clone_" + this.id + ' to l:' +source_pos.left + ' t:' + source_pos.top );
 37+ $j('#clone_' + this.id).css(source_pos);
 38+ },
 39+ helper:function(){
 40+ //js_log(' should put at: ' + source_pos.left + ' ' + source_pos.right);
 41+ //get source pos:
 42+ //$j(this).clone().attr('id', 'clone_' + this.id).css({'z-index':'101'}).appendTo('body');
 43+ $j(this).clone().attr('id', 'clone_' + this.id).css({
 44+ 'z-index':'101',
 45+ 'position':'absolute'
 46+ }).appendTo('#container_track_0');
 47+ js_log('appended: ' + 'clone_' + this.id );
 48+ return $j('#clone_'+this.id).get(0);
 49+ },
 50+ drag:function(e, ui){
 51+ insert_key = _this.p_seq.clipDragUpdate(ui, this);
 52+ },
 53+ //do contain:
 54+ containment:'#container_track_0',
 55+ stop:function(){
 56+ js_log('done drag insert after: ' + insert_key);
 57+ }
2758 });
 59+
2860 },
2961 resourceEdit:function(rObj, rsdElement){
30 -
 62+ //pass along for now:
 63+ this.parent_resourceEdit(rObj, rsdElement);
3164 }
3265 }
\ No newline at end of file
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js
@@ -102,7 +102,7 @@
103103 'wiki_commons':{
104104 'enabled':1,
105105 'checked':1,
106 - 'd' :0,
 106+ 'd' :1,
107107 'title' :'Wikipedia Commons',
108108 'desc' : 'Wikimedia Commons is a media file repository making available public domain '+
109109 'and freely-licensed educational media content (images, sound and video clips) to all.',
@@ -124,7 +124,7 @@
125125 'metavid':{
126126 'enabled':1,
127127 'checked':1,
128 - 'd' :1,
 128+ 'd' :0,
129129 'title' :'Metavid.org',
130130 'homepage':'http://metavid.org',
131131 'desc' : 'Metavid hosts thousands of hours of US house and senate floor proceedings',
@@ -370,16 +370,19 @@
371371 drawTabs: function(){
372372 var _this = this;
373373 //add the tabs to the rsd_results container:
374 - var o='<div class="rsd_tabs_container" style="position:absolute;top:49px;width:100%;left:12px;height:25px;">';
375 - o+= '<ul class="rsd_cp_tabs" style="margin: 0 0 0 0;position:absolute;top:0px;padding:0;">'; //no idea why margin does not overwrite from the css
376 - o+='<li id="rsd_tab_combined" ><img src="' + mv_embed_path + 'skins/'+mv_skin_name+ '/images/remote_cp/combined_tab.png"></li>';
 374+ var o='<div class="rsd_tabs_container" style="position:absolute;top:41px;width:100%;left:12px;height:25px;">';
 375+ //o+= '<ul class="rsd_cp_tabs" style="margin: 0 0 0 0;position:absolute;top:0px;padding:0;">'; //no idea why margin does not overwrite from the css
 376+ //output combined tab:
 377+ o+='<div id="rsd_tab_combined" class="rsd_cp_tab"><img src="' + mv_embed_path + 'skins/'+mv_skin_name+ '/images/remote_cp/combined_tab.png"></div>';
377378 for(var cp_id in this.content_providers){
378379 var cp = this.content_providers[cp_id];
379380 if( cp.enabled && cp.checked){
380 - var class_attr = (cp.d)?'class="rsd_selected"':'';
381 - o+='<li id="rsd_tab_'+cp_id+'" ' + class_attr + '>';
 381+ var class_attr = 'class="rsd_cp_tab';
 382+ //add selected if so:
 383+ class_attr+= (cp.d)?' rsd_selected"':'"';
 384+ o+='<div id="rsd_tab_'+cp_id+'" ' + class_attr + '>';
382385 if(cp.tab_img === true){
383 - o+='<img alt="' + cp.title +'" src="' + mv_embed_path + 'skins/' + mv_skin_name + '/images/remote_cp/' + cp_id + '_tab.png"></li>';
 386+ o+='<img alt="' + cp.title +'" src="' + mv_embed_path + 'skins/' + mv_skin_name + '/images/remote_cp/' + cp_id + '_tab.png"></div>';
384387 }else if(typeof cp.tab_img=='string'){
385388 o+='<img alt="' + cp.title +'" src="' + cp.tab_img + '"></li>';
386389 }else if(cp.tab_img === false){
@@ -390,16 +393,16 @@
391394 //do an upload tab if enabled:
392395 if( this.enable_uploads ){
393396 var class_attr = ( this.disp_item =='upload' ) ? 'class="rsd_selected"':'';
394 - o+='<li id="rsd_tab_upload" ' + class_attr + ' >'+gM('upload');+'</li>';
 397+ o+='<div id="rsd_tab_upload" ' + class_attr + ' >'+gM('upload');+'</li>';
395398 }
396 - o+='</ul>';
 399+ //o+='</ul>';
397400 o+='</div>';
398401 //outout the resource results holder
399402 o+='<div id="rsd_results" />';
400403 $j('#rsd_results_container').html(o);
401404
402405 //setup bindings for tabs:
403 - $j('.rsd_cp_tabs li').click(function(){
 406+ $j('.rsd_cp_tab').click(function(){
404407 _this.selectTab( $j(this).attr('id').replace(/rsd_tab_/, '') );
405408 });
406409 },
@@ -450,9 +453,10 @@
451454 o+='<div id="mv_result_' + rInx + '" class="mv_clip_box_result" style="' + disp + 'width:' +
452455 _this.thumb_width + 'px;height:'+ (_this.thumb_width-20) +'px;position:relative;">';
453456 o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + rInx +'" style="width:' + _this.thumb_width + 'px;" src="' + rItem.poster + '">';
454 - //add a linkback to resource page in lower left:
 457+ //add a linkback to resource page in upper right:
455458 if(rItem.link)
456 - o+='<a target="_new" style="position:absolute;top:0px;right:0px" title="' + gM('Resource Description Page') + '" href="' + rItem.link + '"><img src="' + stylepath + '/common/images/magnify-clip.png"></a>';
 459+ o+='<a target="_new" style="position:absolute;top:0px;right:0px" title="' + gM('Resource Description Page') +
 460+ '" href="' + rItem.link + '"><img src="' + stylepath + '/common/images/magnify-clip.png"></a>';
457461 o+='</div>';
458462 }else if(_this.result_display_mode == 'list'){
459463 o+='<div id="mv_result_' + rInx + '" class="mv_clip_list_result" style="' + disp + 'width:90%">';
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvUploader.js
@@ -117,7 +117,7 @@
118118 //hard code style (since not always easy to import style sheets)
119119 $j('body').append('<div id="dlbox-centered" class="dlbox-centered" style="display:none;'+
120120 'position:fixed;background:#DDD;border:3px solid #AAA;font-size:115%;width:40%;'+
121 - 'height:300px;padding: 10px;z-index:100;bottom:40%;left:20%;" >'+
 121+ 'height:300px;padding: 10px;z-index:100;top:100px;bottom:40%;left:20%;" >'+
122122 '<h5>' + gM('upload-in-progress') + '</h5>' +
123123 '<div id="fogg-pbar-container" style="border:solid thin gray;width:90%;height:15px;" >' +
124124 '<div id="fogg-progressbar" style="background:#AAC;width:0%;height:15px;"></div>' +
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mvSequencer.js
@@ -924,7 +924,7 @@
925925 'time':0
926926 });
927927 //render out edit button
928 - track_html+='<div class="clip_edit_button clip_edit_base"/>';
 928+ track_html+='<div class="clip_edit_button clip_edit_base clip_control"/>';
929929
930930 //render out transition edit box
931931 track_html+='<div id="tb_' + base_id + '" style="" class="clip_trans_box"/>';
@@ -1076,43 +1076,7 @@
10771077 handle: ":not(.clip_control)",
10781078 scroll:true,
10791079 drag:function(e, ui){
1080 - //animate re-arrange by left position:
1081 - //js_log('left: '+ui.position.left);
1082 - //locate clip (based on clip duration not animate)
1083 - var id_parts = this.id.split('_');
1084 - var track_inx = id_parts[1];
1085 - var clip_inx = id_parts[3];
1086 - var clips = this_seq.plObj.tracks[track_inx].clips;
1087 - var cur_drag_clip = clips[clip_inx];
1088 - var return_org = true;
1089 - $j(this).css('zindex',10);
1090 - //find out where we are inserting and set left border to solid red thick
1091 - for(var k in clips){
1092 - if( ui.position.left > clips[k].left_px &&
1093 - ui.position.left < (clips[k].left_px + clips[k].width_px)){
1094 - if(clip_inx!=k){
1095 - //also make sure we are not where we started
1096 - if(k-1!=clip_inx){
1097 - $j('#track_'+track_inx+'_clip_'+k).css('border-left', 'solid thick red');
1098 - insert_key=k;
1099 - }else{
1100 - insert_key='na';
1101 - }
1102 - }else{
1103 - insert_key='na';
1104 - }
1105 - }else{
1106 - $j('#track_'+track_inx+'_clip_'+k).css('border-left', 'solid thin white');
1107 - }
1108 - }
1109 - //if greater than the last k insert after
1110 - if(ui.position.left > (clips[k].left_px + clips[k].width_px) &&
1111 - k!=clip_inx ){
1112 - $j('#track_'+track_inx+'_clip_'+k).css('border-right', 'solid thick red');
1113 - insert_key='end';
1114 - }else{
1115 - $j('#track_'+track_inx+'_clip_'+k).css('border-right', 'solid thin white');
1116 - }
 1080+ insert_key = this_seq.clipDragUpdate(ui, this);
11171081 },
11181082 start:function(e,ui){
11191083 js_log('start drag:' + this.id);
@@ -1187,6 +1151,49 @@
11881152 //debugger;
11891153 }
11901154 },
 1155+ clipDragUpdate:function( ui, clipElm){
 1156+ var this_seq = this;
 1157+
 1158+ var insert_key='na';
 1159+ //animate re-arrange by left position:
 1160+ //js_log('left: '+ui.position.left);
 1161+ //locate clip (based on clip duration not animate)
 1162+ var id_parts = clipElm.id.split('_');
 1163+ var track_inx = id_parts[1];
 1164+ var clip_inx = id_parts[3];
 1165+ var clips = this_seq.plObj.tracks[track_inx].clips;
 1166+ var cur_drag_clip = clips[clip_inx];
 1167+ var return_org = true;
 1168+ $j(clipElm).css('zindex',10);
 1169+ //find out where we are inserting and set left border to solid red thick
 1170+ for(var k in clips){
 1171+ if( ui.position.left > clips[k].left_px &&
 1172+ ui.position.left < (clips[k].left_px + clips[k].width_px)){
 1173+ if(clip_inx!=k){
 1174+ //also make sure we are not where we started
 1175+ if(k-1!=clip_inx){
 1176+ $j('#track_'+track_inx+'_clip_'+k).css('border-left', 'solid thick red');
 1177+ insert_key=k;
 1178+ }else{
 1179+ insert_key='na';
 1180+ }
 1181+ }else{
 1182+ insert_key='na';
 1183+ }
 1184+ }else{
 1185+ $j('#track_'+track_inx+'_clip_'+k).css('border-left', 'solid thin white');
 1186+ }
 1187+ }
 1188+ //if greater than the last k insert after
 1189+ if(ui.position.left > (clips[k].left_px + clips[k].width_px) &&
 1190+ k!=clip_inx ){
 1191+ $j('#track_'+track_inx+'_clip_'+k).css('border-right', 'solid thick red');
 1192+ insert_key='end';
 1193+ }else{
 1194+ $j('#track_'+track_inx+'_clip_'+k).css('border-right', 'solid thin white');
 1195+ }
 1196+ return insert_key;
 1197+ },
11911198 deselectClip:function( clipElm ){
11921199 $j(clipElm).removeClass("mv_selected_clip");
11931200 $j('#' + $j(clipElm).parent().attr("id") + '_adj').fadeOut("fast");
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js
@@ -59,7 +59,7 @@
6060 }
6161 }
6262
63 - //if media type was not supplied detect for resoure if possible:
 63+ //if media type was not supplied detect for resource if possible:
6464 //@@todo more advanced detection.
6565 if(!this.media_type){
6666 if( this.rObj.type.indexOf("image/") === 0){
@@ -90,9 +90,36 @@
9191 //master edit types object:
9292 //maybe we should refactor these into their own classes
9393 //more refactor each media type should be its own class inheriting the shared baseEditType object
94 - edit_types:{
 94+ edit_types:{
 95+ 'duration':{
 96+ d:1,
 97+ 'media':['image','template'],
 98+ 'doEdit':function( _this ){
 99+ //do clock mouse scroll duration editor
 100+ $j('#sub_cliplib_ic').html('cur dur: ' + _this.rObj.dur );
 101+ }
 102+ },
 103+ 'inoutpoints':{
 104+ 'd':1,
 105+ 'media':['video'],
 106+ 'doEdit':function( _this ){
 107+ var cat = _this.rObj
 108+ //debugger;
 109+ //do clock mouse scroll duration editor
 110+ var end_ntp = ( _this.rObj.embed.end_ntp) ? _this.rObj.embed.end_ntp : _this.rObj.embed.getDuration();
 111+ if(!end_ntp)
 112+ end_ntp = seconds2ntp( _this.rObj.dur );
 113+ $j('#sub_cliplib_ic').html(
 114+ _this.getSetInOut({
 115+ 'start_ntp' : _this.rObj.embed.start_ntp,
 116+ 'end_ntp' : end_ntp
 117+ })
 118+ );
 119+ _this.setInOutBindings();
 120+ }
 121+ },
95122 'fileopts':{
96 - 'd':1,
 123+ 'd':0,
97124 'media':['image','video','template'],
98125 'doEdit':function( _this ){
99126 var doEditHtml = function(){
@@ -206,33 +233,6 @@
207234
208235 }
209236 },
210 - 'duration':{
211 - d:0,
212 - 'media':['image','template'],
213 - 'doEdit':function( _this ){
214 - //do clock mouse scroll duration editor
215 - $j('#sub_cliplib_ic').html('cur dur: ' + _this.rObj.dur );
216 - }
217 - },
218 - 'inoutpoints':{
219 - 'd':0,
220 - 'media':['video'],
221 - 'doEdit':function( _this ){
222 - var cat = _this.rObj
223 - //debugger;
224 - //do clock mouse scroll duration editor
225 - var end_ntp = ( _this.rObj.embed.end_ntp) ? _this.rObj.embed.end_ntp : _this.rObj.embed.getDuration();
226 - if(!end_ntp)
227 - end_ntp = seconds2ntp( _this.rObj.dur );
228 - $j('#sub_cliplib_ic').html(
229 - _this.getSetInOut({
230 - 'start_ntp' : _this.rObj.embed.start_ntp,
231 - 'end_ntp' : end_ntp
232 - })
233 - );
234 - _this.setInOutBindings();
235 - }
236 - },
237237 'panzoom':{
238238 'd':0,
239239 'media':['image','video'],
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css
@@ -494,33 +494,47 @@
495495 width: 15px;height:19px; top: 0px; bottom: 0px; left: 0px;
496496 background: transparent url(images/slider_handle_green.gif) no-repeat scroll 0% 0%;
497497 }
498 -.ui-dragSpan {filter: alpha(opacity=70); -moz-opacity: .7; background-color:#AAF; position:absolute; left: 10px; right:10px;height:19px; }
 498+.ui-dragSpan {
 499+ filter: alpha(opacity=70);
 500+ -moz-opacity: .7;
 501+ background-color:#AAF;
 502+ position:absolute;
 503+ left: 10px;
 504+ right:10px;
 505+ height:19px;
 506+}
499507
500 -#remote search css:
501 -
502 -ul.rsd_cp_tabs {
503 - border-bottom:1px solid #CCCCCC;
 508+div.rsd_cp_tab_container{
504509 display:inline;
505 - list-style-image:none;
506 - list-style-position:outside;
507 - list-style-type:none;
508 - z-index:2;
 510+ margin:0;
 511+ padding:5px 2px 10px 2px;
 512+ background:#F7F7F7 url(remote_search/tab-bg.png) repeat-x scroll left bottom;
 513+ border:1px solid #777;
 514+ margin-left:7px;
 515+ cursor:pointer;
 516+ float:left;
 517+ width:auto;
509518 }
510 -ul.rsd_cp_tabs li.rsd_selected {
511 - background:#FFFFFF none repeat scroll 0 0;
512 - border-bottom:0;
513 - padding-bottom:11px;
514 - padding-top:12px;
515 -}
516 -ul.rsd_cp_tabs li {
 519+div.rsd_cp_tab {
517520 display:inline;
518521 margin:0;
519 - padding:10px 2px 10px 2px;
 522+ padding:5px 2px 10px 2px;
520523 background:#F7F7F7 url(remote_search/tab-bg.png) repeat-x scroll left bottom;
521524 border:1px solid #777;
522525 margin-left:7px;
523526 cursor:pointer;
 527+ float:left;
 528+ width:auto;
 529+ position:relative;
524530 }
 531+
 532+div.rsd_selected {
 533+ background:#FFFFFF none repeat scroll 0 0;
 534+ border-bottom:0;
 535+ padding-top:6px;
 536+ z-index:2;
 537+}
 538+
525539 .rsd_results_container{
526540 position:absolute;
527541 left:2px;

Status & tagging log