Commit Graph

18 Commits

Author SHA1 Message Date
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
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
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
Ed Sanders 75db3ed9fe Math symbols: Remove 'tex' when identical to 'insert'
Change-Id: I3e9abc923eb686a60b9ae5359d8b823acc863f31
2017-02-09 19:22:47 +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
Ed Sanders e2139b1657 build: Introduce stylelint to lint for css errors
Also update the rest of the CI world whilst we're at it.

Change-Id: Iaad2867797cccb2dd0df7758e448b553859fa62c
2016-05-19 19:16:00 +01:00
Ed Sanders 4010978ebf Add inverse of texToClass function in comment
Change-Id: Iba9658cfb8f413eaff8cdd62b6b7b2d836c5b23d
2016-04-12 15:01:04 +01:00
Ed Sanders 481138a73d Remove SVGO compression, now done upstream in Mathoid
Change-Id: I961eb82722ae161bdf7a3ea945c299244ce321fb
Depends-On: I86c1a14ad81d2d252ac73da973274f88153d993c
2016-03-23 10:52:10 +00:00
Ed Sanders 49fc247004 Use the mathoidStyle property instead of parsing the SVG
This attribute was added in Ia0f601c1d5. Use it instead of
extracting the information from the SVG.

Change-Id: Ib6d6f4c9480ae00ccb2977b57c7b93de8ebb03f2
2016-03-22 14:46:48 +00:00
Ed Sanders 2b9bce4a0b makeSvgsAndCss: Add missing semi-colons to CSS, tweak symbol alignment formula
Sub-pixel alignment errors are unavoidable as the browser will rasterise
the SVG then round percentage offsets to the pixel grid.

Change-Id: I704db755d49be189db9670594e2ae2f193e6052d
2016-02-02 19:03:01 +00:00
Ed Sanders fd6f963504 makeSvgsAndCss: Increase max connections
This was set low to avoid issues with local servers, but the new default
server (wmflabs.org) can handle a higher value, and the script runs
much faster.

Change-Id: I69b06c59fc03c4c4b15619e8dff7bfc904dba96f
2016-02-02 12:49:32 +00:00
Thalia 2b9e3307ac Add option to adjust SVG baseline on math dialog buttons
If a symbol has "backgroundPosition" set to true, adjust
its vertical position in the button, according to the
vertical-align property on the SVG, by adding a
background-position property on its CSS rule.

Also set "backgroundPosition" to true for a number of
symbols and generate a new CSS file.

Bug: T123397
Change-Id: Ic9bbb65d2bedf38f569d8922599a2e3d2575f153
2016-02-01 18:07:13 +00:00
Thalia a3a76811d2 Use more generic host and port for updating the math menu
Change-Id: Iaa079b8037d3c73cfc8a283aa3f7c7926feb328b
2016-01-13 20:04:14 +00:00
Ed Sanders e4719c56a7 SVG/CSS generator: Ignore duplicates and 'notWorking' buttons
Change-Id: I5f0c9fc62a1e434576550e142d6b25f329e63e7f
2015-11-20 18:03:06 -08:00
Ed Sanders cbc847222e SVG/CSS generator: Make faster by skipping already-fetched icons
Also keep the CSS file in alphabetical order so additions make
for clean diffs. (The async built file had a pseudo-random order)

Change-Id: Iad76ef36c90f42ba3232f135b05465408f42b2ba
2015-11-20 17:32:03 -08:00
Ed Sanders a682d9677f VE: Correct name of script in header
Change-Id: I4a76d72dcb22a5ebeb02f6c0b6946c1ef4744185
2015-11-18 20:16:13 -08:00
Thalia eac71ab60f Add tool to create SVG files of LaTeX symbols
Also produces a CSS file for the symbol buttons, using the
SVG filenames. Gets the list of symbols from symbols.json.

Bug: T118660
Change-Id: Iaa792418d870a7e266b6455ef037994e31278278
2015-11-19 04:11:59 +00:00