forked from shaba/openuds
* Fixed configuration, now it's more "friendly"
* Replaced numerics buttons with "better ones" :-)
This commit is contained in:
parent
0d6171bc0f
commit
8c09ec9b74
204
server/src/uds/static/adm/css/bootstrap-switch.css
vendored
204
server/src/uds/static/adm/css/bootstrap-switch.css
vendored
@ -1,5 +1,5 @@
|
||||
/* ========================================================================
|
||||
* bootstrap-switch - v2.0.1
|
||||
* bootstrap-switch - v3.0.1
|
||||
* http://www.bootstrap-switch.org
|
||||
* ========================================================================
|
||||
* Copyright 2012-2013 Mattia Larentis
|
||||
@ -19,7 +19,7 @@
|
||||
* ========================================================================
|
||||
*/
|
||||
|
||||
.has-switch {
|
||||
.bootstrap-switch {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
@ -32,96 +32,105 @@
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
vertical-align: middle;
|
||||
min-width: 100px;
|
||||
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||
}
|
||||
.has-switch:focus {
|
||||
border-color: #66afe9;
|
||||
outline: 0;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
|
||||
.bootstrap-switch.bootstrap-switch-mini {
|
||||
min-width: 71px;
|
||||
}
|
||||
.has-switch.switch-mini {
|
||||
min-width: 72px;
|
||||
}
|
||||
.has-switch.switch-mini span,
|
||||
.has-switch.switch-mini label {
|
||||
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
|
||||
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
|
||||
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
|
||||
padding-bottom: 4px;
|
||||
padding-top: 4px;
|
||||
font-size: 10px;
|
||||
line-height: 9px;
|
||||
}
|
||||
.has-switch.switch-mini i.switch-mini-icons {
|
||||
height: 1.20em;
|
||||
line-height: 9px;
|
||||
vertical-align: text-top;
|
||||
text-align: center;
|
||||
transform: scale(0.6);
|
||||
margin-top: -1px;
|
||||
margin-bottom: -1px;
|
||||
.bootstrap-switch.bootstrap-switch-small {
|
||||
min-width: 79px;
|
||||
}
|
||||
.has-switch.switch-small {
|
||||
min-width: 80px;
|
||||
}
|
||||
.has-switch.switch-small span,
|
||||
.has-switch.switch-small label {
|
||||
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
|
||||
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
|
||||
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
|
||||
padding-bottom: 3px;
|
||||
padding-top: 3px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
.has-switch.switch-large {
|
||||
.bootstrap-switch.bootstrap-switch-large {
|
||||
min-width: 120px;
|
||||
}
|
||||
.has-switch.switch-large span,
|
||||
.has-switch.switch-large label {
|
||||
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
|
||||
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
|
||||
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
|
||||
padding-bottom: 9px;
|
||||
padding-top: 9px;
|
||||
font-size: 16px;
|
||||
line-height: normal;
|
||||
}
|
||||
.has-switch.switch-animate > div {
|
||||
-webkit-transition: left 0.5s;
|
||||
transition: left 0.5s;
|
||||
.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
|
||||
-webkit-transition: margin-left 0.5s;
|
||||
transition: margin-left 0.5s;
|
||||
}
|
||||
.has-switch.switch-off > div {
|
||||
left: -50%;
|
||||
.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-container {
|
||||
margin-left: 0%;
|
||||
}
|
||||
.has-switch.switch-on > div {
|
||||
left: 0%;
|
||||
.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label {
|
||||
border-bottom-right-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
.has-switch.disabled {
|
||||
.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-container {
|
||||
margin-left: -50%;
|
||||
}
|
||||
.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label {
|
||||
border-bottom-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
}
|
||||
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-container {
|
||||
margin-left: -25%;
|
||||
}
|
||||
.bootstrap-switch.bootstrap-switch-disabled,
|
||||
.bootstrap-switch.bootstrap-switch-readonly,
|
||||
.bootstrap-switch.bootstrap-switch-indeterminate {
|
||||
opacity: 0.5;
|
||||
filter: alpha(opacity=50);
|
||||
cursor: default !important;
|
||||
}
|
||||
.has-switch.disabled span,
|
||||
.has-switch.disabled label {
|
||||
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
|
||||
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,
|
||||
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,
|
||||
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,
|
||||
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,
|
||||
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,
|
||||
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,
|
||||
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,
|
||||
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
|
||||
cursor: default !important;
|
||||
}
|
||||
.has-switch > div {
|
||||
.bootstrap-switch.bootstrap-switch-focused {
|
||||
border-color: #66afe9;
|
||||
outline: 0;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
|
||||
}
|
||||
.bootstrap-switch .bootstrap-switch-container {
|
||||
display: inline-block;
|
||||
width: 150%;
|
||||
position: relative;
|
||||
top: 0;
|
||||
border-radius: 4px;
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
.has-switch input[type=radio],
|
||||
.has-switch input[type=checkbox] {
|
||||
display: none;
|
||||
}
|
||||
.has-switch span,
|
||||
.has-switch label {
|
||||
.bootstrap-switch .bootstrap-switch-handle-on,
|
||||
.bootstrap-switch .bootstrap-switch-handle-off,
|
||||
.bootstrap-switch .bootstrap-switch-label {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
display: inline-block !important;
|
||||
height: 100%;
|
||||
padding-bottom: 4px;
|
||||
@ -129,56 +138,65 @@
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
.has-switch label {
|
||||
.bootstrap-switch .bootstrap-switch-handle-on,
|
||||
.bootstrap-switch .bootstrap-switch-handle-off {
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
width: 33.333333333%;
|
||||
}
|
||||
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
|
||||
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
|
||||
color: #fff;
|
||||
background: #428bca;
|
||||
}
|
||||
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
|
||||
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
|
||||
color: #fff;
|
||||
background: #5bc0de;
|
||||
}
|
||||
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
|
||||
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success {
|
||||
color: #fff;
|
||||
background: #5cb85c;
|
||||
}
|
||||
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,
|
||||
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning {
|
||||
background: #f0ad4e;
|
||||
color: #fff;
|
||||
}
|
||||
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,
|
||||
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger {
|
||||
color: #fff;
|
||||
background: #d9534f;
|
||||
}
|
||||
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,
|
||||
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
|
||||
color: #000;
|
||||
background: #eeeeee;
|
||||
}
|
||||
.bootstrap-switch .bootstrap-switch-handle-on {
|
||||
border-bottom-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
}
|
||||
.bootstrap-switch .bootstrap-switch-handle-off {
|
||||
border-bottom-right-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
.bootstrap-switch .bootstrap-switch-label {
|
||||
text-align: center;
|
||||
margin-top: -1px;
|
||||
margin-bottom: -1px;
|
||||
z-index: 100;
|
||||
width: 33.333333333%;
|
||||
color: #333333;
|
||||
background: #ffffff;
|
||||
}
|
||||
.has-switch label i {
|
||||
color: #000;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
line-height: 18px;
|
||||
pointer-events: none;
|
||||
}
|
||||
.has-switch span {
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
width: 33.333333333%;
|
||||
}
|
||||
.has-switch span.switch-left {
|
||||
color: #f00;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
}
|
||||
.has-switch span.switch-right {
|
||||
color: #000;
|
||||
background: #eeeeee;
|
||||
}
|
||||
.has-switch span.switch-primary,
|
||||
.has-switch span.switch-left {
|
||||
color: #fff;
|
||||
background: #428bca;
|
||||
}
|
||||
.has-switch span.switch-info {
|
||||
color: #fff;
|
||||
background: #5bc0de;
|
||||
}
|
||||
.has-switch span.switch-success {
|
||||
color: #fff;
|
||||
background: #5cb85c;
|
||||
}
|
||||
.has-switch span.switch-warning {
|
||||
background: #f0ad4e;
|
||||
color: #fff;
|
||||
}
|
||||
.has-switch span.switch-danger {
|
||||
color: #fff;
|
||||
background: #d9534f;
|
||||
}
|
||||
.has-switch span.switch-default {
|
||||
color: #000;
|
||||
background: #eeeeee;
|
||||
.bootstrap-switch input[type='radio'],
|
||||
.bootstrap-switch input[type='checkbox'] {
|
||||
position: absolute !important;
|
||||
top: 0;
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
filter: alpha(opacity=0);
|
||||
z-index: -1;
|
||||
}
|
||||
|
45
server/src/uds/static/adm/css/jquery.bootstrap-touchspin.css
Normal file
45
server/src/uds/static/adm/css/jquery.bootstrap-touchspin.css
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Bootstrap TouchSpin - v3.0.1
|
||||
* A mobile and touch friendly input spinner component for Bootstrap 3.
|
||||
* http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
*
|
||||
* Made by István Ujj-Mészáros
|
||||
* Under Apache License v2.0 License
|
||||
*/
|
||||
|
||||
.bootstrap-touchspin .input-group-btn-vertical {
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
width: 1%;
|
||||
vertical-align: middle;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.bootstrap-touchspin .input-group-btn-vertical > .btn {
|
||||
display: block;
|
||||
float: none;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
padding: 8px 10px;
|
||||
margin-left: -1px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-up {
|
||||
border-radius: 0;
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
|
||||
.bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-down {
|
||||
margin-top: -2px;
|
||||
border-radius: 0;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.bootstrap-touchspin .input-group-btn-vertical i {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 5px;
|
||||
font-size: 9px;
|
||||
font-weight: normal;
|
||||
}
|
@ -59,6 +59,7 @@ Handlebars.registerHelper "ifbelongs", (context1, context2, options) ->
|
||||
options.fn this
|
||||
else
|
||||
options.inverse this
|
||||
return
|
||||
|
||||
|
||||
# Counters.
|
||||
@ -72,11 +73,19 @@ Handlebars.registerHelper "set_counter", (id, value, options) ->
|
||||
|
||||
Handlebars.registerHelper "get_counter", (id, options) ->
|
||||
options.data["_counter_" + id]
|
||||
return
|
||||
|
||||
Handlebars.registerHelper "inc_counter", (id, options) ->
|
||||
options.data["_counter_" + id] += 1
|
||||
return
|
||||
|
||||
Handlebars.registerHelper "set_var", (var_name, value) ->
|
||||
Handlebars.registerHelper var_name, () -> value
|
||||
return
|
||||
|
||||
Handlebars.registerHelper "unset_var", (var_name) ->
|
||||
Handlebars.registerHelper var_name, null
|
||||
return
|
||||
|
||||
# For inserting "inline" javascript scripts, due to the fact that we cannot
|
||||
# Insert "<script>...</script>" inside inline elements (they are already scripts)
|
||||
|
File diff suppressed because one or more lines are too long
@ -10,9 +10,10 @@ gui.configuration.link = ->
|
||||
)
|
||||
gui.setLinksEvents()
|
||||
gui.tools.applyCustoms "#form_config"
|
||||
$("#form_config .form-control").each (i, element) ->
|
||||
$(element).attr "data-val", $(element).val()
|
||||
return
|
||||
for element in $("#form_config .config-ctrl")
|
||||
$element = $(element)
|
||||
val = if $element.attr('type') is 'checkbox' then (if $element.is(":checked") then "1" else "0") else $element.val()
|
||||
$element.attr "data-val", val
|
||||
|
||||
|
||||
# Add handlers to buttons
|
||||
@ -24,14 +25,15 @@ gui.configuration.link = ->
|
||||
|
||||
$("#form_config .button-save").on "click", (event) ->
|
||||
cfg = {}
|
||||
$("#form_config .form-control").each (i, element) ->
|
||||
for element, i in $("#form_config .config-ctrl")
|
||||
# $("#form_config .form-control").each (i, element) ->
|
||||
$element = $(element)
|
||||
unless $element.attr("data-val") is $element.val()
|
||||
val = if $element.attr('type') is 'checkbox' then (if $element.is(":checked") then "1" else "0") else $element.val()
|
||||
unless $element.attr("data-val") is val
|
||||
section = $element.attr("data-section")
|
||||
key = $element.attr("data-key")
|
||||
cfg[section] = {} if not cfg[section]?
|
||||
cfg[section][key] = value: $element.val()
|
||||
return
|
||||
cfg[section][key] = value: val
|
||||
|
||||
gui.doLog cfg
|
||||
unless $.isEmptyObject(cfg)
|
||||
@ -40,6 +42,10 @@ gui.configuration.link = ->
|
||||
gui.notify gettext("Configuration saved"), "success"
|
||||
return
|
||||
), gui.failRequestModalFnc
|
||||
else
|
||||
gui.showDashboard()
|
||||
gui.notify gettext("No changes has been made"), "success"
|
||||
return
|
||||
return
|
||||
|
||||
return
|
||||
|
@ -70,12 +70,17 @@
|
||||
$(selector + " .selectpicker").selectpicker()
|
||||
|
||||
# Activate Touchspinner
|
||||
$(selector + " input[type=numeric]:not([readonly])").TouchSpin
|
||||
tspn = $(selector + " input[type=numeric]:not([readonly])")
|
||||
tspn.attr("type", "text")
|
||||
tspn.TouchSpin
|
||||
verticalbuttons: true
|
||||
verticalupclass: 'glyphicon glyphicon-plus'
|
||||
verticaldownclass: 'glyphicon glyphicon-minus'
|
||||
min: -99999
|
||||
max: 99999
|
||||
decimals: 0
|
||||
|
||||
$(selector + " input[type=numeric]:not([readonly])").attr("type", "text")
|
||||
|
||||
|
||||
# TEST: cooler on mobile devices
|
||||
$(selector + " .selectpicker").selectpicker "mobile" if /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)
|
||||
|
@ -3,13 +3,13 @@
|
||||
"use strict"
|
||||
|
||||
# Public attributes
|
||||
gui.debug = off
|
||||
gui.debug = on
|
||||
|
||||
# "public" methods
|
||||
gui.doLog = (args...)->
|
||||
if gui.debug
|
||||
try
|
||||
console.log.apply window, args
|
||||
console.log args
|
||||
return
|
||||
|
||||
|
||||
|
@ -1,37 +1,13 @@
|
||||
/*jshint undef: true, unused:true */
|
||||
/*global jQuery: true */
|
||||
|
||||
/*!=========================================================================
|
||||
* Bootstrap TouchSpin
|
||||
* v2.8.0
|
||||
*
|
||||
/*
|
||||
* Bootstrap TouchSpin - v3.0.1
|
||||
* A mobile and touch friendly input spinner component for Bootstrap 3.
|
||||
* http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
*
|
||||
* https://github.com/istvan-meszaros/bootstrap-touchspin
|
||||
* http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
*
|
||||
* Copyright 2013 István Ujj-Mészáros
|
||||
*
|
||||
* Thanks for the contributors:
|
||||
* Stefan Bauer - https://github.com/sba
|
||||
* amid2887 - https://github.com/amid2887
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* ====================================================================== */
|
||||
|
||||
* Made by István Ujj-Mészáros
|
||||
* Under Apache License v2.0 License
|
||||
*/
|
||||
(function($) {
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
var _currentSpinnerId = 0;
|
||||
|
||||
@ -72,6 +48,9 @@
|
||||
stepinterval: 100,
|
||||
forcestepdivisibility: 'round', // none | floor | round | ceil
|
||||
stepintervaldelay: 500,
|
||||
verticalbuttons: false,
|
||||
verticalupclass: 'glyphicon glyphicon-chevron-up',
|
||||
verticaldownclass: 'glyphicon glyphicon-chevron-down',
|
||||
prefix: '',
|
||||
postfix: '',
|
||||
prefix_extraclass: '',
|
||||
@ -91,6 +70,9 @@
|
||||
step: 'step',
|
||||
decimals: 'decimals',
|
||||
stepinterval: 'step-interval',
|
||||
verticalbuttons: 'vertical-buttons',
|
||||
verticalupclass: 'vertical-up-class',
|
||||
verticaldownclass: 'vertical-down-class',
|
||||
forcestepdivisibility: 'force-step-divisibility',
|
||||
stepintervaldelay: 'step-interval-delay',
|
||||
prefix: 'prefix',
|
||||
@ -241,7 +223,14 @@
|
||||
}
|
||||
|
||||
function _buildInputGroup() {
|
||||
var html = '<div class="input-group bootstrap-touchspin"><span class="input-group-btn"><button class="' + settings.buttondown_class + ' bootstrap-touchspin-down" type="button">-</button></span><span class="input-group-addon bootstrap-touchspin-prefix">' + settings.prefix + '</span><span class="input-group-addon bootstrap-touchspin-postfix">' + settings.postfix + '</span><span class="input-group-btn"><button class="' + settings.buttonup_class + ' bootstrap-touchspin-up" type="button">+</button></span></div>';
|
||||
var html;
|
||||
|
||||
if (settings.verticalbuttons) {
|
||||
html = '<div class="input-group bootstrap-touchspin"><span class="input-group-addon bootstrap-touchspin-prefix">' + settings.prefix + '</span><span class="input-group-addon bootstrap-touchspin-postfix">' + settings.postfix + '</span><span class="input-group-btn-vertical"><button class="' + settings.buttondown_class + ' bootstrap-touchspin-up" type="button"><i class="' + settings.verticalupclass + '"></i></button><button class="' + settings.buttonup_class + ' bootstrap-touchspin-down" type="button"><i class="' + settings.verticaldownclass + '"></i></button></span></div>';
|
||||
}
|
||||
else {
|
||||
html = '<div class="input-group bootstrap-touchspin"><span class="input-group-btn"><button class="' + settings.buttondown_class + ' bootstrap-touchspin-down" type="button">-</button></span><span class="input-group-addon bootstrap-touchspin-prefix">' + settings.prefix + '</span><span class="input-group-addon bootstrap-touchspin-postfix">' + settings.postfix + '</span><span class="input-group-btn"><button class="' + settings.buttonup_class + ' bootstrap-touchspin-up" type="button">+</button></span></div>';
|
||||
}
|
||||
|
||||
container = $(html).insertBefore(originalinput);
|
||||
|
||||
@ -266,11 +255,11 @@
|
||||
}
|
||||
|
||||
function _hideEmptyPrefixPostfix() {
|
||||
if (settings.prefix == '') {
|
||||
if (settings.prefix === '') {
|
||||
elements.prefix.hide();
|
||||
}
|
||||
|
||||
if (settings.postfix == '') {
|
||||
if (settings.postfix === '') {
|
||||
elements.postfix.hide();
|
||||
}
|
||||
}
|
||||
@ -350,7 +339,13 @@
|
||||
}
|
||||
});
|
||||
|
||||
elements.down.on('mousedown touchstart', function(ev) {
|
||||
elements.down.on('mousedown.touchspin', function(ev) {
|
||||
elements.down.off('touchstart.touchspin'); // android 4 workaround
|
||||
|
||||
if (originalinput.is(':disabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
downOnce();
|
||||
startDownSpin();
|
||||
|
||||
@ -358,7 +353,41 @@
|
||||
ev.stopPropagation();
|
||||
});
|
||||
|
||||
elements.up.on('mousedown touchstart', function(ev) {
|
||||
elements.down.on('touchstart.touchspin', function(ev) {
|
||||
elements.down.off('mousedown.touchspin'); // android 4 workaround
|
||||
|
||||
if (originalinput.is(':disabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
downOnce();
|
||||
startDownSpin();
|
||||
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
});
|
||||
|
||||
elements.up.on('mousedown.touchspin', function(ev) {
|
||||
elements.up.off('touchstart.touchspin'); // android 4 workaround
|
||||
|
||||
if (originalinput.is(':disabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
upOnce();
|
||||
startUpSpin();
|
||||
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
});
|
||||
|
||||
elements.up.on('touchstart.touchspin', function(ev) {
|
||||
elements.up.off('mousedown.touchspin'); // android 4 workaround
|
||||
|
||||
if (originalinput.is(':disabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
upOnce();
|
||||
startUpSpin();
|
||||
|
||||
@ -420,21 +449,23 @@
|
||||
stopSpin();
|
||||
});
|
||||
|
||||
if (settings.mousewheel) {
|
||||
originalinput.on('mousewheel DOMMouseScroll', function(ev) {
|
||||
var delta = ev.originalEvent.wheelDelta || -ev.originalEvent.deltaY || -ev.originalEvent.detail;
|
||||
originalinput.on('mousewheel DOMMouseScroll', function(ev) {
|
||||
if (!settings.mousewheel || !originalinput.is(':focus')) {
|
||||
return;
|
||||
}
|
||||
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
var delta = ev.originalEvent.wheelDelta || -ev.originalEvent.deltaY || -ev.originalEvent.detail;
|
||||
|
||||
if (delta < 0) {
|
||||
downOnce();
|
||||
}
|
||||
else {
|
||||
upOnce();
|
||||
}
|
||||
});
|
||||
}
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
|
||||
if (delta < 0) {
|
||||
downOnce();
|
||||
}
|
||||
else {
|
||||
upOnce();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function _bindEventsInterface() {
|
||||
@ -529,7 +560,7 @@
|
||||
if (settings.maxboostedstep) {
|
||||
if (boosted > settings.maxboostedstep) {
|
||||
boosted = settings.maxboostedstep;
|
||||
value = Math.round((value / boosted) * boosted);
|
||||
value = Math.round((value / boosted)) * boosted;
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
<link href="{% get_static_prefix %}adm/css/font-awesome.min.css" rel="stylesheet" media="screen">
|
||||
<link href="{% get_static_prefix %}adm/css/bootstrap-formhelpers.min.css" rel="stylesheet" media="screen">
|
||||
<link href="{% get_static_prefix %}adm/css/bootstrap-switch.css" rel="stylesheet" media="screen">
|
||||
<link href="{% get_static_prefix %}adm/css/jquery.bootstrap-touchspin.css" rel="stylesheet" media="screen">
|
||||
<link href="{% get_static_prefix %}adm/css/bootstrap-select.min.css" rel="stylesheet" media="screen">
|
||||
|
||||
<link href="{% get_static_prefix %}adm/css/jquery.dataTables.css" rel="stylesheet" media="screen">
|
||||
@ -67,7 +68,7 @@
|
||||
<script src="{% get_static_prefix %}adm/js/jquery.cookie.js"></script>
|
||||
<script src="{% get_static_prefix %}adm/js/bootstrap.min.js"></script>
|
||||
<script src="{% get_static_prefix %}adm/js/bootstrap-switch.min.js"></script>
|
||||
<script src="{% get_static_prefix %}adm/js/bootstrap.touchspin.js"></script>
|
||||
<script src="{% get_static_prefix %}adm/js/jquery.bootstrap-touchspin.js"></script>
|
||||
|
||||
<script src="{% get_static_prefix %}adm/js/bootstrap-select.min.js"></script>
|
||||
<script src="{% get_static_prefix %}adm/js/jquery.validate.min.js"></script>
|
||||
|
@ -21,37 +21,41 @@
|
||||
<div class="tab-content col-md-12 col-md-offset-0 col-lg-8 col-lg-offset-2">
|
||||
{{# eachKey config }}
|
||||
<div class="tab-pane {{# if first }}active{{/ if }}" id="section_{{ key }}">
|
||||
{{ set_var "cfg_section" key }}
|
||||
{{# eachKeySorted value }}
|
||||
{{ set_var "cfg_key" key }}
|
||||
<div class="form-group">
|
||||
<label for="fld_{{ clean_whitespace ../key }}{{ key }}" class="col-sm-5 control-label">{{ key }}</label>
|
||||
<div class="col-sm-6">
|
||||
{{# if value.crypt }}
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" data-section="{{ ../../key }}" data-key="{{ ../key }}" id="fld_{{ clean_whitespace ../../key }}{{ clean_whitespace ../key }}" value="€fa{}#42123~#||23|ßðđæ">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default button-undo" type="button" data-fld="fld_{{ clean_whitespace ../../key }}{{ clean_whitespace ../key }}"><i class="fa fa-undo"></i> </button>
|
||||
</span>
|
||||
<div>
|
||||
<input type="password" class="form-control config-ctrl" data-section="{{ cfg_section }}" data-key="{{ cfg_key }}" value="€fa{}#42123~#||23|ßðđæ">
|
||||
</div>
|
||||
{{ else }}
|
||||
{{# ifequals value.type 1 }}
|
||||
<textarea class="form-control" id="fld_{{ clean_whitespace ../../../key }}{{ clean_whitespace ../../key }}" data-section="{{ ../../../key }}" data-key="{{ ../../key }}" rows="3">{{ value.value }}</textarea>
|
||||
<textarea class="form-control" data-section="{{ cfg_section }}" data-key="{{ cfg_key }}" rows="3">{{ value.value }}</textarea>
|
||||
{{ else }}
|
||||
{{# ifequals value.type 3 }}
|
||||
<input type="checkbox" data-on-label="{% endverbatim %}{% trans 'Yes' %}{% verbatim %}" data-off-label="{% endverbatim %}{% trans 'No' %}{% verbatim %}" class="form-control" id="fld_{{ clean_whitespace ../../../key }}{{ clean_whitespace ../../key }}"{{# ifequals value.value 1 }} checked{{/ ifequals }}>
|
||||
<input type="checkbox" data-on-label="{% endverbatim %}{% trans 'Yes' %}{% verbatim %}" data-off-label="{% endverbatim %}{% trans 'No' %}{% verbatim %}" class="config-ctrl" {{# ifequals value.value 1 }} checked{{/ ifequals }} data-section="{{ cfg_section }}" data-key="{{ cfg_key }}">
|
||||
{{ else }}
|
||||
<div class="input-group">
|
||||
<input type="{{# ifequals value.type 2 }}numeric{{ else }}text{{/ ifequals}}" class="form-control" id="fld_{{ clean_whitespace ../../../key }}{{ clean_whitespace ../../key }}" data-section="{{ ../../../key }}" data-key="{{ ../../key }}" value="{{ value.value }}">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-info button-undo" type="button" data-fld="fld_{{ clean_whitespace ../../../key }}{{ clean_whitespace ../../key }}"><i class="fa fa-undo"></i> </button>
|
||||
</span>
|
||||
{{# ifequals value.type 2 }}
|
||||
<div>
|
||||
<input type="numeric" class="form-control config-ctrl" data-section="{{ ../../../../../key }}" data-key="{{ key }}" value="{{ value.value }}">
|
||||
</div>
|
||||
{{ else }}
|
||||
<div>
|
||||
<input type="{{# ifequals value.type 2 }}numeric{{ else }}text{{/ ifequals}}" class="form-control config-ctrl" data-section="{{ cfg_section }}" data-key="{{ cfg_key }}" value="{{ value.value }}">
|
||||
</div>
|
||||
{{/ ifequals }}
|
||||
{{/ ifequals }}
|
||||
{{/ ifequals }}
|
||||
{{/ if }}
|
||||
</div>
|
||||
</div>
|
||||
{{ unset_var "cfg_key" }}
|
||||
{{/ eachKeySorted }}
|
||||
</div>
|
||||
{{ unset_var "cfg_section" }}
|
||||
{{/ eachKey }}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user