r110239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110238‎ | r110239 | r110240 >
Date:13:16, 29 January 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
new stuff post should go to namespace, not removed special pages
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPOrg.php (modified) (history)
  • /trunk/extensions/EducationProgram/resources/ep.addcourse.js (added) (history)
  • /trunk/extensions/EducationProgram/resources/ep.addorg.js (added) (history)
  • /trunk/extensions/EducationProgram/resources/ep.api.js (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/EducationProgram.php
@@ -282,9 +282,9 @@
283283 $wgRemoveGroups['epadmin'] = array( 'eponlineamb', 'epcampamb', 'epinstructor' );
284284
285285 // Namespaces
286 -define( 'EP_NS_COURSE', 442 + 0 );
 286+define( 'EP_NS_COURSE', 442 + 0 );
287287 define( 'EP_NS_COURSE_TALK', 442 + 1 );
288 -define( 'EP_NS_INSTITUTION', 422 + 2 );
 288+define( 'EP_NS_INSTITUTION', 442 + 2 );
289289 define( 'EP_NS_INSTITUTION_TALK', 442 + 3 );
290290
291291 // Resource loader modules
@@ -359,6 +359,18 @@
360360 ),
361361 );
362362
 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+
363375 if ( array_key_exists( 'WikiEditorHooks', $GLOBALS['wgAutoloadClasses'] ) ) {
364376 $wgResourceModules['ep.formpage']['dependencies'][] = 'ext.wikiEditor.toolbar';
365377 }
Index: trunk/extensions/EducationProgram/includes/EPOrg.php
@@ -209,12 +209,14 @@
210210 }
211211
212212 $out = $context->getOutput();
 213+
 214+ $out->addModules( 'ep.addorg' );
213215
214216 $out->addHTML( Html::openElement(
215217 'form',
216218 array(
217219 'method' => 'post',
218 - 'action' => SpecialPage::getTitleFor( 'EditInstitution' )->getLocalURL(),
 220+ 'action' => self::getTitleFor( 'NAME' )->getLocalURL(),
219221 )
220222 ) );
221223
@@ -235,7 +237,11 @@
236238 $out->addHTML( ' ' . Html::input(
237239 'addneworg',
238240 wfMsg( 'ep-institutions-add' ),
239 - 'submit'
 241+ 'submit',
 242+ array(
 243+ 'disabled' => 'disabled',
 244+ 'class' => 'ep-org-add',
 245+ )
240246 ) );
241247
242248 $out->addHTML( Html::hidden( 'isnew', 1 ) );
Index: trunk/extensions/EducationProgram/includes/EPCourse.php
@@ -329,12 +329,14 @@
330330 }
331331
332332 $out = $context->getOutput();
 333+
 334+ $out->addModules( 'ep.addcourse' );
333335
334336 $out->addHTML( Html::openElement(
335337 'form',
336338 array(
337339 'method' => 'post',
338 - 'action' => SpecialPage::getTitleFor( 'EditCourse' )->getLocalURL(),
 340+ 'action' => self::getTitleFor( 'NAME' )->getLocalURL(),
339341 )
340342 ) );
341343
@@ -362,7 +364,11 @@
363365 $out->addHTML( ' ' . Html::input(
364366 'addnewcourse',
365367 wfMsg( 'ep-courses-add' ),
366 - 'submit'
 368+ 'submit',
 369+ array(
 370+ 'disabled' => 'disabled',
 371+ 'class' => 'ep-course-add',
 372+ )
367373 ) );
368374
369375 $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
127 + native
Index: trunk/extensions/EducationProgram/resources/ep.api.js
@@ -1,6 +1,6 @@
22 /**
33 * 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
55 *
66 * @licence GNU GPL v3 or later
77 * @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
124 + native

Status & tagging log