euscanwww: Adding PoC switches for feed settings
Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
143
euscanwww/htdocs/css/toggle_buttons.css
Normal file
143
euscanwww/htdocs/css/toggle_buttons.css
Normal file
@ -0,0 +1,143 @@
|
||||
/* line 7, ../sass/screen.scss */
|
||||
.toggle-button {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
background: #0088CC;
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #0088cc), color-stop(100%, #0055cc));
|
||||
background-image: -webkit-linear-gradient(top, #0088cc, #0055cc);
|
||||
background-image: -moz-linear-gradient(top, #0088cc, #0055cc);
|
||||
background-image: -o-linear-gradient(top, #0088cc, #0055cc);
|
||||
background-image: linear-gradient(top, #0088cc, #0055cc);
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
-ms-border-radius: 4px;
|
||||
-o-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
position: relative;
|
||||
bottom: -2px;
|
||||
text-align: left;
|
||||
min-height: 25px;
|
||||
max-height: 25px;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
/* line 29, ../sass/screen.scss */
|
||||
.toggle-button:before, .toggle-button:after {
|
||||
line-height: 25px;
|
||||
font-weight: bold;
|
||||
letter-spacing: .4px;
|
||||
}
|
||||
/* line 35, ../sass/screen.scss */
|
||||
.toggle-button:before {
|
||||
color: #fefefe;
|
||||
padding-left: 0%;
|
||||
margin-left: 10px;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
|
||||
content: attr(data-enabled);
|
||||
}
|
||||
/* line 43, ../sass/screen.scss */
|
||||
.toggle-button.disabled {
|
||||
background: #fefefe;
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fefefe), color-stop(100%, #e6e6e6));
|
||||
background-image: -webkit-linear-gradient(top, #fefefe, #e6e6e6);
|
||||
background-image: -moz-linear-gradient(top, #fefefe, #e6e6e6);
|
||||
background-image: -o-linear-gradient(top, #fefefe, #e6e6e6);
|
||||
background-image: linear-gradient(top, #fefefe, #e6e6e6);
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
/* line 47, ../sass/screen.scss */
|
||||
.toggle-button.disabled:before {
|
||||
color: #555555;
|
||||
padding-left: 50%;
|
||||
margin-left: 10px;
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
|
||||
content: attr(data-disabled);
|
||||
}
|
||||
/* line 54, ../sass/screen.scss */
|
||||
.toggle-button.disabled label {
|
||||
margin-left: -1px;
|
||||
left: 0%;
|
||||
}
|
||||
/* line 60, ../sass/screen.scss */
|
||||
.toggle-button label {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
width: 50%;
|
||||
height: 25px;
|
||||
background: #fefefe;
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fefefe), color-stop(100%, #e6e6e6));
|
||||
background-image: -webkit-linear-gradient(top, #fefefe, #e6e6e6);
|
||||
background-image: -moz-linear-gradient(top, #fefefe, #e6e6e6);
|
||||
background-image: -o-linear-gradient(top, #fefefe, #e6e6e6);
|
||||
background-image: linear-gradient(top, #fefefe, #e6e6e6);
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
-ms-border-radius: 4px;
|
||||
-o-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
top: -1px;
|
||||
margin-left: 0;
|
||||
left: 50%;
|
||||
}
|
||||
/* line 75, ../sass/screen.scss */
|
||||
.toggle-button input[type=checkbox] {
|
||||
display: none;
|
||||
}
|
||||
/* line 84, ../sass/screen.scss */
|
||||
.toggle-button.primary:before, .toggle-button.info:before, .toggle-button.success:before, .toggle-button.warning:before, .toggle-button.danger:before {
|
||||
color: white;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
/* line 90, ../sass/screen.scss */
|
||||
.toggle-button.primary {
|
||||
background: #0088cc;
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #0088cc), color-stop(100%, #0055cc));
|
||||
background-image: -webkit-linear-gradient(top, #0088cc, #0055cc);
|
||||
background-image: -moz-linear-gradient(top, #0088cc, #0055cc);
|
||||
background-image: -o-linear-gradient(top, #0088cc, #0055cc);
|
||||
background-image: linear-gradient(top, #0088cc, #0055cc);
|
||||
}
|
||||
/* line 94, ../sass/screen.scss */
|
||||
.toggle-button.info {
|
||||
background: #5bc0de;
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5bc0de), color-stop(100%, #2f96b4));
|
||||
background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
|
||||
background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
|
||||
background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
|
||||
background-image: linear-gradient(top, #5bc0de, #2f96b4);
|
||||
}
|
||||
/* line 99, ../sass/screen.scss */
|
||||
.toggle-button.success {
|
||||
background: #62c462;
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #62c462), color-stop(100%, #51a351));
|
||||
background-image: -webkit-linear-gradient(top, #62c462, #51a351);
|
||||
background-image: -moz-linear-gradient(top, #62c462, #51a351);
|
||||
background-image: -o-linear-gradient(top, #62c462, #51a351);
|
||||
background-image: linear-gradient(top, #62c462, #51a351);
|
||||
}
|
||||
/* line 104, ../sass/screen.scss */
|
||||
.toggle-button.warning {
|
||||
background: #dbb450;
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #dbb450), color-stop(100%, #f89406));
|
||||
background-image: -webkit-linear-gradient(top, #dbb450, #f89406);
|
||||
background-image: -moz-linear-gradient(top, #dbb450, #f89406);
|
||||
background-image: -o-linear-gradient(top, #dbb450, #f89406);
|
||||
background-image: linear-gradient(top, #dbb450, #f89406);
|
||||
}
|
||||
/* line 109, ../sass/screen.scss */
|
||||
.toggle-button.danger {
|
||||
background: #ee5f5b;
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ee5f5b), color-stop(100%, #bd362f));
|
||||
background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
|
||||
background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
|
||||
background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
|
||||
background-image: linear-gradient(top, #ee5f5b, #bd362f);
|
||||
}
|
20
euscanwww/htdocs/js/jquery.js
vendored
20
euscanwww/htdocs/js/jquery.js
vendored
File diff suppressed because one or more lines are too long
105
euscanwww/htdocs/js/jquery.toggle.buttons.js
Normal file
105
euscanwww/htdocs/js/jquery.toggle.buttons.js
Normal file
@ -0,0 +1,105 @@
|
||||
!function ($) {
|
||||
"use strict";
|
||||
// version: 1.3
|
||||
|
||||
$.fn.toggleButtons = function (opt) {
|
||||
var $element
|
||||
, $labelEnabled
|
||||
, options
|
||||
, active
|
||||
, styleActive
|
||||
, styleDisabled
|
||||
, animationCss
|
||||
, transitionSpeed = 0.05
|
||||
, defaultSpeed = 0.05;
|
||||
|
||||
this.each(function () {
|
||||
$element = $(this);
|
||||
|
||||
options = $.extend({}, $.fn.toggleButtons.defaults, opt);
|
||||
|
||||
$element.addClass('toggle-button');
|
||||
|
||||
$labelEnabled = $('<label></label>').attr('for', $element.find('input').attr('id'));
|
||||
$element.append($labelEnabled);
|
||||
|
||||
if (options.animated) {
|
||||
$element.addClass('toggle-button-animated');
|
||||
|
||||
if (options.transitionSpeed !== undefined)
|
||||
if (/^(\d*%$)/.test(options.transitionSpeed)) // is a percent value?
|
||||
transitionSpeed = defaultSpeed * parseInt(options.transitionSpeed) / 100;
|
||||
else
|
||||
transitionSpeed = options.transitionSpeed;
|
||||
|
||||
animationCss = ["-webkit-", "-moz-", "-o-", ""];
|
||||
$(animationCss).each(function () {
|
||||
$element.find('label').css(this + 'transition', 'all ' + transitionSpeed + 's');
|
||||
});
|
||||
}
|
||||
|
||||
$element.css('width', options.width);
|
||||
|
||||
$element.attr("data-enabled", options.label.enabled === undefined ? "ON" : options.label.enabled);
|
||||
$element.attr("data-disabled", options.label.disabled === undefined ? "OFF " : options.label.disabled);
|
||||
|
||||
active = $element.find('input').is(':checked');
|
||||
|
||||
if (!active)
|
||||
$element.addClass('disabled');
|
||||
|
||||
styleActive = options.style.enabled === undefined ? "" : options.style.enabled;
|
||||
styleDisabled = options.style.disabled === undefined ? "" : options.style.disabled;
|
||||
|
||||
if (active && styleActive !== undefined)
|
||||
$element.addClass(styleActive);
|
||||
if (!active && styleDisabled !== undefined)
|
||||
$element.addClass(styleDisabled);
|
||||
|
||||
$element.on('click', function (e) {
|
||||
if ($(e.target).is('input'))
|
||||
return true;
|
||||
|
||||
e.stopPropagation();
|
||||
$(this).find('label').click();
|
||||
});
|
||||
|
||||
|
||||
$element.find('label').on('click', function (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
$element = $(this).parent();
|
||||
|
||||
$element
|
||||
.delay(transitionSpeed * 500).queue(function () {
|
||||
$(this).toggleClass('disabled')
|
||||
.toggleClass(styleActive)
|
||||
.toggleClass(styleDisabled)
|
||||
.dequeue();
|
||||
});
|
||||
|
||||
active = !($element.find('input').is(':checked'));
|
||||
|
||||
$element.find('input').attr('checked', active);
|
||||
options.onChange($element, active, e);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.toggleButtons.defaults = {
|
||||
onChange: function () {
|
||||
},
|
||||
width: 100,
|
||||
animated: true,
|
||||
transitionSpeed: undefined,
|
||||
label: {
|
||||
enabled: undefined,
|
||||
disabled: undefined
|
||||
},
|
||||
style: {
|
||||
enabled: undefined,
|
||||
disabled: undefined
|
||||
}
|
||||
};
|
||||
}($);
|
Reference in New Issue
Block a user