* Avoid global wfMessage since it defaults to the session-based user language.
This can be worked around with `inLanguage( $context->getLanguage() )` but
is rather fragile. MediaWiki provides msg() in its RequestContext as well
(as used on special pages etc.). Use the same here.
* While at it, refactor this a bit to simplify the message handling.
* Remove empty constructor method.
Change-Id: I4a358d6de236e24fa6e0538bb049ddec98f9fcc4
Partially reverts "Expose version information in the client" (a72099af66 / I7836e1d40).
The Git data oscillates between two values due to differences between the
staging and production environments. Each change causes the module version to
change also, leading to cache churn.
Instead fetch version information with an API call the first
time the help popup is opened.
Bug: T119750
Change-Id: Ib9c45e60d3164cfa85eb1ef247cc91cf0d8bf954
This method is only called once, in getScript(). There is no need to
indefinitely cache it in the class.
Besides, the GitInfo class already caches it in much the same way in its
own class.
Also move the class instantiation of GitInto into getScript() so that it is
deferred until getScript() is needed – which in turn is only called once and
will naturally gargage collect it as it's now a local variable.
Change-Id: I545baa04e9ff2333fbf2ca7d0473dab0cf9269fd
This module effectively uses it already since this module doesn't
add meta data to getDefinitionSummary, but rather adds all of getScript()
into the hash, which is exactly what enableModuleContentVersion is for.
Using this has the advantage of being well-tested and better cached,
as right now the script has to be computed twice (once for the response,
and once for the version header), whereas enableModuleContentVersion
uses RL's in-process cache.
Bug: T102578
Change-Id: I42fb720988b4b4b4310bde238dc321b62866f827
This change is for compatibility with Iee61e5b527 in MediaWiki.
This patch increases the minor minor version number due to said requirement.
Change-Id: I0ac775ca286e64825e31a9213b94648e41a5bc30
The current approach matched historical RL conventions, but was quite
fragile. It used memcached to track hashes of all (or most?) factors
that influence the generated script.
Now that RL uses version hashes instead of timestamp, just hash the
script directly. Currently ResourceLoader falls back to hashing
the generated timestamp. Let's bypass this.
As a bonus, this also gets rid of the getMessages() hack which was
causing all messages to load twice and the module to be almost
twice a big as it could be.
It loaded messages once as part of getScript, via ve.init.platform.addMessages.
And a second time via getMessages() for which mw.loader calls mw.messages.set.
Bug: T94074
Change-Id: Ib8e688bf3a9c151cbb18016e10230c3a4bab46b8
It uses modules/ve-mw/init/ve.init.mw.Platform.js via addParsedMessages
The missing dependency triggered an error when working on the Flow/VE
integration.
Change-Id: I64347aa6a0cf94fe51dd724432c22d54eea0cfd9
Objectives:
* Allow users on-wiki to create tools and dialogs for citation templates
of their choosing
* Allow editing of citation templates directly, without having to go
through the reference dialog
* Provide citation template tools within reference editing that use the
same titles and icons as the citation tools do, but don't wrap the
inserted content in a ref tag
Changes:
* Reference list was cloning the DOM element it was inserting into its
view before the generated content node could finish rendering, so it
never ended up showing the finished rendering in the reference list
* Documenting hack about use of reference list node's destroy method,
and how we are depending on destroy not canceling generated content
rendering
* Introduced reference model
* Added saving/updating method to transclusion model
* Added getPartsList method to dm transclusion node, which caches the
result and invalidates the cache on update
* Added citation dialog, which extends transclusion dialog
* Added cite group to toolbars, cite-template in reference dialog toolbar
* Factored out getting the node to edit and saving changes procedures in
transclusion dialog so they could be extended in citation dialog
* Updated uses of autoAdd as per changes in oojs-ui (Ic353f91)
* Renamed MWDialogTool file since there was only one tool in it
* Expanded TransclusionDialogTool file out since there is now more logic
to it
* Switched to using ve.dm.MWReferenceModel instead of plain objects in
reference search widget
Configuration:
If you add to MediaWiki:Visualeditor-cite-tool-definition.json the
following code you will magically be presented with a delightful array
of citation options:
[
{ "name": "web", "icon": "ref-cite-web", "template": "Cite web" },
{ "name": "book", "icon": "ref-cite-book", "template": "Cite book" },
{ "name": "news", "icon": "ref-cite-news", "template": "Cite news" },
{ "name": "journal", "icon": "ref-cite-journal", "template": "Cite journal" }
]
...or...
[
{
"name": "any-name",
"icon": "any-ooui-icon",
"template": "Any template",
"title": "Any title text"
}
]
The title text is derived either from the title property or from the name
property by pre-pending the string 'visualeditor-cite-tool-name-' to
generate a message key. Titles for 'web', 'book', 'news' and 'journal' are
provided. The icon is a normal oo-ui-icon name, and more icons can be
added, as usual, by adding a class called .oo-ui-icon-{icon name} to
MediaWiki:Common.css. 'ref-cite-web', 'ref-cite-book', 'ref-cite-news'
and 'ref-cite-journal' are provided. The template name is simply the name
of the template without its namespace prefix.
Depends on Ic353f91 in oojs-ui
Bug: 50110
Bug: 50768
Change-Id: Id401d973b8d5fe2faec481cc777c17a24fd19dd4
Changes include:
* Target mobile for ve dependencies
* Create mobile view constructor
** Some tools like dialogs are excluded for now
* Refactor mw.target to permit code reuse
** Split out pageTarget view functionality from core init methods
Change-Id: I786b63ab57518fc6af7761501259ed66592f70e3
* Check in #getGitHeadHash now ensures a false value is
cached as well.
* Made ve.version.id being false when invalid more stable
since we now rely on this as of eeb3ac3b19.
* Added documentation for ve.version.
Change-Id: I164aa9ebaa7f8a4d1e8f2210af76e06b23abef09
By passing in the information via a ResourceLoaderModule this
gets around any concerns with performance (version information
is read from the file system).
The version information is appended to the beta toolbar dialog.
Bug: 53050
Change-Id: I7836e1d4003416cbb7e18e3435aa87d82fd5c2e2
Also..
* removed an incorrrect comment referring to the old module
name (standalone didn't use the VisualEditorMessagesModule).
* made it use debug mode to determine whether to minify or
prettify the js code.
Change-Id: I493007649fba27e7faab0cf743eded5f68714c50
2013-08-29 18:07:35 -07:00
Renamed from VisualEditorMessagesModule.php (Browse further)