Roan Kattouw
ebb291ce8a
Fix r74454: convert $wgCacheEpoch to a UNIX timestamp before comparing it with other UNIX timestamps
2010-10-08 10:25:23 +00:00
Roan Kattouw
8e65282ff6
(bug 25201) Respect $wgCacheEpoch in the resource loader
...
* The mtime of each module is now maxed with $wgCacheEpoch before being used. I chose to make this the caller's responsibility rather than getModifiedTime()'s, otherwise custom modules can (and inevitably will) forget to respect $wgCacheEpoch
* Invalidate message blobs if they're older than $wgCacheEpoch
2010-10-07 19:35:05 +00:00
Niklas Laxström
08b4de8037
Fix logic error in IMS check introduced in r72940. Was sending 304 even for modified files
2010-10-02 16:54:53 +00:00
Max Semenik
6bff3b462b
Bug 25338: fixed exception in Resource Loader
2010-10-02 10:18:48 +00:00
Trevor Parscal
0dc580a701
Fixed typo in r73673, thank for spotting that Roan!
2010-10-01 22:06:03 +00:00
Trevor Parscal
ab7d30c726
Added group param to loader script wrapping.
2010-10-01 20:26:18 +00:00
Max Semenik
3ccc262e83
"self::" --> "this->"
2010-10-01 16:09:01 +00:00
Trevor Parscal
30578bc6dd
Added some content for basic unit tests for ResourceLoader class.
2010-09-29 23:57:53 +00:00
Trevor Parscal
d79eac20f3
Fixed a use of ResourceLoader::getModule as a static method when converting things over in r73971.
2010-09-29 21:13:56 +00:00
Trevor Parscal
016fbe7a81
Made ResourceLoader an instantiable object, rather than a static one, making it more modular and testable.
2010-09-29 19:04:04 +00:00
Platonides
adf45bb4e1
Tiny changes, fix comment, remove unused globals and throw and exception instead of a fatal if given a wrong langcode.
2010-09-29 15:54:43 +00:00
Trevor Parscal
2d8b027219
* Fixed bug #25281 by adding special treatment for modules in the "private" group
...
* Added $wgResourceLoaderInlinePrivateModules to allow private modules to be either embedded in the HTML output or accessed through ResourceLoader (which will bypass squid cache and check the user paramter against $wgUser)
* Moved more generated javascript functionality to ResourceLoader
* Fixed comment typo made in r73673
* Added documentation for ResoruceLoaderRegisterModules hook
2010-09-24 22:10:25 +00:00
Trevor Parscal
066588f12a
Moved more generated javascript to ResourceLoader functions. Cleaned some things up in the startup module.
2010-09-24 21:03:29 +00:00
Trevor Parscal
09d3b2cf1e
* Moved registration generation to startup module.
...
* Moved some javascript code generation to reusable functions (more to do).
* Reduced the code output by using mutliple calling method for mediaWiki.loader.state.
* Moved CSS minification to the end (should be a bit faster than running it for each module).
2010-09-24 18:49:19 +00:00
Trevor Parscal
da50a7fef5
Added early exits when files are used before webstart
2010-09-24 17:31:40 +00:00
Trevor Parscal
389c3722dd
Improved the performance of ResourceLoader by pre-loading module information in a batch query. This was mostly code written by catrope and patched in / gotten working by me.
2010-09-23 21:23:51 +00:00
Trevor Parscal
b29514b0b3
* Added $wgResourceLoaderDebug, a default fallback for debug mode which can be overridden by the debug URL parameter a la $wgLanguageCode
...
* Merged $wgResourceLoader(Unv|V)ersioned(Client|Server)Maxage vars into $wgResourceLoaderMaxage, which contains an array of the same values.
2010-09-22 20:44:12 +00:00
Trevor Parscal
d825fbb1b8
Added group functionality to ResourceLoaderModule objects. Also fixed a bug that was registering non-ResourceLoaderFileModule objects incorrectly in the startup script.
2010-09-20 21:23:29 +00:00
Tim Starling
004f1edb37
Minor resource loader changes:
...
* Broke some long lines, converted some overly complex ternary operators to if()
* Added lots of line breaks into the output, for easier debugging.
* Added profiling for various functions.
* wfGetDb -> wfGetDB
* Fixed escaping in ResourceLoaderStartUpModule::getScript(), escape for JS rather than assuming Html::linkedScript() won't have any bad characters in it.
2010-09-17 11:45:49 +00:00
Trevor Parscal
0efe57292a
Fixed bug that cause ResourceLoader to generate mediaWiki.loader.implement calls with an empty array for the style parameter when no styles were present, which caused issues in JavaScript land - also made mediaWiki.loader more resilliant to this kind of abuse.
2010-09-16 20:53:06 +00:00
Trevor Parscal
9d6b323c57
Changed to always calling ResourceLoader::intitialize rather than checking the state of ResourceLoader::$initialized - allthough this is slower (extra function call overhead) it centralizes the logic. Premature optimization is evil.
2010-09-15 18:33:51 +00:00
Trevor Parscal
b2a0b06569
Moved responsiblity of initializtion to ResourceLoader public interfaces.
2010-09-15 18:27:47 +00:00
Trevor Parscal
0578faf0fb
Fixed really bad stuff going on with running hooks at the file level. Now, ResourceLoader::initialize must be called before you can use it durring page rendering. ResourceLoader::respond calls it automatically. ResourceLoader::initialize only has side-effects when run the first time.
2010-09-15 18:15:36 +00:00
Trevor Parscal
3d2009277f
Fixed a bunch of syntax errors and mistakes.
2010-09-15 01:46:19 +00:00
Trevor Parscal
4e5e3a6619
Using hook for registering resources.
2010-09-15 01:02:38 +00:00
Max Semenik
271f6392ea
Follow-up r72941: don't use json_encode() directly
2010-09-14 11:58:09 +00:00
Trevor Parscal
e7e5c33661
Added missing semi-colon in r72941
2010-09-13 23:41:35 +00:00
Trevor Parscal
1b97774d5e
Wrapped custom loaders in a function which provides name, version and statically defined dependencies for a module. This solves bug #25085 .
2010-09-13 23:41:03 +00:00
Trevor Parscal
27a1a67359
* Changed the expiry time strategy, now treating any request to ResourceLoader::respond which does not contain a version parameter as an unversioned request which is responded to with a near-future maxage and smaxage, while those which do contain a version parameter are treated as versioned requests and responded to with a far-future maxage and smaxage.
...
* Added some release notes for ResourceLoader globals.
* Changed when OutputPage appends timestamps to style/script-only requests - now they are only made into versioned requests if the module is a ResourceLoaderWikiModule or a ResourceLoaderUserPreferencesModule - because they might be changed on-wiki and require immediate feedback. This would only affect logged-in users however, as cached pages will contain the latest version number as of the time they were generated. This strategy may need to be adjusted to work with ESI to add version parameters to everything all the time, but this at least presents a reasonable fallback in the event that ESI is not setup.
2010-09-13 23:19:05 +00:00
Trevor Parscal
b862d74b82
Removed comment that's no longer relevant
2010-09-13 21:15:46 +00:00
Trevor Parscal
6ba8f312d1
Added versions to statically added ResourceLoader script and style tags.
2010-09-11 08:03:11 +00:00
Trevor Parscal
767a8725fa
ResourceLoaderSiteModule now supports CSS too!
2010-09-10 20:18:24 +00:00
Trevor Parscal
8a2bf1862a
Made OutputPage only ask for a style from ResourceLoader once with media=all, and ResourceLoader respond with styles wrapped in @media [type] { ... } blocks.
2010-09-10 18:24:45 +00:00
Trevor Parscal
b3fea2070b
Added media-type support for static and dynamic ResourceLoader requests.
2010-09-10 00:21:36 +00:00
Roan Kattouw
195680aeb5
Fix spelling of max-age in Cache-Control: header. This inconsistency in the HTTP standard is retarded
2010-09-08 16:35:20 +00:00
Alexandre Emsenhuber
bb6ec5642a
Fixed some doxygen warnings
2010-09-05 13:31:34 +00:00
Max Semenik
967541fdc7
load.php5 support for r72349
2010-09-04 19:54:39 +00:00
Siebrand Mazeland
3f501420ee
Stylize files added in r72349
2010-09-04 12:53:01 +00:00
Trevor Parscal
cad68eb943
Better solution for r72367, this allows file modules to always be written in ltr, while site modules are written in whatever $wgContLang is.
2010-09-04 10:53:57 +00:00
Trevor Parscal
81b40a37e5
Only flip CSS if dir is different from $wgContLang
2010-09-04 10:28:41 +00:00
Trevor Parscal
0aa8869150
Fix a bug in the resource loader causing it to return no Content-Type header for 304s. Firefox doesn't care but Chrome seems to, so we always set the right Content-Type
2010-09-04 08:38:45 +00:00
Roan Kattouw
32377424b9
Merging resourceloader branch into trunk. Full documentation is at http://www.mediawiki.org/wiki/ResourceLoader and a general overview has been posted on wikitech-li < http://lists.wikimedia.org/pipermail/wikitech-l/2010-September/049253.html >. One important change is that all JS is now loaded at the bottom, so any scripts assuming things from wikibits or whatever are present will fail.
2010-09-04 04:00:09 +00:00