Index: trunk/extensions/WikiLove/WikiLove.php |
— | — | @@ -112,7 +112,8 @@ |
113 | 113 | 'wikilove-err-msg', |
114 | 114 | 'wikilove-err-image', |
115 | 115 | 'wikilove-err-sig', |
116 | | - 'wikilove-barnstar-header', |
| 116 | + 'wikilove-err-gallery', |
| 117 | + 'wikilove-err-gallery-again', |
117 | 118 | ), |
118 | 119 | 'dependencies' => array( |
119 | 120 | 'jquery.ui.dialog', |
Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.css |
— | — | @@ -224,6 +224,14 @@ |
225 | 225 | position: relative; |
226 | 226 | } |
227 | 227 | |
| 228 | +/*#mw-wikilove-dialog #mw-wikilove-gallery*/ #mw-wikilove-gallery-error { |
| 229 | + margin-left: 15px; |
| 230 | +} |
| 231 | + |
| 232 | +/*#mw-wikilove-dialog #mw-wikilove-gallery #mw-wikilove-gallery-error*/ #mw-wikilove-gallery-error-again { |
| 233 | + color: #0645AD; |
| 234 | +} |
| 235 | + |
228 | 236 | /*#mw-wikilove-dialog*/ #mw-wikilove-gallery img { |
229 | 237 | margin-right: 5px; |
230 | 238 | margin-bottom: 5px; |
Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js |
— | — | @@ -68,6 +68,10 @@ |
69 | 69 | <div id="mw-wikilove-subtype-description"></div>\ |
70 | 70 | <label id="mw-wikilove-gallery-label"><html:msg key="wikilove-image"/></label>\ |
71 | 71 | <div id="mw-wikilove-gallery">\ |
| 72 | + <div id="mw-wikilove-gallery-error">\ |
| 73 | + <html:msg key="wikilove-err-gallery"/>\ |
| 74 | + <a href="#" id="mw-wikilove-gallery-error-again"><html:msg key="wikilove-err-gallery-again"/></a>\ |
| 75 | + </div>\ |
72 | 76 | <div id="mw-wikilove-gallery-spinner" class="mw-wikilove-spinner"></div>\ |
73 | 77 | <div id="mw-wikilove-gallery-content"></div>\ |
74 | 78 | </div>\ |
— | — | @@ -114,7 +118,7 @@ |
115 | 119 | $( '#mw-wikilove-add-details' ).hide(); |
116 | 120 | $( '#mw-wikilove-preview' ).hide(); |
117 | 121 | $( '#mw-wikilove-types' ).replaceWith( $typeList ); |
118 | | - |
| 122 | + $( '#mw-wikilove-gallery-error-again' ).click( $.wikiLove.showGallery ); |
119 | 123 | $( '#mw-wikilove-types a' ).click( $.wikiLove.clickType ); |
120 | 124 | $( '#mw-wikilove-subtype' ).change( $.wikiLove.changeSubtype ); |
121 | 125 | $( '#mw-wikilove-preview-form' ).submit( $.wikiLove.submitPreview ); |
— | — | @@ -424,6 +428,7 @@ |
425 | 429 | $( '#mw-wikilove-gallery-content' ).html( '' ); |
426 | 430 | gallery = {}; |
427 | 431 | $( '#mw-wikilove-gallery-spinner' ).fadeIn( 200 ); |
| 432 | + $( '#mw-wikilove-gallery-error' ).hide(); |
428 | 433 | |
429 | 434 | if( typeof currentTypeOrSubtype.gallery.number == 'undefined' |
430 | 435 | || currentTypeOrSubtype.gallery.number <= 0 |
— | — | @@ -458,10 +463,16 @@ |
459 | 464 | dataType: 'json', |
460 | 465 | type: 'POST', |
461 | 466 | success: function( data ) { |
462 | | - if ( !data || !data.query || !data.query.pages || loadingType != currentTypeOrSubtype ) { |
| 467 | + if ( !data || !data.query || !data.query.pages ) { |
| 468 | + $( '#mw-wikilove-gallery-error' ).show(); |
| 469 | + $( '#mw-wikilove-gallery-spinner' ).fadeOut( 200 ); |
463 | 470 | return; |
464 | 471 | } |
465 | 472 | |
| 473 | + if ( loadingType != currentTypeOrSubtype ) { |
| 474 | + return; |
| 475 | + } |
| 476 | + |
466 | 477 | $.each( data.query.pages, function( id, page ) { |
467 | 478 | if ( page.imageinfo && page.imageinfo.length ) { |
468 | 479 | // build an image tag with the correct url and width |
— | — | @@ -491,6 +502,10 @@ |
492 | 503 | index++; |
493 | 504 | } |
494 | 505 | } ); |
| 506 | + }, |
| 507 | + error: function() { |
| 508 | + $( '#mw-wikilove-gallery-error' ).show(); |
| 509 | + $( '#mw-wikilove-gallery-spinner' ).fadeOut( 200 ); |
495 | 510 | } |
496 | 511 | }); |
497 | 512 | }, |
Index: trunk/extensions/WikiLove/WikiLove.i18n.php |
— | — | @@ -39,6 +39,8 @@ |
40 | 40 | 'wikilove-err-msg' => 'Please enter a message.', |
41 | 41 | 'wikilove-err-image' => 'Please select an image.', |
42 | 42 | 'wikilove-err-sig' => 'Please do not include a signature in the message.', |
| 43 | + 'wikilove-err-gallery' => 'Something went wrong when loading the images!', |
| 44 | + 'wikilove-err-gallery-again' => 'Try again', |
43 | 45 | ); |
44 | 46 | |
45 | 47 | /** Message documentation (Message documentation) |