Commit graph

6362 commits

Author SHA1 Message Date
Rob Moen 212e5b231b Prevent getSaveFields from returning a property named undefined
Change-Id: Id7326ee8b951ba2219d3ea6767370ece9aba3c23
2013-12-18 15:32:49 -08: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
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 6c77dd8034 Merge "Fix mw.util dependencies" 2013-12-17 21:40:27 +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 abd85fda36 Fix mw.util dependencies
ext.visualEditor.base doesn't and shouldn't depend on mw.util,
but some other modules do. viewPageTarget.init has a dependency
on mw.util meaning that if VE is loaded through it, we'll always
be fine, but for correctness (and support for other targets),
explicitly indicate the dependency on mw.util for every module that
uses it.

Change-Id: I63821938d899897088799bde4d46b04cd2f9a3e2
2013-12-17 20:56:19 +00: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
jenkins-bot fed05f4e9a Merge "Empty empty.html" 2013-12-17 20:27:51 +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
Ed Sanders f4051c8efb Empty empty.html
Some test data was accidentally commited but this should be empty.

Change-Id: If84b4b2a06fcc3b3aeaeedf4624e2040cdbfc2c2
2013-12-17 19:19: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
jenkins-bot f343207c3f Merge "Fix buildi18n-json.sh to be consistent with TWN's build scripts" 2013-12-13 21:30:50 +00:00
jenkins-bot a140d749a6 Merge "Rebuild VisualEditor.i18n.php" 2013-12-13 21:29:57 +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
Roan Kattouw c5d815ffa4 Fix buildi18n-json.sh to be consistent with TWN's build scripts
Use spaces instead of tabs, and don't put a newline at the end
of the file.

Change-Id: Ice8dcec18acd9370e6885dd863a920ad779e0248
2013-12-13 13:01:15 -08:00
jenkins-bot 386f27bffc Merge "Fix the standalone toolbar to not demote heading1" 2013-12-13 20:47:17 +00:00
Roan Kattouw 4114da45fa Rebuild VisualEditor.i18n.php
Change-Id: Idf167d3f3b604ff23df050741c68e3b024897c93
2013-12-13 12:36:51 -08: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