Skip to content

Commit 7a549ac

Browse files
committedAug 15, 2012
Initial commit of files. Just a jQuery Mobile skeleton without much javascript functionality.
1 parent 8508d28 commit 7a549ac

File tree

8 files changed

+119
-1
lines changed

8 files changed

+119
-1
lines changed
 

Diff for: ‎README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
packyourbag
2-
===========
2+
===========
3+
4+
A tiny App which helps you to pack your bag without forgetting your socks.
5+
Primarily for experimenting with jQuery Mobile [http://jquerymobile.com].

Diff for: ‎images/hanger.png

3.27 KB
Loading

Diff for: ‎images/t_shirt.png

370 Bytes
Loading

Diff for: ‎index.html

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Pack your bag</title>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.min.css" />
8+
<link rel="stylesheet" href="packyourbag.css" />
9+
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
10+
<script src="http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.min.js"></script>
11+
</head>
12+
<body>
13+
14+
<div data-role="page" id="page-list">
15+
16+
<div data-role="header" data-position="fixed" data-theme="b">
17+
<div style="float:left">
18+
<a href="#page-add-item" data-role="button" data-inline="true" data-mini="true" data-icon="plus">Add a thing</a>
19+
</div>
20+
<h1>Pack your bag</h1>
21+
</div>
22+
23+
<div data-role="content">
24+
<div>My bag for <b>5</b> days</div>
25+
<ul id="template-baglist" class="template">
26+
<li id="template-item">
27+
<a href="#">
28+
<img src="images/hanger.png" alt="Symbol of packed item" class="ui-li-icon">
29+
<div class="state-notpacked">Not Packed</div>
30+
<div><span id="template-description">Pairs of Trousers</span></div>
31+
</a>
32+
</li>
33+
</ul>
34+
<ul id="baglist" data-role="listview" data-inset="true" data-filter="false">
35+
<li data-icon="check">
36+
<a href="#">
37+
<img src="images/hanger.png" alt="Symbol of packed item" class="ui-li-icon">
38+
<div class="state-packed">Packed</div>
39+
<div><span class="item-count">4</span> Pairs of Socks</div>
40+
</a>
41+
</li>
42+
<li>
43+
<a href="#">
44+
<img src="images/t_shirt.png" alt="Symbol of packed item" class="ui-li-icon">
45+
<div class="state-notpacked">Not Packed</div>
46+
<div><span class="item-count">5</span> T-Shirts</div>
47+
</a>
48+
</li>
49+
</ul>
50+
</div>
51+
52+
</div>
53+
54+
<div data-role="page" id="page-add-item">
55+
<div data-role="header" data-position="fixed" data-theme="b">
56+
<h1>Add an item to your pack list</h1>
57+
</div>
58+
<div data-role="content">
59+
<div>...</div>
60+
<a href="#page-list" data-role="button" data-inline="true" data-icon="plus">Ok, add this</a>
61+
</div>
62+
</div>
63+
64+
</body>
65+
66+
<script type="text/javascript">
67+
var count = 0;
68+
$("#page-add-item a").click(function(){
69+
var item;
70+
count++;
71+
$("#template-description").html("Test " + count);
72+
item = $("#template-item").clone();
73+
$("#baglist").append(item);
74+
$("#baglist").listview('refresh');
75+
});
76+
</script>
77+
78+
</html>

Diff for: ‎index.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
$(function() {
3+
4+
var html = $('#template1').html();
5+
var data = {
6+
"address": "http://github.com/hij1nx",
7+
"name": "Github"
8+
};
9+
10+
var map = new Plates.Map();
11+
map.where('class').is('link').use('address').as('href');
12+
map.where('class').is('link').use('name');
13+
14+
var output = Plates.bind(html, data, map);
15+
16+
$('#ui').html(output);
17+
$('#ui').html();
18+
19+
});

Diff for: ‎my.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
console.log("my-js running");
2+

Diff for: ‎packyourbag.css

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.item-count {
2+
font-weight: bold;
3+
color: green;
4+
}
5+
.state-packed {
6+
float:right;
7+
color: green;
8+
}
9+
.state-notpacked {
10+
float:right;
11+
font-weight: bold;
12+
color: red;
13+
}
14+
.template {
15+
display:none;
16+
}

Diff for: ‎packyourbag.js

Whitespace-only changes.

0 commit comments

Comments
 (0)
Please sign in to comment.