Commit graph

840 commits

Author SHA1 Message Date
Roan Kattouw
51b959dcdc (bug 27564) Timestamp of site module embedded in Squid-cached page HTML 2011-03-14 15:16:43 +00:00
Alexandre Emsenhuber
9834cbb559 Fix for r83698: pass the Title object to the skin so that we are sure to show the correct context 2011-03-13 11:24:27 +00:00
Happy-melon
3d161feebf Follow-up r83755: @deprecated @since is wrong, doesn't have the expected semantic meaning. 2011-03-12 18:14:33 +00:00
Alexandre Emsenhuber
08861c5638 Only call User::getSkin() when necessary.
(With this, a parser cache hit on action=render may not load the skin at all)
2011-03-11 14:31:12 +00:00
Happy-melon
0ebda6b3e4 Include MediaWiki:Noscript.css in <noscript></noscript> tags in the header, to allow wikis to load styles for users with JS disabled. 2011-03-05 16:01:25 +00:00
Happy-melon
1b39e95b17 Optionally disable including mediawiki.legacy (wikibits.js) module. 2011-03-03 21:40:14 +00:00
Alexandre Emsenhuber
477e6e0610 * (bug 27680) Fix for r82273: wgCanonicalSpecialPageName no longer false when requesting a special page with subpage parameter
The problem is that in this case $wgOut's Title object is not exactely the same $wgTitle because of line 600 of SpecialPage:
	$wgTitle = $page->getTitle();
which strips the subpage parameter. Now using SpecialPage::resolveAliasWithSubpage() so that it works in all cases.

Also PHP strikes again for not allowing SpecialPage::resolveAliasWithSubpage( $title->getDBkey() )[0] syntax. YAY :)
2011-02-25 11:48:14 +00:00
Sam Reed
9d5cfab4ea Fixup and add another return type 2011-02-21 17:12:33 +00:00
Roan Kattouw
977d20741b (bug 27468) Move private styles out to their own section, so they override everything except user styles. Moved from one makeResourceLoaderLink() call with array_merge() to multiple calls, because makeResourceLoaderLink() orders the modules, then groups them, so the input order is not preserved. Also fixed an issue in makeResourceLoaderLink() where the $uery variable was reused in each iteration but not cleared, allowing pollution to occur in theory (doesn't seem to have happened in practice, though). 2011-02-20 17:24:42 +00:00
Krinkle
b2378a694c Using the mw alias for mediaWiki in core. Saves bandwidth and makes sense (there's no point in a wrapper function for ($,mw) if we use jQuery and mediaWiki inside of it).
TODO: Since the alias is globally available from the start, the 'mw' argument in the wrapper is redundant, so that should be removed at some point as well.
2011-02-19 22:59:44 +00:00
Roan Kattouw
880f09b10c (bug 27302) Avoid unnecessary requests for user and site modules if the relevant wiki pages don't exist.
Done by adding isKnownEmpty() to ResourceLoaderModule and overriding it to check for page existence in ResourceLoaderWikiModule. Needed to rearrange some code in OutputPage::makeResourceLoaderLink() to have the emptiness check and dropping of modules work properly. Also factored the page_touched check in ResourceLoaderWikiModule::getModifiedTime() out to a separate method (getTitleMtimes()) and moved in-object caching there as well, so getModifiedTime() and isKnownEmpty() share code and caching for their timestamp/existence checks.

This does not account for the case where e.g. a user has user CSS but no user JS: I had implemented this by checking for $context->getOnly() in getTitleMtimes(), but then realized it's not safe to do this in a function called by getModifiedTime(): it causes the timestamp list in the startup module to only take scripts in account for wiki modules, because the startup module has &only=scripts set
2011-02-19 17:07:05 +00:00
Alexandre Emsenhuber
3f8df56044 We have already have a printable flag in the OutputPage object, so use it.
This was causing to have the printable version for every non-empty version of the printable paramter, instead of only for "yes".
2011-02-18 11:55:11 +00:00
Happy-melon
eb9cf4b00c Create a user.groups module in ResourceLoader, which bundles a CSS and JS page for each usergroup the user is a member of (MediaWiki:Sysop.js, MediaWiki:Autoconfirmed.css, etc). Groups '*' and 'user' are not included. 2011-02-16 19:54:02 +00:00
Happy-melon
ef6041d750 revert r82283, loads of unrelated changes 2011-02-16 19:51:25 +00:00
Happy-melon
d64cd26a7c Create a user.groups module in ResourceLoader, which bundles a CSS and JS page for each usergroup the user is a member of (MediaWiki:Sysop.js, MediaWiki:Autoconfirmed.css, etc). Groups '*' and 'user' are not included. 2011-02-16 19:49:37 +00:00
Alexandre Emsenhuber
4fe955e32b Moved Skin::makeGlobalVariablesScript() to OutputPage::getJSVars()
* merged <script> and if ( window.mediaWiki ) block with the one of mediaWiki.loader as stated in the doc
* removed dependency of $wgTitle
* the two only calls to this functions are in SemanticForms, but will not affect current version of MediaWiki:
** specials/SF_UploadWindow.php: this file is only used before 1.16
** specials/SF_UploadWindow2.php: the call is part of the else branch of a "method_exists( $wgOut, 'addModules' )" check, which means it's not called since 1.17
2011-02-16 18:25:44 +00:00
Sam Reed
fd8be135e7 Fix text description of OutputPage::getLanguageLinks(), it doesn't return 'fr' => 'Title', it returns 'fr:Title' 2011-02-16 10:28:24 +00:00
Roan Kattouw
33e5eadafb (bug 27302) Don't append the current timestamp for user/site modules when no user/site JS/CSS is present. Was caused by 1 being rounded down to 0, which is interpreted as 'now' by wfTimestamp(). This revision just drops timestamp rounding because it's not used consistently anyway 2011-02-16 07:19:33 +00:00
Rob Lanphier
a768182823 Followup to r69185, putting the "dir" attribute back on the HTML root element 2011-02-07 03:18:12 +00:00
Ilmari Karonen
6eb0ed9207 (bug 23315) Add new body classes to allow easier styling of special pages.
Also eliminate some duplicate code introduced into SpecialPage::headElement() in r61071 by calling Skin::getPageClasses() instead, and use $sk parameter instead of $wgUser->getSkin() to get skin name.
2011-02-06 21:08:48 +00:00
Alexandre Emsenhuber
5ce1ed2b1b * Changed all calls to wfMsgWikiHtml() in core
* Now replacing parameter before parsing where possible
* Used 'parseinline' for 'nosuchuser' message in Special:Userlogin for consistency with other error messages
2011-02-06 12:38:33 +00:00
Alexandre Emsenhuber
42628c0dbc Easier to use addWikiText() in wrapWikiMsg() 2011-02-05 20:15:49 +00:00
Happy-melon
da36f65433 Follow-up r64670 (bug22929): cleaner implementation of security for script (and potentially CSS) files. ResourceLoader *already* knows where each module has come from, so all we need to do is filter them in OutputPage according to the desired level of 'trustworthiness'.
TODO:
* Are there instances where we might want to restrict CSS as well as JS?
* Would a $wg config option and/or user preference and/or index.php GET parameter to limit inclusion be useful?
* Can we deprecate any of the existing $wg config options?
* What's going on with the duplicated code between OutputPage and SkinTemplate?
2011-02-04 16:39:17 +00:00
Daniel Friesen
3d220be8d6 Completely remove support for legacy style skins. All legacy skinning options are now part of a SkinLegacy/LegacySkinTemplate pair that inherits from the normal SkinTemplate setup. Also ported our three built in skins to use the new legacy classes. ( ;) if you want to kill legacy skins now, you only have to svn rm 4 files) 2011-02-04 04:18:05 +00:00
Happy-melon
e6e9b4ea20 Follow-up r79682: more documentation tidying 2011-02-02 11:00:09 +00:00
Krinkle
d11bf6b0e0 fixing php Parse error: syntax error from r81169 2011-01-28 23:31:01 +00:00
Platonides
855ddbed7b Follow up r81100. Don't hardcode hiddencat quotes, per r80936 CR. 2011-01-28 22:17:01 +00:00
OverlordQ
5a107a02d4 Followup r81067, use the right syntax for doing a join 2011-01-27 20:25:37 +00:00
Sam Reed
728dc12f64 Fixup query fail from r80936 2011-01-26 23:13:20 +00:00
Sam Reed
13c42dc573 Couple more raw SQL to query arrays 2011-01-24 23:15:10 +00:00
Brion Vibber
cb3d7eb63d * (bug 26861) avoid warning in OutputPage::addVaryHeader when $options param is null
This should coerce nulls to empty arrays to make them play a little nicer.

Also added a doc comment that the format and contents of the $option parameter need to be described in some way; judging by the below getXVO() function they're used to produce the X-Vary-Options header along with the vary cookie settings, but offhand wouldn't know what acceptable options are or how to look them up (X-Vary-Options is something we made up as an extension for our patched Squid servers, so there's no public standard like the HTTP RFCs to look it up in.)
2011-01-22 16:59:01 +00:00
Niklas Laxström
abe4a1b3b5 Follow-up r80192, tweak docs 2011-01-14 07:54:28 +00:00
Daniel Friesen
aeb8395e6d Followup r80192 which had an unclosed comment causing some php notices resulting from hidden var statements. 2011-01-13 22:20:04 +00:00
Sam Reed
5c77ea3df9 Fixing up spaces to tabs in r80192
Removing trailing whitespace
2011-01-13 22:08:13 +00:00
Antoine Musso
a7fd3952b1 OutputPage properties documentation
This is following a pair session with Zak Greant on november 12th 2010.
Please review, ammend and commit your changes if you have anything useful
to add.
Please note you will find some humoristics quotes.
2011-01-13 21:08:59 +00:00
Roan Kattouw
e707877912 Followup r80003: array_unique() preserves keys, so we got module arrays that looked like {"0": "ext.liquidThreads", "58": "mediawiki.legacy.wikibits", "59": "mediawiki.util", ... } . To prevent this from happening, use array_values() to reindex the arrays 2011-01-11 13:51:49 +00:00
Roan Kattouw
489281060b Apply array_unique() to module lists in OutputPage, should prevent lots of duplicate 'ext.liquidThreads' elements in the module array reported by thedj 2011-01-11 13:41:40 +00:00
Niklas Laxström
eba61fa159 * (bug 25506) Exception is thrown if OutputPage::parse is called inside a tag hook, which would reset parser state 2011-01-09 12:46:40 +00:00
Roan Kattouw
fb80a53b1b (bug 26497) printable=yes and handheld=yes request parameters were broken. Fixed this in a bit of an ugly way, by propagating these parameters to load.php and running OutputPage::transformCssMedia() on it there. This revision also fixes the fact that ResourceLoader ignored $wgHandheldForIPhone, and no longer wraps styles in @media all { } because it's useless and breaks @import (which can't be used inside @media ; this is bug 26478) 2011-01-07 20:22:50 +00:00
Happy-melon
128f33aa5e More ancient deprecated functions:
* OutputPage::setParserOptions() - 1.6 (r12183)
* OutputPage::addPrimaryWikitext() - 1.10 (r19095)
* OutputPage::addSecondaryWikiText() - 1.10 (r19520)
* OutputPage::tryParserCache() - 1.16 (r52888)
* OutputPage::reportTime() - 1.6 (r11117)
* OutputPage::<various error pages> - 1.7 (r14631)
2011-01-06 20:40:42 +00:00
Roan Kattouw
c53ccc605f Fix bug 26570 (user CSS preview broken) and bug 26555 (styles added with $out->addStyle() are loaded after site/user CSS)
Did this by moving RL <link> generation from getHeadLinks() to buildCssLinks() (Trevor did this earlier), but did it right this time:
* Updated callers for buildCssLinks() parameter list change so stuff doesn't explode
* Considered making buildCssLinks() tolerant of a missing $sk parameter, but decided against this: it's not used in SVN extensions anywhere
* Changed addInlineStyle() to add styles to $this->mInlineStyles instead of $this->mScripts. This unbreaks addInlineStyle(), which was used for CSS previews
* Added styles added through addStyle()/addInlineStyle() in the right place (right after normal RL styles)
2011-01-06 16:58:29 +00:00
Alexandre Emsenhuber
1e22a9dbde Allow OutputPage::parse() to parse in any langauge, modified wfMsgExt() and wfMessage() accordingly 2011-01-05 12:24:39 +00:00
Alexandre Emsenhuber
903a3752fd Use isArticleRelated() instead of checking if $wgArticle is set 2011-01-04 14:49:08 +00:00
Tim Starling
ccfe5ad97b Fix for bug 26561: clickjacking attacks. See the bug report for full documentation. 2011-01-04 06:12:33 +00:00
Krinkle
a987ea008e Reverting r78889 and r78865. Breaks changeslist on translatewiki (unpatrolled-flag exclamation mark popping up on page histories and and diff-views where they shouldn't instead of an 'm' for minor)
-  = ChangesList::flag( 'minor' );
- The jquery effects plugin and collapsible implementation, also in those commits, are redundant now.
- If/when skins.commons is needed again, we can simply add that part back in.
- (r78891 is not reverted because the file it altered was deleted while r78865 was -merged)
2010-12-25 00:29:41 +00:00
Roan Kattouw
b2a808d87b Really fix bug 26131: just putting the site+user <link> at the bottom of the <head> isn't good enough if the client-side loader is gonna add dynamically populated <style> tags below it later, so we need those dynamic <style> tags to go before the site+user <link> but after the skin <link>. Make OutputPage insert a <meta> tag between these two, marking the spot for the client side load which inserts dynamic <style> tags above this <meta> tag rather than at the end of the <head> 2010-12-24 01:22:11 +00:00
Roan Kattouw
2919e59281 Followup r78933: reapply r78802 2010-12-23 23:28:12 +00:00
Roan Kattouw
a3bc558367 Revert r78023 and its follow-up r78802: change seems to have been made for somewhat cosmetic reasons ("it makes more sense for this to be here rather than there") and breaks stuff. Will reapply typo fix from r78802 in next commit 2010-12-23 23:26:10 +00:00
Happy-melon
023debde16 (bug 17456) implement CollapsibleTables in core javascript. Using ResourceLoader/jQuery, this is now able to replace not only the ubiquitous collapsible tables in articles ([[mw:Manual:Collapsible tables]]), but also most of the other places we collapse things as well, like the enhanced Watchlist/RecentChanges feed. 2010-12-23 00:06:58 +00:00
Sam Reed
e15ffb8001 Followup r78023, change usage of $style to $styles, not introduced in this revision, but was moved by it 2010-12-22 16:16:12 +00:00