2 lines
3.4 KiB
Plaintext
2 lines
3.4 KiB
Plaintext
)]}'
|
|
{"version":3,"sources":["templating/templating.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qD;;AAEA,G;AACA,4C;AACA,S;AACA,oC;AACA,G;AACA,0B;;AAEA,0D;;AAEA,wE;AACA,wC;AACA,2D;AACA,qD;AACA,gE;AACA,uD;AACA,sE;AACA,gE;AACA,+G;AACA,+D;AACA,G;AACA,E;;AAEA,wB;AACA,mD;AACA,6B;AACA,gE;AACA,kE;AACA,kE;AACA,sE;AACA,uE;AACA,8D;AACA,iD;AACA,E;;AAEA,qD;AACA,8D;AACA,kD;;AAEA,G;AACA,4E;AACA,O;AACA,gB;AACA,G;AACA,kD;AACA,kB;AACA,kE;AACA,4B;AACA,K;AACA,G;AACA,8D;AACA,0B;;AAEA,kD;AACA,oD;AACA,E;;AAEA,4D;AACA,yD;AACA,8C;AACA,qB;AACA,yB;AACA,W;;AAEA,wD;AACA,4B;AACA,E;;AAEA,wB;AACA,wB;;AAEA,wB;AACA,6C;AACA,kC;AACA,8D;AACA,iE","file":"/packages/templating.js","sourcesContent":["\n// Packages and apps add templates on to this object.\n\n/**\n * @summary The class for defining templates\n * @class\n * @instanceName Template.myTemplate\n */\nTemplate = Blaze.Template;\n\nvar RESERVED_TEMPLATE_NAMES = \"__proto__ name\".split(\" \");\n\n// Check for duplicate template names and illegal names that won't work.\nTemplate.__checkName = function (name) {\n // Some names can't be used for Templates. These include:\n // - Properties Blaze sets on the Template object.\n // - Properties that some browsers don't let the code to set.\n // These are specified in RESERVED_TEMPLATE_NAMES.\n if (name in Template || _.contains(RESERVED_TEMPLATE_NAMES, name)) {\n if ((Template[name] instanceof Template) && name !== \"body\")\n throw new Error(\"There are multiple templates named '\" + name + \"'. Each template needs a unique name.\");\n throw new Error(\"This template name is reserved: \" + name);\n }\n};\n\n// XXX COMPAT WITH 0.8.3\nTemplate.__define__ = function (name, renderFunc) {\n Template.__checkName(name);\n Template[name] = new Template(\"Template.\" + name, renderFunc);\n // Exempt packages built pre-0.9.0 from warnings about using old\n // helper syntax, because we can. It's not very useful to get a\n // warning about someone else's code (like a package on Atmosphere),\n // and this should at least put a bit of a dent in number of warnings\n // that come from packages that haven't been updated lately.\n Template[name]._NOWARN_OLDSTYLE_HELPERS = true;\n};\n\n// Define a template `Template.body` that renders its\n// `contentRenderFuncs`. `<body>` tags (of which there may be\n// multiple) will have their contents added to it.\n\n/**\n * @summary The [template object](#templates_api) representing your `<body>`\n * tag.\n * @locus Client\n */\nTemplate.body = new Template('body', function () {\n var view = this;\n return _.map(Template.body.contentRenderFuncs, function (func) {\n return func.apply(view);\n });\n});\nTemplate.body.contentRenderFuncs = []; // array of Blaze.Views\nTemplate.body.view = null;\n\nTemplate.body.addContent = function (renderFunc) {\n Template.body.contentRenderFuncs.push(renderFunc);\n};\n\n// This function does not use `this` and so it may be called\n// as `Meteor.startup(Template.body.renderIntoDocument)`.\nTemplate.body.renderToDocument = function () {\n // Only do it once.\n if (Template.body.view)\n return;\n\n var view = Blaze.render(Template.body, document.body);\n Template.body.view = view;\n};\n\n// XXX COMPAT WITH 0.9.0\nUI.body = Template.body;\n\n// XXX COMPAT WITH 0.9.0\n// (<body> tags in packages built with 0.9.0)\nTemplate.__body__ = Template.body;\nTemplate.__body__.__contentParts = Template.body.contentViews;\nTemplate.__body__.__instantiate = Template.body.renderToDocument;\n"]} |