Commit graph

116 commits

Author SHA1 Message Date
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/ /\ /g;s/—/―/g;s/•/•/g;s/á/á/g;s/´/´/g;s/à/à/g;s/α/α/g;s/ä/ä/g;s/ç/ç/g;s/©/©/g;s/↓/↓/g;s/°/°/g;s/é/é/g;s/ê/ê/g;s/ë/ë/g;s/è/è/g;s/€/€/g;s/↔//g;s/…/…/g;s/í/í/g;s/ì/ì/g;s/←/←/g;s/“/“/g;s/·/·/g;s/−/−/g;s/–/–/g;s/ó/ó/g;s/ô/ô/g;s/œ/œ/g;s/ò/ò/g;s/õ/õ/g;s/ö/ö/g;s/£/£/g;s/′/′/g;s/″/″/g;s/»/»/g;s/→/→/g;s/”/”/g;s/Σ/Σ/g;s/×/×/g;s/ú/ú/g;s/↑/↑/g;s/ü/ü/g;s/¥/¥/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
Siebrand Mazeland
80858a18fc Fix for r66504 per Nikerabbit's CR. Actually copy-paste and not adjust issue. 2010-05-16 08:26:14 +00:00
Siebrand Mazeland
af8b58e0c5 HTML5 fix: Bad value for attribute size on element input: The empty string is not a valid positive integer.
Spotted in Special:BlockList. Also fixed when attribute value is false.
2010-05-15 23:57:50 +00:00
Alexandre Emsenhuber
0ea2add9f0 Fix for r63675: the parameter is $attribs, not $attrs 2010-03-18 17:14:24 +00:00
Happy-melon
85a6396920 Strict type checking, otherwise can't set a default value of '0'. 2010-03-13 16:11:36 +00:00
Happy-melon
f8151c1594 Apply CSS classes for XML checkboxes/radiobuttons to their labels as well. 2010-03-13 14:59:44 +00:00
Tim Starling
4438c46cf3 Revert r56514 and r60421 per CR. 2010-02-03 04:54:20 +00:00
Aryeh Gregor
b621f9f104 Use Html::element() for Xml::submitButton()
There are a bunch of other places where we could switch to Html methods
here too.  See
<http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61130#c5451>.
2010-01-27 18:59:52 +00:00
Tim Starling
ad19c032b0 Fix for bug 9413 and the related Malayalam issue reported on wikitech-l.
* Added $wgFixArchaicUnicode, which, if enabled, converts some deprecated Unicode sequences in Arabic and Malayalam text to their Unicode 5.1 equivalents.
* Added generateNormalizerData.php to generate the relevant data files. Added the generated data files also. 
* Made most things call the new wrapper method $wgContLang->normalize() instead of UtfNormal::cleanUp(), so that Unicode normalization can be customised on a per-language basis.
* Added some generic support for conversion tables to Language so that subclasses can easily implement these kinds of transformations.
2010-01-04 08:28:50 +00:00
OverlordQ
6dd459c848 Followup to r56514 r56174 empty strings are not NULL 2009-12-26 23:15:03 +00:00
OverlordQ
a989843cd0 Code cleanup, covert leading spaces into tabs per coding style 2009-11-14 21:27:13 +00:00
Alexandre Emsenhuber
b4b89afea3 fix some doxygen warnings 2009-10-04 21:21:30 +00:00
Andrew Garrett
1b8de0bdf2 In Xml::encodeJsVar, keep backwards compatibility by encoding empty arrays as empty arrays rather than empty objects. Regression in r56032, reported as bug 20671 2009-09-17 09:31:16 +00:00
Brion Vibber
cec03907df Revert r55842 "Can now pass in element attributes other than just id to buildTable functions"
Code won't actually work because $id can't be an array, per notes on http://www.mediawiki.org/wiki/Special:Code/MediaWiki/55842#c3882
2009-09-08 17:42:02 +00:00
Andrew Garrett
8ce84340bf Add AJAX category management system. Includes suggestion system, dialogs for setting edit summaries and confirming, and methods for adding and removing all categories, but only directly in the page text (as categories in templates cannot be removed). 2009-09-08 15:02:41 +00:00
Nimish Gautam
e1d42d5106 Can now pass in element attributes other than just id to buildTable functions 2009-09-04 23:18:16 +00:00
Aryeh Gregor
7f937555e5 Make Xml::hidden() a wrapper around Html::hidden()
HTML-specific stuff should go into the Html class; it doesn't belong in
Xml.
2009-08-21 21:57:53 +00:00
Niklas Laxström
592be1ab8c Core change for r52446, allow querying params like id 2009-06-26 11:17:12 +00:00
Andrew Garrett
155ddf6de4 Branch merge of preferences work branch. Includes fixes for several bugs. WARNING: Breaks some extensions which have not been adapted to use it properly (basically anything not used on Wikimedia). 2009-04-24 01:31:17 +00:00
Alexandre Emsenhuber
b6e00a655b Fix doxygen warnings 2009-04-17 16:58:52 +00:00
Aaron Schulz
18bff5deff Fixed E_NOTICE 2009-02-18 03:12:26 +00:00
Aaron Schulz
1e06acb820 * consolidated getDateMenu duplication into xml.php
* made filter settings carry over when pressing "go"
* made filter links a bit smaller
* removed DefaultQuery cruft
* updated docs
2009-02-12 19:02:14 +00:00
Brion Vibber
16aaf74c1e Revert r45027, r45028 "* summary and subject messages now uses wiki text rather than raw HTML"
Changing the format of existing messages is disruptive, which is why we don't do it as a rule -- we introduce new messages that replace the old ones.
2008-12-31 17:10:02 +00:00
Alexandre Emsenhuber
b613687121 * summary and subject messages now uses wiki text rather than raw HTML
* Added the colon in summary, subject and subject-preview messages rather than using colon-separator
* Changed the note in RELEASE-NOTES to also point to bug 212
* Also escaped other messages that weren't escaped
* Added new $attribs option to Xml::label(), using it in Xml::inputLabel(), Xml::inputLabelSep(), Xml::checkLabel() and Xml::radioLabel()
* $fname -> __METHOD__
* Whitespaces tweaks
2008-12-25 15:22:01 +00:00
Chad Horohoe
beea7f4f9e Add two new XML methods for building tables (buildTable and buildTableRow). Accepts associative arrays where the key is the row/cell id and the value is its value. Non-string keys are skipped. 2008-12-16 14:07:58 +00:00
Chad Horohoe
2167d03261 Cleanup for Xml::namespaceSelector():
* Removed useless $hidden param, cleaned up calls that specified it (only 1, and it passed default false)
* Add $label param for easy attachment of labels to the selector.
2008-09-30 14:05:21 +00:00
Victor Vasiliev
cd6b69e5b4 As Raymond points out, there is a mw-submit class 2008-08-29 20:27:25 +00:00
Victor Vasiliev
f7df81b59f * Add class='mw-input' to the input row
* Move submit button to the table
2008-08-29 20:16:29 +00:00
Andrew Garrett
e75a08f1bc PHP Sucks. Having a value of 0 was making $value appear as false, so you couldn't set a value when adding an option. Fixed this up with a strict check. 2008-08-20 12:30:31 +00:00
Aryeh Gregor
2658e07fb9 Cleanup some of my old code a bit. These should still be replaced with nicer functions altogether, though, as Brion would have it. 2008-08-13 14:52:40 +00:00
Aryeh Gregor
81d611bcac Re-commit turning makeKnownLinkObj(), makeBrokenLinkObj(), makeLinkObj() into link() wrappers. This should mean that all link processing now goes through link(). Per Brion's advice, remove the BrokenLink hook and replace it with LinkBegin and LinkEnd hooks. All parser tests pass except the usual suspects. 2008-08-05 17:05:59 +00:00
Brion Vibber
bd600419c4 Revert r38591 -- "Make good-faith effort to run BrokenLink hook in Linker::link(). No parser-test regressions, and it shouldn't change behavior unless Xml::expandAttributes() and Sanitizer::decodeTagAttributes() aren't inverses up to normalization."
IMHO this is an excellent opportunity to kill a horrible interface and replace it with a sane one. Note the only use of the BrokenLink hook currently in our SVN is in SemanticForms:

/**
 * Sets the URL for form-based adding of a nonexistent (broken-linked, AKA
 * red-linked) page
 */
function sffSetBrokenLink(&$linker, $title, $query, &$u, &$style, &$prefix, &$text, &$inside, &$trail) {
	$link = sffAddDataLink($title);
	if ($link != '')
		$u = $link;
	return true;
}

In the unlikely event that anybody else is really needing the exact hook details, I'm sure there's a much nicer, more future-friendly way to do it. Make a new hook and let these hypothetical extensions fix themselves up. :)
2008-08-05 04:56:29 +00:00