Commit graph

64 commits

Author SHA1 Message Date
Ed Sanders b5eb22bf04 Document monospace hack
Change-Id: Ia27dccdb9dc2de6ca66e08c54c62eb91302a381c
2018-01-11 14:45:39 +01:00
Eddie Greiner-Petter 3abd668325 Add new (unprefixed) CSS modifier user-select
The CSS already has this modifier prefixed with -webkit-, -ms- and
-moz-, some browsers now support this without any prefix (according to
caniuse.com: Chrome 54+, Opera 41+).

Change-Id: Icd67250c26bec61be0fb101f1db077ee13ccf6b7
2017-11-07 19:36:32 +01:00
David Lynch 17c5301995 ce.MWSyntaxHighlightNode: Always generate node contents
Don't bother checking supported languages before generating the node contents.
We always want the preview, as that's what will display on the rendered page
even if the language is invalid.

Bug: T164120
Change-Id: I8344449bbf9c9cce131d745ea5f4e54b96fe57b1
2017-07-17 11:37:05 -05:00
Ed Sanders 7239e4439c Remove redundant multiline option
MWAceEditorWidget is now multiline by inheritance

Bug: T170275
Change-Id: Ie9d8f200b95497bbe91396ea92e29b0d317f010a
2017-07-12 16:28:34 +01:00
Bartosz Dziewoński 8a186b5822 ve.ui.MWSyntaxHighlightWindow: Set $overlay for the ComboBoxInputWidget
* Allows the dropdown menu to extend outside of the dialog.
* Avoid z-index conflicts with Ace scrollbars (T170027).

Bug: T170027
Change-Id: I52d2d06b56391f30be07c71a86d71d9ab50f0a8c
2017-07-11 00:15:38 +02:00
Ed Sanders 28b480ca0a Pass dataElement type to parent's toDataElement
Ensures the rendering is cached with the correct hash.

Bug: T151130
Depends-On: I80e2f2587cff8e9d9fe6ded5d8581263268deaa8
Change-Id: I64466cc342f7ab7f9d4539f935688d167853a662
2017-05-19 16:06:44 +02:00
Ed Sanders f53d8c2e6e VE: Support editing start line parameter
Change-Id: I869ac413f4d7581026353e2d54f9d22c6b6290f5
2017-05-15 09:49:42 +01:00
Derk-Jan Hartman 9638ee20c3 Avoid background when the content is narrow
All our highlight content is inside a <pre> block. When this block is
more narrow that the page (due to being pushed aside by floating
context for instance), then the background of this parent element will
extend beyond the contents.

An alternative could be setting overflow:hidden; and then setting
margin:0 on the included <pre> element (which has UA default margins)

Bug: T126010
Change-Id: Id3c9544ea8fa379c7c640afa692d6184ad9c550f
2017-04-27 18:38:55 +02:00
Kunal Mehta db681d158b Update pygments to 2.2
Notable changes:

* Added new token types and lexing for magic methods and variables in
  Python and PHP.
* Added a new token type for heredoc (and similar) string delimiters and
  lexing for them in C++, Perl, PHP, Postgresql and Ruby lexers.
* Improved the CSS lexer.
* Added Varnish config lexer

Full changelog is found at:
<bc45808f83/CHANGES>

Bug: T156573
Change-Id: I4dc1782f19881ba1294308e1cdea1b2e063f438a
2017-04-27 15:10:16 +02:00
Ed Sanders d150ddea1c build: Replace jshint/jscs with eslint
Change-Id: I503a57bed2ee6bb648697d6245af0b0286b5f3ec
2016-11-19 13:56:05 +00:00
Ed Sanders 37711ca15c VE: Fix combobox API and other issues
* Combobox is now an input widget so doesn't need .input
* Replace isValid with getValidity.
* Remove 'Show line numbers' from inline mode, as it has
  no effect.
* Remove no-longer required z-index hack.

Bug: T150555
Change-Id: I3c4ac3cb6b174348cc3582469a86fb1a23ca7c51
2016-11-15 17:22:54 +00:00
James D. Forrester cfbc206cb2 MWSyntaxHighlightWindow: It's ComboBoxInputWidget now
Change-Id: Id18b096103c82eea996c27be5b33b05615e74757
2016-11-09 11:39:12 -08:00
Derk-Jan Hartman 50075eaa66 Convert SyntaxHighlight names to Ace names
Provide a translation from Syntaxhighlight compatible Pygments and
GeSHi language names to CodeEditor compatible Ace lexer names

Now when you select php4, the CodeEditor will use the Ace lexer php,
instead of falling back to text mode.

Bug: T148515
Change-Id: Ibc209f97318614f764457726f8d55f4e15276d79
2016-10-31 14:13:36 +01:00
jenkins-bot 65de308fdc Merge "VE: Ensure ext.pygments module gets loaded when a user adds a syntax highlight node" 2016-09-20 22:53:50 +00:00
Alex Monk 37ff7c6709 VE: Ensure ext.pygments module gets loaded when a user adds a syntax highlight node
Otherwise it won't get styled unless VE was loaded on a read page with one existing.

Bug: T60388
Change-Id: I32c02eda1e7dca077340c2bf3c15aadad7e3b61a
2016-09-20 22:24:40 +00:00
David Lynch 87736b516e Enable live autocomplete
Bug: T138458
Change-Id: I8440957ebc04267807c55aa4b8b347ede1240021
2016-09-19 11:26:31 -05:00
Chad Horohoe 3a017611da Add missing LICENSE and AUTHORS files
Bug: T138157
Change-Id: I9b1430c983f0ca6fea0bb0354796cffcff0030bb
2016-06-27 11:43:24 -07:00
Ed Sanders d679469840 Introduce stylelint
Change-Id: Iea4d20abb8aa9d656639c8e128df0e963291cace
2016-05-19 17:44:00 +01:00
jenkins-bot 09577225fb Merge "Prevent selecting line numbers in syntaxhighlight" 2016-04-12 16:10:27 +00:00
jenkins-bot 7bb06997dc Merge "VE: Preserve context when calling parent static method" 2016-04-12 15:09:27 +00:00
Ed Sanders f285f9e8c5 VE: Rename parent tool
InspectorTool is a deprecated alias.

Change-Id: If96a623cf260b01dad53e888ff111728b529ceec
2016-04-12 15:05:03 +01:00
Derk-Jan Hartman ccce9fdf53 Prevent selecting line numbers in syntaxhighlight
This works most of the time in modern browsers.

Bug: T131227
Change-Id: Iaad1568f55556c8dd0f465b555ce868498d71828
2016-04-11 14:25:40 +02:00
Ed Sanders 635ef9c4c0 VE: Preserve context when calling parent static method
Change-Id: I32e9c13d549f8f13ca50cf8d244f0dfbc3f3bb8d
2016-04-01 12:59:32 +03:00
Ed Sanders fbdf65a344 VE: Fix primary command on SH nodes
This fixes the double-click/press-enter to edit functionality.

Change-Id: I275c505d8a3abb7d7e3686ffacf52e54235241e7
2016-02-07 23:31:16 +00:00
Ori Livneh 5d99d54626 Update pygments bundle to 2.1
Changelog:
https://bitbucket.org/birkenfeld/pygments-main/raw/7614bf7/CHANGES

Lots of new lexers: Emacs Lisp, Arduino, Modula-2 with multi-dialect support,
Fortran fixed format, Archetype Definition language, Terraform, Jcl,
Easytrieve, ParaSail, Boogie, Turtle, Fish Shell, Roboconf, Test Anything
Protocol, Shen, Component Pascal, SuperCollider, Shell consoles (Tcsh,
PowerShell, MSDOS), Elm and J, Crmsh, Praat, CSound, Ezhil, Thrift, QVT
Operational, Hexdump, and CAmkES Configuration.

Bug: T125581
Change-Id: Ie881af3d1dff23f08ccc9cbcf5f94a084fa561e1
2016-02-02 15:17:25 -08:00
Florian 3203eaf554 Fix inheritance of ve.ui.MWSyntaxHighlightDialogTool
From the description of the commit message[1] for WindowTool (which replaces
DialogTool) and FragmentWindowTool, the
ve.ui.MWSyntaxHighlightDialogTool should be a FragmentWindowTool,
and not a WindowTool/DialogTool.

In fact, the bug is caused by the missing isCompatibleWith method
in WindowTool.

[1] I3a0e761f0d6e942d503ec

Follow up: I676af9c50b09ef007926240eb2327d1a0fdd80f5

Bug: T121596
Change-Id: I0fa440d845c1dea34b623de0a36fb57cebf60f78
2015-12-19 01:27:14 +00:00
jenkins-bot 6267ec8450 Merge "VE: Register sequence with CommandHelp" 2015-11-05 15:36:41 +00:00
Ed Sanders f24eb8bfba VE: Register sequence with CommandHelp
Depends on I65e2bfc2 in VE-MW

Change-Id: I6054caa97c4f7e5fcd632912534deac977af6016
2015-11-05 10:14:14 +00:00
Ed Sanders 8a39d4f9dc VE: Clear Ace's undo manager after setting initial value
Depends on Ia331acc41 in ve-mw.

Change-Id: Idf8cd4983d7ce8cd570f5672521b04a988bbc324
2015-10-30 16:27:43 +00:00
Ed Sanders b73e6ab425 Follow-up Ib709ffd72: Add vendor prefixes
As per http://caniuse.com/#feat=css3-tabsize

Bug: T115284
Change-Id: I1a9984f37fa943b9fa4ffa403e4ba37986fa9986
2015-10-28 10:49:02 +00:00
jenkins-bot cfdacaf12a Merge "VE: Add '<syntax' and '<source' sequences" 2015-10-22 15:47:16 +00:00
jenkins-bot f53f47b8b1 Merge "Use Ace editor widget for code input" 2015-10-22 15:47:13 +00:00
jenkins-bot 89c96e67a6 Merge "Use dialog for editing block level syntax highlights" 2015-10-22 15:47:10 +00:00
jenkins-bot efe8a78991 Merge "VE: Remove unnecessary validation check" 2015-10-22 15:39:36 +00:00
jenkins-bot 465788c2de Merge "VE: Focus, but don't open, language input on open" 2015-10-22 15:39:25 +00:00
jenkins-bot f7dd0d5536 Merge "VE: Update renamed CSS class to restore fixed width font" 2015-10-22 15:39:08 +00:00
Ed Sanders e127b3162b VE: Add '<syntax' and '<source' sequences
Change-Id: Ie087fd665f527ea13254576ee07ebd029a1803ea
2015-10-22 11:56:48 +01:00
Ed Sanders 826c2cba40 Use Ace editor widget for code input
Depends on Ie483f6eba2 in ve-mw.

Bug: T49742
Change-Id: Ifaff6a5345fef92aba57b4fc00181f5b32cf7365
2015-10-21 17:32:15 +01:00
Ed Sanders 3a42016be0 Set tab size to 4
Bug: T115284
Change-Id: Ib709ffd72bad20db6282a4f32175d8062f4d2e25
2015-10-20 15:26:25 +01:00
Ed Sanders 0f10206cf2 Use dialog for editing block level syntax highlights
Maintain the inspector for inline snippets (which are editable
but still not creatable).

Bug: T112617
Bug: T57934
Change-Id: I76e36590363d36c0d3db4ec28ce81c4860d9b467
2015-10-20 15:16:11 +01:00
Ed Sanders 10b6dee5a2 VE: Remove unnecessary validation check
Change-Id: I7cc68eaead398ed97baf620142386f8e0bab4fb9
2015-10-20 15:16:11 +01:00
Ed Sanders 30a98dcbcd VE: Focus, but don't open, language input on open
Bug: T112798
Bug: T114202
Change-Id: Id70e8baea3687d5cd57ff3f45b5f332098451b7d
2015-10-20 15:16:05 +01:00
Ed Sanders 115fc92bfc VE: Update renamed CSS class to restore fixed width font
Change-Id: I029cfdfc5eabb8358b7c3b0274f4e759134a3af5
2015-10-19 13:51:03 +02:00
Ed Sanders c0482fe738 build: Update JSCS from 1.8.0 to 2.1.0 and make pass
Change-Id: I3b26c3cba814dcc8691f9f1ac04eb7dcc996f185
2015-09-18 16:01:40 +00:00
Ed Sanders 359c060eb7 Rename modules/VisualEditor to modules/ve-syntaxhighlight
Per new naming convention.

Change-Id: I0db6f70c2d7671eb9c25a6ff7eecf46eafb696d2
2015-09-18 12:14:39 +01:00
Alex Monk de31d8d7f1 VisualEditor integration: Fix handling of (None) language
Change-Id: I6a5ca5db218d8497eed5dfb61b5a5acb4bb0c122
2015-09-16 20:23:54 +01:00
Ed Sanders 8212ef5609 Split nodes into block/inline
Bug: T103963
Change-Id: Ib0390d6432fe97810988be3aca59ba38c0d55b64
2015-09-16 17:23:48 +01:00
Alex Monk 910ea5a6c9 VE integration: Fix regression in Ic84c5afb
Calling clearItems().addItems like this was super slow and broke autoEllipsis.

Bug: T103756
Change-Id: I398ae5b0fda00a559d742660fa930710174117b2
2015-08-28 19:04:15 +00:00
Alex Monk 0a59b4ccb1 VE integration: Provide a combobox for language input
Bug: T103756
Change-Id: Ic84c5afb1cf83cce6fa521a99f5fee242bc610b1
2015-08-27 03:24:07 +01:00
Bartosz Dziewoński 6b1a4a6d8c Restore 'direction: ltr;' for .mw-highlight
Follow-up to 043969f84e.

It is not needed for current HTML generated by the extension tag,
but is required for compatibility with cached renders generated
between 6484894497 and
043969f84e.

Bug: T105499
Change-Id: Ie15d9c7fb673528b2ab5e40e6beddc580fb6d368
2015-07-11 13:50:41 +02:00