Commit Graph

72 Commits

Author SHA1 Message Date
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
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
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
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
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
jenkins-bot
78adcc5e20 Merge "LanguageSettings: Simplify positioning code" 2016-08-16 11:49:44 +00:00
jenkins-bot
f44d97230b Merge "LanguageSettings: Do not render modules twice on initialization" 2016-08-16 10:03:00 +00:00
Niklas Laxström
05e0b8c53e LanguageSettings: Simplify positioning code
* Remove scrolling from positioning code
* Make sure that any calculated default positions also apply to
* modules by updating this.top and this.left.

Bug: T143074
Change-Id: Iffc49674abcca8a8c4a600569a05db1314fae3f6
2016-08-16 06:28:43 +00:00
Niklas Laxström
d24472e962 Fix some comment typos
Change-Id: I338891147cb6aa8e6d88119eb61ea718edb93747
2016-08-15 09:55:02 +00:00
Niklas Laxström
5e7e8fe48e LanguageSettings: Do not render modules twice on initialization
Change-Id: I25d939ffcabde394bb7a496ee8bc5df9a87c2573
2016-08-15 09:48:00 +00: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
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
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
Divya
ee94df2890 Margin below disable input tools button
Fixed bottom rule to extend within dialog

Bug: T1169
Change-Id: If15c52e2c06c2c267f6599bd40e147e095896e80
2015-01-08 12:24:00 -05:00
Santhosh Thottingal
0c16041f5b Fix the missing close icon in ULS
Regression after the patch I39005ef2425c01b8623bf9df6d75c1e27f1c5bda
and I4a2542b3b745b8b749845a7e8dbb926dd5c4f0e4
Missed to rename the class in MW ULS.

Change-Id: If44d225a2e859dafa544b4a99ee554cecbfd8aca
2014-05-26 14:11:27 +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
d2522e40dc Avoid duplicate html ids for the settings panel triggers
Bug: 57353
Change-Id: I144b7612639147fc96ef1506c454954d605958e9
2013-11-21 16:31:44 +00:00
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
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
Santhosh Thottingal
f5ce066c80 Lazyload jquery.uls library
In the "interlanguage" position ULS is shown after 2 clicks,
so don't load it initially.

In the "personal" position ULS is shown immediately after
the language icon click, so load it, but conditionally.

The new RL module ext.uls.mediawiki is added for setting
jquery.uls defaults in a way that will lazy-load the language names.

Change-Id: Ic33ef034c794a523b5403867196c6098a58eb5b1
2013-11-11 14:13:02 +05:30
Siebrand Mazeland
315cf739bc Update formatting
Change-Id: Iaee2ab4f36d3a0dce143c62965ab29de504b31ea
2013-10-09 15:40:39 +02:00
Santhosh Thottingal
3af403fee5 Make the cancel and apply button applicable for all modules
If a user does changes in module A, does not save or cancel,
goes to module B, does some changes, moves to other modules,
and finally presses Apply, all changes should get saved.

Similarly, if a user cancels, all changes should get cancelled.

This required moving the cancel and apply button outside of modules
and managed by the language settings framework.

Modules get mw.uls.settings.apply or mw.uls.settings.cancel triggers
to do whatever they want to do on apply or save.

Includes some refactoring related to this.

Bug: 53256
Change-Id: I7d773d33a980a78604b36e39bf96a5686870124e
2013-09-02 17:03:13 +02:00
Nikerabbit
ef826e0e75 Simplify the cancel logic for input and display settings
Change-Id: I2afe78edad31b00a35d0589384e4091b61091275
2013-08-29 10:57:45 +00:00
Nikerabbit
537e6def5d Revert "Simplify the cancel logic for input and display settings"
This reverts commit a5d79594a3.

Causes new integration tests to fail.

Change-Id: I7e14d73d0d726a3253e8c6e6bdf5066230d8454c
2013-08-27 12:34:50 +00:00
Santhosh Thottingal
a5d79594a3 Simplify the cancel logic for input and display settings
Restore the language(ui, content), font values, input method values.

Rest of the UI resetting will be done by redrawing the settings
area whenever the language settings is accessed again.

Change-Id: Ia1488d1501f9c9f61726cea3637624f22a7ba135
2013-08-26 14:56:38 +00:00
Santhosh Thottingal
4704cf5182 Use mw.hook for notifying cancel of settings window to modules
This avoids mandate of having 'cancel' method defined in settings module.
Also avoids looping of all modules while cancel is happening.

Change-Id: I87d0975f2ef1bdee61f71d66eabe3040b81876b8
2013-08-22 11:51:26 +05:30
Siebrand Mazeland
64cd234e27 Change comma to semi-colon
Cannot cause confusion this way.

Change-Id: I75e6dcd9e9dd45e8b9c605c28d766f87e06dd271
2013-08-05 17:21:08 +00:00
Santhosh Thottingal
f11ef736a4 Fix the logic of apply and cancel actions
* Refactored the Cancel button handler code to cancel method in
display settings and input settings.
* When the user makes changes in multiple modules and clicks the Cancel
button or closes the language settings after that, cancel the changes in
all the modules. See bug 50564.
* The Apply button was always active in input methods module. Fixed the
logic for that.
* Renamed the enableApplyButton method to markDirty in both modules.
* Introduced isDirty attribute to the modules for optimizing the Cancel
method to avoid unnecessary restore actions.
* More minor cleanup and documentation.

Bug: 50564

Change-Id: I71f527bfb7dd7f6724e4365371ac3e4fc0723ed6
2013-07-23 14:09:27 +03:00
Santhosh Thottingal
f144cd5c16 Fix regression of bf1d62ba4
https://gerrit.wikimedia.org/r/#/c/75076/ had multiple issues:
1. Selecting of input methods stopped working
2. With 'personal' position, ULS windows comes on every page click

Bug: 50559

Change-Id: I0cf815228760d27bca07acd58631713988659831
2013-07-22 11:25:30 +00:00
Santhosh Thottingal
bf1d62ba42 Close language settings when clicked outside
To make the behavior consistent with ULS langauge selection window.

This also avoid multiple language settings screen appearing in rare
case of using two entry points to access language settings one after
another.

Bug: 50559
Change-Id: I990eb6402085290df314db0a75235e0ad7b2fd55
2013-07-22 13:40:23 +05:30
Santhosh Thottingal
8f9cec5835 Sort the language modules by id
Bug: 49735
Change-Id: I82e0d47781f982dd1a6ea7cc1e3cbe07bfd6b616
2013-06-26 10:25:25 +00:00
Amir E. Aharoni
3332062bac Cleanup ext.uls.languagesettings.js
Change-Id: Ied12c6bf2022c0c291d7e5edc213340e6a159f77
2013-06-14 18:28:35 -07:00
Santhosh Thottingal
6a9b31ad26 Use smooth scrolling for the windows when not in viewport
Change-Id: I94591d17ba023d9a13e2436ddebfd0209e076845
2013-06-07 14:26:31 +00:00
Santhosh Thottingal
84355a422d On show of language settings, update the panel
Settings changed using other UIs will not be updated unless we refresh
the settings panel.

Bug: 49148
Change-Id: Ia7cd8c91e59360c80eb72fdf0a966bdb3ce52d27
2013-06-07 14:25:39 +00:00
Santhosh Thottingal
73716f3f67 Remove lot of scroll to view related code
Just use javascript scrollIntoView to do that.
Also remove duplication of code related to this

Change-Id: Ied1235a85f4fe2d99afa127737979c24d3591118
2013-06-03 05:44:17 +00:00
Santhosh Thottingal
146f0fc2a4 Scroll the window to show language settings if necessary
Restores the feature removed while refactoring in
Iafb15ac9a7140fcce9e71ed933be6c55be81dc7e

Change-Id: I3aec168457190b7bfb40c09c97252e0cbb3dd1de
2013-05-20 14:01:58 +05:30
Santhosh Thottingal
b1563040ab Cog icon can be used to close the language settings panel
Bug: 47971
Change-Id: I7b6d6142e113bf3f90feef1650bc384a5edc42cb
2013-05-20 07:59:43 +00:00
Santhosh Thottingal
bb3e72f5a0 Simplify the language settings display
Directly show language settings instead of showing ULS language selector
and then simulating click on language settings

Change-Id: Iafb15ac9a7140fcce9e71ed933be6c55be81dc7e
2013-05-20 10:21:38 +05:30
jenkins-bot
ee9fe23599 Merge "Scroll language settings on all changes" 2013-05-16 09:52:35 +00:00
Amir E. Aharoni
5dde8024cf Revert "Avoid duplicate languagesettings dialog in page source"
This reverts commit 3b2e39d822.

Because of that commit input settings cannot be opened from
the IME menu and from the buttons at the bottom of ULS.

Change-Id: I9aee4f40d39392df0cdc5aba8b481b71838dc41a
2013-05-15 22:38:42 +03:00
Amir E. Aharoni
73e6e01c22 Scroll language settings on all changes
Change-Id: I550f309d713cb6aac6b18b326379b879dc0b9589
2013-05-15 15:33:26 +03:00
Santhosh Thottingal
3b2e39d822 Avoid duplicate languagesettings dialog in page source
Bug: 48211
Change-Id: I78ad47b1875f9f6f40707fb05f948c939fe91b39
2013-05-15 14:46:46 +05:30
Amir E. Aharoni
03546744ba Changes to show the display settings in the sidebar
* Add a caret for the ULS in the sidebar.
* Adjust the panel's position.
* Immediately show the Display settings instead of the language list.

Also added documentation.

Change-Id: I6635092e9e020cb1f5b51f437abde4e81c31ae48
2013-05-02 07:51:49 +03:00
Pau Giner
a2bb12e332 Make sections more clear in settings panel
CSS adjustments to visually distinguish settings sections from the
settings panel. Sections in the left use a light gray background to
provide contrast with the specific settings of each category.

Change-Id: Ie56020d6b8886cb9296f9ac9defe6ad81a6cc184
2013-03-27 12:15:04 +01:00
Amir E. Aharoni
4f651fa0e2 Cleanup for JSHint
Change-Id: I35d2d41640f405f4e1e94b18ddac751437a84bb5
2013-03-05 14:50:12 +02:00