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
|
* http://www.bootstrap-switch.org
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
* Copyright 2012-2013 Mattia Larentis
|
* Copyright 2012-2013 Mattia Larentis
|
||||||
@ -19,7 +19,7 @@
|
|||||||
* ========================================================================
|
* ========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.has-switch {
|
.bootstrap-switch {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@ -32,96 +32,105 @@
|
|||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-ms-user-select: none;
|
-ms-user-select: none;
|
||||||
-o-user-select: none;
|
|
||||||
user-select: none;
|
user-select: none;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
-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;
|
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||||
}
|
}
|
||||||
.has-switch:focus {
|
.bootstrap-switch.bootstrap-switch-mini {
|
||||||
border-color: #66afe9;
|
min-width: 71px;
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
.has-switch.switch-mini {
|
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
|
||||||
min-width: 72px;
|
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
|
||||||
}
|
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
|
||||||
.has-switch.switch-mini span,
|
|
||||||
.has-switch.switch-mini label {
|
|
||||||
padding-bottom: 4px;
|
padding-bottom: 4px;
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
line-height: 9px;
|
line-height: 9px;
|
||||||
}
|
}
|
||||||
.has-switch.switch-mini i.switch-mini-icons {
|
.bootstrap-switch.bootstrap-switch-small {
|
||||||
height: 1.20em;
|
min-width: 79px;
|
||||||
line-height: 9px;
|
|
||||||
vertical-align: text-top;
|
|
||||||
text-align: center;
|
|
||||||
transform: scale(0.6);
|
|
||||||
margin-top: -1px;
|
|
||||||
margin-bottom: -1px;
|
|
||||||
}
|
}
|
||||||
.has-switch.switch-small {
|
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
|
||||||
min-width: 80px;
|
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
|
||||||
}
|
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
|
||||||
.has-switch.switch-small span,
|
|
||||||
.has-switch.switch-small label {
|
|
||||||
padding-bottom: 3px;
|
padding-bottom: 3px;
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
}
|
}
|
||||||
.has-switch.switch-large {
|
.bootstrap-switch.bootstrap-switch-large {
|
||||||
min-width: 120px;
|
min-width: 120px;
|
||||||
}
|
}
|
||||||
.has-switch.switch-large span,
|
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
|
||||||
.has-switch.switch-large label {
|
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
|
||||||
|
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
|
||||||
padding-bottom: 9px;
|
padding-bottom: 9px;
|
||||||
padding-top: 9px;
|
padding-top: 9px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
.has-switch.switch-animate > div {
|
.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
|
||||||
-webkit-transition: left 0.5s;
|
-webkit-transition: margin-left 0.5s;
|
||||||
transition: left 0.5s;
|
transition: margin-left 0.5s;
|
||||||
}
|
}
|
||||||
.has-switch.switch-off > div {
|
.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-container {
|
||||||
left: -50%;
|
margin-left: 0%;
|
||||||
}
|
}
|
||||||
.has-switch.switch-on > div {
|
.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label {
|
||||||
left: 0%;
|
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;
|
opacity: 0.5;
|
||||||
filter: alpha(opacity=50);
|
filter: alpha(opacity=50);
|
||||||
cursor: default !important;
|
cursor: default !important;
|
||||||
}
|
}
|
||||||
.has-switch.disabled span,
|
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
|
||||||
.has-switch.disabled label {
|
.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;
|
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;
|
display: inline-block;
|
||||||
width: 150%;
|
width: 150%;
|
||||||
position: relative;
|
|
||||||
top: 0;
|
top: 0;
|
||||||
|
border-radius: 4px;
|
||||||
-webkit-transform: translate3d(0, 0, 0);
|
-webkit-transform: translate3d(0, 0, 0);
|
||||||
transform: translate3d(0, 0, 0);
|
transform: translate3d(0, 0, 0);
|
||||||
}
|
}
|
||||||
.has-switch input[type=radio],
|
.bootstrap-switch .bootstrap-switch-handle-on,
|
||||||
.has-switch input[type=checkbox] {
|
.bootstrap-switch .bootstrap-switch-handle-off,
|
||||||
display: none;
|
.bootstrap-switch .bootstrap-switch-label {
|
||||||
}
|
|
||||||
.has-switch span,
|
|
||||||
.has-switch label {
|
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
|
||||||
display: inline-block !important;
|
display: inline-block !important;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-bottom: 4px;
|
padding-bottom: 4px;
|
||||||
@ -129,56 +138,65 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 20px;
|
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;
|
text-align: center;
|
||||||
margin-top: -1px;
|
margin-top: -1px;
|
||||||
margin-bottom: -1px;
|
margin-bottom: -1px;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
width: 33.333333333%;
|
width: 33.333333333%;
|
||||||
|
color: #333333;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
}
|
}
|
||||||
.has-switch label i {
|
.bootstrap-switch input[type='radio'],
|
||||||
color: #000;
|
.bootstrap-switch input[type='checkbox'] {
|
||||||
text-shadow: 0 1px 0 #fff;
|
position: absolute !important;
|
||||||
line-height: 18px;
|
top: 0;
|
||||||
pointer-events: none;
|
left: 0;
|
||||||
}
|
opacity: 0;
|
||||||
.has-switch span {
|
filter: alpha(opacity=0);
|
||||||
text-align: center;
|
z-index: -1;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
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
|
options.fn this
|
||||||
else
|
else
|
||||||
options.inverse this
|
options.inverse this
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
# Counters.
|
# Counters.
|
||||||
@ -72,11 +73,19 @@ Handlebars.registerHelper "set_counter", (id, value, options) ->
|
|||||||
|
|
||||||
Handlebars.registerHelper "get_counter", (id, options) ->
|
Handlebars.registerHelper "get_counter", (id, options) ->
|
||||||
options.data["_counter_" + id]
|
options.data["_counter_" + id]
|
||||||
|
return
|
||||||
|
|
||||||
Handlebars.registerHelper "inc_counter", (id, options) ->
|
Handlebars.registerHelper "inc_counter", (id, options) ->
|
||||||
options.data["_counter_" + id] += 1
|
options.data["_counter_" + id] += 1
|
||||||
return
|
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
|
# For inserting "inline" javascript scripts, due to the fact that we cannot
|
||||||
# Insert "<script>...</script>" inside inline elements (they are already scripts)
|
# 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.setLinksEvents()
|
||||||
gui.tools.applyCustoms "#form_config"
|
gui.tools.applyCustoms "#form_config"
|
||||||
$("#form_config .form-control").each (i, element) ->
|
for element in $("#form_config .config-ctrl")
|
||||||
$(element).attr "data-val", $(element).val()
|
$element = $(element)
|
||||||
return
|
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
|
# Add handlers to buttons
|
||||||
@ -24,14 +25,15 @@ gui.configuration.link = ->
|
|||||||
|
|
||||||
$("#form_config .button-save").on "click", (event) ->
|
$("#form_config .button-save").on "click", (event) ->
|
||||||
cfg = {}
|
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)
|
$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")
|
section = $element.attr("data-section")
|
||||||
key = $element.attr("data-key")
|
key = $element.attr("data-key")
|
||||||
cfg[section] = {} if not cfg[section]?
|
cfg[section] = {} if not cfg[section]?
|
||||||
cfg[section][key] = value: $element.val()
|
cfg[section][key] = value: val
|
||||||
return
|
|
||||||
|
|
||||||
gui.doLog cfg
|
gui.doLog cfg
|
||||||
unless $.isEmptyObject(cfg)
|
unless $.isEmptyObject(cfg)
|
||||||
@ -40,6 +42,10 @@ gui.configuration.link = ->
|
|||||||
gui.notify gettext("Configuration saved"), "success"
|
gui.notify gettext("Configuration saved"), "success"
|
||||||
return
|
return
|
||||||
), gui.failRequestModalFnc
|
), gui.failRequestModalFnc
|
||||||
|
else
|
||||||
|
gui.showDashboard()
|
||||||
|
gui.notify gettext("No changes has been made"), "success"
|
||||||
|
return
|
||||||
return
|
return
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -70,12 +70,17 @@
|
|||||||
$(selector + " .selectpicker").selectpicker()
|
$(selector + " .selectpicker").selectpicker()
|
||||||
|
|
||||||
# Activate Touchspinner
|
# 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
|
min: -99999
|
||||||
max: 99999
|
max: 99999
|
||||||
decimals: 0
|
decimals: 0
|
||||||
|
|
||||||
$(selector + " input[type=numeric]:not([readonly])").attr("type", "text")
|
|
||||||
|
|
||||||
# TEST: cooler on mobile devices
|
# TEST: cooler on mobile devices
|
||||||
$(selector + " .selectpicker").selectpicker "mobile" if /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)
|
$(selector + " .selectpicker").selectpicker "mobile" if /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
# Public attributes
|
# Public attributes
|
||||||
gui.debug = off
|
gui.debug = on
|
||||||
|
|
||||||
# "public" methods
|
# "public" methods
|
||||||
gui.doLog = (args...)->
|
gui.doLog = (args...)->
|
||||||
if gui.debug
|
if gui.debug
|
||||||
try
|
try
|
||||||
console.log.apply window, args
|
console.log args
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,37 +1,13 @@
|
|||||||
/*jshint undef: true, unused:true */
|
/*
|
||||||
/*global jQuery: true */
|
* Bootstrap TouchSpin - v3.0.1
|
||||||
|
|
||||||
/*!=========================================================================
|
|
||||||
* Bootstrap TouchSpin
|
|
||||||
* v2.8.0
|
|
||||||
*
|
|
||||||
* A mobile and touch friendly input spinner component for Bootstrap 3.
|
* A mobile and touch friendly input spinner component for Bootstrap 3.
|
||||||
*
|
|
||||||
* https://github.com/istvan-meszaros/bootstrap-touchspin
|
|
||||||
* http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
* http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||||
*
|
*
|
||||||
* Copyright 2013 István Ujj-Mészáros
|
* Made by István Ujj-Mészáros
|
||||||
*
|
* Under Apache License v2.0 License
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* ====================================================================== */
|
|
||||||
|
|
||||||
(function($) {
|
(function($) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
var _currentSpinnerId = 0;
|
var _currentSpinnerId = 0;
|
||||||
|
|
||||||
@ -72,6 +48,9 @@
|
|||||||
stepinterval: 100,
|
stepinterval: 100,
|
||||||
forcestepdivisibility: 'round', // none | floor | round | ceil
|
forcestepdivisibility: 'round', // none | floor | round | ceil
|
||||||
stepintervaldelay: 500,
|
stepintervaldelay: 500,
|
||||||
|
verticalbuttons: false,
|
||||||
|
verticalupclass: 'glyphicon glyphicon-chevron-up',
|
||||||
|
verticaldownclass: 'glyphicon glyphicon-chevron-down',
|
||||||
prefix: '',
|
prefix: '',
|
||||||
postfix: '',
|
postfix: '',
|
||||||
prefix_extraclass: '',
|
prefix_extraclass: '',
|
||||||
@ -91,6 +70,9 @@
|
|||||||
step: 'step',
|
step: 'step',
|
||||||
decimals: 'decimals',
|
decimals: 'decimals',
|
||||||
stepinterval: 'step-interval',
|
stepinterval: 'step-interval',
|
||||||
|
verticalbuttons: 'vertical-buttons',
|
||||||
|
verticalupclass: 'vertical-up-class',
|
||||||
|
verticaldownclass: 'vertical-down-class',
|
||||||
forcestepdivisibility: 'force-step-divisibility',
|
forcestepdivisibility: 'force-step-divisibility',
|
||||||
stepintervaldelay: 'step-interval-delay',
|
stepintervaldelay: 'step-interval-delay',
|
||||||
prefix: 'prefix',
|
prefix: 'prefix',
|
||||||
@ -241,7 +223,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _buildInputGroup() {
|
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);
|
container = $(html).insertBefore(originalinput);
|
||||||
|
|
||||||
@ -266,11 +255,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _hideEmptyPrefixPostfix() {
|
function _hideEmptyPrefixPostfix() {
|
||||||
if (settings.prefix == '') {
|
if (settings.prefix === '') {
|
||||||
elements.prefix.hide();
|
elements.prefix.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.postfix == '') {
|
if (settings.postfix === '') {
|
||||||
elements.postfix.hide();
|
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();
|
downOnce();
|
||||||
startDownSpin();
|
startDownSpin();
|
||||||
|
|
||||||
@ -358,7 +353,41 @@
|
|||||||
ev.stopPropagation();
|
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();
|
upOnce();
|
||||||
startUpSpin();
|
startUpSpin();
|
||||||
|
|
||||||
@ -420,8 +449,11 @@
|
|||||||
stopSpin();
|
stopSpin();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (settings.mousewheel) {
|
|
||||||
originalinput.on('mousewheel DOMMouseScroll', function(ev) {
|
originalinput.on('mousewheel DOMMouseScroll', function(ev) {
|
||||||
|
if (!settings.mousewheel || !originalinput.is(':focus')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var delta = ev.originalEvent.wheelDelta || -ev.originalEvent.deltaY || -ev.originalEvent.detail;
|
var delta = ev.originalEvent.wheelDelta || -ev.originalEvent.deltaY || -ev.originalEvent.detail;
|
||||||
|
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
@ -435,7 +467,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function _bindEventsInterface() {
|
function _bindEventsInterface() {
|
||||||
originalinput.on('touchspin.uponce', function() {
|
originalinput.on('touchspin.uponce', function() {
|
||||||
@ -529,7 +560,7 @@
|
|||||||
if (settings.maxboostedstep) {
|
if (settings.maxboostedstep) {
|
||||||
if (boosted > settings.maxboostedstep) {
|
if (boosted > settings.maxboostedstep) {
|
||||||
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/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-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/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/bootstrap-select.min.css" rel="stylesheet" media="screen">
|
||||||
|
|
||||||
<link href="{% get_static_prefix %}adm/css/jquery.dataTables.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/jquery.cookie.js"></script>
|
||||||
<script src="{% get_static_prefix %}adm/js/bootstrap.min.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-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/bootstrap-select.min.js"></script>
|
||||||
<script src="{% get_static_prefix %}adm/js/jquery.validate.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">
|
<div class="tab-content col-md-12 col-md-offset-0 col-lg-8 col-lg-offset-2">
|
||||||
{{# eachKey config }}
|
{{# eachKey config }}
|
||||||
<div class="tab-pane {{# if first }}active{{/ if }}" id="section_{{ key }}">
|
<div class="tab-pane {{# if first }}active{{/ if }}" id="section_{{ key }}">
|
||||||
|
{{ set_var "cfg_section" key }}
|
||||||
{{# eachKeySorted value }}
|
{{# eachKeySorted value }}
|
||||||
|
{{ set_var "cfg_key" key }}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="fld_{{ clean_whitespace ../key }}{{ key }}" class="col-sm-5 control-label">{{ key }}</label>
|
<label for="fld_{{ clean_whitespace ../key }}{{ key }}" class="col-sm-5 control-label">{{ key }}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
{{# if value.crypt }}
|
{{# if value.crypt }}
|
||||||
<div class="input-group">
|
<div>
|
||||||
<input type="password" class="form-control" data-section="{{ ../../key }}" data-key="{{ ../key }}" id="fld_{{ clean_whitespace ../../key }}{{ clean_whitespace ../key }}" value="€fa{}#42123~#||23|ßðđæ">
|
<input type="password" class="form-control config-ctrl" data-section="{{ cfg_section }}" data-key="{{ cfg_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>
|
</div>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{# ifequals value.type 1 }}
|
{{# 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 }}
|
{{ else }}
|
||||||
{{# ifequals value.type 3 }}
|
{{# 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 }}
|
{{ else }}
|
||||||
<div class="input-group">
|
{{# ifequals value.type 2 }}
|
||||||
<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 }}">
|
<div>
|
||||||
<span class="input-group-btn">
|
<input type="numeric" class="form-control config-ctrl" data-section="{{ ../../../../../key }}" data-key="{{ key }}" value="{{ value.value }}">
|
||||||
<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>
|
|
||||||
</div>
|
</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 }}
|
||||||
{{/ ifequals }}
|
{{/ ifequals }}
|
||||||
{{/ if }}
|
{{/ if }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{ unset_var "cfg_key" }}
|
||||||
{{/ eachKeySorted }}
|
{{/ eachKeySorted }}
|
||||||
</div>
|
</div>
|
||||||
|
{{ unset_var "cfg_section" }}
|
||||||
{{/ eachKey }}
|
{{/ eachKey }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user