Commit graph

588 commits

Author SHA1 Message Date
Ed Sanders c56a921585 Change command list from whitelist to blacklist
Also remove toolbar definitions as they can now be derived from
command availability.

Depends on If32d514a in core.

Change-Id: I2313f3cc2531686b27f96dc1110b28bb4b295f89
2014-11-24 18:28:37 +00:00
jenkins-bot 268a852455 Merge "Follow-up I19da270a: Make overlay appear above non-VE skin items in Monobook" 2014-11-22 02:29:01 +00:00
James D. Forrester 6f446e0d1a Follow-up I19da270a: Make overlay appear above non-VE skin items in Monobook
In I19da270a we bumped the z-index for the overlay from 4 down to 2, to avoid
clashing with the toolbar. However, the site logo, search box and personal
tools all have a z-index of 3, so 4 is required. Instead, bump the toolbar's
z-index up by 1 to 5.

Change-Id: I7e1edcf05cde054c7bcb8c13b5633930fb5ed3b5
2014-11-21 13:29:16 -08:00
Roan Kattouw 6d21d83244 Add instrumentation for edit schema
Move ve.track() subscriber to its own file, and have it
route mwtiming.* events (for TimingData) and mwedit.* events
(for Edit schema) differently. Most of the data population
lives in the subscriber, so actual ve.track() calls are
pretty lightweight.

Existing ve.track() calls with timing data were kept with
their names intact for backwards compatibility, but
we may eventually want to throw them out and start from scratch.

ve.init.mw.ViewPageTarget.init.js:
* Remove old track subscriber
* Track init and ready events
* Remove old ve.track( 'Edit', ... ) crap that didn't work

ve.init.mw.ViewPageTarget.js:
* Fire the saveWorkflowBegin event before the save dialog
  loads rather than after
* Remove unnecessary this.events.trackSaveError() calls:
  TargetEvents already listens to these events itself
* Remove badtoken handler because all it was was an
  unnecessary trackSaveError() call
* Add abort tracking
** Pass trackMechanism through deactivate() and cancel()

ve.init.mw.Target.js:
* Add static.integrationType to populate the 'integration'
  field in the schema

ve.init.mw.TargetEvents.js:
* Simplify onSaveError* methods away into connect bindings
* Map track topics to mwtiming.* so they can be routed separately
* Track save-related mwedit.* events

Depends on I978eda96c in WikimediaEvents

Change-Id: Iae677d9b15c71d2b18e795bd5179d11876c06abd
2014-11-21 11:59:15 -08:00
jenkins-bot 1b3fe26a3a Merge "Move tearDownBeforeUnloadHandler() to cancel()" 2014-11-21 19:42:59 +00:00
jenkins-bot ad908a666d Merge "Prevent JS errors when surfaceReady fires after deactivation" 2014-11-21 19:41:00 +00:00
James D. Forrester a1d75042c0 Update VE core submodule to master (fb57e24)
New changes:
7d8ed7f Copy in some IE CSS hacks from ve-mw
a2e962e Update OOjs UI to v0.1.0-pre (20c61ec865)
d99c62f Update OOjs UI to v0.1.0-pre (d4cfcce969)
7fe02b3 Fix lots of spelling mistakes and typos

Local changes:
Remove redundant IE CSS rules since core's I013688c5

Bug: 73565
Change-Id: Ic60cd5290932ec38fab26492fffa17c3a8e91398
2014-11-21 10:28:34 -08:00
Ed Sanders 2997cee444 Fix lots of spelling mistakes and typos
Change-Id: Icf78d3d599326d3f12d09edcd2b8491ed35ade04
2014-11-21 13:00:50 +00:00
jenkins-bot c8028dfe06 Merge "Fix ridiculously small font size in overlays under MonoBook" 2014-11-20 20:01:22 +00:00
Roan Kattouw 9ed9c6cfe0 Move tearDownBeforeUnloadHandler() to cancel()
Make sure it always gets torn down on deactivate, not
just on save. Otherwise we end up with multiple copies of it.

Change-Id: I7b95c316641fc48ce7087a0042ec6174fe03180b
2014-11-20 19:23:17 +00:00
Roan Kattouw 5317ce8082 Prevent JS errors when surfaceReady fires after deactivation
If you clicked "Read" while the editor was loading
(but only while the "Edit" tab was already active, not before)
then you could get in a situation where surfaceReady fired
on an already-aborted target, which caused JS errors.

It seems like we should clean more things up in this
case, but I don't know what they are. In any case,
we should not try to set things up on a non-activating
target when surfaceReady fires.

Change-Id: Id57bd63ff288156725e472e7d89009022090253a
2014-11-20 19:22:49 +00:00
jenkins-bot d8808da403 Merge "Insert last modified text as HTML" 2014-11-20 19:12:07 +00:00
jenkins-bot 921f606209 Merge "Remove unused CSS: toolbar contains no PopupButtonWidgets" 2014-11-20 18:27:55 +00:00
Alex Monk 8a1adef97c Fix ridiculously small font size in overlays under MonoBook
Copy in the font-size:127%; rule from MonoBook's main.css which is applied to
div#globalWrapper

Caused by Id425c56d

Bug: 73660
Change-Id: I05502295b81c62fd1180dff860dea68d76c2dfa9
2014-11-20 17:56:38 +00:00
Ed Sanders 6ffbc72f82 Remove unused CSS: toolbar contains no PopupButtonWidgets
Change-Id: I719a4dec30d5ca52337bd3a7d2506065562d831d
2014-11-20 13:56:48 +00:00
James D. Forrester 7317114187 Update VE core submodule to master (029fc7e)
New changes:
029fc7e Update OOjs UI to v0.1.0-pre (1fa4eb7a73)

Update changes:
Changes were generated by running this script:
https://gist.github.com/trevorparscal/265f1b8c854190637a1e

File changes:

Scripts (modules/ve-mw/ui/widgets)
- ve.ui.MWInternalLinkMenuItemWidget.js → ve.ui.MWInternalLinkMenuOptionWidget.js
- ve.ui.MWLinkMenuItemWidget.js → ve.ui.MWLinkMenuOptionWidget.js

File content changes:

Scripts (*.js)
- MWInternalLinkMenuItemWidget → MWInternalLinkMenuOptionWidget
- MWLinkMenuItemWidget → MWLinkMenuOptionWidget
- ContextMenuWidget → ContextSelectWidget
- ContextItemWidget → ContextOptionWidget
- TextInputMenuWidget → TextInputMenuSelectWidget
- MenuWidget → MenuSelectWidget
- MenuItemWidget → MenuOptionWidget
- MenuSectionItemWidget → MenuSectionOptionWidget
- OutlineWidget → OutlineSelectWidget
- OutlineItemWidget → OutlineOptionWidget

Styles (*.less)
- contextMenuWidget → contextSelectWidget
- contextItemWidget → contextOptionWidget
- textInputMenuWidget → textInputMenuSelectWidget
- menuWidget → menuSelectWidget
- menuItemWidget → menuOptionWidget
- menuSectionItemWidget → menuSectionOptionWidget
- outlineWidget → outlineSelectWidget
- outlineItemWidget → outlineOptionWidget

Change-Id: Ifded7f9e17923dbb56a722b7424ccd2854194c21
2014-11-19 17:04:26 -08:00
jenkins-bot 30d8bf60f1 Merge "ViewPageTarget#onSaveErrorSpamBlacklist: Use mw.language.listToText now it exists" 2014-11-19 11:06:01 +00:00
Timo Tijhof 420b336d31 mw.ViewPageTarget.init: Simplify hideLoading and pushState
Follows-up Ica33de675, If505a46f54.

* The setting of 'uri' looked like a redundant local alias before
  passing on to pushState, but is actually important on itself.

* Remove binding for hideLoading. It's a detachable method on
  a singleton, not an instance method.

Change-Id: Ic3536caf3f42ee893124312fd5981b67336bd480
2014-11-19 02:58:17 +00:00
Roan Kattouw bb6e01c488 Fix back button not exiting VE
When you clicked the Back button in the browser, the URL
in the address bar would change (removing veaction=edit),
but we would not go back to read mode. This was broken
by 5c0c11753 almost a month ago but apparently no one noticed.

This is because 5c0c11753 moved the pushState() calls to
be earlier (in init init), making the replaceState() call
in the ViewPageTarget constructor (which is there
specifically for this bug) run too late in those cases.

The simplest way to fix this is to duplicate these replaceState()
calls before the pushState() calls in init init.
I feel a bit bad about copying code, but not very bad
because the code I'm copying already has a FIXME comment
about how there should be a better way :P

Change-Id: I6627a5d1d9377ae815bc58bceeb059ce9f4f19ab
2014-11-19 02:07:41 +00:00
jenkins-bot aa44c8916b Merge "Consistently use location as global, and location.href for full url" 2014-11-19 02:00:35 +00:00
Timo Tijhof c0692af5f7 Use history as global instead of via window
Just like DOM interfaces such as document and location. And JS
constructors like Object.prototype, and libs like jQuery.
No need for the window host object.

Change-Id: Ie39aaea2ca17bdec5fb3afe32a4e6c9f751bd0c6
2014-11-19 01:12:11 +00:00
Timo Tijhof 82657727f9 Consistently use location as global, and location.href for full url
The location object is a global, just like document.

Using it via 'window' needlessly adds complexity and, for example,
makes it harder to catch typos in static analysis.

Standardise on location.href in place of the many different
variants for accessing and assinging the full url:

 location =
 location.href =
 location.assign() =

And each with 'window', 'document' and without host object.

Change-Id: If88515bd88fc5b93ebacd4ec41fce02fec540f18
2014-11-19 00:20:08 +00:00
Alex Monk 94fadaec4a Insert last modified text as HTML
mw.msg can return things with <br />, which we want to be interpreted as HTML
rather than just escaped as text.

Bug: 73571
Change-Id: I7861432d9361e01f9def0578c342e60715c3d764
2014-11-18 23:42:18 +00:00
James D. Forrester 6b61addd06 ViewPageTarget#onSaveErrorSpamBlacklist: Use mw.language.listToText now it exists
Change-Id: I1289c43ea4be1cd9dc1addb7c765d7050b311d8d
2014-11-18 14:22:30 -08:00
Alex Monk ac6f6caeac On save, if there was no 'last modified' text at the bottom of the page, add it
Just hope that wgMaxCredits is 0.

Change-Id: Idf4a7cceb0650eaec4442244066d875a3ff38e06
2014-11-17 01:18:46 +00:00
Alex Monk ff3d76f488 Don't try to get newtimestamp from edit if no change was made
ApiEditPage can give us 'nochange' instead of the
'oldrevid'/'newrevid'/'newtimestamp' keys if we gave it a null edit.

Bug: 73463
Change-Id: Ic22597dfed11de3823471673404090a9bce12928
2014-11-17 01:03:00 +00:00
jenkins-bot ed7cfa1207 Merge "When saving, return the full contentSub to the client" 2014-11-13 20:45:09 +00:00
Alex Monk 581d1350e6 When saving, return the full contentSub to the client
And introduce code to make FlaggedRevs add its notices to contentSub.

Bug: 60718
Change-Id: Ibb91dc563ccf73d3b4bd1994134ccf02634fccb5
2014-11-12 17:36:59 +00:00
Alex Monk ba81c45da9 Restore selection after closing save dialog
Also simplify some weird focus code in MWSaveDialog

Bug: 72911
Change-Id: Ifb8fd9be96a199f86412247211e3920a35dd22bf
2014-11-11 23:55:39 +00:00
Roan Kattouw 0c92ef904c Followup 5c0c117: make the edit tab work with oldid= again
After 5c0c117, clicking the VE edit tab on /wiki/Foo?oldid=123
sent you to /wiki/Foo?veaction=edit , dropping the oldid parameter
and editing the current version rather than the old version.

Fix this by only recomputing veEditUri from scratch when necessary,
and reusing the current URI when possible.

Change-Id: Iee9a745990f1a2bad40f46b8cdaaa727bb7fead8
2014-11-10 18:24:45 -05:00
Roan Kattouw 9533c378ea Remove last usage of ve.bind() in VE-MW
Change-Id: Ia645e3d599da9b65b71dbe67f82b7c0fa3be1683
2014-11-10 15:45:09 -05:00
Alex Monk de73246ee1 Show category items as red if they don't have description pages
Also fix some lies I wrote in related code/docs

Bug: 65517
Change-Id: Iafacee7d8e460913d84808fe38ecc8da4a1817c0
2014-11-08 14:27:27 +00:00
jenkins-bot 613e69b2c8 Merge "Refactor out show/hide loading spinner" 2014-11-06 18:39:06 +00:00
Ed Sanders 841dfda98d Refactor out show/hide loading spinner
Change-Id: If505a46f54921ce4742ecfed598eb07a9ba5e3eb
2014-11-06 16:41:05 +00:00
jenkins-bot 1a6c46f7ee Merge "Use hasOwnProperty instead of 'key in obj'" 2014-11-06 12:37:04 +00:00
Roan Kattouw e144e55972 Followup 31bafa1: forgot to rename 'data' to 'args' for citation commands
Bug: 73001
Change-Id: I8cc436cbe16955130d25b2385e3f561fd2ffb4d5
2014-11-05 13:46:54 -08:00
Ed Sanders 0efbfa7e21 Use hasOwnProperty instead of 'key in obj'
Change-Id: I48f044c547b48a97cdfb31f7b887dca0ed7e341b
2014-11-05 20:54:50 +00:00
Roan Kattouw ccd9142262 Remove the loading spinner at the end, not halfway through loading
We were attaching its removal to the wrong promise in 2 of the 3
places where it was being called.

Also this file is horrible and should be refactored. A lot.

Change-Id: If74b1629266f22e2d110305b139bef4a8e69b13b
2014-11-05 12:50:40 -08:00
Catrope c8396eb65f Revert "Clear selection after tearing down surface to work around Firefox bug"
Superseded by I051ef92eeea9 in VE core.

This reverts commit d68eae6c8d.

Change-Id: Ie5e0a6169cfe3634e20a3b88e8aeb980b4094e10
2014-11-04 17:20:30 -08:00
James D. Forrester 31bafa183d Update VE core submodule to master (a942301)
New changes:
2cc219a Update OOjs UI to v0.1.0-pre (571f26d0ab)
3543cb7 Protect against offset=-1 in insertContent()
7a3d456 [BREAKING CHANGE] Move selection restrictions from tools to commands
3d847bb Disable desktop context on table selections
41282dd Missed function rename from RangeFix change
dd6c8b8 Support toDomElements returning an empty array
9be6464 Placholder -> placeholder
9bdd0a8 Restore basic styling to toolbar in core target (only)

Local changes:
Move selection restrictions from tools to commands

Change-Id: I88f3d04946bd1d03ed001d747475a8b495a0f64c
2014-11-04 14:11:04 -08:00
Alex Monk b2af92870a Update "page was last modified on date, at time" footer line when saving
Bug: 52403
Change-Id: I11e00066000e927f0551691d05fe11fe2ae125b0
2014-10-31 01:00:04 +00:00
Alex Monk b71bb51171 Remove more references to ve.bind
Seems some of them have crept back in since I1a7fc7f2 (and we missed one somehow)

Bug: 72156
Change-Id: I5631fb7d5963d06aeb238c1daa44344b2060ef1a
2014-10-30 20:55:44 +00:00
James D. Forrester 6626450419 Toolbar: Make styling and insert menus collapsible
Also re-synchronise toolbar in MWMediaDialog and MWReferenceDialog.

Change-Id: I8cd5f0d9f7e188fa1a7ab8d34a2796340f5e99b7
2014-10-30 12:22:20 -07:00
jenkins-bot 3806a2838c Merge "Clear selection after tearing down surface to work around Firefox bug" 2014-10-29 23:21:36 +00:00
jenkins-bot dcb14bc9bf Merge "Hide page status indicators even if they aren't :visible" 2014-10-29 20:59:00 +00:00
Bartosz Dziewoński 2a55baaef7 Hide page status indicators even if they aren't :visible
The container is zero-height and zero-width, so jQuery doesn't
consider it :visible, and yet it still takes up visual space.

Bug: 72693
Change-Id: I3bed5394a2a64a9f7f0a331f850aa412b5b11b7d
2014-10-29 21:52:38 +01:00
James D. Forrester cc8f6970a5 Update VE core submodule to master (f4ff1d6)
New changes:
d845991 Data model implementation for tables
a27c148 ContentEditable implementation for tables
3c47428 Actions and context menus for manipulating tables
543ca54 Support annotation tool on table selections
149cf3d Supporting copy paste of single table cells
25c9eee Table header/data format tools
e557e46 Merge cells tool
afcf2d9 Allow custom type and attributes when creating a table

Local changes:
Add the files and messages for table editing

Change-Id: I6e6c33b96d3089049a0fd5385191caa83df5756b
2014-10-29 11:52:09 -07:00
Roan Kattouw d68eae6c8d Clear selection after tearing down surface to work around Firefox bug
Bug: 71852
Change-Id: I3b4f0f755ece5c9e5444f8abadb1950a3f4ef318
2014-10-28 11:23:06 -07:00
Roan Kattouw 5876014c8f Override overflow: hidden; for <h3>s in the command help dialog
When this dialog is not isolated, MediaWiki's overflow: hidden;
rules for headings cut off part of the text in the <h3>s.

Compensates for Id425c56d9d24 in VE core.

Change-Id: Id9f6bd2bdbed0c6fe57e897c2415c3eceff900a6
2014-10-27 17:51:46 -07:00
Ed Sanders ab365ccacc Fix selection check in wikitext warning
Change-Id: I2f084eb4ee29bd166b05163cd2d6e64e0a4f136d
2014-10-27 16:21:24 +00:00