diff --git a/LICENCE_BSD3Clause.txt b/LICENCE_BSD3Clause.txt new file mode 100644 index 0000000..f2254dd --- /dev/null +++ b/LICENCE_BSD3Clause.txt @@ -0,0 +1,10 @@ +Copyright (c) 2012, Pierre Quentel pierre.quentel@gmail.com +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSE.md b/LICENSE.md index 3ef128e..6636f89 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -* This project licensed by [MPL](./LICENSE.txt). +* This project licensed by [MPL2](./LICENSE.txt). * css/UbuntuRegular.ttf licensed by [Ubuntu Font License](./LICENSE_UFL.txt). @@ -8,8 +8,12 @@ * Bootstrap Icons licensed by [Mit License](./LICENSE_MIT.txt) +* Brython licensed by [BSD-3-Clause License](./LICENCE_BSD3Clause.TXT) + > Ubuntu and Canonical are registered trademarks of Canonical Ltd. > Gnome are registered trademarks of Gnome. -> WineHQ are registered trademarks of WineHQ. \ No newline at end of file +> WineHQ are registered trademarks of WineHQ. + +> Python are registered trademarks of Python Software Foundation. \ No newline at end of file diff --git a/README.md b/README.md index ad4b1de..da554a5 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Ubuntu Tour -Web based Ubuntu 21.04 desktop remake. You can try latest ubuntu edition remake from [here](https://malisipi.github.io/ubuntu-tour/) +Web based Ubuntu 21.10 desktop remake. You can try latest ubuntu edition remake from [here](https://malisipi.github.io/ubuntu-tour/) ## Features * Multi-window (You can open same application 2 (or more) times) * Resizable, draggable windows -* Changable wallpapers +* Changeable wallpapers * Similar interface with Gnome (Ubuntu Tour imitate Gnome Interface however never use Gnome code.) * Clone applications @@ -20,8 +20,9 @@ For introduce the Ubuntu environment' beauty (on web) and for fun. :) I was insp ## To-Do List * Increase clone apps' functionality -* [8] Create more clone aplication -* [-] Update interface to similar Ubuntu 21.10 interface +* [8] Create more clone application +* [+] Update interface to similar Ubuntu 21.10 interface +* [-] Update interface to similar Ubuntu 22.04 interface ## Notes @@ -33,4 +34,4 @@ For introduce the Ubuntu environment' beauty (on web) and for fun. :) I was insp ## License -This project licensed by MPL. Learn more from [here](./LICENSE.md) \ No newline at end of file +This project licensed by MPL2. Learn more from [here](./LICENSE.md) \ No newline at end of file diff --git a/apps/css/app-layout.css b/apps/css/app-layout.css index e713e40..87c8f60 100644 --- a/apps/css/app-layout.css +++ b/apps/css/app-layout.css @@ -1,5 +1,7 @@ body{ background: #141414; + user-select: none; + -webkit-user-select: none; } .titlebar-container{ diff --git a/apps/css/app-styles.css b/apps/css/app-styles.css index 34cba83..cadd84e 100644 --- a/apps/css/app-styles.css +++ b/apps/css/app-styles.css @@ -15,6 +15,11 @@ background: #888888; } +body{ + user-select: none; + -webkit-user-select: none; +} + .special-button{ border: #111111; background: #333333; diff --git a/apps/filemanager/css/side.css b/apps/filemanager/css/side.css index 654af4b..7dc3fba 100644 --- a/apps/filemanager/css/side.css +++ b/apps/filemanager/css/side.css @@ -17,6 +17,9 @@ body{ background: #222222; + margin: 0px; + user-select: none; + -webkit-user-select: none; } .location-inactive{ diff --git a/apps/settings/about.html b/apps/settings/about.html index 15ea4f7..49a6a42 100644 --- a/apps/settings/about.html +++ b/apps/settings/about.html @@ -47,7 +47,7 @@ - +
OS nameUbuntu 21.04Ubuntu Impish Indri (development branch)
@@ -59,7 +59,7 @@
- +
Gnome Version3.38.540.4.0
diff --git a/apps/settings/css/side.css b/apps/settings/css/side.css index 0a9c951..fb89bc1 100644 --- a/apps/settings/css/side.css +++ b/apps/settings/css/side.css @@ -32,6 +32,9 @@ body{ background: #222222; + margin: 0px; + user-select: none; + -webkit-user-select: none; } .location-inactive{ diff --git a/apps/settings/js/background.js b/apps/settings/js/background.js index 7f0b0fd..b3aa315 100644 --- a/apps/settings/js/background.js +++ b/apps/settings/js/background.js @@ -4,5 +4,6 @@ function showWallpaper(){ function setWallpaper(file){ parent.parent.document.getElementsByClassName("wallpaper")[0].src="icons/unsplash/"+file; + parent.parent.window.localStorage["wallpaper"]="icons/unsplash/"+file; document.getElementById("theWallpaper").src="../../icons/unsplash/"+file; } \ No newline at end of file diff --git a/apps/terminal/css/main.css b/apps/terminal/css/main.css index 6ca5dda..7af855d 100644 --- a/apps/terminal/css/main.css +++ b/apps/terminal/css/main.css @@ -5,12 +5,12 @@ textarea{ width: 100%; height: 100%; background: #0000; - color: #eee; + color: transparent; + text-shadow: 0 0 0 #fff; border: none; resize: none; -} - -textarea{ font-family: UbuntuMonoRegular !important; font-size: 16px !important; + outline: none; + word-break: break-all; } \ No newline at end of file diff --git a/apps/terminal/js/main.js b/apps/terminal/js/main.js index d358a8a..b7a7c16 100644 --- a/apps/terminal/js/main.js +++ b/apps/terminal/js/main.js @@ -35,14 +35,17 @@ __console_info="Welcome to Terminal"; outputs=__console_info; now_dir="/"; now_command=""; +run_python3=0; function updateOutputs(){ out.value=outputs; } function updateOutputsWithCommands(){ - out.value=outputs+"\nuser@desktop:"+now_dir+"# "+now_command; - out.scrollBy(0,9999999999999999999999999); + setTimeout(() => { + out.value=outputs+"\nuser@desktop:"+now_dir+"# "+now_command; + out.scrollBy(0,9999999999999999999999999); + }, 1); } function clearOutputs(){ @@ -82,6 +85,9 @@ function runBashCommand(__command){ writeOutput("You are already logged in as root user.") }else if(__the_command=="sh"||__the_command=="bash"){ writeOutput(__console_info); + }else if(__the_command=="python3"){ + run_python3=1; + brython({"debug":0}); }else if(__the_command=="echo"){ writeOutput(__command.join(" ").replace("echo ","")) }else if(__the_command=="cd"){ @@ -113,7 +119,7 @@ function runBashCommand(__command){ mkdir rmdir cp mv rm\n\ apt-get apt dpkg su sudo\n\ sh bash echo help clear\n\ -cd ls dir") +cd ls dir python3 ") }else{ writeOutput(__the_command+": Command not found") } @@ -122,6 +128,7 @@ cd ls dir") } function handlerKeyPress(){ + if(run_python3==1) return false; keyCode=window.event.keyCode; keyName=window.event.key; if(keyCode==8){ diff --git a/apps/terminal/main.html b/apps/terminal/main.html index 458b9b8..98a2b2a 100644 --- a/apps/terminal/main.html +++ b/apps/terminal/main.html @@ -5,9 +5,15 @@ + + - + + \ No newline at end of file diff --git a/contextmenu.html b/contextmenu.html index 5f3edc1..6256392 100644 --- a/contextmenu.html +++ b/contextmenu.html @@ -3,11 +3,22 @@ + - -
- - -
Open Desktop On Files
Change Wallpaper...
- + +
New Folder
+
Paste
+
Select All
+
Arrange Icons
+
Arrange By...
+
Open Desktop On Files
+
Open In Terminal
+
Change Wallpaper...
+
Display Settings
+
Desktop Symbol Settings
+ \ No newline at end of file diff --git a/css/activities.css b/css/activities.css new file mode 100644 index 0000000..ffe7287 --- /dev/null +++ b/css/activities.css @@ -0,0 +1,18 @@ +.activities{ + position: fixed; + top: 26px; + left: 80px; + width: calc(100% - 80px); + height: calc(100% - 26px); + z-index: 99999999999999999999999999999999999999999; + background: #222222; +} + +.activities-wallpaper{ + position: fixed; + top: 106px; + left: 120px; + width: calc(100% - 160px); + height: calc(100% - 146px); + border-radius: 30px; +} \ No newline at end of file diff --git a/css/app-menu.css b/css/app-menu.css index ee23807..a2bf2d1 100644 --- a/css/app-menu.css +++ b/css/app-menu.css @@ -4,16 +4,16 @@ top:26px; height: calc(100% - 26px); width: calc(100% - 80px); - background: #222222cc; + background: #222222; z-index: 99999999999999999999999999999999999999999; } .app-menu-container{ - width: 80%; - height: 80%; - position: absolute; - left: 10%; - top: 10%; + position: fixed; + top: 206px; + left: 120px; + width: calc(100% - 160px); + height: calc(100% - 246px); overflow-x: hidden; overflow-y: auto; display: flex; @@ -21,6 +21,14 @@ justify-content: center; } +.app-menu-container-wallpaper{ + position: fixed; + top: 98px; + left: calc(50% - 40px); + height: 90px; + width: 160px; +} + .app-menu-app { width: 144px; height: 144px; diff --git a/css/contentmenu.css b/css/contentmenu.css index 87c3885..6943db7 100644 --- a/css/contentmenu.css +++ b/css/contentmenu.css @@ -1,24 +1,30 @@ body{ - cursor: default; -} - -.option-list{ - position: fixed; - top: 0px; - left: 0px; - height: 100%; - width: 100%; background: #222222; + display: grid; + grid-template-rows: auto auto; + margin: 5px 0px; + -webkit-user-select: none; + user-select: none; } -.option{ - width: 100%; +body > div{ transition-duration: 0.2s; - border-radius: 5px; color: #ffffff; + margin: 0px; + padding: 0px; + font-size: 16px; + line-height: 25px; +} + +body > div > div{ + margin: 0px 25px; } -.option:hover{ +body > div:hover{ transition-duration: 0.2s; background: #444444; +} + +.section{ + border-bottom: 1px #777777 solid; } \ No newline at end of file diff --git a/css/dock.css b/css/dock.css index f250481..6a52dc4 100644 --- a/css/dock.css +++ b/css/dock.css @@ -2,7 +2,7 @@ position: fixed; top:26px; left: 0px; - background: #222222; + background: #111111; width: 80px; z-index: 99999999999999999999999999999999999999999; height: calc(100% - 106px); @@ -44,7 +44,7 @@ left: 0px; width: 80px; height: 80px; - background: #222222; + background: #111111; z-index: 99999999999999999999999999999999999999999; } diff --git a/css/main.css b/css/main.css index 9cb0b28..986647a 100644 --- a/css/main.css +++ b/css/main.css @@ -2,6 +2,10 @@ body{ background: #550055; } +input,textarea{ + outline: none; +} + ::-webkit-scrollbar { width: 5px; height: 5px; @@ -43,9 +47,44 @@ body{ background: #00000044; top: 0px; left: 0px; - border-radius: 10px; - border: none; + border-radius: 5px; + border: #777777 solid 1px; position: fixed; - height: 60px; + height: 266px; width: 250px; +} + +.panel-activities:hover, .panel-notification:hover, .panel-status:hover, .panel-active-app:hover { + background: #ffffff44; + border-radius: 50px; + transition-duration: 0.2s; +} + +.menu-searchbox{ + position: fixed; + top: 45px; + height: 28px; + left: calc(50% - 110px); + width: 298px; + border-radius: 15px; + background: #111111; + border: #777777 solid 1px; + display: grid; + grid-template-columns: 35px auto; + align-items: center; +} + +.menu-searchbox > input{ + padding: 0px; + height: 28px; + border: none; + background: #111111; + color: #ffffff; + border-radius: 15px; +} + +.menu-searchbox > img{ + filter: brightness(2); + height: 24px; + justify-self: center; } \ No newline at end of file diff --git a/css/panel.css b/css/panel.css index 8a0410f..ee8ed49 100644 --- a/css/panel.css +++ b/css/panel.css @@ -10,10 +10,10 @@ .panel-activities{ position: fixed; - height: 26px; + height: 22px; width: 85px; - left: 0px; - top: 0px; + left: 2px; + top: 2px; font-size: 16px; color: #ffffff; text-align: center; @@ -22,35 +22,46 @@ align-content: center; flex-direction: column; cursor: default; + transition-duration: 0.2s; } -.panel-active-app-icon{ +.panel-active-app{ position: fixed; + left: 90px; + width: 0px; + height: 22px; + top: 2px; + transition-duration: 0.2s; + cursor: default; +} + +.panel-active-app-icon{ + position: absolute; height: 16px; width: 16px; - left: 100px; - top: 5px; + left: 10px; + top: 3px; cursor: default; filter: grayscale(1); } .panel-active-app-name{ - position: fixed; + position: absolute; height: 16px; - width: 400px; - left: 120px; - top: 5px; + left: 30px; + top: 3px; font-size: 16px; color: #ffffff; cursor: default; + white-space:nowrap; } .panel-notification{ position: fixed; - height: 26px; - width: 150px; + height: 22px; + width: 120px; left: 50%; - top: 0px; + top: 2px; transform: translate(-50%,0); font-size: 16px; color: #ffffff; @@ -60,18 +71,23 @@ align-content: center; flex-direction: column; cursor: default; + transition-duration: 0.2s; } .panel-status{ position: fixed; - height: 21px; - width: 110px; - right: 0px; - top: 5px; + height: 22px; + width: 80px; + right: 2px; + top: 2px; font-size: 16px; color: #ffffff; - text-align: right; cursor: default; + display: grid; + grid-template-columns: auto auto auto; + align-items: center; + justify-items: center; + transition-duration: 0.2s; } .panel-status-icon{ @@ -87,6 +103,7 @@ height: 315px; border: #222222 2px solid; border-radius: 5px; + border: #777777 solid 1px; } .notification-about{ @@ -98,4 +115,5 @@ height: 300px; border: #222222 2px solid; border-radius: 5px; + border: #777777 solid 1px; } diff --git a/css/status.css b/css/status.css index feb17eb..bf11eb4 100644 --- a/css/status.css +++ b/css/status.css @@ -1,6 +1,21 @@ body{ background: #222222; - padding: 15px; + display: grid; + grid-template-areas: + 'sound sound-slider ' + 'brightness brightness-slider' + 'section section ' + 'wifi wifi-text ' + 'bluetooth bluetooth-text ' + 'battery battery-text ' + 'section2 section2 ' + 'settings settings-text ' + 'lock lock-text ' + 'shutdown shutdown-text '; + grid-gap: 10px; + grid-template-rows: auto auto 5px auto auto auto 5px auto auto auto; + grid-template-columns: 30px auto; + justify-content: center; cursor: default; } @@ -19,7 +34,7 @@ body{ .slider{ width: 235px; - transform: translate(3px,-9px); + align-self: flex-end; } .label{ diff --git a/css/window.css b/css/window.css index 88094dd..571fdc8 100644 --- a/css/window.css +++ b/css/window.css @@ -1,5 +1,6 @@ body{ user-select: none; + -webkit-user-select: none; } .window{ diff --git a/icons/unsplash/9XngoIpxcEo.jpg b/icons/unsplash/9XngoIpxcEo.jpg index 40f745a..306ace1 100644 Binary files a/icons/unsplash/9XngoIpxcEo.jpg and b/icons/unsplash/9XngoIpxcEo.jpg differ diff --git a/icons/unsplash/Tjbk79TARiE.jpg b/icons/unsplash/Tjbk79TARiE.jpg index 6bce887..c8e15a8 100644 Binary files a/icons/unsplash/Tjbk79TARiE.jpg and b/icons/unsplash/Tjbk79TARiE.jpg differ diff --git a/icons/unsplash/WeYamle9fDM.jpg b/icons/unsplash/WeYamle9fDM.jpg index 40f83eb..d3af2f8 100644 Binary files a/icons/unsplash/WeYamle9fDM.jpg and b/icons/unsplash/WeYamle9fDM.jpg differ diff --git a/icons/unsplash/qDG7XKJLKbs.jpg b/icons/unsplash/qDG7XKJLKbs.jpg index 5cff77e..e39cb68 100644 Binary files a/icons/unsplash/qDG7XKJLKbs.jpg and b/icons/unsplash/qDG7XKJLKbs.jpg differ diff --git a/icons/unsplash/tyAAl6r_c2U.jpg b/icons/unsplash/tyAAl6r_c2U.jpg index 9d206fb..78346d9 100644 Binary files a/icons/unsplash/tyAAl6r_c2U.jpg and b/icons/unsplash/tyAAl6r_c2U.jpg differ diff --git a/index.html b/index.html index 6611b5b..83636f1 100644 --- a/index.html +++ b/index.html @@ -16,19 +16,23 @@ + + + - +
-
Activities
- -
+
Activities
+
+ +
+
-    -    -    -    + + +
@@ -38,16 +42,19 @@
Home
-
-
- Trash -
-
+
+
+
+ +
+
+ diff --git a/js/activities.js b/js/activities.js new file mode 100644 index 0000000..da9e17e --- /dev/null +++ b/js/activities.js @@ -0,0 +1,11 @@ +function showHideActivities(){ + if(document.getElementsByClassName("activities")[0].style.visibility=="hidden"){ + document.getElementsByClassName("activities")[0].style.visibility = "visible"; + document.getElementsByClassName("app-menu")[0].style.visibility = "hidden"; + document.querySelector(".notification-about").hidden=true; + document.querySelector(".status-about").hidden=true; + document.querySelector(".activities-wallpaper").src=document.querySelector(".wallpaper").src; + }else{ + document.getElementsByClassName("activities")[0].style.visibility = "hidden"; + } +} \ No newline at end of file diff --git a/js/app-menu.js b/js/app-menu.js index 6e9d0ce..f916810 100644 --- a/js/app-menu.js +++ b/js/app-menu.js @@ -1,6 +1,10 @@ function showHideAppMenu(){ if(document.getElementsByClassName("app-menu")[0].style.visibility=="hidden"){ document.getElementsByClassName("app-menu")[0].style.visibility = "visible"; + document.querySelector(".app-menu-container-wallpaper").src=document.querySelector(".wallpaper").src; + document.getElementsByClassName("activities")[0].style.visibility = "hidden"; + document.querySelector(".notification-about").hidden=true; + document.querySelector(".status-about").hidden=true; }else{ document.getElementsByClassName("app-menu")[0].style.visibility = "hidden"; } diff --git a/js/localStorage.js b/js/localStorage.js new file mode 100644 index 0000000..2a94812 --- /dev/null +++ b/js/localStorage.js @@ -0,0 +1,9 @@ +if (typeof(Storage) === "undefined") { //If localStorage not supported, create a variable for storing data as temporary. + localStorage={}; +} + +if(localStorage["wallpaper"]==undefined) localStorage["wallpaper"]="icons/unsplash/9XngoIpxcEo.jpg"; + +window.addEventListener("load",()=>{ + document.querySelector(".wallpaper").src=localStorage["wallpaper"]; +}); \ No newline at end of file diff --git a/js/panel.js b/js/panel.js index d3d095a..b75b16a 100644 --- a/js/panel.js +++ b/js/panel.js @@ -2,19 +2,28 @@ monthShortNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","No function UpdatePanelTime(){ now = new Date(); - document.getElementsByClassName("panel-notification")[0].innerHTML=now.getDate()+" "+(monthShortNames[now.getMonth()])+ " " + now.getHours() + ":" + now.getMinutes(); + document.getElementsByClassName("panel-notification")[0].innerHTML=now.getDate()+" "+(monthShortNames[now.getMonth()])+ " " + now.toString().match("..:..")[0]; } setInterval(UpdatePanelTime,1000) function changePanelActiveAppIcon(icon,name){ + if(name==""){ + document.querySelector(".panel-active-app").hidden=true; + }else{ + document.querySelector(".panel-active-app").hidden=false; + } document.getElementsByClassName("panel-active-app-icon")[0].src=icon; document.getElementsByClassName("panel-active-app-name")[0].innerText=name; + setTimeout(() => { + document.querySelector(".panel-active-app").style.width=Math.abs(document.getElementsByClassName("panel-active-app-icon")[0].getBoundingClientRect().left-document.getElementsByClassName("panel-active-app-name")[0].getBoundingClientRect().right)-(-20)+"px"; + }, 1); } function showStatusAbout(){ if(document.getElementsByClassName("status-about")[0].hidden){ document.getElementsByClassName("status-about")[0].hidden=false; + document.querySelector(".notification-about").hidden=true; }else{ document.getElementsByClassName("status-about")[0].hidden=true; } @@ -23,6 +32,7 @@ function showStatusAbout(){ function showNotificationAbout(){ if(document.getElementsByClassName("notification-about")[0].hidden){ document.getElementsByClassName("notification-about")[0].hidden=false; + document.querySelector(".status-about").hidden=true; }else{ document.getElementsByClassName("notification-about")[0].hidden=true; } diff --git a/js/status.js b/js/status.js index 5e42657..7ece7ea 100644 --- a/js/status.js +++ b/js/status.js @@ -1,3 +1,8 @@ function changeBrightness(){ parent.document.getElementById("brightness").style.opacity=1-document.getElementById("brightness-change").value/100; +} + +function openSettings(){ + parent.showStatusAbout(); + parent.window_create_special(parent.createRandomWindowID(),'apps/settings/index.html','Settings','icons/Suru/Suru/48x48/apps/system-settings.png'); } \ No newline at end of file diff --git a/js/window.js b/js/window.js index defeb13..1983033 100644 --- a/js/window.js +++ b/js/window.js @@ -145,16 +145,22 @@ function window_minimize(w){ if(document.getElementById(w).hidden){ document.getElementById(w).hidden=false; changeWindowZIndex(w); + document.getElementById(w).onmousedown() }else{ if(ZIndex-1==document.getElementById(w).style.zIndex){ document.getElementById(w).hidden=true; + changePanelActiveAppIcon('icons/null.svg',''); }else{ changeWindowZIndex(w); + document.getElementById(w).onmousedown() } } } +window_infos={}; + function window_maximize(w){ + window_infos[w]=[document.getElementById(w).style.top,document.getElementById(w).style.left,document.getElementById(w).style.width,document.getElementById(w).style.height]; document.getElementById(w).style.top="26px"; document.getElementById(w).style.left="80px"; document.getElementById(w).style.width="calc(100% - 80px)"; @@ -169,10 +175,10 @@ function window_maximize(w){ } function window_restore(w){ - document.getElementById(w).style.top="100px"; - document.getElementById(w).style.left="100px"; - document.getElementById(w).style.width="300px"; - document.getElementById(w).style.height="300px"; + document.getElementById(w).style.top=window_infos[w][0]; + document.getElementById(w).style.left=window_infos[w][1]; + document.getElementById(w).style.width=window_infos[w][2]; + document.getElementById(w).style.height=window_infos[w][3]; AllowMovable(document.getElementById(w)); document.getElementById(w+"-maximize").src="icons/Suru/Suru/scalable/ui/window-maximize-symbolic.svg"; document.getElementById(w+"-maximize").onclick = function(e) {window_maximize(w)}; @@ -184,7 +190,7 @@ function window_restore(w){ function window_create(name,url,title,icon){ hideAppMenu(); - document.getElementById("dock").insertAdjacentHTML('afterend',"
\ + document.getElementsByClassName("dock")[0].insertAdjacentHTML('afterend',"
\
\
"+title+"
\
\ @@ -200,12 +206,13 @@ function window_create(name,url,title,icon){
\ \
"; - + changePanelActiveAppIcon(icon,title); + changeWindowZIndex(name); } function window_create_special(name,url,title,icon){ hideAppMenu(); - document.getElementById("dock").insertAdjacentHTML('afterend',"
\ + document.getElementsByClassName("dock")[0].insertAdjacentHTML('afterend',"
\
\
\   \ @@ -223,11 +230,14 @@ function window_create_special(name,url,title,icon){
\ \
"; + changePanelActiveAppIcon(icon,title); + changeWindowZIndex(name); } function window_delete(w){ document.getElementById(w).remove(); document.getElementById(w+"-dock").remove(); + changePanelActiveAppIcon('icons/null.svg',''); } ZIndex=1000; @@ -237,8 +247,9 @@ function changeWindowZIndex(id){ ZIndex+=1; } +latest_window_id=0; + function createRandomWindowID(){ - return "w"+Math.floor(Math.random() * Math.random() * Math.random() * Math.random()*10000000)+ - Math.floor(Math.random() * Math.random() * Math.random() * Math.random()*10000000)+ - Math.floor(Math.random() * Math.random() * Math.random() * Math.random()*10000000); + latest_window_id+=1; + return "w"+latest_window_id; } \ No newline at end of file diff --git a/main.js b/main.js index 2af1427..3bddc66 100644 --- a/main.js +++ b/main.js @@ -4,6 +4,10 @@ function rightclick(event) { function showHideContextMenu(top=0,left=0){ if(document.getElementsByClassName("context-menu-container")[0].hidden){ + if(top<=26) return false; + if(left<=80) return false; + if(document.querySelector(".activities").style.visibility!="hidden") return false; + if(document.querySelector(".app-menu").style.visibility!="hidden") return false; document.getElementsByClassName("context-menu-container")[0].hidden=false; document.getElementsByClassName("context-menu")[0].style.top=top+"px"; document.getElementsByClassName("context-menu")[0].style.left=left+"px"; diff --git a/status.html b/status.html index 91e2f02..cdc11b2 100644 --- a/status.html +++ b/status.html @@ -7,15 +7,15 @@ - - -
-
Wifi

-
Bluetooth is off

-
Full

-
-
Settings

-
Lock

-
Shutdown
+ + +
+
Wifi
+
Bluetooth is off
+
Full
+
+
Settings
+
Lock
+
Shutdown
\ No newline at end of file