r112769 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112768‎ | r112769 | r112770 >
Date:03:11, 1 March 2012
Author:johnduhart
Status:resolved (Comments)
Tags:
Comment:
mw.config use and simplying a function
Modified paths:
  • /trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js (modified) (history)
  • /trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.user/ext.articleCreation.user.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.user/ext.articleCreation.user.js
@@ -204,11 +204,7 @@
205205 },
206206
207207 isInterstitialDisabled : function(button) {
208 - if ( $.cookie('mw:ac:disabled-interstitial:'+button) ) {
209 - return true;
210 - }
211 -
212 - return false;
 208+ return $.cookie('mw:ac:disabled-interstitial:' + button);
213209 },
214210
215211 trackAction : function(article, action) {
Index: trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js
@@ -1,6 +1,6 @@
22 jQuery( document ).ready( function() {
33 var newTitle = 'Special:ArticleCreationLanding' + '/' +
4 - encodeURIComponent(wgPageName);
 4+ encodeURIComponent( mw.config.get('wgArticlePath') );
55 var landingURL = mw.config.get('wgArticlePath').replace( '$1', newTitle );
66 // change the link to point to the new special page
77 jQuery("div.noarticletext")

Follow-up revisions

RevisionCommit summaryAuthorDate
r112826followup to -r112769 - change wgArticlePath back to wgPageName, it is causing...bsitu18:36, 1 March 2012

Comments

#Comment by Kaldari (talk | contribs)   21:05, 2 March 2012

I actually prefer the more explicit style of the longer function - you can instantly see that the function either returns true or false. However, as this is a matter of preference, I'm marking resolved.

Status & tagging log