Commit Graph

64 Commits

Author SHA1 Message Date
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
Santhosh Thottingal
27f356d1f6 Add autonym class to the buttons displaying language
Change-Id: Iade66179acd46835099e015d73c01349526f80ec
2013-11-05 15:00:12 +05:30
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
Amir E. Aharoni
628923c812 When applying settings, log ime-change only if needed
Change-Id: I62b4ce777948c18cec5117279523198f4514c3a6
2013-08-20 12:42:52 +03:00
Amir E. Aharoni
4e04182ecd Fire the ime-enable/disable hook upon saving the preferences
Change-Id: I98e502cd8dc1990b10b1f824614c84d3bf5b993f
2013-08-20 08:31:21 +00:00
Amir E. Aharoni
3b6d5cc83e Log ime-change event
Change-Id: I6dfc769f0de536e2ef35b165fe7a35f196bb181b
2013-08-20 08:34:52 +03:00
Santhosh Thottingal
117cc5bf46 eventlogger module for ULS
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
2013-08-15 17:08:15 +03:00
Amir E. Aharoni
8c8b82ac4b Add event logging for more languages in input settings
Change-Id: I98b048ad8fdb923bc7e0834d2021c49b687ad9da
2013-08-04 08:56:19 +00:00
Santhosh Thottingal
82fbfe62e7 Load jquery.ime only when user focus on editable fields
To reduce javascript size for page load.

Change-Id: Ibf2ccd5b5501720837051d6e268b122e8a9f8590
2013-07-30 14:18:55 +03:00
Amir E. Aharoni
56dd512725 Revert "Load jquery.ime only when user focus on editable fields"
This reverts commit 63d547915f.

Bug: 52115
Change-Id: I1d6b65622e8a103a8a892beacf268e77b9e1b2d0
2013-07-27 00:56:18 +03:00
Santhosh Thottingal
63d547915f Load jquery.ime only when user focus on editable fields
To reduce javascript size for page load.

Change-Id: I71928ac5149cbcf2cc75073fdf628403e6abe456
2013-07-26 16:08:35 +03: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
a3bf6f7e3d Naming convention fix.
Change-Id: If1661a9c35fafb048b2a30b9fefbace7668e98d7
2013-07-19 10:20:31 +05:30
Niklas Laxström
da1baaf663 Help links for input settings
Bug: 42373
Change-Id: I30c8d6cbe916ac026ad70974755942c5bbea7162
2013-07-15 11:08:17 +00:00
Siebrand Mazeland
96705c0ed9 Remove redundant value assignment
Also redistribute variables over 2 lines instead of 3.

Change-Id: I4127173f84ef59d4de2199ff45b52243c761a87d
2013-07-08 14:38:05 +02:00
Niklas Laxström
c51384e4e1 Use /** for method documentation blocks
Change-Id: I6c7a8b7c2e2e861120caa1f1b5ff9b0dc7537737
2013-07-06 10:33:12 +00:00
Santhosh Thottingal
acbc10c494 After rendering input and display settings, refresh webfonts
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
2013-07-02 10:53:21 +00:00
Siebrand Mazeland
1f9bf6f82c Update indentation and newlines
Change-Id: Iac833df12a00949d32f2ce2fc26a657bab3d8229
2013-06-17 16:36:34 +02:00
Santhosh Thottingal
34d4045c3b Validate imeId before rendering
Fix: TypeError: $.ime.sources[imeId] is undefined

Bug: 49584
Change-Id: I9f5615d8b6729d76feae04e195a5ec6f26676bda
2013-06-17 10:08:16 +05:30
jenkins-bot
dce0b387c7 Merge "Input settings - language selection cleanup" 2013-06-13 10:09:31 +00:00
Santhosh Thottingal
638ab5bb3d Input settings - language selection cleanup
Renamed imeLanguage to UI language to make it correct.
And some logic corrections as per that change.

Bug: 49380
Change-Id: I1ed664623b23393e289bd817b88d7f326f6524be
2013-06-12 11:41:56 +00:00
Santhosh Thottingal
43be2f274c Scroll to viewport after input methods list is rendered
Added input methods may increase the height of window.
Make sure the entire window is in view port.

Bug: 49427
Change-Id: I06194b7d51459a31247104b2113ef3212774f004
2013-06-12 06:53:27 +00:00
Santhosh Thottingal
f0b3e6524c Cleanup
Minor whitespace, coding convention cleanup

Change-Id: Ibb10ce64ad4c35bfd6f924665243961c80b81714
2013-06-11 10:24:13 +05:30
Santhosh Thottingal
ae27298bee Fix: new language is not added to button on the display panel
Bug: 49377
Change-Id: Ibfec48d84ecc166628d2bc0b052688f19967491f
2013-06-10 12:02:26 +05:30
Santhosh Thottingal
9bc9aa7238 Avoid duplicate language buttons in input settings panel
Bug: 49141
Change-Id: Ibf076e6049e87e1398c87d2a264343f32eaddf28
2013-06-07 14:28:17 +00:00
Santhosh Thottingal
e9ab300889 Fix: ULS popup moves to sidebar if opened from ime menu
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
2013-06-07 14:26:46 +00: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
c9aa1f1130 Correct the loop logic for language buttons
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
2013-06-06 06:36:36 +00:00
Amir E. Aharoni
1a17ef392d Properly save back-up preferences for repeated canceling
Before this patch, this scenarios didn't yield the expected result:

1) Disable IME, click Apply 2) Enable IME, click Cancel

The expected result is that IME would be disabled, but it was enabled.

This patch re-stashes the preferences when they are saved, so
the last saved preferences are loaded when pressing Cancel.

Change-Id: Ic7abdab165e367d970e6568ba69b25bf7d4f675a
2013-06-04 12:00:21 +03:00
Amir E. Aharoni
361eb95f33 Make "Cancel" reset preferences and "Apply" save and close
Bug: 48898
Change-Id: I9f5444ffd57ddf46d197ebdb23a18c0c4600b196
2013-06-04 10:42:29 +03: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
jenkins-bot
44dbfbba4f Merge "Show input methods for selected language correctly" 2013-05-29 11:49:49 +00:00
Siebrand Mazeland
fb459cfd88 Clarify labels for input methods
Bug: 48536
Change-Id: I12fa43a9402f64f6da7ba040ff37363a2cc027bb
2013-05-28 07:54:27 +02:00
Amir E. Aharoni
282b6c7644 Show input methods for selected language correctly
Remove redundant calls to prepareInputmethods
and redundant button styling.

Rename firstLanguauge to the clearer currentLanguage.

Switch checking for imeLanguage and the prereferences language
to make sure that the last one is shown.

Done in pair programming with Santhosh.

Bug: 48163
Change-Id: Ie8441f29eb20caa05534c8589481a26cb415a27f
2013-05-27 13:38:32 +03:00
Santhosh Thottingal
bf270812f5 Fix all jshint errors
Change-Id: Ib8fb350132bb34c1e063eb644af5aeff833f95e8
2013-05-20 15:07:42 +05:30
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
394f4ab943 Merge "Set the position of display settings to match ULS" 2013-05-16 09:52:15 +00:00
Amir E. Aharoni
07465bf20c Set the position of display settings to match ULS
Bug: 47822
Change-Id: I7b04a831b2c5d7932564a3cdde94be0e233f7a7b
2013-05-16 09:48:44 +00:00
Amir E. Aharoni
977b36ade6 Replace id uls-more-languages with class
Change-Id: I51f74f0b3bcec1b45dd5588638346a6d02a44e52
2013-05-15 10:45:35 +03:00
Niklas Laxström
2f4e9cfff9 Reduce rerenderings in input settings
Change-Id: Ia929bbbb2cd6be18e37d9b73b4eea199bd0ad4b8
2013-05-09 16:28:21 +03:00
Niklas Laxström
aee1fcff19 Join some appends to one call
Change-Id: Iccf4c7653aff775a6ea0ddc211135dab8b1d99d1
2013-04-29 12:20:42 +00:00
Niklas Laxström
d309c687e9 Rename confusingly named function
Change-Id: I685a1658ec911e28cba4c9d3d7cbaaf4f1cca22e
2013-04-29 12:20:42 +00:00
Amir E. Aharoni
3471158dec Avoid null in the IME languages buttons
Change-Id: Ic64763fdba34bdcebde33104f7e6130d93a84e02
2013-04-29 14:52:37 +03:00
Amir E. Aharoni
f47b54819b Make disabling input methods work
Mark isDirty correctly.

Change-Id: I1c5219c9f63dec15272dd97341295e346cdabcb3
2013-01-17 18:35:03 +00:00
Amir E. Aharoni
e0e4ffa950 (bug 42375) Show current IME language in ULS input settings
Change-Id: I5240b1cb42b98ecb5dec96be838fbcf7736f81e6
2013-01-07 23:54:05 +02:00
Amir E. Aharoni
80ce8e068b (bug 42440) Fix button state when canceling
Also changed class names to make finding cancel buttons easier.

Change-Id: Ieaf242eb03add06038307d913a87a196d41ba01d
2013-01-02 08:04:50 +00:00