Commit graph

5476 commits

Author SHA1 Message Date
jenkins-bot bc9205e0cc Merge "VisualEditor: RTL entries don't receive dir="rtl" in Page settings / Languages" 2013-08-30 18:26:55 +00:00
cmcmahon 88504aa3d9 use regexp anchors to prevent false matches
Change-Id: Ib13b85986e3df431b0f900fea38165197411370e
2013-08-30 17:28:40 +00:00
Pavel Selitskas 1084cdb350 VisualEditor: RTL entries don't receive dir="rtl" in Page settings / Languages
We call isRedirect to get the real language code instead of the site code.
Post-factum, lang attribute is added as well for each entry.

Bug: 53503
Change-Id: Ia6bf63a7cbe3c7b99ed05d0bd0fdd33190550c98
2013-08-30 14:39:45 +03:00
Ed Sanders a72099af66 Expose version information in the client
By passing in the information via a ResourceLoaderModule this
gets around any concerns with performance (version information
is read from the file system).

The version information is appended to the beta toolbar dialog.

Bug: 53050
Change-Id: I7836e1d4003416cbb7e18e3435aa87d82fd5c2e2
2013-08-29 18:19:40 -07:00
Timo Tijhof bdd1a73eaa data: Rename MessagesModule to DataModule
Also..
* removed an incorrrect comment referring to the old module
  name (standalone didn't use the VisualEditorMessagesModule).
* made it use debug mode to determine whether to minify or
  prettify the js code.

Change-Id: I493007649fba27e7faab0cf743eded5f68714c50
2013-08-29 18:07:35 -07:00
Moriel Schottlender 84cca4f472 Cursor fix after link insertion
When a link was inserted, the cursor position was backwards (at the
beginning of the word rather than its end) - this commit fixes that
problem.

Also, thanks for the help Ed!

Bug: 53560
Change-Id: I04fe1ca4c9126898e7bf85cdf519794d66b4f38b
2013-08-29 21:46:28 +00:00
jenkins-bot 4291b2a308 Merge "When pasting, try to use original range" 2013-08-29 18:26:53 +00:00
jenkins-bot 0cdcf2d155 Merge "Always give references names. Ignore if used once." 2013-08-29 18:26:04 +00:00
jenkins-bot 7d045c03c5 Merge "Add David to author lists" 2013-08-29 18:18:22 +00:00
Ed Sanders 62c7358af9 Add David to author lists
Change-Id: If46dc34381e5cc7c3fbfc9886868cd1a63bf7a47
2013-08-29 11:11:10 -07:00
jenkins-bot 0ae19ffa40 Merge "Set contentEditable using jQuery#prop" 2013-08-29 17:54:56 +00:00
Ed Sanders 98cad0f410 Set contentEditable using jQuery#prop
Also always use strings 'true'/'false' for the value, because
it is a string property (spellcheck, however, is a boolean)
and always use a capital second 'E' in the name.

Change-Id: Ia4e1f9edfd8f236fe81df190e6a68729d7b52243
2013-08-29 09:59:55 -07:00
jenkins-bot 467ddf5ab8 Merge "Followup 41a4b3fb: use .not()" 2013-08-29 01:55:19 +00:00
jenkins-bot 53eda266d9 Merge "Add dual detection for types that Parsoid is about to rename" 2013-08-29 00:55:50 +00:00
jenkins-bot b41d3bee07 Merge "Add ULS to the standalone" 2013-08-29 00:44:02 +00:00
jenkins-bot fc0143a7eb Merge "Actually move the experimental LanguageInspector messages into the experimental module" 2013-08-29 00:42:45 +00:00
Roan Kattouw c68e550bb3 Add ULS to the standalone
Also rerun makeStaticLoader

Change-Id: If9fae5dc5ea37567c50ab5d462308ff05e053c8c
2013-08-28 17:35:37 -07:00
Roan Kattouw a03c512f33 Actually move the experimental LanguageInspector messages into the experimental module
Change-Id: I91453bfa535b1b5a8c6c495a5857977a646434d6
2013-08-28 17:25:52 -07:00
Moriel Schottlender d4c2374515 Fixing inspector popup position
The inspector popup should appear relative to the position of the related
calling method - either relative to the cursor (like in links and language)
or relative to the focusableNode (like in templates/transclusion).

Bug: 50905
Change-Id: I07f58d0c6561adecbec560fc24bcb6e590f2cd9f
2013-08-28 23:59:36 +00:00
jenkins-bot ae4fee0883 Merge "AnnotationInspector insertion over blank selection" 2013-08-28 23:44:07 +00:00
jenkins-bot 1375c48488 Merge "Move contentEditable=false to protected node" 2013-08-28 23:33:09 +00:00
jenkins-bot 4493ca1f48 Merge "Rename 'DOM Changes' => 'DOM changes'" 2013-08-28 23:32:25 +00:00
Roan Kattouw 4d91e4edbf Add dual detection for types that Parsoid is about to rename
Bug: 53432
Change-Id: If404585f9a118b4155ceb46fbe8e467b41ec6b29
2013-08-28 16:30:20 -07:00
Ed Sanders 458f8d1a82 Move contentEditable=false to protected node
Because that's where it should be.

Bug: 53507
Change-Id: I9afffea238a774b884d4d2434d3523e4c4e445b2
2013-08-28 16:18:55 -07:00
Ed Sanders e0018e8e94 Rename 'DOM Changes' => 'DOM changes'
Because we don't use title case in comments

Change-Id: I5cdd3241aba0727a3cd5d0ded972ae54abf1efd0
2013-08-28 15:55:35 -07:00
Zeljko Filipin 8f7e9c27a7 Moved VisualEditor Selenium tests from browsertests repository
Requested by James Forrester at QA mailing list:

http://lists.wikimedia.org/pipermail/qa/2013-August/000339.html

Bug: 53467
Change-Id: I915b4e41d32c9190ccea73f2b3bce9a53918fe80
2013-08-28 20:14:21 +00:00
Ed Sanders 52de8b76ec Always give references names. Ignore if used once.
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
2013-08-28 12:47:33 -07:00
jenkins-bot c3576a5c29 Merge "Fix typo (was comma instead of semicolon)" 2013-08-28 18:54:58 +00:00
jenkins-bot f39e3f364f Merge "Check clipboardData exists before accessing it" 2013-08-28 18:52:01 +00:00
David Chan e0663b5066 Fix typo (was comma instead of semicolon)
modules/unicodejs/test/unicodejs.wordbreak.test.js
* fix typo

Change-Id: Ieef78b4f51054b760217c8e2f12a4510857ee88a
2013-08-28 11:51:52 -07:00
Ed Sanders 182d9bbeea Check clipboardData exists before accessing it
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
2013-08-28 11:47:13 -07:00
jenkins-bot 3ec8e32a1a Merge "Add support for single scripts, styles and debugScripts" 2013-08-28 17:47:25 +00:00
Trevor Parscal e907403d76 Add support for single scripts, styles and debugScripts
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
2013-08-28 17:37:58 +00:00
Moriel Schottlender ba7e0ff273 AnnotationInspector insertion over blank selection
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
2013-08-27 20:34:57 -04:00
Ed Sanders f50102f521 Disable inserting/changing references when surface widget is empty
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
2013-08-27 17:18:52 -07:00
Ed Sanders ddb608e6bc When pasting, try to use original range
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
2013-08-27 15:40:59 -07:00
jenkins-bot 92c7be9b31 Merge "Detect outdated pending post KeyPress handler" 2013-08-27 22:31:07 +00:00
David Chan d867ef8fc0 Detect outdated pending post KeyPress handler
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
2013-08-27 13:55:02 -07:00
Roan Kattouw 10393b8773 Followup 41a4b3fb: use .not()
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
2013-08-27 13:53:17 -07:00
Roan Kattouw 051867c3ab Actually use GeneratedContentNode in AlienNode
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
2013-08-27 13:53:17 -07:00
jenkins-bot 0ef918b6f0 Merge "Language Inspector Default Fix" 2013-08-27 20:36:42 +00:00
jenkins-bot 8b773cf9a4 Merge "Give document real focus after cut" 2013-08-27 20:21:42 +00:00
jenkins-bot 80ded50c8b Merge "Copy-paste data fixes" 2013-08-27 20:21:00 +00:00
jenkins-bot 78141a6f33 Merge "Don't render <meta>/<link>/<style> tags in GeneratedContentNode" 2013-08-27 18:28:34 +00:00
Roan Kattouw 41a4b3fb51 Don't render <meta>/<link>/<style> tags in GeneratedContentNode
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
2013-08-27 11:26:37 -07:00
jenkins-bot d7702819e8 Merge "Make ve.dm.Surface.{start,stop}HistoryTracking idempotent." 2013-08-27 16:27:41 +00:00
C. Scott Ananian 4fee78227d Make ve.dm.Surface.{start,stop}HistoryTracking idempotent.
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
2013-08-27 09:25:54 -07:00
C. Scott Ananian 7fb7665608 Avoid crash after ve.dm.Surface.purgeHistory().
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
2013-08-27 09:37:37 -04:00
Roan Kattouw ce138adbdb Kill domAttributeWhitelist in favor or renderHtmlAttributes
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
2013-08-26 18:37:50 -07:00
Ed Sanders fd410c03a7 Give document real focus after cut
If only a FocusableNode is selected the document doesn't have
real focus, so we must do it manually.

Bug: 53362
Change-Id: I781f59dda7f2884ff02f6688c2c8c037ac7ed1a6
2013-08-26 23:06:13 +00:00