diff --git a/build/knockout-amd-helpers.js b/build/knockout-amd-helpers.js index 4a73996..80e8053 100644 --- a/build/knockout-amd-helpers.js +++ b/build/knockout-amd-helpers.js @@ -1,4 +1,4 @@ -// knockout-amd-helpers 0.7.0 | (c) 2014 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license +// knockout-amd-helpers 0.7.1 | (c) 2014 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license define(["knockout"], function(ko) { //helper functions to support the binding and template engine (whole lib is wrapped in an IIFE) diff --git a/build/knockout-amd-helpers.min.js b/build/knockout-amd-helpers.min.js index bf9a66d..aa7d79b 100644 --- a/build/knockout-amd-helpers.min.js +++ b/build/knockout-amd-helpers.min.js @@ -1,2 +1,2 @@ -// knockout-amd-helpers 0.7.0 | (c) 2014 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license +// knockout-amd-helpers 0.7.1 | (c) 2014 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license define(["knockout"],function(a){var b=window.requirejs||window.require||window.curl,c=a.utils.unwrapObservable,d=function(a,b){var c,d=function(){return a.apply(this,b||[])};return d.prototype=a.prototype,c=new d,c.constructor=a,c},e=function(a){return a&&a.replace(/\/?$/,"/")},f=function(b){for(var c=a.virtualElements.firstChild(b);c;){if(1===c.nodeType||8===c.nodeType)return!0;c=a.virtualElements.nextSibling(c)}return!1};a.bindingHandlers.module={init:function(g,h,i,j,k){var l,m,n=c(h()),o={},p=a.bindingHandlers.module.initializer,q=a.bindingHandlers.module.disposeMethod;return o.templateEngine=n&&n.templateEngine,o.templateProperty=a.bindingHandlers.module.templateProperty,o.afterRender=function(){var a=c(h());a&&"function"==typeof a.afterRender&&a.afterRender.apply(this,arguments)},f(g)||(o.name=function(){var a=c(h());return(a&&"object"==typeof a?c(a.template||a.name):a)||""}),o.data=a.observable(),o["if"]=o.data,a.applyBindingsToNode(g,{template:o},l=k.extend({$module:null})),m=function(){a.computed(function(){var a=o.data();a&&("function"==typeof a[q]&&(a[q].call(a),a=null),o.data(null))}).dispose()},a.computed({read:function(){var f,g=c(h());g&&"object"==typeof g&&(p=g.initializer||p,q=g.disposeMethod||q,o.templateProperty=a.unwrap(g.templateProperty)||o.templateProperty,f=[].concat(c(g.data)),g=c(g.name)),m(),g&&b([e(a.bindingHandlers.module.baseDir)+g],function(a){"function"==typeof a?a=d(a,f):a&&a[p]&&(a=a[p].apply(a,f||[])||a),l.$module=a,o.data(a)})},disposeWhenNodeIsRemoved:g}),a.utils.domNodeDisposal.addDisposeCallback(g,m),{controlsDescendantBindings:!0}},baseDir:"",initializer:"initialize",disposeMethod:"dispose",templateProperty:""},a.virtualElements&&(a.virtualElements.allowedBindings.module=!0),function(a,b){var c=new a.nativeTemplateEngine,d={};c.defaultPath="templates",c.defaultSuffix=".tmpl.html",c.defaultRequireTextPluginName="text",a.templateSources.requireTemplate=function(b){this.key=b,this.template=a.observable(" "),this.requested=!1,this.retrieved=!1},a.templateSources.requireTemplate.prototype.text=function(){return!this.requested&&this.key&&(b([c.defaultRequireTextPluginName+"!"+e(c.defaultPath)+this.key+c.defaultSuffix],function(a){this.retrieved=!0,this.template(a)}.bind(this)),this.requested=!0),this.key||this.template(""),0===arguments.length?this.template():void 0},c.makeTemplateSource=function(b,c){var e;return"string"==typeof b?(e=(c||document).getElementById(b),e&&"script"===e.tagName.toLowerCase()?new a.templateSources.domElement(e):(b in d||(d[b]=new a.templateSources.requireTemplate(b)),d[b])):!b||1!==b.nodeType&&8!==b.nodeType?void 0:new a.templateSources.anonymousTemplate(b)},c.renderTemplate=function(b,d,e,f){var g,h=e&&e.afterRender,i=e&&e.templateProperty&&d.$module&&d.$module[e.templateProperty];return g=!i||"function"!=typeof i&&"string"!=typeof i?c.makeTemplateSource(b,f):{text:function(){return"function"==typeof i?i.call(d.$module):i}},"function"==typeof h&&g instanceof a.templateSources.requireTemplate&&!g.retrieved&&(e.afterRender=function(){g.retrieved&&h.apply(this,arguments)}),c.renderTemplateSource(g,d,e)},a.amdTemplateEngine=c,a.setTemplateEngine(c)}(a,b)}); \ No newline at end of file