Commit graph

52 commits

Author SHA1 Message Date
Ed Sanders 4d53bcbe09 VE: Don't load CodeMirror code until tool is activated
This saves about 300k uncompressed / 80k compressed whenever VE loads!

Change-Id: I7cf1c35292c2ea48cc15ceb4c22d4473a25484e9
2020-03-19 20:23:24 +00:00
AronDemian f0e689d203 Remove the unnecessary 1.5em padding in MinervaNeue skin that misaligns highlights.
Bug: T245532
Bug: T245568
Change-Id: Ib29678eb38ebb5a5d2975a087e55b2ddd2a4b35d
Related: I135bf0f7bf73e0d9faaa43c565cef43c5c934a34 - T245476
2020-02-19 15:00:43 +01:00
Bartosz Dziewoński 5a1501d46f VE: Update padding to match VisualEditor changes
See Ib7ffbf09d5aa23fddb894aa3b081ec993ddcee2d.

Bug: T238678
Change-Id: Ia9d38599e76b63147318c6604dbd9b9fabf35b16
2019-12-13 14:54:03 +00:00
Ed Sanders a134e66777 Don't replace whitespace characters in VE
Bug: T153434
Depends-On: Ic4a5ab803c89b3671f452579bca0da08b779bdfe
Change-Id: Ic3d848ff86cceceeeea9385bfc49ad2241e3801b
2019-11-14 22:30:32 +00:00
Ed Sanders cf9885b586 Match tabSize to surface view CSS property
For browsers that don't support the property, assume
the default value of 8 is used.

Change-Id: Icb9a97fa79e08458bf717903f1d7b68e433e7904
2019-11-14 22:30:32 +00:00
Isarra 90ac9d3475 Remove Timeless VE styles, too many variables to do them properly here
Move this stuff to Timeless itself since we can just reuse the width cutoff
and padding variables directly there and don't need to worry about them
randomly changing.

Corresponding change: Ic64b9786cb7186dba3eb2042a3238149c3bb44c6

Bug: T230756
Change-Id: Ia7168341bcadbc60e307b58b67afc1975a2424f9
2019-08-20 20:26:45 +00:00
Ed Sanders 7604581cc1 Remove obsolete aliases from closures
Bug: T208951
Change-Id: I64c2966b7c41d6b2b1911e2fb52e4c7364bf7964
2018-11-12 13:19:41 +00:00
Bartosz Dziewoński 079d240a2c ve.ui.CodeMirror: Fix padding to match VisualEditor's padding
VisualEditor's default padding for the source editing surface was
changed in Icdc6f1e2a7544ebbd828f85ff370113a0e06983a (June 2018).

Since then the alignment of editing surface and CodeMirror syntax
highlighting surface was broken in skins that don't override the
default padding (basically every skin except Vector and MonoBook).
Unfortunately Vector and MonoBook happen to be the only skins we
officially support and actually test, so the issue went unnoticed.

Bug: T205154
Bug: T205658
Change-Id: Ic85a6c20b266f6b93ab8ec9c2d35acff679f31bc
2018-09-27 22:06:00 +02:00
Ed Sanders ef8c62c74b Use renamed ve.visibleWhitespaceCharacters
Change-Id: I246079505d4c37406b3f99ca17b7e8e926adaec5
2018-09-24 16:34:54 +01:00
Ed Sanders 1be09a9a1d build: Update linters
Change-Id: I8d3aaf0b7d453033b72e5d6622b8f54df2c86bca
2018-09-12 00:03:19 +01:00
Derk-Jan Hartman 736c63fd0b Accessibility: Disable both directions of tabbing in CodeMirror
Bug: T197534
Change-Id: Ia05c3ccbdb4baa8e701bf46478c42d2473777535
2018-06-17 19:24:14 +02:00
Ed Sanders 341a67496a Simplify target lookup
Change-Id: I00449f043c391c7648e2c17651d15c2807044402
2018-05-12 13:10:05 +01:00
Ed Sanders fca1d62a6c Apply line height selector to CodeMirror line wrapper
Bug: T193219
Change-Id: I7973b5e1a4f602c0fc371d78a1ebead093c48e74
2018-04-27 21:42:45 +01:00
jenkins-bot d3c7f3cdd4 Merge "Use CM API for setting document direction" 2018-04-25 18:36:32 +00:00
jenkins-bot 466fca0ec0 Merge "Load CodeMirror with VE always" 2018-04-25 16:04:39 +00:00
Niharika Kohli 7c848abd8d Load CodeMirror with VE always
This patch makes Codemirror on VE independent of the beta feature,
making it always load.

This is a first step to graduating CodeMirror out of beta.

Bug: T191923
Change-Id: Ide794e8f986d3f0455ff282819c71d9144dd75db
2018-04-23 20:54:43 +00:00
jenkins-bot 6e2bdac5d2 Merge "Remove 'Try syntax highlighting' popup for all users" 2018-04-18 21:02:25 +00:00
Ed Sanders dcf28f37a1 Use CM API for setting document direction
Bug: T191923
Change-Id: I68ee7de8ff2d26044fc8a71a04ade65b5d4420c8
2018-04-16 16:53:29 +01:00
Ed Sanders d428893b80 Merge selectors for VE & CM surfaces, and add 'hyphens' rule
Keep all our font rule settings in one place to make it
easier to keep them in sync. Also add a rule for 'hyphens' in
case the browser default has changed.

Bug: T192019
Change-Id: I2c27e5075a9bc6aaed9fe048d163f57976708357
2018-04-16 16:43:35 +01:00
MusikAnimal 7d99bbefde Remove 'Try syntax highlighting' popup for all users
A Node script was used to remove the now unused i18n messages.
This same script sorts the messages alphabetically, so it looks
like some unrelated messages were changed, but they weren't.

Bug: T191297
Change-Id: I69cce06133c1d055d31d12ebc8408123c187b574
2018-04-12 18:22:31 -04:00
Ed Sanders c09151d659 Fix some small edge cases with font matching
Change-Id: I6e2df8e13f19a29a3a80fbbfc0ed5332c33eb584
2018-03-27 22:35:00 +01:00
Ed Sanders 4f2ace3ad9 Unbreak VE integration in IE11
Element.remove is not supported in IE11 so use
parentNode.removeChild.

Change-Id: Iacfdc2fb563d5ed168dc691ecf439e60e94d4e2a
2018-03-27 21:46:00 +01:00
Ed Sanders 1dc74c66fe Avoid using bold with VE+CodeMirror
We can't guarantee the preserve glyph width, e.g.
on Firefox with Chinese characters.

Bug: T184467
Change-Id: I6fc92fcd034bda3d9a94749935aae03c8373f7c5
2018-03-07 19:56:51 +00:00
Ed Sanders 06af670325 VE: Use different approach for transparent text issue
Deferring the insertions can lead to sync issues, so use
a different technique to selective refresh the CodeMirror
view when the height changes.

This reverts commit 8e3d96f75f.

Bug: T188473
Bug: T185184
Change-Id: I502501cc0325db64f29a67716306733859d102a9
2018-02-28 12:38:44 +00:00
jenkins-bot b0ee15034a Merge "VE: Match whitespace rendering of ve.ce.TextNode" 2018-02-25 22:40:46 +00:00
jenkins-bot 348949d15b Merge "Defer update of CM surface to avoid invisible text" 2018-02-25 20:58:45 +00:00
Ed Sanders 8e3d96f75f Defer update of CM surface to avoid invisible text
Bug: T185184
Change-Id: I0b115d892ab322911c895dda030b77f35cc9195a
2018-02-25 18:05:19 +00:00
Ed Sanders 8b27277b20 VE: Refresh rendering after surfaceReady
Bug: T188215
Change-Id: I4c53f554d8091aa71ce59fe04857b588209639d3
2018-02-25 17:58:32 +00:00
Ed Sanders 452d6d0a80 VE: Match whitespace rendering of ve.ce.TextNode
Bug: T187694
Change-Id: Ie27e9862e0f55fcc10af91a2bdd9c5d21d49ddc4
2018-02-19 10:43:53 +00:00
Ed Sanders e795883f0d NWE: Fix padding in Vector
Bug: T185299
Change-Id: Iea8e61654608259ddc90286aef59014a37e4f44d
2018-01-19 10:13:53 +00:00
Ed Sanders 8d998f97ed Make NWE integration background transparent
Allows for VE's placeholder text feature to work.

Change-Id: Ieee01baf3dc049f248a97408af70499dcea8f4c9
2018-01-04 12:37:42 +00:00
Ed Sanders 9960ed601f Remove font-size now it is set by editfont
Bug: T180678
Change-Id: Ic9e8bdb3b34dbb2f2c5748d6bb57e9da90112118
2017-12-21 12:21:57 +00:00
Ed Sanders 80241fb717 Disable WebkitTextFillColor in Firefox+OSX
Avoids opaque selection covering text.

Bug: T175223
Change-Id: Iede96501d4a03ccd80488b4661c18647eb9118e1
2017-11-30 18:05:52 +00:00
Ed Sanders 0296e2dcad Fix typo in name of non-webkit hide class
Also increase opacity to 40% so selection & cursor
are more visible.

Change-Id: Ia957f816de9003eb8b709de3d7993bbfef99e3bc
2017-11-30 16:35:57 +00:00
jenkins-bot ca3ff81fc1 Merge "Remove reference to editfont-default" 2017-10-03 18:48:23 +00:00
jenkins-bot 76671dc662 Merge "Respect beta feature in new wikitext editor" 2017-09-29 05:37:46 +00:00
Sam Wilson 0ca61108d1 Change popup label colour to green
This is to stop it looking so much like a link that can be clicked on.

Bug: T174219
Change-Id: Icdae8ddf32aa0c08fe0d708eb289bafe53f9b589
2017-09-12 08:29:49 +08:00
Sam Wilson b4b9da7e51 Join the popup label into one message
The popup label was being styled as two words from two different
i18n messages, each a different colour. This combines them into
one, moves the identifing class name up to the outer span, and
colours both words blue (the outer braces are left black).

Bug: T174219
Change-Id: Id1166f48ae4b3b8daff29be56dd92ef330dd9cef
2017-09-11 10:23:22 +08:00
Ed Sanders f5210867ba Respect beta feature in new wikitext editor
Bug: T173480
Change-Id: I2ca5a33f09aefe0c3d31082270869a13cee14fc4
2017-08-30 22:53:55 +01:00
jenkins-bot ba091f4ee8 Merge "Add RTL support in VE source editor mode" 2017-08-29 15:59:28 +00:00
Ed Sanders 439628712b Remove reference to editfont-default
Bug: T170223
Depends-On: I1ace59c980740fc785ccbd500e19cc8b71d46a5b
Change-Id: I1e0dcab462aaa8c924b49d42f8679359a449a62e
2017-08-25 18:46:01 +01:00
niharika29 c6ab876fe7 Update the CodeMirror icon in NWE to the highlight icon, like in the other editors
Change-Id: I92c61c0bb21fc80ee6ab3ffd521d59764e757f7c
2017-08-23 17:22:23 +00:00
Ed Sanders 29680aceb7 Add padding support for other skins
Change-Id: Ia7494545f2dda36bc2798c23ff8a2855212b77aa
2017-08-13 12:38:40 -04:00
Ed Sanders 11f592ba54 Add RTL support in VE source editor mode
Bug: T170001
Change-Id: I7223a57969a2299a86d73cfd57336e8d56086520
2017-08-13 11:10:54 -04:00
Ed Sanders 7fe9e2e762 Popup: Use built-in features of PopupWidget instead of custom CSS
* Use OOUI buttons for the actions.
* Make the widget wider to accommodate longer titles in
  different languages.
* Don't show if CM already enabled

Change-Id: Ibde461a99929565c15b5e7c5ef3ad88e163fba05
2017-07-20 21:30:45 +00:00
Ed Sanders cec399b4e3 VE: Disable mw-editfont when using CodeMirror
Due to using bold as a highlight style, the VE overlay technique
will only work with monospaced fonts.

Change-Id: I33e3e07cf0f3d8e25dd35623286eedf28ba20ae1
2017-07-20 21:30:22 +00:00
Ed Sanders 410e442fd1 build: Update eslint, stylelint
Whitespace and regex escaping fixes

Change-Id: Ic706dfd3ed7efb16db104b054091bec0ba0cb5ed
2017-07-20 15:58:31 +00:00
Ed Sanders 16225450c8 VE CodeMirror: Don't handle any specialChars
Bug: T170382
Change-Id: Icf39a5efdc5a553cf5885e4de7189a37a9a7424d
2017-07-12 15:23:49 +01:00
Ed Sanders 91397eb556 Ensure CM surface can't be edited in VE mode
CM surface is just for presentation, it shouldn't
be possible to focus or select anything in the surface,
so in addition to it being beneath the VE surface,
disable it through the CM API and disable pointer-events
with CSS.

Bug: T170170
Change-Id: Ief49c293f514e22bc6db5eebb3a11c1bc695432d
2017-07-10 18:02:22 +00:00
Ed Sanders 6364cb4c04 Rewrite VE<->CM synchronizer using transaction op walking
Previous hacky method fell apart with multi-line transactions.

Depends-On: I465a3f6a8afcd6536293999eb40c01daeb9d905b
Depends-On: I800085eb3a5f7332eab356b62a34bfc603a29839
Change-Id: I66946d7e3f425d8dbbdae720756a7978fbe25582
2017-07-07 23:33:10 +00:00