1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00

Move Switchery library to npm/yarn

This commit is contained in:
Miguel Angel Mulero Martinez 2020-10-20 14:17:50 +02:00
parent 36fe5f48b8
commit 477661131c
7 changed files with 85 additions and 2069 deletions

View file

@ -1,98 +0,0 @@
/*
*
* Main stylesheet for Switchery.
* http://abpetkov.github.io/switchery/
*
*/
/* Switchery defaults. */
.switchery {
background-color: #fff;
border: 1px solid #fff;
border-radius: 20px;
cursor: pointer;
display: inline-block;
height: 14px;
position: relative;
vertical-align: middle;
width: 45px;
z-index:1000;
opacity:1 !important;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
box-sizing: content-box;
background-clip: content-box;
}
.switchery > small {
background: #fff;
border-radius: 100%;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
height: 14px;
position: absolute;
top: 0;
width: 14px;
}
.switcherymid {
background-color: #fff;
border: 1px solid #fff;
border-radius: 20px;
cursor: pointer;
display: inline-block;
height: 14px;
position: relative;
vertical-align: middle;
width: 35px;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
box-sizing: content-box;
background-clip: content-box;
}
.switcherymid > small {
background: #fff;
border-radius: 100%;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
height: 14px;
position: absolute;
top: 0;
width: 14px;
}
/* Switchery sizes. */
.switchery-small {
border: none !important;
border-radius: 20px;
height: 10px;
width: 20px;
margin-top:-3px;
margin-right:3px;
}
.switchery-small > small {
height: 10px;
width: 10px;
}
.switchery-large {
border-radius: 40px;
height: 40px;
width: 66px;
}
.switchery-large > small {
height: 40px;
width: 40px;
}

File diff suppressed because it is too large Load diff

View file

@ -66,6 +66,7 @@
"select2": "^4.0.13", "select2": "^4.0.13",
"semver-min": "^0.6.5", "semver-min": "^0.6.5",
"short-unique-id": "^1.1.1", "short-unique-id": "^1.1.1",
"switchery-latest": "^0.8.2",
"three": "~0.97.0", "three": "~0.97.0",
"universal-ga": "^1.2.0", "universal-ga": "^1.2.0",
"vue": "2.6.12", "vue": "2.6.12",

View file

@ -0,0 +1,62 @@
.switchery {
height: 14px;
width: 45px;
z-index:1000;
opacity:1 !important;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
box-sizing: content-box;
background-clip: content-box;
}
.switchery > small {
height: 14px;
width: 14px;
}
.switcherymid {
background-color: #fff;
border: 1px solid #fff;
border-radius: 20px;
cursor: pointer;
display: inline-block;
height: 14px;
position: relative;
vertical-align: middle;
width: 35px;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
box-sizing: content-box;
background-clip: content-box;
}
.switcherymid > small {
background: #fff;
border-radius: 100%;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
height: 14px;
position: absolute;
top: 0;
width: 14px;
}
/* Switchery sizes. */
.switchery-small {
border: none !important;
height: 10px;
width: 20px;
margin-top:-3px;
margin-right:3px;
}
.switchery-small > small {
height: 10px;
width: 10px;
}

View file

@ -292,11 +292,11 @@ GuiControl.prototype.switchery = function() {
const COLOR_SWITCHERY_SECOND = 'var(--switcherysecond)'; const COLOR_SWITCHERY_SECOND = 'var(--switcherysecond)';
$('.togglesmall').each(function(index, elem) { $('.togglesmall').each(function(index, elem) {
const switchery = new Switchery(elem, { const switchery = new Switchery(elem, {
size: 'small', size: 'small',
color: COLOR_ACCENT, color: COLOR_ACCENT,
secondaryColor: COLOR_SWITCHERY_SECOND, secondaryColor: COLOR_SWITCHERY_SECOND,
}); });
$(elem).on("change", function () { $(elem).on("change", function () {
switchery.setPosition(); switchery.setPosition();
}); });
@ -304,10 +304,10 @@ GuiControl.prototype.switchery = function() {
}); });
$('.toggle').each(function(index, elem) { $('.toggle').each(function(index, elem) {
const switchery = new Switchery(elem, { const switchery = new Switchery(elem, {
color: COLOR_ACCENT, color: COLOR_ACCENT,
secondaryColor: COLOR_SWITCHERY_SECOND, secondaryColor: COLOR_SWITCHERY_SECOND,
}); });
$(elem).on("change", function () { $(elem).on("change", function () {
switchery.setPosition(); switchery.setPosition();
}); });
@ -315,11 +315,11 @@ GuiControl.prototype.switchery = function() {
}); });
$('.togglemedium').each(function(index, elem) { $('.togglemedium').each(function(index, elem) {
const switchery = new Switchery(elem, { const switchery = new Switchery(elem, {
className: 'switcherymid', className: 'switcherymid',
color: COLOR_ACCENT, color: COLOR_ACCENT,
secondaryColor: COLOR_SWITCHERY_SECOND, secondaryColor: COLOR_SWITCHERY_SECOND,
}); });
$(elem).on("change", function () { $(elem).on("change", function () {
switchery.setPosition(); switchery.setPosition();
}); });

View file

@ -36,7 +36,8 @@
<link type="text/css" rel="stylesheet" href="./css/tabs/options.css" media="all"/> <link type="text/css" rel="stylesheet" href="./css/tabs/options.css" media="all"/>
<link type="text/css" rel="stylesheet" href="./css/opensans_webfontkit/fonts.css" media="all"/> <link type="text/css" rel="stylesheet" href="./css/opensans_webfontkit/fonts.css" media="all"/>
<link type="text/css" rel="stylesheet" href="./css/dropdown-lists/css/style_lists.css" media="all"/> <link type="text/css" rel="stylesheet" href="./css/dropdown-lists/css/style_lists.css" media="all"/>
<link type="text/css" rel="stylesheet" href="./js/libraries/switchery/switchery.css" media="all"/> <link type="text/css" rel="stylesheet" href="./node_modules/switchery-latest/dist/switchery.min.css" media="all"/>
<link type="text/css" rel="stylesheet" href="./css/switchery_custom.css" media="all"/>
<link type="text/css" rel="stylesheet" href="./node_modules/@fortawesome/fontawesome-free/css/all.css" media="all"/> <link type="text/css" rel="stylesheet" href="./node_modules/@fortawesome/fontawesome-free/css/all.css" media="all"/>
<link type="text/css" rel="stylesheet" href="./components/MotorOutputReordering/Styles.css" media="all"/> <link type="text/css" rel="stylesheet" href="./components/MotorOutputReordering/Styles.css" media="all"/>
<link type="text/css" rel="stylesheet" href="./css/select2_custom.css" media="all"/> <link type="text/css" rel="stylesheet" href="./css/select2_custom.css" media="all"/>
@ -66,7 +67,7 @@
<script type="text/javascript" src="./node_modules/three/examples/js/renderers/Projector.js"></script> <script type="text/javascript" src="./node_modules/three/examples/js/renderers/Projector.js"></script>
<script type="text/javascript" src="./js/libraries/jquery.flightindicators.js"></script> <script type="text/javascript" src="./js/libraries/jquery.flightindicators.js"></script>
<script type="text/javascript" src="./node_modules/semver-min/umd/index.js"></script> <script type="text/javascript" src="./node_modules/semver-min/umd/index.js"></script>
<script type="text/javascript" src="./js/libraries/switchery/switchery.js"></script> <script type="text/javascript" src="./node_modules/switchery-latest/dist/switchery.min.js"></script>
<script type="text/javascript" src="./node_modules/bluebird/js/browser/bluebird.min.js"></script> <script type="text/javascript" src="./node_modules/bluebird/js/browser/bluebird.min.js"></script>
<script type="text/javascript" src="./js/libraries/jquery.ba-throttle-debounce.min.js"></script> <script type="text/javascript" src="./js/libraries/jquery.ba-throttle-debounce.min.js"></script>
<script type="text/javascript" src="./node_modules/inflection/inflection.min.js"></script> <script type="text/javascript" src="./node_modules/inflection/inflection.min.js"></script>

View file

@ -6886,6 +6886,11 @@ sver-compat@^1.5.0:
es6-iterator "^2.0.1" es6-iterator "^2.0.1"
es6-symbol "^3.1.1" es6-symbol "^3.1.1"
switchery-latest@^0.8.2:
version "0.8.2"
resolved "https://registry.yarnpkg.com/switchery-latest/-/switchery-latest-0.8.2.tgz#a3c2530597114b8120590714c7ea5efbd025b0fc"
integrity sha512-Dams2HXv3yz2KrIcVEly0Ry6oYV+g3r+ygNNFmSLVPM1lPOFZydv0Us9+bX5F3DUzSvdF1rCszcW6EvOaGCCBw==
tar-fs@^1.13.0, tar-fs@^1.8.1: tar-fs@^1.13.0, tar-fs@^1.8.1:
version "1.16.3" version "1.16.3"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509" resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509"