diff --git a/modules/core/templates/loginuserpass.php b/modules/core/templates/loginuserpass.php index 61b16608836684e80f3589483fbefe20d30ea8f5..4e012eee10679684cf2f5a97e451b70bd80fd50f 100644 --- a/modules/core/templates/loginuserpass.php +++ b/modules/core/templates/loginuserpass.php @@ -159,14 +159,13 @@ if ($this->data['errorcode'] !== null) { <tr id="submit"> <td class="loginicon"></td><td></td> <td> - <button class="btn" - onclick="this.value='<?php echo $this->t('{login:processing}'); ?>'; - this.disabled=true; this.form.submit(); return true;" tabindex="6"> + <button id="submit_button" class="btn" tabindex="6"> <?php echo $this->t('{login:login_button}'); ?> </button> </td> </tr> </table> + <input type="hidden" id="processing_trans" value="<?php echo $this->t('{login:processing}'); ?>" /> <?php foreach ($this->data['stateparams'] as $name => $value) { echo('<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'); diff --git a/modules/core/templates/loginuserpass.twig b/modules/core/templates/loginuserpass.twig index 7f27bc186072f50cb616145daf0d596c4b12d79d..49fe67bf6fa4f3b6367897bcc73898f3be7c92c8 100644 --- a/modules/core/templates/loginuserpass.twig +++ b/modules/core/templates/loginuserpass.twig @@ -2,6 +2,10 @@ {% extends "@core/base.twig" %} +{% block postload %} +<script src="{{baseurlpath}}assets/js/loginuserpass.js"></script> +{% endblock %} + {% block content %} {% if errorcode -%} <div class="pure-g"> @@ -99,10 +103,10 @@ </div> <!-- form-align--> <br><br> - <button class="pure-button pure-button-red pure-input-1-2 pure-input-sm-1-1 right" type="submit" onclick="this.value='{{ 'Processing...'|trans }}';" tabindex="6"> + <button class="pure-button pure-button-red pure-input-1-2 pure-input-sm-1-1 right" id="submit_button" type="submit" tabindex="6"> {{ 'Login'|trans }} </button> - + <input type='hidden' id="processing_trans" value="{{ 'Processing...'|trans }}" /> {% for name, value in stateparams -%} <input type="hidden" name="{{ name }}" value="{{ value }}" /> {%- endfor %} diff --git a/modules/core/www/assets/js/loginuserpass.js b/modules/core/www/assets/js/loginuserpass.js new file mode 100644 index 0000000000000000000000000000000000000000..c9ade78a1ef45ebe238d73cc20aaa64e7bcbbb09 --- /dev/null +++ b/modules/core/www/assets/js/loginuserpass.js @@ -0,0 +1,14 @@ +document.addEventListener( + 'DOMContentLoaded', + function () { + var button = document.getElementById("submit_button"); + button.addEventListener( + 'click', + function () { + var translation = document.getElementById("processing_trans"); + this.disabled = true; + this.innerHTML = translation.value; + } + ); + } +); diff --git a/modules/memcacheMonitor/templates/memcachestat.tpl.php b/modules/memcacheMonitor/templates/memcachestat.tpl.php index 9a9a3399d313d69f9331ac08a7903cc42e9ed9b0..e3815c72bd5551ae0d1b7badaacf7a014e3f919e 100644 --- a/modules/memcacheMonitor/templates/memcachestat.tpl.php +++ b/modules/memcacheMonitor/templates/memcachestat.tpl.php @@ -1,42 +1,19 @@ <?php -$this->data['head'] = '<style type="text/css"> - table.statustable td, table.statustable th { - border: 1px solid #eee; - padding: 2px 6px; - } - table.statustable { - border-collapse: collapse; - } - .bmax { - border: 1px solid #555; - background: #eee; - } - .bused { - border-right: 1px solid #555; - border-bottom: 1px solid #555; - color: white; - background: #833; - } -</style> -'; - - - +$this->data['head'] = '<link href="'.$this->data['baseurlpath'].'assets/css/memcacheMonitor.css" rel="stylesheet" />'; $this->includeAtTemplateBase('includes/header.php'); $title = $this->data['title']; $table = $this->data['table']; - // Identify column headings $column_titles = array(); -foreach($table as $row_title => $row_data) { - foreach($row_data as $ct => $foo) { - if(!in_array($ct, $column_titles, true)) { - $column_titles[] = $ct; - } - } +foreach ($table as $row_title => $row_data) { + foreach ($row_data as $ct => $foo) { + if (!in_array($ct, $column_titles, true)) { + $column_titles[] = $ct; + } + } } ?> @@ -48,28 +25,28 @@ foreach($table as $row_title => $row_data) { <tr> <th></th> <?php -foreach($column_titles as $ct) { - echo '<th>' . htmlspecialchars($ct) . '</th>' . "\n"; +foreach ($column_titles as $ct) { + echo '<th>'.htmlspecialchars($ct).'</th>'."\n"; } ?> </tr> <?php -foreach($table as $row_title => $row_data) { - echo '<tr>' . "\n"; - echo '<th class="rowtitle" style="text-align: right">' . $this->t($this->data['rowtitles'][$row_title]) . '</th>' . "\n"; +foreach ($table as $row_title => $row_data) { + echo '<tr>' . "\n"; + echo '<th class="rowtitle" style="text-align: right">'.$this->t($this->data['rowtitles'][$row_title]).'</th>'."\n"; - foreach($column_titles as $ct) { - echo '<td>'; + foreach ($column_titles as $ct) { + echo '<td>'; - if(array_key_exists($ct, $row_data)) { - echo htmlspecialchars($row_data[$ct]); - } + if (array_key_exists($ct, $row_data)) { + echo htmlspecialchars($row_data[$ct]); + } - echo '</td>' . "\n"; - } + echo '</td>' . "\n"; + } - echo '</tr>' . "\n"; + echo '</tr>' . "\n"; } ?> @@ -77,15 +54,14 @@ foreach($table as $row_title => $row_data) { <?php if (array_key_exists('bytes', $this->data['statsraw']) && array_key_exists('limit_maxbytes', $this->data['statsraw'])) { - foreach($this->data['statsraw']['bytes'] as $key => $row_data) { - echo ('<h3>Storage usage on [' . $key . ']</h3>'); - $maxpix = 400; - $pix = floor($this->data['statsraw']['bytes'][$key]*$maxpix / $this->data['statsraw']['limit_maxbytes'][$key]); - - echo('<div class="bmax" style="width: ' . $maxpix. 'px"><div class="bused" style="width: ' . $pix . 'px"> - Used: ' . $table['bytes'][$key] . ' - </div>Total available: ' . $table['limit_maxbytes'][$key] . '</div>'); - } + foreach ($this->data['statsraw']['bytes'] as $key => $row_data) { + echo ('<h3>Storage usage on ['.$key.']</h3>'); + $maxpix = 400; + $pix = floor($this->data['statsraw']['bytes'][$key]*$maxpix / $this->data['statsraw']['limit_maxbytes'][$key]); + + echo '<div class="bmax" style="width: '.$maxpix.'px"><div class="bused" style="width: '.$pix.'px">Used: '. + $table['bytes'][$key].'</div>Total available: '.$table['limit_maxbytes'][$key].'</div>'; + } } $this->includeAtTemplateBase('includes/footer.php'); diff --git a/modules/memcacheMonitor/templates/memcachestat.twig b/modules/memcacheMonitor/templates/memcachestat.twig index f3d4cbd013eb655c0c9bc986f06501d7f85be7f9..fdc4af4bd03a307ad28974a4c4463185ec4ab749 100644 --- a/modules/memcacheMonitor/templates/memcachestat.twig +++ b/modules/memcacheMonitor/templates/memcachestat.twig @@ -2,7 +2,7 @@ {% extends "base.twig" %} {% block preload %} - <link href="{{ baseurlpath }}style.css" rel="stylesheet" /> + <link href="{{ baseurlpath }}assets/css/memcacheMonitor.css" rel="stylesheet" /> {% endblock %} {% block content %} diff --git a/modules/memcacheMonitor/www/style.css b/modules/memcacheMonitor/www/assets/css/memcacheMonitor.css similarity index 100% rename from modules/memcacheMonitor/www/style.css rename to modules/memcacheMonitor/www/assets/css/memcacheMonitor.css