Due to a lack of clarity in the wikitext documentation the border
checkbox wasn't set up right. This is the proper behavior: border is
allowed for all unframed images (frameless and basic) while the
framed images (frame and thumb) have it anyways. Wikitext
documentation was also clarified for prosperity.
Change-Id: I4dd4775da473d669781553796be99646240c13fe
Otherwise the surface ends up in a weird half-focused state which
causes it to behave strangely.
Bug: 63909
Change-Id: I3ebc30fde0202116b383a5b497aca65b66732922
The logic was checking that there were at least three items to show, then triggering
the MWMoreParametersResultWidget widget with the number of items left in the overflow
if the limit was two. Whoops. :-)
Change-Id: Icec16a2d26bef8bf8d74ed619341afd494ca0479
Previous hack caused unwanted blur events and subsequent range changes.
Depends on I8388318311 in core.
Change-Id: I9163f4d9928887a5eec09f0651ec0a66cc221cd4
There are two ways dialogs determine if they are inserting or updating.
1. They evaluate whether the dialog is inserting or not and set a boolean
flag, used later to steer the saving code
2. They evaluate whether the dialog is inserting or not and, if not,
store the node to be updated in a property, used later to steer the
saving code
In the reference list dialog, setup used strategy 1, and teardown used
strategy 2. We've now normalized to use strategy 2 in both methods, which
fixes this bug.
Bug: 61885
Change-Id: I1b077b2aef4121328bce2b373874dd7373e405a1
These were being used indirectly in the MW*Model's. Use surface
fragments instead.
Fixes I0fae3e5ff2bd.
Change-Id: I1d6aa5e00a9315cf7088f87f9e9d828833feec64
Move various bits of code from initialize to setup as required.
MWDialog is now useless so use ve.ui.Dialog directly.
New changes:
0b2d03f [BREAKING CHANGE] Pass fragments, not surfaces, to windows (reprise)
0101ac4 Update OOjs UI to v0.1.0-pre (ac6848398c)
Change-Id: I0fae3e5ff2bd0da5b74c244af226b07b1f5883bd
ve.dm.Scalable is now a computational model for image scaling and
size manipulation. This commit adjusts the nodes and the edit and
insertion dialog to handle the new scalable model, and by that
use a centralized computational engine for all scaling and size
changes.
New changes:
3ec19fb8 Refactor Scalable functionality
Change-Id: I017a017924f544cc8bc9b7d8245335759ae0e890
* Truncate beyond 3 parameters
* Add a special option class that, when clicked, shows the remaining parameters
* Use a special option class for the no parameters item instead of hacking the normal one
* Simplify the design of the no parameters item: no icon, centered text
Change-Id: Ia8259e91b42a59c2b08019df36217d485208ad99
Changes:
* Change uses of initializeSelection to selectItem
* Use "choose" event to respond to deliberate item selection by the user
Depends on changes in OOJS-UI (Ib3826ed)
Change-Id: Ia167a70ca5f40b1f15adad30620fdb13ef0d02d7
This test never worked. Last week this feature broke but the
test continued to pass. Let's not do that again.
Change-Id: I9819a3304191959b9b194b3e675dfdd273618881
These were backwards which was triggering edit conflict detection for all users.
Fortunately for logged in users, if Revision::userWasLastToEdit was given a bad
timestamp (e.g. when we submitted here), it would just return true, suppressing
the conflict. It always showed a conflict for anonymous users however.
Bug: 56835
Change-Id: Ib07f965238ca96e17bf59b34da8a8e789954da61
When using a tool that opens a citation or citation transclusion dialog,
the dialog shouldn't use edit mode unless the template in the node and the
template the tool would insert match.
Bug: 63452
Change-Id: I34a5a2da576247f4046da45f742bccc3cec22c5a
Also update tools for changes in VE core.
New changes:
e4de14b Make tools use commands
e029817 Make getToolsForNode place primary commands first
Change-Id: I66575ee6d49e6b2f5a5f789978da98bb55e6dc5e
Protocol-relative <base> tags are fine when the iframe trick is used
because the iframe inherits a default base URL from the parent document,
so if the <base> is relative it can be resolved against that. However,
a document created with DOMParser (or document.implementation, oops!)
won't inherit anything, so anything other than a fully absolute <base>
will just break.
To make Parsoid's relative <base> work anyway, resolve it in the
context of the main document, then write the resolved version
back into the <base> tag.
Change-Id: I7261bd5dbe9ec1f4077a4e5a00bd2a03ac237ca0
New changes:
0318f64 Fix copyright year range for one file not updated to 2011-2014
4dbd57e Add <base> for relative URLs in tests
554cde9 Localisation updates from https://translatewiki.net.
c32448a Update OOjs UI to v0.1.0-pre (1c7875205a)
8f675c8 Localisation updates from https://translatewiki.net.
4fb929c Add a <base> to every test document by default
09c404c Protect against invalid/absent <base> in ve.resolveUrl()
05924db Use DOMParser in ve.createDocumentFromHtml() if available
9c19df0 Update OOjs UI to v0.1.0-pre (e697490c9b)
Local changes:
Use ve.dm.example.base for link tests in mwExample
Change-Id: I384e2a2edeebe9379de4910889a61670d9f734f5
The transclusion tools shown in the toolbar in the reference dialog
passed a template to open with to the transclusion dialog, but it
didn't take that config parameter.
Moved this parameter up from CitationDialog to TransclusionDialog,
and moved its logic into the setup function.
Bug: 63037
Change-Id: I9249c845a5ae7cca2ec4d75d69e1236f7755d246
this.refGroup is only ever read and never written, so obviously it's
always undefined. And it turns out that creating references with
listGroup='mwReference/undefined' crashes when you try to remove
them again.
Bug: 63085
Change-Id: Id326208bd6b3fe3b602ed6e3b57b7ea06d8ceb2c
* Create a method to produce the correct label
* Override that method in the citation dialog subclass
Change-Id: Ic74a23dcf30aae201f3d6c312b760cf058aadf11
This fails before the reference has been inserted, because
it's not yet in keyedNodes at that point.
Bug: 63031
Change-Id: I34ea1a88c0f332c23e43597d1c42158bfb0f1e98
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
If we render new links with a plain target, then if you're on a
subpage like Foo/Bar, [[Baz]] will point to Foo/Baz. In order to
avoid this, we fake the link target to be ../Baz and resolve that,
which produces the correct result.
This hack is only needed until Parsoid stops producing ../-prefixed
links. This hack is only applied in view mode, because applying
it to our DOM output back to Parsoid would confuse Parsoid and
cause bugs.
Bug: 58314
Change-Id: Ifb4b63a26235a04e6362fc3e3e57d8773831eb38
The request for originalDimensions is taken from the API, which can be
rather slow. There is a future (soon) fix that refactors the entire way
we read the originalDimensions asynchronously and load it into the dialog
but until that is available, this fix introduces a couple of basic
fallbacks in case originalDimensions are not yet available in the size
widget.
Bug: 62024
Change-Id: I8d00cea6f1d667359a44a6c185c16340bc6e81c9
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
It was excluded, but also promoted, and the toolbar resolves this ambiguity
in favor of promotion.
Bug: 62575
Change-Id: I2f1eadb27cbd16e3258aee0311c7b35f6311ea5a
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
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
* 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
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
Also, we warn the user that Here Be Dragons™ when they're editing a Page
Translation /source/ page.
Bug: 50284
Change-Id: I841ccb8461d31358640a16301a6a78750a660d36
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
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
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
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
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