Commit graph

639 commits

Author SHA1 Message Date
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
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
jenkins-bot 5d6ee06b84 Merge "Fix wikitext warning: Get range from selection before trying to find start" 2014-10-24 17:27:44 +00:00
Alex Monk 4639a1c044 Fix wikitext warning: Get range from selection before trying to find start
Bug: 72475
Change-Id: Ib43d9c6b9b46be461354b3b5bbdf9d5de90887a6
2014-10-24 17:18:08 +01:00
suchetag 5c0c117537 Make spinner appear immediately when clicking edit
Moved the spinner code from ViewPageTarget to ViewPageTarget.init to make it appear immediately on clicking edit.
Bonus: also fixes the URL to add the parameter vesection when clicking a section edit link.

Bug: 65453
Change-Id: Ica33de675203cc0f0594b8362731c4e98a644313
2014-10-22 03:20:40 +05:30
jenkins-bot 1d3f875dc4 Merge "Apply link styling logic to transclusion nodes" 2014-10-08 14:30:01 +00:00
Alex Monk 8f7713e796 Apply link styling logic to transclusion nodes
Only template nodes for now. Not sure what we can do about generated content nodes in general...

Bug: 65353
Change-Id: I848f36764b446ed30c74c0e641d0973008f6880b
2014-10-08 15:03:40 +01:00
Ed Sanders 1af18c3c12 Update VE core submodule to master (984b57a)
New changes:
6bbcd6a Localisation updates from https://translatewiki.net.
b8d8a5b [BREAKING CHANGE] The Great Selection Rewrite of 2014

Local changes:
Update to use new selection/range API

Change-Id: I5480d5c77d599c93c2d374fac88bb2fdb68b0024
2014-10-07 21:39:33 +02:00
Bartosz Dziewoński d751d569db mw.Platform: Use 'mediawiki.language' for language fallback chain
Bonus:
* Remove doubled dependency on mediawiki.Uri
* Add missing dependency on mediawiki.language

Change-Id: Ide716aad7b9f08ae9a24f99812f07273d89da33a
2014-10-05 19:00:32 +00:00
Roan Kattouw 005c6fef27 Fix syntax error in mittoHidden selector
Bug: 71521
Change-Id: Id34987e992a7c13cdfcfec85a7c33f7538606fe0
2014-10-01 11:04:31 -07:00
Alex Monk 0c0b545959 Blacklist div[id = kloutify] as well
Followup to I8af9f7ba

Bug: 67006
Change-Id: I84c8902ae8a81f9b62f6817e2f58809f28ca97f7
2014-09-30 23:01:00 +01:00
Alex Monk 0547d8c8ec Remove certain blacklisted elements when getting HTML from document
Hack to try to kill a class of bugs caused by misbehaving browser plugins.

Unable to test whether this fixes them or not.

Bug: 68900
Bug: 51423
Bug: 51521
Bug: 52791
Bug: 52884
Bug: 53252
Bug: 61776
Bug: 63121
Bug: 63229
Change-Id: I8af9f7ba4be45b42f6e2e382ff1a3e1f452058ba
2014-09-30 22:51:06 +01:00
jenkins-bot c8a408e8ce Merge "mw.LinkCache: Clean up" 2014-09-29 23:36:03 +00:00
Timo Tijhof 94c2c6c745 mw.LinkCache: Clean up
Pompidom.

Change-Id: Ia4e05d62845a7bce685cc9926101a238fe4bbce9
2014-09-29 16:33:46 -07:00
Bartosz Dziewoński c81ed82fa8 Add rudimentary support for page status indicators
Just hide them when opening the editor and show again afterwards. Will
need Parsoid for proper support.

Corresponding patch in core: I2389ff9a5332a2b1d033eb75f0946e5241cfaaf4.

Bug: 23796
Change-Id: I3ce5e7869be50dcd189ca24e2b3d7ebc62de4fc4
2014-09-29 13:45:10 +02:00
jenkins-bot 3d0aae0dcd Merge "Stop "Edit pages on double click" from affecting VE" 2014-09-25 22:52:19 +00:00
Alex Monk 77fc7e7d6c Stop "Edit pages on double click" from affecting VE
Relies on I0f6225b2

Bug: 53058
Change-Id: Ibd363dfb9da7d91055c541a83969d23401297603
2014-09-25 21:19:18 +01:00
Roan Kattouw 8517777b9f Update VE core submodule to master (8d5ec7a)
New changes:
8d5ec7a [BREAKING CHANGE] Rename ve.Document.getNodeFromOffset to getBranchNodeFromOffset

Local changes:
* Update calls for rename of getNodeFromOffset to getBranchNodeFromOffset

Change-Id: Ibc69f5a5deeed5698368bb19b30f14497c579e90
2014-09-24 11:34:14 -07:00
jenkins-bot f67989eaa5 Merge "Replace use of ve.isArray with native Array.isArray" 2014-09-24 03:05:57 +00:00
Timo Tijhof 66de06b0fa Replace use of ve.isArray with native Array.isArray
Change-Id: Ibc45e0fd80db7da872f6ef934cef915be9366e06
2014-09-23 17:58:09 -07:00
Alex Monk 93e4c59e4f Use LinkCache instead of an object in MWCategoryWidget to store hidden status (to be shared with the input widget)
Change-Id: Icb62b9b27ea1d61097d059fa268cc4834d46fc9f
2014-09-23 23:56:27 +01:00
jenkins-bot d2bcc9dc05 Merge "Show pending state on action button and keep dialog open when switching to source mode" 2014-09-16 23:44:22 +00:00
Roan Kattouw c4857a1f82 Use ve.parseXhtml() and ve.serializeXhtml()
Introduced in VE core in I0fb47f7c91f61.

In IE, this fixes corruption of style and bgcolor attributes.
In other browsers, the only change is that we now use
XMLSerializer rather than .outerHTML to serialize, but as
far as I can tell this isn't materially different. XMLSerializer
correctly uses HTML semantics when given an HTML document.

Bug: 70856
Change-Id: If48555fa4763e763484bbabfa0bc4ded0d0a5c58
2014-09-16 01:41:53 +00:00
Alex Monk 65b232a35b Show pending state on action button and keep dialog open when switching to source mode
Instead of doing a blocking overlay, we're simply keeping the dialog open,
which is necessary for the pending status of the action buttons anyway.

Requires Ib2c8f336 in OOUI

Bug: 65012
Change-Id: I65b5de4a1666a81b157a71f6fec490007689eb44
2014-09-15 20:44:55 +01:00
Roan Kattouw 7545868bc8 Don't return undefined in ve.init.mw.Platform#getLanguageName
When the language isn't found, return an empty string
instead of undefined.

Bug: 70731
Change-Id: Ia28e0d24e57e3a24414e04bee58ec76459665ad4
2014-09-12 14:43:31 -07:00
James D. Forrester e130042b7f mw.ViewPageTarget.init: Log an error if target fails to load
So users aren't left entirely stranded..

Change-Id: I111176b83227b48d50623a4817b9dc7573010338
2014-09-08 01:11:07 +02:00
Timo Tijhof 7f43fccd4d mw.ViewPageTarget.init: Reduce Deferred clutter in getTarget()
* mw.loader.using returns a promise already.
* Use .then() instead of manually forwarding failures.
* Cache .promise() result.

Change-Id: I3d0a90051c389c02dd5714020b2a1fb872790a18
2014-09-08 01:10:10 +02:00
James D. Forrester f2e22babaa Update VE core submodule to master (1f82a47)
New changes:
5d063a2 Don't use three different coordinate systems in getSelectionRect()
feeb1ae Only focus the paste target if focusedNode has changed
2c1bb97 Update OOjs UI to v0.1.0-pre (4cef83f702)

Local changes:
* Update references to renamed classes
* Update calling patterns element mixins

Change-Id: I330c0e308807597dec31dad8dbf713eb29fdc290
2014-09-03 17:20:09 -07:00
Alex Monk 14b23d7ba4 Make sure mediawiki.notification is loaded -before- calling ViewPageTarget#checkForWikitextWarning
That function needs to return the result immediately, not wait for module loading (via mw.notify).
This was breaking us being able to keep track of what wikitextWarning object was in use (but only
the first time we used the module), and therefore fail to close the warning when the wikitext
disappeared.

Bug: 70168
Change-Id: I0f1427423a5fe82ec8e70e2f0462a3044ca7ace8
2014-08-29 21:18:24 +01:00
jenkins-bot 3286115c21 Merge "Return undefined, not null from onbeforeunload" 2014-08-28 23:11:30 +00:00
Roan Kattouw f0cadeca42 Return undefined, not null from onbeforeunload
IE doesn't accept null as a "do nothing" value, only undefined.
If you return null, it'll show a popup with the text "null".

Change-Id: I984a7ded483c4c178cbca2a9af9abd895e6ded56
2014-08-28 14:38:49 -07:00
jenkins-bot 7492cc7949 Merge "Pick up 'summary' parameter from URL to use as initial edit summary" 2014-08-28 21:29:07 +00:00
Alex Monk 2748366a8e Pick up 'summary' parameter from URL to use as initial edit summary
To match the wikitext editor

Bug: 69501
Change-Id: I3cfc269aa344d89cc30af29699aca70eda5565e2
2014-08-28 02:56:14 +01:00
Roan Kattouw 03c8ad7744 Fix various bugs in our Monobook stylesheet
* Toolbar was too tall
** The actions toolbar is nested in the main toolbar, so the rule
   increasing the font size by 25% for toolbars applied to it twice
* Font size in link suggestions was too big
** Remove 25% font size increase from overlays
** Add it back on the context (otherwise it's too small)
** But only on the main surface's context (otherwise contexts in dialogs are too big)
* Make highlights and context appear below, not above, toolbar menus
** z-index: 4 was too high for the overlay, because MenuToolGroup also has 4
** But the default of z-index: 1 is too low because it puts dialogs behind the surface
** z-index: 2 seems to work

Bug: 69949
Change-Id: I19da270abcdbe526ff213f0eb7d0859b48276930
2014-08-27 23:28:20 +00:00
jenkins-bot aa95f70c4e Merge "Switch 'disallowQuotedKeysInObjects' jscs rule on and fix up" 2014-08-25 18:00:07 +00:00
jenkins-bot 8462907ae3 Merge "Do not focus CE on mobile when editor opens" 2014-08-22 22:50:59 +00:00
Ed Sanders 9a1e3852fc Update VE core submodule to master (c231b71)
New changes:
c9f1027 Remove broken ve.isMsie() function
6571da1 Fix case on language annotation CSS class
c231b71 Fix case in all annotation classes

Local changes:
Fix case in all annotation classes

Change-Id: Iba2596cde52d8f8be27e0257893ef8ec77798ae8
2014-08-22 14:27:14 -07:00
jenkins-bot 67877be2a2 Merge "Blacklist plain block images from MW paste" 2014-08-22 21:07:17 +00:00
James D. Forrester a232147b11 Switch 'disallowQuotedKeysInObjects' jscs rule on and fix up
Change-Id: I75ac4b378ef485feead9d0eff34ed7877b94b5d0
2014-08-22 13:50:48 -07:00
Roan Kattouw c5281a4e4d Don't apply a background to language annotations in IE
Because doing that makes the text disappear if dir="rtl" is also set.

Bonus: explain why we're changing which nodes to set highlight
opacities on for IE.

Change-Id: I061e372b26a7b523fc1f307ad9897b884803fdf4
2014-08-22 13:34:45 -07:00
Ed Sanders 57cd852543 Blacklist plain block images from MW paste
Same as inline images, only MW images are allowed.

Change-Id: I0272ebb44c044cd6bcdb85cd5e11d3b50530cc73
2014-08-22 21:31:29 +01:00
Juliusz Gonera 7864de472e Do not focus CE on mobile when editor opens
Extract the part of mw.Target#restoreEditSection responsible for moving
cursor to a separate method and move the cursor only on desktop.

Bug: 68832
Change-Id: I4ffc54ced64ce9e52d0cbcffb2fb4d082239098c
2014-08-22 12:37:00 -07:00
Roan Kattouw 2cf3c8bcd8 Update VE core submodule to master (f1fd9a8)
New changes:
eaa4528 Queue up annotation changes to make operations safer
09fc01f [BREAKING CHANGE] Remove span-wrapping of images
b59f85f Followup b141a7d2: make inspectors not close immediately in IE
1088cac Define kbd font-family explicity in case environment overrides
137add3 Fix embeddable desktop context popups
a2f0f80 Rename getRelativeOffset to getBoundingRect and use in getSelectionRect
fc09114 Fallback to node position when getting selection rectangle
1506099 Change comment to meta in whitespace test case to actually test whitespace handling
7dc4854 Remove global overlay classes when destroying MobileSurface
6e6b08a Update OOjs UI to v0.1.0-pre (d6008381aa)
e0a8089 Destroy WindowManagers in Context and Surface destructors
8c71904 Never embed the context when an inspector is present
163bd50 [BREAKING CHANGE] Rename 'image' to 'inlineImage'
5dd8bad Make focusables behave correctly when $element != $focusable
ba6fba7 Basic block image (figure/figcaption) support

Update changes:
* ImageNode was renamed to InlineImageNode in VE core
* BlockImageNode and BlockImageCaptionNode were added in VE core
* ve.ce.ImageNode.css was removed in VE core

Change-Id: Ide31b47448a4b4d6388f84a7a6ee9d471c1331f6
2014-08-22 11:51:50 -07:00
jenkins-bot bea941d213 Merge "Followup 67f304a: use .openWindow(), not .open(), to open save dialog" 2014-08-21 19:06:16 +00:00
Roan Kattouw e33bcb02cc Followup 67f304a: use .openWindow(), not .open(), to open save dialog
Calling .open() directly doesn't work any more.

Change-Id: I986ad063f7b83992a8f96969ccb5f7e08fb9f386
2014-08-21 12:00:40 -07:00
Bartosz Dziewoński 8bb55d683b mw.ViewPageTarget: Be more careful when updating page title
If there is more than one span in #firstHeading, we only want to
update the first one.

This will still break if something inserts elements *before* the title
span, but fixing that would take more thought (we probably should
rebuild the entire heading element and fire 'wikipage.content' on it).

Bug: 69857
Change-Id: Id78b9b8275a57c9b3f3f1dbd0aaca356f94d0f03
2014-08-21 18:36:01 +02:00
Sam Smith 33ef289190 Reinstate the ve-ui-toolbar-saveButton class
The class provided a minimal coupling to the firsteditve guided tour,
which used it to attach a guider to the "Save page" button.

The class was removed in I30dc7020121f0dd6907b61ef674a7cb14eb00652.

Bug: 69784
Change-Id: I81fdc4f2fa41c86a6481cf478c154b5d6c99d41d
2014-08-20 17:39:40 +01:00
jenkins-bot 90110f53b1 Merge "Provide mw-redirect and mw-disambig classes for links on the surface" 2014-08-19 18:00:07 +00:00
Roan Kattouw 924e3c026d Update VE core submodule to master (03975f8)
New changes:
a28e085 Restore QUnit web UI
8e2477c [BREAKING CHANGE] Move modules to src and tests and i18n, UnicodeJS to lib
26adfaf Fix path prefix for tests/index.html so it actually runs
d87dab5 Work around getSystemPlatform() race condition
6682ebc Make getParsedMessage() test actually test getParsedMessage()

Local changes:
* Update paths from lib/ve/modules/ve to lib/ve/src or lib/ve/tests
* Update paths from lib/ve/modules/unicodejs to lib/ve/lib/unicodesjs
* Rename unicodejs.wordbreak module to unicodejs
* Update code for getSystemPlatform() and isInternetExplorer()
  being made static

Change-Id: I7bb3bb74addfd3fbb64795c5ac3ff791b8874a4f
2014-08-15 14:42:08 -07:00
Bartosz Dziewoński 066283dde7 Provide mw-redirect and mw-disambig classes for links on the surface
To mimic PHP parser, or, in the case of mw-disambig, what I would want
the PHP parser to be.

Change-Id: I70dc426a3b87daef27816d6d86130c39f30ba0f4
2014-08-14 16:56:07 +00:00
Ed Sanders 7c923c2044 Remove unused modules URL
Change-Id: I1e66866388ee862bc122faacebbd5f3883bd90f8
2014-08-12 23:54:30 +00:00