diff --git a/package/DEBIAN/control b/package/DEBIAN/control index b9e7477c..940c7fac 100644 --- a/package/DEBIAN/control +++ b/package/DEBIAN/control @@ -1,5 +1,5 @@ Package: hedera-web -Version: 1.0-40 +Version: 1.0-42 Architecture: all Maintainer: Juan Ferrer Toribio Depends: apache2, php5-mysql, php-vn-web diff --git a/package/usr/share/hedera-web/forms/admin/access-log/style.css b/package/usr/share/hedera-web/forms/admin/access-log/style.css index c1e09338..35a35eb1 100755 --- a/package/usr/share/hedera-web/forms/admin/access-log/style.css +++ b/package/usr/share/hedera-web/forms/admin/access-log/style.css @@ -8,7 +8,7 @@ max-width: 50em; margin: 0 auto; } -.access-log grid tbody tr +.access-log .htk-grid tbody tr { height: 3.4em; } diff --git a/package/usr/share/hedera-web/forms/admin/access-log/ui.xml b/package/usr/share/hedera-web/forms/admin/access-log/ui.xml index 2c193e14..267055c1 100755 --- a/package/usr/share/hedera-web/forms/admin/access-log/ui.xml +++ b/package/usr/share/hedera-web/forms/admin/access-log/ui.xml @@ -68,12 +68,12 @@ - - - - - - + + + + + + diff --git a/package/usr/share/hedera-web/forms/admin/visits/ui.xml b/package/usr/share/hedera-web/forms/admin/visits/ui.xml index a4928a12..d3c3e178 100755 --- a/package/usr/share/hedera-web/forms/admin/visits/ui.xml +++ b/package/usr/share/hedera-web/forms/admin/visits/ui.xml @@ -136,7 +136,7 @@ - + diff --git a/package/usr/share/hedera-web/forms/cms/home/home.js b/package/usr/share/hedera-web/forms/cms/home/home.js index a986dc88..2a28d022 100755 --- a/package/usr/share/hedera-web/forms/cms/home/home.js +++ b/package/usr/share/hedera-web/forms/cms/home/home.js @@ -2,142 +2,7 @@ Vn.Home = new Class ({ Extends: Vn.Module - - ,dateFormat: _('%a, %e %b %Y') - ,activate: function () - { - var query = 'SELECT title, date_time, text, id FROM news ' - +'WHERE tag != \'course\' ' - +'ORDER BY priority, date_time DESC'; - this.conn.execQuery (query, this.onNewsQueryDone.bind (this)); - -/* this.answer = new Htk.RadioGroup (); - - var query = 'SELECT question, @id := id FROM survey ORDER BY id DESC LIMIT 1; ' - +'SELECT id, answer, votes FROM survey_answer WHERE survey_id = @id'; - this.conn.execQuery (query, this.answersQueryDone.bind (this)); - - this.$('vote-button').addEventListener ('click', this.voteClicked.bind (this)); -*/ } - - ,onNewsQueryDone: function (resultSet) - { - var newsColumn = this.$('news-column'); - var res = resultSet.fetchResult (); - - if (res) - while (res.next ()) - { - var div = document.createElement ('div'); - div.className = 'new'; - - var title = document.createElement ('h2'); - title.appendChild (document.createTextNode (res.get ('title'))); - div.appendChild (title); - - var p = document.createElement ('p'); - p.className = 'new-info'; - div.appendChild (p); - - var date = Vn.Date.strftime (res.get ('date_time'), this.dateFormat); - p.appendChild (document.createTextNode (date)); - - var text = document.createElement ('div'); - text.className = 'new-text'; - div.appendChild (text); - - var html = '' + res.get ('text'); - text.innerHTML = html; - - var img = document.createElement ('img'); - img.alt = ''; - img.src = Vn.Config['image_dir'] + '/news/full/' + res.get ('id') + '.png'; - div.appendChild (img); - - newsColumn.appendChild (div); - } - } - - ,answersQueryDone: function (resultSet) - { - var value = resultSet.fetchValue (); - - var question = this.$('question'); - question.appendChild (document.createTextNode (value)); - - var res = resultSet.fetchResult (); - - this.totalVotes = 0; - var answers = this.$('answers'); - - if (res) - while (res.next ()) - { - var tr = document.createElement ('tr'); - answers.appendChild (tr); - - var td = document.createElement ('td'); - td.className = 'radio'; - tr.appendChild (td); - - var radio = this.answer.createButton (res.get ('id')); - td.appendChild (radio); - - var td = document.createElement ('td'); - tr.appendChild (td); - - var label = document.createElement ('label'); - label.appendChild (document.createTextNode (res.get ('answer'))); - td.appendChild (label); - - var tr = document.createElement ('tr'); - answers.appendChild (tr); - - var td = document.createElement ('td'); - tr.appendChild (td); - - var td = document.createElement ('td'); - tr.appendChild (td); - - var text = document.createTextNode (res.get ('votes') + ' ' + _('votes')); - td.appendChild (text); - - this.totalVotes += res.get ('votes'); - } - - this.refreshVotes (); - } - - ,refreshVotes: function () - { - var totalNode = this.$('total'); - Vn.Node.setText (totalNode, this.totalVotes); - } - - ,voteClicked: function () - { - if (this.answer.value) - { - var query = 'CALL survey_vote (#id)'; - - var batch = new Sql.Batch (); - batch.addParam ('id', this.answer); - - this.conn.execQuery (query, this.voteDone.bind (this), batch); - } - else - alert (_('NoAnswerSelected')); - } - - ,voteDone: function (resultSet) - { - if (resultSet.fetchResult ()) - { - this.totalVotes++; - this.refreshVotes (); - alert (_('ThanksForVote')); - } - } + ,activate: function () {} }); diff --git a/package/usr/share/hedera-web/forms/cms/home/ui.xml b/package/usr/share/hedera-web/forms/cms/home/ui.xml index 5e8d182b..1451f739 100755 --- a/package/usr/share/hedera-web/forms/cms/home/ui.xml +++ b/package/usr/share/hedera-web/forms/cms/home/ui.xml @@ -1,17 +1,25 @@ + + + SELECT title, date_time, text, id FROM news + WHERE tag != 'course' + ORDER BY priority, date_time DESC + +
-
-
diff --git a/package/usr/share/hedera-web/forms/cms/training/training.js b/package/usr/share/hedera-web/forms/cms/training/training.js index 289c19b2..6c6e8b8e 100755 --- a/package/usr/share/hedera-web/forms/cms/training/training.js +++ b/package/usr/share/hedera-web/forms/cms/training/training.js @@ -2,52 +2,6 @@ Vn.Training = new Class ({ Extends: Vn.Module - - ,dateFormat: _('%a, %e %b %Y') - ,activate: function () - { - var query = 'SELECT title, date_time, text, id FROM news ' - +'WHERE tag = \'course\' ' - +'ORDER BY priority, date_time DESC'; - this.conn.execQuery (query, this.onCoursesQueryDone.bind (this)); - } - - ,onCoursesQueryDone: function (resultSet) - { - var coursesColumn = this.$('courses-column'); - var res = resultSet.fetchResult (); - - if (res) - while (res.next ()) - { - var div = document.createElement ('div'); - div.className = 'new'; - - var title = document.createElement ('h2'); - title.appendChild (document.createTextNode (res.get ('title'))); - div.appendChild (title); - - var p = document.createElement ('p'); - p.className = 'new-info'; - div.appendChild (p); - - var date = Vn.Date.strftime (res.get ('date_time'), this.dateFormat); - p.appendChild (document.createTextNode (date)); - - var text = document.createElement ('div'); - text.className = 'new-text'; - div.appendChild (text); - - var html = '' + res.get ('text'); - text.innerHTML = html; - - var img = document.createElement ('img'); - img.alt = ''; - img.src = Vn.Config['image_dir'] + '/news/full/' + res.get ('id') + '.png'; - div.appendChild (img); - - coursesColumn.appendChild (div); - } - } + ,activate: function () {} }); diff --git a/package/usr/share/hedera-web/forms/cms/training/ui.xml b/package/usr/share/hedera-web/forms/cms/training/ui.xml index b4341aa8..b337a82c 100755 --- a/package/usr/share/hedera-web/forms/cms/training/ui.xml +++ b/package/usr/share/hedera-web/forms/cms/training/ui.xml @@ -1,5 +1,25 @@ + + + SELECT title, date_time, text, id FROM news + WHERE tag = 'course' + ORDER BY priority, date_time DESC + +
-
+
+ +
+

+

+ +

+
+ +
+ +
+
+
diff --git a/package/usr/share/hedera-web/forms/ecomerce/catalog/style.css b/package/usr/share/hedera-web/forms/ecomerce/catalog/style.css index bcb075a5..9f653b47 100755 --- a/package/usr/share/hedera-web/forms/ecomerce/catalog/style.css +++ b/package/usr/share/hedera-web/forms/ecomerce/catalog/style.css @@ -29,7 +29,6 @@ .catalog div.main .box { margin: 0 auto; - min-width: 52em; max-width: 70em; } @@ -185,7 +184,24 @@ table.types td.grid-message padding-top: 1em; } -/* Items */ +/* Box view */ + +.item-box +{ + padding: 1em; + border-bottom: 1px solid #DDD; + height: 14em; +} + +.item-box img +{ + float: left; + margin-right: 1em; + max-width: 14em; + max-height: 14em; +} + +/* List view */ table.items { diff --git a/package/usr/share/hedera-web/forms/ecomerce/catalog/ui.xml b/package/usr/share/hedera-web/forms/ecomerce/catalog/ui.xml index f0a9ed45..a93aa4a3 100755 --- a/package/usr/share/hedera-web/forms/ecomerce/catalog/ui.xml +++ b/package/usr/share/hedera-web/forms/ecomerce/catalog/ui.xml @@ -25,6 +25,27 @@ + + CALL item (#warehouse, #date); + SELECT i.grouping, m.amount, Foto, i.available, Article, Categoria, + Medida, Tallos, Color, o.Abreviatura, price, fixed, m.id, + Id_Article + FROM vn2008.Articles a + INNER JOIN vn2008.item_catalog i ON i.item_id = a.Id_Article + LEFT JOIN vn2008.Origen o ON a.id_origen = o.id + LEFT JOIN order_row_view m + ON m.item_id = a.Id_Article AND m.order_id = #order + WHERE #filter AND available > 0 + ORDER BY Article, Medida + LIMIT 400; + DROP TEMPORARY TABLE vn2008.item_catalog; + + + + + + +
@@ -42,28 +63,22 @@
- - - CALL item (#warehouse, #date); - SELECT i.grouping, m.amount, Foto, i.available, Article, Categoria, - Medida, Tallos, Color, o.Abreviatura, price, fixed, m.id, - Id_Article - FROM vn2008.Articles a - INNER JOIN vn2008.item_catalog i ON i.item_id = a.Id_Article - LEFT JOIN vn2008.Origen o ON a.id_origen = o.id - LEFT JOIN order_row_view m - ON m.item_id = a.Id_Article AND m.order_id = #order - WHERE #filter AND available > 0 - ORDER BY Article, Medida - LIMIT 400; - DROP TEMPORARY TABLE vn2008.item_catalog; - - - - - - - + diff --git a/package/usr/share/hedera-web/forms/ecomerce/orders/style.css b/package/usr/share/hedera-web/forms/ecomerce/orders/style.css index 47dc53f8..eb757f38 100755 --- a/package/usr/share/hedera-web/forms/ecomerce/orders/style.css +++ b/package/usr/share/hedera-web/forms/ecomerce/orders/style.css @@ -7,7 +7,7 @@ { max-width: 70em; } -.orders .grid tbody tr +.orders .htk-grid tbody tr { height: 5em; } diff --git a/package/usr/share/hedera-web/image/access-log.png b/package/usr/share/hedera-web/image/deprecated/access-log.png similarity index 100% rename from package/usr/share/hedera-web/image/access-log.png rename to package/usr/share/hedera-web/image/deprecated/access-log.png diff --git a/package/usr/share/hedera-web/image/blogger.png b/package/usr/share/hedera-web/image/deprecated/blogger.png similarity index 100% rename from package/usr/share/hedera-web/image/blogger.png rename to package/usr/share/hedera-web/image/deprecated/blogger.png diff --git a/package/usr/share/hedera-web/image/calendar.png b/package/usr/share/hedera-web/image/deprecated/calendar.png similarity index 100% rename from package/usr/share/hedera-web/image/calendar.png rename to package/usr/share/hedera-web/image/deprecated/calendar.png diff --git a/package/usr/share/hedera-web/image/clean.png b/package/usr/share/hedera-web/image/deprecated/clean.png similarity index 100% rename from package/usr/share/hedera-web/image/clean.png rename to package/usr/share/hedera-web/image/deprecated/clean.png diff --git a/package/usr/share/hedera-web/image/delete.png b/package/usr/share/hedera-web/image/deprecated/delete.png similarity index 100% rename from package/usr/share/hedera-web/image/delete.png rename to package/usr/share/hedera-web/image/deprecated/delete.png diff --git a/package/usr/share/hedera-web/image/edit.png b/package/usr/share/hedera-web/image/deprecated/edit.png similarity index 100% rename from package/usr/share/hedera-web/image/edit.png rename to package/usr/share/hedera-web/image/deprecated/edit.png diff --git a/package/usr/share/hedera-web/image/error.png b/package/usr/share/hedera-web/image/deprecated/error.png similarity index 100% rename from package/usr/share/hedera-web/image/error.png rename to package/usr/share/hedera-web/image/deprecated/error.png diff --git a/package/usr/share/hedera-web/image/exit.png b/package/usr/share/hedera-web/image/deprecated/exit.png similarity index 100% rename from package/usr/share/hedera-web/image/exit.png rename to package/usr/share/hedera-web/image/deprecated/exit.png diff --git a/package/usr/share/hedera-web/image/facebook.png b/package/usr/share/hedera-web/image/deprecated/facebook.png similarity index 100% rename from package/usr/share/hedera-web/image/facebook.png rename to package/usr/share/hedera-web/image/deprecated/facebook.png diff --git a/package/usr/share/hedera-web/image/git.png b/package/usr/share/hedera-web/image/deprecated/git.png similarity index 100% rename from package/usr/share/hedera-web/image/git.png rename to package/usr/share/hedera-web/image/deprecated/git.png diff --git a/package/usr/share/hedera-web/image/go-previous.png b/package/usr/share/hedera-web/image/deprecated/go-previous.png similarity index 100% rename from package/usr/share/hedera-web/image/go-previous.png rename to package/usr/share/hedera-web/image/deprecated/go-previous.png diff --git a/package/usr/share/hedera-web/image/google-plus.png b/package/usr/share/hedera-web/image/deprecated/google-plus.png similarity index 100% rename from package/usr/share/hedera-web/image/google-plus.png rename to package/usr/share/hedera-web/image/deprecated/google-plus.png diff --git a/package/usr/share/hedera-web/image/info.png b/package/usr/share/hedera-web/image/deprecated/info.png similarity index 100% rename from package/usr/share/hedera-web/image/info.png rename to package/usr/share/hedera-web/image/deprecated/info.png diff --git a/package/usr/share/hedera-web/image/logo-big.png b/package/usr/share/hedera-web/image/deprecated/logo-big.png similarity index 100% rename from package/usr/share/hedera-web/image/logo-big.png rename to package/usr/share/hedera-web/image/deprecated/logo-big.png diff --git a/package/usr/share/hedera-web/image/logo.png b/package/usr/share/hedera-web/image/deprecated/logo.png similarity index 100% rename from package/usr/share/hedera-web/image/logo.png rename to package/usr/share/hedera-web/image/deprecated/logo.png diff --git a/package/usr/share/hedera-web/image/ok.png b/package/usr/share/hedera-web/image/deprecated/ok.png similarity index 100% rename from package/usr/share/hedera-web/image/ok.png rename to package/usr/share/hedera-web/image/deprecated/ok.png diff --git a/package/usr/share/hedera-web/image/order.png b/package/usr/share/hedera-web/image/deprecated/order.png similarity index 100% rename from package/usr/share/hedera-web/image/order.png rename to package/usr/share/hedera-web/image/deprecated/order.png diff --git a/package/usr/share/hedera-web/image/pay.png b/package/usr/share/hedera-web/image/deprecated/pay.png similarity index 100% rename from package/usr/share/hedera-web/image/pay.png rename to package/usr/share/hedera-web/image/deprecated/pay.png diff --git a/package/usr/share/hedera-web/image/print.png b/package/usr/share/hedera-web/image/deprecated/print.png similarity index 100% rename from package/usr/share/hedera-web/image/print.png rename to package/usr/share/hedera-web/image/deprecated/print.png diff --git a/package/usr/share/hedera-web/image/refresh.png b/package/usr/share/hedera-web/image/deprecated/refresh.png similarity index 100% rename from package/usr/share/hedera-web/image/refresh.png rename to package/usr/share/hedera-web/image/deprecated/refresh.png diff --git a/package/usr/share/hedera-web/image/remove.png b/package/usr/share/hedera-web/image/deprecated/remove.png similarity index 100% rename from package/usr/share/hedera-web/image/remove.png rename to package/usr/share/hedera-web/image/deprecated/remove.png diff --git a/package/usr/share/hedera-web/image/show.png b/package/usr/share/hedera-web/image/deprecated/show.png similarity index 100% rename from package/usr/share/hedera-web/image/show.png rename to package/usr/share/hedera-web/image/deprecated/show.png diff --git a/package/usr/share/hedera-web/image/unavailable.png b/package/usr/share/hedera-web/image/deprecated/unavailable.png similarity index 100% rename from package/usr/share/hedera-web/image/unavailable.png rename to package/usr/share/hedera-web/image/deprecated/unavailable.png diff --git a/package/usr/share/hedera-web/image/youtube.png b/package/usr/share/hedera-web/image/deprecated/youtube.png similarity index 100% rename from package/usr/share/hedera-web/image/youtube.png rename to package/usr/share/hedera-web/image/deprecated/youtube.png diff --git a/package/usr/share/hedera-web/js/htk/field/html.js b/package/usr/share/hedera-web/js/htk/field/html.js new file mode 100755 index 00000000..920bc001 --- /dev/null +++ b/package/usr/share/hedera-web/js/htk/field/html.js @@ -0,0 +1,16 @@ +Htk.Html = new Class +({ + Extends: Htk.Field + ,Tag: 'htk-html' + + ,initialize: function (props) + { + this.parent (props); + this.createElement ('div'); + } + + ,putValue: function (value) + { + this.node.innerHTML = value; + } +}); diff --git a/package/usr/share/hedera-web/js/htk/field/image.js b/package/usr/share/hedera-web/js/htk/field/image.js index 2697c69c..054650a8 100755 --- a/package/usr/share/hedera-web/js/htk/field/image.js +++ b/package/usr/share/hedera-web/js/htk/field/image.js @@ -2,18 +2,39 @@ Htk.Image = new Class ({ Extends: Htk.Entry ,Tag: 'htk-image' - + ,Properties: + { + /** + * The directory where the images are allocated. + **/ + directory: + { + type: String + ,set: function (x) + { + this._directory = x; + this.basedir = Vn.Config['image_dir'] +'/'+ x; + this.render (false); + } + ,get: function () + { + return this._directory; + } + } + } + + ,_directory: null + ,basedir: null ,empty: false - ,file: null ,initialize: function (props) { this.parent (props); - this.node = document.getElementById (nodeId); - this.node.addEventListener ('error', this.error.bind (this)); + this.createElement ('img'); +// this.node.addEventListener ('error', this.onImageError.bind (this)); } - ,error: function () + ,onImageError: function () { if (!this.empty) { @@ -24,24 +45,26 @@ Htk.Image = new Class ,render: function (force) { - if (this.realValue) + if (this._value) { - this.file = this.realValue + '.png'; + var url = ''; + + if (this.basedir) + url += this.basedir +'/'; + + url += this._value; if (force) - this.file += '?' + (new Date()).getTime (); + url += '?' + (new Date()).getTime (); this.empty = false; - this.node.src = this.url + '/' + this.file; + this.node.src = url; } else - { - this.file = null; - this.error (); - } + this.onImageError (); } - ,setRealValue: function (value) + ,putValue: function (value) { this.render (false); } @@ -50,11 +73,9 @@ Htk.Image = new Class { if (show) { - var obj = this; - this.node.addEventListener ('mouseover', - function () { obj.mouseOver () }, false); - this.node.addEventListener ('mouseout', - function () { obj.mouseOut () }, false); + this.fullImage = new Htk.FullImage (); + this.node.addEventListener ('mouseover', this.onMouseOver.bind (this)); + this.node.addEventListener ('mouseout', this.onMouseOut.bind (this)); } } @@ -65,29 +86,29 @@ Htk.Image = new Class var obj = this; this.style.cursor = 'pointer'; this.node.addEventListener ('dblclick', - function (e) { obj.dblClicked (e) }, false); + this.onDoubleClick.bind (this)); } } - ,dblClicked: function (event) + ,onDoubleClick: function (event) { - var form = htkImageForm.node; - form.style.top = getPageYOffset () + (event.clientY - 80) + 'px'; - form.style.left = (event.clientX + 30) + 'px'; - document.body.appendChild (form); - htkImageForm.load (this); + var editor = new Htk.ImageEditor (); + editor.setData (cell.value, this._directory); + + this.popup = new Htk.Popup (); + this.popup.setChild (editor); + this.popup.show (this.node); } - ,mouseOver: function () + ,onMouseOver: function (cell) { - if (!this.empty) - htkImageFull.show (this.url + '/../full', this.file); + if (!cell.empty) + this.fullImage.show (this.basedir, cell.value); } - - ,mouseOut: function () + + ,onMouseOut: function () { - if (!this.empty) - htkImageFull.hide (); + this.fullImage.hide (); } }); diff --git a/package/usr/share/hedera-web/js/htk/field/label.js b/package/usr/share/hedera-web/js/htk/field/label.js index 4d890607..a40a3d39 100755 --- a/package/usr/share/hedera-web/js/htk/field/label.js +++ b/package/usr/share/hedera-web/js/htk/field/label.js @@ -13,6 +13,7 @@ Htk.Label = new Class ,set: function (x) { this._format = _(x); + this.putValue (this._value); } ,get: function () { diff --git a/package/usr/share/hedera-web/js/htk/field/text.js b/package/usr/share/hedera-web/js/htk/field/text.js new file mode 100755 index 00000000..e092d90d --- /dev/null +++ b/package/usr/share/hedera-web/js/htk/field/text.js @@ -0,0 +1,37 @@ +Htk.Text = new Class +({ + Extends: Htk.Field + ,Tag: 'htk-text' + ,Properties: + { + /** + * Format that applies to the value. + **/ + format: + { + type: String + ,set: function (x) + { + this._format = _(x); + this.putValue (this._value); + } + ,get: function () + { + return this._format; + } + } + } + + ,_format: null + + ,initialize: function (props) + { + this.parent (props); + this.node = document.createTextNode (''); + } + + ,putValue: function (value) + { + this.node.nodeValue = Vn.Value.format (value, this._format); + } +}); diff --git a/package/usr/share/hedera-web/js/htk/image-editor.js b/package/usr/share/hedera-web/js/htk/image-editor.js index 16afa08f..dcfaf63b 100755 --- a/package/usr/share/hedera-web/js/htk/image-editor.js +++ b/package/usr/share/hedera-web/js/htk/image-editor.js @@ -42,7 +42,7 @@ Htk.ImageEditor = new Class this.$('name').addEventListener ('change', function () { - this.signalEmit ('name-changed', this.nameInput.value); + this.signalEmit ('name-changed', this.$('name').value); } .bind (this)); } diff --git a/package/usr/share/hedera-web/js/htk/main.php b/package/usr/share/hedera-web/js/htk/main.php index 3f9dfd46..dbe813b3 100755 --- a/package/usr/share/hedera-web/js/htk/main.php +++ b/package/usr/share/hedera-web/js/htk/main.php @@ -7,11 +7,14 @@ Vn\Hedera\Js::includeLib ('htk' ,'widget' ,'popup' ,'toast' + ,'repeater' ,'grid' ,'radio-group' ,'full-image' ,'image-editor' ,'field' + ,'field/text' + ,'field/html' ,'field/entry' ,'field/radio' ,'field/label' diff --git a/package/usr/share/hedera-web/js/htk/repeater.js b/package/usr/share/hedera-web/js/htk/repeater.js new file mode 100755 index 00000000..e383f22d --- /dev/null +++ b/package/usr/share/hedera-web/js/htk/repeater.js @@ -0,0 +1,102 @@ +Htk.Repeater = new Class +({ + Extends: Htk.Widget + ,Tag: 'htk-repeater' + ,Properties: + { + model: + { + type: Db.Model + ,set: function (x) + { + this.link ({_model: x}, + { + 'status-changed': this.onModelChange + ,'row-deleted': this.onRowDelete + ,'row-updated': this.onRowUpdate + ,'row-inserted': this.onRowInsert + ,'updatable-changed': this.onUpdatableChange + }); + + this.onModelChange (); + } + ,get: function () + { + this._model; + } + } + ,formId: + { + type: String + ,set: function (x) + { + this._alias = x; + } + ,get: function () + { + this._alias; + } + } + } + + ,xml: null + ,parentBuilder: null + ,_alias: 'form' + + ,initialize: function () + { + this.createElement ('div'); + } + + ,loadXml: function (builder, node) + { + this.xml = node.firstElementChild; + this.parentBuilder = builder; + this.onModelChange (); + } + + ,onModelChange: function () + { + if (!this._model || !this.xml) + return; + + Vn.Node.removeChilds (this.node); + + if (!this._model.ready) + return; + + for (var i = 0; i < this._model.numRows; i++) + { + var builder = new Vn.Builder (); + + var form = new Db.Form (); + form.model = this._model; + form.row = i; + builder.add (this._alias, form); + + var mainNode = builder.loadXmlFromNode (this.xml); + this.node.appendChild (mainNode); + } + } + + ,onRowDelete: function (model, row) + { + var childs = this.node.childNodes; + this.node.removeChild (childs[row]); + } + + ,onRowUpdate: function () + { + + } + + ,onRowInsert: function () + { + + } + + ,onUpdatableChange: function () + { + + } +}); diff --git a/package/usr/share/hedera-web/js/htk/widget.js b/package/usr/share/hedera-web/js/htk/widget.js index c57fad04..1e560b5c 100755 --- a/package/usr/share/hedera-web/js/htk/widget.js +++ b/package/usr/share/hedera-web/js/htk/widget.js @@ -38,19 +38,7 @@ Htk.Widget = new Class { return this.node; } - - ,ui: function (uiFile) - { - this.builder = new Vn.Builder (); - this.builder.load (uiFile, this.onUiReady.bind (this)); - } - - ,onUiReady: function () - { - this.node = this.builder.getNode (); - this.uiReady (); - } - + ,$: function (id) { if (this.builder) @@ -58,10 +46,4 @@ Htk.Widget = new Class return null; } - - /** - * Virtual method that shoud be implemented by all widgets using the ui - * builder. - **/ - ,uiReady: function () {} }); diff --git a/package/usr/share/hedera-web/js/vn/builder.js b/package/usr/share/hedera-web/js/vn/builder.js index cfe8b3df..d7ce350a 100755 --- a/package/usr/share/hedera-web/js/vn/builder.js +++ b/package/usr/share/hedera-web/js/vn/builder.js @@ -16,11 +16,6 @@ Vn.Builder = new Class this.objectMap[key].destroy (); } } - - ,getNode: function () - { - return this.mainNode; - } ,loadXml: function (xmlDoc) { @@ -43,6 +38,20 @@ Vn.Builder = new Class delete this.contexts; return true; } + + ,loadXmlFromNode: function (node) + { + this.contexts = []; + var mainNode = this.loadNode (node, null); + this.resolveProperties (); + delete this.contexts; + return mainNode; + } + + ,add: function (id, object) + { + this.objectMap[id] = object; + } ,loadNode: function (node, parentContext) { diff --git a/package/usr/share/hedera-web/locale/ca/ajax/image.json b/package/usr/share/hedera-web/locale/ca/rest/image.json similarity index 100% rename from package/usr/share/hedera-web/locale/ca/ajax/image.json rename to package/usr/share/hedera-web/locale/ca/rest/image.json diff --git a/package/usr/share/hedera-web/locale/ca/ajax/query.json b/package/usr/share/hedera-web/locale/ca/rest/query.json similarity index 100% rename from package/usr/share/hedera-web/locale/ca/ajax/query.json rename to package/usr/share/hedera-web/locale/ca/rest/query.json diff --git a/package/usr/share/hedera-web/locale/es/ajax/image.json b/package/usr/share/hedera-web/locale/es/rest/image.json similarity index 100% rename from package/usr/share/hedera-web/locale/es/ajax/image.json rename to package/usr/share/hedera-web/locale/es/rest/image.json diff --git a/package/usr/share/hedera-web/locale/es/ajax/query.json b/package/usr/share/hedera-web/locale/es/rest/query.json similarity index 100% rename from package/usr/share/hedera-web/locale/es/ajax/query.json rename to package/usr/share/hedera-web/locale/es/rest/query.json diff --git a/package/usr/share/hedera-web/locale/fr/ajax/image.json b/package/usr/share/hedera-web/locale/fr/rest/image.json similarity index 100% rename from package/usr/share/hedera-web/locale/fr/ajax/image.json rename to package/usr/share/hedera-web/locale/fr/rest/image.json diff --git a/package/usr/share/hedera-web/locale/fr/ajax/query.json b/package/usr/share/hedera-web/locale/fr/rest/query.json similarity index 100% rename from package/usr/share/hedera-web/locale/fr/ajax/query.json rename to package/usr/share/hedera-web/locale/fr/rest/query.json diff --git a/package/usr/share/hedera-web/pages/login/style.css b/package/usr/share/hedera-web/pages/login/style.css index 84b977ff..e5f4b1aa 100755 --- a/package/usr/share/hedera-web/pages/login/style.css +++ b/package/usr/share/hedera-web/pages/login/style.css @@ -72,7 +72,7 @@ a { position: absolute; margin-top: -17em; - padding: 2em; + padding: 1em; max-width: 45em; top: 50%; left: 0; diff --git a/package/usr/share/hedera-web/pages/web/web.js b/package/usr/share/hedera-web/pages/web/web.js index 5e4c9c53..602d14bb 100755 --- a/package/usr/share/hedera-web/pages/web/web.js +++ b/package/usr/share/hedera-web/pages/web/web.js @@ -47,6 +47,12 @@ Vn.Web = { event.stopPropagation (); }); + + if (!Vn.Cookie.check ('hedera_cookies')) + { + Vn.Cookie.set ('hedera_cookies', true); + (new Htk.Toast ()).showWarning (_('CookiesNotification')); + } } ,showBackground: function ()