From 1a2e0895a43bf87e36dacba53674797418dc4b5f Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 5 Dec 2016 13:39:29 +0100 Subject: [PATCH] Errores solucionados: posicion toast, mas... --- debian/changelog | 2 +- debian/install | 2 +- debian/links | 3 ++- env.php | 3 +-- hedera-web.php | 5 +--- js/htk/popup.js | 9 +++----- js/htk/style.css | 37 ++++++++++++++++-------------- js/htk/toast.js | 43 +++++++++++++++++++++++------------ rest/core/change-password.php | 2 +- rest/edi/lib/method.php | 2 +- rest/edi/load.php | 2 +- rest/tpv/confirm-mail.php | 4 ++-- webpack.config.js | 2 +- 13 files changed, 64 insertions(+), 52 deletions(-) diff --git a/debian/changelog b/debian/changelog index ce8d9119..6e70df87 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.388-deb8) stable; urgency=low +hedera-web (1.389-deb8) stable; urgency=low * Initial Release. diff --git a/debian/install b/debian/install index c1967ddc..ddaaaa78 100644 --- a/debian/install +++ b/debian/install @@ -1,7 +1,7 @@ conf/* etc/hedera-web web usr/share/php/vn doc/* usr/share/doc/hedera-web -hedera-web.php usr/bin +hedera-web.php usr/share/hedera-web forms usr/share/hedera-web image usr/share/hedera-web js usr/share/hedera-web diff --git a/debian/links b/debian/links index 97b506b0..3da38843 100644 --- a/debian/links +++ b/debian/links @@ -1 +1,2 @@ -etc/hedera-web/apache.conf etc/apache2/conf-available/hedera-web.conf +etc/hedera-web/apache.conf etc/apache2/conf-available/hedera-web.conf +usr/share/hedera-web/hedera-web.php usr/bin \ No newline at end of file diff --git a/env.php b/env.php index 812cf90e..3ddf9c0a 100644 --- a/env.php +++ b/env.php @@ -6,10 +6,9 @@ set_include_path (__DIR__.PATH_SEPARATOR.get_include_path ()); $vnAutoloadMap['vn/web'] = __DIR__.'/web'; -const _ENABLE_DEBUG = FALSE; +const _ENABLE_DEBUG = TRUE; const _DEV_MODE = TRUE; const _CONFIG_DIR = __DIR__.'/../../.config'; const _LOG_DIR = '/tmp'; const _DATA_DIR = '/tmp'; -const _HEDERA_DIR = __DIR__; diff --git a/hedera-web.php b/hedera-web.php index 746e9f26..90d013e9 100755 --- a/hedera-web.php +++ b/hedera-web.php @@ -4,9 +4,6 @@ @include_once __DIR__.'/env.php'; require_once 'vn-autoload.php'; -if (!defined ('_HEDERA_DIR')) - define ('_HEDERA_DIR', '/usr/share/hedera-web'); - -$cliApp = new Vn\Lib\CliApp ('hedera-web', _HEDERA_DIR.'/rest'); +$cliApp = new Vn\Lib\CliApp ('hedera-web', __DIR__.'/rest'); $cliApp->run (); diff --git a/js/htk/popup.js b/js/htk/popup.js index 66393a93..a81ea1e0 100644 --- a/js/htk/popup.js +++ b/js/htk/popup.js @@ -153,8 +153,8 @@ module.exports = new Class var dblMargin = margin * 2; var width = node.offsetWidth; var height = node.offsetHeight; - var innerWidth = Vn.Browser.getInnerWidth (); - var innerHeight = Vn.Browser.getInnerHeight (); + var innerWidth = window.innerWidth; + var innerHeight = window.innerHeight; if (width + dblMargin > innerWidth) { @@ -169,9 +169,6 @@ module.exports = new Class if (this.isModal ()) { - style.top = '50%'; - style.left = '50%'; - style.marginLeft = (-node.offsetWidth / 2) +'px'; style.marginTop = (-node.offsetHeight / 2) +'px'; } @@ -183,7 +180,7 @@ module.exports = new Class var top = rect.top + spacing + this._parent.offsetHeight; if (left + width > innerWidth) - left -= (left + width) - Vn.Browser.getInnerWidth () + margin; + left -= (left + width) - window.innerWidth + margin; if (top + height > innerHeight) top -= height + this._parent.offsetHeight + spacing * 2; diff --git a/js/htk/style.css b/js/htk/style.css index c0d54000..62231a33 100644 --- a/js/htk/style.css +++ b/js/htk/style.css @@ -428,21 +428,6 @@ td.cell-image .htk-image /* Popup */ -.htk-popup -{ - z-index: 200; - display: block; - position: fixed; - overflow: hidden; - background-color: white; - border-radius: 0.15em; - box-shadow: 0 0 0.4em rgba(1, 1, 1, 0.6); - box-sizing: content-box; -} -.htk-popup > * -{ - border-radius: 0.1em; -} .htk-background { position: fixed; @@ -455,9 +440,27 @@ td.cell-image .htk-image opacity: 0; transition: opacity 200ms ease-in-out; } -.htk-background > .htk-popup +.htk-popup { + z-index: 200; + display: block; + position: fixed; + overflow: hidden; + background-color: white; + border-radius: 0.15em; + box-shadow: 0 0 0.4em rgba(1, 1, 1, 0.6); + box-sizing: content-box; +} +.htk-popup.modal +{ + position: absolute; font-size: 1.2em; + top: 50%; + left: 50%; +} +.htk-popup > * +{ + border-radius: 0.1em; } /* Dialog */ @@ -465,7 +468,7 @@ td.cell-image .htk-image .htk-dialog { padding: 1.5em; - max-width: 25em; + max-width: 20em; font-weight: normal; color: #555; } diff --git a/js/htk/toast.js b/js/htk/toast.js index 5585cdf0..ac3f46f9 100644 --- a/js/htk/toast.js +++ b/js/htk/toast.js @@ -12,7 +12,7 @@ module.exports = /** * Shows a normal toast message. * - * @param String message The message text + * @param {String} message The message text **/ ,showMessage: function (message) { @@ -22,7 +22,7 @@ module.exports = /** * Shows a warning toast message. * - * @param String message The message text + * @param {String} message The message text **/ ,showWarning: function (message) { @@ -32,7 +32,7 @@ module.exports = /** * Shows an error toast message. * - * @param String message The message text + * @param {String} message The message text **/ ,showError: function (message) { @@ -42,11 +42,34 @@ module.exports = ,pushTop: function (top) { this._topHeap.push (top); + this._refreshPosition (); } ,popTop: function () { - return this._topHeap.pop (); + var top = this._topHeap.pop (); + this._refreshPosition (); + return top; + } + + ,_refreshPosition: function () + { + if (!this._container) + return; + + var left; + var heapLen = this._topHeap.length; + + if (heapLen > 0) + { + var top = this._topHeap[heapLen - 1]; + var rect = top.getBoundingClientRect (); + left = (rect.left + parseInt (rect.width / 2) - window.pageXOffset) +'px'; + } + else + left = ''; + + this._container.style.left = left; } /** @@ -83,16 +106,8 @@ module.exports = this._timeouts = []; this._container = container; } - - var heapLen = this._topHeap.length; - - if (heapLen > 0) - { - var top = this._topHeap[heapLen - 1]; - var rect = top.getBoundingClientRect (); - var left = rect.left + parseInt (rect.width / 2) - window.pageXOffset; - this._container.style.left = left +'px'; - } + + this._refreshPosition (); } ,_showText: function (message, className) diff --git a/rest/core/change-password.php b/rest/core/change-password.php index 1d3d1d63..5b53adfc 100755 --- a/rest/core/change-password.php +++ b/rest/core/change-password.php @@ -16,7 +16,7 @@ class ChangePassword extends Vn\Web\JsonRequest $db->query ('CALL account.userChangePassword (#, #)', [$oldPassword, $newPassword]); - Account::sync ($db, $_SESSION['user'], $newPassword, Account::PASS); + Account::sync ($db, $_SESSION['user'], $newPassword, Account::PASS | Account::USER); return TRUE; } } diff --git a/rest/edi/lib/method.php b/rest/edi/lib/method.php index 3b0bc63c..f208bc17 100644 --- a/rest/edi/lib/method.php +++ b/rest/edi/lib/method.php @@ -17,7 +17,7 @@ abstract class Method extends \Vn\Lib\Method $imapConf = $db->getRow ( 'SELECT host, user, pass, success_folder, error_folder FROM imap_config'); - $this->mailbox = sprintf ('{%s/imap/ssl/novalidate-cert}INBOX', + $this->mailbox = sprintf ('{%s/imap/ssl/novalidate-cert}', $imapConf['host']); $imap = imap_open ($this->mailbox diff --git a/rest/edi/load.php b/rest/edi/load.php index 686f6a96..dc23912c 100644 --- a/rest/edi/load.php +++ b/rest/edi/load.php @@ -193,7 +193,7 @@ class Load extends Edi\Method // Moves the mail to another folder - $folder = sprintf ('INBOX.%s', $folder); + $folder = sprintf ('%s', $folder); if (!imap_mail_move ($imap, $msg, $folder)) error_log ('Can\'t move message to %s: %s' diff --git a/rest/tpv/confirm-mail.php b/rest/tpv/confirm-mail.php index 29cb215e..be71416c 100644 --- a/rest/tpv/confirm-mail.php +++ b/rest/tpv/confirm-mail.php @@ -15,7 +15,7 @@ class ConfirmMail extends Vn\Lib\Method FROM tpv_imap_config' ); - $mailbox = sprintf ('{%s/imap/ssl/novalidate-cert}INBOX', + $mailbox = sprintf ('{%s/imap/ssl/novalidate-cert}', $imapConf['host']); $imap = imap_open ($mailbox @@ -65,7 +65,7 @@ class ConfirmMail extends Vn\Lib\Method else $folder = $imapConf['error_folder']; - if (!imap_mail_move ($imap, $msg, "INBOX.$folder")) + if (!imap_mail_move ($imap, $msg, "$folder")) trigger_error (imap_last_error (), E_USER_WARNING); $count++; diff --git a/webpack.config.js b/webpack.config.js index 95467fd3..a6168619 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,7 +4,7 @@ var path = require ('path'); var devMode = process.env.NODE_ENV !== 'production'; -config = { +var config = { entry: ['./app.js'], output: { path: path.join (__dirname, 'build'),