Commit Graph

54 Commits

Author SHA1 Message Date
Santhosh Thottingal
d1647a9fa0 Update the local copy of preferences before saving to reflect other module changes
Change-Id: Idfd6d4f71eff9d1a1e6606b3fa91abf9ddc7b183
2013-11-22 12:05:42 +05:30
Amir E. Aharoni
bb250efea1 Cleanup wgULSLanguages usage
Change-Id: I15cb10f97ed39b18fdfb1bc2ce51d02374fe9c43
2013-11-11 18:14:55 +02:00
Niklas Laxström
193f69b017 Refactor ime lazy loading
* Do not load anything unless input field is focused
* Split the setup function to smaller functions
* Introduce $wgULSImeSelectors to allow configuration and avoid
  duplication of selectors in two places.

Change-Id: If5a476e66681dde9f0b72f619d35ddf6255246ac
2013-11-05 16:48:47 +05:30
Siebrand Mazeland
315cf739bc Update formatting
Change-Id: Iaee2ab4f36d3a0dce143c62965ab29de504b31ea
2013-10-09 15:40:39 +02:00
Roan Kattouw
d6ae72eb9c Don't trigger namespaced events, it breaks VisualEditor
Code like $input.trigger( 'focus.ime' ); doesn't make any sense. Event
namespaces exist for binding and unbinding and are irrelevant when
triggering. However, there's a bug in the version of jQuery that we
use (1.8.3) that causes .trigger( 'focus.ime' ) to perform a native
focus and call natively bound focus handlers, but only call jQuery
event handlers bound to 'focus.ime', not handlers bound to 'focus'.
This bug is fixed in jQuery 1.9+. http://jsfiddle.net/WGy9h/3/
demonstrates this bug.

The way ULS broke VE with this went like this:
* VE initializes and creates two contentEditable divs, the
  pasteTarget and the documentNode. It then focuses the documentNode.
* ULS loads jQuery.ime
* Once jQuery.ime loads, it first calls .trigger( 'focus.ime' ) on
  the pasteTarget
* jQuery focuses the pasteTarget, which means a blur is emitted on the
  documentNode
* In response to this blur event, VE disables the SurfaceObserver
* jQuery.ime then calls .trigger( 'focus.ime' ) on the documentNode
* jQuery focuses the documentNode, but does not call VE's focus handler
  because it's bound to 'focus' rather than 'focus.ime'
* This means VE's SurfaceObserver is not reenabled
* If the user then focuses something else then focuses VE again, a
  native focus event fires and the SurfaceObserver does get reenabled

Change-Id: I7c590599df4cf62418403bc1d1dccfc3c6db5fd3
2013-09-27 16:34:19 -07:00
Amir E. Aharoni
a1ad38d715 Show an autonym for languages that don't have input methods
Bug: 51025
Change-Id: I4a6cc9a79f186941cc79533de90ab0fb7e104673
2013-08-26 13:31:27 +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
8f5be106f5 Update jquery.ime library
upstream: http://github.com/wikimedia/jquery.ime

changes:
* Support for contenteditable, like the VisualEditor surfaces. This
  support is very minimal now. Because of VE bugs on IME support, many
  things are broken. But one-one keyboard mappings should work with less
  issues. The UI of jquery.ime is not integrated with VE toolbar
* More input methods
	- IPA-X-SAMPA by Amir
	- Armenian keymaps by  Aleksey Chalabyan
	- Kurdish keymaps by Ghybu
	- Кыргыз keymap by Amir
	- Central Kurdish keyboards by Çalak
* A lot of input method bug fixes multiple contributors
* Minor UX fixes

Introduces Rangy library.
A module named rangy is defined in VisualEditor extension with more features of rangy.
Here we need only the core library. This module is loaded dynamically from
client when rangy is undefined. If VE is present rangy will be defined, the module
defined in VE will be used. ie, This get loaded only when VE is not present and
user trying to type in a contenteditable.

Bug: 49569
Bug: 50849
Bug: 50220

Change-Id: Iadad5a4e5972fbd1359847526d28e9dbbe00a7c4
2013-08-19 04:40:08 +00: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
Santhosh Thottingal
c4631fdf51 Top position the ULS for IME menu wrt the input field
Currently it is positioned relative to the ... menu item.
It caused weird positioning at some places.
Positioning it relative to the input field makes more sense.

lazyload option was removed from jquery.uls. Removing it from here.

Change-Id: I331051a38d7dfd97466601bfcc2facaf446d0db9
2013-07-30 15:55:42 +03: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
d92c75518b Delay loading of language settings javascript
Load them when language settings is opened using cog or ULS icon click

Change-Id: I472497c549bff0fd578156fa0113dae2d6a7a7fb
2013-07-26 15:55:07 +03:00
jenkins-bot
3ae89279fb Merge "Lazy initialization of language settings for IME menu" 2013-07-26 11:06:48 +00:00
Santhosh Thottingal
eff459eea6 Lazy initialization of language settings for IME menu
Initialize it only when first time user clicks on it

In a page like Special:Translate where lot of input fields
appearing, the previous approach was adding many language settings
div to the page.

Bug: 48211

Change-Id: If063df6782c6a51ac77ed5531dfa253c7f3ddbc4
2013-07-24 11:12:01 +00:00
Santhosh Thottingal
1aafd31cf5 Typo fix
Change-Id: I496d137a706bd1672ea12f4d6d465d858a399794
2013-07-24 15:28:33 +05:30
Niklas Laxström
883e87ea56 Help links for ime selector menu
Change-Id: Ia6a0db9af25216f3d03c5130de96000141ccaa57
2013-07-15 13:24:12 +00:00
Santhosh Thottingal
e4cefe06fd Apply webfonts to the IME selector too
It get added to DOM after DOM is ready, and does not inherit styles
(by design)

Change-Id: I45a982b5c1c2a39718f38e77a33b79f89e460474
2013-07-08 07:42:49 +00:00
Niklas Laxström
034acf6f0f Log ime-enable and ime-disable events
Change-Id: I96964cb190d1a67bba536458ebadd3bd677d4fa6
2013-07-06 12:26:52 +00:00
jenkins-bot
7d1f6222fa Merge "Allow disabling of IME by a jQuery selector" 2013-07-05 13:38:36 +00:00
Amir E. Aharoni
8205e294d7 Allow disabling of IME by a jQuery selector
Add the variable $wgULSNoImeSelectors to allow custom
disabling of IME in specific elements.

Add captcha input field id to the exclusion list.

Bug: 41675
Change-Id: Ib03a20c50a4f473e6a58638b85da16659268eb09
2013-07-05 13:37:31 +00:00
Santhosh Thottingal
8ddff0b2fc Use single entry point mw.uls.init for all ULS ui initialization
Change-Id: I485ea27deebb530eb89e4b0935eda01a5276f884
2013-07-04 17:05:10 +00:00
Niklas Laxström
10c1177c1d Remove comma that shouldn't have been introduced
Change-Id: Iaf24bc1cf4ec59fe2c44601eee1a19ccdac757ba
2013-06-19 18:19:42 +00:00
Santhosh Thottingal
7a95d13345 Use content language as default language for ime selector
Change-Id: I9780cefc6585ebcc99bd8a45ccf10ecf6ee54a4d
2013-06-19 10:04:43 +00:00
Siebrand Mazeland
1f9bf6f82c Update indentation and newlines
Change-Id: Iac833df12a00949d32f2ce2fc26a657bab3d8229
2013-06-17 16:36:34 +02:00
Santhosh Thottingal
9d75ff9a09 Disable IME too in blacklisted browsers
Change-Id: I140352f723bc4863d14ed6441c9e173310c683b3
2013-06-17 09:31:06 +00: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
8640964f95 Clicking on the 'Apply Settings' does not close the ULS panel
Bug: 48898
Change-Id: I0c05a9a1be14c1036110f84c7a0080b98f93ee1d
2013-06-03 15:10:38 +05:30
jenkins-bot
3066c79174 Merge "Display notification when disabling input methods from keyboard icon menu" 2013-05-26 14:15:41 +00:00
Santhosh Thottingal
170be2068e Reset the dirty bit after preferences are saved.
Bug: 48703
Change-Id: I5768c455324396d503646a4c803e9d512f47c0e1
2013-05-23 15:36:33 +05:30
Santhosh Thottingal
cea4d81766 Display notification when disabling input methods from keyboard icon menu
Bug: 48534
Change-Id: Id6c1cb22cb09a226cfcc84d597724e5d803392f3
2013-05-23 12:15:49 +05:30
Santhosh Thottingal
3cdcd26b63 Do not show ULS in weird positions
ULS was shown relative to input field position. That will not work
always. Show it in default position - center of screen.

Change-Id: I5fd9f10d955322abd2623ce8b88792b391553dcd
2013-05-22 15:48:59 +03:00
Santhosh Thottingal
8f57432672 Revert "Remove redundant focus handler"
This reverts commit 739d952a81.
Bug: 48703

Change-Id: Ib66ed3c824f0bd5e68258eb5a39b8affc8b50e9f
2013-05-22 17:49:23 +05:30
Santhosh Thottingal
4a49c25f10 Provide disable input tools option in IME menu
Bug: 48533
Change-Id: Ie856cbda344ae2624567fb6c2d6206996c3b10dc
2013-05-22 08:52:10 +00:00
Santhosh Thottingal
739d952a81 Remove redundant focus handler
focus on input field and updating language(can be changed from settings,
selector etc) is already handled inside jquery.ime

But focus on the particular input field need to be triggered, without
consuming focus event with in the event handler

Change-Id: I0b3783542e23b194fe141b9aef692a855469ce62
2013-05-22 08:49:47 +00:00
Santhosh Thottingal
7178b0eb5a (Bug 42378) Make "disable IME tools" effects immediate as a preview
Change-Id: I76560e4c4bc0ddaa1c7cc78202e14a46b6e7ac76
2013-03-15 14:20:43 +00:00
Amir E. Aharoni
4f651fa0e2 Cleanup for JSHint
Change-Id: I35d2d41640f405f4e1e94b18ddac751437a84bb5
2013-03-05 14:50:12 +02:00
Amir E. Aharoni
16424982eb Check that ime was defined before selecting a language
Fixes a regression from I759c01f894569372d69d3b879e34aafda2ed41b1.

Change-Id: I5c3998b687fb92e3c90301edecb25b6a8306f423
2013-03-05 07:57:46 +02:00
Amir E. Aharoni
1df008a146 Make the IME selector state consistent in all textareas
Fixes:
https://mingle.corp.wikimedia.org/projects/internationalization/cards/2478

Change-Id: I759c01f894569372d69d3b879e34aafda2ed41b1
2013-03-04 18:58:11 +02: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
ba7c921b55 (bug 42148) Saving the preferences only if they changed
Change-Id: I46a6fa85bc5ebfe6f34a957c302b1bf997cb3576
2013-01-09 20:01:57 +05:30
Santhosh Thottingal
59f32ad7fe Fix the language selection from language selector for IME
Change-Id: I40e77680e4832a38a9c0ae03bbf5a3850afa518e
2012-11-23 09:14:34 +00:00
Santhosh Thottingal
cccd49163b Correct the preference overriding for IME
Change-Id: I80eddfe7476b1c7ff1562f79bc14f497e4630862
2012-11-01 10:18:20 +05:30
Santhosh Thottingal
fc29a7e587 Option for disabling the IME system
* It can be a user preference using the ULS Input method settings
* It can be a mediaWiki configuration $wgULSIMEEnabled

Change-Id: Ic5fb4932d62ab18db5d3b10ca81c0f6bfe9fd29e
2012-10-31 12:57:14 +05:30
Santhosh Thottingal
8069e530e7 i18n for input method settings
Change-Id: Id6cf3f24fe355a6757533d3b7f302e3d33cfa0c3
2012-10-30 19:50:35 +01:00
Santhosh Thottingal
4818545939 Add a more settings link instead of the help link
It opens the input settings panel of ULS

Change-Id: I6d22585f735073d3d7d3e59eba24befe72238786
2012-10-30 11:33:50 +05:30
Santhosh Thottingal
87c7d50b01 Move the IME customization code out of document.ready
Change-Id: If358cb1639b4a7e847aefac8f4b7b1923209f76d
2012-10-29 14:32:44 +05:30
Santhosh Thottingal
1c72077c89 Cleanup
whitepace, unwanted fixmes, wrong comments, jshint

Change-Id: I571b2b3a7e9fbbe7c93262ee9783fbe334d9170e
2012-10-29 14:27:40 +05:30