r57680 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57679‎ | r57680 | r57681 >
Date:20:04, 13 October 2009
Author:dale
Status:deferred
Tags:
Comment:
* added file type display inline with media asset display
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -30,7 +30,7 @@
3131 "mwe-cc_sa_title" : "Share Alike",
3232 "mwe-cc_pd_title" : "Public Domain",
3333 "mwe-unknown_license" : "Unknown license",
34 - "mwe-no_import_by_url" : "This user or wiki <b>can not<\/b> import assets from remote URLs.<p>Do you need to login?<\/p><p>If permissions are set, you may have to enable <a href=\"http:\/\/www.mediawiki.org\/wiki\/Manual:$wgAllowCopyUploads\">$wgAllowCopyUploads<\/a>.<\/p>",
 34+ "mwe-no_import_by_url" : "This user or wiki <b>can not<\/b> import assets from remote URLs.<p>Do you need to login?<\/p><p>Is upload_by_url permission set for you?<\/br> Do you need may have to enable <a href=\"http:\/\/www.mediawiki.org\/wiki\/Manual:$wgAllowCopyUploads\">$wgAllowCopyUploads<\/a>.<\/p>",
3535 "mwe-results_from" : "Results from <a href=\"$1\" target=\"_new\" >$2<\/a>",
3636 "mwe-missing_desc_see_source" : "This asset is missing a description. Please see the [$1 orginal source] and help describe it.",
3737 "rsd_config_error" : "Add media wizard configuration error: $1",
@@ -46,7 +46,13 @@
4747 "mwe-importing_asset" : "Importing asset",
4848 "mwe-preview_insert_resource" : "Preview insert of resource: $1",
4949 "mwe-checking-resource": "Checking for resource",
50 - "mwe-resource-needs-import": "Resource $1 needs to be imported"
 50+ "mwe-resource-needs-import": "Resource $1 needs to be imported",
 51+ "mwe-ftype-svg" : "SVG vector file",
 52+ "mwe-ftype-jpg" : "JPEG image file",
 53+ "mwe-ftype-png" : "PNG image file",
 54+ "mwe-ftype-oga" : "Ogg audio file",
 55+ "mwe-ftype-ogg" : "Ogg video file",
 56+ "mwe-ftype-unk" : "Unknown File Format"
5157 });
5258
5359 var default_remote_search_options = {
@@ -269,6 +275,37 @@
270276 '</a>'+
271277 '</div>';
272278 },
 279+ /**
 280+ * getTypeIcon
 281+ * @param str mime type of the reqeusted file
 282+ */
 283+ getTypeIcon:function( mimetype) {
 284+ var typestr = 'unk';
 285+ switch( mimetype ){
 286+ case 'image/svg+xml':
 287+ typestr = 'svg';
 288+ break;
 289+ case 'image/jpeg':
 290+ typestr = 'jpg'
 291+ break;
 292+ case 'image/png':
 293+ typestr = 'png';
 294+ break;
 295+ case 'audio/ogg':
 296+ typestr = 'oga';
 297+ case 'video/ogg':
 298+ case 'application/ogg':
 299+ typestr = 'ogg';
 300+ break;
 301+ }
 302+
 303+ if(typestr=='unk')
 304+ js_log("unkown ftype: " + mimetype );
 305+
 306+ return '<div class="rsd_file_type ui-corner-all ui-state-default ui-widget-content" title="' + gM('mwe-ftype-' + typestr) + '">' +
 307+ typestr +
 308+ '</div>'
 309+ },
273310 /*
274311 * getLicenceKeyFromKey
275312 * @param license_key the key of the license (must be defined in: this.licenses.cc.licenses)
@@ -966,9 +1003,16 @@
9671004 o+='<a target="_new" style="position:absolute;top:0px;right:0px" title="' +
9681005 gM('mwe-resource_description_page') +
9691006 '" href="' + rItem.link + '"><img src="http://upload.wikimedia.org/wikipedia/commons/6/6b/Magnify-clip.png"></a>';
 1007+
 1008+ //add file type icon if known
 1009+ if( rItem.mime ){
 1010+ o+= _this.getTypeIcon( rItem.mime );
 1011+ }
 1012+
9701013 //add license icons if present
9711014 if( rItem.license )
9721015 o+= _this.getlicenseImgSet( rItem.license );
 1016+
9731017 o+='</div>';
9741018 }else if(_this.result_display_mode == 'list'){
9751019 o+='<div id="mv_result_' + rInx + '" class="mv_clip_list_result" style="width:90%">';
Index: trunk/phase3/js2/mwEmbed/skins/mvpcf/styles.css
@@ -505,10 +505,17 @@
506506 #rsd_resource_edit{
507507 z-index:2;
508508 }
 509+.rsd_file_type{
 510+ position : absolute;
 511+ bottom : 0px;
 512+ left : 3px;
 513+ font-size: x-small;
 514+ background:#FFF;
 515+}
509516 .rsd_license{
510 - position:absolute;
511 - bottom:0px;
512 - left:0px;
 517+ position : absolute;
 518+ bottom : 0px;
 519+ right : 0px;
513520 }
514521 .rsd_license img{
515522 float:left;

Status & tagging log