mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-12-27 00:59:00 +01:00
[refactor] use node to handle vendor modules
This commit is contained in:
parent
22a7fecc5f
commit
ed652080d9
@ -16,7 +16,8 @@ const htmlmin = require('gulp-htmlmin');
|
||||
|
||||
const folder = {
|
||||
src: 'src',
|
||||
dest: 'dest/web'
|
||||
dest: 'dest/web',
|
||||
nodeModules: 'node_modules',
|
||||
}
|
||||
|
||||
const filename = {
|
||||
@ -58,7 +59,8 @@ function css() {
|
||||
|
||||
function js() {
|
||||
return src([
|
||||
folder.src + '/js/vendor/*.js',
|
||||
folder.nodeModules + '/html5sortable/dist/html5sortable.min.js',
|
||||
folder.nodeModules + '/invert-color/lib/invert.min.js',
|
||||
folder.src + '/js/helper.js',
|
||||
folder.src + '/js/data.js',
|
||||
folder.src + '/js/fontawesome.js',
|
||||
|
11
package-lock.json
generated
11
package-lock.json
generated
@ -4954,6 +4954,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"html5sortable": {
|
||||
"version": "0.9.16",
|
||||
"resolved": "https://registry.npmjs.org/html5sortable/-/html5sortable-0.9.16.tgz",
|
||||
"integrity": "sha512-GjCFl7w+Z6bQNs6lU5fhPqLoC5aRbFbQtL9rgqGR3Fs0GCRCrGjoRusZkhWaQpMr4eN25BlkviYA2nH+hFnDoA==",
|
||||
"dev": true
|
||||
},
|
||||
"htmlparser2": {
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
|
||||
@ -5215,6 +5221,11 @@
|
||||
"integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==",
|
||||
"dev": true
|
||||
},
|
||||
"invert-color": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/invert-color/-/invert-color-2.0.0.tgz",
|
||||
"integrity": "sha512-9s6IATlhOAr0/0MPUpLdMpk81ixIu8IqwPwORssXBauFT/4ff/iyEOcojd0UYuPwkDbJvL1+blIZGhqVIaAm5Q=="
|
||||
},
|
||||
"invert-kv": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
|
||||
|
@ -40,6 +40,8 @@
|
||||
"gulp-replace": "^1.0.0",
|
||||
"gulp-uglify": "^3.0.2",
|
||||
"gulp-htmlmin": "^5.0.1",
|
||||
"web-ext": "^3.1.1"
|
||||
"web-ext": "^3.1.1",
|
||||
"html5sortable": "^0.9.16",
|
||||
"invert-color": "^2.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -1179,8 +1179,8 @@
|
||||
|
||||
<!-- js-block -->
|
||||
<!-- vendor -->
|
||||
<script src="js/vendor/html5sortable.min.js"></script>
|
||||
<script src="js/vendor/invert.min.js"></script>
|
||||
<script src="../node_modules/html5sortable/dist/html5sortable.min.js"></script>
|
||||
<script src="../node_modules/invert-color/lib/invert.min.js"></script>
|
||||
<!-- nightTab -->
|
||||
<script src="js/helper.js"></script>
|
||||
<script src="js/data.js"></script>
|
||||
|
2
src/js/vendor/html5sortable.min.js
vendored
2
src/js/vendor/html5sortable.min.js
vendored
File diff suppressed because one or more lines are too long
2
src/js/vendor/invert.min.js
vendored
2
src/js/vendor/invert.min.js
vendored
@ -1,2 +0,0 @@
|
||||
/*! @license https://github.com/onury/invert-color */
|
||||
!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):r.invert=n()}(this,function(){"use strict";var t=Math.sqrt(1.05*.05)-.05,n=/^(?:[0-9a-f]{3}){1,2}$/i,i={black:"#000000",white:"#ffffff",threshold:t};function o(r){if("#"===r.slice(0,1)&&(r=r.slice(1)),!n.test(r))throw new Error('Invalid HEX color: "'+r+'"');return 3===r.length&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)]}function f(r){if(!r)throw new Error("Invalid color value");return Array.isArray(r)?r:"string"==typeof r?o(r):[r.r,r.g,r.b]}function u(r,n,t){var e=!0===n?i:Object.assign({},i,n);return function(r){var n,t,e=[];for(n=0;n<r.length;n++)t=r[n]/255,e[n]=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4);return.2126*e[0]+.7152*e[1]+.0722*e[2]}(r)>e.threshold?t?o(e.black):e.black:t?o(e.white):e.white}function r(r,n){return void 0===n&&(n=!1),r=f(r),n?u(r,n):"#"+r.map(function(r){return n=(255-r).toString(16),void 0===t&&(t=2),(new Array(t).join("0")+n).slice(-t);var n,t}).join("")}return function(r){function n(r,n){r=f(r);var t,e=n?u(r,n,!0):r.map(function(r){return 255-r});return{r:(t=e)[0],g:t[1],b:t[2]}}r.asRGB=n,r.asRgbArray=function(r,n){return r=f(r),n?u(r,n,!0):r.map(function(r){return 255-r})},r.defaultThreshold=t,r.asRgbObject=n}(r||(r={})),r});
|
Loading…
Reference in New Issue
Block a user