Commit Graph

708 Commits

Author SHA1 Message Date
Santhosh Thottingal
32bb03045f Refactor all language, font change code to preview method
Avoids duplication of code and better organising language and font
change logic

Change-Id: I4e95cfc2de7b650a75e2bd550af547647d5b3eb3
2013-09-30 04:14:46 +00: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
Kartik Mistry
039c91d1d5 Integration tests for live preview of display language
Bug: 53255

Change-Id: I1506ddd0ef68217ac114bdf4c29c62cd071b1900
2013-09-26 22:51:37 -07:00
Santhosh Thottingal
2d8522d1ba Keep correct lang attribute when display settings closed
Bug: 54594
Change-Id: I15b12e17b5a922cce6717577bc0d56dfd80ccfee
2013-09-26 07:36:13 +00:00
Santhosh Thottingal
3fbbf05c26 Optionally exclude elements from applying webfonts
* Updates jquery.webfonts from upstream
* Introduces wgULSNoWebfontsSelectors configuration variable. It
  takes an array of jquery selector to which webfonts will not be
  applied if defined.

Change-Id: I0dc263f84620af4077f52e18eeb0f986ff0f13b9
2013-09-19 10:17:54 -07:00
Santhosh Thottingal
e0fa027b9f Fix typo in the fontname of Estrangelo Edessa
It was Estarngelo Edessa
Bug: 47229

Change-Id: I941c8c09bedcf58428f93231936f168f993cde8f
2013-09-11 18:09:22 -07:00
Niklas Laxström
e36d9b1cc3 Regression: Using [...] to change language does not activate apply button
Bug: 53736
Change-Id: If52beb73f9f3f74cde63bd846974540682066ab6
2013-09-04 07:00:53 +00: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
Niklas Laxström
34146ea023 (bug 49738) Use correct name for wiki content language
Happens when anonymous user cannot change language, and the
language of the translation differs from the content language.

Change-Id: Ie4f15f1813eec992cfe060baf9cd7dcb5f8a0d95
2013-08-30 12:45:02 +03: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
0d9bbd8113 Make the behavior of close button same as cancel button
Bug: 53255
Change-Id: If27a770c531d78538c70dd86199f1791b1171c2d
2013-08-26 14:31:09 +00: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
jenkins-bot
c59a1f0122 Merge "Make Phetsarath font default for Lao" 2013-08-26 06:04:08 +00:00
jenkins-bot
313ce86021 Merge "Pass an actual array to fontStack option to webfonts" 2013-08-26 05:57:47 +00:00
Kartik Mistry
a66be7dca8 Make Phetsarath font default for Lao
Bug: 52962

Change-Id: I5da0d2d3ca08f3eb3a09800e03e9d25ecdba0286
2013-08-26 11:20:33 +05:30
Santhosh Thottingal
c793a9bd31 Pass an actual array to fontStack option to webfonts
Change-Id: Id836d7ce82e22e7d0679a5c615be014b1fce08b3
2013-08-26 09:43:00 +05:30
Kartik Mistry
e0d63bce05 Make OskiEast font default for Canadian Syllabic
Change-Id: Ie928de294ec0dee5482fb93d4333ab5df9d1c843
2013-08-23 16:59:36 +05:30
jenkins-bot
ee70cf04c9 Merge "Use mw.hook for notifying cancel of settings window to modules" 2013-08-22 08:03:38 +00:00
Amir E. Aharoni
7330295ce2 Use the old way of checking browser support for MW < 1.22
Bug: 52322
Change-Id: I346c1119b2ae841b3dbb2e7b8a5a2d924269b150
2013-08-22 09:32:59 +03: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
jenkins-bot
00e248e1f9 Merge "Provide mw.hook when not provided by older MediaWikis" 2013-08-22 04:17:09 +00:00
Niklas Laxström
ec518a03b4 Provide mw.hook when not provided by older MediaWikis
Change-Id: I8d0826722064551cc46be26215ffb954f39babb0
2013-08-22 09:46:07 +05:30
Ebrahim Byagowi
0ff6ab13cb Add Nazli as a serif font for Persian Script
It is the font used in book maker for Persian Wikipedia. Its font
family (Nazanin) is one of widely used font on Persian documents.
It is needed for print output of Persian Wikipedia articles

Change-Id: I2c658f599b5c05882673f42c29c80ae826ddc047
2013-08-21 16:56:15 +03:00
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
jenkins-bot
6cf1486399 Merge "Log ime-change event" 2013-08-20 05:44:08 +00:00
Amir E. Aharoni
3b6d5cc83e Log ime-change event
Change-Id: I6dfc769f0de536e2ef35b165fe7a35f196bb181b
2013-08-20 08:34:52 +03:00
Amir E. Aharoni
a3bca89a42 Implement language-selection-method event
Change-Id: If2d207f8a221c8f2a560b1399ad69a3032b2064b
2013-08-20 05:16:35 +00:00
Kartik Mistry
e5891b83b5 Add a Lao web font
Bug: 52962
Change-Id: Ia8cf7fa8c8f2832da35af52899b4a7c5bc05e5d3
2013-08-19 23:49:06 +03:00
Kartik Mistry
f244ef66d1 Add a Sinhala web font
Bug: 52964
Change-Id: I04a05c01c079ac6a4b109fe0c4a6c36c7732fcae
2013-08-19 23:30:43 +05:30
Amir E. Aharoni
0f34b4d934 Fixing "Common language" functionality
If was broken in
Icda498f676d1d3ddaefad75fd9212150f6966666

Bug: 53035
Change-Id: Ida29364073b07b985050565cacc6634c134f8d6c
2013-08-19 16:34:43 +03:00
Santhosh Thottingal
7649b47f5c Followup I59dfcfb25c, language change work with out event logging
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
2013-08-19 10:13:56 +00:00
Niklas Laxström
1f66cb22bc Log no-search-results event
Change-Id: Ia272a6783d56c75ba775d71195104aad21214121
2013-08-19 08:13:55 +00:00
Santhosh Thottingal
44bd73325a Log font-change event
Change-Id: I093e27d74d047a639082a5da6442944f590c67dc
2013-08-19 06:00:26 +00:00
jenkins-bot
80715de3b2 Merge "Add the Nuosu SIL font for the Yi language" 2013-08-19 05:53:01 +00: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
Amir E. Aharoni
100bda017e Whitespace
Change-Id: I8855c3e2f237a9a22573509d70babea701896526
2013-08-18 18:10:40 +03:00
Amir E. Aharoni
8e051c3aaf Add the Nuosu SIL font for the Yi language
Change-Id: I7836f85f0599e4eb3b40168021ac0e3740e03f95
2013-08-17 15:58:11 +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
jenkins-bot
8defd1f4a8 Merge "TypeError: window.navigator.userLanguage is undefined" 2013-08-15 08:39:56 +00:00
jenkins-bot
d0b9d2717f Merge "Log settings-open event" 2013-08-14 09:36:57 +00:00
umherirrender
92a021e147 TypeError: window.navigator.userLanguage is undefined
This can happen, when the user deletes the pref User languages from the
browser.

Change-Id: Ieaf783fbae113724704e2cce2e166e56935e8ce1
2013-08-12 18:14:49 +00:00
Siebrand Mazeland
64cd234e27 Change comma to semi-colon
Cannot cause confusion this way.

Change-Id: I75e6dcd9e9dd45e8b9c605c28d766f87e06dd271
2013-08-05 17:21:08 +00:00
Siebrand Mazeland
e75b174b10 Make return values consistent
Tipsy does not expect a return value.

Change-Id: I9172dfe18ee1dc6d7773ce861a8a8b52638bc7b6
2013-08-05 17:20:10 +00:00
Siebrand Mazeland
8b1e6b911b Fix incorrect documentation
Change-Id: I646a5ccb2ff9e3e7f8871b4e55b55ec881c4301d
2013-08-05 09:23:19 +02:00
Niklas Laxström
df18f0a5ff Log settings-open event
Change-Id: I55fb9e4b8b6b210003f6bbad07486e1c2a8cba4f
2013-08-05 15:19:57 +08:00
Niklas Laxström
0af4375e7c Fix spelling mistake in variable name
Change-Id: I791555dc4a04beb6109e212314f8f4747fc8b6d9
2013-08-05 04:04:19 +00:00
jenkins-bot
52b8c80092 Merge "Log language-change for interface language" 2013-08-05 03:29:17 +00:00