Page MenuHomeWickedGov Phorge

mediawiki.template.mustache.js
No OneTemporary

Size
906 B
Referenced Files
None
Subscribers
None

mediawiki.template.mustache.js

/* global Mustache */
( function () {
// Register mustache compiler
mw.template.registerCompiler( 'mustache', {
compile: function ( src ) {
return {
/**
* @ignore
* @return {string} The raw source code of the template
*/
getSource: function () {
return src;
},
/**
* @ignore
* @param {Object} data Data to render
* @param {Object} partialTemplates Map partial names to Mustache template objects
* returned by mw.template.get()
* @return {jQuery} Rendered HTML
*/
render: function ( data, partialTemplates ) {
const partials = {};
if ( partialTemplates ) {
for ( const name in partialTemplates ) {
const template = partialTemplates[ name ];
partials[ name ] = template.getSource();
}
}
return $( $.parseHTML( Mustache.render( src, data, partials ) ) );
}
};
}
} );
}() );

File Metadata

Mime Type
text/plain
Expires
Sat, May 16, 18:14 (7 h, 18 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
15/da/232895e7a88713bb5a4026dd3fcb
Default Alt Text
mediawiki.template.mustache.js (906 B)

Event Timeline