Commit graph

1175 commits

Author SHA1 Message Date
jenkins-bot
8cabb5f777 Merge "Make TOC hideable" 2013-10-24 19:22:32 +00:00
Tim Starling
d1bc243f65 Remove all instances of the word "iff"
It's elitist mathematical jargon. In all cases dealt with here, it adds
no additional meaning compared to "if", beyond what was already obvious
from context. Thus, its only purpose is to smugly demonstrate that the
author attended their second-year mathematics classes, at the expense of
causing confusion for everyone who doesn't have such a background.

If you really think you need to convey extra information beyond what
"if" gives you, the English language contains plenty of devices for doing
so, without resorting to neologisms.

Change-Id: Iae21095d02ec2935c10e94f532235c2671c115b1
2013-10-23 10:56:54 -07:00
Max Semenik
21c1c7d025 Make TOC hideable
Currently, if an extension doesn't want a TOC, it has to remove it manually.
This change wraps the TOC in markers that make it easy to remove it in ParserOutput
on demand without fragmenting the parser cache with stuff like "use/not use TOC".

Change-Id: I2889bcb9eb999c9049601e92440132118e1a8a41
2013-10-18 17:47:47 +04:00
Ori Livneh
8920372686 OutputPage->getJSVars: Maintain symmetry between JS & PHP vars
The function is more difficult to read than it need be by dint of some things
two names. I can't be the only one who finds 'wgCurRevisionId' => $latestRevID
ugly, right? Anyhow, lots of JS code depends on the JS variable names, whereas
the PHP variables exist only in the scope of that method, so it's clear that
it's the PHP names that should be brought in line.

Change-Id: Ibddd5d2fc8d75e0ade18ff3433714d52605f2911
2013-09-27 11:42:03 +02:00
jenkins-bot
123d4122c8 Merge "Add wgRevisionId variable to ResourceLoader" 2013-09-26 02:43:26 +00:00
csteipp
365137e704 Vary on forceHTTPS cookie
Varnish seems to be returning the cached version of pages for users
after they have logged in over https, but access an http page. This
seems to occure because only the forceHTTPS cookie is sent on the
request, but varnish doesn't vary the cache based on that cookie.

Bug: 54513
Change-Id: Ia97ed80622191669ee5ca37af809d307bbdb61ae
2013-09-25 15:42:02 -07:00
parent5446
7fa7b71eb3 Add wgRevisionId variable to ResourceLoader
mw.config provides wgCurRevisionId, which has the latest
revision number. This adds wgRevisionId, which indicates
the revision number currently being viewed. This is useful
when looking at old revisions.

Bug: 51594
Change-Id: Ie0d00f3a9a8af8533ab28204b5bb483a0092c710
2013-09-24 19:34:42 -04:00
MatmaRex
250caa19a0 Remove 'mediawiki.legacy.wikiprintable' module
It's a relic of simpler times, no longer used by any core skin. The
'mediawiki.legacy.commonPrint' module can be used instead.
(SkinTemplate-based skins do it automatically.)

* The 'mediawiki.legacy.wikiprintable' module has been removed.
* The skins/common/wikiprintable.css file has been deleted.
* Skin#commonPrintStylesheet has been deprecated; its return value is
  ignored.

Dependency: I96e66ff8905416bea906d40cdd72ba646399191b
Change-Id: Icbcebc8f539f7786d037b717d262684e9931aca6
2013-09-16 17:31:58 +00:00
jenkins-bot
edb4ed713c Merge "No spaces after (casts)" 2013-09-04 18:14:05 +00:00
MatmaRex
df8ec1e216 No spaces after (casts)
Also removed some unnecessary ones. I think I've caught them all.

The spaceless version already appears in core ~300 times (after
accounting for false positives when grepping). Some consistency would
be nice.

Change-Id: I607655b5f4366e66dc78730d5fd2f57ed8776cae
2013-09-04 20:05:43 +02:00
Matthew Flaschen
ab44291204 Remove dead code
Accidentally left in dabbbc7d2a

Change-Id: I58e65ca7ad23d00992f66f3bcee879e662b62ef0
2013-08-31 01:57:33 -04:00
Timo Tijhof
7627cf6175 mw.config: Add wgIsRedirect
Change-Id: I6e365f20b513ded10ede51d4b34de0736653a3dc
2013-07-23 21:11:31 +02:00
Matthew Flaschen
0bbc358951 Add wgIsProbablyEditable for editability based on quickUserCan.
It uses quickUserCan like SkinTemplate, for performance reasons.

Bug: 43790
Change-Id: I2f77b69624cc1a4cd74c8178eea53681f3f2b107
2013-07-04 05:18:49 +00:00
Liangent
423f550009 Fix various language tags used in Html attribs to use wfBCP47()
Change-Id: I823ffacf5a55e53d6ab5383c1a42a9199d56f11d
2013-06-30 17:37:12 +00:00
Brion VIBBER
b2f25fe60d Merge "Kill <meta name="keywords" content="..."> in a blazing fire." 2013-06-10 15:53:15 +00:00
Alex Monk
ce4bcce3b7 Merge "Followup mistake in I82711cee" 2013-06-10 15:13:16 +00:00
Daniel Friesen
f1d2386af2 Kill <meta name="keywords" content="..."> in a blazing fire.
meta-keywords is completely and totally useless. It has absolutely no effect
on search engine and no-one uses it anymore. Time to euthanize it.

There isn't a single user of OutputPage::addKeywords inside any extension
inside of Gerrit. So I'm just deleting this method without a deprecation.

Change-Id: I188755521dcde3a9e191975d1ae3cabf7a5d67cd
2013-06-08 06:30:54 -07:00
Daniel Friesen
a4ce59a4a0 Followup If21705c2, Shorten remaining urls to the whatwg HTML spec.
Finish up with the /specs/web-apps/current-work/multipage/ urls that
haven't been updated to /html/.

Change-Id: I4dbee0477eea440b0e8f113b1d393c6e0c739c4c
2013-06-08 04:48:01 -07:00
Daniel Friesen
49677c4ca9 Followup mistake in I82711cee
Can't believe the fact the @deprecated has the wrong version number
made it through our review process.

Change-Id: If9beea75bb909484b242c1c4cb787fef8f6501d3
2013-06-08 04:02:49 -07:00
MatmaRex
1965df8df3 Remove the $wgHandheldForIPhone config variable entirely
It only really made sense in pair with $wgHandheldStyle, and that has
been removed in Ia8d79b4a.

Remove irrelevant tests, adjust still relevant ones.

Change-Id: I7c24128f7b148d0244538ad95bb60bf09ec4b5cb
2013-06-04 21:53:47 +02:00
jrobson
aa015eba26 Give skin more control of OutputPage modules
Remove addDefaultModules from OutputPage
Instead only enforce mediawiki.page.startup

Add a method getDefaultModules which groups modules
by type allowing a skin to tweak

Change-Id: I89d529f0378d90af0fe0a5adea5d5dbdca83a86e
2013-05-28 16:50:49 +00:00
Daniel Friesen
072d516848 Deprecate OutputPage::out.
OutputPage is supposed to be a container for output. It should NOT be used as a replacement for echo.

Only one seemingly unmaintained extension uses this method.
This method is deprecated now and should be removed in the next release.

Change-Id: I82711cee7204604a47cfbb5e4496b4cc737a837c
2013-05-17 15:08:54 +00:00
Daniel Friesen
a57e1da5da OutputPage: Move our <meta charset="...> so it's placed above the title
It's recommended for the meta charset to be placed before the <title> since
<title> contains text which is inside the character set defined by the meta charset.

Use of meta charset inside XHTML also seems to be redundant, not recommended,
and is very likely completely ignored.

Change-Id: I335b0598a9615540dc5e917682508b4a8d32d96e
2013-05-16 22:57:42 -07:00
Daniel Friesen
97caae596d Drop support for XHTML 1.0
* $wgHtml5 = false; is now ignored completely.
* $wgDocType and $wgDTD have been removed.
* $wgXhtmlDefaultNamespace is now ignored.
* XHTML5 will be output if $wgMimeType is set to an XML mime type (according to HTML5's rules).
* For backwards compatibility with extensions $wgHtml5 and $wgXhtmlDefaultNamespace are set
  in Setup.php but depending on them is deprecated.

Change-Id: Iad9634e2ee420b5a3bbffe550421fde4fa1819b0
2013-05-15 23:09:25 -07:00
Timo Tijhof
1bd0d43f7f OutputPage: Guard jQuery.ready() against absence of jQuery
We already wrap usage of global "mediaWiki" in a condition
for window.mw (see method
ResourceLoader::makeLoaderConditionalScript) because:
1) The startup module blacklists certain
   browsers in which we won't load jquery+mediawiki.
2) It might have failed to load (for whatever reason).

Adding guard for window.jQuery for the same reasons.

Follows-up Ic3d0c937268d09, which caused a TypeError
'ready of undefined not a function' in browsers where
jquery+mediawiki isn't loaded by the startup module.

Change-Id: I9dcd8d347c6b00efe207d031a480e5b85bf78936
2013-05-14 23:09:57 +02:00
Alexandre Emsenhuber
7053baca03 Remove "will be removed in ..." comments
All of them are wrong, since 1.20 is out for a while now, and
these methods are still here.

Change-Id: I3b59b61490c9aea5252e25623b0b282295dcc3f6
2013-05-11 22:04:21 +02:00
umherirrender
cbc4fd7a5b print is not a function
Removed parenthesis after print

Change-Id: I1343872de7aa7c64952a3d86a63aaa091e46bda3
2013-05-09 20:06:03 +02:00
jenkins-bot
9cc02e7087 Merge "mw.config: Add wgPageContentModel for content model of current page" 2013-05-07 20:53:20 +00:00
umherirrender
7ced06d8d8 mw.config: Add wgPageContentModel for content model of current page
This field of the page table can be useful to determine the
corrosponding model for a page.

Change-Id: I0525ad764540b213b2697e1e9e64f7da73f6cf83
2013-05-07 20:34:11 +00:00
kaldari
bc34b5867a Adding GetNewMessagesAlert hook and wgUserNewMsgRevisionId JS global
This hook allows extensions to disable or modify the new messages
alert ('orange bar of doom') while still allowing the user_newtalk
table to be updated.

The wgUserNewMsgRevisionId JS global allows gadgets and extensions
to create their own new message alerts on the client side.

I also threw in a few comment updates for good measure!

See also Echo change I3f35a56b which utilizes this.

Bug: 47962
Change-Id: I2105bdd2bcd5b27f6f36ec8d8fa7fa99d60a2d82
2013-05-04 20:21:41 -07:00
MatmaRex
e60f36bc03 Clean up the class building logic in OutputPage
Build the classes using an array that is finally imploded, instead of
concatenating strings repeatedly.

Change-Id: I2a09282d5ba33f131a4311c58e49dab5eefce418
2013-04-30 07:45:08 +02:00
Timo Tijhof
0a000d5cf4 Call jQuery.ready() before </body>
mw.loader defaults to async=false. Overridden when $.isReady=true
or a mw.loader call sets async=true.

The problem is in calls to mw.loader.load that are not in
the HTML output but occur *before* the DOMContentReady event.

In those cases we want to use async (creating a script tag)
instead of synchronous (document.write) because in Firefox
DOMContentReady is emitted some time after it is no longer safe
to use document.write (bug 47457).

This also optimises the dom ready event cross-browser.

Bug: 34542
Bug: 47457
Change-Id: Ic3d0c937268d0943d2f770f3ca18bcf4e1eed346
2013-04-29 21:47:24 +02:00
daniel
8e7150b549 (bug 45535) Hook for changing language links.
This adds a new hook called LanguageLinks which is called
whenever a list of language links is returned to the user.
This gives extensions the option to manipulate the links
on the fly.

Note that this change only covers the language links used
in OutputPage and by ApiParse. Adapting ApiQueryLangLinks is
left as a follow-up task.

As explained on bugzilla, this is a precondition to
allowing Wikibase/Wikidata to update languagelinks without
forcing a (redundant) re-parse of the page content.

This change also introduces the notion of link flags that
can be used to associate flags with language links. This
will be integrated with ParserOutput and OutputPage in a
follow-up.

Change-Id: Iaec0faa131413a291fc8f77496e4f371addb3b99
2013-04-29 09:13:47 -04:00
umherirrender
c0d61543b2 Pass array to Title::getLocalURL instead of an urlencoded string
This makes code easier to read and the urlencode is done inside
getLocalURL or friends

Change-Id: I21b988890356d11835eedba12a90a347bf0905b2
2013-04-27 08:22:01 +00:00
umherirrender
dbd0b590e9 else if -> elseif
Also fixed some spacing while at it
Added some braces for one line statements

Change-Id: Iebfa2b17091509daabc76248121c7763e2295d20
2013-04-17 16:52:47 +02:00
Aaron Schulz
3082af5472 Account for $wgSquidMaxage in OutputPage::checkLastModified().
* This deals with the fact that seldom edited pages can end up cached
  with very stale resource (JS/CSS) references since the response to
  IMS GET requests will be 304 Not Modified if page_touched is ancient.
  When squid revalidates its stale cache it will keep getting 304s and
  renewing the TTL on the stale cache.

Bug: 44570
Change-Id: I3889f300012aeabd37e228653279ad19b296e4ae
2013-04-16 06:53:10 +00:00
umherirrender
97234cc884 Added spaces before and removed spaces after 'array'
Fix some other spacing while at it

Change-Id: I13f81533eaf40e06c13cf377c0f08ef5cef01d00
2013-04-14 21:57:46 +02:00
Timo Tijhof
6cbad437fa OutputPage: Set empty modules to state 'ready' instead of 'missing'.
Some cases were already covered by I595b3af190, but in the case
where the module is disabled entirely it was setting it to missing.

This is inconsistent with the behaviour of load.php (which will implement
an empty module resulting in state=ready) and confusing as it
implies there is a problem (a missing module) whereas in fact it
isn't a problem. Modules that depend on it to allow customization
wouldn't load as it will fail on missing dependencies.

Also makes asserting problems (bug 44299) hard as it would have
to whitelist state 'missing' for user/site/user.groups.

Bug: 46857
Change-Id: I46b5bc6f714abe4b66186d7b7a14c69195f00ee1
2013-04-03 22:51:22 +02:00
Trevor Parscal
bc9e97cd3f Merge "Add RL targets support to OutputPage" 2013-03-30 00:13:16 +00:00
Matthew Flaschen
dabbbc7d2a Remove rel="next" that accompanied returnto.
Removed rel="next" link that was put on every
page that had a returnto because otherwise
Firefox (and possibly others) might prefetch
the page, which is not desired in returnto
situations.

Bug: 46680
Change-Id: Ifaf40c663dc25e51bffc317144d9bdc1dab21785
2013-03-29 20:20:50 +00:00
Max Semenik
990cb75cc4 Add RL targets support to OutputPage
The target URI parameter is already used by ResourceLoaderStartUpModule
to filter modules, this change introduces the ability to produce
mobile-aware load.php links in the core and filter out modules not suitable
for current target.

Change-Id: Ie03990e11d9a0ac8cd81dd0aae5c5a95f1d23e81
2013-03-27 20:35:01 +04:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls

Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"

Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
2013-03-13 03:42:41 -04:00
jenkins-bot
6114f05fc1 Merge "Correct case of Title::getPrefixedDBkey() calls" 2013-03-12 15:13:21 +00:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Alexandre Emsenhuber
cd4dd7ca85 Correct case of Title::getPrefixedDBkey() calls
Change-Id: Ic9ef0cc6dbb0a8eb0ee93432299ef59759223e2c
2013-03-09 21:14:22 +01:00
umherirrender
55183ad0b2 Use ContextSource::getLanguage instead of $wgLang
Found two places, where $wgLang is used inside a ContextSource.

Change-Id: I1881a20d3cd9b50eb4af0cd588451ed941f936fa
2013-03-09 17:02:44 +01:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
jenkins-bot
6fedebf971 Merge "Improve documentation for OutputPage->addModuleStyles" 2013-03-01 21:26:21 +00:00
Matthew Flaschen
7d55a773f3 Improve documentation for OutputPage->addModuleStyles
Change-Id: I56392cdb4e0d9fd5cac15ac947962364ae96381f
2013-02-27 03:42:45 -05:00