forked from verdnatura/hedera-web
Checkpoint
This commit is contained in:
parent
11ba609144
commit
546e67d6f6
|
@ -3,39 +3,37 @@ Hedera.AddressList = new Class
|
||||||
({
|
({
|
||||||
Extends: Hedera.Form
|
Extends: Hedera.Form
|
||||||
|
|
||||||
,activate: function ()
|
,activate: function() {
|
||||||
{
|
this.$('user-model').setInfo('c', 'myClient', 'hedera');
|
||||||
this.$('user-model').setInfo ('c', 'myClient', 'hedera');
|
this.$('addresses').setInfo('a', 'myAddress', 'hedera');
|
||||||
this.$('addresses').setInfo ('a', 'myAddress', 'hedera');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,onAddAddressClick: function ()
|
,onAddAddressClick: function() {
|
||||||
{
|
this.hash.set({
|
||||||
this.hash.set ({
|
|
||||||
form: 'account/address',
|
form: 'account/address',
|
||||||
address: 0
|
address: 0
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
,onReturnClick: function ()
|
,onReturnClick: function() {
|
||||||
{
|
|
||||||
window.history.back();
|
window.history.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
,onRemoveAddressClick: function (button, form)
|
,onSetDefaultClick: function() {
|
||||||
{
|
Htk.Toast.showMessage(_('DefaultAddressModified'));
|
||||||
if (confirm (_('AreYouSureDeleteAddress')))
|
}
|
||||||
{
|
|
||||||
form.set ('isActive', false);
|
,onRemoveAddressClick: function(button, form) {
|
||||||
form.refresh ();
|
if (confirm(_('AreYouSureDeleteAddress'))) {
|
||||||
|
form.set('isActive', false);
|
||||||
|
form.refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
,onEditAddressClick: function (button, form)
|
,onEditAddressClick: function(button, form) {
|
||||||
{
|
this.hash.set({
|
||||||
this.hash.set ({
|
|
||||||
form: 'account/address',
|
form: 'account/address',
|
||||||
address: form.get ('id')
|
address: form.get('id')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,3 +5,4 @@ SetAsDefault: Establir com per defecte
|
||||||
RemoveAddress: Esborrar direcció
|
RemoveAddress: Esborrar direcció
|
||||||
EditAddress: Modificar direcció
|
EditAddress: Modificar direcció
|
||||||
AreYouSureDeleteAddress: Estàs segur de que vols eliminar la direcció?
|
AreYouSureDeleteAddress: Estàs segur de que vols eliminar la direcció?
|
||||||
|
DefaultAddressModified: Adreça per defecte modificada
|
||||||
|
|
|
@ -5,3 +5,4 @@ SetAsDefault: Set as default
|
||||||
RemoveAddress: Remove address
|
RemoveAddress: Remove address
|
||||||
EditAddress: Edit address
|
EditAddress: Edit address
|
||||||
AreYouSureDeleteAddress: Are you sure you want to delete the address?
|
AreYouSureDeleteAddress: Are you sure you want to delete the address?
|
||||||
|
DefaultAddressModified: Default address modified
|
||||||
|
|
|
@ -5,3 +5,4 @@ SetAsDefault: Establecer como predeterminada
|
||||||
RemoveAddress: Borrar dirección
|
RemoveAddress: Borrar dirección
|
||||||
EditAddress: Modificar dirección
|
EditAddress: Modificar dirección
|
||||||
AreYouSureDeleteAddress: ¿Estás seguro de que quieres borrar la dirección?
|
AreYouSureDeleteAddress: ¿Estás seguro de que quieres borrar la dirección?
|
||||||
|
DefaultAddressModified: Dirección por defecto modificada
|
||||||
|
|
|
@ -5,3 +5,4 @@ SetAsDefault: Définir par défaut
|
||||||
RemoveAddress: Supprimer l'adresse
|
RemoveAddress: Supprimer l'adresse
|
||||||
EditAddress: Changement d'adresse
|
EditAddress: Changement d'adresse
|
||||||
AreYouSureDeleteAddress: Souhaitez-vous vraiment supprier l'adresse?
|
AreYouSureDeleteAddress: Souhaitez-vous vraiment supprier l'adresse?
|
||||||
|
DefaultAddressModified: Adresse par défaut modifiée
|
||||||
|
|
|
@ -5,3 +5,4 @@ SetAsDefault: Selecionar como pre-determinado
|
||||||
RemoveAddress: Eliminar Morada
|
RemoveAddress: Eliminar Morada
|
||||||
EditAddress: Modificar Morada
|
EditAddress: Modificar Morada
|
||||||
AreYouSureDeleteAddress: Tens certeza que queres eliminar esta morada?
|
AreYouSureDeleteAddress: Tens certeza que queres eliminar esta morada?
|
||||||
|
DefaultAddressModified: Endereço padrão modificado
|
||||||
|
|
|
@ -1,48 +1,15 @@
|
||||||
|
|
||||||
.address-list
|
.address-list {
|
||||||
{
|
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
}
|
}
|
||||||
.address-list .box
|
.address-list .box {
|
||||||
{
|
|
||||||
max-width: 30em;
|
max-width: 30em;
|
||||||
}
|
}
|
||||||
.address-list .form
|
.address-list .form {
|
||||||
{
|
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
max-width: 25em;
|
max-width: 25em;
|
||||||
padding: 2em;
|
padding: 2em;
|
||||||
}
|
}
|
||||||
.address
|
.address-list .htk-list .side {
|
||||||
{
|
padding-right: 16px;
|
||||||
padding: 1em;
|
|
||||||
border-bottom: 1px solid #DDD;
|
|
||||||
}
|
|
||||||
.address p
|
|
||||||
{
|
|
||||||
margin: 0.2em 0;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.address p.important
|
|
||||||
{
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
.address .actions
|
|
||||||
{
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
.address .actions > .htk-button
|
|
||||||
{
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.address .actions > *
|
|
||||||
{
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.address .actions > input
|
|
||||||
{
|
|
||||||
margin: .6em;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,15 +33,28 @@
|
||||||
id="default-address"
|
id="default-address"
|
||||||
column="defaultAddressFk"
|
column="defaultAddressFk"
|
||||||
form="user-form"/>
|
form="user-form"/>
|
||||||
<htk-repeater model="addresses" form-id="iter">
|
<htk-repeater model="addresses" form-id="iter" class="htk-list">
|
||||||
<custom>
|
<custom>
|
||||||
<div class="address">
|
<div class="address item" on-click="onSetDefaultClick">
|
||||||
<div class="actions">
|
<div class="side">
|
||||||
<htk-radio
|
<htk-radio
|
||||||
form="iter"
|
form="iter"
|
||||||
column="id"
|
column="id"
|
||||||
radio-group="default-address"
|
radio-group="default-address"
|
||||||
tip="_SetAsDefault"/>
|
tip="_SetAsDefault"/>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<p class="important">
|
||||||
|
{{iter.nickname}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{iter.street}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{iter.postalCode}}, {{iter.city}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
<htk-button
|
<htk-button
|
||||||
form="iter"
|
form="iter"
|
||||||
column="id"
|
column="id"
|
||||||
|
@ -55,16 +68,6 @@
|
||||||
icon="edit"
|
icon="edit"
|
||||||
on-click="onEditAddressClick"/>
|
on-click="onEditAddressClick"/>
|
||||||
</div>
|
</div>
|
||||||
<p class="important">
|
|
||||||
<htk-text form="iter" column="nickname"/>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<htk-text form="iter" column="street"/>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<htk-text form="iter" column="postalCode"/>,
|
|
||||||
<htk-text form="iter" column="city"/>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</custom>
|
</custom>
|
||||||
</htk-repeater>
|
</htk-repeater>
|
||||||
|
|
|
@ -43,9 +43,13 @@
|
||||||
}
|
}
|
||||||
.new-text {
|
.new-text {
|
||||||
margin: 1.5em 0;
|
margin: 1.5em 0;
|
||||||
|
font-family: 'Open Sans';
|
||||||
|
line-height: 1.3em;
|
||||||
}
|
}
|
||||||
.new-text a {
|
.new-text a {
|
||||||
color: blue;
|
color: #6a1;
|
||||||
|
}
|
||||||
|
.new-text a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
.new-text li {
|
.new-text li {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="form" class="home">
|
<div id="form" class="home">
|
||||||
<div class="column mansonry" id="news-column">
|
<div class="column mansonry" id="news-column">
|
||||||
<htk-repeater form-id="new">
|
<htk-repeater form-id="iter">
|
||||||
<db-model property="model">
|
<db-model property="model">
|
||||||
<custom>
|
<custom>
|
||||||
SELECT title, text, image, id FROM news
|
SELECT title, text, image, id FROM news
|
||||||
|
@ -25,14 +25,14 @@
|
||||||
<htk-image
|
<htk-image
|
||||||
directory="news"
|
directory="news"
|
||||||
subdir="full"
|
subdir="full"
|
||||||
form="new"
|
form="iter"
|
||||||
column="image"
|
column="image"
|
||||||
editable="false"
|
editable="false"
|
||||||
full-dir="full"/>
|
full-dir="full"/>
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<h2><htk-text form="new" column="title"/></h2>
|
<h2>{{iter.title}}</h2>
|
||||||
<div class="new-text">
|
<div class="new-text">
|
||||||
<htk-html form="new" column="text"/>
|
<htk-html value="{{iter.text}}"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,56 +3,43 @@ Hedera.Basket = new Class
|
||||||
({
|
({
|
||||||
Extends: Hedera.Form
|
Extends: Hedera.Form
|
||||||
|
|
||||||
,open: function ()
|
,open: function() {
|
||||||
{
|
this.close();
|
||||||
this.close ();
|
|
||||||
this.isOpen = true;
|
this.isOpen = true;
|
||||||
|
|
||||||
Hedera.BasketChecker.check (this.conn,
|
Hedera.BasketChecker.check(this.conn,
|
||||||
this.onBasketCheck.bind (this));
|
this.onBasketCheck.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
,onBasketCheck: function (isOk)
|
,onBasketCheck: function(isOk) {
|
||||||
{
|
|
||||||
if (isOk)
|
if (isOk)
|
||||||
this.loadUi ();
|
this.loadUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
,activate: function ()
|
,activate: function() {
|
||||||
{
|
this.$('items').setInfo('bi', 'myBasketItem', 'hedera');
|
||||||
this.$('items').setInfo ('bi', 'myBasketItem', 'hedera');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,onConfigureClick: function ()
|
,onConfigureClick: function() {
|
||||||
{
|
Htk.Toast.showWarning(_('RememberReconfiguringImpact'));
|
||||||
Htk.Toast.showWarning (_('RememberReconfiguringImpact'));
|
this.hash.set({form: 'ecomerce/checkout'});
|
||||||
this.hash.set ({form: 'ecomerce/checkout'});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,onCatalogClick: function ()
|
,onCatalogClick: function() {
|
||||||
{
|
this.hash.set({form: 'ecomerce/catalog'});
|
||||||
this.hash.set ({form: 'ecomerce/catalog'});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,onCheckoutClick: function ()
|
,onCheckoutClick: function() {
|
||||||
{
|
this.hash.set({form: 'ecomerce/confirm'});
|
||||||
this.hash.set ({form: 'ecomerce/confirm'});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,repeaterFunc: function (res, form)
|
,onDeleteClick: function(button, form) {
|
||||||
{
|
if (confirm(_('ReallyDelete')))
|
||||||
res.$('subtotal').value = this.subtotal (form);
|
form.deleteRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
,onDeleteClick: function (button, form)
|
,subtotal: function(form) {
|
||||||
{
|
return form.get('amount') * form.get('price');
|
||||||
if (confirm (_('ReallyDelete')))
|
|
||||||
form.deleteRow ();
|
|
||||||
}
|
|
||||||
|
|
||||||
,subtotal: function (form)
|
|
||||||
{
|
|
||||||
return form.get ('amount') * form.get ('price');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,24 @@
|
||||||
.basket
|
.basket {
|
||||||
{
|
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
}
|
}
|
||||||
.basket .box
|
.basket .box {
|
||||||
{
|
|
||||||
max-width: 30em;
|
max-width: 30em;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 0 2em;
|
padding: 30px;
|
||||||
}
|
}
|
||||||
.basket .form > p
|
.basket .form > p {
|
||||||
{
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
color: white;
|
color: white;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.basket .head
|
.basket .head {
|
||||||
{
|
padding-bottom: 30px;
|
||||||
padding: 1.8em 0;
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border-bottom: 1px solid #DDD;
|
border-bottom: 1px solid #DDD;
|
||||||
}
|
}
|
||||||
.basket .head p
|
.basket .head p {
|
||||||
{
|
font-weight: bold;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
|
@ -31,61 +27,48 @@
|
||||||
|
|
||||||
/* Lines */
|
/* Lines */
|
||||||
|
|
||||||
.basket .lines
|
.basket .line {
|
||||||
{
|
display: flex;
|
||||||
padding: .8em 0;
|
gap: 20px;
|
||||||
|
margin: 24px 0;
|
||||||
|
height: 65px;
|
||||||
}
|
}
|
||||||
.basket .line
|
.basket .line:last-child {
|
||||||
{
|
margin-bottom: 0;
|
||||||
padding: 1em 0;
|
|
||||||
}
|
}
|
||||||
.basket .line > .delete
|
.basket .line > .delete {
|
||||||
{
|
align-self: center;
|
||||||
margin: -0.5em;
|
|
||||||
margin-top: 1em;
|
|
||||||
margin-right: .5em;
|
|
||||||
float: left;
|
|
||||||
}
|
}
|
||||||
.basket .line > .photo
|
.basket .line > .photo {
|
||||||
{
|
flex: none;
|
||||||
margin-right: 1em;
|
|
||||||
float: left;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
height: 4.25em;
|
width: 65px;
|
||||||
width: 4.25em;
|
|
||||||
}
|
}
|
||||||
.basket .line > .info
|
.basket .line > .info {
|
||||||
{
|
flex: 1;
|
||||||
margin-left: 7.5em;
|
|
||||||
}
|
}
|
||||||
.basket .line > .info > h2
|
.basket .line > .info > h2 {
|
||||||
{
|
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
padding-bottom: .1em;
|
padding-bottom: .1em;
|
||||||
}
|
}
|
||||||
.basket .line > .info > p
|
.basket .line > .info > p {
|
||||||
{
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.basket .line > .info > .tags
|
.basket .line > .info > .tags {
|
||||||
{
|
|
||||||
color: #777;
|
color: #777;
|
||||||
}
|
}
|
||||||
.basket .line .subtotal
|
.basket .line .subtotal {
|
||||||
{
|
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fields */
|
/* Fields */
|
||||||
|
|
||||||
.basket td.available-exceeded input
|
.basket td.available-exceeded input {
|
||||||
{
|
|
||||||
background-color: #FCC;
|
background-color: #FCC;
|
||||||
}
|
}
|
||||||
.basket .icon > img
|
.basket .icon > img {
|
||||||
{
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="lines">
|
<div class="lines">
|
||||||
<htk-repeater form-id="iter" renderer="repeaterFunc">
|
<htk-repeater form-id="iter">
|
||||||
<db-model id="items" property="model" updatable="true">
|
<db-model id="items" property="model" updatable="true">
|
||||||
SELECT bi.id, bi.amount, bi.price, i.longName item,
|
SELECT bi.id, bi.amount, bi.price, i.longName item,
|
||||||
i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7,
|
i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7,
|
||||||
|
@ -60,19 +60,15 @@
|
||||||
<htk-text form="iter" column="item"/>
|
<htk-text form="iter" column="item"/>
|
||||||
</h2>
|
</h2>
|
||||||
<p class="tags">
|
<p class="tags">
|
||||||
<htk-text form="iter" column="value5"/>
|
{{iter.value5}} {{iter.value6}} {{iter.value7}}
|
||||||
<htk-text form="iter" column="value6"/>
|
|
||||||
<htk-text form="iter" column="value7"/>
|
|
||||||
</p>
|
</p>
|
||||||
<p class="amount">
|
<p class="amount">
|
||||||
<htk-text form="iter" column="amount"/> x
|
{{iter.amount}} x {{Vn.Value.format(iter.price, '%.2d€')}}
|
||||||
<htk-text form="iter" column="price" format="%.2d€"/>
|
|
||||||
<span class="subtotal">
|
<span class="subtotal">
|
||||||
<htk-text id="subtotal" format="%.2d€"/>
|
{{Vn.Value.format(iter.price * iter.amount, '%.2d€')}}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"/>
|
|
||||||
</div>
|
</div>
|
||||||
</custom>
|
</custom>
|
||||||
</htk-repeater>
|
</htk-repeater>
|
||||||
|
|
|
@ -103,11 +103,6 @@ Hedera.Catalog = new Class({
|
||||||
'form': this.hash.get('form'),
|
'form': this.hash.get('form'),
|
||||||
'realm': form.get('id')
|
'realm': form.get('id')
|
||||||
});
|
});
|
||||||
|
|
||||||
var img = builder.$('image');
|
|
||||||
img.src = 'image/family/black/'+ form.get('code') +'.svg';
|
|
||||||
img.title = form.get('name');
|
|
||||||
img.alt = img.title;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,onRealmChange: function(param, newValue) {
|
,onRealmChange: function(param, newValue) {
|
||||||
|
|
|
@ -121,7 +121,7 @@
|
||||||
<div
|
<div
|
||||||
id="item-box"
|
id="item-box"
|
||||||
class="box item-box"
|
class="box item-box"
|
||||||
title="_AddToBasket">
|
title="{{_('AddToBasket')}}">
|
||||||
<htk-image
|
<htk-image
|
||||||
directory="catalog"
|
directory="catalog"
|
||||||
subdir="200x200"
|
subdir="200x200"
|
||||||
|
@ -131,34 +131,34 @@
|
||||||
full-dir="1600x900"/>
|
full-dir="1600x900"/>
|
||||||
<div class="item-info">
|
<div class="item-info">
|
||||||
<h2>
|
<h2>
|
||||||
<htk-text form="item" column="item"/>
|
{{item.item}}
|
||||||
</h2>
|
</h2>
|
||||||
<p class="sub-name">
|
<p class="sub-name">
|
||||||
<htk-text form="item" column="subName"/>
|
{{item.subName}}
|
||||||
</p>
|
</p>
|
||||||
<table class="tags">
|
<table class="tags">
|
||||||
<tr>
|
<tr>
|
||||||
<td><htk-text form="item" column="tag5"/></td>
|
<td>{{item.tag5}}</td>
|
||||||
<td><htk-text form="item" column="value5"/></td>
|
<td>{{item.value5}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><htk-text form="item" column="tag6"/></td>
|
<td>{{item.tag6}}</td>
|
||||||
<td><htk-text form="item" column="value6"/></td>
|
<td>{{item.value6}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><htk-text form="item" column="tag7"/></td>
|
<td>{{item.tag7}}</td>
|
||||||
<td><htk-text form="item" column="value7"/></td>
|
<td>{{item.value7}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="available-price">
|
<div class="available-price">
|
||||||
<span class="grouping" title="_MinimalGrouping">
|
<span class="grouping" title="_MinimalGrouping">
|
||||||
<htk-text form="item" column="grouping" format="x%.0d"/>
|
{{Vn.Value.format(item.grouping, 'x%.0d')}}
|
||||||
</span>
|
</span>
|
||||||
<span class="available" title="_Available">
|
<span class="available" title="_Available">
|
||||||
<htk-text form="item" column="available"/>
|
{{item.available}}
|
||||||
</span>
|
</span>
|
||||||
<span class="price" title="_GroupingPrice">
|
<span class="price" title="_GroupingPrice">
|
||||||
<htk-text form="item" column="price" format="%.2d€"/>
|
{{Vn.Value.format(item.price, 'x%.0d')}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
<div class="realms">
|
<div class="realms">
|
||||||
<htk-repeater
|
<htk-repeater
|
||||||
model="realms-model"
|
model="realms-model"
|
||||||
form-id="realm-form"
|
form-id="form"
|
||||||
renderer="realmRenderer"
|
renderer="realmRenderer"
|
||||||
class="realms-box">
|
class="realms-box">
|
||||||
<db-model
|
<db-model
|
||||||
|
@ -199,7 +199,11 @@
|
||||||
</db-model>
|
</db-model>
|
||||||
<custom>
|
<custom>
|
||||||
<a id="link">
|
<a id="link">
|
||||||
<img id="image"/>
|
<img
|
||||||
|
id="image"
|
||||||
|
src="{{`image/family/black/${form.code}.svg`}}"
|
||||||
|
title="{{form.name}}"
|
||||||
|
alt="{{form.name}}"/>
|
||||||
</a>
|
</a>
|
||||||
</custom>
|
</custom>
|
||||||
</htk-repeater>
|
</htk-repeater>
|
||||||
|
|
|
@ -11,7 +11,7 @@ AddressQuestion: On vols rebre la comanda?
|
||||||
AddressQuestionPickup: A què direcció vols associar la comanda? (Opcional)
|
AddressQuestionPickup: A què direcció vols associar la comanda? (Opcional)
|
||||||
AgencyQuestion: Com vols rebre la comanda?
|
AgencyQuestion: Com vols rebre la comanda?
|
||||||
PickupWarehouseQuestion: En quin magatzem vols recollir la comanda?
|
PickupWarehouseQuestion: En quin magatzem vols recollir la comanda?
|
||||||
ConfirmToAccessCatalog: Confirma les dades per accedir al catàleg
|
ConfirmData: Confirma les dades
|
||||||
Arrival: Arribada
|
Arrival: Arribada
|
||||||
Pickup: Recollida
|
Pickup: Recollida
|
||||||
Agency: Agència
|
Agency: Agència
|
||||||
|
|
|
@ -11,7 +11,7 @@ AddressQuestion: Where do you want to receive the order?
|
||||||
AddressQuestionPickup: To which address do you want to associate the order? (Optional)
|
AddressQuestionPickup: To which address do you want to associate the order? (Optional)
|
||||||
AgencyQuestion: How you want to receive the order?
|
AgencyQuestion: How you want to receive the order?
|
||||||
PickupWarehouseQuestion: What store you want to pickup your order?
|
PickupWarehouseQuestion: What store you want to pickup your order?
|
||||||
ConfirmToAccessCatalog: Confirm the data to access the catalog
|
ConfirmData: Confirm the data
|
||||||
Arrival: Arrival
|
Arrival: Arrival
|
||||||
Pickup: Pickup
|
Pickup: Pickup
|
||||||
Agency: Agency
|
Agency: Agency
|
||||||
|
|
|
@ -11,7 +11,7 @@ AddressQuestion: ¿Dónde quieres recibir el pedido?
|
||||||
AddressQuestionPickup: ¿A qué dirección quieres asociar el pedido? (Opcional)
|
AddressQuestionPickup: ¿A qué dirección quieres asociar el pedido? (Opcional)
|
||||||
AgencyQuestion: ¿Cómo quieres recibir el pedido?
|
AgencyQuestion: ¿Cómo quieres recibir el pedido?
|
||||||
PickupWarehouseQuestion: ¿En qué almacén quieres recoger el pedido?
|
PickupWarehouseQuestion: ¿En qué almacén quieres recoger el pedido?
|
||||||
ConfirmToAccessCatalog: Confirma los datos para acceder al catálogo
|
ConfirmData: Confirma los datos
|
||||||
Arrival: Llegada
|
Arrival: Llegada
|
||||||
Pickup: Recogida
|
Pickup: Recogida
|
||||||
Agency: Agencia
|
Agency: Agencia
|
||||||
|
|
|
@ -11,7 +11,7 @@ AddressQuestion: Adresse livraison?
|
||||||
AddressQuestionPickup: À quelle adresse voulez-vous associer la commande? (Optionnel)
|
AddressQuestionPickup: À quelle adresse voulez-vous associer la commande? (Optionnel)
|
||||||
AgencyQuestion: Agence de livraison
|
AgencyQuestion: Agence de livraison
|
||||||
PickupWarehouseQuestion: Dans quel magasin vuoulez-vous retirer votre commande?
|
PickupWarehouseQuestion: Dans quel magasin vuoulez-vous retirer votre commande?
|
||||||
ConfirmToAccessCatalog: Confirmez les coordonnées pour accéder au catalogue
|
ConfirmData: Confirmez les coordonnées
|
||||||
Arrival: Arrivée
|
Arrival: Arrivée
|
||||||
Pickup: Retrait
|
Pickup: Retrait
|
||||||
Agency: Agence
|
Agency: Agence
|
||||||
|
|
|
@ -11,7 +11,7 @@ AddressQuestion: Onde queres receber a encomenda?
|
||||||
AddressQuestionPickup: Para qual endereço deseja associar o pedido? (Opcional)
|
AddressQuestionPickup: Para qual endereço deseja associar o pedido? (Opcional)
|
||||||
AgencyQuestion: Como queres receber a encomenda?
|
AgencyQuestion: Como queres receber a encomenda?
|
||||||
PickupWarehouseQuestion: Em qual armazém queres levantar a encomenda?
|
PickupWarehouseQuestion: Em qual armazém queres levantar a encomenda?
|
||||||
ConfirmToAccessCatalog: Confirme os dados para entrar no catálogo
|
ConfirmData: Confirme os dados
|
||||||
Arrival: Chegada
|
Arrival: Chegada
|
||||||
Pickup: Recolhida
|
Pickup: Recolhida
|
||||||
Agency: Agência
|
Agency: Agência
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
.answers button,
|
.answers button,
|
||||||
.answers p,
|
.answers p,
|
||||||
.radio > div {
|
.radio > div {
|
||||||
font-size: 1.4em;
|
font-size: 1.2em;
|
||||||
}
|
}
|
||||||
.answers .htk-select {
|
.answers .htk-select {
|
||||||
max-width: 10em;
|
max-width: 10em;
|
||||||
|
@ -54,13 +54,9 @@
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
}
|
}
|
||||||
.thin-calendar {
|
.thin-calendar {
|
||||||
width: inherit;
|
|
||||||
max-width: 24em;
|
max-width: 24em;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
box-shadow: .05em .05em .2em rgba(0, 0, 0, .2);
|
box-shadow: none;
|
||||||
}
|
|
||||||
.thin-calendar tr > th {
|
|
||||||
color: white;
|
|
||||||
}
|
}
|
||||||
.htk-assistant .thin {
|
.htk-assistant .thin {
|
||||||
float: right;
|
float: right;
|
||||||
|
|
|
@ -174,7 +174,7 @@
|
||||||
</htk-step>
|
</htk-step>
|
||||||
<htk-step
|
<htk-step
|
||||||
name="confirm-delivery">
|
name="confirm-delivery">
|
||||||
<h2><t>ConfirmToAccessCatalog</t></h2>
|
<h2><t>ConfirmData</t></h2>
|
||||||
<div class="answers target">
|
<div class="answers target">
|
||||||
<p>
|
<p>
|
||||||
<t>Arrival</t>
|
<t>Arrival</t>
|
||||||
|
@ -192,7 +192,7 @@
|
||||||
</htk-step>
|
</htk-step>
|
||||||
<htk-step
|
<htk-step
|
||||||
name="confirm-pickup">
|
name="confirm-pickup">
|
||||||
<h2><t>ConfirmToAccessCatalog</t></h2>
|
<h2><t>ConfirmData</t></h2>
|
||||||
<div class="answers target">
|
<div class="answers target">
|
||||||
<p>
|
<p>
|
||||||
<t>Pickup</t>
|
<t>Pickup</t>
|
||||||
|
|
|
@ -1,72 +1,44 @@
|
||||||
.orders
|
.orders {
|
||||||
{
|
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
}
|
}
|
||||||
.orders .box
|
.orders .box {
|
||||||
{
|
|
||||||
max-width: 25em;
|
max-width: 25em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Balance */
|
/* Balance */
|
||||||
|
|
||||||
.balance
|
.balance {
|
||||||
{
|
|
||||||
margin-right: .5em;
|
margin-right: .5em;
|
||||||
}
|
}
|
||||||
.balance > *
|
.balance > * {
|
||||||
{
|
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.balance > .amount
|
.balance > .amount {
|
||||||
{
|
|
||||||
color: white;
|
color: white;
|
||||||
padding: 0.3em;
|
padding: 0.3em;
|
||||||
}
|
}
|
||||||
.balance > .info
|
.balance > .info {
|
||||||
{
|
|
||||||
display: inline;
|
display: inline;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 1.2em;
|
height: 1.2em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.balance > .negative
|
.balance > .negative {
|
||||||
{
|
|
||||||
background-color: #EF5350;
|
background-color: #EF5350;
|
||||||
border-radius: 0.1em;
|
border-radius: 0.1em;
|
||||||
box-shadow: 0 0 0.4em #666;
|
box-shadow: 0 0 0.4em #666;
|
||||||
}
|
}
|
||||||
.balance-popup
|
.balance-popup {
|
||||||
{
|
|
||||||
width: 25em;
|
width: 25em;
|
||||||
}
|
}
|
||||||
.balance-grid
|
.balance-grid {
|
||||||
{
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* List */
|
/* List */
|
||||||
|
|
||||||
.orders .item
|
.orders .htk-list .total {
|
||||||
{
|
|
||||||
display: block;
|
|
||||||
padding: 1em;
|
|
||||||
border-bottom: 1px solid #DDD;
|
|
||||||
}
|
|
||||||
.orders .item:hover
|
|
||||||
{
|
|
||||||
background-color: rgba(1, 1, 1, 0.05);
|
|
||||||
}
|
|
||||||
.orders .item > p
|
|
||||||
{
|
|
||||||
margin: .1em 0;
|
|
||||||
}
|
|
||||||
.orders .item > p.important
|
|
||||||
{
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
.orders .item > p.total
|
|
||||||
{
|
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,30 +39,25 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="form" class="orders">
|
<div id="form" class="orders">
|
||||||
<div class="box confirmed">
|
<div class="box confirmed">
|
||||||
<htk-repeater form-id="iter" renderer="repeaterFunc">
|
<htk-repeater form-id="iter" renderer="repeaterFunc" class="htk-list">
|
||||||
<db-model property="model" id="tickets">
|
<db-model property="model" id="tickets">
|
||||||
<custom>
|
<custom>
|
||||||
CALL myTicket_list (NULL, NULL);
|
CALL myTicket_list (NULL, NULL);
|
||||||
</custom>
|
</custom>
|
||||||
</db-model>
|
</db-model>
|
||||||
<custom>
|
<custom>
|
||||||
<a id="link" class="item" title="_SeeOrder">
|
<a id="link" class="item" title="{{_('SeeOrder')}}">
|
||||||
|
<div class="content">
|
||||||
<p class="important total">
|
<p class="important total">
|
||||||
<htk-text form="iter" column="total" format="%.2d€"/>
|
{{Vn.Value.format(iter.total, '%.2d€')}}
|
||||||
</p>
|
</p>
|
||||||
<p class="important">
|
<p class="important">
|
||||||
<htk-text form="iter" column="landed" format="%D"/>
|
{{Vn.Value.format(iter.landed, '%D')}}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>#{{iter.id}}</p>
|
||||||
#<htk-text form="iter" column="id"/>
|
<p>{{iter.nickname}}</p>
|
||||||
</p>
|
<p>{{iter.agency}}</p>
|
||||||
<p>
|
</div>
|
||||||
<htk-text form="iter" column="nickname"/>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<htk-text form="iter" column="agency"/>
|
|
||||||
</p>
|
|
||||||
<div class="clear"/>
|
|
||||||
</a>
|
</a>
|
||||||
</custom>
|
</custom>
|
||||||
</htk-repeater>
|
</htk-repeater>
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
OrderDetail: Detall de l'encarrec
|
OrderDetail: Detall de l'encarrec
|
||||||
|
ShippingInformation: Dades d'enviament
|
||||||
|
DeliveryAddress: Adreça de lliurament
|
||||||
Print delivery note: Imprimir albarà
|
Print delivery note: Imprimir albarà
|
||||||
Agency: Agència
|
Agency: Agència
|
||||||
Warehouse: Magatzem
|
Warehouse: Magatzem
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
OrderDetail: Order detail
|
OrderDetail: Order detail
|
||||||
|
ShippingInformation: Shipping information
|
||||||
|
DeliveryAddress: Delivery address
|
||||||
Print delivery note: Print delivery note
|
Print delivery note: Print delivery note
|
||||||
Agency: Agency
|
Agency: Agency
|
||||||
Warehouse: Store
|
Warehouse: Store
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
OrderDetail: Detalle del pedido
|
OrderDetail: Detalle del pedido
|
||||||
|
ShippingInformation: Datos de envío
|
||||||
|
DeliveryAddress: Dirección de entrega
|
||||||
Print delivery note: Imprimir albarán
|
Print delivery note: Imprimir albarán
|
||||||
Agency: Agencia
|
Agency: Agencia
|
||||||
Warehouse: Almacén
|
Warehouse: Almacén
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
OrderDetail: Détails de la commande
|
OrderDetail: Détails de la commande
|
||||||
|
ShippingInformation: Informations sur la livraison
|
||||||
|
DeliveryAddress: Addresse de livraison
|
||||||
Print delivery note: Imprimer bulletin de livraison
|
Print delivery note: Imprimer bulletin de livraison
|
||||||
Agency: Agence
|
Agency: Agence
|
||||||
Warehouse: Entrepôt
|
Warehouse: Entrepôt
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
OrderDetail: Detalhes da encomenda
|
OrderDetail: Detalhes da encomenda
|
||||||
|
ShippingInformation: Dados de envio
|
||||||
|
DeliveryAddress: Endereço de entrega
|
||||||
Print delivery note: Imprimir nota de entrega
|
Print delivery note: Imprimir nota de entrega
|
||||||
Agency: Agência
|
Agency: Agência
|
||||||
Warehouse: Armazém
|
Warehouse: Armazém
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
.ticket
|
.ticket {
|
||||||
{
|
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
}
|
}
|
||||||
.ticket .box
|
.ticket .box {
|
||||||
{
|
|
||||||
max-width: 30em;
|
max-width: 30em;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 2em;
|
padding: 2em;
|
||||||
|
@ -12,36 +10,29 @@
|
||||||
|
|
||||||
/* Header */
|
/* Header */
|
||||||
|
|
||||||
.ticket .head
|
.ticket .head {
|
||||||
{
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
padding-bottom: .2em;
|
padding-bottom: .2em;
|
||||||
border-bottom: 1px solid #DDD;
|
border-bottom: 1px solid #DDD;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
.ticket .address,
|
.ticket .head > div > div {
|
||||||
.ticket .total
|
margin: 15px 0;
|
||||||
{
|
|
||||||
margin-top: .8em;
|
|
||||||
}
|
}
|
||||||
.ticket .head > div
|
.ticket .head > div > div:first-child {
|
||||||
{
|
margin: 0;
|
||||||
padding-bottom: .8em;
|
|
||||||
}
|
}
|
||||||
.ticket .head p
|
.ticket .head p {
|
||||||
{
|
margin: .2em 0;
|
||||||
margin: .2em;
|
|
||||||
}
|
}
|
||||||
.ticket .head p.important
|
.ticket .head p.important {
|
||||||
{
|
font-size: 1.2rem;
|
||||||
font-size: 1.4em;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.ticket .total
|
.ticket .total {
|
||||||
{
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.ticket .packages
|
.ticket .packages {
|
||||||
{
|
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
padding-top: 1em;
|
padding-top: 1em;
|
||||||
border-top: 1px solid #DDD;
|
border-top: 1px solid #DDD;
|
||||||
|
@ -50,47 +41,42 @@
|
||||||
|
|
||||||
/* Lines */
|
/* Lines */
|
||||||
|
|
||||||
.ticket .line
|
.ticket .line {
|
||||||
{
|
display: flex;
|
||||||
padding: .5em 0;
|
gap: 20px;
|
||||||
|
margin: 24px 0;
|
||||||
|
height: 65px;
|
||||||
}
|
}
|
||||||
.ticket .line > .photo
|
.ticket .line:last-child {
|
||||||
{
|
margin-bottom: 0;
|
||||||
margin-right: 1em;
|
}
|
||||||
float: left;
|
.ticket .line > .photo {
|
||||||
|
flex: none;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
height: 4.25em;
|
width: 65px;
|
||||||
width: 4.25em;
|
|
||||||
}
|
}
|
||||||
.ticket .line > .info
|
.ticket .line > .info {
|
||||||
{
|
flex: 1;
|
||||||
margin-left: 5.25em;
|
|
||||||
}
|
}
|
||||||
.ticket .line > .info > h2
|
.ticket .line > .info > h2 {
|
||||||
{
|
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
padding-bottom: .1em;
|
padding-bottom: .1em;
|
||||||
}
|
}
|
||||||
.ticket .line > .info > p
|
.ticket .line > .info > p {
|
||||||
{
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.ticket .line > .info > .tags
|
.ticket .line > .info > .tags {
|
||||||
{
|
|
||||||
color: #777;
|
color: #777;
|
||||||
}
|
}
|
||||||
.ticket .line > .info .discount
|
.ticket .line > .info .discount {
|
||||||
{
|
|
||||||
color: green;
|
color: green;
|
||||||
}
|
}
|
||||||
.ticket .line > .info > .amount
|
.ticket .line > .info > .amount {
|
||||||
{
|
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
.ticket .line > .info > .subtotal
|
.ticket .line > .info > .subtotal {
|
||||||
{
|
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
<p class="important ticket-id">
|
<p class="important ticket-id">
|
||||||
#<htk-text column="id" form="ticket"/>
|
#<htk-text column="id" form="ticket"/>
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3><t>ShippingInformation</t></h3>
|
||||||
<p>
|
<p>
|
||||||
<t>Preparation</t> <htk-text form="ticket" column="shipped" format="%D"/>
|
<t>Preparation</t> <htk-text form="ticket" column="shipped" format="%D"/>
|
||||||
</p>
|
</p>
|
||||||
|
@ -40,6 +43,7 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="address">
|
<div class="address">
|
||||||
|
<h3><t>DeliveryAddress</t></h3>
|
||||||
<p>
|
<p>
|
||||||
<htk-text form="ticket" column="nickname"/>
|
<htk-text form="ticket" column="nickname"/>
|
||||||
</p>
|
</p>
|
||||||
|
@ -101,7 +105,6 @@
|
||||||
<htk-text id="subtotal" format="%.2d€"/>
|
<htk-text id="subtotal" format="%.2d€"/>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"/>
|
|
||||||
</div>
|
</div>
|
||||||
</custom>
|
</custom>
|
||||||
</htk-repeater>
|
</htk-repeater>
|
||||||
|
|
|
@ -43,15 +43,10 @@
|
||||||
editable="true"
|
editable="true"
|
||||||
conn="conn"/>
|
conn="conn"/>
|
||||||
<p class="important">
|
<p class="important">
|
||||||
<htk-text form="iter" column="title"/>
|
{{iter.title}}
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<htk-text form="iter" column="nickname"/>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<t>Priority</t>
|
|
||||||
<htk-text form="iter" column="priority"/>
|
|
||||||
</p>
|
</p>
|
||||||
|
<p>{{iter.nickname}}</p>
|
||||||
|
<p>{{iter.priority}}</p>
|
||||||
</div>
|
</div>
|
||||||
</custom>
|
</custom>
|
||||||
</htk-repeater>
|
</htk-repeater>
|
||||||
|
|
|
@ -1,36 +1,30 @@
|
||||||
|
|
||||||
var Model = require ('./model');
|
var Model = require('./model');
|
||||||
|
|
||||||
module.exports = new Class
|
module.exports = new Class({
|
||||||
({
|
Properties: {
|
||||||
Properties:
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* The model associated to this form.
|
* The model associated to this form.
|
||||||
**/
|
*/
|
||||||
model:
|
model: {
|
||||||
{
|
|
||||||
type: Model
|
type: Model
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* The row where the form positioned, has -1 if the row is unselected.
|
* The row where the form positioned, has -1 if the row is unselected.
|
||||||
**/
|
*/
|
||||||
row:
|
row: {
|
||||||
{
|
|
||||||
type: Number
|
type: Number
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* The number of rows in the form.
|
* The number of rows in the form.
|
||||||
**/
|
*/
|
||||||
numRows:
|
numRows: {
|
||||||
{
|
|
||||||
type: Number
|
type: Number
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Checks if the form data is ready.
|
* Checks if the form data is ready.
|
||||||
**/
|
*/
|
||||||
ready:
|
ready: {
|
||||||
{
|
|
||||||
type: Boolean
|
type: Boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,18 +32,16 @@ module.exports = new Class
|
||||||
,_model: null
|
,_model: null
|
||||||
,_row: -1
|
,_row: -1
|
||||||
|
|
||||||
,refresh: function ()
|
,refresh: function() {
|
||||||
{
|
|
||||||
if (this._model)
|
if (this._model)
|
||||||
this._model.refresh ();
|
this._model.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emits the 'iter-changed' signal on the form.
|
* Emits the 'iter-changed' signal on the form.
|
||||||
**/
|
*/
|
||||||
,iterChanged: function ()
|
,iterChanged: function() {
|
||||||
{
|
this.signalEmit('iter-changed');
|
||||||
this.signalEmit ('iter-changed');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -57,34 +49,39 @@ module.exports = new Class
|
||||||
*
|
*
|
||||||
* @param {String} columnName The column name
|
* @param {String} columnName The column name
|
||||||
* @return {integer} The column index or -1 if column not exists
|
* @return {integer} The column index or -1 if column not exists
|
||||||
**/
|
*/
|
||||||
,getColumnIndex: function (columnName)
|
,getColumnIndex: function(columnName) {
|
||||||
{
|
|
||||||
if (this._model)
|
if (this._model)
|
||||||
return this._model.getColumnIndex (columnName);
|
return this._model.getColumnIndex(columnName);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
,insertRow: function ()
|
,insertRow: function() {
|
||||||
{
|
|
||||||
if (this._model)
|
if (this._model)
|
||||||
this.row = this._model.insertRow ();
|
this.row = this._model.insertRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
,performOperations: function ()
|
,performOperations: function() {
|
||||||
{
|
|
||||||
if (this._model)
|
if (this._model)
|
||||||
this._model.performOperations ();
|
this._model.performOperations();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the current row.
|
* Removes the current row.
|
||||||
**/
|
*/
|
||||||
,deleteRow: function ()
|
,deleteRow: function() {
|
||||||
{
|
|
||||||
if (this._row >= 0)
|
if (this._row >= 0)
|
||||||
this._model.deleteRow (this._row);
|
this._model.deleteRow(this._row);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the row as object.
|
||||||
|
*
|
||||||
|
* @return {Object} The row
|
||||||
|
*/
|
||||||
|
,getObject: function() {
|
||||||
|
return this._model.getObject(this._row);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,10 +89,9 @@ module.exports = new Class
|
||||||
*
|
*
|
||||||
* @param {String} columnName The column name
|
* @param {String} columnName The column name
|
||||||
* @return {Object} The value
|
* @return {Object} The value
|
||||||
**/
|
*/
|
||||||
,get: function (columnName)
|
,get: function(columnName) {
|
||||||
{
|
return this._model.get(this._row, columnName);
|
||||||
return this._model.get (this._row, columnName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,10 +99,9 @@ module.exports = new Class
|
||||||
*
|
*
|
||||||
* @param {String} columnName The column name
|
* @param {String} columnName The column name
|
||||||
* @param {Object} value The new value
|
* @param {Object} value The new value
|
||||||
**/
|
*/
|
||||||
,set: function (columnName, value)
|
,set: function(columnName, value) {
|
||||||
{
|
return this._model.set(this._row, columnName, value);
|
||||||
return this._model.set (this._row, columnName, value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,10 +109,9 @@ module.exports = new Class
|
||||||
*
|
*
|
||||||
* @param {String} columnName The column index
|
* @param {String} columnName The column index
|
||||||
* @return {Object} The value
|
* @return {Object} The value
|
||||||
**/
|
*/
|
||||||
,getByIndex: function (column)
|
,getByIndex: function(column) {
|
||||||
{
|
return this._model.getByIndex(this._row, column);
|
||||||
return this._model.getByIndex (this._row, column);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -125,10 +119,9 @@ module.exports = new Class
|
||||||
*
|
*
|
||||||
* @param {String} columnName The column index
|
* @param {String} columnName The column index
|
||||||
* @param {Object} value The new value
|
* @param {Object} value The new value
|
||||||
**/
|
*/
|
||||||
,setByIndex: function (column, value)
|
,setByIndex: function(column, value) {
|
||||||
{
|
return this._model.setByIndex(this._row, column, value);
|
||||||
return this._model.setByIndex (this._row, column, value);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
796
js/db/model.js
796
js/db/model.js
File diff suppressed because it is too large
Load Diff
|
@ -3,14 +3,14 @@ var Result = require('./result');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class stores the database results.
|
* This class stores the database results.
|
||||||
**/
|
*/
|
||||||
module.exports = new Class({
|
module.exports = new Class({
|
||||||
results: null
|
results: null
|
||||||
,error: null
|
,error: null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initilizes the resultset object.
|
* Initilizes the resultset object.
|
||||||
**/
|
*/
|
||||||
,initialize: function(results, error) {
|
,initialize: function(results, error) {
|
||||||
this.results = results;
|
this.results = results;
|
||||||
this.error = error;
|
this.error = error;
|
||||||
|
@ -20,7 +20,7 @@ module.exports = new Class({
|
||||||
* Gets the query error.
|
* Gets the query error.
|
||||||
*
|
*
|
||||||
* @return {Db.Err} the error or null if no errors hapened
|
* @return {Db.Err} the error or null if no errors hapened
|
||||||
**/
|
*/
|
||||||
,getError: function() {
|
,getError: function() {
|
||||||
return this.error;
|
return this.error;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ module.exports = new Class({
|
||||||
* Fetchs the next result from the resultset.
|
* Fetchs the next result from the resultset.
|
||||||
*
|
*
|
||||||
* @return {Db.Result} the result or %null if error or there are no more results
|
* @return {Db.Result} the result or %null if error or there are no more results
|
||||||
**/
|
*/
|
||||||
,fetchResult: function() {
|
,fetchResult: function() {
|
||||||
var result = this.fetch();
|
var result = this.fetch();
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ module.exports = new Class({
|
||||||
* Fetchs the first row from the next resultset.
|
* Fetchs the first row from the next resultset.
|
||||||
*
|
*
|
||||||
* @return {Array} the row if success, %null otherwise
|
* @return {Array} the row if success, %null otherwise
|
||||||
**/
|
*/
|
||||||
,fetchRow: function() {
|
,fetchRow: function() {
|
||||||
var result = this.fetch();
|
var result = this.fetch();
|
||||||
|
|
||||||
|
@ -70,6 +70,11 @@ module.exports = new Class({
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetchs the first row object from the next resultset.
|
||||||
|
*
|
||||||
|
* @return {Array} the row if success, %null otherwise
|
||||||
|
*/
|
||||||
,fetchObject: function() {
|
,fetchObject: function() {
|
||||||
var result = this.fetch();
|
var result = this.fetch();
|
||||||
|
|
||||||
|
@ -90,7 +95,7 @@ module.exports = new Class({
|
||||||
* Fetchs the first row and column value from the next resultset.
|
* Fetchs the first row and column value from the next resultset.
|
||||||
*
|
*
|
||||||
* @return {Object} the value if success, %null otherwise
|
* @return {Object} the value if success, %null otherwise
|
||||||
**/
|
*/
|
||||||
,fetchValue: function() {
|
,fetchValue: function() {
|
||||||
var row = this.fetchRow();
|
var row = this.fetchRow();
|
||||||
|
|
||||||
|
|
|
@ -1,54 +1,44 @@
|
||||||
|
|
||||||
var Iterator = require ('./iterator');
|
var Iterator = require('./iterator');
|
||||||
var Model = require ('./model');
|
var Model = require('./model');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A light iterator for models.
|
* A light iterator for models.
|
||||||
**/
|
*/
|
||||||
module.exports = new Class
|
module.exports = new Class({
|
||||||
({
|
|
||||||
Extends: Vn.Object
|
Extends: Vn.Object
|
||||||
,Implements: Iterator
|
,Implements: Iterator
|
||||||
,Properties:
|
,Properties: {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* The model associated to this form.
|
* The model associated to this form.
|
||||||
**/
|
*/
|
||||||
model:
|
model: {
|
||||||
{
|
|
||||||
type: Model
|
type: Model
|
||||||
,set: function (x)
|
,set: function(x) {
|
||||||
{
|
|
||||||
this._model = x;
|
this._model = x;
|
||||||
}
|
}
|
||||||
,get: function ()
|
,get: function() {
|
||||||
{
|
|
||||||
return this._model;
|
return this._model;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* The row where the form positioned, has -1 if the row is unselected.
|
* The row where the form positioned, has -1 if the row is unselected.
|
||||||
**/
|
*/
|
||||||
row:
|
row: {
|
||||||
{
|
|
||||||
type: Number
|
type: Number
|
||||||
,set: function (x)
|
,set: function(x) {
|
||||||
{
|
|
||||||
this._row = x;
|
this._row = x;
|
||||||
}
|
}
|
||||||
,get: function ()
|
,get: function() {
|
||||||
{
|
|
||||||
return this._row;
|
return this._row;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* The number of rows in the form.
|
* The number of rows in the form.
|
||||||
**/
|
*/
|
||||||
numRows:
|
numRows: {
|
||||||
{
|
|
||||||
type: Number
|
type: Number
|
||||||
,get: function ()
|
,get: function() {
|
||||||
{
|
|
||||||
if (this._model)
|
if (this._model)
|
||||||
return this._model.numRows;
|
return this._model.numRows;
|
||||||
|
|
||||||
|
@ -57,12 +47,10 @@ module.exports = new Class
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Checks if the form data is ready.
|
* Checks if the form data is ready.
|
||||||
**/
|
*/
|
||||||
ready:
|
ready: {
|
||||||
{
|
|
||||||
type: Boolean
|
type: Boolean
|
||||||
,get: function ()
|
,get: function() {
|
||||||
{
|
|
||||||
if (this._model)
|
if (this._model)
|
||||||
return this._model.ready;
|
return this._model.ready;
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,7 @@ module.exports = new Class
|
||||||
,isOpen: false
|
,isOpen: false
|
||||||
,uiLoaded: false
|
,uiLoaded: false
|
||||||
|
|
||||||
,initialize: function (gui, formInfo)
|
,initialize: function(gui, formInfo) {
|
||||||
{
|
|
||||||
this.gui = gui;
|
this.gui = gui;
|
||||||
this.conn = gui.conn;
|
this.conn = gui.conn;
|
||||||
this.hash = gui.hash;
|
this.hash = gui.hash;
|
||||||
|
@ -19,107 +18,98 @@ module.exports = new Class
|
||||||
*
|
*
|
||||||
* @param {string} objectId The object identifier
|
* @param {string} objectId The object identifier
|
||||||
* @return {Object} The object, or %null if not found
|
* @return {Object} The object, or %null if not found
|
||||||
**/
|
*/
|
||||||
,$: function (objectId)
|
,$: function(objectId) {
|
||||||
{
|
|
||||||
if (this.builder)
|
if (this.builder)
|
||||||
return this.builder.getById (objectId);
|
return this.builder.getById(objectId);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
,loadUi: function ()
|
,loadUi: function() {
|
||||||
{
|
|
||||||
if (!this.isOpen)
|
if (!this.isOpen)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var builder = new Vn.Builder ();
|
var builder = new Vn.Builder();
|
||||||
builder.signalData = this;
|
builder.signalData = this;
|
||||||
builder.add ('conn', this.conn);
|
builder.add('conn', this.conn);
|
||||||
builder.loadXml ('forms/'+ this.formInfo.path +'/ui.xml');
|
builder.loadXml('forms/'+ this.formInfo.path +'/ui.xml');
|
||||||
|
|
||||||
var res = this.builder = builder.load ();
|
var res = this.builder = builder.load();
|
||||||
this.node = res.$('form');
|
this.node = res.$('form');
|
||||||
res.link ();
|
res.link(this);
|
||||||
|
|
||||||
var models = res.getByTagName ('db-model');
|
var models = res.getByTagName('db-model');
|
||||||
|
|
||||||
for (var i = 0; i < models.length; i++)
|
for (var i = 0; i < models.length; i++)
|
||||||
models[i].conn = this.conn;
|
models[i].conn = this.conn;
|
||||||
|
|
||||||
var queries = res.getByTagName ('db-query');
|
var queries = res.getByTagName('db-query');
|
||||||
|
|
||||||
for (var i = 0; i < queries.length; i++)
|
for (var i = 0; i < queries.length; i++)
|
||||||
queries[i].conn = this.conn;
|
queries[i].conn = this.conn;
|
||||||
|
|
||||||
if (this.node)
|
if (this.node) {
|
||||||
{
|
this.gui.setForm(this.node);
|
||||||
this.gui.setForm (this.node);
|
this.gui.setTitle(res.$('title'));
|
||||||
this.gui.setTitle (res.$('title'));
|
this.gui.setActions(res.$('actions'));
|
||||||
this.gui.setActions (res.$('actions'));
|
this.activate();
|
||||||
this.activate ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.uiLoaded = true;
|
this.uiLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
,unloadUi: function ()
|
,unloadUi: function() {
|
||||||
{
|
|
||||||
if (!this.uiLoaded)
|
if (!this.uiLoaded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.node)
|
if (this.node) {
|
||||||
{
|
this.deactivate();
|
||||||
this.deactivate ();
|
this.gui.setTitle(null);
|
||||||
this.gui.setTitle (null);
|
this.gui.setActions(null);
|
||||||
this.gui.setActions (null);
|
Vn.Node.remove(this.node);
|
||||||
Vn.Node.remove (this.node);
|
this.deactivate();
|
||||||
this.deactivate ();
|
|
||||||
this.node = null;
|
this.node = null;
|
||||||
}
|
}
|
||||||
if (this.builder)
|
if (this.builder) {
|
||||||
{
|
this.builder.unref();
|
||||||
this.builder.unref ();
|
|
||||||
this.builder = null;
|
this.builder = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the form is opened.
|
* Called when the form is opened.
|
||||||
**/
|
*/
|
||||||
,open: function ()
|
,open: function() {
|
||||||
{
|
this.close();
|
||||||
this.close ();
|
|
||||||
this.isOpen = true;
|
this.isOpen = true;
|
||||||
this.loadUi ();
|
this.loadUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the form is closed.
|
* Called when the form is closed.
|
||||||
**/
|
*/
|
||||||
,close: function ()
|
,close: function() {
|
||||||
{
|
|
||||||
if (!this.isOpen)
|
if (!this.isOpen)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
this.unloadUi ();
|
this.unloadUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the form is activated.
|
* Called when the form is activated.
|
||||||
**/
|
*/
|
||||||
,activate: function () {}
|
,activate: function() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the form is deactivated.
|
* Called when the form is deactivated.
|
||||||
**/
|
*/
|
||||||
,deactivate: function () {}
|
,deactivate: function() {}
|
||||||
|
|
||||||
,_destroy: function ()
|
,_destroy: function() {
|
||||||
{
|
this.close();
|
||||||
this.close ();
|
this.parent();
|
||||||
this.parent ();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -64,8 +64,8 @@
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
|
||||||
.action-bar > div {
|
& > div {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -73,17 +73,20 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 1em;
|
padding: 0 1em;
|
||||||
gap: .5em;
|
gap: .5em;
|
||||||
}
|
|
||||||
.action-bar > div > * {
|
& > * {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
.action-bar button {
|
|
||||||
margin: 0;
|
|
||||||
padding: .6em;
|
|
||||||
}
|
}
|
||||||
.action-bar button:hover {
|
button {
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 15px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
background-color: rgba(2550, 255, 255, .2);
|
background-color: rgba(2550, 255, 255, .2);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Background */
|
/* Background */
|
||||||
|
|
||||||
|
@ -277,10 +280,15 @@
|
||||||
/* Mobile */
|
/* Mobile */
|
||||||
|
|
||||||
@media (max-width: 960px) {
|
@media (max-width: 960px) {
|
||||||
.action-bar span.label,
|
.action-bar {
|
||||||
|
span.label,
|
||||||
.htk-button > .text {
|
.htk-button > .text {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.htk-button {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
& > .navbar {
|
& > .navbar {
|
||||||
padding-left: 2.8em;
|
padding-left: 2.8em;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
Binary file not shown.
|
@ -1,8 +1,14 @@
|
||||||
|
|
||||||
|
@import "../htk/style/classes";
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
src: url('poppins.ttf') format('truetype');
|
src: url('poppins.ttf') format('truetype');
|
||||||
}
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Open Sans';
|
||||||
|
src: url('opensans.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
/* Global */
|
/* Global */
|
||||||
|
|
||||||
|
@ -243,12 +249,6 @@ img.editable {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button */
|
|
||||||
|
|
||||||
.htk-button img {
|
|
||||||
height: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Float */
|
/* Float */
|
||||||
|
|
||||||
.clear {
|
.clear {
|
||||||
|
@ -258,11 +258,8 @@ img.editable {
|
||||||
/* Box */
|
/* Box */
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
background-color: white;
|
@extend %box;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border-radius: .6em;
|
|
||||||
box-shadow: .05em .05em .2em rgba(0, 0, 0, .1);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
.box .header {
|
.box .header {
|
||||||
padding: 0.6em 0.8em;
|
padding: 0.6em 0.8em;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
|
|
||||||
var Button = require('./button');
|
var Button = require('./button');
|
||||||
|
|
||||||
module.exports = new Class
|
module.exports = new Class({
|
||||||
({
|
|
||||||
Extends: Button
|
Extends: Button
|
||||||
,Tag: 'htk-bar-button'
|
,Tag: 'htk-bar-button'
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,13 @@ module.exports = new Class({
|
||||||
image: {
|
image: {
|
||||||
type: String
|
type: String
|
||||||
,set: function(x) {
|
,set: function(x) {
|
||||||
this.span.innerText = x;
|
this.iconNode.name = x;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
type: String
|
type: String
|
||||||
,set: function(x) {
|
,set: function(x) {
|
||||||
this.span.innerText = x;
|
this.iconNode.name = x;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tip: {
|
tip: {
|
||||||
|
@ -21,7 +21,7 @@ module.exports = new Class({
|
||||||
,set: function(x) {
|
,set: function(x) {
|
||||||
if (x) {
|
if (x) {
|
||||||
this.node.title = _(x);
|
this.node.title = _(x);
|
||||||
this.span.title = _(x);
|
this.iconNode.title = _(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderContent();
|
this.renderContent();
|
||||||
|
@ -49,9 +49,8 @@ module.exports = new Class({
|
||||||
node.className = 'htk-button';
|
node.className = 'htk-button';
|
||||||
node.addEventListener('click', this.onClick.bind(this));
|
node.addEventListener('click', this.onClick.bind(this));
|
||||||
|
|
||||||
this.span = this.createElement('span');
|
this.iconNode = new Htk.Icon();
|
||||||
this.span.className = 'material-symbols-rounded icon';
|
node.appendChild(this.iconNode.node);
|
||||||
node.appendChild(this.span);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,renderContent: function() {
|
,renderContent: function() {
|
||||||
|
|
|
@ -43,12 +43,17 @@ module.exports = new Class({
|
||||||
thead.appendChild(tr);
|
thead.appendChild(tr);
|
||||||
|
|
||||||
var th = this.createElement('th');
|
var th = this.createElement('th');
|
||||||
th.appendChild(this.createTextNode('<'));
|
th.className = 'previous';
|
||||||
th.className = 'button';
|
|
||||||
th.addEventListener('click', this.prevMonthClicked.bind(this));
|
|
||||||
tr.appendChild(th);
|
tr.appendChild(th);
|
||||||
|
|
||||||
|
var previousButton = new Htk.Button({
|
||||||
|
icon: 'arrow_back_ios'
|
||||||
|
}).node;
|
||||||
|
previousButton.addEventListener('click', this.prevMonthClicked.bind(this));
|
||||||
|
th.appendChild(previousButton);
|
||||||
|
|
||||||
var th = this.createElement('th');
|
var th = this.createElement('th');
|
||||||
|
th.className = 'month-year';
|
||||||
th.colSpan = 5;
|
th.colSpan = 5;
|
||||||
tr.appendChild(th);
|
tr.appendChild(th);
|
||||||
|
|
||||||
|
@ -62,12 +67,17 @@ module.exports = new Class({
|
||||||
th.appendChild(yearNode);
|
th.appendChild(yearNode);
|
||||||
|
|
||||||
var th = this.createElement('th');
|
var th = this.createElement('th');
|
||||||
th.appendChild(this.createTextNode('>'));
|
th.className = 'next';
|
||||||
th.className = 'button';
|
|
||||||
th.addEventListener('click', this.nextMonthClicked.bind(this));
|
|
||||||
tr.appendChild(th);
|
tr.appendChild(th);
|
||||||
|
|
||||||
|
var nextButton = new Htk.Button({
|
||||||
|
icon: 'arrow_forward_ios'
|
||||||
|
}).node;
|
||||||
|
nextButton.addEventListener('click', this.nextMonthClicked.bind(this));
|
||||||
|
th.appendChild(nextButton);
|
||||||
|
|
||||||
var tr = this.createElement('tr');
|
var tr = this.createElement('tr');
|
||||||
|
tr.className = 'weekdays';
|
||||||
thead.appendChild(tr);
|
thead.appendChild(tr);
|
||||||
|
|
||||||
for (var i = 1; i <= len; i++) {
|
for (var i = 1; i <= len; i++) {
|
||||||
|
|
|
@ -4,13 +4,11 @@ module.exports = new Class
|
||||||
Extends: Htk.Field
|
Extends: Htk.Field
|
||||||
,Tag: 'htk-html'
|
,Tag: 'htk-html'
|
||||||
|
|
||||||
,render: function ()
|
,render: function() {
|
||||||
{
|
this.createRoot('div');
|
||||||
this.createRoot ('div');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,putValue: function (value)
|
,putValue: function(value) {
|
||||||
{
|
|
||||||
this.node.innerHTML = value;
|
this.node.innerHTML = value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
require('db/db');
|
require('db/db');
|
||||||
require('./style.scss');
|
require('./style/classes.scss');
|
||||||
|
require('./style/main.scss');
|
||||||
|
|
||||||
Htk = module.exports = {
|
Htk = module.exports = {
|
||||||
NodeBuilder : require('./node-builder')
|
NodeBuilder : require('./node-builder')
|
||||||
|
|
|
@ -42,7 +42,7 @@ module.exports = new Class({
|
||||||
|
|
||||||
,render: function() {
|
,render: function() {
|
||||||
const node = this.createRoot('span');
|
const node = this.createRoot('span');
|
||||||
node.className = 'material-symbols-rounded icon';
|
node.className = 'htk-icon material-symbols-rounded';
|
||||||
}
|
}
|
||||||
|
|
||||||
,_setIcon: function() {
|
,_setIcon: function() {
|
||||||
|
|
|
@ -96,7 +96,7 @@ module.exports = new Class({
|
||||||
|
|
||||||
var builder = this._builder = new Vn.Builder();
|
var builder = this._builder = new Vn.Builder();
|
||||||
builder.setParent(builderResult);
|
builder.setParent(builderResult);
|
||||||
builder.loadXmlFromNode(node.firstElementChild);
|
builder.loadXmlFromNode(node.firstElementChild, null, [this._formId]);
|
||||||
|
|
||||||
this._onModelChange();
|
this._onModelChange();
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ module.exports = new Class({
|
||||||
|
|
||||||
this._builder.add(this._formId, set);
|
this._builder.add(this._formId, set);
|
||||||
var res = this._builder.load();
|
var res = this._builder.load();
|
||||||
res.link();
|
res.link(null, [set.getObject()]);
|
||||||
|
|
||||||
this._childsData.push({
|
this._childsData.push({
|
||||||
builder: res,
|
builder: res,
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
|
%box {
|
||||||
|
border-radius: .6em;
|
||||||
|
box-shadow: .05em .05em .2em rgba(0, 0, 0, .1);
|
||||||
|
overflow: hidden;
|
||||||
|
border: none;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
%clickable {
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 250ms ease-out;
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
background-color: $color-hover-cd;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,7 @@
|
||||||
|
|
||||||
|
@import "variables";
|
||||||
|
@import "classes";
|
||||||
|
|
||||||
/* Grid */
|
/* Grid */
|
||||||
|
|
||||||
.htk-grid {
|
.htk-grid {
|
||||||
|
@ -160,17 +163,73 @@ td.cell-image .htk-image {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Icon */
|
||||||
|
|
||||||
|
.htk-icon {}
|
||||||
|
|
||||||
|
/* List */
|
||||||
|
|
||||||
|
.htk-list {
|
||||||
|
.item {
|
||||||
|
@extend %clickable;
|
||||||
|
padding: 20px;
|
||||||
|
border-bottom: 1px solid #DDD;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: rgba(1, 1, 1, 0.05);
|
||||||
|
}
|
||||||
|
& > .side {
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
& > .content {
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
& > .important {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-bottom: .5em;
|
||||||
|
}
|
||||||
|
& > p {
|
||||||
|
margin: .1em 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
& > .actions {
|
||||||
|
flex: none;
|
||||||
|
display: none;
|
||||||
|
|
||||||
|
& > .htk-button {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
& > * {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
& > input {
|
||||||
|
margin: .6em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.item:hover > .actions {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.item:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Button */
|
/* Button */
|
||||||
|
|
||||||
.htk-button {
|
.htk-button {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 2em;
|
border-radius: 22px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
gap: .5em;
|
gap: 8px;
|
||||||
padding: 0 .5em;
|
padding: 0 10px;
|
||||||
|
|
||||||
& > span.icon {
|
& > .htk-icon {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -178,49 +237,66 @@ td.cell-image .htk-image {
|
||||||
/* Calendar */
|
/* Calendar */
|
||||||
|
|
||||||
.htk-calendar {
|
.htk-calendar {
|
||||||
|
@extend %box;
|
||||||
width: 20em;
|
width: 20em;
|
||||||
background-color: white;
|
|
||||||
border: none;
|
table {
|
||||||
border-radius: .5em;
|
|
||||||
}
|
|
||||||
.htk-calendar table {
|
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
.htk-calendar thead tr,
|
thead tr,
|
||||||
.htk-calendar tfoot tr {
|
tfoot tr {
|
||||||
background-color: #888;
|
|
||||||
color: white;
|
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 3em;
|
height: 3em;
|
||||||
}
|
}
|
||||||
.htk-calendar thead span {
|
thead > tr {
|
||||||
color: white;
|
&.weekdays > th {
|
||||||
}
|
font-weight: normal;
|
||||||
.htk-calendar thead tr {
|
color: #999;
|
||||||
border-bottom: none;
|
text-transform: lowercase;
|
||||||
}
|
}
|
||||||
.htk-calendar tfoot tr {
|
& > th {
|
||||||
|
&.previous, &.next {
|
||||||
|
font-size: .8rem;
|
||||||
|
|
||||||
|
button {
|
||||||
|
border-radius: 50%;
|
||||||
|
padding: 10px;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
|
||||||
|
& > .htk-icon {
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.month-year {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
text-transform: lowercase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tfoot tr {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
}
|
}
|
||||||
.htk-calendar th.button {
|
th.button {
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
}
|
}
|
||||||
.htk-calendar th.button:hover {
|
th.button:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-color: rgba(1, 1, 1, 0.2);
|
background-color: rgba(1, 1, 1, 0.2);
|
||||||
}
|
}
|
||||||
.htk-calendar col {
|
col {
|
||||||
width: 14.2%;
|
width: 14.2%;
|
||||||
}
|
}
|
||||||
.htk-calendar tr {
|
tr {
|
||||||
height: 2em;
|
height: 2em;
|
||||||
}
|
}
|
||||||
.htk-calendar tbody td {
|
tbody td {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.htk-calendar tbody td > div {
|
tbody td > div {
|
||||||
height: 2em;
|
height: 2em;
|
||||||
width: 2em;
|
width: 2em;
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
|
@ -229,22 +305,23 @@ td.cell-image .htk-image {
|
||||||
padding: 0.3em;
|
padding: 0.3em;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
color: #555;
|
color: #555;
|
||||||
}
|
}
|
||||||
.htk-calendar div.disabled {
|
div.disabled {
|
||||||
color: #999;
|
color: #bbb;
|
||||||
}
|
}
|
||||||
.htk-calendar div.today {
|
div.today {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
.htk-calendar div.selected {
|
div.selected {
|
||||||
color: white;
|
color: white;
|
||||||
background-color: #8cc63f;
|
background-color: #8cc63f;
|
||||||
}
|
}
|
||||||
.htk-calendar div.enabled:hover {
|
div.enabled:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-color: rgba(140, 198, 63, 0.8);
|
background-color: rgba(140, 198, 63, 0.8);
|
||||||
color: white;
|
color: white;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Image */
|
/* Image */
|
||||||
|
@ -439,7 +516,7 @@ td.cell-image .htk-image {
|
||||||
& > h2 {
|
& > h2 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 1.5em;
|
font-size: 1.5rem;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
$color-hover-cd: rgba(255, 255, 255, .1);
|
501
js/vn/builder.js
501
js/vn/builder.js
|
@ -1,35 +1,30 @@
|
||||||
|
|
||||||
var Object = require ('./object');
|
var Object = require('./object');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a object from a XML specification.
|
* Creates a object from a XML specification.
|
||||||
**/
|
*/
|
||||||
module.exports = new Class
|
module.exports = new Class({
|
||||||
({
|
|
||||||
Extends: Object
|
Extends: Object
|
||||||
,_addedMap: {}
|
,_addedMap: {}
|
||||||
,_contexts: null
|
,_contexts: null
|
||||||
|
|
||||||
,add: function (id, object)
|
,add: function(id, object) {
|
||||||
{
|
|
||||||
this._addedMap[id] = object;
|
this._addedMap[id] = object;
|
||||||
}
|
}
|
||||||
|
|
||||||
,setParent: function (parentResult)
|
,setParent: function(parentResult) {
|
||||||
{
|
|
||||||
this._parentResult = parentResult;
|
this._parentResult = parentResult;
|
||||||
|
|
||||||
if (parentResult && !this.signalData)
|
if (parentResult && !this.signalData)
|
||||||
this.signalData = parentResult.builder.signalData;
|
this.signalData = parentResult.builder.signalData;
|
||||||
}
|
}
|
||||||
|
|
||||||
,getMain: function (result)
|
,getMain: function(result) {
|
||||||
{
|
|
||||||
return result.objects[this._mainContext];
|
return result.objects[this._mainContext];
|
||||||
}
|
}
|
||||||
|
|
||||||
,getById: function (result, objectId)
|
,getById: function(result, objectId) {
|
||||||
{
|
|
||||||
var index = this._contextMap[objectId];
|
var index = this._contextMap[objectId];
|
||||||
|
|
||||||
if (index !== undefined)
|
if (index !== undefined)
|
||||||
|
@ -41,18 +36,16 @@ module.exports = new Class
|
||||||
return object;
|
return object;
|
||||||
|
|
||||||
if (this._parentResult)
|
if (this._parentResult)
|
||||||
return this._parentResult.getById (objectId);
|
return this._parentResult.getById(objectId);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
,getByTagName: function (result, tagName)
|
,getByTagName: function(result, tagName) {
|
||||||
{
|
|
||||||
var tags = this._tags[tagName];
|
var tags = this._tags[tagName];
|
||||||
|
|
||||||
if (tags)
|
if (tags) {
|
||||||
{
|
var arr = new Array(tags.length);
|
||||||
var arr = new Array (tags.length);
|
|
||||||
|
|
||||||
for (var i = 0; i < tags.length; i++)
|
for (var i = 0; i < tags.length; i++)
|
||||||
arr[i] = result.objects[tags[i]];
|
arr[i] = result.objects[tags[i]];
|
||||||
|
@ -69,32 +62,28 @@ module.exports = new Class
|
||||||
* @path String The XML path
|
* @path String The XML path
|
||||||
* @dstDocument Document The document used to create the nodes
|
* @dstDocument Document The document used to create the nodes
|
||||||
* @return %true on success, %false othersise
|
* @return %true on success, %false othersise
|
||||||
**/
|
*/
|
||||||
,loadXml: function (path, dstDocument)
|
,loadXml: function(path, dstDocument) {
|
||||||
{
|
|
||||||
this._path = path;
|
this._path = path;
|
||||||
return this.loadFromXmlDoc (Vn.getXml (path), dstDocument);
|
return this.loadFromXmlDoc(Vn.getXml(path), dstDocument);
|
||||||
}
|
}
|
||||||
|
|
||||||
,loadFromString: function (xmlString, dstDocument)
|
,loadFromString: function(xmlString, dstDocument) {
|
||||||
{
|
var parser = new DOMParser();
|
||||||
var parser = new DOMParser ();
|
var xmlDoc = parser.parseFromString(xmlString, 'text/xml');
|
||||||
var xmlDoc = parser.parseFromString (xmlString, 'text/xml');
|
return this.loadFromXmlDoc(xmlDoc, dstDocument);
|
||||||
return this.loadFromXmlDoc (xmlDoc, dstDocument);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,loadFromXmlDoc: function (xmlDoc, dstDocument)
|
,loadFromXmlDoc: function(xmlDoc, dstDocument, scope) {
|
||||||
{
|
|
||||||
if (!xmlDoc)
|
if (!xmlDoc)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
this._compileInit (dstDocument);
|
this._compileInit(dstDocument, scope);
|
||||||
|
|
||||||
var docElement = xmlDoc.documentElement;
|
var docElement = xmlDoc.documentElement;
|
||||||
|
|
||||||
if (docElement.tagName !== 'vn')
|
if (docElement.tagName !== 'vn') {
|
||||||
{
|
this._showError('Malformed XML');
|
||||||
this._showError ('Malformed XML');
|
|
||||||
this._contexts = null;
|
this._contexts = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -103,9 +92,9 @@ module.exports = new Class
|
||||||
|
|
||||||
if (childs)
|
if (childs)
|
||||||
for (var i = 0; i < childs.length; i++)
|
for (var i = 0; i < childs.length; i++)
|
||||||
this._compileNode (childs[i]);
|
this._compileNode(childs[i]);
|
||||||
|
|
||||||
this._compileEnd ();
|
this._compileEnd();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,75 +104,130 @@ module.exports = new Class
|
||||||
* @path Node The DOM node
|
* @path Node The DOM node
|
||||||
* @dstDocument Document The document used to create the nodes
|
* @dstDocument Document The document used to create the nodes
|
||||||
* @return %true on success, %false othersise
|
* @return %true on success, %false othersise
|
||||||
**/
|
*/
|
||||||
,loadXmlFromNode: function (node, dstDocument)
|
,loadXmlFromNode: function(node, dstDocument, scope) {
|
||||||
{
|
this._compileInit(dstDocument, scope);
|
||||||
this._compileInit (dstDocument);
|
this._mainContext = this._compileNode(node).id;
|
||||||
this._mainContext = this._compileNode (node).id;
|
this._compileEnd();
|
||||||
this._compileEnd ();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
,load: function ()
|
,load: function() {
|
||||||
{
|
|
||||||
if (this._contexts === null)
|
if (this._contexts === null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var contexts = this._contexts;
|
var contexts = this._contexts;
|
||||||
var len = contexts.length;
|
var len = contexts.length;
|
||||||
var objects = new Array (len);
|
var objects = new Array(len);
|
||||||
|
|
||||||
for (var i = 0; i < len; i++)
|
for (var i = 0; i < len; i++) {
|
||||||
{
|
|
||||||
var context = contexts[i];
|
var context = contexts[i];
|
||||||
|
|
||||||
if (context.tagName)
|
if (context.tagName)
|
||||||
objects[i] = this.elementInstantiate (context);
|
objects[i] = this.elementInstantiate(context);
|
||||||
else if (context.klass)
|
else if (context.klass)
|
||||||
objects[i] = this.objectInstantiate (context);
|
objects[i] = this.objectInstantiate(context);
|
||||||
else
|
else
|
||||||
objects[i] = this.textInstantiate (context);
|
objects[i] = this.textInstantiate(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new BuilderResult (this, objects);
|
return new BuilderResult(this, objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
,link: function (result)
|
,link: function(result, self, scope) {
|
||||||
{
|
|
||||||
var objects = result.objects;
|
var objects = result.objects;
|
||||||
|
|
||||||
for (var i = this._links.length - 1; i >= 0; i--)
|
for (var i = this._links.length - 1; i >= 0; i--) {
|
||||||
{
|
|
||||||
var l = this._links[i];
|
var l = this._links[i];
|
||||||
var addedObject = this._addedMap[l.objectId];
|
var addedObject = this._addedMap[l.objectId];
|
||||||
|
|
||||||
if (addedObject)
|
if (addedObject) {
|
||||||
{
|
|
||||||
if (l.prop)
|
if (l.prop)
|
||||||
objects[l.context.id][l.prop] = addedObject;
|
objects[l.context.id][l.prop] = addedObject;
|
||||||
else
|
else
|
||||||
objects[l.context.id].appendChild (addedObject);
|
objects[l.context.id].appendChild(addedObject);
|
||||||
}
|
} else
|
||||||
else
|
this._showError('Referenced unexistent object with id \'%s\'',
|
||||||
this._showError ('Referenced unexistent object with id \'%s\'',
|
|
||||||
l.objectId);
|
l.objectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.linkExpr(result, self, scope);
|
||||||
|
|
||||||
var contexts = this._contexts;
|
var contexts = this._contexts;
|
||||||
for (var i = 0; i < contexts.length; i++)
|
for (var i = 0; i < contexts.length; i++) {
|
||||||
{
|
|
||||||
var context = contexts[i];
|
var context = contexts[i];
|
||||||
var object = objects[i];
|
var object = objects[i];
|
||||||
|
|
||||||
if (context.tagName)
|
if (context.tagName)
|
||||||
this.elementLink (context, object, objects, result);
|
this.elementLink(context, object, objects, result);
|
||||||
else if (context.klass)
|
else if (context.klass)
|
||||||
this.objectLink (context, object, objects, result);
|
this.objectLink(context, object, objects, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
,_compileInit: function (dstDocument)
|
,fnExpr(expr) {
|
||||||
{
|
return new Function(this._scopeArgs,
|
||||||
|
'"use strict"; return ' + expr + ';'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
,matchExpr(value) {
|
||||||
|
const match = /^{{(.*)}}$/.exec(value);
|
||||||
|
if (!match) return null;
|
||||||
|
return this.fnExpr(match[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
,linkExpr(result, self, scope) {
|
||||||
|
const contexts = this._contexts;
|
||||||
|
const objects = result.objects;
|
||||||
|
let args = [_]
|
||||||
|
|
||||||
|
if (scope) args = args.concat(scope);
|
||||||
|
|
||||||
|
for (let i = 0; i < contexts.length; i++) {
|
||||||
|
const context = contexts[i];
|
||||||
|
const object = objects[i];
|
||||||
|
|
||||||
|
if (context.exprs) {
|
||||||
|
const values = [];
|
||||||
|
for (expr of context.exprs) {
|
||||||
|
let value = undefined;
|
||||||
|
try {
|
||||||
|
value = expr.apply(self, args);
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('Expression error:', e.message);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
values.push(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
let k = 0;
|
||||||
|
const text = context.text.replace(/{{\d+}}/g, function() {
|
||||||
|
return values[k++];
|
||||||
|
});
|
||||||
|
object.textContent = text;
|
||||||
|
} else {
|
||||||
|
const dynProps = context.dynProps;
|
||||||
|
|
||||||
|
for (const prop in dynProps) {
|
||||||
|
let value = undefined;
|
||||||
|
try {
|
||||||
|
value = dynProps[prop].apply(self, args);
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('Expression error:', e.message);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context.tagName)
|
||||||
|
object.setAttribute(prop, value);
|
||||||
|
else
|
||||||
|
object[prop] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
,_compileInit: function(dstDocument, scope) {
|
||||||
this._path = null;
|
this._path = null;
|
||||||
this._tags = {};
|
this._tags = {};
|
||||||
this._contexts = [];
|
this._contexts = [];
|
||||||
|
@ -191,61 +235,58 @@ module.exports = new Class
|
||||||
this._links = [];
|
this._links = [];
|
||||||
this._mainContext = null;
|
this._mainContext = null;
|
||||||
this._doc = dstDocument ? dstDocument : document;
|
this._doc = dstDocument ? dstDocument : document;
|
||||||
|
|
||||||
|
this._scope = ['_'];
|
||||||
|
if (scope)
|
||||||
|
this._scope = this._scope.concat(scope);
|
||||||
|
this._scopeArgs = this._scope.join(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
,_compileEnd: function ()
|
,_compileEnd: function() {
|
||||||
{
|
for (var i = this._links.length - 1; i >= 0; i--) {
|
||||||
for (var i = this._links.length - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
var l = this._links[i];
|
var l = this._links[i];
|
||||||
var contextId = this._contextMap[l.objectId];
|
var contextId = this._contextMap[l.objectId];
|
||||||
|
|
||||||
if (contextId != undefined)
|
if (contextId != undefined) {
|
||||||
{
|
|
||||||
if (l.prop)
|
if (l.prop)
|
||||||
l.context.objectProps[l.prop] = contextId;
|
l.context.objectProps[l.prop] = contextId;
|
||||||
else
|
else
|
||||||
l.context.childs.push (contextId);
|
l.context.childs.push(contextId);
|
||||||
|
|
||||||
this._links.splice (i, 1);
|
this._links.splice(i, 1);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
var object = this._addedMap[l.objectId];
|
var object = this._addedMap[l.objectId];
|
||||||
|
|
||||||
if (!object && this._parentResult)
|
if (!object && this._parentResult)
|
||||||
object = this._parentResult.getById (l.objectId);
|
object = this._parentResult.getById(l.objectId);
|
||||||
|
|
||||||
if (object)
|
if (object) {
|
||||||
{
|
|
||||||
l.context.props[l.prop] = object;
|
l.context.props[l.prop] = object;
|
||||||
this._links.splice (i, 1);
|
this._links.splice(i, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
,_compileNode: function (node)
|
,_compileNode: function(node) {
|
||||||
{
|
|
||||||
var context = null;
|
var context = null;
|
||||||
var tagName = null;
|
var tagName = null;
|
||||||
|
|
||||||
if (node.nodeType === Node.ELEMENT_NODE)
|
if (node.nodeType === Node.ELEMENT_NODE)
|
||||||
tagName = node.tagName.toLowerCase ();
|
tagName = node.tagName.toLowerCase();
|
||||||
else if (node.nodeType !== Node.TEXT_NODE
|
else if (node.nodeType !== Node.TEXT_NODE
|
||||||
|| /^[\n\r\t]*$/.test (node.textContent))
|
|| /^[\n\r\t]*$/.test(node.textContent))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var context =
|
var context =
|
||||||
this.textCompile (node, tagName)
|
this.textCompile(node, tagName)
|
||||||
|| this.objectCompile (node, tagName)
|
|| this.objectCompile(node, tagName)
|
||||||
|| this.elementCompile (node, tagName);
|
|| this.elementCompile(node, tagName);
|
||||||
|
|
||||||
context.id = this._contexts.length;
|
context.id = this._contexts.length;
|
||||||
|
|
||||||
if (tagName)
|
if (tagName) {
|
||||||
{
|
var nodeId = node.getAttribute('id');
|
||||||
var nodeId = node.getAttribute ('id');
|
|
||||||
|
|
||||||
if (nodeId)
|
if (nodeId)
|
||||||
this._contextMap[nodeId] = context.id;
|
this._contextMap[nodeId] = context.id;
|
||||||
|
@ -255,44 +296,53 @@ module.exports = new Class
|
||||||
if (!tags)
|
if (!tags)
|
||||||
this._tags[tagName] = tags = [];
|
this._tags[tagName] = tags = [];
|
||||||
|
|
||||||
tags.push (context.id);
|
tags.push(context.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._contexts.push (context);
|
this._contexts.push(context);
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a text node context.
|
* Creates a text node context.
|
||||||
**/
|
*/
|
||||||
,textCompile: function (node, tagName)
|
,textCompile: function(node, tagName) {
|
||||||
{
|
if (!tagName) {
|
||||||
if (!tagName)
|
let text = node.textContent;
|
||||||
var text = node.textContent;
|
|
||||||
else if (tagName === 't')
|
if (/{{.*}}/.test(text)) {
|
||||||
var text = _(node.firstChild.textContent);
|
let i = 0;
|
||||||
|
const self = this;
|
||||||
|
const exprs = [];
|
||||||
|
text = text.replace(/{{((?:(?!}}).)*)}}/g, function(match, capture) {
|
||||||
|
exprs.push(self.fnExpr(capture));
|
||||||
|
return `{{${i++}}}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
return {text, exprs};
|
||||||
|
} else
|
||||||
|
return {text};
|
||||||
|
} else if (tagName === 't')
|
||||||
|
return {text: _(node.firstChild.textContent)};
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return {text: text};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,textInstantiate: function (context)
|
,textInstantiate: function(context) {
|
||||||
{
|
return this._doc.createTextNode(context.exprs ? '' : context.text);
|
||||||
return this._doc.createTextNode (context.text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a object context.
|
* Creates a object context.
|
||||||
**/
|
*/
|
||||||
,objectCompile: function (node, tagName)
|
,objectCompile: function(node, tagName) {
|
||||||
{
|
|
||||||
var klass = vnCustomTags[tagName];
|
var klass = vnCustomTags[tagName];
|
||||||
|
|
||||||
if (!klass)
|
if (!klass)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var props = {};
|
var props = {};
|
||||||
|
var dynProps = {};
|
||||||
var objectProps = {};
|
var objectProps = {};
|
||||||
var childs = [];
|
var childs = [];
|
||||||
var events = {};
|
var events = {};
|
||||||
|
@ -300,6 +350,7 @@ module.exports = new Class
|
||||||
var context = {
|
var context = {
|
||||||
klass: klass,
|
klass: klass,
|
||||||
props: props,
|
props: props,
|
||||||
|
dynProps: dynProps,
|
||||||
objectProps: objectProps,
|
objectProps: objectProps,
|
||||||
childs: childs,
|
childs: childs,
|
||||||
events: events,
|
events: events,
|
||||||
|
@ -308,21 +359,17 @@ module.exports = new Class
|
||||||
|
|
||||||
var a = node.attributes;
|
var a = node.attributes;
|
||||||
|
|
||||||
for (var i = 0; i < a.length; i++)
|
for (var i = 0; i < a.length; i++) {
|
||||||
{
|
|
||||||
var attribute = a[i].nodeName;
|
var attribute = a[i].nodeName;
|
||||||
var value = a[i].nodeValue;
|
var value = a[i].nodeValue;
|
||||||
|
|
||||||
if (this._isEvent (attribute))
|
if (this._isEvent(attribute)) {
|
||||||
{
|
var handler = this._getMethod(value)
|
||||||
var handler = this._getMethod (value)
|
|
||||||
|
|
||||||
if (handler)
|
if (handler)
|
||||||
events[attribute.substr (3)] = handler;
|
events[attribute.substr(3)] = handler;
|
||||||
}
|
} else if (!/^(id|property)$/.test(attribute)) {
|
||||||
else if (!/^(id|property)$/.test (attribute))
|
this.propCompile(context, klass, props, dynProps,
|
||||||
{
|
|
||||||
this.propCompile (context, klass, props,
|
|
||||||
node, attribute, value);
|
node, attribute, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -330,72 +377,65 @@ module.exports = new Class
|
||||||
var childNodes = node.childNodes;
|
var childNodes = node.childNodes;
|
||||||
|
|
||||||
if (childNodes)
|
if (childNodes)
|
||||||
for (var i = 0; i < childNodes.length; i++)
|
for (var i = 0; i < childNodes.length; i++) {
|
||||||
{
|
|
||||||
var child = childNodes[i];
|
var child = childNodes[i];
|
||||||
var isElement = child.nodeType === Node.ELEMENT_NODE;
|
var isElement = child.nodeType === Node.ELEMENT_NODE;
|
||||||
var childTagName = isElement ? child.tagName.toLowerCase () : null;
|
var childTagName = isElement ? child.tagName.toLowerCase() : null;
|
||||||
var childContext;
|
var childContext;
|
||||||
|
|
||||||
if (childTagName === 'pointer')
|
if (childTagName === 'pointer') {
|
||||||
{
|
this._addLink(context, null, child.getAttribute('object'));
|
||||||
this._addLink (context, null, child.getAttribute ('object'));
|
} else if (childTagName === 'custom') {
|
||||||
}
|
|
||||||
else if (childTagName === 'custom')
|
|
||||||
{
|
|
||||||
context.custom = child;
|
context.custom = child;
|
||||||
}
|
} else if (childContext = this._compileNode(child)) {
|
||||||
else if (childContext = this._compileNode (child))
|
var prop = isElement ? child.getAttribute('property') : null;
|
||||||
{
|
|
||||||
var prop = isElement ? child.getAttribute ('property') : null;
|
|
||||||
|
|
||||||
if (prop)
|
if (prop) {
|
||||||
{
|
prop = prop.replace(/-./g, this._replaceFunc);
|
||||||
prop = prop.replace (/-./g, this._replaceFunc);
|
|
||||||
objectProps[prop] = childContext.id;
|
objectProps[prop] = childContext.id;
|
||||||
}
|
} else
|
||||||
else
|
childs.push(childContext.id);
|
||||||
childs.push (childContext.id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
,propCompile: function (context, klass, props, node, attribute, value)
|
,propCompile: function(context, klass, props, dynProps, node, attribute, value) {
|
||||||
{
|
|
||||||
var isLink = false;
|
var isLink = false;
|
||||||
var newValue = null;
|
var newValue = null;
|
||||||
var propName = attribute.replace (/-./g, this._replaceFunc);
|
var propName = attribute.replace(/-./g, this._replaceFunc);
|
||||||
var propInfo = klass.Properties[propName];
|
var propInfo = klass.Properties[propName];
|
||||||
|
|
||||||
if (!propInfo)
|
if (!propInfo) {
|
||||||
{
|
this._showError('Attribute \'%s\' not valid for tag \'%s\'',
|
||||||
this._showError ('Attribute \'%s\' not valid for tag \'%s\'',
|
|
||||||
attribute, node.tagName);
|
attribute, node.tagName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!value)
|
if (!value) {
|
||||||
{
|
this._showError('Attribute \'%s\' empty on tag \'%s\'',
|
||||||
this._showError ('Attribute \'%s\' empty on tag \'%s\'',
|
|
||||||
attribute, node.tagName);
|
attribute, node.tagName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (propInfo.type)
|
const expr = this.matchExpr(value);
|
||||||
{
|
|
||||||
|
if (expr) {
|
||||||
|
dynProps[propName] = expr;
|
||||||
|
} else {
|
||||||
|
switch (propInfo.type) {
|
||||||
case Boolean:
|
case Boolean:
|
||||||
newValue = (/^(true|1)$/i).test (value);
|
newValue = (/^(true|1)$/i).test(value);
|
||||||
break;
|
break;
|
||||||
case Number:
|
case Number:
|
||||||
newValue = 0 + new Number (value);
|
newValue = 0 + new Number(value);
|
||||||
break;
|
break;
|
||||||
case String:
|
case String:
|
||||||
newValue = this._translateValue (value);
|
newValue = this._translateValue(value);
|
||||||
break;
|
break;
|
||||||
case Function:
|
case Function:
|
||||||
var method = this._getMethod (value);
|
var method = this._getMethod(value);
|
||||||
newValue = method ? method.bind (this.signalData) : null;
|
newValue = method ? method.bind(this.signalData) : null;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (propInfo.enumType)
|
if (propInfo.enumType)
|
||||||
|
@ -405,22 +445,21 @@ module.exports = new Class
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLink)
|
if (isLink)
|
||||||
this._addLink (context, propName, value);
|
this._addLink(context, propName, value);
|
||||||
else if (newValue !== null && newValue !== undefined)
|
else if (newValue !== null && newValue !== undefined)
|
||||||
props[propName] = newValue;
|
props[propName] = newValue;
|
||||||
else
|
else
|
||||||
this._showError ('Attribute \'%s\' invalid for tag \'%s\'',
|
this._showError('Attribute \'%s\' invalid for tag \'%s\'',
|
||||||
attribute, node.tagName);
|
attribute, node.tagName);
|
||||||
}
|
}
|
||||||
|
|
||||||
,objectInstantiate: function (context)
|
|
||||||
{
|
|
||||||
return new context.klass ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,objectLink: function (context, object, objects, res)
|
,objectInstantiate: function(context) {
|
||||||
{
|
return new context.klass();
|
||||||
object.setProperties (context.props);
|
}
|
||||||
|
|
||||||
|
,objectLink: function(context, object, objects, res) {
|
||||||
|
object.setProperties(context.props);
|
||||||
|
|
||||||
var objectProps = context.objectProps;
|
var objectProps = context.objectProps;
|
||||||
for (var prop in objectProps)
|
for (var prop in objectProps)
|
||||||
|
@ -428,42 +467,42 @@ module.exports = new Class
|
||||||
|
|
||||||
var childs = context.childs;
|
var childs = context.childs;
|
||||||
for (var i = 0; i < childs.length; i++)
|
for (var i = 0; i < childs.length; i++)
|
||||||
object.appendChild (objects[childs[i]]);
|
object.appendChild(objects[childs[i]]);
|
||||||
|
|
||||||
var events = context.events;
|
var events = context.events;
|
||||||
for (var event in events)
|
for (var event in events)
|
||||||
object.on (event, events[event], this.signalData);
|
object.on(event, events[event], this.signalData);
|
||||||
|
|
||||||
if (context.custom)
|
if (context.custom)
|
||||||
object.loadXml (res, context.custom);
|
object.loadXml(res, context.custom);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a HTML node context.
|
* Creates a HTML node context.
|
||||||
**/
|
*/
|
||||||
,elementCompile: function (node, tagName)
|
,elementCompile: function(node, tagName) {
|
||||||
{
|
|
||||||
var attributes = {};
|
var attributes = {};
|
||||||
|
var dynProps = {};
|
||||||
var childs = [];
|
var childs = [];
|
||||||
var events = {};
|
var events = {};
|
||||||
var handler;
|
var handler;
|
||||||
|
|
||||||
var a = node.attributes;
|
var a = node.attributes;
|
||||||
|
|
||||||
for (var i = 0; i < a.length; i++)
|
for (var i = 0; i < a.length; i++) {
|
||||||
{
|
|
||||||
var attribute = a[i].nodeName;
|
var attribute = a[i].nodeName;
|
||||||
var value = a[i].nodeValue;
|
var value = a[i].nodeValue;
|
||||||
|
const expr = this.matchExpr(value);
|
||||||
|
|
||||||
if (this._isEvent (attribute))
|
if (expr) {
|
||||||
{
|
dynProps[attribute] = expr;
|
||||||
var handler = this._getMethod (value);
|
} else if (this._isEvent(attribute)) {
|
||||||
|
var handler = this._getMethod(value);
|
||||||
|
|
||||||
if (handler)
|
if (handler)
|
||||||
events[attribute.substr (3)] = handler;
|
events[attribute.substr(3)] = handler;
|
||||||
}
|
} else if (attribute !== 'id')
|
||||||
else if (attribute !== 'id')
|
attributes[attribute] = this._translateValue(value);
|
||||||
attributes[attribute] = this._translateValue (value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var childContext;
|
var childContext;
|
||||||
|
@ -471,145 +510,129 @@ module.exports = new Class
|
||||||
|
|
||||||
if (childNodes)
|
if (childNodes)
|
||||||
for (var i = 0; i < childNodes.length; i++)
|
for (var i = 0; i < childNodes.length; i++)
|
||||||
if (childContext = this._compileNode (childNodes[i]))
|
if (childContext = this._compileNode(childNodes[i]))
|
||||||
childs.push (childContext.id);
|
childs.push(childContext.id);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
tagName: tagName,
|
tagName,
|
||||||
attributes: attributes,
|
attributes,
|
||||||
childs: childs,
|
dynProps,
|
||||||
events: events
|
childs,
|
||||||
|
events
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
,elementInstantiate: function (context)
|
,elementInstantiate: function(context) {
|
||||||
{
|
return this._doc.createElement(context.tagName);
|
||||||
return this._doc.createElement (context.tagName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,elementLink: function (context, object, objects)
|
,elementLink: function(context, object, objects) {
|
||||||
{
|
|
||||||
var attributes = context.attributes;
|
var attributes = context.attributes;
|
||||||
for (var attribute in attributes)
|
for (var attribute in attributes)
|
||||||
object.setAttribute (attribute, attributes[attribute]);
|
object.setAttribute(attribute, attributes[attribute]);
|
||||||
|
|
||||||
var childs = context.childs;
|
var childs = context.childs;
|
||||||
for (var i = 0; i < childs.length; i++)
|
for (var i = 0; i < childs.length; i++) {
|
||||||
{
|
|
||||||
var child = objects[childs[i]];
|
var child = objects[childs[i]];
|
||||||
|
|
||||||
if (child instanceof Htk.Widget)
|
if (child instanceof Htk.Widget)
|
||||||
child = child.node;
|
child = child.node;
|
||||||
if (child instanceof Node)
|
if (child instanceof Node)
|
||||||
object.appendChild (child);
|
object.appendChild(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
var events = context.events;
|
var events = context.events;
|
||||||
for (var event in events)
|
for (var event in events)
|
||||||
object.addEventListener (event,
|
object.addEventListener(event,
|
||||||
events[event].bind (this.signalData));
|
events[event].bind(this.signalData));
|
||||||
}
|
}
|
||||||
|
|
||||||
,_showError: function (error)
|
,_showError: function(error) {
|
||||||
{
|
|
||||||
var path = this._path ? this._path : 'Node';
|
var path = this._path ? this._path : 'Node';
|
||||||
var logArgs = ['Vn.Builder: %s: '+ error, path];
|
var logArgs = ['Vn.Builder: %s: '+ error, path];
|
||||||
|
|
||||||
for (var i = 1; i < arguments.length; i++)
|
for (var i = 1; i < arguments.length; i++)
|
||||||
logArgs.push (arguments[i]);
|
logArgs.push(arguments[i]);
|
||||||
|
|
||||||
console.warn.apply (null, logArgs);
|
console.warn.apply(null, logArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
,_addLink: function (context, prop, objectId)
|
,_addLink: function(context, prop, objectId) {
|
||||||
{
|
this._links.push({
|
||||||
this._links.push ({
|
|
||||||
context: context
|
context: context
|
||||||
,prop: prop
|
,prop: prop
|
||||||
,objectId: objectId
|
,objectId: objectId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
,_translateValue: function (value)
|
,_translateValue: function(value) {
|
||||||
{
|
var chr = value.charAt(0);
|
||||||
var chr = value.charAt (0);
|
|
||||||
|
|
||||||
if (chr === '_')
|
if (chr === '_')
|
||||||
return _(value.substr (1));
|
return _(value.substr(1));
|
||||||
else if (chr === '\\' && value.charAt (1) === '_')
|
else if (chr === '\\' && value.charAt(1) === '_')
|
||||||
return value.substr (1);
|
return value.substr(1);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
,_getMethod: function (value)
|
,_getMethod: function(value) {
|
||||||
{
|
|
||||||
if (this.signalData)
|
if (this.signalData)
|
||||||
var method = this.signalData[value];
|
var method = this.signalData[value];
|
||||||
else
|
else
|
||||||
var method = window[value];
|
var method = window[value];
|
||||||
|
|
||||||
if (method === undefined)
|
if (method === undefined)
|
||||||
this._showError ('Function \'%s\' not found', value);
|
this._showError('Function \'%s\' not found', value);
|
||||||
|
|
||||||
return method;
|
return method;
|
||||||
}
|
}
|
||||||
|
|
||||||
,_isEvent: function (attribute)
|
,_isEvent: function(attribute) {
|
||||||
{
|
return /^on-\w+/.test(attribute);
|
||||||
return /^on-\w+/.test (attribute);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,_replaceFunc: function (token)
|
,_replaceFunc: function(token) {
|
||||||
{
|
return token.charAt(1).toUpperCase();
|
||||||
return token.charAt(1).toUpperCase ();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var BuilderResult = new Class
|
var BuilderResult = new Class({
|
||||||
({
|
|
||||||
Extends: Object
|
Extends: Object
|
||||||
|
|
||||||
,initialize: function (builder, objects)
|
,initialize: function(builder, objects) {
|
||||||
{
|
|
||||||
this.builder = builder;
|
this.builder = builder;
|
||||||
this.objects = objects;
|
this.objects = objects;
|
||||||
}
|
}
|
||||||
|
|
||||||
,getMain: function ()
|
,getMain: function() {
|
||||||
{
|
return this.builder.getMain(this);
|
||||||
return this.builder.getMain (this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,$: function (objectId)
|
,$: function(objectId) {
|
||||||
{
|
return this.builder.getById(this, objectId);
|
||||||
return this.builder.getById (this, objectId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,getById: function (objectId)
|
,getById: function(objectId) {
|
||||||
{
|
return this.builder.getById(this, objectId);
|
||||||
return this.builder.getById (this, objectId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,getByTagName: function (tagName)
|
,getByTagName: function(tagName) {
|
||||||
{
|
return this.builder.getByTagName(this, tagName);
|
||||||
return this.builder.getByTagName (this, tagName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,link: function ()
|
,link: function(self, scope) {
|
||||||
{
|
this.builder.link(this, self, scope);
|
||||||
this.builder.link (this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,_destroy: function ()
|
,_destroy: function() {
|
||||||
{
|
|
||||||
var objects = this.objects;
|
var objects = this.objects;
|
||||||
|
|
||||||
for (var i = 0; i < objects.length; i++)
|
for (var i = 0; i < objects.length; i++)
|
||||||
if (objects[i] instanceof Object)
|
if (objects[i] instanceof Object)
|
||||||
objects[i].unref ();
|
objects[i].unref();
|
||||||
|
|
||||||
this.parent ();
|
this.parent();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ module.exports =
|
||||||
,'Feb'
|
,'Feb'
|
||||||
,'Mar'
|
,'Mar'
|
||||||
,'Apr'
|
,'Apr'
|
||||||
,'May'
|
,'AbrMay'
|
||||||
,'Jun'
|
,'Jun'
|
||||||
,'Jul'
|
,'Jul'
|
||||||
,'Ago'
|
,'Ago'
|
||||||
|
|
|
@ -27,6 +27,7 @@ December: Decembre
|
||||||
Jan: Gen
|
Jan: Gen
|
||||||
Feb: Febr
|
Feb: Febr
|
||||||
Mar: Març
|
Mar: Març
|
||||||
|
AbrMay: Mai
|
||||||
Apr: Abr
|
Apr: Abr
|
||||||
Jun: Juny
|
Jun: Juny
|
||||||
Jul: Jul
|
Jul: Jul
|
||||||
|
|
|
@ -28,6 +28,7 @@ Jan: Jan
|
||||||
Feb: Feb
|
Feb: Feb
|
||||||
Mar: Mar
|
Mar: Mar
|
||||||
Apr: Apr
|
Apr: Apr
|
||||||
|
AbrMay: May
|
||||||
Jun: Jun
|
Jun: Jun
|
||||||
Jul: Jul
|
Jul: Jul
|
||||||
Ago: Ago
|
Ago: Ago
|
||||||
|
|
|
@ -16,7 +16,7 @@ January: Enero
|
||||||
February: Febrero
|
February: Febrero
|
||||||
March: Marzo
|
March: Marzo
|
||||||
April: Abril
|
April: Abril
|
||||||
May: May
|
May: Mayo
|
||||||
June: Junio
|
June: Junio
|
||||||
July: Julio
|
July: Julio
|
||||||
August: Agosto
|
August: Agosto
|
||||||
|
@ -28,6 +28,7 @@ Jan: Ene
|
||||||
Feb: Feb
|
Feb: Feb
|
||||||
Mar: Mar
|
Mar: Mar
|
||||||
Apr: Abr
|
Apr: Abr
|
||||||
|
AbrMay: May
|
||||||
Jun: Jun
|
Jun: Jun
|
||||||
Jul: Jul
|
Jul: Jul
|
||||||
Ago: Ago
|
Ago: Ago
|
||||||
|
|
|
@ -28,6 +28,7 @@ Jan: Jan
|
||||||
Feb: Fév
|
Feb: Fév
|
||||||
Mar: Mars
|
Mar: Mars
|
||||||
Apr: Avr
|
Apr: Avr
|
||||||
|
AbrMay: Mai
|
||||||
Jun: Juin
|
Jun: Juin
|
||||||
Jul: Juil
|
Jul: Juil
|
||||||
Ago: Août
|
Ago: Août
|
||||||
|
|
|
@ -28,6 +28,7 @@ Jan: оны
|
||||||
Feb: хоё
|
Feb: хоё
|
||||||
Mar: Гур
|
Mar: Гур
|
||||||
Apr: Дөр
|
Apr: Дөр
|
||||||
|
AbrMay: May
|
||||||
Jun: Jun
|
Jun: Jun
|
||||||
Jul: Jul
|
Jul: Jul
|
||||||
Ago: Най
|
Ago: Най
|
||||||
|
|
|
@ -28,6 +28,7 @@ Jan: Jan
|
||||||
Feb: Fev
|
Feb: Fev
|
||||||
Mar: Mar
|
Mar: Mar
|
||||||
Apr: Abr
|
Apr: Abr
|
||||||
|
AbrMay: Mai
|
||||||
Jun: Jun
|
Jun: Jun
|
||||||
Jul: Jul
|
Jul: Jul
|
||||||
Ago: Ago
|
Ago: Ago
|
||||||
|
|
Loading…
Reference in New Issue