Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Release 0.1.6

  • Loading branch information...
commit 92c3024357c74e55c040042af2f480c5c97c3dcb 1 parent 149d166
@kmalakoff authored
View
6 README.md
@@ -4,10 +4,10 @@
Knockback-Inspector.js provides an inspector tree view library for Backbone.Models and Backbone.Collections using Knockback.js,
-#Download Latest (0.1.5):
+#Download Latest (0.1.6):
-* [Development version](https://raw.github.com/kmalakoff/knockback-inspector/0.1.5/knockback-inspector.js)
-* [Production version](https://raw.github.com/kmalakoff/knockback-inspector/0.1.5/knockback-inspector.min.js)
+* [Development version](https://raw.github.com/kmalakoff/knockback-inspector/0.1.6/knockback-inspector.js)
+* [Production version](https://raw.github.com/kmalakoff/knockback-inspector/0.1.6/knockback-inspector.min.js)
* [Styling](http://cloud.github.com/downloads/kmalakoff/knockback-inspector/knockback-inspector.css)
Please see the [release notes](https://github.com/kmalakoff/knockback-inspector/blob/master/RELEASE_NOTES.md) for upgrade pointers.
View
5 RELEASE_NOTES.md
@@ -1,5 +1,6 @@
Please refer to the following release notes when upgrading your version of Knockback-Inspector.js.
-## 0.1.5
+## 0.1.6
-* added AMD loader.
+* added AMD loader.
+* added support for embedded arrays
View
24 knockback-inspector.js
@@ -1,5 +1,5 @@
/*
- knockback-inspector.js 0.1.5
+ knockback-inspector.js 0.1.6
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
@@ -16,7 +16,7 @@
}
})(function() {// Generated by CoffeeScript 1.3.3
/*
-knockback-inspector.js 0.1.5
+knockback-inspector.js 0.1.6
(c) 2012 Kevin Malakoff.
Knockback-Inspector.js is freely distributable under the MIT license.
See the following for full license details:
@@ -48,7 +48,7 @@ kb = !this.kb && (typeof require !== 'undefined') ? require('knockback') : this.
kbi = this.kbi = typeof exports !== 'undefined' ? exports : {};
-this.kbi.VERSION = '0.1.5';
+this.kbi.VERSION = '0.1.6';
kbi.TemplateSource = (function() {
@@ -182,10 +182,12 @@ kbi.NodeViewModel = (function() {
model = kb.utils.wrappedModel(this.node);
this.attribute_names = ko.observableArray(model ? _.keys(model.attributes) : []);
} else if ((typeof node_value.get === 'function') && (typeof node_value.trigger === 'function')) {
- this.node = kb.viewModel(node_value);
- this.attribute_names = ko.observableArray(_.keys(node_value.attributes));
- } else if (node_value.models) {
- this.node = kb.collectionObservable(node_value);
+ if (node_value.models) {
+ this.node = kb.collectionObservable(node_value);
+ } else {
+ this.node = kb.viewModel(node_value);
+ this.attribute_names = ko.observableArray(_.keys(node_value.attributes));
+ }
}
return;
}
@@ -213,7 +215,7 @@ kbi.ArrayNodeViewGenerator = (function() {
};
ArrayNodeViewGenerator.prototype.nodeManipulator = function() {
- return "<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>";
+ return "<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name + '[]'\"></span>\n</div>";
};
ArrayNodeViewGenerator.prototype.attributeEditor = function() {
@@ -221,15 +223,15 @@ kbi.ArrayNodeViewGenerator = (function() {
};
ArrayNodeViewGenerator.prototype.arrayTree = function() {
- return "" + (kbi.ViewHTML.arrayTree("'['+$index()+'] (array)'", false, "$data"));
+ return "" + (kbi.ViewHTML.arrayTree("'['+$index()+']'", false, "$data"));
};
ArrayNodeViewGenerator.prototype.modelTree = function() {
- return "" + (kbi.ViewHTML.modelTree("'['+$index()+'] (model)'", false, "$data"));
+ return "" + (kbi.ViewHTML.modelTree("'['+$index()+']'", false, "$data"));
};
ArrayNodeViewGenerator.prototype.collectionTree = function() {
- return "" + (kbi.ViewHTML.collectionTree("'['+$index()+'] (collection)'", false, "$data"));
+ return "" + (kbi.ViewHTML.collectionTree("'['+$index()+']'", false, "$data"));
};
ArrayNodeViewGenerator.prototype.nodeEnd = function() {
View
4 knockback-inspector.min.js
@@ -1,6 +1,6 @@
/*
- knockback-inspector.js 0.1.5
+ knockback-inspector.js 0.1.6
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
-*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-inspector",["underscore","backbone","knockout","knockback"],e):e.call(this)}(function(){var e,t,n,r,i,s={}.hasOwnProperty,o=function(e,t){function r(){this.constructor=e}for(var n in t)s.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};if(!this._&&typeof require!="undefined")try{i=require("lodash")}catch(u){i=require("underscore")}else i=this._;return i=i.hasOwnProperty("_")?i._:i,e=!this.Backbone&&typeof require!="undefined"?require("backbone"):this.Backbone,r=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko,t=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb,n=this.kbi=typeof exports!="undefined"?exports:{},this.kbi.VERSION="0.1.5",n.TemplateSource=function(){function e(e,t){this.template_generator=e,this.binding_context=t!=null?t:{}}return e.prototype.data=function(e,t){return arguments.length===1?this.binding_context[e]:this.binding_context[e]=t},e.prototype.text=function(){if(arguments.length>0)throw"kbi.TemplateSource: unexpected writing to template source";return this.template_generator.viewText(this.binding_context)},e}(),n.TemplateEngine=function(e){function t(){this.allowTemplateRewriting=!1,this.generators={kbi_array_node:n.ArrayNodeViewGenerator,kbi_model_node:n.ModelNodeViewGenerator,kbi_collection_node:n.CollectionNodeViewGenerator}}return o(t,e),t.prototype.generator=function(e,t){return arguments.length===1?this.generators[e]:this.generators[e]=t},t.prototype.makeTemplateSource=function(e){return this.generators.hasOwnProperty(e)?new n.TemplateSource(new this.generators[e](e)):t.__super__.makeTemplateSource.apply(this,arguments)},t.prototype.renderTemplateSource=function(e,n,r){var i,s;for(i in n)s=n[i],e.data(i,s);return t.__super__.renderTemplateSource.apply(this,arguments)},t}(r.nativeTemplateEngine),n.FetchedModel=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.parse=function(e){var t,r,s,o,u;t={};for(s in e)u=e[s],i.isObject(u)?(o=new n.FetchedModel,t[s]=o.set(o.parse(u))):i.isArray(u)?(r=new n.FetchedCollection,t[s]=r.reset(r.parse(u))):t[s]=u;return t},t}(e.Model),n.FetchedCollection=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.model=n.FetchedModel,t.prototype.parse=function(e){var t;return t=e.results?e.results:e,i.map(e.results,function(e){var t;return t=new n.FetchedModel,t.set(t.parse(e))})},t}(e.Collection),n.NodeViewModel=function(){function e(e,n,s){var o,u;this.name=e,this.node=s,this.opened=r.observable(n),u=r.utils.unwrapObservable(this.node),u instanceof t.ViewModel?(this.node=u,o=t.utils.wrappedModel(this.node),this.attribute_names=r.observableArray(o?i.keys(o.attributes):[])):typeof u.get=="function"&&typeof u.trigger=="function"?(this.node=t.viewModel(u),this.attribute_names=r.observableArray(i.keys(u.attributes))):u.models&&(this.node=t.collectionObservable(u));return}return e}(),n.nodeViewModel=n.nvm=function(e,t,r){return new n.NodeViewModel(e,t,r)},n.ArrayNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: '['+$index()+']'\"></label>\n <input type='text' data-bind=\"value: $data, valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("'['+$index()+'] (array)'",!1,"$data")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("'['+$index()+'] (model)'",!1,"$data")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("'['+$index()+'] (collection)'",!1,"$data")},e.prototype.nodeEnd=function(){return""},e}(),n.CollectionNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n "+this.modelNode()+"\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.modelNode=function(){return""+n.ViewHTML.modelTree("'['+$index()+']'",!1,"$data")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ModelNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: attribute_names -->\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: $data\"></label>\n <input type='text' data-bind=\"value: $parent.node[$data], valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("$data",!1,"$parent.node[$data]")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("$data",!1,"$parent.node[$data]")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("$data+'[]'",!0,"$parent.node[$data]")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ViewHTML=function(){function e(){}return e.arrayTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_array_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.modelTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_model_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.collectionTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_collection_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e}(),n})}).call(this);
+*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-inspector",["underscore","backbone","knockout","knockback"],e):e.call(this)}(function(){var e,t,n,r,i,s={}.hasOwnProperty,o=function(e,t){function r(){this.constructor=e}for(var n in t)s.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};if(!this._&&typeof require!="undefined")try{i=require("lodash")}catch(u){i=require("underscore")}else i=this._;return i=i.hasOwnProperty("_")?i._:i,e=!this.Backbone&&typeof require!="undefined"?require("backbone"):this.Backbone,r=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko,t=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb,n=this.kbi=typeof exports!="undefined"?exports:{},this.kbi.VERSION="0.1.6",n.TemplateSource=function(){function e(e,t){this.template_generator=e,this.binding_context=t!=null?t:{}}return e.prototype.data=function(e,t){return arguments.length===1?this.binding_context[e]:this.binding_context[e]=t},e.prototype.text=function(){if(arguments.length>0)throw"kbi.TemplateSource: unexpected writing to template source";return this.template_generator.viewText(this.binding_context)},e}(),n.TemplateEngine=function(e){function t(){this.allowTemplateRewriting=!1,this.generators={kbi_array_node:n.ArrayNodeViewGenerator,kbi_model_node:n.ModelNodeViewGenerator,kbi_collection_node:n.CollectionNodeViewGenerator}}return o(t,e),t.prototype.generator=function(e,t){return arguments.length===1?this.generators[e]:this.generators[e]=t},t.prototype.makeTemplateSource=function(e){return this.generators.hasOwnProperty(e)?new n.TemplateSource(new this.generators[e](e)):t.__super__.makeTemplateSource.apply(this,arguments)},t.prototype.renderTemplateSource=function(e,n,r){var i,s;for(i in n)s=n[i],e.data(i,s);return t.__super__.renderTemplateSource.apply(this,arguments)},t}(r.nativeTemplateEngine),n.FetchedModel=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.parse=function(e){var t,r,s,o,u;t={};for(s in e)u=e[s],i.isObject(u)?(o=new n.FetchedModel,t[s]=o.set(o.parse(u))):i.isArray(u)?(r=new n.FetchedCollection,t[s]=r.reset(r.parse(u))):t[s]=u;return t},t}(e.Model),n.FetchedCollection=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.model=n.FetchedModel,t.prototype.parse=function(e){var t;return t=e.results?e.results:e,i.map(e.results,function(e){var t;return t=new n.FetchedModel,t.set(t.parse(e))})},t}(e.Collection),n.NodeViewModel=function(){function e(e,n,s){var o,u;this.name=e,this.node=s,this.opened=r.observable(n),u=r.utils.unwrapObservable(this.node),u instanceof t.ViewModel?(this.node=u,o=t.utils.wrappedModel(this.node),this.attribute_names=r.observableArray(o?i.keys(o.attributes):[])):typeof u.get=="function"&&typeof u.trigger=="function"&&(u.models?this.node=t.collectionObservable(u):(this.node=t.viewModel(u),this.attribute_names=r.observableArray(i.keys(u.attributes))));return}return e}(),n.nodeViewModel=n.nvm=function(e,t,r){return new n.NodeViewModel(e,t,r)},n.ArrayNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name + '[]'\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: '['+$index()+']'\"></label>\n <input type='text' data-bind=\"value: $data, valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("'['+$index()+']'",!1,"$data")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("'['+$index()+']'",!1,"$data")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("'['+$index()+']'",!1,"$data")},e.prototype.nodeEnd=function(){return""},e}(),n.CollectionNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n "+this.modelNode()+"\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.modelNode=function(){return""+n.ViewHTML.modelTree("'['+$index()+']'",!1,"$data")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ModelNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: attribute_names -->\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: $data\"></label>\n <input type='text' data-bind=\"value: $parent.node[$data], valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("$data",!1,"$parent.node[$data]")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("$data",!1,"$parent.node[$data]")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("$data+'[]'",!0,"$parent.node[$data]")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ViewHTML=function(){function e(){}return e.arrayTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_array_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.modelTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_model_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.collectionTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_collection_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e}(),n})}).call(this);
View
2  package.json
@@ -32,5 +32,5 @@
},
"main" : "knockback-inspector.js",
- "version" : "0.1.5"
+ "version" : "0.1.6"
}
View
6 packages/npm/README.md
@@ -4,10 +4,10 @@
Knockback-Inspector.js provides an inspector tree view library for Backbone.Models and Backbone.Collections using Knockback.js,
-#Download Latest (0.1.5):
+#Download Latest (0.1.6):
-* [Development version](https://raw.github.com/kmalakoff/knockback-inspector/0.1.5/knockback-inspector.js)
-* [Production version](https://raw.github.com/kmalakoff/knockback-inspector/0.1.5/knockback-inspector.min.js)
+* [Development version](https://raw.github.com/kmalakoff/knockback-inspector/0.1.6/knockback-inspector.js)
+* [Production version](https://raw.github.com/kmalakoff/knockback-inspector/0.1.6/knockback-inspector.min.js)
* [Styling](http://cloud.github.com/downloads/kmalakoff/knockback-inspector/knockback-inspector.css)
Please see the [release notes](https://github.com/kmalakoff/knockback-inspector/blob/master/RELEASE_NOTES.md) for upgrade pointers.
View
24 packages/npm/knockback-inspector.js
@@ -1,5 +1,5 @@
/*
- knockback-inspector.js 0.1.5
+ knockback-inspector.js 0.1.6
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
@@ -16,7 +16,7 @@
}
})(function() {// Generated by CoffeeScript 1.3.3
/*
-knockback-inspector.js 0.1.5
+knockback-inspector.js 0.1.6
(c) 2012 Kevin Malakoff.
Knockback-Inspector.js is freely distributable under the MIT license.
See the following for full license details:
@@ -48,7 +48,7 @@ kb = !this.kb && (typeof require !== 'undefined') ? require('knockback') : this.
kbi = this.kbi = typeof exports !== 'undefined' ? exports : {};
-this.kbi.VERSION = '0.1.5';
+this.kbi.VERSION = '0.1.6';
kbi.TemplateSource = (function() {
@@ -182,10 +182,12 @@ kbi.NodeViewModel = (function() {
model = kb.utils.wrappedModel(this.node);
this.attribute_names = ko.observableArray(model ? _.keys(model.attributes) : []);
} else if ((typeof node_value.get === 'function') && (typeof node_value.trigger === 'function')) {
- this.node = kb.viewModel(node_value);
- this.attribute_names = ko.observableArray(_.keys(node_value.attributes));
- } else if (node_value.models) {
- this.node = kb.collectionObservable(node_value);
+ if (node_value.models) {
+ this.node = kb.collectionObservable(node_value);
+ } else {
+ this.node = kb.viewModel(node_value);
+ this.attribute_names = ko.observableArray(_.keys(node_value.attributes));
+ }
}
return;
}
@@ -213,7 +215,7 @@ kbi.ArrayNodeViewGenerator = (function() {
};
ArrayNodeViewGenerator.prototype.nodeManipulator = function() {
- return "<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>";
+ return "<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name + '[]'\"></span>\n</div>";
};
ArrayNodeViewGenerator.prototype.attributeEditor = function() {
@@ -221,15 +223,15 @@ kbi.ArrayNodeViewGenerator = (function() {
};
ArrayNodeViewGenerator.prototype.arrayTree = function() {
- return "" + (kbi.ViewHTML.arrayTree("'['+$index()+'] (array)'", false, "$data"));
+ return "" + (kbi.ViewHTML.arrayTree("'['+$index()+']'", false, "$data"));
};
ArrayNodeViewGenerator.prototype.modelTree = function() {
- return "" + (kbi.ViewHTML.modelTree("'['+$index()+'] (model)'", false, "$data"));
+ return "" + (kbi.ViewHTML.modelTree("'['+$index()+']'", false, "$data"));
};
ArrayNodeViewGenerator.prototype.collectionTree = function() {
- return "" + (kbi.ViewHTML.collectionTree("'['+$index()+'] (collection)'", false, "$data"));
+ return "" + (kbi.ViewHTML.collectionTree("'['+$index()+']'", false, "$data"));
};
ArrayNodeViewGenerator.prototype.nodeEnd = function() {
View
4 packages/npm/knockback-inspector.min.js
@@ -1,6 +1,6 @@
/*
- knockback-inspector.js 0.1.5
+ knockback-inspector.js 0.1.6
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
-*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-inspector",["underscore","backbone","knockout","knockback"],e):e.call(this)}(function(){var e,t,n,r,i,s={}.hasOwnProperty,o=function(e,t){function r(){this.constructor=e}for(var n in t)s.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};if(!this._&&typeof require!="undefined")try{i=require("lodash")}catch(u){i=require("underscore")}else i=this._;return i=i.hasOwnProperty("_")?i._:i,e=!this.Backbone&&typeof require!="undefined"?require("backbone"):this.Backbone,r=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko,t=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb,n=this.kbi=typeof exports!="undefined"?exports:{},this.kbi.VERSION="0.1.5",n.TemplateSource=function(){function e(e,t){this.template_generator=e,this.binding_context=t!=null?t:{}}return e.prototype.data=function(e,t){return arguments.length===1?this.binding_context[e]:this.binding_context[e]=t},e.prototype.text=function(){if(arguments.length>0)throw"kbi.TemplateSource: unexpected writing to template source";return this.template_generator.viewText(this.binding_context)},e}(),n.TemplateEngine=function(e){function t(){this.allowTemplateRewriting=!1,this.generators={kbi_array_node:n.ArrayNodeViewGenerator,kbi_model_node:n.ModelNodeViewGenerator,kbi_collection_node:n.CollectionNodeViewGenerator}}return o(t,e),t.prototype.generator=function(e,t){return arguments.length===1?this.generators[e]:this.generators[e]=t},t.prototype.makeTemplateSource=function(e){return this.generators.hasOwnProperty(e)?new n.TemplateSource(new this.generators[e](e)):t.__super__.makeTemplateSource.apply(this,arguments)},t.prototype.renderTemplateSource=function(e,n,r){var i,s;for(i in n)s=n[i],e.data(i,s);return t.__super__.renderTemplateSource.apply(this,arguments)},t}(r.nativeTemplateEngine),n.FetchedModel=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.parse=function(e){var t,r,s,o,u;t={};for(s in e)u=e[s],i.isObject(u)?(o=new n.FetchedModel,t[s]=o.set(o.parse(u))):i.isArray(u)?(r=new n.FetchedCollection,t[s]=r.reset(r.parse(u))):t[s]=u;return t},t}(e.Model),n.FetchedCollection=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.model=n.FetchedModel,t.prototype.parse=function(e){var t;return t=e.results?e.results:e,i.map(e.results,function(e){var t;return t=new n.FetchedModel,t.set(t.parse(e))})},t}(e.Collection),n.NodeViewModel=function(){function e(e,n,s){var o,u;this.name=e,this.node=s,this.opened=r.observable(n),u=r.utils.unwrapObservable(this.node),u instanceof t.ViewModel?(this.node=u,o=t.utils.wrappedModel(this.node),this.attribute_names=r.observableArray(o?i.keys(o.attributes):[])):typeof u.get=="function"&&typeof u.trigger=="function"?(this.node=t.viewModel(u),this.attribute_names=r.observableArray(i.keys(u.attributes))):u.models&&(this.node=t.collectionObservable(u));return}return e}(),n.nodeViewModel=n.nvm=function(e,t,r){return new n.NodeViewModel(e,t,r)},n.ArrayNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: '['+$index()+']'\"></label>\n <input type='text' data-bind=\"value: $data, valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("'['+$index()+'] (array)'",!1,"$data")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("'['+$index()+'] (model)'",!1,"$data")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("'['+$index()+'] (collection)'",!1,"$data")},e.prototype.nodeEnd=function(){return""},e}(),n.CollectionNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n "+this.modelNode()+"\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.modelNode=function(){return""+n.ViewHTML.modelTree("'['+$index()+']'",!1,"$data")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ModelNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: attribute_names -->\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: $data\"></label>\n <input type='text' data-bind=\"value: $parent.node[$data], valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("$data",!1,"$parent.node[$data]")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("$data",!1,"$parent.node[$data]")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("$data+'[]'",!0,"$parent.node[$data]")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ViewHTML=function(){function e(){}return e.arrayTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_array_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.modelTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_model_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.collectionTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_collection_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e}(),n})}).call(this);
+*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-inspector",["underscore","backbone","knockout","knockback"],e):e.call(this)}(function(){var e,t,n,r,i,s={}.hasOwnProperty,o=function(e,t){function r(){this.constructor=e}for(var n in t)s.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};if(!this._&&typeof require!="undefined")try{i=require("lodash")}catch(u){i=require("underscore")}else i=this._;return i=i.hasOwnProperty("_")?i._:i,e=!this.Backbone&&typeof require!="undefined"?require("backbone"):this.Backbone,r=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko,t=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb,n=this.kbi=typeof exports!="undefined"?exports:{},this.kbi.VERSION="0.1.6",n.TemplateSource=function(){function e(e,t){this.template_generator=e,this.binding_context=t!=null?t:{}}return e.prototype.data=function(e,t){return arguments.length===1?this.binding_context[e]:this.binding_context[e]=t},e.prototype.text=function(){if(arguments.length>0)throw"kbi.TemplateSource: unexpected writing to template source";return this.template_generator.viewText(this.binding_context)},e}(),n.TemplateEngine=function(e){function t(){this.allowTemplateRewriting=!1,this.generators={kbi_array_node:n.ArrayNodeViewGenerator,kbi_model_node:n.ModelNodeViewGenerator,kbi_collection_node:n.CollectionNodeViewGenerator}}return o(t,e),t.prototype.generator=function(e,t){return arguments.length===1?this.generators[e]:this.generators[e]=t},t.prototype.makeTemplateSource=function(e){return this.generators.hasOwnProperty(e)?new n.TemplateSource(new this.generators[e](e)):t.__super__.makeTemplateSource.apply(this,arguments)},t.prototype.renderTemplateSource=function(e,n,r){var i,s;for(i in n)s=n[i],e.data(i,s);return t.__super__.renderTemplateSource.apply(this,arguments)},t}(r.nativeTemplateEngine),n.FetchedModel=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.parse=function(e){var t,r,s,o,u;t={};for(s in e)u=e[s],i.isObject(u)?(o=new n.FetchedModel,t[s]=o.set(o.parse(u))):i.isArray(u)?(r=new n.FetchedCollection,t[s]=r.reset(r.parse(u))):t[s]=u;return t},t}(e.Model),n.FetchedCollection=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.model=n.FetchedModel,t.prototype.parse=function(e){var t;return t=e.results?e.results:e,i.map(e.results,function(e){var t;return t=new n.FetchedModel,t.set(t.parse(e))})},t}(e.Collection),n.NodeViewModel=function(){function e(e,n,s){var o,u;this.name=e,this.node=s,this.opened=r.observable(n),u=r.utils.unwrapObservable(this.node),u instanceof t.ViewModel?(this.node=u,o=t.utils.wrappedModel(this.node),this.attribute_names=r.observableArray(o?i.keys(o.attributes):[])):typeof u.get=="function"&&typeof u.trigger=="function"&&(u.models?this.node=t.collectionObservable(u):(this.node=t.viewModel(u),this.attribute_names=r.observableArray(i.keys(u.attributes))));return}return e}(),n.nodeViewModel=n.nvm=function(e,t,r){return new n.NodeViewModel(e,t,r)},n.ArrayNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name + '[]'\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: '['+$index()+']'\"></label>\n <input type='text' data-bind=\"value: $data, valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("'['+$index()+']'",!1,"$data")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("'['+$index()+']'",!1,"$data")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("'['+$index()+']'",!1,"$data")},e.prototype.nodeEnd=function(){return""},e}(),n.CollectionNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n "+this.modelNode()+"\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.modelNode=function(){return""+n.ViewHTML.modelTree("'['+$index()+']'",!1,"$data")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ModelNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: attribute_names -->\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: $data\"></label>\n <input type='text' data-bind=\"value: $parent.node[$data], valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("$data",!1,"$parent.node[$data]")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("$data",!1,"$parent.node[$data]")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("$data+'[]'",!0,"$parent.node[$data]")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ViewHTML=function(){function e(){}return e.arrayTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_array_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.modelTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_model_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.collectionTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_collection_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e}(),n})}).call(this);
View
2  packages/npm/package.json
@@ -18,5 +18,5 @@
},
"main" : "knockback-inspector.js",
- "version" : "0.1.5"
+ "version" : "0.1.6"
}
View
24 packages/nuget/Content/Scripts/knockback-inspector.js
@@ -1,5 +1,5 @@
/*
- knockback-inspector.js 0.1.5
+ knockback-inspector.js 0.1.6
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
@@ -16,7 +16,7 @@
}
})(function() {// Generated by CoffeeScript 1.3.3
/*
-knockback-inspector.js 0.1.5
+knockback-inspector.js 0.1.6
(c) 2012 Kevin Malakoff.
Knockback-Inspector.js is freely distributable under the MIT license.
See the following for full license details:
@@ -48,7 +48,7 @@ kb = !this.kb && (typeof require !== 'undefined') ? require('knockback') : this.
kbi = this.kbi = typeof exports !== 'undefined' ? exports : {};
-this.kbi.VERSION = '0.1.5';
+this.kbi.VERSION = '0.1.6';
kbi.TemplateSource = (function() {
@@ -182,10 +182,12 @@ kbi.NodeViewModel = (function() {
model = kb.utils.wrappedModel(this.node);
this.attribute_names = ko.observableArray(model ? _.keys(model.attributes) : []);
} else if ((typeof node_value.get === 'function') && (typeof node_value.trigger === 'function')) {
- this.node = kb.viewModel(node_value);
- this.attribute_names = ko.observableArray(_.keys(node_value.attributes));
- } else if (node_value.models) {
- this.node = kb.collectionObservable(node_value);
+ if (node_value.models) {
+ this.node = kb.collectionObservable(node_value);
+ } else {
+ this.node = kb.viewModel(node_value);
+ this.attribute_names = ko.observableArray(_.keys(node_value.attributes));
+ }
}
return;
}
@@ -213,7 +215,7 @@ kbi.ArrayNodeViewGenerator = (function() {
};
ArrayNodeViewGenerator.prototype.nodeManipulator = function() {
- return "<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>";
+ return "<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name + '[]'\"></span>\n</div>";
};
ArrayNodeViewGenerator.prototype.attributeEditor = function() {
@@ -221,15 +223,15 @@ kbi.ArrayNodeViewGenerator = (function() {
};
ArrayNodeViewGenerator.prototype.arrayTree = function() {
- return "" + (kbi.ViewHTML.arrayTree("'['+$index()+'] (array)'", false, "$data"));
+ return "" + (kbi.ViewHTML.arrayTree("'['+$index()+']'", false, "$data"));
};
ArrayNodeViewGenerator.prototype.modelTree = function() {
- return "" + (kbi.ViewHTML.modelTree("'['+$index()+'] (model)'", false, "$data"));
+ return "" + (kbi.ViewHTML.modelTree("'['+$index()+']'", false, "$data"));
};
ArrayNodeViewGenerator.prototype.collectionTree = function() {
- return "" + (kbi.ViewHTML.collectionTree("'['+$index()+'] (collection)'", false, "$data"));
+ return "" + (kbi.ViewHTML.collectionTree("'['+$index()+']'", false, "$data"));
};
ArrayNodeViewGenerator.prototype.nodeEnd = function() {
View
4 packages/nuget/Content/Scripts/knockback-inspector.min.js
@@ -1,6 +1,6 @@
/*
- knockback-inspector.js 0.1.5
+ knockback-inspector.js 0.1.6
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
-*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-inspector",["underscore","backbone","knockout","knockback"],e):e.call(this)}(function(){var e,t,n,r,i,s={}.hasOwnProperty,o=function(e,t){function r(){this.constructor=e}for(var n in t)s.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};if(!this._&&typeof require!="undefined")try{i=require("lodash")}catch(u){i=require("underscore")}else i=this._;return i=i.hasOwnProperty("_")?i._:i,e=!this.Backbone&&typeof require!="undefined"?require("backbone"):this.Backbone,r=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko,t=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb,n=this.kbi=typeof exports!="undefined"?exports:{},this.kbi.VERSION="0.1.5",n.TemplateSource=function(){function e(e,t){this.template_generator=e,this.binding_context=t!=null?t:{}}return e.prototype.data=function(e,t){return arguments.length===1?this.binding_context[e]:this.binding_context[e]=t},e.prototype.text=function(){if(arguments.length>0)throw"kbi.TemplateSource: unexpected writing to template source";return this.template_generator.viewText(this.binding_context)},e}(),n.TemplateEngine=function(e){function t(){this.allowTemplateRewriting=!1,this.generators={kbi_array_node:n.ArrayNodeViewGenerator,kbi_model_node:n.ModelNodeViewGenerator,kbi_collection_node:n.CollectionNodeViewGenerator}}return o(t,e),t.prototype.generator=function(e,t){return arguments.length===1?this.generators[e]:this.generators[e]=t},t.prototype.makeTemplateSource=function(e){return this.generators.hasOwnProperty(e)?new n.TemplateSource(new this.generators[e](e)):t.__super__.makeTemplateSource.apply(this,arguments)},t.prototype.renderTemplateSource=function(e,n,r){var i,s;for(i in n)s=n[i],e.data(i,s);return t.__super__.renderTemplateSource.apply(this,arguments)},t}(r.nativeTemplateEngine),n.FetchedModel=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.parse=function(e){var t,r,s,o,u;t={};for(s in e)u=e[s],i.isObject(u)?(o=new n.FetchedModel,t[s]=o.set(o.parse(u))):i.isArray(u)?(r=new n.FetchedCollection,t[s]=r.reset(r.parse(u))):t[s]=u;return t},t}(e.Model),n.FetchedCollection=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.model=n.FetchedModel,t.prototype.parse=function(e){var t;return t=e.results?e.results:e,i.map(e.results,function(e){var t;return t=new n.FetchedModel,t.set(t.parse(e))})},t}(e.Collection),n.NodeViewModel=function(){function e(e,n,s){var o,u;this.name=e,this.node=s,this.opened=r.observable(n),u=r.utils.unwrapObservable(this.node),u instanceof t.ViewModel?(this.node=u,o=t.utils.wrappedModel(this.node),this.attribute_names=r.observableArray(o?i.keys(o.attributes):[])):typeof u.get=="function"&&typeof u.trigger=="function"?(this.node=t.viewModel(u),this.attribute_names=r.observableArray(i.keys(u.attributes))):u.models&&(this.node=t.collectionObservable(u));return}return e}(),n.nodeViewModel=n.nvm=function(e,t,r){return new n.NodeViewModel(e,t,r)},n.ArrayNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: '['+$index()+']'\"></label>\n <input type='text' data-bind=\"value: $data, valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("'['+$index()+'] (array)'",!1,"$data")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("'['+$index()+'] (model)'",!1,"$data")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("'['+$index()+'] (collection)'",!1,"$data")},e.prototype.nodeEnd=function(){return""},e}(),n.CollectionNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n "+this.modelNode()+"\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.modelNode=function(){return""+n.ViewHTML.modelTree("'['+$index()+']'",!1,"$data")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ModelNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: attribute_names -->\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: $data\"></label>\n <input type='text' data-bind=\"value: $parent.node[$data], valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("$data",!1,"$parent.node[$data]")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("$data",!1,"$parent.node[$data]")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("$data+'[]'",!0,"$parent.node[$data]")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ViewHTML=function(){function e(){}return e.arrayTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_array_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.modelTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_model_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.collectionTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_collection_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e}(),n})}).call(this);
+*/(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback-inspector",["underscore","backbone","knockout","knockback"],e):e.call(this)}(function(){var e,t,n,r,i,s={}.hasOwnProperty,o=function(e,t){function r(){this.constructor=e}for(var n in t)s.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};if(!this._&&typeof require!="undefined")try{i=require("lodash")}catch(u){i=require("underscore")}else i=this._;return i=i.hasOwnProperty("_")?i._:i,e=!this.Backbone&&typeof require!="undefined"?require("backbone"):this.Backbone,r=!this.ko&&typeof require!="undefined"?require("knockout"):this.ko,t=!this.kb&&typeof require!="undefined"?require("knockback"):this.kb,n=this.kbi=typeof exports!="undefined"?exports:{},this.kbi.VERSION="0.1.6",n.TemplateSource=function(){function e(e,t){this.template_generator=e,this.binding_context=t!=null?t:{}}return e.prototype.data=function(e,t){return arguments.length===1?this.binding_context[e]:this.binding_context[e]=t},e.prototype.text=function(){if(arguments.length>0)throw"kbi.TemplateSource: unexpected writing to template source";return this.template_generator.viewText(this.binding_context)},e}(),n.TemplateEngine=function(e){function t(){this.allowTemplateRewriting=!1,this.generators={kbi_array_node:n.ArrayNodeViewGenerator,kbi_model_node:n.ModelNodeViewGenerator,kbi_collection_node:n.CollectionNodeViewGenerator}}return o(t,e),t.prototype.generator=function(e,t){return arguments.length===1?this.generators[e]:this.generators[e]=t},t.prototype.makeTemplateSource=function(e){return this.generators.hasOwnProperty(e)?new n.TemplateSource(new this.generators[e](e)):t.__super__.makeTemplateSource.apply(this,arguments)},t.prototype.renderTemplateSource=function(e,n,r){var i,s;for(i in n)s=n[i],e.data(i,s);return t.__super__.renderTemplateSource.apply(this,arguments)},t}(r.nativeTemplateEngine),n.FetchedModel=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.parse=function(e){var t,r,s,o,u;t={};for(s in e)u=e[s],i.isObject(u)?(o=new n.FetchedModel,t[s]=o.set(o.parse(u))):i.isArray(u)?(r=new n.FetchedCollection,t[s]=r.reset(r.parse(u))):t[s]=u;return t},t}(e.Model),n.FetchedCollection=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t.prototype.model=n.FetchedModel,t.prototype.parse=function(e){var t;return t=e.results?e.results:e,i.map(e.results,function(e){var t;return t=new n.FetchedModel,t.set(t.parse(e))})},t}(e.Collection),n.NodeViewModel=function(){function e(e,n,s){var o,u;this.name=e,this.node=s,this.opened=r.observable(n),u=r.utils.unwrapObservable(this.node),u instanceof t.ViewModel?(this.node=u,o=t.utils.wrappedModel(this.node),this.attribute_names=r.observableArray(o?i.keys(o.attributes):[])):typeof u.get=="function"&&typeof u.trigger=="function"&&(u.models?this.node=t.collectionObservable(u):(this.node=t.viewModel(u),this.attribute_names=r.observableArray(i.keys(u.attributes))));return}return e}(),n.nodeViewModel=n.nvm=function(e,t,r){return new n.NodeViewModel(e,t,r)},n.ArrayNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($data) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='array' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name + '[]'\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: '['+$index()+']'\"></label>\n <input type='text' data-bind=\"value: $data, valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("'['+$index()+']'",!1,"$data")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("'['+$index()+']'",!1,"$data")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("'['+$index()+']'",!1,"$data")},e.prototype.nodeEnd=function(){return""},e}(),n.CollectionNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: node -->\n "+this.modelNode()+"\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.modelNode=function(){return""+n.ViewHTML.modelTree("'['+$index()+']'",!1,"$data")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ModelNodeViewGenerator=function(){function e(e){this.template_name=e}return e.prototype.viewText=function(){return""+this.nodeStart()+"\n"+this.nodeManipulator()+"\n <!-- ko if: opened -->\n <!-- ko foreach: attribute_names -->\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_SIMPLE) -->\n "+this.attributeEditor()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_ARRAY) -->\n "+this.arrayTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_MODEL) -->\n "+this.modelTree()+"\n <!-- /ko -->\n\n <!-- ko if: (kb.utils.valueType($parent.node[$data]) == kb.TYPE_COLLECTION) -->\n "+this.collectionTree()+"\n <!-- /ko -->\n\n <!-- /ko -->\n <!-- /ko -->\n"+this.nodeEnd()},e.prototype.nodeStart=function(){return"<li class='kbi' data-bind=\"css: {opened: opened, closed: !opened()}\">"},e.prototype.nodeManipulator=function(){return"<div class='collection' data-bind=\"click: function(){ opened(!opened()) }\">\n <span data-bind=\"text: (opened() ? '- ' : '+ ' )\"></span>\n <span data-bind=\"text: name\"></span>\n</div>"},e.prototype.attributeEditor=function(){return"<fieldset class='kbi'>\n <label data-bind=\"text: $data\"></label>\n <input type='text' data-bind=\"value: $parent.node[$data], valueUpdate: 'keyup'\">\n</fieldset>"},e.prototype.arrayTree=function(){return""+n.ViewHTML.arrayTree("$data",!1,"$parent.node[$data]")},e.prototype.modelTree=function(){return""+n.ViewHTML.modelTree("$data",!1,"$parent.node[$data]")},e.prototype.collectionTree=function(){return""+n.ViewHTML.collectionTree("$data+'[]'",!0,"$parent.node[$data]")},e.prototype.nodeEnd=function(){return"</li>"},e}(),n.ViewHTML=function(){function e(){}return e.arrayTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_array_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.modelTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_model_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e.collectionTree=function(e,t,n){return"<ul class='kbi' data-bind=\"template: {name: 'kbi_collection_node', data: kbi.nvm("+e+", "+t+", "+n+')}"></ul>'},e}(),n})}).call(this);
View
BIN  packages/nuget/Knockback-Inspector.js.0.1.6.nupkg
Binary file not shown
View
4 packages/nuget/package.nuspec
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
- <version>0.1.5</version>
+ <version>0.1.6</version>
<authors>Kevin Malakoff</authors>
<owners />
<licenseUrl>https://github.com/kmalakoff/knockback-inspector/blob/master/LICENSE</licenseUrl>
@@ -9,7 +9,7 @@
<dependencies>
<dependency id="knockoutjs" version="2.0.0.1" />
<dependency id="Backbone.js" version="0.9.2" />
- <dependency id="Knockback.js" version="0.15.1" />
+ <dependency id="Knockback.js" version="0.16.6" />
</dependencies>
<id>Knockback-Inspector.js</id>
<title>Knockback-Inspector.js</title>
View
4 src/lib/kbi_core.coffee
@@ -1,5 +1,5 @@
###
-knockback-inspector.js 0.1.5
+knockback-inspector.js 0.1.6
(c) 2012 Kevin Malakoff.
Knockback-Inspector.js is freely distributable under the MIT license.
See the following for full license details:
@@ -16,4 +16,4 @@ kb = if not @kb and (typeof(require) isnt 'undefined') then require('knockback')
# export or create kbi namespace
kbi = @kbi = if (typeof(exports) != 'undefined') then exports else {}
-@kbi.VERSION = '0.1.5'
+@kbi.VERSION = '0.1.6'
View
2  src/module-loader.js
@@ -1,5 +1,5 @@
/*
- knockback-inspector.js 0.1.5
+ knockback-inspector.js 0.1.6
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
View
15 src/view_models/kbi_node_view_model.coffee
@@ -9,14 +9,15 @@ class kbi.NodeViewModel
model = kb.utils.wrappedModel(@node)
@attribute_names = ko.observableArray(if model then _.keys(model.attributes) else [])
- # Backbone.Model signature
+ # Backbone signature
else if (typeof(node_value.get) is 'function') and (typeof(node_value.trigger) is 'function')
- @node = kb.viewModel(node_value) # create view model
- @attribute_names = ko.observableArray(_.keys(node_value.attributes))
-
- # Backbone.Collection signature
- else if (node_value.models)
- @node = kb.collectionObservable(node_value) # create collection observable
+ # Backbone.Collection signature
+ if (node_value.models)
+ @node = kb.collectionObservable(node_value) # create collection observable
+ # Backbone.Model signature
+ else
+ @node = kb.viewModel(node_value) # create view model
+ @attribute_names = ko.observableArray(_.keys(node_value.attributes))
return
View
8 src/views/kbi_array_node_view_generator.coffee
@@ -33,7 +33,7 @@ class kbi.ArrayNodeViewGenerator
nodeManipulator: ->
return """<div class='array' data-bind="click: function(){ opened(!opened()) }">
<span data-bind="text: (opened() ? '- ' : '+ ' )"></span>
- <span data-bind="text: name"></span>
+ <span data-bind="text: name + '[]'"></span>
</div>"""
attributeEditor: ->
@@ -45,12 +45,12 @@ class kbi.ArrayNodeViewGenerator
"""
arrayTree: ->
- return """#{kbi.ViewHTML.arrayTree("'['+$index()+'] (array)'", false, "$data")}"""
+ return """#{kbi.ViewHTML.arrayTree("'['+$index()+']'", false, "$data")}"""
modelTree: ->
- return """#{kbi.ViewHTML.modelTree("'['+$index()+'] (model)'", false, "$data")}"""
+ return """#{kbi.ViewHTML.modelTree("'['+$index()+']'", false, "$data")}"""
collectionTree: ->
- return """#{kbi.ViewHTML.collectionTree("'['+$index()+'] (collection)'", false, "$data")}"""
+ return """#{kbi.ViewHTML.collectionTree("'['+$index()+']'", false, "$data")}"""
nodeEnd: -> return ''
Please sign in to comment.
Something went wrong with that request. Please try again.