Index: trunk/extensions/Push/includes/Push_Tab.php |
— | — | @@ -329,7 +329,7 @@ |
330 | 330 | ' ' . |
331 | 331 | Html::rawElement( |
332 | 332 | 'div', |
333 | | - array( 'style' => 'display:inline; opacity:0', 'id' => 'txtTemplateList' ), |
| 333 | + array( 'style' => 'display:none; opacity:0', 'id' => 'txtTemplateList' ), |
334 | 334 | count( $templates ) > 0 ? |
335 | 335 | wfMsgExt( 'push-tab-used-templates', 'parseinline', $wgLang->listToText( $templates ), count( $templates ) ) : |
336 | 336 | htmlspecialchars( wfMsg( 'push-tab-no-used-templates' ) ) |
— | — | @@ -376,7 +376,7 @@ |
377 | 377 | ' ' . |
378 | 378 | Html::rawElement( |
379 | 379 | 'div', |
380 | | - array( 'style' => 'display:inline; opacity:0', 'id' => 'txtFileList' ), |
| 380 | + array( 'style' => 'display:none; opacity:0', 'id' => 'txtFileList' ), |
381 | 381 | '' |
382 | 382 | ) |
383 | 383 | ) |
Index: trunk/extensions/Push/includes/ext.push.tab.js |
— | — | @@ -24,9 +24,6 @@ |
25 | 25 | } |
26 | 26 | |
27 | 27 | var pages; |
28 | | - var imageRequestMade = false; |
29 | | - var images = false; |
30 | | - var imagePushRequests = []; |
31 | 28 | |
32 | 29 | $.each($(".push-button"), function(i,v) { |
33 | 30 | getRemoteArticleInfo( $(v).attr( 'targetid' ), $(v).attr( 'pushtarget' ) ); |
— | — | @@ -53,10 +50,6 @@ |
54 | 51 | $(this).attr( 'pushtarget' ), |
55 | 52 | $(this).attr( 'targetname' ) |
56 | 53 | ); |
57 | | - |
58 | | - if ( $('#checkIncFiles').length != 0 && $('#checkIncFiles').attr('checked') && !imageRequestMade ) { |
59 | | - getIncludedImages(); |
60 | | - } |
61 | 54 | }); |
62 | 55 | |
63 | 56 | $('#push-all-button').click(function() { |
— | — | @@ -69,8 +62,14 @@ |
70 | 63 | |
71 | 64 | $('#divIncTemplates').hover( |
72 | 65 | function() { |
| 66 | + var isHidden = $('#txtTemplateList').css( 'opacity' ) == 0; |
| 67 | + |
| 68 | + if ( isHidden ) { |
| 69 | + $('#txtTemplateList').css( 'display', 'inline' ); |
| 70 | + } |
| 71 | + |
73 | 72 | $('#txtTemplateList').fadeTo( |
74 | | - ( $('#txtTemplateList').css( 'opacity' ) == 0 ? 'slow' : 'fast' ), |
| 73 | + isHidden? 'slow' : 'fast', |
75 | 74 | 1 |
76 | 75 | ); |
77 | 76 | }, |
— | — | @@ -88,6 +87,7 @@ |
89 | 88 | var isHidden = $('#txtFileList').css( 'opacity' ) == 0; |
90 | 89 | |
91 | 90 | if ( isHidden ) { |
| 91 | + $('#txtFileList').css( 'display', 'inline' ); |
92 | 92 | setIncludeFilesText(); |
93 | 93 | } |
94 | 94 | |
— | — | @@ -189,57 +189,15 @@ |
190 | 190 | |
191 | 191 | function setButtonToImgPush( button, targetUrl, targetName ) { |
192 | 192 | button.innerHTML = mediaWiki.msg( 'push-button-pushing-files' ); |
193 | | - imagePushRequests.push( { 'sender': button, 'targetUrl': targetUrl, 'targetName': targetName } ); |
194 | | - startImagesPush(); |
| 193 | + initiateImagePush( button, targetUrl, targetName ); |
195 | 194 | } |
196 | 195 | |
197 | | - function getIncludedImages() { |
198 | | - imageRequestMade = true; |
| 196 | + function initiateImagePush( sender, targetUrl, targetName ) { |
| 197 | + var images = window.wgPushPageFiles.concat( window.wgPushTemplateFiles ); |
199 | 198 | |
200 | 199 | $.getJSON( |
201 | 200 | wgScriptPath + '/api.php', |
202 | 201 | { |
203 | | - 'action': 'query', |
204 | | - 'prop': 'images', |
205 | | - 'format': 'json', |
206 | | - 'titles': pages.join( '|' ), |
207 | | - }, |
208 | | - function( data ) { |
209 | | - if ( data.query ) { |
210 | | - images = []; |
211 | | - |
212 | | - for ( page in data.query.pages ) { |
213 | | - if ( data.query.pages[page].images ) { |
214 | | - for ( var i = data.query.pages[page].images.length - 1; i >= 0; i-- ) { |
215 | | - if ( $.inArray( data.query.pages[page].images[i].title, images ) == -1 ) { |
216 | | - images.push( data.query.pages[page].images[i].title ); |
217 | | - } |
218 | | - } |
219 | | - } |
220 | | - } |
221 | | - |
222 | | - startImagesPush(); |
223 | | - } |
224 | | - else { |
225 | | - alert( mediaWiki.msg( 'push-tab-err-fileinfo' ) ); |
226 | | - } |
227 | | - } |
228 | | - ); |
229 | | - } |
230 | | - |
231 | | - function startImagesPush() { |
232 | | - if ( images !== false ) { |
233 | | - var req; |
234 | | - while ( req = imagePushRequests.pop() ) { |
235 | | - initiateImagePush( req.sender, req.targetUrl, req.targetName ); |
236 | | - } |
237 | | - } |
238 | | - } |
239 | | - |
240 | | - function initiateImagePush( sender, targetUrl, targetName ) { |
241 | | - $.getJSON( |
242 | | - wgScriptPath + '/api.php', |
243 | | - { |
244 | 202 | 'action': 'pushimages', |
245 | 203 | 'format': 'json', |
246 | 204 | 'images': images.join( '|' ), |