From d6bc0052931fb64ae9caccd5571406985286ab73 Mon Sep 17 00:00:00 2001 From: Ryan Niemeyer Date: Sun, 30 Mar 2014 21:31:13 -0500 Subject: [PATCH] bump version to 0.8.0 --- .gitignore | 3 ++- bower.json | 2 +- build/knockout-kendo.js | 5 +---- build/knockout-kendo.min.js | 4 ++-- package.json | 2 +- src/knockout-kendo-core.js | 3 --- 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 3810f8e..9c201e2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ _config.yml _site test node_modules -reports \ No newline at end of file +reports +example \ No newline at end of file diff --git a/bower.json b/bower.json index ed369f3..f7c3f0f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "knockout-kendo", - "version": "0.7.0", + "version": "0.8.0", "main": "build/knockout-kendo.min.js", "dependencies": { "knockout": ">= 2.0" diff --git a/build/knockout-kendo.js b/build/knockout-kendo.js index fe9718a..9a43d04 100644 --- a/build/knockout-kendo.js +++ b/build/knockout-kendo.js @@ -1,5 +1,5 @@ /* - * knockout-kendo 0.7.0 + * knockout-kendo 0.8.0 * Copyright © 2013 Ryan Niemeyer & Telerik * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -257,10 +257,7 @@ ko.kendo.BindingFactory = function() { } //option is observable, determine what to write to it else if (eventConfig.writeTo && ko.isWriteableObservable(options[eventConfig.writeTo])) { - console.log("binding handler for", eventName); - handler = function(e) { - console.log("firing handler for", eventConfig.writeTo); var propOrValue, value; if (!childProp || !e[childProp] || e[childProp] === element) { diff --git a/build/knockout-kendo.min.js b/build/knockout-kendo.min.js index 611644e..e873eaf 100644 --- a/build/knockout-kendo.min.js +++ b/build/knockout-kendo.min.js @@ -1,5 +1,5 @@ /* - * knockout-kendo 0.7.0 + * knockout-kendo 0.8.0 * Copyright © 2013 Ryan Niemeyer & Telerik * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,4 +14,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -!function(a){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?a(require("knockout"),require("jquery"),require("kendo")):"function"==typeof define&&define.amd?define(["knockout","jquery","kendo"],a):a(window.ko,window.jQuery,window.kendo)}(function(a,b,c,d){c=c||window.kendo,a.kendo=a.kendo||{},a.kendo.BindingFactory=function(){var e=this;this.createBinding=function(c){if(b()[c.parent||c.name]){var d={};d.init=function(a,b,f,g,h){var i=e.buildOptions(c,b);return i.async===!0||c.async===!0&&i.async!==!1?(setTimeout(function(){d.setup(a,i,h)},0),void 0):(d.setup(a,i,h),i&&i.useKOTemplates?{controlsDescendantBindings:!0}:void 0)},d.setup=function(d,f,g){var h,i=b(d);e.setupTemplates(c.templates,f,d,g),h=e.getWidget(c,f,i),e.handleEvents(f,c,d,h,g),e.watchValues(h,f,c,d),h.destroy&&a.utils.domNodeDisposal.addDisposeCallback(d,function(){h.destroy()})},d.options={},d.widgetConfig=c,a.bindingHandlers[c.bindingName||c.name]=d}},this.buildOptions=function(b,d){var e=b.defaultOption,f=a.utils.extend({},a.bindingHandlers[b.name].options),g=a.utils.unwrapObservable(d());return g instanceof c.data.DataSource||"object"!=typeof g||null===g||e&&!(e in g)?f[e]=d():a.utils.extend(f,g),f};var f=function(b,c){return function(d){return a.renderTemplate(b,c.createChildContext(d._raw&&d._raw()||d))}};this.setupTemplates=function(b,c,d,e){var g,h,i,j;if(b&&c&&c.useKOTemplates){for(g=0,h=b.length;h>g;g++)i=b[g],c[i]&&(c[i]=f(c[i],e));j=c.dataBound,c.dataBound=function(){a.memoization.unmemoizeDomNodeAndDescendants(d),j&&j.apply(this,arguments)}}},this.unwrapOneLevel=function(b){var d,e={};if(b)if(b instanceof c.data.DataSource)e=b;else if("object"==typeof b)for(d in b)e[d]=a.utils.unwrapObservable(b[d]);return e},this.getWidget=function(b,c,d){var e;if(b.parent){var f=d.closest("[data-bind*='"+b.parent+":']");e=f.length?f.data(b.parent):null}else e=d[b.name](this.unwrapOneLevel(c)).data(b.name);return a.isObservable(c.widget)&&c.widget(e),e},this.watchValues=function(a,b,c,d){var f,g=c.watch;if(g)for(f in g)g.hasOwnProperty(f)&&e.watchOneValue(f,a,b,c,d)},this.watchOneValue=function(c,e,f,g,h){var i=a.computed({read:function(){var i,j,k=g.watch[c],l=a.utils.unwrapObservable(f[c]),m=g.parent?[h]:[];b.isArray(k)?k=e[l?k[0]:k[1]]:"string"==typeof k?k=e[k]:j=!0,k&&f[c]!==d&&(j?m.push(l,f):(i=k.apply(e,m),m.push(l)),(j||i!==l)&&k.apply(e,m))},disposeWhenNodeIsRemoved:h}).extend({throttle:1});a.isObservable(f[c])||i.dispose()},this.handleEvents=function(a,b,c,d,f){var g,h,i=b.events;if(i)for(g in i)i.hasOwnProperty(g)&&(h=i[g],"string"==typeof h&&(h={value:h,writeTo:h}),e.handleOneEvent(g,h,a,c,d,b.childProp,f))},this.handleOneEvent=function(b,c,d,e,f,g,h){var i;c.call&&"function"==typeof d[c.call]?i=d[c.call].bind(h.$data,h.$data):c.writeTo&&a.isWriteableObservable(d[c.writeTo])&&(console.log("binding handler for",b),i=function(a){console.log("firing handler for",c.writeTo);var b,f;g&&a[g]&&a[g]!==e||(b=c.value,f="string"==typeof b&&this[b]?this[b](g&&e):b,d[c.writeTo](f))}),i&&f.bind(b,i)}},a.kendo.bindingFactory=new a.kendo.BindingFactory,a.kendo.setDataSource=function(b,d,e){var f,g;return d instanceof c.data.DataSource?(b.setDataSource(d),void 0):(e&&e.useKOTemplates||(f=a.mapping&&d&&d.__ko_mapping__,g=d&&f?a.mapping.toJS(d):a.toJS(d)),b.dataSource.data(g||d),void 0)},function(){var a=c.data.ObservableArray.fn.wrap;c.data.ObservableArray.fn.wrap=function(b){var c=a.apply(this,arguments);return c._raw=function(){return b},c}}();var e=function(b){return function(c){c&&(a.utils.extend(this.options[b],c),this.redraw(),this.value(.001+this.value()))}},f=a.kendo.bindingFactory.createBinding.bind(a.kendo.bindingFactory),g="clicked",h="close",i="collapse",j="content",k="data",l="enable",m="expand",n="expanded",o="error",p="filter",q="info",r="isOpen",s="max",t="min",u="open",v="palette",w="readonly",x="search",y="selected",z="success",A="size",B="title",C="value",D="values",E="warning";f({name:"kendoAutoComplete",events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,search:[x,h],data:function(b){a.kendo.setDataSource(this,b)},value:C}}),f({name:"kendoButton",defaultOption:g,events:{click:{call:g}},watch:{enabled:l}}),f({name:"kendoCalendar",defaultOption:C,events:{change:C},watch:{max:s,min:t,value:C}}),f({name:"kendoColorPicker",events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,value:C,color:C,palette:v}}),f({name:"kendoComboBox",events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,isOpen:[u,h],data:function(b){a.kendo.setDataSource(this,b)},value:C}}),f({name:"kendoDatePicker",defaultOption:C,events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,max:s,min:t,value:C,isOpen:[u,h]}}),f({name:"kendoDateTimePicker",defaultOption:C,events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,max:s,min:t,value:C,isOpen:[u,h]}}),f({name:"kendoDropDownList",events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,isOpen:[u,h],data:function(b){a.kendo.setDataSource(this,b),b.length&&this.options.optionLabel&&this.select()<0&&this.select(0)},value:C}}),f({name:"kendoEditor",defaultOption:C,events:{change:C},watch:{enabled:l,value:C}}),f({name:"kendoGrid",defaultOption:k,watch:{data:function(b,c){a.kendo.setDataSource(this,b,c)}},templates:["rowTemplate","altRowTemplate"]}),f({name:"kendoListView",defaultOption:k,watch:{data:function(b,c){a.kendo.setDataSource(this,b,c)}},templates:["template"]}),f({name:"kendoMaskedTextBox",defaultOption:C,events:{change:C},watch:{enabled:l,isReadOnly:w,value:C}}),f({name:"kendoMenu",async:!0}),f({name:"kendoMenuItem",parent:"kendoMenu",watch:{enabled:l,isOpen:[u,h]},async:!0}),f({name:"kendoMultiSelect",events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,search:[x,h],data:function(b){a.kendo.setDataSource(this,b)},value:C}});var F=function(a,b){b||0===b?this.show(b,a):this.hide()};f({name:"kendoNotification",watch:{error:function(a){F.call(this,o,a)},info:function(a){F.call(this,q,a)},success:function(a){F.call(this,z,a)},warning:function(a){F.call(this,E,a)}}}),f({name:"kendoNumericTextBox",defaultOption:C,events:{change:C},watch:{enabled:l,value:C,max:function(a){this.options.max=a,this.value()>a&&this.value(a)},min:function(a){this.options.min=a,this.value()g;g++)i=b[g],c[i]&&(c[i]=f(c[i],e));j=c.dataBound,c.dataBound=function(){a.memoization.unmemoizeDomNodeAndDescendants(d),j&&j.apply(this,arguments)}}},this.unwrapOneLevel=function(b){var d,e={};if(b)if(b instanceof c.data.DataSource)e=b;else if("object"==typeof b)for(d in b)e[d]=a.utils.unwrapObservable(b[d]);return e},this.getWidget=function(b,c,d){var e;if(b.parent){var f=d.closest("[data-bind*='"+b.parent+":']");e=f.length?f.data(b.parent):null}else e=d[b.name](this.unwrapOneLevel(c)).data(b.name);return a.isObservable(c.widget)&&c.widget(e),e},this.watchValues=function(a,b,c,d){var f,g=c.watch;if(g)for(f in g)g.hasOwnProperty(f)&&e.watchOneValue(f,a,b,c,d)},this.watchOneValue=function(c,e,f,g,h){var i=a.computed({read:function(){var i,j,k=g.watch[c],l=a.utils.unwrapObservable(f[c]),m=g.parent?[h]:[];b.isArray(k)?k=e[l?k[0]:k[1]]:"string"==typeof k?k=e[k]:j=!0,k&&f[c]!==d&&(j?m.push(l,f):(i=k.apply(e,m),m.push(l)),(j||i!==l)&&k.apply(e,m))},disposeWhenNodeIsRemoved:h}).extend({throttle:1});a.isObservable(f[c])||i.dispose()},this.handleEvents=function(a,b,c,d,f){var g,h,i=b.events;if(i)for(g in i)i.hasOwnProperty(g)&&(h=i[g],"string"==typeof h&&(h={value:h,writeTo:h}),e.handleOneEvent(g,h,a,c,d,b.childProp,f))},this.handleOneEvent=function(b,c,d,e,f,g,h){var i;c.call&&"function"==typeof d[c.call]?i=d[c.call].bind(h.$data,h.$data):c.writeTo&&a.isWriteableObservable(d[c.writeTo])&&(i=function(a){var b,f;g&&a[g]&&a[g]!==e||(b=c.value,f="string"==typeof b&&this[b]?this[b](g&&e):b,d[c.writeTo](f))}),i&&f.bind(b,i)}},a.kendo.bindingFactory=new a.kendo.BindingFactory,a.kendo.setDataSource=function(b,d,e){var f,g;return d instanceof c.data.DataSource?(b.setDataSource(d),void 0):(e&&e.useKOTemplates||(f=a.mapping&&d&&d.__ko_mapping__,g=d&&f?a.mapping.toJS(d):a.toJS(d)),b.dataSource.data(g||d),void 0)},function(){var a=c.data.ObservableArray.fn.wrap;c.data.ObservableArray.fn.wrap=function(b){var c=a.apply(this,arguments);return c._raw=function(){return b},c}}();var e=function(b){return function(c){c&&(a.utils.extend(this.options[b],c),this.redraw(),this.value(.001+this.value()))}},f=a.kendo.bindingFactory.createBinding.bind(a.kendo.bindingFactory),g="clicked",h="close",i="collapse",j="content",k="data",l="enable",m="expand",n="expanded",o="error",p="filter",q="info",r="isOpen",s="max",t="min",u="open",v="palette",w="readonly",x="search",y="selected",z="success",A="size",B="title",C="value",D="values",E="warning";f({name:"kendoAutoComplete",events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,search:[x,h],data:function(b){a.kendo.setDataSource(this,b)},value:C}}),f({name:"kendoButton",defaultOption:g,events:{click:{call:g}},watch:{enabled:l}}),f({name:"kendoCalendar",defaultOption:C,events:{change:C},watch:{max:s,min:t,value:C}}),f({name:"kendoColorPicker",events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,value:C,color:C,palette:v}}),f({name:"kendoComboBox",events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,isOpen:[u,h],data:function(b){a.kendo.setDataSource(this,b)},value:C}}),f({name:"kendoDatePicker",defaultOption:C,events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,max:s,min:t,value:C,isOpen:[u,h]}}),f({name:"kendoDateTimePicker",defaultOption:C,events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,max:s,min:t,value:C,isOpen:[u,h]}}),f({name:"kendoDropDownList",events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,isOpen:[u,h],data:function(b){a.kendo.setDataSource(this,b),b.length&&this.options.optionLabel&&this.select()<0&&this.select(0)},value:C}}),f({name:"kendoEditor",defaultOption:C,events:{change:C},watch:{enabled:l,value:C}}),f({name:"kendoGrid",defaultOption:k,watch:{data:function(b,c){a.kendo.setDataSource(this,b,c)}},templates:["rowTemplate","altRowTemplate"]}),f({name:"kendoListView",defaultOption:k,watch:{data:function(b,c){a.kendo.setDataSource(this,b,c)}},templates:["template"]}),f({name:"kendoMaskedTextBox",defaultOption:C,events:{change:C},watch:{enabled:l,isReadOnly:w,value:C}}),f({name:"kendoMenu",async:!0}),f({name:"kendoMenuItem",parent:"kendoMenu",watch:{enabled:l,isOpen:[u,h]},async:!0}),f({name:"kendoMultiSelect",events:{change:C,open:{writeTo:r,value:!0},close:{writeTo:r,value:!1}},watch:{enabled:l,search:[x,h],data:function(b){a.kendo.setDataSource(this,b)},value:C}});var F=function(a,b){b||0===b?this.show(b,a):this.hide()};f({name:"kendoNotification",watch:{error:function(a){F.call(this,o,a)},info:function(a){F.call(this,q,a)},success:function(a){F.call(this,z,a)},warning:function(a){F.call(this,E,a)}}}),f({name:"kendoNumericTextBox",defaultOption:C,events:{change:C},watch:{enabled:l,value:C,max:function(a){this.options.max=a,this.value()>a&&this.value(a)},min:function(a){this.options.min=a,this.value()