Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
* Support to dialog and notification
* Fix window resize bug
* Location api for weather and maps
* App demo mode (Read README.md to learn more)
* Update style of interface
* New terminal commands (uname, notify-send, wine) and support to start apps from terminal
* New app (VSCode)
* Fix context menu bug
  • Loading branch information
malisipi committed Nov 13, 2021
1 parent 52e9db9 commit 98f25cb
Show file tree
Hide file tree
Showing 39 changed files with 515 additions and 217 deletions.
2 changes: 2 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

* Brython licensed by [BSD-3-Clause License](./LICENCE_BSD3Clause.TXT)

* Also used Geolocation Services of [CodeTabs](https://github.com/jolav/codetabs)

> Ubuntu and Canonical are registered trademarks of Canonical Ltd.
> Gnome are registered trademarks of Gnome.
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,24 @@ For introduce the Ubuntu environment' beauty (on web) and for fun. :) I was insp
## To-Do List

* Increase clone apps' functionality
* [12] Create more clone application
* [13] Create more clone application
* [+] Update interface to similar Ubuntu 21.10 interface
* [-] Update interface to similar Ubuntu 22.04 interface

## App Demo Mode

You can present your demo app with that project.

> `https://malisipi.github.io/ubuntu-tour/?[`name`,`icon`,`location`]`
* name: Your app's name
* icon: Your app's icon
* location: Your app's website

> You can't send notification or create a new window. Because your app demo that hosted on another domain will be blocked by CORS policy. If you need to create a more powerful app demo, You can host the project with together your app demo.
> https://malisipi.github.io/ubuntu-tour/?[%22Ubuntu-Tour%22,%22https://malisipi.github.io/ubuntu-tour/%22,%22https://malisipi.github.io/ubuntu-tour/icons/Suru/Suru/scalable/places/start-here-symbolic.svg%22]
## Notes

> Ubuntu Tour is compatible with touch devices. (Window resize on mobile is harder than on computer. And some browsers may not support resize on mobile.)
Expand Down
10 changes: 5 additions & 5 deletions apps/filemanager/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ function goToForward(){

function goTo(){
if (window.event.keyCode == '13'){
alert("It's just a demo :)")
parent.parent.showNotification("It's just a demo :)","","",1250);
}
}

function showMenu(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function showAsList(){
alert("It's just a demo :)")
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function changeLook(){
alert("It's just a demo :)")
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function searchAnything(){
alert("It's just a demo :)")
parent.parent.showNotification("It's just a demo :)","","",1250);
}
2 changes: 1 addition & 1 deletion apps/filemanager/js/folderview.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ function openFile(theFile){
if(theFile=="Tjbk79TARiE.jpg") aboutFile=["../../icons/unsplash/Tjbk79TARiE.jpg","picture"];

if(aboutFile[1]=="picture"){
parent.parent.window_create_special(parent.parent.createRandomWindowID(),'apps/imageviewer/index.html?file='+aboutFile[0],'Image Viewer','icons/Suru/Suru/48x48/apps/image-viewer-app.png');
parent.parent.start_app('eog',"file="+aboutFile[0]);
}
}
2 changes: 1 addition & 1 deletion apps/filemanager/other_locations.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>
<body>
<div class="aboutLocation">On This PC</div>
<div class="item-list" ondblclick="alert('It\'s just a demo :)')">
<div class="item-list" ondblclick="parent.parent.showNotification('It\'s just a demo :)','','',1250);">
<table class="item-list-table">
<tr>
<td class="item-list-table-1"><img draggable="false" class="item-icon" src="../../icons/Suru/Suru/48x48/devices/drive-harddisk.png"/></td>
Expand Down
4 changes: 2 additions & 2 deletions apps/filemanager/trash.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<tr>
<td class="trash-nav-label">Trash</td>
<td class="trash-nav-buttons">
<button onclick="alert('It\'s just a demo :)');">Restore</button>
<button onclick="alert('It\'s just a demo :)');">Empty</button>
<button onclick="parent.parent.showNotification('It\'s just a demo :)','','',1250);">Restore</button>
<button onclick="parent.parent.showNotification('It\'s just a demo :)','','',1250);">Empty</button>
</td>
</tr>
</table>
Expand Down
6 changes: 3 additions & 3 deletions apps/help/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ function goToForward(){
}

function showBookmarks(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function searchbutton(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function showMenu(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function reloadWebpage(){
Expand Down
4 changes: 2 additions & 2 deletions apps/imageviewer/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ function zoomOut(){
}

function doFullscreen(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function showMenu(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function showImage(){
Expand Down
2 changes: 1 addition & 1 deletion apps/libreoffice/calc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</style>
<script>
function itsjustdemo(){
alert("It's just a demo :)");
parent.showNotification("It's just a demo :)","","",1250);
}
</script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion apps/libreoffice/writer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</style>
<script>
function itsjustdemo(){
alert("It's just a demo :)");
parent.showNotification("It's just a demo :)","","",1250);
}
</script>
</head>
Expand Down
10 changes: 5 additions & 5 deletions apps/maps/js/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function myLocation(){
alert("It's just a demo :)")
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function layers(){
alert("It's just a demo :)")
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function zoomIn(){
Expand All @@ -17,15 +17,15 @@ function zoomOut(){
}

function star(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function showMenu(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function goTo(){
if (window.event.keyCode == '13'){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}
}
4 changes: 3 additions & 1 deletion apps/maps/map.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<div id="mapdiv" style="border: none; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%;"></div>
<script src="js/OpenLayers.js"></script>
<script>
_location=JSON.parse(localStorage["location"]);

map = new OpenLayers.Map("mapdiv");
map.addLayer(new OpenLayers.Layer.OSM());

//Set start centrepoint and zoom
var lonLat = new OpenLayers.LonLat( -74.0059,40.7142 )
var lonLat = new OpenLayers.LonLat(_location.longitude,_location.latitude )
.transform(
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
map.getProjectionObject() // to Spherical Mercator Projection
Expand Down
6 changes: 3 additions & 3 deletions apps/settings/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
<div class="bar-container">
<table class="bar">
<tr>
<td class="bar-left">OS name</td>
<td class="bar-right">Ubuntu Impish Indri (development branch)</td>
<td class="bar-left">OS Name</td>
<td class="bar-right">Ubuntu 21.10</td>
</tr>
</table>
<table class="bar">
<tr>
<td class="bar-left">OS type</td>
<td class="bar-left">OS Type</td>
<td class="bar-right">64-bit</td>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/js/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function showMenu(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function searchAnything(){
alert("It's just a demo :)")
parent.parent.showNotification("It's just a demo :)","","",1250);
}
2 changes: 1 addition & 1 deletion apps/settings/js/background.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +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;
localStorage["wallpaper"]="icons/unsplash/"+file;
document.getElementById("theWallpaper").src="../../icons/unsplash/"+file;
}
8 changes: 5 additions & 3 deletions apps/settings/js/side.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ function doActive(obj){
}

function openLocation(thelocation){
if(thelocation=="!") aboutLocation=["",-1];
if(thelocation=="!"){
parent.parent.showNotification("It's just a demo :)","","",1250);
return false;
}
if(thelocation=="Background") aboutLocation=["background.html",3];
if(thelocation=="About") aboutLocation=["about.html",24];

try {
parent.document.querySelectorAll(".special-title")[1].innerHTML=thelocation;
doInactive(parent.document.getElementsByClassName("side-iframe")[0].contentWindow.document.getElementsByClassName("location-active")[0]);
} catch {}
if(aboutLocation[1]!=-1){
parent.document.getElementsByClassName("content-iframe")[0].src=aboutLocation[0];
doActive(parent.document.getElementsByClassName("side-iframe")[0].contentWindow.document.getElementsByClassName("location-inactive")[aboutLocation[1]]);
} else {
alert("It's just a demo :)")
}
}
6 changes: 3 additions & 3 deletions apps/terminal/js/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
newTab = () => {
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

searchAnything = () => {
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

openMenu = () => {
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}
25 changes: 20 additions & 5 deletions apps/terminal/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,28 @@ function runBashCommand(__command){
return 0;
}
writeOutput("user@desktop:"+now_dir+"# "+now_command);
if(__the_command=="mkdir"||__the_command=="rmdir"||__the_command=="cp"||__the_command=="mv"||__the_command=="rm"){
if(parent.parent.check_app(__command.join(" "))){
parent.parent.start_app(__command.join(" "));
}else if(__the_command=="mkdir"||__the_command=="rmdir"||__the_command=="cp"||__the_command=="mv"||__the_command=="rm"){
writeOutput(__the_command+": Read-only file system");
}else if(__the_command==""){
writeOutput("",0);
}else if(__the_command=="apt-get"||__the_command=="apt"||__the_command=="dpkg"){
writeOutput("Package manager is busy now.")
}else if(__the_command=="su"||__the_command=="sudo"){
writeOutput("You are already logged in as root user.")
}else if(__the_command=="uname"){
writeOutput("Linux")
}else if(__the_command=='notify-send'){
parent.parent.showNotification(__command[1],__command[2]);
}else if(__the_command=='wine'){
if(__command.length==1 || __command[1]=="--help"){
writeOutput("Usage: wine PROGRAM [ARGUMENTS...] Run the specified program\n wine --help Display this help and exit\n wine --version Output version information and exit");
} else if(__command[1]=="--version"){
writeOutput("wine-6.21")
} else {
writeOutput("Uygulama başlatılamadı veya belirtilen dosya ile ilişkili bir uygulama yok.")
}
}else if(__the_command=="sh"||__the_command=="bash"){
writeOutput(__console_info);
}else if(__the_command=="python3"){
Expand Down Expand Up @@ -116,10 +130,11 @@ function runBashCommand(__command){
}
}else if(__the_command=="help"){
writeOutput("\
mkdir rmdir cp mv rm\n\
apt-get apt dpkg su sudo\n\
sh bash echo help clear\n\
cd ls dir python3 ")
mkdir rmdir cp mv rm\n\
apt-get apt dpkg su sudo\n\
sh bash echo help clear\n\
cd ls dir python3 uname\n\
notify-send wine")
}else{
writeOutput(__the_command+": Command not found")
}
Expand Down
6 changes: 4 additions & 2 deletions apps/weather/app.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<body>
<div class="current-weather" >
<img id="current-logo" draggable="false" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1'%3E%3C/svg%3E">
<div id="current-location">New York</div>
<div id="current-location"></div>
<div id="current-temp">0 °C</div>
</div>
<div class="weather-daily"></div>
Expand Down Expand Up @@ -165,7 +165,9 @@
document.querySelector("#current-logo").src=_weather_codes[data["current_weather"]["weathercode"]];
document.querySelector("#current-temp").innerHTML=Math.round([data["current_weather"]["temperature"]])+"°C";
};
xhttp.open("GET", "https://api.open-meteo.com/v1/forecast?latitude=40.71&longitude=-74.01&daily=weathercode,temperature_2m_max,temperature_2m_min&current_weather=true&timezone=Europe%2FLondon", true);
_location=JSON.parse(localStorage["location"]);
document.querySelector("#current-location").innerHTML=_location.country_name+", "+_location.city;
xhttp.open("GET", "https://api.open-meteo.com/v1/forecast?latitude="+_location.latitude+"&longitude="+_location.longitude+"&daily=weathercode,temperature_2m_max,temperature_2m_min&current_weather=true&timezone=Europe%2FLondon", true);
xhttp.send();
</script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions apps/weather/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ function reload(){
}

function showMenu(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function hourly(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function daily(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}
6 changes: 3 additions & 3 deletions apps/webbrowser/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ function goToForward(){
}

function openNewTab(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function showBookmarks(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function goTo(){
Expand All @@ -26,7 +26,7 @@ function goTo(){


function showMenu(){
alert("It's just a demo :)");
parent.parent.showNotification("It's just a demo :)","","",1250);
}

function reloadWebpage(){
Expand Down
2 changes: 1 addition & 1 deletion apps/wine/notepad.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</style>
<script>
function itsjustdemo(){
alert("It's just a demo :)");
parent.showNotification("It's just a demo :)","","",1250);
}
</script>
</head>
Expand Down
Loading

0 comments on commit 98f25cb

Please sign in to comment.