Index: branches/js2-work/phase3/js/mwEmbed/languages/mwEmbed.i18n.php |
— | — | @@ -300,6 +300,14 @@ |
301 | 301 | 'rsd-search-timeout' => 'The search request did not complete. The server may be down experiencing heavy load. You can try again later', |
302 | 302 | |
303 | 303 | /* |
| 304 | + * js file: /modules/AddMedia/mw.UploadInterface.js |
| 305 | + */ |
| 306 | + 'mwe-upload-in-progress' => 'Upload in progress (do not close this window)', |
| 307 | + 'mwe-uploaded-status' => 'Uploaded', |
| 308 | + 'mwe-uploaded-time-remaining' => 'Time remaining: $1', |
| 309 | + 'mwe-upload-done' => 'Your upload <i>should be</i> accessible.', |
| 310 | + |
| 311 | + /* |
304 | 312 | * js file: /modules/AddMedia/mw.UploadHandler.js |
305 | 313 | */ |
306 | 314 | 'mwe-upload-stats-fileprogress' => '$1 of $2', |
— | — | @@ -383,6 +391,7 @@ |
384 | 392 | 'mwe-upload' => 'Upload file', |
385 | 393 | 'mwe-destfilename' => 'Destination filename:', |
386 | 394 | 'mwe-summary' => 'Summary', |
| 395 | + 'mwe-date-of-work' => 'Date of the work', |
387 | 396 | 'mwe-error_not_loggedin' => 'You do not appear to be logged in or do not have upload privileges.', |
388 | 397 | 'mwe-error-not-loggedin-file' => 'You do not appear to be logged in or there was an error in the software. You can $1 and try again', |
389 | 398 | 'mwe-link-login' => 'login', |
— | — | @@ -394,6 +403,7 @@ |
395 | 404 | 'mwe-upload-once-done' => 'Please $1. Once you have completed your upload, $2', |
396 | 405 | 'mwe-upload-in-new-win-link' => 'upload in the new window or tab', |
397 | 406 | 'mwe-upload-refresh' => 'refresh your upload list', |
| 407 | + 'mwe-ie-inline-upload' => 'Inline uploading is currently disabled for Internet Exploer. You can $1 then $2', |
398 | 408 | |
399 | 409 | /* |
400 | 410 | * js file: /modules/AddMedia/mw.FirefoggGUI.js |
Index: branches/js2-work/phase3/js/mwEmbed/skins/common/images/cookies_blocked_MSIE_eye.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: branches/js2-work/phase3/js/mwEmbed/skins/common/images/cookies_blocked_MSIE_eye.png |
___________________________________________________________________ |
Name: svn:mime-type |
401 | 411 | + application/octet-stream |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.UploadInterface.js |
— | — | @@ -48,6 +48,10 @@ |
49 | 49 | setup: function( options ) { |
50 | 50 | var _this = this; |
51 | 51 | |
| 52 | + if( ! options ){ |
| 53 | + options = { }; |
| 54 | + } |
| 55 | + |
52 | 56 | // Start the "upload" time |
53 | 57 | this.uploadBeginTime = ( new Date() ).getTime(); |
54 | 58 | |
— | — | @@ -62,7 +66,7 @@ |
63 | 67 | .attr( 'id', "upProgressDialog" ) |
64 | 68 | ); |
65 | 69 | |
66 | | - if( typeof options == 'undefined' || !options.title ) { |
| 70 | + if( !options.title ) { |
67 | 71 | options.title = gM('mwe-upload-in-progress'); |
68 | 72 | } |
69 | 73 | |
— | — | @@ -255,7 +259,7 @@ |
256 | 260 | }; |
257 | 261 | |
258 | 262 | |
259 | | - if ( apiRes.error || ( apiRes.upload && apiRes.upload.result == "Failure" ) ) { |
| 263 | + if ( apiRes && apiRes.error || ( apiRes.upload && apiRes.upload.result == "Failure" ) ) { |
260 | 264 | |
261 | 265 | // Check a few places for the error code |
262 | 266 | var error_code = 0; |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.UploadForm.js |
— | — | @@ -26,7 +26,9 @@ |
27 | 27 | "mwe-upload-not-my-file" : "Upload media that is not my own work to $1", |
28 | 28 | "mwe-upload-once-done" : "Please $1. Once you have completed your upload, $2", |
29 | 29 | "mwe-upload-in-new-win-link" : "upload in the new window or tab", |
30 | | - "mwe-upload-refresh" : "refresh your upload list" |
| 30 | + "mwe-upload-refresh" : "refresh your upload list", |
| 31 | + |
| 32 | + "mwe-ie-inline-upload" : "Inline uploading is currently disabled for Internet Exploer. You can $1 then $2" |
31 | 33 | } ); |
32 | 34 | |
33 | 35 | var default_form_options = { |
— | — | @@ -185,6 +187,7 @@ |
186 | 188 | } ); |
187 | 189 | }); |
188 | 190 | } |
| 191 | + |
189 | 192 | /** |
190 | 193 | * Build the Asset Description info template |
191 | 194 | * and update the wpUploadDescription value |
— | — | @@ -258,8 +261,7 @@ |
259 | 262 | .text( gM('mwe-link-login') ) |
260 | 263 | .attr('attr', options.apiUrl.replace( 'api.php', 'index.php' ) + '?title=Special:UserLogin' ) |
261 | 264 | ) |
262 | | - ); |
263 | | - |
| 265 | + ); |
264 | 266 | } |
265 | 267 | } ); |
266 | 268 | |
— | — | @@ -330,6 +332,12 @@ |
331 | 333 | gM( 'mwe-upload-own-file', uploadProvider.title ) |
332 | 334 | ) |
333 | 335 | .click( function( ) { |
| 336 | + // Check for IE ( requires p3p policy and requires more porting work. ) |
| 337 | + if( $j.browser.msie ) { |
| 338 | + showUploadInTab( uploadProvider, uploadMenuTarget, "mwe-ie-inline-upload" ); |
| 339 | + return false; |
| 340 | + } |
| 341 | + |
334 | 342 | $j( uploadMenuTarget ).empty().loadingSpinner(); |
335 | 343 | |
336 | 344 | // if selectUploadProviderCb is set run the callback |
— | — | @@ -378,35 +386,7 @@ |
379 | 387 | .text( |
380 | 388 | gM( 'mwe-upload-not-my-file', uploadProvider.title ) |
381 | 389 | ).click( function ( ) { |
382 | | - //Show refresh link |
383 | | - $j( uploadMenuTarget ).empty().html( |
384 | | - gM( "mwe-upload-once-done", |
385 | | - $j('<a />') |
386 | | - .attr( { |
387 | | - 'href' : uploadProvider.uploadPage, |
388 | | - 'target' : "_new" |
389 | | - } ) |
390 | | - .text( |
391 | | - gM("mwe-upload-in-new-win-link") |
392 | | - ), |
393 | | - |
394 | | - $j('<a />') |
395 | | - .attr( { |
396 | | - 'href' : '#' |
397 | | - } ) |
398 | | - .addClass('user-upload-refresh') |
399 | | - .text( |
400 | | - gM('mwe-upload-refresh') |
401 | | - ) |
402 | | - ) |
403 | | - ); |
404 | | - // NOTE: if gM supported jquery object a bit better |
405 | | - // we could bind the link above in the gM call |
406 | | - $j( uploadMenuTarget ).find( '.user-upload-refresh' ) |
407 | | - .click( function( ) { |
408 | | - remoteSearchDriver.showUserRecentUploads( uploadTargetId ); |
409 | | - return false; |
410 | | - } ); |
| 390 | + showUploadInTab( uploadProvider, uploadMenuTarget, "mwe-upload-once-done" ); |
411 | 391 | } ) |
412 | 392 | ) |
413 | 393 | ); |
— | — | @@ -414,6 +394,40 @@ |
415 | 395 | }; |
416 | 396 | |
417 | 397 | /** |
| 398 | + * Handles the very similar layout of IE and non-inline upload |
| 399 | + */ |
| 400 | + function showUploadInTab(uploadProvider, uploadMenuTarget, msgKey ){ |
| 401 | + //Show refresh link |
| 402 | + $j( uploadMenuTarget ).empty().html( |
| 403 | + gM( msgKey, |
| 404 | + $j('<a />') |
| 405 | + .attr( { |
| 406 | + 'href' : uploadProvider.uploadPage, |
| 407 | + 'target' : "_new" |
| 408 | + } ) |
| 409 | + .text( |
| 410 | + gM("mwe-upload-in-new-win-link") |
| 411 | + ), |
| 412 | + |
| 413 | + $j('<a />') |
| 414 | + .attr( { |
| 415 | + 'href' : '#' |
| 416 | + } ) |
| 417 | + .addClass('user-upload-refresh') |
| 418 | + .text( |
| 419 | + gM('mwe-upload-refresh') |
| 420 | + ) |
| 421 | + ) |
| 422 | + ); |
| 423 | + // NOTE: if gM supported jquery object a bit better |
| 424 | + // we could bind the link above in the gM call |
| 425 | + $j( uploadMenuTarget ).find( '.user-upload-refresh' ) |
| 426 | + .click( function( ) { |
| 427 | + remoteSearchDriver.showUserRecentUploads( uploadTargetId ); |
| 428 | + return false; |
| 429 | + } ); |
| 430 | + } |
| 431 | + /** |
418 | 432 | * Get a jquery built upload form |
419 | 433 | */ |
420 | 434 | function addUploadForm( options ){ |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.RemoteSearchDriver.js |
— | — | @@ -40,6 +40,8 @@ |
41 | 41 | "mwe-no_recent_uploads" : "No recent uploads", |
42 | 42 | |
43 | 43 | "mwe-not-logged-in-uploads" : "You may not be logged in so no recent uploads can be displayed. $1 login and $2", |
| 44 | + "mwe-ie-eye-permision" : "If using Internet Exploer and logged in, you may need to adjust your privacy settings", |
| 45 | + |
44 | 46 | "mwe-loggin-link" : "Please login", |
45 | 47 | "mwe-try-again-link" : "try again", |
46 | 48 | |
— | — | @@ -1168,6 +1170,25 @@ |
1169 | 1171 | .append( gM( 'mwe-try-again-link' ) ) |
1170 | 1172 | ) |
1171 | 1173 | ); |
| 1174 | + |
| 1175 | + // If using internet exploer it could be IE privacy settings ( aka "evil eye" ) |
| 1176 | + // http://stackoverflow.com/questions/389456/cookie-blocked-not-saved-in-iframe-in-internet-explorer |
| 1177 | + if( $j.browser.msie ){ |
| 1178 | + $j( '#user-results-' + uploadTargetId ).append( |
| 1179 | + $j('<br />'), |
| 1180 | + $j('<br />'), |
| 1181 | + |
| 1182 | + $j('<span />') |
| 1183 | + .text( gM('mwe-ie-eye-permision' ) ), |
| 1184 | + |
| 1185 | + $j('<img />' ) |
| 1186 | + .attr( { |
| 1187 | + 'src': mw.getConfig('images_path' ) + 'cookies_blocked_MSIE_eye.png', |
| 1188 | + 'alt' : gM('mwe-ie-eye-permision' ) |
| 1189 | + }) |
| 1190 | + ); |
| 1191 | + } |
| 1192 | + |
1172 | 1193 | // Note if we updated gM to return jQuery ojbects then we could |
1173 | 1194 | // bind above |
1174 | 1195 | $j( '#user-results-' + uploadTargetId ) |
— | — | @@ -1869,15 +1890,14 @@ |
1870 | 1891 | * Add Resource edit layout and display a loader. |
1871 | 1892 | */ |
1872 | 1893 | addResourceEditLoader: function( ) { |
| 1894 | + mw.log() |
1873 | 1895 | var _this = this; |
1874 | 1896 | editWidth = 400; |
1875 | 1897 | // Remove any old instance: |
1876 | 1898 | $j( _this.target_container ).find( '#rsd_resource_edit' ).remove(); |
1877 | | - |
| 1899 | + |
1878 | 1900 | // Hide the results container |
1879 | | - this.$resultsContainer.hide(); |
1880 | | - |
1881 | | - var pt = $j( _this.target_container ).html(); |
| 1901 | + this.$resultsContainer.hide(); |
1882 | 1902 | |
1883 | 1903 | // Set up the interface compoents: |
1884 | 1904 | var $clipEditControl = $j('<div />') |
— | — | @@ -1893,21 +1913,22 @@ |
1894 | 1914 | 'padding' : '5px' |
1895 | 1915 | } ) |
1896 | 1916 | .loadingSpinner(); |
| 1917 | + |
| 1918 | + mw.log(" clip edit control "); |
1897 | 1919 | |
1898 | 1920 | var $clipEditDisplay = $j('<div />') |
1899 | 1921 | .attr( 'id', 'clip_edit_disp' ) |
1900 | 1922 | .addClass( 'ui-widget ui-widget-content ui-corner-all' ) |
1901 | 1923 | .css({ |
1902 | 1924 | 'position' : 'absolute', |
1903 | | - 'overflow' : 'auto;', |
| 1925 | + 'overflow' : 'auto', |
1904 | 1926 | 'left' : ( editWidth + 25 ) + 'px', |
1905 | 1927 | 'right' :'0px', |
1906 | 1928 | 'top' : '5px', |
1907 | 1929 | 'bottom' : '10px', |
1908 | 1930 | 'padding' : '5px' |
1909 | 1931 | }) |
1910 | | - .loadingSpinner(); |
1911 | | - |
| 1932 | + .loadingSpinner(); |
1912 | 1933 | |
1913 | 1934 | // Add the edit layout window with loading place holders |
1914 | 1935 | $j( _this.target_container ).append( |
— | — | @@ -1920,7 +1941,8 @@ |
1921 | 1942 | 'bottom' : '0px', |
1922 | 1943 | 'right' : '4px', |
1923 | 1944 | 'background-color' : '#FFF' |
1924 | | - } ).append( |
| 1945 | + } ) |
| 1946 | + .append( |
1925 | 1947 | $clipEditControl, |
1926 | 1948 | $clipEditDisplay |
1927 | 1949 | ) |
— | — | @@ -1977,9 +1999,11 @@ |
1978 | 2000 | |
1979 | 2001 | // Remove any existing resource edit interface |
1980 | 2002 | _this.removeResourceEditor(); |
1981 | | - |
| 2003 | + mw.log(" removed old resource "); |
| 2004 | + |
1982 | 2005 | // Append to the top level of model window: |
1983 | 2006 | _this.addResourceEditLoader(); |
| 2007 | + mw.log("done adding resource editor"); |
1984 | 2008 | |
1985 | 2009 | var mediaType = _this.getMediaType( resource ); |
1986 | 2010 | var width = _this.getMaxEditWidth( resource ); |
— | — | @@ -2197,10 +2221,10 @@ |
2198 | 2222 | mw.log( 'append html: ' + embedHtml ); |
2199 | 2223 | $j( '#clip_edit_disp' ).html( embedHtml ); |
2200 | 2224 | |
2201 | | - mw.log( "about to call $j.embedPlayer::embed_vid" ); |
| 2225 | + mw.log( "about to call $j.embedPlayer::embed_vid" ); |
| 2226 | + |
2202 | 2227 | // Rewrite by id |
2203 | | - $j( '#embed_vid').embedPlayer ( function() { |
2204 | | - |
| 2228 | + $j( '#embed_vid').embedPlayer ( function() { |
2205 | 2229 | // Add extra space at the top if the embed player is less than 90px high |
2206 | 2230 | // bug 22189 |
2207 | 2231 | if( $j('#embed_vid').get(0).getPlayerHeight() < 90 ) { |
— | — | @@ -2219,9 +2243,8 @@ |
2220 | 2244 | // Add libraries resizable and hoverIntent to support video edit tools |
2221 | 2245 | var librarySet = [ |
2222 | 2246 | 'mw.ClipEdit', |
2223 | | - '$j.ui.resizable', |
2224 | | - '$j.fn.hoverIntent' |
2225 | | - ] |
| 2247 | + '$j.ui.resizable' |
| 2248 | + ]; |
2226 | 2249 | mw.load( librarySet, function() { |
2227 | 2250 | // Make sure the rsd_edit_img is removed: |
2228 | 2251 | $j( '#rsd_edit_img' ).remove(); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/kplayerEmbed.js |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | this.getPlayerElement(); |
83 | 83 | |
84 | 84 | //alert( this.playerElement ); |
85 | | - if( this.playerElement ) { |
| 85 | + if( this.playerElement && this.playerElement.addJsListener ) { |
86 | 86 | // Add KDP listeners |
87 | 87 | _this.bindPlayerFunction( 'doPause', 'onPause' ); |
88 | 88 | _this.bindPlayerFunction( 'doPlay', 'play' ); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.ApiProxy.js |
— | — | @@ -25,7 +25,8 @@ |
26 | 26 | "mwe-proxy-not-ready" : "Proxy is not configured", |
27 | 27 | "mwe-please-login" : "The request failed. Are you logged in on $1 ? Please $2 and try again", |
28 | 28 | "mwe-log-in-link" : "log in", |
29 | | - "mwe-remember-loging" : "General security reminder: Only login to web sites when your address bar displays that site's address." |
| 29 | + "mwe-remember-loging" : "General security reminder: Only login to web sites when your address bar displays that site's address." |
| 30 | + |
30 | 31 | } ); |
31 | 32 | |
32 | 33 | |
— | — | @@ -415,8 +416,8 @@ |
416 | 417 | * @param {URL} apiUrl The url of the api server |
417 | 418 | */ |
418 | 419 | // Include gadget js ( in case the user has not enabled the gadget on that domain ) |
419 | | - //var gadgetWithJS = '?withJS=MediaWiki:Gadget-mwEmbed.js'; |
420 | | - var gadgetWithJS = ''; |
| 420 | + var gadgetWithJS = '?withJS=MediaWiki:Gadget-mwEmbed.js'; |
| 421 | + //var gadgetWithJS = ''; |
421 | 422 | function getServerFrame( context ) { |
422 | 423 | if( ! context || ! context.apiUrl ){ |
423 | 424 | mw.log( "Error no context api url " ); |
— | — | @@ -932,9 +933,9 @@ |
933 | 934 | s += 'id="' + mw.escapeQuotes( options[ 'name' ] ) + '" '; |
934 | 935 | |
935 | 936 | // Check for style: |
936 | | - if( ! options['style'] ){ |
| 937 | + if( ! options['style'] ) { |
937 | 938 | options['style'] = 'display:none'; |
938 | | - } |
| 939 | + } |
939 | 940 | |
940 | 941 | // Add style attribute: |
941 | 942 | s += 'style="' + mw.escapeQuotes( options[ 'style' ] ) + '" '; |
— | — | @@ -963,6 +964,7 @@ |
964 | 965 | var targetName = ( typeof options[ 'target' ] == 'string') ? options[ 'target' ] : $j( options[ 'target' ]).length ; |
965 | 966 | |
966 | 967 | mw.log( "Append iframe:" + options[ 'src' ] + ' to: ' + targetName + " \n WITH REQUEST: " + JSON.stringify( options.request ) ); |
| 968 | + |
967 | 969 | // Append to target |
968 | 970 | $j( options[ 'target' ] ).append( s ); |
969 | 971 | |
Index: branches/js2-work/phase3/js/mwEmbed/modules/ClipEdit/mw.ClipEdit.js |
— | — | @@ -795,7 +795,7 @@ |
796 | 796 | |
797 | 797 | $j( '<a />') |
798 | 798 | .attr({ |
799 | | - 'href': '#', |
| 799 | + 'href': '#' |
800 | 800 | }) |
801 | 801 | .addClass( 'mw_crop_msg' ) |
802 | 802 | .text( gM( 'mwe-crop' ) ), |
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | var urlparts = getRemoteEmbedPath(); |
7 | 7 | var mwEmbedHostPath = urlparts[0]; |
8 | 8 | var mwRemoteVersion = 'r104'; |
9 | | -var mwUseScriptLoader = false; |
| 9 | +var mwUseScriptLoader = true; |
10 | 10 | |
11 | 11 | // Log the mwRemote version ( will determine what version of js we get ) |
12 | 12 | if( window.console ){ |
— | — | @@ -116,8 +116,7 @@ |
117 | 117 | |
118 | 118 | // Special api proxy page |
119 | 119 | if ( wgPageName == 'MediaWiki:ApiProxy' ) { |
120 | | - var wgEnableIframeApiProxy = true; |
121 | | - alert( " MediaWiki:ApiProxy rewrite " ); |
| 120 | + var wgEnableIframeApiProxy = true; |
122 | 121 | loadMwEmbed( [ 'mw.ApiProxy' ], function() { |
123 | 122 | mw.load( mwEmbedHostPath + '/apiProxyPage.js?' + mwGetReqArgs() ); |
124 | 123 | } ); |