Commit Graph

664 Commits

Author SHA1 Message Date
Santhosh Thottingal
ac50f27d2d Fix: Live preview of languages removes labels from the language panel
MW ULS uses its api to load the localization. Avoid the conflict with
i18n.load method. Directly use the i18n message stores load method

Bug: 61990
Change-Id: I7ea7e7fc31a0831ae2b2c4b4301fbe81109fdf9d
2014-02-27 15:18:13 +05:30
Amir E. Aharoni
261542d738 Log tofu detection event
This only works if webfonts enabled (the checkbox is checked).

Change-Id: Ibbedc6a34dacb983f156d8a33afa5ab625e32f5f
2014-02-26 00:19:08 +02:00
jenkins-bot
cf164ced3e Merge "resources/images: Optimize all SVGs (partially by hand)" 2014-02-19 08:50:21 +00:00
Bartosz Dziewoński
c9cd0fc401 resources/images: Optimize all SVGs (partially by hand)
Passed with svgo 0.4.2 <https://github.com/svg/svgo>, then prepended
'<?xml version="1.0" encoding="UTF-8"?>' prolog to each file since
svgo sees it fit to remove it and that breaks file type detection.
svgo truncated all numerical values to a maximum of 3 decimal places
of precision.

Applied some additional optimizations by hand (with a text editor or
in Inkscape).

Did not touch upstream-managed SVG files, will submit separate
patches for them.

File size changes:

* cog-sprite.svg:    2,520 → 1,253 bytes – 50.3% smaller
* cog.svg:          17,961 → 1,154 bytes – 93.6% smaller
* display.svg:       2,591 → 1,053 bytes – 59.4% smaller
* help.svg:          1,790 →   674 bytes – 62.3% smaller
* input.svg:         5,515 → 2,092 bytes – 62.1% smaller
* remove-input.svg:  5,956 → 2,208 bytes – 62.9% smaller

Total:              36,333 → 8,434 bytes – 76.8% smaller

Details:

* cog-sprite.svg:
  * Use <defs> and <use> instead of duplicating the path data.

* cog.svg:
  * Vacuumed defs with Inkscape, there were weird leftovers there.

* input.svg:
  * Simplified the shapes.

* remove-input.svg:
  * As above. Reused the same path data with a transform to improve
    compression when embedded.

Bug: 56292
Change-Id: Iad1771829ba2711e4827befc1c73e34453734640
2014-02-19 00:54:42 +01:00
Niklas Laxström
ff6c3041c2 Wrong border color for caret
After seeing this wrong color dozens of times while testing svg
icons on high zooms, I can't stand the slightly different color of
the border for the caret from the rest of the ULS dialog. The border
of ULS is transparent with 0.2 alpha component over the background,
in this case I just hardcoded the resulting color here to match.

Change-Id: Ib2b2801f51ea02d2788d8703e3410eca9b3a57a3
2014-02-18 22:23:44 +00:00
Amir E. Aharoni
7627358fb4 Prevent JSON parsing errors
Bug: 61137
Change-Id: I2df6b6108bb7834b927205d3b6afa69354cecaf7
2014-02-10 15:25:37 +02:00
jenkins-bot
ab83208b60 Merge "Encode URL parameter" 2014-02-10 12:38:32 +00:00
Santhosh Thottingal
1c3a935ef0 Try to restore the old preferences, if any, if possible
Preferences were saved using jStorage. The browsers which ULS supports now
have wide native support for local storage, so we removed jquery.jStorage
in I09b2bd52972.

The old local storage key was 'jStorage' as put by jquery.jStorage. We now
check if that key is present. If so we migrate the preferences and remove
the old key to save space. We are not aware of anything else using this
module.

Change-Id: I995a32c4cb7a3bc818fe255f92dbc972211cb112
2014-02-10 17:52:04 +05:30
Santhosh Thottingal
e21c221e2b Use localStorage, fallback to cookie, remove jquery.jStorage RL dependency
As per comments in I22613d9f6846db5456beb532cec47396fccda8ae

Change-Id: I09b2bd52972d9aef20dd469c556631e0299bc407
2014-02-10 12:11:13 +00:00
Santhosh Thottingal
27771fdeaf Restore enableWebfonts pref and remove uls-enable
This patch restores the enableWebfonts preference, stored inside
the uls-preferences blob. It existed as 'enable-webfonts' in
the past and was removed in
If735a733717596fae03042c5e277bd538bd8501f

Each wiki can be configured to load the fonts by default
using the new global variable $wgULSWebfontsEnabled.
Its default value is true (to load fonts).

This also removes the preference 'uls-enable', recently added in
I71b70d8ee7c3cad7f49b32e5dc494ef4fc1bdb2f

The initialization of ext.uls.webfonts.js is changed as well,
so that minimal webfonts JS library code is loaded,
and the rest is loaded only if a user requests it.

Bug: 60304
Change-Id: I49e812eae32266f165591c75fd67b86ca06b13f0
2014-02-10 17:40:30 +05:30
jenkins-bot
7b376a80c8 Merge "Fix remaining strings not participating in live language preview" 2014-02-10 06:56:34 +00:00
jenkins-bot
9a5a1d909f Merge "Remove duplicate code and add todo" 2014-02-10 06:54:11 +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
jenkins-bot
135507f8dd Merge "Replace Xerxes with Artaxerxes" 2014-02-07 08:50:59 +00:00
Niklas Laxström
41d6ee2f44 Remove duplicate code and add todo
Found while looking at bug 47974

Change-Id: I7d4ef165e36e96cb6a61880a3413d8883c51c7fd
2014-02-06 17:09:08 +05:30
Kartik Mistry
abd130ed64 Set tooltip load timeout later than collapsible navs
Load tooltip at 700ms on page load to give enough time for collapsible
navigation to finish altering sidebar layout.

Bug: 51170
Change-Id: I8c7666a51ffe68007c4aadb4e72aa668d0fe6164
2014-02-06 09:11:02 +00:00
Reza
d81e5b762f Replace Xerxes with Artaxerxes
Xerxes is not passing OpentypeSanitizer check per
https://bugzilla.mozilla.org/show_bug.cgi?id=964696 that is why it won't work
as web font on Chrome and Firefox. This is its derivation to fix the issue.

Change-Id: I619e0c3ecb882ee91d46b36bf65a143bd8647d2f
2014-02-01 20:00:24 +05:30
Niklas Laxström
9fb8c3fdf0 Fix remaining strings not participating in live language preview
Change-Id: Id2dc9279e4bfae499a6e8b00a34a74c5505512b2
2014-02-01 11:22:30 +00:00
Reza
33713a1d69 Add Iranian Serif, Iranian Sans Bold, remove Amiri from fa
* Adding Iranian Serif and removing Amiri is per this request-url which is added also:
  https://fa.wikipedia.org/wiki/%D9%88%DB%8C%DA%A9%DB%8C%E2%80%8C%D9%BE%D8%AF%DB%8C%D8%A7:%D9%86%D8%B8%D8%B1%D8%AE%D9%88%D8%A7%D9%87%DB%8C/%D8%A7%D9%81%D8%B2%D9%88%D8%AF%D9%86_%DB%8C%DA%A9_%D9%82%D9%84%D9%85_%D9%88_%D8%AD%D8%B0%D9%81_%D9%82%D9%84%D9%85%DB%8C_%D8%AF%DB%8C%DA%AF%D8%B1
  but adding Iranian Sans Bold is for sake of completion like Amiri
* All EOTs and WOFFs are built/rebuilt using latest sfnttool

Change-Id: I3c0220395b22eaeebc355c0b857a7444c6e14662
2014-01-28 14:44:57 +00:00
Niklas Laxström
7c28df5125 Add ext.uls.messages as dependency for ext.uls.mediawiki
Turns out the messages for language selector were not loading
in Special:MainPage. This fixes that as well as cleaning up the
dependencies.

Change-Id: Ice8dcf1b2e878a0fe3cd0e002a9b1cff2f1901dd
2014-01-25 00:53:47 +00:00
Santhosh Thottingal
219b222c34 Remove the license string from the font repository
Saves 2KB

Change-Id: Ifc4add09a00b1906fad60185f95d0691915d9c94
2014-01-25 00:00:21 +00:00
jenkins-bot
366c1c7648 Merge "Avoid loading of jquery.i18n and messages until trigger clicked" 2014-01-24 21:42:49 +00:00
Niklas Laxström
15b3c31029 Avoid loading of jquery.i18n and messages until trigger clicked
Use RL for trigger tooltip messages to avoid using jquery.i18n just
to display the triggers. Reordered dependencies so that messages
are loaded for the setting panels and ime menu.

Change-Id: Ic9518f7b63699542deb02a413e03c28344c99fa4
2014-01-23 23:35:27 +00:00
jenkins-bot
349720854b Merge "Remove redundant title attribute for ULS trigger" 2014-01-23 22:21:39 +00:00
Niklas Laxström
6f4148ca5e Remove redundant title attribute for ULS trigger
It is unconditionally overwritten some ten lines after

Change-Id: I048673fbcb5d2a489a673284405822a148764e22
2014-01-23 22:12:05 +00:00
Niklas Laxström
c7edc4db7e Remove -moz-linear-gradient
This does not have much effect on the gzipped payload, but it still
makes the modules look big and (I assume) take space in the local
storage.

This prefix is not used by current versions of browsers, so the only
change is that some users with old browsers get bitmap images instead
of vector images.

Instances where -moz-linear-gradient is used with colors were left in,
as were the instances in upstream libs.

Change-Id: I1515c53955467eb21c8ed70e46aecc61ab4718c2
2014-01-23 21:55:25 +00:00
Santhosh Thottingal
81c4dfe848 Refactor the css so that embedded images are optimally loaded
Change-Id: If19d20fb22afafbf62c355394dcda825a0151ac6
2014-01-23 16:48:18 +00:00
Fomafix
d50ca14543 Encode URL parameter
Change-Id: I2eaf564b35624c8441cb8f54f6ab166f5d1762a2
2014-01-21 07:18:03 +00:00
Santhosh Thottingal
89892f7f0e For IE, do not use salt for tofu detection
Adding salt won't work for IE since it uses a tofu with small width
for unassigned code points. From tests, algorithm without salt
should be enough for IE.

Change-Id: If39e6c49d272fa67f60c19f1af64f1fb71856bcd
2014-01-20 18:46:29 +00:00
Santhosh Thottingal
1113786330 Detect tofu before applying any default fonts
To detect whether the client can render a given string,
use a tofu detection algorithm.

If the user has an explicit font preference, do not override it.

If the user has no preference and there is a default font for a
language, see if that language can be rendered at the user's browser
using tofu detection.

If tofu is detected, apply the font.

If the element has 'autonym' class, apply Autonym font only when
that language has tofu.

Change-Id: Ib9ee9497e6bcfa7eb86f7d264e0980d8880d6b70
2014-01-20 22:20:58 +05:30
Ori Livneh
f7066d4d2a Apply /* @embed */ pragma to every image, not just the topmost in each block
/* @embed */ is scoped to the rule immediately below it, not the entire block.

Change-Id: I862b01e6bb70a53904b8264872f08d1bc1b073c1
2014-01-17 19:21:52 -08:00
Santhosh Thottingal
61e1f95a4c Wait till rendering thread completion before applying webfonts
So that the fontfamily values are always 'seen' by the webfonts jquery
plugin. Missing this was causing incorrect behavior -overriding the
fontfamiliy from css- in random cases.

The stylesheet ext.uls.webfonts.css define font family values for
interlanguge links and autonym class. This patch make sure that that
css values are read by jquery.webfonts while deciding which font to
apply. Autonym font is supposed to be used for them. If jquery.webfonts
does not read that these elements has a font family defined in css as
"'Autonym', sans-serif", it will attempt to apply fonts as per user
preference or default fonts based on lang attribute. That will cause
applying bigger fonts.

jquery.webfonts does not apply any fonts, if an element has explicit
font family value defined by inline css or by external style sheets.

Bug: 59958
Change-Id: I2da436caa618bc2318e20e3c0492a6bf1c03e162
2014-01-13 08:58:00 +05:30
Reedy
9d94cfad57 Add RailwaysSans font
Not adding as a font option for English, but make it possible to define
the font in css and get the font downloaded from server

Bug: 58203
Change-Id: I968c4c4c3ba35ca53a9762cef0f7c59b374b1f67
2014-01-07 14:56:55 +05:30
jenkins-bot
c8bbeb23d7 Merge "Fixing Scheherazade to properly target local font" 2014-01-06 09:14:44 +00:00
Niklas Laxström
38d7c935be Fix alignment issue of ULS trigger
The calculated font-height is about 13.5px on my machine. For some
reason the usage of Autonym font sways the rounding of the container
height to 14px instead of 13px as for other items. I found out that
setting line-height to 1em or 100% makes the trigger size also round
to 13px, but I can't explain why. I didn't see any change in Modern
or Monobook skins (Monobook is broken already with bold and icon
missing).

Bug: 59239
Change-Id: I71ed556f2ef707b7e5f5891d6fc0c88c01f6b0ca
2014-01-06 08:07:24 +00:00
Reza
426e005ca4 Fixing Scheherazade to properly target local font
Change-Id: I790f43d611f33d48c30f56fc95ce5f7d2c1f2f24
2014-01-04 23:08:21 +00:00
Kartik Mistry
7db07f2d94 Update AbyssinicaSIL font to new upstream version
* Upstream version: 1.500
* Upstream URL: http://scripts.sil.org/AbyssinicaSIL

Change-Id: Ia676001360affbb05985bd865506f03f983fdf07
2013-12-23 17:14:23 +05:30
Reedy
b1b2a26a8c Update ext.uls.webfonts.repository.js against current code
Change-Id: Iab27035e87f381bffd4f186cdb735d61ee0993cd
2013-12-15 19:23:55 +00:00
Ebrahim Byagowi
7f7c2c89f2 Add Lateef and Scheherazade fonts for ckb and fa
* Also improves Nazli by adding Nazli bold from its original pack
* Scheherazade-R.woff is taken from Scheherazade font pack
* Except the above, rest WOFFs and EOTs are made by sfntly

Bug: 58381
Bug: 58382
Change-Id: Iede469600ddcaebfce177f5b3d33a9fc81ea33f9
2013-12-12 10:13:04 +00:00
Kartik Mistry
e19309c1b9 Update Autonym font from upstream.
* Fixed autonym for Old Slavonic.
* Fixed Glagolitic glyphs for 'cu'.
* Removed RFN and documentation updates.

Change-Id: I51263f0b6ecfbd43234b115a2d143f6703f0e60a
Version: 20131205
URL: https://github.com/santhoshtr/AutonymFont
2013-12-05 19:15:37 +05:30
jenkins-bot
bcfd55af9b Merge "Initial support for webfonts in MobileFrontend" 2013-12-02 17:25:37 +00:00
Ebrahim Byagowi
e4736e8cd6 Enable Amiri for ckbwiki
Bug: 57767
Change-Id: Ia176d107061047a921cd29a45ec24b330daddf19
2013-11-30 12:28:50 +00:00
Amir E. Aharoni
fd885d9881 Initial support for webfonts in MobileFrontend
Written in pair-programming with Ryan Kaldari.

This adds a version of webfonts initialization that is stripped
of any smart features. It only loads the basic jquery.webfonts
library and the fonts repository in a way that is usable
with the MobileFronted extension.

It is completely disabled by default.

It can be enabled by setting
$wgULSMobileWebfontsEnabled = true;
and even then it will only be enabled for users
who opted in for the mobile beta mode.

Change-Id: I488e411232a1192bbf46ae5675c701366bda9a3e
2013-11-30 12:28:46 +02:00
jenkins-bot
da7d1cde05 Merge "Apply Autonym only to class interlanguage-link" 2013-11-25 15:52:23 +00:00
Amir E. Aharoni
27935fb034 Apply Autonym only to class interlanguage-link
This depends on Ia995f89504d19ac281d55e0c19c51c9dc6442d8e .

Change-Id: I2ea915f4e1d01649bf91a13288b73c731dd64f6c
2013-11-25 17:51:29 +02:00
Santhosh Thottingal
abae4e1780 Do not save isDirty field in preferences
Bug: 57349
Change-Id: Id5fe6bf61fcf79942f879bd1729e6b0a622aded8
2013-11-25 17:24:44 +05:30
Santhosh Thottingal
ed993610f5 Clean up ini files
* Use ; for comments
* Avoid unescaped characters like = signs
* Consistency in request-url values

Change-Id: I1a94e30f1acedd934645b70f65025872e4bc7b8e
2013-11-24 12:17:42 +05:30
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
3dda6b5828 Comment and whitespace cleanup
Change-Id: I7ac44f4d371faa3c6941ccf8a4654a035e9b05a5
2013-11-22 10:18:20 +05:30
jenkins-bot
52a011afa2 Merge "Update TharLon font to new upstream version." 2013-11-22 04:17:01 +00:00