Commit graph

2944 commits

Author SHA1 Message Date
jenkins-bot 3d0ce68893 Merge "Fix ModelRegistry bugs" 2013-04-09 11:56:14 +00:00
Catrope 87125aaf36 Fix MetaList tests, were totally broken
They worked fine with just one group, but once Rob added a second group
everything came falling down.

* Index the return value of findItem() into the correct array
  (list.items for all, list.groups[groupname] for groups)
* Expect null if there is something at the coordinates but it's in the
  wrong group
* Keep track of the next index and expect that for forInsertion when
  findItem() returned null, as well as at the end of each offset

Change-Id: I76438f583cea5694ce04fa2f4e7e88f8f8f236d1
2013-04-09 12:46:04 +01:00
jenkins-bot 5029ee29ea Merge "Great Annotation Refactor of 2013" 2013-04-09 11:28:06 +00:00
Catrope 1645fe01e6 Be resilient against an unset hrefPrefix in MWCategoryMetaItem
(or any unset attribute for that matter)

Change-Id: I59364354c64fbce016090e17aa9683ec0a0fea9b
2013-04-08 21:44:59 -07:00
Catrope 2eb0d2a6b2 Great Annotation Refactor of 2013
This changes the annotation API to be the same as the node API, sans
a few boolean flags that don't apply. The APIs were different, but
there was really no good reason why, so this makes things simpler for
API users. It also means we'll be able to factor a bunch of things out
because they're now duplicated between nodes, meta items and annotations.

Linear model annotations are now objects with 'type' and 'attributes'
properties (rather than 'name' and 'data'), for consistency with elements.
They now also contain html/0/* attributes for HTML attribute preservation,
which obsoletes the htmlTagName and htmlAttributes properties.
dm.Annotation subclasses take a reference to such an object and implement
conversion using .static.toDataElement and .static.toDomElements just
like nodes do. The custom .getHash() functions are no longer necessary
because of the way HTML attribute preservation was reimplemented.

CE rendering has been moved out of dm.Annotation (it never made sense to
have CE rendering functions in DM classes, this was bothering me) and into
separate ce.Annotation subclasses. These are very similar to CE nodes in
that they have a this.$ generated based on something in the DM; the main
difference is that nodes listen to events and update themselves, whereas
annotations are static and are simply destroyed and rebuilt when they
change. This change also adds whitelisted HTML attribute rendering for
annotations, as well as class="ve-ce-FooAnnotation" attributes.

Now that annotation classes produce real DOM nodes rather than weird
objects describing HTML tags, we can't generate HTML as a string in
ce.ContentBranchNode anymore. getRenderedContents() has been rewritten
to be much more similar to the way the converter renders annotations;
in fact, significant parts of it were copied from the converter, so that
should be factored out in the future. This change actually fixes an
annotation rendering discrepancy between ce.ContentBranchNode and
dm.Converter; see the diff of ve.ce.ContentBranchNode.test.js.

ve.ce.MWEntityNode.js:
* Remove stray property

ve.dm.MWExternalLinkAnnotation.js:
* Store 'rel' attribute

ve.dm.TextStyleAnnotation.js:
* Put all the conversion logic in the abstract base class

ve.dm.Converter.js:
* Also feed annotations through getDomElementsFromDataElement() and
  createDataElement()

ve.dm.Node.js:
* Fix undocumented property

ve.ce.ContentBranchNode.test.js:
* Add descriptive messages for each test case
* Compare DOM trees, not HTML strings
* Compare without all the class="ve-ce-WhateverAnnotation" clutter

ve.ui.LinkInspector.js:
* Replace direct .getHash() calls (evil!) with ve.getHash()

Bug: 46464
Bug: 44808
Change-Id: I31991488579b8cce6d98ed8b29b486ba5ec38cdc
2013-04-08 18:10:16 -07:00
Catrope 9bac935c7d Fix ModelRegistry bugs
* In matchTypeRegExps(), skip string types
** Didn't break because we currently have mixes of strings and regexes
* Combine types from rel, typeof and property rather than picking one
** Added test case in ve.dm.example that resembles actual Parsoid output
* If the element has extension-specific types, not only restrict type
  matching to extension-specific types, but also require that *all* types
  present on the element be matched

Change-Id: Iacf3851a0ca9081d2c813b42435484a47cec6230
2013-04-08 18:05:34 -07:00
Christian Williams 23ac4b79bb Clickable inline images
Clicking an inline image will select it, or expand the selection.

Change-Id: I505665f2dac2e52140cc049e63e3355190dcbfec
2013-04-08 17:58:46 -07:00
Christian Williams 4c1934b19d Prevent IE from editing ce="false"
This is a redux of logic already in master.
Moved from keydown to keypress because IE
fires keydown multiple times for held keys.
Changed the logic to determine that the current
offset is just after an element that should not be
directly edited.

Change-Id: I5206d8919abde740d92f636b0c8618c4ebb6f6ff
2013-04-08 17:53:31 -07:00
Ed Sanders 93bbe93829 Fix for custom hash with keys in different order
Instead of returning val when a custom hash is found,
feed it back into val and let the object sorting take
place if required.

Bug: 46895
Change-Id: I6a9b42facd97fbf49042d3a082121ec93659b9f1
2013-04-09 00:20:44 +01:00
Ed Sanders 277c4f6c28 Change custom .getHash functions to .getHashObject
As described in the bug, ve.getHash performs JSON.stringify so to
customise a hash the object should just return an object to be
hashed, not the hash string itself.

Bug: 46895
Change-Id: If11071d4b04a01e25102ffb57240882f650ee10d
2013-04-08 23:29:56 +01:00
Trevor Parscal f7335d4729 Support loading stylesheets into frames from different locations
This is one of the blockers for splitting VE up into separate
repositories or extending VE with an extension.

ve.ui.Frame.js

  It's critical that we don't emit initialize from ve.ui.Frame until
  it's completely loaded, especially its styles, because we will
  begin measuring it straight away.

  Involved loading the stylesheets using $.ajax and setting base
  URL of the iframe to the ve.ui styles directory so all the image
  URLs still worked. This won't work for stylesheets from multiple
  locations, so we needed a more robust solution.

  The new solution uses some trickery described in the code
  documentation, but essentially no longer depends on all
  stylesheets being located in the same folder.

ve.ui.Dialog.js, ve.ui.Inspector.js, ve.ui.Window.js

  Static methods are now being used to extend a window class to
  include different stylesheets rather than simple array
  concatenation.

Change-Id: I619238732f975d41305f81f8f818a577a40f49da
2013-04-08 13:58:50 -07:00
jenkins-bot b47310238d Merge "Quick fix for IE typing after generated content" 2013-04-05 23:14:40 +00:00
Christian Williams de49bf2bf7 Quick fix for IE typing after generated content
The previous check was incorrect and was setting selection
too often.

Change-Id: I1ac393c149b6f814949b84e47faa04906c94f6af
2013-04-05 16:12:12 -07:00
Trevor Parscal 148b6bf8a8 Media dialog support
*/index.php
* Added links to new files

VisualEditor.php
* Added links to new files
* Removed keys of non-existent messages

ve.ui.ContentDialog.js, ve.ui.MetaDialog.js
* Removed redundant comments

ve.ui.MediaDialog.js
* New dialog, just for media

icons.ai, picture.png, picture.svg, ve.ui.Icons-*.css
* Added picture icon

ve.ui.MediaButtonTool.js
* New button, just for media (shows up in the context toolbar)

ve.ui.DialogButtonTool.js
* New base class for dialog buttons

ve.ui.Context.js
* Added basic support for showing dialog buttons, in addition to
  annotation buttons, in the context toolbar - to test, select only an
  image node

ve.ui.Dialog.js
* Prevent clicks on the click-block from changing focus
* Moved initialize to below the event handlers and updated its
  documentation

ve.ui.DialogFactory.js
* Added a way to get the names of dialogs that can be used to edit a
  node

ve.ui.Inspector.js
* Removed close handler which set focus, this is done already in window

ve.ui.InspectorFactory.js
* Fixed comment so it's not telling lies anymore

ve.ui.Window.js
* Removed auto-focus on frame, it's changing the focus in the parent
  document which blows-away the focus in CE, and it really isn't needed
  as it turns out

VisualEditor.18n.php
* Added media dialog title message
* Added media tool tooltip message

Bug: 37870
Change-Id: I9150c46b3e292910fed899fa60d6da433049ca45
2013-04-05 11:52:57 -07:00
Timo Tijhof 1513c23be6 Test: Disable circular reference test for ve.getHash.
Change-Id: Idbad334ed21247c3f4d442f6aad62a0b9347cfc6
2013-04-04 03:31:26 +02:00
jenkins-bot 4b2e33aba4 Merge "ve.init: Fix broken dependency between ve.js and ve.init.platform" 2013-04-04 00:15:32 +00:00
Catrope a0c7d90f65 Fix a bug where trimOuterSpaceFromRange() didn't trim an all-whitespace range
Also add tests for it

Change-Id: I713626bd778f45b5f7bfb6ca4ba2057f84c0a0c5
2013-04-03 16:58:51 -07:00
Timo Tijhof 306680efd5 ve.init.mw.ViewPageTarget: Use original label for replaced tab
To verify
* Save "MediaWiki:Edit" with "Edit page" (anything not "Edit")
* Set this.tabLayout = 'replace';
* Observe that the ve-edit tab is now "Edit" (msg: vector-view-edit)
  instead of "Edit page" (msg: edit)

Bug: 42117
Change-Id: I2e7dd85cd14049101e2d49751d37797d77bc7c9d
2013-04-04 00:16:46 +02:00
jenkins-bot 19383f77f4 Merge "Test: Fix 404 errors in example images." 2013-04-03 20:52:44 +00:00
Inez Korczyński fea3273cad Make ve.ce.Document.getSiblingWordBoundary compatible with new linmod
Change-Id: I746fb8ad761e68cb3c8a76550e2dd4cb540be4e6
2013-04-03 18:07:11 +00:00
Timo Tijhof 1ec8ba3e24 Remove superfluous spaces in function invocations.
Find-Exec: ack '\.[a-zA-Z]+\ \(' --js modules/ve modules/unicodejs
Change-Id: Ib7d0a6514f3321f1d09fbf7cf52c2a9c2cecde88
2013-04-03 17:48:34 +00:00
Timo Tijhof 93b5e174f1 ve.init: Fix broken dependency between ve.js and ve.init.platform
Depencency tree looked like this
* ext.visualEditor.viewPageTarget
  - ve.init.platform
  - ve.init.target
** ext.visualEditor.core
   - (most ve.* classes)
*** ext.visualEditor.base
    - ve.js

Some of the ve classes are calling ve.msg from the global scope
at load time (e.g. in the definition of static properties or in
constructors of classes that were immediately instantiated in
the same file).

Platform needs to be initialised in the base module.
ve.init.Platform.js was already there, but that's just an
abstract base class. The the ve.init.platform property is set
from the implementation classes' files.

Updated makeStaticLoader.php and re-ran for test and demo html.
The fake "Standalone Init" module is now gone, which shows that
this was needed as test/ and demo/ already put their platform
code in/after the 'ext.visualEditor.base' module in the html.

Bug: 45175
Change-Id: I47d7d92495974572194700c98a219d22ecbfaf4b
2013-04-03 05:47:40 +02:00
jenkins-bot 50f84e341e Merge "Re-run makeStaticLoader for index.php (fix 404 ve.ui.FlaggableElements.js)" 2013-04-03 01:58:40 +00:00
Trevor Parscal 96c39e07fc Add left/right/center alignment to popups
This allows the popup to be aligned to the callout in 3 different ways, center is still default.

Change-Id: I3f2a4672da62d7d4cd4c7d20df640d6390f00c9f
2013-04-02 17:36:54 -07:00
Timo Tijhof 6123661736 Re-run makeStaticLoader for index.php (fix 404 ve.ui.FlaggableElements.js)
Change-Id: Ifba82e644e6ad4b2fe69f2632df7935756dd275c
2013-04-02 23:56:25 +02:00
Timo Tijhof 42f4ecc854 Test: Fix 404 errors in example images.
Consistently refer to example.png for <img> tests.
And "Wiki.png" for MediaWiki image tests.

Change-Id: I799654b66bb586338e807a84bb84f7ec0b486728
2013-04-02 23:52:02 +02:00
jenkins-bot 85f6177543 Merge "Add overlay to frame" 2013-04-02 19:22:26 +00:00
jenkins-bot 2f0c091bf2 Merge "Stack panel, element mixins, cleanup" 2013-04-02 19:22:08 +00:00
Trevor Parscal 8e273b7d9f Add overlay to frame
This is where we can add popups and stuff.

Accessible through: this.$$.frame.$overlay

Change-Id: Icbc9a114006804a1b9ab74144f0aaf59a15c5466
2013-04-02 12:10:31 -07:00
Ed Sanders fb534ebedc Script tag for LinearData test not renamed after file move.
Change-Id: I89f7c2afd815f3050a2d837de67189cd628c03c6
2013-04-01 15:39:53 +01:00
jenkins-bot 4d41a23b61 Merge "Store data in LinearData class with an index-value store for objects" 2013-03-30 10:17:39 +00:00
Ed Sanders fdf30b1ac8 Store data in LinearData class with an index-value store for objects
Created an IndexValueStore class which can store any object and return
an integer index to its hash map.

Linear data is now stored in ve.dm.LinearData instances. Two subclasses
for element and meta data contain methods specific to those data types
(ElementLinearData and MetaLinearData).

The static methods in ve.dm.Document that inspected data at a given
offset are now instance methods of ve.dm.ElementLinearData.

AnnotationSets (which are no longer OrderedHashSets) have been moved
to /dm and also have to be instantiated with a pointer the store.

Bug: 46320
Change-Id: I249a5d48726093d1cb3e36351893f4bff85f52e2
2013-03-30 10:06:34 +00:00
Ed Sanders 5b168bdbad Fix MWImageNode dimensions and implement toDomElements
Using element.height was returning 0 if the attribute was empty
when in fact what we mean to store is null (i.e. auto height).

This takes care of the writing of attributes in CE as jQuery
ignores an attribute-set command if the value is null.

Also in this commit I've implemented a basic toDomElements
that outputs the original HTML (code copied from AlienNode).
This stops the code from throwing an exception but will
eventually need to be rewritten to rebuild the HTML from
the attributes stored in the DM.

Bug: 56336
Change-Id: I297a1d0a07e9ebf9d0110fb1cdf266f8415f25b7
2013-03-29 12:51:43 +00:00
jenkins-bot 7b9618ebc2 Merge "Typing support after Aliens and Entities for IE" 2013-03-29 02:19:15 +00:00
Inez Korczyński 836fa82155 Make sure that rangy is initialized only once and that it is initialized before it is used.
Change-Id: Ia318908d34e82ae97ae1bf662ad9fc5dc28bf6ba
2013-03-28 14:50:43 -07:00
Christian Williams 48f6403504 Typing support after Aliens and Entities for IE
When the cursor is between ce="false" elements and an editable next
sibling, IE often sets the anchorNode to be the ce="false" element
(or text node within). This change returns aliens to ce="false"
(abandoning the former true within true IE trick), and ensures that
the cursor is in the right place on keydown by programmatically
setting the selection.

Change-Id: I952488510f32b096b27e8e55d4afc7df930e0072
2013-03-28 14:49:09 -07:00
jenkins-bot f6c50d70a5 Merge "Fix for live preview in jsduck" 2013-03-28 21:11:25 +00:00
Trevor Parscal 3dfbda60d1 Fix for live preview in jsduck
This got out of sync, pretty simple fix.

Change-Id: Ib21e63399f184de1b182f20b9d35307e2c73a0df
2013-03-28 13:26:15 -07:00
Timo Tijhof c53685b865 Doc: Replace "@property @type {Type}" with "@property {Type}".
Also removed a few redundant headings in class documentation
comments. There is already an @class and it looks a bit odd  in
the generated pages:
 <h2>TextString</h2>
 <p>TextString</p>
 <p>This class provides a ...</p>

Change-Id: Ie311c6993ed02e79272dbde71f6a1bc252ef3037
2013-03-28 21:21:56 +01:00
jenkins-bot 9c9675f778 Merge "Fix: focus method should be called on jQuery object not on ve.ui.TextInputWidget object itself." 2013-03-28 20:11:37 +00:00
Inez Korczyński 497b6947e5 Fix: focus method should be called on jQuery object not on ve.ui.TextInputWidget object itself.
Change-Id: I70b6553245b68e6de465eb3434bce4c4228f1764
2013-03-28 13:09:27 -07:00
Inez Korczyński 21e4fdc014 Added support for displaying inline images.
Change-Id: Ieecbca8ed864585e8eaa99598d4bfdb5ac9bfec7
2013-03-28 13:05:57 -07:00
Trevor Parscal a2e59f7c86 Stack panel, element mixins, cleanup
*.php
* Updated links to files

ve.ui.MetaDialog
* Added stack panel that now contains category and language editor panels
* Attached outline widget to stack panel

ve.ui.FlaggableWidget -> ve.ui.FlaggableElement
* Moved to elements

ve.ui.GroupWidget -> ve.ui.GroupElement
* Moved to elements
* Removed invalid event documentation

ve.ui.LabledWidget -> ve.ui.LabledElement
* Moved to elements

ve.ui.StackPanelLayout.js
* New class, mutually exclusive panel container

ve.ui.TitledPanelLayout
* Remvoed, using labeled element instead

ve.ui.Element.css
* Added for elements
* Moved label style here, from widget styles

*.css, ve.ui.ButtonWidget.js, ve.ui.InputLabelWidget, ve.ui.OptionWidget, ve.ui.SelectWidget
* Adjusted class names to reflect widget -> element migration

Change-Id: I32f504c844dba7aae1b286eef06ca046627bdc8d
2013-03-28 12:40:01 -07:00
jenkins-bot 0a8697808e Merge "Removed static "overrides", which were only setting defaults" 2013-03-27 18:34:37 +00:00
jenkins-bot ff38fcd4ef Merge "New popup widget" 2013-03-27 18:30:37 +00:00
Trevor Parscal d25a04b35b New popup widget
This will make the popup with callout functionality easy to reuse elsewhere - in the first case most likely the popup menus for the category widget.

*.php
* Added links to the new widget

ve.ui.Context.css, ve.ui.Widget.css
* Moved styles to the widget stylesheet

ve.ui.Context.js, ve.ui.PopupWidget
* Moved "popup" specific stuff to the new popup widget

Change-Id: I823c6e2c5e1ec11088898e9621d93e983c3b76f3
2013-03-27 11:27:25 -07:00
jenkins-bot 686d4ddc71 Merge "Added layouts and fixed up dialog styling issues" 2013-03-27 18:15:05 +00:00
Inez Korczyński 47691cf586 Initialize rangy once and globally instead of doing it in constructor of every surface.
Change-Id: I06e331021ff8af63e76ceccc005319fc9ce96619
2013-03-27 11:05:29 -07:00
jenkins-bot b20de29fe8 Merge "Small cleanup in CE" 2013-03-27 18:02:06 +00:00
Inez Korczyński fe0fdcd67c Small cleanup in CE
Better comments for:
* ve.ce.Document.getRelativeOffset,
* ve.ce.Document.getSiblingWordBoundary.
Convert ve.ce.Surface.getSelectionRect to a static method.
Moved getNodeAndOffset from ve.ce.Surface to ve.ce.Document.

Change-Id: Ic00221fa463205d04c9b52150c0dd15904493b1e
2013-03-27 10:50:02 -07:00
Ed Sanders 4988efd35e UnicodeJS library to implement Unicode standards
Initially just with a Wordbreak module to implement Unicode standard
on 'Default Word Boundaries'. Due to it's standaloneability this has
been written as a separate library. Non-BMP characters are currently
not supported.

Bug: 44085
Change-Id: Ieafa070076f4c36855684f6bc179667e28af2c25
2013-03-27 17:44:22 +00:00
Trevor Parscal 63567654a2 Link inspector suggestion sections
ve.ui.Widget.css
* Made sections use a default cursor - they aren't clickable so they shouldn't appear to be

Change-Id: Id74288040080c18b8595f2903239bc82e8bc1ab2
2013-03-26 16:57:30 -07:00
Trevor Parscal 482db3763c Removed static "overrides", which were only setting defaults
The default widget element type is already 'div', no need to override that.

Change-Id: Ief6ee9a7a2e2384ea26276483a5d8e33ab70dacf
2013-03-26 16:51:35 -07:00
jenkins-bot a5dcf7cd1b Merge "Prevent adding content to aliens in IE" 2013-03-26 23:04:41 +00:00
Christian Williams a8a5c74d8b Prevent adding content to aliens in IE
The phantoms prevent direct clicking into aliens,
and the recent selection changes prevent keyboard
navigation into aliens, but one issue remained.
Clicking to place the cursor just after an alien
would actually focus within the alien. Typing
modified the alien content. By nesting ce="true"
within ce="true", IE ceases this behavior.

Dragging state is now set to false when blurring
the document. The mouseup event sets dragging to
false, but the event is cancelled because blur
happens between mousedown and mouseup. Phantom
display logic uses on this property.

Change-Id: I162dea89838756fd28d63ff66cc4a5e5bda2873a
2013-03-26 16:01:13 -07:00
Trevor Parscal 168fcec387 Added layouts and fixed up dialog styling issues
ve.ui.Dialog.css
* Fix issue where the use of margin auto on the outer dialog wrapper
  would expose parts of the underlying content - this is resolved by
  making the outer wrapper cover the whole screen and making the
  window frame use margin auto

ve.ui.Icons*.css
* Added missing settings icon rule

ve.ui.Layout.css
* Added styles for editor panel

ve.ui.Window.css
* Removed default height, setting it specifically in inspector now

ve.ui.EditorPanelLayout.js
* New layout, adds a title and icon above the content

ve.ui.TitledEditorLayout.js
* Similar to labeled widget, but for panels

ve.ui.MetaDialog.js
* Using settings icon now
* Switched to using a specific layout - still hard-coded for
  categories

ve.ui.Frame.js
* Modified style loader to guarantee order of style rules, no matter
  what order they load in

*.php
* Moved layouts to be included after widgets so they can use widgets
* Added links to new layouts

Change-Id: I7ff5f5f095460fd4f6cf841f4182bfb92bf034da
2013-03-26 20:52:35 +00:00
Catrope 7e65e3becf Add insert and remove events to MetaList
These events occur when an item is inserted or removed by onTransact(),
so both for insertions/removals done through the MetaList mutators and
insertions/removals done by any other means.

We have to gather these events and batch them up because we have to allow
offset translation and index recomputation to occur first (otherwise
calling .getOffset() and .getIndex() on inserted items doesn't work).

Change-Id: I74a9a21398eca4e9afd7148171af20d439cf7ebd
2013-03-26 15:09:52 +00:00
jenkins-bot 34cc39bf9f Merge changes I4b62a310,I7c9f22a1
* changes:
  Add mutators in MetaList
  Move .commit()/.rollback() from TransactionProcessor to Document
2013-03-26 14:31:44 +00:00
jenkins-bot 8d207b43e7 Merge "Add support for slugs in ve.ce.Document.prototype.getRelativeOffset" 2013-03-25 23:47:03 +00:00
jenkins-bot 14132aeb4e Merge "Docs: Primitive -> primitive." 2013-03-25 23:46:07 +00:00
Inez Korczyński 2108030cfd Add support for slugs in ve.ce.Document.prototype.getRelativeOffset
Also removed ve.ce.Surface.prototype.adjustCursor because it is not being used anymore

Change-Id: Ib7dd8f4f6eaa688995d33247600875a45fc5a602
2013-03-25 16:43:57 -07:00
jenkins-bot e3fd32923f Merge "Cleanup in ve.ce.Surface." 2013-03-25 23:32:32 +00:00
Inez Korczyński 0339a92284 Cleanup in ve.ce.Surface.
Mostly by extracting parts of onDocumentKeyDown method into separated methods: handleLeftOrRightArrowKey and handleUpOrDownArrowKey

Change-Id: If19abf2218bc667c729f7bf388074061cec3031c
2013-03-25 16:23:39 -07:00
jenkins-bot 6178b3bf56 Merge "Fix documentation to place @emits in the correct place" 2013-03-25 22:22:01 +00:00
Catrope 8baf7a1df9 Add mutators in MetaList
Add .insertMeta() and .removeMeta() methods to insert and remove
metadata through the meta list. For convenience, there is also a
.remove() method in MetaItem that wraps around removeMeta().

Also rename insertItem() and removeItem() to addInsertedItem() and
deleteRemovedItem() to avoid confusion, and make the MetaList
constructor take a dm.Surface rather than a document so we can call
change().

Change-Id: I4b62a3109404cfd56f5de68938e1db908b03e678
2013-03-25 21:12:20 +00:00
Ed Sanders 1cec447b59 Fix documentation to place @emits in the correct place
@emits, @returns, @chainable & @throws should always appear
in that order, according to CODING.md.

Change-Id: I9b192e018a028a8b32730c288cc4e3108800fb58
2013-03-25 21:06:05 +00:00
Catrope 1176bf9677 Move .commit()/.rollback() from TransactionProcessor to Document
Previously these were static functions in TransactionProcessor
which instantiated a TP called .process() on it. These are now
methods of ve.dm.Document.

Also moved the emission of the 'transact' event on the document from
TransactionProcessor to Document itself, and moved the tests asserting
double application is protected against from TP to Document (because
the corresponding code moved as well).

Change-Id: I7c9f22a14accaf0ba1f70d5aa4f0573bb7e677d0
2013-03-25 21:03:44 +00:00
jenkins-bot 47dee2a685 Merge "Small cleanup/refactoring to getSiblingWordBoundary" 2013-03-25 20:48:06 +00:00
Inez Korczyński 92ea103153 Small cleanup/refactoring to getSiblingWordBoundary
CPU time + memory optimization + make inexpensive comparison first

Change-Id: I7f504f741b4d90201e40bbc40ae2e88fe0db2e33
2013-03-25 20:38:24 +00:00
Timo Tijhof b19a2010d8 Docs: Primitive -> primitive.
Only one left, thought there were more.

Change-Id: Ifdf490854ea138daf01319ed58cdba4182481c85
2013-03-25 18:55:08 +01:00
jenkins-bot a75b463794 Merge "Add MW-specific meta items for categories and language links" 2013-03-23 21:52:31 +00:00
Inez Korczyński 3b8cdfe2a0 Programmatic handling for selection (arrow up and arrow down only).
This is only for IE and only for backwards selection.

Change-Id: Ifdcd2d404d1018057b5ba16753fc964b07738879
2013-03-22 17:06:41 -07:00
jenkins-bot 59e9c3f65e Merge "Programmatic handling for selection (arrow left and arrow right only)." 2013-03-22 19:34:48 +00:00
jenkins-bot f34407b31a Merge "Introduce helper functions." 2013-03-22 19:28:34 +00:00
Inez Korczyński 8b2d3caebb Programmatic handling for selection (arrow left and arrow right only).
Change-Id: I6ccbecdeafbe189dbe052e4e9ce8f926dad14aea
2013-03-22 12:24:31 -07:00
jenkins-bot e45df0df11 Merge "Introduce method ve.ce.Document.getRelativeOffset." 2013-03-22 19:18:28 +00:00
Inez Korczyński 5b9964878d Introduce helper functions.
* ve.ce.isLeftOrRightArrowKey
* ve.ce.isUpOrDownArrowKey
* ve.ce.isArrowKey

Change-Id: Id9fd7975e98085d01e545d1d0fc6086a06648031
2013-03-22 11:43:18 -07:00
Inez Korczyński c8819742eb Introduce method ve.ce.Document.getRelativeOffset.
Change-Id: If2b8675b4604fc5ec1430497f2d55b2f3584a453
2013-03-22 11:41:26 -07:00
Timo Tijhof 573aea477d ve.init.mw.ViewPageTarget: Fix exception in deactivate().
This caused the page to stay in a dimmed state because it would
throw an exception before tearDownSurface() and showPageContent()
would be called.

Bug: 46456
Change-Id: I91ad2b110c2c523a4bb367407e3f33a953328ab4
2013-03-22 19:32:56 +01:00
Inez Korczyński c636ae138d Cleanup to ve.dm.SurfaceFragment.wordBoundaryPattern
Change-Id: I475fc0c97d5af646f51fe779c4b3136ddd3f83d0
2013-03-21 15:24:23 -07:00
Inez Korczyński 8199f2a1c1 Removed ve.dm.Document.getIEStyleWordBoundary method.
Added ve.ce.Document.getSiblingWordBoundary method.

Change-Id: I44b53273429aede5be10f39c2ee2f70d96cdc6fb
2013-03-21 14:46:13 -07:00
Catrope b39576b433 Add MW-specific meta items for categories and language links
Also rename MWMetaItem to MWAlienMetaItem, because that's what it
really is.

Change-Id: I70695bfa3b8449c936a63f7b2a248b90c49dcea1
2013-03-21 12:18:52 -07:00
Trevor Parscal c2e1350fe0 Remove more periods
Tags don't need periods at the end, these are not complete sentences.

Change-Id: I8efa931862149e892d08b370e70aff8d86a6db7d
2013-03-20 22:55:50 +00:00
Trevor Parscal fb22e4df50 Group, Select, Option, Outline and MenuSection widgets
Objective: Refactor menu widgets so that the majority of their code can be reused, and then add an outline widget which shares the same base classes.

ve.ui.Dialog.css
* Make dialog a fixed width and have a minimum and maximum height while always being centered in the window.
* Add style for the outline panel
* Add border below the title
* Move font-size adjustment to child elements to preserve layout scale

ve.ui.Inspector.css
* Make inspectors fade in when being opened (will happen after the size transition is complete)
* Add initial size for inspector to prevent the default size of the unfinished contents from making it too large while loading

ve.ui.Tool.css
* Update classes according to changes in labeled widgets

ve.ui.Widget.css
* Add display: block to widget labels to support use of autoEllipsis on them
* Update classes according to changes in labeled widgets
* Add styles for new select, option and outline item widgets
* Remove unused group and items classes for menu widgets (which are now subclasses of the select widget and no longer have grouping built-in)

ve.ui.Window.css.js
* Moved selection disabling rules up to the head to prevent selection drawing around the title

ve.ui.GroupWidget.js
* New widget that manages "items", allowing getting, adding, removing and clearing

ve.ui.MenuSectionItemWidget.js
* New widget that can be used inside a menu to create an unselectable, unhighlightable item that describes a section of the menu

ve.ui.OptionWidget.js
* New widget to be used with select widgets, provides select and highlight functionality

ve.ui.OutlineItemWidget.js
* New widget to be used with outline widgets, extends option and adds support for an icon to be rendered to the left of the label

ve.ui.OutlineWidget.js
* New widget that provides a vertically stacked list of mutually exclusive options, extends select

ve.ui.SelectWidget.js
* New widget that implements most of what menu once did, only now it also handles all the events for it's child elements internally

ve.ui.MetaDialog.js
* Hacked in support for an outline widget in the outline pane
* Added classes for styling purposes

ve.ui.FormatDropDownTool.js
* Modified call to menu item constructor as per changes therein
* Reorganized options config to make construction simpler
* Changed to setLabel after selecting the item to prevent the label from being changed to the wrong value as a side-effect of setting the item

ve.ui.DropDownTool.js
* Added $$ in config for menu widget - just in case later on we use a drop-down inside of a frame
* Using jQuery .text() method to propagate the selected item's text to the label rather than keeping around a plain text copy of the label in a property

ve.ui.Context.js
* Improve context/inspector behavior in regards to initial sizing

ve.ui.js
* Added context property to $$ returned by get$$ so it's easy to get the document object (for event binding) wherever you have a $$

ve.ui.Window.js
* Fixed incorrect case for boolean type in comment
* Added getFrame method

ve.ui.ButtonWidget.js
* Removed extra class being set on label

ve.ui.LabeledWidget.js
* Added class on label
* Added fitLabel method which uses autoEllipsis internally

ve.ui.MenuItemWidget.js
* Moved nearly all of the implementation to option so it could be reused

ve.ui.Menu.js
* Moved most of the implementation to select and group

ve.ui.MWLinkTargetInputWidget
* Prevent aborting and re-querying if the value hasn't actually changed
* Updated populateMenu method as per changes in menu class

*.php
* Added links to new files

Change-Id: I2271b5cc0554973b13cfbff94caf16901c02caa5
2013-03-20 22:55:32 +00:00
Trevor Parscal db6cede4d4 Fix transition animation between context menu/inspector
This removes the "grow from nothing" effect (which may have been a
little overkill) but fixes the situation where the inspector is open
and you click to a new location and it moves to the new location and
then transitions down to the menu (which looks bad).

Change-Id: I19d27da6fea7c36965c83aa73836b1bc870c9bcc
2013-03-20 15:43:32 -07:00
jenkins-bot 0cf80096fe Merge "Document and clean up events in all the things" 2013-03-20 16:59:29 +00:00
Timo Tijhof 4e64187beb Document and clean up events in all the things
* Document them consistently between secetions Inheritance and
  Static Properties under their own (new) section Events.
* Removed any quotes or brackets around the event name in existing
  @emit annotations
  Search: @emit.*['"{}(){}]
* For every call to this.emit() anywhere, added @emits.
* Fixed all warnings for references to undefined events
  (introduced as a result of the previous point).
  Event handler parameter documented based on the emit() call
  and actual handlers using the event. Usually the latter is
  more elaborate.
* Extend coverage of jQuery as needed
  (copied from mwcore/maintenance/jsduck/external.js
  written by me, hereby implicitly and explicitly released under MIT).

Specifics
* ve.ce.Surface#onContentChange: Fixed type of range from Object to ve.Range.
* ve.ce.SurfaceObserver#poll: Fix syntax for code from {} to `backticks`.
* ve.ui.Toolbar#onContextChange: Doesn't actually emit "clearState" event.
  Removed #onClearState in Tool, ButtonTool and DropdownTool.

Bug: 45872
Change-Id: Id879aa769b2c72d86a0322e75dddeb868211ce28
2013-03-20 09:58:27 -07:00
jenkins-bot a559d0d180 Merge "Create basic tests for AnnotationSet." 2013-03-20 16:35:15 +00:00
Inez Korczyński 1c62a63bbf Introducing method ve.dm.Document.getIEStyleWordBoundary
This is just a prototype - if it will be as useful as I expect
then it will get refactored (and probably get a better name +
location).

Change-Id: Ice1a2bd7d498d9d8438c35239216f01bd3db1826
2013-03-20 16:32:38 +00:00
Ed Sanders 62dacf17be Minor comment and licence fixes
Change-Id: I7fb632e56291b136e3e7b83ea6335474f1521d05
2013-03-19 20:54:01 +00:00
Ed Sanders 62318f9c61 Create basic tests for AnnotationSet.
Also covers methods inherited from OrderedHashSet.

Bug: 46320
Change-Id: I632e4cf1b87312179a9ce52df0d590ff42f56325
2013-03-19 15:31:50 +00:00
jenkins-bot 223617ecdf Merge "Add MetaList" 2013-03-15 22:58:10 +00:00
jenkins-bot 0ad90791e0 Merge "Layouts, grids and panels" 2013-03-15 22:41:21 +00:00
Trevor Parscal c535d7c5df Layouts, grids and panels
Layouts
* Makes widget inherit from element
* Adds layout which also inherits from element
* Adds grid and panel layouts
* Uses grid layout in meta dialog

Other changes
* Corrects issues with several of the stand-alone files by fixing and using makeStaticLoader.php

Change-Id: I6b92c0204e176c914c26eff8c03ea417578e080c
2013-03-15 15:12:56 -07:00
Catrope 00a109b4a1 Add MetaList
A MetaList is a collection of MetaItems representing all of the
metadata in a ve.dm.Document, and it updates itself live as the
underlying document changes.

Currently this interface is read-only, I'll add mutators next.

Change-Id: If7bfc9563af37e22dcdca9a682d6decc2f6f1872
2013-03-15 15:03:10 -07:00
jenkins-bot 9acd22330d Merge "Added categories and language icons" 2013-03-15 21:24:04 +00:00
Trevor Parscal b58465dead Added categories and language icons
These are not used yet, but will be for inspectors and dialogs to come.

Change-Id: I503c889d137f8a804f627446af861e6b94442e2b
2013-03-15 14:17:42 -07:00
Trevor Parscal 5e7f538a63 Toolbar style fixes
demo.css
* Removed toolbar floating styles, which were out of sync and essentially a duplication of those in ve.Surface.css

ve.Surface.css
* Reorganized rules
* Fixed some CSS syntax issues

Change-Id: I94eb83fa74312266817f8932f54fc9b89332c524
2013-03-15 12:48:49 -07:00
jenkins-bot d73797d087 Merge "Remove 1px left margin from toolbar in Vector" 2013-03-15 18:25:10 +00:00
jenkins-bot 4a27e78813 Merge changes Ieffb108b,I334f7db2
* changes:
  Remove unused .data()
  Link inspector menu not appearing in the right place
2013-03-15 18:24:40 +00:00
Ed Sanders 0e973815ee Remove 1px left margin from toolbar in Vector
Apparently this is left over code from when Vector drew
the left border as a background.

Change-Id: I3a9829ed7ab1bb1f2ad1a1c88aff82b1a2fc456d
2013-03-15 18:14:18 +00:00
jenkins-bot 4565fa5725 Merge "Move toolbar-shadow.png to correct location" 2013-03-15 18:01:29 +00:00
jenkins-bot e915520310 Merge "Disable the save button when there is no past history" 2013-03-15 17:05:22 +00:00
Ed Sanders 9f2fed76d5 Disable the save button when there is no past history
If the user has undone all their actions they should not be able to
save the document. By updating the 'edited' property we also solve
the issue of the onbeforeunload alert displaying if all edits
have been undone.

Bug: 42939
Change-Id: Ib3bc5b0e2f21781166a17a3fdf4f5286e6713859
2013-03-15 15:56:53 +00:00
jenkins-bot 624171a952 Merge "Emit a transact event on the ve.dm.Document when a transaction occurs" 2013-03-15 13:07:54 +00:00
jenkins-bot 7cd0888b3a Merge "Make metadata reaping handle replacement operations more sanely" 2013-03-15 13:03:23 +00:00
jenkins-bot 9e1f517e9d Merge "Change MetaNodes to MetaItems" 2013-03-15 12:23:25 +00:00
Catrope a835c03bc1 Change MetaNodes to MetaItems
Rather than meta-things being special kinds of nodes, they are now a
separate class of things (MetaItems) along with Nodes and Annotations.

* Created a generic ve.dm.MetaItem that meta items inherit from.
  There will be actual instances of this class as well in the upcoming
  meta group code.
* Renamed MetaNode to AlienMetaItem, MWMetaNode to MWMetaItem,
  'metaBlock'/'metaInline' to 'alienMeta'
* Created a MetaItemFactory, handle meta items in the ModelRegistry
* Kill ve.dm.Node.static.isMeta, now obsolete

ve.dm.Converter:
* Pass in the MetaItemFactory
* Look up data element types in the ModelRegistry rather than the
  NodeFactory, because they can be either nodes or meta items
* Document createDataElement() and make explicit that modelClass can be
  either a node or a meta item
* Handle meta items in getDataFromDom()
* In getDomFromData(), check the MetaItemFactory as well as the NodeFactory

Change-Id: I893709c6f3aa00f85c1b905b70f9f4e597bdeada
2013-03-14 23:35:50 -07:00
Catrope dadf005a67 Emit a transact event on the ve.dm.Document when a transaction occurs
We'll need this to let a MetaList observe a Document and adjust to changes.
We should probably also have SurfaceFragment listen to this event instead.

Change-Id: I9e811e242969eb44afe0b4fa8153d0fb1b0071cd
2013-03-14 23:35:50 -07:00
Catrope 031b96dd2a Make metadata reaping handle replacement operations more sanely
Before, replacement operations that both inserted and removed data at
the same time would be treated as removals followed by insertions,
so we'd reap the metadata from the affected range and move it to the
start of the range. For a pure replacement, this doesn't make any sense.

Instead, preserve the first min(insertLength, removeLength) elements in
the metadata array, then perform a pure insertion splice or a pure
removal splice for the length adjustment. Any metadata reaped in a
removal splice is restored at the offset where we started removing,
after the preserved portion.

These changes make the behavior of metadata reaping saner in general
(the previous behavior had the potential to move metadata around if it
was near a paragraph opening or closing and you converted the paragraph
to a heading), and makes the behavior match up with translateOffset(),
which is desirable for MetaList synchronization.

Change-Id: If9a1c6a7cf43ead7e3e1e8f6e081b139ca65fa53
2013-03-14 23:35:50 -07:00
Trevor Parscal c0dcf647ac Move toolbar-shadow.png to correct location
The style was moved, but the image was left behind.

Change-Id: Ib6c22cf652d0ae787030986f0afd262e62d7f610
2013-03-14 17:10:42 -07:00
Trevor Parscal 531d3a7ac6 Remove unused .data()
Just cleaning up the cruft

Change-Id: Ieffb108b234409a1122a984b45bdda688ce2014b
2013-03-14 16:56:36 -07:00
Trevor Parscal ec912dc2d1 Link inspector menu not appearing in the right place
ve.ui.Widget.css
* Adjust menu up a few pixels to match other uses of ve.ui.MenuWidget (the format drop down)

ve.ui.LinkInspector.js
* Moved the form value initialization to a timeout that fires well after the animation of the inspector - this is only important because the first element has a menu that pops up and the menu was rendering in the wrong location

ve.ui.Frame.js
* Added reference to frame within this.$$ by passing it to get$$

ve.ui.Inspector.js
* Removed auto-focus on open from inspector base class - this will be done in a more specific and controlled way instead

ve.ui.js
* Added optional frame argument to get$$ so that it's easy to get the frame from any $$ that's bound to an iframe document

ve.ui.Window.js
* Removed duplicate static member assignments
* Added auto-focus on the window's frame before calling onOpen
* Added auto-blur of anything focused within the iframe after calling onClose

ve.ui.MWLinkTargetInputWidget.js
* Auto-highlight the selected item when populating a menu so that pressing enter always keeps the currently selected item selected

ve.ui.TextInputMenuWidget.js
* Take the frame's position into account when positioning a menu below an input

Change-Id: I334f7db29af6b821bcfc8dc3c0ccba2636d4d9b1
2013-03-14 16:56:04 -07:00
Trevor Parscal 949722c392 Toolbar actions not floating
Spurious semi-colon caused class to not be parsed, making toolbar actions not float right

Change-Id: I1ef88358908002cd7feb8c02b5da80d4f1ffe46d
2013-03-14 16:47:23 -07:00
jenkins-bot 77d29ec51c Merge "Add support for non-Latin scripts to wordBoundaryPattern" 2013-03-14 18:18:38 +00:00
Ed Sanders 47090bd1fd Add support for non-Latin scripts to wordBoundaryPattern
Replacing [a-zA-Z] with a long unicode expression which encompasses
all the characters in the unicode 'letters' category. Similarly replacing
[0-9] with an expression for 'numbers'.

Bug: 44085
Change-Id: Idd403339caa24769ce08133dda06ab6d4b9d694e
2013-03-14 11:17:28 -07:00
jenkins-bot bf6e7a6361 Merge "Correct name of can(Node)HaveGrandchildren functions" 2013-03-14 18:15:43 +00:00
jenkins-bot f53fe28d11 Merge "Add tests for ve.dm.Document.getNearestWordBoundary" 2013-03-14 18:02:27 +00:00
jenkins-bot 6f1216c3bf Merge "Fix Surface constructor in IndentationAction tests" 2013-03-14 18:01:23 +00:00
jenkins-bot 34a792d7b9 Merge "Context, frame, window, dialog and inspector refactor" 2013-03-14 17:41:09 +00:00
Trevor Parscal 1572ec1569 Context, frame, window, dialog and inspector refactor
This is a major refactor of user interface context, frame, dialog
and inspector classes, including adding several new classes which
generalize managing inspectors/dialogs (which are now subclasses
of window).

New classes:
* ve.ui.Window.js - base class for inspector and dialog classes
* ve.ui.WindowSet.js - manages mutually exclusive windows, used
  by surface and context for dialogs and inspectors respectively
* ve.ui.DialogFactory - generates dialogs
* ve.ui.IconButtonWidget - used in inspector for buttons in the head

Refactored classes:
* ve.ui.Context - moved inspector management to window set
* ve.ui.Frame - made iframes initialize asynchronously
* ve.ui.Dialog and ve.ui.Inspector - moved initialization to async
  initialize method

Other interesting bits:

ve.ui.*Icons*.css, *.svg, *.png, *.ai
* Merged icon stylesheets so all icons are available inside windows
* Renamed inspector icon to window

ve.ui.*.css
* Reorganized styles so that different windows can include only
  what they need
* Moved things to where they belonged (some things were in strange places)

ve.init.Target.js, ve.init.mw.ViewPageTarget.js, ve.init.sa.Target.js
* Removed dialog management - dialogs are managed by the surface now

ve.ui.*Dialog.js
* Renamed title message static property
* Added registration

ve.ui.*Inspector.js
* Switch to accept surface object rather than context, which conforms
  to the more general window class without losing any functionality
  (in fact, most of the time the surface was what we actually wanted)

ve.ui.MenuWidget.js, ve.ui.MWLinkTargetInputWidget.js
* Using surface overly rather than passing an overlay around
  through constructors

Change-Id: Ifd16a1003ff44c48ee7b2c66928cf9cc858b2564
2013-03-14 00:03:31 +00:00
Ed Sanders 387d8d6d39 Fix Surface constructor in IndentationAction tests
The IndentationAction was created against a version of master which
didn't have the new Surface constructor signature. This commit resolves
that conflict.

Change-Id: Ifc17f95acfa6057963d503448405355831b1ff97
2013-03-13 23:55:25 +00:00
Ed Sanders d22c7f7773 Correct name of can(Node)HaveGrandchildren functions
Bug: 43893
Change-Id: I9fd2a1fd6e3ee0a7bdfc357b5d4e4e0fd3efa0a5
2013-03-13 23:25:33 +00:00
Ed Sanders 981bb3ae7c Add tests for ve.dm.Document.getNearestWordBoundary
Also in this commit is a minor fix to the regular expression so it
behaves as documented (the hyphen needed escaping).

Bug: 44085
Change-Id: Idc315e2dce79be8f028b5681c60f74e175b9d869
2013-03-13 17:21:59 +00:00
jenkins-bot acf72c72c4 Merge "Refactor convert to use isolateAndUnwrap" 2013-03-13 16:37:17 +00:00
jenkins-bot 1d6e1828f3 Merge "Emit apply and close dialog when apply changes is clicked." 2013-03-13 06:56:49 +00:00
Rob Moen 002fa5d40b Fix current annotation being nullified
MWLinkTargetInputWidget annotation property was being killed
on populateMenu.

Other changes:
* Removed calls to sanitize on subclasses setValue methods
  as those methods call the parent class method which already
  sanitizes input.

Bug: 46025
Change-Id: I169dd58a06122122f187f9d751076ef56b255558
2013-03-13 01:41:33 +00:00
Timo Tijhof 2a1a25c580 Fix new lint warnings previously uncaught by jshint
The new jshint (0.9.1 > 1.1.0) is smarter about detecting trailing
whitespace (which enabled in our jshintrc file).
Looks like we did indeed let it slip through a few times in ve.Document.

Also cleaning up comment from * to - for consistency and avoiding
block-comment characters.

Change-Id: Ie1621816d608b5c42028ee945346d872a747c6a4
2013-03-13 01:37:00 +00:00
Ed Sanders a03d0d68cb Refactor convert to use isolateAndUnwrap
isolateAndUnwrap now unwraps to a level determined by a target type
i.e. the type you are going to convert to.

Also in this commit wrap/unwrap/rewrap have been refactored to use
getLengthDifference. unwrap now takes an inner/outer unwrap depth.

Change-Id: I3c6249de43232a9ef64f498a0aaf66b1c44973f2
2013-03-13 01:07:52 +00:00
jenkins-bot 9dfa6945b4 Merge "Only unwrap { generated: wrapper } based on context." 2013-03-13 00:55:14 +00:00
Ed Sanders 9a7b8aacf8 Only unwrap { generated: wrapper } based on context.
Wrapper paragraphs should only be unwrapped if they are the first
element in their parent - or if there is a block level element separating
them from the previous unwrapped paragraph.

Empty paragraphs should only be unwrapped if they are empty and the
last element in their parent.

Also in this commit is a simple test for IndentationAction.decrease().

Bug: 45590
Change-Id: I1f47d12db6d57d984fd4607f667a3b62c53f3dd6
2013-03-13 00:42:16 +00:00
jenkins-bot 34e8a9dbac Merge "Create MediaWiki specific nodes to contain MW specific rules." 2013-03-12 23:46:51 +00:00
Ed Sanders 0ce20b6e16 Create MediaWiki specific nodes to contain MW specific rules.
Heading and Preformatted nodes have rules that should only
exist under a document node in MediaWiki.

Two new node types have been created as has a new DropdownTool which
uses these. The MW init options have been changed to use the new
DropdownTool.

Bug: 45295

Change-Id: I3f47e1ae1f5c1415bde58a75385e4bf5f4b8fffc
2013-03-12 16:28:29 -07:00
Timo Tijhof c13dce97ec Fix JSDuck warnings
Change-Id: Ibc3f49c55ded5490fcb071f0ccf9f25a71a06c97
Warning: categories.json Class 've.NodeFactory' not found in categories file
Warning: ve.ui.ContentDialog.js:8: Unknown type ve.ui.Surface
Warning: ve.ui.MetaDialog.js:8: Unknown type ve.ui.Surface
Warning: ve.ui.Dialog.js:8: Unknown type ve.ui.Surface
2013-03-12 22:05:25 +01:00
Ed Sanders 404ddbf7cc Fix broken FormatAction tests.
The ve.Surface constructor was recently changed, but the instantiation
in the FormatAction tests was not updated accordingly.

The constructor now requires a ve.init.Target object.

Bug: 39597
Change-Id: Ia4193fbab5c63007ed057009bf9a39f1f9d18fb7
2013-03-11 16:53:44 +00:00
jenkins-bot 7b47b2ef03 Merge "Do not display phantoms while dragging mouse over alien nodes." 2013-03-08 23:38:25 +00:00
Inez Korczyński b99192e110 Do not display phantoms while dragging mouse over alien nodes.
It really does screw up selection in IE and does not look good in other supported browsers.

Change-Id: Ie190e86b25c3b253d4cf809594e74094275d0d57
2013-03-08 15:18:38 -08:00
Rob Moen 004f4cdeb7 Emit apply and close dialog when apply changes is clicked.
* Cleanup cancel button click binding.

Change-Id: I959a1b33e06a344a7946de8709f71f9c265a7604
2013-03-08 13:51:58 -08:00
jenkins-bot 8f7f6aefe6 Merge "Adding comments for grep" 2013-03-08 21:47:55 +00:00
shirayuki 17508a2657 Adding comments for grep
Change-Id: Ib20219ccf4409ac24f896c67e695f4155136daeb
2013-03-09 06:46:24 +09:00
Rob Moen ef9fb83685 In MW integration, dialog was overlapping toolbar shadow.
Setting the top to the outerHeight of the toolbar solves this.

Change-Id: I528ce23c88dfe6a3be7d4f7c4f6c90ef608630c1
2013-03-08 11:15:21 -08:00
jenkins-bot 80067f8633 Merge "Use static.name once for ce and dm nodes" 2013-03-08 01:20:35 +00:00
Ed Sanders edcaaf9edc Use static.name once for ce and dm nodes
Add a static.name property to ce nodes and make sure both ce
and dm nodes always use the static.name property in constructors
and registration calls.

The result of this is that any given node type should now only
appear once in the code as a string.

Bug: 45701
Change-Id: Ibf31de16ab28ad58209c1443cd74f93dda278998
2013-03-07 17:19:39 -08:00
jenkins-bot 49fea58c76 Merge "Fix for incorrect usage of ve.Range" 2013-03-07 23:51:18 +00:00
Inez Korczyński c021445649 Fix for incorrect usage of ve.Range
Properties "from" and "to" of ve.Range should be used when
direction of the range is important.

Change-Id: I73f27abf5c90f9aad8fdd0622f71b09188af9486
2013-03-07 15:49:00 -08:00
jenkins-bot 007d221b73 Merge "More work on dialog classes and their mw specific handling." 2013-03-07 22:46:43 +00:00
jenkins-bot 41a4cc2327 Merge "Introduce dialogs" 2013-03-07 22:46:36 +00:00
Rob Moen 7044ec820f More work on dialog classes and their mw specific handling.
Changes include:

VisualEditor.i18n.php, VisualEditor.php
* i18n labels for dialogs

ve.init.mw.ViewPageTarget.js
* Initial go at onOpenDialog and onCloseDialog methods

ve.init.Target.js
* Change calls to dialog hide & show to close & open

ve.ui.MetaDialog.js, ve.ui.ContentDialog.js
* Pass surface when constructing
* Add static title message property

ve.ui.Surface.css
* Set high z-index for toolbar for shadow to overlap dialog.

ve.ui.Dialog.js
* Extends EventEmitter class.
* Changed hide/show method names to open/close.
* Create base ui elements.

ve.Surface.js
* Create instance of meta dialog.

Change-Id: I867ca0546606eeb5e2ab7f612bb5af700ab877ec
2013-03-07 12:47:42 -08:00
Inez Korczyński e9b8021bf3 Fix for IE bug where clearTimeout doesn't clear the timeout
Apparently in IE even after you call clearTimeout, the function passed
to setTimeout might still get invoked (not 100% of the time).

It depends on the time difference between calling clearTimeout and
when that function was supposed to be called.

Change-Id: I050c1ecc51c1d891a028fb777243573487357171
2013-03-07 03:49:39 +00:00
Rob Moen 81c9b72db5 Introduce dialogs
Major changes:

demos/ve/index.php
* Renamed ve-demo-content to ve-demo-editor

ve.init.mw.ViewPageTarget, ve.init.sa.Target
* Added handlers for dialog events

ve.ui.*Dialog.js
* Added skeleton classes for dialogs

ve.init.Target.js
* Create abstract class methods for Target.

ve.init.sa.Target.js
* Create Standalone target view methods.

ve.init.mw.Target.js
* Added MW specific target view methods.
* Integration action buttons are now added to the edit
view in the toolbar.

ve.Surface.js
* Simplified constructor, now requiring a target which contains the container

* Other changes include some documentation and code cleanup.

Bug: 39597
Change-Id: Iff39266bdd3052f34bda254ca407030dbbc81f26
2013-03-06 14:19:15 -08:00