diff --git a/gulpfile.js b/gulpfile.js index dbbba2fc8..ebbe5df5e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -12,14 +12,7 @@ sass.compiler = require("dart-sass"); let eslintConfig = { parser: "babel-eslint", - globals: [ - "jQuery", - "$", - "firebase", - "moment", - "html2canvas", - "ClipboardItem", - ], + globals: ["firebase", "ClipboardItem"], envs: ["es6", "browser", "node"], rules: { "constructor-super": "error", diff --git a/package-lock.json b/package-lock.json index 120440f6b..e8b5a1df9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1777,6 +1777,11 @@ } } }, + "base64-arraybuffer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.2.0.tgz", + "integrity": "sha512-7emyCsu1/xiBXgQZrscw/8KPRT44I4Yq9Pe6EGs3aPRTsWuggML1/1DTuZUuIaJPIm1FTDUVXl4x/yW8s0kQDQ==" + }, "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -2658,6 +2663,14 @@ "randomfill": "^1.0.3" } }, + "css-line-break": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-1.1.1.tgz", + "integrity": "sha512-1feNVaM4Fyzdj4mKPIQNL2n70MmuYzAXZ1aytlROFX1JsOo070OsugwGjj7nl6jnDJWHDM8zRZswkmeYVWZJQA==", + "requires": { + "base64-arraybuffer": "^0.2.0" + } + }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -4793,6 +4806,14 @@ "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, + "html2canvas": { + "version": "1.0.0-rc.7", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.0.0-rc.7.tgz", + "integrity": "sha512-yvPNZGejB2KOyKleZspjK/NruXVQuowu8NnV2HYG7gW7ytzl+umffbtUI62v2dCHQLDdsK6HIDtyJZ0W3neerA==", + "requires": { + "css-line-break": "1.1.1" + } + }, "htmlescape": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", @@ -5408,6 +5429,29 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, + "jquery": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", + "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==" + }, + "jquery-color": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jquery-color/-/jquery-color-2.2.0.tgz", + "integrity": "sha512-4VoxsLMw860EQGNT/TmP3Lbr7/1OCQlBPS4ILj7bxRApJrPQfpqzdIOTY8Ll9nGY7UHtWqDuzR7cUcS1lcWjVw==" + }, + "jquery-easing": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jquery-easing/-/jquery-easing-0.0.1.tgz", + "integrity": "sha1-s8N1JbVXNNwe4a0JtsM3MYdodxU=", + "requires": { + "jquery": "*" + } + }, + "jquery.cookie": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jquery.cookie/-/jquery.cookie-1.4.1.tgz", + "integrity": "sha1-1j3OIJ6raR/mMxbbCMqeR+D5OFs=" + }, "js-base64": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", diff --git a/package.json b/package.json index 35d9c14af..e78c254aa 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,6 @@ "deploy:live:functions": "npm run build && firebase deploy -P live --only functions", "deploy:live": "npm run build && firebase deploy -P live" }, - "engines": { - "node": "10" - }, "devDependencies": { "@babel/core": "^7.12.3", "@babel/plugin-transform-runtime": "^7.12.1", @@ -45,6 +42,12 @@ "@babel/runtime": "^7.12.5", "chart.js": "^2.9.4", "chartjs-plugin-annotation": "^0.5.7", - "chartjs-plugin-trendline": "^0.2.2" + "chartjs-plugin-trendline": "^0.2.2", + "html2canvas": "^1.0.0-rc.7", + "jquery": "^3.5.1", + "jquery-color": "^2.2.0", + "jquery-easing": "0.0.1", + "jquery.cookie": "^1.4.1", + "moment": "^2.29.1" } } diff --git a/src/js/global-dependencies.js b/src/js/global-dependencies.js index 38f9239aa..b5653dd6d 100644 --- a/src/js/global-dependencies.js +++ b/src/js/global-dependencies.js @@ -1,12 +1,19 @@ -//this file should be concatenated at the top of the legacy js files +// this file should be concatenated at the top of the legacy js files + +import $ from "jquery"; +import "jquery-color"; +import "jquery-easing"; +import "jquery.cookie"; import Chart from "chart.js"; import chartTrendline from "chartjs-plugin-trendline"; import chartAnnotation from "chartjs-plugin-annotation"; - Chart.plugins.register(chartTrendline); Chart.plugins.register(chartAnnotation); +import moment from "moment"; +import html2canvas from "html2canvas"; + import { db_getSnapshot, db_setSnapshot, diff --git a/src/js/script.js b/src/js/script.js index 960c812d5..f626c7c34 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -4821,6 +4821,7 @@ if (firebase.app().options.projectId === "monkey-type-dev-67af4") { if (window.location.hostname === "localhost") { window.onerror = function (error) { Misc.showNotification(error, 3000); + }; $("#top .logo .top").text("localhost"); $("head title").text($("head title").text() + " (localhost)"); diff --git a/static/index.html b/static/index.html index 285bf37ea..3b05ebc53 100644 --- a/static/index.html +++ b/static/index.html @@ -947,7 +947,9 @@
-