Commit graph

6251 commits

Author SHA1 Message Date
Roan Kattouw 536df35ed1 Add language code to language dialog
Bonus: give both the language name and page name
lang and dir attributes.

Further bonus: reintroduce message that was deleted
earlier with all of its original translations.

Change-Id: Id137ff9a069799b6c09574b72f450eac6665d144
2013-12-11 02:42:20 +00:00
jenkins-bot b45107021a Merge "Put the shim from 9abad038 back (was reverted in b9bbf60f)" 2013-12-11 00:34:46 +00:00
jenkins-bot e4668d4c63 Merge "Remove ve-pasteProtect class when falling back to clipboardData" 2013-12-10 22:02:08 +00:00
Translation updater bot c6cf993c2d Localisation updates from https://translatewiki.net.
Change-Id: Ic5d1dee35d8347ea461681eacc51f1e2e0789e81
2013-12-10 20:44:55 +00:00
Ed Sanders c1f88f50ee Remove ve-pasteProtect class when falling back to clipboardData
We already do this on the pasteTarget.

Change-Id: Idcc7ed34daebfb5ed14925eb5ee8526d1001a2f1
2013-12-10 20:11:35 +00:00
Ed Sanders 333166e818 Fix paste sequence in Firefox
It appears that if the pasteTarget is given focus too close to the
range being set it may not take effect in time. Moving up to before
any of the selection setting logic seems to fix the issue.

Bug: 58283
Change-Id: I9bfb0ab6952863496fb3548e6804cb347d52cc57
2013-12-10 19:17:12 +00:00
Roan Kattouw 728077039d Put the shim from 9abad038 back (was reverted in b9bbf60f)
The shim triggers bug 58249, but that's not as bad as we thought.
It turns out LocalisationUpdate still finishes despite the scary
exception, it just skips VisualEditor and finishes the rest successfully.

I will work on making the LU error more useful, and eventually
making it support JSON blobs, but the shim isn't causing a
lot of damage for now.

Change-Id: I92f11524d891e901f1a089dd8cad1232478a5ee4
2013-12-10 11:11:10 -08:00
jenkins-bot 7e9f214acd Merge "Add missing tests to FlatLinearData" 2013-12-10 17:58:59 +00:00
jenkins-bot 04377b5cac Merge "Organise Flat/ElementLinearData methods and tests" 2013-12-10 17:56:45 +00:00
jenkins-bot 8ce640f263 Merge "Remove references to 'document' in LinearData classes" 2013-12-10 17:55:12 +00:00
Ed Sanders 2e0b523ddc Add missing tests to FlatLinearData
Change-Id: I5a5f2c55928359951c4b811b75662517cec07540
2013-12-10 17:52:37 +00:00
Ed Sanders 6c231be8ab Organise Flat/ElementLinearData methods and tests
Move containsElementData to FlatLinearData next to isElementData. Move
tests for both methods to FlatLinearData.test.js.

Change-Id: I07a192f5925da7cc763efe5e41427f1f47d85850
2013-12-10 17:51:36 +00:00
jenkins-bot 094326fedd Merge "Sync JSON i18n for 1a5bdd5" 2013-12-10 17:28:52 +00:00
Roan Kattouw b6a35aa96d Sync JSON i18n for 1a5bdd5
Change-Id: Ib9c7219e4f9ae5893439eec7059519d2f24cd5f2
2013-12-10 09:09:45 -08:00
Ed Sanders 191d610b21 Remove references to 'document' in LinearData classes
This is left over from when all these methods where in ve.dm.Document.

Change-Id: Iec18aeddc7c8575f72550053c6278ff37a1d6000
2013-12-10 17:07:44 +00:00
jenkins-bot 41397bba1d Merge "Check the selection has collapsed after pasting" 2013-12-10 17:03:15 +00:00
jenkins-bot 9bf0f5b93e Merge "Show full language names in the MW language dialog" 2013-12-10 17:00:53 +00:00
Ed Sanders 80f5f12451 Check the selection has collapsed after pasting
In Chrome you can paste the empty string which triggers
the paste events but doesn't change the paste target. This
results in the insertion of the context character on empty
lines. To avoid this we can detect if the selection we put
around the context character is still there and abort the
paste.

Bug: 58138
Change-Id: Ib73465a2376cd316dbac6ce2567ecb64bc500307
2013-12-10 15:52:27 +00:00
jenkins-bot 150a9586eb Merge "Revert "Shim for VisualEditor.i18n.php that reads JSON blobs"" 2013-12-10 02:44:16 +00:00
Jforrester b9bbf60ffb Revert "Shim for VisualEditor.i18n.php that reads JSON blobs"
This reverts commit 9abad0385d.

I guess for now we'll just have to keep these in sync manually until MW core is updated.

Bug: 58249
Change-Id: I243303bdcbd048248776866fa12a17fc8279b80f
2013-12-10 02:41:25 +00:00
jenkins-bot d2250acc59 Merge "Don't move the cursor to the top of the page after closing a dialog" 2013-12-09 23:21:18 +00:00
Roan Kattouw 29532f15db Don't move the cursor to the top of the page after closing a dialog
And other focus behavior fixes.

ve.ce.Surface.prototype.focus:
* Restore focus to the pasteTarget if a focusedNode was selected.
  This function is invoked when a dialog is closed, and we were
  always focusing the documentNode, which means the selection was
  restored incorrectly when the selection was really in the pasteTarget.

ve.ce.Surface.prototype.documentOnFocus:
* Don't rerender the model selection if the documentNode was focused but
  a focusedNode is selected. Otherwise the user can never deselect a
  focusedNode.

ve.ce.Surface.prototype.onModelSelect:
* Rerender the selection even if prev === next. This function was
  already called as a means to rerender a lost selection, and it didn't
  work if it so happened that the selection was still the same and was
  on a focusedNode.
* Clear the surfaceObserver state when moving focus from the
  documentNode to the pasteTarget. If we don't do this, then placing
  the selection back in the documentNode at the exact same place where
  it was before will not be noticed by the observer.

ve.ui.Context.prototype.onSurfaceFocus:
* Hide the context only when an inspector is open, not just when the
  context popup is visible. This ensures that the context is still
  hidden when the user clicks out of an inspector, but fixes a bug
  where the context was hidden when the selection was restored on
  an inspectable focusedNode.

Bug: 58090
Change-Id: I0658f025a9c6005d769fd0291380fcb9c1ba4f32
2013-12-09 15:17:53 -08:00
jenkins-bot 273ce5086c Merge "Only strip style attributes on rich paste from VE" 2013-12-09 22:59:06 +00:00
Translation updater bot 711d578486 Localisation updates from https://translatewiki.net.
This is a full export of the recently converteted i18n of
VisualEditor. The conversion script should generate output in
this format, so that future diffs for localisation updates
remain as small as possible.

Change-Id: I03c3223f51027b97d7962553e80afd741991c9af
2013-12-09 22:30:48 +00:00
Ed Sanders 6a52fba643 Only strip style attributes on rich paste from VE
Stripping all HTML atributes (to avoid CE-added styles such as
'font-size: 1em;') also strips data-parsoid which can cause
round trip errors. As an improvement only strip the style
attribute.

Bug: 58136
Change-Id: I34386bd847d1cf0583317a8b07916e43ff7af029
2013-12-09 22:25:43 +00:00
Roan Kattouw 9abad0385d Shim for VisualEditor.i18n.php that reads JSON blobs
For performance we might also want to provide a conversion script
that generates a static PHP file.

Change-Id: I6a72bb3ec23c90fc5740327a7e46b4d805562779
2013-12-09 13:20:29 -08:00
Roan Kattouw 2fa725599c Add missing specialcharacters messages to JSON blobs
These were accidentally dropped when I rebased my commit
that imported all i18n messages into the JSON files.

Change-Id: I2f5611f3dbe1a31134426184a9d5648ffc751947
2013-12-09 13:19:17 -08:00
Roan Kattouw f462ea5bb0 Convert all i18n to JSON blobs
Split the i18n messages into four groups:
* oojs-ui (moved to the oojs-ui repo in a separate commit)
* VE core
* VE-MW (MediaWiki-specific things)
* VE-WMF (Wikimedia-specific things)

The VE-WMF group is new, and we'll split WMF-specific code out into
it later, for now it's just messages associated with that code.

Each language has its own JSON file at modules/MODULE/i18n/LANG.json

Kept messages in VisualEditor.i18n.php as the master copy, because
TranslateWiki can't deal with the JSON files just yet. Added a script
to rebuild the JSON files from the PHP file.

Change-Id: I94e084b2f10994f41324fd08a05ff7f8391ea2eb
2013-12-09 10:52:01 -08:00
cmcmahon d627b4da8f [Browser tests] maintenance for remove parameter/template buttons
Change-Id: Ia04ddc5aa18f412bb2e02ee45dcfdc421b3ec64a
2013-12-09 17:39:09 +00:00
Translation updater bot 5aca63495e Localisation updates from https://translatewiki.net.
Change-Id: Ic9e1017e3fc867016a6d04cc95250eb899791c04
2013-12-08 20:29:26 +00:00
Translation updater bot 92a299e79c Merge "Localisation updates from https://translatewiki.net." 2013-12-07 01:56:36 +00:00
Translation updater bot a28d2c3cd6 Localisation updates from https://translatewiki.net.
Change-Id: I68afe24adc4fd1d9f24cc2ae01a180e583c3f7be
2013-12-07 01:55:36 +00:00
jenkins-bot ff9ee27aa8 Merge "Add jquery.i18n files and RL module" 2013-12-06 22:53:47 +00:00
Roan Kattouw e1a404e68f Add jquery.i18n files and RL module
Imported 09f7c9e40fc3bd502 from
 https://github.com/wikimedia/jquery.i18n/tree/09f7c9e40fc3bd502

Change-Id: I9bc4759202a0475bcf52230e0c57a877cc848773
2013-12-06 22:50:43 +00:00
jenkins-bot 1b5f57fa20 Merge "Use proper conditional registration for jquery.uls" 2013-12-06 22:21:18 +00:00
jenkins-bot 5dfd0784de Merge "Followup 418f2606e0: put <?xml tag back." 2013-12-06 21:54:05 +00:00
Roan Kattouw b2fa114c5a Followup 418f2606e0: put <?xml tag back.
These aren't optional in SVG files. Browsers will display them without,
but dropping them breaks MIME type detection, which breaks data URI
embedding: the underline-u icon was being embedded as data:text/plain,...

Bug: 58119
Change-Id: Ia790877fcd536f2714626ccf47beadd09cb4fac9
2013-12-06 13:46:00 -08:00
jenkins-bot ed43cab350 Merge "mw.Target: Fix document focus scroll bug" 2013-12-06 21:40:50 +00:00
jenkins-bot 0d1e458ea1 Merge "Spell removable and movable using modern English" 2013-12-06 21:36:30 +00:00
Timo Tijhof c6b997d0ba mw.Target: Fix document focus scroll bug
Follows-up I55ef2622c9eacc which activated code introduced in
mw.Target in commits before that one that caused a change in the
execution order.

Hiding of page content (regular wiki page content provided by
original view request) must happen before the surface document is
focussed.

We used to hide the content from mw.ViewPageTarget#setUpSurface,
which is called from #onReady, which focusses the document after
setUpSurface is done.

Most of this code was moved to mw.ViewPageTarget#onSurfaceReady
which is the listener for the surfaceReady event emitted from

If our surface document gets focus while the original wikipage
content container is still there, the view port is forced to
scroll down because our surface is the next element sibling after
the wikipage container in the DOM.

And browsers (apparently Chrome is not affected) naturally retain
scroll position even if the elements above the one you "scrolled to"
disappear.

We can't (and shouldn't) move the hidePageContent call because
that's the responsibility of the Target subclass, so instead
moved the document focus to below the hidePageContent which is
now also part of the responsibility of the Target subclass.

Also:
* Removed target.surfaceOptions reference because that property
  does not exist. We never passed a second argument here, and
  whatever this was intended for, doesn't exist.

Bug: 58089
Change-Id: I230fbd5401cbd6e3b9450c7f156650409be8ef16
2013-12-06 22:32:51 +01:00
jenkins-bot 47fcb0fad1 Merge "Revert "Revert "Remove dual-type support for Languages and Categories""" 2013-12-06 21:15:40 +00:00
Catrope c3c0a5e166 Revert "Revert "Remove dual-type support for Languages and Categories""
The Parsoid team says the cache is clean of old language /
category types, and would like us to use the new types
for newly generates languages/categories.

This reverts commit d8dcafe25b.

Change-Id: I0cffd5d299624230f3805f9468b2497f392c12c0
2013-12-06 21:12:44 +00:00
jhall ba90be7d7a [browser test] Headings now include a buffer space
Confirmed with James F that this was an intentional Parsoid
change (and not a bug).

Change-Id: I21d7eba4675eaf7250267003516585e96069b4e6
2013-12-06 20:55:58 +00:00
jenkins-bot 35dc56fec8 Merge "Fix svg sources to start at (0,0) not (-0.5,0.5)" 2013-12-06 20:44:42 +00:00
Ed Sanders 418f2606e0 Fix svg sources to start at (0,0) not (-0.5,0.5)
Change-Id: Ib7e0e18620512272f6c66ec9f81f7d4d38feedfa
2013-12-06 20:36:28 +00:00
Trevor Parscal b3281bd87a Spell removable and movable using modern English
Also...

* Update OOjs UI to v0.1.0-pre (5ffe63d088)
* Make template parameter text boxes shorter (3em down from 10em)
* Reorder extendObject calls to not modify incoming config objects
* Allow level option to default to 0, rather than specifically defining it
* Use icon button widgets with remove icons for parameter, placeholder,
  template and content removal buttons

Change-Id: I29db9d814fab5cf4debd0fc7bab6f51475cb0f94
2013-12-06 12:24:36 -08:00
Timo Tijhof cf7f2b141d Set up node-jscs, pass it, and configure in local Gruntfile
Let's experiment with this via our local Gruntfile. If it works
fine we can install it in Jenkins (similar to node-csslint).

Verify through $ npm install && npm test;

Fixed all outstanding violations.

Also:
* Added syntaxhighight to ignore.
* Added imetests (which contain unformatted JSON) to ignore.
* In ve.dm.ModelRegistry#matchTypeRegExps, removed redundant
  !! cast from the [+!!withFunc] statement which was hitting
  a bug in node-jscs. All callers to this local private function
  pass a literal boolean true/false so no need to cast it.
* Removed "/* key .. , value */" from ve.setProp, though this
  wasn't caught by node-jscs, found it when searching for " , ".
* Made npm.devDependencies fixed instead of using tilde-ranges.
  This too often leads to strange bugs or sudden changes. Fixed
  them at the version they were currently ranging to.

Bug: 54218
Change-Id: Ib2630806f3946874c8b01e58cf171df83a28da29
2013-12-06 10:37:27 -08:00
Zeljko Filipin e195aa7bb5 Updated Ruby gems
Checking if selenium-webdriver 2.38.0 fixes cursor problem in Chrome.

Change-Id: I4467ed4ec1b3d7007f4293e3791f41502ce05959
2013-12-06 16:11:36 +00:00
cmcmahon e54170929d [browser test] Chrome seems to not honor when_present() correctly
1) Added another sleep statement which seems to fix the issue locally.
2) Modified a link page element identifier.

Change-Id: Ic0006f18752d3625bc244d924a7a8a9fac2d5221
2013-12-06 15:02:53 +00:00
Ed Sanders 1a5bdd5bd2 Show full language names in the MW language dialog
Bug: 54086
Change-Id: I099ac552638d666a447eb3aeaef68329ffacdfce
2013-12-06 13:10:33 +00:00