Commit graph

4859 commits

Author SHA1 Message Date
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 877463e712 Merge "Add hooks and classes, initially to support GuidedTour" 2013-07-10 19:32:32 +00: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
jenkins-bot c404079f61 Merge "Focus link inspector input prior to lookup." 2013-07-10 19:03:38 +00: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
Timo Tijhof a7e8c9d660 mw.ViewPageTarget.init: Document use of mw.libs.ve to test presence
The presence check used to be against the VE global, but we
recently made that impossible without providing an alternative.

Though by accident, mw.libs.ve has become the new way to check
for presence.

Change-Id: If85695525777a71dde467675052d2ede4e52c9b7
2013-07-10 15:55:17 +02:00
Matthew Flaschen 7f094ee607 Add hooks and classes, initially to support GuidedTour
* Hooks for activation, deactivation, save dialog state change,
  and tab setup.
* Class for save button (needed to point to it in a clean way).
  Also done for cancel button to be consistent, though GuidedTour
  doesn't currently use this.

Change-Id: I4a0e0631d513fb09c3408f2f36a0de0bd51e1a37
2013-07-10 00:05:05 -04:00
jenkins-bot f8184ebeb9 Merge "Lock surface while inspectors are animating open" 2013-07-10 01:54:05 +00:00
jenkins-bot 5f24fe3d40 Merge "jquery.client: Update to upstream from ce3e67e1 in mediawiki/core.git" 2013-07-10 01:44:13 +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
Timo Tijhof c903a087bd jquery.client: Update to upstream from ce3e67e1 in mediawiki/core.git
Change-Id: I5b21a2a48ba3fde53370758bac7f1b8a65c4c04f
2013-07-10 01:36:54 +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
Timo Tijhof 50b7a9fc93 mw.ViewPageTarget: Explicitly release our copy of linmod data
Follows-up Ic0c6d190c9b78 which introduced a full linmod copy in a
scope that is also accessible by other closures (namely the
callbacks to jQuery.Deferred #done and #always, and setTimeout).

Though in theory engines may be able to garbage collect it,
I doubt it. Though browsers probably destruct the setTimeout
callback I know  at least the closures pass to jQuery.Deferred
are not released by jQuery, so an engine would have to
understand these other functions well enough to know it doesn't
access the `data` variable.

Let's release explicitly to be safe.

Change-Id: I11000edcad4690dcce53b6e9d1a45bf2ab82fbcb
2013-07-10 01:02:10 +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 bf930c88c6 Merge "Defer conversion in the sanity check" 2013-07-09 23:33:31 +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
jenkins-bot 0e61539cfe Merge "Revert "Add support for <blockquote> elements"" 2013-07-09 21:37:17 +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
jenkins-bot 6dee20d408 Merge "Add support for <blockquote> elements" 2013-07-09 21:34:46 +00:00
Translation updater bot c5ad0c1078 Localisation updates from http://translatewiki.net.
Change-Id: I434dbca8e5fc80919b9e77ee9f4507cd96705718
2013-07-09 20:40:59 +00:00
Roan Kattouw b77a1b2250 Defer conversion in the sanity check
Conversion is apparently pretty slow on large articles, so put it inside
the setTimeout(). We still need to copy the data array synchronously
though.

Change-Id: Ic0c6d190c9b782f8c643d00d335f0e004d860bcf
2013-07-09 13:21:48 -07: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
Timo Tijhof fdedbb36e2 mw.ViewPageTarget.init: Clarify reason for FF12 / FF14 blacklist
Follows-up I7a9dddb693091f.

Change-Id: I49a952f6b1714808cd4f063c48cf3102997f8746
2013-07-09 13:11:15 +02:00
James D. Forrester d59a3f1202 Blacklist Firefox 13 and 14 too
Firefox 13 and 14 were the cause of links magically turning into [[./Foo]].
Once the immediate rush of deployment is over, we'll want to investigate as
to why and hopefully find a way to unblacklist FF.

Bug: 50720
Change-Id: I7a9dddb693091fa1e44b4325e77b9e4f55e5c193
2013-07-08 18:20:42 -07:00
jenkins-bot 11d5218444 Merge "mw.ViewPageTarget.init: Only bind edit section links on view page" 2013-07-08 23:16:54 +00:00
jenkins-bot 98c92d49c7 Merge "mw.ViewPageTarget: Fix incorrect retention of the wrong oldid" 2013-07-08 23:16:15 +00:00
Timo Tijhof 106f357852 mw.ViewPageTarget.init: Only bind edit section links on view page
The handler for the Edit tab already is in this conditional,
for edit section we were making the assumption that they only
ever appear on a view page, but that's wrong. They're also shown
on a diff against the latest revision of the page.

Bug: 50925
Change-Id: I802e548cbcdc03cfca66129466668854604bc3e7
2013-07-08 16:12:47 -07:00
Timo Tijhof d16fef546a mw.ViewPageTarget: Fix incorrect retention of the wrong oldid
* Only pass the oldid to the API from #load if we restoring from
  oldid in the url. Otherwise load the latest version.
* Setting 'restoring' from mw.Target instead of mw.ViewPageTarget
  so that we don't rely on mw.ViewPageTarget in mw.Target#load.
* Fix the API to not require 'oldid' to be passed.
* Fix the API to actually return the 'newrevid' property. It
  was doing a no-op on a $result that is never used due to the
  same variable being overwritten with the result of parseWikitext.
* Moved updating of wgCurRevisionId to mw.ViewPageTarget as it
  belongs there (possible future inline editors probably act
  on a different page than the main one). Also made it only
  update if it isn't undefined, so that a null edit doesn't
  result in wgCurRevisionId being unset.

Bug: 49943
Bug: 50441
Change-Id: I221e5038f95eadf6d87013e80f12394f0376a293
2013-07-08 16:11:23 -07:00
jenkins-bot c328e3deff Merge "Make all annotations additive" 2013-07-08 19:51:56 +00:00
jenkins-bot ade008e3c6 Merge "Separate out UnicodeJS tests properly" 2013-07-08 19:15:55 +00:00
jenkins-bot de61c74ff2 Merge "Drop mw:ExtLink/URL support" 2013-07-08 19:13:29 +00:00
Translation updater bot 9b38c2ce87 Localisation updates from http://translatewiki.net.
Change-Id: Icf828cf3171a868c14cb7c2db30692fcb9c85e25
2013-07-08 19:02:59 +00:00
Translation updater bot 7d9cfbe15f Localisation updates from http://translatewiki.net.
Change-Id: Ic28f51ba1ef4f1eb80bea69cdc131cec8994b4e2
2013-07-07 19:46:57 +00:00
jenkins-bot 67d1629754 Merge changes I4d7533af,Ib909c5fb
* changes:
  Math Node UI
  Math Node Matcher
2013-07-07 07:36:00 +00:00
Trevor Parscal 37240aca59 Math Node UI
Show an inspector with inputwidget when the user clicks a math
node. The data of the math equation is shown in the
edit box, it can re-render the math tag image when
the inspector is closed, and save the change when
saving the page.

TODO:
* Change the icon from link to math
* Translate title by translatewiki in i18n
* Other further UI improvements

Change-Id: I4d7533af25186cc39cc4bc6a4326d222ffd6db19
2013-07-07 07:32:11 +00:00
jiabao 7eb6efa3b7 Math Node Matcher
This patch creates two files handling math node matching,
which are:
ve.dm.MWMathNode.js - a basic version of toDataElement
and toDomElement functions work
ve.ce.MWMathNode.js - math formulas in VisualEditor are
clickable and render as img tags

Change-Id: Ib909c5fb02e385c88050f42d02d207ab6a97d0dd
2013-07-07 07:32:02 +00:00