Parameter config is optional (both in the parent class and here),
this subclass forgot to add the fallback.
Though in a plain subclass the local fallback isn't needed
(parent class takes cares of it), in this case it is needed
since the constructor directly accesses config.multiline etc.
Change-Id: I3f9b73efb6c40a29efa221e1654b1247baaca281
Objectives:
* Split reference dialog (at least for now) an edit and an insert dialog
* Add reference search widget for selecting an existing source, or
choosing to add a new one
* Abstract reference names, don't allow editing them and generate them
when needed
* When editing groups, move the internal item and update all references
to it
* Resolve name conflicts when moving a reference to a new group by
generating a new list key
Bonus:
* Add getNodeGroups method to internal list
* Add getUniqueListKey method to internal list
* Add destroy functionality to ce.node to release events and references
Bug: 49733
Change-Id: Ib244ff6ad9b4cee1decfd9b9e1d3d4e9cdcfb78c
Objectives:
* Make options unable to be selected or highlighted when disabled
* Add default styles for selected state
* Fix line-height for option labels
* Use default cursor when field is disabled
Change-Id: I8a535cd6b259b092c2abce27ddb10882cdde6cf5
Objective:
* Make the escape key close dialogs, like pressing the X button
* Auto-focus the iframe on window open
Bonus:
* Add ESCAPE and SHIFT to ve.Keys and use instead of hardcoding numbers
* Use ve.Keys in some other places too
Bug: 49809
Change-Id: Ibf1fce5e24efcd83d9e1465c3cdaac24ff3fb45d
We need to normalise titles so 'user:foo_bar' == 'User:Foo bar', and
we also need to some HTML attribute removal as links from Parsoid
will have href and rel set (again, this should be fixed in by Parsoid
when the do the merging at their end).
Bug: 49985
Change-Id: I5fb5bfc69c344ca4ce4803d7b6116074648a8d7e
We calculate an overlap offset for when the popup widget has been moved
to avoid going out of the viewport, but that offset is only applied to the
body and not the callout.
Change-Id: Ib9d08d60ccfa6562378640c526faf1e8363abbba
Follows-up I99acbd1699:
* "Parent method" comment
* Remove redundant slice() call to convert arguments to array,
native JavaScript methods that take array-like arguments such
as Function#apply and Array#slice are both compatible with
the Arguments objects, no need to convert it. Most invocations
already did this right but a few were recently introduced again.
* Removed silly "Document dialog." descriptions.
* Removed a few redundant "@method" tags in the near vicinity
of code I changed.
* Fixed function invocation to be either on one line or
one parameter per line. Having all arguments on one line
but the name + "(" looks confusing as it suggest there
is only 1 parameter. Same as object literals:
so:
{ foo: 1, bar }
or:
{
foo: 1,
bar: 2,
}
not:
{
foo: 1, bar: 2
}
Change-Id: I379bc2b32603bcf90aba9b4cd0112e7f027d070e
Previously pageExists thought matchingPages was an indexed object when
in fact it was an array. This didn't manifest as a bug as we subsequently
check the normalised URL in the correct manner (using indexOf), but it
did remove the optimisation of not running mw.Title if there was an exact match.
Change-Id: Ic616cbfa0d7ed5447e032dd1f772779db2dc19e5
Objectives:
* Clear this.titles when resetting, otherwise results are shown once and
then blacklisted forever.
* Attach done() before always(), so done() gets called first and not
after always() has dereferenced the request object.
* Remove use of imaginary variables like this.loading, which were never
set, and were referencing even more imaginary methods on other imaginary
objects like this.request.abort()...
Change-Id: Ifbe74346f68b6a91f425b56a2696fd1e46b61e02
If the query is cleared, we should still clear all items and abort any
loading that may be going on. We should still not try and load results
for an empty query though.
Change-Id: If23c6e0469247b1c1c47ab85b9a5a010e8a4fe26
Objectives:
* Allow adding content or templates within a transclusion
* Add template placeholder to model and view which resolves to nothing
when saving (thus disappearing if not resolved)
Changes:
*.php
* Add links to new messages and files
ve.ui.OutlineControlsWidget.js
* Organize controls into "adders" and "movers"
ve.ui.Widget.css
* Add styles for adders/movers sections of outline controls
* Make adders appear on hover to reduce clutter
ve.ui.Icons-*.css
* Add icon for "add item"
ve.ui.Dialog.css
* Add styles for add template fieldsets
* Make placeholder items in the outline italic
ve.ui.PagedDialog.js
* Pass adders config to outline controls
ve.ui.MWTransclusionDialog.js
* Add support for adding content and templates
ve.dm.MWTransclusionModel.js
* Add addPlaceholder method
ve.dm.MWTemplatePlaceholderModel.js
* New class, pretty much an empty part
* Using this makes the UI much easier to work with - no need to special
case the outline control for new items
* Because it's not supported specifically in
ve.dm.MWTransclusionModel.getPlainObject, it produces nothing and goes
away naturally on apply
Change-Id: I3478560fb53ba2ccd3fb26bafb6a61e6415565eb
matchingPages contains titles with spaces, but .toString() returns titles
with underscores, so normalizing with .toString() is incorrect. Use
.getPrefixedText() instead.
This caused a bug in the link dialog where, if the link was an internal
link pointing to an existing page with a space in its name, the "New page"
section would be displayed but would be empty, and the link's target would
be displayed in the "Existing page" section but colored red.
Change-Id: I59d8b87b996d80da1b25124b942bd2b72ef50845
Objectives:
* Allow reordering items in outline widgets using an outline control
widget
* Use an outline control widget to reorder transclusion parts
Changes:
ve.ui.SelectWidget.js
* Emit add and remove events
ve.ui.OutlineItemWidget.js
* Add movable config options
* Add isMovable method
ve.ui.OutlineControlsWidget.js
* New class
* Displays move up/down buttons which are synchronized with an outline
widget
* Doesn't actually move items (since an outline widget is probably
data-driven) just emits events
ve.ui.Widget.css
* Add disabled style for icon button widgets
* Add styles for outline controls widget
ve.ui.Icons*.css
* Add missing icon styles
ve.ui.Dialog.css
* Add styles for outline and controls in editable paged dialogs
ve.ui.GroupElement.js
* Fix bug where items are insertions are in the wrong place when "moving"
them
ve.ui.PagedDialog.js
* Add editable config option which shows outline controls under the
outline
* Pass through movable config option when creating pages
ve.ui.MWTranclusionDialog.js
* Configure paged dialog outline as editable
* Add initialize method to connect outline controls widget events
* Make addPart method automatically add parameters when templates are
added
* Add handler for outline controls move event which re-orders parts
* Make parts movable (params are automatically ordered, so they aren't
movable)
ve.dm.MWTransclusionModel.js
* Add addPart method and use it within the addContent and addTemplate
methods
* Fix documentation lies
* Add getPartFromId method
*.php
* Add links to new files and messages
Change-Id: I919d4c3e9b85d07a97a99c0b2e8739a859bdf2b1
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
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
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
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
Objective:
* Allow inserting images from local wiki and commons
Changes:
ve.init.mw.ViewPageTarget.js
* Add media insert button to toolbar
ve.init.mw.Platform.js
* Add getMediaSources method - defaults to local wiki and commons
ve.ui.MWMediaInsertDialog.js
* New dialog for inserting media
* Uses a media select widget and inserts block images
ve.ui.Dialog.css
* Added styling for media select widget in media insert dialog
ve.ui.Widget.css
* Added styles for media select widget and media select item widget
ve.ui.MWMediaInsertButtonTool.js
* New tool for inserting media
ve.ui.MediaSelectItemWidget.js
* New item widget for media select widgets
ve.ui.MediaSelectWidget.js
* New widget for searching for and selecting media items
ve.ui.TextInputWidget.js
* Added isPending method
VisualEditor.i18n.php
* New messages for media insert dialog
VisualEditor.php
* Added links to new files and messages
PhantomJS--
Change-Id: Ia803ff3ef518782ce76802d2dab7559686a1bb0a
Objective:
* Make all text inputs have the ability to be "pending", not just ones
with a special mixin
Changes:
* Delete pending input widget
* Move pending input widget implementation to text input widget
* Update all uses of pending input widget
* Make pending image a reusable "texture"
* Update styles of text input widget for pending state
* Get rid of checking for mixin since all text inputs can be pending now
Bonus:
* Get rid of unused images, including .psd and .ai files
* Add transparency texture
* Fix input widget not using documented config value
* Fix documentation in select widget (lies!)
Change-Id: Ib46ab01dc39d706e5c25fd473dee0edce51b7e44
Changes:
ve.ui.Widget.css
* Add styles for decorated text input widgets and their icon elements
ve.ui.TextInputWidget.js
* Add icon option which adds an icon before input text
Change-Id: Ib48d795391cb5d110e7dc05658d51129792dfc33
Prologue:
Farewell ve.Editor my good chap… Oh, hey there HTML frames - I didn't
see you there! In a world where iframes are outlaws, and symbols like
document and window are global, there were more than a few assumptions
about which document or window was being used. But fear not - for this
commit (probably) tracks them all down, leaving a trail of
iframe-compatible awesomeness in its wake. With the great ve.ui.Surface
now able to be used inside of iframes, let the reference editing
commence. But there, lurking in the darkness is a DM issue so fierce it
may take Roan and/or Ed up to 3 whole hours to sort it out.
Note to Roan and/or Ed:
Editing references seems to work fine, but when saving the page there
are "no changes" which is a reasonable indication to the contrary.
Objectives:
* Make it possible to have multiple surfaces be instantiated, get along
nicely, and be embedded inside of iframes if needed.
* Make reference content editable within a dialog
Approach:
* Move what's left of ve.Editor to ve.ui.Surface and essentially
obliterate all use of it
* Make even more stuff inherit from ve.Element (long live this.$$)
* Use the correct document or window anywhere it was being assumed to be
the top level one
* Resolve stacking order issues by removing the excessive use of z-index
and introducing global and local overlay elements for each editor
* Add a surface to the reference dialog, load up the reference contents
and save them back on apply
* Actually destroy what we create in ce and ui surfaces
* Add recursive frame offset calculation method to ve.Element
* Moved ve.ce.Surface's getSelectionRect method to the prototype
Bonus:
* Move ve.ce.DocumentNode.css contents to ve.ce.Node.css (not sure why it
was separate in the first place, but I'm likely the one to blame)
* Fix blatant lies in documentation
* Whitespace cleanup here and there
* Get rid of ve.ui.Window overlays - not used or needed
Change-Id: Iede83e7d24f7cb249b6ba3dc45d770445b862e08