Skip to content

Commit

Permalink
feat(vuejs): remove old compatibility scripts for JQuery and obsolete…
Browse files Browse the repository at this point in the history
…s files
  • Loading branch information
hbollon committed Jul 18, 2021
1 parent 6f42449 commit 33e6eb1
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 966 deletions.
898 changes: 0 additions & 898 deletions resources/static/vue-igopher/public/css/iziToast.min.css

This file was deleted.

10 changes: 1 addition & 9 deletions resources/static/vue-igopher/public/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="">
<html lang="en">

<head>
<meta charset="utf-8">
Expand All @@ -21,14 +21,6 @@
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript
enabled. Please enable it to continue.</strong>
</noscript>
<script>
if (typeof module === 'object') {
window.module = module;
module = undefined;
}
</script>
<script src="js/bs-init.js"></script>
<script src="js/fixScriptElectron.js"></script>

<div id="app"></div>
<!-- built files will be auto injected -->
Expand Down
8 changes: 0 additions & 8 deletions resources/static/vue-igopher/public/js/bs-init.js

This file was deleted.

7 changes: 0 additions & 7 deletions resources/static/vue-igopher/public/js/chart.min.js

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions resources/static/vue-igopher/public/js/iziToast.min.js

This file was deleted.

70 changes: 35 additions & 35 deletions resources/static/vue-igopher/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Astor } from './plugins/astilectron';
import { Astor } from "./plugins/astilectron";
export const iziToast: any = require("izitoast"); // eslint-disable-line
export const bootstrap: any = require("@/bootstrap/js/bootstrap.min.js"); // eslint-disable-line
export const SUCCESS = "Success";
Expand All @@ -7,48 +7,48 @@ export var igopherConfig: any; // eslint-disable-line

// iziToast configuration for notification system
iziToast.settings({
position: 'topRight',
timeout: 8000,
closeOnClick: true,
resetOnHover: false,
transitionIn: 'flipInX',
transitionOut: 'flipOutX',
position: "topRight",
timeout: 8000,
closeOnClick: true,
resetOnHover: false,
transitionIn: "flipInX",
transitionOut: "flipOutX",
});

// Parse JSON Array to JSON Object
export function serialize(data: any) {
const obj: any = {};
for (const [key, value] of data) {
if (obj[key] !== undefined) {
if (!Array.isArray(obj[key])) {
obj[key] = [obj[key]];
}
obj[key].push(value);
} else {
obj[key] = value;
}
const obj: any = {};
for (const [key, value] of data) {
if (obj[key] !== undefined) {
if (!Array.isArray(obj[key])) {
obj[key] = [obj[key]];
}
obj[key].push(value);
} else {
obj[key] = value;
}
return obj;
}
return obj;
}

// Wait for the DOM to be fully loaded
export const ready = (callback: any) => {
if (document.readyState != "loading") callback();
else document.addEventListener("DOMContentLoaded", callback);
}
if (document.readyState != "loading") callback();
else document.addEventListener("DOMContentLoaded", callback);
};

export function getIgopherConfig(astor: Astor, callback: () => void) {
// Get actual IGopher configuration to fill inputs
astor.trigger("getConfig", {}, function(message: any) {
if (message.status === SUCCESS) {
igopherConfig = JSON.parse(message.msg);
console.log("getIgopherConfig: ", igopherConfig);
callback();
} else {
console.log(message.msg)
iziToast.error({
message: message.msg,
});
}
});
}
// Get actual IGopher configuration to fill inputs
astor.trigger("getConfig", {}, function(message: any) {
if (message.status === SUCCESS) {
igopherConfig = JSON.parse(message.msg);
console.log("getIgopherConfig: ", igopherConfig);
callback();
} else {
console.log(message.msg);
iziToast.error({
message: message.msg,
});
}
});
}
1 change: 0 additions & 1 deletion resources/static/vue-igopher/src/views/DmAutomation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { Astor } from "@/plugins/astilectron";
DmAutomationPanel,
},
mounted() {
console.log("dmautomation")
const astor: Astor = inject('astor');
config.ready(() => {
Expand Down
1 change: 0 additions & 1 deletion resources/static/vue-igopher/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { Astor } from "@/plugins/astilectron";
SettingsPanel,
},
mounted() {
console.log("settings")
const astor: Astor = inject('astor');
config.ready(() => {
Expand Down

0 comments on commit 33e6eb1

Please sign in to comment.