Sort them alphabetically; trim unused ones; give descriptions for missing ones;
only use the needed messages in the ResourceLoader payload.
Change-Id: I2af295a009121236d46c0705f85d3722dfb72aae
Objectives:
* Remove the whole toolbar subset thing, it's up to the creator of the
subsurface to know what is and is now allowed, and the commands were
still passing through unfiltered
* Correctly separate initialization from opening - fix issue where opening
the reference dialog multiple times will keep adding more and more
controls
Changes:
ve.init.Target.js
* Remove getToolbarSubset method
ve.ui.MWReferenceDialog.js
* Add toolbar tools and surface commands configs to reference dialog,
including the things that are safe to use in references
* Move creation of field sets and reused controls to initialize method
to prevent re-creation each time the dialog is opened
* Move static initialization stuff to the top near the other static stuff
Change-Id: I1c8577d17c506bac76e61b2b036655c59ef5a218
We don't need to decompose and rebuild alien meta items
as they are uneditable, so just store the dom node and return that
in toDomElements.
Update test cases and several tests now need to use
assert.deepEqualWithDomElements.
Change-Id: I4d2eed267dac7855cb929a17d7aef566eaf0e287
Turns out that by skipping the last item, the following logic which
depended on that item being in the existing items list failed to keep
it's grubby hands off it.
Yes, I know I +2'd it. Shame on me too.
Bug: 48556
Bug: 48565
I93ce05f7cbb28313a3f0827539f0528c366aeb7e
Change-Id: If48e001b92c217bee0a35b6da41d1c1ff0e3271c
Was previously only set on form submission, but there was no button so
you had to press the Enter key
Bug: 48555
Change-Id: I256d2b21bc2306959f6d6a0373386054b21dadfe
getLookupMenuItemsFromData() constructed a regex from user input
without escaping. I don't *think* there are any injection
vulnerabilities here but at the very least it triggers exceptions
when the input is, say, a backslash. Instead, use .lastIndexOf() which
allows us to efficiently check whether a string starts with a certain
prefix.
getLookupCacheItemFromData() was stripping out the Category: prefix
using a regex that hardcoded Category: (so failed to detect localized
prefixes) and used global replacement, which meant that strings with
multiple occurrences of 'Category:' were handled incorrectly. Instead,
use mw.Title to strip the prefix. Also move away from .map() because we
may need to drop a result if it doesn't pass mw.Title validation.
this.categoryPrefix still has a few legitimate uses left, so keep it
around but set it to the localized namespace prefix rather than Category:
Change-Id: I6547f9df2e94fe81f6aefb9286e547425137344b
Objective:
* Add an event to single line text input widgets to detect when the enter
key has been pressed
Changes:
ve.ui.TextInputWidget.js
* Retain value of multiline config option
* Add key press handler to detect pressing of enter key
* Emit 'enter' event when enter key is pressed if input is single line
Bonus:
* Add missing documentation for multiline config option
Change-Id: Id9c64343f4a2ea8f0f45213fd2b59ca87c805b24
Objective:
* Prevent undefined and null from being converted to 'undefined' and
'null' when given to setValue by converting them to empty string instead
Changes:
ve.ui.InputWidget.js
* Move all sanitization to one place
* Improve sanitization by adding cases for undefined and null
Change-Id: I8817a8fcac271e560a9e49887c68a035293866d4
Objective:
* Add functionality to paged dialogs to work with the pages and select
them programmatically
Changes:
ve.ui.PagedDialog.js
* Keep track of the current page name
* Add setPage method, which is can be used publicly and is also used
internally when items in the outline are selected
* Add a page content config option which auto-appends to the inside of
the page
* Add removePage method for removing pages by name
* Add getPageName method which gets the current page name
Change-Id: I2a2f0c329d274796b8c9e7572ecff8294f472f7f
Of course CSS is perfectly standardized and wonderful, so we need a bunch
of duplicative and non-standard rules.
Also fix the mixin in MWCategoryWidget
Change-Id: I24da0ddb29d2886c450da362fee47d22da8e631d
With explicit cache management on the Parsoid side there is no need to send
this explicitly any more.
Change-Id: I34bf3a6ffe631d3350c05ec4c21563f8a734effc
unicodejs.js:
* charRangeArrayRegexp to write surrogate-aware regexps
* private helper functions
unicodejs.wordbreak.test.js:
* test charRangeArrayRegexp
* corrected tests for non-BMP wordbreaks
unicodejs.wordbreak.js:
* use new surrogate-aware regexps
unicodejs.wordbreakproperties.js:
* generated from Unicode data
unicodejs.graphemebreakproperties.js:
* generated from Unicode data
unicodejs.wordbreak.groups.js:
* delete as no longer used
unicodejs-properties.py:
* generate unicodejs.wordbreakproperties.js from Unicode data
* generate unicodejs.graphemebreakproperties.js from Unicode data
index.php:
* update script tag links
/VisualEditor.php:
* update script tag links
/demos/ve/index.php:
* update script tag links
/maintenance/makeStaticLoader.php:
* update script tag links
Change-Id: I39c0386a85b0cf21d68d3385b84018a5d7648de5
Now that I797b2bd87 is in we can remove the data-parsoid hack
for new references. Also fix the converter to always insert content
for keyless references.
Change-Id: Ia42907feb8f64637189eba15139177c7eb5e8899
When editing the default sort key or a category's sort key, we would just
build a brand new meta item and replace the original item with it. This
destroys whitespace information tracked in the .internal property though,
so the resulting diffs looked pretty bad.
Instead, use ve.extendObject() to base the new meta item on the old one,
changing only what we need to change and keeping .internal (and
htmlAttributes and anything else that may be hiding in there) intact.
Change-Id: I40f4403ea2f2d13542d2e3c8c53e2d7f79515381
Objective:
* Allow opening reference dialog with arbitrary selection
* Auto-insert reference when selection is not a reference node
Changes:
ve.init.mw.ViewPageTarget.js
* Added reference button to toolbar
ve.init.Target.js
* Add getToolbarSubset so we can exclude the reference button from
the toolbar in the reference dialog (nested references are not
allowed).
ve.ui.MWReferenceDialog.js
* Stop storing referenceNode (not needed)
* Only store internalItem on open if there's a focused node that's a
reference
* Use wrapper paragraph when creating a new reference
* Create new reference on dialog close if required
ve.dm.InternalList.js
* Major rewrite to support key less references.
* Add new method for creating a transaction to insert a new iternal
item. Also returns the index of the new item to be passed to the
reference node.
Change-Id: I839ae165c299248484ce93d4ab087318a95fbb94
Previously we populated the reference body into all <ref> tags
with the same key. Now we store an internal attribute marking
which element originally had the data.
If that tag is deleted the body is moved to the first <ref> tag
with that name.
Change-Id: If9f12bfb699e6ce85bb8f7d2ea9e6df528610a3d
Introduction of fake selection for single focused nodes. This
change specifically makes the selection much nicer in appearance
for Chrome users selecting floated FocusableNodes (block images)
for example.
Added ve-ce-surface-highlights DOM element to contain styled
highlight elements.
Made adjustments to getSelectionRect to return fake selection
bounds if necessary.
Replaced old uses of showSelection with model.change().
Change-Id: I96e66567cdce6455ef3eb77568e72f23140448ff