Skip to content

Commit 0e7e73e

Browse files
author
nova@novas optiplex
committed
finally new stuff
1 parent 6ccaa18 commit 0e7e73e

File tree

12 files changed

+351
-272
lines changed

12 files changed

+351
-272
lines changed

assets/code/apps.js

Lines changed: 47 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -153,28 +153,28 @@ var app = {
153153
null
154154
)
155155
);
156-
navbar.appendChild(
157-
tk.cb(
158-
"b4",
159-
"Categories",
160-
function () {
161-
appstorepage.src = "/assets/sysappfiles/appstore/categories.html";
162-
},
163-
null
164-
)
165-
);
166-
navbar.appendChild(
167-
tk.cb(
168-
"b4",
169-
"This Device",
170-
function () {
171-
appstorepage.src = "/assets/sysappfiles/appstore/thisdevice.html";
172-
},
173-
null
174-
)
175-
);
156+
// navbar.appendChild(
157+
// tk.cb(
158+
// "b4",
159+
// "Categories",
160+
// function () {
161+
// appstorepage.src = "/assets/sysappfiles/appstore/categories.html";
162+
// },
163+
// null
164+
// )
165+
// );
166+
// navbar.appendChild(
167+
// tk.cb(
168+
// "b4",
169+
// "This Device",
170+
// function () {
171+
// appstorepage.src = "/assets/sysappfiles/appstore/thisdevice.html";
172+
// },
173+
// null
174+
// )
175+
// );
176176
appstorepage.setAttribute("frameborder", "0");
177-
appstorepage.src = "/assets/sysappfiles/appstore/app.html?eapp";
177+
appstorepage.src = "/assets/sysappfiles/appstore/home.html";
178178
appstorepage.style.width = "100%";
179179
appstorepage.style.height = "100%";
180180
wc.style.height = "calc(100% - 65px)";
@@ -185,6 +185,26 @@ var app = {
185185
document.body.parentElement.getAttribute("style")
186186
);
187187
};
188+
appstorepage.contentWindow.onhashchange = function () {
189+
var hash = appstorepage.contentWindow.location.hash;
190+
if (hash.startsWith("#installApp:")) {
191+
var appid = hash.split(":")[1];
192+
function toDataUrl(url, callback) {
193+
var xhr = new XMLHttpRequest();
194+
xhr.onload = function () {
195+
var reader = new FileReader();
196+
reader.onloadend = function () {
197+
callback(reader.result);
198+
};
199+
reader.readAsDataURL(xhr.response);
200+
};
201+
xhr.open("GET", url);
202+
xhr.responseType = "blob";
203+
xhr.send();
204+
}
205+
206+
}
207+
};
188208
},
189209
},
190210
setup: {
@@ -203,41 +223,9 @@ var app = {
203223
const first = tk.c("div", main, "setb");
204224
tk.img("./assets/img/systemIcons/os.svg", "setupi", first);
205225
tk.p("Welcome to NovaOS Deskop Next-Gen!", "h2", first);
206-
tk.p("NovaOS is proudly powered by WebDesk!", "h3", first);
226+
tk.p("NovaOS is powered by WebDesk!", "h3", first);
207227
tk.cb("b1", `Login as Guest`, () => wd.desktop("Guest", gen(8)), first);
208-
tk.cb("b1", `Begin Setup`, () => ui.sw2(first, warn), first);
209-
// warn menu
210-
const warn = tk.c("div", main, "setb hide");
211-
tk.img("./assets/img/systemIcons/os.svg", "setupi", warn);
212-
tk.p(`Online services`, "h2", warn);
213-
tk.p(
214-
"NovaOS makes an ID called a DeskID for you. Others using WebDesk, NovaOS-NG or compatible tools can use this ID to send you files or call you.",
215-
undefined,
216-
warn
217-
);
218-
tk.p(
219-
"To recieve calls and files from others, NovaOS needs to be open. When not in use, NovaOS uses less resources",
220-
undefined,
221-
warn
222-
);
223-
tk.p(
224-
"You can find your DeskID upon completion of setup.",
225-
undefined,
226-
warn
227-
);
228-
// tk.cb('b1', `What's my DeskID?`, function () {
229-
// const box = wm.cm();
230-
// tk.p(`Your DeskID is <span class="deskid med">unknown</span>. You'll need to finish setup to use this ID.`, undefined, box);
231-
// tk.cb('b1 rb', 'Got it', undefined, box);
232-
// }, warn);
233-
tk.cb(
234-
"b1",
235-
"Got it",
236-
function () {
237-
ui.sw2(warn, user);
238-
},
239-
warn
240-
);
228+
tk.cb("b1", `Begin Setup`, () => ui.sw2(first, user), first);
241229
// user menu
242230
const user = tk.c("div", main, "setb hide");
243231
tk.img("./assets/img/setup/user.svg", "setupi", user);
@@ -1157,8 +1145,8 @@ var app = {
11571145
"340px",
11581146
"auto",
11591147
true,
1160-
undefined,
1161-
undefined,
1148+
true,
1149+
true,
11621150
"./assets/img/systemIcons/store.svg"
11631151
);
11641152
const apps = tk.c("div", win.main);
@@ -1170,8 +1158,8 @@ var app = {
11701158
apps.forEach(function (app2) {
11711159
const notif = tk.c("div", win.main, "notif2");
11721160
tk.p(
1173-
`<span class="bold">${app2.name}</bold> by ${app2.pub}`,
1174-
"bold",
1161+
`<bold class="bold">${app2.name}</bold> by ${app2.pub}`,
1162+
"",
11751163
notif
11761164
);
11771165
tk.p(app2.info, undefined, notif);

assets/code/core.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,29 @@ var gens = randTk.gens;
5050
* @namespace
5151
*/
5252
var wd = {
53+
loadapps: async function (inapp, onlineApps, apps) {
54+
const onlineApp = onlineApps.find(app => app.name === inapp.name);
55+
56+
if (onlineApp.ver === inapp.ver && sys.fucker === false) {
57+
console.log(`<i> ${inapp.name} is up to date (${inapp.ver} = ${onlineApp.ver})`);
58+
const fucker = await fs.read(inapp.exec);
59+
if (fucker) {
60+
eval(fucker);
61+
} else {
62+
fs.del('/system/apps.json');
63+
fs.delfold('/system/apps');
64+
wm.notif('App Issues', 'All apps were uninstalled due to corruption or an update. Your data is safe, you can reinstall them anytime.', () => app.appmark.init(), 'App Market');
65+
sys.fucker = true;
66+
return;
67+
}
68+
} else {
69+
const remove = apps.filter(item => item.id !== inapp.id);
70+
const removed = JSON.stringify(remove);
71+
fs.write('/system/apps.json', removed);
72+
app.appmark.create(onlineApp.path, onlineApp, true);
73+
console.log(`<!> ${inapp.name} was updated (${inapp.ver} --> ${onlineApp.ver})`);
74+
}
75+
},
5376
win: function () {
5477
$('.d').not('.dragged').on('mousedown touchstart', function (event) {
5578
var $window = $(this).closest('.window');

assets/code/ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ var tk = {
392392
* @param {String} [icon='./assets/img/systemIcons/noicon.svg'] - The icon of the window
393393
* @returns {Object} The created window
394394
*/
395-
mbw: function (title, wid, hei, full, min, quit, id, icon = './assets/img/systemIcons/noicon.svg') {
395+
mbw: function (title, wid, hei, full, min = true, quit = true, id, icon = './assets/img/systemIcons/noicon.svg') {
396396
var windowDiv = document.createElement('div');
397397
windowDiv.classList.add('window');
398398
windowDiv.classList.add('winf');

assets/sysappfiles/appstore/app.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ <h1>Loading...</h1>
2525
<h1 id="appn">AppName</h1>
2626
<h3 id="appdesc">AppDescription</h3><br>
2727
<h5 id="appdev">AppDeveloper</h5>
28-
<h5 id="appcat">AppCategory</h5>
2928
<div class="btnrow">
30-
<button class="b1">Install</button>
31-
<button id="qr" class="b1">QuickRun</button>
29+
<button class="b1 inst">Install</button>
30+
<!-- <button id="qr" class="b1">QuickRun</button> -->
3231
</div>
3332
</div>
3433
</div>

assets/sysappfiles/appstore/app.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
var appid = window.location.search.split("?")[1]
22
console.log(appid)
33
document.addEventListener('DOMContentLoaded', async function() {
4-
document.querySelector("iframe").src=`https://pkgs.os.novafurry.win/${appid}/desc`
5-
var repoResponse = await fetch(`https://pkgs.os.novafurry.win/${appid}/meta.json`);
4+
var repoResponse = await fetch(`https://ospkgs.novafurry.win/pkgs/${appid}/meta.json`);
65
document.querySelector('.loader').remove()
76
document.querySelector('main').classList.remove("hide")
87
console.log(repoResponse)
98
app = await repoResponse.json();
10-
document.querySelector('#appn').innerText = app.name
11-
document.querySelector('#appico').src = app.icon
12-
document.querySelector('#appdesc').innerText = app.description
13-
document.querySelector('#appdev').innerText = `${app.developer} - `
14-
document.querySelector('#appcat').innerText = `${app.category} - ${app.specialTags.includes("Official") ? "Official" : ""} - ${app.specialTags.includes("Featured") ? "Featured" : ""}`
15-
if(app.specialTags.includes('quickRun')){
16-
17-
}
18-
else{
19-
document.querySelector('#qr').remove()
9+
document.querySelector('#appn').innerText = app.title
10+
document.querySelector('#appico').src = `https://ospkgs.novafurry.win/pkgs/${appid}/${app.icon}`
11+
document.querySelector('#appdesc').innerText = app.desc
12+
document.querySelector('#appdev').innerText = `${app.publisher} - ${app.verifiedPublisher ? "Verified" : "Unverified"}`
13+
// if(app.specialTags.includes('quickRun')){
14+
// }
15+
// else{
16+
// document.querySelector('#qr').remove()
17+
// }
18+
document.querySelector(".inst").onclick = function(){
19+
window.location.hash = "installApp:"+appid
2020
}
2121
})

assets/sysappfiles/appstore/home.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<body>
1111
<main>
12-
<div class="carouselArea">
12+
<!-- <div class="carouselArea">
1313
<h2>Featured</h2>
1414
<div class="carousel__container">
1515
<div class="carousel__item active hidden">
@@ -24,14 +24,16 @@ <h2>Featured</h2>
2424
<img class="carousel__item" src="Frame 3.png" alt="image3">
2525
</div>
2626
</div>
27-
</div>
28-
<h2>Offical Applications<br><small>Applications developed by the NovaOS Team</small></h2>
29-
<div class="approw officialApps">
27+
</div> -->
28+
<!-- <h2>Offical Applications<br><small>Applications developed by the NovaOS Team</small></h2> -->
29+
<!-- <div class="approw officialApps">
30+
</div> -->
31+
<div class="approw apps">
3032
</div>
3133
<br>
3234
<br>
3335
</main>
34-
<script>
36+
<!-- <script>
3537
const carousel = document.body
3638
const carouselContainer = carousel.querySelector('.carousel__container');
3739
const carouselItems = carousel.querySelectorAll('.carousel__item');
@@ -61,7 +63,7 @@ <h2>Offical Applications<br><small>Applications developed by the NovaOS Team</sm
6163
nextIndex = (nextIndex + 1) % carouselItems.length;
6264
}
6365
}, 2000);
64-
</script>
66+
</script> -->
6567
<script src="main.js"></script>
6668
</body>
6769

assets/sysappfiles/appstore/main.js

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,71 @@
11
document.addEventListener('DOMContentLoaded', async function() {
2-
var repoResponse = await fetch('https://pkgs.os.novafurry.win/allapps.json');
2+
var repoResponse = await fetch('https://ospkgs.novafurry.win/getapps.php');
33
repoResponse = await repoResponse.json();
44
var featuredApps = []
55
var officialApps = []
6+
var other = []
67
repoResponse.forEach(app => {
7-
if(app.specialTags.includes("Featured") && featuredApps.length < 4){
8-
featuredApps.push(app)
9-
}
10-
else if(app.specialTags.includes("Official")){
11-
officialApps.push(app)
12-
}
8+
// if(app.specialTags.includes("Featured") && featuredApps.length < 4){
9+
// featuredApps.push(app)
10+
// }
11+
// else if(app.specialTags.includes("Official")){
12+
// officialApps.push(app)
13+
// } else {
14+
// other.push(app)
15+
16+
// }
17+
other.push(app)
18+
1319
});
14-
var featuredAppsContainer = document.querySelector('.carousel__container');
15-
featuredApps.forEach((app, index) => {
16-
featuredAppsContainer.children[index].querySelector('img').src = app.banner;
17-
featuredAppsContainer.children[index].classList.remove('hidden');
18-
})
19-
document.querySelectorAll('.carousel__item.hidden').forEach(item => {
20-
item.remove();
21-
});
22-
document.querySelector('.carouselArea').style.display = featuredAppsContainer.children.length > 0 ? 'block' : 'none';
23-
var officialAppsContainer = document.querySelector('.officialApps');
24-
officialApps.forEach(app => {
25-
// design for app cards
26-
// <div class="application">
27-
// <img src="Frame 3.png" alt="image1">
28-
// <h3>Application 1</h3>
29-
// <p>Description of Application 1</p>
30-
// </div>
20+
// var featuredAppsContainer = document.querySelector('.carousel__container');
21+
// featuredApps.forEach((app, index) => {
22+
// featuredAppsContainer.children[index].querySelector('img').src = app.banner;
23+
// featuredAppsContainer.children[index].classList.remove('hidden');
24+
// })
25+
// document.querySelectorAll('.carousel__item.hidden').forEach(item => {
26+
// item.remove();
27+
// });
28+
// document.querySelector('.carouselArea').style.display = featuredAppsContainer.children.length > 0 ? 'block' : 'none';
29+
// var officialAppsContainer = document.querySelector('.officialApps');
30+
// officialApps.forEach(app => {
31+
// // design for app cards
32+
// // <div class="application">
33+
// // <img src="Frame 3.png" alt="image1">
34+
// // <h3>Application 1</h3>
35+
// // <p>Description of Application 1</p>
36+
// // </div>
37+
// var appDiv = document.createElement('div');
38+
// appDiv.classList.add('application');
39+
// var appImg = document.createElement('img');
40+
// appImg.src = app.banner;
41+
// appImg.alt = app.name;
42+
// var appName = document.createElement('h3');
43+
// appName.innerText = app.name;
44+
// var appDesc = document.createElement('p');
45+
// appDesc.innerText = app.description;
46+
// appDiv.appendChild(appImg);
47+
// appDiv.appendChild(appName);
48+
// appDiv.appendChild(appDesc);
49+
// officialAppsContainer.appendChild(appDiv);
50+
// })
51+
var otherAppsContainer = document.querySelector('.approw.apps');
52+
53+
other.forEach(app => {
3154
var appDiv = document.createElement('div');
3255
appDiv.classList.add('application');
3356
var appImg = document.createElement('img');
34-
appImg.src = app.banner;
35-
appImg.alt = app.name;
57+
appImg.src = `https://ospkgs.novafurry.win/pkgs/${app.id}/${app.cover}`;
58+
appImg.alt = app.title;
3659
var appName = document.createElement('h3');
37-
appName.innerText = app.name;
60+
appName.innerText = app.title;
3861
var appDesc = document.createElement('p');
39-
appDesc.innerText = app.description;
62+
appDesc.innerText = app.desc;
4063
appDiv.appendChild(appImg);
4164
appDiv.appendChild(appName);
4265
appDiv.appendChild(appDesc);
43-
officialAppsContainer.appendChild(appDiv);
66+
appDiv.onclick = function(){
67+
window.location.href = `/assets/sysappfiles/appstore/app.html?${app.id}`
68+
}
69+
otherAppsContainer.appendChild(appDiv);
4470
})
45-
4671
})

0 commit comments

Comments
 (0)