Skip to content

Commit

Permalink
Enrico has fixed the css bug on scenario gui , Marco has solved a bug…
Browse files Browse the repository at this point in the history
… in the webobject html page and finished implementing the common top menu for every onos webpage!
  • Loading branch information
marco committed Aug 10, 2016
1 parent e738088 commit c423ef3
Show file tree
Hide file tree
Showing 18 changed files with 88 additions and 693 deletions.
6 changes: 3 additions & 3 deletions scp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
scp -r * root@192.168.1.2:/bin/onos
scp -vrC * root@192.168.1.2:/bin/onos

scp -r * root@192.168.1.2:/tmp/onos
scp -vrC * root@192.168.1.2:/tmp/onos






scp -r root@192.168.1.2:/bin/onos/* /tmp/ram/
scp -vrC root@192.168.1.2:/bin/onos/* /tmp/ram/

100 changes: 1 addition & 99 deletions scripts_folder/css/scenarios_list.css
Original file line number Diff line number Diff line change
@@ -1,102 +1,4 @@
/*//////////////////////////////pezzo standard per ogni css////////////////*/

body {
margin: 0;
padding: 0;
background-color: white;
}

#body2 {
position:absolute;
margin: 0;
padding: 0;
background-color: white;
width:100%;
}

a, a:visited {text-decoration:none; color:black;}

a:hover{text-decoration:none; font-weight: bold;}

#image {
display: block;
margin: auto;
height: auto;
}

#container-image{
margin:0 auto;
width:100%;
background-color: black;
}

.divisorio{
height:auto;
background-color: black;
border-bottom: 2px solid #0072ca;
color:#0072ca;
text-align: center;
font-weight: bold;
font-size: 40px;
text-shadow: 2px 2px gray ;/*non supportato da IE9 e precedenti*/
}



/*//////////////////////////////////inizio menu/////////////////////////*/

#container{
margin-left: auto;
margin-right: auto;
margin-top:15px;
position:relative;
width:400px;
height:70px;

}

.menu{

text-align:center;

}

.flex {max-width: 100%}



#play{
width:60px;
height:60px;
position:absolute;

}

#teach{
width:60px;
height:60px;
position:absolute;
left:180px;
bottom:4px;
}

#setup{
width:60px;
height:60px;
position:absolute;
left:340px;
}

.button:hover{top:-10px;}

#footer {
margin: auto;
height:100px;
width:100%;
}


/*//////////////////////////////fine menu-//////////////pezzo standard per css////////////////*/



Expand All @@ -105,7 +7,7 @@ a:hover{text-decoration:none; font-weight: bold;}
/*////////////////////////////////////inizio nuovo scenario///////////////////////////////////*/

.nuovo-container{
margin-top:50px;
margin-top:150px;
margin-left:auto;
margin-right:auto;
position:relative;
Expand Down
2 changes: 1 addition & 1 deletion scripts_folder/globalVar.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
log_enable=0 #enable the log file size check
check_log_len_time=datetime.datetime.today().minute
mail_error_log_enable=1 #enable onos to send mail when an error happens
error_log_mail_frequency=60 #seconds between a error check and another
error_log_mail_frequency=30 #seconds between a error check and another
last_error_check_time=0
mail_where_to_send_errors="electronicflame@gmail.com"

Expand Down
Binary file modified scripts_folder/globalVar.pyc
Binary file not shown.
50 changes: 37 additions & 13 deletions scripts_folder/gui/get_top_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,35 @@
#


top_menu_html='''<!DOCTYPE html>



web_page=''



def getTopMenu(text_to_insert_in_head="",slashes="../"):
'''
| Get a standard html for the menu , the variable slashes contain a string with
| how many "../" as needed to return to the onos main directory-
| it will make the correct relative path for the immages and css.
|
'''

global web_page
relative_path=slashes

#for i in range (0,number_of_slashes):
# relative_path=relative_path+"../"

top_menu_html='''<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="../css/menu.css">
<meta charset="utf-8">
<!--onos_automatic_meta-->
<link rel="stylesheet" href="'''+relative_path+'''css/menu.css">
</head>
<body>
Expand All @@ -22,30 +43,33 @@
<div id="upper-bar-image"><img class="flex" src="../img/upper-bar.png" class="image" /></div>
<div id="upper-bar-image"><img class="flex" src="'''+relative_path+'''img/upper-bar.png" class="image" /></div>
<div id="upper-bar-testo">ONOS House</div>
<div id="container-menu">
<div id="play-button" class="menu-button"><a href="/"><img class="flex" src="../img/play.png" class="image" /></a></div>
<div id="scenario-button" class="menu-button"><a href="scenarios_list/"><img class="flex" src="../img/scenario.png" class="image" /></a></div>
<div id="settings-button" class="menu-button"><a href="/setup/"><img class="flex" src="../img/settings.png" class="image" /></a></div>
<div id="exit-button" class="menu-button"><a href="#"><img class="flex" src="../img/exit.png" class="image" /></a></div>
<div id="play-button" class="menu-button"><a href="/"><img class="flex" src="'''+relative_path+'''img/play.png" class="image" /></a></div>
<div id="scenario-button" class="menu-button"><a href="/scenarios_list/"><img class="flex" src="'''+relative_path+'''img/scenario.png" class="image" /></a></div>
<div id="settings-button" class="menu-button"><a href="/setup/"><img class="flex" src="'''+relative_path+'''img/settings.png" class="image" /></a></div>
<div id="exit-button" class="menu-button"><a href="#"><img class="flex" src="'''+relative_path+'''img/exit.png" class="image" /></a></div>
</div>
<!--fine pezzo standard per header menu e nome pagina 2321--> '''


web_page=top_menu_html

def getTopMenu(text_to_insert_in_head=""):
global web_page





web_page=top_menu_html


tmp_page=web_page[0:web_page.find('<head>')+6]+text_to_insert_in_head+web_page[web_page.find('<head>')+6:]
#warning!!! you have to write exactly "<head>" not "< head>" nor "<head >" nor "<HEAD>"
#the text_to_insert_in_head will be inserted in the start of head html
Expand Down
Binary file modified scripts_folder/gui/get_top_menu.pyc
Binary file not shown.
33 changes: 8 additions & 25 deletions scripts_folder/gui/mod_scenario.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: UTF-8 -*-


from get_top_menu import * #works because there is sys.path.append(lib_dir2) in globalVar.py

scenarios_name_comparison='(mystring=="")'
for scenario in scenarioDict :
Expand Down Expand Up @@ -78,19 +78,9 @@
except:
sel3="0"




html='''
<!-- pezzo standard per header menu e nome pagina -->
<!DOCTYPE html>
<html>
<head>
part_to_insert_in_head='''
<link rel="stylesheet" href="../../css/mod_scenario.css">
<meta charset="utf-8">
<script type="text/javascript">
function checkvalue() {
Expand All @@ -109,23 +99,16 @@
</head>
<body>
<div id="container-image">
<img id="image" src="../../img/header.jpg" class="image" />
</div>
'''

<div id="container">
<div id="play" class="button" ><a href="/"><img class="flex" src="../../img/home.png" class="image" /></a></div>
<div id="teach" class="button" ><a href="/scenarios_list/"><img class="flex" src="../../img/scenario-ico.png" class="image" /></a></div>
<div id="setup" class="button" ><a href="/setup/"><img class="flex" src="../../img/setup-ico.gif" class="image" /></a></div>
</div>

slashes="../../"
html=getTopMenu(part_to_insert_in_head,slashes)

html=html+'''
<br><br><br>
<div class="divisorio">MOD SCENARIO "'''+scenario_to_mod+'''"</div>
Expand Down
25 changes: 6 additions & 19 deletions scripts_folder/gui/pag_creator.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,29 @@
# -*- coding: UTF-8 -*-
import codecs
from get_top_menu import * #works because there is sys.path.append(lib_dir2) in globalVar.py
obj_name_list=zone["objects"]


#with codecs.open("css/play-zone.css",'r',encoding='utf8') as g:
# css_file = g.read()
# css_play_zone=css_file
#g.close()
part_to_insert_in_head='''<!--onos_automatic_page--><!--onos_automatic_javascript--><link rel="stylesheet" href="../css/zone.css"><style type="text/css"><!--onos_automatic_body_style--></style>
play_zone_start_html='''<!DOCTYPE html><html><head><!--onos_automatic_meta--><!--onos_automatic_page--><title>ONOS</title><!--onos_automatic_javascript-->
<meta charset="utf-8">
<link rel="stylesheet" href="../css/zone.css">
<style type="text/css">
'''
html=getTopMenu(part_to_insert_in_head)

<!--onos_automatic_body_style-->
</style>
</head>
play_zone_html=html+'''
<body>
<div id="ReloadThis" >
<div id="container-image">
<img id="image" src="/img/header.jpg" class="image" />
</div>
<div id="container">
<div id="play" class="button" ><a href="/"><img class="flex" src="/img/home.png" class="image" /></a></div>
<div id="teach" class="button" ><a href="/scenarios_list/"><img class="flex" src="/img/scenario-ico.png" class="image" /></a></div>
<div id="setup" class="button" ><a href="/setup/"><img class="flex" src="/img/setup-ico.gif" class="image" /></a></div>
<div id ="system_time"> <!--onos_system_time--> </div>
</div>
'''


web_page=play_zone_start_html+ '''<div class="divisorio">'''+room.upper()+'''</div>'''
web_page=play_zone_html+ '''<div class="divisorio">'''+room.upper()+'''</div>'''



Expand Down
31 changes: 8 additions & 23 deletions scripts_folder/gui/scenario_conditions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# -*- coding: UTF-8 -*-

from get_top_menu import * #works because there is sys.path.append(lib_dir2) in globalVar.py

html=scenario_to_mod

obj_name_comparison='(mystring=="select_an_element")||(mystring2=="select_an_element")'
Expand Down Expand Up @@ -116,15 +117,8 @@



part_to_insert_in_head=''' <link rel="stylesheet" href="../../../css/scenario_conditions.css">
html='''
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="../../css/scenario_conditions.css">
<meta charset="utf-8">
<script type="text/javascript">
function checkvalue() {
Expand All @@ -139,26 +133,17 @@
}
}
</script>
</head>
<body>
<div id="container-image">
<img id="image" src="../../../img/header.jpg" class="image" />
</div>
'''



<div id="container">
<div id="play" class="button" ><a href="/"><img class="flex" src="../../../img/home.png" class="image" /></a></div>
<div id="teach" class="button" ><a href="/scenarios_list/"><img class="flex" src="../../../img/scenario-ico.png" class="image" /></a></div>
<div id="setup" class="button" ><a href="/setup/"><img class="flex" src="../../../img/setup-ico.gif" class="image" /></a></div>
</div>
slashes="../../../"
html=getTopMenu(part_to_insert_in_head,slashes)



html=html+'''
<br><br><br>
<div class="divisorio">CONDITIONS</div>
<div id="body2"><!--serve per dare un riferimento diverso dal body per il potion:relative ovvero dal menu in giù semplifica la costruzione della pagina -->
Expand Down

0 comments on commit c423ef3

Please sign in to comment.