Commit graph

22 commits

Author SHA1 Message Date
Alex Monk 8a9b6a901c Avoid checking non-set keys in user-defined data
Bug: T121768
Change-Id: I41350f4313f861cc06ac485e50a938acf3a302c0
2015-12-17 16:48:49 +00:00
Ori Livneh b1db8349fe Avoid embedding Git metadata in ext.visualEditor.data
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
2015-11-30 12:34:56 +01:00
Timo Tijhof 370b0bfeb5 Remove redundant VisualEditorDataModule::getGitHeadHash static cache
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
2015-11-10 01:06:33 +00:00
Timo Tijhof 4613449b65 Enable new module versioning for VisualEditorDataModule
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
2015-11-10 00:46:55 +00:00
Ed Sanders ecdcdcc69f VisualEditorDataModule: remove $msgKeys
This is apparently no longer used.

Change-Id: Iccf6e00a4e96aece9a81f1f7f91024faf15b0798
2015-09-03 21:29:51 +00:00
addshore aea5ebab38 Remove use of deprecated wfRunHooks
Change-Id: I390f731564d02866f2724284e2a5e0639f4a889d
2015-08-06 19:09:19 +01:00
Bartosz Dziewoński cd8307351a build: Updating development dependencies
* jakub-onderka/php-parallel-lint: 0.8.0 → 0.9
* mediawiki/mediawiki-codesniffer: 0.2.0 → 0.3.0

Change-Id: Ic4a5fd50cd1403da11c6b0be75eaa290524d8b0a
2015-06-19 23:32:37 +02:00
Andrew Green 598e1fd1c1 Update VisualEditorDataModule::getDependencies method signature
This change is for compatibility with Iee61e5b527 in MediaWiki.

This patch increases the minor minor version number due to said requirement.

Change-Id: I0ac775ca286e64825e31a9213b94648e41a5bc30
2015-06-09 02:24:20 +01:00
Timo Tijhof 2e050ff498 VisualEditorDataModule: Use definition summary instead of time tracking
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
2015-06-08 18:27:27 +00:00
Aaron Schulz e64c3bfd1d Use ResourceLoaderModule::safeFilemtime instead of using filemtime directly
Change-Id: Ic3a3a23e31b57b1508757ee6a1b0888b4e5f6cce
2015-03-31 17:08:24 +00:00
Matthew Flaschen 3af3bde7fe VisualEditorDataModule depends on ext.visualEditor.mediaWiki
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
2015-02-24 23:10:27 -05:00
James D. Forrester 2f8b3e0d96 build: Bump copyright notices to 2015
Change-Id: Ie92dab7411116d3410195c3fb0a3513c664c0c30
2015-01-12 20:34:19 -08:00
Kunal Mehta 5575bed67c Use Config instead of globals
Change-Id: Iecf6358fcd15fe578b3e0dcdfa6022e0a1a763c8
2014-08-15 15:50:26 -07:00
Ed Sanders 06911a01ca Remove old message
Change-Id: I0e8b9ea7957f8495dc9713ac5db811f42dfb19fe
2014-07-28 14:23:50 +01:00
kaldari dc596bf31b Moving citation tool code in API module into its own function
This should slightly improve the readability and modularity of the
code.

Change-Id: Ie4dcbeca550129c2fcea69f011d0297f334ea235
2014-05-09 08:56:40 +00:00
Trevor Parscal be199c0bf2 Ultra-mega-hyper-citation editing on crack
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
2014-03-24 19:24:38 +00:00
James D. Forrester 0ffd654bed Bump copyright like it's 2014
Change-Id: Ic469ebda2c061dc7da0b4c1625f43a7be55da4fa
2014-01-05 20:06:50 +08:00
Roan Kattouw b46a9ca70c Rename misspelled variable $parsedMesssages
Change-Id: Idc2e9ccf5960807242305c43b8acb28b7fb64073
2013-12-12 01:30:58 +00:00
Rob Moen f1fa56165d Create base MobileView config and target refactor
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
2013-12-02 17:59:27 -08:00
Timo Tijhof e4662a65cd Clean up VisualEditorDataModule and document ve.version
* 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
2013-09-18 03:40:00 +02:00
Ed Sanders a72099af66 Expose version information in the client
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
2013-08-29 18:19:40 -07:00
Timo Tijhof bdd1a73eaa data: Rename MessagesModule to DataModule
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)