diff --git a/forms/ecomerce/orders/ui.xml b/forms/ecomerce/orders/ui.xml
index d3fb343a..b8f53fa1 100755
--- a/forms/ecomerce/orders/ui.xml
+++ b/forms/ecomerce/orders/ui.xml
@@ -15,11 +15,13 @@
@@ -37,7 +39,7 @@
diff --git a/forms/news/news/ui.xml b/forms/news/news/ui.xml
index 8724e636..cf11a2c7 100755
--- a/forms/news/news/ui.xml
+++ b/forms/news/news/ui.xml
@@ -40,7 +40,8 @@
directory="news"
subdir="200x200"
full-dir="full"
- editable="true"/>
+ editable="true"
+ conn="conn"/>
diff --git a/image/icon/dark/logo.png b/image/icon/dark/logo.png
deleted file mode 100644
index 6c485352..00000000
Binary files a/image/icon/dark/logo.png and /dev/null differ
diff --git a/image/icon/dark/logo.svg b/image/logo-dark.svg
similarity index 100%
rename from image/icon/dark/logo.svg
rename to image/logo-dark.svg
diff --git a/index.php b/index.php
index 8461c7d7..a8619318 100755
--- a/index.php
+++ b/index.php
@@ -1,6 +1,6 @@
run ();
diff --git a/js/db/conn.js b/js/db/connection.js
similarity index 81%
rename from js/db/conn.js
rename to js/db/connection.js
index 3cb637af..b18e99be 100644
--- a/js/db/conn.js
+++ b/js/db/connection.js
@@ -1,10 +1,14 @@
/**
- * Simulates a connection to a database by making asynchronous http requests to
- * a remote PHP script that returns the results in JSON format.
+ * Simulates a connection to a database by making asynchronous requests to a
+ * remote REST service that returns the results in JSON format.
* Using this class can perform any operation that can be done with a database,
* like open/close a connection or selecion/updating queries.
+ *
+ * Warning! You should set a well defined dababase level privileges to use this
+ * class or you could have a serious security hole in you application becasuse
+ * the user can send any statement to the server. For example: DROP DATABASE
**/
-Db.Conn = new Class ().extend
+Db.Connection = new Class ().extend
({
Flag:
{
@@ -24,7 +28,7 @@ Db.Conn = new Class ().extend
}
});
-Db.Conn.implement
+Db.Connection.implement
({
Extends: Vn.JsonConnection
@@ -92,9 +96,9 @@ Db.Conn.implement
switch (columns[j].type)
{
- case Db.Conn.Type.DATE:
- case Db.Conn.Type.DATE_TIME:
- case Db.Conn.Type.TIMESTAMP:
+ case Db.Connection.Type.DATE:
+ case Db.Connection.Type.DATE_TIME:
+ case Db.Connection.Type.TIMESTAMP:
castFunc = this.valueToDate;
break;
}
diff --git a/js/db/main.js b/js/db/main.js
index 16692b54..2897d938 100644
--- a/js/db/main.js
+++ b/js/db/main.js
@@ -3,7 +3,7 @@ Vn.include ('js/sql/main');
Vn.includeLib ('db',
[
'db'
- ,'conn'
+ ,'connection'
,'result'
,'result-set'
,'model'
diff --git a/js/db/model.js b/js/db/model.js
index 3afde179..f610a297 100644
--- a/js/db/model.js
+++ b/js/db/model.js
@@ -45,7 +45,7 @@ Db.Model.implement
**/
conn:
{
- type: Db.Conn
+ type: Db.Connection
,set: function (x)
{
this._conn = x;
diff --git a/js/hedera/app.js b/js/hedera/app.js
index 61a3adda..ecbeb266 100644
--- a/js/hedera/app.js
+++ b/js/hedera/app.js
@@ -1,7 +1,18 @@
Vn.App = new Class
({
- Extends: Vn.Object
+ Extends: Vn.Object,
+ Properties:
+ {
+ conn:
+ {
+ type: Db.Connection
+ ,get: function ()
+ {
+ return this._conn;
+ }
+ }
+ }
,initialize: function ()
{
@@ -16,18 +27,18 @@ Vn.App = new Class
});
this._isGuest.on ('changed', this._onGuestChange, this);
- var conn = new Db.Conn ();
+ var conn = new Db.Connection ();
this.link ({_conn: conn}, {'error': this._onConnError});
}
,run: function ()
{
- var guest = Vn.Cookie.check ('hedera_guest');
+ var guest = localStorage.getItem ('hederaGuest');
if (guest)
- Vn.Cookie.unset ('hedera_guest');
+ localStorage.removeItem ('hederaGuest');
- if (Vn.Cookie.check ('vn_pass'))
+ if (localStorage.getItem ('vnToken'))
{
this._conn.open (null, null, null,
this._onAutoLogin.bind (this));
@@ -67,7 +78,7 @@ Vn.App = new Class
if (success)
{
- Vn.Cookie.set ('hedera_guest', true);
+ localStorage.setItem ('hederaGuest', true);
this._onLogin ();
}
else
@@ -77,10 +88,7 @@ Vn.App = new Class
,_onAutoLogin: function (success)
{
if (!success)
- {
- Vn.Cookie.unset ('vn_pass');
this.run ();
- }
else
this._onLogin ();
}
@@ -97,8 +105,7 @@ Vn.App = new Class
,_onLogout: function (gui)
{
this._freeGui ();
- Vn.Cookie.unset ('hedera_guest');
- Vn.Cookie.unset ('vn_pass');
+ localStorage.removeItem ('hederaGuest');
this.run ();
}
@@ -119,10 +126,13 @@ Vn.App = new Class
{
if (error instanceof Vn.JsonException)
{
- var exception = error.exception
- .replace (/\\/g, '.')
- .replace (/Exception$/, '')
- .replace (/^Vn\.Web\./, '');
+ if (error.exception)
+ var exception = error.exception
+ .replace (/\\/g, '.')
+ .replace (/Exception$/, '')
+ .replace (/^Vn\.Web\./, '');
+ else
+ var exception = null;
switch (exception)
{
diff --git a/js/hedera/gui.js b/js/hedera/gui.js
index b28a5fda..75f1903e 100644
--- a/js/hedera/gui.js
+++ b/js/hedera/gui.js
@@ -9,7 +9,7 @@ Vn.Gui = new Class
{
conn:
{
- type: Db.Conn
+ type: Db.Connection
,set: function (x)
{
this.link ({_conn: x},
diff --git a/js/hedera/gui.xml b/js/hedera/gui.xml
index 2576bf32..0a825ded 100755
--- a/js/hedera/gui.xml
+++ b/js/hedera/gui.xml
@@ -11,10 +11,10 @@
diff --git a/js/hedera/login.js b/js/hedera/login.js
index 2e640484..149e19fa 100644
--- a/js/hedera/login.js
+++ b/js/hedera/login.js
@@ -10,12 +10,13 @@ Vn.Login = new Class
{
conn:
{
- type: Db.Conn
+ type: Db.Connection
,set: function (x)
{
this.link ({_conn: x}, {'loading-changed': this._onConnLoadChange});
x.execQuery (
- 'SELECT title, link, icon FROM social ORDER BY priority',
+ 'SELECT title, link, icon FROM social '
+ +'WHERE priority ORDER BY priority',
this._onSocialQueryDone.bind (this));
}
,get: function ()
@@ -60,8 +61,10 @@ Vn.Login = new Class
{
document.body.appendChild (this.node);
- if (Vn.Cookie.check ('vn_user'))
- this.$('user').value = Vn.Cookie.get ('vn_user');
+ var lastUser = localStorage.getItem ('hederaLastUser');
+
+ if (lastUser)
+ this.$('user').value = lastUser;
this._focusUserInput ();
}
@@ -93,7 +96,10 @@ Vn.Login = new Class
this.$('pass').value = '';
if (success)
+ {
+ localStorage.setItem ('hederaLastUser', this.$('user').value);
this.signalEmit ('login');
+ }
else
this._focusUserInput ();
}
@@ -130,7 +136,7 @@ Vn.Login = new Class
social.appendChild (a);
var img = document.createElement ('img');
- imt.src = 'image/social/'+ res.get ('icon');
+ img.src = 'image/social/'+ res.get ('icon');
img.alt = res.get ('title');
img.title = res.get ('title');
a.appendChild (img);
diff --git a/js/hedera/login.xml b/js/hedera/login.xml
index 2f2d2014..ed3f51c8 100755
--- a/js/hedera/login.xml
+++ b/js/hedera/login.xml
@@ -50,32 +50,7 @@