Commit graph

732 commits

Author SHA1 Message Date
Alex Monk 9900d42816 On serialization failure, reset document opacity.
In case we were switching to source.
Normally MWWikitextSwitchConfirmDialog#getActionProcess would do this for us,
but this closeWindow call doesn't trigger that, we can't get it by overriding
MWWikitextSwitchConfirmDialog#close either.

Bug: T134333
Change-Id: I66a12ff6d13601250b9d470e1be54fe38a1ef06c
2016-06-13 23:45:43 +01:00
jenkins-bot 6a6d3b9368 Merge "Fix loading bar opacity" 2016-06-07 14:07:48 +00:00
Ed Sanders 61cb539c7b Fix config of mobile surfaces
Change-Id: I0109a93a41b0387199a0424b60a26a415393bc5d
2016-06-03 10:51:42 +01:00
jenkins-bot 6e6d2bf66b Merge "Move $editableContent computation into overridable method" 2016-06-01 17:40:15 +00:00
Ed Sanders 538959dc49 Move $editableContent computation into overridable method
Change-Id: Ibb0b877a01f8982fb895616c4c0d3e897bf37c85
2016-06-01 09:58:17 -07:00
Ed Sanders 0a0ca68d62 Simplify teardown of toolbar save button
Bug: T136421
Change-Id: I6829ad75b93c6aa6c6db51b5c9cd84915c75cdb8
2016-06-01 17:52:58 +01:00
Ed Sanders b33cd5d8f1 Fix loading bar opacity
* Ensure ve-loading isn't removed early
* Quickly detach then reattach the loading bar during
  activation so it doesn't get moved and marked as original content

Change-Id: I263c9627348953a11966f8bcc435d0d89b0b6084
2016-06-01 14:52:57 +01:00
jenkins-bot d70485244d Merge "Allow extensions to support extra namespaces and content models" 2016-06-01 01:02:51 +00:00
Ed Sanders 796da84576 Allow extensions to support extra namespaces and content models
Change-Id: If67bab93da355da609b6df274514b5c72a6ed91a
2016-06-01 01:55:03 +01:00
jenkins-bot 337109fef1 Merge "Un-blacklist Firefox versions 12,13,14" 2016-05-31 16:55:38 +00:00
Ed Sanders 20fa650a6b Un-blacklist Firefox versions 12,13,14
T52720 (link corruption in FF13/14) appears to be fixed.
T52780 (editor not loading in FF11/12) appears to be fixed.

FF11 has a new issue where templates are normalised even
when not touched (T136607)

Change-Id: I34358e3d90b8186e6b89c04c038ab79c908fc81b
2016-05-31 09:46:50 -07:00
Ed Sanders 4d466f16b5 Add fallback selectors if image page has no existing local content
Change-Id: I1fac3b35b5d498115c96b07c29cf409be72a1389
2016-05-31 16:42:21 +01:00
Ed Sanders d6a770bb4d Remove unused namespace class
Introduced recently but then abandoned.

Change-Id: Ifa999f0e60fe1b6d68c63813025c9fd48b79ad5f
2016-05-28 20:54:24 +01:00
Alex Monk afd5944bde Followup I9280fe4d: Merge main case with default, they are identical
Change-Id: I280f0eba1c99f5e96ffe5466e8398115fbc5f4f8
2016-05-26 18:15:27 +01:00
James D. Forrester 1b9427c5dd Follow-up 1dc933be: Don't fatal when editing non-NS0/6/14 pages
Change-Id: I9280fe4d771cf7ce1ee3874a34d7a14b672b222c
2016-05-26 09:07:07 -07:00
Ed Sanders 1c5c1fc6b9 Append surface & toolbar components in the correct places
Use setSurface and setupToolbar to position the surface and the
toolbar save button in the DOM.

Change-Id: Ide634848f4e78501724c358bcb1fdab8abd491b9
2016-05-26 08:50:21 -07:00
Ed Sanders 1dc933bead Genericise target initialisation across namespaces
Define $editableContent on target construction, and mark
all non-ancestor nodes between that at the target container
as uneditable (50% opacity, no pointer events).

Bug: T58289
Change-Id: I7fe51104bd5aa1bd53ffc604e5f02752c7553578
2016-05-25 12:50:36 +01:00
Alex Monk 8c3dc0887d Don't show tab preference dialog again if it's already been shown
Bug: T135534
Change-Id: Ifecac607acccc0e18e61b07e8456566d4671aa1b
2016-05-20 02:36:25 +01:00
Alex Monk 349b1f5e57 Add WTE welcome dialog
Bug: T133800
Change-Id: I6eb43274e22f647958c3ab1b6d5c12b3dbea388e
2016-05-10 23:28:21 +00:00
Alex Monk 1ba035e053 Fix deactivating VE after user explicitly decideas to discard changes
Bug: T134794
Change-Id: Idf1941793317a6aff9fe57082b85e3ebff0c72b4
2016-05-10 23:39:57 +01:00
Alex Monk 3c55bfbb80 Add a hidden link with accesskey=v in SET prefer-wt mode and remember-last wikitext
Try to tidy up a bit of code in DAT.init.js as well

Bug: T116406
Change-Id: Iad1713e14ea1f982886ba06e0b722c554ab2b892
2016-05-01 21:01:57 +01:00
jenkins-bot 80636c235e Merge "Add a popup after switching into VE from WTE" 2016-04-25 22:42:55 +00:00
Ed Sanders 6efd583ff7 Add method that runs after activation, for overriding
Change-Id: I046583e61f328baddb0c09eaff122e991c85f992
2016-04-22 17:17:56 +01:00
Ed Sanders 7a007e2874 Create MW targets using a factory
Move the existing static property 'name' to 'trackingName'
to make way for a real registry index.

Change-Id: Iab0d5be611ece7038234551c4847b07517b4348d
2016-04-21 21:06:39 +01:00
Ed Sanders 7576810b28 Use Array.prototype.indexOf in support check
The SupportCheck method asserts that the method is available so use it
instead of the confusingly named jQuery version.

Change-Id: I2105384cc4f6f2ec1cdb24a7bf3b0f4cce7672d3
2016-04-21 12:41:13 +01:00
Alex Monk 0bbe2e38ee Add a popup after switching into VE from WTE
Bug: T131066
Change-Id: I2294da7d09dfbacb9187aba5e6e703511cec3c9f
2016-04-20 18:46:00 -07:00
Ed Sanders a6aa6daa28 Defer before restoring scroll position, and allow 0
Bug: T131791
Change-Id: Id48b913effe5313c193ce62b19faf5655278ff6d
2016-04-19 21:42:09 +01:00
jenkins-bot d4f9a85f27 Merge "Set mw.libs.ve.EditingTabDialog.static.message instead of passing it to setup data" 2016-04-17 17:49:28 +00:00
jenkins-bot 227de9cfef Merge "Close VE SET dialog when we deactivate" 2016-04-17 17:43:01 +00:00
jenkins-bot 299027e528 Merge "Don't select edit tab when VE is opened while user has prefer-wt pref" 2016-04-17 17:39:56 +00:00
Alex Monk 4ccc1ad5af Don't select edit tab when VE is opened while user has prefer-wt pref
You can still open VE with prefer-wt mode by going to veaction=edit, and
T116406 proposes making it accessible with a keyboard shortcut as well.

Change-Id: Ifc25b5147a96a200ac3a7de465d5cdf67e2e255b
2016-04-15 02:37:46 +01:00
Ed Sanders 011ff4e133 Replace transitionend event with setTimeout
transitionend events seem like a neater solution, but we should
migrate all of our code at once, and provide a polyfill for
browsers which don't support it (IE9).

Change-Id: If6ae030856f8e69cc8bb26f21bfed30d5d22775c
2016-04-14 16:21:41 +01:00
Alex Monk f3c5e2f410 Set mw.libs.ve.EditingTabDialog.static.message instead of passing it to setup data
Change-Id: I2bfb79e258253e00c9f856bbbb3c4efae55a128c
2016-04-13 22:46:14 +01:00
Alex Monk 47cfc03d72 Close VE SET dialog when we deactivate
You can trigger deactivation by browsing back.

Bug: T132494
Change-Id: I8f66e22a745d84a3ca4b144c389c3ae654974789
2016-04-13 22:41:27 +01:00
jenkins-bot 5dc1257507 Merge "More minor/watch checkbox state computation server-side" 2016-04-11 14:18:56 +00:00
Ed Sanders f342dc01c3 Adjust DOM and CSS so UI surface runs from top to bottom of page
Place things like the page title and redirect link inside a new
container $originalContent, which is appended to the surface
when ready. Replace margins with padding in various places.

This will allow us to surface-height-matching sidebar for dialogs.

Change-Id: I60d80fb303bdaf93e9d121f62d534ee3a3056e59
2016-04-11 13:18:36 +01:00
Roan Kattouw 12eb41acff More minor/watch checkbox state computation server-side
Following through on my threat from 72b0d2a19c (November 2013).

Change-Id: I0daeef2a0373bbdb06627053e9d726d6fc20a3f6
2016-04-08 18:02:01 -07:00
jenkins-bot 597a095a64 Merge "Ensure veswitched is not set when we set wteswitched in the URI" 2016-04-05 15:51:33 +00:00
Alex Monk 373a19f1cc Ensure veswitched is not set when we set wteswitched in the URI
veswitched and wteswitched together cannot result in any sane behaviour.

To reproduce:
* Open VE (while having multi-tab pref?), switch into WTE
* Make a change
* Switch into VE

Change-Id: I90e19169e3fab60ab876c8e4d349801309db262f
2016-04-05 01:27:37 +01:00
Alex Monk 7788aece55 After saving and setting HTML, set single-editor edit section handlers again
Change-Id: I6e0962271e7e1460abbe82864b47fddc5bd7f235
2016-04-02 09:53:25 +03:00
Alex Monk 4210c4bee0 Use veaction=edit in URL instead of action=edit when we're using multiple tabs
TODO: What about prefer-wt users switching from WTE?

Bug: T131064
Change-Id: I9aa701cbda3964decb8b1ee853c0a281567a0ccb
2016-03-30 02:54:01 +01:00
Alex Monk b1aebf0b48 Don't strip namespace from text that we replace firstHeading with
wgTitle is basically just $title->getText()
wgPageName is $title->getPrefixedDBkey()

So we need to take wgPageName and run getPrefixedText (difference is underscores
get replaced by spaces)

Change-Id: Ib99f0d20f1ba99338f80bbbf39cffd544887c3fa
2016-03-25 04:45:09 +00:00
Alex Monk 2063025237 Don't change focus to VE surface if we're opening the SET dialog
Bug: T130552
Change-Id: Idc4639bb3f51690a827bdbdb0419e9303dd39a1b
2016-03-23 01:08:32 +00:00
jenkins-bot 4e4684e7d0 Merge "Show redirect target inside target" 2016-03-17 22:54:39 +00:00
jenkins-bot 33c9055fdc Merge "Reload page after user selects multi-tab option of SET dialog" 2016-03-17 15:39:09 +00:00
Alex Monk 3288d4e3f9 Show redirect target inside target
Bug: T63861
Depends-On: I71d3d415fe918e8b0a090860cad9271092b1bd7e
Change-Id: I5a138b95e04773885ca9ee548026729805eb11f0
2016-03-17 15:21:06 +00:00
Alex Monk 02953f5d64 Suppress meta dialog on refresh pages if we want to show SET dialog
Bug: T129819
Change-Id: I1176d06e5a5f56f01528acd7d099c8be9d317e51
2016-03-15 08:10:46 +00:00
Alex Monk 3807a918f9 Reload page after user selects multi-tab option of SET dialog
Bug: T129510
Change-Id: I3fcac175f18d8159e6a5c4084668264d4705970c
2016-03-11 05:39:29 +00:00
Alex Monk 4462f2539a Suppress welcome dialog this time if we're showing the SET pref dialog
Bug: T129200
Change-Id: Iaa6d80df930cfcbd243efd31437cb8707da35c06
2016-03-10 17:54:15 +00:00
Timo Tijhof cf1d7c0dab mw.DesktopArticleTarget: Fix "Uncaught: Cannot read done of undefined"
Regression from 863a2c2974.

Sometimes when clicking "Switch to source mode" in the toolbar this
error is thrown and the interface freezes because setEditorPreference()
only returns a promise if the value is different.

> Uncaught TypeError: Cannot read property 'done' of undefined
> - ve.init.mw.DesktopArticleTarget.switchToWikitextEditor

Change-Id: Ie59f06a8ed9af9c4fb8199b013c06992d0c4f700
2016-03-08 23:13:11 +00:00