Commit graph

1807 commits

Author SHA1 Message Date
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
jenkins-bot a8371251d3 Merge "Fix documentation for GridLayout to add a return type" 2013-05-25 12:11:14 +00:00
Catrope 65c3540da7 Fix getAnnotationIndexesFromOffset() to always return an array
It used to, but a recent change broke it

Change-Id: I03ecfd5a515855a286136b57217779fd1c5912a5
2013-05-25 13:41:32 +02:00
jenkins-bot c6e06f3917 Merge "Merging and remapping of IVStores and InternalLists" 2013-05-25 11:37:12 +00:00
jenkins-bot e25aa4f199 Merge "Add getDocumentSlice" 2013-05-25 11:36:37 +00:00
Catrope 238d68eb74 Merging and remapping of IVStores and InternalLists
Add merge() methods to IndexValueStore and InternalList, which merge
another store/list in to the current one and return a mapping
translating old indexes to new ones.

Also add functions that, given such a mapping, traverse a linear
model data array and remap store/list indexes using simple logic for
annotations and node type-specific functions for node attributes.

Change-Id: I1e90755ced1a87c190947c037cf151c4d17cf8b7
2013-05-25 11:33:35 +00:00
Catrope 6562b32aa7 Add getDocumentSlice
A document slice is a document built from a data slice of an existing
document. It's completely separate from the original document and has
its own store and internalList. The new document's data also contains
the entirety of the original document's internal list. It's possible
to create a document slice of data located inside the internal list,
in which case the resulting document will contain that data twice (one
mutable copy at the top level, and one immutable copy in the internal
list).

ve.dm.Document.js:
* Optionally take an internalList in the constructor. This allows us to
  create a document with a clone of an existing internalList rather than
  an empty one.
* Add edgeMetadata flag to getFullData()

ve.dm.IndexValueStore.js, ve.dm.InternalList.js:
* Make these classes cloneable

Change-Id: I93e06f764ace16aee9df941b07f8c2bff1a28e2b
2013-05-25 11:33:14 +00: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
jenkins-bot d6b801aa7d Merge "Store multi byte characters as one element" 2013-05-25 09:00:49 +00:00
jenkins-bot cc59e59647 Merge "Correctly populate internalList for example documents" 2013-05-24 22:55:36 +00:00
Ed Sanders 90e4f4d665 Store multi byte characters as one element
Getting & setting the cursor is done with byte offsets
instead of data model offset (characters) so we need to
be able to convert between the two as well as splitting
characters.

TODO: The regex only works on surrogate pairs, not
yet combining accents.

fixupInsertion will combine a combining mark with the
character to its left it it can.

Bug: 48630

Change-Id: I8d936fb15d82f73cd45fac142c540a7950850d55
2013-05-25 00:50:11 +02:00
jenkins-bot 601f01dbd3 Merge changes I2dc0c151,I807a0f32
* changes:
  Attach resize handles to $localOverlay
  Remove resize handles on surface teardown
2013-05-24 22:17:50 +00:00
jenkins-bot a160da0cb9 Merge "Remove language page tab from MW meta dialog" 2013-05-24 22:15:56 +00:00
jenkins-bot bb9da98c5d Merge "Wrap pre-formatted nodes at word boundaries, not window width" 2013-05-24 20:49:09 +00:00
James D. Forrester 83c79bd586 Wrap pre-formatted nodes at word boundaries, not window width
Bug: 38043
Change-Id: I9b5e3b3e62b52c86743ee345b1cc31beec0a061e
2013-05-24 22:44:44 +02:00
Ed Sanders e14defc76f Attach resize handles to $localOverlay
Because that's where they should be.

Change-Id: I2dc0c1511f459fea6bf7db86eff9a55c07dd911b
2013-05-24 22:43:15 +02:00
Ed Sanders 80a37e9df3 Remove resize handles on surface teardown
Add teardown call to surface destruction in mw target, and
teardown listener to resizeable node.

Bug: 48530
Change-Id: I807a0f32d3d1eb490456d887f7bf867bdb896df4
2013-05-24 22:19:18 +02: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
Catrope 8157bcc474 Correctly populate internalList for example documents
Right now the internal list is very much HTML-based, so it's not
populated at all when creating a document from data. So hack this in by
specifying what should be in the internal list as a property of the
example document's data array.

Change-Id: I51c7b7b4dcd9fd3333777c1287b7ba544887aa32
2013-05-24 17:39:45 +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
Inez Korczyński 57317e2327 Use our own collection of constant to key code. The one based on w3c is not reliable.
Also, for next few months, please don't mention w3c when I'm around.

Change-Id: I4c8577ae50c16b177dbe370a0deac0d3272e9a06
2013-05-23 16:39:01 -07:00
jenkins-bot ba5dd768a7 Merge "Fix value for DOM_VK_DELETE" 2013-05-23 19:35:13 +00:00
Ed Sanders 181fb4d920 Fix value for DOM_VK_DELETE
The spec you link to appears to not correlate to the real world.
Firefox has a value of 0x2E (46 in decimal) store for this, and
both FF & Chrome report that value in my tests.

Change-Id: I4b0d4d27448587ca7381c640d6d3949402305656
2013-05-23 18:57:27 +02:00
jenkins-bot 41e10e2e37 Merge "Support for thumb and frame images with captions." 2013-05-23 07:47:04 +00:00
Inez Korczyński 1d7cf569e6 Support for thumb and frame images with captions.
* VisualEditor.hooks.php
** export URL to magnify clip as a configuration variable so thumbnail image can render correctly

* ve.ce.Surface.css
** add CSS styling to make image captions look the same way in edit mode as they look in the view mode

* ve.ce.ParagraphNode.js
** add CSS class ve-ce-generated-wrapper if it is a generated wrapper

* ve.ce.MWImageCaptionNode.js
** make image caption rendering match the view mode

Change-Id: I0cd1b25e8f8355e0500aabc90e7c4cdf591545f3
2013-05-23 00:44:43 -07: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 f25572a992 Merge "Fix for check if data is balanced" 2013-05-22 22:05:43 +00:00
Inez Korczyński 02d522500c Fix for check if data is balanced
Previous check wouldn't make sense, cause the last offset in the data
could be that one that makes data balanced (and j is increased always
after iteration).


Change-Id: Ie9498d0ac9e3417d09b8b3043bf3281e7dfbf9db
2013-05-22 14:19:42 -07:00
Inez Korczyński f29fa6ec88 Added comment to explain better what ve.Keys is.
Change-Id: I9c9b181c4ddbaa0a32e419726fc91b6ae8db7b2a
2013-05-22 13:19:45 -07: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 ec44f52a8c Merge "Remove native KeyEvent" 2013-05-22 19:56:36 +00:00
jenkins-bot 5b343fcc2c Merge "Get rid of try..catch by using ve.dm.nodeFactory.lookup." 2013-05-22 19:55:32 +00:00
jenkins-bot a0bf6a0fc2 Merge "ve.Element: Add unit tests" 2013-05-22 19:53:01 +00:00
Christian Williams d0dbc395a5 Remove native KeyEvent
Relying on any native implementation of window.KeyEvent is
unreliable. The two specs listed in the comments for this method
are not the same and Firefox now has DOM_VK_ENTER and
DOM_VK_RETURN which are equivalent to 13 and 14 respectively.
The key on the right side of my home row triggers 14 using
native window.KeyEvent in Firefox, where Chrome uses our
defined constants and returns 13. This fix ensures the same
values for all browsers.

Change-Id: I12b2f5d674bdf13526577cb81d0505b608f2846c
2013-05-22 12:52:31 -07:00
Inez Korczyński bf6df1ff37 Get rid of try..catch by using ve.dm.nodeFactory.lookup.
Change-Id: I017ed60f7d7ce8af34c94fe237cc4101192518f1
2013-05-22 12:51:51 -07: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
Timo Tijhof d28e10d830 ve.Element: Add unit tests
Follows-up c2defc9.

Change-Id: I2045e40567de01f6b44beffe760b6a6287754f75
2013-05-21 19:18:46 +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
Ed Sanders 523e981a08 Show warning when commit message is empty and preference is set
If the commit message is empty we show a warning, and if the warning
is already visible we allow the user to proceed.

Bug: 47752
Change-Id: Idba707abaea8b08a94f7fa4d5bc5b1e35261a572
2013-05-21 08:02:16 +02: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
jenkins-bot c1477bc1da Merge "Move selection to end of insertion after paste" 2013-05-20 23:19:55 +00:00
jenkins-bot d783cb15cf Merge "mw.ViewPageTarget: Get feedback url from content language" 2013-05-20 22:24:56 +00:00
Ed Sanders 6ca8caa0ca mw.ViewPageTarget: Get feedback url from content language
Link is specific to the project language, not the user's preference.

Bug: 47730
Change-Id: I3804e6f91015ef9b8ae5196efb37475d714cd7d5
2013-05-20 22:23:05 +00:00
Inez Korczyński cea627b6d4 mw.ViewPageTarge: Add mw-content-ltr/mw-content-rtl to surface
Add class to surface in order to correctly match MediaWiki styling.

Change-Id: If9f39dabc723d37a51065e410415fc76ca044d2e
2013-05-20 22:18:39 +00:00
Inez Korczyński 7c8bc08470 Added very basic support (rendering) for captions of thumb and frame images.
Change-Id: I4a59d4601c9bf44b241bb1432c9f1abc3f961743
2013-05-20 13:15:35 -07:00
jenkins-bot 6c367b9998 Merge "Add a transaction builder for replacing the contents of a node" 2013-05-20 20:12:10 +00:00
Catrope 7aefae885a Add a transaction builder for replacing the contents of a node
Change-Id: I69d362c4694104313dd2634434eddfbaf9435b22
2013-05-20 13:09:54 -07:00
jenkins-bot 8ba06a89b8 Merge "Refetch the token when we get a badtoken error" 2013-05-20 20:04:36 +00:00
jenkins-bot 791fdfb6d4 Merge "Refactor HTML attribute preservation" 2013-05-20 17:29:09 +00:00
jenkins-bot fb9f6df6b5 Merge "Wrap <img> in <a> inside image thumb in order to match MediaWiki parser output." 2013-05-18 16:54:24 +00:00
jenkins-bot cd91f4108f Merge "Fix call to getWindow" 2013-05-18 16:50:34 +00:00
jenkins-bot f31e8d19d9 Merge changes Icbab46af,Ied54d2b7
* changes:
  Move toolbar cancel message to VE specific message
  Remove parsedMessages from messages array
2013-05-18 16:48:36 +00:00
Ed Sanders 95f41c176b Move selection to end of insertion after paste
Assuming this was broken by changes to translateRange.

Bug: 48603
Change-Id: Ia2a2120cb75aa86374b594ae3f484c5161028919
2013-05-18 16:41:58 +01:00
Ed Sanders 57b9167bb5 Fix call to getWindow
Using the wrong namespace.

Bug: 48602
Change-Id: I31dc071328123b57b778aa1b21f0e1daf6405e5c
2013-05-18 16:29:03 +01:00
Ed Sanders 706b64e82c Change document title on surface setup/teardown
Now reads "Creating/Editing Title - Sitename".

Bug: 48272
Change-Id: I9dcc8ec2c37a7ff9cff6cedb7bdb1fed1bdc4deb
2013-05-18 12:29:47 +01:00
jenkins-bot 0a8e596ffc Merge "Fix old copy/paste documentation errors" 2013-05-18 10:23:37 +00:00
jenkins-bot 44aac53bbe Merge "Fix various issues with prematurely aborting VE load" 2013-05-18 10:21:54 +00:00
jenkins-bot 9a3d7c288e Merge "Fix bytelimit status update" 2013-05-18 10:20:27 +00:00
jenkins-bot bbfdb30f87 Merge "Change 'Edit source' to 'Create source' for new pages" 2013-05-18 10:19:01 +00:00
Ed Sanders d8658a9fb0 Fix bytelimit status update
We need to listen to the same events as bytelimit. Specifically
we were missing keyup, which meant the counter could get stuck on
-1.

Bug: 47718
Change-Id: I3d4f3f8cd451bfb6acea19ee9baae7be60adcf15
2013-05-18 10:18:59 +00: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
Catrope 6f0c739d42 Refetch the token when we get a badtoken error
Intercept badtoken errors, refetch the edit token from the
action=tokens API, and retry the request again. If this fails too,
show the error to the user.

Right now this just shows the good old confirm() dialog if the token
refetch fails; we should probaby give the user a clearer error message
telling them to refresh the page or something.

Bug: 42984
Change-Id: Ib43d1938ffa24bc8d1dc76a300e16e486dabd928
2013-05-17 19:15:21 -07:00
Ed Sanders 356c279046 Always enable save button on oldid pages
Was previously enabled on creation but could be disabled
by state changes.

Bug: 48584
Change-Id: I67c011ac655d4e553f9467cab10a875aaac61d03
2013-05-17 21:00:26 +01:00
Inez Korczyński e196c2f247 Wrap <img> in <a> inside image thumb in order to match MediaWiki parser output.
Change-Id: I91cfcd9ea319b4429abbbe9ddbb07d1cd8a65b62
2013-05-17 11:42:27 -07:00
Ed Sanders e968fc717f Change 'Edit source' to 'Create source' for new pages
Bug: 47421
Change-Id: Iafba040cb8eb53017f38f2099a473e0e43e2ec46
2013-05-17 18:43:41 +01:00
Ed Sanders 1db0ced8cc Fix various issues with prematurely aborting VE load
Add checks to make sure parts of the target are acutally
active before trying to tear them down or use them.

This fixes a couple of issues which appeared when the VE was
closed before it had a chance to finish loading.

Bug: 48520
Bug: 47813
Change-Id: Ide5def0e983bab49108b40008fc170957c7fc2a2
2013-05-17 17:48:27 +01:00
Ed Sanders 5d41f902ee Fix old copy/paste documentation errors
Three methods in ve.init.mw.ViewPageTarget have incorrect descriptions.

Change-Id: Ie2e7835a7c6fa7387d48936dbe65649a150eec79
2013-05-17 16:38:48 +01:00
Ed Sanders f56bdf70fd Move toolbar cancel message to VE specific message
Be consistent with all other button messages.

Change-Id: Icbab46aff210b79db59de688d539b8e69a13ec0d
2013-05-17 15:21:46 +01:00
jenkins-bot 4f14fddd2b Merge "ve.ui.PopupWidget visibility fixes" 2013-05-17 05:52:35 +00:00
jenkins-bot dd2d6e900d Merge "Use promise pattern inside MWTemplateDialog in order to download TemplateData (currently just mocked) asynchronously." 2013-05-17 05:49:29 +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
jenkins-bot 28d33df097 Merge "Support for nodes that handles their own children in ve.dm.Converter.prototype.getDomSubtreeFromData" 2013-05-17 05:48:35 +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 6033608ba1 Merge "Keep veaction=edit in the url when VE runs in debug mode so it keeps user just refresh the page in order to get into the edit mode." 2013-05-16 23:06:44 +00:00
Inez Korczyński 531c049679 Support for nodes that handles their own children in ve.dm.Converter.prototype.getDomSubtreeFromData
Change-Id: I784dec71d3f0b23001075234e324a8e06a6cfc6b
2013-05-16 16:01:46 -07:00
Inez Korczyński 9f16ff5150 Keep veaction=edit in the url when VE runs in debug mode so it keeps user just refresh the page in order to get into the edit mode.
Change-Id: I32c7135c3b989348d2d5722977cec2f81f08c162
2013-05-16 15:02:14 -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
jenkins-bot 57a2de90aa Merge "Emit teardown event before replacing generated content node content and emit setup event after." 2013-05-16 01:23:34 +00: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 995a20219a Emit teardown event before replacing generated content node content and emit setup event after.
Change-Id: I397d4dfb5fd0177255a0b4389ba5380807969ef4
2013-05-15 17:35:49 -07:00
Ed Sanders b5ead95ee8 Implement roundtrip update of template contents
Currently there is no Parsoid call for this so we're using the PHP
parser API.

Change-Id: I8bc4f96924d88de7bc67203336bf465ba91fc37b
2013-05-16 00:56:44 +01:00
jenkins-bot a47619cd04 Merge "Introduce createPage method in ve.ui.MWTemplateDialog and even use it!" 2013-05-15 23:40:29 +00:00
jenkins-bot 133a501481 Merge "Fixing block template styling" 2013-05-15 23:39:52 +00:00
Christian Williams e669f8faf6 Fixing block template styling
Trailing comma borks everything.

Change-Id: Ic4eb97f84b45297312b45ab64355836ef8a329d1
2013-05-15 16:37:27 -07:00
Trevor Parscal e64d900fc3 Fix image block node error
When loading an image block node in the demo, there are no classes on the figure, which caused the code to crash because it was assuming that jQuery's attr method would always return a string.

Change-Id: Ib13e7bfa3fb2bd76ac71dfef085bed209d880b4a
2013-05-15 16:24:10 -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