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
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
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
If not reset, the font-family will persist for languages
without font preferences
Steps to reproduce:
1. Open language settings->Display settings.
Switch language to English. Inspect the lang and font-family
of uls-display-settings element.
2. Switch language to hi. Inspect the lang and font-family
of uls-display-settings element. You can see Lohit Devanagari
as font.
3. Switch the language back to English. You can still see font
as Lohit Devanagari. With this patch, you should see font family
reset for English.
Change-Id: Ib3346d8b888c7dcfda16e8a10473c785a1ebd890
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
Happens when anonymous user cannot change language, and the
language of the translation differs from the content language.
Change-Id: Ie4f15f1813eec992cfe060baf9cd7dcb5f8a0d95
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
This avoids mandate of having 'cancel' method defined in settings module.
Also avoids looping of all modules while cancel is happening.
Change-Id: I87d0975f2ef1bdee61f71d66eabe3040b81876b8
In I59dfcfb25c, for logging events when page is navigating away, we
used callbacks with mw.hook. That is wrong approach. If event logging
is disabled those callbacks will never called: it broke language change
and all use cases which navigates away from current page.
Event logging should not interfere with any ULS functionality. If ULS
functionality depends on callbacks from event logging, it is wrong.
In this patch, we give a small time window to make sure event logging is
fired, but we won't wait for its success or failure.
If eventlogging is disabled, this time window does not exist.
Change-Id: I0b7d9d8b9d1d01b99422010596ebfa80b2589d04
Separating event logging out of ULS functionality. Event logging
is now loosely coupled with ULS. ULS core modules can emit an event
whenever EventLogging is required. The eventlogger module will act
on the event if configured.
Change-Id: I59dfcfb25c1acb85376b56239f2355ee7c4aff1e
Our logEvent wrapper now returns jQuery.Promise too.
Added timeout out parameter to our logEvent wrapper. Unlike
GettingStarted, I didn't create separate logUnlessTimeout
function.
Chrome apparently emulates enter on links as a click, so
this catches enters, left and middle clicks, but not if
the link is opened via right click menu. Might not catch
enter in all browsers.
Change-Id: I4b0eb56e7c7d6e56f8fd99d536f9b60b94a2e09e
* 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
In Iddef0805ab a custom message store was introduced for ULS, but
there were updates in jquery.i18n that allows us to use default
message store again.
(see https://github.com/wikimedia/jquery.i18n/pull/40)
Change-Id: I86cb7a44efa83e5811824cd1104c6be11b1e2925
Because those windows are rendered later. The settings window inherits
fonts. But button in those panels doesn't inherit. Make sure all panel
elements have current font applied.
Change-Id: Ibb8b12b3d973023c49ef89a04d534081bf8ee87f
Issues fixed:
Incorrect position of ULS when accessed from more languages button
of input/display settings, when language settings opened from ime
menu.
Arrow(callout) appearing for ULS when opened from more languages
button of input/display settings, when language settings opened from ime
menu.
Used a class 'callout' to mark whether windows need callout arrow or not.
Bug: 49060
Change-Id: Ic4c0a1e386918494a0d006a02dd0cf93ef269163
It is possible that the count reach more than SUGGESTED_LANGUAGES_NUMBER
before it reach the
languagesForButtons.length === SUGGESTED_LANGUAGES_NUMBER
check. This will cause the loop to run for all languages.
Change-Id: Ie6190d1c80c2a7152af490db2bc115ecdfde4184
Also make sure that correct language is passed to the getFont
It was wrong in current version - UI language was passed always
(introduced in a refactoring to avoid code duplication for content
and ui language- commit: 98bb1c200c )
Change-Id: I62860f9d62538915628ad21e5d904e56bdcc9430
Directly show language settings instead of showing ULS language selector
and then simulating click on language settings
Change-Id: Iafb15ac9a7140fcce9e71ed933be6c55be81dc7e