Version aplha5 del bionic

This commit is contained in:
Juan Ferrer Toribio 2015-07-17 16:34:42 +02:00
parent e460b4595f
commit 06349730e8
20 changed files with 335 additions and 107 deletions

View File

@ -1,26 +1,59 @@
/* News panel */ /* News panel */
.home .home
{ {
padding: 1em; margin: .5em;
} }
.home .column .column
{ {
max-width: 40em; max-width: 120em;
margin: 0 auto; margin: 0 auto;
text-align: center;
}
/* New */
.new-container
{
display: inline-block;
vertical-align: top;
}/*
.new-container:nth-child(2n+0)
{
float: right;
}*/
@media screen and (min-width: 300px)
{
.new-container { width: 100%; }
}
@media screen and (min-width: 700px)
{
.new-container { width: 50%; }
}
@media screen and (min-width: 1300px)
{
.new-container { width: 33.3%; }
}
@media screen and (min-width: 2000px)
{
.new-container { width: 25%; }
} }
.new .new
{ {
padding: 2em; text-align: left;
background-color: white; background-color: white;
color: #222; color: #222;
border: none; border: none;
border-radius: 0.1em; border-radius: 0.1em;
box-shadow: 0 0.2em 0.2em #CCC; box-shadow: 0 0.2em 0.2em #CCC;
margin-bottom: 1em; margin: .5em;
}
.new .top
{
padding: 1.5em;
padding-bottom: 1em;
} }
/* New */
.new h2 .new h2
{ {
font-size: 1.6em; font-size: 1.6em;
@ -46,8 +79,7 @@
{ {
display: block; display: block;
margin: auto; margin: auto;
max-width: 92%; width: 100%;
padding-top: 1em;
} }
/* Survey */ /* Survey */

View File

@ -1,7 +1,7 @@
<vn> <vn>
<vn-group> <vn-group>
<db-model id="news"> <db-model id="news">
SELECT title, date_time, text, id FROM news SELECT title, date_time, text, image, id FROM news
WHERE tag != 'course' WHERE tag != 'course'
ORDER BY priority, date_time DESC ORDER BY priority, date_time DESC
</db-model> </db-model>
@ -9,15 +9,19 @@
<div id="form" class="home"> <div id="form" class="home">
<div class="column" id="news-column"> <div class="column" id="news-column">
<htk-repeater model="news" form-id="new"> <htk-repeater model="news" form-id="new">
<div class="new-container">
<div class="new"> <div class="new">
<h2><htk-text form="new" column="title"/></h2> <div class="top">
<p class="new-info"> <h2><htk-text form="new" column="title"/></h2>
<htk-text format="_%a, %e %b %Y" form="new" column="date_time"/> <p class="new-info">
</p> <htk-text format="_%a, %e %b %Y" form="new" column="date_time"/>
<div class="new-text"> </p>
<htk-html form="new" column="text"/> <div class="new-text">
<htk-html form="new" column="text"/>
</div>
</div> </div>
<htk-image directory="news/full" form="new" column="id"/> <htk-image directory="news/full" form="new" column="image"/>
</div>
</div> </div>
</htk-repeater> </htk-repeater>
</div> </div>

View File

@ -1,27 +1,55 @@
/* News panel */ /* News panel */
.training .training
{ {
padding: 1em; margin: .5em;
} }
.training .column .column
{ {
max-width: 40em; max-width: 120em;
margin: 0 auto; margin: 0 auto;
text-align: center;
}
/* New */
.new-container
{
display: inline-block;
vertical-align: top;
}
@media screen and (min-width: 800px)
{
.new-container { width: 100%; }
}
@media screen and (min-width: 1000px)
{
.new-container { width: 50%; }
}
@media screen and (min-width: 1300px)
{
.new-container { width: 33.3%; }
}
@media screen and (min-width: 2000px)
{
.new-container { width: 25%; }
} }
.new .new
{ {
padding: 2em; text-align: left;
background-color: white; background-color: white;
color: #222; color: #222;
border: none; border: none;
border-radius: 0.1em; border-radius: 0.1em;
box-shadow: 0 0.2em 0.2em #CCC; box-shadow: 0 0.2em 0.2em #CCC;
margin-bottom: 1em; margin: .5em;
}
.new .top
{
padding: 1.5em;
padding-bottom: 1em;
} }
/* New */
.new h2 .new h2
{ {
font-size: 1.6em; font-size: 1.6em;
@ -47,6 +75,6 @@
{ {
display: block; display: block;
margin: auto; margin: auto;
max-width: 92%; width: 100%;
padding-top: 1em;
} }

View File

@ -1,23 +1,27 @@
<vn> <vn>
<vn-group> <vn-group>
<db-model id="news"> <db-model id="news">
SELECT title, date_time, text, id FROM news SELECT title, date_time, text, image, id FROM news
WHERE tag = 'course' WHERE tag = 'course'
ORDER BY priority, date_time DESC ORDER BY priority, date_time DESC
</db-model> </db-model>
</vn-group> </vn-group>
<div id="form" class="training"> <div id="form" class="training">
<div class="column" id="courses-column"> <div class="column" id="news-column">
<htk-repeater model="news" form-id="course"> <htk-repeater model="news" form-id="new">
<div class="new-container">
<div class="new"> <div class="new">
<h2><htk-text form="course" column="title"/></h2> <div class="top">
<p class="new-info"> <h2><htk-text form="new" column="title"/></h2>
<htk-text format="_%a, %e %b %Y" form="course" column="date_time"/> <p class="new-info">
</p> <htk-text format="_%a, %e %b %Y" form="new" column="date_time"/>
<div class="new-text"> </p>
<htk-html form="course" column="text"/> <div class="new-text">
<htk-html form="new" column="text"/>
</div>
</div> </div>
<htk-image directory="news/full" form="course" column="id"/> <htk-image directory="news/full" form="new" column="image"/>
</div>
</div> </div>
</htk-repeater> </htk-repeater>
</div> </div>

View File

@ -45,7 +45,7 @@
<item name="order" param="order"/> <item name="order" param="order"/>
</sql-batch> </sql-batch>
</db-model> </db-model>
<htk-column-image column="Foto" directory="catalog" subdir="30x30" show-full="true"/> <htk-column-image column="Foto" directory="catalog" subdir="50x50" show-full="true"/>
<htk-column-text title="_Item" column="Article"/> <htk-column-text title="_Item" column="Article"/>
<htk-column-text renderer="featuresRender"/> <htk-column-text renderer="featuresRender"/>
<htk-column-text title="_Amount" column="amount" renderer="stemsRender"/> <htk-column-text title="_Amount" column="amount" renderer="stemsRender"/>

View File

@ -31,7 +31,7 @@ Vn.Checkout = new Class
date.setTime (date.getTime () + 86400000); date.setTime (date.getTime () + 86400000);
} }
this.$('delivery').value = date; this.$('date').value = date;
this.$('method').value = i.get ('delivery_method'); this.$('method').value = i.get ('delivery_method');
this.$('agency').value = i.get ('agency_id'); this.$('agency').value = i.get ('agency_id');
this.$('address').value = i.get ('address_id'); this.$('address').value = i.get ('address_id');
@ -41,11 +41,11 @@ Vn.Checkout = new Class
,onConfirmClick: function () ,onConfirmClick: function ()
{ {
var query = 'CALL basket_configure (#delivery, #method, #agency, #address)'; var query = 'CALL basket_configure (#date, #method, #agency, #address)';
var batch = new Sql.Batch (); var batch = new Sql.Batch ();
batch.addParam ('method', this.$('method')); batch.addParam ('method', this.$('method'));
batch.addParam ('delivery', this.$('delivery')); batch.addParam ('date', this.$('date'));
batch.addParam ('agency', this.$('agency')); batch.addParam ('agency', this.$('agency'));
batch.addParam ('address', this.$('address')); batch.addParam ('address', this.$('address'));
@ -124,7 +124,7 @@ Vn.Checkout = new Class
this.$('agencies').refresh (); this.$('agencies').refresh ();
break; break;
case 'pickup': case 'pickup':
this.$('agencies').refresh (); this.$('warehouses').refresh ();
break; break;
} }
@ -159,7 +159,7 @@ Vn.Checkout = new Class
{ {
var now = new Date (); var now = new Date ();
now.setHours (0,0,0,0); now.setHours (0,0,0,0);
return date.getTime () >= now.getTime () return date.getTime () >= now.getTime ()
&& date.getDay () != 0; && date.getDay () != 0;
} }

View File

@ -3,7 +3,7 @@
<vn-param id="order"> <vn-param id="order">
<vn-hash-link key="order"/> <vn-hash-link key="order"/>
</vn-param> </vn-param>
<vn-param id="delivery"/> <vn-param id="date"/>
<vn-param id="method"/> <vn-param id="method"/>
<vn-param id="agency"/> <vn-param id="agency"/>
<vn-param id="address"/> <vn-param id="address"/>
@ -22,19 +22,32 @@
</db-model> </db-model>
</db-form> </db-form>
<db-model property="model" id="agencies" auto-load="false" result-index="1"> <db-model property="model" id="agencies" auto-load="false" result-index="1">
CALL agency_list_by_date (#delivery, #address); CALL agency_list_by_date (#date, #address);
SELECT a.Id_Agencia, a.description SELECT a.Id_Agencia, a.description
FROM t_agency t FROM t_agency t
JOIN vn2008.Agencias a ON a.Id_Agencia = t.agency_id JOIN vn2008.Agencias a ON a.Id_Agencia = t.agency_id
JOIN vn2008.Vistas v ON a.Vista = v.vista_id JOIN vn2008.Vistas v ON a.Vista = v.vista_id
WHERE a.web != FALSE WHERE a.web != FALSE
AND v.code = #method AND v.code = 'AGENCY'
ORDER BY a.description; ORDER BY a.description;
DROP TEMPORARY TABLE t_agency; DROP TEMPORARY TABLE t_agency;
<sql-batch property="batch"> <sql-batch property="batch">
<item name="address" param="address"/> <item name="address" param="address"/>
<item name="delivery" param="delivery"/> <item name="date" param="date"/>
<item name="method" param="method"/> </sql-batch>
</db-model>
<db-model property="model" id="warehouses" auto-load="false" result-index="1">
CALL agency_list_by_date (#date, NULL);
SELECT a.Id_Agencia, SUBSTR(a.description, 5) description
FROM t_agency t
JOIN vn2008.Agencias a ON a.Id_Agencia = t.agency_id
JOIN vn2008.Vistas v ON a.Vista = v.vista_id
WHERE a.web != FALSE
AND v.code = 'PICKUP'
ORDER BY a.description;
DROP TEMPORARY TABLE t_agency;
<sql-batch property="batch">
<item name="date" param="date"/>
</sql-batch> </sql-batch>
</db-model> </db-model>
</vn-group> </vn-group>
@ -84,7 +97,7 @@
<htk-calendar <htk-calendar
id="calendar" id="calendar"
class="thin-calendar" class="thin-calendar"
param="delivery" param="date"
restrict-func="calendarRestrict" restrict-func="calendarRestrict"
on-changed="onFieldChange"/> on-changed="onFieldChange"/>
</div> </div>
@ -128,7 +141,7 @@
id="warehouse-combo" id="warehouse-combo"
param="agency" param="agency"
on-changed="onFieldChange" on-changed="onFieldChange"
model="agencies"/> model="warehouses"/>
</div> </div>
</div> </div>
<div id="confirm-agency-step" class="confirm"> <div id="confirm-agency-step" class="confirm">
@ -136,7 +149,7 @@
<div class="answers target"> <div class="answers target">
<p> <p>
<t>Arrival</t> <t>Arrival</t>
<htk-text format="_%A, %e of %B" param="delivery"/> <htk-text format="_%A, %e of %B" param="date"/>
</p> </p>
<p> <p>
<htk-text form="address-form" column="name"/> <htk-text form="address-form" column="name"/>
@ -156,7 +169,7 @@
<div class="answers target"> <div class="answers target">
<p> <p>
<t>Arrival</t> <t>Arrival</t>
<htk-text format="_%A, %e of %B" param="delivery"/> <htk-text format="_%A, %e of %B" param="date"/>
</p> </p>
<p> <p>
<htk-text form="address-form" column="name"/> <htk-text form="address-form" column="name"/>
@ -175,7 +188,7 @@
<div class="answers target"> <div class="answers target">
<p> <p>
<t>Pickup</t> <t>Pickup</t>
<htk-text format="_%A, %e of %B" param="delivery"/> <htk-text format="_%A, %e of %B" param="date"/>
</p> </p>
<p> <p>
<t>Warehouse</t> <t>Warehouse</t>

View File

@ -8,7 +8,24 @@ Vn.Confirm = new Class
this.tpv = new Vn.Tpv (this.conn, this.hash); this.tpv = new Vn.Tpv (this.conn, this.hash);
} }
,onStatusChange: function (form) ,onOrderReady: function (form)
{
if (form.row < 0)
return;
if (form.get ('method') != 'PICKUP')
{
this.$('address').style.display = 'block';
Vn.Node.setText (this.$('method'), _('Agency'));
}
else
{
this.$('address').style.display = 'none';
Vn.Node.setText (this.$('method'), _('Warehouse'));
}
}
,onImportReady: function (form)
{ {
if (form.row != -1) if (form.row != -1)
this.$('total').value = form.get ('tax_base') + form.get ('vat'); this.$('total').value = form.get ('tax_base') + form.get ('vat');
@ -29,28 +46,25 @@ Vn.Confirm = new Class
,onConfirmClick: function () ,onConfirmClick: function ()
{ {
// var query = 'CALL order_confirm (#order)'; this.$('confirm-query').execute ();
var query = 'SELECT TRUE ok, customer_get_debt() debt';
var batch = new Sql.Batch ();
batch.addParam ('order', this.$('order-id'));
this.conn.execQuery (query, this.confirmDone.bind (this), batch);
} }
,confirmDone: function (resultSet) ,onConfirm: function (query, resultSet)
{ {
var res = resultSet.fetchResult (); var res = resultSet.fetchResult ();
var debt = resultSet.fetchValue ();
if (!(res && res.next())) if (res)
this.goBasket (); {
Vn.Cookie.unset ('order');
Vn.Cookie.unset ('order'); this.pay = debt > this.$('order-form').get ('credit');
this.pay = res.get ('debt') > this.$('order-form').get ('credit');
this.popup = new Htk.Popup (); this.popup = new Htk.Popup ();
this.popup.setChildNode (this.$('success-dialog')); this.popup.setChildNode (this.$('success-dialog'));
this.popup.showCenter (); this.popup.showCenter ();
}
else
this.hash.set ({'form': 'ecomerce/basket'});
} }
,onAcceptClick: function () ,onAcceptClick: function ()

View File

@ -3,14 +3,15 @@
<vn-param id="order-id"> <vn-param id="order-id">
<vn-hash-link key="order"/> <vn-hash-link key="order"/>
</vn-param> </vn-param>
<db-form id="order-form"> <db-form id="order-form" on-ready="onOrderReady">
<db-model updatable="true"> <db-model>
SELECT o.id, o.date_send, o.delivery_method_id, o.note, SELECT o.id, o.date_send, o.note, o.company_id,
ag.description agency, o.company_id, ad.consignee, ad.zip_code, ag.description agency, v.code method, c.credit,
ad.city, ad.name address, c.credit ad.consignee, ad.zip_code, ad.city, ad.name address
FROM order_view o FROM order_view o
JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id
LEFT JOIN address_view ad ON ad.id = o.address_id LEFT JOIN address_view ad ON ad.id = o.address_id
JOIN vn2008.Vistas v ON v.vista_id = o.delivery_method_id
JOIN customer_view c JOIN customer_view c
WHERE o.id = #order WHERE o.id = #order
<sql-batch property="batch"> <sql-batch property="batch">
@ -18,10 +19,12 @@
</sql-batch> </sql-batch>
</db-model> </db-model>
</db-form> </db-form>
<db-form id="total-form" on-iter-changed="onStatusChange"> <db-form id="total-form" on-ready="onImportReady">
<db-model result-index="1"> <db-model result-index="1">
CALL order_get_vat (#order); CALL order_get_vat (#order);
SELECT SUM(tax_base) tax_base, SUM(vat + surcharge) vat SELECT
IFNULL(SUM(tax_base), 0) tax_base,
IFNULL(SUM(vat + surcharge), 0) vat
FROM t_order_vat; FROM t_order_vat;
DROP TEMPORARY TABLE t_order_vat; DROP TEMPORARY TABLE t_order_vat;
<sql-batch property="batch"> <sql-batch property="batch">
@ -29,6 +32,13 @@
</sql-batch> </sql-batch>
</db-model> </db-model>
</db-form> </db-form>
<db-query id="confirm-query" on-ready="onConfirm">
CALL order_confirm_bionic (#order);
SELECT customer_get_debt() debt;
<sql-batch property="batch">
<item name="order" param="order-id"/>
</sql-batch>
</db-query>
</vn-group> </vn-group>
<div id="form" class="confirm"> <div id="form" class="confirm">
<div class="box"> <div class="box">
@ -42,11 +52,11 @@
<htk-text format="_%A, %e of %B" form="order-form" column="date_send"/> <htk-text format="_%A, %e of %B" form="order-form" column="date_send"/>
</p> </p>
<p class="small"> <p class="small">
<t>Agency</t> <span id="method"><t>Agency</t></span>
<htk-text form="order-form" column="agency"/> <htk-text form="order-form" column="agency"/>
</p> </p>
</div> </div>
<div class="section"> <div id="address" class="section">
<p> <p>
<htk-text form="order-form" column="consignee"/> <htk-text form="order-form" column="consignee"/>
</p> </p>

View File

@ -12,7 +12,7 @@
</div> </div>
<htk-grid> <htk-grid>
<db-model id="news-model" updatable="true"> <db-model id="news-model" updatable="true">
SELECT n.id, c.Cliente, priority, SELECT n.id, c.Cliente, priority, image,
CONCAT(LEFT(n.title, 25), '...') title CONCAT(LEFT(n.title, 25), '...') title
FROM news n FROM news n
JOIN vn2008.Clientes c ON n.user_id = c.Id_Cliente JOIN vn2008.Clientes c ON n.user_id = c.Id_Cliente
@ -24,9 +24,9 @@
image="image/edit.svg" image="image/edit.svg"
on-clicked="onEditClick"/> on-clicked="onEditClick"/>
<htk-column-image <htk-column-image
column="id" column="image"
directory="news" directory="news"
subdir="30x30" subdir="50x50"
show-full="true" show-full="true"
editable="true"/> editable="true"/>
<htk-column-text title="_Title" column="title"/> <htk-column-text title="_Title" column="title"/>

View File

@ -5,11 +5,11 @@
{ {
* { font-size: 8pt; } * { font-size: 8pt; }
} }
@media screen and (min-device-width: 1150px) @media screen and (min-width: 1150px)
{ {
* { font-size: 10pt; } * { font-size: 10pt; }
} }
@media screen and (min-device-width: 1850px) @media screen and (min-width: 1850px)
{ {
* { font-size: 12pt; } * { font-size: 12pt; }
} }
@ -440,7 +440,8 @@ img.icon
} }
.cell-image > img .cell-image > img
{ {
min-height: 1.5em; max-width: 2.5em;
max-height: 2.5em;
} }
/* Repater */ /* Repater */
@ -557,11 +558,6 @@ img.icon
box-shadow: 0 0.1em 0.1em #CCC; box-shadow: 0 0.1em 0.1em #CCC;
} }
.htk-date-chooser > button:hover
{
background-color: #EEE;
}
/* Full image */ /* Full image */
.htk-full-image .htk-full-image

View File

@ -11,6 +11,7 @@ Vn\Hedera\Js::includeLib ('db'
,'iterator' ,'iterator'
,'form' ,'form'
,'param' ,'param'
,'query'
,'calc' ,'calc'
,'calc-sum' ,'calc-sum'
); );

View File

@ -38,7 +38,6 @@ Db.Model.implement
({ ({
Extends: Vn.Object Extends: Vn.Object
,Tag: 'db-model' ,Tag: 'db-model'
,Child: 'query'
,Properties: ,Properties:
{ {
/** /**

View File

@ -0,0 +1,114 @@
Db.Query = new Class
({
Extends: Vn.Object
,Tag: 'db-query'
,Properties:
{
/**
* The connection used to execute the statement.
**/
conn:
{
type: Db.Conn
,set: function (x)
{
this._conn = x;
this.onChange ();
}
,get: function ()
{
return this._conn;
}
},
/**
* The model query.
**/
query:
{
type: String
,set: function (x)
{
this._stmt = new Sql.String ({query: x});
this.onChange ();
}
,get: function ()
{
return this._stmt.render (null);
}
},
/**
* The model select statement.
**/
stmt:
{
type: Sql.Stmt
,set: function (x)
{
this._stmt = x;
this.onChange ();
}
,get: function ()
{
return this._stmt;
}
},
/**
* The batch used to execute the statement.
**/
batch:
{
type: Sql.Batch
,set: function (x)
{
this.link ({_batch: x}, {'changed': this.onChange});
this.onChange ();
}
,get: function ()
{
return this._batch;
}
},
/**
* Wether to execute automatically de query que it's ready.
**/
autoLoad:
{
type: Boolean,
value: false
}
}
,initialize: function (props)
{
this.parent (props);
}
,loadXml: function (builder, node)
{
this.parent (builder, node);
var query = node.firstChild.nodeValue;
if (query)
this.query = query;
}
,execute: function ()
{
this._conn.execStmt (this._stmt,
this.onQueryDone.bind (this), this._batch);
}
,onQueryDone: function (resultSet)
{
this.signalEmit ('ready', resultSet);
}
,onChange: function ()
{
if (this.autoLoad && this._conn && this._stmt && this._batch)
this.execute ();
}
});

View File

@ -74,7 +74,7 @@ Htk.Calendar = new Class
var tr = document.createElement ('tr'); var tr = document.createElement ('tr');
thead.appendChild (tr); thead.appendChild (tr);
for (i = 1; i <= len; i++) for (var i = 1; i <= len; i++)
{ {
var th = document.createElement ('th'); var th = document.createElement ('th');
tr.appendChild (th); tr.appendChild (th);
@ -105,23 +105,21 @@ Htk.Calendar = new Class
th.addEventListener ('click', this.nextYearClicked.bind (this)); th.addEventListener ('click', this.nextYearClicked.bind (this));
tr.appendChild (th); tr.appendChild (th);
*/ */
var td, div;
var tbody = document.createElement ('tbody'); var tbody = document.createElement ('tbody');
table.appendChild (tbody); table.appendChild (tbody);
for (i = 0; i < 6; i++) for (var i = 0; i < 6; i++)
{ {
tr = document.createElement ('tr'); var tr = document.createElement ('tr');
tbody.appendChild (tr); tbody.appendChild (tr);
for (j = 0; j < len; j++) for (var j = 0; j < len; j++)
{ {
td = document.createElement ('td'); var td = document.createElement ('td');
td.addEventListener ('click', this.dayClicked.bind (this, td, i*len+j)); td.addEventListener ('click', this.dayClicked.bind (this, td, i*len+j));
tr.appendChild (td); tr.appendChild (td);
div = document.createElement ('div'); var div = document.createElement ('div');
td.appendChild (div); td.appendChild (div);
this.cells.push ({ this.cells.push ({
@ -185,7 +183,7 @@ Htk.Calendar = new Class
var firstWeekDay = (weekDay != 0) ? weekDay - 1 : 6; var firstWeekDay = (weekDay != 0) ? weekDay - 1 : 6;
var monthDays = this.getMonthDays (); var monthDays = this.getMonthDays ();
for (i = 0; i < this.cells.length; i++) for (var i = 0; i < this.cells.length; i++)
{ {
var cell = this.cells[i]; var cell = this.cells[i];

View File

@ -45,6 +45,7 @@ Htk.Image = new Class
,render: function (force) ,render: function (force)
{ {
console.log (this._value);
if (this._value) if (this._value)
{ {
var url = ''; var url = '';
@ -59,9 +60,13 @@ Htk.Image = new Class
this.empty = false; this.empty = false;
this.node.src = url; this.node.src = url;
this.node.style.display = '';
} }
else else
this.onImageError (); {
delete this.node.src;
this.node.style.display = 'none';
}
} }
,putValue: function (value) ,putValue: function (value)

View File

@ -112,6 +112,8 @@ Sql.Batch = new Class
,isReady: function () ,isReady: function ()
{ {
var id;
for (id in this.params) for (id in this.params)
if (!(this.params[id] && this.params[id].isReady ())) if (!(this.params[id] && this.params[id].isReady ()))
return false; return false;

View File

@ -73,10 +73,7 @@ Sql.Value = new Class
,isReady: function () ,isReady: function ()
{ {
if (this._value !== undefined && this._value !== null) return this._value !== undefined;
return true;
return false;
} }
,replaceFunc: function (token) ,replaceFunc: function (token)

View File

@ -28,7 +28,13 @@ Vn.Object = new Class
* @param {Object} instance The instance * @param {Object} instance The instance
**/ **/
,on: function (id, callback, instance) ,on: function (id, callback, instance)
{ {
if (!(callback instanceof Function))
{
console.warn ('Vn.Object: Invalid callback for signal \'%s\'', id);
return;
}
if (!this.signals[id]) if (!this.signals[id])
this.signals[id] = []; this.signals[id] = [];

View File

@ -18,6 +18,11 @@ Vn.Module = new Class
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 = this.builder.getObjects ('db-query');
for (var i = 0; i < queries.length; i++)
queries[i].conn = this.conn;
var hashLinks = this.builder.getObjects ('vn-hash-link'); var hashLinks = this.builder.getObjects ('vn-hash-link');
for (var i = 0; i < hashLinks.length; i++) for (var i = 0; i < hashLinks.length; i++)