Commit graph

216 commits

Author SHA1 Message Date
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
Frédéric Wang be7be3becb Remove woff fonts
1) Because enabling native MathML now requires special configuration steps
  from the users, they can as well just check their math font setup. Hence we
  remove the Web font fallback.
2) We then can actually just remove ext.math.desktop.css since no specific
  style is necessary any more on desktop.
3) We also no longer need to add the Web font to the list of font-family on
  the <math> element. We actually just remove the whole font-family rule so
  that it is up to web engines developers & users to decide the best math font
  to use (e.g. via the "Fonts for mathematics" option in the font preference
  menu of Firefox).

Change-Id: I1818d288b0f28715a460e3163590e4d0374c42b4
2016-05-23 14:52:59 +00: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
Frédéric Wang d808880450 Remove some obsolete CSS rules that are no longer needed in Firefox ESR 45:
- Use the non-math font Cambria first (fixed in https://bugzilla.mozilla.org/show_bug.cgi?id=598900).
- Set line-height to normal (fixed in https://bugzilla.mozilla.org/show_bug.cgi?id=1187673).

Change-Id: I19836285e08c2996d611a47361bbb5f9e9eb6921
2016-04-25 16:28:11 +00:00
Moritz Schubotz f071dbcf80 Remove Firefox specific CSS styles
The Firefox specific CSS changes require a special
setup of math fonts on the system. To avoid problems
OS dependent behavior, this browser specific modifications
are removed from the ext.math.css file.
There are a couple of places, where people can overwrite
their CSS rules individually.

For example from version 1.8 the plugin 
cf. de1eec2f0d
Note that this change will make things worse for users
that chose the MathML rendering option and managed to
configure their font setup right.

Change-Id: I5a376904a01a46634eea2160e02736df74cd0b5f
2016-04-24 20:32:28 +00:00
jenkins-bot 950c0596ca Merge "Make short mode for the math dialog" 2016-04-19 19:22:23 +00:00
Thalia a5e6d22495 Make short mode for the math dialog
When the math dialog's menuLayout height is below 450 px,
make the symbol menu and the preview element shorter, so
the input is still in view. (This works until about
280px, below which the user will need to scroll down to
use the input.

Bug: T121150
Change-Id: I9e41cce80c3f770b1e3d0e7b133470045a1afe67
2016-04-19 19:50:17 +01:00
physikerwelt 0b17471332 Use img element to display SVGs in new IEs
InternetExplorer versions that do support SVG images
have problems rendering  these in meta tags.
Replacing meta tags with img elements resolves the problem.

Bug: T132491
Change-Id: I353e911a8e2066c10d8df583cae88861a8623816
2016-04-19 17:16:50 +00:00
jenkins-bot 86f359ec30 Merge "Add inverse of texToClass function in comment" 2016-04-12 15:29:34 +00:00
jenkins-bot e00af78d9a Merge "Use new executeCommand method" 2016-04-12 15:20:29 +00:00
Ed Sanders 4010978ebf Add inverse of texToClass function in comment
Change-Id: Iba9658cfb8f413eaff8cdd62b6b7b2d836c5b23d
2016-04-12 15:01:04 +01:00
Ed Sanders dba01a653e CSS code style: spaces inside parentheses
Change-Id: Ia1324fe4ee98b487b82d01ee0d9cffe284a64811
2016-04-12 14:57:27 +01:00
Ed Sanders 3f456b1931 Use new executeCommand method
Change-Id: I24afd6c94c3224a3ae1f86204ddc16c726833c7c
2016-04-12 14:56:45 +01:00
Ed Sanders 617e0ccd53 Remove icon properties from windows
Windows stopped supporting icons a while ago.

Change-Id: I7a3fba6aef39b761f8eac9ed0f639ed18b1c4e65
2016-03-29 12:34:56 +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
jenkins-bot e736202170 Merge "Resize math dialog input to fit the available space" 2016-01-25 15:12:44 +00:00
Thalia 150e658dc3 Correct \mathit button in math dialog
Change-Id: Ida4d82a9b859234e84a93ac34549076be9c42c46
2016-01-24 11:48:23 +00:00
Thalia 79eeb24bc0 Resize math dialog input to fit the available space
Every time the math dialog is resized, calculate the
vertical space available to the input and resize the
input to fill this space.

Bug: T123891
Depends-On: Ia2e094071f385628449f1935f0250cbeb75196f0
Change-Id: I3f3c915469f282a6e0459a7e4d10e19bee68b8db
2016-01-23 11:08:48 +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
Thalia f62b625c21 Small corrections to the math dialog menu
Remove some duplicated symbols and correct some typos

Change-Id: I41e98a7b80554f3332e9abff33b9d12701a5d855
2016-01-11 18:18:42 +00:00
physikerwelt c085e6952b Fix link to PNG fallback for IE 8 and older
Change-Id: Iffb65af756a8fc53fcc9f484c783f69f8d908690
2016-01-06 22:16:21 +00:00
jenkins-bot 2499ea5236 Merge "VE: Rename parent tool" 2016-01-04 20:50:58 +00:00
jenkins-bot 867ad7f91a Merge "Allow users to choose math inspector or math dialog" 2016-01-04 17:10:42 +00:00
Ed Sanders ee3e0855f1 VE: Rename parent tool
Depends on I3a0e761f0 in core.

Change-Id: I7c6e5f2bd20e7875efc0ee60e329cdf081b64bd5
2016-01-04 17:07:51 +00:00