Skip to content

Commit 3a00f1f

Browse files
committed
init set
0 parents  commit 3a00f1f

3 files changed

Lines changed: 169 additions & 0 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
node_modules
3+
package-lock.json
4+
pnpm-lock.yaml

app.request.js

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
function loadResources(sources, callback) {
2+
let loadedCount = 0;
3+
const totalSources = sources.length;
4+
5+
function loadScript(source) {
6+
const script = document.createElement('script');
7+
script.src = source;
8+
script.onload = script.onreadystatechange = function() {
9+
if (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete') {
10+
loadedCount++;
11+
if (loadedCount === totalSources && typeof callback === 'function') {
12+
callback();
13+
}
14+
script.onload = script.onreadystatechange = null;
15+
}
16+
};
17+
script.onerror = function() {
18+
console.error('Error loading script: ', source);
19+
loadedCount++;
20+
if (loadedCount === totalSources && typeof callback === 'function') {
21+
callback();
22+
}
23+
};
24+
document.body.appendChild(script);
25+
}
26+
27+
function loadCSS(source) {
28+
const link = document.createElement('link');
29+
link.rel = 'stylesheet';
30+
link.href = source;
31+
link.onload = function() {
32+
loadedCount++;
33+
if (loadedCount === totalSources && typeof callback === 'function') {
34+
callback();
35+
}
36+
};
37+
link.onerror = function() {
38+
console.error('Error loading CSS: ', source);
39+
loadedCount++;
40+
if (loadedCount === totalSources && typeof callback === 'function') {
41+
callback();
42+
}
43+
};
44+
document.head.appendChild(link);
45+
}
46+
47+
sources.forEach(source => {
48+
if (source.endsWith('.css')) {
49+
loadCSS(source);
50+
} else if (source.endsWith('.js')) {
51+
loadScript(source);
52+
} else {
53+
console.error('Unsupported file type for source: ', source);
54+
loadedCount++;
55+
if (loadedCount === totalSources && typeof callback === 'function') {
56+
callback();
57+
}
58+
}
59+
});
60+
}
61+
62+
function executeAppResponse() {
63+
try {
64+
// Assuming app.response.js is in the same directory
65+
import('./app.response.js')
66+
.then(module => {
67+
if (typeof module.default === 'function') {
68+
const result = module.default();
69+
// Assuming you have a function to handle the result
70+
handleResult(result);
71+
} else {
72+
console.error('Error: app.response is not a function');
73+
}
74+
})
75+
.catch(error => {
76+
console.error('Error loading app.response.js: ', error);
77+
});
78+
} catch (error) {
79+
console.error('Error executing app.response: ', error);
80+
}
81+
}
82+
83+
// Example usage:
84+
const sources = [
85+
/* SCRIPT section */
86+
'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js',
87+
'https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/js/bootstrap.min.js',
88+
'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.5/js/foundation.min.js',
89+
'https://semantic-ui.com/dist/semantic.min.js',
90+
'https://ajax.googleapis.com/ajax/libs/angularjs/1.6.5/angular.min.js',
91+
'https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js',
92+
'https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js',
93+
'https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js',
94+
'https://cdnjs.cloudflare.com/ajax/libs/three.js/89/three.min.js',
95+
'https://d3js.org/d3.v5.min.js',
96+
'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js',
97+
'https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js',
98+
'https://cdnjs.cloudflare.com/ajax/libs/uikit/3.16.19/js/uikit.min.js',
99+
'https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TweenMax.min.js',
100+
'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.min.js',
101+
'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.dom.min.js',
102+
'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.sound.min.js',
103+
'https://unpkg.com/rxjs/bundles/rxjs.umd.min.js',
104+
/* CSS section */
105+
'https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css',
106+
'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.5/css/foundation.min.css',
107+
'https://semantic-ui.com/dist/semantic.min.css',
108+
'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.4/css/bulma.min.css',
109+
'https://cdnjs.cloudflare.com/ajax/libs/hint.css/2.7.0/hint.min.css',
110+
'https://cdn.tailwindcss.com/3.3.1.css',
111+
'https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css',
112+
'https://cdnjs.cloudflare.com/ajax/libs/uikit/3.16.19/css/uikit.min.css',
113+
'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css',
114+
'https://use.fontawesome.com/releases/v5.8.2/css/all.css'
115+
];
116+
117+
loadResources(sources, function() {
118+
// All scripts and CSS files have been loaded, execute further actions here
119+
console.log('All resources loaded successfully.');
120+
executeAppResponse();
121+
});
122+
123+
function handleResult(result) {
124+
// Assuming you want to store the result in a multidimensional array with timestamp as index
125+
const timestamp = new Date().getTime();
126+
const indexedResult = { [timestamp]: result };
127+
console.log('Result:', indexedResult);
128+
}

package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"dependencies": {
3+
"@octokit/core": "^6.0.1",
4+
"@webextensions/live-css": "^7.0.10",
5+
"backbone": "^1.6.0",
6+
"base58": "^2.0.1",
7+
"binascii": "^0.0.2",
8+
"bip32": "^4.0.0",
9+
"bip39": "^3.1.0",
10+
"bitcoin": "^3.0.3",
11+
"bootstrap": "^5.3.3",
12+
"bower": "^1.8.14",
13+
"cjs": "^0.0.11",
14+
"crypto": "^1.0.1",
15+
"crypto-js": "^4.2.0",
16+
"dns": "^0.1.5",
17+
"ethereumjs-wallet": "^1.0.2",
18+
"express": "^4.19.2",
19+
"fs": "0.0.1-security",
20+
"grunt": "^1.6.1",
21+
"gsap": "^3.12.5",
22+
"gulp": "^3.9.1",
23+
"harp": "^0.46.1",
24+
"hashlib": "^1.0.1",
25+
"hmac": "^1.0.1",
26+
"jquery": "^3.7.1",
27+
"jsdom": "^24.0.0",
28+
"lodash": "^4.17.21",
29+
"mnemonic": "^1.0.1",
30+
"monero": "^1.0.6",
31+
"npm": "^10.5.0",
32+
"openai": "^4.29.2",
33+
"os": "^0.1.2",
34+
"readline": "^1.3.0",
35+
"sha256": "^0.2.0"
36+
}
37+
}

0 commit comments

Comments
 (0)