Commit graph

5697 commits

Author SHA1 Message Date
jenkins-bot 8f435960a9 Merge "The great image scaling rewrite of 2014 (MW)" 2014-02-05 23:01:15 +00:00
jenkins-bot 64fad7695b Merge "Move image info API call to media node" 2014-02-05 23:00:13 +00:00
Translation updater bot 85fa839839 Localisation updates from https://translatewiki.net.
Change-Id: I02d167bb6ad9cb716b1e91f50a6ff23c9030fbd6
2014-02-05 21:44:25 +00:00
Jeff Hall 90d46cb15c [Browser test] Get transclusion test back to working with Chrome
Getting rid of a pesky comment that sneaked in somehow...

Change-Id: I4d06ea8f038d3b176d5340897b50b921fa5d8918
2014-02-05 13:12:59 -08:00
Moriel Schottlender b522994344 Adding position setting to media edit dialog
This adds an image position/alignment to the media edit dialog.

Bug: 51293
Change-Id: I15fbd1ed0998a9093fa039b76624395d661af05b
2014-02-05 20:56:37 +00:00
Moriel Schottlender e8205a7133 Adding alternate text to media edit dialog
Adding an option to add or edit alt text to images in the media edit
dialog.

Bug: 38129
Change-Id: I6d339781822175c40c66a4689ec6e1a873cb081d
2014-02-05 20:56:30 +00:00
Ed Sanders fb4f7d3e24 The great image scaling rewrite of 2014 (MW)
Implement new logic in ve.Scalable from I5b4f0f91b.

Also update VE core submodule to master (57ed8d3).

New changes:
59a0afe The great image scaling rewrite of 2014

Change-Id: I24a2976036310d3814cc7d1853a68745e0499bd5
2014-02-05 12:55:11 -08:00
Ed Sanders 61d010df2f Move image info API call to media node
As other widgets may be interested in the image info, this should
be part of the DM node, which the media edit dialog then fetches
and uses to populate the MediaSizeWidget.

Other fixes:
* Remove spinner, not really necessary as the orignal size button is
  disabled if the orignal dimensions aren't set.
* Don't wait until image info call to resolve to initialise size
  widget values. These should always be available instantly from the
  attributes.

Depends on I9530ed4257e88b in core.

Change-Id: I394f49941b621059bc08c8a8f79471b2fe16c7d8
2014-02-05 12:48:31 -08:00
Ed Sanders 13eb918087 Only generate transclusion contents for clipboard
Parsoid doesn't care about the transclusion contents and it can
cause bugs if not removed properly. Remove the about group attribute
as that was for Parsoid's benefit.

Depends on Ib29972472d in core.

Bug: 60897
Change-Id: I907b2113c257baff5c022ff0749dca9dbb1fba5f
2014-02-05 12:45:55 -08:00
Ed Sanders 425d6fee54 Exclude galleries from reference/caption surface tools
Because putting galleries in either would just be silly.

Change-Id: I03013607f3caae0053661c3c47d46b888ab5fde0
2014-02-05 19:45:56 +00:00
Ed Sanders d7e9564d22 Hide structure tools in MWReferences
Technically these are possible to render (although there's currently
a Parsoid bug preventing it) but really references should just contain
one single paragraph.

Change-Id: I405d75a0935d3f4610e10b942b48fa0fa2679a20
2014-02-05 19:39:39 +00:00
Ed Sanders 1e6daf1ee6 Implement surface paste rules for media/ref dialogs
Extend default paste rules to prevent lists/tables/references/headings
as applicable.

Also update submodule to master (76ff210).

New changes:
f1a927f Internal paste rules and type conversions

Bug: 59603
Change-Id: I952f98477219a55d25a2bd817344bde58a4862d4
2014-02-05 11:17:33 -08:00
Translation updater bot 8e4fe35f87 Localisation updates from https://translatewiki.net.
Change-Id: I9fb62c00efa3cb6e72dfe312b1e5c7a1ab32d227
2014-02-04 21:06:47 +00:00
Ed Sanders 047d6bf6cc Fix usage of '$' in MWReferenceSearchWidget
Easier to just use native getAttribute.

Change-Id: Ibd72eb457bb82b3b134d1eb29c4c33b3b9a7242f
2014-02-04 16:09:38 +00:00
Ed Sanders c528a0ffea Fix 'use existing reference' list rendering
Got broken by mass $ -> $element conversion in If3d870124ab8d1

Bug: 57209
Change-Id: Iada098d0fa361f4a825a4c87aa8a7493386855e4
2014-02-04 15:55:04 +00:00
jenkins-bot dbe8441557 Merge "Add placeholder for gallery editor" 2014-02-03 22:18:46 +00:00
James D. Forrester 87dd841150 Add placeholder for gallery editor
Change-Id: Id351cea8614282924eb9b1644693f7cd71fd9fa4
2014-02-03 14:05:49 -08:00
Translation updater bot 5fa1c98299 Localisation updates from https://translatewiki.net.
Change-Id: Iaf6b92dcac5199872caba55bbafe6178e7159731
2014-02-03 21:23:58 +00:00
Translation updater bot 84433d6deb Localisation updates from https://translatewiki.net.
Change-Id: I99af5d06b49085353cb3641b32abfa80b2eb5916
2014-02-01 19:48:00 +00:00
jenkins-bot 4ec405342c Merge "Fix search results when $wgDebugToolbar is enabled" 2014-01-31 02:37:18 +00:00
Krenair fc56562364 Fix search results when $wgDebugToolbar is enabled
When $wgDebugToolbar is enabled, a debuginfo key is always returned from the
API.
Unfortunately that broke the ve.isArray check on the result, breaking the
opensearch calls by the linker.

Change-Id: I907ef6fc2589581cf7333af3968b63b483af65a9
2014-01-31 02:34:39 +00:00
jenkins-bot 8960cc252b Merge "Revert "Make it possible to run VisualEditor tests in headless mode"" 2014-01-31 02:05:42 +00:00
Jhall 26a4623ddd Revert "Make it possible to run VisualEditor tests in headless mode"
This reverts commit 9a20fc03b7.

This change appears to have completely broken the VisualEditor browser tests :(

Change-Id: Ia2753f0718ccc5ac5ce7b726bd89040171feae7c
2014-01-31 02:02:56 +00:00
jenkins-bot 92f62d3261 Merge "[browser test] cucumber.yml is no longer needed" 2014-01-30 18:38:46 +00:00
Zeljko Filipin 9a20fc03b7 Make it possible to run VisualEditor tests in headless mode
Bug: 60584
Change-Id: I63782af45610d4e5fcbbea73d7f8d68035faee1a
2014-01-30 17:32:38 +01:00
Zeljko Filipin dd7c60e0ea [browser test] cucumber.yml is no longer needed
Bug: 56085
Change-Id: Ia6b221b70ecf5741bd3550bc9006822da260efe7
2014-01-30 13:12:12 +01:00
Krenair 9a38ccfe12 Hide wikitext warning notification when the user removes the markup
Bug: 51701
Change-Id: I2b24b91175768334c5111bf8e550be9c34c12f69
2014-01-30 01:41:00 +00:00
Krenair ff95f88e58 Stop API error dialog popping up if you navigate away from the page while Parsoid loads
By checking response.status per this page:
http://stackoverflow.com/questions/9229005/how-to-handle-jquery-ajax-post-error-when-navigating-away-from-a-page

Bug: 51546
Change-Id: I80830b4af1f950369b73497c767cdee4806e7ce6
2014-01-29 00:22:55 +00:00
jenkins-bot 4c3da1b017 Merge "[browser test] Moved Sauce Labs browser configuration to mediawiki-selenium Ruby gem" 2014-01-28 22:32:15 +00:00
Translation updater bot 0b5d86b6a7 Localisation updates from https://translatewiki.net.
Change-Id: Iea5074baacada1142e6b05427f8bc762db107643
2014-01-28 21:24:43 +00:00
Zeljko Filipin 59e764505a [browser test] Moved Sauce Labs browser configuration to mediawiki-selenium Ruby gem
Bug: 56085
Change-Id: Icf9dd875665f13dafb308d2897c857a632ac117a
2014-01-28 17:58:20 +00:00
Roan Kattouw 12e4b41660 Don't throw JS errors when opening MWExtensionInspector on the wrong node type
The setup method just assumed this.node was of the right type, and
would just crash if it wasn't. You could select an image, open the
gallery inspector, and it would happily try to inspect it until
crashing because there was no .mw.extsrc attribute.

Bug: 60502
Change-Id: Idf0e9cf7ccaa37e607374ced150db732926a19f8
2014-01-27 19:21:36 -08:00
jenkins-bot c39d1e63e0 Merge "Simplify toDataElement in MW" 2014-01-28 03:17:41 +00:00
jenkins-bot 4b71c52f44 Merge "Fix toolbar margins in vector" 2014-01-28 02:48:56 +00:00
Ed Sanders bdb4a8a149 Simplify toDataElement in MW
As per I54943588c5cc2 in core.

Change-Id: Ia40e7327c4ce07a79d64a6d5b1ff0d7acec55171
2014-01-27 18:43:36 -08:00
jenkins-bot 2c0faa4bb1 Merge "Store original dimensions results in IV store" 2014-01-28 02:33:57 +00:00
jenkins-bot 263b8c04c1 Merge "Add tagName to ve.dm.MWGalleryNode" 2014-01-27 22:34:37 +00:00
Roan Kattouw 4aeb773404 Add tagName to ve.dm.MWGalleryNode
I told James this wasn't needed, but I was wrong. It is null in
the parent class, and DOM throws on document.createElement(null).

Bug: 60307
Change-Id: Iff8fda9acf9f37e537d7d6cf6106a801d6b71338
2014-01-27 14:28:16 -08:00
Roan Kattouw 3acd206a6a Followup 7994eae8c2: fix MWLinkInspector breakage
getAnnotationFromText was renamed to getAnnotationFromFragment,
update MWLinkInspector for this.

Bug: 60374
Bug: 60378
Change-Id: I202a2777f0202dcf42c5968daf8bdf5583b0a11b
2014-01-27 13:11:06 -08:00
Ed Sanders 3612914509 Fix toolbar margins in vector
In HD mode, the left margin was 0.25em off.

In narrow mode, the margins were completely wrong.

Bug: 51000
Change-Id: I7fd9cbc925b828fd780adb9ab2c71bcf15dc7284
2014-01-27 20:11:22 +00:00
Translation updater bot 0e7d5eb397 Localisation updates from https://translatewiki.net.
Change-Id: Idcbcf99348cf8305ec0631f9c220cebb41e6a71d
2014-01-26 16:28:09 +00:00
Ed Sanders f6acb93d5a Store original dimensions results in IV store
* Remove the this.mediaSize custom store object and replace
  with a hash function and the document's IV store.
* Remove this.inputs/this.fieldsets namespaces.
* Calculate this.filename as soon as this.mediaNode is set.
* Rename getMediaSize to getOriginalDimensions

Change-Id: I2030aade5d96555451f6a390d0aa3d44b860841f
2014-01-26 14:26:57 +00:00
Translation updater bot ed7678eb6b Localisation updates from https://translatewiki.net.
Change-Id: I36c11b10b2ad32d68bbca3a7670dbd3a4c9e4dd1
2014-01-24 20:14:28 +00:00
Ed Sanders 5dff7fc7d0 Fix typo in ui.MWCategoryItemWidget
Change-Id: I6270753598bed3179451d17919b445f15db42233
2014-01-24 19:00:11 +00:00
jenkins-bot bea2018ea2 Merge "[Browser test] Updated indent/outdent page elements." 2014-01-23 20:49:06 +00:00
Translation updater bot 8aad62944a Localisation updates from https://translatewiki.net.
Change-Id: I8a601b861359c78e4c175171d6bae972112cb669
2014-01-23 20:21:57 +00:00
Jeff Hall c94c67846b [Browser test] Updated indent/outdent page elements.
Change-Id: I686bec668b6e49b3cebf48790398923f13e3e594
2014-01-23 11:02:32 -08:00
jenkins-bot 319fa24061 Merge "ve.dm.MWTransclusionModel: Clean up and fix logic error" 2014-01-23 03:00:55 +00:00
jenkins-bot ee83ec0e1e Merge "Relativise URLs against target document" 2014-01-23 02:58:51 +00:00
Timo Tijhof 7316c6ba3b ve.dm.MWTransclusionModel: Clean up and fix logic error
* Reduce duplication by calling #removePart (equal, line by line)
* Reset `remove` at the start of each iteration, it was leaking
  through to future iterations.
* Minor simplification in property access.

Change-Id: Ie0a83d582804bc50131ca5a8da36b0605dd4a6c3
2014-01-23 02:58:23 +00:00
Ed Sanders bb773e852c Relativise URLs against target document
mw.Uri will just be using window.document, which may have
a different base.

Depends on I86fe6c2f41e549 in core.

Bug: 58136
Change-Id: I320d5d477d97ebf25963ab2dc429931bc871dd17
2014-01-22 18:46:38 -08:00
Moriel Schottlender 8130acebfd Changing image size in MWMediaEditDialog
Adding the ability to edit image size in the media edit dialog.
The size is now a separate widget.

The following changes were made:
* The dialog was changed to a booklet with 'general settings' and
  'advanced settings', in preparation for other edit features.
* The original image maximum size is fetched from the API and cached.
* Maximum size is limited to the image's original maximum size.
* Aspect ratio is kept when changing height or width, using original
  image size to preserve a sane ratio through the MediaSizeWidget.
* If an error is found in the size, the image will retain its previously
  set dimensions.

Depends on MediaSizeWidget: I3d0f9348a52

Bug: 38129
Change-Id: I2946fb21c46ce05583b219f665ef68928188899e
2014-01-22 18:43:45 -08:00
Trevor Parscal 92746ef3da Implement 'change' events in templates models
This will make generating live previews possible.

Changes:
* Add change events to template model.
* Set up connect/disconnect.

Also:
* Add missing fallback for getParameterLabel (Param#label is
  optional per the TemplateData spec).
* Implement getWikitext, to be used by the UI dialog later
  to create a preview from the wikitext.
* Correctly mark ve.dm.MWTransclusionNode#escapeParameter as
  being a static method.

Change-Id: Ie306ed03babf11568e954b1813ce5324f57d7f0e
2014-01-22 19:03:17 +00:00
cmcmahon 09ed99ef81 Chrome does not always dismiss the beta warning
Change-Id: I48249852d308cfb68ab64cedde6a83f41879ff36
2014-01-22 08:50:15 -07:00
Translation updater bot dabe8ad402 Localisation updates from https://translatewiki.net.
Change-Id: Iacb2d0da11a7bc7970d265ee8a15df0dd6319f70
2014-01-21 19:54:38 +00:00
Jeff Hall 37e90c1a80 [Browsertest] Test maintenance for new DOM elements.
Change-Id: I25c1d98bd5cbee9ccb8d6fd1e2912e3205cf85ac
2014-01-21 10:46:40 -08:00
Ed Sanders fdb4062aec Remove unnecessary strangely written range clone
Probably left over from when the range calculation was more complex.

Change-Id: I59c989bac0d80f4a12e57cbd41bdc6587acd964a
2014-01-21 17:35:45 +00:00
Translation updater bot 22b49f3d5b Localisation updates from https://translatewiki.net.
Change-Id: I718643c6387c2046a5312fcd80b321dbc14220cb
2014-01-20 20:28:16 +00:00
Translation updater bot 718200d7ba Localisation updates from https://translatewiki.net.
Change-Id: I39f011f38c6808a8326eab014a58b3b7b2265b9c
2014-01-18 21:17:33 +00:00
Trevor Parscal 49471fc9b5 Update VE core submodule to master
Also update for indicator changes in Iaf7726150

New changes:
f981943 Fix toolbar indicators in demo
e849941 Update OOjs UI to v0.1.0-pre (11632fcada)

Change-Id: I16c38259ccedbfba8260f8a508b572cee6389517
2014-01-17 18:30:00 -08:00
Trevor Parscal 7994eae8c2 MediaWiki language inspector updates
* Add ULS, which was removed from VE core
* Add experimental mwlanguage module which adds ULS integration
* Hook in ULS to the existing language widget

Also update VE core submodule with changes:
* 1e92abe Generic language inspector

Bug: 47759
Change-Id: I325a4dcc316d0334fadfcaa46ad3acd45c6bf84b
2014-01-18 01:02:23 +00:00
jenkins-bot 3cdc8e59b4 Merge "Tee tracked events to MediaWiki's mw.track" 2014-01-17 22:49:24 +00:00
Translation updater bot 7ef8e0ffc9 Localisation updates from https://translatewiki.net.
Change-Id: I6e85c2b35c7e261884dab13f80ebee1ca1e5bea4
2014-01-17 20:42:25 +00:00
Trevor Parscal f4156bd09f Update VE core submodule to master (e7e2833)
New changes:
* e7e2833 - Update uses of Push/IconButtonWidget to ButtonWidget
* d9d9eb5 - Update OOjs UI to v0.1.0-pre (d9bab13)
  * d9bab13 - The Great Button Refactor of 2014
* 22b93ef - Update OOjs UI build (88b2871)
  * 88b2871 - Fix png transparency on required.png
  * 670c468 - Add i18n

Also:
* Update uses of Push/IconButtonWidget to ButtonWidget as there
  is a breaking change in new OOjs UI version.
  This was separated from commit I325a4dcc316d0.

Change-Id: I82220d15221c52be03feafcfc85c2bd6c12ba462
2014-01-17 16:29:36 +01:00
Translation updater bot 8e2a38cc04 Localisation updates from https://translatewiki.net.
Change-Id: Ib08fc6b50614b3c6737d67b1e7e8158e67b249e8
2014-01-16 23:09:48 +00:00
Ori Livneh 753d87e618 Tee tracked events to MediaWiki's mw.track
When running in the context of MediaWiki, VisualEditor should tee its event
stream to MediaWiki's main event bus, mw.track(), so that MediaWiki event
subscribers have a unified interface for subscribing to events. Each
VisualEditor event topic is prefixed with 've.'

To test this patch, you can use this snippet:

  mw.trackSubscribe( 've', function ( topic, data ) {
    console.log( this, topic, data );
  } );

Change-Id: I6b3f10b0dd0aa7fa47c3b35e2fc554622960ce52
2014-01-16 13:34:20 -08:00
Timo Tijhof 8e7a864e90 Clean up and doc fixes
Remove odd comment and move node property to list of properties.

Change-Id: Ife3161bbdbf01075e987e65d9bfef41994efa916
2014-01-16 17:41:08 +00:00
Ed Sanders 26392cc1db Fix png transparency on gallery.png
Change-Id: Ia202294e1d27517c5317654e1d2d3410286c1773
2014-01-16 11:45:32 +00:00
Ed Sanders 6f37b4608c Only show non-anchored resize handles for MWBlock/InlineImages
For block images, show the bottom left/right anchor if the image
is right/left aligned, and both if it is centred.

For inline images, show the bottom right anchor unless the page is
RTL.

Change-Id: Icb5b74b954493257c517a5fbac5f0a0a457c544c
2014-01-16 02:41:48 +00:00
jenkins-bot adf8249688 Merge "Ultra-basic gallery editing" 2014-01-15 23:27:06 +00:00
James D. Forrester 842688c51b Ultra-basic gallery editing
'Cos Erik doesn't like things he can't edit.

Change-Id: I1d9fb1215bb16b1245eddd87c977fb5bfdee4da9
2014-01-15 15:13:12 -08:00
jenkins-bot 96f638d2ce Merge "Add multipart/form-data emulation to ve.init.mw.Target#apiRequest" 2014-01-15 22:28:29 +00:00
jenkins-bot 6a04a92f32 Merge "Support external links in MWInternalLinkAnnotation" 2014-01-15 22:27:29 +00:00
jenkins-bot c8a1e16749 Merge "Display indicators for required parameters in template dialog" 2014-01-15 22:23:20 +00:00
Trevor Parscal c8f7845def Display indicators for required parameters in template dialog
Update submodule for changes in OOUI (I1c047b55c7a0d5cf3e0aa0cc3f9a4da7d45c0304)

Change-Id: I8f84a9ae277e5093356f591f7a56e8cebf4a1893
2014-01-15 14:15:21 -08:00
Ed Sanders a703086e61 Keyboard shortcuts MW integration
Also adds a button to the utilities menu.

Depends on I806343b42c5fc63d.

Bug: 52844
Change-Id: Ia488362f4b8c9b99b615c84a7341d97e28bdb295
2014-01-15 14:04:06 -08:00
Translation updater bot 13cc46af5e Localisation updates from https://translatewiki.net.
Change-Id: If64ba9477f844aa6ffd9eb4e21b8d8dd9704c889
2014-01-15 21:05:13 +00:00
jenkins-bot d05767a3f1 Merge "About-group extra DOM data in toDomElements" 2014-01-15 20:25:59 +00:00
Trevor Parscal 4f0b988fbc Rejigger-ify the insert tool order
Change-Id: I9e37561eaac17689378af2c6a14dbf24b9326e9e
2014-01-15 20:08:10 +00:00
Roan Kattouw edd2bcd34e Add multipart/form-data emulation to ve.init.mw.Target#apiRequest
On my example main page, this reduces the size of the POST body by 45%

Bug: 59660
Change-Id: I7f04f403e0081188b8b4024c4431ae43b127434c
2014-01-15 17:17:29 +00:00
Ed Sanders 217ea940d5 Support external links in MWInternalLinkAnnotation
As URLs from the clipboard are always absolute, we need to detect if these
are from the same wiki as the current document, and if so convert back to
relative for Parsoid.

Bug: 58136
Change-Id: Id251afe65193fc6356628f1deb5ed757f8a6d347
2014-01-15 12:20:46 +00:00
Ed Sanders 3059fecc5f About-group extra DOM data in toDomElements
Although marked as data-ve-ignore, it isn't ignored by Parsoid,
so about group it together as well.

Bug: 59002
Change-Id: I263e316fb10f3e6f23fc1d409686cdefbd28fafa
2014-01-15 11:06:25 +00:00
jenkins-bot 2284cb9aae Merge "Factor out AJAX defaults into ve.init.mw.Target.static.apiRequest()" 2014-01-15 10:37:43 +00:00
jenkins-bot ebae1e9192 Merge "Update VE core submodule to master" 2014-01-15 03:34:25 +00:00
Roan Kattouw b0cfb82369 Update VE core submodule to master
Also update MWConverter.test.js for test util changes.

New changes:
863288b Update OOjs UI to v0.1.0-pre (af97c1caec)
0bb2404 Refactor converter test utils to run single test cases

Change-Id: I90273786ac186df3eec13270f94d655b605bfdc4
2014-01-14 19:29:58 -08:00
Roan Kattouw 244da036fe Add csslint rule for duplicate background images to ve-mw icons CSS too
Change-Id: I8b179f9caf884bf53d9393570e6b786b52d52d79
2014-01-14 19:11:36 -08:00
jenkins-bot 7c087176ac Merge "Use paramOrder data for ordering template parameters" 2014-01-15 02:58:52 +00:00
Ed Sanders b2b9f217da Wrap text nodes in spans if trying to mark as data-ve-ignore
Otherwise you're going to have a bad time.

Bug: 59002
Change-Id: Ifd90087b3d36f412420b9786f3d54a5418846d03
2014-01-14 23:42:49 +00:00
Translation updater bot 68cfe81a27 Localisation updates from https://translatewiki.net.
Change-Id: Ib1f0997190631aa51686cc2c5bb5888116a0e7c5
2014-01-14 20:52:58 +00:00
Trevor Parscal 2a40b3b27b Use paramOrder data for ordering template parameters
Parameters are ordered using 2 consecutive buckets, the intersection of
paramOrder and parameters in use ordered using paramOrder followed by the
remaining parameters in alpha-numeric order.

A patch to TemplateData was needed to make this work, but we won't get a
crash without it, just no order specification:
    Ic5b42c4189868412138680654c499b6c8bc8f47e

The paramOrder property needs some help still, as it currently requires
being either omitted or containing an exhaustive list of all known
parameters. It should backfill unmentioned params in JSON specified order
instead.

Bug: 51930
Change-Id: Ic3eb665389380c8e3dd6562b059c2f6655a22588
2014-01-14 20:19:54 +00:00
Trevor Parscal 278bcd9a20 Added indicators to toolbars
The down arrow is no longer default, so it needs to be specified
explicitly.

Updates submodule to include indicator changes
(see I0a1faef11a1e7e6ea3e44275c85f2efafae4dc9a)

Change-Id: I32aef3ea2e66fd823aeb07dac06cfefba9954270
2014-01-13 18:32:01 -08:00
Translation updater bot ed8c44ac5b Localisation updates from https://translatewiki.net.
Change-Id: Ie1eaab263686b24029df951f6decf9ef9fdc3b0b
2014-01-13 21:35:23 +00:00
Roan Kattouw 97c4c6c71b Factor out AJAX defaults into ve.init.mw.Target.static.apiRequest()
Change-Id: I90b0858ccd657b7183ae5327903449d17d9f0bef
2014-01-13 11:45:30 -08:00
Timo Tijhof 6f90f9364e Remove unused ve-init-mw-viewPageTarget-transform-hidden
Follows-up I2d6157708bd7b.

Change-Id: I62c7d7bb179719165df92499cb66b62aa2c6785d
2014-01-13 20:18:42 +01:00
jenkins-bot 542871bcf2 Merge "Update categories HTML on page save" 2014-01-13 18:35:47 +00:00
jenkins-bot da9324772f Merge "Hide #contentSub properly" 2014-01-13 17:15:19 +00:00
Ed Sanders 5acabd693f Hide #contentSub properly
It is treated specially which results in it being set to opacity=0 instead
of hidden, and leaves a large space at the top of the document. Removing
special treatment of it results in it being hidden properly.

Bug: 52243
Bug: 54325
Change-Id: I2d6157708bd7b4c3a7c6474b1612862120f963b7
2014-01-13 17:05:42 +00:00
jenkins-bot 545038dc19 Merge "Fix more copyright headers not updated to 2014" 2014-01-13 15:39:57 +00:00
Ed Sanders 2e62862dc7 Fix comment in header for MWEditModeTool
Change-Id: I63e555c80a42073268ac487d0e0ee330531942ac
2014-01-13 15:18:06 +00:00
Ed Sanders cd55b92bb2 Fix more copyright headers not updated to 2014
Change-Id: Ib45ae179c001ca270597ad954f65b0b1b2c776de
2014-01-13 15:08:24 +00:00
Ed Sanders c74d7f1a21 Update categories HTML on page save
Because there's an API for that.

Bug: 48560
Change-Id: I410647d2b1aa740f606ddca64052b8d2b54671bf
2014-01-12 14:55:39 +00:00
Translation updater bot 6d20834fb1 Localisation updates from https://translatewiki.net.
Change-Id: I531b88ca2c6940c47d3a16b8e8cf76bdd4145200
2014-01-11 22:27:29 +00:00
Translation updater bot ba4193d492 Localisation updates from https://translatewiki.net.
Change-Id: I78979bdbc86ccf4978ab914f78e1d8e3cdc76648
2014-01-10 22:47:39 +00:00
Translation updater bot bf8724bb2e Localisation updates from https://translatewiki.net.
Change-Id: Icb9ab1278c12df6b8e9d8fed872373052de5350e
2014-01-09 20:30:20 +00:00
jenkins-bot 38c0206c53 Merge "Refactor extraModules to $wgVisualEditorPreferenceModules" 2014-01-09 12:38:48 +00:00
Translation updater bot ae6e53ae3d Localisation updates from https://translatewiki.net.
Change-Id: Ide0e254d8c77ccf40387960e2d0f8dbae0410994
2014-01-08 20:39:11 +00:00
cmcmahon 6414f6559f Remove expensive sleep for beta warning
Change-Id: Ibc06d98fc1a180a0be0e1538188b13759fcbc364
2014-01-08 20:02:52 +00:00
jenkins-bot d5b51e5204 Merge "Protect against JS error when langlinks API query returns an error" 2014-01-08 15:19:02 +00:00
Translation updater bot 3049c066c2 Localisation updates from https://translatewiki.net.
Change-Id: Ia1bf13acedc4fb46c6bc398a93654f0a53aeee6d
2014-01-07 20:47:21 +00:00
Roan Kattouw e711d79e48 Protect against JS error when langlinks API query returns an error
This happens e.g. when opening VE on a redirect page.

Change-Id: I75b77da42013c3d446cbc9c57aebe0907a2b40dc
2014-01-07 11:26:31 +08:00
jenkins-bot cc84209767 Merge "Force CSSJanus to not flip image alignment classes" 2014-01-07 02:45:54 +00:00
Translation updater bot 30d9693b89 Localisation updates from https://translatewiki.net.
Change-Id: I450b7cef38331f72c727dda4975c0d7b83d9be1e
2014-01-06 20:08:50 +00:00
jenkins-bot 6edb66229b Merge "Use $.parseHTML() to parse HTML in the transclusion preview" 2014-01-06 15:40:13 +00:00
jenkins-bot 24808c87a6 Merge "Don't send edit token in action=visualeditor requests" 2014-01-06 15:39:09 +00:00
jenkins-bot 2e44796a94 Merge "Use GET rather than POST in ve.ui.MWLanguagesPage" 2014-01-06 15:38:06 +00:00
jenkins-bot 2016380ac5 Merge "Let users set __NOEDITSECTION__ status" 2014-01-06 09:45:49 +00:00
James D. Forrester 707f7c93a5 Let users set __NOEDITSECTION__ status
Adds a checkbox to the page settings pane of the meta dialog that lets
users set or unset the __NOEDITSECTION__ flag on the page.

Change-Id: If1eca58e28d214021f5f5582856e595d4d0fbc43
2014-01-06 17:42:57 +08:00
Roan Kattouw dc882baab6 Refactor extraModules to $wgVisualEditorPreferenceModules
Instead of having a hard-coded array of preference-triggered modules
that we need to maintain in multiple places, manage this data in one
place in a configuration variable, and explicitly declare the preference
and module names rather than interpolating both of them from a name.

This allows extensions to add preference-triggered modules, and it
allows them to have preference names and module names that aren't
prefixed with 'visualeditor-enable-' and 'ext.visualEditor.' respectively.

Change-Id: I9eb14349cd39125d5c11ffb44c962cc5febb6ba0
2014-01-06 16:57:45 +08:00
Translation updater bot cabf40044e Localisation updates from https://translatewiki.net.
Change-Id: Ica0ef464fe067e1dbba18dfed038a4a715bdc4e9
2014-01-05 20:14:40 +00:00
jenkins-bot 34afa4c15d Merge "[browser test] change list_item to li" 2014-01-05 19:20:21 +00:00
jenkins-bot e2aaeffe15 Merge "[browser test] Updated Ruby and RubyGems" 2014-01-05 17:43:28 +00:00
James D. Forrester 0ffd654bed Bump copyright like it's 2014
Change-Id: Ic469ebda2c061dc7da0b4c1625f43a7be55da4fa
2014-01-05 20:06:50 +08:00
James D. Forrester 0fadc2bc77 Let users set __NOTOC__ & __FORCETOC__ status
This creates a new panel in the meta dialog, "Page settings", where page-
level settings will be, err, set. For now, this exposes just the
behavioural switches for the presence/absence of the Table Of Contents –
__NOTOC__ and __FORCETOC__.

As part of this change, the meta dialog is renamed to "Options" to be
less confusing, and the icon for the meta dialog is changed to the
generic one for dialogs, which was previously unused. The page settings
pane is provided first in this list, given that the categories pane
(amongst others) is now directly accessible through the toolbar menu.

Bug: 56866
Bug: 56867
Change-Id: I33ce05c19d2e19b249e1cefd26fd0e3697d0085d
2014-01-05 18:56:53 +08:00
Roan Kattouw aede27fbd8 Use $.parseHTML() to parse HTML in the transclusion preview
This fixes the issue where parsing HTML that started with
a text node would cause that first text node to be dropped.

Change-Id: I71dafd69e12cab50e6644b4817f0fd6105657216
2014-01-05 13:52:55 +08:00
Roan Kattouw cec798558a Don't send edit token in action=visualeditor requests
This is not needed any more since action=visualeditoredit
was split out of action=visualeditor.

Change-Id: I3bdb9dff07e232be8f85827fe4276ca8f4956253
2014-01-05 13:52:27 +08:00
Roan Kattouw 28ad21af2e Use GET rather than POST in ve.ui.MWLanguagesPage
Change-Id: Ibf8a3fdd651d8863dca2c4c958da41fc2d80c06a
2014-01-05 13:52:02 +08:00
Zeljko Filipin fc250c601d [browser test] Updated Ruby and RubyGems
Also changed single quotes to double quotes.


Bug: 56083
Bug: 57597
Change-Id: I9afea8053472d888e2484f155b5ed38034794742
2014-01-04 01:24:47 +00:00
Zeljko Filipin 508ee3203e [browser test] change list_item to li
Both are valid, but using li is the convention.


Change-Id: Ic6929a1c8508760d0228c78fa132e1b1d92680a2
2014-01-04 01:24:20 +00:00
Moriel Schottlender 580a3f3d8d Use image sources from the fileRepo API
This commit switches from using hard-coded media source urls to utilizing
MediaWiki's API call for meta=filerepoinfo. The API call is done only if
needed when the media insertion dialog is loading, and is done only once
per session.


Bug: 50673
Change-Id: Ia5ad9a8c00cca6cbbbc890359dc529e29e1a6be7
2014-01-04 01:21:24 +00:00
Translation updater bot 0bd356f4b4 Localisation updates from https://translatewiki.net.
Change-Id: I60bec12bb438191cd90350911a37c02308308f9b
2014-01-03 20:45:45 +00:00
Translation updater bot 3e925e6343 Localisation updates from https://translatewiki.net.
Change-Id: I65bb885587aa269f3773ba4ad0e5c440a092b8b9
2014-01-02 20:50:46 +00:00
Translation updater bot 664f479ed8 Localisation updates from https://translatewiki.net.
Change-Id: I543d2c4ad9f1a75b2c306f499fb0334301bf6a2b
2014-01-01 20:01:28 +00:00
Moriel Schottlender f4531e8cd1 Force CSSJanus to not flip image alignment classes
For some reason, the class-wide /*@noflip*/ on mw-halign-left and
mw-halign-right didn't 'catch' and cssjanus ended up flipping the
float directions in RTL. This fix forces noflip condition on each
of the lines separately, which seems to work.

Bug: 50910
Change-Id: I4cddce80397d821dc3cbf40ee4b4c471890d8d35
2013-12-31 09:43:44 -05:00
Translation updater bot 2f9e6b9b38 Localisation updates from https://translatewiki.net.
Change-Id: I94121419f6bd900d9a203d421e52cec422f431cc
2013-12-30 20:02:40 +00:00
Translation updater bot ae830de58d Localisation updates from https://translatewiki.net.
Change-Id: I132f4c2cf178420ba43ca1f51ce16ad39f68753f
2013-12-29 19:34:21 +00:00
Translation updater bot edbfce3663 Localisation updates from https://translatewiki.net.
Change-Id: I4220bf8e7772a5668d4178cdcd42a631560d2560
2013-12-28 19:33:39 +00:00
Translation updater bot 90044befbd Localisation updates from https://translatewiki.net.
Change-Id: I7d057b398d3ed648006437dcef59fb5df75477cc
2013-12-27 18:38:13 +00:00
Translation updater bot 93fe564245 Localisation updates from https://translatewiki.net.
Change-Id: Ia818cec9e2666d760489e1adfd6bfb15886ab248
2013-12-26 19:43:23 +00:00
Translation updater bot 79ac21ca25 Localisation updates from https://translatewiki.net.
Change-Id: I60929cbfb66708e15c34671556edeedadf47d229
2013-12-25 20:03:30 +00:00
Jeff Hall c0c021219d [Browser test] Retry loop for beta warning dismissal.
Tests run via SauceLabs do not always dismss beta warning
pop-up on the first attempt, so try and try again!

Change-Id: I074824c5f1c99d8e5408dcb1ada7b97a6d20ebe8
2013-12-24 16:12:13 -08:00
cmcmahon 2b9e0cb1ff interim move prevents edit conflicts while we sort test data issues
Change-Id: I857fd2d99513e0c176ef832bc92e0a16d972e74a
2013-12-24 10:35:22 -07:00
Jeff Hall 385cc12fd9 [Browser test] Update test to handle SSL in test2
Changed URL matching condition to be indifferent
to HTTP vs HTTPS addresses since it's not
relevant for what is under test here.

Change-Id: I3382174d6cd0e05c28fc94e0a2fcbc5d170fed3c
2013-12-23 22:28:37 +00:00
Jeff Hall 456e8c1f99 [Browser test] Update test to use existing hook
1) Reduce some code duplication.
2) Added bonus: will fix a problem with the failing "links" test.
3) Removed some commented code lines in feature file.

Change-Id: I7ad4ade89c6477fd42eca178bae294f4dfecdf5b
2013-12-23 22:05:34 +00:00
Translation updater bot 7779f28aa4 Localisation updates from https://translatewiki.net.
Change-Id: I97a05c21a2c5f8d1311ce6df8ea4fd75f6f1e246
2013-12-23 20:52:06 +00:00
Translation updater bot 792aafa8ce Localisation updates from https://translatewiki.net.
Change-Id: I5feeaefbe31e45490902e3a98e693893e3cd9f79
2013-12-22 20:33:06 +00:00
Translation updater bot 4b3578b791 Localisation updates from https://translatewiki.net.
Change-Id: I928998e2edd039ed8acd2e537245f864f942daf8
2013-12-21 20:42:48 +00:00
Translation updater bot 4c9a8f03a7 Localisation updates from https://translatewiki.net.
Change-Id: I12de0358eabe0b60b7572df75cb0afd8483969f8
2013-12-20 20:36:35 +00:00
Roan Kattouw ee743f869d Use submodule for VisualEditor core
* Add lib/ve.
* Remove modules provided by VisualEditor core.
* Update paths.
* Remove VisualEditor core specific things from Gruntfile.
* Remove entries from external.js already in lib/ve/.docs/external.js.
* Implement build script to compose a jsduck index that includes
  all of VisualEditor core. Right now it includes VisualEditor's
  index as-is, and because those patterns (e.g. ve.dm.*Node) will
  also MW subclasses this means our category page will include
  MW classes under "VisualEditor (core)" (before the repo split,
  this was intentional).
  This is inevitable unless we list every class individually, or
  (the plan) until we move the MW subclasses out of the ve.*
  namespace and into mw.* somewhere.

Bug: 45342
Change-Id: Iff45cd555430634c9fc341fd3b177c1e0625300b
2013-12-20 09:18:41 +00:00
Roan Kattouw c41b60021d Move libraries to the lib/ directory
Didn't move unicodejs because it doesn't have its own repo
and is currently mastered in this repo

Change-Id: I14ab4bd641077d993ac235d8bcdcf8e50a1a72a7
2013-12-19 23:02:52 +01:00
Translation updater bot 0e3818418d Localisation updates from https://translatewiki.net.
Change-Id: I639ee73b173299883c724c28bff1da32971970f9
2013-12-19 20:55:29 +00:00
Trevor Parscal 7d129e091f OOjs UI to v0.1.0-pre (04754daaa9)
Changes:
* 04754da (HEAD) Change label of disabled switch to 'disabled' in demo
* 33c379f        BookletLayout: Sync outline with panels via focus instead of scroll
* ca53b7e        Fix checkboxes so the value can actually be set
* eb77c91        Refactor ToggleWidget, add ToggleButtonWidget, ButtonGroupWidget
  ----
* 5ffe63d (prev) Spell removable and movable using modern English

Change-Id: I7f1e0cd92c6eb8346da35b59a293759f2c72d7a9
2013-12-19 20:22:11 +01:00
jenkins-bot 37e5d037d0 Merge "Documentation fix in MWBlockImageNode" 2013-12-19 18:34:42 +00:00
Ed Sanders ae6f22910f Documentation fix in MWBlockImageNode
Change-Id: I8203474b8816197421ee18c5513b4c7235adb1da
2013-12-19 18:32:40 +00:00
cmcmahon 7689946826 [browser test] replace single quotes with double quotes
Change-Id: I569c31b389a9678e2d99709073511711e7e628e3
2013-12-19 10:07:10 -07:00
Zeljko Filipin 30f2619c14 [Browser test] New test for switching between editing modes
1) Using native page-objects methods for dealing with Javascript alerts.
2) Added tags to feature file per reviewer comment.

Change-Id: I3e9d9ae16f1c880878c8e198c647376a0b9aed37
2013-12-19 14:56:30 +00:00
Jeff Hall 2b74982e95 [Browser test] New test for multi-edit workflow
1) Per reviewer comments, moved some of the verbosity
   from feature to steps file in order to make
   the feature file a little more readable.
2) Using random strings for the text of each edit
   in order to make every edit unique.
3) Removing a commented line that wasn't needed.

Bug: 57654

Change-Id: Ib8b15964436d9c24556fac32977a64e2d5f22044
2013-12-19 14:28:11 +00:00
jenkins-bot cdc8c6bc06 Merge "MWBlockImage new DOM fixes" 2013-12-19 08:29:12 +00:00
Timo Tijhof ca40077866 Clean up Target properties
Move target.surface from mw.Target to Target
* All targets use this, let's standardise it.

Move target.$document from mw.ViewPageTarget to Target
* It was initialised with null in mw.ViewPageTarget, but the
  assignment happened in mw.Target. So it should be moved up
  at least to mw.Target.
* Since it is useful to have in sa.Target as well, moved it up
  to the abstract Target, and implemented in sa.Target and
  immediately used in the standalone demo where we were already
  duplicating the find( '.ve-ce-documentNode' ).

Add missing target.setupDone = false; in sa.Target

Add missing target.toolbar to Target
* Was used in all subclasses, but never initialised in any of
  the constructors. Let's standardise this property name as well
  (instead of initialising it in three places).

Move target#event-surfaceReady from mw.Target to Target
* sa.Target uses it as well, and considering Platform#initialize
  is already standardised in the abstract class, Target#setup
  being deferred is most likely to happen in each target as well
  so let's avoid different events being invented for the same
  thing and consistently use 'surfaceReady'.

Change-Id: Ia8bde188a4cde7e1615c2ae9c5b758eefc5d9cb7
2013-12-19 02:16:20 +00:00
Timo Tijhof 370b07ffaf demo: Convert VisualEditor standalone demo to pure HTML+JS
Change-Id: I9a93abce933e91881e553c0bdb26f31065cf4cda
2013-12-19 03:12:13 +01:00
jenkins-bot 198a001ac0 Merge "Clean up HTML files, Gruntfile and remove index-phantomjs-tmp hack" 2013-12-18 23:43:03 +00:00
jenkins-bot 8126dd47dd Merge "Prevent getSaveFields from returning a property named undefined" 2013-12-18 23:38:59 +00:00
Rob Moen 212e5b231b Prevent getSaveFields from returning a property named undefined
Change-Id: Id7326ee8b951ba2219d3ea6767370ece9aba3c23
2013-12-18 15:32:49 -08:00
Ed Sanders 76defa7ce2 MWBlockImage new DOM fixes
MWBlockImage
* Remove properties which just cache model properties. We can get
  fresh values from the model whenever needed and this just causes
  problems keeping them in sync.
* Tidy up DOM documentation indentation
* Merge setupCaption and setCaptionVisible into updateCaption. The
  caption's visibility can be calculated inside the method from
  model attributes.
* No need to generate figcaption on init, updateCaption  will do
  this for us
* Storing full view and model in this.caption is unnecessary,
  just store this.$caption (view.$element) and this.captionVisible
* Append the caption directly to the figure now there is no container
* Simplify setCaptionVisible
* Add in fix to account for border to figure width
* updateSize can get values from the model if they are not provided
* Remove unnecessary styles being set on this.$element.

MWImageCaption
* Generate as a figcaption instead of a div for direct attachment

MWImage
* Missing docs

CSS
* Cleanup reset styles, remove redundant add in required
* Fix margins for left/right floats to match .tleft/.tright
* Use more specific selector for inner border (thumbimage) to avoid
  matching shields.
* Remove unnecessary frameless styles, it has no border by default.

Change-Id: I52e0e10b465bb9761c2e4be28c98bec37b0dd2ca
2013-12-18 22:53:13 +00:00
Translation updater bot 336a4ca9ca Localisation updates from https://translatewiki.net.
Change-Id: If44e14fd60106a123c8a7cfc6f4b70163a6ec3b5
2013-12-18 20:27:34 +00:00
Zeljko Filipin 1cd761dad8 [browser test] Prefer string interpolation instead of string concatenation
Following Ruby coding convention[1].

Also fixes "no implicit conversion of nil into String (TypeError)"
error.

1: https://github.com/styleguide/ruby

Change-Id: I3bcf9ba08476117921de7d5a242f3726d8b05efb
2013-12-18 16:38:48 +00:00
Rob Moen 790d2c1307 Move additional module loading from mw.Target to mw.ViewPageTarget
This resolves some experimental mode dependencies on Mobile integration.

Bug: 58551
Change-Id: Id6c498ae19a5d5b1e5d1698f5e149a9b5d6f3b26
2013-12-18 07:11:36 +00:00
Timo Tijhof 3e9b227a6a Clean up HTML files, Gruntfile and remove index-phantomjs-tmp hack
Consistently:
* Use <!DOCTYPE html>.
* Use lowercase element tags.
* Indent <head> from <html>.
* Use <meta charset="utf-8">.
* Indent <script> and <style> content from open/close tag.
* Put <link> before <script> when in <head> (in ve/test).
* Use .html instead of .php for indexes where PHP is no
  longer used.
* Use the same license header as we use elsewhere (/*! instead
  of /** and no @file)

Gruntfile:
* Include the new .js files in jshint (demos/**/*.js).
* Order buildloader keys in the same order as the directories
  they go to (alphabetically).
* Add missing jshint patterns:
  - .docs/**/*.js
  - build/**/*.js
  - modules/ve-wmf/**/*.js
* Add missing qunit test:
  - qunit.unicodejs
* Add missing watch patterns:
  - .jscs.json
  - qunit.unicodejs

Also:
* Moved relatively large pieces of script into separate files
  so that they are less repeated (though .template) and also
  able to be linted properly.
* Fixed jshint warnings in newly-created trigger.js and demo.js.
* Moved <script> elements already in <body> to bottom of <body>
  (in ve/test and eg-iframe).
* Moved <script> in eg-iframe from <head> to <body>.
* Fixed buildloader grunt task to use a non-\n whitespace match.
  for the start as well, the newline before the placeholder was
  being stripped.
* Removed the (now obsolete) index-phantomjs-tmp hack.

Change-Id: I7c5a371b82f69f367a8e1c11673d2f37868bc931
2013-12-18 07:00:23 +00:00
Ed Sanders 50bec367ca Fix paste tests to work in phantomJS
PhantomJS doesn't play nicely with document.execCommand and complex
HTML. For testing the attribute stripping, use the clipboardData
path. Add in a special clipboard key value that allows us to manually
trigger this from the tests ('useClipboardData-0').

Change-Id: I0de842095a6a9a766f0f9a2249064ca7707283c8
2013-12-18 02:40:42 +00:00
jenkins-bot b922592902 Merge "Replace makeStaticLoader with a grunt task" 2013-12-17 21:41:29 +00:00
jenkins-bot a887720196 Merge "Move visualeditor-languages-tool message from ve to ve-mw" 2013-12-17 21:39:33 +00:00
jenkins-bot 725601305e Merge "Alphabetize msgs-ve" 2013-12-17 21:35:35 +00:00
jenkins-bot 09dee21de7 Merge "Split ext.visualEditor.mwcore out of ext.visualEditor.core" 2013-12-17 21:34:45 +00:00
jenkins-bot cd67c365c6 Merge "Use jquery.i18n for standalone i18n" 2013-12-17 21:16:24 +00:00
jenkins-bot 0a5687e296 Merge "Allow ve.init.Platforms to asynchronously initialize themselves" 2013-12-17 21:15:29 +00:00
Roan Kattouw 88c4888872 Replace makeStaticLoader with a grunt task
'grunt build' builds modules/ve/test/index.php, demos/ve/index.php
and .docs/eg-iframe.html from the associated *.template files.

Got rid of the JS-based SVG/PNG switching logic. Instead, we now
just use SVG unconditionally. We'd already dropped browser support
for browsers that don't support SVG anyway.

Change-Id: Iba2e68f17904687cb13e793a410e095f28f1b13c
2013-12-17 22:03:01 +01:00
Roan Kattouw b61813b935 Move visualeditor-languages-tool message from ve to ve-mw
I intially thought it was associated with the language inspector, but
it's not, it's the label for the languages pane in the meta dialog.

Change-Id: I478e3951862a25eee056e3df6cc3c9f9f7d9d935
2013-12-17 20:56:13 +00:00
Roan Kattouw fe2ab4a203 Alphabetize msgs-ve
Change-Id: I79294c8b3a80d25eeeb03a84bc04b3d670ce6a14
2013-12-17 20:56:07 +00:00
Roan Kattouw fb3a75b85d Split ext.visualEditor.mwcore out of ext.visualEditor.core
* Split files according to ve / ve-mw paths
* Split messages according to msgs-ve / msgs-ve-mw
* Update dependencies accordingly
* Remove ve-mw/ hack in makeStaticLoader.php, no longer needed

Bug: 45342
Change-Id: I6cb89606c307e27e237a1e9b56b94dfdcd310f41
2013-12-17 20:56:03 +00:00
Roan Kattouw 94879a98b7 Use jquery.i18n for standalone i18n
VisualEditor.php:
* Make jquery.i18n a dependency of ext.visualEditor.standalone

makeStaticLoader.php:
* Remove ve.init.platform.addMessages() call with PHP-generated messages
* Add fake module for jquery.i18n
** Needed because the module might come from MW core
** Also add special treatment for fallbacks.js and language scripts

ve.init.sa.Platform.js:
* Remove basic message system, replace with jquery.i18n
* Add initialize method that loads messages for current language and
  fallbacks

ve.init.sa.Target.js:
* Wait for the platform to initialize before actually doing things
* Add .setup() method to allow callers to short-circuit this process
** This is convenient for callers of ve.init.sa.Target in the test suite

ve.ce.test.js:
* Use existing ve.test.utils function for creating a surface

ve.test.utils.js:
* Call .setup() on the target so we can get a surface synchronously

ve.init.Platform.test.js:
* Make these tests async, wait for the platform to initialize
* Allow for missing messages to be output either as <foo> (MW)
  or foo (jquery.i18n)
* Get rid of message clearing code, namespace test messages instead

Change-Id: Iac7dfd327eadf9b503a61510574d35d748faac92
2013-12-17 21:16:26 +01:00
Translation updater bot e7ea330f96 Localisation updates from https://translatewiki.net.
Change-Id: Ifd7b23212032c27448a6204b7d77acef8524c961
2013-12-17 19:25:54 +00:00
jenkins-bot b5a3cfe30c Merge "Strip trailing linebreaks on paste due to Chrome bug" 2013-12-17 18:53:09 +00:00
jhall 5e6154ebc4 [Browser test] New transclusion template search
Per Bug: 58406, updating search criteria for
tranclusion templates to work with existing
content in beta labs.

  Please enter the commit message for your changes. Lines starting

Change-Id: Iac6919d234bd298034cc3c3d90ec62239a3fd0df
2013-12-17 08:30:07 -05:00
Roan Kattouw fc119e3d60 Allow ve.init.Platforms to asynchronously initialize themselves
We'll need this for the standalone platform to load jquery.i18n messages

Change-Id: Iacb9fcb2d5750711187f7d72d53d8c7d54c6f30b
2013-12-16 22:46:19 +01:00
Translation updater bot 11ff000c97 Localisation updates from https://translatewiki.net.
Change-Id: If5925a9a9e9ecd1fc44921d1f91f3cc31c23cae7
2013-12-16 19:50:58 +00:00
Jeff Hall f83c8d7519 [Browser test] Additional waits for SauceLabs timeouts
Applying same fix that was applied earlier to "bullets_steps.rb"
since that relieved frequent timeout behavior seen with tests
run via SauceLabs.

Change-Id: I0c924a315cd2bf4821a9155a1d1dcd052910e50e
2013-12-16 10:29:20 -08:00
Ed Sanders 1f7c81851e Strip trailing linebreaks on paste due to Chrome bug
When pasting into a selected paragraph, or emptying a paragraph Chrome
adds a linebreak. Our paste into empty uses a selected paragraph for
context so the converter picks up this extra linebreak.

It is possible that this breaks are intentional but not likely
so better just to trim than to leave the user with a break which
doesn't even render clearly.

Bug: 58347
Change-Id: Ia6b22cdaeedf1a75bb529c9a5312add9c3ce182c
2013-12-16 18:20:24 +00:00
jenkins-bot 93a75dcc04 Merge "Add useful HTML in toDomElements for refs and templates." 2013-12-16 14:57:08 +00:00
Ed Sanders f5cbcc4f56 Add useful HTML in toDomElements for refs and templates.
For the benefit of pasting out of VE.
Use data-ve-ignore where necessary to avoid the HTML being
used on the way back in to VE.

Change-Id: Iabe678c4246c1d1f51abb058b6e750811fdf9bea
2013-12-16 14:33:40 +00:00
jenkins-bot 46f5f29839 Merge "Move index label generation to the model" 2013-12-16 13:17:26 +00:00
Translation updater bot e2f816a4bb Localisation updates from https://translatewiki.net.
Change-Id: I6930c50f3e0a6410e70f9817e953d490895dfe86
2013-12-15 20:59:48 +00:00
Translation updater bot 35f1d5ad77 Localisation updates from https://translatewiki.net.
Change-Id: Ic4dd2f71419cd76a4deb220c1947e4eb4040ff16
2013-12-14 20:55:06 +00:00
Ed Sanders 8e3f77a9e7 JSCS fixes
Change-Id: I11032f05eaee1e8c895e06ebbc9c329cbc70c8c0
2013-12-14 00:04:12 +00:00
Ed Sanders 8ce7182045 Move index label generation to the model
Also make available as a static method so it can be used by the
converter. We will need this for generated HTML for the external
clipboard.

Change-Id: Ief843ac10cd6c6e4b25e09a007625d363792adff
2013-12-14 00:02:50 +00:00
jenkins-bot 0a203fec65 Merge "Update jquery.i18n to f6102aa4feddf3623c9fba3a3d31592c58204b58" 2013-12-13 21:34:08 +00:00
jenkins-bot 717f8acf47 Merge "Move language inspector messages to VE core" 2013-12-13 21:32:56 +00:00
jenkins-bot 628eb96c24 Merge "Reformat English JSON files" 2013-12-13 21:32:22 +00:00
Roan Kattouw c3ea309a78 Move language inspector messages to VE core
They conceptually belong in VE-MW, but right now the language
inspector is used in the VE standalone, and not having the
messages breaks it.

Change-Id: I0f84c6ee6c6142581c895515a2bd2a6caf4e511d
2013-12-13 13:23:58 -08:00
Roan Kattouw e0f011be54 Reformat English JSON files
They were never reformatted by the TWN export

Change-Id: I24b455d7897a4dba89993a8eeaad2fa68933ae1e
2013-12-13 13:01:37 -08:00
jenkins-bot 386f27bffc Merge "Fix the standalone toolbar to not demote heading1" 2013-12-13 20:47:17 +00:00
Roan Kattouw af4b7bd067 Fix the standalone toolbar to not demote heading1
The duplication of the toolbar definition is ugly but we don't
have a better system to say "give me the same except demote this
one thing" right now.

Change-Id: Id74ed1a18aee4a947992bdd626702f578bbace14
2013-12-13 12:24:54 -08:00
jenkins-bot 0fcc524bd3 Merge "Add a getDirectionFromRange Method to ve.ce.Document" 2013-12-13 20:24:23 +00:00
Roan Kattouw 21dd4e411a Update jquery.i18n to f6102aa4feddf3623c9fba3a3d31592c58204b58
From f6102aa4fe

Also rename jquery.i18n.messages.js to jquery.i18n.messagestore.js ,
somehow these files are named differently between the version in ULS
and the version in github and I didn't pick up that change when
switching between them.

Change-Id: Icd78c1374969f1ea539938237d405a8aeecd1dd7
2013-12-13 12:16:53 -08:00
Translation updater bot 69957698c7 Localisation updates from https://translatewiki.net.
Change-Id: Ied0dc7cfda9706146529f47f10c089963f80e0d7
2013-12-13 20:09:48 +00:00
Moriel Schottlender 95d99192b4 Add a getDirectionFromRange Method to ve.ce.Document
getDirectionFromRange returns the direction property of the ce nodes under
that range. That method is mostly useful to recognize the overall block
direction of a selection or fragment.

The method is currently used in the following locations:
* ve.ui.Toolbar onContextChange - as a means to recognize the current context's
  block direction for the icon directionality.
* ve.ui.MWExtensionInspector - if the selection is text and not an existing node
  the input directionality adjusts to the context direction.

Bug: 57421
Change-Id: Ifc01b8e5dc0a2fe39d221e59e452c5cfad709a2d
2013-12-13 12:07:19 -08:00
jenkins-bot fc3ea799df Merge "Check values property exists before removing attribute" 2013-12-13 19:39:42 +00:00
jenkins-bot 9e9243e51f Merge "data-ve-ignore attribute for elements to be complete ignored by the converter" 2013-12-13 19:36:55 +00:00
jenkins-bot 252f25c9cd Merge "Fix hashes in MW toDomElement functions" 2013-12-13 19:36:01 +00:00
jhall c6a002110e [Browser test] Add waits for SauceLabs happiness
1) when_present waits to deal with SauceLabs sluggishness
2) Restore a "sleep" method for running test locally

Change-Id: I692befa5da607cf2468e3a56eb9b634a17f8deb2
2013-12-13 18:56:53 +00:00
David Chan 15f69cb597 ve.EventSequencer onLoop: minor consistency change
Change-Id: I2102c7eb3f8865ef403b01d8975359a4a212bf6c
2013-12-13 18:33:11 +00:00
Ed Sanders 6d65373339 data-ve-ignore attribute for elements to be complete ignored by the converter
This is for HTML we generate for the benefit of the external clipboard
(i.e. pasting into other applications).

Change-Id: I1c5ff4760f17e1981a78a0bc44f8e296454bb065
2013-12-13 17:48:06 +00:00
Ed Sanders 2843714834 Fix hashes in MW toDomElement functions
Hashes weren't using the new [ object, config ] set up so were
never matching the store. Also added a check to see if the
originalDomElements actually exists before trying to use them
(they may have been removed by a clone operation).

Change-Id: I886e369ced9a9d2e0e457ced9c21b2a7a8e55d58
2013-12-13 17:48:03 +00:00
Timo Tijhof 89ae1aa107 Update oojs to v1.0.6
Code:
 http://krinkle.github.io/oojs/releases/oojs-1.0.6.js

Release notes:
 https://github.com/wikimedia/oojs/blob/v1.0.6/History.md

Change-Id: Iaf7cd26b09d709f67f1947ebf14f751654d8b36e
2013-12-13 02:27:12 +01:00
James D. Forrester de4b7e4f0e Move "visualeditor-toolbar-insert" to ve, not ve-mw
Fix mis-placed message breaking stand-alone.

Change-Id: Ibffff67105e6877a61ba68eafc6395e598a36f82
2013-12-12 17:11:46 -08:00
Ed Sanders 74277cbde0 Check values property exists before removing attribute
Apparently the values property is optional so an
exception is thrown if it isn't set.

Bug: 58421
Change-Id: Ied2a1adb2818fb3f516c1cbde263a675ceb84446
2013-12-13 00:10:07 +00:00
Ed Sanders 5f78aa22f1 Check InternalList node exists when rendering MWReferenceList
If you've just pasted in a reference and a list the internal list
nodes may not have been rebuilt yet.

Bug: 58242
Change-Id: Ib10b81f4023194791f789f3e7dda393f2e355ea3
2013-12-12 23:02:10 +00:00
jenkins-bot 630249b1cc Merge "[Browser test] Update Firefox + Selenium versions." 2013-12-12 21:40:42 +00:00
jhall b552171189 [Browser test] Update Firefox + Selenium versions.
Change-Id: Iea8b5dea546140da58759da2db3150f85e1a553f
2013-12-12 21:33:27 +00:00
jhall b9cd28589b [Browser test] Updates to use new Insert menu
"Insert" menu replaces "More" menu for
accessing some advanced markup features.

Change-Id: I57635b54f3a5b2b72f754747bdb836fe1bfda5ec
2013-12-12 21:32:42 +00:00
Translation updater bot ae5b16e981 Localisation updates from https://translatewiki.net.
Change-Id: If498cb7858a02cdc647d26251f35625c93e158e0
2013-12-12 21:17:06 +00:00
jenkins-bot da14b51b7e Merge "Use the same new toolbar for media and reference dialogs" 2013-12-12 19:32:22 +00:00
jenkins-bot a8b8c47c97 Merge "Update jquery.i18n to 255b10492507f78acd547cfab71eef403018d76f" 2013-12-12 19:26:30 +00:00
James D. Forrester 00088bbf05 Use the same new toolbar for media and reference dialogs
With blocks comment out where they're not wanted.

Bonus: Actually make the pasteSpecial command available in these
contexts.

Bug: 58404
Change-Id: Ic77c252ddc9ae54019b2d86ee5f8a6f4febf4292
2013-12-12 19:22:50 +00:00
Moriel Schottlender e3308b0bd9 Direction adjustment to <figure> styling
Adding @noflip to align-left and align-right in the <figure> css styling
rules and removing the need to resize the Branch Node div element on center.

Change-Id: Iec6e589ba9ecdf32c1a0934b9eb05ee3fd42af66
2013-12-12 19:15:53 +00:00
Roan Kattouw 18e243bea4 Update jquery.i18n to 255b10492507f78acd547cfab71eef403018d76f
From 255b104925

Change-Id: I77398f35c9f5465ba6fd224f35b6a863269a7d38
2013-12-12 11:13:18 -08:00
jenkins-bot 46c708df2f Merge "Make commands aware of their symbolic names" 2013-12-12 18:48:07 +00:00
jenkins-bot cf03ad7616 Merge "Render CE MWBlockImageNodes as styled <figure>s" 2013-12-12 18:47:12 +00:00
jenkins-bot aad149fa43 Merge "Add getDomSubtreeFromModel to converter API" 2013-12-12 17:41:00 +00:00
jenkins-bot 67bd5488da Merge "Rename getDataFromDom to getDataFromDomSubtree" 2013-12-12 17:37:04 +00:00
jhall d35cc1e573 [Browser test] Update to use new text styling menu
Also removed some duplicated code and
added test cases for bold and italic styling.

Change-Id: I181c208dd1165ea52bd4c49eb00c2eaae41ef05f
2013-12-12 10:37:48 -05:00
Ed Sanders 92dab00f60 Add getDomSubtreeFromModel to converter API
This means we no longer have to inject the store/internalList etc.
state into the converter manually before generating DOM.

Change-Id: I9d1f5f2592a7c5bf4ad404416b79ad65afd83b9c
2013-12-12 14:37:18 +00:00
Ed Sanders 1e83bd03b3 Rename getDataFromDom to getDataFromDomSubtree
To match its inverse getDomSubtreeFromData, and to make clear
that the input can be any subtree, not just a full document.

Change-Id: I4853bb6def0059eda43f86f0dcb6dd44309dc35d
2013-12-12 11:58:41 +00:00
Roan Kattouw 4c98f753a0 makeStaticLoader: Update fake standalone init module
* Don't add ext.visualEditor.base to it, and strip of ve-mw stuff
** .base doesn't contain ve-mw stuff any more, so no stripping needed
** Instead of appending .base, just load .base and create a
   separate fake module for Standalone init.

* Don't manually register .sa files
** Instead use ext.visualEditor.standalone, it's right there.
** Add missing CSS file to .standalone.

* Documented the purpose of 'Dependencies' and removed scripts
  from that fake module that don't fall under that rationale and
  instead add them as regular modules (rangy, unicodejs).

* Removed weird 'jquery' dependency in 'ext.visualEditor.core'
  module. This is strongly recommended against, and might
  actually cause jQuery to be reloaded due to outstanding bugs
  in core with the state machine in the startup queue (jquery, mediawiki).

* Unlist unused 'jquery.client' dependency in makeStaticLoader.
  As per the module definitions in VisualEditor.php, this is
  only used by the .mediawiki module. Grepped modules/ve/ and
  found 0 uses.

* Update dependency order to roughly match the dependency tree
  as it is specified in ResourceLoader (e.g. rangy is for .core,
  not .base).

* Keep fake modules out of ResourceLoader.

Change-Id: I2a31543e5ad2fc39f5980fea855172108eda4428
2013-12-12 03:34:42 +01:00
Roan Kattouw e754b07539 Rebuild static loaders
Had apparently gotten out of sync

Change-Id: Ib2d576ec5b5db2fe6fec468fd053dfc8a029747a
2013-12-12 01:32:33 +00:00
jenkins-bot 29f047ea89 Merge "Fix issues with copy-pasting MWTransclusionNodes" 2013-12-12 00:45:28 +00:00
jenkins-bot 9a68595f71 Merge "Add recursion to removeHtmlAttribute" 2013-12-12 00:44:29 +00:00
Ed Sanders f0e9ec7922 Fix issues with copy-pasting MWTransclusionNodes
ve.dm.MWTransclusionNode
* Implement getClonedElement to remove originalDomElements
  and originalMw. We don't want to put these in the clipboard
  as there is no guarantee they are the rendering of the current
  set of parameters (a refresh may be in progress) and they may
  confuse the converter on the way back in.
  Remove about attribute to prevent about grouping of duplicated
  nodes.
* Set an extra attribute to flag that the outputted DOM doesn't
  have any generated content attached to it that can be stored
  on load.
* Check for said attribute in toDataElement and skip the
  storeGeneratedContents step. This will trigger an async update
  of the generated contents on paste.

ve.ce.Surface
* Call cloneElements before writing to pasteTarget so data in external
  clipboard is stripped of generated contents.

ve.dm.Node
* Only strip data-parsoid as other attributes may be meaningful.

ve.dm.mwExample, ve.dm.Node.test
* Update tests

Bug: 58241
Change-Id: I3e15cc97e94747647078204a0b398e6ac3ec6382
2013-12-12 00:02:11 +00:00
Ed Sanders ba2636c787 Add recursion to removeHtmlAttribute
This is pretty straightforward because the htmlAttributes data
structure is so simple...

Change-Id: Ie46fcc0715c4aecb984e73dc81a5297673f2c3ea
2013-12-12 00:02:11 +00:00
Moriel Schottlender f1123f87f5 Render CE MWBlockImageNodes as styled <figure>s
This change is meant to transform the current block image node rendering
in ContentEditable from the nested <div> structure to a <figure> tag more
closely matching Parsoid's output, with CSS to style it the same. This is
mostly so we can work with and display attribute changes, like 'type' and
'alignment', without constantly destroying and rebuilding nested <div>
structures.

This change also includes all the attribute changes that will be called
when the media edit dialog changes image type, alignment, size, etc.

Node: The mw-classes 'thumb', 'thumbinner' and 'thumbcaption' are
preserved in the structure of the <figure> but CSS designers should note
these styles are no longer necessarily attached to <div> elements.

Bug: 53436
Change-Id: I40065acd9fd59d30f94b5336736d4986e8de15aa
2013-12-11 15:54:55 -08:00
James D. Forrester bd94ff92bb Initial re-styling of the toolbar
Move all text styles, and the remove styles button, into a new 'list' toolbar
group, using the text-styles icon. Less-used text styles (strikethrough, code
and underline) are demoted, with remove styles at the end, and bold and italic
promoted.

Now re-label the "More" catch-all to now be "Insert", which is what's left.

Change-Id: I66a1bba347ea64e540106b1090995b3117a8b1b2
2013-12-11 23:41:12 +00:00
Kyle Florence 638e4f65b6 Make commands aware of their symbolic names
This introduces a small reorginization of how commands are registered so
that they are associated with their corresponding symbolic names.
This change is mainly to aid with event tracking, but it might be
generally useful for other things as well.

Change-Id: I2ccf4522f786a54c1f5395008b7b0333a1fa6072
2013-12-11 15:34:20 -08:00
jenkins-bot 1fb7446738 Merge "Re-label the formula inspector to not be LaTeX" 2013-12-11 23:12:01 +00:00
jenkins-bot 9489984127 Merge "Strip empty spans after style attributes have been removed" 2013-12-11 23:11:00 +00:00
Ed Sanders dc5269f249 Strip empty spans after style attributes have been removed
We already do this for removeHtmlAttributes mode.

Add tests in ElementLinearData and ce.Surface. Get rid of unused
clipboardHtml param in ce.Surface tests as it is unused and replace
with clipboardKey flag which tests the VE->VE paste path.

Change-Id: I0cd82a37d6e765ecab489dc22f642ebbcfbb5387
2013-12-11 23:01:23 +00:00
jenkins-bot 67dad75ddd Merge "Format MW example HTML" 2013-12-11 22:28:31 +00:00
jenkins-bot 5009eaed5b Merge "Move removeHtmlAttribute into ve.dm.Model" 2013-12-11 22:27:20 +00:00
Ed Sanders 0da40d1c09 Format MW example HTML
For readability

Change-Id: I7e58fd71a0a34e2e11bf93b1f088e4c87795b748
2013-12-11 22:03:15 +00:00
Ed Sanders a1c1016bae Move removeHtmlAttribute into ve.dm.Model
Make available only as a static method so you don't accidentally
change a node without using a transaction.

Change-Id: If27442b502ec176a58e75ef4f9afa5119d06dcc5
2013-12-11 22:02:36 +00:00
James D. Forrester 68d077fa70 Re-label the formula inspector to not be LaTeX
Because users like to understand labels.

Bug: 53251
Change-Id: Iab24371161f278f07e516478a864d957859c32ae
2013-12-11 13:05:27 -08:00
Translation updater bot 942946cec1 Merge "Localisation updates from https://translatewiki.net." 2013-12-11 20:31:05 +00:00
Translation updater bot f6c5722b1f Localisation updates from https://translatewiki.net.
Change-Id: Ia3cd64ae99a564324c09a134eb32aacbbf269e75
2013-12-11 20:29:53 +00:00
jenkins-bot 04c9f79834 Merge "Don't select nodes inserted by a dialog, but drop cursor after" 2013-12-11 20:25:50 +00:00
Roan Kattouw 970cf03cc8 Followup 5d7673eb: still adjust width/height when positioning fails
ve.ui.Context#updateDimensions does two things: it updates the position
of the popup by measuring where the selection is, and it updates the
width and height of the popup by measuring the contents of the inspector
or the context menu.

In some cases, measuring where the selection is fails, and
ve.ce.Surface#getSelectionRect returns null. This seems to only happen
1) in phantomjs while running the test suite and 2) when an inspector
is opened and doesn't adjust the selection while opening. I suspect
it has something to do with the selection not having been recently
set or the documentNode not having focus, but I haven't investigated
this in depth yet.

Prior to 5d7673eb, the editor would simply crash of the position
measurement failed. 5d7673eb changed this to just bail completely if
the position couldn't be measured, but that's also wrong. Without a
position measurement, we can't update the position of the popup, but
we can still adjust its width and height, and we should.

The failure to adjust the popup's width and height in this case was
causing a bug where opening the link inspector with the selection
set exactly to what the inspector would expand it to would cause the
popup's width and height to never be adjusted, and most of the inspector
to be invisible.

Bug: 58301
Change-Id: Ia6504e0a7b0cd1affbff2632e9f573684f1d5dcb
2013-12-11 19:54:44 +00:00
jenkins-bot 447fcb94c7 Merge "Add language code to language dialog" 2013-12-11 19:38:14 +00:00
Ed Sanders 60262b883e Move resetting of paste state variables to after afterPaste
So that if the function bails with a return they are still run.

Bug: 58346
Change-Id: Ibd0f194e9c31e2b023dbd00a13ade51785f78ae6
2013-12-11 19:22:42 +00:00
Ed Sanders a38b1d9420 Allow tables to contain captions!
Captions were not in the allowed lists of children for tables.
This causes an exception to be thrown if you try to do fixUpInsertion
on a transaction containing captions.

Bug: 58318
Change-Id: I866e015c14e787830c45da93dfed9d2119fb0865
2013-12-11 15:42:09 +00:00
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 286f2b1581 Merge "Rename big/small stack to undoStack & newTransactions" 2013-12-11 02:41:28 +00:00
jenkins-bot cc65c7a704 Merge "Text style icon" 2013-12-11 01:46:50 +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
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
Roan Kattouw 96000558a2 Don't select nodes inserted by a dialog, but drop cursor after
It used to be that when you closed a dialog, the thing that the dialog
inspected or inserted would be selected. For insertions, the selection
will now be collapsed immediately after the inserted node.
For modifications, the original behavior was kept, as it makes sense to
keep selecting the node that the user had to select in order to access
the dialog. For removals (only possible in the transclusion dialog),
the selection ends up as a collapsed selection at the location where
the removed node used to be; this was already behaving correctly,
as we get this behavior for free with offset translation.

Bug: 54957
Change-Id: Ibd14e8084d67a9ee85e3bac075c3fb50f27b05b2
2013-12-09 18:02:18 -08: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 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
Ed Sanders d6ca977397 Rename big/small stack to undoStack & newTransactions
Becuase big/small stack doesn't really mean anything.
Bonus: rename the transactions property of the stack item from
'stack' to 'transactions'.

Bug: 49754
Change-Id: I361dda49f4c1e58a541df5b9e478cf20957939a1
2013-12-08 20:25:53 +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
Ed Sanders 9d83d4e4a1 Text style icon
Change-Id: I63befa2fcbfcdc4dbdf81e4c31296d12b6508591
2013-12-06 22:41:13 +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
Moriel Schottlender cf237b882e Insert special character tool
A tool to add special characters and diacritics to text.

Also added a new button type ve.ui.GroupButtonWidget that includes a
group of PushButtonWidget objects and returna the individual button's
value upon click

Wikis can edit <visualeditor-specialcharinspector-characterlist-insert>,
a JSON string, to include their own desird special characters to insert
through the tool.

Bug: 50296
Change-Id: I26d1f437feef1c8b61ed3be5f74ef524b33baf49
2013-12-05 22:51:14 -08:00
jenkins-bot d17e031d46 Merge "Revert "Remove dual-type support for Languages and Categories"" 2013-12-06 04:03:10 +00:00
Jforrester d8dcafe25b Revert "Remove dual-type support for Languages and Categories"
'Cos Parsoid caches things for ages.

This reverts commit 114a24f1d3.

Change-Id: I8b2f4d982becea36ddc06b29b3a48660fa0f3a44
2013-12-06 04:01:00 +00:00
James D. Forrester d0ba27fd1f Only remove and insert a Category if it's changed
The CategoryPopupWidget's popupClose() method was checking for the
category having changed by comparing its sort key value to the existing
one, but it failed to account that null !== ''.

Change-Id: Idb6a84dc32706d90dea70dceb0b9b3a26ed70110
2013-12-06 01:42:49 +00:00
jenkins-bot 674236cab4 Merge changes I51e74b32,Ibaa14d20
* changes:
  Refactor Transclusion and Meta dialogs to use BookletLayout
  Update OOJS UI to v0.1.0-pre (592e1d6401)
2013-12-06 00:48:41 +00:00
jenkins-bot 28482f85ac Merge "Special character icon" 2013-12-06 00:45:31 +00:00
Ed Sanders 9cb6bf9f53 Special character icon
Change-Id: I779ebf3dc30bf40514be0380a24ba72ee86a5524
2013-12-05 19:05:56 -08:00
Trevor Parscal 51e096d6f2 Refactor Transclusion and Meta dialogs to use BookletLayout
Use OOJS-UI's newly-extended paged dialogs (in e08eb2a03b) to refactor
how the Transclusion and Meta dialogs work, splitting out the code for
each of the panels into its own file and simplifying extensibility.

The Meta dialog (ve.ui.MWMetaDialog) now has two self-managing panels:
* ve.ui.MWCategoriesPage for categories and the default sort key
* ve.ui.MWLanguagesPage for language links

The Transclusion dialog (ve.ui.MWTransclusionDialog) now has four:
* ve.ui.MWTemplatePage for a template's primary panel
* ve.ui.MWTemplateParameterPage for each parameter of a template
* ve.ui.MWTemplatePlaceholderPage for a placeholder to insert a template
* ve.ui.MWTransclusionContentPage for non-template transclusion

Additionally, the Transclusion dialog has been slightly cleaned up:
* Replace add/remove events with replace events in transclusion model
* Actually return and resolve a promise (as documented)
* Get rid of "origin" info in template models
* Add method for adding required parts

TODO:

* Decide how and when we will choose between advanced transclusion and
  template dialogs
* Work out design issues with how template descriptions will be visible
  and how adding parameters will work if only showing parameters in
  outline
* Add preview to template dialog
* Consider ways to further improve pages for use in continuous mode

WARNING:

* Right now the template dialog gets overridden by the advanced
  transclusion dialog because they have the same symbolic name and the
  latter is registered later than the former. To test the template
  dialog, just change the symbolic name of the advanced transclusion
  dialog.

Change-Id: I51e74b322aec9a4c3918e6f792bdb3d318060979
2013-12-05 16:26:26 -08:00
Trevor Parscal 49d108003d Update OOJS UI to v0.1.0-pre (592e1d6401)
Change-Id: Ibaa14d20af212987e9abf5bf12668992e5a80da2
2013-12-05 16:06:46 -08:00
jenkins-bot 68ad762613 Merge "Remove dual-type support for Languages and Categories" 2013-12-05 23:01:32 +00:00
jenkins-bot 9205d81c56 Merge "Merge getDataFromDom and getModelFromDom" 2013-12-05 22:58:37 +00:00
jenkins-bot b8a3b4a3cb Merge "Separate data/metadata split and node tree loops" 2013-12-05 22:01:26 +00:00
Ed Sanders 3c66a297c9 Merge getDataFromDom and getModelFromDom
Now getDataFromDom is no longer called externally, we can merge these two
methods to provide one API endpoint. Also now we have deleted getDataFromDom
we can remove the 'Recursion' disambiguator from the internal function.

Also now that the whitespace info doesn't need to be passed around, implement
it as a simple return value get function.

Change-Id: I9c667e9b90443d12660b731347d7535ccb1a17cd
2013-12-05 21:54:08 +00:00
Ed Sanders 25a6e93ef2 Separate data/metadata split and node tree loops
It's not much of an optimisation to combine these loops but
separating them gives us greater flexibility.

Move the building of the node tree to happen lazily when
getDocumentNode is called.

In the rich paste path we can now create the DM without building
the node tree and remove the metadata.

Change-Id: I10b4bc486ff8ff8037158aa6dfd45aac87557d42
2013-12-05 21:30:04 +00:00
jenkins-bot 2554487f41 Merge "Prevent content selections ending up inside handlesOwnChildren nodes" 2013-12-05 18:02:43 +00:00
mayankmadan 306665fa72 [browser test] Changed readme file so that it points to mediawiki-selenium
Bug: 56089
Change-Id: Ia0f5d0a36337d883c4066a866aada98d849b8315
2013-12-05 17:52:58 +00:00
jhall 02ae003f2b [Browser test] Removing hard-coded MEDIAWIKI_USER value
Per this QA mail list discussion:
http://lists.wikimedia.org/pipermail/qa/2013-December/000799.html

Change-Id: Ide3bafe9b69eb5769eb99d0a3989d0e909f512ea
2013-12-05 16:56:29 +00:00
Ed Sanders 62e9b6a939 Prevent content selections ending up inside handlesOwnChildren nodes
The delete logic sees the caption inside the image as a valid place to
put a cursor and therefore a valid range to delete up to. This means
paragraphs can be merged into image captions by backspacing them in.

Add in a flag that keeps track of whether we are in a handlesOwnChildren
node so we can skip over them.

Bug: 57927
Change-Id: I19e91d2d3a871806d207cbd419f4a45e41d69dc0
2013-12-05 16:45:28 +00:00
jenkins-bot 11cd6fab6b Merge "Don't strip HTML attributes from inspected links" 2013-12-05 15:28:40 +00:00
James D. Forrester 114a24f1d3 Remove dual-type support for Languages and Categories
The new form was implemented in Parsoid and deployed in October, so enough time
has passed that there is no longer any need for VisualEditor to support the old
type.

Bug: 56009
Change-Id: Ief2e584345ccdb0e7eb44ab16c4bc14f7c14f5ec
2013-12-04 18:49:48 -08:00
jenkins-bot d2c74b18a7 Merge "Revert "Update OOJS UI to v0.1.0-pre (d047752ccc)"" 2013-12-05 02:04:59 +00:00
Catrope 2a4ba14862 Revert "Update OOJS UI to v0.1.0-pre (d047752ccc)"
Still broken, this time because PagedOutlineLayout / BookletLayout
usage wasn't updated.

This reverts commit c6cfe763bb.

Change-Id: If0d37d396ecf3bb09f026d4432c5d7e30f040085
2013-12-05 02:03:00 +00:00
Ed Sanders e01e2e045b Always use #getDocumentNode.
Because if you only sometimes use a getter you're just wasting your time!

Change-Id: Idd38976f77b58e322d527cecca9f9c36e3ad9318
2013-12-04 22:55:26 +00:00
Ed Sanders 6d34e344ee getDataFromDom -> getModelFromDom
Following on from getDomFromModel, this returns a document model
instead of element linear data. The only instance that hasn't been
replaced is in rich paste, where we need to sanitize the converted
data before constructing the document model.

This should be cleaned up in a later commit.

Change-Id: I37a2b641632af2cb515e3409deed5cd1fa358af5
2013-12-04 14:46:34 -08:00
Roan Kattouw c8608fd7bc Remove duplicate method setUpSurface from ViewPageTarget
Was already implemented in the parent class. Moved setPasteRules() so it
would still get run, everything else had already been moved.

Change-Id: I55ef2622c9eacc8b46bd3487919165bccfc347d5
2013-12-04 22:43:47 +00:00
jenkins-bot 4fe0bc5b80 Merge "Change signature of getDomFromData and rename" 2013-12-04 22:03:43 +00:00
Timo Tijhof 68cf65844e jscs: "var\t" -> "var "
Only 2 hits.

Change-Id: Ie8c5c39a49f620891bae8582dcc0d2f151e50e21
2013-12-04 21:06:19 +01:00
jenkins-bot aff527a20b Merge "Update OOJS UI to v0.1.0-pre (d047752ccc)" 2013-12-04 19:28:24 +00:00
Roan Kattouw b3eb415e37 Remove ooui-inspector-* messages
Move existing uses over to the already existing visualeditor-inspector-*
messages.

Change-Id: I6da7f3d61256d1c2b4c1f9583da8bc59a2d7473d
2013-12-04 19:04:51 +00:00
Timo Tijhof c6cfe763bb Update OOJS UI to v0.1.0-pre (d047752ccc)
Also, as OOjs UI's StackPanelLayout was renamed to StackLayout, and the
showItem() function to setItem(), fix uses in VisualEditor.

Change-Id: If153e5e7c3a7c60e3d62e20aac8fabd4eaaa73c2
2013-12-04 08:53:53 -08:00
Ed Sanders 86922f8ca8 Change signature of getDomFromData and rename
Currently it takes 4 arguments which are all properties
of the document model, so just pass the model instead and
access the properties later. Rename to getDomFromModel.

Change-Id: I0c378a04dc08b9b90bdc3984f8fa8c4acfe0b667
2013-12-04 16:30:40 +00:00
jenkins-bot f0c1bd28f5 Merge "Revert "Update OOJS UI to v0.1.0-pre (d047752ccc)"" 2013-12-04 16:27:13 +00:00
Jforrester b327268e0d Revert "Update OOJS UI to v0.1.0-pre (d047752ccc)"
This reverts commit 32e0850507.

Change-Id: I429b6e6172cb58ded5cad3cf63e8437a9d26ffd5
2013-12-04 16:20:59 +00:00
jhall 1b847c44dd [Browser test] Restoring a missing page element
Earlier check-in for a VE media interface test
inadvertently re-named a page element that
should not have changed.

Change-Id: Iac1ef365e9cb3912977c8a89f3158ad9d122c93d
2013-12-04 16:03:15 +00:00
jenkins-bot 12d2210cb3 Merge "[Browser tests] Prefer double-quoted strings in Ruby code" 2013-12-04 12:17:01 +00:00
jenkins-bot 0b726589bd Merge "Fix spurious MetaList events" 2013-12-04 11:41:30 +00:00
Timo Tijhof 32e0850507 Update OOJS UI to v0.1.0-pre (d047752ccc)
Change-Id: Ic8e5e8176b35be702ad7a995918fc746f8b1176d
2013-12-04 04:04:13 +01:00
Moriel Schottlender 87fd3b7756 Add direction classes to Toolbar based on context
Add rtl/ltr-related classes to the toolbar based on cursor context, so
certain icons can change based on inline and block directions.

Change-Id: I1b6e450226bf8da820fb622f28c1c3062c534bb0
2013-12-03 15:24:54 -08:00
jhall 73198b52d0 [Browser test] New test for VE media interface
Updated to capture changed iframe positioning of some page controls.

Change-Id: I3864e04935eca1ae7c9d70df42fd34ce58e90d66
2013-12-03 23:12:57 +00:00
Roan Kattouw 39eea83698 Fix spurious MetaList events
Moving items around in the MetaList only works if all deletions are
done before all insertions. This was almost but not completely true:
when moving an existing item we would delete it and immediately re-
insert it, meaning that if there were multiple items being moved
there would be a removal after an insertion.

Instead, let the insertion loop re-insert the moved items while
making sure not to emit insert events for them. This is how I
originally intended the code to be structured, but I thought that
duplicating the insertion would be equivalent to protecting the
emission of the insertion event. Clearly I was wrong.

This fixes weird bugs where categories sometimes appeared twice
in the category dialog depending on where the category was in
the list and what the exact length of the list was (i.e., whether
the binary search in the MetaList found the first or second item
with identical offset and index).

Change-Id: I4cd131052dda396add7a0e2dbe2383bb5c1b5721
2013-12-03 22:48:50 +00:00
James D. Forrester a0065cbe0b Fix naked request for save dialog's summary in save
Sometimes a save is not a save, but a switch to the wikitext editor; in this
case, the save dialog doesn't exist, so don't assume that it does.

Bug: 57947
Change-Id: Ic2df7d2066ba03564ed531e1d31351cd27441abe
2013-12-03 14:35:55 -08:00
Timo Tijhof 31e6950af0 Fix csslint warnings
Also:
* Added modules/syntaxhighlight to csslintignore because
  it is broken right now, so it's hard to fix those warnings
  without being able to verify it.
* Fixed a typo in the grunt-watch config that accessed an
  inexistent property.

Change-Id: Ib81572506786b6a1203c454d1b2b91bb6ae2a3de
2013-12-03 23:09:56 +01:00
jenkins-bot bbba628f3c Merge "Close inspectors when surface is focused but selection doesn't change" 2013-12-03 21:39:23 +00:00
jenkins-bot 9c3610afb3 Merge "Clear cache key when deactivating target" 2013-12-03 18:24:28 +00:00
jenkins-bot 5cc0706067 Merge "Move activating/deactivating to ViewPageTarget" 2013-12-03 18:21:55 +00:00
jenkins-bot b5f04fe9e0 Merge "Use a global resizing flag on the surface to hide phantoms" 2013-12-03 03:22:56 +00:00
jenkins-bot 334bb899be Merge "Pressing enter in a list with no nearby content creates a paragraph" 2013-12-03 03:07:19 +00:00
jenkins-bot 76e3d9ec89 Merge "ve.ce.Surface.handleEnter tests" 2013-12-03 03:03:35 +00:00
jenkins-bot ad2fac3f92 Merge "Genericise runSurfaceHandleDeleteTest to work with other 'handle' methods" 2013-12-03 02:59:09 +00:00
Roan Kattouw 75449ea597 Clear cache key when deactivating target
And other state too, while we're at it.

Bug: 57905
Change-Id: Ifd2744c841f302764cf57c13f4a760cbe80fa2e0
2013-12-02 18:52:47 -08:00
Roan Kattouw 9dc891f4cb Move activating/deactivating to ViewPageTarget
That's where they belong IMO, since ViewPageTarget is the one that
has .activate() and .deactivate(), and mw.Target doesn't retain any
state (apart from some caching things).

Change-Id: Ia6cf5bac9054163d54ab492d691d8ce9d6a3bb90
2013-12-02 18:21:31 -08:00
jenkins-bot 164a262aeb Merge changes I8c8b2d49,If2124c68,I786b63ab
* changes:
  Split apart onSaveError logic for other mw targets
  mw.ViewPageTarget: Remove unused onTokenError handler covered in onSaveError
  Create base MobileView config and target refactor
2013-12-03 02:11:57 +00:00
Rob Moen db970a61fc Split apart onSaveError logic for other mw targets
Change-Id: I8c8b2d4900b511a65cff4c554cf7ef89d6d39ea9
2013-12-02 18:04:29 -08:00
Rob Moen a701e87caa mw.ViewPageTarget: Remove unused onTokenError handler covered in onSaveError
Change-Id: If2124c68aab0d313f4ddd698014d2a4296bbabb8
2013-12-03 02:02:03 +00:00
Rob Moen f1fa56165d Create base MobileView config and target refactor
Changes include:
* Target mobile for ve dependencies
* Create mobile view constructor
** Some tools like dialogs are excluded for now
* Refactor mw.target to permit code reuse
** Split out pageTarget view functionality from core init methods

Change-Id: I786b63ab57518fc6af7761501259ed66592f70e3
2013-12-02 17:59:27 -08:00
Roan Kattouw da4995888b Close inspectors when surface is focused but selection doesn't change
It's possible for the user to put the cursor back from the inspector
in the surface without triggering a selection change, if the selection
was collapsed and they clicked in exactly the right spot.
In practice, this can happen if the link inspector is open in creation
mode and the user clicks to drop the cursor at the same position where
it was when the inspector was opened.

When this happens, the inspector wouldn't close, because it only closed
in response to selection changes. If the user then typed something,
weird things would happen.

To prevent this state (cursor is in surface but inspector is open) from
occurring, close the inspector and hide the context when the document is
focused. This fixes the link inspector creation mode issue, and it also
causes the link inspector to no longer briefly remain visible after the
user has clicked out of it.

Bug: 56976
Change-Id: Ib70fc13031873009a175e4b049a07694a87ce25d
2013-12-02 23:52:54 +00:00
jenkins-bot c06316eb64 Merge "Make veaction=edit work regardless of user preference" 2013-12-02 23:43:52 +00:00
jenkins-bot 4c54865134 Merge "Re-order command registry to match toolbar order" 2013-12-02 22:51:52 +00:00
jenkins-bot 5ca96e805f Merge changes I177877bf,I49a02b5d
* changes:
  Use visibility: hidden; for the ui.Context and its popup
  Followup eb95d7b0b2: don't hide the inspectors WindowSet at all
2013-12-02 21:18:55 +00:00
jenkins-bot e223156d06 Merge "Fix JS errors when inserting references" 2013-12-02 21:15:32 +00:00
Roan Kattouw 1df63b8a63 Use visibility: hidden; for the ui.Context and its popup
They contain iframes and those need to not be display: none;
in order to make Firefox happy.

Bug: 57568
Change-Id: I177877bff3c3b18bfc87ee4e6afa7e60fea26ffc
2013-12-02 13:03:06 -08:00
Roan Kattouw 07671c6b53 Followup eb95d7b0b2: don't hide the inspectors WindowSet at all
There's no point in hiding the WindowSet if we've already closed the
open window in it. In fact, there's no point in hiding a WindowSet
pretty much ever.

Change-Id: I49a02b5d255b266eb9e0a537cb64082eb0ad5e4b
2013-12-02 12:29:33 -08:00
Roan Kattouw f8ff2023c3 Fix JS errors when inserting references
ve.ui.MWReferenceDialog.prototype.teardown:
* Pass ranges rather than nodes to transaction builders
* Don't do a removal in insertion mode, we know the removal range
  will be empty

ve.dm.Transaction.newFromDocumentInsertion:
* Correctly splice the edited internalItem into listData in the case
  that newDoc isn't a document slice of doc
* Rename range to spliceItemRange for clarity
* Introduce spliceListNodeRange and set it to either newDoc's
  listNodeRange or doc's depending on whether newDoc is a slice of doc

Bug: 57683
Change-Id: Iae7de7701ae86bed89b707038407243d82249e1a
2013-12-02 11:35:00 -08:00
jenkins-bot 8c1f58979e Merge "Use visibility: hidden; to hide inspectors" 2013-12-02 19:26:07 +00:00
Roan Kattouw eb95d7b0b2 Use visibility: hidden; to hide inspectors
Using display: none; on the inspectors WindowSet causes Firefox to
neglect to load CSS in the inspectors' iframes, which means the frame
never initializes and the inspector never opens.

Bug: 57568
Change-Id: Ia1a0ce78754fa1318a7d439abe1f0e2f86420e7a
2013-12-02 10:42:31 -08:00
jenkins-bot 649c1aeb9e Merge "Add focus and blur events to ce.Surface" 2013-12-02 18:35:39 +00:00
Ed Sanders 456c97d912 Pressing enter in a list with no nearby content creates a paragraph
Currently we assume getNearestContentOffset will give us something
sane however it can return -1 when there is no nearby content and so
an exception is thrown. In this case we have to create an empty
paragraph to place the cursor in.

Change-Id: Ic6c19da881e47ff6be45cdaa4b71bfcc1c654796
2013-12-02 15:57:43 +00:00
Ed Sanders 519e54d463 ve.ce.Surface.handleEnter tests
Change-Id: Ic30cd4e116029be85822f73dcb84938e641bc4b9
2013-12-02 15:57:41 +00:00
Ed Sanders 96e2313e6e Genericise runSurfaceHandleDeleteTest to work with other 'handle' methods
We will want to reuse this test runner for handleEnter and handleInsertion.

Change-Id: I7489bf2d20fa17b1c164ff20e0cfcd9b9d5102d2
2013-12-02 15:52:44 +00:00
Ed Sanders 76091d4474 Re-order command registry to match toolbar order
Bonus: fix grammar in DialogAction comment.

Change-Id: I0fdf5f028f7191b0d662456ec1506490d7439a1a
2013-12-02 14:18:03 +00:00
jenkins-bot 97adcc2103 Merge "Tear down the save dialog and remove it from memory on surface teardown" 2013-12-01 22:23:06 +00:00
Ed Sanders 7982ecf2c3 Render MW extension node wikitext with XML
MW extensions are XML not HTML, so we shouldn't build them as XML
to prevent HTML specific rules being applied, such as <source>
always being self closing.

Bug: 54577
Change-Id: I84af4a29cd1c4ae4d1db4f70a4012a8ad0f98bf6
2013-12-01 17:13:39 +00:00
jenkins-bot 2cf336b958 Merge changes Icb404af8,Ib6efc2a5,I6d48f8ee
* changes:
  Make autonumbered external links inspectable
  Always remove the annotation when the remove button is clicked
  Add abstract getAnnotation() method to AnnotationInspector
2013-11-30 08:58:09 +00:00
Roan Kattouw 93b645a453 Make autonumbered external links inspectable
When the target of an autonumbered link is changed to a URL, it's kept
as an autonumbered link and its target is updated. When the target is
changed to a MediaWiki page, the autonumbered link is removed and
replaced with an internal link with the text set to the target.
So for instance, if you inspect [http://www.example.com] and change
its target to "Foo", the result will be [[Foo]].

The core of this commit adds support for inspecting nodes to
ve.ui.LinkInspector. This support should probably move into a
class in between AnnotationInspector and LinkInspector, perhaps
called HybridInspector or something, but I'm deferring that for now.

LinkInspector allows changes to inspected nodes to be reflected either
as attribute changes on the node, or by replacing the node with something
else. MWLinkInspector uses this feature to replace the autonumbered
external link node with an internal link annotation when the target is
set to an external link.

Bug: 53505
Change-Id: Icb404af84c24574438e4de3ef05bbd1993b593f7
2013-11-30 00:14:41 -08:00
Roan Kattouw dd6d225ed7 Don't strip HTML attributes from inspected links
When you inspect a link, then close the inspector immediately,
nothing should change. However, AnnotationInspector was comparing
the generated annotation and the existing annotation by hash, and so
would consider an annotation with htmlAttributes different from
one without. This meant that inspecting a Parsoid-generated link
and then closing the inspector would cause a transaction to be
processed that removes the htmlAttributes from the annotation.

I believe a similar issue also existed for annotations with attributes
like origTitle and hrefPrefix, although I didn't reproduce this.

The fix is to have AnnotationInspector compare annotations by the
hash of their comparableObjects, rather than their hashObjects.

Change-Id: I848ffc2b7e7b2c67754a0ece3af105ffafa837ec
2013-11-27 22:54:21 +00:00
Roan Kattouw 8739772531 Add focus and blur events to ce.Surface
Didn't bother to deduplicate blur-focus event pairs that occur when the
focus moves from the documentNode to the pasteTarget or vice versa
(this happens when switching between normal selection and FocusableNode
selection).

Change-Id: If1ccd2fbf11de956b6c2364ae81b9dc20a1bf409
2013-11-27 21:56:34 +00:00
cmcmahon c65a683ecf [browser test] more shuffling of elements among iframes
Change-Id: I1a60e2370fc436702d983705d7360563f5483242
2013-11-27 09:05:58 -07:00
Roan Kattouw e41cb61814 Always remove the annotation when the remove button is clicked
Remove weird check that prevented a removal from happening if the
subclass's getAnnotation() method returned null.

This caused a bug where if you inspected a link, typed an invalid
link target (e.g. '|'), then clicked the remove button (trash can icon),
the inspector would close but the link wouldn't be removed.
However, if you typed something that was a valid link target (or didn't
touch the input at all), the remove button would work as expected.

Change-Id: Ib6efc2a5827b109c6b38185e6d89b7bb29b13a75
2013-11-27 14:55:33 +00:00
Roan Kattouw 0fe4a7778e Add abstract getAnnotation() method to AnnotationInspector
It was relied on, and all subclasses had one, but for some reason
it wasn't defined as an abstract method.

Change-Id: I6d48f8ee666bd339be87744840c6edb4abb56dbf
2013-11-27 14:52:18 +00:00
Ed Sanders 5b9231d49d Tear down the save dialog and remove it from memory on surface teardown
Otherwise the old save dialog will still be around if the user sets up
another surface (e.g. a second edit), but won't be attached to the DOM.

Bug: 57654
Change-Id: I23c10849a212534bdd0600637d8ad4fa3ebc4fb7
2013-11-27 14:00:16 +00:00
mayankmadan 2af79b6108 [Browser tests] Prefer double-quoted strings in Ruby code
Bug: 57597
Change-Id: I4ddc3f20d03bf3e66b04234be529c3eaa29be9e0
2013-11-27 16:01:23 +05:30
cmcmahon 0a091193f9 [browser test] elements moved among iframes
Change-Id: Icc9f3f4422dfed063073724f8b610e75fd967b2d
2013-11-26 18:55:21 -07:00
Timo Tijhof c852bf6000 ve.js: Coding style fixup for 6f2090aac6
Change-Id: I5ef9d590b5cc573df64f1c9099c79207c471cfb6
2013-11-26 23:00:24 +00:00
jenkins-bot 91f00b0eaf Merge "Revert model to use simple UTF-16 code units" 2013-11-26 22:53:06 +00:00
jenkins-bot af9e6dd263 Merge "mw.ViewPageTarget: Use ve-activated class on the html element" 2013-11-26 22:52:14 +00:00
jenkins-bot c18534bcad Merge changes If814e178,Id133431e,I38d63e31,I16d575b6
* changes:
  Plain text paste with paste special
  Use rare unicode characters for paste placeholders
  Rich paste
  Add fixUpInsertion to newFromDocumentReplace
2013-11-26 21:07:46 +00:00
Rob Moen b37fbf9ba9 mw.ViewPageTarget: Use ve-activated class on the html element
This allows things outside of VisualEditor to style themselves
differently while the editor is active.

Bug: 57555
Change-Id: Ief6b5f53096dd5eeb43a72a7bb182a2c04ec97ca
2013-11-26 20:41:27 +00:00
jenkins-bot 3b63e332b5 Merge "Also apply autonumbering CSS to links in generated content" 2013-11-26 20:13:24 +00:00
jenkins-bot 29d33c4528 Merge "Fix moving over an image with the arrow keys in Firefox" 2013-11-26 19:51:27 +00:00
David Chan 6f2090aac6 Revert model to use simple UTF-16 code units
This is a prerequisite to browser-based grapheme cluster handling, which
is needed so left/right cursoring and backspace behave as users expect.

modules/ve/ve.js
modules/ve/ce/ve.ce.Document.js
modules/ve/ce/ve.ce.js
* Revert cluster-aware splitting to trivial javascript code unit splitting
* Rewrite ve.splitClusters as a trivial compatibility method (remove soon)
* getClusterOffset/getByteOffset use unicodeJS.graphemebreak.splitClusters

modules/unicodejs/tools/unicodejs-properties.py
modules/unicodejs/unicodejs.graphemebreakproperties.js
modules/unicodejs/unicodejs.js
* Allow grapheme break tests to work with surrogate pairs

demos/ve/pages/minimal.html
demos/ve/pages/multibyte.html
demos/ve/pages/unicode.html
* replace file with more precise tests

modules/ve/test/ve.test.js
* Remove reference to grapheme-based splitting (which is no longer used)
* Correct typo

Bug: 53757
Bug: 51472
Bug: 51596
Bug: 51846
Change-Id: Ife34c87ebe40bc1689298b592eec5c0cdc2f7589
2013-11-26 19:38:14 +00:00
Ed Sanders b1e6dfcda6 Plain text paste with paste special
Register ctrl/cmd+shift+v as a trigger which sets a flag for the
next paste event.

When the paste special flag is set, modify the sanitizeData method
to strip all annotations, and any elements other than paragraphs.

Bug: 53781
Change-Id: If814e1786ffa805b52ab32f4a06f52da743fd9af
2013-11-26 18:23:58 +00:00
Thalia 65aab78d3b Use rare unicode characters for paste placeholders
Helps with bug reporting, like the snowman and pawn.

Change-Id: Id133431eea987442c8b50a05821ebd54649b26b9
2013-11-26 18:23:58 +00:00
Ed Sanders 7cec9ae04a Rich paste
Allow pasting of rich (HTML) content.

ve.ce.Surface
* Use a sliced document clone for converting to DM HTML (copy)
* Add full context to pasteTarget before copying
* Add ve-pasteProtect class to spans to prevent them being dropped
* Implement external paste by converting HTML to data and inserting
  with newFromDocumentInsertion
* Remove clipboard key placeholder after read so they aren't picked
  up by rich paste. Hash no longer includes the placeholder.
* Detect the corruption of important spans and fallback to clipboard
  data HTML if available.

ve.dm.LinearData
* Add clone method for copy

ve.dm.ElementLinearData
* Add compareUnannotated for use by context diffing.
* Add sanitize method for cleaning data according to a set of rules.

ve.dm.Transaction
* Add range parameter for inserting a range of a document only,
  e.g. stripping the paste context.

ve.dm.Document
* Implement sliced document clone creation so that DM HTML
  is generated correctly in onCopy

ve.dm.DocumentSlice
* Replaces LinearDataSlice. Now has two ranges for balanced data
  and data with a full context.

ve.init.Target.js
* Define default, loose, paste rules (just remove aliens).

ve.init.mw.ViewPageTarget
* Define strict MW paste rules:
  + no links, spans, underlines
  + no images, divs, aliens
  + strip extra HTML attribues

ve.init.sa.Target, ve.init.mw.ViewPageTarget, ve.ui.Surface
* Pass through and store paste rules.

Bug: 41193
Bug: 48170
Bug: 50128
Bug: 53828
Change-Id: I38d63e31ee3e3ee11707e3fffed5174e1d633b42
2013-11-26 18:23:12 +00:00
Roan Kattouw 21c72a553a Fix moving over an image with the arrow keys in Firefox
There was a bug when you moved over an image with the arrow keys:
if your selection was on an image and you pressed an arrow key, the
selection would move but focus would remain with the paste target
rather than going back to the document node, which caused strange
symptoms (immobilizing the arrow keys and scrolling horizontally)
in Firefox.

Bug: 57600
Change-Id: Iaf6a49787dd2fd2f3f88abd0d1f5ae512fd3fd68
2013-11-26 17:09:30 +00:00
Roan Kattouw f4bb62b9d7 Also apply autonumbering CSS to links in generated content
We had CSS that applied to our rendering of autonumbered links,
but not for raw <a rel="mw:ExtLink"></a> tags appearing in
generated content like templates.

Bug: 57420
Change-Id: Ic1585ecb1a133d16b7393ce0ce38a11b76cc2239
2013-11-26 16:53:31 +00:00
Rob Moen 07464e20a5 Remove the toolbar tracker
We were using it for the pop-out save dialog, but now that the save
dialog is real dialog, we don't need it any more.

Change-Id: I72697b5502d5f3fd19f2369a754a62d614af715b
2013-11-26 13:37:50 +00:00
jenkins-bot ef7152ff91 Merge "Use InputWidget facilities in byte limit counter" 2013-11-26 13:21:18 +00:00
jenkins-bot bb983c88d4 Merge "Don't build out save dialog when initializing editor" 2013-11-26 12:13:49 +00:00
jenkins-bot 4bfe1885c3 Merge "Share code between conflict resolution and the edit source switch" 2013-11-26 10:42:15 +00:00
James D. Forrester 7ba9f24121 Make veaction=edit work regardless of user preference
Move the userPrefEnabled check out of isAvailable and instead check
it in-line with isAvailable for setting up the tabs with CSS, but
not for the veaction=edit function.

Bug: 55900
Change-Id: I23984e377ff3fc797e921546492b8c73a5101235
2013-11-26 09:46:42 +00:00
jenkins-bot ea5a28e487 Merge "Move setting of minor/watch defaults from MWSaveDialog to Target" 2013-11-25 17:38:20 +00:00
Roan Kattouw 620e0e21ef Use InputWidget facilities in byte limit counter
* Don't use setTimeout() within a change event, because change fires
  after the text has already changed
* Don't use .$input.val(), use .getValue() instead
* Don't use .placeholder()
** Reaching into .$input is bad
** Any use of .placeholder() is TextInputWidget's responsibility
** All browsers we support also support placeholder natively
* Remove .editSummaryByteLimit from ViewPageTarget, unused
* Remove ve.bind() wrapping, we already have var saveDialog = this;

Change-Id: I380575fec8d02d1191bfc1f3f235b94c64cd23b6
2013-11-25 17:23:35 +00:00
Roan Kattouw 080b4380fa Don't build out save dialog when initializing editor
The save dialog DOM is pretty big, so building it on demand
like every other dialog out there seems like a good idea.

Change-Id: I02077c3e45f01d3467d41616eb879bd1d608a82b
2013-11-25 17:23:29 +00:00
Roan Kattouw 35e20d954f Share code between conflict resolution and the edit source switch
Each used their own implementation of building a form and submitting it.
The edit source one wasn't passing in the oldid, which caused edit
conflicts.

Also introduced a separation between form fields (for the action=edit UI)
and API options, building one from the other.

Bug: 56835
Change-Id: I38547b4ba1827f4028a2255109cba2a57cd59e8a
2013-11-25 17:23:20 +00:00
Roan Kattouw 72b0d2a19c Move setting of minor/watch defaults from MWSaveDialog to Target
It looks like it also came from there originally, because it uses
this.pageExists which doesn't even exist in MWSaveDialog. This caused
all pages, even existing pages, to be watched when 'watchcreations'
was set.

This logic really belongs server-side, though.

Bug: 56206
Change-Id: Idf500383b27a93136dc0cfdd60a2e7b2607af95c
2013-11-25 17:20:29 +00:00
David Chan b4f4eeb4b6 Event Logger: collect IME functionality info
ve/ce/SurfaceObserver.js
* Do not setTimeout if frequency === null

demos/ve/eventLogger.html
* Standalone event logging script

ve/test/ce/imetests/*.js
* JSON event logs for various tests/browsers/IMEs

ve/test/ce/ve.ce.test.js
* Add an IME test

VisualEditor.hooks.php
* Add test files

Change-Id: I50e89d5a289f3fcb4fe2a6835a2ec96fb497242c
2013-11-25 16:56:09 +00:00
David Chan addd1d7b23 Test Surface with IME-like event sequences
* modules/ve/test/ce/ve.ce.TestRunner.js
Class to interact with the CE Surface and document in tests

* modules/ve/ve.EventSequencer.js
Wrap setTimeout/clearTimeout calls (for easy replacement in tests)

Change-Id: I2e2407e2b169ae77237c87bf8857b3026cc7efce
2013-11-25 16:49:49 +00:00
jenkins-bot 95358bb7a3 Merge "Consolidate edit section handling code in ViewPageTarget" 2013-11-25 13:47:20 +00:00
Roan Kattouw cf486e011a Consolidate edit section handling code in ViewPageTarget
Move generation of initial edit summary from setupSaveDialog() to
restoreEditSection().

This allows us to get rid of the properties tracking whether both
halves of the edit section handling had happened, because they're
now in the same method.

Moving setupSaveDialog() down so it runs after restoreEditSection();
this is needed for the communication via this.initialEditSummary
to work correctly.

Change-Id: I06a9c5cf5c752acea8a2ac25d0ffb6ac61cfe986
2013-11-25 13:40:05 +00:00
Roan Kattouw 9724bf939d Fix 1919fffc: forgot to add getInnerWhitespace() in one place
Change-Id: Ia90d671100ae445ef414c6aff7b27d078ba82ffc
2013-11-25 13:39:54 +00:00
Roan Kattouw 68426a948a Update OOJS UI to v0.1.0-pre (e5ef1e5b28)
Change-Id: I07c911756b6247d9d541841fb4bab3ac09b2d8d3
2013-11-25 10:47:49 +00:00
Roan Kattouw 1919fffc74 Use serialization cache in MW integration
Add prepareCacheKey() which submits HTML for serialization and saves
the resulting cache key, and tryWithPreparedCacheKey() which uses that
cache key (if available; if pending, it waits for it) for API requests.
Implemented save(), serialize() and showChanges() in terms of
tryWithPreparedCacheKey().

When opening the save dialog, run the conversion, cache it, and fire
off a prepareCacheKey(). Then use the cached conversion for save/diff/
serialize. This means we don't convert multiple times, and it causes
the prepared wikitext to be used.

Bug: 55979
Bug: 56011
Change-Id: I1d56fe88d312e9810a57d56a285ccdf4f1facf42
2013-11-22 16:50:16 +00:00
jenkins-bot 10702d9fa0 Merge "Fix crash in MWExtensionNode creation mode" 2013-11-22 15:05:42 +00:00
jenkins-bot ecfa59ae4a Merge "Fix icon opacities" 2013-11-22 13:50:06 +00:00
Ed Sanders 6f984ea98a Fix icon opacities
* parameter.svg had no opacity set
* replace.svg had a document opacity of 80% in addition to the normal 75%
* re-rendered parameter.png (syntaxhighlight doesn't have png's yet)

Change-Id: I9c990fefaf4f5a7536b884b92523408146d7b2c7
2013-11-22 13:47:20 +00:00
Roan Kattouw 1b7fa1cf74 Make save dialog ready for async initialization
initialize() is currently called synchronously, but once the CSS
transplantation code is fixed and it goes back to being async, that'll
cause problems.

* Add this.setupDeferred and use it to defer setupCheckboxes() until
  after initialization
* Move code populating the edit summary from ViewPageTarget into
  MWSaveDialog and use .setValue() rather than manipulating the
  TextInputWidget's DOM. Defer this until after init as well
* Move clearing of the diff from ViewPageTarget into MWSaveDialog,
  and don't connect it to the transact event at startup, only when
  we've actually shown a diff
* Remove swapPanel( 'save' ) from ViewPageTarget, instead do this
  on setup in the dialog itself

Bonus:
* Document events
* Get rid of onFooButtonClick handlers in favor of array syntax

Change-Id: Idcdae5e013340f4519db4387bab507e714d47941
2013-11-22 13:17:53 +00:00
jenkins-bot edc1146eaa Merge "ce.MWTransclusionNode: Don't pass token to parsefragment API" 2013-11-22 13:14:42 +00:00
Roan Kattouw 1f8d01b72e Fix crash in MWExtensionNode creation mode
We can't get the directionality from the focused node if there isn't one.

This doesn't add any logic to determine the directionality in creation
mode, filed https://bugzilla.wikimedia.org/show_bug.cgi?id=57421 for that.

Change-Id: I3ff8d48f19c7beef5e24b55712a26d86efa5812a
2013-11-22 13:03:02 +00:00
jenkins-bot 4f573a3ea2 Merge "Recompute auto-numbered reference listKeys when merging internalLists" 2013-11-20 11:33:15 +00:00
jenkins-bot 9093eff614 Merge "Fix reference to insertItem() in MetaList, was renamed to insertMeta()" 2013-11-20 11:31:37 +00:00
Ed Sanders 24a95b102d Add fixUpInsertion to newFromDocumentReplace
In order to do this we have to separate out the removal
operation from NDFR, so it becomes newFromDocumentInsertion
(again, although actually, for the first time). As NFDI is
an insertion we can just run fixUpInsertion on the data
part of it.

In order for the removal operation to be a proper removal
we have to allow metadata removal (the default is to merge it).

Change-Id: I16d575b61b9796e7e889f2c27cfe02b4a40b7639
2013-11-20 11:24:06 +00:00
Roan Kattouw cde3304864 Recompute auto-numbered reference listKeys when merging internalLists
This fixes some of the problems with pasting references.

It's a bit overzealous in that references get renumbered even when
replacing, which is unnecessary but doesn't actually have any
noticeable effect.

Unfortunately, the internal list state depends so much on the converter
having run that we now need to add yet another hack, to set the counter
to the appropriate value.

Change-Id: I3c6514ce600af4f4c037f419554d34b5a5c86a63
2013-11-20 16:50:48 +05:30
Roan Kattouw fd4495e2df Pass the mw.user directly into {{GENDER:}}
Apparently we can do that ^^

Change-Id: I646bc7df29ad2ae605148089a53f1b5b238dca22
2013-11-20 10:51:32 +00:00
jenkins-bot 137ca9d2d6 Merge "Store inner whitespace of the body and compare it on conversion" 2013-11-20 10:45:04 +00:00
Roan Kattouw 59f5ec86ae Clean up uses of 'this' in mw.ViewPageTarget
* Use 'this' instead of 'viewPage' in setupSaveDialog()
* Unwrap unnecessary .each() in restoreEditSection()

Change-Id: I45d0c9714d59e195d0c4413ed3dbe9cbabe45e9d
2013-11-20 05:33:38 +00:00
Timo Tijhof de979ff293 Replace raw oojs-ui files with v0.1.0-pre (0267100ab3)
Change-Id: I792bc0335269976ff29433227b6fa562a1026aeb
2013-11-20 10:27:48 +05:30
Jeff Hall c027af9e12 [Browser test] Expanding test with additional text markup types
Change-Id: I3141993f1527dfdeea66ac2a52ee7c8be384f198
2013-11-19 13:42:07 -08:00
jenkins-bot 457cbfdbe8 Merge "Prevent link-annotating MWReferences" 2013-11-19 11:01:40 +00:00
Ed Sanders f9d7129465 Prevent link-annotating MWReferences
As it isn't sensible wikitext.

Bug: 56250
Change-Id: I7ec03f87ad69645c2877ee7a399950f3967a1362
2013-11-19 10:58:20 +00:00
Timo Tijhof 8f9d184758 doc: Fix existing violations detected by JSDuck 5
* Fix invalid @param name (mixup of type and param name).
* Fix incorrect reliance on inferred name for ve.Range.
  @class uses the below function to guess its name, however
  if @property is encountered, the @class block ends. Thus
  it was indexed as a nameless class.
* Separate @property definitions because combining them like
  that doesn't work (it silently ignored everything after the
  first "from" property).

Also:
* Add some missing @static to static methods in ve.Range.
* Remove a few redundant @method while at it.

Change-Id: I8357c30711a4830af0b68b18350352c457a607f3
2013-11-19 16:10:25 +05:30
jenkins-bot f0982adf3b Merge "doc: Get rid of 'static' property container in jsduck index" 2013-11-19 10:28:23 +00:00
Timo Tijhof 4854d644ee doc: Get rid of 'static' property container in jsduck index
Us grouping the inheritable static properties that way is an
implementation detail that is polluting the index and makes
it harder to refer to individual identifiers.

It also causes problems under JSDuck 5 because that version is
more strict about defining properties (Foo.static.bar) of which
the parent is not defined in the index (Foo.static), we'd have
to add a sea of `@static @property {Object} this.static` all
over the place. Might as well hide this implementation detail
and just consider them static properties (just like we already
do for "private" properties).

Change-Id: Ibf2ebf7752aabc2b75b6ac6fa00e2284a181a600
2013-11-19 10:21:39 +00:00
Jeff Hall 583936f82f [Browser test] Add Review Changes workflow per reviewer comment
Change-Id: I50d0defb3c4f51f317a497d0f805859e961b8f7f
2013-11-19 10:28:26 +01:00
Rob Moen b1694c6535 Add inputFilter function to InputWidget
Change-Id: I6abc5281c70f01c26cfa181c37ed3240bda3eb3e
2013-11-19 13:41:03 +05:30
Rob Moen f496085017 Account for sanitization changes properly in InputWidget
setValue() doesn't do anything if this.value === value, but with
sanitization it's possible for that to be true while the value in
the DOM is out of sync and needs to be changed.

The fix is to check for this.value changing and the DOM changing
separately.

Change-Id: I5f571445f5729f5477902c155a4ee9588b7194a8
2013-11-19 08:06:05 +00:00
Roan Kattouw ef5f3ec054 Combine all the saveError.* track events
Instead just use saveError, and indicate the type of error in the data.

Change-Id: Ibc33b108c1f8f3aa0841ab7f0886a35d99525195
2013-11-19 11:02:52 +05:30
jenkins-bot 93164ba3b7 Merge "Only replace meta-data from dialog if it has changed" 2013-11-18 08:45:30 +00:00
James D. Forrester 74332f7a21 Only replace meta-data from dialog if it has changed
Previously we had a defaultSortKeyChanged value that lied - it was
possible for the value to be changed A -> B -> A by the user mid-
edit. However, the meta dialog assumed that defaultSortKeyChanged
wasn't lying, so blindly changed the meta item to the new value,
causing an unnecessary meta change if the user had done a no-op.

Now the value is renamed to defaultSortKeyTouched, and we actually
detect for content changes, and only change the meta item if a
change is actually needed (be that a removal, a replacement, or an
insertion).

Change-Id: I13022090bd7561a460a1151013e2b7d2a029f4dd
2013-11-18 14:13:15 +05:30
jenkins-bot 8fc7c8d336 Merge "Document the fact that ve.dm.MetaItem#replaceWith takes a plain object" 2013-11-18 08:42:21 +00:00
Roan Kattouw a60bdb8003 Document the fact that ve.dm.MetaItem#replaceWith takes a plain object
Also encourage callers to pass plain objects unless they know what
they're doing; it's almost always wrong to pass in a MetaItem.

Change-Id: I8e8ef8ac7f77ec9f929d797e467b9c9d1140d721
2013-11-18 14:07:05 +05:30
jenkins-bot 31496bac82 Merge "Fix whitespace issue that eluded me in c4b349db4" 2013-11-18 08:36:24 +00:00
Roan Kattouw e5e47afbba Fix whitespace issue that eluded me in c4b349db4
Change-Id: I5159a70929ac52fdc78b873f10853fa4420b992b
2013-11-18 13:58:44 +05:30
jenkins-bot 1fdf5f829c Merge "Guard against undefined listener arrays in EventSequencer" 2013-11-18 08:22:39 +00:00
David Chan c4b349db47 Guard against undefined listener arrays in EventSequencer
Change-Id: Ida3ba2eaf92cdacaf1ca1294905226fda05c0884
2013-11-18 13:47:09 +05:30
jenkins-bot 3b0c87f5e3 Merge "Make generic localization utility for lang code keyed objects" 2013-11-13 22:37:02 +00:00
Trevor Parscal 2d7f93bdb6 Make generic localization utility for lang code keyed objects
Utilize in OO.ui.IconedElement and ve.dm.TemplateSpecModel

Change-Id: I0883a73cb478d4f7509f61aebed2b2957ddb9ce8
2013-11-13 14:26:51 -08:00
cmcmahon 2d6864e19f [browser test] Additional UTF-8 editing test string
Change-Id: Iaf894043462e114e0845fc3016396ab4f51fa21b
2013-11-13 18:46:44 +00:00
Roan Kattouw 51f0add829 Fix reference to insertItem() in MetaList, was renamed to insertMeta()
Change-Id: I9c14568e43987ef5354995a0ea76f93ca8bff921
2013-11-12 18:08:08 -08:00
jenkins-bot 1fe57b4844 Merge "Add OO.ui.ToggleWidget" 2013-11-13 00:58:19 +00:00
jenkins-bot 3af8c56180 Merge "Make inspector tools active when content is inspectable" 2013-11-13 00:57:24 +00:00
jenkins-bot f61227fc3c Merge "Make tools disable correctly" 2013-11-13 00:54:38 +00:00
Trevor Parscal 3dcba7679a Add OO.ui.ToggleWidget
Compact toggle widget with short labels for on/off states.

Change-Id: I582e81126d5f1564302409c1b262e28e4a9505ac
2013-11-12 16:54:35 -08:00
Trevor Parscal 9429f4c225 Make inspector tools active when content is inspectable
This was a regression that occurred when the toolbar was refactored
recently. The correct and previous behavior was if the cursor is in a
location where the context would show an inspector tool, that inspector
tool should be active in the toolbar.

Change-Id: I8ac2b1bd21b843db30e3e9f951702378007e139a
2013-11-13 00:54:28 +00:00
cmcmahon d2165ad8fb [browser test] identifier for Link close element changed
Change-Id: Ia923c775315af9f0cd7017e0b02e621b3d9112b4
2013-11-13 00:23:50 +00:00
Roan Kattouw ec1c57330c Rename remapInteralListIndexes() to correct typo
Change-Id: Iebd2cebfd1a323b40d35ffbe1b908b0b7cb6c826
2013-11-12 14:39:38 -08:00
Trevor Parscal a6dca1bfef Fix docs for ve.dm.Model.getAttributes
Prefix is optional

Change-Id: Idb436ba4755b79dfab07dc8e8266b1716a26b58b
2013-11-12 12:23:34 -08:00
Trevor Parscal 22287cd3d3 Make tools disable correctly
* Respect disabled state when handling clicks
* Style disabled tools in lists correctly

Change-Id: I14dffa3248ffa5d32403c6145381cfabdc2d7ff1
2013-11-12 12:13:56 -08:00
Trevor Parscal 65a2f41268 Cleanup after window refactor
Related to: I82c4fed8bcb3fb5630938c8bc4dd9b2d5f1a8c1d

Change-Id: I4cc280725315fee0c5dd042479d4373cc0cdd0b4
2013-11-12 12:02:28 -08:00
jenkins-bot a2d9925e3a Merge "Use mw.util.getUrl instead of mw.util.wikiGetlink (deprecated)" 2013-11-12 17:36:41 +00:00
Timo Tijhof 98bc6adf1f Use mw.util.getUrl instead of mw.util.wikiGetlink (deprecated)
Change-Id: I72afbbd909ce2394d54f78d465bd8ad245c1694f
2013-11-12 18:34:05 +01:00
jenkins-bot 0f9eb502a2 Merge "Guard against detached nodes in ve.ce.GeneratedContentNode#doneGenerating" 2013-11-12 12:15:15 +00:00
Ed Sanders f2b0505037 Use a global resizing flag on the surface to hide phantoms
Otherwise you get rendering issues when you resizing adjacent
resizable nodes and you drag over the other node.

Change-Id: Ie70833fa6ae38879b70a19e8d7ecec13a1d54e92
2013-11-12 11:37:20 +00:00
Timo Tijhof 6feef815e2 ce.MWTransclusionNode: Don't pass token to parsefragment API
As of 46f40dc, we've split the VisualEditor API backend and the
part containing the parsefragment method no longer needs
an edit token.

This gets rid of the warning that started appearing after 46f40dc:

{
 "warnings":{"main":{"*":"Unrecognized parameter: 'token'"}},
 "visualeditor":{"result":"success","content":"<p>foo\n</p>"}
}

Change-Id: I36f79fa8ae48cdbec1b3506953418561ef2ff828
2013-11-11 20:33:26 +01:00
Roan Kattouw df3a61e874 Guard against detached nodes in ve.ce.GeneratedContentNode#doneGenerating
The generation promise can get resolved (e.g. AJAX request can complete)
after the node has been detached. In that case accessing this.model.doc
will fail, so check for this in doneGenerating().

Also attempt to abort the pending promise on teardown.

Bug: 56649
Change-Id: Ia55f1c2c8dc3a3619c0b50795e50fcae4bc6471f
2013-11-09 17:42:38 -08:00
Ed Sanders 26726ee31d Fix edit source switch in Firefox
Previously was failing for two reasons:
1. FF requires the form to be attached before submitting
2. options.watch failed because of FF's annoying Object.prototype.watch

Bug: 56767
Change-Id: I7b3d349f057f5b87f823ce788b4143f817af5303
2013-11-09 17:39:53 -08:00
jenkins-bot fdd4246237 Merge "Window refactor" 2013-11-09 03:08:54 +00:00
Moriel Schottlender a7c3e9689a Force LTR direction in MWSyntaxHighlightDialog
Syntax highlight editor shouldn't rely on GUI language directionality
but always allow for LTR text editing.

Bug: 56780
Change-Id: Iae7f9eee20ffb9a003830503865458918f5e1df3
2013-11-08 13:00:39 -08:00
Trevor Parscal 4192cbc4d5 Window refactor
Changes:

* Cleanup the window API to use more consistent and intuitive methods - we
  now use initialize/setup/teardown instead of
  initialize/onSetup/onOpen/onClose as methods which are overridden, and
  use open/close methods to control the window
* Change events around to have opening/open and closing/close events which
  act as before/after points during the opening/closing process
* Make WindowSet and Context respond to windows being opened, rather than
  opening them directly
* Fix a LinkInspector creation mode bug where the initial text doesn't get
  reset
* Move inspector, a VisualEditor concept, back to VE
* Cleanup naming of SurfaceDialog, SurfaceToolbar, etc. to use shorter
  names, they were given Surface* names when the generic ones were also in
  VE, but now the generic ones are in OO, so they can return to their
  original names

Change-Id: I82c4fed8bcb3fb5630938c8bc4dd9b2d5f1a8c1d
2013-11-08 12:33:25 -08:00
jenkins-bot d64801c86a Merge "MWExtensionInspector input direction based on content" 2013-11-08 19:29:58 +00:00
Moriel Schottlender 53f4b2f1ea MWExtensionInspector input direction based on content
In general, the direction of the MWExtensionInspector textarea
should be dependent on the directionality of the node it is editing.

The only exceptions are <hiero> and <math> that need to have their
textarea LTR always; these two inspectors' directionality definition
is overridden in their onOpen() method.

Bug: 56779
Change-Id: Iac5c1c3bf2c61b9fa36c9588c1734c91ca4305c4
2013-11-08 11:27:02 -08:00
jenkins-bot c0ee282b16 Merge "Add shortcut commands for underline & sub/superscript." 2013-11-08 19:02:50 +00:00
jenkins-bot efac869499 Merge "Add <ref> tags to wikitext detection regex" 2013-11-08 18:56:24 +00:00
cmcmahon f8d0cbded5 [browser test] one more variable string no longer hard coded
Change-Id: Ifa4917442707d0c83799ea7e018ae1c4aa7bb4c6
2013-11-08 09:19:30 -07:00
cmcmahon 53cb5a3ffd [browser test] edit string no longer hard coded
Change-Id: I8d9e9ae2cafa18a9a680abdca8c4224ef10a08b6
2013-11-08 07:35:38 -07:00
Ed Sanders 20063995b2 Add shortcut commands for underline & sub/superscript.
Underline is particularly important as CE will apply underline
formatting automatically when you press Ctrl+U but the
SurfaceObserver will not notice it, leading to inconsistency
between the view and the model.

For sub/superscript I've used the Google Docs key mappings as these
appear to have the fewest conflicts with existing browser shortcuts
and there isn't much consistency between desktop clients anyway
(Word and Open/LibreOffice use completely different shortcuts).

Bonus: reordered command lists to be consistent with UI layout.
Change-Id: I92998e42f9bcfb932d44e8f483811efd538e5981
2013-11-08 13:55:08 +00:00
Roan Kattouw 6f650d9a61 Add <ref> tags to wikitext detection regex
Bug: 56755
Change-Id: Ib7279401601147420441e77e4796b94fe91ac956
2013-11-07 17:47:33 -08:00
jenkins-bot d2da45ec36 Merge "Add a whole bunch of new ve.track() events for instrumenting loading and saving" 2013-11-07 23:57:57 +00:00
Roan Kattouw d6a00d689e Add a whole bunch of new ve.track() events for instrumenting loading and saving
Renamed events:
* performance.domLoad --> performance.system.domLoad
* performance.domSave --> performance.system.domSave

New events:
* performance.system.activation: total load time
* performance.system.domDiff: timing of paction=diff; like .domSave
* performance.system.domSerialize: timing of paction=serialize; like .domSave
* behavior.lastTransactionTillSaveDialogOpen: time from last transaction
  until user opened save dialog
* behavior.saveDialogOpenTillSave: time from save dialog opening to user
  clicking save
* behavior.saveDialogOpenTillReview: time from save dialog opening to user
  clicking review (skipped when a cached diff is shown)
* behavior.saveDialogClose: when user closes save dialog; duration is time
* performance.user.saveComplete: time from user clicking save to successful
  save completion; 'retries' indicates # of badtoken retries
* performance.user.saveError.*: time from user clicking save to failure;
  'retries' indicates # of badtoken retries
** performance.user.saveError.abusefilter
** performance.user.saveError.badtoken: token was bad and we prompted the user
** performance.user.saveError.captcha
** performance.user.saveError.editconflict
** performance.user.saveError.empty
** performance.user.saveError.spamblacklist
** performance.user.saveError.unknown
* performance.user.reviewComplete: time from user clicking review to diff showing
* performance.user.reviewError: time from user clicking review to diff failure
  since dialog was opened

Change-Id: I9815fa637d34c766c163e181d2f9527d3f32a7c3
2013-11-07 15:42:52 -08:00
jenkins-bot d3ea3835fd Merge "Fix image resize handles update on surface change" 2013-11-07 21:09:32 +00:00
jenkins-bot f93531a6e0 Merge "Restore selection when editor is refocused" 2013-11-07 20:38:53 +00:00
Roan Kattouw 500570b4ca Restore selection when editor is refocused
When the editor is focused, the selection goes back to the start of
the document. This was remedied in the .focus() method, but not in
response to native focus events, so when external code blurred then
refocused the editor, the selection would move to the top.

This broke section editing on wikis where ULS is installed: the
selection would be initialized at the start of the section, but then
ULS would load and blur the documentNode (by focusing the pasteTarget)
and then focus it again, so the selection would move to the top.

Instead of restoring the selection only in .focus(), restore it in
response to focus events on the documentNode. When this is done,
saving and restoring the scrollTop is no longer needed.

Bug: 56651
Change-Id: I14700174ee092f9b208215d31a7d1871078a89bf
2013-11-07 12:09:02 -08:00
cmcmahon ca2a7ce38f [browser test] input string no longer hard coded
Change-Id: I361b3ea025e405d1fc5a2e12c3c85d177147b90d
2013-11-06 17:08:42 -07:00
jenkins-bot edb769814c Merge "[browser test] add a test to edit with utf8 strings" 2013-11-06 17:21:05 +00:00
Ed Sanders 2e0d642a11 Make sure all links have target=_blank in the save dialog
Anything that uses getParsedMessage could contain a link.

Change-Id: I523edd935c4989e5929fca8891651c2287af973a
2013-11-05 21:23:02 +00:00
cmcmahon 3754bc77e4 [browser test] add a test to edit with utf8 strings
Change-Id: I88e475ee98bc8f696c1a1d0ad108c12a48fe7eee
2013-11-05 07:45:06 -07:00
Roan Kattouw 3ed7bb16a6 Send the old category and language types to Parsoid for back compat
Change-Id: If67d822e1a22bc24aa0c816952081dc614f6e686
2013-11-04 19:41:19 -08:00
Moriel Schottlender 97d3f5143f Fix image resize handles update on surface change
The resizing handles under ResizableNode are created in the location of the image
but if the page is edited and the image moves relative to the document, the handles
remained where the image was previously and not where its updated location is at.

This code fixes that bug by changing the CE event listening to the model's 'transact'
instead of 'history', and clears the cached offset when a 'transact' event happens.

Change-Id: Id0e4296dd89b24839ba68a534ca77d73c23b7434
2013-11-04 18:04:53 -08:00
jenkins-bot 64c4f47cc8 Merge "Work around crazy Chrome bug" 2013-11-04 19:12:01 +00:00
Trevor Parscal af8d034ca8 Work around crazy Chrome bug
When the ListToolGroup in the toolbar (the "More" section) is scrolled
down such that the top tool is partly obscured, and you hover over the
bottom half of the "More" button, the top tool displays a hover effect
and using the scroll wheel will scroll the list rather than the page.

This is because the list has a box-shadow that's 1em tall, and the
height of the "More" button is 2em. And in Chrome, pointer events
"work" even in the box-shadow area. Roan reported the Chrome bug at
https://code.google.com/p/chromium/issues/detail?id=314291

This change works around the bug by making the tools in the list
inline-block instead of block; for some reason the bug only affects
block elements.

Change-Id: I4ea3f41c91d0ff5d5cc150fe8acc3427f0ab5f3a
2013-11-04 09:47:16 -08:00
jenkins-bot e309271289 Merge "Fix appearance and messages on demo page" 2013-11-04 15:19:21 +00:00
Ed Sanders 3a98e84932 Fix appearance and messages on demo page
Some 've-ui-toolbar-bar' classes hadn't been converted to OO.ui so the
toolbar had no border. Also removed a useless rule in mw.ViewPageTarget.css.

SA platform didn't override OO.ui.msg to use the ve.msg so no messages
were getting through.

Change-Id: Ieb5bc3c98d1c435ec194b201b517a688cd9b02b9
2013-11-04 15:11:04 +00:00
jenkins-bot 154726deea Merge "Fix metadata issues in newFromDocumentReplace" 2013-11-04 14:55:37 +00:00
Roan Kattouw 64e5016423 Fix metadata issues in newFromDocumentReplace
* Our metadata insertions now need to be the same length as the data
  insertion, not one more, so:
** Remove the +1 in the listMetadata splice
** Shorten the metadata variable by dropping the merging of the
   metadata right before and right after the internal list; it was
   also including the metadata right after the internal list twice
*** We still need to deal with this in some way though, left a TODO
** Fix the metadata insertion test for these changes
* Fix null reference keys in the test data; we made all references
  keyed a while ago, but this test data was never updated for that
** The remapping of reference data doesn't remap auto/N keys yet,
   left a FIXME for that

Change-Id: I8ef4e6ee7c1808574d81d0b83294848afd400cd7
2013-11-04 14:37:26 +00:00
Zeljko Filipin efa741baea [browser test] Updated Ruby gems
Change-Id: I8c298efe8dd1abbb42b5c42ee0b8075a0aad9acf
2013-11-04 15:36:03 +01:00
jenkins-bot d9ee8f20aa Merge "Add OO.ui.Element.getDir" 2013-11-04 07:59:46 +00:00
Trevor Parscal 4c3a49dfc0 Add OO.ui.Element.getDir
Stop using this.$.frame.dir - a horrible hack made of duct tape
and bubble gum.

Or perhaps rather, masking tape and post-it-notes...

Change-Id: I53690e4485974b95edbdd255c0b96c2f639c5261
2013-11-03 23:55:53 -08:00
jenkins-bot 0ca1c5d52e Merge "Rename this.$ to this.$element, and this.$$ to this.$" 2013-11-04 07:06:59 +00:00
Trevor Parscal db9f941fa6 Rename this.$ to this.$element, and this.$$ to this.$
Objectives:
* Rename this.$ to this.$element
* Rename this.$$ to this.$
* Get rid of the need to use this.frame.$$
* Rename OO.ui.Element.get$$ to OO.ui.Element.getJQuery

Changes: (using Sublime Text regex patterns)
* Replace "get$$" with "getJQuery"
* Replace "\.(\$)([^\$a-zA-Z])" with ".$element$2"
* Replace "\.(\$\$)" with ".$"
* Replace "'$$'" with "'$'"
* Set this.$ to null in constructor of OO.ui.Window
* Set this.$ to this.frame.$ in initialize method of OO.ui.Window
* Replace "\.(frame.\$)([^\$a-zA-Z])" with ".\$$2"

Bonus:
* Use this.$() in a bunch of places where $() was erroneously used

Change-Id: If3d870124ab8d10f8223532cda95c2b2b075db94
2013-11-03 23:03:49 -08:00
Trevor Parscal e6f6decb12 Followup 6ec34a3dee: prevent focus loss on tool clicks
Change-Id: I7b756013ac234ad80937466a5881a1f92d8723d1
2013-11-02 00:04:21 +00:00