Index: trunk/extensions/Push/Push.i18n.php |
— | — | @@ -21,6 +21,8 @@ |
22 | 22 | 'right-bulkpush' => 'Authorization to use bulk push functionality (ie Special:Push).', |
23 | 23 | 'right-pushadmin' => 'Authorization to modify push targets and push settings.', |
24 | 24 | |
| 25 | + 'push-err-captacha' => 'Could not push to $1 due to captcha.', |
| 26 | + |
25 | 27 | // Tab |
26 | 28 | 'push-tab-text' => 'Push', |
27 | 29 | 'push-button-text' => 'Push', |
Index: trunk/extensions/Push/specials/Push_Body.php |
— | — | @@ -202,7 +202,12 @@ |
203 | 203 | $form .= Xml::element( 'textarea', array( 'name' => 'pages', 'cols' => 40, 'rows' => 10 ), $pages, false ); |
204 | 204 | $form .= '<br />'; |
205 | 205 | |
206 | | - $form .= Xml::checkLabel( wfMsg( 'export-templates' ), 'templates', 'wpExportTemplates', false ) . '<br />'; |
| 206 | + $form .= Xml::checkLabel( |
| 207 | + wfMsg( 'export-templates' ), |
| 208 | + 'templates', |
| 209 | + 'wpExportTemplates', |
| 210 | + $wgRequest->wasPosted() ? $wgRequest->getCheck( 'templates' ) : false |
| 211 | + ) . '<br />'; |
207 | 212 | |
208 | 213 | if ( count( $egPushTargets ) == 1 ) { |
209 | 214 | $names = array_keys( $egPushTargets ); |
— | — | @@ -212,7 +217,9 @@ |
213 | 218 | $form .= '<b>' . htmlspecialchars( wfMsg( 'push-special-select-targets' ) ) . '</b><br />'; |
214 | 219 | |
215 | 220 | foreach ( $egPushTargets as $targetName => $targetUrl ) { |
216 | | - $form .= Xml::checkLabel( $targetName, str_replace( ' ', '_', $targetName ), $targetName, true ) . '<br />'; |
| 221 | + $checkName = str_replace( ' ', '_', $targetName ); |
| 222 | + $checked = $wgRequest->wasPosted() ? $wgRequest->getCheck( $checkName ) : true; |
| 223 | + $form .= Xml::checkLabel( $targetName, $checkName, $targetName, $checked ) . '<br />'; |
217 | 224 | } |
218 | 225 | } |
219 | 226 | |
Index: trunk/extensions/Push/Push.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | die( 'Not an entry point.' ); |
24 | 24 | } |
25 | 25 | |
26 | | -define( 'Push_VERSION', '0.3 alpha' ); |
| 26 | +define( 'Push_VERSION', '0.3' ); |
27 | 27 | |
28 | 28 | $wgExtensionCredits['other'][] = array( |
29 | 29 | 'path' => __FILE__, |
— | — | @@ -75,6 +75,7 @@ |
76 | 76 | 'push-special-item-completed', |
77 | 77 | 'push-special-item-failed', |
78 | 78 | 'push-special-push-done', |
| 79 | + 'push-err-captacha', |
79 | 80 | ); |
80 | 81 | |
81 | 82 | // For backward compatibility with MW < 1.17. |
Index: trunk/extensions/Push/RELEASE-NOTES |
— | — | @@ -10,6 +10,8 @@ |
11 | 11 | * Fixed push functionality for wikis on remote domains. |
12 | 12 | * Added 'bulkpush' right. |
13 | 13 | * Added batch operations to Special:Push. |
| 14 | +* Added redlink support to the tab interface. |
| 15 | +* Improved error handling. |
14 | 16 | |
15 | 17 | === Version 0.2 === |
16 | 18 | 2010-12-08 |
Index: trunk/extensions/Push/includes/Push_Tab.php |
— | — | @@ -282,7 +282,8 @@ |
283 | 283 | 'class' => 'push-button', |
284 | 284 | 'pushtarget' => $url, |
285 | 285 | 'style' => 'width: 125px; height: 30px', |
286 | | - 'targetid' => $targetId |
| 286 | + 'targetid' => $targetId, |
| 287 | + 'targetname' => $name |
287 | 288 | ), |
288 | 289 | wfMsg( 'push-button-text' ) |
289 | 290 | ) |
Index: trunk/extensions/Push/includes/ext.push.tab.js |
— | — | @@ -34,7 +34,8 @@ |
35 | 35 | initiatePush( |
36 | 36 | this, |
37 | 37 | $('#pageName').attr('value'), |
38 | | - $(this).attr( 'pushtarget' ) |
| 38 | + $(this).attr( 'pushtarget' ), |
| 39 | + $(this).attr( 'targetname' ) |
39 | 40 | ); |
40 | 41 | }); |
41 | 42 | |
— | — | @@ -67,7 +68,7 @@ |
68 | 69 | ); |
69 | 70 | } |
70 | 71 | |
71 | | - function initiatePush( sender, pageName, targetUrl ) { |
| 72 | + function initiatePush( sender, pageName, targetUrl, targetName ) { |
72 | 73 | $.getJSON( |
73 | 74 | wgScriptPath + '/api.php', |
74 | 75 | { |
— | — | @@ -80,6 +81,9 @@ |
81 | 82 | if ( data.error ) { |
82 | 83 | handleError( sender, targetUrl, data.error ); |
83 | 84 | } |
| 85 | + else if ( data.edit && data.edit.captcha ) { |
| 86 | + handleError( sender, targetUrl, { info: mediaWiki.msg( 'push-err-captacha', targetName ) } ); |
| 87 | + } |
84 | 88 | else { |
85 | 89 | sender.innerHTML = mediaWiki.msg( 'push-button-completed' ); |
86 | 90 | setTimeout( function() {reEnableButton( sender );}, 1000 ); |
— | — | @@ -114,7 +118,8 @@ |
115 | 119 | |
116 | 120 | function handleError( sender, targetUrl, error ) { |
117 | 121 | alert( error.info ); |
118 | | - sender.innerHTML = mediaWiki.msg( 'push-button-failed' ); |
| 122 | + sender.innerHTML = mediaWiki.msg( 'push-button-failed' ); |
| 123 | + setTimeout( function() {reEnableButton( sender );}, 3000 ); |
119 | 124 | } |
120 | 125 | |
121 | 126 | } ); })(jQuery); |
\ No newline at end of file |