Commit graph

559 commits

Author SHA1 Message Date
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
Trevor Parscal e8d8308d9a dialog: Remove background color body
This was causing strange rendering problems, and it's really not even
needed.

Change-Id: I130e9e5c5f2c5ab99b5245de6c0243e9be9cf558
2013-06-18 21:52:43 +00:00
jenkins-bot 9ba2bab2de Merge "ve.ui.IconButtonWidget: Extend css transition from 100ms to 200ms" 2013-06-18 21:48:41 +00:00
jenkins-bot 61879a93ed Merge "ve.ui.LookupInputWidget: Hide lookup input widget menu when empty" 2013-06-18 21:46:39 +00:00
Trevor Parscal 00d5c41e02 ve.ui.IconButtonWidget: Extend css transition from 100ms to 200ms
Makes make it look nicer.

Change-Id: Ib7c1021a31f607b6e697f16fe797358c0167acee
2013-06-18 21:45:33 +00:00
Trevor Parscal db48513465 ve.ui.LookupInputWidget: Hide lookup input widget menu when empty
Change-Id: Iac397c2ddcb7ea54c751485bdd922f7b19494d1e
2013-06-18 21:42:41 +00:00
jenkins-bot 8e4177c960 Merge "Only undo on MWMetaDialog close if small stack is non-empty" 2013-06-18 19:34:15 +00:00
jenkins-bot 4fdebb5679 Merge "doc: Tag ve.ui.Window static properties as inheritable" 2013-06-18 19:33:12 +00:00
Trevor Parscal 42f0321b84 Element fixes
Objectives:

* Make get$$ work with empty jQuery selections
* Reset the $items selection when clearing a group

Changes:

ve.Element.js
* Add existing context property to possible solutions

ve.GroupElement.js
* Reset this.$items after detaching them

Change-Id: I73b46649d7ecd5045941086c4e1bb3241c8f4ef3
2013-06-18 11:35:07 -07:00
Timo Tijhof 48dd042068 doc: Tag ve.ui.Window static properties as inheritable
Also updated outdated reference to dialog in demo.

Change-Id: I6c9997d4b4059348b400f592d6ae95cd9f43996c
2013-06-18 11:22:27 -07:00
jenkins-bot 388faa8d58 Merge "Correctly distinguish between Deferred and Promise" 2013-06-18 18:01:38 +00:00
Roan Kattouw d5365d2b5a Correctly distinguish between Deferred and Promise
Deferred is read-write, Promise is read-only. Document and return
the correct types.

Change-Id: Icfd6efb07b222c73d49b97ddbfe6565b8542ad00
2013-06-18 10:56:56 -07:00
Ed Sanders 84fbd1db2c Only undo on MWMetaDialog close if small stack is non-empty
Added return boolean to ve.dm.Surface#breakpoint to indicate if
and transactions were pushed to the big stack. Use this value in
MWMetaDialog to see if we need to undo on close.

Added tests for ve.dm.Surface#breakpoint.

Bug: 49630
Change-Id: Ieb2e9e361afe057af93c4d374acc85df58bfb4c3
2013-06-18 16:55:03 +01:00
Roan Kattouw 9c19bc385e Actually normalize page titles correctly in MWLinkTargetInputWidget
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
2013-06-18 00:37:17 -07:00
jenkins-bot 8b414bf426 Merge "grunt: Also delete QUnit temp files when test fails" 2013-06-17 18:29:21 +00:00
Ed Sanders 4986576cc4 grunt: Also delete QUnit temp files when test fails
Move post-qunit task to qunit.done event which fires both on
success and failure.

Define pre-qunit + qunit as a group test 'unit', so they can
be run from the command line (previously 'grunt qunit' would
fail) as 'grunt unit'.

Also add override comment to css file using non-standard
property so csslint passes again (follows-up b2fbe35).

Bug: 49431
Change-Id: I5079d00a63d43276a12dd78c306bb3819470631d
2013-06-17 11:27:52 -07:00
jenkins-bot 59bf9966b4 Merge "Fix logical conflicts from the transclusion merge." 2013-06-17 18:14:29 +00:00
Ed Sanders dcbea2328c Code style fix: @return -> @returns
Change-Id: I26daca6313bf09055af8f980ba0065782257fd54
2013-06-17 11:50:24 +01:00
Ed Sanders 642a84483e Fix logical conflicts from the transclusion merge.
Change-Id: Ic9d708cdba74c908d14839def5050c8825134c56
2013-06-17 10:36:47 +01:00
Trevor Parscal fc8c46dd74 Reference name and group editing
Objective:

* Allow editing reference groups and names in the reference dialog

Bonus:

* Modify attribute transaction builder to support multiple attribute
  changes in a single transaction

Changes:

ve.ui.MWReferenceDialog.js
* Load ref name and group from model
* Save ref name and group, if changed, to model

ve.ui.ListAction.js, ve.ui.Transaction.test.js, ve.ce.ResizableNode.js
* Update use of newFromAttributeChange to newFromAttributeChanges

ve.dm.SurfaceFragment.test.js
* Add test for new changeAttributes method

ve.dm.InternalList.js
* Missing new line at end of file

ve.dm.Transaction.js
* Change newFromAttributeChange to accept an list of attribute changes and
  produce a single transaction that applies one or more attribute changes
  at once

ve.dm.SurfaceFragment.js
* Fix bug in getCoveredNodes where the wrong mode name was being used
* Add changeAttributes method, which applies attributes to all covered
  nodes and allows filtering of which types of nodes the attributes are
  applied to

ve.dm.MWReferenceNode.js
* Actually write key and group back to DOM
* Separate onRoot functionality into addToInternalList so it can be called
  separately (similarly onUnroot/removeFromInternalList)

ve.ce.MWReferenceListNode.js
* Clone internal item CE node before appending to avoid rendering bug.

*.php
* Add links to messages and sort them

Change-Id: Ic4121e4fcfc09265d5863af6f078cdeb77926c8e
2013-06-14 15:29:56 -07:00
jenkins-bot 3e1e544e48 Merge "Add group field to reference dialog" 2013-06-14 22:24:38 +00:00
Trevor Parscal ac26f5fc69 Outline controls
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
2013-06-14 11:56:30 -07:00
Trevor Parscal acea97263b Add group field to reference dialog
Change-Id: Icf9ea348cd97bdb09ddf18769f53c01ea5a8b7ef
2013-06-14 10:30:03 -07:00
jenkins-bot 0bffa7b119 Merge "Improve category widget styling" 2013-06-13 19:27:57 +00:00
Trevor Parscal 6fba13b453 Improve category widget styling
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
2013-06-13 19:26:29 +00:00
jenkins-bot 03127491b2 Merge changes Ic189011e,I7617a35b
* changes:
  Make references dialog scroll
  Make fieldset layout icons optional
2013-06-13 17:04:19 +00:00
jenkins-bot 628fd18930 Merge "Category popup fixes" 2013-06-13 15:30:07 +00:00
Trevor Parscal e2b7504b8e Category popup fixes
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
2013-06-12 16:44:10 -07:00
Trevor Parscal d3a2fab2c4 Transclusion editing
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
2013-06-12 16:39:13 -07:00
Trevor Parscal caa16737d5 Make references dialog scroll
If the content in the sub-editor gets big enough, this can be a problem.

Change-Id: Ic189011e64090186d87a397b2b047057a97f2a3d
2013-06-12 16:24:38 -07:00
Trevor Parscal 91d615e684 Make fieldset layout icons optional
Change-Id: I7617a35bd9e8322d0b9f8e225885ccbe5fa230ee
2013-06-12 16:23:48 -07:00
jenkins-bot 5f30bd9ed6 Merge "References dialog cleanup" 2013-06-12 19:25:59 +00:00
Trevor Parscal 8f9d2a607e Cleanup unused dialogs
Objectives:
* Remove unused dialogs

Changes:

*.js
* Remove unused stuff
*.php
* Cleanup links to files and messages

Change-Id: Ie670afa3aef1757151e385bf922464b85f662a7d
2013-06-12 11:49:44 -07:00
Trevor Parscal 2d044518bd References dialog cleanup
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
2013-06-12 11:27:49 -07:00
Trevor Parscal 18cde8a420 Actually fix bug 48556
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
2013-06-12 01:53:14 +00:00
jenkins-bot 75d36e5b32 Merge "Set sort keys on click-out too" 2013-06-11 21:16:55 +00:00
jenkins-bot 2573708132 Merge "Improve langlinks styling in meta dialog" 2013-06-11 21:16:02 +00:00
jenkins-bot 9e74da4f31 Merge "Add missing documentation for category widgets" 2013-06-11 21:14:54 +00:00
Trevor Parscal 0c935f69af Improve langlinks styling in meta dialog
Change-Id: I88d6d374d34dc08ecf46053cfc639c03ec23f8bf
2013-06-11 14:02:28 -07:00
Roan Kattouw 9507b7767e Add missing documentation for category widgets
Change-Id: Idd01bb8d01363cb2eaf311abae8fa5ecf7b36f0e
2013-06-11 13:01:37 -07:00
jenkins-bot 2ce91bf4ca Merge "Text input widget enter event" 2013-06-11 19:59:33 +00:00
jenkins-bot 4d664cbeb6 Merge "Improve input widget value sanitization" 2013-06-11 19:47:34 +00:00
jenkins-bot f41045c51e Merge "Paged dialog upgrades" 2013-06-11 19:46:24 +00:00
Roan Kattouw 1be42c8fa6 Set sort keys on click-out too
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
2013-06-11 12:41:22 -07:00
jenkins-bot ff48204896 Merge "Don't offer to move the very last category to the end" 2013-06-11 19:28:50 +00:00
jenkins-bot 0be4835151 Merge "Break words in the category dialog" 2013-06-11 19:28:09 +00:00
jenkins-bot 783a33624e Merge "Clean up incorrect use of regular expressions in CategoryInputWidget" 2013-06-11 19:27:22 +00:00
Roan Kattouw 514039b2ba Clean up incorrect use of regular expressions in CategoryInputWidget
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
2013-06-11 12:25:41 -07:00
Trevor Parscal c32564f36d Text input widget enter event
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
2013-06-11 19:21:32 +00:00
Trevor Parscal 6a3badfcc7 Improve input widget value sanitization
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
2013-06-11 19:21:27 +00:00
Trevor Parscal 252e9b3d12 Paged dialog upgrades
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
2013-06-11 19:20:57 +00:00
Roan Kattouw 73c393e3ab Use the correct $$ in the meta dialog
Change-Id: Id23228c67eb4e50b3912b6148374e459b0f59b34
2013-06-11 10:49:53 -07:00
jenkins-bot 9972fa86ea Merge "When editing meta items, modify them rather than rebuiding them" 2013-06-11 11:12:52 +00:00
Roan Kattouw b2fbe35962 Break words in the category dialog
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
2013-06-10 16:49:01 -07:00
Roan Kattouw ad3a0ba1a2 Don't offer to move the very last category to the end
Bug: 48556
Change-Id: I93ce05f7cbb28313a3f0827539f0528c366aeb7e
2013-06-10 16:00:25 -07:00
Roan Kattouw 8e8ddd9cad Fix exception in InputWidget when config.value isn't set
Change-Id: I0d41d8b39aa6777f206ec47b8ceefff012e2b00b
2013-06-10 15:52:25 -07:00
Ed Sanders e67b4030f3 Remove Parsoid hack and fix new references.
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
2013-06-10 23:01:17 +01:00
Roan Kattouw 983d9287e9 When editing meta items, modify them rather than rebuiding them
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
2013-06-10 14:36:35 -07:00
Trevor Parscal 8039b1c2f8 Insert Reference
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
2013-06-10 20:14:08 +01:00
Christian Williams babaa4118d FocusedNode Selection
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
2013-06-07 17:49:35 -07:00
Trevor Parscal 1fd7e85846 Image insertion
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
2013-06-06 17:36:55 -07:00
jenkins-bot 9fcdd0b513 Merge "HACK: Update template dialog for Parsoid's url -> href change" 2013-06-07 00:21:44 +00:00
Catrope 13c9b117c1 HACK: Update template dialog for Parsoid's url -> href change
Also need to strip ./ and ../

This is a dirty hack, Timo to clean this up

Change-Id: I7f377d916b90f5cdecfcd77a6d5276747a543761
2013-06-07 00:09:04 +00:00
Trevor Parscal f1d481ff64 Prevent scrolling in top-level window while dialog is open
Because scroll events cannot be canceled or prevented from bubbling
up, the only way to prevent the scrolling is to cancel the actual key
and mouse wheel events.

PhantomJs -= 2

Change-Id: I540738459181c37d11caf5db07345703e7000ef9
2013-06-06 23:43:19 +00:00
jenkins-bot 002e8d9095 Merge "Pending input refactor" 2013-06-06 21:47:09 +00:00
Trevor Parscal 8a8a337ce5 Pending input refactor
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
2013-06-06 21:17:35 +00:00
jenkins-bot a3e5e9d76d Merge "Fix API request for language links" 2013-06-06 15:34:26 +00:00
Ed Sanders fc5ead9212 Code style fixes: 'function(' => 'function ('
Change-Id: I905f6bec5c12903775bf3bb1085d26c9ea001eca
2013-06-06 13:02:16 +01:00
Ed Sanders 6e70953a94 Fix API request for language links
Fixes placement of 'indexpageids' in ajax options from I5b8fdfb78a211783

Bug: 48814
Change-Id: I897da1cf06c79ee40e29fb632d09cddb57144ada
2013-06-06 12:36:53 +01:00
James D. Forrester 760470ab38 Give users a read-only view of language links
This makes the 'category' section of the meta-data panel less lonely, and
prompts us to actually do this at some point quite soon (or encourage others
so to do).

Bug: 48814

Change-Id: I5b8fdfb78a2117839277a683db47fe97107d87b0
2013-06-05 20:22:58 -07:00
jenkins-bot ebbcc86ecf Merge "Make the mwMeta dialog trigger a toolbar action, not a button" 2013-06-05 22:08:58 +00:00
James D. Forrester 96b007eb7b Make the mwMeta dialog trigger a toolbar action, not a button
This has the secondary impact of moving mwMeta dialog out of experimental mode.

Change-Id: I3bb61d536826c6ba139661861092cd63423d99a4
2013-06-05 15:02:19 -07:00
Ed Sanders 7e94da8a3b Fix double width border between toolbar and surface in dialog.
Change-Id: I647a5f4c37d543e8a7c90eecf8cbe3a7a856cc47
2013-06-05 15:02:07 +01:00
Timo Tijhof 57960a73bd Add .csslintrc file and fix remaining warnings
Adding a fairly loose .csslintrc file so that our code
passes it.

The following options cause warnings in our code and have been
disabled for now:

* adjoining-classes
  > Don't use adjoining classes.
  > .ve-ui-widget-disabled.ve-ui-textInputWidget textarea:focus {

* box-sizing
  > The box-sizing property isn't supported in IE6 and IE7.
  > box-sizing: border-box;

* box-model
  > Using width with border can sometimes make elements larger than you expect.
  > border: solid 1px #ccc;
  > Using width with padding can sometimes make elements larger than you expect.
  > padding: 0 0.75em 0 0.75em;
  > Using width with border-right can sometimes make elements larger than you expect.
  > border-right: 1px solid #eee;

* fallback-colors
  > Fallback background-color (hex or RGB) should precede RGBA background-color.
  > background-color: rgba(104,171,255,0.1);

* important
  > Use of !important
  > position: relative !important;

* outline-none
  > Outlines shouldn't be hidden unless other visual changes are made.
  > .ve-ce-documentNode[contenteditable="true"]:focus {

* qualified-headings
  > Heading (h1) should not be qualified.
  > .ve-ce-branchNode h1:empty:before,

* universal-selector
  > The universal selector (*) is known to be slow.
  > .ve-ce-protectedNode * {

* unqualified-attributes
  > Unqualified attribute selectors are known to be slow.
  > .ve-ce-documentNode[contenteditable="true"]:focus {

Fixes made:
* modules/ve/ce/styles/ve.ce.Surface.css:
 [L66:C2] margin can't be used with display: inline.
* modules/ve/ui/styles/ve.ui.css: Unknown @ rule: @-ms-keyframes
 Internet Explorer < 10 doesn't support keyframes. IE10+ supports
 the standard property. I don't think ms-keyframes ever existed
 http://caniuse.com/css-animation. ms-transform did exist
 http://caniuse.com/transform.

Change-Id: I728a48e489c079e1c94a506bb00c245de9551eb6
2013-06-05 11:07:00 +00:00
Timo Tijhof b463c5d377 jshint: Fix trailing comma
Due to the "es5: true" jshint option we enabled, these
warnings were surpressed. I've disabled the option since
we no longer require it. It was enabled in 07c86fc to fix
a bug with jshint. This bug has now been fixed.

Change-Id: I55b7d031eb5581af5f733f050cf2ea98dacb2af6
2013-06-05 13:00:49 +02:00
Timo Tijhof 0560084393 ve.ui.MWTemplateDialog: Implement inferring of template data
Clean up of logic implemented during the template-sprint:

* Store spec inside the content model, directly associated
  with the content-part. This allowed fixing the bug where
  two spec-less template invocations overwrote each other's
  made-up template data due to it using "target.wt" as key.
  The opener now provides the fetcher with a "specId" which
  is set to "part/<id>" for wt-generated template targets.

* Batching is now implemented inside the fetcher instead
  of outside. This allows calling "getTemplateSpecs" inside
  the loop with a dedicated callback for each spec to store
  it in the content.parts[i] object passed by reference.

  It also makes it easier to use by different code paths.
  You call it as much as you like and it will queue up
  naturally through javascript yielding and then make a batch
  request. This is based on the pattern I used in MediaWiki core
  for mw.loader#addEmbeddedCSS.

Follows-up e7af635, da679b7.

Change-Id: I4d7121229d060a96d927585c987a1a81a474b922
2013-05-30 18:37:51 +01:00
Trevor Parscal eec6b99369 Add icon option to ve.ui.TextInputWidget
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
2013-05-29 12:39:07 +01:00
Trevor Parscal 750ab24d31 Add search icons
Change-Id: Id5b74916502ea3f94c79968e2dd7f64a563896ce
2013-05-29 11:57:04 +01:00
Trevor Parscal da679b7a9c Template dialog cleanup
Objectives:

* Break template page creation into it's own method
* Get rid of styling being applied in JavaScript
* Fix styling issues

Changes:

ve.ui.MWTemplateDialog.js
* Add method for adding a template page
* Replace css calls with addition of classes for styling
* Cleanup of append calls

ve.ui.Dialog.css
* Make inputs in the template dialog full width and a reasonable height

ve.ui.Widget.css
* Swap margins with padding in labels to prevent layout issues
* Prevent textareas from being resized in safari/chrome

Change-Id: I4030d8605aad865251ecd0aeb8cc72d333bed6a4
2013-05-29 11:03:52 +01:00
Trevor Parscal b0f464ef0e Add support for editing multi-template nodes
Objectives:

* Refactor template dialog to support loading template data for, and
  editing multiple templates and interleaved content in a template node
* Update template node model to generate multi-template wikitext

Changes:

ve.dm.MWTemplateNode.js
* Rewrite getWikitext method to work with multi-template formats

ve.dm.MWTemplateDialog.js
* Retain information about the node and template calls
* Break AJAX handler into its own method
* Attach event handlers to inputs directly so template values are
  edited directly on the fly
* Refactor page building to support multiple templates
* Add multi-template support for template data API call
* Add support for editing plain text content

Change-Id: I92ff8a9e186701a3f8da88def92a5b7dcb607897
2013-05-29 01:10:57 +01:00
Trevor Parscal 6d8de30853 Use config object for ve.ui.PagedDialog.addPage optional args
Objectives;

* Cleanup the addPage API
* Add optional index param to addPage method

Changes:

ve.ui.MWMetaDialog.js, ve.ui.MWTemplateDialog.js
* Update uses of addPage

ve.ui.PagedDialog.js
* Bundle existing optional arguments into object
* Add index option for inserting a specific index

Change-Id: Idcef4d0a52fb817c7d888990920b2c12224a3392
2013-05-28 20:33:32 +01:00
jenkins-bot e2258af635 Merge "Make menus render on the very top of everything" 2013-05-28 13:01:21 +00:00
Trevor Parscal f16eb56a95 Make menus render on the very top of everything
Menus dismiss automatically on blur, so it's safe to make them on the very top of everything

Change-Id: I08bed7f7fbf108f1197c4b6c52ab5b5159e3c982
2013-05-28 13:59:05 +01:00
Trevor Parscal 3be13a7cbc Consistent use of mw in HTML classes, and data element and annotation types
MWfooBar or MWfoobar should be mwFooBar

Change-Id: I30f0ef05960c9df218ef6f1cb161ff6ccd529bc7
2013-05-28 13:49:56 +01:00
Trevor Parscal dd0b331a93 Re-fix pixel grid snapping on new text style icons
Trevor tweaked the pixel grid snapping on my previous commit
but it appears that introduced some errors as well. The horizontal
lines in underline-a and strikethrough-s no longer have integer
x-coordinates, and on underline-u the whole object is offset
by (0.166, 0.166).

Bug: 47780
Change-Id: I51f2605e7d8e2bab1d641f02244d5cd24f505676
2013-05-26 14:30:53 +02:00
jenkins-bot 23595970fe Merge "Remove duplicated code breaking the template dialog" 2013-05-26 12:09:55 +00:00
jenkins-bot cd637c6c35 Merge "Fix misspelled event handler" 2013-05-26 11:19:35 +00:00
jenkins-bot 6ddf7f3695 Merge "Rename 'langlinks' to 'languages'" 2013-05-26 09:19:45 +00:00
Catrope 2fd9454c67 Convert from DOS line endings (CRLF) to Unix ones (LF)
Change-Id: I66c2d6662c7512d5c55daf7a8a1876f00f8a7705
2013-05-25 23:51:21 +02:00
Ed Sanders dd0086468e Rename 'langlinks' to 'languages'
For internal naming consistency (e.g. with MWLanguageMetaItem).

Change-Id: Ifb53fa10da52e1ea87389b024b7c581b8dd730e6
2013-05-25 18:07:46 +02:00
jenkins-bot e51c896d29 Merge "Remove trailing whitespace everywhere" 2013-05-25 15:05:35 +00:00
Catrope dc961f6773 Remove trailing whitespace everywhere
Change-Id: I14f812bd31bd33d9fbd1148a474cbe7a3375d954
2013-05-25 15:04:11 +00:00
Trevor Parscal fb768ddcaf Restore window overlays
And use them for the category widget for it's popup.

Change-Id: I43db14c749400efa6a770343afbdfa16dd6bff30
2013-05-25 15:44:36 +02:00
jenkins-bot cddab2bafc Merge "Fix undefined i18n message in category popout" 2013-05-25 13:03:15 +00:00
Catrope 4f1ed682ed Fix misspelled event handler
Change-Id: I3f3091aad24d4bfdea08fbce1c331e8767866bbc
2013-05-25 14:53:33 +02:00
Catrope d13e09ea6d Fix undefined i18n message in category popout
Message was renamed earlier but this caller wasn't updated

Change-Id: I7ec37c6e0fd6fbbe766166704ea797c9ffd6684b
2013-05-25 14:49:27 +02:00
Catrope b70d6e1b45 Remove duplicated code breaking the template dialog
Change-Id: Ied5dc71106601ab354441c2d81507b616553c0d9
2013-05-25 14:23:29 +02:00
James D. Forrester c85e9ad161 Fix documentation for GridLayout to add a return type
Change-Id: I461160b01ae9fc4448904eeaf150570989d09d45
2013-05-25 12:48:17 +02:00
James D. Forrester 5819375022 Internationalisation for the metadata dialog
Change-Id: Iefb6d5c90583f0684cb9548d38b83048b43d3c81
2013-05-25 10:11:35 +00:00
Ed Sanders 6ca45aa2c8 Remove language page tab from MW meta dialog
MW meta is close to being moved out of experimental, but language
editing is not in line for the beta release.

Bug: 48561
Change-Id: Ie87a3c7dde2f29c3898c08d4cade5c0ba2f937dd
2013-05-24 20:26:14 +02:00
Ed Sanders ce86aa77c8 Add MW meta button to toolbar
Bug: 48561
Change-Id: Ibf63329a53bcd8043d46315239c19be4e681a18a
2013-05-24 15:54:50 +00:00
Ed Sanders 626a8c60f2 Make MW meta dialog experimental
Also remove the exception thrown when we try to add an non-existent
toolbar button, as it may just be experimental and not loaded.

Change-Id: I0a60421f45d7a3941c510defc60d1fbf9469e784
2013-05-24 17:53:06 +02:00
Ed Sanders 026af0d6c0 Remove unused toolbar group name.
Can't see why we'd need to style toolbar groups differently.

Change-Id: I0646b8cf37ab19e34a8ed2eb8558773365403610
2013-05-24 15:36:00 +00:00
Trevor Parscal 2e76271b4e The Great ve.ui.Surface refactor of 2013
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
2013-05-24 14:01:02 +02:00
Timo Tijhof 917fbc6f30 ve.ui.Toolbar: Clear the float before the toolbar
On wikis where certain "topicons" exist the toolbar showed a
weird blank space pushing the entire toolbar down and
ve-ui-toolbar-actions to the left.

Bug: 48734
Change-Id: Ic5f73ac1eb8c41b891dd1c67b71795cb6c456141
2013-05-23 01:07:51 +02:00
jenkins-bot f8e36324c0 Merge "Clicking link button while link inspector is already open throws error" 2013-05-22 19:57:14 +00:00
jenkins-bot df1e82bcf9 Merge "ve.ui.MWTemplateDialog: Implement templatedata API fetch" 2013-05-22 18:03:35 +00:00
Timo Tijhof 70694b2bbf MWLinkTargetInputWidget: Normalise value before matching
Don't suggest a "new page" (redlink) for values that are
strictly different but the same as a suggestion according
to mw.Title (e.g. input "foo" with an existing "Foo" page
should not suggest a redlink to inexistant page "foo").

Bug: 48476
Change-Id: I66f5fc56554984af58d6223dc6cd76b3ab9940bd
2013-05-22 00:20:41 +02:00
Ed Sanders 38f199d505 Clicking link button while link inspector is already open throws error
Bug: 48549
Change-Id: Ia97b6e3d862e02f5c55cac3f490fd8f26052027a
2013-05-21 16:26:45 +01:00
Timo Tijhof e7af635e88 ve.ui.MWTemplateDialog: Implement templatedata API fetch
Fetch
* Added basic name expansion logic since bug 48663 is not yet
  resolved in Parsoid.
* Fetch info from template data API.

Clean up (follows-up 97157a1c, de203cb8, 718db58)
* Remove redundant initialize method.
* Pass the entire target object to #getTemplateData
  because `target.wt` is *not* the template name.
* Reorganise #createPage to be more logical and rename
  to #createParamPage.
* Add todo comments for things currently missing.
* Implement error handling of promise to prevent UI from
  going stale if the promise is not resolved.
* Fix documentation in ve.ui.MWCategoryInputWidget.

Change-Id: Ie0114a81eead86d7a3b3e3a7a5b10d25c457b524
2013-05-20 23:50:19 -07:00
jenkins-bot 3b85e30f6a Merge "Icons for underline, strike & super/subscript buttons" 2013-05-20 23:58:23 +00:00
Ed Sanders 40e45d176a Icons for underline, strike & super/subscript buttons
Bug: 47780
Change-Id: I2f317e1dda2c2e2fceac401768c732dae02e83ce
2013-05-20 16:53:04 -07:00
Catrope 9ff6737f4c Refactor HTML attribute preservation
Rather than using namespaced linmod attributes, store the preserved
HTML attributes in the .htmlAttributes property of the linear model
element, in a nested structure to allow for easier treatment of child
nodes. Also added attribute order preservation by storing attributes
as an object plus an array of keys.

ve.ce.Node.js:
* Remove html/* attribute synchronization. Doesn't make sense any more
  because these things aren't in the attributes object any more. I don't
  think it ever made sense because these attributes were never supposed
  to be changed anyway.

ve.ce.View.js:
* Replace renderAttributes() with a simple wrapper around
  renderHtmlAttributeList()

ve.dm.Converter.js:
* Add buildHtmlAttributeList() and renderHtmlAttributes() for building
  and rendering HTML attribute lists

ve.dm.Model.js:
* Add getter for .htmlAttributes

ve.dm.Node.js:
* Drop .htmlAttributes on clone, and remove logic dropping html/*

ve.ui.MWCategoryWidget.js:
* Remove html/0/about hack, was already unnecessary and now doesn't
  work any more

tests/:
* UPDATE ALL THE TESTS

Change-Id: I620573afd70d36ade6b80413075b6e1f4a435abe
2013-05-17 20:57:33 -07:00
jenkins-bot 4f14fddd2b Merge "ve.ui.PopupWidget visibility fixes" 2013-05-17 05:52:35 +00:00
Trevor Parscal 3a99b99876 ve.ui.PopupWidget visibility fixes
Objective:

* Context popup would stop opening sometimes "mysteriously" which ended
  up having to do with the automatic closing on blur functionality
  added to popups for use in the category popup widget
* Mousedown event canceling was being applied a little too widely, and
  was causing popup widgets to not allow child elements to be focused
  (unless they contained an iframe, like an inspector)

Changes:

ve.ui.Context.js
* Make use of the popup's show and hide methods within the inspector

ve.ui.MWCategoryPopupWidget.js
* Override autoClose option for category popup widgets

ve.ui.PopupWidget.js
* Add autoClose option to popup widgets
* Move event handler to the top of the methods (convention)
* Only bind blur event if autoClose is enabled
* Inline the getFocusedChild method

Change-Id: I22aedb5fbd51b327ea7ce2ecdd6123e79cbebb9c
2013-05-17 05:49:16 +00:00
Inez Korczyński 97157a1c1c Use promise pattern inside MWTemplateDialog in order to download TemplateData (currently just mocked) asynchronously.
Change-Id: Ib23521cf40a80cc82872de82d3935414ef385d21
2013-05-16 20:37:15 -07:00
jenkins-bot 0eb2581b64 Merge "ve.ui.Context: Add embedding feature" 2013-05-16 18:26:39 +00:00
Trevor Parscal 55b5f30edb ve.ui.Context: Add embedding feature
Objectives:

* Make the context menu display in the top right corner of the currently
  focused inspectable node (if there is one)
* Prevent clicking on anything to do with the toolbar or popup from doing
  anything at all, ever

Bonus:

* While we are using the clever feature in jQuery's on method which allows
  passing boolean false to cancel the event - may as well do that in
  ve.ui.Dialog as well

Changes:

ve.ui.FocusableNode
* Add ability to specify the focusable element so that dimensions can be
  derived from it

ve.ce.Surface
* Add quotes to object keys

ve.ui.MediaDialog
* Change association from being MW specific to handling images in general

ve.ui.Context
* Add embedded styles for context
* Add embedded mode, which is triggered when the context is a single
  focusable node, and the node is large enough to fit the context
  reasonably

ve.ui.Dialog
* Inline mousedown handler

ve.ui.Toolbar, ve.ui.PopupWidget
* Cancel stray mousedown events

Change-Id: I4b25d33f64b4bcb8a3ecfd7e9728f54a2d4886f3
2013-05-16 11:23:59 -07:00
Inez Korczyński a191073d72 Create and commit transaction after attributes of the template are changed and applied.
Change-Id: I4a1acdadcd1486ddd5dafcfc794c9b3b93e92592
2013-05-15 17:49:27 -07:00
Inez Korczyński 1b4b6663c3 Introduce createPage method in ve.ui.MWTemplateDialog and even use it!
Change-Id: I7b063a9380742e157a4c7128c1654abcf3ad8c6f
2013-05-15 16:22:12 -07:00
Inez Korczyński ba5c4f104d Build TemplateDialog based on parameters that are passed to template
(instead of TemplateData as before).

Change-Id: I50b0e6ef1936c4b56f40fa73bd42b03587bdf979
2013-05-15 22:47:59 +00:00
Christian Williams f238683341 Content for Template Dialog
Initial commit of page content.

Change-Id: Iffdf4f4179c6f3b04611d4bd9548e7cf23188856
2013-05-15 15:13:38 -07:00
jenkins-bot 943301f2c9 Merge "Multiline option for ve.ui.TextInputWidget.js" 2013-05-15 21:47:25 +00:00
jenkins-bot e21f8edb60 Merge "Process example template data and add pages to PagedDialog based on it." 2013-05-15 21:44:07 +00:00
jenkins-bot e75f63f279 Merge "Added clearPages method to ve.ui.PagedDialog." 2013-05-15 21:41:34 +00:00
Trevor Parscal 96e49858fa Multiline option for ve.ui.TextInputWidget.js
Objective:

* Add multiline option to text input widget which uses a text area instead of a text input

Changes:

ve.ui.Widget.css
* Add text area support for styles otherwise only targeting input elements

ve.ui.InputWidget.js
* Initialize input element using a method, so it can be fully customized (like making a text area or select input
* Use val() to set the initial value, using jQuery's abstraction around inputs of various types

ve.ui.TextInputWidget.js
* Add multiline option which uses a text area instead of an input

Change-Id: I1bf17c8c76b7f1708c57ee5e95160c071ddd00e9
2013-05-15 14:41:22 -07:00
Inez Korczyński de203cb871 Process example template data and add pages to PagedDialog based on it.
Change-Id: I34ee42e66df26000842f9b1540a577b2621f8839
2013-05-15 14:36:44 -07:00
Inez Korczyński 3895a3ea11 Added clearPages method to ve.ui.PagedDialog.
Change-Id: Ie55f727f649b2dcd4189489c7baa9f524aa5d1c7
2013-05-15 14:31:20 -07:00
jenkins-bot bd0d61c143 Merge "Fix for default sort key crash" 2013-05-15 21:10:57 +00:00
Trevor Parscal 79df2232a5 Fix for default sort key crash
The existing default sort key was being cached when the dialog was
constructed, but on the 2nd time launching it the reference was broken.
This change gets rid of the caching and always grabs a fresh copy when
we need one.

Also, the flag indicating the default sort key has changed wasn't being
reset properly.

Change-Id: I8fb3b088f25212b8c542df65bb5a248550ff6f27
2013-05-15 21:04:10 +00:00
Christian Williams 3f6e127423 Pages in template dialog
Just a starting point for Inez to loop.

Change-Id: I6d418ba955f0904d34b474c984eef7f97be257e9
2013-05-15 13:39:34 -07:00
jenkins-bot f888b79056 Merge "Add level option to ve.ui.OutlineItemWidget" 2013-05-15 20:35:06 +00:00
Trevor Parscal 55f28eecce Add level option to ve.ui.OutlineItemWidget
Objective:

* Add indentation feature to outline items

Changes:

ve.ui.PagedDialog.js
* Pass level argument through addPage method

ve.ui.Widget.css
* Add styles for non-zero levels of outline items

ve.ui.OutlineItemWidget.js
* Add missing config documentation for icon option
* Add level option, with getLevel/setLevel methods
* Add statically configurable number of levels and level class

Change-Id: Ie24761c64918fdc6cd28070b3cf56743c6288970
2013-05-15 12:54:19 -07:00