Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -282,9 +282,9 @@ |
283 | 283 | $wgRemoveGroups['epadmin'] = array( 'eponlineamb', 'epcampamb', 'epinstructor' ); |
284 | 284 | |
285 | 285 | // Namespaces |
286 | | -define( 'EP_NS_COURSE', 442 + 0 ); |
| 286 | +define( 'EP_NS_COURSE', 442 + 0 ); |
287 | 287 | define( 'EP_NS_COURSE_TALK', 442 + 1 ); |
288 | | -define( 'EP_NS_INSTITUTION', 422 + 2 ); |
| 288 | +define( 'EP_NS_INSTITUTION', 442 + 2 ); |
289 | 289 | define( 'EP_NS_INSTITUTION_TALK', 442 + 3 ); |
290 | 290 | |
291 | 291 | // Resource loader modules |
— | — | @@ -359,6 +359,18 @@ |
360 | 360 | ), |
361 | 361 | ); |
362 | 362 | |
| 363 | +$wgResourceModules['ep.addorg'] = $moduleTemplate + array( |
| 364 | + 'scripts' => array( |
| 365 | + 'ep.addorg.js', |
| 366 | + ), |
| 367 | +); |
| 368 | + |
| 369 | +$wgResourceModules['ep.addcourse'] = $moduleTemplate + array( |
| 370 | + 'scripts' => array( |
| 371 | + 'ep.addcourse.js', |
| 372 | + ), |
| 373 | +); |
| 374 | + |
363 | 375 | if ( array_key_exists( 'WikiEditorHooks', $GLOBALS['wgAutoloadClasses'] ) ) { |
364 | 376 | $wgResourceModules['ep.formpage']['dependencies'][] = 'ext.wikiEditor.toolbar'; |
365 | 377 | } |
Index: trunk/extensions/EducationProgram/includes/EPOrg.php |
— | — | @@ -209,12 +209,14 @@ |
210 | 210 | } |
211 | 211 | |
212 | 212 | $out = $context->getOutput(); |
| 213 | + |
| 214 | + $out->addModules( 'ep.addorg' ); |
213 | 215 | |
214 | 216 | $out->addHTML( Html::openElement( |
215 | 217 | 'form', |
216 | 218 | array( |
217 | 219 | 'method' => 'post', |
218 | | - 'action' => SpecialPage::getTitleFor( 'EditInstitution' )->getLocalURL(), |
| 220 | + 'action' => self::getTitleFor( 'NAME' )->getLocalURL(), |
219 | 221 | ) |
220 | 222 | ) ); |
221 | 223 | |
— | — | @@ -235,7 +237,11 @@ |
236 | 238 | $out->addHTML( ' ' . Html::input( |
237 | 239 | 'addneworg', |
238 | 240 | wfMsg( 'ep-institutions-add' ), |
239 | | - 'submit' |
| 241 | + 'submit', |
| 242 | + array( |
| 243 | + 'disabled' => 'disabled', |
| 244 | + 'class' => 'ep-org-add', |
| 245 | + ) |
240 | 246 | ) ); |
241 | 247 | |
242 | 248 | $out->addHTML( Html::hidden( 'isnew', 1 ) ); |
Index: trunk/extensions/EducationProgram/includes/EPCourse.php |
— | — | @@ -329,12 +329,14 @@ |
330 | 330 | } |
331 | 331 | |
332 | 332 | $out = $context->getOutput(); |
| 333 | + |
| 334 | + $out->addModules( 'ep.addcourse' ); |
333 | 335 | |
334 | 336 | $out->addHTML( Html::openElement( |
335 | 337 | 'form', |
336 | 338 | array( |
337 | 339 | 'method' => 'post', |
338 | | - 'action' => SpecialPage::getTitleFor( 'EditCourse' )->getLocalURL(), |
| 340 | + 'action' => self::getTitleFor( 'NAME' )->getLocalURL(), |
339 | 341 | ) |
340 | 342 | ) ); |
341 | 343 | |
— | — | @@ -362,7 +364,11 @@ |
363 | 365 | $out->addHTML( ' ' . Html::input( |
364 | 366 | 'addnewcourse', |
365 | 367 | wfMsg( 'ep-courses-add' ), |
366 | | - 'submit' |
| 368 | + 'submit', |
| 369 | + array( |
| 370 | + 'disabled' => 'disabled', |
| 371 | + 'class' => 'ep-course-add', |
| 372 | + ) |
367 | 373 | ) ); |
368 | 374 | |
369 | 375 | $out->addHTML( Html::hidden( 'isnew', 1 ) ); |
Index: trunk/extensions/EducationProgram/resources/ep.addcourse.js |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +/** |
| 3 | + * JavasSript for the Education Program MediaWiki extension. |
| 4 | + * @see https://www.mediawiki.org/wiki/Extension:Education_Program |
| 5 | + * |
| 6 | + * @licence GNU GPL v3 or later |
| 7 | + * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
| 8 | + */ |
| 9 | + |
| 10 | +(function( $, mw ) { |
| 11 | + |
| 12 | + $( document ).ready( function() { |
| 13 | + |
| 14 | + $( '.ep-course-add' ).closest( 'form' ).submit( function() { |
| 15 | + var action = $( this ).attr( 'action' ); |
| 16 | + $( this ).attr( |
| 17 | + 'action', |
| 18 | + action.substring( 0, action.length - 4 ) + $( '#newname' ).val() + ' (' + $( '#newterm' ).val() + ')' |
| 19 | + ); |
| 20 | + } ); |
| 21 | + |
| 22 | + $( '.ep-course-add' ).removeAttr( 'disabled' ); |
| 23 | + |
| 24 | + } ); |
| 25 | + |
| 26 | +})( window.jQuery ); |
\ No newline at end of file |
Property changes on: trunk/extensions/EducationProgram/resources/ep.addcourse.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 27 | + native |
Index: trunk/extensions/EducationProgram/resources/ep.api.js |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Education Program MediaWiki extension. |
4 | | - * @see https://www.mediawiki.org/wiki/Extension:Reviews |
| 4 | + * @see https://www.mediawiki.org/wiki/Extension:Education_Program |
5 | 5 | * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
Index: trunk/extensions/EducationProgram/resources/ep.addorg.js |
— | — | @@ -0,0 +1,22 @@ |
| 2 | +/** |
| 3 | + * JavasSript for the Education Program MediaWiki extension. |
| 4 | + * @see https://www.mediawiki.org/wiki/Extension:Education_Program |
| 5 | + * |
| 6 | + * @licence GNU GPL v3 or later |
| 7 | + * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
| 8 | + */ |
| 9 | + |
| 10 | +(function( $, mw ) { |
| 11 | + |
| 12 | + $( document ).ready( function() { |
| 13 | + |
| 14 | + $( '.ep-org-add' ).closest( 'form' ).submit( function() { |
| 15 | + var action = $( this ).attr( 'action' ); |
| 16 | + $( this ).attr( 'action', action.substring( 0, action.length - 4 ) + $( '#newname' ).val() ); |
| 17 | + } ); |
| 18 | + |
| 19 | + $( '.ep-org-add' ).removeAttr( 'disabled' ); |
| 20 | + |
| 21 | + } ); |
| 22 | + |
| 23 | +})( window.jQuery ); |
\ No newline at end of file |
Property changes on: trunk/extensions/EducationProgram/resources/ep.addorg.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 24 | + native |