This avoids problems when unnamed references were copy-pasted.
Knowing that key is always non-null simplifies a lot of logic
elsewhere.
Bug: 53365
Change-Id: I3a23123ae732d9583814d38dd880a0cdf691fd5d
Bug fix for browsers which don't have an event.clipboardData
property. The check is done correctly in onCopy but not onPaste.
Change-Id: I3cdf4c0358aa145dcb70c2c103d08a0002001fd4
Objective:
* Make makeStaticLoader.php compatible with ResourceLoader module
definitions that use a string instead of an array with a single element
when describing a single file
Changes:
maintenance/makeStaticLoader.php
* Cast styles, scripts and debugScripts to array when iterating over them
Change-Id: Ib91daba732c2035145c479467a0b6b9ca3155659
This commit fixes two issues with insertion of annotations in blank space:
* LanguageInspector issue with inserting an language annotation inside any
whitespace (selection of space between words or collapsed selection in
blank line)
* AnnotationInspector issue with collapsed selection inside slugs. If
the marker was in a slug collapsed selection, activating
AnnotationInspector would expand the range to the closest word (on the
next paragraph). This commit makes sure the expansion for the next word
only happens if the selection is outside a slug.
Change-Id: I144eccefba16131a3d2ec6a3181adf47a15d6cc0
This listens to change events on the surface and checks to see if
there is more than just an empty paragraph node.
Bug: 53345
Change-Id: Ic8fa84d7cdcbffd154178939d0ec8c2c4f86c415
This functionality was (accidentally?) removed by I8f8a240a. It
stops us from over-zealously balancing data when we can get away
with just pasting the original selected range (e.g. it always wraps
collections of text and content nodes in another paragraph).
Bug: 53364
Change-Id: I93fa56c4e43083993c310e0050087e9d1de1e08b
modules/ve/ce/ve.ce.Surface.js
* Schedule the post-keypress async handler in a way that can be cancelled.
* Cancel it and run the handler immediately if another key event happens.
Bug: 53079
Change-Id: If139ff3230c10caa616743f71659c4606d290310
I claimed that it didn't preserve text nodes, but it does. It's just
that there's a bug where it doesn't preserve text nodes if the selector
passed to it is too simple, but 'link, meta, style' is complex enough
to avoid triggering this bug.
Change-Id: Id4a60dc87b8d4c613bc7013641b116dd7c331ac1
ce.AlienNode was mixing in GeneratedContentNode, but wasn't actually using
it properly. This commit fixes this so that AlienNode can benefit from
the <meta>/<link>/<style> stripping code in GeneratedContentNode.
Also added a getHashObject() function to dm.AlienNode to summarize the
domElements attribute because ve.getHash() chokes on it otherwise.
Change-Id: Ief3be94f9730297abe0e3c57506b81a8ff1d136d
There is no good reason why we'd render these tags, and their presence
causes Chrome to crash while cutting across them.
Bug: 50043
Change-Id: I611e3907cf20fa27dbef89ea941d0b787a44ba4f
Add a little robustness, guaranteeing that we don't end up with multiple
history tracking tasks running, leaking one, or try to clear a non-running
interval.
Change-Id: I41db2d6fefc7f45f150aa14ecefc648760ad6200
The selection property is never null; it is initialized to Range(0,0).
If it is set to null in purgeHistory(), the next call to
ve.dm.Surface.change() will crash.
Change-Id: Ia45c0ba26291e8ad09c445fdf2323710b5ab409f
domAttributeWhitelist wasn't actually being observed. Instead, we
already had the code in place to treat renderHtmlAttributes as a
boolean/whitelist/blacklist hybrid, it just wasn't used that way
yet.
This makes the interface nicer and fixes the bug where all attributes
(including data-parsoid and even things like onmouseover) were
rendered by CE.
Change-Id: I02e266c7c7dc197ed845164b7a705d786846a33b
If only a FocusableNode is selected the document doesn't have
real focus, so we must do it manually.
Bug: 53362
Change-Id: I781f59dda7f2884ff02f6688c2c8c037ac7ed1a6
* Assign cut/copy/paste events to the document so that
they are triggered when the CE doesn't have real focus
e.g. only a FocusableNode is selected
* Use clipboardData.setData when available. The key can
be stored and retrieved perfectly in text/xcustom but
this technique doesn't work in FF or IE
* Just use text content for key as this is what is written
to the clipboard, so this can be used directly without
having to get the content from the pasteTarget.
Bug: 48604
Bug: 49396
Change-Id: Ib3702f9441f6ee3fa34ec071f00994dd7e591d99
- Added missing @inheritdoc so that generated documentation is
not empty.
- Fixed type of mw.Platform#getMessage from (implied) @property
back to @method.
- Removed notes from mw methods. They are prepended instead of
appended, thus overriding the useful single-line summary
of the method with this random note. Description should either
be replaced entirely (e.g. no @inheritdoc) or inherited.
- Rephrased a few description to be consistent with the others
(e.g. "Get .." and "Add .." instead of "Gets .." or "Adds..").
Follows-up cbe35632f1.
Change-Id: Ie55bb9e18f1524b706f0e195300170e4d552bf73
The reversed image was created by Ebraminio using
convert loading.gif -flop loading2.gif
Bug: 51401
Change-Id: I264d9368cf8fd030ff34540e50e0038aa42ece16
Was previously broken as getSlice was using ve.Range#equals to
compare ranges which is direction-sensitive.
Bug: 51538
Change-Id: Ib58d1d8fd11b62388c111a5da66171d13a9db9c2
Convert to Markdown, for better rendering in github. Link more
prominently to install instructions in the README, also mention
Gerrit and the code style and API documentation.
Change-Id: I8e26fea108c32f37078e363f1af18eaf28b83516
Objective:
* Use the MW link specifically, since the target/command system doesn't
understand the group/id/extension concept yet
Change-Id: I8b756fa0bb55468312bb30d45ac5b943ff7362b5
Currently ignores all non-element data, but element content (e.g.
images) can be annotated.
Added test cases and updated the test runner to only compare
store indexes for a more readable output.
Bug: 50127
Change-Id: I234586a28072811c8288aab56f6abaaa0da0c88d