Commit graph

1146 commits

Author SHA1 Message Date
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
Translation updater bot 53d12db4e3 Localisation updates from https://translatewiki.net.
Change-Id: Ife09a6898e1055711bb4f2f7e70201f8b68ea0af
2014-03-23 20:32:40 +00:00
Translation updater bot 09dba6e934 Localisation updates from https://translatewiki.net.
Change-Id: Ia15e694f718ef340df5400b05864d15985450017
2014-03-22 20:52:11 +00:00
Translation updater bot 9f8251736f Localisation updates from https://translatewiki.net.
Change-Id: I6b63b5ba34b47c70ff5ec502fd9d85134bc0cacf
2014-03-21 20:49:03 +00:00
Trevor Parscal 90f458ebf4 Fix a typo that causes crashes when using the wrong symbol for mwTocWidget
Bug: 62934
Change-Id: Id2713a9aab1ec372ce987c24d8703aa91e1abe98
2014-03-21 20:33:17 +00:00
James D. Forrester f8720326b0 Split out omnibus CSS files
Change-Id: I195a0e4091cf2d003c325e9c653dd634e7096779
2014-03-21 20:14:52 +00:00
James D. Forrester 3ce49146fe Update VE core submodule to master (5003907)
New changes:
7b68782 Update OOjs UI to v0.1.0-pre (3b434d5388)
ecb194d Remove border-radius prefixes
993220a Fix invalid use of border shorthand syntax
580473e build: Clean up repo split left overs in Gruntfile

Incidental change:
* The OOjs UI-provided 'autoAdd' configuration option for tools has been
  replaced with 'autoAddToCatchall' and 'autoAddToGroup'.

Change-Id: Ie7646ae867e5c6ca616c3f9045c79b886e78475c
2014-03-21 19:08:04 +00:00
Translation updater bot f9a7d6e4f6 Localisation updates from https://translatewiki.net.
Change-Id: I90f14f829ab3c01435c329152f396f8877f1eb59
2014-03-20 20:32:04 +00:00
jenkins-bot f52b34d473 Merge "Followup 861d097: actually exclude reference tool in reference dialog toolbar" 2014-03-20 06:04:43 +00:00
Roan Kattouw 5ad0828936 Followup 861d097: actually exclude reference tool in reference dialog toolbar
It was excluded, but also promoted, and the toolbar resolves this ambiguity
in favor of promotion.

Bug: 62575
Change-Id: I2f1eadb27cbd16e3258aee0311c7b35f6311ea5a
2014-03-19 22:58:35 -07:00
jenkins-bot 8ae779ec1f Merge "Don't use search widget emptiness as a proxy for "no reusable references"" 2014-03-20 05:50:40 +00:00
Roan Kattouw 45b17da937 Don't use search widget emptiness as a proxy for "no reusable references"
This works the first time the dialog is opened, but if the user types
a value into the search widget that yields 0 results, then closes
and reopens the dialog, that value will persist and the search widget
will still be empty, so we'll wrongly disable the "Use existing reference"
button.

Instead, check what we're actually interested in directly: whether
the index of reusable references is empty.

Bug: 61960
Change-Id: If4bf6ced7dc3af643f602c07f3142a0e637a3247
2014-03-19 22:46:04 -07:00
jenkins-bot 0c8cb151fb Merge "Remove the math inspector code" 2014-03-20 05:34:31 +00:00
jenkins-bot d60a375500 Merge "Ignore placeholder parameters in serialization" 2014-03-20 05:32:44 +00:00
Roan Kattouw 4bf24633e0 Ignore placeholder parameters in serialization
Apparently adding a parameter whose name is an empty string causes Parsoid
to output |undefined= . And I can't say I blame them.

Bug: 62621
Change-Id: I01bc401ae60935dcce309b743057641e2e503528
2014-03-19 22:27:59 -07:00
jenkins-bot 24c0082093 Merge "Display links to nonexistent pages as red" 2014-03-20 02:44:22 +00:00
jenkins-bot e6280f34b2 Merge "Add lookupTitle attribute" 2014-03-20 02:44:10 +00:00
Roan Kattouw 78a52f1f80 Display links to nonexistent pages as red
* Add ve.init.mw.LinkCache to track page existence and
  transparently query it
* Populate it with initial data from the parser cache
  if available, obtained in the VE API module
* Use linkCache data in link annotation rendering

This doesn't yet integrate the LinkCache with other
components like the link inspector. That should be
done so we can deduplicate the existence checks.

Additionally, we should generalize LinkCache and use
it for the category existence/status checks as well.

Bug: 37901
Change-Id: I9fd43e8c3864dd375cf6dadfdeedd05e4fe9cf3b
2014-03-20 02:42:33 +00:00
Roan Kattouw 0304b89db9 Add lookupTitle attribute
This is the normalized title without the fragment, which is what
should be used for existence check purposes. Also add a test for
an internal link to a page's section.

Change-Id: I0e04f64c1bebeff84a0c17ef9b6c8dc06876f769
2014-03-19 19:34:19 -07:00
James D. Forrester aea64bf2df Remove the math inspector code
Moved to the Math extension in I8e582ee6deadc2750

Change-Id: Iab0c56246626de1e0f6ab770e777c0a28756fa75
2014-03-19 19:27:25 -07:00
Rob Moen ec40953722 Mixin ClickableNode and add primary command names
Created ve.ui.MWCommandRegistery, added inspector and dialog commands

Change-Id: I6b45018bdb719e36a85a785d4e08d32ee4b9b0a3
2014-03-20 00:33:38 +00:00
jenkins-bot 6c85a29a85 Merge "Properly teardown TOC widget" 2014-03-19 23:27:18 +00:00
Rob Moen e02460131f Properly teardown TOC widget
Change-Id: Ib115024b4e50ac379e5b8689ae796fce3586d386
2014-03-19 15:51:23 -07:00
jenkins-bot df028aee2b Merge "Disable VisualEditor on Page Translation output pages" 2014-03-19 22:27:37 +00:00
James D. Forrester 903c19ef06 Disable VisualEditor on Page Translation output pages
Also, we warn the user that Here Be Dragons™ when they're editing a Page
Translation /source/ page.

Bug: 50284
Change-Id: I841ccb8461d31358640a16301a6a78750a660d36
2014-03-19 15:25:24 -07:00
Translation updater bot ae972511fb Localisation updates from https://translatewiki.net.
Change-Id: I59aa0597a064cfa75ccaf10c25cb548281003fa2
2014-03-19 20:45:17 +00:00
Translation updater bot 0950e9e023 Localisation updates from https://translatewiki.net.
Change-Id: I5acc7680ca45f585ffabec36954dae51743f2277
2014-03-18 21:02:48 +00:00
Andrew Garrett 7e52a1ab2a Fail gracefully if there is no edit tab
For example, LiquidThreads pages, pages which are using DynamicTabs, etc.

Change-Id: I6b059dd76c150ee7fefb087aefe7fcccf41a3a43
2014-03-18 16:25:24 +11:00
Translation updater bot 081f93443e Localisation updates from https://translatewiki.net.
Change-Id: I5ca488eb11a53dc4ed269d7461883ba399afe8f0
2014-03-17 21:23:03 +00:00
cmcmahon ad6928376e [browser test] Fix a mistake in previous commit.
Earlier commit did not use _element properly

Change-Id: Id8d887af21cd83a2bfaddf8db7d5121a5213a13f
2014-03-17 13:54:46 -07:00
jenkins-bot d183c74d6b Merge "[browser test] dismissing beta 10X is overkill" 2014-03-17 20:07:18 +00:00
jenkins-bot 32c648c530 Merge "Remove commented-out, now-confirmed-as-wrong wrong image insertion code" 2014-03-17 18:58:46 +00:00
jenkins-bot 24c4938d34 Merge "Increases width of defaultsort and page redirect fields in options dialog" 2014-03-17 18:58:27 +00:00
James D. Forrester 18693e76e0 Remove commented-out, now-confirmed-as-wrong wrong image insertion code
Bug: 61560
Change-Id: Id66f7a3204bae0978cc4e86d443551ce878ef8c8
2014-03-17 11:55:56 -07:00
jenkins-bot 77f4547cb3 Merge "Update VE core submodule to master (f1249ec)" 2014-03-17 18:53:01 +00:00
jenkins-bot c5c2cb809c Merge "Update VE core submodule to master (aaad03a)" 2014-03-17 18:52:50 +00:00
Marielle Volz 2a46901832 Increases width of defaultsort and page redirect fields in options dialog
This patch increases the width of the defaultsort field, a problem
identified in bug 51012. It does this by adding a custom class in
/modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js called
.ve-ui-mwCategoriesPage-defaultsort and then applying the style in
modules/ve-mw/ui/styles/ve.ui.Page.css.

The patch also increases the width of a field that was not addressed
in the bug report, the page redirect field in the page settings
page in the options dialog. This was done because, like the
defaultsort field, this field takes as input page titles, which
can sometimes be long. This was done by adding a style to
modules/ve-mw/ui/styles/ve.ui.MWWidget using the
.ve-ui-mwTitleInputWidget class, a class which had been added
to the input field but didn't have any styles associated with it
until this commit.

In both fields, the width has been set to 30em.

Bug: 51012
Change-Id: Ic24f0d20256a5d64075f9d2850215a03b8c8ae66
2014-03-17 18:51:26 +00:00
Roan Kattouw 99de3f2e31 Update VE core submodule to master (f1249ec)
Update MWMediaDialog for .static.config -> .static.dialogData
rename in VE core.

New changes:
61e34f3 Only insert slugs where paragraphs are allowed
f65983d Don't try to return the document in getCoveredNodes
b9313ba Remove incorrect documentation for the .static containers
16874e2 ve.ui.Trigger: Clean up indentation and documentation
0eeba06 Cleanup docs and method of tools

Change-Id: I7bfb500ace1acc360cc24de2763e3f52fbb82a0e
2014-03-17 18:45:00 +00:00
jenkins-bot 1c84584d50 Merge "Clarified the default link for image insertion." 2014-03-17 18:44:58 +00:00
C. Scott Ananian 0128db1dec Clarified the default link for image insertion.
Bug: 61560
Bug: 49844
Change-Id: Iab37caf1b34906b9bb1be241aa869bd2d4877907
2014-03-17 14:38:29 -04:00
cmcmahon f0731084da [browser test] add when_present to link header check
I was surprised to find this missing, this was a mistake that
causes bogus failures

Change-Id: Iab38ef4db315993ca1f31c079f17be22ebf17d3c
2014-03-17 11:37:36 -07:00
cmcmahon 0a2f97d3b9 [browser test] dismissing beta 10X is overkill
Change-Id: Ic674bcb53d54948d6beb58338cbef030fc3e524f
2014-03-17 11:29:37 -07:00
jenkins-bot 99ece6e6d0 Merge "Re-sync toolbarGroups for MWMediaEdit and MWReference dialogs" 2014-03-17 17:23:37 +00:00
James D. Forrester 5e4af875c1 Update VE core submodule to master (aaad03a)
Also update ContentBranchNode test for changes in VE core

New changes:
bdf9a9f Merge two Properties blocks in DesktopContext
d3c22bb Make ContentBranchNode echo suppression work in CBNs that contain inline nodes
aaad03a Localisation updates from https://translatewiki.net.

Change-Id: I3e1757b42307c3bd52ba0571068eb1c6bfb5ab89
2014-03-16 16:53:53 -07:00
Translation updater bot 7821eb7bd3 Localisation updates from https://translatewiki.net.
Change-Id: Id1b163bd4eeaac35a61102c43c11c77cddfa65af
2014-03-15 20:13:20 +00:00
James D. Forrester b68c8d3819 Re-sync toolbarGroups for MWMediaEdit and MWReference dialogs
Change-Id: Ic42a57e0e7a1639242092dbe41e13c1b8586f841
2014-03-14 17:01:44 -07:00
jenkins-bot fbdc55dc78 Merge "Table of contents widget" 2014-03-14 22:31:10 +00:00
Rob Moen eba7d58dd1 Table of contents widget
TOC Widget is created in the mw target view class.
Adding and removing a heading rebuilds the TOC Widget based
on the the order of the page heading nodes.

TOC Widget considers TOC page settings and displays in the default manor
unless forced or disabled.

TOC Widget still needs to be finalized by being placed in the surface.
This could be a problem until we have a CE node for it to live in or
have some DM work added.  Roan and I have discussed how to go forward.

To enable the widget you must add the following to LocalSettings.php:
$wgVisualEditorEnableTocWidget = true;

Change-Id: I488cfbbdb060e50d81f51e0f757e67d0114b8936
2014-03-14 15:20:19 -07:00
Trevor Parscal 42ba981e27 Update VE core submodule to master (520299e)
New changes:
dd15f23 Split ve.ui.Surface into DesktopSurface and MobileSurface
16283f4 Add OOjs UI's sco.json i18n file
ef94038 Split ve.ui.Context into DesktopContext and MobileContext

Minor adjustments to point to desktop and mobile Surface or Context.

Change-Id: I7cf6f99a5a1216a28a7146afcd4deb68c7eac38e
2014-03-14 13:13:02 -07:00
James D. Forrester ae06f75a76 Replace semicolon with full-stop in two messages
This should make them more readable and consistent with other messages.

Change-Id: I0a26e0e784a37bce58751359cc48dff660d7737d
2014-03-14 11:44:28 -07:00