Commit graph

2338 commits

Author SHA1 Message Date
Ed Sanders f2b4998faf HACK: Don't merge adjacent annotations from Parsoid
Adjacent annotations should not be merged if they both
originate from Parsoid. This is a hack because this logic
should be in Parsoid, not VE.

Bug: 49873
Change-Id: If1e23e3039178300d72b1c0c585931417bb603b5
2013-07-14 18:36:33 -07:00
jenkins-bot e65baa886f Merge "Make link inspector re-usable by splitting it up" 2013-07-12 21:17:49 +00:00
jenkins-bot 587079401e Merge "Fix annotated element alien metadata inside wrapped paragraph" 2013-07-12 20:48:58 +00:00
Ed Sanders d2778b1df4 Fix annotated element alien metadata inside wrapped paragraph
Add check that we can close the wrapper to meta items, also
annotate them correctly.

Bug: 51235
Change-Id: Idd4a2304f588ea74b9a9814ce86c1fd0c026e441
2013-07-12 20:13:15 +01:00
Trevor Parscal a4491c12f8 Make link inspector re-usable by splitting it up
Objective:

* Make the majority of link inspector, which is generic to any annotation,
  usable for other annotation inspectors

This was merged earlier (f7107fa20d) but broke master, so it was
reverted (092fa74dee). This commit also incorporates 5dcf5d1c49.

Change-Id: Ib9190dee66ce064d69962f9c4c5b3a710be8ad07
2013-07-12 17:58:04 +00:00
jenkins-bot 0926fd0656 Merge "Optimise png images with optipng" 2013-07-12 17:34:39 +00:00
Rob Moen 25b937c496 Adjust toolbar group margins for equal vertical alignment
Change-Id: I4596e50c941b1cb628f2ccba983d4b60b7939174
2013-07-11 11:22:45 -07:00
jenkins-bot e317792028 Merge "Tighten up outlines and fieldsets" 2013-07-11 16:32:27 +00:00
Trevor Parscal 1c637008e5 Tighten up outlines and fieldsets
Objective:

* Make outline widgets and fieldset layouts take up a little less space

Bonus:

* Fix option icons always showing up on the first item because the option
  wasn't position relative

Changes:

ve.ui.Widget.css
* Add position: relative to option widgets
* Cleanup unused background properties for outline items
* Reduce padding for outline items
* Move icons to match padding changes

ve.ui.Layout.css
* Reduce margins for fieldset layouts, including using a negative top
  margin to compensate for the overly tall legend

Change-Id: Ida6147b8171dcb4152ca9be0e099a5f9b81ac1c0
2013-07-11 16:22:38 +00:00
jenkins-bot ca15571b2f Merge "Reuse the rules variable" 2013-07-11 00:23:00 +00:00
Roan Kattouw 7345e63961 Reuse the rules variable
Change-Id: I8ce666dad712a99e471930132e3d123dfcf5466d
2013-07-10 17:21:07 -07:00
jenkins-bot bc6a4ee8e1 Merge "Work around Firefox's excessive style security paranoia" 2013-07-11 00:20:21 +00:00
Roan Kattouw 9938186cab Work around Firefox's excessive style security paranoia
Apparently it's possible for a stylesheet's .cssRules to be accessible,
but for the individual items' .cssText not to be, in which case Firefox
throws a nice security exception that kills the entire editor.

Wrap all inspector of cssRules in a try-catch, and fall back to cloning
the ownerNode if anything weird happens.

Change-Id: I0187ad308e395e92aea587c00fd8d8eb0280822e
2013-07-10 17:16:00 -07:00
jenkins-bot ac6c10dad7 Merge "Bind listener to keyup to capture arrows & better math for scrolling." 2013-07-10 21:22:58 +00:00
Rob Moen 31104d5788 Bind listener to keyup to capture arrows & better math for scrolling.
Listen to keyup to properly capture and respond to up and down arrows.
Rewrite calculation for scroll to better follow toolbar obscured cursor.

Bug: 48787
Change-Id: Ia46fb15ec9a8c07b3945b53a6545897ca23e59fa
2013-07-10 14:21:03 -07:00
jenkins-bot 691d9fe462 Merge "Language Inspector: CE / DM" 2013-07-10 19:13:40 +00:00
Moriel Schottlender fdcec169d1 Language Inspector: CE / DM
This is the infrastructure for the Language Inspector prototype, defining
the dm and ce pieces of the <span lang='xx' dir='yy'> annotations. It also
sets up a visual indicator for language blocks (with informational tooltip
for the user while editing. The UI is built on top of this.

Bug: 47759
Change-Id: I239eef5124e29369ea9c5d8c0f49b2f6a61bc053
2013-07-10 12:11:27 -07:00
Rob Moen ef36b753da Focus link inspector input prior to lookup.
Since the menu only shows while it's input is focused, input must be focused
prior to suggestions being popuplated.  Fixes race condition where
look up request is near instantaneous.

Change-Id: Icf645d051415ac3ee9e15bc85f22f29dc9b64666
2013-07-10 10:22:20 -07:00
jenkins-bot f8184ebeb9 Merge "Lock surface while inspectors are animating open" 2013-07-10 01:54:05 +00:00
jenkins-bot 06faf92a12 Merge "Make parameter search widget have a horizontal limit" 2013-07-10 01:42:44 +00:00
jenkins-bot 15f2ff6f20 Merge "Tool and context menu size and alignment fixes" 2013-07-10 01:37:34 +00:00
Trevor Parscal 703328d770 Make parameter search widget have a horizontal limit
Objective:

* Cut off really long parameter names with ellipsis

Changes:

ve.ui.Widget.css
* Use ellipsis when option labels get too long

ve-mw/ve.ui.Widget.css
* Limit the size of a parameter result widget label - this is a hack, but
  since there are strange bugs with using ellipsis together with % based
  width, it's the best we can do for now

Bug: 50800
Change-Id: Idbfa336d2bba376b0d078fdd0ece65926d610d81
2013-07-10 01:35:38 +00:00
jenkins-bot 9d5ba2bf78 Merge "Remove dead CSS code" 2013-07-10 01:35:30 +00:00
jenkins-bot 164094ee6c Merge "RTL Improvements" 2013-07-10 01:34:06 +00:00
Trevor Parscal 9297f33989 Tool and context menu size and alignment fixes
Objectives:

* Make context menu toolbar consistently sized and aligned, especially
  in monobook

Changes:

ve.ui.Toolbar.css
* Remove vertical line between groups, just use whitespace
* Switch from padding to margins to avoid size calculation issues

ve.ui.Tool.css
* Remove tiny margin on button tools, tightening them up a bit
* Replace 50% 50% with center center

ve.ui.Context.css
* Switch from padding to margins to avoid size calculation issues
* Use different margins depending on text direction
* Reverse the 0.8em rule used in the dialog - this is a hack, it should
  be cleanup up later with a better strategy for normalizing the size
  of text within VE elements

Change-Id: If65f12382625efa33777e284bd23a94dc509436a
2013-07-10 01:33:37 +00:00
Trevor Parscal 461e518fca Remove dead CSS code
Reference counting indicates these styles are not in use, so they can now be safely garbage collected.

Change-Id: I432f73490eeb00ff414f150fcf26c718607bac95
2013-07-10 01:32:57 +00:00
Trevor Parscal 33e2c8f280 Lock surface while inspectors are animating open
Objective:

* Prevent input while the inspector is animating open

Changes:

ve.ui.LinkInspector.js
* Disable and then re-enable the surface while the inspector is opening

ve.ce.DocumentNode.js
* Remove opacity changes on disable/enable

ve.init.mw.ViewPageTarget.js
* Change the opacity of the document when save dialog is open

Bug: 51075
Change-Id: Ic7910a666b33b41b57b035a15cf1f8c9264e7111
2013-07-09 17:16:25 -07:00
Trevor Parscal 3a6e91dfb7 RTL Improvements
Objectives:

* Make option widget icons correctly placed in RTL
* Make embedded context toolbar correctly placed in RTL

Approach:

Use separate elements for icons within option widgets which have more
flexibility when rendering in either LTR or RTL when compared to CSS
background position. The simpler approach, using CSS background
position offsets, isn't cross-browser compatible at this time.

Changes:

ve.ui.OutlineItemWidget.js
* Remove custom icon implementation, using parent class implementation
  instead

ve.ui.OptionWidget.js
* Add icon option, which adds an icon element only if an icon was
  specified

ve.ui.MenuItemWidget.js, ve-mw/ve.ui.MWParameterResultWidget.js
* Add override for icon config option
* Document icon config as private

ve.ui.Context.js
* Add detection and special handling for positioning embedded context
  toolbar when rendering in RTL

ve.ui.Widget.css
* Add styles for option widget's new icon option
* Add styles to make indentation still work for outline item widgets
* Adjust styles for menu item widget as per changes in option widget

ve-mw/ve.ui.Widget.css
* Adjust styles for parameter result widget as per changes in option
  widget

Change-Id: Ibfa4b613e0fd7902f8a2c78b5717de402c5f82b8
2013-07-10 00:09:22 +00:00
jenkins-bot 2e0f80e0d3 Merge "ve.dm.Surface: Fix incorrect @return for #getDocument" 2013-07-09 23:48:29 +00:00
Timo Tijhof ec9fc830a6 ve.dm.Surface: Fix incorrect @return for #getDocument
This returns a ve.dm.Document object, not ve.dm.DocumentNode
(very different classes).

Change-Id: Ia8d4eda3e4a51cef58ab816453703a33c8d5f7d5
2013-07-10 01:46:55 +02:00
jenkins-bot d0b0c7b3eb Merge "Affordances for MenuWidget to be optionally focusable." 2013-07-09 23:44:11 +00:00
jenkins-bot ca87540eac Merge "Be sure lookupMenu input is focused before showing" 2013-07-09 23:32:49 +00:00
Roan Kattouw e9ca44c86c Transplant CSS from the main document to each iframe
We previously manually loaded CSS into these frames, which is flawed
because it completely bypasses ResourceLoader (so CSSJanus didn't flip
them, necessitating a bunch of hacks for RTL), and doesn't pull in
MediaWiki styles (so templates inside references don't render correctly).
Instead, this commit copies all styles from the main document into each
frame's document, inlining what it can.

Loading all styles in dialogs and inspectors caused some problems,
initially. We didn't namespace our styles for dialogs vs. inspectors
at all; the only reason inspector styles weren't being applied to dialogs
and vice versa was because we controlled which files were being loaded
in which context. This commit namespaces the inspector and dialog styles
where needed so they don't conflict and try to override each other.

Tested in Vector and Monobook, but not in Apex and not in RTL.

ve.init.mw.ViewPageTarget*.css:
* Namespace styles that are only intended for the main document
* Undo Monobook's font-size: x-small; in frames

*Dialog.js:
* Remove addLocalStylesheet() calls, we don't need those any more
** ve.ui.MWDialog seems to be unneeded now, we may want to remove it

*.css:
* Remove @noflip-ped RTL rules where they were just flipped versions of
  their LTR counterparts

ve.ui.Dialog.css, ve.ui.Inspector.css:
* Namespace styles with .ve-ui-dialog-content / .ve-ui-inspector-content

ve.ui.Frame.css:
* Move the margin:0 and padding:0 here (were in the frame <body>'s style
  attribute) and add background:none to prevent frames from getting
  the skin's background (grey in Vector, a book in Monobook)

ve.ui.Dialog.js, ve.ui.Inspector.js:
* Add ve-ui-dialog-content / ve-ui-inspector-content class to the
  frame's content <div> so we can restrict styles to only apply in
  dialogs / inspectors

ve.ui.Frame.js:
* Replace infrastructure for @import-ing stylesheets with transplantation
* Remove code polling to see when the stylesheets were loaded
** We can't do this in the new approach AFAIK, since all styles in the
   frame are either inlined or inaccessible due to the same-origin policy
** We also shouldn't need it because the browser should have cached the
   styles when it loaded the main document
* Apply ve-ui-frame-body class to the frame's <body> so we can style it
** Move inline padding:0;margin:0; into ve.ui.Frame.css
** Move the ve-ltr/ve-rtl class up to the <body>

ve.ui.Window.js:
* Remove infrastructure registering stylesheet URLs to load

Change-Id: I4a37115301811ad860f4578344a04873ea8c2b69
2013-07-09 16:13:28 -07:00
Rob Moen d6761f3ec3 Be sure lookupMenu input is focused before showing
Resolving this bug reveals a completely unrelated bug where hitting
enter while making a link prior to the input being focused, the
selected text gets replaced with a new line.

Bug: 51075
Bug: 49941
Change-Id: I61a90eeaa40b8b66886c17152544c46fa8ca396a
2013-07-09 22:59:53 +00:00
Catrope 30ebc9a656 Revert "Add support for <blockquote> elements"
Whoops, merged too soon. The dropdown part of it doesn't
actually work right.

This reverts commit 3c51ebad93.

Change-Id: Ieafbf18ca8a43b07e33a787772abbc77aef63e4c
2013-07-09 21:35:47 +00:00
James D. Forrester 3c51ebad93 Add support for <blockquote> elements
Bug: 51009
Change-Id: I7ba1635e4f856a021e1a7a2d26a8714230c9364a
2013-07-09 13:15:06 -07:00
Rob Moen 61c708ef1c Affordances for MenuWidget to be optionally focusable.
* ve.ui.MenuWidget.js
MenuWidget no longer creates an embeded input element by default.
In the case of no configured input element, we bind the keydown
handler to window with addEventListner while using the useCapture
flag.  This nicely prevents elements lower in the dom from triggering
( document node ) Supported in IE9 and above and all modern browsers.

* ve.ui.ListAction.js
Since MenuWidget is no longer stealing focus from the surface,
we no longer need to restore focus after a list item conversion.
This is the end goal, as browsers like Chrome like to scroll to
the top of elements that gain focus.

Bug: 50792
Change-Id: I5b6969bca1a58b040708f8ac9d3dc8b07ddf9e6b
2013-07-09 12:53:35 -07:00
jenkins-bot c328e3deff Merge "Make all annotations additive" 2013-07-08 19:51:56 +00:00
Ed Sanders e91cd00a2f Make all annotations additive
Any annotation could have a style attribute which has
a compound effect, and this also prevents roundtrip
errors. Button tool logic should prevent any annotation
from being applied twice which shouldn't be.

Bug: 49755
Change-Id: I8502a55cd2b195d28d0e2ecd63f15de670f80d60
2013-07-05 21:01:20 +00:00
Ed Sanders 11453371c6 Fix CSS lint error ('0px' => '0')
Change-Id: If9bfd8b061c0cd8240980cbd4ee4db5f24d40104
2013-07-05 22:22:31 +02:00
jenkins-bot 4621c083a1 Merge "makeStaticLoader: Update output and re-sync" 2013-07-05 18:47:47 +00:00
jenkins-bot 3456c7c441 Merge "Moved embed statement where it does something" 2013-07-05 18:41:37 +00:00
Moriel Schottlender 1dc21c01e3 Page settings fix-fix
This re-fixes the fix to the frame fix. fix fix.
Two things changed: Background position flipped to the right properly
(was somewhat off before) and text-alignment flipped as well.

Bug: 49613
Change-Id: I0aa317ef674537d20d7ed64e74eaa3cfe8030c8c
2013-07-05 13:44:13 -04:00
Niklas Laxström 5957065043 Optimise png images with optipng
Change-Id: Id014ad0a0aa99c9440360e32d2e10bc99fa64738
2013-07-05 09:47:12 +00:00
Niklas Laxström 96b7dbacb5 Moved embed statement where it does something
Followup to Ibdc2410cc

Change-Id: I5e665f5d720366650c362ed603693a223c96ee77
2013-07-05 09:47:12 +00:00
Timo Tijhof 50ffdeb729 makeStaticLoader: Update output and re-sync
This was broken after 92c38ea removed ve-mw files from the
static loaders but didn't update makeStaticLoader.php so
it was harder to keep the files in sync and a few minor issues
on the documentation pages.

Since the files are still mixed in the non-mw modules the only
way to exclude them is to do what was manually done in 92c38ea:
Filter out paths starting with "ve-mw/" from non-mw modules.

Change-Id: Id58ee89ac18c63c01719dc11ec7a07ddeee3ea0b
2013-07-04 05:11:13 +02:00
Catrope 092fa74dee Revert "Make link inspector re-usable by splitting it up"
Breaks MWLinkInspector initialization behavior

This reverts commit f7107fa20d.

Change-Id: If93d1092eeb14f6ba23e6368834a6f80df765d21
2013-07-03 18:39:31 -07:00
Rob Moen a3e2507cfe Listen to keypress in ve.ce.surface.$ rather than window
Bug: 50538
Change-Id: Ifddf1bae1ee799ec3467a81c597702fc3f8be089
2013-07-03 22:28:17 +00:00
Trevor Parscal 5dcf5d1c49 Add @inheritable to modelClasses in annotation inspector
Change-Id: Ic9b2a9c530a85d36078337d20ca8252efaf74c99
2013-07-03 15:24:55 -07:00
jenkins-bot bd6f1f22c1 Merge "Make link inspector re-usable by splitting it up" 2013-07-03 22:20:51 +00:00