Commit graph

147 commits

Author SHA1 Message Date
robin
7405ad3999 Use number input type for year in dateMenu
Use the HTML5 number input type for the year input field in the dateMenu (used on e.g. history pages), since a year is always a number :)
(There was once a year type proposed, but that didn't make it into HTML5)

Patchset 2: use Html::input instead of Xml::input (and change the other Xml's to self::)

Change-Id: If9ad28566abfc02a164367d7cdd6992939169c0a
2012-09-17 21:47:19 +02:00
Alex Monk
2fabea7eea Use wfMessage instead of deprecated wfMsg*
Or $this->msg in special pages.

Change-Id: I774a89d646615053c8424050e42ad95601f92543
2012-08-18 14:11:05 +02:00
robin
72ebf55665 Use Xml::languageSelector in SpecialAllmessages
Improve Xml::languageSelector: add parameters to change label message and id/name of the select tag.

Use languageSelector in SpecialAllmessages (less code duplication)

Patchset 10 July: add tests per MaxSem; add version for new parameters and change the message parameter to require a Message object per Nikerabbit

Change-Id: I7fbb29ee2dc37a2b6a5e2cfc88207a0b47b83e9b
2012-07-10 13:43:38 -04:00
Alexandre Emsenhuber
2040d1337e Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ib46e50da4ec649a6a06cbeed00752effb79ed06e
2012-05-09 20:11:36 +02:00
Robin Pepermans
44d2c73bf5 Combine getLanguageNames and getTranslatedLanguageNames into one function which is much easier and more logical to use. Does not contain any actual changes yet in what the function does.
* Reduces the overly long code in r107002, and reduces code for {{#language:}}
* Fixes the language list in Special:Translate which contained languages that gave "invalid code" when selecting
2012-02-27 11:59:24 +00:00
Sam Reed
e16a11ae16 Improve documentation
Fix whitespace


Fix weird conditional loading of DB_MASTER from specials/SpecialEditWatchlist.php
2012-02-21 21:15:05 +00:00
Sam Reed
43dd8dd7e9 Followup r107002
Add a TODO to do this via hook or similar
2012-02-16 02:52:11 +00:00
Sam Reed
09a78c1368 More return documentation 2012-02-09 21:36:14 +00:00
Sam Reed
0a626db6e1 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:29:36 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Tim Starling
8a9b79dda7 Revert r110321: introduces an XSS vulnerability because FormatJson::encode() does not prevent the termination of CDATA sections when JavaScript is embedded in HTML. 2012-02-08 00:03:16 +00:00
Krinkle
ece121efd6 [Xml::encodeJsVar] Use FormatJson::encode / native json_encode instead
* Follows-up r110320
* XmlTest.php passes
2012-01-30 19:45:38 +00:00
Krinkle
6ebbb369a6 [Xml::encodeJsVar] Change to match FormatJson::encode output
- Pure whitespace change
- In preparation to deprecate it in favor of FormatJson / json_encode
2012-01-30 19:40:20 +00:00
Antoine Musso
11c166bf92 comment / style for Html::namespaceSelector()
Xml.php:
* align array values. Easier to the eyes.

Html.php:
* Various comments
* Switched the way the HTML is forged

Ping r109990
2012-01-30 11:02:56 +00:00
Krinkle
11b0b2e7d3 [Xml/Html] new method Html::namespaceSelector
* Using params and option arrays instead of 4 random parameters like Xml::namespaceSelector did
* Right now it's passing $selectAttribs['name'] to Xml::label, this is done because that's what Xml::namespaceSelector did. However it's wrong since labels associate over ID not NAME. Will fix in the next commit, making sure unit tests stay functional first. This bug has been in Xml::namespaceSelector for a long time but usually unnoticed as people kept either defaults. Although it was easy to get wrong as the NAME was configurable but the ID was hardcoded in Xml::namespaceSelector.
* Deprecated Xml::namespaceSelector and made it cal Html::namespaceSelector

* Follows-up r109974, r109698
* XmlTest.php still runs successfully
2012-01-25 03:01:20 +00:00
Krinkle
957c3b5b68 [Unit testing] Re-order attribs to a-z to make testing more reliable
* This is in preparation for deprecating this in favor of an Html:: method soon, making sure here that tests still match afterwards
* Follows-up r109698
2012-01-25 00:52:29 +00:00
Ryan Kaldari
d539feaa20 follow-up to r106912 - NULL to null 2012-01-04 19:01:12 +00:00
Ryan Kaldari
6aa9ece18b follow-up to r106912, making change to correct branch this time 2011-12-21 22:54:22 +00:00
Happy-melon
cc311fa7dd Type hinting 2011-10-17 15:56:25 +00:00
Niklas Laxström
64c31d8f16 Small cleanups to XmlSelect 2011-10-08 11:41:10 +00:00
Sam Reed
e159eb114e Fix fail from r94473
Append to the string, don't replace it
2011-08-14 19:50:08 +00:00
Sam Reed
8a42c19f41 Made Xml::buildTable() wrap header stuff in <thead></thead> 2011-08-14 19:47:44 +00:00
Siebrand Mazeland
5dcc810e2b Update whitespace, braces. 2011-08-02 13:56:07 +00:00
Platonides
6860753996 Follow up r91072. This is indeed not needed. 2011-06-29 22:37:11 +00:00
Platonides
eadb8a3e73 Delay expansion of XmlSelect options until getting the HTML.
Setting the default after adding options now works.
Enabled testSetDefaultAfterAddingOptions().
2011-06-29 14:15:47 +00:00
Antoine Musso
5418ac98d2 Find 'all' special ns regardless of its rank in the select
This is done by looking for an <option> element with an empty string value
which denote the special case 'all'.
Also removed a comment in Xml.php asking to keep 'all' as a first element
since it is no longer needed.

Follow up r90943 (comment 18872 by Brion)
2011-06-28 19:32:25 +00:00
Antoine Musso
d4abcb5268 Disable ns selector checkboxes when 'all' namespace is selected
* based on an idea by Aaron on r90866
* comes with QUnit test
* expect the special 'all' namespace to be the first in the list
* function build on mediawiki.special form r90941
2011-06-28 06:40:49 +00:00
Antoine Musso
d86a3bc217 Xml::label now apply the 'title' attribute when provided 2011-06-23 19:57:52 +00:00
Sam Reed
8bfd19b451 Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits (3/3), so hopefully reviewable in CR...
2011-06-17 16:05:35 +00:00
Jure Kajzer
62a12d2454 * moved infobox to Html (r88109#c16937) 2011-06-01 13:57:50 +00:00
Sam Reed
c6686ca6bd More documentation
Addition of spaces according to our coding style guidelines
2011-05-21 19:22:01 +00:00
Jure Kajzer
7fdcf7a92e * fixed typo 2011-05-15 09:20:40 +00:00
Jure Kajzer
a069d8bde0 discussion with hashar
* moved getInfoBox into Xml.php as infoBox static method
* moved config-infobox* css classes from config to mw-infobox* in shared
* left getInfoBox as a wrapper in the installer
2011-05-14 16:54:22 +00:00
Sam Reed
40e70b32de Xml::hidden() --> Html::hidden()
Xml::hidden() killed
2011-05-06 23:13:09 +00:00
Sam Reed
f985524076 More versions added to @deprecated tags
Couple of inbound calls fixed up

Some ancient code removed as it's been marked deprecated
2011-05-06 21:50:18 +00:00
Chad Horohoe
e4c31083f1 Null -> null, reorder docs to match signature 2011-02-26 10:55:44 +00:00
Brion Vibber
638b6751e1 * (bug 25571) Xml::encodeJsVar now passes floats natively instead of converting to strings
Added unit test cases for int, float, and strings that look like int or float.
2011-02-14 00:54:40 +00:00
Ryan Kaldari
751ed18cce adding comment 2011-01-22 01:57:25 +00:00
Sam Reed
b2bfcc788a Documentation addition/tweaks 2011-01-10 04:44:33 +00:00
Happy-melon
1ca41c10cd Clarify doc, per r63675 CR. 2010-11-06 15:14:04 +00:00
Niklas Laxström
a5b16e9cb5 Added @since tags for stuff introduced in r75994 2010-11-04 14:14:01 +00:00
Tim Starling
82f274088a * Introduced Xml::encodeJsCall(), to replace the awkward repetitive code that was doing the same thing throughout the resource loader with varying degrees of security and correctness.
* Modified Xml::encodeJsVar() to allow it to pass through JS expressions without encoding, using a special object.
* In ResourceLoader::makeModuleResponse(), renamed $messages to $messagesBlob to make it clear that it's JSON-encoded, not an array.
* Fixed MessageBlobStore to store {} for an empty message array instead of [].
* In ResourceLoader::makeMessageSetScript(), fixed call to non-existent function mediaWiki.msg.set.
* For security, changed the calling convention of makeMessageSetScript() and makeLoaderImplementScript() to require explicit object construction of XmlJsCode() before interpreting their input as JS code.
* Documented several ResourceLoader static functions.
* In ResourceLoaderWikiModule, for readability, reduced the indenting level by flipping some if blocks and adding continue statements.
* In makeCustomLoaderScript(), allow non-numeric $version. The only caller I can find is already sending a non-numeric $version, presumably it was broken. Luckily there aren't any loader scripts in existence, I had to make one to test it.
* wfGetDb -> wfGetDB
* Added an extra line break in the startup module output, for readability.
* In ResourceLoaderStartUpModule::getModuleRegistrations(), fixed another assignment expression
2010-11-04 07:53:37 +00:00
Sam Reed
408247d80b More function parameter commenting 2010-10-27 23:56:01 +00:00
Sam Reed
168dc48bf6 Parameter documentation 2010-10-27 23:50:09 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Platonides
537826a674 Remove $wgContLanguageCode usage in core.
sed -i 's/$wgContLanguageCode/$wgLanguageCode/g'
These are now the same, always. Per and since r15827.

$wgLanguageCode wins due to being the one set by LocalSettings.

$wgContLanguageCode definition at includes/Setup.php kept for now.
2010-09-07 22:37:55 +00:00
Sam Reed
ecf56c33fa Braces and spaces 2010-09-04 03:43:33 +00:00
Aryeh Gregor
ba78c75668 Make r66504 a little more concise 2010-06-09 20:49:00 +00:00
Chad Horohoe
bcf63be4ea (bug 23797) Xml::input() now allows '0' for the value parameter 2010-06-07 18:20:30 +00:00
Aryeh Gregor
74a21f3bd1 Remove most named character references from output
Recommit of r66254 to trunk.  This was just

find extensions phase3 -iname '*.php' \! -iname '*.i18n.php' \! -iname 'Messages*.php' \! -iname '*_Messages.php' -exec sed -i 's/&nbsp;/\&#160;/g;s/&mdash;/―/g;s/&bull;/•/g;s/&aacute;/á/g;s/&acute;/´/g;s/&agrave;/à/g;s/&alpha;/α/g;s/&auml;/ä/g;s/&ccedil;/ç/g;s/&copy;/©/g;s/&darr;/↓/g;s/&deg;/°/g;s/&eacute;/é/g;s/&ecirc;/ê/g;s/&euml;/ë/g;s/&egrave;/è/g;s/&euro;/€/g;s/&harr;//g;s/&hellip;/…/g;s/&iacute;/í/g;s/&igrave;/ì/g;s/&larr;/←/g;s/&ldquo;/“/g;s/&middot;/·/g;s/&minus;/−/g;s/&ndash;/–/g;s/&oacute;/ó/g;s/&ocirc;/ô/g;s/&oelig;/œ/g;s/&ograve;/ò/g;s/&otilde;/õ/g;s/&ouml;/ö/g;s/&pound;/£/g;s/&prime;/′/g;s/&Prime;/″/g;s/&raquo;/»/g;s/&rarr;/→/g;s/&rdquo;/”/g;s/&Sigma;/Σ/g;s/&times;/×/g;s/&uacute;/ú/g;s/&uarr;/↑/g;s/&uuml;/ü/g;s/&yen;/¥/g' {} +

followed by reading over every single line of the resulting diff and
fixing a whole bunch of false positives.  The reason for this change is
given in <http://lists.wikimedia.org/pipermail/wikitech-l/2010-April/047617.html>.
I cleared it with Tim and Brion on IRC before committing.  It might
cause a few problems, but I tried to be careful; please report any
issues.

I skipped all messages files.  I plan to make a follow-up commit that
alters wfMsgExt() with 'escapenoentities' to sanitize all the entities.
That way, the only messages that will be problems will be ones that
output raw HTML, and we want to get rid of those anyway.

This should get rid of all named entities everywhere except messages.  I
skipped a few things like &nbsp that I noticed in manual inspection,
because they weren't well-formed XML anyway.

Also, to everyone who uses non-breaking spaces when they could use a
normal space, or nothing at all, or CSS padding: I still hate you.  Die.
2010-05-30 17:33:59 +00:00