From ec54e33d81e0c89ffc6c08c656eba15a7d91d768 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Sun, 27 Sep 2020 11:11:31 +0200 Subject: [PATCH 1/4] NEW: Introducing new modal boxes in TakePOS --- htdocs/takepos/css/pos.css.php | 73 ++++++++++++++++++++++++++++++++++ htdocs/takepos/index.php | 55 +++++++++++++++---------- 2 files changed, 106 insertions(+), 22 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 4666de59a8e..e320142ff35 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -669,3 +669,76 @@ div#moreinfo, div#infowarehouse { padding-right: 4px; } } + +/* Modal box */ +.modal { + display: none; /* Hidden by default */ + position: fixed; + z-index: 1; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgb(0,0,0); + background-color: rgba(0,0,0,0.4); +} + +/* The Close Button */ +.close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close:hover, +.close:focus { + color: black; + text-decoration: none; + cursor: pointer; +} + +.modal-header { + padding: 2px 16px; + background-color: #2b4161; + color: white; +} + +.modal-body {padding: 2px 16px;} + +.modal-footer { + padding: 2px 16px; + background-color: #2b4161; + color: white; +} + +.modal-content { + position: relative; + background-color: #fefefe; + margin: 15% auto; /* 15% from the top and centered */ + padding: 0; + border: 1px solid #888; + width: 40%; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); + animation-name: animatetop; + animation-duration: 0.4s +} + +@keyframes animatetop { + from {top: -300px; opacity: 0} + to {top: 0; opacity: 1} +} + +.block { + display: block; + width: 100%; + border: none; + color: white; + background-color: #8c907e; + padding: 14px 28px; + font-size: 16px; + cursor: pointer; + text-align: center; + margin: 2px; +} \ No newline at end of file diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 73b039d97e9..04c0fbecac5 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -728,27 +728,12 @@ function CashReport(rowid) // Popup to select the terminal to use function TerminalsDialog() { - jQuery("#dialog-info").dialog({ - resizable: false, - height: global->TAKEPOS_NUM_TERMINALS / 3 * 20); ?>, - width: dol_optimize_smallscreen ? 316 : 400); ?>, - modal: true, - buttons: { - 'trans("Terminal")) ?> 1': function() { - location.href='index.php?setterminal=1'; - } - global->TAKEPOS_NUM_TERMINALS; $i++) - { - print ", - '".dol_escape_js($langs->trans("Terminal"))." ".$i."': function() { - location.href='index.php?setterminal=".$i."'; - } - "; - } - ?> - } - }); + var modal = document.getElementById("ModalTerminal"); + var span = document.getElementsByClassName("close")[0]; + span.onclick = function() { + modal.style.display = "none"; + } + modal.style.display = "block"; } function DirectPayment(){ @@ -774,6 +759,8 @@ function WeighingScale(){ }); } + + $( document ).ready(function() { PrintCategories(0); LoadProducts(0); @@ -802,7 +789,6 @@ $( document ).ready(function() { '.$langs->trans('TerminalSelect').''; $keyCodeForEnter = $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} > 0 ? $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} : ''; ?>
@@ -853,6 +839,31 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { } ?> + + + + +
From 494348356a4eee3f32616bd639fd9bbac4ebaed5 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 27 Sep 2020 11:35:07 +0200 Subject: [PATCH 2/4] Fix travis --- htdocs/takepos/index.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 04c0fbecac5..6444a51f3ec 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -759,8 +759,6 @@ function WeighingScale(){ }); } - - $( document ).ready(function() { PrintCategories(0); LoadProducts(0); @@ -849,10 +847,10 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {