Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/src/field
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitm@lovullo.com>2015-11-30 14:22:34 -0500
committerMike Gerwitz <gerwitm@lovullo.com>2015-11-30 14:38:42 -0500
commit9a1dd337eb0a2f64a2674b119cc7efd1cddd0b80 (patch)
tree26ecc18db2765806771316b7445945cb78dcca3d /src/field
parent4cc240e9773ce5a3d4e31a07b0f6001a25e02fb1 (diff)
downloadliza-9a1dd337eb0a2f64a2674b119cc7efd1cddd0b80.tar.gz
liza-9a1dd337eb0a2f64a2674b119cc7efd1cddd0b80.tar.bz2
liza-9a1dd337eb0a2f64a2674b119cc7efd1cddd0b80.zip
Liberate {,ui/}field/
Diffstat (limited to 'src/field')
-rw-r--r--src/field/BucketField.js60
-rw-r--r--src/field/Field.js31
2 files changed, 91 insertions, 0 deletions
diff --git a/src/field/BucketField.js b/src/field/BucketField.js
new file mode 100644
index 0000000..4a6e8bf
--- /dev/null
+++ b/src/field/BucketField.js
@@ -0,0 +1,60 @@
+/**
+ * Field representing bucket value
+ *
+ * Copyright (C) 2015 LoVullo Associates, Inc.
+ *
+ * This file is part of liza.
+ *
+ * liza is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+var Class = require( 'easejs' ).Class,
+ Field = require( './Field' );
+
+
+module.exports = Class( 'BucketField' )
+ .implement( Field )
+ .extend(
+{
+ /**
+ * Field name
+ * @type {string}
+ */
+ 'private _name': '',
+
+ /**
+ * Field index
+ * @type {string}'
+ */
+ 'private _index': 0,
+
+
+ __construct: function( name, index )
+ {
+ this._name = ''+name;
+ this._index = +index;
+ },
+
+
+ 'public getName': function()
+ {
+ return this._name;
+ },
+
+
+ 'public getIndex': function()
+ {
+ return this._index;
+ }
+} );
diff --git a/src/field/Field.js b/src/field/Field.js
new file mode 100644
index 0000000..83128ec
--- /dev/null
+++ b/src/field/Field.js
@@ -0,0 +1,31 @@
+/**
+ * Field representation
+ *
+ * Copyright (C) 2015 LoVullo Associates, Inc.
+ *
+ * This file is part of liza.
+ *
+ * liza is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+var Interface = require( 'easejs' ).Interface;
+
+
+module.exports = Interface( 'Field',
+{
+ 'public getName': [],
+
+ 'public getIndex': []
+} );