Commit graph

243 commits

Author SHA1 Message Date
Ed Sanders 94335db392 build: Update eslint-config-wikimedia to 0.10.0
Change-Id: Iec4ea5f8e74ad6f73232b01bdca3b19d93e36dfb
2019-01-08 23:17:15 +00:00
Ed Sanders 5f7f535c28 Update eslint-config-wikimedia to 0.9.0
Change-Id: I4c7dcb1b3cd3d03e3ea3d1e17bfcf63f3b553e50
2018-11-30 21:08:28 +00:00
jenkins-bot 9962f9d16c Merge "VE dialog: Reset scroll offsets on teardown" 2018-11-15 23:51:40 +00:00
Ed Sanders 3986634d8a Remove obsolete aliases from closures
Bug: T208951
Change-Id: Ia4b1a813c9eb8c24db42ded937d40feea539f9c5
2018-11-12 17:08:20 +00:00
Ed Sanders c4e0340e46 VE dialog: Reset scroll offsets on teardown
Change-Id: Ieb252188948249c992a7e43117781f5fdf159d5b
2018-11-12 16:15:00 +00:00
James D. Forrester 428f5a847b Drop support for MediaWiki core's removed "2006 wikitext editor"
Change-Id: I59bad8faee3f0f998344f985eb675087533d3d8f
2018-11-06 17:19:43 -08:00
Debenben 19d97c4377 remove problematic texvc from VE suggestions
The patch removes the following texvc macros conflicting with generic LaTeX syntax from the autocomplete suggestions of the visual formula editor:
* \and
* \or
* \pagecolor
* \part
* \ang
* \C
* \H
* \bold
* \Bbb
and replaces the following commands with the LaTeX equivalents in the visual formula editors math dialogue
* \and -> \land
* \or -> \lor
according to https://www.mediawiki.org/w/index.php?title=Extension:Math/Roadmap&oldid=2808288

Bug: T197842
Change-Id: Id3a085dc0a7551b582a9a0a759a838411d1ecf71
2018-06-21 05:15:09 +00:00
James D. Forrester 0e47032839 MWLatexDialog: Fix hard-coded line height
This changed after the OOUI font-size change. Also reduce
the preview height which is measure in em's so that it is
closer to its original pixel value.

Also fix line height for error messages.

Change-Id: I3537d33dc1889e0154f4574bb33b22b3c006fe9c
2018-06-08 19:12:21 +01:00
Ed Sanders 9b2ba59ac9 Move icons to RL image module and generate variants
Bug: T196050
Change-Id: Ie6acbeac3d74b99278b8d5b0db3ca1d349065d5e
2018-06-02 21:56:49 +01:00
Moritz Schubotz (physikerwelt) ffcfdf488e
Autocomplete LaTeX commands with backslash
Insert required backslash to LaTeX commands.
This should help to avoid that users ommit the backslash for LaTeX commands unintentionally.

Change-Id: I970cec2cb597815cc4272ed573ac1a2ee2682e55
2018-04-24 20:17:21 +02:00
Thiemo Kreuz 801888d34b Use short "@license MIT" according to SPDX
Note there is not even a LICENSE.txt in this code base.

Change-Id: I3dccd4187f4a20e3f040c812c5811298794d469a
2018-04-13 16:04:06 +02:00
Ed Sanders 6d042da104 Redraw icons to fit 20x20 canvas better
Change-Id: I1222cbcb1e78ded144f1ac1e6376bfebb32be3c7
2018-03-22 15:34:55 +00:00
Bartosz Dziewoński e04e5ee28a Update icons for new 20px grid
Set viewBox to "2 2 20 20" to trim 2px off each side of our
existing 24px icons, therefore aligning them to the new 20px
grid. All of them had been drawn with large margins, so none
of the graphic is lost.

Bug: T177432
Bug: T190151
Change-Id: Ifaa8c27450cde7ed25d4429bd8aba25bcba3bfcc
2018-03-20 18:56:16 +01:00
Moritz Schubotz d8822169ab
Mathoid CLI interface
Renders formulae via mathoid without to run mathoid as a service.
Mathoid 0.7.1 or later must be installed locally and configured to be
accessed directly from the math extension. It has been tested with the
config.dev.yaml of version 0.7.1. If mathoid is installed in
'/srv/mathoid' the following line might be added to LocalSettings.php
$wgMathoidCli = ['/srv/mathoid/cli.js', '-c', '/srv/mathoid/config.dev.yaml'];
i.e., make sure to specify the -c parameter with an absolute path.
In addition mathoid uses more memory than the the default. With
the config.dev.yaml a value of
$wgMaxShellMemory = 2097152;
has been tested to work well.

Change-Id: I0600f056d21927963267cf979d342e313419e9fa
2018-02-21 20:29:20 +01:00
Ed Sanders 271a149b5f getSelectedItem() -> findSelectedItem()
Change-Id: I6ddf1ab488774f22fd566846c38483dcaf35ab27
2018-01-17 13:49:06 +00:00
Ed Sanders 23054cfe5b Fix auto-height when CodeMirror not available
Change-Id: I0e88b12b0e67f471bac8ab767cdeca8ac7bafeec
2018-01-11 15:10:17 +01:00
jenkins-bot bdc65a3f3a Merge "Remove redundant multiline option" 2017-07-18 19:23:38 +00:00
Ed Sanders 24a024ee8e build: Upgrade grunt-eslint from 19.0.0 to 20.0.0, and other linters
Change-Id: I4a8b9ece024164053e69a2a8f6fbd6406737d373
2017-07-18 13:04:49 +01:00
Ed Sanders b923169efa Remove redundant multiline option
MWAceEditorWidget is now multiline by inheritance

Bug: T170275
Change-Id: I0efe1299ceb441c70d106e3b25514c0c0a7dfdce
2017-07-12 16:26:54 +01:00
Thiemo Mättig 1ac3ab619e More strict regular expressions for CSS parsing
Having greedy .* matchers in these regular expressions is quite scary,
and a possible source of hard to track errors. For example, a string
like "height:8px;left:3ex" will make these regular expressions succeed,
even if they shouldn't. The substring "8px;left;3" will be fetched, and
most probably turned into something unexpected like "8ex" for the
calculations below.

Change-Id: Ia6753a58802fb3f3c5df4d2b35a6d8e616835f20
2017-07-11 07:33:34 +00:00
jenkins-bot 9d840da775 Merge "Add a few symbols to the math dialog menu" 2017-06-09 15:23:45 +00:00
Ed Sanders 407bfc4f3b Limit overflow-x rule to block elements
The overflow-x rule has no effect on inline elements
anyway, as documented in T134281, and it confuses
logic in VE for computing highlights.

Bug: T167438
Change-Id: Ifb9e503386c2e0bb101265310767ca9d00ad0c44
2017-06-08 17:26:32 +01:00
Ed Sanders 742afcdb8b Specify iconWhenInvisible for math/chem nodes
Bug: T166526
Change-Id: I42703d15fa7e491d85d01899c706dbca4e5816b6
2017-06-07 22:41:16 +01:00
Thalia 5d222caaa8 Add a few symbols to the math dialog menu
Change-Id: Id9fdbde64957af149784bb16ac225e3896bb9b8d
2017-06-05 19:00:54 +01:00
Prateek Saxena ff8a903fa6 Use TabPanelLayout instead of the deprecated CardLayout
Bug: T164902
Change-Id: I979cb14b8430bf89ae9a453786bc4337ef82211d
2017-05-17 15:02:42 +05:30
Ed Sanders 3189409b7c Remove separate stylelint config for VE
Change-Id: I2698ef817a27a783f19b73c2780ba7410640a2b8
2017-04-28 17:37:45 +01:00
James D. Forrester 5a6626fcce stylelint: Drop unsupported no-unsupported-browser-features reference
Change-Id: I0f0098ddb299167e94079e068f2cc2a8f3e0262e
2017-04-10 13:12:54 -07:00
Amire80 848d762e24 Add support for chemical formulae in VisualEditor
The chemical and mathematical formula inspectors and dialogs
have a lot of similar functionality, and the common parts are
now moved to the common MWLatex class.

MWMath* classes now inherit from MWLatex*, and so do
the new MWChem* classes.

Bug: T153365
Change-Id: I4452ceca55197fda5f1e1293a5741c6f5fb7c245
2017-02-19 18:36:26 +00:00
jenkins-bot 74be597efb Merge "build: Bump stylelint and make pass" 2017-02-18 00:13:01 +00:00
James D. Forrester 6a6c68b387 build: Bump stylelint and make pass
grunt-stylelint              0.6.0  →   0.7.0
 stylelint-config-wikimedia   0.3.0  →   0.4.1

Change-Id: Id87b8df04d415e1f1058a4042a31408236402037
2017-02-17 15:30:18 -08:00
James D. Forrester 4a06cdf728 Follow-up 75db3ed9: Also fall back to symbol.insert in MWMathPage
Bug: T157751
Change-Id: Ia0d40c70f52f41eb07dcbe121437379419b861b3
2017-02-09 17:47:27 -08:00
Ed Sanders 75db3ed9fe Math symbols: Remove 'tex' when identical to 'insert'
Change-Id: I3e9abc923eb686a60b9ae5359d8b823acc863f31
2017-02-09 19:22:47 +00:00
jenkins-bot cb190d507d Merge "Add scrollbars to displaystyle formulae" 2017-01-17 18:51:13 +00:00
Amire80 48a5a0a7e8 Split ve.ui.MWMathPage.css from ve.ui.MWMathDialog.css
There are separate JS files for them, so the CSS should be separate, too.

This is a part of the refactoring that is required for bug T153365.

Change-Id: Iadbe5eeccff25ed1d184658945a4eb52e465d863
2017-01-11 19:44:31 -08:00
jenkins-bot f8ceb1d495 Merge "Add word list to math dialog for autocompletion" 2017-01-11 23:57:20 +00:00
Thalia 06f6af78dc Add word list to math dialog for autocompletion
Bug: T155107
Change-Id: I57bbf9d9a75810cd06b9ba43a173f9bf4a74c9fc
2017-01-11 14:44:16 -08:00
Ed Sanders edd166cfa3 Create chemistry icon for upcoming VE chemistry support
Bug: T153365
Change-Id: Ieaf5708932cfc91de6c293fd752dd64b8a73c73d
2017-01-11 14:28:31 -08:00
Moritz Schubotz c877e564fc Add scrollbars to displaystyle formulae
Add mwe-math-element class attribute to the outermost element
holding mathematical expressions. Add a css rule that adds a
scrollbar to the element in case it's a div, which is the case
for displaystyle formulae.

Note, there will be no scroll bar if long formulae are not
explicitly marked up das displaystyle formulae.ƒ

Bug: T134281
Change-Id: Iba462601bb15f8667d1284282ba4f6c2020a02b9
2017-01-11 10:49:40 -08:00
Physikerwelt 797c8ddfc9 Revert "Add class mwe-math-element to math elements"
This reverts commit e674d7e73b.
That commit does not help to solve T134281.
It adds a CSS class name which is configurable
by a global variable to various math elements, which is confusing.

Change-Id: Iea5f231e0cea1221dc717b3409b36c0baf11bb24
2017-01-03 23:57:46 +00:00
tameeshb e674d7e73b Add class mwe-math-element to math elements
This is the fix for the bug that makes the whole page scroll when long 
equations are present in the wiki article.

Bug: T134281
Change-Id: I29f8df027384098cd0923bcfa23a914c8d887bba
2016-12-21 23:03:18 +00:00
Ed Sanders a182a9d332 Fix primary command name
Primary command name is used by double click and enter.
Make this launch the default edit action 'mathDialog'.

Change-Id: Ie7a87914a55ecc87769c4a1aa029b36966b83a04
2016-11-30 12:39:59 +00:00
Ed Sanders 422ea757ae eslint: Re-enable wrap-iife and partially enable dot-notation
Also removed upstreamed spaced-comment rule.

Change-Id: Ide83abeedfea27c1f4574af0069d5a9fdb81de84
2016-11-15 13:13:05 +00:00
Ed Sanders f66ef920fb build: Replace jscs and jshint with eslint
Change-Id: I95f59d9bef6bb8fec69b454dc8efe4b4c7e40805
2016-10-28 11:11:26 -07:00
Thalia 3ebade4175 Make width of buttons in math dialog more flexible
Previously there were only two possible button widths,
now there are four.

Bug: T145613
Change-Id: I233f4f7c6cb810d6b5d54a5242514afed7c2ad9d
2016-10-14 16:30:50 -07:00
Ed Sanders 5f31ddeb8f VE: Make all edits 'quick edit' on mobile
Mobile doesn't really have room for the full dialog.

Change-Id: I08f45c3b26bd88f75deb4dbd51435a109021f0fe
2016-09-08 16:19:29 -07:00
James D. Forrester fda31a802f build: Fix stylelint devDependencies
Bug: T142235
Change-Id: I45021b2cd1decdc4cd9a9e9908d132cc1f6d795b
2016-08-05 11:59:39 -07:00
Ed Sanders 7938545a7c Use transition timing from OOUI theme config
Depends-On: I00eaa2b815d7c76b6315a3993a9a7921ae503c00
Change-Id: Iddd99171137a7457d0c3084c396453575a1e7231
2016-07-12 13:29:15 +01:00
Moritz Schubotz 2fc8fa6ccd Fix: Update png fallback
In Ifdd75ce51076b098af67a96b5dcb0fc0726d2b00
I missed to update the png fallback mechanism
given the fact that SVG is now a <img element
as well and no longer a <meta tag.

Bug: T136905
Change-Id: If1b4fb11cfb50eab98f847674fdbef2cd0e43e37
2016-06-03 10:10:06 +02:00
Moritz Schubotz 349d7cfc16 Use img instead of meta tags for SVGs
* replace meta tag with img tag
* remove js workaround for IE

Bug: T136709
Change-Id: Ifdd75ce51076b098af67a96b5dcb0fc0726d2b00
2016-06-02 12:12:32 +02:00
James D. Forrester 9b6f6c7300 Follow-up 3f456b1: Fix typo in function call
Bug: T132736
Change-Id: I36862baf287efe275d5b5fdc3bef911b7815a762
2016-05-26 09:22:33 -07:00