Index: trunk/extensions/AddMediaWizard/AddMedia/mw.UploadHandler.js |
— | — | @@ -85,12 +85,12 @@ |
86 | 86 | // Update the selecto to include pointer to upload handler |
87 | 87 | var selectorElement = $j( this.selector ).get( 0 ); |
88 | 88 | selectorElement[ 'uploadHandler' ] = myUpload; |
89 | | - } |
| 89 | + }; |
90 | 90 | } )( jQuery ); |
91 | 91 | |
92 | 92 | mw.UploadHandler = function( options ) { |
93 | 93 | return this.init( options ); |
94 | | -} |
| 94 | +}; |
95 | 95 | |
96 | 96 | mw.UploadHandler.prototype = { |
97 | 97 | |
— | — | @@ -232,7 +232,7 @@ |
233 | 233 | 'name': 'comment', |
234 | 234 | 'type' : 'hidden' |
235 | 235 | }) |
236 | | - ) |
| 236 | + ); |
237 | 237 | } |
238 | 238 | |
239 | 239 | var uploadDesc = _this.getUploadDescription(); |
— | — | @@ -305,7 +305,7 @@ |
306 | 306 | } else if ( _this.upload_mode == 'autodetect' ) { |
307 | 307 | mw.log( 'detectUploadMode::' + _this.upload_mode + ' api:' + _this.apiUrl ); |
308 | 308 | if( !_this.apiUrl ) { |
309 | | - mw.log( 'Error: can\'t autodetect mode without api url' ); |
| 309 | + mw.log( 'Error: cant autodetect mode without api url' ); |
310 | 310 | return; |
311 | 311 | } |
312 | 312 | |
— | — | @@ -320,7 +320,7 @@ |
321 | 321 | return mw.log( 'Error: bad api results' ); |
322 | 322 | } |
323 | 323 | if ( typeof data.paraminfo.modules[0].classname == 'undefined' ) { |
324 | | - mw.log( 'Autodetect Upload Mode: \'post\' ' ); |
| 324 | + mw.log( 'Autodetect Upload Mode: post ' ); |
325 | 325 | _this.upload_mode = 'post'; |
326 | 326 | callback( 'post' ); |
327 | 327 | } else { |
— | — | @@ -398,7 +398,7 @@ |
399 | 399 | 'name' : "action", |
400 | 400 | 'value' : "upload" |
401 | 401 | }) |
402 | | - ) |
| 402 | + ); |
403 | 403 | } |
404 | 404 | |
405 | 405 | // Add JSON response format (jsonfm so that IE does not prompt save dialog box on iframe result ) |
— | — | @@ -410,7 +410,7 @@ |
411 | 411 | 'name' : "format", |
412 | 412 | 'value' : "jsonfm" |
413 | 413 | }) |
414 | | - ) |
| 414 | + ); |
415 | 415 | } |
416 | 416 | |
417 | 417 | // Map a new hidden form |
— | — | @@ -504,7 +504,7 @@ |
505 | 505 | 'comment' : this.getUploadDescription(), |
506 | 506 | 'watch' : ( $j( '#wpWatchthis' ).is( ':checked' ) ) ? 'true' : 'false', |
507 | 507 | 'ignorewarnings': ($j('#wpIgnoreWarning' ).is( ':checked' ) ) ? 'true' : 'false' |
508 | | - } |
| 508 | + }; |
509 | 509 | this.doHttpUpload( httpUpConf ); |
510 | 510 | }, |
511 | 511 | |
— | — | @@ -535,7 +535,7 @@ |
536 | 536 | |
537 | 537 | // Run the JS equivalent of SpecialUpload.php getInitialPageText |
538 | 538 | comment_value = this.getCommentText( comment_value, license, copyStatus, source ); |
539 | | - this.rewriteDescriptionText = false; |
| 539 | + //this.rewriteDescriptionText = false; |
540 | 540 | } |
541 | 541 | mw.log( 'getUploadDescription:: new val:' + comment_value ); |
542 | 542 | return comment_value; |
— | — | @@ -552,15 +552,15 @@ |
553 | 553 | * @param {String} source The source filed |
554 | 554 | */ |
555 | 555 | getCommentText: function( comment, license, copyStatus, source ) { |
556 | | - var pageText = '== ' + gM( 'filedesc' ) + " ==\n" + comment + "\n"; |
| 556 | + var pageText = '== ' + gM( 'mwe-filedesc' ) + " ==\n" + comment + "\n"; |
557 | 557 | if( copyStatus ){ |
558 | | - pageText += '== ' + gM( 'filestatus' ) + " ==\n" + copyStatus + "\n"; |
| 558 | + pageText += '== ' + gM( 'mwe-filestatus' ) + " ==\n" + copyStatus + "\n"; |
559 | 559 | } |
560 | 560 | if( source ){ |
561 | | - pageText += '== ' + gM( 'filesource' ) + " ==\n" + source + "\n"; |
| 561 | + pageText += '== ' + gM( 'mwe-filesource' ) + " ==\n" + source + "\n"; |
562 | 562 | } |
563 | 563 | if ( license ) { |
564 | | - pageText += '== ' + gM( 'license-header' ) + " ==\n" + '{{' + license + '}}' + "\n"; |
| 564 | + pageText += '== ' + gM( 'mwe-license-header' ) + " ==\n" + '{{' + license + '}}' + "\n"; |
565 | 565 | } |
566 | 566 | return pageText; |
567 | 567 | }, |
— | — | @@ -771,7 +771,7 @@ |
772 | 772 | if ( apiRes.upload && apiRes.upload.imageinfo && apiRes.upload.imageinfo.descriptionurl ) { |
773 | 773 | // Call the completion callback if available. |
774 | 774 | if ( typeof _this.doneUploadCb == 'function' ) { |
775 | | - _this.doneUploadCb( apiRes ) |
| 775 | + _this.doneUploadCb( apiRes ); |
776 | 776 | // Close the ui |
777 | 777 | _this.ui.close(); |
778 | 778 | return true; |
— | — | @@ -833,7 +833,7 @@ |
834 | 834 | _this.processApiResult( data ); |
835 | 835 | } ); |
836 | 836 | } else { |
837 | | - mw.log( 'No session key re-sending upload' ) |
| 837 | + mw.log( 'No session key re-sending upload' ); |
838 | 838 | //Do a stashed upload |
839 | 839 | $j( '#wpIgnoreWarning' ).attr( 'checked', true ); |
840 | 840 | $j( _this.form ).submit(); |
— | — | @@ -876,7 +876,7 @@ |
877 | 877 | this.editToken = $j("form[name='token']").val(); |
878 | 878 | } |
879 | 879 | if( !this.editToken ){ |
880 | | - mw.log("Error: can not find edit token ") |
| 880 | + mw.log("Error: can not find edit token "); |
881 | 881 | return false; |
882 | 882 | } |
883 | 883 | return this.editToken; |
— | — | @@ -948,14 +948,14 @@ |
949 | 949 | |
950 | 950 | if ( !data || !data.query || !data.query.pages ) { |
951 | 951 | // Ignore a null result |
952 | | - mw.log(" No data in DestCheck result") |
| 952 | + mw.log(" No data in DestCheck result"); |
953 | 953 | return; |
954 | 954 | } |
955 | 955 | |
956 | 956 | if ( data.query.pages[-1] ) { |
957 | 957 | // No conflict found |
958 | | - mw.log(" No pages in DestCheck result") |
959 | | - return; |
| 958 | + mw.log(" No pages in DestCheck result"); |
| 959 | + return false; |
960 | 960 | } |
961 | 961 | for ( var page_id in data.query.pages ) { |
962 | 962 | if ( !data.query.pages[ page_id ].imageinfo ) { |
— | — | @@ -966,7 +966,7 @@ |
967 | 967 | if ( data.query.normalized ) { |
968 | 968 | var ntitle = data.query.normalized[0].to; |
969 | 969 | } else { |
970 | | - var ntitle = data.query.pages[ page_id ].title |
| 970 | + var ntitle = data.query.pages[ page_id ].title; |
971 | 971 | } |
972 | 972 | var img = data.query.pages[ page_id ].imageinfo[0]; |
973 | 973 | |
— | — | @@ -983,7 +983,7 @@ |
984 | 984 | .attr( linkAttr ) |
985 | 985 | .text( ntitle ) |
986 | 986 | ) |
987 | | - ) |
| 987 | + ); |
988 | 988 | |
989 | 989 | var $imageLink = $j('<a />') |
990 | 990 | .addClass( 'image' ) |
— | — | @@ -1039,5 +1039,6 @@ |
1040 | 1040 | ); |
1041 | 1041 | } |
1042 | 1042 | } ); |
1043 | | - } |
| 1043 | + }; |
| 1044 | + |
1044 | 1045 | })( jQuery ); |
Index: trunk/extensions/AddMediaWizard/AddMedia/searchLibs/mediaWikiSearch.js |
— | — | @@ -28,33 +28,53 @@ |
29 | 29 | * @param {String} title Title of the resource to be added |
30 | 30 | * @param {Function} callback Function called once title resource acquired |
31 | 31 | */ |
32 | | - addByTitle:function( title , callback, redirect_count ) { |
| 32 | + getByTitle:function( title , callback ) { |
33 | 33 | |
34 | | - mw.log( "AddByTitle::" + title ); |
| 34 | + mw.log( "MediaWikiSearch:: getByTitle:" + title ); |
35 | 35 | |
36 | | - var _this = this; |
37 | | - if ( !redirect_count ) |
38 | | - redirect_count = 0; |
39 | | - if ( redirect_count > 5 ) { |
40 | | - mw.log( 'Error: addByTitle too many redirects' ); |
41 | | - callback( false ); |
42 | | - return false; |
43 | | - } |
| 36 | + var _this = this; |
| 37 | + |
44 | 38 | var request = { |
45 | | - 'titles':'File:' + title, |
46 | | - 'prop':'imageinfo|revisions|categories', |
47 | | - 'iiprop':'url|mime|size', |
48 | | - 'iiurlwidth': parseInt( this.rsd.thumb_width ), |
49 | | - 'rvprop':'content', |
| 39 | + 'titles' : 'File:' + title.replace(/File:|Image:/ig, ''), |
| 40 | + 'prop' : 'imageinfo|revisions|categories', |
| 41 | + 'iiprop' : 'url|mime|size|metadata', |
| 42 | + 'iiurlwidth' : parseInt( this.rsd.thumb_width ), |
| 43 | + 'rvprop' : 'content', |
50 | 44 | 'redirects' : true |
51 | 45 | } |
52 | | - mw.getJSON(this.provider.apiUrl, request, function( data ) { |
| 46 | + mw.getJSON( this.provider.apiUrl, request, function( data ) { |
53 | 47 | // call addSingleResult |
54 | 48 | callback( _this.addSingleResult( data ) ); |
55 | 49 | }); |
56 | 50 | }, |
57 | | - |
| 51 | + |
| 52 | + getResourceFromUrl: function( url, callback ){ |
| 53 | + var title = this.getTitleKeyFromMwUrl( url ); |
| 54 | + if( !title) { |
| 55 | + callback( false ); |
| 56 | + return ; |
| 57 | + } |
| 58 | + this.getByTitle(title , callback ); |
| 59 | + }, |
58 | 60 | /** |
| 61 | + * Does best effort to get the title key from a mediawiki url |
| 62 | + */ |
| 63 | + getTitleKeyFromMwUrl: function( url ){ |
| 64 | + // try for title key param |
| 65 | + var titleKey = mw.parseUri( url ).queryKey['title']; |
| 66 | + if( titleKey ){ |
| 67 | + return titleKey; |
| 68 | + } |
| 69 | + // else try for title url map |
| 70 | + titleKey = url.replace( this.provider.detailsUrl.replace( '$1', ''), '' ); |
| 71 | + if( titleKey != url ){ |
| 72 | + return titleKey; |
| 73 | + } |
| 74 | + mw.log("Error: mediaWikiSearch:: getResourceFromUrl could not get title form url: " + url ); |
| 75 | + return false; |
| 76 | + }, |
| 77 | + |
| 78 | + /** |
59 | 79 | * Get recent upload by user and add them as results |
60 | 80 | * |
61 | 81 | * @param {String} user Name of the user |
— | — | @@ -88,7 +108,7 @@ |
89 | 109 | var resourceQuery = { |
90 | 110 | 'titles' : titleStr, |
91 | 111 | 'prop' : 'imageinfo|revisions|categories', |
92 | | - 'iiprop' : 'url|mime|size', |
| 112 | + 'iiprop' : 'url|mime|size|metadata', |
93 | 113 | 'iiurlwidth': parseInt( _this.rsd.thumb_width ), |
94 | 114 | 'rvprop':'content' |
95 | 115 | }; |
— | — | @@ -122,7 +142,7 @@ |
123 | 143 | 'gsrlimit': this.provider.limit, |
124 | 144 | 'gsroffset': this.provider.offset, |
125 | 145 | 'prop':'imageinfo|revisions|categories', |
126 | | - 'iiprop':'url|mime|size', |
| 146 | + 'iiprop':'url|mime|size|metadata', |
127 | 147 | 'iiurlwidth': parseInt( this.rsd.thumb_width ), |
128 | 148 | 'rvprop':'content' |
129 | 149 | }; |
— | — | @@ -183,14 +203,18 @@ |
184 | 204 | } |
185 | 205 | |
186 | 206 | // Get the url safe titleKey from the descriptionurl |
187 | | - var titleKey = page.imageinfo[0].descriptionurl.split( '/' ); |
188 | | - titleKey = unescape( titleKey[ titleKey.length - 1 ] ); |
| 207 | + var titleKey = page.imageinfo[0].descriptionurl.split( '/' ) |
| 208 | + ; |
| 209 | + titleKey = unescape( |
| 210 | + titleKey[ titleKey.length - 1 ] |
| 211 | + .replace( 'index.php?title=', '') |
| 212 | + ); |
189 | 213 | |
190 | 214 | var resource = { |
191 | 215 | 'id' : page_id, |
192 | 216 | 'titleKey' : titleKey, |
193 | 217 | 'link' : page.imageinfo[0].descriptionurl, |
194 | | - 'title' : page.title.replace(/File:|.jpg|.png|.svg|.ogg|.ogv|.oga/ig, ''), |
| 218 | + 'title' : page.title.replace(/Image:|File:|.jpg|.png|.svg|.ogg|.ogv|.oga/ig, ''), |
195 | 219 | 'poster' : page.imageinfo[0].thumburl, |
196 | 220 | 'thumbwidth' : page.imageinfo[0].thumbwidth, |
197 | 221 | 'thumbheight': page.imageinfo[0].thumbheight, |
— | — | @@ -201,11 +225,18 @@ |
202 | 226 | 'desc' : page.revisions[0]['*'], |
203 | 227 | // add pointer to parent search obj: |
204 | 228 | 'pSobj' :_this, |
| 229 | + |
205 | 230 | 'meta': { |
206 | 231 | 'categories':page.categories |
207 | 232 | } |
208 | | - }; |
| 233 | + }; |
209 | 234 | |
| 235 | + for( var i in page.imageinfo[0].metadata ){ |
| 236 | + if( page.imageinfo[0].metadata[i].name == 'length' ){ |
| 237 | + resource.duration = page.imageinfo[0].metadata[i].value; |
| 238 | + } |
| 239 | + } |
| 240 | + |
210 | 241 | /* |
211 | 242 | //to use once we get the wiki-text parser in shape |
212 | 243 | var pObj = mw.parser( resource.desc ); |
— | — | @@ -247,8 +278,10 @@ |
248 | 279 | this.resultsObj[page_id] = resource; |
249 | 280 | |
250 | 281 | // If returnFirst flag: |
251 | | - if ( returnFirst ) |
| 282 | + // xxx this is kind of hacky .. we should have abstract getter / adder to result list |
| 283 | + if ( returnFirst ){ |
252 | 284 | return this.resultsObj[page_id]; |
| 285 | + } |
253 | 286 | |
254 | 287 | |
255 | 288 | this.num_results++; |
Index: trunk/extensions/AddMediaWizard/AddMedia/searchLibs/baseRemoteSearch.js |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | num_results : 0, |
58 | 58 | |
59 | 59 | /** |
60 | | - * Initialise the baseRemoteSearch |
| 60 | + * Initialize the baseRemoteSearch |
61 | 61 | * @param {Object} options The set of options for the remote search class |
62 | 62 | */ |
63 | 63 | init: function( options ) { |
— | — | @@ -67,6 +67,10 @@ |
68 | 68 | return this; |
69 | 69 | }, |
70 | 70 | |
| 71 | + getResourceFromUrl: function( url, callback ){ |
| 72 | + mw.log("Error getResourceFromUrl must be implemented by remoteSearch provider"); |
| 73 | + }, |
| 74 | + |
71 | 75 | /** |
72 | 76 | * Base search results |
73 | 77 | * Does some common initialisation for search results |
Index: trunk/extensions/AddMediaWizard/AddMedia/searchLibs/flickrSearch.js |
— | — | @@ -15,8 +15,7 @@ |
16 | 16 | var flickrSearch = function ( options ) { |
17 | 17 | this.init( options ); |
18 | 18 | } |
19 | | -flickrSearch.prototype = { |
20 | | - dtUrl : 'http://www.flickr.com/photos/', |
| 19 | +flickrSearch.prototype = { |
21 | 20 | // @@todo probably would be good to read the api-key from configuration |
22 | 21 | apikey : '2867787a545cc66c0bce6f2e57aca1d1', |
23 | 22 | // What license we are interested in |
— | — | @@ -102,7 +101,7 @@ |
103 | 102 | var resource = { |
104 | 103 | 'titleKey' : flickrResource.title + '.jpg', |
105 | 104 | 'resourceKey': flickrResource.id, |
106 | | - 'link' : _this.dtUrl + flickrResource.pathalias + '/' + flickrResource.id, |
| 105 | + 'link' : _this.detailsUrl + flickrResource.pathalias + '/' + flickrResource.id, |
107 | 106 | 'title' : flickrResource.title, |
108 | 107 | 'thumbwidth' : flickrResource.width_t, |
109 | 108 | 'thumbheight': flickrResource.height_t, |
Index: trunk/extensions/AddMediaWizard/AddMedia/loader.js |
— | — | @@ -38,7 +38,9 @@ |
39 | 39 | mw.addModuleLoader( 'AddMedia.UploadForm', [ |
40 | 40 | [ |
41 | 41 | 'mw.UploadForm', |
42 | | - '$j.ui' |
| 42 | + '$j.ui', |
| 43 | + '$j.widget', |
| 44 | + '$j.ui.mouse' |
43 | 45 | ], |
44 | 46 | [ |
45 | 47 | '$j.ui.datepicker' |
— | — | @@ -57,7 +59,10 @@ |
58 | 60 | '$j.browserTest', // ( textSelection uses browserTest ) |
59 | 61 | '$j.ui' |
60 | 62 | ], [ |
61 | | - '$j.ui.resizable', |
| 63 | + '$j.widget', |
| 64 | + '$j.ui.mouse', |
| 65 | + '$j.ui.resizable', |
| 66 | + '$j.ui.position', |
62 | 67 | '$j.ui.draggable', |
63 | 68 | '$j.ui.dialog', |
64 | 69 | '$j.ui.tabs', |
— | — | @@ -70,10 +75,13 @@ |
71 | 76 | [ |
72 | 77 | 'mw.UploadHandler', |
73 | 78 | 'mw.UploadInterface', |
74 | | - '$j.ui' |
| 79 | + '$j.ui', |
| 80 | + '$j.ui.mouse', |
| 81 | + '$j.widget' |
75 | 82 | ], |
76 | 83 | [ |
77 | 84 | '$j.ui.progressbar', |
| 85 | + '$j.ui.position', |
78 | 86 | '$j.ui.dialog', |
79 | 87 | '$j.ui.draggable' |
80 | 88 | ] |
Index: trunk/extensions/AddMediaWizard/AddMedia/mw.Firefogg.js |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | "fogg-preview" : "Preview video", |
27 | 27 | "fogg-hidepreview" : "Hide preview", |
28 | 28 | "fogg-warning-firebug" : "<b>Firebug</b> can cause conflicts with <i>Firefogg</i>. Please disable <b>Firebug</b> for this page.", |
29 | | - "fogg-missing-webm-support" : "Please use a [$1 WebM compatible] browser to preview results of WebM videos" |
| 29 | + "fogg-missing-webm-support" : "Please use a [$1 webm compatible] browsers to preview results of webm videos" |
30 | 30 | }); |
31 | 31 | |
32 | 32 | var firefogg_install_links = { |
— | — | @@ -344,9 +344,14 @@ |
345 | 345 | /** |
346 | 346 | * Show the install firefogg msg |
347 | 347 | */ |
348 | | - showInstallFirefog: function() { |
| 348 | + showInstallFirefog: function( target ) { |
349 | 349 | var _this = this; |
350 | 350 | |
| 351 | + if( target ){ |
| 352 | + this.target_use_latest_firefox = target; |
| 353 | + this.target_please_install = target; |
| 354 | + } |
| 355 | + |
351 | 356 | var upMsg = ( _this.form_type == 'upload' ) ? |
352 | 357 | gM( 'fogg-for_improved_uploads' ) + ' ' : gM( 'fogg-not-installed') + ' '; |
353 | 358 | |
Index: trunk/extensions/AddMediaWizard/AddMedia/mw.UploadForm.js |
— | — | @@ -401,7 +401,7 @@ |
402 | 402 | remoteSearchDriver.addResourceEditLoader(); |
403 | 403 | |
404 | 404 | //Add the uploaded result |
405 | | - searchProvider.sObj.addByTitle( wTitle, function( resource ) { |
| 405 | + searchProvider.sObj.getByTitle( wTitle, function( resource ) { |
406 | 406 | // Update the recent uploads ( background task ) |
407 | 407 | remoteSearchDriver.showUserRecentUploads( uploadTargetId ); |
408 | 408 | // Pull up resource editor: |
Index: trunk/extensions/AddMediaWizard/AddMedia/mw.FirefoggGUI.js |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | |
98 | 98 | mw.FirefoggGUI = function( iObj ) { |
99 | 99 | return this.init( iObj ); |
100 | | -} |
| 100 | +}; |
101 | 101 | var default_mvAdvFirefogg_config = { |
102 | 102 | // Config groups to include |
103 | 103 | 'config_groups': [ 'preset', 'range', 'quality', 'meta', 'advVideo', 'advAudio' ], |
— | — | @@ -109,7 +109,7 @@ |
110 | 110 | |
111 | 111 | // The control container |
112 | 112 | 'target_control_container': false |
113 | | -} |
| 113 | +}; |
114 | 114 | |
115 | 115 | mw.FirefoggGUI.prototype = { |
116 | 116 | // The configuration group names |
— | — | @@ -219,13 +219,13 @@ |
220 | 220 | 'group' : "quality" |
221 | 221 | }, |
222 | 222 | 'width': { |
223 | | - 'range' : { 'min': 0, 'max': 1080 }, |
| 223 | + 'range' : { 'min': 0, 'max': 4096 }, |
224 | 224 | 'step' : 4, |
225 | 225 | 'type' : 'slider', |
226 | 226 | 'group' : "quality" |
227 | 227 | }, |
228 | 228 | 'height': { |
229 | | - 'range' : { 'min': 0, 'max' : 1080 }, |
| 229 | + 'range' : { 'min': 0, 'max' : 3072 }, |
230 | 230 | 'step' : 4, |
231 | 231 | 'type' : "slider", |
232 | 232 | 'group' : "quality" |
— | — | @@ -413,7 +413,7 @@ |
414 | 414 | case 'target_btn_save_local_file': |
415 | 415 | var icon; |
416 | 416 | if ( target == 'target_btn_save_local_file' ) { |
417 | | - icon = 'ui-icon-video' |
| 417 | + icon = 'ui-icon-video'; |
418 | 418 | } else { |
419 | 419 | icon = 'ui-icon-folder-open'; |
420 | 420 | } |
— | — | @@ -545,32 +545,6 @@ |
546 | 546 | return out; |
547 | 547 | }, |
548 | 548 | |
549 | | - /** |
550 | | - * Show a dialog box asking the user to select a source URL. |
551 | | - * FIXME: half-written, doesn't work at all. |
552 | | - */ |
553 | | - /* |
554 | | - selectSourceUrl: function() { |
555 | | - // FIXME: i18n |
556 | | - var url = prompt( "Please enter the source media url you would like " + |
557 | | - "to transcode from.", "http://" ); |
558 | | - if ( !url ) { |
559 | | - return; |
560 | | - } |
561 | | - |
562 | | - // update the mode: |
563 | | - this.sourceMode = 'url'; |
564 | | - this.sourceUrl = url; |
565 | | - this.clearSourceInfoCache(); |
566 | | - this.updateSourceFileUI(); |
567 | | - // update the input target |
568 | | - $j( this.target_input_file_name ) |
569 | | - .unbind() |
570 | | - .val( url ) |
571 | | - .removeAttr( 'readonly' ); |
572 | | - }, |
573 | | - */ |
574 | | - |
575 | 549 | bindControls: function() { |
576 | 550 | var _this = this; |
577 | 551 | _this.basefogg_bindControls(); |
— | — | @@ -633,7 +607,7 @@ |
634 | 608 | function() { |
635 | 609 | var configKey = _this.getClassId( this, 'help_' ); |
636 | 610 | if( !helpState[configKey] ) |
637 | | - $j( _this.selector + ' .helpRow_' + configKey ).hide( 'slow' ) |
| 611 | + $j( _this.selector + ' .helpRow_' + configKey ).hide( 'slow' ); |
638 | 612 | } |
639 | 613 | ); |
640 | 614 | |
— | — | @@ -672,7 +646,7 @@ |
673 | 647 | $j( this ).val() ) |
674 | 648 | ); |
675 | 649 | _this.updatePresetSelection( 'custom' ); |
676 | | - }) |
| 650 | + }); |
677 | 651 | break; |
678 | 652 | case 'date': |
679 | 653 | $j( this.selector + ' ._' + configKey ).datepicker({ |
Index: trunk/extensions/AddMediaWizard/AddMedia/mw.RemoteSearchDriver.js |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | "rsd-wiki_commons-title": "Wikimedia Commons", |
76 | 76 | "rsd-wiki_commons": "Wikimedia Commons, an archive of freely-licensed educational media content (images, sound and video clips)", |
77 | 77 | |
78 | | - "rsd-kaltura-title" : "All sources", |
| 78 | + "rsd-kaltura-title" : "Kaltura search ( all sources )", |
79 | 79 | "rsd-kaltura" : "Kaltura aggregated search for free-licensed media across multiple search providers", |
80 | 80 | |
81 | 81 | "rsd-this_wiki-title" : "This wiki", |
— | — | @@ -104,7 +104,17 @@ |
105 | 105 | // The target button or link that will invoke the search interface |
106 | 106 | 'target_invoke_button': null, |
107 | 107 | |
| 108 | + // Default id for search target input |
| 109 | + 'target_search_input' : '#rsd_q', |
| 110 | + |
108 | 111 | /** |
| 112 | + * Callback functions: |
| 113 | + */ |
| 114 | + 'resourceSelectionCallback' : null, |
| 115 | + |
| 116 | + 'displaySearchResultsCallback' : null, |
| 117 | + |
| 118 | + /** |
109 | 119 | * import_url_mode |
110 | 120 | * Can be 'api', 'autodetect', 'remote_link' |
111 | 121 | * api: uses the mediawiki api to insert the media asset |
— | — | @@ -146,8 +156,11 @@ |
147 | 157 | // 'nc' ( non-commercial ), 'all' ( all found licenses are "ok") |
148 | 158 | 'enabled_licenses' : ['pd', 'by', 'sa' ], |
149 | 159 | |
| 160 | + // If the input text should be displayed |
| 161 | + 'displaySearchInput' : true, |
| 162 | + |
150 | 163 | // If we should display resource icons |
151 | | - 'displayResourceInfoIcons' : true, |
| 164 | + 'displayResourceInfoIcons' : true, |
152 | 165 | |
153 | 166 | // If we should display the result format button. |
154 | 167 | 'displayResultFormatButton': true, |
— | — | @@ -166,7 +179,6 @@ |
167 | 180 | |
168 | 181 | $.fn.addMediaWizard = function( options, callback ) { |
169 | 182 | options['target_invoke_button'] = this.selector; |
170 | | - options['instance_name'] = 'rsdMVRS'; |
171 | 183 | window['rsdMVRS'] = new mw.RemoteSearchDriver( options ); |
172 | 184 | if( callback ) { |
173 | 185 | callback( window['rsdMVRS'] ); |
— | — | @@ -266,7 +278,10 @@ |
267 | 279 | 'this_wiki': { |
268 | 280 | 'enabled': 1, |
269 | 281 | 'apiUrl': ( wgServer && wgScriptPath ) ? |
270 | | - wgServer + wgScriptPath + '/api.php' : null, |
| 282 | + wgServer + wgScriptPath + '/api.php' : null, |
| 283 | + |
| 284 | + 'detailsUrl' : ( wgServer && wgArticlePath )? wgServer + wgArticlePath : null, |
| 285 | + |
271 | 286 | 'lib': 'mediaWiki', |
272 | 287 | 'homepage' : ( wgServer && wgScript ) ? |
273 | 288 | wgServer + wgScript : null, |
— | — | @@ -281,6 +296,9 @@ |
282 | 297 | 'enabled': 1, |
283 | 298 | 'homepage': 'http://kaltura.com', |
284 | 299 | 'apiUrl': 'http://kaldev.kaltura.com/michael/aggregator.php', |
| 300 | + |
| 301 | + 'detailsUrl' : 'http://videos.kaltura.com/$1', |
| 302 | + |
285 | 303 | 'lib': 'kaltura', |
286 | 304 | 'resource_prefix' : '', |
287 | 305 | 'tab_image':false |
— | — | @@ -293,6 +311,8 @@ |
294 | 312 | 'enabled': 1, |
295 | 313 | 'homepage': 'http://commons.wikimedia.org/wiki/Main_Page', |
296 | 314 | 'apiUrl': 'http://commons.wikimedia.org/w/api.php', |
| 315 | + 'detailsUrl' : 'http://commons.wikimedia.org/wiki/$1', |
| 316 | + |
297 | 317 | 'lib': 'mediaWiki', |
298 | 318 | 'tab_img': true, |
299 | 319 | |
— | — | @@ -318,6 +338,8 @@ |
319 | 339 | 'homepage': 'http://www.archive.org/about/about.php', |
320 | 340 | |
321 | 341 | 'apiUrl': 'http://www.archive.org/advancedsearch.php', |
| 342 | + 'detailsUrl' : 'http://www.archive.org/details/$1', |
| 343 | + |
322 | 344 | 'lib': 'archiveOrg', |
323 | 345 | 'local': false, |
324 | 346 | 'resource_prefix': 'AO_', |
— | — | @@ -329,9 +351,10 @@ |
330 | 352 | */ |
331 | 353 | 'flickr': { |
332 | 354 | 'enabled': 1, |
333 | | - 'homepage': 'http://www.flickr.com/about/', |
334 | | - |
| 355 | + 'homepage': 'http://www.flickr.com/about/', |
335 | 356 | 'apiUrl': 'http://www.flickr.com/services/rest/', |
| 357 | + 'detailsUrl' : 'http://www.flickr.com/photos/', |
| 358 | + |
336 | 359 | 'lib': 'flickr', |
337 | 360 | 'local': false, |
338 | 361 | // Just prefix with Flickr_ for now. |
— | — | @@ -346,6 +369,8 @@ |
347 | 370 | 'enabled': 1, |
348 | 371 | 'homepage': 'http://metavid.org/wiki/Metavid_Overview', |
349 | 372 | 'apiUrl': 'http://metavid.org/w/index.php?title=Special:MvExportSearch', |
| 373 | + 'detailsUrl' : 'http://metavid.org/wiki/Stream:$1', |
| 374 | + |
350 | 375 | 'lib': 'metavid', |
351 | 376 | 'local': false, |
352 | 377 | |
— | — | @@ -442,7 +467,7 @@ |
443 | 468 | */ |
444 | 469 | init: function( options ) { |
445 | 470 | var _this = this; |
446 | | - mw.log( 'remoteSearchDriver:init' ); |
| 471 | + mw.log( 'RemoteSearchDriver:init' ); |
447 | 472 | |
448 | 473 | // Add in a local "id" reference to each provider |
449 | 474 | for ( var provider_id in this.content_providers ) { |
— | — | @@ -524,6 +549,8 @@ |
525 | 550 | } |
526 | 551 | return this; |
527 | 552 | }, |
| 553 | + |
| 554 | + |
528 | 555 | |
529 | 556 | /** |
530 | 557 | * Get license icon html |
— | — | @@ -730,11 +757,11 @@ |
731 | 758 | var query = _this.getDefaultQuery(); |
732 | 759 | |
733 | 760 | // Refresh the container if "upload" or "changed query" |
734 | | - if ( query != $j( '#rsd_q' ).val() |
| 761 | + if ( query != $j( this.target_search_input ).val() |
735 | 762 | || |
736 | 763 | this.current_provider == 'upload' ) |
737 | 764 | { |
738 | | - $j( '#rsd_q' ).val( query ); |
| 765 | + $j( this.target_search_input ).val( query ); |
739 | 766 | _this.updateResults(); |
740 | 767 | } |
741 | 768 | // $j(_this.target_container).dialog("open"); |
— | — | @@ -823,14 +850,8 @@ |
824 | 851 | .attr({ |
825 | 852 | 'id' : 'rsd_modal_target', |
826 | 853 | 'title' : gM( 'mwe-add_media_wizard' ) |
827 | | - }) |
828 | | - .css( { |
829 | | - 'position' : 'absolute', |
830 | | - 'top' : '3em', |
831 | | - 'left' : '0px', |
832 | | - 'bottom' : '3em', |
833 | | - 'right' : '0px' |
834 | | - }) |
| 854 | + }) |
| 855 | + .css("position", 'relative') |
835 | 856 | ); |
836 | 857 | // Get layout |
837 | 858 | mw.log( 'width: ' + $j( window ).width() + ' height: ' + $j( window ).height() ); |
— | — | @@ -845,6 +866,9 @@ |
846 | 867 | bgiframe: true, |
847 | 868 | autoOpen: true, |
848 | 869 | modal: true, |
| 870 | + width: $j(window).width()-50, |
| 871 | + height: $j(window).height()-50, |
| 872 | + position : 'center', |
849 | 873 | draggable: false, |
850 | 874 | resizable: false, |
851 | 875 | buttons: cancelButton, |
— | — | @@ -855,7 +879,7 @@ |
856 | 880 | $j( this ).parents( '.ui-dialog' ).fadeOut( 'slow' ); |
857 | 881 | } |
858 | 882 | } ); |
859 | | - $j( _this.target_container ).dialogFitWindow(); |
| 883 | + //$j( _this.target_container ).dialogFitWindow(); |
860 | 884 | |
861 | 885 | // Add the window resize hook to keep dialog layout |
862 | 886 | $j( window ).resize( function() { |
— | — | @@ -872,12 +896,16 @@ |
873 | 897 | |
874 | 898 | var $mainContainer = $j( this.target_container ); |
875 | 899 | |
876 | | - var $controlContainer = this.createControlContainer(); |
| 900 | + // Add the provider seleciton |
| 901 | + $mainContainer.append( this.createProviderSelection() ); |
877 | 902 | |
878 | | - $mainContainer.append( $controlContainer ); |
| 903 | + // Add the searchInput control if it should be displayed: |
| 904 | + if( this.displaySearchInput ){ |
| 905 | + $mainContainer.append( this.createSearchInput() ); |
| 906 | + }; |
879 | 907 | |
880 | 908 | this.$resultsContainer = $j('<div />').attr({ |
881 | | - id: "rsd_results_container" |
| 909 | + id : "rsd_results_container" |
882 | 910 | }); |
883 | 911 | |
884 | 912 | $mainContainer.append( this.$filtersContainer ); |
— | — | @@ -885,7 +913,7 @@ |
886 | 914 | |
887 | 915 | // Run the default search: |
888 | 916 | if ( this.getDefaultQuery() ){ |
889 | | - this.updateResults(); |
| 917 | + _this.updateResults(); |
890 | 918 | } |
891 | 919 | |
892 | 920 | // Add bindings |
— | — | @@ -920,12 +948,57 @@ |
921 | 949 | // Setup base cancel button binding |
922 | 950 | this.onCancelResourceEdit(); |
923 | 951 | }, |
924 | | - |
925 | 952 | /** |
| 953 | + * public function to get enabled content providers |
| 954 | + */ |
| 955 | + getEnabledProviders: function(){ |
| 956 | + var enabledProviders = {}; |
| 957 | + for ( var providerName in this.content_providers ) { |
| 958 | + var content_providers = this.content_providers; |
| 959 | + var provider = content_providers[ providerName ]; |
| 960 | + if ( provider.enabled && provider.apiUrl ) { |
| 961 | + enabledProviders[providerName] = provider; |
| 962 | + } |
| 963 | + } |
| 964 | + return enabledProviders; |
| 965 | + }, |
| 966 | + |
| 967 | + createProviderSelection: function(){ |
| 968 | + var _this = this; |
| 969 | + var $providerSelection = $j( '<ul />' ) |
| 970 | + .addClass( "ui-provider-selection" ); |
| 971 | + // Add enabled search providers. |
| 972 | + $j.each( _this.getEnabledProviders(), function(providerName, provider){ |
| 973 | + var $anchor = $j( '<div />' ) |
| 974 | + .text( gM( 'rsd-' + providerName + '-title' ) ) |
| 975 | + .attr({ |
| 976 | + name: providerName |
| 977 | + }); |
| 978 | + if ( _this.current_provider == providerName) { |
| 979 | + $anchor.addClass( 'ui-selected' ); |
| 980 | + } |
| 981 | + |
| 982 | + $anchor.click( function() { |
| 983 | + $j( this ).parent().parent().find( '.ui-selected' ) |
| 984 | + .removeClass( 'ui-selected' ); |
| 985 | + $j( this ).addClass( 'ui-selected' ); |
| 986 | + _this.current_provider = $j( this ).attr( "name" ); |
| 987 | + // Update the search results on provider selection |
| 988 | + _this.updateResults( _this.current_provider, true ); |
| 989 | + return false; |
| 990 | + }); |
| 991 | + |
| 992 | + var $listItem = $j( '<li />' ); |
| 993 | + $listItem.append( $anchor ); |
| 994 | + $providerSelection.append( $listItem ); |
| 995 | + }); |
| 996 | + return $providerSelection; |
| 997 | + }, |
| 998 | + /** |
926 | 999 | * Creates the search control (i.e. Search textbox, search button, provider filter). |
927 | 1000 | * @return A jQuery-generated HTML element ready to be injected in the main container. |
928 | 1001 | */ |
929 | | - createControlContainer: function() { |
| 1002 | + createSearchInput: function() { |
930 | 1003 | var _this = this; |
931 | 1004 | var $controlContainer = $j( '<div />' ) |
932 | 1005 | .addClass( "rsd_control_container" ); |
— | — | @@ -935,22 +1008,20 @@ |
936 | 1009 | action : "javascript:return false" |
937 | 1010 | }); |
938 | 1011 | |
939 | | - var $providerSelection = $j( '<ul />' ) |
940 | | - .addClass( "ui-provider-selection" ); |
941 | | - |
942 | | - var $searchButton = $j.button({ |
943 | | - icon_id: 'search', |
944 | | - text: gM( 'mwe-media_search' ) }) |
945 | | - .addClass( 'rsd_search_button' ) |
946 | | - .buttonHover() |
947 | | - .click(function () { |
948 | | - if( _this.current_provider == 'upload' ){ |
949 | | - _this.current_provider = _this.previus_provider; |
950 | | - } |
951 | | - _this.updateResults( _this.current_provider, true ); |
952 | | - return false; |
953 | | - }); |
954 | 1012 | |
| 1013 | + var $searchButton = $j.button({ |
| 1014 | + icon: 'search', |
| 1015 | + text: gM( 'mwe-media_search' ) |
| 1016 | + }) |
| 1017 | + .addClass( 'rsd_search_button' ) |
| 1018 | + .click(function () { |
| 1019 | + if( _this.current_provider == 'upload' ){ |
| 1020 | + _this.current_provider = _this.previus_provider; |
| 1021 | + } |
| 1022 | + _this.updateResults( _this.current_provider, true ); |
| 1023 | + return false; |
| 1024 | + }); |
| 1025 | + |
955 | 1026 | var $searchBox = $j( '<input />' ) |
956 | 1027 | .addClass( 'ui-corner-all' ) |
957 | 1028 | .attr({ |
— | — | @@ -972,43 +1043,13 @@ |
973 | 1044 | $searchButton.removeClass("ui-button-disabled"); |
974 | 1045 | } |
975 | 1046 | }); |
976 | | - |
977 | | - // Add enabled search providers. |
978 | | - for ( var providerName in this.content_providers ) { |
979 | | - var content_providers = this.content_providers; |
980 | | - var provider = content_providers[ providerName ]; |
981 | | - if ( provider.enabled && provider.apiUrl ) { |
982 | | - var $anchor = $j( '<div />' ) |
983 | | - .text( gM( 'rsd-' + providerName + '-title' ) ) |
984 | | - .attr({ |
985 | | - name: providerName |
986 | | - }); |
987 | | - if ( this.current_provider == providerName) { |
988 | | - $anchor.addClass( 'ui-selected' ); |
989 | | - } |
990 | | - |
991 | | - $anchor.click( function() { |
992 | | - $j( this ).parent().parent().find( '.ui-selected' ) |
993 | | - .removeClass( 'ui-selected' ); |
994 | | - $j( this ).addClass( 'ui-selected' ); |
995 | | - _this.current_provider = $j( this ).attr( "name" ); |
996 | | - // Update the search results on provider selection |
997 | | - _this.updateResults( _this.current_provider, true ); |
998 | | - return false; |
999 | | - }); |
1000 | | - |
1001 | | - var $listItem = $j( '<li />' ); |
1002 | | - $listItem.append( $anchor ); |
1003 | | - $providerSelection.append( $listItem ); |
1004 | | - } |
1005 | | - } |
1006 | | - |
1007 | | - $searchForm.append( $providerSelection ); |
| 1047 | + |
1008 | 1048 | $searchForm.append( $searchBox ); |
1009 | 1049 | $searchForm.append( $searchButton ); |
| 1050 | + |
1010 | 1051 | // Add optional upload buttons. |
1011 | 1052 | if ( this.content_providers['upload'].enabled) { |
1012 | | - $uploadButton = $j.button( { icon_id: 'disk', text: gM( 'mwe-upload_tab' ) }) |
| 1053 | + $uploadButton = $j.button( { icon: 'disk', text: gM( 'mwe-upload_tab' ) }) |
1013 | 1054 | .addClass("rsd_upload_button") |
1014 | 1055 | .click(function() { |
1015 | 1056 | // Update the previus_provider to swap back |
— | — | @@ -1022,7 +1063,7 @@ |
1023 | 1064 | $searchForm.append( $uploadButton ); |
1024 | 1065 | /* |
1025 | 1066 | // Import functionality not yet supported |
1026 | | - $importButton = $j.button({icon_id: 'import', text: 'import'}) |
| 1067 | + $importButton = $j.button({icon: 'import', text: 'import'}) |
1027 | 1068 | .addClass("rsd_import_button"); |
1028 | 1069 | .append( $importButton ); |
1029 | 1070 | */ |
— | — | @@ -1323,11 +1364,11 @@ |
1324 | 1365 | |
1325 | 1366 | // Check if we need to update: |
1326 | 1367 | if ( typeof provider.sObj != 'undefined' ) { |
1327 | | - if ( provider.sObj.last_query == $j( '#rsd_q' ).val() |
| 1368 | + if ( provider.sObj.last_query == $j( this.target_search_input ).val() |
1328 | 1369 | && provider.sObj.last_offset == provider.offset ) { |
1329 | 1370 | |
1330 | 1371 | mw.log( 'last query is: ' + provider.sObj.last_query + |
1331 | | - ' matches: ' + $j( '#rsd_q' ).val() + ' no search needed'); |
| 1372 | + ' matches: ' + $j( this.target_search_input ).val() + ' no search needed'); |
1332 | 1373 | |
1333 | 1374 | // Show search results directly |
1334 | 1375 | this.showResults( ); |
— | — | @@ -1344,7 +1385,7 @@ |
1345 | 1386 | } |
1346 | 1387 | } |
1347 | 1388 | |
1348 | | - if ( $j ( '#rsd_q' ).val().length == 0 ) { |
| 1389 | + if ( $j ( this.target_search_input ).val().length == 0 ) { |
1349 | 1390 | this.$resultsContainer.empty(); |
1350 | 1391 | this.$resultsContainer.text( 'Please insert a search string above.' ); |
1351 | 1392 | return; |
— | — | @@ -1525,7 +1566,7 @@ |
1526 | 1567 | var context = _this.storeContext( d.getTime() ); |
1527 | 1568 | _this.currentRequest = context(); |
1528 | 1569 | mw.log( "ProviderCallBack Generated " + context() ) |
1529 | | - provider.sObj.getSearchResults( $j( '#rsd_q' ).val() , |
| 1570 | + provider.sObj.getSearchResults( $j( _this.target_search_input ).val() , |
1530 | 1571 | function( resultStatus ) { |
1531 | 1572 | mw.log( "ProviderCallBack Received " + context() ); |
1532 | 1573 | if( _this.currentRequest != context() ) { |
— | — | @@ -1597,6 +1638,33 @@ |
1598 | 1639 | }, |
1599 | 1640 | |
1600 | 1641 | /** |
| 1642 | + * Get a resource from a url loads the provider if not already initialized |
| 1643 | + */ |
| 1644 | + getResourceFromUrl: function ( provider, url, callback){ |
| 1645 | + if (!provider.sObj) { |
| 1646 | + this.loadSearchLib( provider, function( provider ){ |
| 1647 | + provider.sObj.getResourceFromUrl( url, callback); |
| 1648 | + }); |
| 1649 | + } |
| 1650 | + else { |
| 1651 | + provider.sObj.getResourceFromUrl( url, callback); |
| 1652 | + } |
| 1653 | + }, |
| 1654 | + |
| 1655 | + /** |
| 1656 | + * Get a resource from a titleKey loads the provider if not already initialized |
| 1657 | + */ |
| 1658 | + getResourceFromTitleKey: function ( provider, title, callback){ |
| 1659 | + if (!provider.sObj) { |
| 1660 | + this.loadSearchLib( provider, function( provider ){ |
| 1661 | + provider.sObj.getByTitle( title, callback); |
| 1662 | + }); |
| 1663 | + } |
| 1664 | + else { |
| 1665 | + provider.sObj.getByTitle( title, callback); |
| 1666 | + } |
| 1667 | + }, |
| 1668 | + /** |
1601 | 1669 | * Get a resource object from a resource id |
1602 | 1670 | * |
1603 | 1671 | * NOTE: We could bind resource objects to html elements to avoid this lookup |
— | — | @@ -1706,7 +1774,7 @@ |
1707 | 1775 | $resultsContainer.append( _this.createResultsFooter() ); |
1708 | 1776 | } |
1709 | 1777 | |
1710 | | - mw.log( 'did numResults :: ' + numResults + ' append: ' + $j( '#rsd_q' ).val() ); |
| 1778 | + mw.log( 'did numResults :: ' + numResults + ' append: ' + $j( this.target_search_input ).val() ); |
1711 | 1779 | |
1712 | 1780 | // Add "no search results" text |
1713 | 1781 | $j( '#rsd_no_search_res' ).remove(); |
— | — | @@ -1718,11 +1786,15 @@ |
1719 | 1787 | ); |
1720 | 1788 | } else { |
1721 | 1789 | $resultsContainer.append( |
1722 | | - gM( 'rsd_no_results', $j( '#rsd_q' ).val() ) |
| 1790 | + gM( 'rsd_no_results', $j( this.target_search_input ).val() ) |
1723 | 1791 | ) ; |
1724 | 1792 | } |
1725 | 1793 | } |
1726 | 1794 | this.addResultBindings(); |
| 1795 | + |
| 1796 | + if( typeof this.displaySearchResultsCallback == 'function'){ |
| 1797 | + this.displaySearchResultsCallback(); |
| 1798 | + } |
1727 | 1799 | }, |
1728 | 1800 | |
1729 | 1801 | /** |
— | — | @@ -1890,7 +1962,15 @@ |
1891 | 1963 | // Resource click action: (bring up the resource editor) |
1892 | 1964 | $j( '.rsd_res_item' ).unbind().click( function() { |
1893 | 1965 | var resource = _this.getResourceFromId( $j( this ).attr( "id" ) ); |
1894 | | - _this.showResourceEditor( resource ); |
| 1966 | + |
| 1967 | + // xxx These hooks should really be managed via bindings not options like this: |
| 1968 | + var showResourceEditor = true; |
| 1969 | + if( typeof _this.resourceSelectionCallback == 'function' ){ |
| 1970 | + showResourceEditor = _this.resourceSelectionCallback( resource ); |
| 1971 | + } |
| 1972 | + if( showResourceEditor ){ |
| 1973 | + _this.showResourceEditor( resource ); |
| 1974 | + } |
1895 | 1975 | return false; |
1896 | 1976 | } ) |
1897 | 1977 | // Add a "bind" class |
— | — | @@ -1949,7 +2029,7 @@ |
1950 | 2030 | 'position' : 'absolute', |
1951 | 2031 | 'top' : '0px', |
1952 | 2032 | 'left' : '0px', |
1953 | | - 'bottom' : '0px', |
| 2033 | + 'bottom' : '30px', |
1954 | 2034 | 'right' : '4px', |
1955 | 2035 | 'background-color' : '#FFF' |
1956 | 2036 | } ) |
— | — | @@ -2646,7 +2726,7 @@ |
2647 | 2727 | getTemplateDescription: function( resource ) { |
2648 | 2728 | // setup the resource description from resource description: |
2649 | 2729 | // FIXME: i18n, namespace |
2650 | | - var description = '{{Information ' + "\n"; |
| 2730 | + var description ='{{Information ' + "\n"; |
2651 | 2731 | |
2652 | 2732 | if ( resource.desc ) { |
2653 | 2733 | description += '|Description= ' + resource.desc + "\n"; |
— | — | @@ -3198,7 +3278,7 @@ |
3199 | 3279 | }, |
3200 | 3280 | |
3201 | 3281 | /* |
3202 | | - * Sets the dispaly mode |
| 3282 | + * Sets the display mode |
3203 | 3283 | * @param {String} mode Either "box" or "list" |
3204 | 3284 | */ |
3205 | 3285 | setDisplayMode: function( mode ) { |
Index: trunk/extensions/AddMediaWizard/AddMedia/jquery.dragDropFile.js |
— | — | @@ -117,11 +117,6 @@ |
118 | 118 | ) |
119 | 119 | ) |
120 | 120 | ) |
121 | | - /*mw.addDialog( "upload this image", '<img width="300" src="' + files[i].getAsDataURL() + '">' + |
122 | | - '<br>name: ' + files[i].name + '</br>' + |
123 | | - '<br>size: ' + files[i].fileSize + '</br>' + |
124 | | - '<br>mime: ' + files[i].mediaType + '</br>'); |
125 | | - */ |
126 | 121 | // do the add-media-wizard with the upload tab |
127 | 122 | } else { |
128 | 123 | alert( "file is too big, needs to be below 64mb" ); |
Index: trunk/extensions/AddMediaWizard/AddMedia/AddMedia.i18n.php |
— | — | @@ -41,11 +41,11 @@ |
42 | 42 | 'fogg-cg-advVideo' => 'Advanced video encoding controls', |
43 | 43 | 'fogg-cg-advAudio' => 'Advanced audio encoding controls', |
44 | 44 | 'fogg-preset-custom' => 'Custom settings', |
45 | | - 'fogg-webvideo-desc' => 'Ogg web video Theora, Vorbis (600 kbit\/s and 400px maximum width)', |
46 | | - 'fogg-savebandwidth-desc' => 'Ogg low bandwidth Theora, Vorbis (164 kbit\/s and 200px maximum width)', |
47 | | - 'fogg-highquality-desc' => 'Ogg high quality Theora, Vorbis (1080px maximum width)', |
48 | | - 'fogg-webvideo-webm-desc' => 'WebM web video VP8 (600 kbit\/s and 480px maximum width)', |
49 | | - 'fogg-highquality-webm-desc' => 'WebM high quality VP8 (1080px maximum width)', |
| 45 | + 'fogg-webvideo-desc' => 'Ogg Web video Theora, Vorbis (600 kbit\/s and 400px maximum width)', |
| 46 | + 'fogg-savebandwidth-desc' => 'Ogg Low bandwidth Theora, Vorbis (164 kbit\/s and 200px maximum width)', |
| 47 | + 'fogg-highquality-desc' => 'Ogg High quality Theora, Vorbis (1080px maximum width)', |
| 48 | + 'fogg-webvideo-webm-desc' => 'Webm Web video VP8 (600 kbit\/s and 480px maximum width)', |
| 49 | + 'fogg-highquality-webm-desc' => 'Webm High quality VP8 (1080px maximum width)', |
50 | 50 | 'fogg-videoQuality-title' => 'Video quality', |
51 | 51 | 'fogg-videoQuality-help' => 'Used to set the <i>visual quality</i> of the encoded video (not used if you set bitrate in advanced controls below).', |
52 | 52 | 'fogg-starttime-title' => 'Start second', |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | 'fogg-audioQuality-title' => 'Audio quality', |
57 | 57 | 'fogg-audioQuality-help' => 'Used to set the <i>acoustic quality</i> of the encoded audio (not used if you set bitrate in advanced controls below).', |
58 | 58 | 'fogg-videoCodec-title' => 'Video codec', |
59 | | - 'fogg-videoCodec-help' => 'Select the clip video codec. More about the <a target=\"_new\" href=\"http:\/\/en.wikipedia.org\/wiki\/Theora\">Theora codec<\/a>. More about the <a target=\"_new\" href=\"http:\/\/en.wikipedia.org\/wiki\/WebM\">VP8 codec<\/a>', |
| 59 | + 'fogg-videoCodec-help' => 'Select the clip video codec. More about the <a target=\"_new\" href=\"http:\/\/en.wikipedia.org\/wiki\/Theora\">Theora codec<\/a>. More about the <a target=\"_new\" href=\"http:\/\/en.wikipedia.org\/wiki\/Webm\">VP8 codec<\/a>', |
60 | 60 | 'fogg-audioCodec-title' => 'Audio codec', |
61 | 61 | 'fogg-audioCodec-help' => 'Used to set the clip audio codec. Presently only Vorbis is supported. More about the <a target="_new" href="http://en.wikipedia.org/wiki/Vorbis">Vorbis codec</a>', |
62 | 62 | 'fogg-width-title' => 'Video width', |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | 'fogg-license-help' => 'The license of the clip (preferably a Creative Commons URL).', |
99 | 99 | 'fogg-contact-title' => 'Contact', |
100 | 100 | 'fogg-contact-help' => 'Contact link', |
101 | | - 'fogg-missing-webm-support' => 'Please use a [$1 WebM compatible] browser to preview results of WebM videos', |
| 101 | + 'fogg-missing-webm-support' => 'Please use a [$1 webm compatible] browsers to preview results of webm videos', |
102 | 102 | 'fogg-gui-title' => 'Make web video', |
103 | 103 | 'mwe-imported_from' => '$1 imported from [$2 $3]. See the original [$4 resource page] for more information.', |
104 | 104 | 'mwe-import-description' => '$1, imported from $2', |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | 'mwe-ftype-unk' => 'Unknown file format', |
184 | 184 | 'rsd-wiki_commons-title' => 'Wikimedia Commons', |
185 | 185 | 'rsd-wiki_commons' => 'Wikimedia Commons, an archive of freely-licensed educational media content (images, sound and video clips)', |
186 | | - 'rsd-kaltura-title' => 'All sources', |
| 186 | + 'rsd-kaltura-title' => 'Kaltura search( all sources )', |
187 | 187 | 'rsd-kaltura' => 'Kaltura aggregated search for free-licensed media across multiple search providers', |
188 | 188 | 'rsd-this_wiki-title' => 'This wiki', |
189 | 189 | 'rsd-this_wiki-desc' => 'The local wiki', |
— | — | @@ -8252,4 +8252,3 @@ |
8253 | 8253 | 'fogg-savebandwidth-desc' => '低帶寬Theora或Vorbis編碼164 kbit/s,最寬200相素', |
8254 | 8254 | 'fogg-highquality-desc' => '高質量Theora或Vorbis編輯,最寬1080相素', |
8255 | 8255 | ); |
8256 | | - |
Index: trunk/extensions/AddMediaWizard/ClipEdit/mw.ClipEdit.js |
— | — | @@ -171,10 +171,10 @@ |
172 | 172 | * Edit the "duration" of a given resource |
173 | 173 | * |
174 | 174 | * supports resource types: |
175 | | - * ['image', 'template'] |
| 175 | + * ['image', 'mwtemplate'] |
176 | 176 | */ |
177 | 177 | 'duration': { |
178 | | - 'media' : ['image', 'template'], |
| 178 | + 'media' : ['image', 'mwtemplate'], |
179 | 179 | 'doEdit':function( _this, target ) { |
180 | 180 | function doUpdateDur( inputElm ) { |
181 | 181 | mw.log( "update duration:" + $j( inputElm ).val() ); |