Commit graph

37230 commits

Author SHA1 Message Date
Roan Kattouw
a2afc812ca Make mw.user.options and mw.user.tokens work in debug mode in IE. Now that mw.user is a separate module, we have to make these depend on that and make sure dependencies are actually processed.
* Make ResourceLoaderUserOptionsModule and ResourceLoaderUserTokensModule depend on mw.user
* Load mw.user.{tokens,options,groups} load as TYPE_COMBINED instead of TYPE_SCRIPT. The latter wouldn't wrap the code in mw.loader.implement()
** ...but make sure 'user' (user scripts) is excluded, that one needs to not be wrapped in a closure
* Make TYPE_COMBINED actually work in makeResourceLoaderLink()
* Add a comment in makeModuleResponse() to explain what the weird is_array( $scripts ) stuff is all about
* Add FIXME about how mw.user.options should split off the CSS part into a separate module
2011-07-28 05:48:57 +00:00
Krinkle
62a3e10fea AjaxCategories rewrite:
Solving syntax problems, performance improvements and applying code conventions: 

* Replaced sprite image with separate images and letting ResourceLoader embed them with @embed (@embed means 0 http requests, less maintenance, none of the known limitations with sprites, and more readable code (named files rather than pixel offsets)

* Many functions were floating in the global namespace (like window.makeCaseInsensitive). A statement ends after a semi-colon(;). All functions declared after "catUrl" were assigned to the window object. I've instead turned the semi-colons back into comma's, merged some other var statements and moved them to the top of the closure. Changed local function declarations into function expressions for clarity.

* fetchSuggestions is called by $.fn.suggestions like ".call( $textbox, $textbox.val() )". So the context (this) isn't the raw element but the jQuery object, no need to re-construct with "$(this)" or "$(that)" which is slow and shouldn't even work. jQuery methods can be called on it directly. I've also replaced "$(this).val()" with the value-argument passed to fetchSuggestions which has this exact value already.

* Adding more function documentation. And changing @since to 1.19 as this was merged from js2-branch into 1.19-trunk and new features aren't backported to 1.18.

* Optimizing options/default construction to just "options = $.extend( {}, options )". Caching defaultOptions is cool, but doesn't really work if it's in a context/instance local variable. Moved it up to the module closure var statements, now it's static across all instances.

* In makeSuggestionBox(): Fixing invalid html fragments passed to jQuery that fail in IE. Shortcuts (like '<foo>' and '<foo/>') are only allowed for createElement triggers, not when creating longer fragments with content and/or attributes which are created through innerHTML, in the latter case the HTML must be completely valid and is not auto-corrected by IE.

* Using more jQuery chaining where possible.

* In buildRegex(): Using $.map with join( '|' ), (rather than $.each with += '|'; and substr).

* Storing the init instance of mw.ajaxCategories in mw.page for reference (rather than local/anonymous).

* Applied some best practices and "write testable code"
** Moved some of the functions created on the fly and assigned to 'this' into prototype (reference is cheaper)
** Making sure at least all 'do', 'set' and/or 'prototype' functions have a return value. Even if it's just a simple boolean true or context/this for chain-ability. 
** Rewrote confirmEdit( .., .., .., ) as a prototyped method named "doConfirmEdit" which takes a single props-object with named valuas as argument, instead of list with 8 arguments.

* Removed trailing whitespace and other minor fixes to comply with the code conventions.
** Removed space between function name and caller: "foo ()" => foo()) 
** Changing "someArray.indexOf() + 1" into "someArr.indexOf() !== -1". We want a Boolean here, not a Number.
** Renamed all underscore-variables to non-underscore variants.

== Bug fixes ==

* When adding a category that is not already on the page as-is but of which the clean() version is already on the page, the script would fail. Fixed it by moving the checks up in handleCategoryAdd() and making sure that createCatLink() actually returned something.

* confirmEdit() wasn't working properly and had unused code (such as submitButton), removed hidden prepending to #catlinks, no need to, it can be dialog'ed directly from the jQuery object without being somewhere in the document.

* in doConfirmEdit() in submitFunction() and multiEdit: Clearing the input field after adding a category, so that when another category is being added it doesn't start with the previous value which is not allowed to be added again...
2011-07-28 00:43:21 +00:00
Sam Reed
c6f9ec2426 Followup r93343
Swap function_exists for MWInit::functionExists()
2011-07-28 00:28:18 +00:00
Sam Reed
cded40da01 Fix syntax error from r93343 2011-07-28 00:23:52 +00:00
Chad Horohoe
6bf0914fbd Followup r93344: forgot to fix test. In other news: inline data providing is eww. 2011-07-28 00:14:49 +00:00
Chad Horohoe
beb2e7c081 Move wfFixBoxImage() out of ImageFunctions and into MediaHandler. It's only used by ImageHandler and OggHandler.
Where to move wfIsBadImage() so we can kill ImageFunctions?
2011-07-28 00:07:08 +00:00
Ryan Kaldari
416459559f make sure sockets are enabled 2011-07-27 23:54:21 +00:00
Roan Kattouw
f450e4eb8c Revert r93237 ("use User::getBlock() accessor rather than accessing $mBlock directly ..."): breaks a test (specifically TitlePermissionTest::testUserBlock()). From what I can tell it looks like the test case is expecting the text of the infinite-block message, but got a Message object instead 2011-07-27 22:28:59 +00:00
Leo Koppelkamm
60d879b52b Recommit r93264 ( Remove semantically incorrect wrapper table from toc and replace it with an inline-blocked diff. Update some skin css, since we don't have the implicit table padding anymore and need to increase to padding to maintain the current look. ) with parser tests and release notes 2011-07-27 21:53:28 +00:00
Siebrand Mazeland
aa3ab31250 siprop=interwikimap and siprop=languages can now use silanguagecode to have a best effort language name translation. Use CLDR extension for best result. 2011-07-27 21:16:32 +00:00
Antoine Musso
be9b7258e7 Typo in message autoblockedtext
Follow up r85951
2011-07-27 19:46:56 +00:00
Raimond Spekking
934e40298b Localisation updates for core and extension messages from translatewiki.net (2011-07-27 19:08:00 UTC) 2011-07-27 19:26:23 +00:00
Antoine Musso
2d55b1670f revert r93284 and follow up r93285
breaks parser tests. Please update the parser tests and reapply.
2011-07-27 19:24:43 +00:00
Antoine Musso
04d3db27c9 revert r93264 : breaks ton of parser tests.
Please update the parser tests and reapply.
2011-07-27 19:20:06 +00:00
Antoine Musso
176f91596c Unicode space separator characters (Zs) now terminates links
Fix 19052 which was only reporting the issue for U+3000 IDEOGRAPHIC SPACE.
Covers both external links and images links. See parser tests for examples.

Unicode 'Zs' includes all characters from the 'separator, space' category.
Characters part of this category are:

Char    Name
U+0020  SPACE
U+00A0  NO-BREAK SPACE
U+1680  OGHAM SPACE MARK
U+180E  MONGOLIAN VOWEL SEPARATOR
U+2000  EN QUAD
U+2001  EM QUAD
U+2002  EN SPACE
U+2003  EM SPACE
U+2004  THREE-PER-EM SPACE
U+2005  FOUR-PER-EM SPACE
U+2006  SIX-PER-EM SPACE
U+2007  FIGURE SPACE
U+2008  PUNCTUATION SPACE
U+2009  THIN SPACE
U+200A  HAIR SPACE
U+202F  NARROW NO-BREAK SPACE
U+205F  MEDIUM MATHEMATICAL SPACE
U+3000  IDEOGRAPHIC SPACE


TEST PLAN:

$ php parserTests.php --quiet
This is MediaWiki version 1.19alpha (r93258).

Reading tests from "tests/parser/parserTests.txt"...
Reading tests from "tests/parser/extraParserTests.txt"...
Reading tests from "../mwexts/LabeledSectionTransclusion/lstParserTests.txt"...
Passed 686 of 686 tests (100%)... ALL TESTS PASSED!

Sounds good :-)
2011-07-27 18:03:01 +00:00
Robin Pepermans
3ac5f41d3a SkinLegacy:
* fix Fatal error: Call to undefined method CologneBlueTemplate::makeExternalLink()
* Use static Linker functions for all other link functions
CologneBlue: check if browseLinks is an array (in a rare case it isn't, which returns a Warning, see e.g. r91432#c19211)
2011-07-27 17:20:53 +00:00
Leo Koppelkamm
73519eb041 r93284 : Update rightClickEdit.js 2011-07-27 16:56:17 +00:00
Leo Koppelkamm
4fc85ff098 Fix Bug 11270 & Bug 11555 : Make editsection link more understandable by positioning it directly left ( RTL: right ) of the title.
Patch by Aryeh Gregor, updated by Roan Kattouw, and updated again by me. I also fixed one bug with modern.css.
Tested in IE6,7,8, Chrome & FF in all skins and both LTR and RTL contexts. I tested with floating images above and below the headers and couldn't find regressions.
2011-07-27 16:43:04 +00:00
Jeroen De Dauw
eb3cb586d3 small style tweaks 2011-07-27 15:58:56 +00:00
Platonides
1d92cdc827 Follow up r93253. Do not mark DatabaseSqliteTest.php as needing a db.
An existing db is not needed, since it uses a memory one.
Having this in Database group fails in DatabaseSqlite->listTables 
since it is working with a MockDatabaseSqlite whose query() return true.
2011-07-27 14:50:10 +00:00
Robin Pepermans
693e81c390 Fix toc margin in modern skin per DieBuche on r90743 2011-07-27 14:38:23 +00:00
Platonides
efa0a5013f Rename PROT_* constants to PROTO_*
Follow up r93258
2011-07-27 14:06:43 +00:00
Leo Koppelkamm
195ed61a82 Remove semantically incorrect wrapper table from toc and replace it with an inline-blocked diff. Update some skin css, since we don't have the implicit table padding anymore and need to increase to padding to maintain the current look. Bug 13766 2011-07-27 13:24:19 +00:00
Alexandre Emsenhuber
ba84011526 * Changed OutputPage::$mIsArticle flag to be false by default. A lot of actions don't change that flag when they should, since about only action=view should have it to true.
* Put OutputPage::$mIsArticleRelated declaration just below $mIsArticle's one since they are related
* Made DifferenceEngine consistent with action=view, i.e. setting that flag to true when displaying any version of the page, current or not
* Made Skin::getCopyright() always use history_copyright when displaying an old version, regardless to the diff parameter
* Changed some checks from namespace != NS_SPECIAL && action=view to isArticle() so that they don't get executed when e.g. throwing an Exception (or similar things)
2011-07-27 13:14:28 +00:00
Leo Koppelkamm
b1c2025060 Save css optimizations for modern css ( margin: 0 0 0 0 to margin: 0 etc.) 2011-07-27 13:01:26 +00:00
Roan Kattouw
e2b9cc8899 (bug NNNNN) Rewrite most of wfExpandUrl() to handle protocol-relative URLs properly and more flexibly
* Fix a bug in rNNNNN where URLs like '/wiki/Foo' weren't expanded completely if $wgServer was protocol-relative. This caused bug NNNNN.
* Add an optional second parameter to wfExpandUrl(), which takes one the PROT_* constants. This allows the caller to determine which protocol should be used if the given URL is protocol-relative, or the given URL is domain-relative but $wgServer is protocol-relative. The options are PROT_HTTP (use http), PROT_HTTPS (use https), PROT_RELATIVE (keep the URL as protocol-relative), and PROT_CURRENT (use http if the current request is http, or https if the current request is https; this is the default).
* Factor the protocol/port detection part of WebRequest::detectServer() out into detectProtocolAndStdPort(), and add detectProtocol() as a wrapper. The latter is used by wfExpandUrl() in PROT_CURRENT mode.
* Rewrite the test suite to test all possible combinations of $wgServer, $defaultProto, $url and HTTP/HTTPS mode. This means the test suite now has 120 test cases rather than 4.
2011-07-27 08:21:40 +00:00
Chad Horohoe
edf1143de1 Mark 2 tests as requiring a DB...since they do :) 2011-07-26 23:39:48 +00:00
Antoine Musso
c608fa8714 makes SpecialPage::mName explicitly private
Only one occurence in Core : SpecialRandompage.
Extensions are done in a following commit.
2011-07-26 21:30:43 +00:00
Krinkle
9fb8dbad9c Release notes for r93247. 2011-07-26 21:14:22 +00:00
Krinkle
cc21627b4d [ResourceLoader 2]: Add support for multiple loadScript sources
Front-end:
* New mw.loader method: addSource(). Call with two arguments or an object as first argument for multiple registrations
* New property in module registry: "source". Optional for local modules (falls back to 'local'). When loading/using one or more modules, the worker will group the request by source and make separate requests to the sources as needed.
* Re-arranging object properties in mw.loader.register to match the same order all other code parts use.
* Adding documentation for 'source' and where missing updating it to include 'group' as well.
* Refactor of mw.loader.work() by Roan Kattouw and Timo Tijhof:'
-- Additional splitting layer by source (in addition to splitting by group), renamed 'groups' to 'splits'
-- Clean up of the loop, and removing a no longer needed loop after the for-in-loop 
-- Much more function documentation in mw.loader.work()
-- Moved caching of wgResourceLoaderMaxQueryLength out of the loop and renamed 'limit' to 'maxQueryLength

Back-end changed provided through patch by Roan Kattouw (to avoid broken code between commits):
* New method in ResourceLoader: addSource(). During construction of ResourceLoader this will be called by default for 'local' with loadScript property set to $wgLoadScript. Additional sources can be registered through $wgResourceLoaderSources (empty array by default)
* Calling mw.loader.addSource from the startup module
* Passing source to mw.loader.register from startup module
* Some new static helper methods

Use:
* By default nothing should change in core, all modules simply default to 'local'. This info originates from the getSource()-method of the ResourceLoaderModule class, which is inherited to all core ResourceLoaderModule-implementations (none override it)
* Third-party users and/or extensions can create new classes extending ResourceLoaderModule, re-implementing the getSource-method to return something else.

Basic example:
$wgResourceLoaderSources['mywiki'] = array( 'loadScript' => 'http://example.org/w/load.php' );
class MyCentralWikiModule extends ResourceLoaderModule {
	function getSource(){
		return 'mywiki';
	}
}
$wgResourceModules['cool.stuff'] => array( 'class' => 'MyCentralWikiModule' );

More complicated example
// imagine some stuff with a ForeignGadgetRepo class, putting stuff in $wgResourceLoaderSources in the __construct() method
class ForeignGadgetRepoGadget extends ResourceLoaderModule {
	function getSource(){
		return $this->source;
	}
}

Loading:
Loading is completely transparent, stuff like $wgOut->addModules() or mw.loader.loader/using both take it as any other module and load from the right source accordingly.


--
This commit is part of the ResourceLoader 2 project.
2011-07-26 21:10:34 +00:00
Happy-melon
c3e096c6e5 (bug 15641) prevent blocked administrators from accessing deleted revisions. 2011-07-26 20:54:41 +00:00
Raimond Spekking
1ca8c6441f Localisation updates for core and extension messages from translatewiki.net (2011-07-26 20:13:00 UTC) 2011-07-26 20:46:49 +00:00
Happy-melon
bd8da57b32 Follow-up r93234: use User::getBlock() accessor rather than accessing $mBlock directly. Also fixes r85951 CR, and remove code duplication in Title::checkUserBlock(). 2011-07-26 19:58:26 +00:00
Happy-melon
323fee7cce Implement an accessor for User->mBlock. Doing this separately as it would be nice to backport this to 1.18 for the purposes of updating extensions for 1.19. 2011-07-26 19:27:14 +00:00
Happy-melon
361c35629b * Fix double-escaping from r85025
* Allow admins to modify blocks placed (probably accidentally) on themselves *by* themselves, whether or not they have the 'unblockself' permission.
2011-07-26 19:04:48 +00:00
Sam Reed
b71d9ff40d Apparently MaxSem cares about SQLite ;)
r93211

Fix a bit of alignment
2011-07-26 17:13:41 +00:00
Sam Reed
53b0d17a11 * (bug 22744) Add/Update indexes for queries done by the API
Add index to logging table accross log_type and log_action
2011-07-26 17:03:14 +00:00
Aaron Schulz
d84d6f7188 (bug 28553) Set ar_parent_id on deletion 2011-07-26 16:41:02 +00:00
Sam Reed
fe04640574 * (bug 29685) do not output NULL parentid with list=deletedrevs&drprop=parentid 2011-07-26 16:17:19 +00:00
Leo Koppelkamm
ef665a75c0 r93090 : Make summaries more modular, Siebrand says there'll be problems with translation otherwise. 2011-07-26 15:50:43 +00:00
Sam Reed
381dcc7200 * (bug 29684) Set forgotten parameter types in ApiQueryIWLinks 2011-07-26 15:19:05 +00:00
Sam Reed
4217b92e0e * (bug 29748) Add API search prefix support
Patch by TheDJ
2011-07-26 15:10:57 +00:00
Daniel Friesen
c366b50344 Followup r93157, missing another one of the stray )'s. 2011-07-26 03:36:27 +00:00
Daniel Friesen
40989c2668 Followup r93132, misplaced ) caused 'dirname() expects exactly 1 parameter, 3 given' error. 2011-07-26 02:44:27 +00:00
Aaron Schulz
c7c2e3a307 Improved r93149 error message 2011-07-26 00:33:39 +00:00
Aaron Schulz
60a3504102 Made addWiki update wikiversions dat and cdb files for multiversion 2011-07-26 00:27:43 +00:00
Krinkle
c3426ac958 Add support for relative-protocol urls in mw.loader.load 2011-07-25 23:04:30 +00:00
Ian Baker
aa5d7bbcea Added a workaround for the lack of RequestContext in 1.17, so this code can be rolled into production.
This code can be removed in 1.18+, but it'll work either way.
2011-07-25 22:39:52 +00:00
Roan Kattouw
1b822db427 Whitespace fix 2011-07-25 22:03:08 +00:00
Sam Reed
66e01d1bb7 Adding __METHOD__ to parameters passed to wfMkdirParents() 2011-07-25 22:01:19 +00:00