Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -1596,6 +1596,10 @@ |
1597 | 1597 | // handler for next button |
1598 | 1598 | $j( '#mwe-upwiz-stepdiv-tutorial .mwe-upwiz-button-next') |
1599 | 1599 | .click( function() { |
| 1600 | + // if the skip checkbox is checked, set the skip cookie |
| 1601 | + if ( $j('#mwe-upwiz-skip').is(':checked') ) { |
| 1602 | + _this.setSkipTutorialCookie( 1 ); |
| 1603 | + } |
1600 | 1604 | _this.moveToStep( 'file', function() { |
1601 | 1605 | // we explicitly move the file input at this point |
1602 | 1606 | // because it was probably jumping around due to other "steps" on this page during file construction. |
— | — | @@ -2223,6 +2227,16 @@ |
2224 | 2228 | $j( '#mwe-upwiz-thanks' ).append( thanksDiv ); |
2225 | 2229 | } ); |
2226 | 2230 | }, |
| 2231 | + |
| 2232 | + /** |
| 2233 | + * Set a cookie which lets the user skip the tutorial step in the future |
| 2234 | + */ |
| 2235 | + setSkipTutorialCookie: function( state ) { |
| 2236 | + var e = new Date(); |
| 2237 | + e.setTime( e.getTime() + (365*24*60*60*1000) ); // one year |
| 2238 | + var cookieString='skiptutorial='+state+'; expires=' + e.toGMTString() + '; path=/'; |
| 2239 | + document.cookie = cookieString; |
| 2240 | + }, |
2227 | 2241 | |
2228 | 2242 | /** |
2229 | 2243 | * |
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php |
— | — | @@ -196,6 +196,8 @@ |
197 | 197 | . UploadWizardTutorial::getHtml() |
198 | 198 | . '</div>' |
199 | 199 | . '<div class="mwe-upwiz-buttons">' |
| 200 | + . '<input type="checkbox" id="mwe-upwiz-skip" value="1" name="skip">' |
| 201 | + . '<label for="mwe-upwiz-skip">Skip this step in the future</label>' |
200 | 202 | . '<button class="mwe-upwiz-button-next">' . wfMsg( "mwe-upwiz-next" ) . '</button>' |
201 | 203 | . '</div>' |
202 | 204 | . '</div>' |