diff --git a/conf/config.php b/conf/config.php index b70f7288..5c6a7ae4 100755 --- a/conf/config.php +++ b/conf/config.php @@ -12,12 +12,12 @@ * * - http://www.mydomain.org -> config.www.php * - http://test.mydomain.org -> config.test.php - **/ + */ return [ /** * Database parameters. - **/ + */ 'db' => [ 'host' => 'localhost' ,'port' => 3306 diff --git a/forms/cms/home/style.css b/forms/cms/home/style.css index e5c58cd1..55e57404 100644 --- a/forms/cms/home/style.css +++ b/forms/cms/home/style.css @@ -55,8 +55,7 @@ } .new-text a { - color: blue; - text-decoration: underline; + color: #2962FF; } .new-text li { diff --git a/forms/cms/training/style.css b/forms/cms/training/style.css index 6ee17b0d..880202f5 100644 --- a/forms/cms/training/style.css +++ b/forms/cms/training/style.css @@ -44,8 +44,7 @@ } .new-text a { - color: blue; - text-decoration: underline; + color: #2962FF; } .new-text li { diff --git a/js/db/calc-sum.js b/js/db/calc-sum.js index 8755e65e..9314a236 100644 --- a/js/db/calc-sum.js +++ b/js/db/calc-sum.js @@ -3,7 +3,7 @@ var Calc = require ('./calc'); /** * Computes a sum of data in the model. - **/ + */ module.exports = new Class ({ Extends: Calc diff --git a/js/db/calc.js b/js/db/calc.js index 17e8d91f..17851a6b 100644 --- a/js/db/calc.js +++ b/js/db/calc.js @@ -4,7 +4,7 @@ var SimpleIterator = require ('./simple-iterator'); /** * Interface for handle foreach operations on the model. - **/ + */ module.exports = new Class ({ Extends: Vn.Param @@ -132,23 +132,23 @@ module.exports = new Class * You don't need to define it if model isn't updatable. * * @param {integer} row The row number - **/ + */ ,before: function (row) {} /** * Called after each update or insert row operation. * * @param {integer} row The row number - **/ + */ ,after: function (row) {} /** * Called before each model refresh. - **/ + */ ,init: function () {} /** * Called when an operation in the model is complete. - **/ + */ ,done: function () {} }); diff --git a/js/db/connection.js b/js/db/connection.js index be4785cc..2100f479 100644 --- a/js/db/connection.js +++ b/js/db/connection.js @@ -8,7 +8,7 @@ * Warning! You should set a well defined dababase level privileges to use this * class or you could have a serious security hole in you application becasuse * the user can send any statement to the server. For example: DROP DATABASE - **/ + */ var Connection = new Class (); module.exports = Connection; @@ -44,7 +44,7 @@ Connection.implement * * @param {String} sql The SQL statement * @param {Function} callback The function to call when operation is done - **/ + */ ,execSql: function (sql, callback) { this.send ('core/query', {'sql': sql}, @@ -57,7 +57,7 @@ Connection.implement * @param {Sql.Stmt} stmt The statement * @param {Function} callback The function to call when operation is done * @param {Sql.Batch} batch The batch used to set the parameters - **/ + */ ,execStmt: function (stmt, callback, batch) { this.execSql (stmt.render (batch), callback); @@ -69,7 +69,7 @@ Connection.implement * @param {String} query The SQL statement * @param {Function} callback The function to call when operation is done * @param {Sql.Batch} batch The batch used to set the parameters - **/ + */ ,execQuery: function (query, callback, batch) { this.execStmt (new Sql.String ({query: query}), callback, batch); diff --git a/js/db/form.js b/js/db/form.js index b97b8edb..53affd10 100644 --- a/js/db/form.js +++ b/js/db/form.js @@ -11,7 +11,7 @@ module.exports = new Class { /** * The model associated to this form. - **/ + */ model: { type: Model @@ -30,7 +30,7 @@ module.exports = new Class }, /** * The row where the form positioned, has -1 if the row is unselected. - **/ + */ row: { type: Number @@ -51,7 +51,7 @@ module.exports = new Class }, /** * The number of rows in the form. - **/ + */ numRows: { type: Number @@ -65,7 +65,7 @@ module.exports = new Class }, /** * Checks if the form data is ready. - **/ + */ ready: { type: Boolean diff --git a/js/db/iterator.js b/js/db/iterator.js index 346f4d7e..ccb90268 100644 --- a/js/db/iterator.js +++ b/js/db/iterator.js @@ -7,28 +7,28 @@ module.exports = new Class { /** * The model associated to this form. - **/ + */ model: { type: Model }, /** * The row where the form positioned, has -1 if the row is unselected. - **/ + */ row: { type: Number }, /** * The number of rows in the form. - **/ + */ numRows: { type: Number }, /** * Checks if the form data is ready. - **/ + */ ready: { type: Boolean @@ -46,7 +46,7 @@ module.exports = new Class /** * Emits the 'iter-changed' signal on the form. - **/ + */ ,iterChanged: function () { this.signalEmit ('iter-changed'); @@ -57,7 +57,7 @@ module.exports = new Class * * @param {String} columnName The column name * @return {integer} The column index or -1 if column not exists - **/ + */ ,getColumnIndex: function (columnName) { if (this._model) @@ -80,7 +80,7 @@ module.exports = new Class /** * Removes the current row. - **/ + */ ,deleteRow: function () { if (this._row >= 0) @@ -92,7 +92,7 @@ module.exports = new Class * * @param {String} columnName The column name * @return {Object} The value - **/ + */ ,get: function (columnName) { return this._model.get (this._row, columnName); @@ -103,7 +103,7 @@ module.exports = new Class * * @param {String} columnName The column name * @param {Object} value The new value - **/ + */ ,set: function (columnName, value) { return this._model.set (this._row, columnName, value); @@ -114,7 +114,7 @@ module.exports = new Class * * @param {String} columnName The column index * @return {Object} The value - **/ + */ ,getByIndex: function (column) { return this._model.getByIndex (this._row, column); @@ -125,7 +125,7 @@ module.exports = new Class * * @param {String} columnName The column index * @param {Object} value The new value - **/ + */ ,setByIndex: function (column, value) { return this._model.setByIndex (this._row, column, value); diff --git a/js/db/model.js b/js/db/model.js index 0181257a..53a3ff09 100644 --- a/js/db/model.js +++ b/js/db/model.js @@ -9,7 +9,7 @@ var Connection = require ('./connection'); * Note that table and column names must be unique in the selection query, * otherwise updates are not allowed on that table/column. If two tables or * columns have the same name, an alias should be used to make it updatable. - **/ + */ var Model = new Class (); module.exports = Model; @@ -56,7 +56,7 @@ Model.implement { /** * The connection used to execute the statement. - **/ + */ conn: { type: Connection @@ -72,7 +72,7 @@ Model.implement }, /** * The result index. - **/ + */ resultIndex: { type: Number @@ -87,7 +87,7 @@ Model.implement }, /** * The batch used to execute the statement. - **/ + */ batch: { type: Sql.Batch @@ -103,7 +103,7 @@ Model.implement }, /** * The model select statement. - **/ + */ stmt: { type: Sql.Stmt @@ -119,7 +119,7 @@ Model.implement }, /** * The model query. - **/ + */ query: { type: String @@ -137,7 +137,7 @@ Model.implement }, /** * The main table. - **/ + */ mainTable: { type: String @@ -154,7 +154,7 @@ Model.implement }, /** * Determines if the model is updatable. - **/ + */ updatable: { type: Boolean @@ -171,7 +171,7 @@ Model.implement }, /** * The number of rows in the model. - **/ + */ numRows: { type: Number @@ -185,7 +185,7 @@ Model.implement }, /** * The current status of the model. - **/ + */ status: { type: Number @@ -196,7 +196,7 @@ Model.implement }, /** * Checks if the model data is ready. - **/ + */ ready: { type: Boolean @@ -207,7 +207,7 @@ Model.implement }, /** * Update mode. - **/ + */ mode: { enumType: Mode @@ -215,7 +215,7 @@ Model.implement }, /** * Wether to execute the model query automatically. - **/ + */ autoLoad: { type: Boolean @@ -275,7 +275,7 @@ Model.implement /** * Refresh the model data reexecuting the query on the database. - **/ + */ ,refresh: function () { var ready = false; @@ -422,7 +422,7 @@ Model.implement * @param {String} field The destination field name * @param {String} table The destination table name * @param {Sql.Expr} srcColumn The default value expression - **/ + */ ,setDefault: function (field, table, expr) { this._defaults.push @@ -439,7 +439,7 @@ Model.implement * @param {String} field The destination field name * @param {String} table The destination table name * @param {Object} value The default value - **/ + */ ,setDefaultFromValue: function (field, table, value) { this._defaults.push @@ -457,7 +457,7 @@ Model.implement * @param {String} field The destination field name * @param {String} table The destination table name * @param {String} srcColumn The source column - **/ + */ ,setDefaultFromColumn: function (field, table, srcColumn) { this._defaults.push @@ -473,7 +473,7 @@ Model.implement * * @param {integer} column The column index * @return {Boolean} %true if column exists, %false otherwise - **/ + */ ,checkColExists: function (column) { return this.columns @@ -486,7 +486,7 @@ Model.implement * * @param {integer} rowIndex The row index * @return {Boolean} %true if row exists, %false otherwise - **/ + */ ,checkRowExists: function (rowIndex) { return this.data @@ -511,7 +511,7 @@ Model.implement * * @param {string} columnName The column name * @return {number} The column index or -1 if column not exists - **/ + */ ,getColumnIndex: function (columnName) { var index; @@ -529,7 +529,7 @@ Model.implement * @param {number} rowIndex The row index * @param {string} columnName The column name * @return {mixed} The value - **/ + */ ,get: function (rowIndex, columnName) { var index = this.getColumnIndex (columnName); @@ -546,7 +546,7 @@ Model.implement * @param {number} rowIndex The row index * @param {string} columnName The column name * @param {mixed} value The new value - **/ + */ ,set: function (rowIndex, columnName, value) { var index = this.getColumnIndex (columnName); @@ -563,7 +563,7 @@ Model.implement * @param {number} rowIndex The row index * @param {number} column The column index * @return {mixed} The value - **/ + */ ,getByIndex: function (rowIndex, column) { if (this.checkRowExists (rowIndex) && this.checkColExists (column)) @@ -578,7 +578,7 @@ Model.implement * @param {number} rowIndex The row index * @param {number} col The column index * @param {mixed} value The new value - **/ + */ ,setByIndex: function (rowIndex, col, value) { if (!this.checkRowExists (rowIndex) @@ -634,7 +634,7 @@ Model.implement * Deletes a row from the model. * * @param {number} rowIndex The row index - **/ + */ ,deleteRow: function (rowIndex) { if (!this.checkRowExists (rowIndex) @@ -681,7 +681,7 @@ Model.implement * Inserts a new row on the model. * * @return The index of the inserted row - **/ + */ ,insertRow: function () { if (!this._checkTableUpdatable (this._mainTable)) @@ -709,7 +709,7 @@ Model.implement /** * Performs all model changes on the database. - **/ + */ ,performOperations: function () { var ops = this._operations; @@ -925,7 +925,7 @@ Model.implement /** * Undoes all unsaved changes made to the model. - **/ + */ ,reverseOperations: function () { for (var i = 0; i < this._operations.length; i++) @@ -998,7 +998,7 @@ Model.implement * * @param {integer} column The column name * @param {SortWay} way The sort way - **/ + */ ,sortByName: function (columnName, way) { this._requestedSortIndex = -1; @@ -1015,7 +1015,7 @@ Model.implement * * @param {integer} column The column index * @param {SortWay} way The sort way - **/ + */ ,sort: function (column, way) { this._requestedSortIndex = column; @@ -1062,7 +1062,7 @@ Model.implement * FIXME: Not fully implemented. * * @param {String} column The column name - **/ + */ ,indexColumn: function (column) { this._requestedIndexes[column] = true; @@ -1106,7 +1106,7 @@ Model.implement * @param {String} column The column name * @param {Object} value The value to search * @return {integer} The column index - **/ + */ ,search: function (column, value) { var index = this.getColumnIndex (column); @@ -1120,7 +1120,7 @@ Model.implement * @param {integer} col The column index * @param {Object} value The value to search * @return {integer} The column index - **/ + */ ,searchByIndex: function (col, value) { if (!this.checkColExists (col)) @@ -1264,7 +1264,7 @@ Model.implement * @param {String} schema The original table schema * @param {Array} pks Array with the names of primary keys * @param {String} ai The autoincrement column name - **/ + */ ,setInfo: function (table, orgname, schema, pks, ai) { if (!this.tableInfo) diff --git a/js/db/param.js b/js/db/param.js index b49bdd54..39943d74 100644 --- a/js/db/param.js +++ b/js/db/param.js @@ -10,7 +10,7 @@ module.exports = new Class { /** * The form field referenced by this param. - **/ + */ column: { type: String @@ -26,7 +26,7 @@ module.exports = new Class }, /** * The form referenced by this param. - **/ + */ form: { type: Form @@ -48,7 +48,7 @@ module.exports = new Class /** * Determines whether the link to the form is unidirectional, ie, a * change in the form updates the parameter but not vice versa. - **/ + */ oneWay: { type: Boolean diff --git a/js/db/query.js b/js/db/query.js index 7605f974..cb30a7aa 100644 --- a/js/db/query.js +++ b/js/db/query.js @@ -9,7 +9,7 @@ module.exports = new Class { /** * The connection used to execute the statement. - **/ + */ conn: { type: Connection @@ -25,7 +25,7 @@ module.exports = new Class }, /** * The model query. - **/ + */ query: { type: String @@ -41,7 +41,7 @@ module.exports = new Class }, /** * The model select statement. - **/ + */ stmt: { type: Sql.Stmt @@ -57,7 +57,7 @@ module.exports = new Class }, /** * The batch used to execute the statement. - **/ + */ batch: { type: Sql.Batch @@ -73,7 +73,7 @@ module.exports = new Class }, /** * Wether to execute automatically de query que it's ready. - **/ + */ autoLoad: { type: Boolean, diff --git a/js/db/result-set.js b/js/db/result-set.js index 23d528d5..c3dceeaf 100644 --- a/js/db/result-set.js +++ b/js/db/result-set.js @@ -3,7 +3,7 @@ var Result = require ('./result'); /** * This class stores the database results. - **/ + */ module.exports = new Class ({ results: null @@ -11,7 +11,7 @@ module.exports = new Class /** * Initilizes the resultset object. - **/ + */ ,initialize: function (results, error) { this.results = results; @@ -22,7 +22,7 @@ module.exports = new Class * Gets the query error. * * @return {Db.Err} the error or null if no errors hapened - **/ + */ ,getError: function () { return this.error; @@ -44,7 +44,7 @@ module.exports = new Class * Fetchs the next result from the resultset. * * @return {Db.Result} the result or %null if error or there are no more results - **/ + */ ,fetchResult: function () { var result = this.fetch (); @@ -64,7 +64,7 @@ module.exports = new Class * Fetchs the first row from the next resultset. * * @return {Array} the row if success, %null otherwise - **/ + */ ,fetchRow: function () { var result = this.fetch (); @@ -81,7 +81,7 @@ module.exports = new Class * Fetchs the first row and column value from the next resultset. * * @return {Object} the value if success, %null otherwise - **/ + */ ,fetchValue: function () { var row = this.fetchRow (); diff --git a/js/db/result.js b/js/db/result.js index 90466c93..2fb2eefe 100644 --- a/js/db/result.js +++ b/js/db/result.js @@ -1,11 +1,11 @@ /** * This class stores a database result. - **/ + */ module.exports = new Class ({ /** * Initilizes the result object. - **/ + */ initialize: function (result) { this.data = result.data; @@ -29,7 +29,7 @@ module.exports = new Class * * @param {String} columnName The column name * @return {Object} The cell value - **/ + */ ,get: function (columnName) { var columnIndex = this.columnMap[columnName]; @@ -38,7 +38,7 @@ module.exports = new Class /** * Resets the result iterator. - **/ + */ ,reset: function () { this.row = -1; @@ -46,7 +46,7 @@ module.exports = new Class /** * Moves the internal iterator to the next row. - **/ + */ ,next: function () { this.row++; diff --git a/js/db/simple-iterator.js b/js/db/simple-iterator.js index 7aca8a49..5327a3e3 100644 --- a/js/db/simple-iterator.js +++ b/js/db/simple-iterator.js @@ -4,7 +4,7 @@ var Model = require ('./model'); /** * A light iterator for models. - **/ + */ module.exports = new Class ({ Extends: Vn.Object @@ -13,7 +13,7 @@ module.exports = new Class { /** * The model associated to this form. - **/ + */ model: { type: Model @@ -28,7 +28,7 @@ module.exports = new Class }, /** * The row where the form positioned, has -1 if the row is unselected. - **/ + */ row: { type: Number @@ -43,7 +43,7 @@ module.exports = new Class }, /** * The number of rows in the form. - **/ + */ numRows: { type: Number @@ -57,7 +57,7 @@ module.exports = new Class }, /** * Checks if the form data is ready. - **/ + */ ready: { type: Boolean diff --git a/js/hedera/form.js b/js/hedera/form.js index 7040315c..652b6d76 100644 --- a/js/hedera/form.js +++ b/js/hedera/form.js @@ -19,7 +19,7 @@ module.exports = new Class * * @param {string} objectId The object identifier * @return {Object} The object, or %null if not found - **/ + */ ,$: function (objectId) { if (this.builder) @@ -86,7 +86,7 @@ module.exports = new Class /** * Called when the form is opened. - **/ + */ ,open: function () { this.close (); @@ -96,7 +96,7 @@ module.exports = new Class /** * Called when the form is closed. - **/ + */ ,close: function () { if (!this.isOpen) @@ -108,12 +108,12 @@ module.exports = new Class /** * Called when the form is activated. - **/ + */ ,activate: function () {} /** * Called when the form is deactivated. - **/ + */ ,deactivate: function () {} ,_destroy: function () diff --git a/js/hedera/gui.js b/js/hedera/gui.js index a4285b17..d0dc6048 100644 --- a/js/hedera/gui.js +++ b/js/hedera/gui.js @@ -444,18 +444,12 @@ module.exports = new Class ,setTitle: function (title) { - Vn.Node.removeChilds (this.$('title')); - - if (title) - this.$('title').appendChild (title); + Vn.Node.setChild (this.$('title'), title); } ,setActions: function (actions) { - Vn.Node.removeChilds (this.$('action-bar')); - - if (actions) - this.$('action-bar').appendChild (actions); + Vn.Node.setChild (this.$('action-bar'), actions); } ,closeForm: function () diff --git a/js/hedera/report.js b/js/hedera/report.js index 9129715b..d48c5b86 100644 --- a/js/hedera/report.js +++ b/js/hedera/report.js @@ -16,7 +16,7 @@ module.exports = new Class * * @param {string} objectId The object identifier * @return {Object} The object, or %null if not found - **/ + */ ,$: function (objectId) { if (this.builderResult) diff --git a/js/htk/column.js b/js/htk/column.js index 6959aa36..62103b26 100644 --- a/js/htk/column.js +++ b/js/htk/column.js @@ -4,7 +4,7 @@ var NodeBuilder = require ('./node-builder'); /** * Represents a grid column. This is an abstract class and should not be * instantiated directly. - **/ + */ module.exports = new Class ({ Extends: NodeBuilder @@ -65,7 +65,7 @@ module.exports = new Class /** * Initializes the column. - **/ + */ ,initialize: function (props) { this.parent (props); @@ -87,7 +87,7 @@ module.exports = new Class * * @param {HTMLTableRow} tr the table row * @return {HTMLTableData} the rendered cell - **/ + */ ,render: function (tr) { var td = this.td.cloneNode (true); diff --git a/js/htk/column/date.js b/js/htk/column/date.js index 94866871..b85d9a48 100644 --- a/js/htk/column/date.js +++ b/js/htk/column/date.js @@ -7,7 +7,7 @@ module.exports = new Class { /** * Format that applies to the value. - **/ + */ format: { type: String diff --git a/js/htk/column/image.js b/js/htk/column/image.js index ddad8143..477c515c 100644 --- a/js/htk/column/image.js +++ b/js/htk/column/image.js @@ -7,7 +7,7 @@ module.exports = new Class { /** * The directory where the images are allocated. - **/ + */ directory: { type: String @@ -15,7 +15,7 @@ module.exports = new Class }, /** * The subdirectory where the images are allocated. - **/ + */ subdir: { type: String @@ -23,7 +23,7 @@ module.exports = new Class }, /** * Subdirectory where full images are allocated. - **/ + */ fullDir: { type: String @@ -31,7 +31,7 @@ module.exports = new Class }, /** * The REST connection used to upload the image. - **/ + */ conn: { type: Vn.JsonConnection diff --git a/js/htk/column/link.js b/js/htk/column/link.js index d50437f2..de65fd13 100644 --- a/js/htk/column/link.js +++ b/js/htk/column/link.js @@ -7,7 +7,7 @@ module.exports = new Class { /** * The link url. - **/ + */ href: { type: String @@ -15,7 +15,7 @@ module.exports = new Class }, /** * the target where the link is opened. - **/ + */ target: { type: String diff --git a/js/htk/column/spin.js b/js/htk/column/spin.js index eaed6852..324ed0b5 100644 --- a/js/htk/column/spin.js +++ b/js/htk/column/spin.js @@ -7,7 +7,7 @@ module.exports = new Class { /** * The text to append to the number. - **/ + */ unit: { type: String @@ -15,7 +15,7 @@ module.exports = new Class }, /** * The number of decimal places to display. - **/ + */ digits: { type: Number ,value: 0 diff --git a/js/htk/column/text.js b/js/htk/column/text.js index ae1eb277..b999f810 100644 --- a/js/htk/column/text.js +++ b/js/htk/column/text.js @@ -7,7 +7,7 @@ module.exports = new Class { /** * Format that applies to the value. - **/ + */ format: { type: String diff --git a/js/htk/dialog.js b/js/htk/dialog.js index b8aeebbe..38e1b827 100644 --- a/js/htk/dialog.js +++ b/js/htk/dialog.js @@ -3,7 +3,7 @@ var Popup = require ('./popup'); /** * Class to show message dialogs with buttons. - **/ + */ var Dialog = new Class (); module.exports = Dialog; @@ -55,7 +55,7 @@ Dialog.implement { /** * The message displayed to the user. - **/ + */ message: { type: String @@ -70,7 +70,7 @@ Dialog.implement } /** * The dialog icon. - **/ + */ ,icon: { type: String @@ -85,7 +85,7 @@ Dialog.implement } /** * The dialog buttons. - **/ + */ ,buttons: { enumType: Button diff --git a/js/htk/field.js b/js/htk/field.js index f93f14d8..7d8ef106 100644 --- a/js/htk/field.js +++ b/js/htk/field.js @@ -112,7 +112,7 @@ module.exports = new Class * editable. * * @param {Boolean} editable Whether the user is allowed to edit the entry - **/ + */ ,setEditable: function (editable) {} /** @@ -120,7 +120,7 @@ module.exports = new Class * on the associated entry. * * @param {Object} value The new value for the entry - **/ + */ ,putValue: function (value) {} /** @@ -128,7 +128,7 @@ module.exports = new Class * on the associated entry changes. * * @param {Object} value The new entry value - **/ + */ ,valueChanged: function (value) { this._value = value; diff --git a/js/htk/field/image.js b/js/htk/field/image.js index 20b8c3f0..fae7a989 100644 --- a/js/htk/field/image.js +++ b/js/htk/field/image.js @@ -1,6 +1,6 @@ /** * Class to display or edit an image. Also it allows to show it's full version. - **/ + */ module.exports = new Class ({ Extends: Htk.Field @@ -9,7 +9,7 @@ module.exports = new Class { /** * The directory where the images are allocated. - **/ + */ directory: { type: String @@ -25,7 +25,7 @@ module.exports = new Class }, /** * The subdirectory where the images are allocated. - **/ + */ subdir: { type: String @@ -41,7 +41,7 @@ module.exports = new Class }, /** * Whether to show the full image when mouse hover. - **/ + */ fullDir: { type: String @@ -57,7 +57,7 @@ module.exports = new Class }, /** * The REST connection used to upload the image. - **/ + */ conn: { type: Vn.JsonConnection diff --git a/js/htk/field/label.js b/js/htk/field/label.js index d3006802..c1e326c7 100644 --- a/js/htk/field/label.js +++ b/js/htk/field/label.js @@ -7,7 +7,7 @@ module.exports = new Class { /** * Format that applies to the value. - **/ + */ format: { type: String diff --git a/js/htk/field/select.js b/js/htk/field/select.js index 2ffa6788..17718362 100644 --- a/js/htk/field/select.js +++ b/js/htk/field/select.js @@ -10,7 +10,7 @@ module.exports = new Class { /** * The model associated to this form. - **/ + */ model: { type: Db.Model @@ -26,7 +26,7 @@ module.exports = new Class }, /** * The row where the form positioned, has -1 if the row is unselected. - **/ + */ row: { type: Number @@ -47,7 +47,7 @@ module.exports = new Class }, /** * The number of rows in the form. - **/ + */ numRows: { type: Number @@ -61,7 +61,7 @@ module.exports = new Class }, /** * Checks if the form data is ready. - **/ + */ ready: { type: Boolean @@ -72,7 +72,7 @@ module.exports = new Class }, /** * Checks if the form data is ready. - **/ + */ placeholder: { type: String @@ -88,7 +88,7 @@ module.exports = new Class }, /** * Wether to allow null values. - **/ + */ notNull: { type: Boolean diff --git a/js/htk/field/text.js b/js/htk/field/text.js index e0483c89..cdd72c4d 100644 --- a/js/htk/field/text.js +++ b/js/htk/field/text.js @@ -7,7 +7,7 @@ module.exports = new Class { /** * Format that applies to the value. - **/ + */ format: { type: String diff --git a/js/htk/full-image.js b/js/htk/full-image.js index 3492f2c3..7f40d3f8 100644 --- a/js/htk/full-image.js +++ b/js/htk/full-image.js @@ -9,7 +9,7 @@ module.exports = new Class { /** * Subdirectory where full images are allocated. - **/ + */ fullDir: { type: String diff --git a/js/htk/grid.js b/js/htk/grid.js index da578b03..6c9a0524 100644 --- a/js/htk/grid.js +++ b/js/htk/grid.js @@ -10,7 +10,7 @@ module.exports = new Class { /** * The source data model. - **/ + */ model: { type: Db.Model @@ -38,7 +38,7 @@ module.exports = new Class }, /** * Message that should be displayed when source model is not ready. - **/ + */ emptyMessage: { type: String @@ -46,7 +46,7 @@ module.exports = new Class }, /** * Wether to display the header with column titles. - **/ + */ showHeader: { type: Boolean diff --git a/js/htk/image-editor.js b/js/htk/image-editor.js index 010b8d66..399d5c54 100644 --- a/js/htk/image-editor.js +++ b/js/htk/image-editor.js @@ -6,7 +6,7 @@ var Tpl = require ('./image-editor.xml'); /** * A form to handle the image database, it allows to add new images or * replace it. - **/ + */ module.exports = new Class ({ Extends: Component @@ -14,7 +14,7 @@ module.exports = new Class { /** * The REST connection used to upload the image. - **/ + */ conn: { type: Vn.JsonConnection diff --git a/js/htk/popup.js b/js/htk/popup.js index a81ea1e0..fa4b2e3f 100644 --- a/js/htk/popup.js +++ b/js/htk/popup.js @@ -3,7 +3,7 @@ var Widget = require ('./widget'); /** * Class to handle popups. - **/ + */ module.exports = new Class ({ Extends: Widget @@ -12,7 +12,7 @@ module.exports = new Class { /** * The popup child. - **/ + */ child: { type: Widget @@ -28,7 +28,7 @@ module.exports = new Class } /** * The popup child Node. - **/ + */ ,childNode: { type: Object @@ -44,7 +44,7 @@ module.exports = new Class } /** * Indicates how the dialog must be displayed. - **/ + */ ,modal: { type: Boolean diff --git a/js/htk/repeater.js b/js/htk/repeater.js index 8e7dc5ee..b56cb0c2 100644 --- a/js/htk/repeater.js +++ b/js/htk/repeater.js @@ -10,7 +10,7 @@ module.exports = new Class { /** * The source data model. - **/ + */ model: { type: Db.Model @@ -33,7 +33,7 @@ module.exports = new Class } /** * The identifier for internal iterator. - **/ + */ ,formId: { type: String @@ -49,7 +49,7 @@ module.exports = new Class /** * {Function (Vn.BuilderResult, Db.Form)} Function to call after every * box rendering. - **/ + */ ,renderer: { type: Function @@ -64,7 +64,7 @@ module.exports = new Class } /** * Message that should be displayed when source model is not ready. - **/ + */ ,emptyMessage: { type: String diff --git a/js/htk/toast.js b/js/htk/toast.js index ac3f46f9..6505720a 100644 --- a/js/htk/toast.js +++ b/js/htk/toast.js @@ -1,6 +1,6 @@ /** * Class to show toast messages. - **/ + */ module.exports = { maxMessages: 6 @@ -13,7 +13,7 @@ module.exports = * Shows a normal toast message. * * @param {String} message The message text - **/ + */ ,showMessage: function (message) { this._showText (message, 'message'); @@ -23,7 +23,7 @@ module.exports = * Shows a warning toast message. * * @param {String} message The message text - **/ + */ ,showWarning: function (message) { this._showText (message, 'warning'); @@ -33,7 +33,7 @@ module.exports = * Shows an error toast message. * * @param {String} message The message text - **/ + */ ,showError: function (message) { this._showText (message, 'error'); @@ -74,7 +74,7 @@ module.exports = /** * Hides all currently displayed toast messages. - **/ + */ ,hide: function () { if (!this._container) diff --git a/js/htk/widget.js b/js/htk/widget.js index 612283e7..0aa50362 100644 --- a/js/htk/widget.js +++ b/js/htk/widget.js @@ -8,7 +8,7 @@ module.exports = new Class { /** * Main HTML node that represents the widget - **/ + */ node: { type: Object @@ -20,7 +20,7 @@ module.exports = new Class }, /** * CSS classes to be appendend to the node classes. - **/ + */ class: { type: String diff --git a/js/sql/batch.js b/js/sql/batch.js index 409423cb..ef88ae52 100644 --- a/js/sql/batch.js +++ b/js/sql/batch.js @@ -4,7 +4,7 @@ var Value = require ('./value'); /** * A map container for many Sql.Object - **/ + */ module.exports = new Class ({ Extends: Object diff --git a/js/sql/delete.js b/js/sql/delete.js index eed14b9b..f4de11c3 100644 --- a/js/sql/delete.js +++ b/js/sql/delete.js @@ -3,7 +3,7 @@ var Stmt = require ('./stmt'); /** * The equivalent of a SQL delete. - **/ + */ module.exports = new Class ({ Extends: Stmt diff --git a/js/sql/dml.js b/js/sql/dml.js index a17fde24..ab5cf0db 100644 --- a/js/sql/dml.js +++ b/js/sql/dml.js @@ -5,7 +5,7 @@ var Field = require ('./field'); /** * The equivalent of a SQL DML. - **/ + */ module.exports = new Class ({ Extends: Stmt diff --git a/js/sql/expr.js b/js/sql/expr.js index 140fcbbb..820afd67 100644 --- a/js/sql/expr.js +++ b/js/sql/expr.js @@ -3,7 +3,7 @@ var Object = require ('./object'); /** * The equivalent of a SQL expression. - **/ + */ module.exports = new Class ({ Extends: Object diff --git a/js/sql/field.js b/js/sql/field.js index a0d4b9ee..b936b125 100644 --- a/js/sql/field.js +++ b/js/sql/field.js @@ -5,7 +5,7 @@ var Expr = require ('./expr'); * The equivalent of a SQL field. * * @param {string} taget The name of the owner table - **/ + */ module.exports = new Class ({ Extends: Expr diff --git a/js/sql/filter-item.js b/js/sql/filter-item.js index dccf5a63..175fb3a6 100644 --- a/js/sql/filter-item.js +++ b/js/sql/filter-item.js @@ -3,7 +3,7 @@ var Operation = require ('./operation'); /** * The equivalent of a SQL operation. - **/ + */ module.exports = new Class ({ Extends: Operation diff --git a/js/sql/filter.js b/js/sql/filter.js index 54512ce7..a574ff3b 100644 --- a/js/sql/filter.js +++ b/js/sql/filter.js @@ -3,7 +3,7 @@ var Operation = require ('./operation'); /** * The equivalent of a SQL operation. - **/ + */ module.exports = new Class ({ Extends: Operation diff --git a/js/sql/function.js b/js/sql/function.js index 6d868a3a..b24df9d9 100644 --- a/js/sql/function.js +++ b/js/sql/function.js @@ -7,7 +7,7 @@ var List = require ('./list'); * * @param {string} funcName The name of the function * @param {Array#Sql.Expr} param Array with function parameters - **/ + */ module.exports = new Class ({ Extends: Expr diff --git a/js/sql/holder.js b/js/sql/holder.js index 2d1a3f2d..34777aca 100644 --- a/js/sql/holder.js +++ b/js/sql/holder.js @@ -3,7 +3,7 @@ var Object = require ('./object'); /** * A holder for another object. - **/ + */ module.exports = new Class ({ Extends: Object diff --git a/js/sql/insert.js b/js/sql/insert.js index 51df787d..a74d29ae 100644 --- a/js/sql/insert.js +++ b/js/sql/insert.js @@ -3,7 +3,7 @@ var Dml = require ('./dml'); /** * The equivalent of a SQL insert. - **/ + */ module.exports = new Class ({ Extends: Dml diff --git a/js/sql/list.js b/js/sql/list.js index 7dd109e1..e9ff9275 100644 --- a/js/sql/list.js +++ b/js/sql/list.js @@ -3,7 +3,7 @@ var Object = require ('./object'); /** * List of Sql.Object - **/ + */ module.exports = new Class ({ Extends: Object diff --git a/js/sql/multi-stmt.js b/js/sql/multi-stmt.js index 60ae789e..ecd91a91 100644 --- a/js/sql/multi-stmt.js +++ b/js/sql/multi-stmt.js @@ -3,7 +3,7 @@ var Stmt = require ('./stmt'); /** * The equivalent of a SQL multi statement. - **/ + */ module.exports = new Class ({ Extends: Stmt diff --git a/js/sql/object.js b/js/sql/object.js index 21db49dd..284756f2 100644 --- a/js/sql/object.js +++ b/js/sql/object.js @@ -1,6 +1,6 @@ /** * Base class for all objects on this library. - **/ + */ module.exports = new Class ({ Extends: Vn.Object @@ -10,14 +10,14 @@ module.exports = new Class * * @param {Sql.Batch} batch The batch used to render the object * @return {String} The SQL string - **/ + */ ,render: function (batch) {} /** * Gets if the object is ready to be rendered. * * @return {boolean} %true if the object is ready, %false otherwise - **/ + */ ,isReady: function () { return true; @@ -27,6 +27,6 @@ module.exports = new Class * Through the query looking for containers and adds it to the batch. * * @return {Sql.Batch} batch The batch - **/ + */ ,findHolders: function (batch) {} }); diff --git a/js/sql/operation.js b/js/sql/operation.js index 229cd2b1..be8a4145 100644 --- a/js/sql/operation.js +++ b/js/sql/operation.js @@ -6,7 +6,7 @@ var Expr = require ('./expr'); * * @param {Array#Sql.Expr} expr Array with the exprs * @param {Sql..Operation.Type} type The type of the operation - **/ + */ var Operation = new Class (); module.exports = Operation; diff --git a/js/sql/search-tags.js b/js/sql/search-tags.js index 5fe37250..7e0eab98 100644 --- a/js/sql/search-tags.js +++ b/js/sql/search-tags.js @@ -3,7 +3,7 @@ var Value = require ('./value'); /** * The equivalent of a SQL value. - **/ + */ module.exports = new Class ({ Extends: Value diff --git a/js/sql/select.js b/js/sql/select.js index 96558a6a..4a0db861 100644 --- a/js/sql/select.js +++ b/js/sql/select.js @@ -4,7 +4,7 @@ var Field = require ('./field'); /** * The equivalent of a SQL select. - **/ + */ module.exports = new Class ({ Extends: Stmt diff --git a/js/sql/stmt.js b/js/sql/stmt.js index ba7e86c3..e447db74 100644 --- a/js/sql/stmt.js +++ b/js/sql/stmt.js @@ -4,7 +4,7 @@ var Expr = require ('./expr'); /** * The equivalent of a SQL statement. - **/ + */ module.exports = new Class ({ Extends: Object diff --git a/js/sql/string.js b/js/sql/string.js index b58341f4..aa9fefb7 100644 --- a/js/sql/string.js +++ b/js/sql/string.js @@ -4,7 +4,7 @@ var Holder = require ('./holder'); /** * Literal SQL string. - **/ + */ module.exports = new Class ({ Extends: Stmt diff --git a/js/sql/table.js b/js/sql/table.js index 7e5bcf9c..ca783387 100644 --- a/js/sql/table.js +++ b/js/sql/table.js @@ -3,7 +3,7 @@ var Target = require ('./target'); /** * Represents a database table. - **/ + */ module.exports = new Class ({ Extends: Target diff --git a/js/sql/target.js b/js/sql/target.js index 1065f09a..219e346d 100644 --- a/js/sql/target.js +++ b/js/sql/target.js @@ -3,7 +3,7 @@ var Object = require ('./object'); /** * The equivalent of a SQL target. - **/ + */ module.exports = new Class ({ Extends: Object diff --git a/js/sql/update.js b/js/sql/update.js index 456a3aec..89d4ae8e 100644 --- a/js/sql/update.js +++ b/js/sql/update.js @@ -3,7 +3,7 @@ var Dml = require ('./dml'); /** * The equivalent of a SQL update. - **/ + */ module.exports = new Class ({ Extends: Dml diff --git a/js/sql/value.js b/js/sql/value.js index fa86052e..cee4f5dc 100644 --- a/js/sql/value.js +++ b/js/sql/value.js @@ -3,7 +3,7 @@ var Expr = require ('./expr'); /** * The equivalent of a SQL value. - **/ + */ module.exports = new Class ({ Extends: Expr @@ -13,7 +13,7 @@ module.exports = new Class { /** * The master param. - **/ + */ param: { type: Vn.Param @@ -29,7 +29,7 @@ module.exports = new Class }, /** * The value. - **/ + */ value: { type: String diff --git a/js/vn/builder.js b/js/vn/builder.js index d44e3d0c..31277225 100644 --- a/js/vn/builder.js +++ b/js/vn/builder.js @@ -3,7 +3,7 @@ var Object = require ('./object'); /** * Creates a object from a XML specification. - **/ + */ module.exports = new Class ({ Extends: Object @@ -69,7 +69,7 @@ module.exports = new Class * @path String The XML path * @dstDocument Document The document used to create the nodes * @return %true on success, %false othersise - **/ + */ ,loadXml: function (path, dstDocument) { this._path = path; @@ -115,7 +115,7 @@ module.exports = new Class * @path Node The DOM node * @dstDocument Document The document used to create the nodes * @return %true on success, %false othersise - **/ + */ ,loadXmlFromNode: function (node, dstDocument) { this._compileInit (dstDocument); @@ -264,7 +264,7 @@ module.exports = new Class /** * Creates a text node context. - **/ + */ ,textCompile: function (node, tagName) { if (!tagName) @@ -284,7 +284,7 @@ module.exports = new Class /** * Creates a object context. - **/ + */ ,objectCompile: function (node, tagName) { var klass = vnCustomTags[tagName]; @@ -443,7 +443,7 @@ module.exports = new Class /** * Creates a HTML node context. - **/ + */ ,elementCompile: function (node, tagName) { var attributes = {}; diff --git a/js/vn/cookie.js b/js/vn/cookie.js index 045edbda..7ab233e1 100644 --- a/js/vn/cookie.js +++ b/js/vn/cookie.js @@ -1,6 +1,6 @@ /** * Brownser cookie handler. - **/ + */ module.exports = { set: function (key, value, days) diff --git a/js/vn/date.js b/js/vn/date.js index 78691d87..d07ab50e 100644 --- a/js/vn/date.js +++ b/js/vn/date.js @@ -1,6 +1,6 @@ /** * Date handling utilities. - **/ + */ Date.prototype.clone = function () { diff --git a/js/vn/hash-listener.js b/js/vn/hash-listener.js index e9f90f4f..69d3a086 100644 --- a/js/vn/hash-listener.js +++ b/js/vn/hash-listener.js @@ -3,7 +3,7 @@ var Object = require ('./object'); /** * Class to handle the URL. - **/ + */ module.exports = new Class ({ Extends: Object diff --git a/js/vn/hash.js b/js/vn/hash.js index e5c5c4d4..2ead138e 100644 --- a/js/vn/hash.js +++ b/js/vn/hash.js @@ -3,7 +3,7 @@ var HashListener = require ('./hash-listener'); /** * Class to handle the URL. - **/ + */ module.exports = { _hash: null @@ -33,7 +33,7 @@ module.exports = * Gets the hash part of the URL. * * @param {string} key The variable name - **/ + */ ,get: function (key) { return this._hashMap[key]; @@ -43,7 +43,7 @@ module.exports = * Sets the hash part of the URL, respecting the current hash variables. * * @param {Object} map A key-value map - **/ + */ ,add: function (map) { var newMap = this._hashMap; @@ -58,7 +58,7 @@ module.exports = * Sets the hash part of the URL. * * @param {Object} map A key-value map - **/ + */ ,set: function (map) { if (map) @@ -90,7 +90,7 @@ module.exports = * @param {Object} map A key-value map * @param {boolean} add %true to combine with the current map, %false otherwise * @return {String} The URL - **/ + */ ,make: function (map, add) { var hash = '#!'; diff --git a/js/vn/json-connection.js b/js/vn/json-connection.js index 7d38b9d6..31843225 100644 --- a/js/vn/json-connection.js +++ b/js/vn/json-connection.js @@ -4,7 +4,7 @@ var JsonException = require ('./json-exception'); /** * Handler for JSON rest connections. - **/ + */ module.exports = new Class ({ Extends: Object @@ -15,7 +15,7 @@ module.exports = new Class /** * Initilizes the connection object. - **/ + */ ,initialize: function () { this.parent (); @@ -48,7 +48,7 @@ module.exports = new Class * @param {String} password The user password * @param {Boolean} remember Specifies if the user should be remembered * @param {Function} openCallback The function to call when operation is done - **/ + */ ,open: function (user, pass, remember, callback) { if (user !== null && user !== undefined) @@ -92,7 +92,7 @@ module.exports = new Class * Closes the connection to the REST service. * * @param {Function} callback The function to call when operation is done - **/ + */ ,close: function (callback) { this._closeClient (); @@ -122,7 +122,7 @@ module.exports = new Class * * @param {String} user The user name * @param {Function} callback The callback function - **/ + */ ,supplantUser: function (user, callback) { var params = {'supplantUser': user}; @@ -141,7 +141,7 @@ module.exports = new Class /** * Ends the user supplanting and restores the last login. - **/ + */ ,supplantEnd: function () { this.fetchToken (); @@ -154,7 +154,7 @@ module.exports = new Class * @param {String} restService The service path * @param {Map} params The params to pass to the service * @param {Function} callback The response callback - **/ + */ ,send: function (restService, params, callback) { if (!params) @@ -162,7 +162,7 @@ module.exports = new Class params['srv'] = 'json:'+ restService; - this.sendWithUrl (params, callback, 'post', '.'); + this.sendWithUrl (params, callback, 'POST', '.'); } ,sendForm: function (form, callback) @@ -174,7 +174,7 @@ module.exports = new Class if (elements[i].name) params[elements[i].name] = elements[i].value; - this.sendWithUrl (params, callback, 'post', form.action); + this.sendWithUrl (params, callback, 'POST', form.action); } ,sendFormMultipart: function (form, callback) @@ -185,7 +185,7 @@ module.exports = new Class formData.append ('token', this.token); var request = new XMLHttpRequest (); - request.open ('post', form.action, true); + request.open ('POST', form.action, true); request.onreadystatechange = this._onStateChange.bind (this, request, callback); request.send (formData); diff --git a/js/vn/json-exception.js b/js/vn/json-exception.js index cd7ebc13..63d0a85d 100644 --- a/js/vn/json-exception.js +++ b/js/vn/json-exception.js @@ -1,6 +1,6 @@ /** * This class stores the database errors. - **/ + */ module.exports = new Class ({ exception: null diff --git a/js/vn/locale.js b/js/vn/locale.js index e1fdde23..05baa1b7 100644 --- a/js/vn/locale.js +++ b/js/vn/locale.js @@ -3,7 +3,7 @@ vnLocaleStrings = {}; /** * Class to manage the internationalization. - **/ + */ module.exports = { language: null @@ -24,7 +24,7 @@ module.exports = var file = path +'/locale/'+ this.language +'.json'+ Vn.getVersion (); var request = new XMLHttpRequest (); - request.open ('get', file, true); + request.open ('GET', file, true); request.onreadystatechange = this.loadDone.bind (this, request, callback); request.send (); } diff --git a/js/vn/node.js b/js/vn/node.js index c75bac86..cdb3a312 100644 --- a/js/vn/node.js +++ b/js/vn/node.js @@ -1,6 +1,11 @@ module.exports = { + /** + * Removes all node childs. + * + * @param {Node} node The HTML Node + */ removeChilds: function (node) { var childs = node.childNodes; @@ -10,12 +15,37 @@ module.exports = node.removeChild (childs[0]); } + /** + * Removes a node from the document. + * + * @param {Node} node The HTML Node + */ ,remove: function (node) { if (node.parentNode) node.parentNode.removeChild (node); } + /** + * Replaces the node child/s with another one. + * + * @param {Node} node The HTML Node + * @param {Node} child The new child or %null to set an empty node + */ + ,setChild: function (node, child) + { + this.removeChilds (node); + + if (child) + node.appendChild (child); + } + + /** + * Replaces the node text/childs with text. + * + * @param {Node} node The HTML Node + * @param {Node} child The new node text or %null for no text + */ ,setText: function (node, text) { Vn.Node.removeChilds (node); @@ -25,14 +55,25 @@ module.exports = node.ownerDocument.createTextNode (text)); } + /** + * Adds a class to the node CSS classes. Note that this + * function doesn't check if the node already has the class. + * + * @param {Node} node The HTML Node + * @param {String} className The CSS class name + */ ,addClass: function (node, className) { -/* var classes = node.className.split (' '); - - if (classes.split (' ').indexOf (className) == -1) -*/ node.className = className +' '+ node.className; + node.className = className +' '+ node.className; } - + + /** + * Removes a class from the node CSS classes. This functions + * removes all ocurrences of the class from the node. + * + * @param {Node} node The HTML Node + * @param {String} className The CSS class name + */ ,removeClass: function (node, className) { var index = 0; @@ -49,18 +90,23 @@ module.exports = node.className = classes.join (' '); } + /** + * Hides the node from the document. + * + * @param {Node} node The HTML Node + */ ,hide: function (node) { node.style.display = 'none'; } + /** + * Shows a hidden node. + * + * @param {Node} node The hidden HTML Node + */ ,show: function (node) { node.style.display = 'block'; } }; - -$ = function (id) -{ - return document.getElementById (id); -} diff --git a/js/vn/object.js b/js/vn/object.js index a8818c80..7d1e890d 100644 --- a/js/vn/object.js +++ b/js/vn/object.js @@ -3,7 +3,7 @@ * The main base class. Manages the signal system. * * @param signals Map with all connected signal handlers - **/ + */ module.exports = new Class ({ Tag: 'vn-object' @@ -17,18 +17,29 @@ module.exports = new Class this.setProperties (props); } + /** + * Sets a group of object properties. + * + * @param {Object} props Properties + */ ,setProperties: function (props) { for (var prop in props) this[prop] = props[prop]; } + /** + * Increases the object reference count. + */ ,ref: function () { this._refCount++; return this; } + /** + * Decreases the object reference count. + */ ,unref: function () { this._refCount--; @@ -55,7 +66,7 @@ module.exports = new Class * @param {String} id The signal identifier * @param {Function} callback The callback * @param {Object} instance The instance - **/ + */ ,on: function (id, callback, instance) { if (!(callback instanceof Function)) @@ -84,7 +95,7 @@ module.exports = new Class * @param {String} id The signal identifier * @param {Function} callback The callback * @param {Boolean} block %true for lock the signal, %false for unlock - **/ + */ ,blockSignal: function (id, callback, block, instance) { if (!this._signalData) @@ -105,7 +116,7 @@ module.exports = new Class * Emits a signal in the current object. * * @param {String} id The signal identifier - **/ + */ ,signalEmit: function (id) { if (!this._signalData) @@ -133,7 +144,7 @@ module.exports = new Class * @param {String} id The signal identifier * @param {Function} callback The connected callback * @param {Object} instance The instance - **/ + */ ,disconnect: function (id, callback, instance) { if (!this._signalData) @@ -154,7 +165,7 @@ module.exports = new Class * Disconnects all signals for the given instance. * * @param {Object} instance The instance - **/ + */ ,disconnectByInstance: function (instance) { if (!this._signalData) @@ -175,7 +186,7 @@ module.exports = new Class /** * Destroys the object, this method should only be called before losing * the last reference to the object. - **/ + */ ,_destroy: function () { if (!this._signalData) @@ -189,6 +200,12 @@ module.exports = new Class this._signalData = null; } + /** + * Links the object with another object. + * + * @param {Object} prop The linked property + * @param {Object} handlers The object events to listen with + */ ,link: function (prop, handlers) { this._signalInit (); diff --git a/js/vn/param.js b/js/vn/param.js index 6b26855c..7001198c 100644 --- a/js/vn/param.js +++ b/js/vn/param.js @@ -5,7 +5,7 @@ var Value = require ('./value'); /** * Simply a linkable value holder. - **/ + */ module.exports = new Class ({ Extends: Object diff --git a/js/vn/url.js b/js/vn/url.js index 9b42eec8..bd060cdf 100644 --- a/js/vn/url.js +++ b/js/vn/url.js @@ -1,13 +1,13 @@ /** * Class to handle the URL. - **/ + */ module.exports = { /** * Gets the value of a URL variable. * * @param {string} key The variable name - **/ + */ getQuery: function (key) { var regExp = new RegExp ('[\?\&]'+ key +'=([^\&]*)(\&?)', 'i'); @@ -21,7 +21,7 @@ module.exports = * * @param {string} key The variable name * @param {string} value The new value - **/ + */ ,setQuery: function (key, value) { var changed = true; diff --git a/js/vn/vn.js b/js/vn/vn.js index 6a0ebe5a..6c8a13f5 100644 --- a/js/vn/vn.js +++ b/js/vn/vn.js @@ -45,7 +45,7 @@ Vn = module.exports = { * is already included, does nothing. * * @param {string} fileName The stylesheet file name - **/ + */ ,includeCss: function (fileName) { var cssData = this.cssIncludes[fileName]; @@ -75,7 +75,7 @@ Vn = module.exports = { * Excludes a CSS stylesheet from the current document. * * @param {string} fileName The stylesheet file name - **/ + */ ,excludeCss: function (fileName) { var cssData = this.cssIncludes[fileName]; @@ -145,7 +145,7 @@ Vn = module.exports = { * Should be called on the last statically incuded script. * * @param {Function} callback The main function - **/ + */ ,main: function (callback) { if (this.mainCalled) @@ -206,7 +206,7 @@ Vn = module.exports = { * current script. * * @param {...} The list of files as function arguments - **/ + */ ,include: function () { for (var i = 0; i < arguments.length; i++) @@ -223,7 +223,7 @@ Vn = module.exports = { * current script. * * @param {...} The list of files as function arguments - **/ + */ ,resource: function () { for (var i = 0; i < arguments.length; i++) @@ -240,7 +240,7 @@ Vn = module.exports = { * are resolved. * * @param {Function} callback The callback function - **/ + */ ,define: function (callback) { this.currentCallback = callback; @@ -251,7 +251,7 @@ Vn = module.exports = { * * @param {string} libName The folder of the library * @param {Array} files Array with every library file name - **/ + */ ,includeLib: function (libName, files) { Vn.Locale.loadScript ('js/'+ libName +'.js'); @@ -267,7 +267,7 @@ Vn = module.exports = { * @param {string} fileName The script file name * @param {Function} callback The function to call when script is * downloaded and included - **/ + */ ,includeJs: function (fileName, callback, skipVersion) { var includeData = this._realIncludeJs (fileName, skipVersion); @@ -344,7 +344,7 @@ Vn = module.exports = { * * @param {string} path The file path * @param {Function} callback The function to call when file is downloaded - **/ + */ ,loadXml: function (path, callback) { var includeData = this._realLoadXml (path); @@ -387,7 +387,7 @@ Vn = module.exports = { * * @param {string} path The file path * @return {Object} The DOM object - **/ + */ ,getXml: function (path) { var includeData = this.includes[path]; @@ -402,7 +402,7 @@ Vn = module.exports = { * Checks if user is using a mobile browser. * * return {boolean} %true if is mobile, %false otherwise. - **/ + */ ,isMobile: function () { if (this.isMobileCached === null) diff --git a/rest/core/account.php b/rest/core/account.php index 58d0cfd5..8d0a4455 100755 --- a/rest/core/account.php +++ b/rest/core/account.php @@ -65,7 +65,7 @@ class SshConnection /** * Abrebiated method to make SSH connections. - **/ + */ function __construct ($host, $user, $password) { $this->connection = $connection = ssh2_connect ($host); @@ -83,7 +83,7 @@ class SshConnection /** * Executes a command on the host. - **/ + */ function exec ($command) { return ssh2_exec ($this->connection, $command); @@ -91,7 +91,7 @@ class SshConnection /** * Escapes the double quotes from an string. - **/ + */ static function escape ($str) { return '"'. str_replace ('"', '\\"', $str) .'"'; diff --git a/rest/core/change-password.php b/rest/core/change-password.php index 5b53adfc..eb0e5325 100755 --- a/rest/core/change-password.php +++ b/rest/core/change-password.php @@ -4,7 +4,7 @@ include __DIR__.'/account.php'; /** * Updates the user password. - **/ + */ class ChangePassword extends Vn\Web\JsonRequest { const PARAMS = ['newPassword']; diff --git a/rest/core/query.php b/rest/core/query.php index a1641e43..765bb447 100755 --- a/rest/core/query.php +++ b/rest/core/query.php @@ -89,7 +89,7 @@ class Query extends Vn\Web\JsonRequest /** * Transforms the database result into a JSON parseable object. - **/ + */ function transformResult ($result) { $tableMap = []; @@ -182,7 +182,7 @@ class Query extends Vn\Web\JsonRequest /** * Transforms the database value into a JSON parseable value. - **/ + */ function castValue ($value, $type) { if ($value !== NULL) diff --git a/rest/core/set-password.php b/rest/core/set-password.php index 446390c3..7fcdbacc 100755 --- a/rest/core/set-password.php +++ b/rest/core/set-password.php @@ -4,7 +4,7 @@ include __DIR__.'/account.php'; /** * Sets the user password. - **/ + */ class SetPassword extends Vn\Web\JsonRequest { const PARAMS = [ diff --git a/rest/core/sync-user.php b/rest/core/sync-user.php index 21b0abd1..b6db8170 100755 --- a/rest/core/sync-user.php +++ b/rest/core/sync-user.php @@ -5,7 +5,7 @@ include __DIR__.'/account.php'; /** * Updates the user credentials on external systems like Samba, create * home directory, create mailbox, etc. - **/ + */ class SyncUser extends Vn\Web\JsonRequest { const PARAMS = ['syncUser']; diff --git a/rest/dms/add.php b/rest/dms/add.php index 19a51740..695c1001 100644 --- a/rest/dms/add.php +++ b/rest/dms/add.php @@ -4,7 +4,7 @@ use Vn\Lib; /** * Adds a document to the Document Management System. - **/ + */ class Add extends Vn\Web\JsonRequest { function run ($db) diff --git a/rest/edi/dml/batch_new.sql b/rest/edi/dml/batch_new.sql index 9f1c60ca..ca760925 100644 --- a/rest/edi/dml/batch_new.sql +++ b/rest/edi/dml/batch_new.sql @@ -1,7 +1,7 @@ /** * Adds a new lot, generates its barcode * inserts/updates de record on table #vn2008.buy_edi - **/ + */ USE edi; DROP PROCEDURE IF EXISTS batch_new; DELIMITER $$ diff --git a/rest/edi/dml/edi_load.sql b/rest/edi/dml/edi_load.sql index 6dea81e2..bb4a15e0 100644 --- a/rest/edi/dml/edi_load.sql +++ b/rest/edi/dml/edi_load.sql @@ -2,7 +2,7 @@ * Creates a buy line from an EDI lot. * * @param v_edi The EDI id - **/ + */ USE edi; DROP PROCEDURE IF EXISTS edi_load; DELIMITER $$ diff --git a/rest/edi/dml/message_new.sql b/rest/edi/dml/message_new.sql index 0a86ac03..2a42f74e 100644 --- a/rest/edi/dml/message_new.sql +++ b/rest/edi/dml/message_new.sql @@ -3,7 +3,7 @@ * * @param v_mail_id Message-ID of email * @param v_sender Origin email id - **/ + */ USE edi; DROP PROCEDURE IF EXISTS message_new; DELIMITER $$ diff --git a/rest/image/image.php b/rest/image/image.php index 56095a6b..d9b41f0c 100755 --- a/rest/image/image.php +++ b/rest/image/image.php @@ -8,7 +8,7 @@ class Image * Creates an image resource from a valid image file. * * @param string $srcFile The source file name - **/ + */ static function create ($srcFile) { $imageType = exif_imagetype ($srcFile); @@ -43,7 +43,7 @@ class Image * @param integer $maxWidth The maximum width of resized image in pixels * @param boolean $crop Wether to crop the image * @param boolean $symbolicSrc If it is not necessary to resize the image creates a symbolic link using the passed path as source - **/ + */ static function resizeSave ($image, $dstFile, $maxHeight, $maxWidth, $crop = FALSE, $symbolicSrc = NULL) { $width = imagesx ($image); diff --git a/rest/image/resize.php b/rest/image/resize.php index 71ca0df0..b5d43f16 100644 --- a/rest/image/resize.php +++ b/rest/image/resize.php @@ -10,7 +10,7 @@ require_once (__DIR__.'/lib.php'); * @param integer $maxHeight The maximum height of resized image in pixels * @param integer $maxWidth The maximum width of resized image in pixels * @param boolean $rewrite Wether to rewrite the destination file if it exits - **/ + */ class Resize extends Vn\Lib\Method { const PARAMS = [ diff --git a/rest/image/sync.php b/rest/image/sync.php index 04f62831..7b02355d 100644 --- a/rest/image/sync.php +++ b/rest/image/sync.php @@ -5,7 +5,7 @@ require_once (__DIR__.'/util.php'); /** * Syncronizes the data directory with the database, this may take * some time. - **/ + */ class Sync extends Vn\Lib\Method { private $trashSubdir; @@ -111,7 +111,7 @@ class Sync extends Vn\Lib\Method * Moves a data directory to the trash. * * @param string $file The file to move to the trash - **/ + */ function moveTrash ($file) { $trashBasedir = "{$this->dataDir}/.trash/". $this->$trashSubdir; diff --git a/rest/image/thumb.php b/rest/image/thumb.php index 9784e249..eb6b1501 100644 --- a/rest/image/thumb.php +++ b/rest/image/thumb.php @@ -9,7 +9,7 @@ require_once (__DIR__.'/util.php'); * @param string $file The file name * @param integer $width The width of the thumb * @param integer $height The height of the thumb - **/ + */ class Thumb extends Vn\Web\RestRequest { function run () diff --git a/rest/image/upload.php b/rest/image/upload.php index 882cb02c..7dbed63c 100755 --- a/rest/image/upload.php +++ b/rest/image/upload.php @@ -7,7 +7,7 @@ use Vn\Lib\UserException; /** * Uploads a file creating its corresponding sizes. - **/ + */ class Upload extends Vn\Web\JsonRequest { function run ($db) diff --git a/rest/image/util.php b/rest/image/util.php index 3236bdd4..7cea4292 100755 --- a/rest/image/util.php +++ b/rest/image/util.php @@ -4,7 +4,7 @@ require_once (__DIR__.'/image.php'); /** * Base class for image methods. - **/ + */ class Util { var $app; @@ -20,7 +20,7 @@ class Util * Loads information for specified schema. * * @param string $schema The schema name - **/ + */ function loadInfo ($schema) { $db = $this->app->getSysConn (); diff --git a/rest/misc/exchange-rate.php b/rest/misc/exchange-rate.php index 6cbb6912..6ed782e4 100755 --- a/rest/misc/exchange-rate.php +++ b/rest/misc/exchange-rate.php @@ -3,7 +3,7 @@ /** * Ejemplo: * - **/ + */ class ExchangeRate extends Vn\Lib\Method { function run ($db) @@ -22,7 +22,7 @@ class ExchangeRate extends Vn\Lib\Method { $xmlDate = new DateTime ($cube['time']); - // Si existen datos más recientes de la máxima fecha los añade + // Si existen datos m�s recientes de la m�xima fecha los a�ade if ($maxDate < $xmlDate) foreach ($cube->Cube as $subCube) diff --git a/rest/tpv/confirm-mail.php b/rest/tpv/confirm-mail.php index be71416c..0c9f1bf4 100644 --- a/rest/tpv/confirm-mail.php +++ b/rest/tpv/confirm-mail.php @@ -4,7 +4,7 @@ require_once (__DIR__.'/tpv.php'); /** * Gets transaction confirmations from the IMAP mailbox. - **/ + */ class ConfirmMail extends Vn\Lib\Method { function run ($db) diff --git a/rest/tpv/confirm-post.php b/rest/tpv/confirm-post.php index 73975773..24c3d127 100644 --- a/rest/tpv/confirm-post.php +++ b/rest/tpv/confirm-post.php @@ -4,7 +4,7 @@ require_once (__DIR__.'/tpv.php'); /** * Gets transaction confirmation from HTTP POST. - **/ + */ class ConfirmPost extends Vn\Web\RestRequest { function run ($db) diff --git a/rest/tpv/confirm-soap.php b/rest/tpv/confirm-soap.php index 86a3b9c6..06eeb900 100644 --- a/rest/tpv/confirm-soap.php +++ b/rest/tpv/confirm-soap.php @@ -5,7 +5,7 @@ require_once (__DIR__.'/tpv.php'); /** * Gets transaction confirmation from SOAP service. - **/ + */ class ConfirmSoap extends Vn\Web\RestRequest { function run ($db) diff --git a/rest/tpv/tpv.php b/rest/tpv/tpv.php index 99ac4fb9..9907e77b 100755 --- a/rest/tpv/tpv.php +++ b/rest/tpv/tpv.php @@ -4,7 +4,7 @@ class Tpv { /** * Tryes to confirm a transaction with the given params. - **/ + */ static function confirm ($db, $params) { if (!(isset ($params['Ds_Amount']) diff --git a/rest/tpv/transaction.php b/rest/tpv/transaction.php index c024869e..5d32cbde 100755 --- a/rest/tpv/transaction.php +++ b/rest/tpv/transaction.php @@ -2,7 +2,7 @@ /** * Starts a new TPV transaction and returns the params. - **/ + */ class Transaction extends Vn\Web\JsonRequest { const PARAMS = ['amount']; diff --git a/web/app.php b/web/app.php index 264f818b..7e34053f 100644 --- a/web/app.php +++ b/web/app.php @@ -7,7 +7,7 @@ namespace Vn\Web; * * Format for $_REQUEST['srv'] variable: * - [serviceName]:[requestDir]/[requestFile] - **/ + */ class App extends \Vn\Lib\App { protected $conn = NULL; @@ -52,7 +52,7 @@ class App extends \Vn\Lib\App * or the default config file if isn't defined a file for the vhost. * * @return string The config file name - **/ + */ function getConfigFile () { if (!empty ($_SERVER['SERVER_NAME']) diff --git a/web/html-service.php b/web/html-service.php index 0f3f5a10..928d6745 100644 --- a/web/html-service.php +++ b/web/html-service.php @@ -6,7 +6,7 @@ use Vn\Lib\Locale; /** * Base class for services that sends response as HTML format. - **/ + */ class HtmlService extends Service { function run () diff --git a/web/json-exception.php b/web/json-exception.php index e81bb677..6d39c483 100755 --- a/web/json-exception.php +++ b/web/json-exception.php @@ -8,7 +8,7 @@ namespace Vn\Web; * @property string $exception The exception name * @property string $message The message string * @property string $code The code of message - **/ + */ class JsonException { var $exception = NULL; diff --git a/web/json-reply.php b/web/json-reply.php index deacf41a..72b3c31d 100755 --- a/web/json-reply.php +++ b/web/json-reply.php @@ -7,7 +7,7 @@ namespace Vn\Web; * * @property Object $data The returned data * @property array $warnings Array with warning messages - **/ + */ class JsonReply { var $data = NULL; diff --git a/web/json-request.php b/web/json-request.php index 58c5bdf5..f8535fa8 100644 --- a/web/json-request.php +++ b/web/json-request.php @@ -4,6 +4,6 @@ namespace Vn\Web; /** * Base class for JSON services. - **/ + */ abstract class JsonRequest extends RestRequest {} diff --git a/web/json-service.php b/web/json-service.php index be4cdf9e..e6994c6a 100644 --- a/web/json-service.php +++ b/web/json-service.php @@ -6,7 +6,7 @@ use Vn\Lib; /** * Base class for JSON application. - **/ + */ class JsonService extends RestService { private $warnings = NULL; diff --git a/web/jwt.php b/web/jwt.php index 74b530fa..b5b6ac70 100755 --- a/web/jwt.php +++ b/web/jwt.php @@ -7,7 +7,7 @@ use Exception; /** * Basic class to encode, decode and verify JWT tokens. It implements the HS256 * algorithm from the RFC 7519 standard. - **/ + */ class Jwt { /** @@ -16,7 +16,7 @@ class Jwt * @param {Array} $payload The data to encode * @param {string} $key The key used to sign the token * @return {string} The new JWT token - **/ + */ static function encode ($payload, $key) { $header = [ @@ -37,7 +37,7 @@ class Jwt * @param {Array} $token The JWT token * @param {string} $key The key used to validate the token * @return {string} The JWT validated and decoded data - **/ + */ static function decode ($token, $key) { $parts = explode ('.', $token); diff --git a/web/rest-request.php b/web/rest-request.php index 01cd11d6..e2f1f0c9 100644 --- a/web/rest-request.php +++ b/web/rest-request.php @@ -10,7 +10,7 @@ class Security /** * Base class for REST services. - **/ + */ abstract class RestRequest extends \Vn\Lib\Method { const PARAMS = NULL; diff --git a/web/rest-service.php b/web/rest-service.php index d510dd43..2376fdfd 100644 --- a/web/rest-service.php +++ b/web/rest-service.php @@ -6,7 +6,7 @@ use Vn\Lib; /** * Base class for REST application. - **/ + */ class RestService extends Service { function run () diff --git a/web/service.php b/web/service.php index cd3d92e1..ab8901c7 100755 --- a/web/service.php +++ b/web/service.php @@ -12,22 +12,22 @@ const WEEK = 7 * DAY; /** * Thrown when user credentials could not be fetched. - **/ + */ class SessionExpiredException extends UserException {} /** * Thrown when user credentials are invalid. - **/ + */ class BadLoginException extends UserException {} /** * Thrown when client version is outdated. - **/ + */ class OutdatedVersionException extends UserException {} /** * Main class for web applications. - **/ + */ abstract class Service { protected $app; @@ -42,7 +42,7 @@ abstract class Service /** * Starts the user session. - **/ + */ function startSession () { $db = $this->db; @@ -130,7 +130,7 @@ abstract class Service * using base64_decode(). * * return Db\Conn The database connection - **/ + */ function login () { $db = $this->db; @@ -210,7 +210,7 @@ abstract class Service /** * Logouts the current user. Cleans the last saved used credentials. - **/ + */ function logout () { unset ($_SESSION['user']); @@ -221,7 +221,7 @@ abstract class Service * is the current logged user. * * @return {Db\Conn} The database connection - **/ + */ function getUserDb ($user) { if ($this->userDb) @@ -239,7 +239,7 @@ abstract class Service * @param {boolean} $remember Wether to create long live token * @param {boolean} $recover Wether to enable recovery mode on login * @return {string} The JWT generated token - **/ + */ function createToken ($user, $remember = FALSE, $recover = FALSE) { if ($remember) @@ -261,7 +261,7 @@ abstract class Service /** * Runs a method. - **/ + */ function loadMethod ($class) { $db = $this->db; @@ -299,7 +299,7 @@ abstract class Service * Checks if the HTTP connection is secure. * * @return boolean Return %TRUE if its secure, %FALSE otherwise - **/ + */ function isHttps () { return isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'; @@ -309,7 +309,7 @@ abstract class Service * Returns the current URL without the GET part. * * @return string The current URL - **/ + */ function getUrl () { $proto = $this->isHttps () ? 'https' : 'http'; @@ -321,7 +321,7 @@ abstract class Service * modification date of the main script. * * @return string The version number - **/ + */ function getVersion () { return (int) strftime ('%G%m%d%H%M%S', @@ -332,7 +332,7 @@ abstract class Service * Obtains the relative path to document root from an absolute path. * * @return string The relative path - **/ + */ function getDir ($absoluteDir) { error_log ("Absolute: $absoluteDir"); diff --git a/web/util.php b/web/util.php index b5ae3918..b361ece8 100644 --- a/web/util.php +++ b/web/util.php @@ -9,7 +9,7 @@ class Util * * @param string file The file path * @param boolean useXsendfile Wether to use the apache module Xsendfile - **/ + */ static function printFile ($file, $useXsendfile = FALSE) { if (!file_exists ($file))