Index: trunk/phase3/resources/jquery/jquery.concurrency.js |
— | — | @@ -0,0 +1,42 @@ |
| 2 | +/** |
| 3 | + * Base jQuery plugin for Concurrency |
| 4 | + * |
| 5 | + * @author Rob Moen |
| 6 | + */ |
| 7 | + |
| 8 | +(function ( $ ) { |
| 9 | + $.concurrency = { |
| 10 | + /* |
| 11 | + * Checkin our checkout an object via API |
| 12 | + * @param ccaction: checkout, checkin |
| 13 | + * @param resourcetype: extension specific type (string) |
| 14 | + * @param record: resource id (int) |
| 15 | + * @param callback: function to handle response |
| 16 | + */ |
| 17 | + check: function( params, callback ) { |
| 18 | + params = $.extend({ |
| 19 | + action: 'concurrency', |
| 20 | + token: mw.user.tokens.get( 'editToken' ), |
| 21 | + format: 'json' |
| 22 | + }, params); |
| 23 | + |
| 24 | + return $.ajax( { |
| 25 | + type: 'POST', |
| 26 | + url: mw.util.wikiScript( 'api' ), |
| 27 | + data: params, |
| 28 | + success: function( data ){ |
| 29 | + if ( typeof callback == 'function' ){ |
| 30 | + callback(data); |
| 31 | + } |
| 32 | + }, |
| 33 | + error: function( data ){ |
| 34 | + if ( typeof callback == 'function' ){ |
| 35 | + callback(data); |
| 36 | + } |
| 37 | + }, |
| 38 | + dataType: 'json' |
| 39 | + } ); |
| 40 | + } |
| 41 | + }; |
| 42 | + |
| 43 | +})( jQuery ); |
\ No newline at end of file |
Property changes on: trunk/phase3/resources/jquery/jquery.concurrency.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 44 | + native |
Index: trunk/phase3/resources/Resources.php |
— | — | @@ -112,6 +112,9 @@ |
113 | 113 | 'jquery.colorUtil' => array( |
114 | 114 | 'scripts' => 'resources/jquery/jquery.colorUtil.js', |
115 | 115 | ), |
| 116 | + 'jquery.concurrency' => array( |
| 117 | + 'scripts' => 'resources/jquery/jquery.concurrency.js', |
| 118 | + ), |
116 | 119 | 'jquery.cookie' => array( |
117 | 120 | 'scripts' => 'resources/jquery/jquery.cookie.js', |
118 | 121 | ), |