Commit Graph

87 Commits

Author SHA1 Message Date
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
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 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
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
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
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
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
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
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