Skip to content

Commit 45e3739

Browse files
committed
Version build
1 parent 373802b commit 45e3739

File tree

5 files changed

+207
-15
lines changed

5 files changed

+207
-15
lines changed

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ compilePWA() {
5858
#to include it, no need for compiling it
5959
}
6060

61-
js_to_combine="jquery-1.10.2.min.js bootstrap.min.js bootswatch.js knockout.js system_scripts.js dependency_manager.js general_purpose_scripts.js framework.js"
61+
js_to_combine="jquery-1.10.2.min.js bootstrap.min.js bootswatch.js knockout.js system_scripts.js dependency_manager.js general_purpose_scripts.js framework.js appDefinitions.js"
6262

6363
css_to_combine="blueprint/screen.css bootstrap.css installUninstallSwitch.css"
6464

build.sh~

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
2+
working_directory=$(mktemp -d)
3+
CSS_DIR="$working_directory/usr/libexec/pi-web-agent/css"
4+
WDIR="usr/libexec/pi-web-agent/css"
5+
LAST_MAIN="usr/libexec/pi-web-agent/templates/_main_part2.htm"
6+
FIRST_MAIN="usr/libexec/pi-web-agent/templates/_main_part1.htm"
7+
TEMPLATE_DIR="$working_directory/usr/libexec/pi-web-agent/templates"
8+
composeFiles() {
9+
10+
JS_FILE="$2.$2"
11+
12+
echo "" > $CSS_DIR/$JS_FILE
13+
for part in $1; do
14+
cat $WDIR/$part >>$CSS_DIR/$JS_FILE
15+
done
16+
17+
md5=$(md5sum $CSS_DIR/$JS_FILE | cut -d ' ' -f 1)
18+
mv $CSS_DIR/$JS_FILE $CSS_DIR/${md5}.$2
19+
echo ${md5}.$2
20+
}
21+
22+
appendJSToHTML() {
23+
24+
echo "<html><head><script src='/css/$1'></script>" > $working_directory/$FIRST_MAIN
25+
26+
}
27+
28+
appendCSSToHTML() {
29+
echo "<link rel='stylesheet' href=/css/$1 type='text/css'>" >>$working_directory/$FIRST_MAIN
30+
cat $FIRST_MAIN >> $working_directory/$FIRST_MAIN
31+
sudo cp $working_directory/$FIRST_MAIN $FIRST_MAIN
32+
}
33+
34+
minifyCSS() {
35+
java -jar yuicompressor-2.4.8.jar --type css $CSS_DIR/$1 > pi-web-agent/$WDIR/$1
36+
}
37+
38+
minifyJS() {
39+
java -jar yuicompressor-2.4.8.jar --type js $CSS_DIR/$1 > pi-web-agent/$WDIR/$1
40+
}
41+
42+
start_compiling() {
43+
for file in $(ls *.c); do
44+
filename=$(basename $file '.c')
45+
gcc $file -o "$filename.pwa"
46+
done
47+
rm *.c
48+
}
49+
50+
compilePWA() {
51+
cd usr/libexec/pi-web-agent/cgi-bin/toolkit
52+
start_compiling
53+
cd -
54+
cd usr/libexec/pi-web-agent/cgi-bin/chrome
55+
start_compiling
56+
cd -
57+
#framework.c must be in source form to allow other developers
58+
#to include it, no need for compiling it
59+
}
60+
61+
js_to_combine="jquery-1.10.2.min.js bootstrap.min.js bootswatch.js knockout.js system_scripts.js dependency_manager.js general_purpose_scripts.js framework.js"
62+
63+
css_to_combine="blueprint/screen.css bootstrap.css installUninstallSwitch.css"
64+
65+
66+
mkdir -p $CSS_DIR
67+
68+
COMBINED_JS=$(composeFiles "$js_to_combine" "js")
69+
COMBINED_CSS=$(composeFiles "$css_to_combine" "css")
70+
71+
echo $COMBINED_JS
72+
echo $COMBINED_CSS
73+
74+
mkdir -p $TEMPLATE_DIR
75+
76+
template=$(appendJSToHTML $COMBINED_JS)
77+
echo $template
78+
template=$(appendCSSToHTML $COMBINED_CSS)
79+
echo $template
80+
81+
cd ~ #place yuicompressor-2.4.8.jar to home
82+
minifyCSS $COMBINED_CSS
83+
minifyJS $COMBINED_JS
84+
cd -
85+
86+
compilePWA
87+
88+
#commit current state
89+
git add .
90+
git commit -m "Version build"

usr/libexec/pi-web-agent/css/12e70d61630a2a15a962928bb2063492.js

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

usr/libexec/pi-web-agent/templates/_main_part1.htm

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
21
<html><head>
2+
<html><head><script src='/css/12e70d61630a2a15a962928bb2063492.js'></script>
3+
<link rel='stylesheet' href=/css/1fb0804802c7640e41c50409a4e3789d.css type='text/css'>
4+
5+
36
<script src="/css/jquery-1.10.2.min.js"></script>
4-
<script src="/css/bootstrap.min.js"></script>
5-
<script src="/css/bootswatch.js"></script>
6-
<script src="/css/knockout.js"></script>
7-
<script src="/css/system_scripts.js"></script>
8-
<script src="/css/appDefinitions.js" type="text/javascript"></script>
9-
<link rel="stylesheet" href="/css/blueprint/screen.css" type="text/css" media="screen, projection">
10-
<link href="/css/bootstrap.css" rel="stylesheet" type="text/css">
11-
<link href="/css/installUninstallSwitch.css" rel="stylesheet" type="text/css">
12-
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.min.css">
13-
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.min.js"></script>
14-
<script src="/css/dependency_manager.js"></script>
15-
<script src="/css/general_purpose_scripts.js" type="text/javascript"></script>
16-
<script src="/css/framework.js"></script>
177
<!--[if lt IE 8]>
188
<link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection">
199
<![endif]-->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<html><head><script src='/css/12e70d61630a2a15a962928bb2063492.js'></script>
2+
<link rel='stylesheet' href=/css/1fb0804802c7640e41c50409a4e3789d.css type='text/css'>
3+
<html><head><script src='/css/12e70d61630a2a15a962928bb2063492.js'></script>
4+
<link rel='stylesheet' href=/css/1fb0804802c7640e41c50409a4e3789d.css type='text/css'>
5+
6+
7+
<script src="/css/jquery-1.10.2.min.js"></script>
8+
<!--[if lt IE 8]>
9+
<link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection">
10+
<![endif]-->
11+
<style>
12+
.ui-dialog {
13+
14+
z-index: 8000;
15+
}
16+
#footer {
17+
clear: both;
18+
position: relative;
19+
z-index: 10;
20+
height: 3em;
21+
margin-top: -3em;
22+
}
23+
#footer p {
24+
font-size:0.7em;
25+
}
26+
</style>
27+
28+
<link rel="icon" type="image/png" href="/icons/logo.png">
29+
</head>
30+
<script type="text/html" id="dropdown-menu-template">
31+
32+
</script>
33+
<body class="preview" id="top" data-spy="scroll" data-target=".subnav" data-offset="80">
34+
<header class="jumbotron subhead" id="overview">
35+
<div class="container">
36+
<div class="span24">
37+
<h1>
38+
<a href="/cgi-bin/index.pwa"><img src="/icons/logo.png" width="90" height="90" align="left">The RPi</a>
39+
<a href="https://www.youtube.com/watch?v=utscyzHnRfY"><img src="/icons/agent_logo.png" width="90" height="90" align="right" title="Watch a hamster eating a tiny burrito"></a>
40+
</h1>
41+
<p class="lead">Web-App Agent</p>
42+
</div>
43+
</div>
44+
<div class="container">
45+
<div id="awesome-navbar" class="navbar navbar-default">
46+
<ul class="nav nav-pills" data-bind="foreach: $root.catnames">
47+
<li class="dropdown">
48+
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
49+
<span data-bind="text: name"></span>
50+
<b style="color: white" class="caret"></b>
51+
</a>
52+
<ul class="dropdown-menu" data-bind="foreach: $root.categories[name]">
53+
<li>
54+
<a data-bind="click: $root.navigateTo">
55+
<img data-bind="attr : { src: '/icons/' + icon}" width="16px" height="16px">
56+
<span data-bind="text: title"></span>
57+
<!-- ko if: $data.version -->
58+
<sup><sup data-bind="text: version"></sup></sup>
59+
<!-- /ko -->
60+
</a>
61+
</li>
62+
</ul>
63+
</li>
64+
65+
<!-- /ko -->
66+
</ul>
67+
</div>
68+
</div>
69+
70+
</header>
71+
72+
<div class="container">
73+
74+
<div class="span35">
75+
<div class="well" style="padding: 8px 0;">
76+
<ul id="pwa-live-info" class="nav nav-list">
77+
<li class="nav-header">Information</li></hl>
78+
<li class="divider"></li>
79+
<li id="li_kernel">Kernel: </li>
80+
<li class="nav-list-space"></li>
81+
<li id="li_hostname">Hostname: </li></hl>
82+
<li class="divider"></li>
83+
<li id="li_memory">Memory: </li>
84+
<li class="nav-list-space"></li>
85+
<li id="li_swap">Swap: </li></hl>
86+
<li class="divider"></li>
87+
<li id="li_hard_drive">Hard Drive: </li></hl>
88+
<li class="divider"></li>
89+
<li id="li_update">Update</li>
90+
<li class="nav-list-space"></li>
91+
<li id="li_temp">Temperature</li>
92+
</ul>
93+
</div>
94+
<p align="center"><img src="/icons/hackathon.jpeg" width="70" height="30"> HackManchester 2013<br>University Challenge Winner Team</p>
95+
</div>
96+
97+
98+
<div class="span23">
99+
100+
<h2 id="extension-title"></h2>
101+
<div id="extension-main-view">
102+
<div id="progress-ui"></div>

0 commit comments

Comments
 (0)