Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -1,12 +1,13 @@ |
2 | 2 | /* |
3 | | -* a library for doing remote media searches |
4 | | -* |
5 | | -* initial targeted archives are: |
| 3 | + * a library for doing remote media searches |
| 4 | + * |
| 5 | + * initial targeted archives are: |
6 | 6 | the local wiki |
7 | 7 | wikimedia commons |
8 | 8 | metavid |
9 | 9 | and archive.org |
10 | | -*/ |
| 10 | + */ |
| 11 | + |
11 | 12 | loadGM({ |
12 | 13 | "mwe-add_media_wizard" : "Add media wizard", |
13 | 14 | "mwe-media_search" : "Media search", |
— | — | @@ -17,7 +18,7 @@ |
18 | 19 | "rsd_results_prev" : "previous", |
19 | 20 | "rsd_no_results" : "No search results for <b>$1<\/b>", |
20 | 21 | "mwe-upload_tab" : "Upload", |
21 | | - "rsd_layout" : "Layout : ", |
| 22 | + "rsd_layout" : "Layout:", |
22 | 23 | "rsd_resource_edit" : "Edit resource: $1", |
23 | 24 | "mwe-resource_description_page" : "Resource description page", |
24 | 25 | "rsd_local_resource_title" : "Local resource title", |
— | — | @@ -29,7 +30,7 @@ |
30 | 31 | "mwe-cc_sa_title" : "Share Alike", |
31 | 32 | "mwe-cc_pd_title" : "Public Domain", |
32 | 33 | "mwe-unknown_license" : "Unknown license", |
33 | | - "mwe-no_import_by_url" : "This user or wiki <b>can not<\/b> import assets from remote URLs.<\/p><p>Do you need to login?<\/p><p>If permissions are set, you may have to enable $wgAllowCopyUploads (<a href=\"http : \/\/www.mediawiki.org\/wiki\/Manual : $wgAllowCopyUploads\">more information<\/a>).<\/p>", |
| 34 | + "mwe-no_import_by_url" : "This user or wiki <b>can not<\/b> import assets from remote URLs.<\/p><p>Do you need to login?<\/p><p>If permissions are set, you may have to enable $wgAllowCopyUploads (<a href=\"http : \/\/www.mediawiki.org\/wiki\/Manual:$wgAllowCopyUploads\">more information<\/a>).<\/p>", |
34 | 35 | "mwe-results_from" : "Results from <a href=\"$1\" target=\"_new\" >$2<\/a>", |
35 | 36 | "mwe-missing_desc_see_source" : "This asset is missing a description. Please see the [$1 orginal source] and help describe it.", |
36 | 37 | "rsd_config_error" : "Add media wizard configuration error: $1", |
— | — | @@ -47,6 +48,7 @@ |
48 | 49 | "mwe-importing_asset" : "Importing asset", |
49 | 50 | "mwe-preview_insert_resource" : "Preview insert of resource: $1" |
50 | 51 | }); |
| 52 | + |
51 | 53 | var default_remote_search_options = { |
52 | 54 | 'profile':'mediawiki_edit', |
53 | 55 | 'target_container':null, //the div that will hold the search interface |
— | — | @@ -77,6 +79,7 @@ |
78 | 80 | 'enable_upload_tab':true, // if we want to enable an uploads tab: |
79 | 81 | 'upload_api_target' : 'http://localhost/wiki_trunk/api.php' // can be local or the url of the upload api. |
80 | 82 | } |
| 83 | + |
81 | 84 | if(typeof wgServer == 'undefined') |
82 | 85 | wgServer = ''; |
83 | 86 | if(typeof wgScriptPath == 'undefined') |
— | — | @@ -85,8 +88,8 @@ |
86 | 89 | stylepath = ''; |
87 | 90 | |
88 | 91 | /* |
89 | | -* base remoteSearch Driver interface |
90 | | -*/ |
| 92 | + * base remoteSearch Driver interface |
| 93 | + */ |
91 | 94 | var remoteSearchDriver = function(iObj){ |
92 | 95 | return this.init( iObj ); |
93 | 96 | } |
— | — | @@ -136,7 +139,7 @@ |
137 | 140 | @local : if the content provider assets need to be imported or not. |
138 | 141 | @local_domains : sets of domains for which the content is local |
139 | 142 | //@@todo should query wgForeignFileRepos setting maybe interwikimap from the api |
140 | | - */ |
| 143 | + */ |
141 | 144 | 'this_wiki':{ |
142 | 145 | 'enabled': 1, |
143 | 146 | 'checked': 1, |
— | — | @@ -249,9 +252,9 @@ |
250 | 253 | } |
251 | 254 | }, |
252 | 255 | /* |
253 | | - * getlicenseImgSet |
254 | | - * @param license_key the license key (ie "by-sa" or "by-nc-sa" etc) |
255 | | - */ |
| 256 | + * getlicenseImgSet |
| 257 | + * @param license_key the license key (ie "by-sa" or "by-nc-sa" etc) |
| 258 | + */ |
256 | 259 | getlicenseImgSet: function( licenseObj ){ |
257 | 260 | //js_log('output images: '+ imgs); |
258 | 261 | return '<div class="rsd_license" title="'+ licenseObj.title + '" >' + |
— | — | @@ -262,9 +265,9 @@ |
263 | 266 | '</div>'; |
264 | 267 | }, |
265 | 268 | /* |
266 | | - * getLicenceKeyFromKey |
267 | | - * @param license_key the key of the license (must be defined in: this.licenses.cc.licenses) |
268 | | - */ |
| 269 | + * getLicenceKeyFromKey |
| 270 | + * @param license_key the key of the license (must be defined in: this.licenses.cc.licenses) |
| 271 | + */ |
269 | 272 | getLicenceFromKey:function( license_key , force_url){ |
270 | 273 | if( typeof( this.licenses.cc.licenses[ license_key ]) == 'undefined') |
271 | 274 | return js_error('could not find:' + license_key); |
— | — | @@ -288,9 +291,9 @@ |
289 | 292 | }; |
290 | 293 | }, |
291 | 294 | /* |
292 | | - * getLicenceKeyFromUrl |
293 | | - * @param licence_url the url of the license |
294 | | - */ |
| 295 | + * getLicenceKeyFromUrl |
| 296 | + * @param licence_url the url of the license |
| 297 | + */ |
295 | 298 | getLicenceFromUrl: function( license_url ){ |
296 | 299 | //js_log("getLicenceFromUrl::" + license_url); |
297 | 300 | //first do a direct lookup check: |
— | — | @@ -768,10 +771,10 @@ |
769 | 772 | } |
770 | 773 | }, |
771 | 774 | /* |
772 | | - * checkForCopyURLPermission: |
773 | | - * not really nessesary the api request to upload will return apopprirate error if the user lacks permission. or $wgAllowCopyUploads is set to false |
774 | | - * (use this function if we want to issue a warning up front) |
775 | | - */ |
| 775 | + * checkForCopyURLPermission: |
| 776 | + * not really nessesary the api request to upload will return apopprirate error if the user lacks permission. or $wgAllowCopyUploads is set to false |
| 777 | + * (use this function if we want to issue a warning up front) |
| 778 | + */ |
776 | 779 | checkForCopyURLPermission:function( callback ){ |
777 | 780 | var _this = this; |
778 | 781 | //do api check: |