Commit graph

591 commits

Author SHA1 Message Date
jenkins-bot 88247dc93d Merge "doc: Fix incorrect documentation in template data model" 2013-07-02 20:05:23 +00:00
Timo Tijhof 1c0cca5460 doc: Fix incorrect documentation in template data model
Per the TemplateData spec:
* Most message values can be null, though they're never undefined.
* 'deprecated' is actually {boolean|string}.

For us:
* Make #isParameterDeprecated always return a boolean
* Add #getParameterDeprecationDescription to get the explanation
  of why a parameter is deprecated
* getParameterDescription doesn't need to pass 'null' for fallback
  since that's the default fallback.
  And it may return null or string.
* #getParameterSets returns an array of Set objects, not an array
  of strings (see spec for more information).

Change-Id: Iee788bc8fa6f0545085a0f154b77b8176f770dd2
2013-07-02 13:02:01 -07:00
jenkins-bot 83627b366d Merge "Make local overlays local to surface and remove insane z-indexes" 2013-07-02 19:45:35 +00:00
jenkins-bot 8d135a0813 Merge "Emit select null on selected item removal" 2013-07-02 19:42:46 +00:00
jenkins-bot 8d3842dc01 Merge "Select widget relative item fixes" 2013-07-02 19:41:54 +00:00
Rob Moen c472b2fe4a Make local overlays local to surface and remove insane z-indexes
ve.ui.Surface.js
* Make local overlay a child of ve-ui-surface and a sibling to
  ve-ce-surface elements.
** This keeps local overlays relative to their surface and eliminates the
   need for insane z-indexes.

ve.ui.PopupWidget.js
* PopupWidget boundaries are now relative to ve-ce-surface and no longer
  protrude out

ve.ce.Node.css, ve.ui.Window.css
* Removal or replacement of insane z-indexes.

ve.ce.FocusableNode.js, ve.ce.ProtectedNode.js, ve.ce.ResizableNode.js,
ve.ui.Context.js
* Translate offsets from local overlay

ve.init.mw.ViewPageTarget-monobook.css,
ve.init.mw.ViewPageTarget-vector.css
* Skin specific z-indexes for global overlay

ve.init.mw.ViewPageTarget.js
* Applied direction specific mw class to ce.Surface vs ui.Surface to
  prevent mw content styles from being applied to ui elements.

ve.ui.Dialog.css
* Adjustments to surface inside of dialog so that relative offsets for
  local overlays can be properly calculated.

ve.ui.Surface.css
* Explicitly force .ve-ui-surface to be relative so that it's children can
  be relatively positioned.

ve.ui.Widget.css
* Removal of unnecessary font-size properties now that local overlay is
  sibling of surface.

ve.js
* Added get relative position helper method to translate position offsets
  from target parent

Bug: 50241
Change-Id: Ibadce404a2286bc5dcec48f0d9da89004dbbd867
2013-07-02 19:35:43 +00:00
jenkins-bot 9ec83c11f7 Merge "Category moving improvements" 2013-07-02 19:17:25 +00:00
jenkins-bot b1859a2f19 Merge "Search widget key commands" 2013-07-02 17:25:42 +00:00
Trevor Parscal 9a7913daa2 Search widget key commands
Objective:

* Enable navigating search results using keyboard up and down keys
* Bubble up query input enter events

Changes:

ve.ui.SearchWidget.js
* Route query input events to emit
* Add handler for keydown events
* Support navigating through the list of results using vertical arrow keys

Change-Id: Ia2e4b27075a8ab2e29a69294e9f7847e8f5a3f83
2013-07-01 17:06:27 -07:00
Trevor Parscal cdc342362c Emit select null on selected item removal
Issues:

* Selected item is removed, but no select even was emitted

Changes:

ve.ui.SelectWidget.js
* On remove, emit select null when removing a selected item
* On clear, emit select null always

Change-Id: I1a94b0f8a841611b20e09f6c02f37fb9589e85c3
2013-07-01 16:19:51 -07:00
Trevor Parscal 4fb94d9586 Select widget relative item fixes
Changes:

ve.ui.SelectWidget.js
* Make getRelativeSelectableItem properly loop around
* Replace confusing and broken getClosestSelectableItem with getFirstSelectableItem since that's the only use case we had for it anyway

ve.ui.PagedDialog.js, ve.ui.LookupInputWidget.js
* Update calls to getClosestSelectableItem to use new method

Change-Id: I2399d01a45c43d1ad663ed6c6de156e796065306
2013-07-01 16:05:08 -07:00
Trevor Parscal ea78f2309c Category moving improvements
Changes:

ve.dm.MetaList.js
* Auto-initialize index to the end of the list (like the docs claim) even when not providing an offset

ve.ui.MWCategoryInputWidget.js
* Cleanup fix for not offering to move the last category to the end

ve.ui.MWCategoryWidget.js
* Allow pressing cancel on the meta dialog after moving a category to the end without crashing

Change-Id: I45059bda022639f7942f1799a42ecf8a4d962df0
2013-07-01 16:01:34 -07:00
Roan Kattouw c41f96cf6b Some basic async code in the initialization
Break setUpSurface into a bunch of parts that setTimeout() each other.
This breaks the initialization of the editor as a whole up into the
following phases:
0) Receive AJAX response, parse HTML
1) Build linear model data
2) Build DM tree
3) Build CE tree, CE DOM, create surface
4) Initialize surface, some UI initialization
5) Launch sanity check, remaining setup, unlock editor

This is a bit hacky right now, we'll probably want to refactor later.

ve.dm.InternalList.js:
* Allow construction without a dm.Document

ve.ui.Surface.js:
* Allow construction based on a dm.Document

Change-Id: Ibf48a7e85cd7376c8f6205ed165ff57e71e34c35
2013-07-01 13:02:10 -07:00
jenkins-bot 8b24c9779a Merge "Restore focus to documentNode on convert" 2013-07-01 19:25:02 +00:00
Rob Moen beadbba79b Restore focus to documentNode on convert
Since format dropdown tool is the only tool where we actually lose
focus to the documentNode, we must restore focus so that firefox
and chrome will display a cursor after converting content branches.

Bug: 50338
Change-Id: I4059b2688565570e0efc21078035775b7aed49e1
2013-07-01 12:22:22 -07:00
jenkins-bot 8159566141 Merge "Allow creating lists in block slugs" 2013-07-01 18:41:48 +00:00
James D. Forrester 662d35178f Add user guide link to beta icon drop down
As part of this, put the 'help' icon next to the beta icon, make the
text not greyed-out (now that it's an actual action) and provide the
link.

On hover, all three items get underlined, which is irritating, however.

Bug: 50476
Change-Id: Id65968072b7134f5864bbd96acf34fd0c23fe17c
2013-07-01 11:07:08 -07:00
Inez Korczyński e02e9e8c82 Allow creating lists in block slugs
Previous when the selection was collapsed and the cursor was in a block
slug we'd get a JS error thrown. This fixes that, though it could do with
a refactor in time.

Bug: 47947
Change-Id: I596ea9bc553f563e3dc7689c518c7d1319ac1dc3
2013-07-01 19:04:54 +02:00
jenkins-bot 87667bd42e Merge "Make toolbar look correct with non-standard browser font size settings" 2013-06-30 19:51:50 +00:00
Inez Korczyński b0b832a796 Make toolbar look correct with non-standard browser font size settings
Assumption about toolbar height never exceeding 88px is not correct. At
least in Chrome, after setting in advanced configuration font size to
"Large" instead of "Medium", the toolbar's height is 110px and part of it
is transparent. Because it is transparent user can see content behind it
when scrolled down, which makes for a not really good experience.

Change-Id: Ibdc2410cc4ab29bfe774961fc062d172386975d4
2013-06-30 19:46:00 +00:00
jenkins-bot f9b8a85662 Merge "Improve async template data loading" 2013-06-30 04:11:01 +00:00
Trevor Parscal 30b56e7597 Improve async template data loading
Objective:

* Fix issue where async behavior of addTemplate caused templates to be added in the wrong order

Bonus:

* Get rid of special adders for transclusion parts, just construct objects outside and use addPart

Change-Id: Ibe579f033873446376d72d3bd1b9f92d9f361de5
2013-06-29 20:51:09 -07:00
Timo Tijhof 7b8eed957f ve.ui.TextInputWidget: Fix TypeError when config is undefined
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
2013-06-28 19:06:43 -07:00
Trevor Parscal de48c88ee3 Use template data for new templates and fix alias bug
Objectives:

* Use template data for templates added to a transclusion using
  the list controls
* Cache template data between different instances of the dialog
* Allow placeholders to be replaced with templates asynchronously
* Save http request and abort pending requests on close

Also:
* Fix breakage of (unused) method getParameterAliases
  (dont delete aliases)
* Remove unused method getTemplateSpec.

Bug: 49778
Change-Id: I391e51cb900ef5560455d6f3d4d2a8b99ed2b034
2013-06-28 23:34:58 +00:00
Ed Sanders 9df1a59818 Disable inspection of references with unknown contents
Ed & Roan:
 Disable editing of references of which we are unable to find the
 source (e.g. <ref name="x"> without a target, or when the target is
 currently nested in something we don't yet process such as inside a
 <references> block or a template).

Timo:
 Improve UI to not be a regular focusable node where the inspector just
 won't show up but add a not-allowed cursor and explanatory tooltip.

James:
 Fix messages to refer to VisualEditor instead of "the" VisualEditor.

Change-Id: Ib2bca092ce13c9187fa8b27ad6a6404cae02aea2
2013-06-27 20:34:32 -07:00
jenkins-bot 9a8cb712b1 Merge "Reference insertion, new and existing" 2013-06-28 01:13:53 +00:00
Trevor Parscal 0aac4c7e60 Reference insertion, new and existing
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
2013-06-27 18:11:31 -07:00
jenkins-bot db38bd835f Merge "Automatically focus on the query input on insert media dialog open" 2013-06-28 00:47:05 +00:00
Trevor Parscal fb789c7ff7 Automatically focus on the query input on insert media dialog open
Change-Id: I03d44d09e3abfffb67adeba5ebe3a52451cc5be5
2013-06-28 00:43:34 +00:00
jenkins-bot 079b4930d5 Merge "Option widget improvements" 2013-06-28 00:43:06 +00:00
Trevor Parscal 3e8a070faa Put the link inspector in the menus overlay
Change-Id: Id8446e0a9d9b0dd7bd04f48405b6818fa39a86e6
2013-06-28 00:36:47 +00:00
Christian Williams 68f635b482 Local Overlay Stacks
After a spirited discussion, localOverlay is getting some children.

* localOverlayBlockers - UI elements that are meant to prevent
interaction with the element. This includes Phantoms and
Highlights.

*localOverlayControls - UI elements that are meant to be
interacted with in order to modify the element. This includes
resize handles and drag marker.

*localOverlayMenus - UI elements that should always position
above all other controls. This includes the context menu.

Bug: 50159
Change-Id: Ic69c2ad275389a31c9fbaf47f3665dcdbb7ac2af
2013-06-28 00:30:54 +00:00
jenkins-bot 80b4a43d7d Merge "Don't compute the end offset to pass to insertMeta()" 2013-06-28 00:12:11 +00:00
jenkins-bot c6fceaa1e2 Merge "Close dialogs on escape" 2013-06-28 00:10:36 +00:00
Trevor Parscal 256ed827d9 Option widget improvements
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
2013-06-28 00:08:00 +00:00
Trevor Parscal 20585c956a Close dialogs on escape
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
2013-06-27 17:00:35 -07:00
Trevor Parscal ed7d42592f Move some of MediaSelectWidget into SearchWidget
Objectives:

* Break apart MediaSelectWidget for re-use
* Rename classes to follow search/result naming scheme

Change-Id: I65aab3dc3d41e31af13e2754e77b7dd185ac90f1
2013-06-27 23:51:09 +00:00
Roan Kattouw 70458e6e78 Don't compute the end offset to pass to insertMeta()
Omitting the offset causes insertMeta() to automatically use the
end offset, so we don't need to compute it in two places. The two
computations were also slightly different.

Change-Id: I55543fdd113a6a986899c093733191df948acb2e
2013-06-27 16:21:02 -07:00
Rob Moen 1b9c077b83 If cursor is obscured by toolbar, on keypress scroll to cursor.
Bug: 48735
Change-Id: I45028ed2f13148332518badd5f4647d4d652884e
2013-06-27 14:09:22 -07:00
jenkins-bot afe99d400a Merge "Fix comparison of MW internal links" 2013-06-27 17:30:00 +00:00
Ed Sanders 14fa3b0999 Fix comparison of MW internal links
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
2013-06-27 17:43:34 +01:00
jenkins-bot 73e460c5bb Merge "ve.ui.ViewRegistry annihilation" 2013-06-27 01:51:53 +00:00
Trevor Parscal 6b5310c562 ve.ui.ViewRegistry annihilation
Objectives:
* Associate models with tools, rather than dialogs and inspectors
* Move tool/model association utilities to ve.ui.ToolFactory
* Obliterate the view registry

Notes:

The only special case for leaving modelClasses definitions in place is
for the linkInspector. It uses these for selection expansion.
Because tools can now override the static canEditModel method, we can
dynamically evaluate a model, rather than be restricted to only
comparing classes. This will be useful for disabling editors for models
that are for some reason incomplete or otherwise broken and cannot be
safely edited.

Change-Id: I7adf254990112d90f1f808593a9111afc7a116b5
2013-06-26 16:52:10 -07:00
Christian Williams eee17a8f09 Fix overlay for Monobook
Because of the z-indexes of major elements of the mono book
skin, and because the overlay containers are appended to the
body, the overlays can't be positioned between the surface and
the toolbar. Before this fix, the overlays are appearing beneath
the surface. This fix will retain proper positioning of the overlays
between the surface and the toolbar for Vector, and will overlay
everything in Monobook.

Later, we will have the overlay container more tightly integrated
with the surface to avoid this stacking problem.

Change-Id: Ibb1553099cc1e35e6a0928a99b584885508ca5b6
2013-06-26 16:10:56 -07:00
jenkins-bot e83cb3f2b5 Merge "Position toolbar if loading with non-zero scroll offset" 2013-06-26 20:17:17 +00:00
James D. Forrester eafe5d844c Discourage (ab)use of H1s, and relabel them
Re-label the headings in the MWFormatDropdownTool with MW-specific
headings per bug 43334, reduce the size of the dropdown's contents a
little to make the headings less vibrant, and move the H1 option to the
end of the list to further discourage its use.

Note that there are some issues with the underlying structure here and our
ability to split the repos into VE-core and VE-MW will need this to be
refactored.

Bug: 43334
Change-Id: I5a58b4dcebd6ceae0ffcd24f663429f25bdc3db9
2013-06-26 19:19:51 +00:00
jenkins-bot 85b3808c9f Merge "Expand recursive call protection in ve.ui.Window#close" 2013-06-26 16:18:28 +00:00
Ed Sanders 45e9ca181e Prevent overlapping link annotations
Use the 'all' mode of SurfaceFragment#getAnnotations to correctly
handle the selections which include linked and non-linked text
in the LinkInspector.

Bug: 50208
Change-Id: I1cab7f3cc4fc9589eced01ad38c59fe5b9622a57
2013-06-26 16:20:51 +01:00
Ed Sanders 4e728ebf26 Expand recursive call protection in ve.ui.Window#close
Focussing the view leads to another call of 'close' which
must be protected against.

Bug: 50140
Change-Id: I8c68468a95cddbc7efb222cf3a1f9868b2949285
2013-06-26 14:00:32 +01:00
Ed Sanders bc04b08892 Position toolbar if loading with non-zero scroll offset
The scroll event doesn't fire if the page is already scrolled
when ve is loaded.

Change-Id: I5b5a2dff2055d9ff1a8b2a2e0016a3fe7aaf22fb
2013-06-26 13:16:20 +01:00
jenkins-bot 01a0ae93b9 Merge "Fix callout position when popup widget has been moved" 2013-06-26 11:07:40 +00:00
jenkins-bot 9b5c0b825d Merge "Set href attribute of newly inserted image to image title" 2013-06-26 02:42:01 +00:00
jenkins-bot a7844ec34a Merge changes Icbf9ac6c,I1e7a1e67
* changes:
  Prevent visual effect on disabled toolbar buttons
  Remove use of filter property for CSS opacity
2013-06-26 02:37:14 +00:00
jenkins-bot 00b72ea0b6 Merge "Don't depend on iframe load events" 2013-06-26 00:26:57 +00:00
Christian Williams a7f471e6e7 Fix z-index of local overlay
Local overlay z-index is positioning overlay items (phantoms, etc)
above the floated toolbar. The overlay container is a sibling to the
toolbar's parent and is later in the DOM. z-indexing is
unnecessary and has been removed.

Bug: 50096
Change-Id: Ib46f66b1d1bea36d761f793e9966e09db6e675ca
2013-06-26 00:00:27 +00:00
Rob Moen 8e8584cc9e Prevent visual effect on disabled toolbar buttons
Bug: 33113
Change-Id: Icbf9ac6cff5e3f914268fe14d1b430609dedd49e
2013-06-25 16:58:14 -07:00
Trevor Parscal c2196b1fe7 Remove use of filter property for CSS opacity
Was used for IE8 support, no longer needed.

Change-Id: I1e7a1e676022dd7607c808bd44848cbf22a9e958
2013-06-25 16:44:06 -07:00
Trevor Parscal e962373e83 Don't depend on iframe load events
It was discovered that nested iframes inside firefox do not fire load
events: http://osdir.com/ml/dev-apps-firefox/2010-03/msg00134.html

Since we no longer care when the iframe is loaded, changing the frame
onLoad method name to load and manually calling it was sufficient.

Bug: 50115

Change-Id: I65c0c404a2a384566701b1c6b1bb978e0b99c90d
2013-06-25 23:12:58 +00:00
Inez Korczyński 537e431466 Set href attribute of newly inserted image to image title
I'm not sure if that's the long term solution, however for now it fixes bug 49844 and bug 49848.

Change-Id: I75dbbfdd248a6f5696252ef3a2d7ca6ede0fa156
2013-06-25 15:09:09 -07:00
Ed Sanders 6b5ed9c711 Fix callout position when popup widget has been moved
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
2013-06-25 11:07:44 -07:00
Ed Sanders 2352613b66 Code style fix: (X) -> ( X )
Change-Id: I7f3ac95621f70d9a89e70e9a51905673240cb51f
2013-06-24 18:51:59 +01:00
Roan Kattouw 0bf155bb36 Fix empty inspector popout bug in Firefox
Due to some sort of mysterious race condition (probably deferred reflow)
calling this.$menu.show() set style="" rather than style="display:block;"
because Firefox believed the parent was still hidden.

Work around this by removing display:none; from the context's CSS rules.
We don't need it because we always manually .hide() these things anyway.

Bug: 50073
Change-Id: I29e210aba9a6265d8364ff8ae49408cb4c2428b9
2013-06-23 19:12:13 -07:00
jenkins-bot dbabfe5514 Merge "Restore selection after dialog close" 2013-06-23 05:49:24 +00:00
Timo Tijhof 8a2c9431e6 Create ref list insertion tool
Fixes (follows-up I1b48ef5240, I6daff5c596):
* Invalid html passed to jQuery constructor.
* Use prop() instead of attr() for boolean values.
* Use append() instead of html() when appending nodes instead
  of parsing html.
* Rename shadowed variable name clash 'mw' to 'mwData'.
* Fix odd construction where we parse '{}' to create an empty
  object.
* Have ve.ce.MWReferenceListNode#update perform changes off-document
  in a detached tree.
* Fix deep property access that can fail. mwData is set to
  either JSON parse of data-mw attr or empty object.
  Accessing mwData.attrs.group needs to be guarded by whether
  mw.attrs is indeed set.
* Have `mw` and `about` attribtue in references list roundtrip
  (especially mw which can data we aren't editing/re-creating).
* Add missing 'refGroup' property to MWReferenceListNode's
  data element (similar to what MWReferenceNode already has).

Change-Id: I67e4f378ccd04e97361d8e58ae57db5353075756
2013-06-22 20:23:22 -07:00
Ed Sanders 847edb4fb5 Restore selection after dialog close
Change-Id: I534e38633700191782a7b088de0ae46a5f800fa8
2013-06-22 00:39:21 +01:00
jenkins-bot 3a3270486a Merge "Match data inserted from MWMediaInsertDialog with MWBlockImageNode" 2013-06-21 21:01:09 +00:00
jenkins-bot 5cfd21754a Merge changes If3d01346,I4e5317f1
* changes:
  Fix incorrectly written CSS that was affecting all table cells on the page instead of cells in mwMetaDialog only
  Fix for rendering block images
2013-06-21 21:00:33 +00:00
jenkins-bot 014b6ed33a Merge changes I379bc2b3,I99acbd16
* changes:
  Straighten out variances in parent method invocation
  ve.ui.MWReferenceDialog: Clean up
2013-06-21 20:53:25 +00:00
jenkins-bot 2bc37bfc29 Merge "Fix logic in link input widget" 2013-06-21 20:14:49 +00:00
jenkins-bot a344396b47 Merge "Remove format tools from mw reference dialog" 2013-06-21 20:13:33 +00:00
jenkins-bot c32378b571 Merge "Delete default sort key if set to empty string" 2013-06-21 20:10:12 +00:00
jenkins-bot ecbb941038 Merge "Allow UI context to update when selection is from 0" 2013-06-21 19:39:57 +00:00
Inez Korczyński 50ec8c507a Match data inserted from MWMediaInsertDialog with MWBlockImageNode
Change-Id: I145beba19a8f69f6fd8c29302350c399b4c51c55
2013-06-21 12:36:14 -07:00
Inez Korczyński 25d8d2895d Fix incorrectly written CSS that was affecting all table cells on the page instead of cells in mwMetaDialog only
Change-Id: If3d01346d7267aec444d573ac83516083a3689bc
2013-06-21 12:33:38 -07:00
Timo Tijhof 2fb1a11a1a Straighten out variances in parent method invocation
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
2013-06-21 19:20:37 +00:00
Timo Tijhof 0c2e35593e ve.ui.MWReferenceDialog: Clean up
* Optimise initialisation by building the tree from the bottom up
  and applying the class last.
* Actually document the dialog. Documenting it as "Document dialog"
  is useless and confusing. If there is no documentation yet, leave it
  empty so it is included in jsduck's optional "no_doc" warning list.
* Remove the redundant "Call" prefix in the parent method description,
  we don't do this else where either.

Change-Id: I99acbd1699b2c99a2c9b58f34dc1e07bea58203d
2013-06-21 11:36:44 -07:00
Trevor Parscal 469cb4aa99 Add reference icon
Objectives:

* Introduce new icon for a reference
* Repurpose existing reference icon for references block

Change-Id: I1bfcdbeda3b9730d62d6b264ef72921e93623f7e
2013-06-21 10:31:43 -07:00
Ed Sanders 51be472159 Fix logic in link input widget
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
2013-06-21 16:42:54 +01:00
Ed Sanders 4116742bcb Remove format tools from mw reference dialog
Because you can't put a heading in a reference.

Bug: 49715
Change-Id: Ic823a90398dafca1caf8fa4142d98133ab661d7c
2013-06-21 16:23:29 +01:00
Ed Sanders 7b1df21aeb Delete default sort key if set to empty string
Bug: 49724
Change-Id: Ie3caaf4811f87911444462f83d511c0cc46c0716
2013-06-21 11:48:20 +01:00
jenkins-bot 93686139f5 Merge "mw.ViewPageTarget: Move save dialog out of toolbar tree" 2013-06-20 22:14:50 +00:00
Timo Tijhof 85c4ebf373 mw.ViewPageTarget: Move save dialog out of toolbar tree
Bug: 49275
Bug: 49361
Change-Id: I2fbc4c8af943f1b096b8912191924961405d5c47
2013-06-20 14:16:50 -07:00
Ed Sanders 8730a913dc Allow UI context to update when selection is from 0
Previous condition was put in as part of I9ed6f9fb as a
temporary fix for bug 42842. However this code was causing
the popup widget to not appear for items at the start of
the document. It appears the bug it was put in to fix
has since been fixed elsewhere.

Bug: 49421
Change-Id: I8bcdea0f7a6951216bf8368865d23ef6246880ea
2013-06-20 19:33:44 +01:00
Ed Sanders 2c421258f8 Delete/don't insert transclusion if object is empty
The transclusion dialog lets you completely delete all templates
within it. If this happens we should delete the node completely, or
not insert it if it's a new instance.

Bug: 49831
Change-Id: Ic5d4fbf73f3d1be9cf877bc8b98096de9e98991a
2013-06-20 17:23:29 +01:00
jenkins-bot 43af678ad4 Merge "ve.ui.PanelLayout: Set default to span accross available space" 2013-06-20 00:29:42 +00:00
jenkins-bot 58c7db50e3 Merge "Always float toolbar to top of page, not last branch node" 2013-06-20 00:27:06 +00:00
Timo Tijhof 82997d73e8 ve.ui.PanelLayout: Set default to span accross available space
Without these properties set, the layout is collapsed into a 0x0px square due to the
parent having overflow-x: auto; and no width/height set.

Change-Id: I77aef8afa3327b11f453196badcdfad3f51f7c3d
2013-06-19 16:20:10 -07:00
Ed Sanders 8d2ba6effe Add resource attribute to newly created images
Bug: 49596
Change-Id: Ifbde0f5a4c8eb01df7b429abbb8ab0d4431c1c6f
2013-06-19 20:47:14 +00:00
Ed Sanders 0072e66183 Always float toolbar to top of page, not last branch node
The check for the toolbar not overlapping the last branch node
'fixes' an edge case where the user has scrolled too far, and
the viewport is shorter than the last branch. A more common
problem caused by this is that if the last branch is very tall
the toolbar disappears whenever you scroll past it.

Bug: 48662
Change-Id: I1c7662f2b6f1ced6f80dec16c6ed69a8cc0c06c8
2013-06-19 18:44:38 +00:00
Ed Sanders 1469575082 Fix inconsistencies and errors with Dialog onOpen/Close
Removed inherited (and often wrong) documentation, replaced direct
usage of onApplyButtonClick with more standard onClose handling,
and one case of calling the wrong parent method.

Change-Id: I86ed16860e996b42c141a6499eefb9084d759a72
2013-06-19 18:35:45 +00:00
jenkins-bot ebddcf9239 Merge "Transclusion editor template naming goodness" 2013-06-19 01:37:07 +00:00
Trevor Parscal ece74379de Transclusion editor template naming goodness
"Template" parts should be labeled with a normalized version of what you would actually write inside a set of curly brackets.

Change-Id: I4b9c541a01da86cb078d38012e5a9fead2fa233c
2013-06-18 18:33:58 -07:00
jenkins-bot 7289df9674 Merge "Make media insertion queries less horrible" 2013-06-19 01:19:43 +00:00
Trevor Parscal bf268e82a5 Make media insertion queries less horrible
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
2013-06-18 18:17:05 -07:00
Inez Korczyński a886952563 Support for editing captions of block images
Bug: 38129
Change-Id: I02207e78f5c28eaccd9bc97a48baa78280192255
2013-06-18 17:57:10 -07:00
Trevor Parscal 4a7503ac10 Add templates from toolbar
Change-Id: I0aa21bed13d1dbc693c1db03eab903af55a1517a
2013-06-19 00:23:23 +00:00
Trevor Parscal 2044a5796b Fix transclusion button message
Change-Id: I90cdb600ffb6e7d80cf6042b50ef0bf8a22c6cbd
2013-06-19 00:17:46 +00:00
Trevor Parscal a8fcfb4a14 Handle media select widget empty queries properly
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
2013-06-18 17:11:38 -07:00
Trevor Parscal 23b2da91fd Template and content adding
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
2013-06-18 23:37:44 +00:00
Trevor Parscal 7c171ae0a5 Whitespace cleanup
Change-Id: I49417b95a6c4c2538715e09b74ed3607f6741c3a
2013-06-18 21:53:03 +00:00