Commit Graph

904 Commits

Author SHA1 Message Date
petarpetkovic
5a1da4dbaa Remove jQuery.inArray usages
Replace jQuery.inArray with JS native Array.prototype.indexOf

Change-Id: I0031f0385e440a34846334d158425182542a9ac9
2018-08-24 20:18:53 +00:00
petarpetkovic
54a3313e1a Remove jQuery.grep usages
Replace jQuery.grep with native JS Array.prototype.filter method.

Change-Id: Idbf88a516061ff46211f72e8b93e11f5fa838e88
2018-08-24 20:43:33 +02:00
petarpetkovic
6ce67b8dda Use JS native methods for array manipulations
* In mw.uls.addPreviousLanguage, jQuery.map was used for what is
essentially filtering, not mapping. Filtering was used to remove
one element from array. Use Array.prototype.splice instead.
* In mw.uls.getFrequentLanguageList, replace:
- jQuery.each with Array.prototype.forEach
- jQuery.inArray with Array.prototype.indexOf
- jQuery.grep with Array.prototype.filter

Change-Id: Id2208b3c89e982f91f49981d18e588ae8ce3b130
2018-08-24 20:07:49 +02:00
petarpetkovic
134c9b134f Remove duplicated usage of article "the"
Bug: T201491
Change-Id: Id6ee7ace11e7fbadd0323642c06021f89362e9f2
2018-08-08 14:36:33 +02:00
Amire80
cda999605a For the ULS instance in the IME selector, read the autonym from ULS data
Sometimes new languages don't appear in wgULSLanguages.
For these cases, read their autonym from ULS's own langdb.
Otherwise they are not shown at all.

Bug: T198080
Change-Id: I2bef16811c6a0bdaef5db94719d7b76fe00c6e04
2018-06-25 15:02:41 +03:00
petarpetkovic
9c0c918bab Replace jQuery.proxy() with Function.prototype.bind()
Also, one immediate invocation of jQuery.proxy() is replaced by
Function.prototype.call()

Change-Id: Ibbdbe6413793c113d4de1c67cfcb7d95676565b2
2018-06-18 06:56:09 +00:00
Fomafix
162cc56f02 Reorder functions to avoid forward references
Remove /* eslint-disable no-use-before-define */.

Change-Id: I001b50050d8c492aed99a3620b6fc03ffb29e135
2018-06-11 23:44:47 +00:00
Volker E
f3d48beef7 build: Bring SVGO optimization to build step
Enabling SVGO automation with 'grunt-svgmin' and conservative
plugin settings to build step, among those:
- enable removeRasterImages and sortAttrs,
- disable cleanupIDs, removeDesc, removeTitle, removeViewBox &
  removeXMLProcInst and
- make use of pretty, indent and multipass options.

Also updating SVG accordingly.

Bug: T185596
Change-Id: I0030a711a2947ca8c1eb4e56d8540661c72a2639
2018-05-20 08:55:05 +00:00
Santhosh Thottingal
c818cf2800 Remove temporarily forced postcss-less version
postcss-less issue is now resolved and new version released.
Also a spacing related error is fixed

Change-Id: I0d768d29d2003fb4373436d957efcf0cec84286f
2018-03-27 16:13:32 +05:30
Amire80
04a8eeb62c Switch the current tab to the new language only if it was not Ctrl/Command/Shift-Click
Bug: T189582
Change-Id: Ib497be874b3d559a8f1715d09160378f0c43881e
2018-03-26 15:40:56 +00:00
Amire80
75bf99124a Parse the parameters to no-results-found event as an object
This fixes a bug in
I2ff9ce9b40df16ed3c5e6970fb3b691af08cedec

Bug: T179402
Change-Id: I770211c666ad530f6a4bb618c6f2c3521aa05a8e
2018-03-20 09:17:55 +00:00
Amire80
d6630a4780 Log the context of the ULS in which no search results were found
Relies on updates to EventLogging schema. Diff:
https://meta.wikimedia.org/w/index.php?title=Schema%3AUniversalLanguageSelector&type=revision&diff=17799034&oldid=7327441

Bug: T179402
Change-Id: I2ff9ce9b40df16ed3c5e6970fb3b691af08cedec
2018-03-08 16:03:33 +02:00
Niklas Laxström
9a6e8a2bc9 Fix custom no results again
Since we added .i18n() call to upstream, it started overwriting
our text from the default data-i18n. Change data-i18n instead.

Bug: T188860
Change-Id: Ib7e9fb9590ace9c2a4ce2e2afb5a740ae4346be6
2018-03-05 14:17:12 +01:00
Kunal Mehta
67d470a9e7 Use SPDX 3.0 license identifier
SPDX released version 3 of their license list (<https://spdx.org/licenses/>),
which changed the FSF licenses to explicitly end in -only or -or-later
instead of relying on an easy to miss + symbol.

Bug: T183858
Change-Id: Id75a37eab27282ca7797fa3e6ceb92750c59477f
2018-03-03 19:27:21 +00:00
Fomafix
74d59bf306 Remove window.pluralRuleParser
The module 'jquery.i18n' was removed in 1312b905f2 because it is
already in core. The mapping from mw.libs.pluralRuleParser to
window.pluralRuleParser is not needed here anymore.

Change-Id: I00993d43578368ba3ebc1f4055cabf4904e45783
2018-02-16 16:32:59 +01:00
jenkins-bot
ee21e016be Merge "Custom no-results message for compact links search" 2018-02-13 13:11:29 +00:00
Niklas Laxström
fca9b5c0e6 Make ULS trigger and settings more keyboard accessible
It's now possible to tab to "display settings" and "input settings"
and access them with enter or space. Also escape can now be used
to close the settings screen.

The ULS trigger in interlanguage position is a button to get
native accessibility features.

Also removed `mw.hook( 'mw.uls.settings.open' ).fire( 'uls' );` as
it didn't seem very useful and there wasn't immediately obvious
place to put it. The existing click handler could be removed because
the settings dialog themselves place event listeners.

The patch is a bit longer than strictly necessary because the CSS
was mess (rules in different modules, poorly organized) and I had
to bring related rules together to understand them.

Bug: T52793
Change-Id: Id37c2665b1c97b81ef57be27a1abfae0db6b34d5
2018-02-12 17:57:04 +01:00
Santhosh Thottingal
75e80446cb Reduce the padding for ULS trigger icon in personal toolbar position
Bug: T175769
Change-Id: I49b533fd7adbbd5baa8dbbb0b0c6670ab8d1e692
2018-02-12 12:57:39 +05:30
Santhosh Thottingal
28c455feaf Custom no-results message for compact links search
Bug: T182539
Change-Id: I0e3bb7104015a5244290058dc0ac5b3c17b1ea20
2018-02-08 10:38:06 +05:30
Santhosh Thottingal
453a4458e6 Update jquery.uls to 3161b34
* language-data update: Add Western Armenian to known languages
* Stop rendering languages twice on initial display
* Style adjustments for no-results
* package.json: maintenance updates
* Localisation updates

In addition to the jquery.uls update, this patch contains local
style customization for no-results view as specified in T175235.

Bug: T175235
Bug: T185086
Change-Id: I51645554413dbaa80e02fec8f9115f4de409fb06
2018-02-06 08:17:20 +00:00
jenkins-bot
aed8d0bec2 Merge "Update jquery.uls to d122f37" 2018-01-30 11:45:06 +00:00
Santhosh Thottingal
fd7b9ec652 Update jquery.uls to d122f37
* Do not group search results by region
* Replace ULS trigger icon with monochromatic one
* Custom no-results message support
* Upgrade jquery in the example to 3.2.1
* Use .siblings to locate the suggestions, clear elements for efficiency
* Removing assigned ids to elements that are not guaranteed to be unique
* Use eslint and stylelint, fix all errors

Update the language icon in ext.uls.pt module with new monochromatic one
Also use custom style for monobook skin.

Bug: T182539
Bug: T175769
Change-Id: I7341064cd0de367d933048c4800f951568747d11
2018-01-30 15:10:01 +05:30
Santhosh Thottingal
f536b3969d Prevent page scroll to top while clicking on language settings icon
If the language settings window is not visible, all calculations
will go wrong and page will scroll to 0 position.

So call scrollIntoView only when the element is visible.

The $.fn.scrollIntoView defined in jquery.uls core may be unnecessary
now since it is available natively on DOM elements.

Bug: T178188
Change-Id: I461fa9eb7c51cd277bebd3a04cfcc0eed9793c4e
2018-01-04 10:17:03 +05:30
Kartik Mistry
d969c2a804 Remove non-default Saab font for Punjabi
* Not updated from upstream; last release is buggy as per upstream.
* Punjabi language has good font support in all modern operating
  systems.

Bug: T180422
Change-Id: I323953b4c6293df89034f05e0c2e13a96b42dc34
2017-12-05 06:19:13 +00:00
Volker E
e3ad0f3be5 Move “Language settings” dialog headline up
Moving “Language settings” dialog headline up to put on a
virtual line with ToggleButton and apply `#000` to it as
dialog titles elsewhere.

Bug: T175295
Change-Id: Id2d7a7b90996ec7be96e8bafd7bbe78eb8f0e1c9
2017-12-01 05:03:43 +00:00
jenkins-bot
603cfea7d0 Merge "Improve ULS language search api" 2017-12-01 04:47:30 +00:00
Ed Sanders
447c09d462 build: Update linters
Change-Id: I45540db95711b461ded3630894bd1f149c24ff19
2017-11-29 15:02:47 +00:00
Volker E
72cf0a7f23 BetaFeatures SVGs: Merge logo and title path
In the process of updating BetaFeatures logo it got
identified that the logo is better marked up as one
`<path>` element.
Follows up I57f2f4890e980992db2c25506bbdc330530d67b1

Bug: T180427
Change-Id: I3bd8eb032943e00c93975db2911a9f7d26c0bcb2
2017-11-28 16:06:05 -08:00
Volker E
300d69b92d Unify BetaFeatures SVG screenshot markup
Unifying BetaFeatures SVG screenshot markup by:
- changing `id`s for better readability,
- sorting attributes,
- using full pixel values where applicable and
- generalizing attributes on `g` where applicable

Also fixing a visual glitch in the RTL version.
Follows up Idace90e945a2bd5efa869ee717224274fd94e91a.

Bug: T180427
Change-Id: I57f2f4890e980992db2c25506bbdc330530d67b1
2017-11-27 19:40:49 -08:00
Niklas Laxström
e87dd20cdd Improve ULS language search api
* Store prefixes and infixes separately in the data
* First match language code, then prefixes, then infixes
* Try to use suggestion either in user language or autonym first
* use formatversion=2 to avoid escaping Unicode

Using Language::fetchLanguageName might can have a small
performance impact. On the other hand there is now check
to skip languages we already found, avoiding some fuzzy
matching.

This is in a preparation for a change in jquery.uls to use
the search API more, while trying to reduce the amount of
weird autocompletion suggestions we show to the user.

Bug: T73891
Change-Id: Id94c5352d9a591969bf90144d1d2d5e758d08301
2017-11-27 14:57:42 +01:00
Kartik Mistry
ca45dc7404 Update eslint and stylelint and fixes
Change-Id: I02e615e0efa95b673702f1ce8c957a37397ced13
2017-11-25 08:34:04 +05:30
Prateek Saxena
a9dc4a0f1a betafeatures icons: Correct contrast between light blue and gray
Change-Id: Idace90e945a2bd5efa869ee717224274fd94e91a
2017-11-23 11:41:33 +05:30
Prateek Saxena
963ce22b9f Update colors betafeatures icon
Updated light gray (Base80) and light blue (Accent90).

Old: https://phabricator.wikimedia.org/F10912040
New: https://phabricator.wikimedia.org/F10912039

Bug: T180427
Change-Id: I88d74a0b7447a9a3effb0bb56f3666991558f1fd
2017-11-21 11:23:55 +05:30
Santhosh Thottingal
dc84413373 Remove Madan font for ne
* Unknown upstream
* Not updated for years
* ne has better support in operating systems
* Non-default font for ne

Bug: T180422

Change-Id: Ife0b81e4db3bc069752d89c53f4690ddcfad7ef3
2017-11-14 15:49:35 +01:00
Santhosh Thottingal
d5f0666025 Remove non-default Gubby font for Kannada and Tulu
Bug: T180422
Change-Id: I78af0a3889e48625ebb38b1b212cb8b454a5639c
2017-11-14 15:23:09 +01:00
Santhosh Thottingal
07087dbb06 Remove ttf format from repo and thereby from fontface css
TTF files are not removed, the entries for them from the repo
is removed. Generated CSS will also skip ttf.

TTF format is not required for any browser now a days.
https://caniuse.com/#feat=woff

Change-Id: I018e74f6a50e63f55adeca480c03124092fba015
2017-11-14 09:23:55 +05:30
Santhosh Thottingal
146426ffe7 Remove fonts for Odia(or) from fontrepo
Remove non-default Utkal font - Its upstream is unknown now.

Change-Id: Iefa9eeaf953d87d4a5c8766fa575d61f9bd96d2b
2017-11-13 15:31:27 +05:30
Santhosh Thottingal
c0bbd9efc1 Remove Tamil fonts from fontrepo
* These fonts are with no upstream now and little known among
  Tamil users.
* Tamil is very well supported in all operating systems
  now a days.
* Also reduce the metadata size for fontrepo

Change-Id: I4e7afb6476a4714f8d87bd2a048309b732883b2f
2017-11-13 15:26:59 +05:30
Santhosh Thottingal
28c0ba6bca Remove fonts for Malayalam from font repo
* I maintain these fonts in upstream and there we several releases
  since these fonts were added.
* Malayalam has better support in operating systems compared to 2012
  when these fonts were added.
* Reduce font metadata size for wikipedia pages when webfonts are
  enabled.

Change-Id: Ie5b54cc866b1c67849b094a9701b2c80d876b55f
2017-11-13 09:16:58 +00:00
Santhosh Thottingal
6bddc79773 Remove Lohit family of fonts from fontrepo
* The languages covered by these fonts are now available in all
operating systems.
* These fonts are not updated for years in our repo
* Saves the amount of font repo data we deliver for *every wikipedia
  page* when webfonts is enabled

Change-Id: Ia0f1b6acc4cf8b7a354671bea47b58425ab8c08e
2017-11-13 09:16:22 +00:00
Santhosh Thottingal
4f3461a9aa Remove autonym font and its usage
I no longer maintain the Autonym font.
Also remove the tofu detection.

Bug: T135464
Bug: T135465
Change-Id: I103aab40ea5f5fc403a7ee5b23d1b634cc9c6ee1
2017-11-13 08:03:12 +00:00
jenkins-bot
29fe7733ac Merge "Align SVGs to WikimediaUI color palette and optimize" 2017-11-02 08:31:36 +00:00
Volker E
8291331f5e Replacing left-over #565656 with WikimediaUI palette color
Another remainder.

Change-Id: Icfa93be50f7b6fa868dd554fd1d8967b9c5bd9e9
2017-11-02 00:35:48 -07:00
Volker E
c8b391564e Align SVGs to WikimediaUI color palette and optimize
Aligning SVGs to WikimediaUI color palette, optimizing
by help of SVGO and align markup to each other, among changes:
- unifying XML declaration
- removing `standalone=no` as it's default
- adding `viewBox` attribute for cross-browser compatibility
- removing unnecessary groups and ids where applicable
- unifying identation
- bringing attributes in order

Bug: T178867
Change-Id: Ie7803dd904cee14fa401331e082982794dc0a225
2017-11-02 00:25:40 -07:00
jenkins-bot
99f231929e Merge "Move buttons further to the side of dialog" 2017-11-02 06:52:26 +00:00
Volker E
29f3ac245b Move buttons further to the side of dialog
Moving apply and cancel buttons to align with padded edge of dialog
in order for resembling “final” state of buttons better.

Bug: T175295
Change-Id: I96b8b6dc3a3fca907a8f5d2923a19b0f86172c61
2017-11-02 11:48:26 +05:30
jenkins-bot
5c8b77d35a Merge "Introduce CSS class to enable lower specificity style overrides" 2017-11-02 06:12:34 +00:00
jenkins-bot
d9e3455f4b Merge "Replace settings block rounded gradient with color" 2017-11-02 06:06:21 +00:00
Volker E
8605fa8bf3 Introduce CSS class to enable lower specificity style overrides
Making `#language-settings-dialog` carry the same CSS class
`.language-settings-dialog` to be able to override it in theme styles
more sanely. Follow-up to Id9c8652820641d6.

Bug: T175295
Change-Id: I1aa69f8701ed6d6cb2ed59cabf11332f2a10d21f
2017-11-02 07:40:39 +05:30
Volker E
31477ad0ec Replace settings block rounded gradient with color
Replacing vertical background gradient with single color, as no
faux 3D gradients are part of current style guide.

Change-Id: If98a6cb22a9551a5d69d782759eadd5cec7e0efc
2017-11-01 13:38:52 -07:00