Commit graph

133 commits

Author SHA1 Message Date
Ed Sanders aa2e0af348 Update VE core submodule to master (19e50b7)
New changes:
e536779 [DEPRECATING CHANGE] Rename link inspector tools
3899967 Localisation updates from https://translatewiki.net.
0a1c09e [BREAKING CHANGE] ve.init.Target: Upstream the action toolbar from sa/mw desktop targets

Local changes:
* Refactor tools for the breaking change

Change-Id: I676af9c50b09ef007926240eb2327d1a0fdd80f5
2015-12-11 10:03:02 -08:00
James D. Forrester 705199753c Let the feedback tool be configured for a remote wiki
Bug: T92661
Change-Id: Id48729c89db208714f67fec1eabafe577a834b51
2015-12-10 12:12:59 -08:00
Ed Sanders e9250d87fd Avoid useless jQuery.click shortcut
Why have one event API when you can have ten...

Change-Id: I645cbeb4e486aba9e734ba47d2e7c3958a694f19
2015-12-09 17:34:00 +00:00
Ori Livneh b1db8349fe Avoid embedding Git metadata in ext.visualEditor.data
Partially reverts "Expose version information in the client" (a72099af66 / I7836e1d40).
The Git data oscillates between two values due to differences between the
staging and production environments. Each change causes the module version to
change also, leading to cache churn.

Instead fetch version information with an API call the first
time the help popup is opened.

Bug: T119750
Change-Id: Ib9c45e60d3164cfa85eb1ef247cc91cf0d8bf954
2015-11-30 12:34:56 +01:00
Ed Sanders 259ec31ece MWSignatureTool: Restrict command to linear selections
Change-Id: If6109c2ef2a18eccaccf18bd1d76c272a1dc3cd5
2015-11-17 22:08:23 -08:00
Ed Sanders e1d14099e0 Image/gallery icons: Rename and use new upstream versions
Depends on oojs-ui > 0.13.2.

Change-Id: Iee4cc52b998626e829fd92346d5ee1295c08f26f
2015-11-18 01:49:31 +00:00
Bartosz Dziewoński 9be5c85db4 Provide a tool to insert a signature in namespaces that need it
VisualEditor is usually not enabled in talk namespaces... but
sometimes it is. And when users see the button to edit with VE,
they're going to click it and expect to be able to sign their posts.

This tool is only loaded on talk pages and pages in additional
namespaces defined in $wgExtraSignatureNamespaces.

Code adapted with small tweaks from my own gadget
<https://meta.wikimedia.org/wiki/User:Matma_Rex/visualeditor-signature.js?oldid=13461327>,
which is already available under the MIT license.

Changes include:
* The tool is now always visible if the wiki allows signatures in any
  VE namespaces, but disabled when not allowed in the current namespace.
* Register '~~~~' sequence to insert the signature.
* Code style tweaks for stricter lint checks in this repository.
* Documentation corrections.

Swedish translation provided by André Costa (already credited
as a translator as Lokal_Profil).

Depends on changes in VisualEditor core:
* I89fe53890ab59d12260ea6b41de802c38c24e8b9
* I14cd7efac521687ea38580341ae08ddc522edeeb

Bug: T53154
Change-Id: I6be5fb2118cf3eef5098d4c5320228aa81411ccb
2015-11-16 18:06:32 +01:00
jenkins-bot 53dbf3ac2f Merge "Replace 'source' icon with OOUI's 'wikiText' one" 2015-11-11 01:42:00 +00:00
Alex Monk 87affb5ca4 Restructure education popup code to work without overriding onSelect
That code was breaking on mobile which uses a subclass of the normal
link inspector.

Bug: T117603
Change-Id: I75541230c21b1ee9eb73f6fb4b1fe5a5f9c14e75
2015-11-09 23:18:01 +00:00
Ed Sanders 216d0ea7a7 Update CommandHelpRegistry calls for breaking change in core
New changes:
281b543 Slugs: Remove vertical alignment hack
d6ddbe4 Localisation updates from https://translatewiki.net.
94bb263 Follow-up d6ddbe4: Fix build for added language 'sd'
bc8579d [BREAKING CHANGE] CommandHelp: Cleanup registry API

Change-Id: I65e2bfc299fbd60d6bdc7a57a030980b6cb8ab18
2015-11-05 07:29:44 -08:00
Ed Sanders 3716682570 CommandHelpDialog: Move registrations to where sequences are defined
Change-Id: I031575bbf40cd789252ac5e082bb5fa435eab257
2015-11-04 15:03:58 -08:00
Alex Monk 6341c4a3b5 Apply same hide/show logic to both education popup dots
Bug: T117627
Change-Id: Icbde23f396935b7f6275ed89ce264ce5e49ebf6a
2015-11-04 15:56:40 +00:00
James D. Forrester 09800aa249 Replace 'source' icon with OOUI's 'wikiText' one
Change-Id: Id66d436b9140604ace7ebfbec1f80dc8f3830a20
2015-11-04 06:15:29 -08:00
Alex Monk 5eaa211d43 MWEducationPopupTool: Changes to the dot
Make the dot more like the one in the designs, with two circles etc.

Change-Id: Ic3e1b2dcd846c5825455b68697acab44016ee598
2015-11-03 01:15:44 +00:00
jenkins-bot 2018249d97 Merge "Create more MW sequences" 2015-10-22 21:49:54 +00:00
Ed Sanders 07d56b6b5d Create more MW sequences
* '{|' for tables
* '<!--' for comments
* '<gallery' for galleries

Change-Id: Ib78c411bf8676bc1974bb80515fd56c642cd67b7
2015-10-22 22:23:13 +01:00
jenkins-bot bc15c3e189 Merge "Move sequence registrations adjacent to commands" 2015-10-22 16:12:38 +00:00
Ed Sanders 57d33a291e Move sequence registrations adjacent to commands
If a command is not registered because a file/module is not
loaded, the sequence should not be loaded either.

Change-Id: I45d86ad371c7b717601b6593eaa573292ebdd4ed
2015-10-22 15:15:41 +01:00
Ed Sanders 524c2c9ee0 '<ref' sequence: Trigger basic dialog if Citoid not installed
Change-Id: Ibb7589e760e5583e12581cd4fc07dc88101420ea
2015-10-22 11:21:20 +01:00
Ed Sanders 760d9c130c EducationPopup: Tidy up DOM and CSS
Change-Id: I4effa34a4d3ddfca0f6ee61fe169a726dc0ec3f6
2015-10-15 22:35:30 +01:00
Roan Kattouw 17a5cf6a93 Followup 9d6fbc894e: fix JS error in education popup
If a tool had an education popup bound to it, but it was
suppressed because the user has already seen it (according to
the cookie or localStorage), then clicking that tool would
cause a JS error.

Also remove a workaround for a ClippableElement problem
that appears to be unnecessary.

Change-Id: I73a3f5f9cc1726e28e70fc545b72960afc5ac41c
2015-10-14 16:32:14 -07:00
jenkins-bot 81a89952ef Merge "Educational popups and highlights for links+citations" 2015-10-14 21:52:50 +00:00
Alex Monk 9d6fbc894e Educational popups and highlights for links+citations
Bug: T108620
Change-Id: I42b0e06f50aca5cb783d88f79a080461e745ceee
2015-10-06 14:33:57 +01:00
James D. Forrester e5e1810f02 MWWelcomeDialog: Alter to be welcoming, use a nice image
Drop beta-ness as users don't care and it confuses them. Leaving the preference
alone for now.

Bug: T99963
Bug: T112354
Change-Id: I0e039dec54d528fce24226e76b931b593dd13a9e
2015-09-14 18:29:07 -07:00
Ed Sanders 471df53aaf MWLinkInspectorTool: Add parent method call to #updateState
Bonus: No need to check if fragment is a SurfaceFragment.

Bug: T111099
Change-Id: Ieaa3ee979477175d0f129e30838853bc04937fad
2015-09-01 21:09:13 +00:00
C. Scott Ananian 7cc23367f6 Specialized inspector for ISBN magic links
Implement a special node type, context item, and inspector for
ISBN/PMID/RFC magic links.  Add buttons to the link inspectors
to convert back and forth between "simple" links, and magic links.

Depends on I5d000d8b63dafdfe0a2753069d3f0ac5b03b8829 in Parsoid
for clean round-tripping of localized ISBN magic links.

Bug: T63558
Change-Id: Id5b7a2ae3c80b0e5eed598f0bd024d3e94f7e9aa
2015-09-01 14:25:59 -04:00
James D. Forrester 282ddfa1b6 build: Enable jscs jsDoc rule 'checkTypes' and make pass
Change-Id: Idbf6e698ba7015ee5e4f1cf78234ad3f187f1c06
2015-08-19 11:37:13 -07:00
James D. Forrester f5c6f61163 build: Enable jscs rule 'requireSpacesInsideBrackets' and make pass
Change-Id: I846d36c15e1b1f810d2ef7fd422f8412790bcb0f
2015-08-19 10:33:02 -07:00
Alex Monk 48f941caf9 Set the default feedback message to the page URL
Bug: T109081
Change-Id: Ibc36acd38738e2d45621d477c0406b28a744290a
2015-08-17 17:26:12 +01:00
James D. Forrester 1d6085b801 Update VE core submodule to master (e61ebf2)
New changes:
61d20a1 Hide on-screen keyboard when selecting nodes on all mobile platforms
e5aff79 Localisation updates from https://translatewiki.net.
a99a897 Update OOjs UI to v0.12.3
3c01a14 Make DM nodes sensibly hashable
a611eb9 Make ve.dm.example.postprocessAnnotations fluent
496c895 Update ve.dm.ElementLinearData#hasContent documentation
fcaa035 Support RegExp sequences; trigger sequence matcher after newline
edda1d4 Add a mechanism to wait until ve.init.platform has been created
e174155 Autolink URLs when typing
ac9248f Allow drag and drop of links (and subsequent autolinking)
c88fad6 Localisation updates from https://translatewiki.net.

Local changes:
* Define `ve.init.platform.getUnanchoredExternalLinkUrlProtocolsRegexp`.
* Make `ve.ui.MWLinkAction` extend `ve.ui.LinkAction`.
* Override `ve.ui.LinkAction.getLinkAnnotation` so auto-links use the proper
  `ve.ui.MWExternalLinkAnnotation` type.

Change-Id: I934f76158512e2e89b614ed92fef6481f70728e7
2015-08-12 14:31:06 -07:00
Ed Sanders ac9f1a0919 MobileArticleTarget: Give toolbar split focused/unfocused modes
Split the toolbar into two modes depending on if the surface is focused:
* When unfocused, show a hamburger containing back and source switch
* When focused, show editing tools, and a check button to unfocus

For the editing toolbar, space the tools out using table-cell layout
and hide labels below 480px.

Depends on I06813e3ff in core (surface blur method).

Bug: T93325
Change-Id: Ibf09cb29019d7a71e1e144b326710b1f6506cd0c
2015-08-06 15:43:36 -07:00
Ed Sanders 022fa98856 Use target-specific command registry for lookup
Only use was in MWHelpPopupTool#onKeyboardShortcutsClick.

Depends on Ie24369b9 in core.

Change-Id: I630d3e55057ddf6f87e39ab2e99e93a71bd1d8bb
2015-08-03 01:07:47 +00:00
Ed Sanders dedc107507 MWCommandRegistry: Move commands' registrations to their code
By moving the registration to the code which introduce the commands, if any
module such as 'media' is omitted from an integration, we don't register a
command which is never used.

MWCommandRegistry.js remains to be used for over-rides of core tools' exact
commands, such as insertTable.

Change-Id: I84b4351b980a764d3c72a564f605821ae1c761f9
2015-08-02 17:55:09 -07:00
Bartosz Dziewoński 6d18641e4d Specify 'associatedWindows' for link and citation tools
Depends on I21fb955ecb697060263538914014d5712e013695 in core.

Bug: T98845
Change-Id: Id7f59c0095e8d85bb608bed0ab60603665fbca47
2015-06-29 16:26:32 -07:00
Alex Monk 93c2ac5014 Don't add basic reference tool to catch-all
Bug: T101130
Change-Id: I225da5cb6a9b961af556029166bdf728197475e4
2015-06-29 19:42:00 +01:00
Alex Monk db036ddd8d Make sure switch to source editing button does not get disabled
Was broken by Ief769ba0

Bug: T97646
Change-Id: I43ea85373a6ca427bf6a1c9e01d70b960d93db91
2015-05-09 00:25:19 +01:00
Ed Sanders fd538835ef Fix line height inside notice/help popups
In wikitext editor these messages were in mw-body-content where they
inherited a sensible line height, so apply one manually.

Bonus:
* Make header bold
* Remove some duplication with inheritance

Change-Id: Ia7eaa556815ee6645a85162de03198e5a4dc7b03
2015-04-30 14:02:36 +01:00
James D. Forrester 85381a6b75 Update VE core submodule to master (2714bfc)
New changes:
8dc8b26 Trim leading and trailing whitespace from annotations
306feb4 Add get(Col|Row)Count to TableSelection and use in isFull*
1c06d21 Cursor holders for native cursoring to ce=false nodes
b08384d Provide file extension fallback for FileTransferHandlers
28844ed [BREAKING CHANGE] Move all icons to OOjs UI's icon packs
9d37355 demo: Set 'lang' attribute of target
8945420 Follow-up 8dc8b266: account for annotations that return []
c2bbc97 Localisation updates from https://translatewiki.net.

Local changes:
* Switch to using OOjs UI icons for VisualEditor core features
* Update test for whitespace trimming

Change-Id: I12b22a411600b6e8e61858e7ed600fb53eedd95d
2015-04-16 14:02:59 -07:00
Timo Tijhof 66c9d538c5 MWPopupTool: Don't assume editnotice html has a single wrapping element
In case of FlaggedRevs, for example, the software is given a loose
string of html with a Bold element, Text nodes, and Anchor element.

Bug: T95989
Change-Id: I3d345677507ffc08feec0f7785e148ac98f19cb7
2015-04-14 12:39:42 +01:00
Roan Kattouw 95bffa22a0 Stop using this.$
Has been a backwards-compatibility alias since OOjs UI 0.7.0.

Change-Id: I17d7c03e9d1b9fa991d88444d22abfd403269ee0
2015-04-14 02:54:01 +01:00
Timo Tijhof eca25738df mw.Target: Defer parsing of edit notices to MWNoticesPopupTool
Also use an array instead of an object. The keys were already
meaningless (index numbers). A "wikimedia/*" Git search did not
show any usage outside MWNoticesPopupTool. However, the array is
backward-compatible with any code using it as an object for keys
or looping (just in case).

This should also make the order more reliable.

Bug: T87412
Change-Id: I683cc902bda5ba768e962af6725e657871b79b9a
2015-03-30 20:47:25 +01:00
Ed Sanders 06ad00bf71 Simplify context item for MWAlienExtensionNodes
Just show the name of extension. 'MediaWiki extension' is meaningless
to most people.

Change-Id: I64dc4914874b3fb3f807d7e0155ad31f2a8e703e
2015-03-27 19:05:26 +00:00
jenkins-bot 557e0e28ad Remove use of ve.indexOf and ve.getObjectKeys
Change-Id: Icbaa729209605fca8018e4bcbbe29c9ded64e7f2
2015-03-10 17:28:00 +01:00
Moriel Schottlender ae72184c8f Work with the new mw.Feedback and add UserAgent checkbox
Add the new feature for user agent checkbox for the mw.Feedback
dialog. This bumps our MediaWiki dependency to 1.25wmf20.

Change-Id: I741ded83de4f575777a15cb20735e351039dc81f
2015-03-03 10:58:34 -08:00
Trevor Parscal 34da7d56b8 Update VE core submodule to master (2e1a0bb)
New changes:
04a5947 Localisation updates from https://translatewiki.net.
dd4691b Update OOjs to v1.1.5
2e1a0bb Context refactor

Local changes:
Add context item support for references, citations, templates and links

Change-Id: I5d488ecbf9768dc63de6e545505dbfd5eb84cc61
2015-02-27 18:21:13 -05:00
Roan Kattouw 2e0c051a37 Load mw.feedback on demand
It depends on jQuery UI so it pulls in a bunch of things
that we can do without while loading VE.

This does mean there's a network delay while we load
mw.feedback (if it's not in localStorage cache already),
so after the user clicks "Leave feedback", nothing happens
for a little bit until the code arrives and the feedback
dialog appears. There is no spinner or anything during this
time; we may possibly want to add one.

Change-Id: Ie4dd9efcfff238fefad2783e22575ffd3fc648e7
2015-02-24 00:30:03 +00:00
Bartosz Dziewoński c0d69dd3db Wait with showing edit notices until after the welcome dialog is closed
Its white overlay is pretty good at obscuring them, and the notices popup
would close when the dialog is closed, making it very easy to miss them.

Also fixed indentation.

Bug: T86987
Change-Id: I9f93c4169de98ef77a1eb33fd31a0ec524b6d2b7
2015-02-02 17:25:02 +00:00
James D. Forrester 2f8b3e0d96 build: Bump copyright notices to 2015
Change-Id: Ie92dab7411116d3410195c3fb0a3513c664c0c30
2015-01-12 20:34:19 -08:00
Alex Monk b539bcd4af Update bugzilla links to phabricator
Bug: T75733
Change-Id: I4bf870b19feac0ee10677829daeb3d46eba3d9d6
2015-01-02 15:47:28 +00:00
Timo Tijhof 2b7ae8c175 Remove use of bind() for inline functions
Follows-up b0e8900, 447e8de, d3f26e65.

Contrary to binding a reference, this-overiddes for inline
functions gets messy and fragile. There's also a minor
performance overhead that can be avoided. No separation of
concerns, eiter, as the object is held by the closure.

Also:
* Remove left-over instances of @method.
* Remove redundant '0' argument to setTimeout.
* Use null instead of $ for apply() on static methods like $.when.
* Use .empty().append() instead of .html(). Does the same but
  without additional overhead and without confusion association
  with "html" which isn't used (it doesn't serialise and re-parse
  or clone, it just appends when given one or more nodes).

Change-Id: I797a3667c67d52568150be9be5d043d149f22077
2014-12-16 23:27:53 +00:00