Commit graph

1324 commits

Author SHA1 Message Date
Alex Monk 984823a77d Replace section edit click handlers in DAT instead of doing it badly in init
If you deactivate without saving (e.g. using the back button), the page
contents aren't replaced and so adding the page click handlers is pointless
and harmful because they will run twice.

This was my fault in Iad1713e1

Bug: T135387
Change-Id: I3c83009bfc0f42125cdcde7f7a51de9bc2f72abf
2016-06-29 03:58:57 +01:00
Tpt 2a2a041933 Allow extensions to register a specific target per content model
Bug: T138489
Change-Id: Ic9d2fa34b90afc58f7e31adf38f97a701aac64f9
2016-06-24 15:38:28 +00:00
jenkins-bot 4973740ae3 Merge "Make visualeditor-quick-access-characters.json always exist" 2016-06-24 10:04:53 +00:00
Alex Monk 4382e18385 Fix our display of redirects during and after editing
Change-Id: Ib559eb8fb8a2643af25ad8df858212f3e9d14b13
2016-06-15 20:25:59 +01:00
Alex Monk 3bda9a75aa Set an automatic summary of empty string when switching from VE into WTE
So if the user supplies a summary in VE, WTE with the "Prompt me when entering
a blank edit summary" preference won't moan.

Bug: T135979
Change-Id: I0e2d2b6f8fb03bb56d600f1118daf82fb3715b66
2016-06-15 18:37:56 +01:00
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
Alex Monk 0659207900 Call child serializeSuccess/Failure in ArticleTarget#serialize
Instead of going straight to ArticleTarget's one.
This causes ve.init.mw.DesktopArticleTarget.prototype.serializeFail
to be called when using that target.

Bug: T134333
Change-Id: I6ec259830178439bc80ea162ba4ad035226022a7
2016-06-13 23:37:27 +01:00
Ed Sanders b104525c8c Blacklist article/section from external paste
Bug: T137441
Change-Id: I9ae85306a3220126462c69e4ea0a2a5e905fffa1
2016-06-13 12:22:10 +01:00
Alex Monk 28c30a3180 Make visualeditor-quick-access-characters.json always exist
Bug: T137368
Change-Id: I3f0f88495323b74d156c24939ca12840b4b970c5
2016-06-10 17:15:49 +01:00
James D. Forrester 5ecf40f51e build: Bump devDependencies to latest and make pass
babel-polyfill              6.8.0  →  6.9.1
 grunt-jscs                  2.8.0  →  3.0.0
 grunt-jsonlint              1.0.7  →  1.0.8
 grunt-stylelint             0.3.0  →  0.4.0
 stylelint-config-wikimedia  0.2.0  →  0.2.2

Change-Id: I4db467c7f2bc291a94e7bab86d18e48a44f6054c
2016-06-07 17:17:02 +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
Bartosz Dziewoński adffe3788c ve.init.MWWelcomeDialog: Don't mess with the actions dynamically
This removes an "ew" comment, which I presume indicates a hack.

Change-Id: I57dfb173d5f37466686f3f9dd9c97a5e7d685199
2016-05-31 23:15:49 +02:00
Bartosz Dziewoński 3dfd203d1b ve.init.MWWelcomeDialog: Fix keyboard focus on dialog actions
Just remove the setTimeout() call. See the task for explanation.

Bug: T135808
Change-Id: I24509046999ef06cef27adb9266167af29d5f76b
2016-05-31 23:05:38 +02: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
jenkins-bot eb9c346221 Merge "Update VE core submodule to master (a4a5afa)" 2016-05-30 17:03:51 +00:00
Ed Sanders 5581394ea3 Update VE core submodule to master (a4a5afa)
New changes:
4a5aa37 Clean up debug bar buttons
15f016c Undo sequence input stripping if window is dismissed
e874734 Localisation updates from https://translatewiki.net.
8db33b4 Follow-up e874734: Fix build for added languages 'gom-latn' and 'gor'
79c5d51 build: Update stylelint config version and make it pass
3804f5e build: Remove grunt-cli
cea7b63 Update OOjs UI to v0.17.3
9f648f4 [BREAKING CHANGE] Always get registries/factories via surface
1252814 Add cloneWithData() utility
5ccdef3 [BREAKING CHANGE] Fix debug bar encapsulation

Local changes:
* Fix debug bar encapsulation

Change-Id: I2c5d722278c5f71b59ee2f8849d9babb5aff6af2
2016-05-30 09:53:31 -07:00
jenkins-bot 51ceeda189 Merge "Remove unused namespace class" 2016-05-29 17:19:32 +00:00
jenkins-bot c2c997081f Merge "Fix z-index of surface for debug bar" 2016-05-29 17:19:29 +00:00
Ed Sanders 73a1127981 Fix font size in target widget debug bar
Change-Id: Ic5120fd1d2cc4955a502fa57478a19851f9f6b33
2016-05-29 17:39:09 +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
Ed Sanders 293163131b Fix z-index of surface for debug bar
Change-Id: I938f2d959cd7cb72c43c2efd666838a9cd9d3e39
2016-05-28 20:53:40 +01:00
jenkins-bot ce149e49d7 Merge "DesktopArticleTarget.init: Make surface hiding hack work with padding" 2016-05-27 18:46:36 +00:00
Ed Sanders 5d9ed11815 DesktopArticleTarget.init: Make surface hiding hack work with padding
Change-Id: Ia8508199c80ef3da7f4ae30bd4e053273fe44d8a
2016-05-27 18:33:33 +00:00
Alex Monk 51dd790710 Track ETag header responses in special event logging schema
Bug: T135171
Change-Id: I70d6db0897c3f08c28d5841302ba7e196f362e48
2016-05-26 23:29:02 +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 67d24eb83f Clear save caches when toolbar is re-attached
Change-Id: I14ddcba9fa4fd5f39341312d241ce59980276a2b
2016-05-26 15:53:04 +00: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
James D. Forrester 8c7ed92288 Update VE core submodule to master (eeaf1e2)
New changes:
c54a48a build: Fix watch list (csslint -> stylelint)
58ba3d9 Add stylelint rules for @-rules
3f8c75a Stylelint: Add rule for unsupported browser features
3b96ff3 Fix minimum Opera version (15 -> 12)
9a1110b Stylelint: No ID selectors
9800bb8 build: Remove remaining references to csslint
b6ab14a stylelint: Re-enable features by names
6cc1f3c Move stylelint to npm
1d15fa0 build: Bump stylelint version to v0.2.0
ccc1724 stylelint: Use the preset rather than extending

Change-Id: I22fa8098592338a5e912aba9ad21131b21d9c0ea
2016-05-18 07:06:53 +01:00
jenkins-bot d2c995594a Merge "Remove remaining references to csslint" 2016-05-17 12:41:48 +00:00
Ed Sanders 8d749518ec stylelint: Comment uses of 'unsupported' browser CSS features
Change-Id: Ia88575d3fe71c22551cc601f03d8f4dea6d7fe16
2016-05-17 12:28:07 +00:00
Ed Sanders df49e5deb9 Remove remaining references to csslint
Change-Id: I1b5177bf746985a199bcc1ec713f886164c74760
2016-05-17 13:27:47 +01:00
Ed Sanders 99d3320573 build: Replace csslint with stylelint
For now just use the rules file in lib/ve, but eventually
this will be a preset.

Change-Id: I7fd79d3e1dce37aef066d416cd969e5fff1e962f
Depends-On: I17e0d23ddfedf64985495ab35d113ea08c03b1df
2016-05-16 22:30:49 +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
Ed Sanders 8e4c9dba13 Fix link blacklisting
Now that we always generate mw link types in the converter,
blacklist mwExternal links, not plain links (which won't exist).

Change-Id: I2ab9fbb9ec50c2e36e8a870d48b6aa06c7e69f8c
2016-04-26 21:20:22 +01:00
jenkins-bot 80636c235e Merge "Add a popup after switching into VE from WTE" 2016-04-25 22:42:55 +00:00
jenkins-bot a825845ad5 Merge "Move monobook global overlay styles to generic DesktopTarget" 2016-04-22 16:37: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 9898b7ea2c Move monobook global overlay styles to generic DesktopTarget
Fixes the font size in non-article desktop targets,
e.g. Flow.

Change-Id: I8f7e0af5061ef5dda2564b62e9b94e606ca77799
2016-04-22 12:42:52 +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
James D. Forrester be1809c35d Update VE core submodule to master (d6c6a85)
New changes:
c48d7cc Add support for placing a toolbar dialog in the side margin
ee7e14b FindAndReplaceDialog#renderFragments: Protect against null surface
fc61463 Fix dm.Surface#getHistory to not return undone items
f1dff2f Introduce ve.Range#overlapsRange method
f608958 Introduce dm.Surface#getModifiedRanges
db114ed Move debugging data-url GIFs to a debug only file
1dd8194 Update RangeFix to 0.2.0
706ff4e Add 'Support: [browser]' to browser hack comments
4f52afc Inline slugs: Limit Firefox hack to versions <38
bf73326 Add classList polyfill for IE9
59d78aa Fix access of iframe-created document in IE9
a886ae1 Hide borders on linked images in IE9
5293974 Fix double-click to edit table cells in IE9
a49a02f Add some more Support: comments

Depends-On: I9c5cea3e8df1fae001d4d98c0782a04dec803776
Change-Id: I460368f509a213464e57bb95f2d726305ef608de
2016-04-18 18:34:20 -07: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
jenkins-bot 25fb8ce692 Merge "Only style originalContent when VE is active" 2016-04-17 17:31:05 +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
Alex Monk 89ed0ccbf5 Only style originalContent when VE is active
Otherwise there is a white block above the resulting content after save

Change-Id: If9239556ed5b1038aa86e4ba161da2abfd9e6bf2
2016-04-15 02:26:44 +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
Alex Monk 71990b4c44 Check wpSection before converting textbox contents for use in VE
Bug: T132309
Change-Id: I93f7706257f1f8ea59b7447f198a34439b17194d
2016-04-11 23:35:11 +01:00
jenkins-bot 5dc1257507 Merge "More minor/watch checkbox state computation server-side" 2016-04-11 14:18:56 +00:00
jenkins-bot 9b9390585d Merge "Adjust DOM and CSS so UI surface runs from top to bottom of page" 2016-04-11 14:03:29 +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
Alex Monk 149dab8fc5 Add ?redirect=false to VE's RB /page/html/ requests
Untested.

Bug: T130757
Change-Id: I27570d3212bd41bf7da93608302dae04c364783f
2016-04-09 03:34:34 +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
jenkins-bot f9c95cd820 Merge "Fix up mw.libs.ve.EditingTabDialog.prototype.getActionProcess" 2016-04-05 15:41:28 +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 f67b578c3f Fix up mw.libs.ve.EditingTabDialog.prototype.getActionProcess
How did this ever work?

Ensure action is passed through and not just undefined, wait for change to go
through before refreshing.

Bug: T131818
Change-Id: I83b5695906044299d338e62e6c980c596d291765
2016-04-04 23:57:46 +01:00
jenkins-bot 12aefcc213 Merge "After saving and setting HTML, set single-editor edit section handlers again" 2016-04-02 18:32:46 +00:00
Roan Kattouw 8e69dfa3b8 ArticleTarget: Correct comment explaining where setAssumeExistence( false ); is called
Change-Id: Ib883ea1fe57fe6cb3e182965a18eb3fb50246178
2016-04-02 20:28:44 +03: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
jenkins-bot 2449ce203d Merge "Use veaction=edit in URL instead of action=edit when we're using multiple tabs" 2016-03-31 15:42:40 +00: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
jenkins-bot 18533b47fa Merge "Toolbar: Add tooltips to structure and insert groups" 2016-03-29 17:15:51 +00:00
jenkins-bot b9643881d9 Merge "Remove icon properties from windows" 2016-03-29 16:37:22 +00:00
Ed Sanders 9a347220bc Target loading: Only parse oldid if it is non-null
This un-breaks MobileFrontend.

Change-Id: Ib1bce6b80abb004ff4ca26920759ef98f3cd1143
2016-03-29 12:57:00 +01:00
Ed Sanders c516d897d2 Remove icon properties from windows
Windows stopped supporting icons a while ago.

Change-Id: I8a63152282a5968dcd17675330e31bd1ebe4b68b
2016-03-29 12:33:42 +01:00
Ed Sanders 1d8d1c2a64 Toolbar: Add tooltips to structure and insert groups
Bug: T131133
Change-Id: I927bf6f0d1de74b4ac8d16c3b5ce27720db322d4
2016-03-29 12:08:22 +01:00
jenkins-bot 068bafd9df Merge "ArticleTarget: Don't assume an explicit oldid is old; check against current" 2016-03-26 00:49:58 +00:00
Alex Monk 680e464e94 ArticleTarget: Don't assume an explicit oldid is old; check against current
Bug: T130810
Change-Id: I3d5b748da37a0a059f282f97dd0d68d1846e2553
2016-03-25 17:37:02 -07: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
jenkins-bot 9b9ace9d03 Merge "Rename startSave -> onSaveDialogSave" 2016-03-23 19:48:06 +00:00
Ed Sanders 5e4ad90845 Rename startSave -> onSaveDialogSave
Factor out actual startSave into new startSave method.

Change-Id: I73edb5021903f04aa197ace2a2afa3aa3a5ddac6
2016-03-23 11:14:06 +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
Ed Sanders fd3683e414 Update VE core submodule to master (d1ce123)
New changes:
6cf8864 Follow-up eb97c1f: Fix build for added language 'inh'
d1ce123 SpecialCharacterDialog: Use getReadyProcess promise to wait for char list

Local changes:
* SpecialCharacterDialog: Defer loading of character list.
  Saves ~40k for most users who never use it.

Change-Id: I74b30fee96e1ae4463ed28c19bef4b515330220e
Depends-On: I45dc9f788aa5bd702b91ffd9f63b05b1f4760691
2016-03-22 09:15:23 -07:00
jenkins-bot 4e4684e7d0 Merge "Show redirect target inside target" 2016-03-17 22:54:39 +00:00
jenkins-bot 1c27e5d51a Merge "In the event of a document reload due to RB vs. API rev ID conflict, always re-set requestedRevId" 2016-03-17 15:39:12 +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 612e43dc08 Prefer error *code* when logging unknown errors
See also I4a5bac24

Change-Id: I62fda9dadd24704f5930b30a2f8ad4d4a9e729cb
2016-03-14 00:27:42 +00:00
Alex Monk 22bf016a84 In the event of a document reload due to RB vs. API rev ID conflict, always re-set requestedRevId
There's probably more to this bug but I think we should still correct this

Bug: T125437
Change-Id: Ib32d1e69b2500578b5dc160c0c2d7481f5577ebb
2016-03-12 04:46:54 +00:00
Alex Monk d1d4839f8f Log readonly code for readonly errors
I thought I did this yesterday

Change-Id: Icd2cf8fdf4263cab335a2ddfa53ab0585153dfb4
2016-03-11 17:33:57 +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
jenkins-bot d6ec1ed86f Merge "Fix logging of event_action.saveFailure.message for responseUnknown" 2016-03-10 21:22:37 +00:00
jenkins-bot ad7c364725 Merge "Better handling of read-only mode" 2016-03-10 21:22:34 +00:00
Alex Monk 0a6f6e1bbd Fix logging of event_action.saveFailure.message for responseUnknown
Change-Id: Ic8d3066d8f6ccf8bc4a1001fd4d406b313915e82
2016-03-10 21:03:25 +00:00
Alex Monk d2a9aefba7 Better handling of read-only mode
* Don't just fail to load, action=visualeditor itself should not write to the DB
  (we have action=visualeditoredit for that)
* Send notice to the client in the usual way
* Handle read only errors on save, log as unknown

This won't let you review changes because that uses visualeditoredit

Bug: T129501
Change-Id: Id78c06b031423e47a7ddf94ec615b6d6975309d3
2016-03-10 21:02:52 +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
jenkins-bot 8d7baccd5f Merge "DesktopArticleTarget: Add Edge and MSIE to whitelist" 2016-03-07 23:28:58 +00:00
jenkins-bot 39f3cfa4a7 Merge "Keep summary and checkbox selections when swtiching WTE->VE" 2016-03-07 23:17:08 +00:00
jenkins-bot 075f569e51 Merge "Update ArticleTarget for new API token handling" 2016-03-07 23:14:32 +00:00
jenkins-bot 6ed2d23b13 Merge "Don't give the user the option to discard changes when changing editor" 2016-03-07 23:14:29 +00:00
jenkins-bot 15f8efed70 Merge "DesktopArticleTarget.init#getLastEditor: Check values for validity" 2016-03-07 23:14:26 +00:00
James D. Forrester 79d1f92b42 DesktopArticleTarget: Add Edge and MSIE to whitelist
Bug: T128447
Change-Id: Ia7afe4ddd5abd4fd1de85ba2d2df1fefa6735d79
2016-03-07 14:58:10 -08:00
James D. Forrester d8eb68d7b6 Don't give the user the option to discard changes when changing editor
Bug: T128585
Change-Id: I02f31e46ae7b2dc7505ed55fc56cd00f538a90e3
2016-03-07 13:39:32 -08:00
James D. Forrester b0407d840d Follow-up I65d96627: Remember the user's preference in WikiEditor too
Oh dear.

Bug: T129130
Change-Id: I12481ded12f99ab1ba59dbd403c1eed038235fd9
2016-03-07 13:03:35 -08:00
jenkins-bot 789979f223 Merge "Try to fix handling of empty document on WTE->VE switch" 2016-03-07 19:48:22 +00:00
James D. Forrester 302aeefd85 DesktopArticleTarget.init#getLastEditor: Check values for validity
Change-Id: I23e0884a97b3689dd42c3df11a6311cd0601c348
2016-03-07 11:27:23 -08:00
Ricordisamoa 993015e03b Update ArticleTarget for new API token handling
action=query&prop=info was being used because it can be combined
with action=query&meta=userinfo, while action=tokens cannot.

However, since MediaWiki 1.24 the 'intoken' parameter of
action=query&prop=info is deprecated, while the preferred way of
retrieving tokens is action=query&meta=tokens which not only can
be combined with action=query&meta=userinfo but also spares the
need of dealing with page ids.

Change-Id: I5ded3c303ede20514eeb2840715fe240b3b2c7e1
2016-03-05 14:44:07 +01:00
jenkins-bot ea11c33e6d Merge "Handle API errors when refetching the edit token" 2016-03-05 02:16:32 +00:00
Roan Kattouw 6322be2e07 Handle API errors when refetching the edit token
This can happen when the user gets logged out on a private wiki.
We get a badtoken error, so we try to refetch the token, which
itself returns an error. Token refetches didn't have error handling
at all and got the save dialog stuck in the pending state.

We can't offer the user to proceed with a different identity here,
because we encountered an error while trying to figure out what their
current identity is. The best we can do is encourage them to
log back in in a different tab.

Bug: T128934
Change-Id: I17d4452f688ec22631dbd12af223731635004d66
2016-03-04 18:06:33 -08:00
jenkins-bot 074885d7cf Merge "Follow-up 2c24efae: fix typo in event name for unknown save errors" 2016-03-05 02:01:57 +00:00
Roan Kattouw 84d534997e Follow-up 2c24efae: fix typo in event name for unknown save errors
This probably means we stopped logging unknown save errors
back in August.

Change-Id: I4a5bac244a469e73643e8a7d978d9212dd838fb0
2016-03-04 17:31:40 -08:00
Alex Monk dde45949a3 Try to fix handling of empty document on WTE->VE switch
Bug: T128635
Change-Id: Iff83e1d71e7186b8da875aa507f9e19e8d9c23ce
2016-03-04 02:05:41 +00:00
Ed Sanders 67c207a6f5 Use abstract target widget creation
Change-Id: Ic7e43e80f4f48df99842cee702963d54205e5055
Depends-On: I6a667a641540b347052ea0c645af4e1e59cf333a
2016-03-03 11:49:44 -08:00
Alex Monk 4ed6fd4010 Change Accept header a bit
Per post-merge commit on I77af4b58 by Subbu

Bug: T128233
Change-Id: I30c4c1ad5b68e5b8a006d7a6c7bcbaac7e2eb164
2016-03-02 15:37:37 +00:00
Alex Monk 21334a0fa8 Keep summary and checkbox selections when swtiching WTE->VE
Bug: T128529
Change-Id: I8a7deac1c4d9390c1db7d78c3e0a11d927ef127b
2016-03-02 11:55:50 +00:00
Ed Sanders d94d98ebfe ArticleTarget: Update documentation
'onReady' no longer exists

Change-Id: I6fbcf619ba471f69380a64ba02994bd6ef0ca246
2016-03-01 22:03:07 +00:00
jenkins-bot a0caedc6d9 Merge "API: Send Accept: header to RESTbase" 2016-03-01 03:24:45 +00:00
Alex Monk 2f135e9590 API: Send Accept: header to RESTbase
Bug: T128233
Change-Id: I77af4b58e5469a898063a3f838802e4f5769514b
2016-03-01 01:14:02 +00:00
Alex Monk d46c5e9f91 Fix WTE->VE switching in prefer-wt SET mode
Bug: T128402
Change-Id: I56af672f2334214f048a4bbfe2f9fab891832792
2016-02-29 23:46:11 +00:00
David Lynch 7486f74c6f MWMediaDialog: Only cache relevant information
Trim the cached image data from the media dialog down so that it only caches
the same information that would have been fetched for a non-uploaded image.
Consistency!

Bug: T126081
Change-Id: I0f057c111b66f29c6360e27f97256384f5320b75
2016-02-29 10:16:34 -06:00
jenkins-bot e39d8a744b Merge "Show welcome dialog on mobile too" 2016-02-29 03:02:03 +00:00
James D. Forrester ab4d3e956b Update VE core submodule to master (0371bbe)
New changes:
0371bbe [BREAKING CHANGE] Refine VisualEditorSupportCheck call and document pattern

Local changes: Use new VisualEditorSupportCheck pattern

Change-Id: I7dc0c360b54a93397180b18d88d72532e439da5c
2016-02-26 12:26:56 -08:00
Alex Monk ced27f348f Show welcome dialog on mobile too
Bug: T112599
Change-Id: Ie04aab468c80dabc84e1386e7529138e1101450e
2016-02-25 22:03:00 +00:00
jenkins-bot 7bef4c9a20 Merge "Warn for empty summary when edit section used" 2016-02-25 18:56:57 +00:00
Ed Sanders 229a088f34 Make surface measurable while activating
If the surface is display:none then $.width always
returns 0, which breaks features like FocusableNode's
invisible icon.

Bug: T127319
Change-Id: Ib157ffaeb56fca2bdc26868d830c4bf8feafa2a8
2016-02-23 17:05:09 +00:00
wctaiwan 5da37932a2 Warn for empty summary when edit section used
Warn the user about an empty edit summary when the "edit section"
link is used to trigger VE.

Re-does Ic7b456ca a different way.

Bug: T114857
Change-Id: I319c9c5bed47140a81eb409d490c9f82b89a49fe
2016-02-23 00:34:12 +00:00
Ed Sanders 083182debd Make platform language functions actually work
Previously arguments were not getting passed through.

Change-Id: I19fbd6f8a7f32163a85dda01fa46ac56a8c78cf8
2016-02-22 00:05:05 +00:00
Ed Sanders 15a47665c8 Meta dialog: Use window action to open windows
Because abstraction.

Change-Id: I9811db4380c6cf37a73a76b97c8439f94723c5a6
2016-02-19 17:37:42 +00:00
James D. Forrester cebaacb546 Update VE core submodule to master (cdfd84e)
New changes:
c02ea46 Clarify documentation of directionality methods
43c9b6f Move initialisation browser support checking from downstream
c89be66 Localisation updates from https://translatewiki.net.
5fb7907 Follow-up c89be66: Fix build for added language 'nan'
fc74fab dm.ElementLinearData.compareElements: Add a few missed test cases

Local changes:
Use initialisation browser support checking from upstream

Depends-On: I27a8e7b4376647f01cee648de987dc3ca6a060d5
Change-Id: I3fc79422ee5e487cf5fae3929fe492f21cd2840a
2016-02-17 20:04:16 -08:00
Alex Monk 83d8a7d9bb Don't remove .ve-activated after successfully activating
hideLoading always gets called after activating, not just failing

Follows-up: I13058ae1

Bug: T127184
Change-Id: I47d1892feacbfcf832aa32f689f173601b76c4ba
2016-02-17 15:36:18 +00:00
Alex Monk 9a1c0762cb Try to switch into the wikitext editor automatically if there is an error loading VE on action=edit
Bug: T125998
Change-Id: I2982f6e5f26086a1175b9fc8c3039a2143a44659
2016-02-13 02:56:01 +00:00
Alex Monk 1c1d018bc7 Unbreak VE
Follow-up to I13058ae1

Change-Id: Icb30f87746bea3911379fca9766877a36e8b5975
2016-02-13 00:58:42 +00:00
jenkins-bot bcae181cec Merge "Try to make MW->VE switching failures break less things" 2016-02-12 17:29:29 +00:00
Alex Monk 4a288a5866 Try to make MW->VE switching failures break less things
* Try to hide loading bar on failure
* Don't set wgAction back to 'view' if we're dropping the user back to the
  wikitext editor

Bug: T125580
Change-Id: I13058ae131a1dda3b172e78d9b143d70831c47f1
2016-02-11 02:39:06 +00:00
jenkins-bot 4a751524c4 Merge "Edit mode switch: Show popup next to VE switch button" 2016-02-10 01:51:57 +00:00
Ed Sanders 80124c88a6 Edit mode switch: Show popup next to VE switch button
Only show if the user came from VE.

Change-Id: Ic362ba534d135fca5516c8ba401f6b2a22886ff1
2016-02-10 01:36:32 +00:00
Alex Monk 863a2c2974 Don't try to tell the server to set preferences to their current values
It's rather pointless.

Change-Id: I8065af1d61108ce843c0afd2eaa0f1f9b85b6998
2016-02-10 01:04:47 +00:00
jenkins-bot d5f6c220d3 Merge "Follow-up I7e1edcf05c: Remove MonoBook z-index hack" 2016-02-09 14:28:16 +00:00