Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor...
Transcript of Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor...
![Page 1: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/1.jpg)
WIKIMANIA 2011
Roan Kattouw - Timo Tijhof -
Trevor Parscal -
[[User:Catrope]][[User:Krinkle]][[User:Trevor Parscal]]
Introduction to ResourceLoaderFocus on easy gains for
Speed, localization and developer-friendliness
![Page 2: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/2.jpg)
WIKIMANIA 2011
![Page 3: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/3.jpg)
WIKIMANIA 2011
Resources
0KB 100KB 200KB 300KB 400KB 500KB 600KB
HTML JavaScript CSS Images
![Page 4: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/4.jpg)
WIKIMANIA 2011
Resources
0KB 100KB 200KB 300KB 400KB 500KB 600KB
HTML JavaScript CSS Images
1
![Page 5: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/5.jpg)
WIKIMANIA 2011
Resources
0KB 100KB 200KB 300KB 400KB 500KB 600KB
HTML JavaScript CSS Images
1 29
![Page 6: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/6.jpg)
WIKIMANIA 2011
Resources
0KB 100KB 200KB 300KB 400KB 500KB 600KB
HTML JavaScript CSS Images
1 29 4
![Page 7: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/7.jpg)
WIKIMANIA 2011
Resources
0KB 100KB 200KB 300KB 400KB 500KB 600KB
HTML JavaScript CSS Images
1 2229 4
![Page 8: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/8.jpg)
WIKIMANIA 2011
Resources
0KB 100KB 200KB 300KB 400KB 500KB 600KB
HTML JavaScript CSS Images
1 47 2
![Page 9: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/9.jpg)
WIKIMANIA 2011
Modules
![Page 10: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/10.jpg)
WIKIMANIA 2011
Modules
Scripts,
![Page 11: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/11.jpg)
WIKIMANIA 2011
Modules
Scripts, styles
![Page 12: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/12.jpg)
WIKIMANIA 2011
Modules
Scripts,
& messages
styles
![Page 13: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/13.jpg)
WIKIMANIA 2011
Modules
Scripts, styles
& messages
![Page 14: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/14.jpg)
WIKIMANIA 2011
Modules
![Page 15: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/15.jpg)
WIKIMANIA 2011
Modules
b ca
a, b & c
![Page 16: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/16.jpg)
WIKIMANIA 2011
Modules
b ca
a, b & c
![Page 17: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/17.jpg)
WIKIMANIA 2011
Modules
bcaa, b & c
![Page 18: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/18.jpg)
WIKIMANIA 2011
Modules
a, b & c
![Page 19: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/19.jpg)
WIKIMANIA 2011
Modules
![Page 20: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/20.jpg)
WIKIMANIA 2011
Example: Register a module
![Page 21: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/21.jpg)
WIKIMANIA 2011
Example: Register a module$wgResourceModules['ext.Foobar'] = array(
![Page 22: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/22.jpg)
WIKIMANIA 2011
Example: Register a module$wgResourceModules['ext.Foobar'] = array(
'scripts' => 'resources/ext.Foobar.js',
![Page 23: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/23.jpg)
WIKIMANIA 2011
Example: Register a module$wgResourceModules['ext.Foobar'] = array(
'scripts' => 'resources/ext.Foobar.js','styles' => 'resources/ext.Foobar.css',
![Page 24: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/24.jpg)
WIKIMANIA 2011
Example: Register a module$wgResourceModules['ext.Foobar'] = array(
'scripts' => 'resources/ext.Foobar.js','styles' => 'resources/ext.Foobar.css','messages' => array(
'foobar-title','foobar-welcome','foobar-intro',
),
![Page 25: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/25.jpg)
WIKIMANIA 2011
Example: Register a module$wgResourceModules['ext.Foobar'] = array(
'scripts' => 'resources/ext.Foobar.js','styles' => 'resources/ext.Foobar.css','messages' => array(
'foobar-title','foobar-welcome','foobar-intro',
),'dependencies' => array(
'jquery.ui.button','mediawiki.Title',
),);
![Page 26: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/26.jpg)
WIKIMANIA 2011
Images: Sprites. No ?
![Page 27: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/27.jpg)
WIKIMANIA 2011
Images: Sprites. No ?
![Page 28: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/28.jpg)
WIKIMANIA 2011
Images: Sprites. No ?
![Page 29: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/29.jpg)
WIKIMANIA 2011
Images: Sprites. No ?
![Page 30: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/30.jpg)
WIKIMANIA 2011
Images: Sprites. No ?
![Page 31: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/31.jpg)
WIKIMANIA 2011
Images: Sprites. No ?
![Page 32: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/32.jpg)
WIKIMANIA 2011
CSS: Data URI embedding
![Page 33: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/33.jpg)
WIKIMANIA 2011
CSS: Data URI embedding
.foo {/* @embed */background-image: url(foo.png);
}
![Page 34: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/34.jpg)
WIKIMANIA 2011
CSS: Data URI embedding
.foo {/* @embed */background-image: url(foo.png);
}
.foo {background-image: url(data:image/png;base64,iVBORw0K...FTkSuQmCC);
}
![Page 35: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/35.jpg)
WIKIMANIA 2011
CSS: Flipping for RTL languages
![Page 36: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/36.jpg)
WIKIMANIA 2011
CSS: Flipping for RTL languages.foo {float: left;padding-right: 0.5em;margin: 1px 2px 3px 4px;background-image: url(foo-ltr.png);
}
![Page 37: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/37.jpg)
WIKIMANIA 2011
CSS: Flipping for RTL languages.foo {float: left;padding-right: 0.5em;margin: 1px 2px 3px 4px;background-image: url(foo-ltr.png);
}
.foo {float: right;padding-left: 0.5em;margin: 1px 4px 3px 2px;background-image: url(foo-rtl.png);
}
![Page 38: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/38.jpg)
WIKIMANIA 2011
![Page 39: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/39.jpg)
WIKIMANIA 2011
![Page 40: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/40.jpg)
WIKIMANIA 2011
Startup Module
![Page 41: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/41.jpg)
WIKIMANIA 2011
Startup Module
if ( IE5 ) { giveUp(); }
Sanity check
![Page 42: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/42.jpg)
WIKIMANIA 2011
Startup Module
if ( IE5 ) { giveUp(); }
Sanity checkmodule manifest
Dependencies
b c
a
d e
![Page 43: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/43.jpg)
WIKIMANIA 2011
Startup Module
site-wide settings
Configurationif ( IE5 ) { giveUp(); }
Sanity checkmodule manifest
Dependencies
b c
a
d e
![Page 44: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/44.jpg)
WIKIMANIA 2011
Client-side Loader
![Page 45: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/45.jpg)
WIKIMANIA 2011
Client-side Loader
calculate dependencies
Resolution
b c
a
![Page 46: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/46.jpg)
WIKIMANIA 2011
Client-side Loader
calculate dependencies
Resolution
b c
a
give it to me all at once
Batching
ca +
![Page 47: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/47.jpg)
WIKIMANIA 2011
Client-side Loader
calculate dependencies
Resolution
b c
a
give it to me all at once
Batching
ca +
run in correct order
Execution
a
![Page 48: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/48.jpg)
WIKIMANIA 2011
Example: JavaScript wrapping
![Page 49: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/49.jpg)
WIKIMANIA 2011
Example: JavaScript wrappingmw.loader.implement( 'foo',
![Page 50: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/50.jpg)
WIKIMANIA 2011
Example: JavaScript wrappingmw.loader.implement( 'foo',
function() {! ! // Code for foo module
mw.Foo = { ... };! },
![Page 51: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/51.jpg)
WIKIMANIA 2011
Example: JavaScript wrappingmw.loader.implement( 'foo',
function() {! ! // Code for foo module
mw.Foo = { ... };! },
// CSS for foo module
![Page 52: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/52.jpg)
WIKIMANIA 2011
Example: JavaScript wrappingmw.loader.implement( 'foo',
function() {! ! // Code for foo module
mw.Foo = { ... };! },
// CSS for foo module{
! ! 'all': '.foo{color:blue;background-image:url(data:image/png;base64,iVBORw0K...FTkSuQmCC);}',! ! 'print': '.foo{display:none;}'! },
![Page 53: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/53.jpg)
WIKIMANIA 2011
Example: JavaScript wrappingmw.loader.implement( 'foo',
function() {! ! // Code for foo module
mw.Foo = { ... };! },
// CSS for foo module{
! ! 'all': '.foo{color:blue;background-image:url(data:image/png;base64,iVBORw0K...FTkSuQmCC);}',! ! 'print': '.foo{display:none;}'! },
// messages for foo module
![Page 54: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/54.jpg)
WIKIMANIA 2011
Example: JavaScript wrappingmw.loader.implement( 'foo',
function() {! ! // Code for foo module
mw.Foo = { ... };! },
// CSS for foo module{
! ! 'all': '.foo{color:blue;background-image:url(data:image/png;base64,iVBORw0K...FTkSuQmCC);}',! ! 'print': '.foo{display:none;}'! },
// messages for foo module{
! ! 'foo-intro': 'This is an introduction to foo.',! ! 'foo-msg': 'Hello $1, check out $2!'! });
![Page 55: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/55.jpg)
WIKIMANIA 2011
Example: Module loading
![Page 56: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/56.jpg)
WIKIMANIA 2011
Example: Module loading
//example.org/w/load.php?modules=foo|bar&skin=vector&lang=en
![Page 57: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/57.jpg)
WIKIMANIA 2011
Example: Module loading
//example.org/w/load.php?modules=foo|bar&skin=vector&lang=en
mw.loader.implement('foo',function(){mw.Foo={};},{'all':'.foo{color:blue;background-image:url(data:image/png;base64,iVBORw0K...FTkSuQmCC);}','print':'.foo{display:none;}'},{'foo-intro':'This is an introduction to foo.','foo-msg':'Hello $1, check out $2!'});mw.loader.implement('bar',...);
![Page 58: Introduction to ResourceLoader - Wikimedia · WIKIMANIA 2011 Roan Kattouw - Timo Tijhof - Trevor Parscal - [[User:Catrope]] [[User:Krinkle]] [[User:Trevor Parscal]] Introduction to](https://reader033.fdocuments.in/reader033/viewer/2022042907/5f52dc57213f064fdd331148/html5/thumbnails/58.jpg)
WIKIMANIA 2011
Thanks!
http://wikitech.wikimedia.org/view/Presentations
http://bit.ly/wm11resourceloader
http://www.mediawiki.org/wiki/ResourceLoader
Roan Kattouw - Timo Tijhof -
Trevor Parscal -
[[User:Catrope]][[User:Krinkle]][[User:Trevor Parscal]]