diff --git a/app/browser/browser.css b/app/browser/browser.css index 006b4dd..5bccadb 100644 --- a/app/browser/browser.css +++ b/app/browser/browser.css @@ -48,9 +48,10 @@ z-index: 1; right: 0px; background: white; - border-radius: 0px 0px 0px 5px; + border-radius: 0px 0px 0px 8px; padding: 6px 0; - box-shadow: -2px 2px 4px -2px black; + box-shadow: -2px 2px 8px -2px rgba(0, 0, 0, .5); + overflow: hidden; } .kit-darkmode.winc-browser .browser-menu{ background: #505050; @@ -63,4 +64,14 @@ .browser-menu a:hover{ background: dodgerblue; color: white; -} \ No newline at end of file +} +/* for mobile */ +.kit-mobile .winc-browser iframe { + height: calc(100% - 48px); +} +.kit-mobile .browser-menu{ + padding: 0; +} +.kit-mobile .browser-menu a{ + padding: 8px 10px; +} diff --git a/app/browser/default.html b/app/browser/default.html index 8fc643a..ca3b3c9 100644 --- a/app/browser/default.html +++ b/app/browser/default.html @@ -10,7 +10,6 @@
以下の設定内容でよろしければ、下のボタンを押してkitの使用を開始します。
+以下の設定内容でkitの使用を開始します。
ユーザー名:
ユーザーカラー:
diff --git a/system.js b/system.js
index e2b0882..e15cb3c 100644
--- a/system.js
+++ b/system.js
@@ -90,6 +90,7 @@ class System {
Footer: {},
Launcher: {},
Sightre: {},
+ ContextMenu: {},
// Methods
getWindow: (pid) => document.querySelector(`#w${pid}`),
@@ -104,9 +105,22 @@ class System {
System.UI.Header.desktops = document.querySelector("#desktops");
System.UI.Header.sightre = document.querySelector("#kit-header-sightre");
System.UI.Header.username = document.querySelector("#kit-header-username");
- System.UI.Header.fullscreen = document.querySelector("#kit-header-fullscreen");
+ System.UI.Header.unmax = document.querySelector("#kit-header-unmax");
System.UI.Header.Dropdown.sound = document.querySelector("#dropdown-sound");
+ System.UI.Header.time = document.querySelector("#kit-header-time");
System.UI.Header.powerButton = document.querySelector(".power-button");
+
+ System.UI.Footer.footer = document.querySelector("footer");
+
+ System.UI.ContextMenu.contextMenu = document.querySelector("#kit-context");
+ System.UI.ContextMenu.input = document.querySelector("#kit-context-input");
+ System.UI.ContextMenu.elem = document.querySelector("#kit-context-elem");
+ System.UI.ContextMenu.elemGroup = document.querySelector("#kit-contextgroup-elem");
+ System.UI.ContextMenu.textGroup = document.querySelector("#kit-contextgroup-text");
+ System.UI.ContextMenu.desktopGroup = document.querySelector("#kit-contextgroup-desktop");
+ System.UI.ContextMenu.customGroup = document.querySelector("#kit-contextgroup-custom");
+
+ System.UI.desktopSelector = document.querySelector("#kit-desktop-selector");
System.UI.wallpaper = document.querySelector("#kit-wallpaper");
if (localStorage.getItem("kit-pid")) pid = localStorage.getItem("kit-pid");
@@ -129,13 +143,6 @@ class System {
if (!localStorage.getItem("kit-default-browser"))
localStorage.setItem("kit-default-browser", "browser");
- if (localStorage.getItem("kit-fusen")) {
- this.list = JSON.parse(localStorage.getItem("kit-fusen"));
- for (let i in this.list) {
- KWS.fusen.add(this.list[i]);
- }
- }
-
if (localStorage.getItem("kit-darkmode") == "true") KWS.darkmode = true;
if (System.bootopt.get("safe")) {
@@ -166,8 +173,6 @@ class System {
if (localStorage["kit-recycle"])
System.recycle = JSON.parse(localStorage["kit-recycle"]);
- System.moveDesktop("1");
-
if (localStorage.getItem("kit-shutted-down") == "false") {
Notification.push(
"お知らせ",
@@ -203,27 +208,83 @@ class System {
"現在、kitをセーフモードで起動しています。",
"system"
);
- System.alert({
- title: "セーフブート",
- content: "現在、kitをセーフモードで起動しています。
通常モードで再起動",
- windowTitle: "system"
- });
- } else for (let i of System.startup) if (i != "") System.launch(i);
+ };
+
+ KWS.Util.hide(System.UI.Header.unmax);
- System.UI.Header.fullscreen.style.display = "none";
+ if (System.bootopt.get('safe')) setInterval(System.updateTime, 1000);
+ else setInterval(System.updateTime, 100);
// Event handlers
- $("#desktops")
- .click(function () {
- $("#desktop-" + currentDesktop).toggleClass("selected-section");
- })
- .mousedown(function () {
- $(".window").css("opacity", "0.6");
- })
- .mouseup(function () {
- $(".window").css("opacity", "1.0");
- });
- //タスク一覧
+
+ // Virtual Desktops
+ System.UI.Header.desktops.addEventListener('click', () => {
+ const closeFunc = () => {
+ KWS.currentDesktop.elem.classList.remove('selected-section');
+ System.UI.desktopSelector.classList.remove('-is-open');
+ };
+ if (System.UI.desktopSelector.classList.contains('-is-open')) {
+ closeFunc();
+ }
+ else {
+ KWS.currentDesktop.elem.classList.add('selected-section');
+ System.UI.desktopSelector.classList.add('-is-open');
+ System.UI.desktopSelector.innerHTML = '';
+ KWS.desktops.forEach(desktop => {
+ const elem = document.createElement('div');
+ elem.dataset.index = desktop.index;
+ if (localStorage.getItem("kit-wallpaper")) {
+ elem.style.background = localStorage.getItem("kit-wallpaper");
+ elem.style.backgroundSize = "cover";
+ elem.style.backgroundPosition = "center center";
+ }
+ if (KWS.currentDesktopIndex === desktop.index) {
+ elem.classList.add('-active');
+ }
+ elem.addEventListener('click', () => {
+ if (KWS.currentDesktopIndex === desktop.index) closeFunc();
+ else {
+ KWS.currentDesktop = desktop.index;
+ // Switch unmax button and the footer
+ if (KWS.currentDesktop.maximized.pid === null) {
+ KWS.Util.show(System.UI.Footer.footer);
+ KWS.Util.hide(System.UI.Header.unmax);
+ }
+ else {
+ KWS.Util.hide(System.UI.Footer.footer);
+ KWS.Util.show(System.UI.Header.unmax);
+ }
+ }
+ });
+ const input = document.createElement('input');
+ input.type = 'text';
+ input.value = desktop.name;
+ input.addEventListener('click', (e) => e.stopPropagation());
+ input.addEventListener('blur', () => {
+ desktop.name = input.value;
+ desktop.elem.dataset.name = input.value;
+ });
+ elem.appendChild(input);
+ System.UI.desktopSelector.appendChild(elem);
+ });
+
+ const addButton = document.createElement('div');
+ addButton.classList.add("-add-button");
+ addButton.innerHTML = '+追加する';
+ addButton.addEventListener('click', () => {
+ new Desktop(`Desktop ${KWS.desktops.length}`);
+ closeFunc();
+ KWS.Util.show(System.UI.Footer.footer);
+ KWS.Util.hide(System.UI.Header.unmax);
+ });
+ System.UI.desktopSelector.appendChild(addButton);
+ }
+ });
+ // Unmax
+ System.UI.Header.unmax.addEventListener('click', () => {
+ KWS.unmax(KWS.currentDesktop.maximized.pid);
+ });
+ // Task List
$("#footer-tasks").click(function () {
if ($("#kit-tasks").is(":visible")) {
$("#kit-tasks").html("").fadeOut(300);
@@ -253,26 +314,38 @@ class System {
});
$.getJSON("config/desktop.json", (data) => {
- for (let i in data) {
- $(".desktop-icons").append(
- "