Commit graph

1189 commits

Author SHA1 Message Date
Alex Monk 6d94d060ac Bump Schema:Edit to revision 13457736
* Remove page.length
* Add action.abort.type = switchnochange

Needs to be deployed at the same time as Ib99700ac

Bug: T111420
Change-Id: I7ee245157d4de6c220d7cdf54cd1dd69ff836f15
2015-09-04 00:51:05 +00:00
Ed Sanders e4c351e362 Implement getUserConfig and setUserConfig in MW
Depends on I5704a0e3e0 in core.

Change-Id: I0d6c9317a91dc02566d8877bd1aefae581213cbb
2015-09-01 01:03:38 +00:00
Timo Tijhof 4e3d3acf65 mw.DesktopArticleTarget.init: Don't make non-VE edit tab collapsible
Collapsible relates to the Vector menu behaviour where an item
is moved into the dropdown menu if the window is narrow.

This should only apply to the secondary tab when there are two tabs.

If there is only one tab (non-VE, e.g. in a non-VE namespace) then
this tab should not be collapsible.

Server-side code handled this correctly, but client-side was
adding the class unconditionally.

Change-Id: Iecd195e92f43fe9f11b3938a1a24caed7b331e5f
2015-08-25 05:50:24 +02:00
Alex Monk 01f7207947 Don't retry request in tryWithPreparedCacheKey unless the error was badcachekey
Bug: T109787
Change-Id: I66cd40fadcdfd59bbea05240d0c9917342c6f5a2
2015-08-21 02:01:56 +01:00
James D. Forrester 00d3226be1 build: Enable jscs jsDoc rule 'checkParamNames' and make pass
Change-Id: Ifcd3f67524c32148ff3591263d6374b31ee57d3b
2015-08-19 11:33:59 -07:00
James D. Forrester 85f91f394e build: Enable jscs jsDoc rule 'requireNewlineAfterDescription' and make pass
Change-Id: I7c0fabc93834d19198caea8f5dd1834e9e473d0a
2015-08-19 11:21:01 -07:00
James D. Forrester 945242a55a build: Enable jscs jsDoc rule 'checkAnnotations' and make pass
Change-Id: I76abb1eb1f3e1a2e8a4c03f577a080f4889b3a6d
2015-08-19 11:09:34 -07:00
James D. Forrester 19df1d4c8a build: Enable jscs rule 'requireVarDeclFirst' and make pass
Change-Id: Ia2f765d12bde001c329c2ff4c080a36b71de9803
2015-08-19 11:05:01 -07:00
James D. Forrester f5c6f61163 build: Enable jscs rule 'requireSpacesInsideBrackets' and make pass
Change-Id: I846d36c15e1b1f810d2ef7fd422f8412790bcb0f
2015-08-19 10:33:02 -07:00
Ed Sanders c0d2546617 Add down indicator to advanced menu in mobile
It is a dropdown list so give it the down indicator we use elsewhere.

Change-Id: I8976f2bc5edd1e221ca155da02660703318480ac
2015-08-19 13:05:14 +01:00
Ed Sanders 87daf4773d Fix typos in function names
Change-Id: Id8a9bcd1b4409bc8132ac6007b75274074f5f477
2015-08-18 13:54:51 +01:00
jenkins-bot 0ca9a5a21b Merge "ve.init.mw.Target#saveErrorCaptcha: Focus CAPTCHA input on display" 2015-08-17 19:32:16 +00:00
Ed Sanders 91b7ede4e3 ve.init.mw.Target#saveErrorCaptcha: Focus CAPTCHA input on display
Change-Id: I491d0585380a36e87412d2c36a1d9e5b6111ccac
2015-08-17 19:20:05 +00:00
jenkins-bot 14dde31998 Merge "Convert save checkboxes to OOUI widgets" 2015-08-17 17:53:16 +00:00
Ed Sanders 960ecf8103 Convert save checkboxes to OOUI widgets
Anything with type=checkbox is coverted, and its label is found,
either by for=id or by finding a wrapping label.

All other inputs are stored in $otherFields for form building.

Bug: T86617
Bug: T70572
Change-Id: I94376fef18d02d2058bb548c11ae17f3dec7268c
2015-08-17 18:37:06 +01:00
Ed Sanders 5a25f0113a Increase PageImages limit to number of pages requested
Bug: T109332
Change-Id: Ic571767a17d942f411a5198ffabf51881a985cb8
2015-08-17 17:40:02 +01:00
Ed Sanders 783521ede7 Clear old captchas after building save options
Bug: T109113
Change-Id: Ib60b5c903c85106c92237d7ce47fa0c01e645a1d
2015-08-17 14:09:56 +01:00
Ed Sanders 7114463cc5 MobileArticleTarget: Restructure the toolbar
* Rename the actions toolbar the 'pageToolbar', and place the save button in
  its actions section.
* Inject the title amongst the pageToolbar tools, so we can have tools either
  side of it.
* Don't use the hamburger icon, as this has a (different) expected behaviour
  in MF. Replace it with a back button, and move the edit switch action over
  to the right in an 'advanced' group.

The toolbar is back to being laid out like the source editing toolbar in MF.

Change-Id: I4e00a8cdf603968ee32872323c88e587c1e1a487
2015-08-15 14:33:10 -07:00
C. Scott Ananian 3658b63cb5 Make URL schemes case-insensitive
Bug: T109013
Change-Id: I5e85fbf95ed3dfba79bf3185e170799a4983ed57
2015-08-14 17:53:58 +00:00
James D. Forrester 1d6085b801 Update VE core submodule to master (e61ebf2)
New changes:
61d20a1 Hide on-screen keyboard when selecting nodes on all mobile platforms
e5aff79 Localisation updates from https://translatewiki.net.
a99a897 Update OOjs UI to v0.12.3
3c01a14 Make DM nodes sensibly hashable
a611eb9 Make ve.dm.example.postprocessAnnotations fluent
496c895 Update ve.dm.ElementLinearData#hasContent documentation
fcaa035 Support RegExp sequences; trigger sequence matcher after newline
edda1d4 Add a mechanism to wait until ve.init.platform has been created
e174155 Autolink URLs when typing
ac9248f Allow drag and drop of links (and subsequent autolinking)
c88fad6 Localisation updates from https://translatewiki.net.

Local changes:
* Define `ve.init.platform.getUnanchoredExternalLinkUrlProtocolsRegexp`.
* Make `ve.ui.MWLinkAction` extend `ve.ui.LinkAction`.
* Override `ve.ui.LinkAction.getLinkAnnotation` so auto-links use the proper
  `ve.ui.MWExternalLinkAnnotation` type.

Change-Id: I934f76158512e2e89b614ed92fef6481f70728e7
2015-08-12 14:31:06 -07:00
Alex Monk 45a2beeaff Don't reset edit summary every time we open the save dialog
We were setting the edit summary box to the contents of the 'summary' parameter
every time the save dialog opened, but actually we only want to pay attention
to that the first time the save dialog opens.

Bug: T108329
Change-Id: Ic7b456ca8d7dd7cef8bc27629e3655ce9b97e755
2015-08-11 20:39:31 +01:00
Ori Livneh 11045843bd Silence deprecation and invalid param warnings in API responses
Loading [[en:Sweden]] in VisualEditor requires making 24 API requests for
pageimages / pageprops info, all of which contain the following unnecessary
bloat:

  {"warnings":{"main":{"*":"Unrecognized parameter: 'gpslimit'"},
  "query":{"*":"Formatting of continuation data has changed. To
  receive raw query-continue data, use the 'rawcontinue' parameter.
  To silence this warning, pass an empty string for 'continue' in the
  initial query."}}

That's 276 bytes * 24 requests = 6,624 bytes we could shave without losing
anything at all.

Change-Id: I0e88ebdc47c4d304b71c3c34fde24f82f5abadfc
2015-08-10 20:55:26 -07:00
Ed Sanders 596151acbe MobileArticleTarget: Centre toolbar tools
Popup tool requires special attention to make it work
and keep the tool list left aligned.

Bug: T92027
Change-Id: I77a0dcbba382dce1669a30d48471b0c501c3d851
2015-08-10 21:03:56 +00:00
Ed Sanders 92fc30db48 Update VE core submodule to master (da9d929)
New changes:
2464397 Move toolbar floating code up to the target
11bdc21 Separate SA target into Mobile and Desktop
7ab3389 AlignableContextItem: Fix styling in mobile
758619f CONTRIBUTING.md: Update file paths and build instructions

Local changes to mw.Target to handle toolbar floating.

Change-Id: I0751817e3a6668b120134bfcb6c611b121a46501
2015-08-10 12:33:14 -07:00
Ed Sanders f9fbd52962 MobileArticleTarget: Add webkit touch scrolling to panels
Also use named classes for hiding toolbars, and move the
MobileFrontend overlay z-index hack out to that repo.

Depends on Ia46e6b4d7a in MobileFrontend.

Change-Id: I0e1f527446fd10fde5dd3107e6467fd2c8f621b2
2015-08-10 15:45:26 +00:00
Ed Sanders 37c651001e Switch to using surface model focus/blur events
Depends on Ibcda9a79 in core.

Change-Id: Ieb2f99d7d1d24c24a0f00cf7c33e23b8206bf753
2015-08-07 10:52:24 -07:00
jenkins-bot 79a95bc30a Merge "MobileArticleTarget: Use platform's iOS detection, not MobileFrontend's" 2015-08-07 15:39:58 +00:00
Ed Sanders 0d8914c48d MobileArticleTarget: Use platform's iOS detection, not MobileFrontend's
Change-Id: Ic206d54aee712e6309e34a0414d28c27363dfbc3
2015-08-07 15:37:05 +00:00
Ed Sanders e018dc4519 MobileArticleTarget: Remove incorrect border from toolbar
Change-Id: I9fcb7251afd0e3aa1601c31a684b15bf880b1152
2015-08-07 15:34:28 +00:00
Ed Sanders ac9f1a0919 MobileArticleTarget: Give toolbar split focused/unfocused modes
Split the toolbar into two modes depending on if the surface is focused:
* When unfocused, show a hamburger containing back and source switch
* When focused, show editing tools, and a check button to unfocus

For the editing toolbar, space the tools out using table-cell layout
and hide labels below 480px.

Depends on I06813e3ff in core (surface blur method).

Bug: T93325
Change-Id: Ibf09cb29019d7a71e1e144b326710b1f6506cd0c
2015-08-06 15:43:36 -07:00
jenkins-bot daa099f09e Merge "MobileArticleTarget: Fix over-sized debug bar" 2015-08-06 22:10:12 +00:00
Ed Sanders b93a521163 MobileArticleTarget: Fix over-sized debug bar
Change-Id: I3e92474d7a46a4da420c1ba7a766bf0e17144e47
2015-08-06 21:59:56 +00:00
jenkins-bot 0c49c03c10 Merge "[BREAKING CHANGE] Use save dialog in mobile" 2015-08-06 21:57:56 +00:00
Ed Sanders 707628cfb1 [BREAKING CHANGE] Use save dialog in mobile
Bug: T96186
Change-Id: I4319e23da2d1bfd0cbba9719dbc9642a233bdf67
2015-08-06 21:52:14 +00:00
jenkins-bot c61661c20a Merge "DesktopArticleTarget.init: Don't overwrite mw.libs.ve" 2015-08-05 21:58:07 +00:00
Roan Kattouw ef2d23c36a DesktopArticleTarget.init: Don't overwrite mw.libs.ve
Extend it instead, if it already exists.

Bug: T107979
Change-Id: I70bce7c82dce8199cfe36f810629c5d22b583f0a
2015-08-05 14:48:38 -07:00
Frédéric Bolduc 0ce3baf66d mw.Target: Add jsconfigvars and modules to the save mechanism
* On save, VE will now fetch and append modules and jsconfigvars to the save
  event, which respectively contains necessary JS config module data and the
  list of required modules to be added on the page.
* The jsconfigvars are now properly added to mw.config on edit save.
* If any new modules are now required by the page after an edit, they will be
  loaded by ResourceLoader through mw.loader.load.

Change-Id: Ib3990078a22ad9e46debf3ce174e7cf27b86d944
2015-08-04 19:00:09 -07:00
Ed Sanders 2c24efae29 [BREAKING CHANGE] Target*: Replace target events with methods
When you bind to your own events you're probably using the wrong
design pattern.

The events are kept (without arguments) for the purpose of tracking.

Change-Id: I6983319f9e0ca179e609afb00c821e3eab2161c9
2015-08-04 11:49:54 -07:00
Ed Sanders 529248f831 Target*: Remove 'on' from methods which aren't event handlers
Allows us to rename onSaveEvent back to onSave.

Before this change,
* ve.init.mw.Target.prototype.save ->
* ve.init.mw.Target.prototype.onSave, emit save event ->
* ve.init.mw.DesktopArticleTarget.prototype.onSaveEvent (or MF equivalent)

With this change,
* ve.init.mw.Target.prototype.save ->
* ve.init.mw.Target.prototype.saveSuccess, emit save event ->
* ve.init.mw.DesktopArticleTarget.prototype.onSave (or MF equivalent)

Change-Id: I016262b38a941c93c0978391491baa6d5a32fe28
2015-08-04 17:47:05 +00:00
James D. Forrester 86212df814 Follow-up fd2ef3e: Keep passing data.isRedirect in #onSave
Also fix ve.init.mw.DesktopArticleTarget#onSave to #onSaveEvent to avoid clash.

Change-Id: I5efb1884f9626e5da72b226cc8ca596bb6db4a40
2015-08-03 18:41:58 -07:00
James D. Forrester d6541e1e8d Follow-up fd2ef3e: Call prototype., not ve.init.mw.Target#onSerialize
Change-Id: I9fd86b91c8b7fa3c09758b492332c56d10c39a95
2015-08-03 22:42:51 +00:00
Ed Sanders 92cc1d1b53 Use super constructors in ArticleTargets
Change-Id: I58041de7421232dabe4541d438dd7cc66e3c8d92
2015-08-03 00:35:01 +00:00
Ed Sanders adcfb56761 ve.init.mw.Target#save: Bind this#onSave, not #onSave
Change-Id: I62fbb6f31c0ddd17a1179fb4c2d8f13e44e9c9bb
2015-08-03 00:30:06 +00:00
jenkins-bot a15c54f4db Merge "MWSaveDialog: Make a FragmentDialog now that's available" 2015-08-01 22:44:18 +00:00
jenkins-bot b46bd69c49 Merge "Move toolbarSaveButton init to base class" 2015-08-01 22:43:25 +00:00
Ed Sanders dc71b4849b MWSaveDialog: Make a FragmentDialog now that's available
* Make save a FragmentDialog and open with WindowActions so
  the selection is restored automatically.
* Pass in some information in setup data.

Change-Id: I254b71f252adce064b9c2d2bf2cb6c8d0018e31f
2015-08-01 22:41:17 +00:00
Ed Sanders fd2ef3e4cd MW target: Make 'static' methods either static or be instance methods
MW target has 'static' methods, some of which aren't attached
to the static property, the rest of which should be instance methods.

Rename success/fail functions to remove 'on' as that is reserved for
actual event listeners.

Change-Id: I63e68dbe1923906208b180abfc4a9a280b4d098e
2015-08-01 22:38:49 +00:00
Ed Sanders e9b7f4c029 Move toolbarSaveButton init to base class
Change-Id: I145c4029f9e1a6e46591134a7756dada1251551b
2015-07-31 12:03:14 +01:00
jenkins-bot 1bd8ecf61d Merge "Bring in code from MobileFrontend" 2015-07-30 17:25:14 +00:00
Ed Sanders d2c15e9eb5 Bring in code from MobileFrontend
* Use local edit source tool, and emit event to MF
* Bring in toolbar styles, bonus: remove old desktop style hacks

Bug: T96186
Change-Id: I89351e409aa4e9d626edd7151ae05bdcd58f1cee
2015-07-30 17:13:00 +00:00
Ed Sanders 915a82d2da Remove empty DesktopArticleTarget-shared.css
DesktopArticleTarget.css serves the same purpose and is non-empty.

Change-Id: Ieb2c41cdd774fac09537597b0bf9315aa446020c
2015-07-30 17:58:54 +01:00
Ed Sanders cf191f5fa8 Update VE core submodule to master (8feab4e)
New changes:
11953f7 Localisation updates from https://translatewiki.net.
0dbafb0 Update OOjs UI to v0.12.2
cbd0982 Replace placeholder color with opacity
087365c Support other types of 'empty' document placeholders
7692890 Make scrollIntoView a VE utility function
5a1a159 Localisation updates from https://translatewiki.net.
8edf71e [BREAKING CHANGE] Kill ve.indexOf and thus @until
bb02b02 build: Bump various devDependencies to latest
cb5b2cd Fix scrollIntoView util binding
8feab4e [BREAKING CHANGE] Use config object for Target constructors

Local changes:
* Use config object for Target constructors

Bonus:
* Add CSS classes to MW targets
* Use 'super' calls

Change-Id: Ieb4e4eb3663aab2706c0f3ecc8b82e00555df1d5
2015-07-30 08:28:48 -07:00
Ed Sanders 9921759456 Fix target rename merge conflict in CSS
Change-Id: I4ca015696d51c59a4c533127458bf5453d092bad
2015-07-30 09:47:55 +01:00
Ed Sanders 08a9551c84 MobileArticleTarget: Collapse text style buttons
B/I doesn't fit with link & cite on a iPhone 6

Change-Id: Ib23b2f8540425ee5d8265f369aea250e900a0c5f
2015-07-30 00:25:52 +00:00
jenkins-bot 9f20acfc9a Merge "[BREAKING CHANGE] Bring in some code from MobileFrontend" 2015-07-29 23:47:07 +00:00
Ed Sanders 3593184f42 [BREAKING CHANGE] Bring in some code from MobileFrontend
* Bring in back button & save button from MobileFrontend
  so they are properly styled OOUI widgets
* Accordingly, move toolbar save button code up into base
  MW target.

Bug: T96186
Change-Id: Ic89dd4efb831fc3b09980da16524276f6568619d
2015-07-29 16:16:39 -07:00
Ed Sanders 03449dca80 DesktopArticleTarget-*.css: Placeholder CSS fixes for skins
Change-Id: I8c7f98cc083c0811cd847a8b3874a586487658ca
2015-07-29 12:02:09 -07:00
Ed Sanders bb57348a9e DesktopArticleTarget#activate: Rename pageTarget to target
Change-Id: Iae71a050058afb2c1111a99ede5b969afbf5aca6
2015-07-29 17:58:33 +00:00
Ed Sanders fecdc29a38 Replace ve-init-mw-desktopArticleTarget-* with ve-init-mw-target-*
Except in cases where it is only applied to desktop articles.

Change-Id: I40a9dabcd8454138f94affde809afee9c93732a4
2015-07-29 18:26:36 +01:00
Ed Sanders b5de6fa575 [BREAKING CHANGE] Rename (View|Mobile)PageTarget to (Desktop|Mobile)ArticleTarget
Change-Id: I6a8fa76dc4d70cc04722e30e3fea6a6112d56b40
2015-07-29 18:26:36 +01:00
jenkins-bot 85ca7d3e94 Merge "Close the wikitext switch confirmation dialog if serialisation errors" 2015-07-29 00:41:26 +00:00
Roan Kattouw 6d22fd1aa7 Follow-up 8250c8ad54: unbreak ApiResponseCache
.set() should not overwrite existing deferreds; instead,
it should resolve the existing deferred if it's pending.
This is necessary because .set() is used by processResult().
Without this, passing .get() a title that no information
is known for results in a promise that is never resolved,
because the associated deferred is overwritten as soon
as the API response arrives.

Still make .set() a no-op if data has already been set,
by checking if the deferred is pending. For .resolve() this
doesn't matter, but for modifying this.cacheValues it does.

Bug: T107212
Change-Id: I70e8c5450f23062db214ccc5c585624d41de6509
2015-07-28 15:10:21 -07:00
Florianschmidtwelzow 4981a8253d Allow skin developers to set an offset for toolbar floating
Usage:
In a skin, that needs this offset, e.g. because it has a fixed header, it should add
this config var somewhere before the hook BeforeOutputPage is called:

$wgVisualEditorSkinToolbarScrollOffset['vector'] = 60;
(if 60px is the offset to use)

Depends on: I2e10c12df8277c84d948e48c6a132c03d6324693

Bug: T95528
Change-Id: Iaa86c2f68afa6403fcc4f5b7c655704512beead4
2015-07-28 11:18:07 -07:00
Alex Monk f76b57f1e6 Close the wikitext switch confirmation dialog if serialisation errors
Bug: T103632
Change-Id: Id9aede04ff4f8919770e578fac24ad4a1178b9a6
2015-07-25 14:32:17 +01:00
Ed Sanders 8250c8ad54 Separate 'isMissing' micro cache from full link data cache
Bug: T106819
Change-Id: I72f52d63968aa1ac842b2aa503150cf114f9d711
2015-07-24 16:17:35 +01:00
Alex Monk 82fb5f609a Parse SpamBlacklist error on the server-side
The client won't be able to deal with templates etc.

Bug: T99830
Change-Id: I78611a3f061b1afd73de052aa9ddff48dc368f2d
2015-07-23 18:49:42 +00:00
James D. Forrester 57f8fc5368 build: Drop last jscs over-ride and make pass
Change-Id: I4ff60af79cfc6e09e284d51f9b7ac2afa900f0f5
2015-07-22 15:13:09 -07:00
Ed Sanders 8e0394da5c Support command whitelist feature
Depends on I87d8aa3 in core.

Bug: T106061
Change-Id: I694e4e5a83f281da92380a895b72611141838f42
2015-07-18 18:20:49 -05:00
jenkins-bot 0e5a6aca32 Merge "Don't set browser-prefixed transition CSS classes" 2015-07-18 05:35:45 +00:00
jenkins-bot 3d6af458dd Merge "ve.init.mw.TargetLoader: Error when RESTbase load call fails" 2015-07-18 05:21:37 +00:00
Kunal Mehta 0653804151 Don't set browser-prefixed transition CSS classes
jQuery will take care of this automatically: <https://api.jquery.com/css/#css2>.

Follows up bf56f56f3e.

Change-Id: I4db46fc70a5446a9ffc9f6d4375fae3b53609ee0
2015-07-17 16:31:56 -05:00
Alex Monk 7653dec439 ve.init.mw.TargetLoader: Error when RESTbase load call fails
No retry right now, but we should at least stop failing silently. Doing this
in a window.alert() for now, as OOUI isn't available at this part of the
page load just yet (that will be coming soon).

Bug: T97041
Change-Id: Iacb195667215ee69d3991e4c41651ab6042243c5
2015-07-10 18:13:37 -07:00
jenkins-bot 2cf60686af Merge "Check if links are 'known' rather than 'exist' locally" 2015-07-08 19:29:22 +00:00
Ed Sanders 8971edb480 Check if links are 'known' rather than 'exist' locally
This data is used for marking links red, but links which are known
but don't exist (e.g. interwikis) are not red.

Also fix bug in API caused by trying to return a value of (bool)true which is
apparently not allowed. Use (number)1 instead.

Bug: T104604
Change-Id: I599a513a27b31f7167e688d73bc3685141249971
2015-07-08 20:26:04 +01:00
jenkins-bot 3039da4e30 Merge "Fix section scrolling" 2015-07-08 18:32:03 +00:00
jenkins-bot c39bd98597 Merge "Revert "Make toolbar save button frameless"" 2015-07-08 15:38:55 +00:00
Ed Sanders be5df39f5b Fix section scrolling
Core code now has a scrollIntoView animation triggered on focus
which needs to be cancelled before we scroll to the section heading.

Change-Id: I5eb6a5c98b38c2510d2d7f0108fe56e607b34bd6
2015-07-08 15:34:43 +01:00
Bartosz Dziewoński 652da4afab Revert "Make toolbar save button frameless"
This reverts commit cb11cbd2f5.

Actually not needed after 3d36cac7fc4808f708f03b66f5c099de440e4569
in OOjs UI, and would change the UI in unexpected way.

Bug: T103403
Change-Id: Ia30b168ea29d03aa76ad81d1f9894a67604fdc08
2015-07-07 14:21:04 +00:00
jenkins-bot 9e730bf528 Merge "Save dialog: Show reload link next to FancyCaptchas" 2015-07-02 22:39:26 +00:00
jenkins-bot 052405565c Merge "Revert "Show <newarticletext> as surface placeholder, not an edit notice"" 2015-07-02 20:45:28 +00:00
Alex Monk c912f4e6dc Save dialog: Show reload link next to FancyCaptchas
Bug: T103227
Change-Id: Ib0548aa8ce3e2322dedc9980323e6e1f1cd705a0
2015-07-02 20:12:34 +01:00
Esanders b2ff7aaa17 Revert "Show <newarticletext> as surface placeholder, not an edit notice"
This reverts commit 5ac5c7a05b.

Bug: T104227
Change-Id: Id86dd228c2c671758acc6d2d3314c92da8917472
2015-07-02 15:20:24 +00:00
jenkins-bot 6e601a9930 Merge "Make toolbar save button frameless" 2015-07-01 22:48:16 +00:00
jenkins-bot 859f6daee6 Merge "Show <newarticletext> as surface placeholder, not an edit notice" 2015-07-01 15:49:12 +00:00
Alex Monk 5ac5c7a05b Show <newarticletext> as surface placeholder, not an edit notice
Bug: T104227
Change-Id: If0e1df48c1b3818235f7e02220144d467fb78fe9
2015-07-01 15:46:09 +00:00
Ed Sanders bef186c874 ViewPageTarget-vector.css: Fix non-HD mode typo
Missing comma between two selectors

Change-Id: I3e2ab561991f5f11598be1460f65a239e3c0d7ca
2015-07-01 15:35:55 +00:00
Ed Sanders cb11cbd2f5 Make toolbar save button frameless
Depends on I26b540dd2 in oojs-ui for styling.

Bug: T101165
Change-Id: I075b8cecf9df2026fb1da17e2ebdf0d848a3d250
2015-07-01 12:12:50 +01:00
Ed Sanders 472c98053d Ensure placeholder styling matches document
Bug: T96593
Change-Id: I23bb1393a9a6779b70ed1004496f3ca6ff038e43
2015-06-30 09:47:34 +01:00
Bartosz Dziewoński 6d18641e4d Specify 'associatedWindows' for link and citation tools
Depends on I21fb955ecb697060263538914014d5712e013695 in core.

Bug: T98845
Change-Id: Id7f59c0095e8d85bb608bed0ab60603665fbca47
2015-06-29 16:26:32 -07:00
jenkins-bot bd394194e3 Merge "ve.init.mw.Target: Strip all <script>/<object>/<style>/<embed> on save" 2015-06-25 23:45:00 +00:00
James D. Forrester 4f1881ea74 ve.init.mw.Target: Strip all <script>/<object>/<style>/<embed> on save
Bug: T103430
Change-Id: Ie6ca3181f4c0764625b4d69fa169abc67ffb15bb
2015-06-23 08:42:01 -07:00
Timo Tijhof 87f2d0bc2a Make ext.visualEditor.mwalienextension mandatory (no longer experimental)
This module is required in order to alienate all extension blocks
by default. Otherwise they are interpreted as plain divs which
allow content editable.

Bug: T103455
Change-Id: I08f6b9a516ba6bee6ed18256222108116eceee1e
2015-06-23 03:45:50 +01:00
Timo Tijhof e1ce49509c mw.ViewPageTarget: Ensure canonial view url is restored
When loading VE by clicking Edit on a view url, this naturally
works (we temporarily append our query, and remove it when ready).

When loading VE from a permalink (e.g. Open in new tab) or any
other source linked from HTML pages, then we're not in control
over adding the query (it's already there); we're only in control
over restoring the view url afterwards.

Bug: T102363
Change-Id: I4912ff1c6b28ac987517760ffed481a4cd3bd1ca
2015-06-15 13:28:35 +01:00
Ed Sanders 425e581613 Unregister core image types
Once MW images are registered, we should remove core image support so
we don't accidentally match to them (e.g. an MW inline image with an
unsupported extra RDFa type).

Change-Id: I1c8567346c371fe338f95b232c9ac53e009c5a46
2015-06-02 14:36:14 +01:00
jenkins-bot da3a5dbfc4 Merge "Improve progress bar" 2015-05-12 12:27:28 +00:00
jenkins-bot 788d0b0047 Merge "Remove 3px gap above toolbar in Monobook" 2015-05-12 12:24:42 +00:00
jenkins-bot c35be097d1 Merge "ve.init.mw.ViewPageTarget: Simplify toolbar save button and inner toolbar code" 2015-05-12 12:19:22 +00:00
Trevor Parscal 4297301948 Close the bottom of Vector tabs in VisualEditor
Change-Id: Ie1a0b45300dbc21fb388ee7fc94e0851d0cd5924
2015-05-12 12:56:30 +01:00
Trevor Parscal 293e032786 Remove 3px gap above toolbar in Monobook
Change-Id: I3ccfc4556d2d19e5caa2a4a21b81fab54ca4f414
2015-05-12 12:56:03 +01:00
Bartosz Dziewoński e459c14442 ve.init.mw.ViewPageTarget: Simplify toolbar save button and inner toolbar code
All this is no longer needed since 121216184718e7ebe22d6ecc8f5af5fe4e202465 in
OOjs UI and started causing issues after bb9c9c4f6a2fca6aed0e671e904e469d57da5f34.

Bug: T98795
Change-Id: I6493d6b52b313aac521aee2b0cff1571ea63bbe5
2015-05-12 13:50:40 +02:00
Ed Sanders bf56f56f3e Improve progress bar
* Add a 3rd stage will triggers on API load
* Allow stages to complete in different order (as happens
  on second load)
* Use CSS transitions
* Start slow and speed up using ease-in and progressively
  shorter transitions

Bug: T95137
Change-Id: Ib9090e6c80b7a186bf353c40921d40456d90211a
2015-05-11 13:26:32 +01:00
Alex Monk 6c86046bd8 mw.Target: Fix API breakage of watchlist preference check
Bug: T97838
Change-Id: I413c300ad26dd87d9d6a7c6f0032a8165ea7f2c9
2015-05-07 08:40:03 -07:00
Roan Kattouw e644d33a8d Follow-up 5c38995bd9: don't destroy toolbar twice
The toolbar.destroy() call that was added in 5c38995bd9 was
needed to destroy the dummy toolbar when tearing down VE
before a surface had been intialized. But when tearing down
VE after the surface had been initialized (e.g. exiting using
the Read tab), we would do:

* setTimeout in tearDownToolbar()
** Set toolbar height to 0 and wait for transitionend
*** toolbar.destroy() once transition complete
* toolbar.destroy() in cancel()

This meant that we'd listen for a transitionend event
on an unattached element (because once the setTimeout runs,
the toolbar has already been destroyed by the second call),
which of course never fires, so we'd never resolve the
tearDownToolbar deferred and never finish tearing down VE.

Bug: T98388
Change-Id: I504f0cb0bf13643773fc98cb18b7b380cccb2f88
2015-05-06 16:18:45 -07:00
jenkins-bot 873baa22b6 Merge "Revert "Be more selective in application of 0.8em font size"" 2015-05-06 17:33:57 +00:00
Bartosz Dziewoński d008a3bc7c Revert "Be more selective in application of 0.8em font size"
Causes more problems than it fixes.

This reverts commit cab44b55ef.

Bug: T98193
Change-Id: Id40919ceda36a665e23c6f84965a3b979bb33289
2015-05-06 17:08:49 +00:00
jenkins-bot b488dbeb8b Merge "Be more selective in application of 0.8em font size" 2015-05-05 17:50:17 +00:00
Ed Sanders cab44b55ef Be more selective in application of 0.8em font size
Prevents read-mode elements placed inside the target from
getting scaled down (e.g. firstHeading).

Change-Id: I55ed38e2855c4eb317ec71cebb1842b9b70790b6
2015-05-03 12:05:57 +01:00
Ed Sanders 5c38995bd9 Fix page restoration when Parsoid load fails
Change-Id: I42cd7801af73c97d8fa07a4537c6e1c104e52ac4
2015-05-03 11:51:48 +01:00
Ed Sanders f95cebd8b1 Divide surface margins by 0.8
Change-Id: Ic9a0b3f4d8e82127649bb5ac100e3cbf42001489
2015-05-01 23:17:35 +01:00
Bartosz Dziewoński 335a702ac3 ve.init.mw.ViewPageTarget: Set custom font-size for original .mw-body-content too
Bug: T97690
Change-Id: I6ac49030cdb40798ae50fadf8179dd3a58e0e4b3
2015-04-30 21:25:49 +00:00
jenkins-bot 79b202de19 Merge "Fix toolbar & debug bar negative margins" 2015-04-30 21:18:03 +00:00
jenkins-bot f195a705c0 Merge "Remove unless, and almost-useless closures in response cache" 2015-04-30 17:30:50 +00:00
Ed Sanders ffd904022b Remove unless, and almost-useless closures in response cache
Change-Id: Ie02caefe3d8c43b6b1e6b523fb07042f5ae6db37
2015-04-30 17:26:05 +00:00
jenkins-bot 0824d064ec Merge "Make static methods static in linkCache" 2015-04-30 16:13:21 +00:00
Ed Sanders c32cccd90b Make static methods static in linkCache
Also switch out logic duplicated in MWLinkTargetInputWidget with
LinkCache#processpage.

Change-Id: Ie6f3599d4ea5cc9057cf4403f003da00f18cdebe
2015-04-30 17:00:45 +01:00
Ed Sanders 1a2a08cbf6 Fix toolbar & debug bar negative margins
Now 0.8em is set on the target wrapper, divide all these
margins by 0.8.

Change-Id: If373eac4d2abb9f58da816163b27e4110c39a213
2015-04-30 14:01:37 +01:00
jenkins-bot 6cb513b29c Merge "Update for changes in OOjs UI (Ib40e3477)" 2015-04-30 02:19:18 +00:00
jenkins-bot 3e2f7f0728 Merge "Show different icons for different result types" 2015-04-29 17:01:33 +00:00
James D. Forrester 65112a7e10 Show different icons for different result types
* Disambiguation
* Redirect
* Not found
* Page exists

Bug: T93694
Change-Id: Ic4a60c95e37de372e8d0c12878dece67a2662343
2015-04-29 17:51:34 +01:00
jenkins-bot 1feb544afc Merge "Revert "Pre-fetch RESTBase DNS and negotiate TLS"" 2015-04-29 16:26:00 +00:00
Ed Sanders df6a570f82 Only pull description from wikibase
Filters out 'alias' and other terms not being used yet.

Change-Id: I5d155c76b85de1e5d1d5fb234f565fd6f1658766
2015-04-29 11:17:24 +01:00
GWicke a44fbbf924 Revert "Pre-fetch RESTBase DNS and negotiate TLS"
This is no longer needed, as VisualEditor now loads the content
from the /api/rest_v1/ entry point at the main project domain.

This reverts commit c741db5378.

Bug: T97500

Change-Id: I9b0dba58484884cdf3c7917c633b9815de4c9f92
2015-04-29 01:14:42 +00:00
jenkins-bot 76aa7c8ad6 Merge "Port ve.init.mw.Target to ve.fixBase()" 2015-04-28 20:21:12 +00:00
jenkins-bot d8c0f9e8b3 Merge "Link inspector images and descriptions" 2015-04-27 23:51:38 +00:00
suchetag 3963b1daf2 Link inspector images and descriptions
Fetches images from PageImages extension and descriptions
from Wikibase.

Bug: T93693
Bug: T93694 (partial)
Change-Id: I1bea6b7b57ab951e79468cfa00e9eecddc113d18
2015-04-28 00:23:40 +01:00
Roan Kattouw a332ea210a Port ve.init.mw.Target to ve.fixBase()
The old code in ve.init.mw.Target.static.fixBase was mostly
moved to ve.fixBase(), and the new ve.init.mw.Target.static.fixBase
contains MW-specific logic on top of that. This allows us to get
rid of the base fixing logic in onLoad().

Depends on I607fa579733 in VE core.

Change-Id: I42dfd4b90e86eb67d0111fffafc18e1152249610
2015-04-24 14:41:22 -07:00
jenkins-bot b16a24e04f Merge "Don't give up immediately for revid mismatches on second load" 2015-04-23 20:57:12 +00:00
Roan Kattouw 7a29cf3dbf Don't give up immediately for revid mismatches on second load
If a load failed due to a revid mismatch, and a new attempt then
succeeded, we would keep remembering that it initially failed.
Then when we loaded the editor a second time, encountering
a revid mismatch would cause us to give up immediately.

To fix this, forget about any previous failures once
a load succeeds.

Bug: T97069
Change-Id: Ie10a7532759095cbb5fb8d23af602aa7b9611a06
2015-04-23 13:48:00 -07:00
Bartosz Dziewoński 89b79bb373 Update for changes in OOjs UI (Ib40e3477)
Depends on I175fe468 in VisualEditor core.

Bug: T91152
Change-Id: I08c80cec84242eabd3da5bd3c829022df3e21636
2015-04-23 13:52:12 +02:00
Bartosz Dziewoński 2e96c8c1f3 Allow special characters with tooltip or that encapsulate text
Depends on Idd5e163090c9cf1c103d8b40e8ba19d332671cde and
Ifba178d8099b797a0ca33ca990540c8cb9cd3637 in VE core.

Bug: T65227
Bug: T70425
Bug: T95819
Change-Id: I6f08e3c1c3e4134520dac1e2d32d828cdefea23f
2015-04-22 17:46:00 -07:00
jenkins-bot 3b592bf4bc Merge "Strip language annotations on external import" 2015-04-22 00:33:17 +00:00
Ed Sanders e229e73fc6 Strip language annotations on external import
These are likely to have been generated by a parent language setting,
rather than an a specific inline annotation.

This won't affect ve-to-ve copy paste.

Bug: T95708
Change-Id: Ic8fe417ab6ffa74e85ab170f413b13b83589293d
2015-04-21 16:55:01 +00:00
Ed Sanders b78c725dbf Manually set starting progress to 0 incase stylsheets are slow to apply
Bug: T93964
Change-Id: I7d2bc7ca9f9d7db62a4524446a8e0ba8a3012c2a
2015-04-21 11:32:29 +01:00
jenkins-bot 5cf9798adb Merge "Update VE core submodule to master (952a9bb)" 2015-04-20 00:09:37 +00:00
jenkins-bot f8574e8073 Merge "Fix debug bar margins in monobook" 2015-04-19 23:59:05 +00:00
jenkins-bot 70e50ca38f Merge "Fix debug bar selector in vector stylesheet" 2015-04-19 23:59:03 +00:00
Ed Sanders c9061384d2 Update VE core submodule to master (952a9bb)
New changes:
72b9ed6 [BREAKING CHANGE] Simplify getModelFromDom signature
5a6505c ve.ui.SpecialCharacterDialog: Specify 'transition' only for 'border-color', not 'all'
30a2107 ve.ui.SpecialCharacterPage: Use less jQuery for better performance
e5692fd Localisation updates from https://translatewiki.net.
1ff0a0c Only auto-close windows which are not the one we are trying to open
48964b5 Localisation updates from https://translatewiki.net.
1f928ae Fix rendering of search results when scrolling
046dc5e demo: Add device switcher between desktop and mobile

Local changes:
*  Use simplified getModelFromDom API from 72b9ed6 in core.

Change-Id: Ib220c4e5c3fc520e10b950c02475783cd710d0df
2015-04-19 16:58:31 -07:00
James D. Forrester 0fdfab6c71 Blacklist <script> tags from BitDefender 2015
Bug: T96533
Change-Id: Ic6d030d46543ce01bffdd839f72d84c9fd537835
2015-04-19 15:02:26 -07:00
Ed Sanders 077b09efa2 Fix debug bar margins in monobook
Change-Id: I1654db5d2408471cb420f3422e70dc28d239cdfd
2015-04-19 19:50:08 +01:00
Ed Sanders 94e3386b51 Fix debug bar selector in vector stylesheet
Change-Id: I322cedf4902418b8821f72e34db03abd59016d76
2015-04-19 19:50:08 +01:00
Ed Sanders 4328045501 Update VE core submodule to master (5b0e269)
New changes:
de79de2 [BREAKING CHANGE] Fix font sizes and padding in Surface and SurfaceWidget
aa4a481 Localisation updates from https://translatewiki.net.
c2ff1cb Initialize toolbar tools disabled until surface is initialized
f457c83 Split visualEditor.css into apex & mediawiki versions
aff993c Don't drop <html> attributes when parsing HTML on Opera 12

Local changes:
Fix SurfaceWidget and DebugBar hacks

Change-Id: I93cb8ec787e53c07b5051c0296eb6f59b6048e91
2015-04-17 15:18:08 -07:00
Roan Kattouw c8ac904fa6 Also load mwformatting in mobile
We need it for the strip-if-empty logic in MWHeading,
and for consistency with desktop in general.

Bug: T96395
Change-Id: I9e70df896417811df087f58f3107919ba704f7c4
2015-04-17 10:55:25 -07:00
James D. Forrester 85381a6b75 Update VE core submodule to master (2714bfc)
New changes:
8dc8b26 Trim leading and trailing whitespace from annotations
306feb4 Add get(Col|Row)Count to TableSelection and use in isFull*
1c06d21 Cursor holders for native cursoring to ce=false nodes
b08384d Provide file extension fallback for FileTransferHandlers
28844ed [BREAKING CHANGE] Move all icons to OOjs UI's icon packs
9d37355 demo: Set 'lang' attribute of target
8945420 Follow-up 8dc8b266: account for annotations that return []
c2bbc97 Localisation updates from https://translatewiki.net.

Local changes:
* Switch to using OOjs UI icons for VisualEditor core features
* Update test for whitespace trimming

Change-Id: I12b22a411600b6e8e61858e7ed600fb53eedd95d
2015-04-16 14:02:59 -07:00
jenkins-bot c4901404cc Merge "Don't self-instantiate platform" 2015-04-16 02:37:04 +00:00
Ed Sanders 1ae9178773 Don't self-instantiate platform
Depends on I961dade19 in core.

Change-Id: I39b99617a9362a57a721c8467a1b43bdb9d754dd
2015-04-15 18:46:34 -07:00
Ori Livneh 07001001be Defer loading easy-deflate
Easy-Deflate.js and its dependency, Base64, are not needed for editor
activation. Defer loading these modules until the editor has been activated.

Also promisify prepareCacheKey.

Task: T94616
Change-Id: I2e754fc835a5608b27d81117e1fbc9ea97d5744b
2015-04-15 18:43:28 +01:00
Roan Kattouw 86b82b537d Make activation timings sent to EventLogging not lie
The activation timing was always a bit of a lie even pre-TargetLoader,
because the timer only started when the first RL request for VE
modules had loaded. But at least the process it covered was consistent,
which is no longer true with TargetLoader. Now that we start the
request for the HTML together with the RL request, the activation
time might include some, all or none of the HTML request depending
on how fast the RL request was.

This change makes the activation timings more useful by measuring
from the moment the user clicks "edit" to the moment the editor
is done loading, which is what actually matters.

* Moved start of activation timing to VPT init
** For mobile this falls back to when mw.Target#load is called;
   we'll have to fix that in MobileFrontend later
* Moved end of activation timing out of TargetEvents#onSurfaceReady
  into individual onSurfaceReady handlers
** This is necessary because VPT's onSurfaceReady does quite a lot,
   and we want to include the time that takes in our measurements

Change-Id: Ie44f0b839b39a2b3b22dcd86e20f0d1170cb6069
2015-04-14 21:57:11 +00:00
jenkins-bot 54afadf9d1 Merge "Replace abstract functions that just throw with null" 2015-04-14 16:57:10 +00:00
jenkins-bot 8c29e52202 Merge "mw.ViewPageTarget: Use new simplified ve.ui.Surface#getDom" 2015-04-13 19:06:13 +00:00
Ed Sanders 502272a1bc mw.ViewPageTarget: Use new simplified ve.ui.Surface#getDom
Depends on I6355cf484b8 in core.

Change-Id: I3dcce40af346b1c5ab75c0da81aee8ae02937f44
2015-04-13 18:38:56 +00:00
Ed Sanders 91923e815b Remove useless ve.init.Platform overrides
The parent methods (ve.init.Platform) are now identical.

Change-Id: Idbf18d64b723ce2465e7c0c994c88b4b63c87445
2015-04-13 18:30:57 +00:00
Ori Livneh 30772ee3f5 Update RESTBase pre-connect URL to hit /_preconnect
/_preconnect is a special end-point that is handled by Varnish with an HTTP
204, sparing the RESTBase backend. See I95a716592.

Change-Id: I0c0430014768d7a1c6673d078569d0cf4062d338
2015-04-09 17:43:53 -07:00
James D. Forrester 916eba05a5 Replace abstract functions that just throw with null
Per Timo, this avoids us having pointless code that is never
executed, and the replacement notification to the user (that
ve.blah.UnicornAnnotation.foo is null and not a method) is
sufficiently clear that the issue lies in the lack of existence
of the ve.blah.UnicornAnnotation#foo method.

Only ones in this repo appear to be in ve.init.mw.ApiResponseCache.

Bug: T54482
Change-Id: If44b8d63b8e7b2a5c289fe7278ad54e722b185fa
2015-04-09 23:20:07 +00:00
Moriel Schottlender 7c0b307d8a Allow for citation tools to work under the reference dialog
Set up the surface widget as inside the reference dialog, and let
the citation action notify the template dialog the name of the
dialog it is in. If the tool was executed from within the reference
dialog, skip over creating a reference and instead insert the
citation as a template.

* Depends on ve-core fix I709eeb0de475 *

Bug: T94621
Change-Id: I4871f8c0afe190117cc90e88227b37f292a71e20
2015-04-09 12:18:54 -07:00
Ori Livneh c741db5378 Pre-fetch RESTBase DNS and negotiate TLS
Keep VisualEditor load times snappy by eagerly establishing a connection with
RESTBase via a beacon request, which is deferred until after window.onload /
setTimeout to ensure it does not slow down the loading of the page.

Task: T94784
Change-Id: I19fd2ef6beffe1c4c4f05c2716da079b49e88b95
2015-04-09 11:54:27 -07:00
jenkins-bot 65fe5399a3 Merge "Set targetName for apiLoad and restbaseLoad metrics to the correct values again" 2015-04-09 17:25:49 +00:00
Alex Monk 19dc7d31fe Set targetName for apiLoad and restbaseLoad metrics to the correct values again
If70ff601 didn't really fix anything. The only reason you'd want this data is
to distinguish between mobile and desktop data, but it just set the value to
the desktop version always...

Bug: T95432
Change-Id: I76722e3ad8b7dbe644374b24093bec696f27f48c
2015-04-09 13:57:25 +01:00
Ed Sanders 4379275062 Update VE core submodule to master (7058807)
New changes:
4c1a5ea [BREAKING CHANGE] Give the converter a 'fromClipboard' mode
d855043 Add core tests for annotation merging
fae083e Localisation updates from https://translatewiki.net.
11710e9 Encode and decode HTML entities in comment nodes

Local changes:
* Update getModelFromDom signature

Change-Id: Ida1b9b33d5e25e7d467ef16dd2240442270b9d32
2015-04-07 18:13:06 -07:00
Alex Monk 23e734b93a Only try to load 'site' and 'user' modules on desktop
These simply won't work with MobileFrontend, per jdlrobson

Bug: T95044
Change-Id: I3b899f55b31d4ed40e65e8d1b2f65b75d9ec339f
2015-04-03 21:41:33 +01:00
Timo Tijhof 8475d40b77 mw.ViewPageTarget: Disable pointer events on dimmed elements
Reduces event overhead and prevents accidental interaction with
content while loading, and with content sub while editing.

Change-Id: Ief997cd4d5cf444fb2ee0d28c709301d26e814f9
2015-04-01 01:46:22 +00:00
Roan Kattouw 37bb76e13b Fake <base href> if missing or invalid
If the Parsoid document has an invalid base URI or none at all,
construct one based on wgArticlePath so link href resolution
still works properly. This is needed especially when creating
a new page, because the "Parsoid HTML" is an empty document
in that case.

Bug: T94315
Change-Id: I5d9709725ef471c7ce1987ce887708ac5ee4259a
2015-03-30 21:30:58 -07:00
jenkins-bot 026c015696 Merge "Correct font sizes of everything on MonoBook" 2015-03-30 21:25:33 +00:00
jenkins-bot 2a8c61b57f Merge "Support an "other" page for special characters" 2015-03-30 20:51:23 +00:00
jenkins-bot 2dbe12bc66 Merge "Handle a further 70 WikiEditor special characters" 2015-03-30 20:50:19 +00:00
Timo Tijhof eca25738df mw.Target: Defer parsing of edit notices to MWNoticesPopupTool
Also use an array instead of an object. The keys were already
meaningless (index numbers). A "wikimedia/*" Git search did not
show any usage outside MWNoticesPopupTool. However, the array is
backward-compatible with any code using it as an object for keys
or looping (just in case).

This should also make the order more reliable.

Bug: T87412
Change-Id: I683cc902bda5ba768e962af6725e657871b79b9a
2015-03-30 20:47:25 +01:00
Timo Tijhof 97d7da6643 mw.Target: Remove visible text filter for edit notices
This removes the hack for bug 43013, since T91715 has been fixed.

Bug: T87412
Change-Id: I7f477d0815a8b9a7ca2f4405e4c2d6e914868c56
2015-03-30 20:43:25 +01:00
jenkins-bot c9084affd9 Merge "Try not to die when RESTbase returns a 404" 2015-03-30 17:40:11 +00:00
Ed Sanders 8c0122a2d5 Update border width transition hack
Upstream was reduced from 4px to 2px so reflect that here.

Change-Id: Id8990d15b9fbd4207648c5c93492fb37e5fdab5e
2015-03-30 14:40:17 +01:00
Alex Monk c68b58eedf Try not to die when RESTbase returns a 404
Just assume content = '' like we did with Parsoid

Change-Id: I1b076f4e37a8c54733da0e4535adb7a50ae2a7e5
2015-03-30 08:44:31 +01:00
Alex Monk 5af4564097 Support an "other" page for special characters
Change-Id: I9a1404dff1a970fbbc7bdf822398dbb7057159bf
2015-03-30 03:02:10 +01:00
Alex Monk 14d5b4e930 Handle a further 70 WikiEditor special characters
VE core changes would be needed for the remaining 9. (To deal with 3 titles in
the UI, and 6 encapsulating the selected text with one character before and one
after).

Change-Id: Id7c0fa06b1c873ab286cffb7a83016a2d37ab744
2015-03-30 02:26:11 +01:00
jenkins-bot 4b2ee8f310 Merge "Load all of WikiEditor's special characters" 2015-03-28 03:00:06 +00:00
jenkins-bot 08afdfadbd Merge "Use parseInt(), not Number.parseInt()" 2015-03-27 23:23:22 +00:00
Roan Kattouw b858332667 Use parseInt(), not Number.parseInt()
For whatever reason, Number.parseInt doesn't exist in IE11.

Change-Id: I62366ee027283a8f70d3fff2e29c4f333ad5f697
2015-03-27 16:14:13 -07:00
Alex Monk e084df2df6 Load all of WikiEditor's special characters
Relies on If9c5cdbe and I8fafd734

Bug: T91608
Change-Id: I3fafc561ceae969e4ecc12881154cd8a3568bebb
2015-03-27 22:13:38 +00:00
jenkins-bot 4fbb11e40a Merge "Verify welcome dialog exists before trying to close it" 2015-03-27 18:48:39 +00:00
Moriel Schottlender db9e565a09 Verify welcome dialog exists before trying to close it
When deactivating, verify first that the welcome dialog was
initialized before calling 'close' on it.

Change-Id: Ife98b396f3d8641e2bd313c549fe867bcd84db9b
2015-03-27 11:45:26 -07:00
Bartosz Dziewoński 4bfc19349a Correct font sizes of everything on MonoBook
This is not pretty and probably isn't optimal, but it works well
enough. The bug about getting rid of this all is T91152.

Bug: T94071
Change-Id: If926286f1d0c7835489914ed653a0d65ed24f53a
2015-03-27 19:42:33 +01:00
ecotg 175e60edaf Strip X-Parsoid Performance Headers from Visual Editor
Stripped out X-Parsoid Performance Headers, previously used to gather and
forward Parsoid's performance information, from ApiVisualEditor.php,
ve.init.mw.Target.js and ve.init.mw.TargetLoader.js. Change I936ada7b1 strips
out the corresponding X-Parsoid Performance Headers from Parsoid. Parsoid's
current performance instrumentation is achieved using Graphite and txstatsd.

Change-Id: I57d6f866a7d8287a5115e6236b0fb25bc4d0eabd
2015-03-27 12:03:15 -06:00
Roan Kattouw 6bd5142f2a When content and metadata have different revids, explicitly retry the higher one
It's much less likely we'll get another conflict if we retry
with ?oldid=12345 than if we retry omitting the oldid again.

Change-Id: I10e40f714fd44d7f0ac16c9d0dc6239a95c0ec51
2015-03-26 16:07:43 -07:00
Roan Kattouw b19104ed04 Send requests to RESTbase directly when so configured
Also introduces paction=metadata in ApiVisualEditor which
doesn't hit Parsoid but gets all the other information we need.

Bug: T90374
Change-Id: I71edbc0f8dc15a6f8d3672c10ca3c641cc172be7
2015-03-26 16:00:54 -07:00
jenkins-bot 25aedfd0fb Merge "Show beta welcome dialog before surface is ready" 2015-03-26 19:40:54 +00:00
Moriel Schottlender 74c3b758e2 Show beta welcome dialog before surface is ready
Split up beta and meta dialog show methods so that beta dialog
is displayed as soon as possible, regardless of the surface being
ready. Also make sure that we destroy the temporary window
manager on destroy.

Bug: T90454
Change-Id: Ib8f94518af431487ce940a74a8c268dbdbe403d2
2015-03-26 12:36:40 -07:00
Alex Monk 024823e560 Fix revId check on new pages
Makes it possible to edit new pages again.

Follows up Ifbf44b7772

Change-Id: If170a367dc2f531d11f09569c7ab45ebd414dff6
2015-03-26 17:39:45 +00:00
Alex Monk 9019f02130 Check for the two revision IDs returned by the server being different
With RESTbase we'll be able to retry the older one, but right now we have to do
both with the same request.

This commit retries loading once, then starts emitting errors.

Bug: T92993
Change-Id: Ifbf44b777279dafbe31ab438838d70acd44de726
2015-03-25 20:46:27 +00:00
jenkins-bot 5f3e0b033b Merge "Emit activation entry/exit traces at the appropriate times" 2015-03-25 03:15:56 +00:00
Amir E. Aharoni 1d1ffac74e [BrowserTest] Capture the whole formatting button in the screenshot
This makes the screenshot nicer and more complete.

Change-Id: I0dd9efd2978ff5468ab6101b11b7e6fdd3b0da30
2015-03-24 12:34:42 +02:00
Ori Livneh 13292744b1 Emit activation entry/exit traces at the appropriate times
Due to changes in the way VisualEditor is loaded, the trace.activate.{enter,exit}
events no longer enclose the entire VisualEditor initialization process. This
change ensures that trace.activate.enter is emitted as soon as the user clicks
on an edit link / tab and that the trace.activate.exit is not emitted until the
toolbar has been fully activated.

Change-Id: Ief798faa95a58898b9ae4dcbbbd30506c5dbd9a7
2015-03-23 23:19:12 +00:00
Ed Sanders e006449c7f Vertically center the progress bar within the visible part of #content
On short pages which don't extend below the fold, the progress
bar should center within the #content element.

Change-Id: I0b99e42f5bab8177d3b4ca6dd372d6403ae9b136
2015-03-23 02:34:40 +00:00
Ed Sanders 6d8fbd8221 Make loading progress bar determinate
Estimate loading times to show smooth loading progress.

Bug: T90622
Bug: T92456
Bug: T52206
Change-Id: Ic6e31a938b474c5a11c0c12302ec6c0ebc2c414d
2015-03-20 20:08:01 +00:00
Alex Monk 74cb83d2f8 Fix edit conflicts
When we moved to mw.Api, edit conflict errors stopped going via onSave and
started going to onSaveError instead. So the case to check for them in onSave
would not have worked - instead, they would go through onSaveError and get
picked up by our unknown error code, which just picks out error.info and shows
it, instead of showing our edit conflict screen.

Also return in a couple of other error cases where we probably should've been
(but not necessarily must've been... that didn't necessarily show to the user
if another error emit already caused saveDeferred to be rejected)

Change-Id: Iae7a66a8aa96ee777e9fa780005feeb429129d5f
2015-03-19 02:36:21 +00:00
Ori Livneh 94877eb668 Set mwtiming events' target to 'mwTarget', if unset
We're currently rewriting "mwtiming.performance.system.domLoad" to
"timing.ve.undefined.performance.system.domLoad". The "undefined" comes from
the missing targetName property on the event. I'm not sure why it is missing,
but having it default to 'mwTarget' will Do the Right Thing™.

Task: T93156
Change-Id: If70ff601b6c54ec8f95171cbc43c82c87a177508
2015-03-19 00:40:28 +00:00
jenkins-bot 1046d309b2 Merge "Handle TitleBlacklist errors" 2015-03-18 22:44:36 +00:00
Alex Monk 88088d4ecc Set action.saveFailure.message key in Edit schema
This relies on WikimediaMessages' version of the Edit schema being updated at
the same time.

Change-Id: Iee97fdd2a867f2c252ca7756f2e6341377d9fbb7
2015-03-18 22:24:40 +00:00
Alex Monk c286511f17 Handle TitleBlacklist errors
Relies on I69cf0a88

Using our own new message because TitleBlacklist's own one includes text that
we can't parse on the client and relies on a parameter we don't get from the
API.

This relies on WikimediaMessages' version of the Edit schema being updated at
the same time.

Change-Id: I4c75369b8b97973b72899bfaecbd5a996a440c68
2015-03-18 21:58:51 +00:00
jenkins-bot 05766564d1 Merge "Remove font tags on import (paste/drop)" 2015-03-18 18:29:57 +00:00
jenkins-bot 275ba972bb Merge "Follow-up f620111b: pass parameters to fallback requestPageData() call" 2015-03-18 18:25:24 +00:00
Ed Sanders ba20a26292 mw.ViewPageTarget: Grey-out body content as soon as edit is clicked
Set 've-activated' as soon as edit is clicked, with a 've-loading' state.

This necessitates moving the relevant styles to mw.ViewPageTarget.init.css.

Change-Id: Ic9757cdbf63a2f72eda0dd03ff5588d79028ba0e
2015-03-18 17:56:28 +00:00
Roan Kattouw 3375411afd Follow-up f620111b: pass parameters to fallback requestPageData() call
Bug: T93036
Change-Id: I84eba70d9c0af63b442993c8c59fee89da45c14f
2015-03-18 16:23:37 +00:00
Ed Sanders fbe207fabf Remove font tags on import (paste/drop)
Change-Id: I46c7d4aee2f35ccf8ab6967c0273bc46c5a79347
2015-03-18 08:51:13 +00:00
jenkins-bot 4ef6eb8010 Merge "Unbreak TargetLoader when ViewPageTarget.init isn't present" 2015-03-18 00:42:10 +00:00
Roan Kattouw 812cb9aa2c Unbreak TargetLoader when ViewPageTarget.init isn't present
By lazy-initializing mw.libs.ve

Change-Id: I2fea8a0935b43b5a25287f68bd7487c448d006b6
2015-03-17 17:38:29 -07:00
Alex Monk aac31c9c72 Fix action.abort.mechanism value in ViewPageTarget#onUnload
Was causing EventLogging schema validation failures.

Bug: T92869
Change-Id: I6ecdb4b5b39fe05448664316894314492da4379b
2015-03-17 19:02:44 +00:00
Roan Kattouw f620111b9e Send Parsoid API request immediately when user clicks edit
Move requestPageData from mw.Target to TargetLoader, call it
in init init, and pass the promise it returns into load()
via activate().

Bug: T90372
Change-Id: I828b8474e5a76b3d0d7d08735b4d865c29d2f820
2015-03-16 08:56:42 -07:00
Roan Kattouw d371014e5d Load RL modules in one load.php request, rather than in two stages
This introduces TargetLoader, which manages plugins and RL modules
in a slightly more generic fashion so that Targets themselves don't
have to. This allows us to load all RL modules in one load.php
request, rather than first loading ViewPageTarget which then
loads the other modules.

TargetLoader loads in the bottom queue, so it will be loaded
as part of the main load.php request, but in VPT.init.js we
still have to wait for it with using() because it might not
have arrived yet. This also degrades gracefully on cached pages
where TargetLoader isn't in the bottom queue: it'll be loaded
as a separate request instead, which is suboptimal but no
worse that what we were doing before.

Right now TargetLoader is small enough that it could also be in
the top queue, but in the future we want to add things like
the action=visualeditor API request to it, and mw.Api is
relatively big.

Note: this also makes a breaking change to the plugin API:
plugin callbacks no longer receive the target instance
as a parameter, as they're now executed before the target
has been constructed rather than after. In the long term,
if we want to give plugins access to the target instance,
we could give them the target promise somehow. For now,
I've killed this feature because nothing used it and
the change from a direct object reference to a promise
would have been a breaking change anyway.

Also fixed incorrect documentation index for ve.init.mw.ViewPageTarget.init.

Bug: T53569
Change-Id: Ibfa6abbeaf872ae2aadc6ed9d5beba7473ea441a
2015-03-15 03:43:05 +01:00
Timo Tijhof 93f5697586 mw.ViewPageTarget: Hide ve-ui-surface during activation as well
Follows-up 77f016a.

Bug: T91442
Change-Id: I69072b25add712c8acfcf6fc45aeb6abe8afb0c2
2015-03-12 16:04:13 +00:00
Timo Tijhof caa58d31c5 mw.ViewPageTarget: Hide ve-ui-surface instead of ve-ce-surface
ve-ce-surface is a child of ve-ui-surface. The ve-ui-surface has
margins that would remain in the document flow causing a temporary
growth outwards to the bottom during deactivation (causing the
white area and blue border on Vector's grey background to move down)
after which it would restore again.

Follows-up 77f016a.

Bug: T91442
Change-Id: I5b999b580c968fcd24f07d9a895cfa17afc80c0d
2015-03-12 17:03:30 +01:00
jenkins-bot 9249b4a70f Merge "ve.init.mw.ViewPageTarget: Recalculate toolbar sizes when adding "Save" button" 2015-03-10 21:48:06 +00:00
jenkins-bot 46a9718c74 Merge "Focus the surface after VE is already active" 2015-03-10 20:57:58 +00:00
jenkins-bot a9f2b7e717 Merge "Remove unused iconModuleStyles property" 2015-03-10 19:50:14 +00:00
Roan Kattouw afa4f20e62 Remove unused iconModuleStyles property
It seems to have been intended to allow overriding of which icons
are used, but this isn't used anywhere.

Change-Id: I312f6c8e69d5a4d9c11f4af5f9487d0890a1f4e1
2015-03-10 20:32:47 +01:00
Moriel Schottlender 1fd395e26e Focus the surface after VE is already active
Move the surface focus() call to be done after VE has loaded, to
make sure that the position of the content editable field is at the
top of the page and not -- as happens in Firefox -- after the read
page contents.

Bug: T90420
Change-Id: If91cea42c083d67b1ee6396402c3f607dde70471
2015-03-10 19:22:17 +00:00
jenkins-bot ff31db5314 Merge "Reduce complexity around onbeforeunload handler" 2015-03-10 19:17:34 +00:00
jenkins-bot 07f2992a6a Merge "Do not call Toolbar#initialize twice during editor setup" 2015-03-10 18:16:09 +00:00
Bartosz Dziewoński 11d9c55b07 ve.init.mw.ViewPageTarget: Recalculate toolbar sizes when adding "Save" button
This really should not be necessary.

Depends on I17d22ba6 in OOjs UI.

Bug: T52227
Change-Id: I024dccb0c1cc24dd8390dd44fb7a2d987eef56ea
2015-03-10 17:30:56 +00:00
jenkins-bot 557e0e28ad Remove use of ve.indexOf and ve.getObjectKeys
Change-Id: Icbaa729209605fca8018e4bcbbe29c9ded64e7f2
2015-03-10 17:28:00 +01:00
Bartosz Dziewoński 1dced9e78d Do not call Toolbar#initialize twice during editor setup
Depends on Ib9471bc0 in VisualEditor core. Without that patch
this is actually necessary, because we were removing some event
handlers in the meantime.

Change-Id: I145f1891efd1c91eeb6154e11e96e3fc160e2be3
2015-03-10 14:11:16 +00:00
jenkins-bot eb79687c83 Merge "mw.ViewPageTarget: Hide ve-ce-surface during deactivation" 2015-03-10 09:58:52 +00:00
Timo Tijhof c1accbb61d mw.ViewPageTarget: Cache '#mw-imagepage-content' query
Follows-up eb7b727a53.

Change-Id: If8bed5626ccba9e69d30b770bb2eeed3c6264c7d
2015-03-10 02:53:05 +01:00
Timo Tijhof 77f016ae8f mw.ViewPageTarget: Hide ve-ce-surface during deactivation
While showing the content earlier as soon as possible is nice, the ve-ce-surface
remained visible until toolbar and surface were torn down.

This avoids the split second where the new pageview content *and*
CE surface were visible in the page (this it also messed with the scroll position,
and would temporarily cause a scrollbar to appear).

Bug: T91442
Change-Id: I0a7232cd0264bff28ad66aa328de29d339891aa1
2015-03-10 02:48:24 +01:00
Bartosz Dziewoński d5bf7e9e9e ve.init.mw.ViewPageTarget: Use mw.Api#postWithToken for setting hidebetawelcome pref
We can't use it for saving because we need to display a warning if
the user's identity changed.

Change-Id: I05919e407cd19d96c506671020bcdb95f3e2acaf
2015-03-06 11:11:03 +00:00
Bartosz Dziewoński 1656d3495e ve.init.mw.Target: Don't go into infinite recursion on API errors
The #tryWithPreparedCacheKey method was assuming that the request
could only fail because of invalid cache key. It can also fail because
of a bad token, and probably for a number of other reasons.

So only retry only once, and then fail. If it's a 'badtoken' error
during save, the caller will handle it and retry with a working token.
If it's something else, who knows, but we don't go into infinite loop
at least.

Failing in a way that will be handled is weird because 8e48f945 changed
the signatures of the promises, but not the functions that use them.
This must be fixed later.

Bug: T91158
Change-Id: I103cf888d339b44e3fd4fe2376edf5e37ce4157f
2015-03-06 02:47:47 +01:00
Ed Sanders 94fe054257 Update VE core submodule to master (a65ad7c)
New changes:
a65ad7c Move special character inserter to toolbar dialog manager

… and add it to the toolbar as a terminal option.

Change-Id: I35834d866a13c5dea7f5a520c63b8a99451fcf6d
2015-03-03 18:20:13 -08:00
Roan Kattouw ea3fccccaa Reduce complexity around onbeforeunload handler
We used to attempt to not break Firefox's bfcache, but this
didn't really work very well, and it's not clear that avoiding
bfcache breakage is even a good idea. It's more sensible and
consistent to deliberately break bfcache while VE is active.
On top of that, the Firefox people believe that our trick
shouldn't even have worked to begin with:
https://bugzilla.mozilla.org/show_bug.cgi?id=1102664

Because the onbeforeunload handler is removed when VE
is deactivated, bfcache still works if you first click
Read, then navigate away.

Also clean up the management of the unload handler, using
addEventListener() and removing the return value fallback
code that is needed for beforeunload but not unload.
For beforeunload this is harder to clean up because
the addEventListener()-based API for returning a value
isn't consistent across browsers.

Change-Id: Ie4fe9ea3a59a54ba462733aa5e42bfc0ed5b15eb
2015-03-03 16:36:22 +01:00
Alex Monk 6f1b6c85a5 Send abort event on unload
Still misses some preinit aborts because we need to figure out
a way to attach the unload handler early enough to catch these.

Change-Id: I0ce721e24e69c31318064c6b443c1bfe01077546
2015-03-03 15:25:57 +00:00
jenkins-bot 4b840ab725 Merge "Promote the Language tool Beta Feature to always-on status" 2015-03-02 23:58:27 +00:00
jenkins-bot 91d0c4ff03 Merge "mw.ViewPageTarget: Use CSS for toolbar transition" 2015-03-02 11:39:13 +00:00
jenkins-bot 78a014ce9f Merge "Show the toolbar as soon as the target has been activated" 2015-03-02 11:32:48 +00:00
James D. Forrester bddd84b1e9 Promote the Language tool Beta Feature to always-on status
No complaints in over nine months. Time to just make this available.

Change-Id: I601699573c0d50384720e5a1f0098c7f780de8cf
2015-03-01 17:15:48 -08:00
jenkins-bot 6c5cb61139 Merge "ImageInfoCache: Don't try to access imageinfo result if it's not set" 2015-02-28 01:40:52 +00:00
Alex Monk 944e7d7a86 ImageInfoCache: Don't try to access imageinfo result if it's not set
Bug: T90916
Change-Id: Iebd393b0cff8016cc8917b86ca277eddf7810d4e
2015-02-28 01:25:12 +00:00
Roan Kattouw 2b67617179 Make generateCitationFeatures() idempotent
Add checks so it doesn't generate and register the same
tool twice. This makes it safe to run it multiple times.

Change-Id: I882b51bd0422222f2e80555910c69b059136a503
2015-02-27 16:18:15 -08:00
Trevor Parscal 34da7d56b8 Update VE core submodule to master (2e1a0bb)
New changes:
04a5947 Localisation updates from https://translatewiki.net.
dd4691b Update OOjs to v1.1.5
2e1a0bb Context refactor

Local changes:
Add context item support for references, citations, templates and links

Change-Id: I5d488ecbf9768dc63de6e545505dbfd5eb84cc61
2015-02-27 18:21:13 -05:00
Alex Monk a6dbdb4788 Follow-up I18162f04: Send uselang parameter with paction=parse request
Change-Id: I70c2e6c448c175ebe9d46c2003499e22a79b28b1
2015-02-26 01:45:48 +00:00
Alex Monk ac2242af5f Follow-up I18162f04: Set contentType: 'multipart/form-data' on some requests again
But not all

Change-Id: If9d88bb8d6c532992e8118e504f2fae45c0ca96a
2015-02-26 01:24:16 +00:00
Alex Monk 8e48f94580 Use mw.Api to run requests rather than our own stuff in ve.init.mw.Target
Bug: T58659
Bug: T89435
Change-Id: I18162f04c50f48606378aed62ee99fccdc3159f6
2015-02-25 01:57:22 +00:00
jenkins-bot 057b24ce13 Merge "Factor out the Parsoid API request into its own method" 2015-02-24 02:45:20 +00:00
Roan Kattouw 86e1d1214b Factor out the Parsoid API request into its own method
This will allow us to more easily split the API request
into two requests (one for the HTML, one for metadata)
by returning a $.when() promise, and to initiate these
requests earlier (by storing a promise and returning it
in this method).

Change-Id: I4a5d1b8c47a3dc2edfe89925e63dcf90d7038e45
2015-02-24 02:41:21 +00:00
Ed Sanders d73e9d6a84 Update VE core submodule to master (e6a37e2)
New changes:
822236c Simplify slug behaviour

Local changes:
Add Vector-specific rules for slug animation

Change-Id: I812f6f8afc8733aae245f3606302f032e5e54675
2015-02-23 17:18:40 -08:00
Timo Tijhof 1c5c13fd16 mw.ViewPageTarget: Use CSS for toolbar transition
The toolbar now uses a CSS transition for its height instead of
JavaScript animation through slideDown().

* The animation is on toolbar instead of toolbar-bar so that it
  contains the padding and borders. Otherwise it slides up until
  there is the top and left (quite thick) borders stacked on
  each other which then disappear at once.

* Add transform/translateY so that toolbar also transitions
  when it is in floating state.

* Move class addition to attachToolbar() to avoid additional
  reflow.

Bug: T89543
Change-Id: I30a7b69b77b874d220f60ebe7f7e616cd77bcc36
2015-02-23 19:25:58 +00:00
Ed Sanders 703b2c2ed0 Show the toolbar as soon as the target has been activated
Still to load at this point are
* Additional modules (first load only)
* Parsoid HTML

To account for this we disable the toolFactory event listeners
to prevent flickering, and create a hidden blank dummy surface to
attach the toolbar to.

Bug: T76523
Change-Id: Iab24858f23f4db944dcaa6683a82b950ea9ee1b1
2015-02-23 17:50:17 +00:00
Timo Tijhof 4c1de2edb2 mw.ViewPageTarget: Remove obsolete transitions for margin
These were there to match Vector, however as of 4cec8a70589
Vector no longer has these. Having these in VisualEditor causes
the toolbar to be a few pixels behind (like a slingshot) when the
rest of the skin has already moved.

Change-Id: Ia5886a58316ccb3b0420553c3f466b5256089c73
2015-02-23 17:16:46 +00:00
jenkins-bot f17414f9d5 Merge "Use prefixed page title for browser title bar" 2015-02-23 17:12:20 +00:00
Roan Kattouw f69eb9fef8 Use prefixed page title for browser title bar
We can't use wgTitle directly because it has spaces
but no namespace prefix (e.g. "Foo bar"), and we can't
use wgPageName directly because it has the namespace prefix
but underscores instead of spaces (e.g. "Project:Foo_bar"),
so run wgPageName through mw.Title.

Bug: T90433
Change-Id: If431f5b9f6efa2690cfd964f80d6ac71cb568087
2015-02-23 08:55:47 -08:00
jenkins-bot d9734f56ad Merge "mw.ViewPageTarget: Remove workaround for cascading defaultUserOptions" 2015-02-23 16:51:12 +00:00
Roan Kattouw c57b89616d Follow-up 14a4a4ae1: *actually* fix back compat for this.timeStamp
Introducing a variable doesn't help if you then don't use it :|

Change-Id: Ibf1c230dcb8b17941fcd6e0c82dd7a054a3287f0
2015-02-23 16:14:07 +00:00
Timo Tijhof 60e5ac0902 mw.ViewPageTarget: Remove JS animations from transformPage()
Follows-up 62c1d64ad0.

* Remove '.mw-indicators' animation for opacity. Was a left-over from other
  elements previously stripped in 62c1d64ad0.

* '#siteNotice' no longer slides. It's hidden at the same time as '#contentSub',
  '#toc', and other elements. This is an annoying jump, and we should find a
  way to do it consistently and in a performant manner.

* Fix state classes added in 62c1d64ad0. During deactivation, the ve-active
  class was kept for too long. This created a temporary state in which ve-active
  *and* ve-deactivating were applied. This was harmless as nothing ises the
  've-deactivating' class yet.

* Leaving toolbar as-is for another commit.

Bug: T89543
Change-Id: Ide49f93c45a12f2c13eb4412a9a16a82fefeb43e
2015-02-23 09:08:21 +00:00
Timo Tijhof f687ba7ce0 mw.ViewPageTarget.init: Add missing 'return target'
Follows-up I002322beaae. I had this in the local patch but got
lost in rebasing. The missing return statement caused an uncaught
error when clicking section edit links as it was not forwarding
the return value.

Change-Id: I66b6a789f7182a4446122e94f19cfdb324f8d675
2015-02-23 08:51:20 +00:00
jenkins-bot 07077da54e Merge "mw.ViewPageTarget.init: Reduce duplication around getTarget() calls" 2015-02-22 21:44:36 +00:00
Roan Kattouw 14a4a4ae1e Follow-up 9b582485: implement back compat for timeStamp correctly
timeStamp was used in two places, but we only had back-compat
code in one, so the other ended up using NaN.

Bonus: make jshint happy with the indentation of the $.extend() call.

Change-Id: I69000d11822658f2a227f9756093bc278f5fbaf5
2015-02-22 18:33:19 +00:00
Timo Tijhof a34ccc2f3b mw.ViewPageTarget.init: Reduce duplication around getTarget() calls
De-duplicate the logic of:
* Call showLoading()
* Call getTarget()
* Call activate()
* Bind always(hideLoading)

Also use then() instead of done() on getTarget() so that failures
propagate to the always() handler. Previously the interface would
indefinitely be in a loading state if target fails to load.

Change-Id: I002322beaae64c0de96457eb56dbc68a5fc16369
2015-02-22 15:30:25 +00:00
Ed Sanders db8a36820d Use new attachToolbar method for attaching the toolbar
Depends on I53f032e59 in core.

Change-Id: I85cb73a0ead6c73915b25f5be09c898cb5e1ecb4
2015-02-21 22:29:05 +00:00
Timo Tijhof 5fa98dc803 ve.init.mw.ViewPageTarget: Avoid content shift due to #contentSub
While #contentSub element tends to be empty, it does take up
line-height in most skins (incl. Vector). Previously, hiding this
would cause the content to be shiften upwards one line, only to
be shiften down one line again once activated.

While there are other edge cases to be straightened out, this
makes the content a lot more stationary during activation.

Change-Id: I784436c0f60a63e1a77aba5b8afeacbbdd6932be
2015-02-21 21:18:37 +00:00
Timo Tijhof a3efd1e4f5 ve.init.mw.ViewPageTarget: Update toolbox on activated instead of active
This hides the links at the same time as other parts, right when the
module is loaded, instead of after the surface is ready.

Change-Id: Ifda6985636f354060f43b7e9ecc9425b30c513c9
2015-02-21 15:08:35 +00:00
Alex Monk c6dbdc92ea Don't try to route any events into schema.Edit if it's not actually installed
E.g. no WikimediaEvents

Bug: T88667
Change-Id: I33a13abf22da0caa1282652fa1a078ffcae11e97
2015-02-21 02:41:33 +00:00
Ori Livneh 9b582485f9 Fix ve.init.mw.trackSubscriber.js
* Use the event's timeStamp rather than the current time in the event
  subscriber.
* Instead of using ve.trackSubscribeAll() and then branching on the topic
  prefix, just use ve.trackSubscribe( prefix, ... ) to bind prefix-specific
  handlers.
* Round timing measurements after performing arithmetic, and use Math#round
  rather than Math#floor.
* Rename 'getDefaultTiming' to 'computeDuration'.

Change-Id: I27ff1622ecea9b82d414f871441f127fc2dbd2cc
2015-02-20 14:00:26 -08:00
James D. Forrester a3d2516479 Blacklist Safari versions 6 and below; whitelist 7+
Change-Id: Ie21b15c0e591c0df0793fd58b550728150ed0999
2015-02-20 09:51:05 -08:00
Ori Livneh 429d55cda8 Update ve.init.mw.trackSubscriber to emit 'wgVersion'
Depends on I6cebac796: Update Edit schema to revision 11319708.

Change-Id: I31ce78a573ef0cdab1162c6b78142fd511b9e0ec
2015-02-19 11:20:53 -08:00
jenkins-bot 7c838d839c Merge "Don't log against undefined target constructor name" 2015-02-19 00:55:38 +00:00
Roan Kattouw 3611664663 Update VE core submodule to master (7d2a68e)
New changes:
0ceafd5 Fix V8 deopt for ve.ce.BranchNode#onSplice
01d2d4b [BREAKING CHANGE] Store originalDomElements instead of htmlAttributes
96005a7 Localisation updates from https://translatewiki.net.
42e672e ve.ui.Toolbar: Don't call #updateToolState from #initialize
373562d Localisation updates from https://translatewiki.net.

Local changes:
Update for htmlAttributes going away

Change-Id: I576a1e5d5883b03d1fff6666926f80a5682a280f
2015-02-18 15:35:46 -08:00
Roan Kattouw 71a26929e4 In setupSurface, build the model tree separately
Otherwise it gets built lazily when building the view tree,
and that makes it difficult to instrument it separately.

Change-Id: Ie8c2027e87a87e59323165f0edbba49c4a66d1b3
2015-02-18 21:12:36 +00:00
Roan Kattouw 70db70bc0e Add a bunch of trace.foo.{enter|exit} events logged through ve.track()
Tracked stages are:
* activate: wraps the entire activation
* domLoad: API request for Parsoid HTML
* parseResponse: parse HTML, interpret things like link cache data
* convertModelFromDom: create linear model from Parsoid DOM
* createSurface: build DM and CE trees, create DM, CE and UI surfaces
* initializeSurface: initialize UI and CE surfaces, and CE nodes
* setupToolbar: toolbar setup and attachment
* initializeToolbar: toolbar initialization (deferred so not wrapped by activate)

Bug: T89536
Change-Id: Ife5664e872bad68dcf3c123f274f9c8a38a06031
2015-02-18 21:11:25 +00:00
Roan Kattouw 237bb053d6 Remove the sanity check
It's slow, especially on large pages, and it's triggered
very infrequently these days, and only for known bugs.

In the future we should replace this with a debugging
interface that displays the DOM diff between the original
DOM and the round-tripped DOM, as opposed to the boolean
interface we have now.

By extension, this also means the visualeditor-needcheck
tag won't be applied to new edits any more, although
its registration and messages are kept around because
edits with this tag still exist in page histories.

Bug: T87161
Change-Id: I909153492a5786b4b69fccd42ce3c1d4bdb3a059
2015-02-17 17:14:34 -08:00
Roan Kattouw 70c64e0613 mw.Target: Hopefully fix plugin garbage removal code
Follows-up 0547d8c8.

It's still very difficult to test whether this code works, but
doing $( newDoc ).remove( 'selector1' ).remove( 'selector2' )...
demonstrably doesn't work, because 1) the selector passed to remove()
filters the collection, it doesn't descend into it, and 2) remove()
returns the collection of removed items, so chaining it doesn't work.

Instead, use $( newDoc ).find( 'selector1, selector2, ...' ).remove();

Also normalise selectors.

Change-Id: I97f3b28c4d5120f08e5d7fbf4598ddc0c01d4ecf
2015-02-17 23:52:41 +00:00
Alex Monk 77b59981fa Don't log against undefined target constructor name
This targetName property is expected by the trackSubscriber code for mwtiming.

Bug: T89735
Change-Id: Ie75054a4eb3387f0be0decfe5499af40eea8c6c0
2015-02-17 20:30:52 +00:00
Timo Tijhof 7f05f8877e mw.ViewPageTarget: Remove workaround for cascading defaultUserOptions
Originally added in 5036099906.

* Account for bug T89513 for 'tempdisable' (was done for 'enable' in 9cba9910c6).

* MediaWiki core now loads user defaults in a separate module not
  subject to page caching, making our workaround obsolete.

  Keeping defaultthumbsize as that is intentionally ignoring the user's
  preferences.

Change-Id: I07a7aa8e08c728ddeba67f36a98e989c220dcb50
2015-02-14 03:20:59 +00:00
Ed Sanders 2b48c4991e Fix DOM structure on setup/teardown
* Ensure that the toolbar remains inside the target so that
  target triggers still work
* To keep the page title beneath the toolbar, move it inside
  the target on setup, and restore it on teardown
* Have teardownToolBar/DebugBar return promises so we know
  when teardown is completely finished.

Change-Id: If2a9ce9a653aed51d21c8e8dd7795f2533d54f70
2015-02-10 16:59:43 -08:00
jenkins-bot b4e20aacec Merge "mw.ViewPageTarget: Use CSS instead of JS for DOM hiding/muting" 2015-02-05 22:37:56 +00:00
jenkins-bot 3351d84bf0 Merge "[BrowserTest] Restore the indentation list screenshot scenario" 2015-02-05 09:17:55 +00:00
Timo Tijhof 62c1d64ad0 mw.ViewPageTarget: Use CSS instead of JS for DOM hiding/muting
* Use .ve-activated for elements changed in activate()
  - hideReadOnlyContent()
  - mutePageContent()
  - mutePageTitle

* Use .ve-active for elements changed in onSurfaceReady()
  - hidePageContent()

* Set 've-activated' class from activate() instead of transformPage()
  to consolidate reflows and minimise DOM interaction. It's still
  in the same (synchronous) execution path, but a few statements
  earlier now.

* Remove obsolete #toc wrapper. This <div> (with data property
  to distinguish it from potentially foreign parents in the future)
  was there to aid slideDown/slideUp animations, because those
  don't work well on table elements. See eba7d58dd1.

* Remove obsolete setTimeout in restorePageTitle().
  The removal of .ve-init-mw-viewPageTarget-pageTitle was delayed
  by one second (introduced in Ibc3fa2fb7 / 4cc88b9850). This
  was to account for a jQuery animation we no longer use.

* Remove unused '.ve-init-mw-viewPageTarget-transform-muted'
* Remove unused '.ve-init-mw-viewPageTarget-transform'
* Remove unused '.ve-init-mw-viewPageTarget-pageTitle'

The resulting stylesheet exposes that we're not consistent in
whether elements hide immediately (ve-activated) or once the
surface is ready (ve-active). This is intentionally kept as-is
within this commit.

Of the different elements that had their opacity changed, only
firstHeading was being animated. This animation was removed.

Bug: T88590
Bug: T87160
Change-Id: I87033456f715d99a88425e38e8ac5171144f4ec8
2015-02-04 19:24:29 -08:00
Alex Monk dd52503b6a Unbind watch event handler in VPT when necessary
Caught by Timo in I1df2836f

Change-Id: I0f0af71cdca26f7e8d13f9ea50d22c833b6e1683
2015-02-05 01:16:11 +00:00
jenkins-bot b43e798bb4 Merge "Make API module's LinkCache data transmission format more efficient" 2015-02-04 01:18:21 +00:00
Roan Kattouw e367ecc948 Make API module's LinkCache data transmission format more efficient
We used to send data like { title: { missing: true|false } }
With this change, we send data like { missing: [titles], existing: true|[titles] }
where 'existing' is set to true (assume all non-missing titles exist)
for current revisions and to an array of existing titles for
old revisions.

This is because we always output this data for links in the current
revision, even when loading an old revision: in that case we rely
on the client to request the omitted information, so there we can't
assume that all pages we don't have information about exist.

Bug: T88259
Change-Id: I7b58b3f669cc78fd81b60859cf76928a9087066f
2015-02-03 11:30:40 -08:00
jenkins-bot 0e926f5fcd Merge "Wait with showing edit notices until after the welcome dialog is closed" 2015-02-03 18:44:02 +00:00
Timo Tijhof 1d00894497 mw.Target: Add mw-body-content class before we attach surface
If added afterwards, this causes child elements styles with
'em'-values to get redrawn (or even animated).

Bug: T88387
Change-Id: Ic1aba14b7cfe0ff6e7191f0b6052ed9cc4585fcd
2015-02-02 20:25:02 -08:00
James D. Forrester bed038b509 build: Bump devDependencies to latest
Updates:
* grunt-contrib-csslint  0.3.1  ->  0.4.0
* grunt-contrib-jslint   0.10.0 -> 0.11.0
* grunt-jscs             0.8.1  ->  1.2.0

For jscs, leaving requireSpacesInsideArrayBrackets to avoid headaches for now.

Change-Id: I62d34444edbba65c8bd22d2fa5e50e16cabb0042
2015-02-02 14:30:39 -08:00
jenkins-bot d5f7bac940 Merge "Combine imageinfo requests" 2015-02-02 19:32:00 +00:00
Bartosz Dziewoński c0d69dd3db Wait with showing edit notices until after the welcome dialog is closed
Its white overlay is pretty good at obscuring them, and the notices popup
would close when the dialog is closed, making it very easy to miss them.

Also fixed indentation.

Bug: T86987
Change-Id: I9f93c4169de98ef77a1eb33fd31a0ec524b6d2b7
2015-02-02 17:25:02 +00:00
Alex Monk 9841d1012c Update "Watch this page" option when necessary
On load and change the user presses the button

Bug: T78694
Change-Id: I1df2836f8ba4ae647bfb142513e5de9f32ecd0fe
2015-01-31 02:43:59 +00:00
Alex Monk 7876cc957a Combine imageinfo requests
By generalising LinkCache into ApiBatchQueue to request them all centrally

Bug: T75822
Change-Id: I097311ec2487bb1ae9f5d927c2c13c274ba716f9
2015-01-30 17:20:04 -08:00
Alex Monk f6bf40a19a Update permanent link and PDF download link oldids on save
Bug: T74461
Change-Id: Ic66de6e685d23cac1c9870529f42e1aa6348ac7a
2015-01-28 13:16:12 -08:00
Amir E. Aharoni 8da4c9b3cc [BrowserTest] Restore the indentation list screenshot scenario
* Add a class to the indentation toolbar button, similarly to what was done in
  Ib0cb67151d893a5d2efccf798d6b25d197ed34d2
* Fix the definition of the indentation pull-down element acordingly.
* Restore the Indentation menu screenshot scenario, which was disabled in
  I3e892baa9cb2c8c1303fab232a2b1c64ebdd8f26

Change-Id: If2d92aab6d04aa487d6f753fa7cac94f8d8215c8
2015-01-27 13:35:39 -08:00
jenkins-bot 7dee4f18d7 Merge "Don't rely on 'user' and 'site' modules working correctly" 2015-01-26 22:31:28 +00:00
Roan Kattouw 6623ff4197 Use DOM rather than jQuery for <base> resolution
Avoiding a Sizzle context switch, see https://github.com/jquery/sizzle/issues/311

Bug: T87416
Change-Id: I40dd2cb17f9c3d14d0ee1aa5b542263775feedb7
2015-01-26 10:00:32 -08:00
Alex Monk 34e4c6a51b Check for venotify on page load, not when VPT is created
Not sure what could have broken this or when. Or if it ever worked to be honest...

Bug: T58921
Change-Id: I069b5ccb4a78a6790e5791354402503676faa7fa
2015-01-22 23:50:02 +00:00
Bartosz Dziewoński 4cce592cce Don't rely on 'user' and 'site' modules working correctly
I think somebody somewhere pointed to this as the reason why VE
wouldn't load when user's common.js has syntax errors, but I actually
can't reproduce that. Not sure if this is needed, but looks like a
good idea anyway.

(Once more, with feeling. Reverted broken attempt: aa531488.)

Change-Id: I252c5c20f75b3bbea51200560408dc4cfc7174f6
2015-01-13 19:18:54 +00:00
jenkins-bot c878a3e7e9 Merge "build: Bump copyright notices to 2015" 2015-01-13 16:21:37 +00:00
James D. Forrester 2f8b3e0d96 build: Bump copyright notices to 2015
Change-Id: Ie92dab7411116d3410195c3fb0a3513c664c0c30
2015-01-12 20:34:19 -08:00
James D. Forrester 6ce2210222 Toolbar: Make save button progressive, not constructive
Bug: T86507
Change-Id: I082d1b4ba09abf74e4c6438ef8b93fcc7de7a41b
2015-01-12 17:50:45 -08:00
Jforrester c17e3f89c6 Revert "Don't rely on 'user' and 'site' modules working correctly"
This reverts commit aa53148852.

Bug: T86550
Change-Id: Id97dec739939312caaa10d36197f105a595c1365
2015-01-12 18:49:39 +00:00
Bartosz Dziewoński aa53148852 Don't rely on 'user' and 'site' modules working correctly
I think somebody somewhere pointed to this as the reason why VE
wouldn't load when user's common.js has syntax errors, but I actually
can't reproduce that. Not sure if this is needed, but looks like a
good idea anyway.

Change-Id: I3abecacf083c1c9dfb2ea30207a9911eeea54b50
2015-01-11 19:01:56 +01:00
jenkins-bot d4aa0aef7f Merge "Add classes to toolbar UI elements" 2015-01-06 20:02:45 +00:00
Alex Monk 9600d28ebc Don't break "Edit source" link after VE has closed
Bug: T85552
Change-Id: I6db6fcff24110e749e3a0c1aa7c0528527b53d44
2014-12-30 21:07:04 +00:00
Amir E. Aharoni cd4bd7a73c Add classes to toolbar UI elements
This cleans up the selectors for the elements on the toolbar
so that they can be tested.

Class names in the form of ve-test-* are added to elements
that have words for labels: 'Paragraph', 'Cite', 'Insert'.
There is no other way to look up these elements in the DOM
except using the UI text, but it is different in different languages,
so this is unusable for the language_screenshots job,
which is multilingual by its nature.

Bug: T76143
Change-Id: Ib0cb67151d893a5d2efccf798d6b25d197ed34d2
2014-12-30 12:16:44 +00:00
Ed Sanders f49bbf783a Update setupToolbar signature in mobile target
This method now takes arguments to make sure they are passed.

Bug: T78710
Change-Id: Ifba696c2a1b60690bdccd1b58d347c254dec5432
2014-12-18 11:25:34 +00:00
Alex Monk c5d927552a Fix Ia6bf604c: Update another caller to ve.init.mw.Target
MobileViewTarget.

Due to this being missed, pageName was getting set to a jQuery object,
which eventually got passed as a data value in a $.ajax call, causing
jQuery to emit a TypeError: Illegal invocation.

I guess this needs a MobileFrontend commit as well. Don't think it fixes
all the issues with loading VE mobile though.

Bug: T78710
Change-Id: I431a902563f608a7a33028cd60112f39c57000a4
2014-12-18 00:59:04 +00:00
jenkins-bot f1103d2bf0 Merge "VE-MW fix commit for I4efbae614e" 2014-12-17 20:03:46 +00:00
Roan Kattouw 08bebc9b2b VE-MW fix commit for I4efbae614e
Local changes:
* Call bindHandlers()/unbindHandlers() in activate/deactivate
* Extend onDocumentKeyDown rather than overwriting it

Change-Id: I0739e71781c5140c54512ab421bdcb6d1df5fbbe
2014-12-16 15:42:27 -08:00
Timo Tijhof 2b7ae8c175 Remove use of bind() for inline functions
Follows-up b0e8900, 447e8de, d3f26e65.

Contrary to binding a reference, this-overiddes for inline
functions gets messy and fragile. There's also a minor
performance overhead that can be avoided. No separation of
concerns, eiter, as the object is held by the closure.

Also:
* Remove left-over instances of @method.
* Remove redundant '0' argument to setTimeout.
* Use null instead of $ for apply() on static methods like $.when.
* Use .empty().append() instead of .html(). Does the same but
  without additional overhead and without confusion association
  with "html" which isn't used (it doesn't serialise and re-parse
  or clone, it just appends when given one or more nodes).

Change-Id: I797a3667c67d52568150be9be5d043d149f22077
2014-12-16 23:27:53 +00:00
Alex Monk f9339d070b Edit/view source tab: Do not hijack middle click to display confirmation, only left click
Middle click is supposed to open the link in a new tab.

Bug: T78546
Change-Id: I594f1dff072d54c0a8d7112a1eaa0c1c84d0ffc1
2014-12-15 20:24:11 +00:00