Commit graph

45 commits

Author SHA1 Message Date
Timo Tijhof 29e7a9193d Don't load legacy gadget scripts
The time has come to stop supporting legacy gadgets that haven't
migrated to ResourceLoader yet.

For many Gadgets, migrating to ResourceLoader will be as easy
as adding "[ResourceLoader]" to its definition on MediaWiki:Gadgets-definition.

However for older gadgets, they may need more maintenance. Though
similarly they may've already been malfunctioning silently.

The most common techniques used by legacy scripts, and what their
equivalents are in modern JavaScript, see:
<https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_(users)>

Ref T107399.

Change-Id: Ia5f7323a40a28541515ef3a3f5079f1cc940f392
2015-08-07 01:00:40 +00:00
Kunal Mehta e858bda308 Add abstract GadgetRepo and MediaWikiGadgetsDefinition implementation
GadgetRepo is an abstract class based off of the implementation in the
RL2 branch.

It is a singleton that provides basic methods to construct and interact
with Gadget objects.

The MediaWikiGadgetsDefinition class is an implementation of GadgetsRepo
that parses the "MediaWiki:Gadgets-definition" page for gadget
definitions.

Tests were left in place to demonstrate that no functional changes have
been made aside from relocation of code. Some tests should be moved to
separate files in the future.

Bug: T106176
Change-Id: I3e802889f6f495783f4dbac65c2a8cefa824a778
2015-08-01 15:10:07 -07:00
Thiemo Mättig 5b1f8a1e50 Update api module constructors
This also replaces a deprecated function and adds some code docs.

Change-Id: I22c77d370469c10cad5d504b06280e933eeeeeff
2015-06-17 20:42:20 +02:00
umherirrender 6c25618f55 Replace deprecated $wgSpecialPageGroups
$wgSpecialPageGroups is deprecated since 1.21
override SpecialPage::getGroupName instead

Change-Id: I3fe4906a422fdf7f6d8ba51b39b7f45c01c3d772
2015-05-15 21:55:50 +02:00
umherirrender 76eafe0cfe Escape message parentheses on Special:Gadgets
Bug: T85864
Change-Id: Ibcc4713a84f294e5bf7daa139e36e2dc98903d88
2015-02-07 14:31:19 +01:00
Kunal Mehta 7be53a9aec Replace usage of SpecialPage::getTitle with getPageTitle
Was deprecated in 1.23, see Icdcf5d5295ef5e7f08b1d403e0c123f78738fd40

Change-Id: I7a6bc726325fb467826abe625b58cce55940293d
2013-12-26 22:59:19 -08:00
Siebrand Mazeland 31d5b9a186 Replace remaining deprecated wfMsg calls.
Change-Id: I126968cc09a75bb72987a035e9435dab5e854a35
2012-09-18 00:26:39 +00:00
Reedy 89e1db68bf Die globals, die!
Change-Id: I43f525d860034e844a8ef7caee589e9dca6d4dbe
2012-07-12 09:48:32 -04:00
umherirrender 283d800cbc Show 'viewsource' when user is not allow to edit gadgets
Using viewsource on Special:Gadgets allows non sysop to find the source

Change-Id: Ia5e50372b477e0d55ffa34a67e955518c2016103
2012-05-18 11:49:15 +02:00
Sam Reed df866a5f21 Documentation, code updates, removal of direct member variable access 2012-02-17 21:23:46 +00:00
Liangent f0f203bbba Followup r100509: Don't validate skin names written in the definition page. 2012-01-18 02:44:37 +00:00
Liangent b9aa1fea37 (bug 31414) Skin specific gadgets 2011-10-22 19:09:25 +00:00
Liangent 2c2a44005a Display friendly names of rights on Special:Gadgets 2011-10-20 13:48:06 +00:00
Siebrand Mazeland 76b26174eb stylize.php, update whitespace, remove superfluous comment lines
update indentation and sprinkle some braces.
2011-09-23 06:48:37 +00:00
Max Semenik eb32b8f436 Bug 29362 - Templates are not exported with gadgets 2011-06-13 18:37:21 +00:00
Max Semenik dbc8ef531f Bug 13742 - Allow for gadgets to be turned on by default.
Because I'm lazy to do everything twice, README now points to on-wiki docs for definition format.
2011-04-12 18:09:50 +00:00
Max Semenik 1566407b27 Gadgets: bug 12211 - show in preferences only gadgets the user is able to use 2011-04-03 19:01:52 +00:00
Sam Reed ae659dac2c Fix bug 27251 "GET" in <form method="GET" should be in lowercase 2011-02-08 13:39:50 +00:00
Max Semenik 66a0821cb7 Merged branches/Gadgets-work/ to trunk. It now uses ResourceLoader (scripts must be explicitly marked as supporting it to be loaded this way), and in process I've completely rewritten its internal organisation in OOP style. Documentation commits will follow. 2010-11-11 18:19:57 +00:00
Max Semenik 13ef1f3ba4 Follow-up r70719: prettified gadget export link 2010-09-16 17:28:21 +00:00
Chad Horohoe 25e94b039a More php4 constructors. Missed these somehow 2010-08-30 17:18:13 +00:00
Sam Reed cbe0ee71a5 Remove unused variables (mainly globals)
Add some braces

Change $dbw to $db in one case
2010-08-19 11:53:41 +00:00
Max Semenik 9c360c1e94 Follow-up r70719 and r70721: on the second thought, this permission reflects my previous design, where gadget export page was much more computation-heave. It's not needed. 2010-08-08 19:01:28 +00:00
Max Semenik b0004f78c9 Gadgets: added export feature for easier reuse 2010-08-08 18:22:22 +00:00
Sam Reed 17b8d3ccdb More wrong static method calls fixed 2010-07-26 13:30:31 +00:00
Niklas Laxström 2bff01ac5c i18n fix 2010-07-08 08:13:03 +00:00
Alexandre Emsenhuber d0cbc88d98 Big changes to extensions' documentation:
* changed all @addtogroup to @ingroup
* added some @file where needed
* changed some @package/@subpackage to @ingroup
2010-06-06 15:12:22 +00:00
Aryeh Gregor d0d3d059b5 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
Chad Horohoe 7464a94254 Revert r66934 (Removing wfLoadExtensionMessages() from everything). I disagree on principle...we branch extensions for this very reason. But people want trunk extensions compatible for several versions back, meh. 2010-05-27 15:56:53 +00:00
Chad Horohoe 16fa29f47e Large commit. Removed 800+ references to no-op wfLoadExtensionMessages() 2010-05-26 22:25:32 +00:00
Raimond Spekking 87333c0daa * Show [edit] links for users with editinterface right only
* While I am at it: Use Xml::/Html:: functions, commaList() and link() instead of deprecated functions
2010-01-12 19:45:49 +00:00
Brion Vibber 34bcf4f528 Revert r48479 "(bug 13287) Edit links don't work as expected. Removed the edit links entirely. We already link to the pages anyway and the edit links were causing UI clutter."
Removing the links to edit the UI messages means it's necessary to dig around and guess at names to update the gadget descriptions. IMHO this is pretty terrible, and definitely a step backwards in usability.
2009-03-17 21:49:13 +00:00
Chad Horohoe b8f635e5ed (bug 13287) Edit links don't work as expected. Removed the edit links entirely. We already link to the pages anyway and the edit links were causing UI clutter. 2009-03-17 04:21:54 +00:00
Raimond Spekking aca97f0e23 Replaced some hardcoded colons with the colon-separator message 2009-01-07 22:49:54 +00:00
Siebrand Mazeland c6b911e0f9 Consistent casing for addHTML() 2008-11-06 22:20:29 +00:00
Daniel Kinzler e6010c67cc better support for on-wiki i18n 2008-08-17 15:42:26 +00:00
Brion Vibber 740da4c34d Revert r37263 for now:
* (bug 12211) Show some gadgets only for admins
	* (bug 13742) Allow for gadgets to be turned on by default

I'm a bit leery of the 'on by default' entirely at the moment. :)

A few comments:
* The readme examples don't seem to clearly show the option format
* Why are numeric constants being used as indexes to the option array? Strings are easier to work with and debug.
* There's a lot of stuff like this which feels very ugly:
	if( isset( $gadget->options[Gadget::RIGHTS] ) && !empty( $gadget->options[Gadget::RIGHTS] ) ) {
  Since it's all hard-coded anyway, why not just do something nice and clear like this?
	if( !empty( $gadget->rights ) ) {
* And this:
    if( wfGadgetAllowed( $gadget->options ) ) {
  to:
    if( $gadget->isAllowed() ) {
2008-07-07 18:50:47 +00:00
Victor Vasiliev a1e40d79c1 * (bug 12211) Show some gadgets only for admins
* (bug 13742) Allow for gadgets to be turned on by default
Modified patch by MaxSem
2008-07-07 16:54:20 +00:00
Chad Horohoe 998fb3f46f Bug 13287 - if you say "edit this page," it makes sense to take them to action=edit. 2008-07-01 22:17:43 +00:00
Siebrand Mazeland 7ddb99d3f1 Some improved XHTML compliancy here and there ('<[bB][rR][/]>' -> '<br />') 2008-03-01 14:29:01 +00:00
Siebrand Mazeland d4c4059ac5 * Gadgets uses wfLoadExtensionMessages now
* delay special page message loading a tiny bit
* add descriptionmsg and version in extension credits
* update Translate
2008-02-04 08:40:17 +00:00
Siebrand Mazeland 29813fc87a Whitespace fixes 2008-02-04 08:08:43 +00:00
Brion Vibber 10743c94f9 Must call setHeaders() from execute() so non-monobook skins don't explode.
note -- this sucks, we need to make that not be required. :)
2008-01-14 22:46:14 +00:00
Brion Vibber 48f36695b5 Cleanup:
* Use message prefixes to keep namespaces clean: 'gadget-' for gadget name and code, 'gadget-section-' for gadget sections
* Make link behavior consistent with capitallinks off
* Put headings outside the list in Special:Gadgets
* Some general code cleanup (ditch references, etc)
2007-11-16 20:13:25 +00:00
Daniel Kinzler 724a7b85d9 Gadgets extension: enable JS based gadgets via user preferences 2007-07-31 10:21:34 +00:00