diff --git a/lib/vn/hedera/js.php b/lib/vn/hedera/js.php index adcd2fc3..df3d5963 100755 --- a/lib/vn/hedera/js.php +++ b/lib/vn/hedera/js.php @@ -10,7 +10,7 @@ class Js static function includeFile ($fileName) { - echo ''."\n\t"; + echo ''."\n\t\t"; } static function includeLib ($libName) @@ -28,7 +28,7 @@ class Js static function includeCss ($fileName) { - echo ''."\n\t"; + echo ''."\n\t\t"; } static function isMobile () diff --git a/lib/vn/tpv/tpv.php b/lib/vn/tpv/tpv.php index 7f29a495..f1a5f0d9 100755 --- a/lib/vn/tpv/tpv.php +++ b/lib/vn/tpv/tpv.php @@ -102,14 +102,14 @@ class Tpv $folder = sprintf ('INBOX.%s', $folder); if (!imap_mail_move ($imap, $msg, $folder)) - error_log ('TPV: IMAP: Can\'t move message to %s: %s' + trigger_error (sprintf ('TPV: IMAP: Can\'t move message to %s: %s' ,$folder ,imap_last_error () - ); + ), E_USER_WARNING); } if ($inbox && ($count = count ($inbox)) > 0) - error_log ('TPV: %d mails processed.', $count); + trigger_error (sprintf ('TPV: %d mails processed.', $count)); imap_expunge ($imap); @@ -138,13 +138,13 @@ class Tpv $deleted += count ($messages); } - error_log ('TPV: Cleaner: %d mails deleted.', $deleted); + trigger_error (sprintf ('TPV: Cleaner: %d mails deleted.', $deleted)); } imap_close ($imap); } else - error_log ('TPV: IMAP: %s', imap_last_error ()); + trigger_error (sprintf ('TPV: IMAP: %s', imap_last_error ()), E_USER_ERROR); self::deinit (); } @@ -207,7 +207,7 @@ class Tpv } catch (\Exception $e) { - error_log ("TPV: DB: %s", $e->getMessage ()); + trigger_error (sprintf ("TPV: DB: %s", $e->getMessage ()), E_USER_WARNING); } } diff --git a/web/forms/account/address-list/ui.xml b/web/forms/account/address-list/ui.xml index 033c2c0a..41858817 100755 --- a/web/forms/account/address-list/ui.xml +++ b/web/forms/account/address-list/ui.xml @@ -14,22 +14,17 @@ WHERE active != FALSE +
+

Addresses

+
+
+ +
-
-

Addresses

-
- - -
-
-
+
+

AddEditAddress

+
+
+ + +
-
-

AddEditAddress

-
- - -
-
diff --git a/web/forms/account/conf/ui.xml b/web/forms/account/conf/ui.xml index 7fd48b11..a1468a72 100755 --- a/web/forms/account/conf/ui.xml +++ b/web/forms/account/conf/ui.xml @@ -16,18 +16,17 @@ WHERE active != FALSE +
+

Configuration

+
+
+ +
-
-

Configuration

-
- -
-
-
diff --git a/web/forms/admin/access-log/ui.xml b/web/forms/admin/access-log/ui.xml index 1dff1256..8742652a 100755 --- a/web/forms/admin/access-log/ui.xml +++ b/web/forms/admin/access-log/ui.xml @@ -13,11 +13,11 @@ +
+

AccessLog

+
-
-

AccessLog

-
diff --git a/web/forms/admin/links/ui.xml b/web/forms/admin/links/ui.xml index 41c8adaf..eb0cb4de 100755 --- a/web/forms/admin/links/ui.xml +++ b/web/forms/admin/links/ui.xml @@ -1,9 +1,9 @@ +
+

ControlPanel

+
-
-

ControlPanel

-
SELECT image, name, description, link FROM link diff --git a/web/forms/admin/photos/ui.xml b/web/forms/admin/photos/ui.xml index c0b67e9f..b19d92d8 100755 --- a/web/forms/admin/photos/ui.xml +++ b/web/forms/admin/photos/ui.xml @@ -1,9 +1,9 @@ +
+

Photos

+
-
-

Photos

-
+
+

UserManagement

+
-
-

UserManagement

-
diff --git a/web/forms/admin/visits/ui.xml b/web/forms/admin/visits/ui.xml index 9683a5a2..c9d502a2 100755 --- a/web/forms/admin/visits/ui.xml +++ b/web/forms/admin/visits/ui.xml @@ -1,23 +1,23 @@ +
+

VisitsManagement

+
+
+ + + +
-
-

VisitsManagement

-
- - - -
-
diff --git a/web/forms/agencies/packages/ui.xml b/web/forms/agencies/packages/ui.xml index 3853b34e..dde003b9 100755 --- a/web/forms/agencies/packages/ui.xml +++ b/web/forms/agencies/packages/ui.xml @@ -1,9 +1,9 @@ +
+

ListByAgency

+
-
-

ListByAgency

-
CALL vn2008.agencia_volume () diff --git a/web/forms/agencies/provinces/provinces.js b/web/forms/agencies/provinces/provinces.js index b160d5e0..8e799ba2 100755 --- a/web/forms/agencies/provinces/provinces.js +++ b/web/forms/agencies/provinces/provinces.js @@ -2,10 +2,5 @@ Vn.Provinces = new Class ({ Extends: Vn.Module - - ,onReturnClick: function () - { - window.history.back(); - } }); diff --git a/web/forms/agencies/provinces/ui.xml b/web/forms/agencies/provinces/ui.xml index 85fc9fab..ac37cc8d 100755 --- a/web/forms/agencies/provinces/ui.xml +++ b/web/forms/agencies/provinces/ui.xml @@ -4,18 +4,11 @@ +
+

ByProvince

+
-
-

ByProvince

-
- -
-
-
CALL vn2008.desglose_volume (#agency) diff --git a/web/forms/cms/about/ui.xml b/web/forms/cms/about/ui.xml index 0a1589a2..f88ce594 100755 --- a/web/forms/cms/about/ui.xml +++ b/web/forms/cms/about/ui.xml @@ -1,4 +1,7 @@ +
+

About

+
diff --git a/web/forms/cms/contact/ui.xml b/web/forms/cms/contact/ui.xml index 9c347d71..b12a942a 100755 --- a/web/forms/cms/contact/ui.xml +++ b/web/forms/cms/contact/ui.xml @@ -1,9 +1,9 @@ +
+

IWantCustomer

+
-
-

IWantCustomer

-

FillFormData diff --git a/web/forms/cms/home/ui.xml b/web/forms/cms/home/ui.xml index b722ede4..8f75c612 100755 --- a/web/forms/cms/home/ui.xml +++ b/web/forms/cms/home/ui.xml @@ -1,4 +1,7 @@ +

+

Home

+
diff --git a/web/forms/cms/location/ui.xml b/web/forms/cms/location/ui.xml index 91571408..58388869 100755 --- a/web/forms/cms/location/ui.xml +++ b/web/forms/cms/location/ui.xml @@ -1,3 +1,6 @@ +
+

Location

+
diff --git a/web/forms/cms/training/ui.xml b/web/forms/cms/training/ui.xml index 314a3c96..8880d57f 100755 --- a/web/forms/cms/training/ui.xml +++ b/web/forms/cms/training/ui.xml @@ -1,4 +1,7 @@ +
+

Training

+
diff --git a/web/forms/cms/why/ui.xml b/web/forms/cms/why/ui.xml index 8ad3f086..dfc6db71 100755 --- a/web/forms/cms/why/ui.xml +++ b/web/forms/cms/why/ui.xml @@ -1,9 +1,9 @@ +
+

AboutCompany

+
-
-

AboutCompany

-
  • BecauseOurBigCatalog
  • diff --git a/web/forms/ecomerce/basket/ui.xml b/web/forms/ecomerce/basket/ui.xml index 089e28b5..df7a9b9e 100755 --- a/web/forms/ecomerce/basket/ui.xml +++ b/web/forms/ecomerce/basket/ui.xml @@ -1,23 +1,22 @@ +
    +

    ShoppingBasket

    +
    +
    + + + +
    -
    -

    ShoppingBasket

    -
    - - - -
    -
    -
    diff --git a/web/forms/ecomerce/catalog/catalog.js b/web/forms/ecomerce/catalog/catalog.js index 2f0b1791..95fddb94 100755 --- a/web/forms/ecomerce/catalog/catalog.js +++ b/web/forms/ecomerce/catalog/catalog.js @@ -23,6 +23,11 @@ Vn.Catalog = new Class } } + ,deactivate: function () + { + this.gui.$('top-bar').style.backgroundColor = ''; + } + ,onBasketForGuest: function () { this.onBasketCheck (true); @@ -82,14 +87,14 @@ Vn.Catalog = new Class color = '#'+ realms.get (row, 'color'); } - this.$('header').style.backgroundColor = color; - + this.gui.$('top-bar').style.backgroundColor = color; +/* var tr = this.$('items-grid').getNode () .getElementsByTagName ('thead')[0] .getElementsByTagName ('tr')[0]; //.querySelector ('thead tr'); tr.style.backgroundColor = color; - } +*/ } ,refreshTitle: function (title) { @@ -110,7 +115,7 @@ Vn.Catalog = new Class else if (this.$('search-entry').value) title = _('SearchResults'); - Vn.Node.setText (this.$('title'), title); + Vn.Node.setText (this.$('title-text'), title); } ,onSearch: function (event) @@ -163,6 +168,11 @@ Vn.Catalog = new Class Htk.Toast.showError (_('YouMustBeLoggedIn')); } + ,nameRenderer: function (renderer, form) + { + renderer.subtitle = form.get ('producer'); + } + ,featuresRender: function (renderer, form) { renderer.value = form.get ('Medida') +' '+ form.get ('Categoria') +' '+ form.get ('Color'); @@ -199,8 +209,18 @@ Vn.Catalog = new Class column.td.className = ''; } } + + ,onGridAddItemClick: function (button, form) + { + this.showAmountPopup (button, form.row); + } ,onAddItemClick: function (column, value, row, button) + { + this.showAmountPopup (button, row); + } + + ,showAmountPopup: function (button, row) { if (Vn.Url.getQuery ('guest')) { @@ -213,7 +233,7 @@ Vn.Catalog = new Class this.itemRow = row; this.onEraseClick (); - this.popup.show (button); + this.popup.show (button); } ,onAddLotClick: function (column, value, row, button) @@ -283,3 +303,30 @@ Vn.Catalog = new Class } }); +Htk.ColumnCheck = new Class +({ + Extends: Htk.Column + ,Tag: 'vn-column-item' + + ,render: function (tr) + { + var td = this.parent (tr); + td.style.textAlign = 'left'; + + if (this.value) + { + var node = document.createTextNode ( + Vn.Value.format (this.value, this._format)); + td.appendChild (node); + } + + if (this.subtitle) + { + td.appendChild (document.createElement ('br')); + td.appendChild (document.createTextNode (this.subtitle)); + } + + return td; + } +}); + diff --git a/web/forms/ecomerce/catalog/mobile.css b/web/forms/ecomerce/catalog/mobile.css deleted file mode 100755 index 804c7e9e..00000000 --- a/web/forms/ecomerce/catalog/mobile.css +++ /dev/null @@ -1,13 +0,0 @@ - -.catalog button.menu -{ - display: block; -} -.catalog div.menu -{ - display: none; -} -.catalog div.center -{ - right: 0; -} diff --git a/web/forms/ecomerce/catalog/style.css b/web/forms/ecomerce/catalog/style.css index 0a459105..623fe3e5 100755 --- a/web/forms/ecomerce/catalog/style.css +++ b/web/forms/ecomerce/catalog/style.css @@ -24,9 +24,9 @@ left: 0; right: 0; overflow: auto; - padding: 1em; + padding: .4em; } -.catalog div.main .box +.catalog div.main .list-view { margin: 0 auto; max-width: 50em; @@ -45,7 +45,7 @@ { max-width: 15em; } -.catalog .search +.search { float: left; display: block; @@ -53,38 +53,23 @@ height: 2.2em; padding: 0; } -.catalog .search > input +.search > input { margin: 0; border: none; width: 10em; box-shadow: none; } -.catalog .search > input:focus +.search > input:focus { background-color: initial; } -.catalog .search > img +.search > img { margin: 0.4em; margin-top: 0; vertical-align: middle; } -.catalog button.menu -{ - float: left; - display: none; - border: none; - background-color: transparent; - box-shadow: none; - padding: 0.3em; - padding-left: 0; - margin-left: 0; -} -.catalog button.menu > img -{ - height: 1.8em; -} /* Menu */ @@ -160,46 +145,6 @@ button.basket:hover background-color: rgba(1, 1, 1, .1); } -/* Grid view */ - -.item-box -{ - padding: 1em; - border-bottom: 1px solid #DDD; - min-height: 14em; -} -.item-box > .image -{ - width: 8em; - height: 14em; - float: left; - margin-right: 1em; -} -.item-box img -{ - max-width: 8em; - max-height: 8em; - display: block; - margin: 0 auto; -} -.item-box p -{ - margin: 0; - padding: 0.6em; -} -.item-box h2 -{ - font-weight: normal; -} -.item-box .amount -{ - width: 3em; -} -.amount-p -{ - text-align: right; -} - /* Lots popup*/ div.amount @@ -240,18 +185,17 @@ button.confirm > img { height: 6em; } -.items > tbody img -{ - max-height: 6em; - max-width: 6em; - border-radius: 50%; -} .items .icon { width: 6em; padding: .2em; padding-right: .5em; } +.items .icon > img +{ + max-height: 6em; + max-width: 6em; +} td.second-category { font-weight: bold; @@ -262,8 +206,99 @@ td.third-category font-weight: bold; color: red; } -td.price +.catalog .price { color: green; + font-size: 1.1em; +} + +/* Grid view */ + +.catalog .grid-view +{ + text-align: center; +} +.item-box +{ + text-align: left; + position: relative; + width: 22em; + display: inline-block; + padding: .8em; + margin: .4em; + margin-bottom: .1em; + height: 9em; + overflow: hidden; +} +.item-box > .image +{ + width: 9em; + height: 100%; + float: left; + margin-right: 1em; +} +.item-box img +{ + max-width: 9em; + max-height: 9em; + display: block; + margin: 0 auto; +} +.item-box > p +{ + margin: 0; + padding: 0; + font-size: .9em; +} +.item-box > h2 +{ + font-size: 1.1em; + font-weight: normal; +} +.item-box > .aval-price +{ + position: absolute; + bottom: 1em; + right: 4em; +} +.item-box > .add-button +{ + position: absolute; + bottom: .5em; + right: .5em; +} + +/* Mobile */ + +.catalog-actions button.menu +{ + float: left; + display: none; + border: none; + background-color: transparent; + box-shadow: none; + padding: 0.3em; + padding-left: 0; + margin-left: 0; +} +.catalog-actions button.menu > img +{ + height: 1.8em; +} + +@media (max-width: 950px) +{ + .catalog-actions button.menu + { + display: block; + } + .catalog div.menu + { + display: none; + } + .catalog div.center + { + right: 0; + } } diff --git a/web/forms/ecomerce/catalog/ui.xml b/web/forms/ecomerce/catalog/ui.xml index 6fce9b7c..aff6192a 100755 --- a/web/forms/ecomerce/catalog/ui.xml +++ b/web/forms/ecomerce/catalog/ui.xml @@ -29,7 +29,7 @@ SELECT Id_Article item_id FROM vn2008.Articles WHERE #filter; CALL bionic_calc (); - SELECT t.item_id, t.available, t.price, + SELECT t.item_id, t.available, t.price, t.producer, a.Foto, a.Article, a.Categoria, a.Medida, a.Tallos, a.Color, o.Abreviatura FROM tmp.bionic_item t JOIN vn2008.Articles a ON a.Id_Article = t.item_id @@ -59,51 +59,87 @@ +
    +

    Catalog

    +
    +
    + + +
    -
    - - diff --git a/web/forms/ecomerce/checkout/ui.xml b/web/forms/ecomerce/checkout/ui.xml index e89eaf47..3975ecee 100755 --- a/web/forms/ecomerce/checkout/ui.xml +++ b/web/forms/ecomerce/checkout/ui.xml @@ -47,18 +47,17 @@ +
    +

    ConfigureOrder

    +
    +
    + +
    -
    -

    ConfigureOrder

    -
    - -
    -
    -
    +
    +

    OrderSummary

    +
    -
    -

    OrderSummary

    -

    diff --git a/web/forms/ecomerce/invoices/ui.xml b/web/forms/ecomerce/invoices/ui.xml index 74c0c392..7a257509 100755 --- a/web/forms/ecomerce/invoices/ui.xml +++ b/web/forms/ecomerce/invoices/ui.xml @@ -1,27 +1,27 @@ +

    +

    Invoices

    +
    -
    -

    Invoices

    -
    -
    - - - SELECT invoice_id, serial_num, issued, amount - FROM invoice_view - ORDER BY issued DESC - LIMIT 100 - - - - - - -
    +
    + + + SELECT invoice_id, serial_num, issued, amount + FROM invoice_view + ORDER BY issued DESC + LIMIT 100 + + + + + + +
    diff --git a/web/forms/ecomerce/orders/ui.xml b/web/forms/ecomerce/orders/ui.xml index 97a2228a..8fd34645 100755 --- a/web/forms/ecomerce/orders/ui.xml +++ b/web/forms/ecomerce/orders/ui.xml @@ -1,26 +1,25 @@ +
    +

    LastOrders

    +
    +
    +
    + PendingBalance: + + + + Info +
    + + +
    -
    -

    LastOrders

    -
    -
    - PendingBalance: - - - - Info -
    - - -
    -
    -
    diff --git a/web/forms/ecomerce/ticket/ui.xml b/web/forms/ecomerce/ticket/ui.xml index 5f6bc1b8..f4fab0d2 100755 --- a/web/forms/ecomerce/ticket/ui.xml +++ b/web/forms/ecomerce/ticket/ui.xml @@ -18,17 +18,17 @@ +
    +

    OrderDetail

    +
    +
    + +
    -
    -

    OrderDetail

    -
    - -
    -
diff --git a/web/forms/news/new/style.css b/web/forms/news/new/style.css index 7f0704d8..1ff4072b 100755 --- a/web/forms/news/new/style.css +++ b/web/forms/news/new/style.css @@ -33,7 +33,7 @@ } .new textarea { - min-height: 26em; + min-height: 20em; } .new .foot diff --git a/web/forms/news/new/ui.xml b/web/forms/news/new/ui.xml index 26e749a6..f61c460f 100755 --- a/web/forms/news/new/ui.xml +++ b/web/forms/news/new/ui.xml @@ -14,22 +14,17 @@ +
+

AddEditNew

+
+
+ +
-
-

AddEditNew

-
- - -
-
-
diff --git a/web/forms/news/news/ui.xml b/web/forms/news/news/ui.xml index bef968bd..cb50f057 100755 --- a/web/forms/news/news/ui.xml +++ b/web/forms/news/news/ui.xml @@ -1,16 +1,16 @@ +
+

NewsManagement

+
+
+ +
-
-

NewsManagement

-
- -
-
- + SELECT n.id, c.Cliente, priority, image, CONCAT(LEFT(n.title, 25), '...') title diff --git a/web/global/metatags.php b/web/global/metatags.php index 2eab5d07..c32aa588 100755 --- a/web/global/metatags.php +++ b/web/global/metatags.php @@ -4,10 +4,10 @@ use Vn\Hedera\Web; if ($result = Web::$sysConn->query ('SELECT name, content FROM metatag')) { - echo ''."\n\t"; + echo ''."\n\t\t"; while ($row = $result->fetch_assoc ()) - echo ''."\n\t"; + echo ''."\n\t\t"; $result->free (); } diff --git a/web/image/dark/exit.svg b/web/image/dark/exit.svg new file mode 100644 index 00000000..3a23504b --- /dev/null +++ b/web/image/dark/exit.svg @@ -0,0 +1,61 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/web/image/exit.svg b/web/image/exit.svg new file mode 100644 index 00000000..a071c071 --- /dev/null +++ b/web/image/exit.svg @@ -0,0 +1,61 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/web/js/db/conn.js b/web/js/db/conn.js index ca73d908..a469457a 100755 --- a/web/js/db/conn.js +++ b/web/js/db/conn.js @@ -78,13 +78,16 @@ Db.Conn.implement if (success) try { var json = request.getJson (); - openSuccess = true /* json.data */; + openSuccess = json.data == true; } catch (e) {} if (openSuccess) + { this.connected = true; - + this.signalEmit ('openned'); + } + this.signalEmit ('loading-changed', false); if (openCallback) @@ -101,7 +104,7 @@ Db.Conn.implement this.signalEmit ('loading-changed', true); var request = new Vn.HttpRequest (); - request.addValue ({'action': 'close'}); + request.add ({'action': 'close'}); request.send ('rest.php', this.closed.bind (this, closeCallback)); } diff --git a/web/js/db/db.js b/web/js/db/db.js new file mode 100755 index 00000000..d1c3899a --- /dev/null +++ b/web/js/db/db.js @@ -0,0 +1,5 @@ +/** + * The namespace. + **/ +var Db = {}; + diff --git a/web/js/db/main.js b/web/js/db/main.js index d1c3899a..530f57a5 100755 --- a/web/js/db/main.js +++ b/web/js/db/main.js @@ -1,5 +1,17 @@ -/** - * The namespace. - **/ -var Db = {}; + +Vn.includeJs ('js/sql/main.js'); +Vn.includeLib ('db', +[ + 'db' + ,'conn' + ,'result' + ,'result-set' + ,'model' + ,'iterator' + ,'form' + ,'param' + ,'query' + ,'calc' + ,'calc-sum' +]); diff --git a/web/js/db/main.php b/web/js/db/main.php index 0a284f2c..b86348df 100755 --- a/web/js/db/main.php +++ b/web/js/db/main.php @@ -3,7 +3,7 @@ require_once ('js/sql/main.php'); Vn\Hedera\Js::includeLib ('db' - ,'main' + ,'db' ,'conn' ,'result' ,'result-set' diff --git a/web/js/hedera/app.js b/web/js/hedera/app.js new file mode 100644 index 00000000..2048ad4a --- /dev/null +++ b/web/js/hedera/app.js @@ -0,0 +1,87 @@ + +Vn.App = new Class +({ + initialize: function () + { + window.onerror = this.onWindowError.bind (this); + Vn.Hash.initialize (); + + this.conn = new Db.Conn (); + this.login = new Vn.Login ({conn: this.conn}); + } + + ,run: function () + { + if (Vn.Cookie.check ('vn_pass')) + { + this.conn.open (null, null, null, + this.onAutoLogin.bind (this)); + } + else + { + this.login.on ('login', this.onLogin, this); + this.login.show (); + } + } + + ,onAutoLogin: function (success) + { + if (!success) + { + Vn.Cookie.unset ('vn_pass'); + this.run (); + } + else + this.onLogin (); + } + + ,onLogin: function () + { + this.login.disconnectByInstance (this); + this.login.hide (); + + var gui = new Vn.Gui ({conn: this.conn}); + gui.on ('logout', this.onLogout, this); + gui.show (); + } + + ,onLogout: function (gui) + { + gui.hide (); + gui.unref (); + Vn.Cookie.unset ('vn_pass'); + this.run (); + } + + ,onWindowError: function (message, file, line) + { + var error = new Error (message); + error.fileName = file; + error.lineNumber = line; + + Htk.Toast.showError (_('InternalError')); + this.notifyError (error); + } + + ,notifyError: function (error) + { + if (error instanceof Error) + { + var httpRequest = new Vn.HttpRequest () + httpRequest.add + ({ + 'file': error.fileName + ,'line': error.lineNumber + ,'message': error.message + ,'stack': error.stack + }); + httpRequest.send ('log.php'); + } + } + + ,_destroy: function () + { + this.login.unref (); + this.conn.unref (); + } +}); diff --git a/web/js/hedera/gui.css b/web/js/hedera/gui.css new file mode 100755 index 00000000..96624ad4 --- /dev/null +++ b/web/js/hedera/gui.css @@ -0,0 +1,332 @@ + +.vn-gui +{ + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +/* Font */ + +.vn-gui .welcome, +.vn-gui .menu-title, +.vn-gui .main-menu a +{ + font-size: 1.1em; +} + +/* Header */ + +.vn-gui .top-bar, +.vn-gui .exit +{ + height: 3.9em; +} +.vn-gui .top-bar +{ + position: relative; + background-color: #009688; + width: 100%; + z-index: 1; + overflow: hidden; + box-shadow: 0 0.1em 0.1em #AAA; +} +.vn-gui .top-bar +{ + color: white; +} +.vn-gui .menu-button +{ + display: none; + float: left; + border: none; + background-color: transparent; + padding: 0 .4em; + margin: 0; + height: 100%; +} +.vn-gui .menu-button:hover +{ + background-color: rgba(0, 0, 0, .2); +} +.vn-gui .menu-button img +{ + margin-top: .2em; + height: 1.8em; +} +.vn-gui .title +{ + float: left; +} +.vn-gui .title h1 +{ + font-weight: normal; + font-size: 1.4em; + padding: .7em .6em; + margin: 0; +} +.vn-gui .actions-holder +{ + float: right; + padding: .5em 1em; + padding-left: 0; +} +.vn-gui .top-bar > .loader +{ + float: right; + margin: 1.1em; + visibility: hidden; +} +.vn-gui .exit +{ + float: right; + padding: 0 .4em; +} +.vn-gui .exit img +{ + height: 2.2em; + display: block; + margin: .8em auto; +} +.vn-gui .exit:hover +{ + background-color: rgba(0, 0, 0, .2); +} + +/* Body */ + +.vn-gui > .body +{ + position: absolute; + top: 0; + bottom: 0; + left: 15em; + right: 0; +} +.vn-gui .content +{ + position: absolute; + top: 3.9em; + bottom: 0; + left: 0; + right: 0; +} + +/* Left panel */ + +.vn-gui .menu-header +{ + height: 5.5em; + background-color: #333; +} +.vn-gui .logo +{ + width: 12em; + float: left; + margin: 1em; + margin-bottom: .2em; +} +.vn-gui .welcome +{ + float: left; + color: white; + margin: .5em 1em; +} +.vn-gui .background +{ + z-index: 10; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(10, 10, 10, 0.6); + display: none; +} +.vn-gui .left-panel, +.vn-gui .main-menu > li, +.vn-gui ul.submenu +{ + width: 15em; +} +.vn-gui .left-panel +{ + z-index: 20; + position: absolute; + left: 0; + bottom: 0; + top: 0; + background-color: white; + z-index: 20; + box-shadow: 0 0.2em 0.2em #AAA; +} +.vn-gui .menu-overflow +{ + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 4em; + overflow: auto; +} + +/* Test link */ + +.vn-gui .test-link +{ + display: block; + margin: 1em auto; + max-width: 70%; + background-color: #3f51b5; + color: white; + padding: 0 1em; + line-height: 2em; + border-radius: 0.1em; + text-align: center; +} +.vn-gui .test-link:hover +{ + background-color: #4f61c5; +} + +/* Menu */ + +.vn-gui .main-menu +{ + list-style-type: none; + padding: 0; + margin: 0; +} +.vn-gui .main-menu > li +{ + display: block; + float: left; + clear: both; + padding: 0; +} +.vn-gui .main-menu > li > a +{ + line-height: 2.8em; + width: 70%; + padding: 0 15%; +} +.vn-gui .main-menu a +{ + float: left; +} +.vn-gui .main-menu a:hover +{ + background-color: #DDD /* #AC6 */; +} +.vn-gui .main-menu a.selected +{ + background-color: #EEE; +} +.vn-gui ul.submenu +{ + display: none; + position: fixed; + border: none; + border-radius: 1px; + background-color: white; + box-shadow: 0 0.2em 0.2em #CCC; + z-index: 50; + list-style-type: none; + padding-left: 0; +} +.vn-gui ul.submenu a +{ + width: 60%; + padding: 0.7em 20%; +} + +/* Links */ + +.vn-gui .links +{ + position: absolute; + bottom: 0; + right: 0; + padding: 0.8em; +} +.vn-gui .links a +{ + padding: 0.1em; + display: block; + float: left; + max-width: 2.2em; +} +.vn-gui .links img +{ + height: 1.8em; +} + +/* Form holder */ + +.vn-gui .form-holder +{ + position: absolute; + top: 0em; + bottom: 0; + right: 0; + left: 0; + overflow: auto; +} + +/* Transitions */ + +.vn-gui > .left-panel, +.vn-gui > .body +{ + transition: left .3s; + -webkit-transition: left .3s; +} +.vn-gui .top-bar +{ + transition: background-color .3s; + -webkit-transition: background-color .3s; +} + +/* Mobile */ + +@media (max-width: 950px) +{ + .vn-gui > .body + { + left: 0; + } + .vn-gui .menu-button + { + display: block; + } + .vn-gui .left-panel + { + top: 0; + left: -15em; + box-shadow: 0 0.2em 0.2em #333; + } + .vn-gui .left-panel-show + { + left: 0; + } + .vn-gui .form-holder + { + left: 0; + } + .vn-gui ul.submenu + { + display: block; + position: relative; + border: none; + border-radius: 0; + background-color: white; + box-shadow: none; + } + .vn-gui .htk-toast + { + margin-left: -11em; + } +} + diff --git a/web/js/hedera/gui.js b/web/js/hedera/gui.js new file mode 100755 index 00000000..8f92a922 --- /dev/null +++ b/web/js/hedera/gui.js @@ -0,0 +1,526 @@ + +Vn.Gui = new Class +({ + Extends: Htk.Widget, + Properties: + { + conn: + { + set: function (x) + { + this.link ({_conn: x}, + { + 'error': this.onConnError + ,'loading-changed': this.onConnLoading + }); + + var sql = 'SELECT default_form, image_dir FROM config;' + +'SELECT production_domain, test_domain FROM config;' + +'SELECT name FROM customer_view;' + +'CALL form_list ();'; + this.conn.execQuery (sql, this.onMainQueryDone.bind (this)); + }, + get: function () + { + return this._conn; + } + } + } + + ,forms: {} + ,activeForm: null + ,activeCss: null + ,requestedForm: null + ,menuShown: false + ,menuOptions: {} + ,choosedOption: null + + ,initialize: function (props) + { + this.parent (props); + this.builderInit ('js/hedera/gui.xml'); + + this.loadingCount = 0; + this.formHolder = this.$('form-holder'); + + this.hash = Vn.Hash; + this.hashParam = new Vn.HashParam ({key: 'form'}); + this.hashParam.on ('changed', this.onFormChange, this); + + this.$('background').onclick = function () {}; + + this.$('menu-button').addEventListener ('click', function (event) + { + event.stopPropagation (); + this.showMenu (); + }.bind (this)); + + this.$('left-panel').addEventListener ('click', function (event) + { + event.stopPropagation (); + }); + + if (!Vn.Cookie.check ('hedera_cookies')) + { + Vn.Cookie.set ('hedera_cookies', true); + Htk.Toast.showWarning (_('CookiesNotification')); + } + } + + ,show: function () + { + document.body.appendChild (this.node); + } + + ,hide: function () + { + Vn.Node.remove (this.node); + } + + ,onLogoutClick: function () + { + this.conn.close (this.onConnClose.bind (this)); + } + + ,onConnClose: function () + { + this.signalEmit ('logout'); + } + + ,showBackground: function () + { + Vn.Node.show (this.$('background')); + } + + ,hideBackground: function () + { + Vn.Node.hide (this.$('background')); + } + + ,showMenu: function () + { + this.showBackground (); + Vn.Node.addClass (this.$('left-panel'), 'left-panel-show'); + this.menuShown = true; + + this.hideMenuCallback = this.hideMenu.bind (this); + document.addEventListener ('click', this.hideMenuCallback); + } + + ,hideMenu: function () + { + if (!this.menuShown) + return; + + this.hideBackground (); + Vn.Node.removeClass (this.$('left-panel'), 'left-panel-show'); + this.menuShown = false; + + document.removeEventListener ('click', this.hideMenuCallback); + this.hideMenuCallback = null; + } + + ,onMainQueryDone: function (resultSet) + { + // Retrieving configuration parameters + + var res = resultSet.fetchResult (); + var columns = res.columns; + + if (res.next ()) + for (var i = 0; i < res.columns.length; i++) + Vn.Config[columns[i].name] = res.get (columns[i].name); + + // Retrieving configuration parameters + + var res = resultSet.fetchResult (); + + if (res.next () && res.get ('test_domain')) + { + if (location.host != res.get ('production_domain')) + { + var linkText = 'ReturnToOldWebsite'; + var linkField = 'production_domain'; + } + else + { + var linkText = 'TestTheNewWebsite'; + var linkField = 'test_domain'; + } + + Vn.Node.setText (this.$('test-link'), _(linkText)); + this.$('test-link').href = '//'+ res.get (linkField); + } + else + Vn.Node.hide (this.$('test-link')); + + // Retrieving the user name + + var userName = resultSet.fetchValue (); + + if (userName) + { + var span = this.$('user-name'); + span.appendChild (document.createTextNode (userName)); + } + + // Retrieving menu sections + + var res = resultSet.fetchResult (); + var sectionMap = {}; + + if (res) + for (var i = 0; res.next (); i++) + { + var parent = res.get ('parent'); + + if (!sectionMap[parent]) + sectionMap[parent] = []; + + sectionMap[parent].push (i); + } + + this.createMenu (res, sectionMap, null, this.$('main-menu')); + + // Loading the default form + + this.onFormChange (); + } + + ,notifyError: function (error) + { + if (error instanceof Error) + { + var httpRequest = new Vn.HttpRequest () + httpRequest.add + ({ + 'file': error.fileName + ,'line': error.lineNumber + ,'message': error.message + ,'stack': error.stack + }); + httpRequest.send ('log.php'); + } + } + + ,errorHandler: function (error) + { + if (error instanceof Vn.Error) + switch (error.domain) + { + case 'Auth': + Htk.Toast.showError (_('SessionExpired')); + this.signalEmit ('logout'); + break; + case 'Version': + this.newVersion (error); + break; + case 'User': + Htk.Toast.showError (error.message); + break; + default: + console.error (error.message); + Htk.Toast.showError (_('InternalError')); + } + else + { + console.error (error); + Htk.Toast.showError (_('InternalError')); + this.notifyError (error); + } + } + + ,onConnError: function (conn, error) + { + this.errorHandler (error); + } + + ,onConnLoading: function (conn, isLoading) + { + if (isLoading) + this.loaderPush (); + else + this.loaderPop (); + } + + ,loaderPush: function () + { + this.loadingCount++; + + if (this.loadingCount == 1) + this.$('loader').style.visibility = 'visible'; + } + + ,loaderPop: function () + { + if (this.loadingCount == 0) + return; + + this.loadingCount--; + + if (this.loadingCount == 0) + this.$('loader').style.visibility = 'hidden'; + } + + ,newVersion: function (error) + { + if (this.newVersionBlock || this.skipVersion) + return; + + this.newVersionBlock = true; + + var reload; + var message = _('NewVersionAvailable') +"\n\n"+ error.message; + + if (error.code == 'criticalVersion') + { + alert (message) + reload = true; + } + else + { + reload = confirm (message); + this.skipVersion = true; + } + + if (reload) + location.reload (); + + this.newVersionBlock = false; + } + + ,createMenu: function (res, sectionMap, parent, ul) + { + var sections = sectionMap[parent]; + + for (var i = 0; i < sections.length; i++) + { + res.row = sections[i]; + + var li = document.createElement ('li'); + ul.appendChild (li); + + var a = document.createElement ('a'); + a.href = Vn.Hash.make ({'form': res.get ('path')}); + this.menuOptions[res.get ('path')] = a; + li.appendChild (a); + + var text = document.createTextNode (_(res.get ('description'))); + a.appendChild (text); + + var formId = res.get ('id'); + + if (sectionMap[formId]) + { + var submenu = document.createElement ('ul'); + submenu.className = 'submenu'; + li.appendChild (submenu); + + li.addEventListener ('mouseover', + this.onLiMouseHover.bind (this, submenu, a)); + li.addEventListener ('mouseout', + this.onLiMouseOut.bind (this)); + + this.createMenu (res, sectionMap, formId, submenu); + } + } + } + + ,onLiMouseHover: function (submenu, parent) + { + if (Vn.isMobile ()) + return; + + this.hideSubmenu (); + this.activeSubmenu = submenu; + + var rect = parent.getBoundingClientRect (); + submenu.style.display = 'inline'; + submenu.style.left = rect.right +'px'; + submenu.style.top = rect.top +'px'; + } + + ,onLiMouseOut: function () + { + this.timeout = setTimeout (this.hideSubmenu.bind (this), 160); + } + + ,hideSubmenu: function () + { + var submenu = this.activeSubmenu; + + if (submenu) + { + submenu.style.display = 'none'; + clearTimeout (this.timeout); + this.activeSubmenu = null; + this.timeout = 0; + } + } + + ,onFormChange: function () + { + var formPath = this.hashParam.value; + this.openForm (formPath ? formPath : Vn.Config['default_form'], null); + } + + ,openForm: function (formPath, callback) + { + this.hideMenu (); + this.loaderPush (); + + this.requestedForm = formPath; + + var formInfo = this.forms[formPath]; + var path = 'forms/'+ formPath; + + if (this.activeForm) + { + this.setTitle (null); + this.setActions (null); + this.activeForm.deactivate (); + this.activeForm.close (); + this.activeForm.unref (); + this.activeForm = null; + } + + if (this.activeCss) + { + Vn.excludeCss (this.activeCss +'/style.css'); + + if (Vn.isMobile ()) + Vn.excludeCss (this.activeCss +'/mobile.css'); + } + + this.activeCss = path; + + Vn.includeCss (this.activeCss +'/style.css'); + + if (Vn.isMobile ()) + Vn.includeCss (this.activeCss +'/mobile.css'); + + if (!formInfo) + { + var aux = formPath.split ('/'); + var formName = aux[aux.length - 1]; + + var klass = 'Vn.'+ formName.charAt (0).toUpperCase (); + klass += formName.substr (1).replace (/\w\-\w/g, function (token) + { + return token.charAt (0) + token.charAt (2).toUpperCase (); + }); + + formInfo = { + path: formPath + ,klass: klass + ,localeReady: false + ,jsReady: false + ,uiReady: false + ,error: false + ,ready: false + ,callbacks: [] + }; + + Vn.Locale.load (path, + this.onFormLocaleReady.bind (this, formInfo)); + Vn.includeJs (path +'/'+ formName +'.js', + this.onFormJsReady.bind (this, formInfo)); + Vn.loadXml ('forms/'+ formPath +'/ui.xml', + this.onFormUiReady.bind (this, formInfo)); + + this.forms[formPath] = formInfo; + } + + var newChoosedOption = this.menuOptions[formInfo.path]; + + if (newChoosedOption) + { + if (this.choosedOption) + this.choosedOption.className = null; + + newChoosedOption.className = 'selected'; + this.choosedOption = newChoosedOption; + } + + if (callback) + formInfo.callbacks.push (callback); + if (formInfo.ready) + this.onFormReady (formInfo); + } + + ,onFormLocaleReady: function (formInfo, success) + { + formInfo.localeReady = true; + this.onFormReady (formInfo); + } + + ,onFormJsReady: function (formInfo, success) + { + formInfo.jsReady = true; + formInfo.error = !success; + this.onFormReady (formInfo); + } + + ,onFormUiReady: function (formInfo, success) + { + formInfo.uiReady = true; + formInfo.error = !success; + this.onFormReady (formInfo); + } + + ,onFormReady: function (formInfo) + { + if (!(formInfo.localeReady && formInfo.jsReady && formInfo.uiReady)) + return; + + formInfo.ready = true; + + if (!formInfo.error) + { + if (formInfo.path == this.requestedForm) + try { + var klass = eval (formInfo.klass); + this.activeForm = new klass (this, formInfo); + this.activeForm.open (); + this.activeForm.activate (); + } + catch (e) { + formInfo.error = true; + this.errorHandler (e); + } + } + else + Htk.Toast.showError (_('ErrorLoadingForm')); + + var callbacks = formInfo.callbacks; + formInfo.callbacks = []; + + for (var i = 0; i < callbacks.length; i++) + callbacks[i] (this.activeForm); + + this.loaderPop (); + } + + ,setTitle: function (title) + { + Vn.Node.removeChilds (this.$('title')); + + if (title) + this.$('title').appendChild (title); + } + + ,setActions: function (actions) + { + Vn.Node.removeChilds (this.$('actions-holder')); + + if (actions) + this.$('actions-holder').appendChild (actions); + } + + ,_destroy: function () + { + this.hashParam.unref (); + this.parent (); + } +}); + diff --git a/web/js/hedera/gui.xml b/web/js/hedera/gui.xml new file mode 100755 index 00000000..de606756 --- /dev/null +++ b/web/js/hedera/gui.xml @@ -0,0 +1,49 @@ + +
+
+ + +
+
+
+ + + _Exit + +
+
+ +
+
+
+
+
+
+
+
+
+ diff --git a/web/js/hedera/hedera.js b/web/js/hedera/hedera.js new file mode 100644 index 00000000..665fe387 --- /dev/null +++ b/web/js/hedera/hedera.js @@ -0,0 +1,4 @@ +/** + * Namespace + **/ +var Hedera = {}; diff --git a/web/js/hedera/login.css b/web/js/hedera/login.css new file mode 100755 index 00000000..9b7c7da2 --- /dev/null +++ b/web/js/hedera/login.css @@ -0,0 +1,162 @@ + +.vn-login, +.vn-login label, +.vn-login button, +.vn-login input, +.vn-login textarea, +.vn-login p, +.vn-login a +{ + font-size: 1.2em; + font-weight: normal; + color: #333; +/* text-shadow: 0 0.2em 0.2em #AAA; */ +} + +/* Header */ + +.vn-login .header +{ + z-index: 10; + position: absolute; + background-color: #333; + width: 100%; + height: 3.5em; + +} +.vn-login .header div +{ + margin-top: 1em; + text-align: center; +} +.vn-login .header a +{ + color: white; +} + +/* Body */ + +.vn-login .body +{ + position: absolute; + top: 3.5em; + left: 0; + right: 0; + bottom: 0; +/* background-image: url("background.png"); + background-repeat: repeat; +*/ +} +.vn-login .column +{ + position: relative; + margin: 0 auto; + overflow: auto; + max-width: 40em; + height: 100%; + background-color: white; + box-shadow: 0 0.2em 0.2em #DDD; +} + +/* Login */ + +.vn-login .login +{ + position: absolute; + margin-top: -17em; + padding: 1em; + max-width: 45em; + top: 50%; + left: 0; + right: 0; + +} +.vn-login .logo img +{ + display: block; + margin: 0.5em auto; + min-width: 20em; + width: 75%; +} +.vn-login .version-code +{ + color: red; + text-align: right; + margin: 0.2em auto; + font-weight: bold; + height: 1.6em; +} +.vn-login .form-inputs +{ + margin: 0 auto; + max-width: 16em; +} +.vn-login label +{ + margin: 0; +} +.vn-login div.form-group label +{ + display: block; +} +.vn-login input +{ + border-radius: 0.1em; + box-shadow: 0 0.1em 0.1em #AAA; + margin: 0.3em; +} +.vn-login input[type=text], +.vn-login input[type=password] +{ + margin: 0.5em 0; + margin-bottom: 0.5em; + padding: 0.5em; + width: 100%; + border: 1px solid #AAA; +} +.vn-login td.entry +{ + text-align: left; +} +.vn-login input[type=submit] +{ + display: block; + margin: 0 auto; + background-color: #AD4; + border: 1px solid #8B2; + height: 2.4em; + width: 8em; + color: #250; +} +.vn-login input[type=submit]:hover +{ + background-color: #9C3; +} +.vn-login .bottom +{ + text-align: center; + padding: 1em; +} + +/* Info */ + +.vn-login .info +{ + margin-top: 2em; + text-align: center; +} +.vn-login .info p +{ + margin: 0.5em; +} +.vn-login .links +{ + margin: 0 auto; + margin-top: 2em; + text-align: center; +} +.vn-login .links img +{ + height: 1.8em; +} + diff --git a/web/js/hedera/login.js b/web/js/hedera/login.js new file mode 100755 index 00000000..60fc4aae --- /dev/null +++ b/web/js/hedera/login.js @@ -0,0 +1,74 @@ + +Vn.Login = new Class +({ + Extends: Htk.Widget + + ,initialize: function (props) + { + this.parent (props); + this.builderInit ('js/hedera/login.xml'); + + var self = this; + this.$('form').onsubmit = function () + { + self.onSubmit (); + return false; + }; + } + + ,show: function () + { + document.body.appendChild (this.node); + + if (Vn.Cookie.check ('vn_user')) + this.$('user').value = Vn.Cookie.get ('vn_user'); + + this.focusUserInput (); + } + + ,hide: function () + { + Vn.Node.remove (this.node); + } + + ,focusUserInput: function () + { + var userEntry = this.$('user'); + userEntry.focus (); + userEntry.select (); + } + + ,disableInputs: function (disabled) + { + this.$('user').disabled = disabled; + this.$('pass').disabled = disabled; + this.$('submit').disabled = disabled; + } + + ,onSubmit: function () + { + this.disableInputs (true); + this.conn.open ( + this.$('user').value, + this.$('pass').value, + this.$('remember').value, + this.onConnOpen.bind (this) + ); + } + + ,onConnOpen: function (conn, success) + { + this.$('pass').value = ''; + + if (!success) + { + Htk.Toast.showError (_('InvalidLogin')); + } + else + this.signalEmit ('login'); + + this.disableInputs (false); + this.focusUserInput (); + } +}); + diff --git a/web/js/hedera/login.xml b/web/js/hedera/login.xml new file mode 100755 index 00000000..768933f0 --- /dev/null +++ b/web/js/hedera/login.xml @@ -0,0 +1,57 @@ + + + diff --git a/web/js/hedera/main.js b/web/js/hedera/main.js new file mode 100644 index 00000000..e0083edf --- /dev/null +++ b/web/js/hedera/main.js @@ -0,0 +1,19 @@ + +Vn.includeCss ('js/hedera/style.css'); +Vn.includeCss ('js/hedera/gui.css'); +Vn.includeCss ('js/hedera/login.css'); + +Vn.loadXml ('js/hedera/login.xml'); +Vn.loadXml ('js/hedera/gui.xml'); + +Vn.includeJs ('js/htk/main.js'); +Vn.includeLib ('hedera', +[ + 'hedera' + ,'login' + ,'gui' + ,'module' + ,'app' + ,'tpv' +]); + diff --git a/web/js/hedera/module.js b/web/js/hedera/module.js new file mode 100755 index 00000000..b3bc1028 --- /dev/null +++ b/web/js/hedera/module.js @@ -0,0 +1,88 @@ + +Vn.Module = new Class +({ + Extends: Vn.Object + + ,initialize: function (gui, formInfo) + { + this.gui = gui; + this.conn = gui.conn; + this.hash = gui.hash; + this.formInfo = formInfo; + } + + /** + * Gets an object from the builder associated to this form. + * + * @param {string} objectId The object identifier + * @return {Object} The object, or %null if not found + **/ + ,$: function (objectId) + { + if (this.builder) + return this.builder.get (objectId); + + return null; + } + + /** + * Called when the form is opened. + **/ + ,open: function () + { + this.close (); + + this.builder = new Vn.Builder (); + this.builder.signalData = this; + this.builder.loadXml (Vn.getXml ('forms/'+ this.formInfo.path +'/ui.xml')); + this.node = this.builder.get ('form'); + + var models = this.builder.getObjects ('db-model'); + + for (var i = 0; i < models.length; i++) + 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; + + this.gui.formHolder.appendChild (this.node); + this.gui.setTitle (this.builder.$('title')); + this.gui.setActions (this.builder.$('actions')); + } + + /** + * Called when the form is activated. + **/ + ,activate: function () {} + + /** + * Called when the form is deactivated. + **/ + ,deactivate: function () {} + + /** + * Called when the form is closed. + **/ + ,close: function () + { + if (this.node) + { + Vn.Node.remove (this.node); + this.node = null; + } + if (this.builder) + { + this.builder.unref (); + this.builder = null; + } + } + + ,_destroy: function () + { + this.close (); + this.parent (); + } +}); + diff --git a/web/js/hedera/style.css b/web/js/hedera/style.css new file mode 100755 index 00000000..060934ce --- /dev/null +++ b/web/js/hedera/style.css @@ -0,0 +1,382 @@ + +/* Responsive */ + +@media screen +{ + * { font-size: 12pt; } +} +@media (min-resolution: 120dpi) and (orientation: portrait) +{ + * { font-size: 11pt; } +} +@media (min-resolution: 120dpi) and (orientation: landscape) +{ + * { font-size: 11pt; } +} + +/* Global */ + +body +{ + margin: 0; +} +body, +label, +button, +input, +textarea +{ + font-size: 1em; + font-family: 'Open Sans', 'Verdana', 'Sans'; +} +iframe +{ + border: 0; +} +fieldset, +div +{ + margin: 0; +} +form +{ + padding: 0; + margin: 0; +} +table +{ + width: 100%; +} +a:link, +a:visited, +a:active +{ + color: #000; + text-decoration: none; +} +a:hover +{ + text-decoration: none; + cursor: pointer; +} +a img +{ + padding: 1px; +} +h1, h2, h3, h4, h5, h6 +{ + margin: 0; + padding: 0.2em; +} +h1 +{ + font-size: 1.5em; +} +h2 +{ + font-size: 1.3em; +} +p +{ + margin: 0.8em 0; +} + +/* Inputs */ + +input[type=text], +input[type=password], +input[type=file], +input[type=number], +textarea, +select +{ + border: 1px solid #CCD; + margin: 0.2em; + border-radius: 0.1em; + box-shadow: 0 0.1em 0.1em #CCC; +} + +input[type=text], +input[type=password], +input[type=file], +input[type=number], +textarea +{ + padding: 0.3em; +} +select +{ + background-color: white; + font-size: 1.1em; + height: 1.8em; +} +option +{ + padding: 0.3em; + border-width: 0; + font-weight: normal; + font-size: 1em; +} +select, +option +{ + cursor: pointer; +} +input[type=text], +input[type=password] +{ + height: 1.6em; +} +textarea +{ + height: 3.5em; + width: 20em; +} +input[type=text]:focus, +input[type=password]:focus, +textarea:focus +{ + background-color: #EEF; + border-color: #BBC; +} +input[type=checkbox], +input[type=radio] +{ + cursor: pointer; + margin: 0.2em; + padding: 0.3em; + width: 0.8em; + height: 0.8em; +} + +/* Buttons */ + +button, +input[type=submit], +input[type=button] +{ + border: none; + background-color: transparent; + color: white; + padding: 0.5em; + cursor: pointer; + border-radius: 0.1em; +} +button:hover, +input[type=submit]:hover, +input[type=button]:hover +{ + background-color: rgba(1, 1, 1, 0.1); +} + +/* Flat button */ + +button.flat, +input.button +{ + border: none; + border-radius: 0.1em; + box-shadow: 0 0.2em 0.2em #DDD; + background-color: #AD4; + color: black; +} +button.flat:hover, +input.button:hover +{ + background-color: #9C3; + cursor: pointer; +} +button.flat:disabled, +input.button:disabled +{ + color: gray; +} + +/* Thin button */ + +button.thin +{ + background-color: transparent; + border: none; + color: #008D77; + text-transform: uppercase; +} +button.thin:hover +{ + background-color: rgba(1,1,1,0.1); +} +button.thin:disabled +{ + color: gray; +} + +/* Image */ + +img.editable +{ + cursor: pointer; +} + +/* Button */ + +.htk-button img +{ + height: 1.5em; +} + +/* Float */ + +.clear +{ + clear: both; +} + +/* Box */ + +.box +{ + background-color: white; + margin: 0 auto; + border-radius: 0.1em; + box-shadow: 0 0.2em 0.2em #CCC; +} +.box .header +{ + padding: 0.6em 0.8em; + margin: 0; + background-color: #009688; + color: white; +} +.box .header > h1 +{ + color: white; + text-align: left; + font-size: 1.6em; + line-height: 2em; + font-weight: normal; + display: inline; +} +.box .body +{ + padding: 2em; +} + +/* Form */ + +.form +{ + margin: 0 auto; +} + +.form-group +{ + padding: 0.4em; +} +.form-group > label +{ + display: block; + margin-bottom: 0.5em; +} +.form-group > input[type=text], +.form-group > input[type=password], +.form-group > select, +.form-group > textarea +{ + margin: 0; + width: 100%; +} + +/* Action bar */ + +.action-bar +{ + float: right; + padding: 0; + margin-top: 0.3em; +} +.action-bar > * +{ + float: left; + padding: 0.4em; +} +.action-bar > button +{ + border-left: 1px solid white; +} +.action-bar > button:first-child +{ + border-left: none; +} +.action-bar > button:hover +{ + background-color: rgba(1, 1, 1, 0.2); +} +.action-bar > button > img +{ + vertical-align: middle; + margin-right: 0.4em; + height: 1.4em; +} + +/* Form */ + +table.form +{ + padding: 1em; + border-collapse: separate; + border-spacing: 0.3em; +} +table.form td.label +{ + width: 45%; + text-align: right; +} +table.form tr +{ + height: 2.8em; +} + +/* Icon */ + +img.icon +{ + height: 1.5em; +} + +/* Masonry */ + +.masonry +{ + margin: 0 auto; + text-align: left; +} +.masonry-box +{ + width: 100%; + display: inline-block; + vertical-align: top; +} +@media screen and (min-width: 1000px) and (max-width: 1399px) +{ + .masonry-box + { + width: 50%; + display: block; + float: left; + clear: left; + } + .masonry-box:nth-child(2n+0) + { + float: right; + clear: right; + } +} +@media screen and (min-width: 1400px) +{ + .masonry-box { width: 33.3%; } +} +@media screen and (min-width: 2000px) +{ + .masonry-box { width: 25%; } +} + diff --git a/web/js/hedera/tpv.js b/web/js/hedera/tpv.js new file mode 100755 index 00000000..562e6380 --- /dev/null +++ b/web/js/hedera/tpv.js @@ -0,0 +1,124 @@ + +Vn.Tpv = +{ + check: function (conn) + { + var tpvStatus = Vn.Hash.get ('tpv_status'); + + if (tpvStatus) + { + var batch = new Sql.Batch (); + batch.addValue ('transaction', Vn.Hash.get ('tpv_order')); + batch.addValue ('status', tpvStatus); + + var query = 'CALL transaction_end (#transaction, #status)'; + + conn.execQuery (query, null, batch); + } + } + + ,pay: function (conn, amount, company) + { + if (amount > 0) + { + var query = 'CALL transaction_start (#company, #amount)'; + + var batch = new Sql.Batch (); + batch.addValue ('company', company); + batch.addValue ('amount', parseInt (amount * 100)); + + conn.execQuery (query, + this._onTransactionStart.bind (this), batch); + } + else if (!isNaN (amount)) + Htk.Toast.showError (_('AmountError')); + } + + ,_onTransactionStart: function (resultSet) + { + var res = resultSet.fetchResult (); + + if (res && res.next ()) + { + var form = document.createElement ('form'); + form.method = 'post'; + form.action = res.get ('url'); + document.body.appendChild (form); + + var fieldsMap = + { + 'Ds_Merchant_Amount': 'amount' + ,'Ds_Merchant_Order': 'ds_order' + ,'Ds_Merchant_MerchantCode': 'id' + ,'Ds_Merchant_Currency': 'currency' + ,'Ds_Merchant_TransactionType': 'transaction_type' + ,'Ds_Merchant_Terminal': 'terminal' + ,'Ds_Merchant_MerchantURL': 'merchant_url' + ,'Ds_Merchant_MerchantSignature': 'signature' + ,'Ds_Merchant_UrlOK': null + ,'Ds_Merchant_UrlKO': null + }; + + for (var field in fieldsMap) + { + var input = document.createElement ('input'); + input.type = 'hidden'; + input.name = field; + form.appendChild (input); + + if (fieldsMap[field]) + input.value = res.get (fieldsMap[field]); + } + + var transactionId = res.get ('ds_order'); + form['Ds_Merchant_UrlOK'].value = this._makeUrl ('ok', transactionId); + form['Ds_Merchant_UrlKO'].value = this._makeUrl ('ko', transactionId); + + form.submit (); + } + else + Htk.Toast.showWarning (_('PayError')); + } + + ,_makeUrl: function (status, order) + { + var path = location.protocol +'//'+ location.host; + path += location.port ? ':'+ location.port : ''; + path += location.pathname; + path += location.search ? location.search : ''; + path += Vn.Hash.make ({ + 'form': 'ecomerce/orders', + 'tpv_status': status, + 'tpv_order': order + }, true); + + return path; + } +}; + +Vn.BasketChecker = +{ + check: function (conn, callback) + { + conn.execQuery ('CALL basket_check ()', + this._onBasketCheck.bind (this, callback)); + } + + ,_onBasketCheck: function (callback, resultSet) + { + var status = resultSet.fetchValue (); + + if (!status) + return; + + var isOk = status == 'UPDATED' || status == 'OK'; + + if (status == 'UPDATED') + Htk.Toast.showWarning (_('OrderItemsUpdated')); + if (callback) + callback (isOk); + if (!isOk) + Vn.Hash.set ({'form': 'ecomerce/checkout'}); + } +}; + diff --git a/web/js/htk/htk.js b/web/js/htk/htk.js index f07e8df2..63ad1fd0 100755 --- a/web/js/htk/htk.js +++ b/web/js/htk/htk.js @@ -1,36 +1,4 @@ -include ([ - 'js/db/db.js', - 'js/htk/js/htk/main', - 'js/htk/widget', - 'js/htk/popup', - 'js/htk/toast', - 'js/htk/repeater', - 'js/htk/grid', - 'js/htk/full-image', - 'js/htk/image-editor', - 'js/htk/field', - 'js/htk/field/text', - 'js/htk/field/html', - 'js/htk/field/entry', - 'js/htk/field/radio-group', - 'js/htk/field/radio', - 'js/htk/field/label', - 'js/htk/field/text-area', - 'js/htk/field/spin', - 'js/htk/field/check', - 'js/htk/field/select', - 'js/htk/field/calendar', - 'js/htk/field/date-chooser', - 'js/htk/field/image', - 'js/htk/field/button', - 'js/htk/field/table', - 'js/htk/column', - 'js/htk/column/button', - 'js/htk/column/link', - 'js/htk/column/date', - 'js/htk/column/image', - 'js/htk/column/radio', - 'js/htk/column/spin', - 'js/htk/column/text', - 'js/htk/column/check' -]); +/** + * The namespace. + **/ +var Htk = {}; diff --git a/web/js/htk/image-editor.js b/web/js/htk/image-editor.js index 9cf8269c..c7c5ea8a 100755 --- a/web/js/htk/image-editor.js +++ b/web/js/htk/image-editor.js @@ -1,11 +1,15 @@ +/** + * A form to handle the image database, it allows to add new images or replace it + **/ Htk.ImageEditor = new Class ({ Extends: Htk.Widget ,Xml: 'js/htk/image-editor.xml' - ,initialize: function () + ,initialize: function (props) { - this.builderInit (Htk.ImageEditor.Xml); + this.parent (props) + this.builderInit (this.constructor.Xml); this.$('max-size').value = 10 /* MB */ * 1048576; } @@ -21,7 +25,7 @@ Htk.ImageEditor = new Class } ,onIframeLoad: function () - { + { this.$('submit').disabled = false; this.$('loader').style.visibility = 'hidden'; diff --git a/web/js/htk/loader.css b/web/js/htk/loader.css new file mode 100644 index 00000000..d1fbb82e --- /dev/null +++ b/web/js/htk/loader.css @@ -0,0 +1,74 @@ + +.htk-loader +{ + font-size: 10px; + margin: 50px auto; + text-indent: -9999em; + width: 11em; + height: 11em; + border-radius: 50%; + background: #ffffff; + background: -moz-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); + background: -webkit-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); + background: -o-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); + background: -ms-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); + background: linear-gradient(to right, #ffffff 10%, rgba(255, 255, 255, 0) 42%); + position: relative; + -webkit-animation: load3 1.4s infinite linear; + animation: load3 1.4s infinite linear; + -webkit-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); +} +.htk-loader:before +{ + width: 50%; + height: 50%; + background: #ffffff; + border-radius: 100% 0 0 0; + position: absolute; + top: 0; + left: 0; + content: ''; +} +.htk-loader:after +{ + background: #0dc5c1; + width: 75%; + height: 75%; + border-radius: 50%; + content: ''; + margin: auto; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; +} +@-webkit-keyframes load3 +{ + 0% + { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% + { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +@keyframes load3 +{ + 0% + { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% + { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + diff --git a/web/js/htk/loader.js b/web/js/htk/loader.js new file mode 100755 index 00000000..1c42f564 --- /dev/null +++ b/web/js/htk/loader.js @@ -0,0 +1,12 @@ +Htk.Loader = new Class +({ + Extends: Htk.Widget + ,Tag: 'htk-loader' + + ,initialize: function (props) + { + this.parent (props); + var loader = this.createElement ('div'); + loader.className = 'htk-loader'; + } +}); diff --git a/web/js/htk/main.js b/web/js/htk/main.js index 63ad1fd0..e28a7240 100755 --- a/web/js/htk/main.js +++ b/web/js/htk/main.js @@ -1,4 +1,42 @@ -/** - * The namespace. - **/ -var Htk = {}; + +Vn.includeCss ('js/htk/style.css'); +Vn.includeJs ('js/db/main.js'); +Vn.includeLib ('htk', +[ + 'htk' + ,'widget' + ,'popup' + ,'toast' + ,'repeater' + ,'grid' + ,'loader' + ,'full-image' + ,'image-editor' + ,'assistant' + ,'assistant-bar' + ,'field' + ,'field/text' + ,'field/html' + ,'field/entry' + ,'field/radio-group' + ,'field/radio' + ,'field/label' + ,'field/text-area' + ,'field/spin' + ,'field/check' + ,'field/select' + ,'field/calendar' + ,'field/date-chooser' + ,'field/image' + ,'field/button' + ,'field/table' + ,'column' + ,'column/button' + ,'column/link' + ,'column/date' + ,'column/image' + ,'column/radio' + ,'column/spin' + ,'column/text' + ,'column/check' +]); diff --git a/web/js/htk/main.php b/web/js/htk/main.php index f01f4c1b..25bea914 100755 --- a/web/js/htk/main.php +++ b/web/js/htk/main.php @@ -3,7 +3,7 @@ require_once ('js/db/main.php'); Vn\Hedera\Js::includeLib ('htk' - ,'main' + ,'htk' ,'widget' ,'popup' ,'toast' diff --git a/web/js/htk/style.css b/web/js/htk/style.css new file mode 100755 index 00000000..c536a860 --- /dev/null +++ b/web/js/htk/style.css @@ -0,0 +1,505 @@ + +/* Grid */ + +.htk-grid +{ + margin: auto; + border-collapse: collapse; + text-align: center; +} +.htk-grid > thead > tr, +.htk-grid > tfoot > tr +{ + background-color: #009688; + vertical-align: middle; + text-align: center; + height: 3em; +} +.htk-grid > thead th +{ + color: white; + cursor: pointer; + font-weight: normal; + padding: 0 0.4em; +} +.htk-grid > thead th:hover +{ + background-color: rgba(1, 1, 1, 0.2); +} +.htk-grid tr +{ + height: 3.5em; +} +.htk-grid > tfoot a, +.htk-grid > thead a +{ + color: black; +} +.htk-grid tr.pair-row +{ + background-color: transparent; +} +.htk-grid .message +{ + height: 5em; +} +.htk-grid .message img +{ + vertical-align: middle; + padding: 0.8em; + height: 1.8em; +} +.htk-grid > tbody tr +{ + border-top: 1px solid #DDD; +} +.htk-grid > tbody tr:first-child +{ + border-top: none; +} +.htk-grid > tbody td +{ + margin: 0; + padding: 0 0.5em; +} +.htk-grid > tbody td:first-child, +.htk-grid > thead th:first-child +{ + padding-left: 1em; +} +.htk-grid > tbody td:last-child, +.htk-grid > thead th:last-child +{ + padding-right: 1em; +} +.htk-grid .cell-spin +{ + width: 2.5em; + text-align: right; +} +.htk-grid .cell-button +{ + margin: 0; + padding: 0.5em; + border: none; + background-color: transparent; + border-radius: 0.1em; +} +.htk-grid .cell-button:hover +{ + background-color: rgba(1, 1, 1, 0.1); +} +.htk-grid .cell-button img +{ + height: 1.5em; + display: block; + margin: auto; +} +.htk-grid .cell-image > img +{ + max-width: 2.5em; + max-height: 2.5em; + display: block; + margin: auto; +} + +/* Repater */ + +.htk-repeater > .message +{ + padding: 1em 0; + text-align: center; +} +.htk-repeater > .message > * +{ + vertical-align: middle; +} +.htk-repeater > .message > img +{ + padding: 0.8em; + padding-left: 0; + height: 1.8em; +} + +/* Calendar */ + +.htk-calendar +{ + width: 20em; + background-color: white; + border: none; +} +.htk-calendar table +{ + border-collapse: collapse; +} +.htk-calendar thead tr, +.htk-calendar tfoot tr +{ + background-color: #009688; + color: white; + font-weight: normal; + vertical-align: middle; + text-align: center; + height: 3em; +} +.htk-calendar thead span +{ + color: white; +} +.htk-calendar thead tr +{ + border-bottom: none; +} +.htk-calendar tfoot tr +{ + border-top: none; +} +.htk-calendar th.button:hover +{ + cursor: pointer; + background-color: rgba(1, 1, 1, 0.2); +} +.htk-calendar col +{ + width: 14.2%; +} +.htk-calendar tr +{ + height: 2em; +} +.htk-calendar tbody td +{ + text-align: right; +} +.htk-calendar tbody td > div +{ + height: 2em; + width: 2em; + line-height: 2em; + text-align: center; + border-radius: 2em; + padding: 0.3em; + margin: 0 auto; + color: #555; +} +.htk-calendar div.disabled +{ + color: #999; +} +.htk-calendar div.today +{ + font-weight: bold; + color: black; +} +.htk-calendar div.selected +{ + color: white; + background-color: #009688; +} +.htk-calendar div.enabled:hover +{ + cursor: pointer; + background-color: #008678; + color: white; +} + +/* Date chooser */ + +.htk-date-chooser > button +{ + margin: 0.2em; + padding: 0.3em; + background-color: white; + color: black; + text-align: left; + min-width: 9em; + min-height: 2.3em; + border: 1px solid #CCD; + border-radius: 0.1em; + box-shadow: 0 0.1em 0.1em #CCC; +} + +/* Full image */ + +.htk-full-image +{ + z-index: 100; + position: fixed; + background-color: #FFF; + text-align: center; + border: 1px solid #999; + border-radius: 2px; +} +.htk-full-image-loader +{ + z-index: 110; + position: fixed; + background-color: #FFF; + border: 1px solid #999; + border-radius: 0.1em; +} +.htk-full-image-loader img +{ + padding: 1em; +} + +/* Toast */ + +.htk-toast +{ + z-index: 210; + display: block; + position: fixed; + left: 50%; + top: 4em; + width: 21em; + margin-left: -11em; + text-align: center; + overflow: auto; + max-height: 40em; +} +.htk-toast > div +{ + padding: .5em 2%; + margin: .5em 2%; + border-radius: 0.1em; + box-shadow: 0 0 0.4em #666; + width: 92%; +} +.htk-toast > .message +{ + background-color: #BFB; +} +.htk-toast > .warning +{ + background-color: #FFB; +} +.htk-toast > .error +{ + background-color: #FBB; +} + +/* Popup */ + +.htk-popup +{ + z-index: 200; + display: block; + position: fixed; + background-color: white; + border-radius: 0.1em; + box-shadow: 0 0 0.4em #666; +} +.htk-background +{ + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 190; + background-color: rgba(1, 1, 1, 0.7); +} + +/* Image editor */ + +.htk-image-editor +{ + width: 20em; + margin: 0 auto; +} +.htk-image-editor h2 +{ + color: white; + background-color: #009688; + text-align: left; + font-size: 1.3em; + line-height: 1.7em; + font-weight: normal; + padding: 0.6em 0.8em; + margin: 0; +} +.htk-image-editor iframe +{ + display: none; +} +.htk-image-editor form +{ + padding: 1.5em; +} +.htk-image-editor .form-group +{ + margin-bottom: 0.5em; +} +.htk-image-editor .form-group label +{ + display: block; + margin-bottom: 0.3em; +} +.htk-image-editor .form-group input +{ + width: 95%; + height: 1.8em; +} +.htk-image-editor .footer +{ + margin-top: 1em; + text-align: center; +} +.htk-image-editor .footer img +{ + visibility: hidden; + vertical-align: middle; + padding-right: 1em; +} +.htk-image-editor .footer input +{ + display: inline; + margin-left: 0.5em; + margin-right: 0.5em; +} + +/* Assistant */ + +.htk-assistant > div +{ + display: none; + margin-top: 1em; + margin-bottom: 4em; +} +.htk-assistant > div > h2 +{ + text-align: center; + font-style: italic; + font-weight: normal; + font-size: 1.5em; + margin: 0.5em; + margin-bottom: 1em; +} +.htk-assistant * +{ + color: #555; +} + +/* Assistant bar */ + +.htk-assistant-bar +{ + margin: 0.5em auto; + max-width: 30em; + position: relative; +} +.htk-assistant-bar img +{ + cursor: pointer; +} +.htk-assistant-bar > img +{ + position: absolute; + width: 1.8em; + top: 0; + padding: 0.3em; + border-radius: 0.1em; +} +.htk-assistant-bar > img:hover +{ + background-color: rgba(1,1,1,0.1); +} +.htk-assistant-bar > img.previous +{ + left: 0; +} +.htk-assistant-bar > img.next +{ + right: 0; +} +.htk-assistant-bar > div +{ + margin: 0 auto; + padding-top: 0.2em; +} +.htk-assistant-bar > div > img +{ + padding: 0.3em 0.2em; + width: 1.3em; +} +.htk-assistant-bar > div > img:hover +{ + opacity: .7; +} + +/* Loader */ +/* +.htk-loader +{ + margin: 0 auto; + width: 2em; + height: 2em; + text-indent: -9999em; + border-radius: 50%; + background: #FFF; + background: -moz-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); + background: -webkit-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); + background: -o-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); + background: -ms-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); + background: linear-gradient(to right, #ffffff 10%, rgba(255, 255, 255, 0) 42%); + position: relative; + -webkit-animation: load3 1.4s infinite linear; + animation: load3 1.4s infinite linear; + -webkit-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); +} +.htk-loader:before +{ + width: 50%; + height: 50%; + background: #FFF; + border-radius: 100% 0 0 0; + position: absolute; + top: 0; + left: 0; + content: ''; +} +.htk-loader:after +{ + background: #009688; + width: 75%; + height: 75%; + border-radius: 50%; + content: ''; + margin: auto; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; +} +@-webkit-keyframes load3 +{ + 0% + { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% + { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +@keyframes load3 +{ + 0% + { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% + { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +*/ diff --git a/web/js/htk/widget.js b/web/js/htk/widget.js index 4ffcc3c3..c4a6a3e5 100755 --- a/web/js/htk/widget.js +++ b/web/js/htk/widget.js @@ -52,4 +52,12 @@ Htk.Widget = new Class { Vn.Node.remove (this.node); } + + ,_destroy: function () + { + if (this.builder) + this.builder.unref (); + + this.parent (); + } }); diff --git a/web/js/misc/main.js b/web/js/misc/main.js new file mode 100755 index 00000000..830eae5b --- /dev/null +++ b/web/js/misc/main.js @@ -0,0 +1,4 @@ + +Vn.includeJs ('js/misc/tinymce/tinymce.min.js'); +Vn.includeJs ('js/misc/mootools'); + diff --git a/web/js/sql/main.js b/web/js/sql/main.js index 21358f87..222171c2 100755 --- a/web/js/sql/main.js +++ b/web/js/sql/main.js @@ -1,5 +1,29 @@ -/** - * The namespace. - **/ -var Sql = {}; + +Vn.includeJs ('js/vn/main.js'); +Vn.includeLib ('sql', +[ + 'sql' + ,'object' + ,'holder' + ,'batch' + ,'list' + ,'expr' + ,'value' + ,'field' + ,'function' + ,'operation' + ,'target' + ,'table' + ,'stmt' + ,'dml' + ,'string' + ,'delete' + ,'insert' + ,'select' + ,'update' + ,'multi-stmt' + ,'filter' + ,'filter-item' + ,'search-tags' +]); diff --git a/web/js/sql/main.php b/web/js/sql/main.php index 03f69755..f0ba1789 100755 --- a/web/js/sql/main.php +++ b/web/js/sql/main.php @@ -3,7 +3,7 @@ require_once ('js/vn/main.php'); Vn\Hedera\Js::includeLib ('sql' - ,'main' + ,'sql' ,'object' ,'holder' ,'batch' diff --git a/web/js/sql/sql.js b/web/js/sql/sql.js new file mode 100755 index 00000000..21358f87 --- /dev/null +++ b/web/js/sql/sql.js @@ -0,0 +1,5 @@ +/** + * The namespace. + **/ +var Sql = {}; + diff --git a/web/js/vn/locale.js b/web/js/vn/locale.js index dd865869..17086a28 100755 --- a/web/js/vn/locale.js +++ b/web/js/vn/locale.js @@ -7,13 +7,18 @@ Vn.Locale = ,language: null - ,load: function (path, callback) + ,init: function () { if (!this.language) { var language = navigator.language.substr (0, 2); this.language = language ? language : 'es'; } + } + + ,load: function (path, callback) + { + this.init (); var file = 'locale/'+ this.language +'/'+ path +'.json' +'?'+ Vn.Cookie.get ('hedera_version'); @@ -23,6 +28,12 @@ Vn.Locale = request.onreadystatechange = this.loadDone.bind (this, request, callback); request.send (); } + + ,loadScript: function (path, callback) + { + this.init (); + Vn.includeJs ('locale/'+ this.language +'/'+ path, callback); + } ,loadDone: function (request, callback) { diff --git a/web/js/vn/main.js b/web/js/vn/main.js old mode 100755 new mode 100644 index afb42645..1a0a3e68 --- a/web/js/vn/main.js +++ b/web/js/vn/main.js @@ -1,187 +1,20 @@ -/** - * The main namespace. - **/ -var Vn = -{ - Config: {} - ,jsIncludes: {} - ,cssIncludes: {} - ,xmlIncludes: {} - ,customTags: {} - ,head: document.getElementsByTagName ('head')[0] - ,isMobileCached: null - /** - * Includes a new CSS stylesheet in the current document, if the stylesheet - * its already included, does nothing. - * - * @param {string} fileName The stylesheet file name - **/ - ,includeCss: function (fileName) - { - var cssData = this.cssIncludes[fileName]; - - if (!cssData) - { - var link = document.createElement ('link'); - link.rel = 'stylesheet'; - link.type = 'text/css'; - link.href = fileName +'?'+ Vn.Cookie.get ('hedera_version'); - this.head.appendChild (link); - - this.cssIncludes[fileName] = - { - included: true - ,link: link - }; - } - else if (!cssData.included) - { - cssData.link.disabled = false; - cssData.included = true; - } - } - - /** - * Excludes a CSS stylesheet from the current document. - * - * @param {string} fileName The stylesheet file name - **/ - ,excludeCss: function (fileName) - { - var cssData = this.cssIncludes[fileName]; - - if (cssData && cssData.included) - { - cssData.link.disabled = true; - cssData.included = false; - } - } - - /** - * Includes a new Javascript in the current document, if the script - * its already included, does nothing. - * - * @param {string} fileName The script file name - * @param {Function} callback The function to call when script is - * downloaded and included - **/ - ,includeJs: function (fileName, callback, skipVersion) - { - var includeData = this.jsIncludes[fileName]; - - if (includeData === undefined) - { - var src = fileName; - - if (!skipVersion) - src = src +'?'+ Vn.Cookie.get ('hedera_version'); - - var script = document.createElement ('script'); - script.type = 'text/javascript'; - script.src = src; - - includeData = { - script: script - ,callbacks: [] - ,loaded: false - }; - - if (callback) - includeData.callbacks.push (callback); - - script.onload = - this.jsLoaded.bind (this, includeData, true); - script.onerror = - this.jsLoaded.bind (this, includeData, false); - script.onreadystatechange = - this.jsStateChanged.bind (this, includeData); - - this.jsIncludes[fileName] = includeData; - - this.head.appendChild (script); - } - else if (callback) - { - if (includeData.loaded) - callback (); - else - includeData.callbacks.push (callback); - } - } - - ,jsStateChanged: function (includeData) - { - console.log ('js: '+ includeData.script.readyState); - - if (includeData.script.readyState == 'complete') - this.jsLoaded (includeData, true); - } - - ,jsLoaded: function (includeData, success) - { - if (includeData.loaded) - return; - - for (var i = 0; i < includeData.callbacks.length; i++) - includeData.callbacks[i] (success); - - includeData.loaded = true; - includeData.callbacks = null; - } - - ,loadXml: function (path, callback) - { - var includeData = this.xmlIncludes[path]; - - if (!includeData) - { - var request = new XMLHttpRequest (); - request.onreadystatechange = - this.onXmlReady.bind (this, request, path, callback); - request.open ('get', path +'?'+ Vn.Cookie.get ('hedera_version'), true); - request.send (); - } - else if (callback) - callback (true); - } - - ,onXmlReady: function (request, path, callback) - { - if (request.readyState != 4) - return; - - if (request.status == 200) - this.xmlIncludes[path] = request.responseXML; - - if (callback) - callback (request.status == 200); - } - - ,getXml: function (path) - { - return this.xmlIncludes[path]; - } - - /** - * Checks if user is using a mobile browser. - * - * return {boolean} %true if is mobile, %false otherwise. - **/ - ,isMobile: function () - { - if (this.isMobileCached === null) - { - var regExp = /(Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone)/i; - this.isMobileCached = navigator.userAgent.match (regExp); - } - - return this.isMobileCached; - } - - ,get: function (id) - { - return document.getElementById (id); - } -}; +Vn.includeJs ('js/misc/main.js'); +Vn.includeLib ('vn', +[ + 'browser' + ,'date' + ,'value' + ,'error' + ,'url' + ,'mutators' + ,'object' + ,'param' + ,'hash-listener' + ,'hash' + ,'hash-param' + ,'node' + ,'builder' + ,'http-request' +]); diff --git a/web/js/vn/main.php b/web/js/vn/main.php index d8198cb3..aefcddb5 100755 --- a/web/js/vn/main.php +++ b/web/js/vn/main.php @@ -4,7 +4,7 @@ require_once ('js/misc/main.php'); use Vn\Hedera\Js; -Js::includeFile ('js/vn/main.js'); +Js::includeFile ('js/vn/vn.js'); Js::includeFile ('js/vn/locale.js'); if (strpos ($_SERVER['HTTP_USER_AGENT'], 'MSIE')) diff --git a/web/js/vn/vn.js b/web/js/vn/vn.js new file mode 100755 index 00000000..3ed107c8 --- /dev/null +++ b/web/js/vn/vn.js @@ -0,0 +1,229 @@ +/** + * The main namespace. + **/ +var Vn = +{ + Config: {} + ,jsIncludes: {} + ,cssIncludes: {} + ,xmlIncludes: {} + ,customTags: {} + ,head: document.getElementsByTagName ('head')[0] + ,isMobileCached: null + + ,_registerIncludedScripts: function () + { + var scripts = this.head.getElementsByTagName ('script'); + + var basePath = location.protocol +'//'+ location.host; + basePath += location.port ? ':'+ location.port : ''; + basePath += location.pathname; + console.log (basePath); + + for (var i = 0; i < scripts.length; i++) + { + var path = scripts[i].src.match (/^([\w\./:~-]+)[?#]?.*$/); + } + } + + /** + * Includes a new Javascript in the current document, if the script + * is already included, does nothing and calls the callback. + * + * @param {string} fileName The script file name + * @param {Function} callback The function to call when script is + * downloaded and included + **/ + ,includeJs: function (fileName, callback, skipVersion) + { + var includeData = this.jsIncludes[fileName]; + + if (includeData === undefined) + { + var src = fileName; + + if (!skipVersion) + src = src +'?'+ Vn.Cookie.get ('hedera_version'); + + var script = document.createElement ('script'); + script.type = 'text/javascript'; + script.async = false; + script.src = src; + + includeData = { + script: script + ,callbacks: [] + ,loaded: false + }; + + if (callback) + includeData.callbacks.push (callback); + + script.onload = + this._jsLoaded.bind (this, includeData, true); + script.onerror = + this._jsLoaded.bind (this, includeData, false); + script.onreadystatechange = + this._jsStateChanged.bind (this, includeData); + + this.jsIncludes[fileName] = includeData; + + this.head.appendChild (script); + } + else if (callback) + { + if (includeData.loaded) + callback (); + else + includeData.callbacks.push (callback); + } + } + + ,_jsStateChanged: function (includeData) + { + console.log ('js: '+ includeData.script.readyState); + + if (includeData.script.readyState == 'complete') + this._jsLoaded (includeData, true); + } + + ,_jsLoaded: function (includeData, success) + { + if (includeData.loaded) + return; + + for (var i = 0; i < includeData.callbacks.length; i++) + includeData.callbacks[i] (success); + + includeData.loaded = true; + includeData.callbacks = null; + } + + /** + * Includes an entire Javascript library including it's localized file. + * + * @param {string} libName The folder of the library + * @param {Array} files Array with every library file name + **/ + ,includeLib: function (libName, files) + { + Vn.Locale.loadScript ('js/'+ libName +'.js'); + + for (var i = 0; i < files.length; i++) + this.includeJs ('js/'+ libName +'/'+ files[i] +'.js'); + } + + /** + * Includes a new CSS stylesheet in the current document, if the stylesheet + * is already included, does nothing. + * + * @param {string} fileName The stylesheet file name + **/ + ,includeCss: function (fileName) + { + var cssData = this.cssIncludes[fileName]; + + if (!cssData) + { + var link = document.createElement ('link'); + link.rel = 'stylesheet'; + link.type = 'text/css'; + link.href = fileName +'?'+ Vn.Cookie.get ('hedera_version'); + this.head.appendChild (link); + + this.cssIncludes[fileName] = + { + included: true + ,link: link + }; + } + else if (!cssData.included) + { + cssData.link.disabled = false; + cssData.included = true; + } + } + + /** + * Excludes a CSS stylesheet from the current document. + * + * @param {string} fileName The stylesheet file name + **/ + ,excludeCss: function (fileName) + { + var cssData = this.cssIncludes[fileName]; + + if (cssData && cssData.included) + { + cssData.link.disabled = true; + cssData.included = false; + } + } + + /** + * Request an XML file. + * + * @param {string} path The file path + * @param {Function} callback The function to call when file is downloaded + **/ + ,loadXml: function (path, callback) + { + var includeData = this.xmlIncludes[path]; + + if (true || !includeData) + { + var request = new XMLHttpRequest (); + request.onreadystatechange = + this._onXmlReady.bind (this, request, path, callback); + request.open ('get', path +'?'+ Vn.Cookie.get ('hedera_version'), true); + request.send (); + } + else if (callback) + callback (true); + } + + ,_onXmlReady: function (request, path, callback) + { + if (request.readyState != 4) + return; + + if (request.status == 200) + this.xmlIncludes[path] = request.responseXML; + + if (callback) + callback (request.status == 200); + } + + /** + * Gets the DOM object from an included XML file. + * + * @param {string} path The file path + * @return {Object} The DOM object + **/ + ,getXml: function (path) + { + return this.xmlIncludes[path]; + } + + /** + * Checks if user is using a mobile browser. + * + * return {boolean} %true if is mobile, %false otherwise. + **/ + ,isMobile: function () + { + if (this.isMobileCached === null) + { + var regExp = /(Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone)/i; + this.isMobileCached = navigator.userAgent.match (regExp); + } + + return this.isMobileCached; + } + + ,get: function (id) + { + return document.getElementById (id); + } +}; + diff --git a/web/locale/ca/js/hedera.js b/web/locale/ca/js/hedera.js new file mode 100755 index 00000000..5dfbe023 --- /dev/null +++ b/web/locale/ca/js/hedera.js @@ -0,0 +1,49 @@ +Vn.Locale.add +({ + "User": "Usuari" + ,"Password": "Contrasenya" + ,"Beta": "Beta" + ,"NotCloseSession": "No tancar sessió" + ,"IWantToKnowMore": "Vull saber-ne més!" + ,"Enter": "Entrar" + ,"LoginMail": "clientes@verdnatura.es" + ,"LoginPhone": "+34 607 562 391" + + ,"SessionExpired": "Has estat massa temps inactiu i la sessió ha expirat." + ,"InvalidLogin": "Usuari o contrasenya incorrectes. Recorda que s'hi distingeix entre majúscula i minúscula." + + ,"Menu": "Menú" + ,"Exit": "Sortir" + ,"TestTheNewWebsite": "Prova la nova web!" + ,"ReturnToOldWebsite": "Web antiga" + ,"ChangeLog": "Canvis recents" + + ,"ErrorLoadingForm": "Error al carregar formulari" + ,"CookiesNotification": "En utilitzar aquest lloc web acceptes l'ús de cookies per a la personalització de continguts i anàlisi." + ,"NewVersionAvailable": "Hi ha una nova actualització, la pàgina recargargará automàticament per descarregar-la" + + ,"AppName": "Verdnatura" + + ,"Home": "Inici" + ,"Orders": "Encàrrecs" + ,"Basket": "Cistella" + ,"Last orders": "Últims comandes" + ,"Invoices": "Factures" + ,"Catalog": "Catàleg" + ,"About": "Coneix-nos" + ,"About us": "Quant a" + ,"Why": "Per què?" + ,"Location": "Localització" + ,"Administration": "Administració" + ,"Control panel": "Panell de control" + ,"Users": "Usuaris" + ,"Visits": "Visites" + ,"News": "Noticies" + ,"Photos": "Fotos" + ,"Contact": "Vull ser client" + ,"Training": "Formació" + ,"Agencies": "Agències" + ,"Configuration": "Configuració" + ,"Account": "Compte" + ,"Addresses": "Direccions" +}); diff --git a/web/locale/ca/js/vn.js b/web/locale/ca/js/vn.js index 801faee8..c2eaeaf7 100755 --- a/web/locale/ca/js/vn.js +++ b/web/locale/ca/js/vn.js @@ -41,47 +41,4 @@ Vn.Locale.add ,"Oct": "Oct" ,"Nov": "Nov" ,"Dec": "Des" - - ,"AppName": "Verdnatura" - ,"Beta": "Beta" - ,"User": "Usuari" - ,"Password": "Contrasenya" - ,"Remember": "Recordar" - ,"Enter": "Entrar" - ,"Exit": "Sortir" - ,"ErrorLoadingForm": "Error al carregar formulari" - ,"YoureVisitor": "Solament estàs de visita?" - ,"NewVersionAvailable": "Hi ha una nova actualització, la pàgina recargargará automàticament per descarregar-la" - ,"ChangeLog": "Canvis recents" - ,"CookiesNotification": "En utilitzar aquest lloc web acceptes l'ús de cookies per a la personalització de continguts i anàlisi." - ,"ReturnToOldWebsite": "Web antiga" - ,"TestTheNewWebsite": "Prova la nova web!" - - ,"Menu": "Menú" - - ,"Home": "Inici" - ,"Orders": "Encàrrecs" - ,"Basket": "Cistella" - ,"Last orders": "Últims comandes" - ,"Invoices": "Factures" - ,"Catalog": "Catàleg" - ,"About": "Coneix-nos" - ,"About us": "Quant a" - ,"Why": "Per què?" - ,"Location": "Localització" - ,"Administration": "Administració" - ,"Control panel": "Panell de control" - ,"Users": "Usuaris" - ,"Visits": "Visites" - ,"News": "Noticies" - ,"Photos": "Fotos" - ,"Contact": "Vull ser client" - ,"Training": "Formació" - ,"Agencies": "Agències" - ,"Configuration": "Configuració" - ,"Account": "Compte" - ,"Addresses": "Direccions" - - ,"SessionExpired": "Has estat massa temps inactiu i la sessió ha expirat." - ,"InvalidLogin": "Usuari o contrasenya incorrectes. Recorda que s'hi distingeix entre majúscula i minúscula." }); diff --git a/web/locale/es/js/hedera.js b/web/locale/es/js/hedera.js new file mode 100755 index 00000000..baa952e8 --- /dev/null +++ b/web/locale/es/js/hedera.js @@ -0,0 +1,49 @@ +Vn.Locale.add +({ + "User": "Usuario" + ,"Password": "Contraseña" + ,"Beta": "Beta" + ,"NotCloseSession": "No cerrar sesión" + ,"IWantToKnowMore": "¡Quiero saber más!" + ,"Enter": "Entrar" + ,"LoginMail": "clientes@verdnatura.es" + ,"LoginPhone": "+34 963 242 100" + + ,"SessionExpired": "Has estado demasiado tiempo inactivo y la sesión ha expirado." + ,"InvalidLogin": "Usuario o contraseña incorrectos. Recuerda que se hace distinción entre mayúsculas y minúsculas." + + ,"Menu": "Menú" + ,"Exit": "Salir" + ,"TestTheNewWebsite": "¡Prueba la nueva web!" + ,"ReturnToOldWebsite": "Web antigua" + ,"ChangeLog": "Cambios recientes" + + ,"ErrorLoadingForm": "Error al cargar formulario" + ,"CookiesNotification": "Al utilizar este sitio web aceptas el uso de cookies para la personalización de contenidos y análisis." + ,"NewVersionAvailable": "Hay una nueva actualización, la página se recargargará automaticamente para descargarla" + + ,"AppName": "Verdnatura" + + ,"Home": "Inicio" + ,"Orders": "Pedidos" + ,"Basket": "Cesta" + ,"Last orders": "Últimos pedidos" + ,"Invoices": "Facturas" + ,"Catalog": "Catálogo" + ,"About": "Conócenos" + ,"About us": "Sobre nosotros" + ,"Why": "¿Por qué?" + ,"Location": "Localización" + ,"Administration": "Administración" + ,"Control panel": "Panel de control" + ,"Users": "Usuarios" + ,"Visits": "Visitas" + ,"News": "Noticias" + ,"Photos": "Fotos" + ,"Contact": "Quiero ser cliente" + ,"Training": "Formación" + ,"Agencies": "Agencias" + ,"Configuration": "Configuración" + ,"Account": "Cuenta" + ,"Addresses": "Direcciones" +}); diff --git a/web/locale/es/js/vn.js b/web/locale/es/js/vn.js index e0a85c0b..b6c60d59 100755 --- a/web/locale/es/js/vn.js +++ b/web/locale/es/js/vn.js @@ -41,47 +41,4 @@ Vn.Locale.add ,"Oct": "Oct" ,"Nov": "Nov" ,"Dec": "Dic" - - ,"AppName": "Verdnatura" - ,"Beta": "Beta" - ,"User": "Usuario" - ,"Password": "Contraseña" - ,"Remember": "Recordar" - ,"Enter": "Entrar" - ,"Exit": "Salir" - ,"ErrorLoadingForm": "Error al cargar formulario" - ,"YoureVisitor": "¿Solo estás de visita?" - ,"NewVersionAvailable": "Hay una nueva actualización, la página se recargargará automaticamente para descargarla" - ,"ChangeLog": "Cambios recientes" - ,"CookiesNotification": "Al utilizar este sitio web aceptas el uso de cookies para la personalización de contenidos y análisis." - ,"ReturnToOldWebsite": "Web antigua" - ,"TestTheNewWebsite": "¡Prueba la nueva web!" - - ,"Menu": "Menú" - - ,"Home": "Inicio" - ,"Orders": "Pedidos" - ,"Basket": "Cesta" - ,"Last orders": "Últimos pedidos" - ,"Invoices": "Facturas" - ,"Catalog": "Catálogo" - ,"About": "Conócenos" - ,"About us": "Sobre nosotros" - ,"Why": "¿Por qué?" - ,"Location": "Localización" - ,"Administration": "Administración" - ,"Control panel": "Panel de control" - ,"Users": "Usuarios" - ,"Visits": "Visitas" - ,"News": "Noticias" - ,"Photos": "Fotos" - ,"Contact": "Quiero ser cliente" - ,"Training": "Formación" - ,"Agencies": "Agencias" - ,"Configuration": "Configuración" - ,"Account": "Cuenta" - ,"Addresses": "Direcciones" - - ,"SessionExpired": "Has estado demasiado tiempo inactivo y la sesión ha expirado." - ,"InvalidLogin": "Usuario o contraseña incorrectos. Recuerda que se hace distinción entre mayúsculas y minúsculas." }); diff --git a/web/locale/fr/js/hedera.js b/web/locale/fr/js/hedera.js new file mode 100755 index 00000000..7220fdaa --- /dev/null +++ b/web/locale/fr/js/hedera.js @@ -0,0 +1,49 @@ +Vn.Locale.add +({ + "User": "Utilisateur" + ,"Password": "Mot de passe" + ,"Beta": "Beta" + ,"NotCloseSession": "Garder ma session active" + ,"IWantToKnowMore": "En savoir plus!" + ,"Enter": "Entrer" + ,"LoginMail": "ruben@verdnatura.es" + ,"LoginPhone": "+33 781 533 900" + + ,"SessionExpired": "Il a eu le temps de trop paresseux et votre session a expiré." + ,"InvalidLogin": "Utilisateur ou mot de passe incorrect. N'oubliez pas de distinction entre majuscules et minuscules." + + ,"Menu": "Menu" + ,"Exit": "Laisser" + ,"TestTheNewWebsite": "Testez le nouveau site!" + ,"ReturnToOldWebsite": "Ancien site web" + ,"ChangeLog": "Modifications récentes" + + ,"ErrorLoadingForm": "Forme erreur de chargement" + ,"CookiesNotification": "En utilisant ce site, vous acceptez l'utilisation de cookies pour personnaliser le contenu et l'analyse." + ,"NewVersionAvailable": "Il ya une nouvelle mise à jour, la page sera automatiquement recargargará pour télécharger" + + ,"AppName": "Verdnatura" + + ,"Home": "Accueil" + ,"Orders": "Commandes" + ,"Basket": "Panier" + ,"Last orders": "Dernières commandes" + ,"Invoices": "Facturas" + ,"Catalog": "Catalogue" + ,"About": "Nous" + ,"About us": "A propos de nous" + ,"Why": "Pourquoi?" + ,"Location": "Emplacement" + ,"Administration": "Administration" + ,"Control panel": "Panneau de contrôle" + ,"Users": "Utilisateurs" + ,"Visits": "Visites" + ,"News": "Nouvelles" + ,"Photos": "Photos" + ,"Contact": "Je veux être client" + ,"Training": "Formation" + ,"Agencies": "Agences" + ,"Configuration": "Configuration" + ,"Account": "Compte" + ,"Addresses": "Adresses" +}); diff --git a/web/locale/fr/js/vn.js b/web/locale/fr/js/vn.js index aa43f38d..c3afdaa2 100755 --- a/web/locale/fr/js/vn.js +++ b/web/locale/fr/js/vn.js @@ -41,47 +41,4 @@ Vn.Locale.add ,"Oct": "Oct" ,"Nov": "Nov" ,"Dec": "Déc" - - ,"AppName": "Verdnatura" - ,"Beta": "Beta" - ,"User": "Utilisateur" - ,"Password": "Mot de passe" - ,"Remember": "Rappeler" - ,"Enter": "entrer" - ,"Exit": "Laisser" - ,"ErrorLoadingForm": "Forme erreur de chargement" - ,"YoureVisitor": "¿Solo estás de visita?" - ,"NewVersionAvailable": "Il ya une nouvelle mise à jour, la page sera automatiquement recargargará pour télécharger" - ,"ChangeLog": "Modifications récentes" - ,"CookiesNotification": "En utilisant ce site, vous acceptez l'utilisation de cookies pour personnaliser le contenu et l'analyse." - ,"ReturnToOldWebsite": "Ancien site web" - ,"TestTheNewWebsite": "Testez le nouveau site!" - - ,"Menu": "Menu" - - ,"Home": "Accueil" - ,"Orders": "Commandes" - ,"Basket": "Panier" - ,"Last orders": "Dernières commandes" - ,"Invoices": "Facturas" - ,"Catalog": "Catalogue" - ,"About": "Nous" - ,"About us": "A propos de nous" - ,"Why": "Pourquoi?" - ,"Location": "Emplacement" - ,"Administration": "Administration" - ,"Control panel": "Panneau de contrôle" - ,"Users": "Utilisateurs" - ,"Visits": "Visites" - ,"News": "Nouvelles" - ,"Photos": "Photos" - ,"Contact": "Je veux être client" - ,"Training": "Formation" - ,"Agencies": "Agences" - ,"Configuration": "Configuration" - ,"Account": "Compte" - ,"Addresses": "Adresses" - - ,"SessionExpired": "Il a eu le temps de trop paresseux et votre session a expiré." - ,"InvalidLogin": "Utilisateur ou mot de passe incorrect. N'oubliez pas de distinction entre majuscules et minuscules." }); diff --git a/web/pages/login/login.js b/web/pages/login/login.js index 42eff70a..01a96306 100755 --- a/web/pages/login/login.js +++ b/web/pages/login/login.js @@ -1,10 +1,13 @@ -window.addEventListener ('load', - function () { Vn.Login.initialize (); }); +window.addEventListener ('load', function () { + var web = new Vn.Login (); +}); -Vn.Login = -{ - initialize: function () +Vn.Login = new Class +({ + Extends: Vn.Object + + ,initialize: function () { Vn.Hash.initialize (); @@ -26,5 +29,5 @@ Vn.Login = userEntry.focus (); userEntry.select (); } -}; +}); diff --git a/web/pages/main/head.php b/web/pages/main/head.php new file mode 100755 index 00000000..5a33cec7 --- /dev/null +++ b/web/pages/main/head.php @@ -0,0 +1,13 @@ + diff --git a/web/pages/main/html.php b/web/pages/main/html.php new file mode 100755 index 00000000..e4a8a53a --- /dev/null +++ b/web/pages/main/html.php @@ -0,0 +1,15 @@ + + + + + + + + + + + + Verdnatura + + + diff --git a/web/pages/main/main.js b/web/pages/main/main.js new file mode 100755 index 00000000..dd2d4c99 --- /dev/null +++ b/web/pages/main/main.js @@ -0,0 +1,13 @@ + +Vn.includeJs ('js/misc/main.js'); +Vn.includeJs ('js/vn/locale.js'); +Vn.includeJs ('js/vn/main.js'); +Vn.includeJs ('js/sql/main.js'); +Vn.includeJs ('js/db/main.js'); +Vn.includeJs ('js/htk/main.js'); +Vn.includeJs ('js/hedera/main.js'); + +window.addEventListener ('load', function () { + var app = new Vn.App (); + app.run (); +}); diff --git a/web/pages/main/opensans.ttf b/web/pages/main/opensans.ttf new file mode 100755 index 00000000..db433349 Binary files /dev/null and b/web/pages/main/opensans.ttf differ diff --git a/web/pages/main/style.css b/web/pages/main/style.css new file mode 100755 index 00000000..fcbd6f1c --- /dev/null +++ b/web/pages/main/style.css @@ -0,0 +1,17 @@ + +@font-face +{ + font-family: 'Open Sans'; + src: url('opensans.ttf') format('truetype'); +} + +body +{ + position: absolute; + margin: 0; + height: 100%; + width: 100%; + z-index: -2; + background-color: #EEE; +} + diff --git a/web/pages/version-menu/style.css b/web/pages/version-menu/style.css index 0aa06615..6410c894 100755 --- a/web/pages/version-menu/style.css +++ b/web/pages/version-menu/style.css @@ -1,18 +1,9 @@ -/* -@media - (min-resolution: 120dpi) and (min-width: 800px), - (max-resolution: 119dpi) and (max-width: 800px) -{ - -} -*/ -@media - (min-resolution: 120dpi) and (orientation: portrait) + +@media (min-resolution: 120dpi) and (orientation: portrait) { * { font-size: 18pt; } } -@media - (min-resolution: 120dpi) and (orientation: landscape) +@media (min-resolution: 120dpi) and (orientation: landscape) { * { font-size: 10pt; } } diff --git a/web/pages/web/html.php b/web/pages/web/html.php index d702b1b4..ce1554d2 100755 --- a/web/pages/web/html.php +++ b/web/pages/web/html.php @@ -2,12 +2,14 @@ - + - - + + Verdnatura + +