r75577 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75576‎ | r75577 | r75578 >
Date:20:27, 27 October 2010
Author:krinkle
Status:resolved (Comments)
Tags:
Comment:
changing mw.uti functionnames to follow convention + loading $.client as dependency of mw.util
Modified paths:
  • /trunk/phase3/resources/Resources.php (modified) (history)
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.test.js
@@ -1,6 +1,9 @@
2 -/*
3 - * mediaWiki Debug Test Suit.
 2+/**
 3+ * mediaWiki.util Test Suit
 4+ *
45 * Available on "/Special:BlankPage?action=mwutiltest&debug=true")
 6+ *
 7+ * @author Krinkle <krinklemail@gmail.com>
58 */
69
710 (function ($, mw) {
Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.js
@@ -68,7 +68,7 @@
6969 *
7070 * @param String str string to be encoded
7171 */
72 - 'wikiUrlencode' : function( str ) {
 72+ 'wfUrlencode' : function( str ) {
7373 return this.rawurlencode(str).replace(/%20/g, '_').replace(/%3A/g, ':').replace(/%2F/g, '/');
7474 },
7575
@@ -77,8 +77,8 @@
7878 *
7979 * @param String str pagename to link to
8080 */
81 - 'getWikilink' : function( str ) {
82 - return wgServer + wgArticlePath.replace('$1', this.wikiUrlencode(str));
 81+ 'wfGetlink' : function( str ) {
 82+ return wgServer + wgArticlePath.replace('$1', this.wfUrlencode(str));
8383 },
8484
8585 /**
Index: trunk/phase3/resources/Resources.php
@@ -381,7 +381,7 @@
382382 ) ),
383383 'mediawiki.util' => new ResourceLoaderFileModule( array(
384384 'scripts' => 'resources/mediawiki.util/mediawiki.util.js',
385 - 'dependencies' => 'jquery.checkboxShiftClick',
 385+ 'dependencies' => array( 'jquery.checkboxShiftClick', 'jquery.client' ),
386386 'debugScripts' => 'resources/mediawiki.util/mediawiki.util.test.js',
387387 ) ),
388388

Follow-up revisions

RevisionCommit summaryAuthorDate
r75642Follow-up r75577krinkle14:44, 29 October 2010

Comments

#Comment by Catrope (talk | contribs)   15:24, 28 October 2010
-		'wikiUrlencode' : function( str ) {
+		'wfUrlencode' : function( str ) {

wf is used for global PHP functions only, we shouldn't use it in JS, especially not for non-global things.

I apologize if the coding style guidelines are confusing; they mostly focus on PHP and not everything carries over to JS.

Status & tagging log