forked from Elaina69/Elaina-V4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
75 lines (66 loc) · 2.68 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* @name ISAK V1
* @author Elaina Da Catto/ISAK.M
* @description ISAK theme 1st Generation for Pengu Loader
* @link https://github.com/ISAKEM
*/
let eConsole = "%c ISAK V1 "
let eCss = "color: #ffffff; background-color: #f77fbe"
console.log(eConsole+'%c By %cElaina Da Catto/Modified by ISAK.M',eCss,"", "color: #e4c2b3")
export function getPluginsName() {
let scriptPath = getScriptPath()
let regex = /\/([^/]+)\/index\.js$/
let match = scriptPath.match(regex)
let pluginsname = match ? match[1]:null
return pluginsname
}
export * from "./data/ImportSettings.js"
import "./data/Data.js"
import "./data/built-in_plugins/Custom-Status"
import "./data/built-in_plugins/Old-LL-Settings"
import "./data/ChangeFilters.js"
import "./data/homepage.js"
import "./data/loadCss.js"
import "./data/_utils.js"
import "./data/built-in_plugins/KeyCombines.js"
import "./data/configs/Custom-Status.txt?raw"
import "./data/Manual-Update.js"
import axios from "https://cdn.skypack.dev/axios"
window.setInterval(async ()=> {
let originWallpaperList = await PluginFS.ls("./data/assets/Backgrounds/Wallpapers")
let originAudioList = await PluginFS.ls("./data/assets/Backgrounds/Audio")
let originFontList = await PluginFS.ls("./data/assets/Fonts/Custom")
let originRegaliaBannersList = await PluginFS.ls("./data/assets/Icon/Regalia-Banners")
const Wallpaperregex = /\.(mp4|webm|mkv|mov|avi|wmv)$/
const Audioregex = /\.(mp3|flac|ogg|wav|aac)$/
const Fontregex = /\.(ttf|otf)$/
const RegaliaBannersregex = /\.(png|jpg)$/
const WallpaperList = originWallpaperList.filter((file) => Wallpaperregex.test(file))
const AudioList = originAudioList.filter((file) => Audioregex.test(file))
const FontList = originFontList.filter((file) => Fontregex.test(file))
const RegaliaBannersList = originRegaliaBannersList.filter((file) => RegaliaBannersregex.test(file))
DataStore.set("Wallpaper-list", WallpaperList)
DataStore.set("Audio-list", AudioList)
DataStore.set("Font-list", FontList)
DataStore.set("RegaliaBanners-list", RegaliaBannersList)
},1000)
if (DataStore.get("Dev-mode")) {
let res = await fetch(`//plugins/Server-Data/index.js`)
if (res.status == 200) {
(await (() => import(`//plugins/Server-Data/index.js`))()).default
}
else {
console.warn(`Failed to load ISAK V1 data`)
Toast.error("Failed to load ISAK V1 data")
}
}
else {
let res = await fetch("https://unpkg.com/elainav3-isakmfork-data@latest/index.js")
if (res.status == 200) {
(await (() => import("https://unpkg.com/elainav3-isakmfork-data@latest/index.js"))()).default
}
else {
console.warn(`Failed to load ISAK V1 data`)
Toast.error("Failed to load ISAK V1 data")
}
}