Template:DekiScript:Page

  • Revision slug: Template:DekiScript:Page
  • Revision title: Template:DekiScript:Page
  • Revision id: 331837
  • Created:
  • Creator: DavidWalsh
  • Is current revision? No
  • Comment

Revision Content

<% module.exports = buildAPI({ initialize: function (options) { BaseAPI.prototype.initialize.call(this, options); // Incomplete list of Page vars, but probably good enough. // See also: <http: dekiscript="" developer.mindtouch.com="" docs="" en="" page="" reference="" wiki_functions_and_variables=""> this.setVars({ date: new Date(env.modified), id: env.id, language: env.locale, name: env.slug, path: env.path, tags: env.tags, title: env.title, uri: env.url }); }, subpages: function (locale, slug) { var p = kuma.url.parse(env.url, true); var url = p.protocol + '//' + p.host + '/' + locale + '/docs/' + encodeURIComponent(slug) + '$children'; var subpages = mdn.fetchJSONResource(url); return subpages; } }); %></http:>

Revision Source

<% module.exports = buildAPI({
    
    initialize: function (options) {
        BaseAPI.prototype.initialize.call(this, options);
        
        // Incomplete list of Page vars, but probably good enough.
        // See also: <http://developer.mindtouch.com/en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Page>
        this.setVars({
            date: new Date(env.modified),
            id: env.id,
            language: env.locale,
            name: env.slug,
            path: env.path,
            tags: env.tags,
            title: env.title,
            uri: env.url
        });
    },
    
    subpages: function (locale, slug) {
        var p = kuma.url.parse(env.url, true);
        var url = p.protocol + '//' + p.host + '/' + locale + '/docs/' + encodeURIComponent(slug) + '$children';
        var subpages = mdn.fetchJSONResource(url);
        return subpages;
    }
    
}); %>
Revert to this revision