Commit Graph

156 Commits

Author SHA1 Message Date
DannyS712
e17f5c0b39 Merge jquery.webfonts into ext.uls.webfonts.repository
The two modules are always loaded together and don't need
separate entry points.

Additionally, this makes the ext.uls.webfonts.fonts
just depend on the ext.uls.webfonts.repository module
and not do anything else, so remove it in favor of
referencing ext.uls.webfonts.repository directly where
needed.

Bug: T292042
Change-Id: I067b9eda923fcb0d5da0ed80030356f1f747259b
2021-10-19 09:07:11 +00:00
Niklas Laxström
8c835588f2 Fix positioning of input/display settings for new language selector
Unrelated behavior change: ULS language selection dialog is hidden while
display or input settings is open.

Also simplified dead code in addDisplaySettings.

Bug: T276248
Change-Id: Ia91a2b83e7ad4072016649230e2376b0793cbbff
2021-03-22 12:11:39 +00:00
Niklas Laxström
79a038f166 Handle Apply button little bit more sanely
Change-Id: I55d48de703662f139549d764bf7c1f235111d5ab
2020-11-02 11:08:25 +00:00
Niklas Laxström
094c30bc1c Fix language selection using [...] button
Introduced in I740600d18859422b2f98a5ef92d0321f6e9615a2.

When onSelect was called for the new language, it set dirty to true.
Then the, now delayed, render function reset the dirty status to false.

There is no need to set dirty to false on render, so moved it to the
constructor.

Change-Id: Ibfa23f545c9d358e7e03fb299c238182ea449d7c
2020-10-28 09:29:47 +01:00
Timo Tijhof
09862cffec ext.uls.eventlogger: Remove more obsolete deferred complexity
Follows-up c578db02 and ea671b1f, which I thought removed
all code relating to the old async EventLogging method.
I didn't notice this UI code at the time, because I only took a
single pass over the code to find dead code. Now that that code
is gone, it is clear that the UI code is also redundant.

The mw.track() and logEvent() methods don't track the Beacon API's
async fetches, which also isn't needed, since the loss of browser
context upon navigation doesn't abort background beacons.

The loading of the EL library itself is already ensured via a
dependency so we already know there won't be an async fetch for
that.

What that leaves is some portion of older browsers in which a
EventLogging falls back to 'new Image'. This is basically just
IE 11 per <https://caniuse.com/beacon>, and for those some portion
of events will have been lost since EventLogging removed support
two+ years ago for tracking those fallback fetches via a Promise
(because of the perf issues caused by what the removed code here
was able to do).

Change-Id: Idf4378f983b6ba0e755ebadb97aa6d87cf95f7a5
2020-10-22 23:45:52 +00:00
jdlrobson
5cd10ce862 Reduce JS loaded on critical path
As a precursor to incorporating a new language switcher in the new
version of Vector I'd like to improve the performance of loading
the switcher.

It seems most code can be deferred until the language selector
button is clicked.

This shaves around 30kb of resources off the critical path for
most users. There's potential here for a positive performance
impact so we should follow up the deployment by checking the
associated performance graphs to see if there's improvement.

Note, if the compact personal links feature is enabled
there is no performance saving for now. This will be addressed in follow
ups.

Bug: T153844
Bug: T153845
Bug: T237061
Change-Id: I740600d18859422b2f98a5ef92d0321f6e9615a2
2020-10-20 13:40:49 +00:00
Seb35
54ff8272ab Remove jQuery 3 migration warnings
Bug: T175236
Change-Id: Ibbeec40bd46523c14ba53da1441f46fc9cdfbc10
2020-05-08 11:48:58 +00:00
Fomafix
61ebecff91 Use document.body instead of 'body' as jQuery selector
Change-Id: Ia551b3050ed546de1f9db44dbd332a5b6c108a9f
2019-12-16 15:51:09 +00:00
Fomafix
6a5b9e3164 Consistently use setTimeout, clearTimeout and location without window
Change-Id: Ie83313b3f2a7f9bc939eb19d7a82bc980f12b0b8
2019-12-16 10:19:35 +00:00
Ed Sanders
dae53b628c build: Update linters
Change-Id: Ib513d9fe879fb0c848cdfefaaaa753cc7279e242
2019-09-17 14:55:46 +01:00
Ed Sanders
c080452013 build: Update eslint-config-wikimedia to 0.11.0
Change-Id: Ic59891fab5f8e35420bddbed34072841883fa543
2019-03-13 23:41:14 +00:00
Niklas Laxström
e93e1bc845 Remove disabling of max-len rule and fix violations
Change-Id: I39ec2e572e569a05c11929dd17241653abf954ef
2018-12-15 17:12:18 +00:00
Fomafix
971e4c742d Simplify by using native JavaScript instead of jQuery
Still use $.each for iterating over an Object because there is no
adequate function in ES5.

Change-Id: Idbec13c471e75a9cd5d67204d54bededdbd5582b
2018-09-07 22:35:13 +00:00
Timo Tijhof
4e067715dc Remove redundant closure aliases
'mw' are '$' are globals, always have been, and aren't going
anywhere. They're every bit as real as their longer versions.
If anything, the longer ones are less "real" or 'stable" because
they're not used internally by RL and easier to accidentally
replace or override. For anecdotes and history, see 91f950d6b0.

Change-Id: I526fb8c961d9477992d88f2780a0ff4cbdc51923
2018-09-07 19:23:17 +00:00
Amire80
635cada69b Revert "Simplify by using native JavaScript instead of jQuery"
This reverts commit 0fbdbc2c41.

Bug: T203750
Change-Id: I1bca27b2087f6fc1bfad153f17f4650c52786a7f
2018-09-07 08:57:16 +00:00
Fomafix
0fbdbc2c41 Simplify by using native JavaScript instead of jQuery
Change-Id: I2ca5fbb21ac473f482579a944e5ab68c9374191c
2018-09-04 00:32:12 +00:00
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
134c9b134f Remove duplicated usage of article "the"
Bug: T201491
Change-Id: Id6ee7ace11e7fbadd0323642c06021f89362e9f2
2018-08-08 14:36:33 +02: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
Isarra
86c636fd0a Fix directionality of ULS CLL and languageselect callouts
when appearing on right side of screen

Languageselect was mostly fixed in 354378, but I forgot the
settings ones, so the triangle just disappears when
switching dialogs currently. This follows up on that and
properly fixes it.

Sidebar callouts now appear toward content regardless of
where they're appearing from, or the language
directionality. Triangles are now consistently alligned to
the top of the callout (same position in languageselect and
compact language links) to avoid issues with it appearing
over a scrollbar.

Sideways callout triangles (carets) are consolidated into a
single rendering approach and mixin across compact language
links and toolbox language selector.

Bug: T161586
Change-Id: I7717e26525ac527ede486796f49083ed40ee7d4f
2017-08-10 23:48:34 -04:00
Ed Sanders
811944c49a build: Replace jscs+jshint with eslint
Change-Id: I7f114267fbb4efd62a9162758445cff4fb3c0973
2016-11-09 15:57:38 +00:00
Fomafix
8778051f8f Remove unused variable loginUri
The variable loginUri was added in 422371f6 but never used.

Change-Id: I85aaa6aa524dbe0a02129696f1bff46fb410fbe5
2016-08-30 12:18:45 +02:00
Niklas Laxström
f6da60cfab DisplaySettings: disallow focus on tabgroup buttons
Focus state looks bad in this context.

Change-Id: I3bc1cd63123711ded0652910ef4fa62f19c3bd12
2016-08-15 09:47:51 +00:00
Niklas Laxström
0b89c27678 Give language selection buttons more space
Let them assume normal size with regular padding. In the case that
the buttons do not fit one line, some will overflow to the second
line. In my opinion that looks less ugly than irregular padding
and truncated language names.

Bug: T136273
Change-Id: I26dd7745ac03e1b940348b318d74d0a2bd27e1a3
2016-06-02 05:47:25 +00:00
Niklas Laxström
a19e8c0dba Update jquery.uls and adapt styling
jquery.uls.compact module is kept for now as some other
extensions depend on it. But it does not do anything
anymore.

There are some styles which should be in jquery.uls
upstream, but given the current state that is easiest
done in a follow-up later.

The main change is that language selection is now
compact by default: no heading etc.

Includes style changes for the dialogs, and especially
for the new position of the callout caret.

Bug: T85519
Change-Id: Iade8005439b4f58ab241752f69a5365d8bb88d2c
2016-05-18 11:40:58 +02:00
Ed Sanders
3cfb0d67e5 Update linting tools, config, and fix subsequent failures
Change-Id: I41e080915441367b3a2ab2de7d7a096872a2f2e8
2016-04-13 17:13:06 +01:00
Santhosh Thottingal
a3c63f1efc Update ULS settings UI style to mediawiki.ui style
The ext.uls.buttons style can be removed but Translate extension use that.
Once it is separated we can remove it from ULS.

Testplan:
Use ULS settings and notice the style difference of buttons, checkboxes
and radio buttons. No functionality should be affected and UI should not
be broken in any ways.

This was once attempted in Id186ece6513f154e0388bc4170c21bdabb59038a
but we had to revert because of incompleteness

Bug: T52599
Bug: T127020
Change-Id: Ibbb2068b5036537f298fad6c49169a5b986304d5
2016-04-07 12:06:29 +00:00
Santhosh Thottingal
d728d8c8a7 Remove logging the language selection method
Removed the code to log whether map(removed long time back), search,
common languages used for selecting the language.

This logs were introduced to measure and adapt UI effectiveness.
No longer needed now.

Change-Id: I83bdd250cb6474da4fbf22aed2011071b9f9eba4
2016-04-06 09:59:12 +05:30
Siebrand Mazeland
6a2b2e0bba Update test files
- Updated versions and order of checkers.
- Some consistency updates in Gruntfile.js.
- Updates to make jscs pass.

Change-Id: I7ed93596ff383dc713bd17af2da0472be934d59d
2016-02-18 18:51:37 +00:00
Fomafix
c329f1473d Use spaces inside of brackets in JavaScript
* For consistency
* For MediaWiki coding conventions

Change-Id: I625a8ce0119b1490073f048e1b8ad4e90762d6e2
2016-02-15 13:31:45 +00:00
Fomafix
bd44ae4888 Use .prop() instead of .attr()/.removeAttr() to set boolean attributes
Change-Id: I4988316b202c19f851f2c05e3d07acc8c5ea38cf
2016-02-08 18:38:15 +00:00
Santhosh Thottingal
91eff55c8c Revert "Update inputs to use mw-ui styles"
This reverts commit 30d26a4fd2.

Some issues in this patch were identified, see T52599.

Reverting so that MLEB can be released and issues fixed and
tested properly after the release.

Change-Id: I35c1eb2db5ead8ca75dc2724997d789c83c69b6d
2015-03-30 07:20:23 +00:00
Evan McIntire
30d26a4fd2 Update inputs to use mw-ui styles
Replaces many of the styles with the new standard ones in mw-ui, which is
present in v1.22 of Mediawiki, the current lowest supported version of
ULS.

Might require a follow-up to reduce the amount of redundant CSS present

Bug: T52599
Change-Id: Id186ece6513f154e0388bc4170c21bdabb59038a
2015-03-19 08:51:31 +00:00
Fomafix
0833c990e7 Apply coding conventions for JavaScript
Change-Id: Id158ac08d32cc7421e47ae6abdd2bd80879f04d9
2015-02-07 19:34:21 +00:00
Santhosh Thottingal
dec7b34f1a Use prop instead of attr for changing 'selected' state
Bug: 68998
Change-Id: I4f9231dde31e570e45c4af9e635d7bd9144a7db0
2014-08-25 17:13:08 +05:30
Santhosh Thottingal
27771fdeaf Restore enableWebfonts pref and remove uls-enable
This patch restores the enableWebfonts preference, stored inside
the uls-preferences blob. It existed as 'enable-webfonts' in
the past and was removed in
If735a733717596fae03042c5e277bd538bd8501f

Each wiki can be configured to load the fonts by default
using the new global variable $wgULSWebfontsEnabled.
Its default value is true (to load fonts).

This also removes the preference 'uls-enable', recently added in
I71b70d8ee7c3cad7f49b32e5dc494ef4fc1bdb2f

The initialization of ext.uls.webfonts.js is changed as well,
so that minimal webfonts JS library code is loaded,
and the rest is loaded only if a user requests it.

Bug: 60304
Change-Id: I49e812eae32266f165591c75fd67b86ca06b13f0
2014-02-10 17:40:30 +05:30
jenkins-bot
7b376a80c8 Merge "Fix remaining strings not participating in live language preview" 2014-02-10 06:56:34 +00:00
Timo Tijhof
c6d71015ff Various clean up
Files:
* Consistently have one (1) new line at EOF
  (.gitignore, *.css, *.sh)

JSHint:
* Separate the common (general Wikimedia code conventions) from
  the local more stricter rules (nice work!).

Maintenance:
* Use simplified $IP definition where getenv is only called once.
  Based on http://git.io/ve-mw-36fc3b59-makeStaticLoader

JavaScript:
* Use the same closure in all files:
  - No need for "undefined".
  - One linebreak between license header and start of closure
    (sometimes there were 1 or 2 empty lines).
  - ext.uls.ime.js: No need for "document" (redundant in general,
    but especially as it wasn't used anywhere in this file).
  - Use "$, mw" for all ext.* modules (one of them used "mw, $").

Change-Id: Iba5dab14bbc3fbfc9f8fe96dd2d95529587a69aa
2014-02-08 00:11:50 -08:00
Niklas Laxström
9fb8c3fdf0 Fix remaining strings not participating in live language preview
Change-Id: Id2dc9279e4bfae499a6e8b00a34a74c5505512b2
2014-02-01 11:22:30 +00:00
Amir E. Aharoni
3dda6b5828 Comment and whitespace cleanup
Change-Id: I7ac44f4d371faa3c6941ccf8a4654a035e9b05a5
2013-11-22 10:18:20 +05:30
Santhosh Thottingal
277b0db94d Visual indication while saving the settings
* Button label change to "applying changes"
* Button become disabled
* Cursor changes to "progress"

Bug: 53772
Change-Id: I1de459590ea9b357965a73f274d566eba8c04482
2013-11-21 14:52:48 +05:30
Santhosh Thottingal
8d9f1e97cd Remove unused method: hide
Change-Id: Iba2ca843db8f0edd7fd1826b998a73279e7c06fe
2013-11-18 20:09:42 +00:00
Santhosh Thottingal
be99ff9a55 Fix bug: Cannot apply changes after switching panels back and forth
Bug: 57011
Change-Id: I0614d97dea99781f46bb80a496b12c95aef55c8c
2013-11-14 14:12:59 +00:00
jenkins-bot
fb2c99d30e Merge "Validate the dirty flag before saving preferences in each modules" 2013-11-13 12:40:48 +00:00
Santhosh Thottingal
8b3d27a505 Validate the dirty flag before saving preferences in each modules
Pressing apply button is applicable to all settings module, not only
for the one that is visible. Unless we do a validation before we save
preferences, other module can cause incorrect (old) preferences to be
saved.

Bug: 56885
Change-Id: I31df2ee0bf8b600a94e8fed1a784daf529186b16
2013-11-13 12:39:57 +00:00
Niklas Laxström
de4f78a6be Use data-i18n for system font l10n
This ensures that the translation is updated properly in the
language live preview.

Bug: 56888
Change-Id: I320c570f9272e8d191144f66a9cf0079c89d201d
2013-11-13 08:36:47 +00:00
Santhosh Thottingal
9dd4072d3d Avoid a js error when inputsettings are saved.
It happens when input settings are accessed directly while display
settings are not initialized. While saving the display settings
will not be rendered, causing a js error

Change-Id: I3ef1afe67a6bcdc3047b482d697bc03baab6ac47
2013-11-07 13:58:06 +00:00
Santhosh Thottingal
27f356d1f6 Add autonym class to the buttons displaying language
Change-Id: Iade66179acd46835099e015d73c01349526f80ec
2013-11-05 15:00:12 +05:30
Amir E. Aharoni
25a95bc760 Cleanup comments and whitespace
Change-Id: I7597c590a59ada855d759615fbb1675c3bcfe461
2013-11-01 15:53:20 +02:00
Siebrand Mazeland
315cf739bc Update formatting
Change-Id: Iaee2ab4f36d3a0dce143c62965ab29de504b31ea
2013-10-09 15:40:39 +02:00