Commit graph

605 commits

Author SHA1 Message Date
Catrope 64ce195fae Revert "ve.init.mw.trackSubscriber: Populate platform field with hack"
Caused JS errors when invoked too early.

This reverts commit 35d3898543.

Change-Id: Ie7dd4ef8323a16bb694e6300a096ba53cf4a0a91
2014-11-26 01:55:30 +00:00
Roan Kattouw 35d3898543 ve.init.mw.trackSubscriber: Populate platform field with hack
Use the target used as a proxy for the platform.
Assuming all mobile target users are tablets for now.

Change-Id: I24610e6b6d472744dc1011385c8810a65e06decf
2014-11-25 17:23:50 -08:00
Ed Sanders 5ce4885529 Replace hacky wikitext warning listener with sequences
Uses the generic sequence detection now available in core instead
of a custom hack that had to been manually bound and unbound to
every surface and surface widget.

As the sequence detection looks at just-typed characters the behaviour
has reverted to showing a auto-hide message. This resolves an issue
with the previous system whereby typing in the same paragraph as existing
wikitext patterns triggered the warning.

Depends on I6a4d71d in core.

Bug: T53751
Change-Id: I7d914b1b60a1cf8c79a724e5f634e1e666c9562d
2014-11-25 22:39:29 +00:00
jenkins-bot 69fe06a7ae Merge "Check wgRelevantArticleId to determine relevant page existence even on special pages" 2014-11-25 19:44:02 +00:00
jenkins-bot a7dc4af551 Merge "Catch pagedeleted errors and give the ability to re-create the page" 2014-11-25 19:42:58 +00:00
jenkins-bot f3d772a709 Merge "Only try to close save dialog before destroying surface if it's currently open" 2014-11-25 03:12:03 +00:00
Ed Sanders f79aed7572 Update VE core submodule to master (8ca8c41)
Local changes:
* Rename paste rules to import rules (also used by drag and drop)

New changes:
f5d83f8 Remove data-parsoid removal hack
99f938f Create 'preserveGenerated' mode for cloneElements and use in copy
938b44d [BREAKING CHANGE] Rename paste rules to import rules
c51288c ve.ce.Surface: Move insert HTML path to DM
10ce4cf Provide a FileDropHandler for HTML files
701bb9c Provide a FileDropHandler for CSV and TSV files
ca6b444 build: Update update-oojs.sh and update-oojs-ui.sh scripts

Change-Id: I5cfa15ab3efd03e2c64c2f9f725cb3098f53b32a
2014-11-24 18:55:32 -08:00
jenkins-bot 5861db05b0 Merge "Filter out comments from external paste" 2014-11-25 02:07:24 +00:00
jenkins-bot 17fd82b99a Merge "Fix MW skin hacks" 2014-11-25 00:47:32 +00:00
jenkins-bot 330a1732cb Merge "Change command list from whitelist to blacklist" 2014-11-25 00:42:48 +00:00
jenkins-bot 35cbae3d76 Merge "Fix the "you are now logged in/out" warning" 2014-11-25 00:19:14 +00:00
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
Ed Sanders 325bd0994e Filter out comments from external paste
Bug: T71821
Change-Id: I165efd75adf3d4092860c6d2bc408469dba31388
2014-11-24 11:20:18 +00:00
Alex Monk 1c04d32d75 Only try to close save dialog before destroying surface if it's currently open
Otherwise the closure promise will be rejected as it was already closed with
different data, if you ever opened and closed the save dialog before pressing
the 'Read' button. This means the code in the $.when will never be run, and
the surface never destroyed.

Bug: T75589
Change-Id: I3ffdd1c82506bcd2accc0f3fa113c0950a31918e
2014-11-23 22:30:40 +00:00
Ed Sanders 2653ce3bb3 Fix MW skin hacks
* Ensure surface widget font size matches main surface,
  move vector-specific hack to vector css file and fix.
* Fix base font size in non-isolated monobook windows.
* Move monobook z-index hack to global overlay only.

Change-Id: I1607dc77f81ac9c522e09a3b502aeb38fee02178
2014-11-22 17:52:46 +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
Roan Kattouw 9b3316a360 Fix the "you are now logged in/out" warning
It would tell you you were logged out when you were actually
logged in, and when I looked into it, I found lots of broken
things, including lots of confusion between the current
anon-ness and username and the new anon-ness and username.

ve.init.mw.Target:
* Check the new isAnon value, not the old one
* Pass the username to the event, rather than just anon-ness

ve.init.mw.ViewPageTarget:
* Use the passed username (new username) rather than the
  username from mw.config (which is updated, but confusing)

Change-Id: Icf406d49100d81e87c677fd6b57ff93cc29f601f
2014-11-21 18:23:11 -08:00
Alex Monk 9bb766c5bb Catch pagedeleted errors and give the ability to re-create the page
Bug: 52073
Change-Id: I86a6e1510ccb5e59e94a5262dd3ccd91fdf05a70
2014-11-21 21:44:15 +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
Alex Monk b50ad63fb5 Check wgRelevantArticleId to determine relevant page existence even on special pages
Added to core in I06cd0378

Bug: 66885
Change-Id: I9ce889be0ae1cbaab13a9f408d07b168da8affdd
2014-11-19 22:45:23 +00: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