Commit graph

167 commits

Author SHA1 Message Date
Ed Sanders 707628cfb1 [BREAKING CHANGE] Use save dialog in mobile
Bug: T96186
Change-Id: I4319e23da2d1bfd0cbba9719dbc9642a233bdf67
2015-08-06 21:52:14 +00: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
Ed Sanders 92cc1d1b53 Use super constructors in ArticleTargets
Change-Id: I58041de7421232dabe4541d438dd7cc66e3c8d92
2015-08-03 00:35:01 +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
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 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 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 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
Renamed from modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js (Browse further)