Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -21,6 +21,7 @@ |
22 | 22 | "rsd_layout" : "Layout:", |
23 | 23 | "rsd_resource_edit" : "Edit resource: $1", |
24 | 24 | "mwe-resource_description_page" : "Resource description page", |
| 25 | + "mwe-link" : "link", |
25 | 26 | "rsd_local_resource_title" : "Local resource title", |
26 | 27 | "rsd_do_insert" : "Do insert", |
27 | 28 | "mwe-cc_title" : "Creative Commons", |
— | — | @@ -233,16 +234,16 @@ |
234 | 235 | 'cc':{ |
235 | 236 | 'base_img_url':'http://upload.wikimedia.org/wikipedia/commons/thumb/', |
236 | 237 | 'base_license_url': 'http://creativecommons.org/licenses/', |
237 | | - 'licenses':{ |
238 | | - 'by': 'by/3.0/', |
239 | | - 'by-sa': 'by-sa/3.0/', |
240 | | - 'by-nc-nd': 'by-nc-nd/3.0/', |
241 | | - 'by-nc': 'by-nc/3.0/', |
242 | | - 'by-nd': 'by-nd/3.0/', |
243 | | - 'by-nc-sa': 'by-nc-sa/3.0/', |
244 | | - 'by-sa': 'by-nc/3.0', |
245 | | - 'pd': 'publicdomain/' |
246 | | - }, |
| 238 | + 'licenses':[ |
| 239 | + 'by', |
| 240 | + 'by-sa', |
| 241 | + 'by-nc-nd', |
| 242 | + 'by-nc', |
| 243 | + 'by-nd', |
| 244 | + 'by-nc-sa', |
| 245 | + 'by-sa', |
| 246 | + 'pd' |
| 247 | + ], |
247 | 248 | 'license_img':{ |
248 | 249 | 'by':{ |
249 | 250 | 'im':'1/11/Cc-by_new_white.svg/20px-Cc-by_new_white.svg.png' |
— | — | @@ -274,55 +275,26 @@ |
275 | 276 | licenseObj.img_html + |
276 | 277 | '</a>'+ |
277 | 278 | '</div>'; |
278 | | - }, |
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 | | - }, |
| 279 | + }, |
310 | 280 | /* |
311 | 281 | * getLicenceKeyFromKey |
312 | 282 | * @param license_key the key of the license (must be defined in: this.licenses.cc.licenses) |
313 | 283 | */ |
314 | | - getLicenceFromKey:function( license_key , force_url){ |
315 | | - if( typeof( this.licenses.cc.licenses[ license_key ]) == 'undefined') |
316 | | - return js_error('could not find:' + license_key); |
| 284 | + getLicenceFromKey:function( license_key , force_url){ |
317 | 285 | //set the current license pointer: |
318 | 286 | var cl = this.licenses.cc; |
319 | 287 | var title = gM('mwe-cc_title'); |
320 | 288 | var imgs = ''; |
321 | 289 | var license_set = license_key.split('-'); |
322 | 290 | for(var i=0;i < license_set.length; i++){ |
323 | | - lkey = license_set[i]; |
| 291 | + var lkey = license_set[i]; |
| 292 | + if(! cl.license_img[ lkey ] ){ |
| 293 | + js_log("MISSING::" + lkey ); |
| 294 | + } |
| 295 | + |
324 | 296 | title += ' ' + gM( 'mwe-cc_' + lkey + '_title'); |
325 | | - imgs +='<img class="license_desc" width="20" src="' + cl.base_img_url + |
326 | | - cl.license_img[ lkey ].im + '">'; |
| 297 | + imgs +='<img class="license_desc" width="20" src="' |
| 298 | + + cl.base_img_url + cl.license_img[ lkey ].im + '">'; |
327 | 299 | } |
328 | 300 | var url = (force_url) ? force_url : cl.base_license_url + cl.licenses[ license_key ]; |
329 | 301 | return { |
— | — | @@ -337,15 +309,20 @@ |
338 | 310 | * @param licence_url the url of the license |
339 | 311 | */ |
340 | 312 | getLicenceFromUrl: function( license_url ){ |
341 | | - //js_log("getLicenceFromUrl::" + license_url); |
| 313 | + //js_log("getLicenceFromUrl::" + license_url); |
342 | 314 | //first do a direct lookup check: |
343 | | - for(var i in this.licenses.cc.licenses){ |
344 | | - var lkey = this.licenses.cc.licenses[i].split('/')[0]; |
345 | | - //guess by url trim |
346 | | - if( parseUri(license_url).path.indexOf('/'+ lkey +'/') != -1){ |
347 | | - return this.getLicenceFromKey( i , license_url); |
| 315 | + for(var j =0; j < this.licenses.cc.licenses.length; j++){ |
| 316 | + var jL = this.licenses.cc.licenses[ j ]; |
| 317 | + //special 'pd' case: |
| 318 | + if( jL == 'pd'){ |
| 319 | + var keyCheck = 'publicdomain'; |
| 320 | + }else{ |
| 321 | + var keyCheck = jL; |
| 322 | + } |
| 323 | + if( parseUri(license_url).path.indexOf('/'+ keyCheck +'/') != -1){ |
| 324 | + return this.getLicenceFromKey(jL , license_url); |
348 | 325 | } |
349 | | - } |
| 326 | + }; |
350 | 327 | //could not find it return mwe-unknown_license |
351 | 328 | return { |
352 | 329 | 'title' : gM('mwe-unknown_license'), |
— | — | @@ -353,6 +330,37 @@ |
354 | 331 | 'lurl' : license_url |
355 | 332 | }; |
356 | 333 | }, |
| 334 | + /** |
| 335 | + * getTypeIcon |
| 336 | + * @param str mime type of the requested file |
| 337 | + */ |
| 338 | + getTypeIcon:function( mimetype) { |
| 339 | + var typestr = 'unk'; |
| 340 | + switch( mimetype ){ |
| 341 | + case 'image/svg+xml': |
| 342 | + typestr = 'svg'; |
| 343 | + break; |
| 344 | + case 'image/jpeg': |
| 345 | + typestr = 'jpg' |
| 346 | + break; |
| 347 | + case 'image/png': |
| 348 | + typestr = 'png'; |
| 349 | + break; |
| 350 | + case 'audio/ogg': |
| 351 | + typestr = 'oga'; |
| 352 | + case 'video/ogg': |
| 353 | + case 'application/ogg': |
| 354 | + typestr = 'ogg'; |
| 355 | + break; |
| 356 | + } |
| 357 | + |
| 358 | + if(typestr=='unk') |
| 359 | + js_log("unkown ftype: " + mimetype ); |
| 360 | + |
| 361 | + return '<div class="rsd_file_type ui-corner-all ui-state-default ui-widget-content" title="' + gM('mwe-ftype-' + typestr) + '">' + |
| 362 | + typestr + |
| 363 | + '</div>' |
| 364 | + }, |
357 | 365 | //some default layout values: |
358 | 366 | thumb_width : 80, |
359 | 367 | image_edit_width : 400, |
— | — | @@ -1007,9 +1015,10 @@ |
1008 | 1016 | + '">'; |
1009 | 1017 | //add a linkback to resource page in upper right: |
1010 | 1018 | if( rItem.link ) |
1011 | | - o+='<a target="_new" style="position:absolute;top:0px;right:0px" title="' + |
1012 | | - gM('mwe-resource_description_page') + |
1013 | | - '" href="' + rItem.link + '"><img src="http://upload.wikimedia.org/wikipedia/commons/6/6b/Magnify-clip.png"></a>'; |
| 1019 | + o+='<div class="rsd_linkback ui-corner-all ui-state-default ui-widget-content" >' + |
| 1020 | + '<a target="_new" title="' + gM('mwe-resource_description_page') + |
| 1021 | + '" href="' + rItem.link + '">'+ gM('mwe-link') + '</a>' + |
| 1022 | + '</div>'; |
1014 | 1023 | |
1015 | 1024 | //add file type icon if known |
1016 | 1025 | if( rItem.mime ){ |
Index: trunk/phase3/js2/mwEmbed/php/languages/mwEmbed.i18n.php |
— | — | @@ -161,6 +161,7 @@ |
162 | 162 | 'rsd_layout' => 'Layout:', |
163 | 163 | 'rsd_resource_edit' => 'Edit resource: $1', |
164 | 164 | 'mwe-resource_description_page' => 'Resource description page', |
| 165 | + 'mwe-link' => 'link', |
165 | 166 | 'rsd_local_resource_title' => 'Local resource title', |
166 | 167 | 'rsd_do_insert' => 'Do insert', |
167 | 168 | 'mwe-cc_title' => 'Creative Commons', |
Index: trunk/phase3/js2/mwEmbed/skins/mvpcf/styles.css |
— | — | @@ -509,9 +509,14 @@ |
510 | 510 | position : absolute; |
511 | 511 | bottom : 0px; |
512 | 512 | left : 3px; |
513 | | - font-size: x-small; |
514 | | - background:#FFF; |
| 513 | + font-size: x-small; |
515 | 514 | } |
| 515 | +.rsd_linkback{ |
| 516 | + position: absolute; |
| 517 | + top: 0px; |
| 518 | + right: 0px; |
| 519 | + font-size: x-small; |
| 520 | +} |
516 | 521 | .rsd_license{ |
517 | 522 | position : absolute; |
518 | 523 | bottom : 0px; |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -1441,6 +1441,8 @@ |
1442 | 1442 | ], function() { |
1443 | 1443 | $('#mwe_tmp_loader').dialog({ |
1444 | 1444 | bgiframe: true, |
| 1445 | + draggable: false, |
| 1446 | + resizable: false, |
1445 | 1447 | height: 140, |
1446 | 1448 | modal: true |
1447 | 1449 | }); |