From d327be478013144913b4f4d6ba55d50c18b6c1cd Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 22 May 2017 09:08:21 +0200 Subject: [PATCH] Backup --- js/db/calc.js | 3 +-- js/db/db.js | 3 --- js/htk/field/combo.js | 23 ++++++++++++++++------- js/htk/grid.js | 2 +- js/htk/repeater.js | 4 ++-- js/{db => vn}/form.js | 11 +++++------ js/{db => vn}/iterator-iface.js | 7 ++++--- js/{db => vn}/iterator.js | 7 ++++--- js/vn/lot-iface.js | 2 +- js/vn/vn.js | 3 +++ package.json | 4 ++-- 11 files changed, 39 insertions(+), 30 deletions(-) rename js/{db => vn}/form.js (87%) rename js/{db => vn}/iterator-iface.js (94%) rename js/{db => vn}/iterator.js (91%) diff --git a/js/db/calc.js b/js/db/calc.js index 4f2e6804..a7b6ad68 100644 --- a/js/db/calc.js +++ b/js/db/calc.js @@ -1,6 +1,5 @@ var Model = require ('./model'); -var Iterator = require ('./iterator'); /** * Interface for handle foreach operations on the model. @@ -25,7 +24,7 @@ module.exports = new Class ,'row-inserted': this.onRowInsert }); - var set = new Iterator ({model: x}); + var set = new Vn.Iterator ({model: x}); this.link ({_set: set}); } ,get: function () diff --git a/js/db/db.js b/js/db/db.js index 8095b068..975fe107 100644 --- a/js/db/db.js +++ b/js/db/db.js @@ -6,9 +6,6 @@ Db = module.exports = { ,Result : require ('./result') ,ResultSet : require ('./result-set') ,Model : require ('./model') - ,IteratorIface : require ('./iterator-iface') - ,Iterator : require ('./iterator') - ,Form : require ('./form') ,Query : require ('./query') ,Calc : require ('./calc') ,CalcSum : require ('./calc-sum') diff --git a/js/htk/field/combo.js b/js/htk/field/combo.js index de578a14..6f9bd383 100644 --- a/js/htk/field/combo.js +++ b/js/htk/field/combo.js @@ -10,7 +10,7 @@ var nativeEvents = { module.exports = new Class ({ Extends: Htk.Field - ,Implements: Db.Iterator + ,Implements: Vn.Iterator ,Tag: 'htk-combo' ,Properties: { @@ -44,7 +44,7 @@ module.exports = new Class return; this._row = x; - this.changed (); + this.rowChanged (); } ,get: function () { @@ -107,19 +107,28 @@ module.exports = new Class return this._notNull; } }, - /** - * The current row parameters. - */ params: + { + type: Object + ,set: function (x) + { + this.setAll (x); + } + ,get: function () + { + return this._params; + } + } + ,$: { type: Object ,set: function (x) { - this.assign (x); + this.setAll (x); } ,get: function () { - return this.getParams (); + return this._params; } } } diff --git a/js/htk/grid.js b/js/htk/grid.js index 2dfc9b0f..4d756f10 100644 --- a/js/htk/grid.js +++ b/js/htk/grid.js @@ -25,7 +25,7 @@ module.exports = new Class ,'updatable-changed': this.onUpdatableChange }); - var set = new Db.Iterator ({model: x}); + var set = new Vn.Iterator ({model: x}); this.link ({_set: set}); this.onUpdatableChange (); diff --git a/js/htk/repeater.js b/js/htk/repeater.js index 52260371..3a39b1e9 100644 --- a/js/htk/repeater.js +++ b/js/htk/repeater.js @@ -47,7 +47,7 @@ module.exports = new Class } } /** - * {Function (Vn.BuilderResult, Db.Iterator)} Function to call after + * {Function (Vn.BuilderResult, Vn.Iterator)} Function to call after * every box rendering. */ ,renderer: @@ -112,7 +112,7 @@ module.exports = new Class ,_buildBox: function (index) { - var set = new Db.Iterator ({ + var set = new Vn.Iterator ({ model: this._model, row: index }); diff --git a/js/db/form.js b/js/vn/form.js similarity index 87% rename from js/db/form.js rename to js/vn/form.js index 2acf4fde..c936d3a6 100644 --- a/js/db/form.js +++ b/js/vn/form.js @@ -1,6 +1,6 @@ var Iterator = require ('./iterator'); -var Model = require ('./model'); +var ModelIface = require ('./model-iface'); module.exports = new Class ({ @@ -10,13 +10,13 @@ module.exports = new Class { model: { - type: Model + type: ModelIface ,set: function (x) { this.link ({_model: x}, { 'status-changed': this.onModelChange - ,'row-updated': this.onRowUpdate + ,'row-updated': this.onModelRowUpdate }); } ,get: function () @@ -38,8 +38,7 @@ module.exports = new Class return; this._row = x; - this._rowChanged (); - this.changed (); + this.rowChanged (); } ,get: function () { @@ -77,7 +76,7 @@ module.exports = new Class } } - ,onRowUpdate: function (model, row) + ,onModelRowUpdate: function (model, row) { if (row == this._row) this.rowChanged(); diff --git a/js/db/iterator-iface.js b/js/vn/iterator-iface.js similarity index 94% rename from js/db/iterator-iface.js rename to js/vn/iterator-iface.js index ac3c49f7..a96fd692 100644 --- a/js/db/iterator-iface.js +++ b/js/vn/iterator-iface.js @@ -1,9 +1,10 @@ -var Model = require ('./model'); +var LotIface = require ('./lot-iface'); +var ModelIface = require ('./model-iface'); module.exports = new Class ({ - Implements: Vn.LotIface + Implements: LotIface ,Properties: { /** @@ -11,7 +12,7 @@ module.exports = new Class */ model: { - type: Model + type: ModelIface }, /** * The row where the form positioned, has -1 if the row is unselected. diff --git a/js/db/iterator.js b/js/vn/iterator.js similarity index 91% rename from js/db/iterator.js rename to js/vn/iterator.js index b5b88711..9d8fb75f 100644 --- a/js/db/iterator.js +++ b/js/vn/iterator.js @@ -1,6 +1,7 @@ +var Lot = require ('./lot'); var IteratorIface = require ('./iterator-iface'); -var Model = require ('./model'); +var ModelIface = require ('./model-iface'); /** * A light iterator for models. It assumes that its row and model properties @@ -8,13 +9,13 @@ var Model = require ('./model'); */ module.exports = new Class ({ - Extends: Vn.Lot + Extends: Lot ,Implements: IteratorIface ,Properties: { model: { - type: Model + type: ModelIface ,set: function (x) { this._model = x; diff --git a/js/vn/lot-iface.js b/js/vn/lot-iface.js index f28be673..ae4a1957 100644 --- a/js/vn/lot-iface.js +++ b/js/vn/lot-iface.js @@ -44,7 +44,7 @@ module.exports = new Class { var params = {}; params[field] = value; - this.assign (param); + this.assign (params); } /** diff --git a/js/vn/vn.js b/js/vn/vn.js index d3063997..26d52b8f 100644 --- a/js/vn/vn.js +++ b/js/vn/vn.js @@ -21,6 +21,9 @@ Vn = module.exports = { ,ModelIface : require ('./model-iface') ,ModelProxy : require ('./model-proxy') ,JsonModel : require ('./json-model') + ,IteratorIface : require ('./iterator-iface') + ,Iterator : require ('./iterator') + ,Form : require ('./form') ,Node : require ('./node') ,Builder : require ('./builder') ,JsonException : require ('./json-exception') diff --git a/package.json b/package.json index 10120c47..92f339a7 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,9 @@ "raw-loader": "^0.5.1", "style-loader": "^0.13.1", "url-loader": "^0.5.7", - "webpack": "^2.2.0", + "webpack": "^2.5.1", "webpack-chunk-hash": "^0.4.0", - "webpack-dev-server": "^2.2.0", + "webpack-dev-server": "^2.4.5", "webpack-merge": "^3.0.0" }, "dependencies": {