Index: trunk/extensions/PageTriage/ext.PageTriage.js |
— | — | @@ -0,0 +1,29 @@ |
| 2 | +( function( $ ) { |
| 3 | + |
| 4 | +var $currentArticle = null, // the title of the current article being reviewed |
| 5 | + |
| 6 | +$.pageTriage = { |
| 7 | + tagArticle: function() { |
| 8 | + var sendData = { |
| 9 | + 'action': 'edit', |
| 10 | + 'title': $currentArticle, |
| 11 | + 'text' : $newText, |
| 12 | + 'token': $token, |
| 13 | + 'summary': 'Triaging the page, |
| 14 | + 'notminor': true, |
| 15 | + }; |
| 16 | + |
| 17 | + $.ajax( { |
| 18 | + url: mw.config.get( 'wgScriptPath' ) + '/api.php', |
| 19 | + data: sendData, |
| 20 | + dataType: 'json', |
| 21 | + type: 'POST', |
| 22 | + } ); |
| 23 | + }, |
| 24 | + |
| 25 | + loadArticle: function() { |
| 26 | + // Load in an article |
| 27 | + } |
| 28 | + |
| 29 | + $( document ).ready( $.pageTriage.loadArticle ); |
| 30 | +} |