Objectives:
* Get rid of the border and ensure pixel-perfect positioning of the input.
* Always render the arrow on the top right of the category item
* Make the popup positioning based on the arrow div's position and size
Bug 49420
Change-Id: I3ad4ff1c41e6108161b5b7c8718c676eb850de68
This change adds a '$wgVisualEditorEnableEventLogging' configuration
variable, accessible client-side as
'wgVisualEditorConfig.enableEventLogging'.
When true, the 'schema.Edit' ResourceLoader module will be loaded on the
page, and calls to ViewPageTarget.logEvent will forward to
mw.eventLog#logEvent.
When false, the module is not loaded, and ViewPageTarget.logEvent is a
no-op.
The change also adds a few calls to ViewPageTarget.logEvent to log certain
editor actions, documented in https://meta.wikimedia.org/wiki/Schema:Edit.
Change-Id: Iccd171d7cde15b0302d1b4c292bcbcc2a4b337ef
Objectives:
* Make category popup show "Category" rather than missing message -
this is more similar to other popups like inspectors, which identify
what that thing is that you are working on
* Fix alignment of icon and label in category popup
Changes:
ve.ui.Widget.css
* Make popup title align properly with the remove button
ve.ui.MWCategoryPopupWidget.js
* Update message key
*.php
* Add new message
Change-Id: Ia8051125bbc9bde47ceb931e1ebf42b2955481ff
Objectives:
* Rename just about every use of "template" to "transclusion"
* Make a proper data structure for transclusions
* Abstract away template data
* Use more template data in the user interface
* Allow adding parameters
* Allow removing templates, parameters and content
Changes:
ve.ui.Dialog.css
* Add rule to place add param controls on a single line
ve.ui.MWTemplateDialogs.js
* Move template spec loading into transclusion class
* Add remove button for parts and parameters
* Add parameter adding form
* Use template data for labels and descriptions
ve.dm.*
* Add new transclusion data structures
*.php
* Add links to new files
*.*
* Rename all things "template" to "transclusion"
Bug: 39598
Bug: 49403
Change-Id: I3bcf924a3e179cb65f19e833277a39dfd3dad8bd
Media item dialog for settings; drag-and-drop placement; caption
editing still to come.
Bug: 37870
Change-Id: I547e06dcdb92e19f0159660314187c4f1a62f3ed
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