Commit graph

681 commits

Author SHA1 Message Date
Ilmari Karonen
8c5619f778 (bug 10183) allow users to add custom css/js for all skins via /common.css & /common.js user subpages 2010-03-05 22:42:53 +00:00
Mark A. Hershberger
267bcb1ba9 follow-up r61836 - allow any URL 2010-02-26 02:41:49 +00:00
Niklas Laxström
d1ffdf5ab3 Tidy up OutputPage::includeJQuery 2010-02-24 16:21:52 +00:00
Aryeh Gregor
643866f8b7 War on xml:lang
There is no reason to use this in HTML in addition to the lang
attribute.  No spec requires it (AFAIK) and it's completely redundant.
2010-02-11 17:25:10 +00:00
Tim Starling
8557f29f5e Revert r58635 and related, unnecessary and incorrect use of the hook mechanism 2010-02-09 06:12:15 +00:00
Aryeh Gregor
3bca1224aa Remove extra space in <html> from version="" stuff 2010-02-05 02:36:18 +00:00
Roan Kattouw
76dfc15539 Use wfAppendQuery() instead of "$path?$wgStyleVersion" where $path can contain ?foo=bar&bar=baz . This fixes the bug where MediaWiki:Monobook.js was included on every page and the JS variable skin was always set to 'monobook'; this happened because of &useskin=vector?265 2010-02-03 10:48:11 +00:00
Alexandre Emsenhuber
5cfb227b67 Follow-up r61806: also escape tag in getPageTitle() 2010-02-02 16:26:52 +00:00
Roan Kattouw
42135fdcf0 Fix r61838: add /common 2010-02-02 01:06:22 +00:00
Roan Kattouw
8dc8fa46b6 Fix hardcoding of /skins in OutputPage::addJQuery() 2010-02-02 01:02:16 +00:00
Roan Kattouw
5ebf5c46f5 Allow external URLs (e.g. http://bits.wikimedia.org/foo) in OutputPage::addScript() 2010-02-02 00:44:32 +00:00
Alexandre Emsenhuber
777a4482e6 Fixes to OutputPage's documentation
* action=raw -> action=render
* escape tags in setPageTitle()'s documentation so that it's displayed correctly (not treated as real tags)
2010-02-01 18:04:17 +00:00
Alexandre Emsenhuber
5a76aac735 Per Nikerabbit, follow-up to r61690: document $interface parameter 2010-01-30 17:40:17 +00:00
Alexandre Emsenhuber
fea47da072 Step two in fixing OutputPage's documentation, more or less the same as r61647 2010-01-29 21:32:45 +00:00
Alexandre Emsenhuber
c69affc4f0 Step one in fixing OutputPage's documentation:
* Groupped methods by function
* Added documentation
* Fixed some doxygen warnings
* Some little style fixes
(more to come)
2010-01-28 21:58:50 +00:00
Tim Starling
4a89127e92 No jquery.ui for now. 2010-01-27 09:50:19 +00:00
Tim Starling
30552e0d63 * Moved js2stopgap.js to skins/common/jquery.js, like I said I was going to do months ago.
* Add a $modules parameter to OutputPage::includeJQuery() so that we can include jquery.ui in the main UsabilityInitiative jQuery request in a reasonably flexible way, if we need to.
* Removed $wgExtensionJavascriptLoader, added in r61137 without explanation, seems to be the usual misspelt JS2/mwEmbed rubbish that I keep deleting.
2010-01-27 04:17:49 +00:00
Chad Horohoe
ed1474d7f6 Fix isSyndicated() description too 2010-01-27 00:11:13 +00:00
Chad Horohoe
34cc1e6b6a Make isSyndicated() return a boolean like its name, documentation and callers suggest it should 2010-01-27 00:09:25 +00:00
Alexandre Emsenhuber
9e960c043b And while I'm at it: removed unused global declarations of $wgFeedClasses 2010-01-26 20:52:55 +00:00
Alexandre Emsenhuber
9ff4fc7705 Follow-up r61021: added some documentation per Tim's request 2010-01-26 20:47:34 +00:00
Aryeh Gregor
6a58dcf8eb Use Html::linkedScript()
Follow-up to r61432.  This has a simpler call interface and encapsulates
ugly $wgJsMimeType nonsense.
2010-01-24 19:43:02 +00:00
Niklas Laxström
c2c5ef803a Use Html::element instead of Xml::element
It produces nicer output and has no braindeadiness with empty contents
2010-01-23 20:15:39 +00:00
Niklas Laxström
b7022e9cd9 Part 2 at solving conflict with vector and js edit
Add OutputPage::includeJQuery() for loading the jQuery currently shipped
with core. Extension can use this function to avoid loading it multiple
times. No support for plugins etc.

Changes Translate extension to use that function, restored compatability
with 1.15 for at least this part of code.
2010-01-23 20:11:42 +00:00
Alex Z
d2a3a4b444 Fix for r61391, which broke user JS. Use makeTitleSafe() instead of
newFromText(), use the NS_USER constant directly.
2010-01-23 02:00:38 +00:00
Niklas Laxström
3b686fcf71 Wrap skin specific user js addition inside Title::exists
This should help to reduce unnecessary requests, especially where action=raw is serving
uncached 404 responses in some uncommon configurations.
2010-01-22 20:39:03 +00:00
Aryeh Gregor
40e38d8e2d Use getTitle() instead of mTitle
Might prevent fatal errors caused by r61071, as suggested by code review
there.
2010-01-17 01:47:44 +00:00
Sam Reed
8e0e897034 * (bug 22061) API: add prop=headitems to action=parse
Patch contributed by Paul Copperman
2010-01-16 13:07:58 +00:00
Mark A. Hershberger
2800ca2db7 follow up r60832 and follow up r60763
* Don't set Parser::$mTitle to random garbage.
* Remove ParserOutput::$displayTitle, make setDisplayTitle() and
  getDisplayTitle() wrappers for their *TitleText() equivalents.
* Remove Parser::$mDo*Convert member variables, move test for
  $mDoubleUnderScores[] directives closer to the action.
* Remove bogus "global $wgContLang".
* Use accessor to get at $mConvRuleTitle
* Fix up showtitle option in parserTests.inc
* TODO: refactor FakeConverter class away
2010-01-15 19:14:23 +00:00
Aryeh Gregor
010c456825 Merge all skins' output of opening <body> tag
This fixes a few minor discrepancies, like Vector outputting dir=""
(redundant to the one on <html>), and non-Monobook-based skins omitting
the capitalize-all-nouns class (!).  This adds Html::openElement() and
refactors Html::rawElement() accordingly, so I checked that all parser
tests still pass.

I wasn't able to figure out if I broke some feature of right-floating
quickbars in the Standard skin, because I wasn't able to figure out what
the feature was in the first place.  Hopefully either it works, or
nobody cares, or someone else will figure out what it was supposed to
do.  (This is the stuff in getBodyOptions() in Standard.php I deleted;
I'm not sure the addition to sticky.js does what I want.)
2010-01-15 01:16:52 +00:00
Aryeh Gregor
2f0d048cc6 Remove OutputPage::{get,set}OnloadHandler()
Didn't work at all in Monobook, Modern, Vector, or any derived skin, for
who knows how long.  Only one caller, which was using it to autofocus,
which is a bad idea anyway because it will cause the focus to happen too
late, often after the user has already interacted with the page.  Any
legitimate callers may as well just add the onload in pure JS without
adding an attribute to the body.
2010-01-15 00:55:51 +00:00
Platonides
60c0474ca8 (bug 19226) First line renders differently on many UI messages
Added newlines before $1 to wrapWikiMsgs of <div>s

Also fixes r61052 utf-8 screw-up on RELEASE-NOTES.
2010-01-14 17:14:49 +00:00
Aryeh Gregor
98893997b2 Only advertise RSS feeds by default, not Atom
Advertising both is pointless, since every feed reader in the universe
supports both.  Their functionality is essentially identical.  And users
might be given a choice of multiple feeds to read when there's really
only one distinct feed.  Plus, it cuts a line from the <head>.  The Atom
feed still exists, and you can get the <head> link back if you really
want it with $wgAdvertisedFeedTypes.
2010-01-13 21:29:47 +00:00
Alexandre Emsenhuber
f33c8d775b * (bug 21738) Fix for r57119: OutputPage::setSyndicated() now works again (was breaking Special:RecentChanges' feeds, ...) 2010-01-13 20:23:14 +00:00
Mark A. Hershberger
c568220e61 Refactor LanguageConversion so that title conversion isn't so flimsy. Pull MagicWord detection into Parser->doDoubleUnderscore() && remove ParserConvert. 2010-01-07 04:13:14 +00:00
Sam Reed
b6e0df246f Attempt at normalistion of comparison styles - empty string on left and right hand side normalised to it being on the rhs
Before this change, there were (? being regex 0 or 1)

"" ===? 1
'' ===? 24
"" !==? 8
'' !==? 32

== "" 14
== '' 344
!= "" 9
!== "" 4
!= '' 151
!== '' 85


Rhs was the much more common, and the preferred style by many developers.. (Was a similar discussion in #mediawiki recently.. After that lolbugreport i think)

Where there is a string (non empty) on the lhs, and variable/method call on the rhs still need normalising
2010-01-06 19:59:42 +00:00
Philip Tzou
a2d494dae3 follow-up r60272 and r60292. replace getText with getCheck. 2009-12-22 14:36:00 +00:00
Philip Tzou
5b7f1f3b59 follow-up r60272. replace $_GET with $wgRequest->getText. 2009-12-22 14:12:23 +00:00
Philip Tzou
0a6a24661f follow-up r59522. follow Tim's suggestion to serve same vary and XVO headers for the same URL. Now the vary headers should be consistent. Feel free to test it. 2009-12-21 18:55:42 +00:00
Alexandre Emsenhuber
daeb4f3be2 Fix OutputPage::addReturnTo() and OutputPage::returnToMain()'s documentation 2009-12-20 15:08:26 +00:00
Aryeh Gregor
36f4e6822c Add DTD to fix well-formedness errors in HTML5
Now actually tested, using Python's SAX module.  You can verify that a
page is well-formed XML (or at least won't break in pywikipediabot) with
a program like this:

import xml.sax
class Myhandler(xml.sax.ContentHandler):
    pass
h = Myhandler()
xml.sax.parse("http://localhost/git-trunk/phase3/index.php?title=Special:UserLogin",
    h)

If the page is not well-formed, this will throw an exception.  It did
with the old doctype, but no longer does if $wgWellFormedXml == true.
2009-12-04 19:39:15 +00:00
Alexandre Emsenhuber
76f77d4d82 * (bug 21574) Redirects can now have "303 See Other" HTTP status
Based on a patch by denny vrandecic - http://bug-attachment.wikimedia.org/attachment.cgi?id=6805
2009-12-01 20:56:43 +00:00
Philip Tzou
303b2b745d follow-up r59522, r59523, r59527, r59529, r59530.
1. Only use Accept-Language when 301 redirection happens. It won't call the parser, but it is the most case we need to ensure it uncacheable.
2. Merge addXVOHeader with addVaryHeader.
2009-11-29 06:47:51 +00:00
Philip Tzou
46ee7b2639 bug 21672: Add Accept-Language to Vary and XVO headers to help Squid to determine user's perferred local language which has been eagerly wanted in Chinese Wikipedia. 2009-11-28 19:13:23 +00:00
Tim Starling
7688101426 Removed JS2 work (has been moved to the js2-work branch). Has been lightly tested, should mostly work. Some of the more complicated associated changes are listed below.
* Reverted HttpFunctions.php to r45549 and renamed wgSyncHTTPTimeout back to wgHTTPTimeout
* Edited out the asynchronous features from UploadFromUrl. Made fetchFile() use the curlCopy() function from new-upload r47811 instead of Http::doDownload(). Wrote my own URL validity check to avoid having to use either of the two buggy precedents.
* Removed UploadFromChunk
* Removed chunk upload and background status from ApiUpload.php
* Reverted r54669, use of addScriptClass()
* Left getHeadScripts() in its current location (OutputPage) instead of moving it back to SkinTemplate, just added wikibits.js to it to replace the removed addCoreScripts2Top()
2009-11-26 12:00:36 +00:00
Daniel Friesen
44309e7557 Add a wgCategories variable to the js variables so users don't need to do really ugly dom searching to see if a category is in the categorylinks box. 2009-11-19 00:37:00 +00:00
OverlordQ
a989843cd0 Code cleanup, covert leading spaces into tabs per coding style 2009-11-14 21:27:13 +00:00
Daniel Kinzler
8500fd8005 add a version attribute to the <html> tag if RDFa is used with HTML5 2009-11-13 21:58:39 +00:00
Aryeh Gregor
b70cc5b742 Upper-case DOCTYPE in HTML5 for well-formedness
Apparently <!doctype html> is a syntax error in XML; <!DOCTYPE html> is
required.  Now I know.  This broke Twinkle and probably lots of other stuff, so
it would be good to sync this ASAP.  Sorry for the error.
2009-11-12 03:11:56 +00:00
Michael Dale
e07680d900 (missing .= part) r58512#c4384 2009-11-07 09:26:02 +00:00