Commit Graph

16 Commits

Author SHA1 Message Date
Kunal Mehta
0e7d8a7a9d build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.Commenting.FunctionComment.WrongStyle
* MediaWiki.FunctionComment.Missing.Public

Change-Id: Ic8acf95cfd8edf88125128fe527e357fa5d0a8ec
2017-06-25 18:39:02 +00:00
Fomafix
b30315da05 Use ResourceLoader::makeConfigSetScript to generate mw.config.set() script
Change-Id: If2ca0585c17f772567fffeab0fc32239e87d8cd7
2017-04-02 14:41:33 +02:00
Timo Tijhof
2ab168f113 Use getDefinitionSummary() in ResourceLoaderULSJsonMessageModule
* Fix inaccurate class comment that was copied from an unrelated
  module in MediaWiki core.

* Remove use of deprecated getModifiedTime(). While this implementation was
  straight forward, it is more reliable and deterministic to use a content hash
  because timestamps are not tracked by Git. This currently causes needless
  cache invalidation for all users at Wikimedia every week because git-clone
  starts with fresh timestamps on disk.

  I'm not using enableModuleContentVersion() right now because calling
  getScript() reads all files into memory which is more expensive than
  simply hashing the files. Especially because safeFileHash() is backed
  by an APC cache via FileContentsHasher.

  This matches the implementation in core ResourceLoaderFileModule.

Change-Id: If9aaefa6a3cf047c6c36e1cdd0f350412d59c849
2016-08-23 21:49:26 +00:00
Timo Tijhof
f06ac3efca Simplify ResourceLoaderULSModule with content-based versioning
* Remove manual tracking of when a hash is first seen.
  ResourceLoader is no longer time-based, rather it is content based.
  Except where a timestamp is actually wanted as key, a hash is all
  we need. The default implementation of simply calling getScript()
  and hashing its output suffices, and isn't a performance problem
  in this case.

* Also simplify getScript() by passing an object to 'mw.config.set'.
  Instead of multiple calls for each key/value. This is a no-op
  now because there is only one key.

* Fix inaccurate class comment that was copied from an unrelated
  module in MediaWiki core.

Change-Id: I9bb82cadd9caa7e584e20dd49ce30b64218326c4
2016-08-23 14:49:16 -07:00
jdlrobson
9e0dcbde35 Enable UniversalLanguageSelector modules for mobile
Enable several of the ULS modules so they can be used in a mobile context,
in particular by the Translate Extension

Changes:
* Create a ext.uls.common module that can be loaded safely on mobile
* Only add the ext.uls.init entry point module on desktop (ensured by
the use of targets). On mobile it has no impact other than to increase
the amount of bytes shipped to users.
* Note various modules have not been enabled for mobile usage.

Bug: T102922
Change-Id: If2808886f0bfa153f5918e3c7536e88641028da9
2016-08-17 06:43:46 +00:00
Niklas Laxström
3481946695 Drop svg from supported webfont formats
We do not have any svg formatted font files.

Change-Id: I613c04f082bfc07872d4e843cdacdfd62517bd37
2016-05-24 06:07:07 +00:00
Niklas Laxström
b2b75b15eb Drop eot from supported webfont formats
IE9+ which is lowest that MediaWiki still supports is supposed to
support both ttf and woff par some exceptions.

This reduces uncompressed repo size almost 4000 bytes.

Change-Id: If80f4ec898d86d5fd4cf873d0d86245e66da2f0b
2016-05-24 08:06:11 +02:00
Niklas Laxström
e054af704c FontRepoCompiler now adds hash suffix to font paths
This is now new standard way of doing this in MediaWiki.

Since this makes the font repo bit longer, compensated by no
longer providing version information, which also simplifies the code.
Uncompressed increase is 542 bytes.

Depends on https://github.com/wikimedia/jquery.webfonts/pull/45

Bug: T135806
Change-Id: I1921115fc1abc20e6e756044c0a84a9fe4133884
2016-05-23 09:32:57 +02:00
Kunal Mehta
6b8c33e763 build: Updating mediawiki/mediawiki-codesniffer to 0.7.1
Also added "composer fix" command.

Change-Id: I6f3f29f03abb607fbca9cec6f140875f2a3468a0
2016-05-09 18:30:34 -07:00
Niklas Laxström
651f8bc1c3 Refactor font repo compiler so it can be reused
Includes changes to the generated repository file
because the script had not been run for last update.

Change-Id: I6b5d1ce980c6e5b42e36c0044729536b6b0ae4dc
2016-04-14 10:12:20 +02:00
Siebrand Mazeland
49b4cc0028 Declare functions with access modifiers
Change-Id: I047d3dc6642de07130a43ad4c2fd4a8106450aac
2016-03-05 16:10:52 +01:00
Andrew Green
c00645a0a0 Update ResourceLoaderULSJsonMessageModule::getDependencies method signature
This change is for compatibility with Iee61e5b527 in MediaWiki.

This patch updates version info due to said requirement.

Change-Id: Ic63e617f51702c27104e123d4bed91983a726b7f
2015-06-09 01:23:30 +00:00
Niklas Laxström
a54a7c6793 Use different key for memckey
Change-Id: Iee00180c9b356a510a28000203ac06f757822114
2014-03-13 07:36:14 +00:00
Santhosh Thottingal
328eb017c8 Json message loader clean up
* Rename JsonMessageLoader to ULSJsonMessageLoader
* Correct the return type of mw.uls.loadLocalization

Follow up: Ic39dec1c484982fb07edd167e83794c0b5f470ee

Change-Id: I13c64a5e89ac75be8a95d951658018a78534f466
2013-11-19 10:55:52 +00:00
Niklas Laxström
bd52ae0538 ResourceLoaderULSModule::getModifiedTime updates continuously
Fix is simple: cache the hash of content per language

Added PHPUnit test for the same

Bug: 56856
Change-Id: I590b27af220d6e790c70728062d1a04c098b3d11
2013-11-11 16:12:07 +05:30
Santhosh Thottingal
76e82e4a9c ResourceLoader Module for serving json based localization messages
ApiULSLocalization is still present since we have to provide live
language preview feature.

Moved the loading of json file to includes/JsonMessageLoader.php

Also moved all RL modules to includes folder.

Bug: 56509
Change-Id: Ic39dec1c484982fb07edd167e83794c0b5f470ee
2013-11-04 14:59:14 +00:00