Browse code

new jquery based mobile template added

Rolf Brugger authored on 29.12.2011 22:14:45
Showing 9 changed files

1 1
new file mode 100644
... ...
@@ -0,0 +1,47 @@
1
+<!DOCTYPE html> 
2
+<html> 
3
+<head>
4
+<?php include "$template/incl-head.php"; ?>
5
+</head>
6
+<body> 
7
+<div data-role="page" data-add-back-btn="true" >
8
+
9
+  <div data-role="header">
10
+    <h1>Entry</h1>
11
+	<a href="index.php" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-left jqm-home"  data-ajax='false'>Home</a>
12
+  </div><!-- /header -->
13
+
14
+  <div data-role="content">    
15
+
16
+    <?php include "$template/incl-entry-title.php"; ?>
17
+    
18
+    <?php if($pwdmsg){ ?>
19
+    <p><span class="warning"><?php echo $pwdmsg ?></span></p>
20
+    <?php } ?>
21
+    
22
+    <?php if($entrydeleted){ ?>
23
+      <p><span class="info">Entry <?php echo escape_for_html($t1)."/".escape_for_html($t2) ?> deleted!</span> &nbsp; <a href="index.php" data-role="button" data-icon="home" data-inline="true"  data-ajax='false' data-theme="b">ok</a></p>
24
+    <?php }else{ ?>
25
+      <form name="enterpf" action="index.php" method="post"  autocomplete="off"    data-ajax="false">
26
+      <input name="cat" type="hidden" value="<?php echo escape_for_html($cat) ?>"/>
27
+      <input name="t1"  type="hidden" value="<?php echo escape_for_html($t1) ?>"/>
28
+      <input name="t2"  type="hidden" value="<?php echo escape_for_html($t2) ?>"/>
29
+      <p>
30
+      <div data-role="fieldcontain">
31
+        <label for="name">Passphrase:</label>
32
+        <input id="pf" name="pf" type="password" value="" size="20" maxlength="200" />
33
+      </div>
34
+    
35
+      <input type="submit" data-role="button" name="entrydecrypt" value="Decrypt" /> 
36
+      <input type="submit" data-role="button" name="entryedit" value="Edit" /> 
37
+      <br/>
38
+      <input type="submit" data-role="button" name="entrydelete" value="Delete" data-icon="delete" data-theme="e" /> 
39
+      </p>
40
+      </form>
41
+    <?php } ?>
42
+
43
+  </div><!-- /content -->
44
+</div><!-- /page -->
45
+
46
+</body>
47
+</html>
0 48
new file mode 100644
... ...
@@ -0,0 +1,60 @@
1
+<!DOCTYPE html> 
2
+<html> 
3
+<head>
4
+<?php include "$template/incl-head.php"; ?>
5
+</head>
6
+<body> 
7
+<div data-role="page">
8
+
9
+  <div data-role="header" data-theme="b">
10
+    <h1><?php echo escape_for_html($_POST["cat"]); ?></h1>
11
+	<a href="index.php" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-left jqm-home" data-ajax='false'>Home</a>
12
+  </div><!-- /header -->
13
+
14
+  <div data-role="content">    
15
+
16
+
17
+    <table class="entry">
18
+
19
+	  <tbody>
20
+		  <tr>
21
+		    <th scope="row">Title</th>
22
+		    <td><?php echo escape_for_html($t1) ?></td>
23
+		  </tr>
24
+		  <tr>
25
+		    <th scope="row">Subtitle</th>
26
+		    <td><?php echo escape_for_html($t2) ?></td>
27
+		  </tr>
28
+		  <tr>
29
+		    <th scope="row">URL</th>
30
+		    <td><?php echo escape_for_html( print_url($decfields[2]) ) ?></td>
31
+		  </tr>
32
+		  <tr>
33
+		    <th scope="row">Login</th>
34
+		    <td><?php echo escape_for_html( $decfields[1] )  ?></td>
35
+		  </tr>
36
+		  <tr>
37
+		    <th scope="row">Password</th>
38
+		    <td><?php echo escape_for_html( $decfields[3] )  ?></td>
39
+		  </tr>
40
+          <?php  if(strlen($decfields[8]) > 0){ ?>
41
+		    <tr>
42
+		      <th scope="row"><?php echo escape_for_html( $decfields[8] ) ?></th>
43
+		      <td><?php echo escape_for_html( $decfields[9] ) ?></td>
44
+		    </tr>
45
+          <?php  } ?>
46
+	  </tbody>
47
+    </table>
48
+
49
+  <?php  if(strlen($decfields[$nbencfields]) > 0){ ?>
50
+	<p>
51
+	  <pre><?php echo escape_for_html( $decfields[$nbencfields] ) ?></pre>
52
+	</p>
53
+  <?php  } ?>
54
+    
55
+
56
+  </div><!-- /content -->
57
+</div><!-- /page -->
58
+
59
+</body>
60
+</html>
0 61
new file mode 100644
... ...
@@ -0,0 +1,55 @@
1
+<!DOCTYPE html> 
2
+<html> 
3
+<head>
4
+<?php include "$template/incl-head.php"; ?>
5
+</head>
6
+<body> 
7
+<div data-role="page" >
8
+
9
+  <div data-role="header"  data-theme="b">
10
+    <h1>New Entry</h1>
11
+    <a href="index.php" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-left jqm-home" data-ajax='false'>Home</a>
12
+  </div><!-- /header -->
13
+
14
+  <div data-role="content">    
15
+
16
+
17
+    <form title="Edit Item" class="panel" method="post" action="index.php">
18
+      <!-- h2><?php echo escape_for_html($_POST["cat"]); ?></h2 -->
19
+      <input name="defcat" type="hidden" value="<?php echo escape_for_html($cat) ?>"/>
20
+      <input name="deft1"  type="hidden" value="<?php echo escape_for_html($t1) ?>"/>
21
+      <input name="deft2"  type="hidden" value="<?php echo escape_for_html($t2) ?>"/>
22
+      <input name="mode"   type="hidden" value="<?php echo escape_for_html($mode) ?>"/>
23
+      <ul data-role="listview">
24
+        <li data-role="fieldcontain">
25
+        <label for="name">Existing Category...</label>
26
+        <select name="catdl" size="1" class="category"><option></option>
27
+        <?php
28
+          foreach ($cats as $currcat){
29
+          print "<option".($cat==$currcat ? " selected":"").">".escape_for_html($currcat)."</option>";
30
+          }
31
+        ?>
32
+        </select>
33
+        </li>
34
+        <li data-role="fieldcontain"><label for="name">... or new category</label><input type="text" name="cat" value="" /></li>
35
+
36
+        <li data-role="fieldcontain"><label for="name">Title   </label><input type="text" name="t1" value="<?php echo escape_for_html($t1) ?>" /></li>
37
+        <li data-role="fieldcontain"><label for="name">Subtitle</label><input type="text" name="t2" value="<?php echo escape_for_html($t2) ?>" /></li>
38
+        <li data-role="fieldcontain"><label for="name">URL     </label><input type="text" name="newp2" value="<?php echo escape_for_html($encfields[2]) ?>" /></li>
39
+        <li data-role="fieldcontain"><label for="name">Login   </label><input type="text" name="newp1" value="<?php echo escape_for_html($encfields[1]) ?>" /></li>
40
+        <li data-role="fieldcontain"><label for="name">Password</label><input type="text" name="newp3" value="<?php echo escape_for_html($encfields[3]) ?>" /></li>
41
+        <li data-role="fieldcontain"><label for="name">Note    </label><br/><textarea name="newnote" cols="40" rows="6"><?php echo escape_for_html($encfields[$nbencfields]) ?></textarea></li>
42
+
43
+        <li data-role="fieldcontain"><label for="name">Passphrase</label><input type="password" name="pf" value="" /></li>
44
+      </ul>
45
+
46
+      <br/>
47
+      <input type="submit" data-role="button" name="entrysave" value="save entry" data-icon="check" data-theme="b" /> 
48
+    </form>
49
+
50
+
51
+  </div><!-- /content -->
52
+</div><!-- /page -->
53
+
54
+</body>
55
+</html>
0 56
new file mode 100644
... ...
@@ -0,0 +1,17 @@
1
+    <table class="entry">
2
+
3
+	  <tbody>
4
+		  <tr>
5
+		    <th scope="row">Category</th>
6
+		    <td><?php echo escape_for_html($cat) ?></td>
7
+		  </tr>
8
+		  <tr>
9
+		    <th scope="row">Title</th>
10
+		    <td><?php echo escape_for_html($t1) ?></td>
11
+		  </tr>
12
+		  <tr>
13
+		    <th scope="row">Subtitle</th>
14
+		    <td><?php echo escape_for_html($t2) ?></td>
15
+		  </tr>
16
+	  </tbody>
17
+    </table>
0 18
new file mode 100644
... ...
@@ -0,0 +1,8 @@
1
+<title><?= $pgtitle ?> - Simple Vault</title> 
2
+<meta charset="UTF-8">
3
+<meta name="viewport" content="width=device-width, initial-scale=1"> 
4
+<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
5
+<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
6
+<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
7
+
8
+<!-- script type="text/javascript" src="sv.js"></script -->  
0 9
new file mode 100644
... ...
@@ -0,0 +1,34 @@
1
+<div class="logo"><a href="index.php"><img src="img/logo.png" alt="simplevault logo"/></a></div>
2
+
3
+<form action="index.php" method="get">
4
+<div class="topbar">
5
+  <div class="leftblock">
6
+    <span>
7
+    <a href="index.php"><b>Home</b></a> &nbsp;  &nbsp; 
8
+    <input type="text" name="s" value="<?= htmlspecialchars ($filter) ?>" size ="7" id="inpfield" />
9
+    <input type="image" src="img/go-arr.png" name="image"  title="run filter" />
10
+    </span>
11
+  </div>
12
+  <div class="rightblock"><span><a href="?tools">Tools</a></span></div>
13
+</div>
14
+<div class="catbar">
15
+  <span>Categories: &nbsp; 
16
+    <?php foreach ($cats as $currcat){ ?>
17
+      <a href="?cat=<?php echo urlencode($currcat); ?>"><?php echo escape_for_html($currcat); ?></a> <?php echo " (".svcountcatentries($currcat).")"; ?> &nbsp; 
18
+    <?php } ?>
19
+  </span>
20
+</div>
21
+</form>
22
+
23
+<div class="addentry">
24
+  <a href="?new=1&amp;cat=<?php echo urlencode($defcat) ?>"><img class="button" src="img/add.png" title="add new entry" alt="add new entry" /> add new entry</a>
25
+</div>
26
+
27
+<?php foreach($errormsg as $msg){ ?>
28
+<p><span class="warning"><?php echo escape_for_html($msg) ?></span></p>
29
+<?php } ?>
30
+
31
+<?php foreach($infomsg as $msg){ ?>
32
+<p><span class="info"><?php echo escape_for_html($msg) ?></span></p>
33
+<?php } ?>
34
+
0 35
new file mode 100644
... ...
@@ -0,0 +1,46 @@
1
+<!DOCTYPE html> 
2
+<html> 
3
+<head>
4
+<?php include "$template/incl-head.php"; ?>
5
+</head>
6
+<body> 
7
+<div data-role="page">
8
+
9
+  <div data-role="header" data-theme="b">
10
+    <h1>Simplevault</h1>
11
+    <a href="?new=1" data-icon="add" class="ui-btn-right jqm-add" >New</a>
12
+  </div><!-- /header -->
13
+
14
+  <div data-role="content">	
15
+    <!-- ul data-role="listview">
16
+      <?php foreach ($cats as $currcat){ // 1st level: categories ?>
17
+        <li><a href="#<?php echo strtr($currcat, " ", "_"); ?>"><?php echo $currcat; ?></a></li>
18
+      <?php } ?>
19
+    </ul -->
20
+
21
+  <?php
22
+  // nested list of categories and items 
23
+  print "<ul data-role='listview'>";
24
+  $currcat = "";
25
+  foreach ($vlt as $record){
26
+    $recfields = explode ("\t", $record, $nbfields);
27
+    if($currcat != $recfields[0]){ // new category has started
28
+      if($currcat != ""){print "</li>\n</ul>\n";} 
29
+      print "<li>{$recfields[0]}";
30
+      print "<ul>";
31
+      //print "<ul id=\"".strtr($recfields[0], " ", "_")."\" title=\"{$recfields[0]}\">\n";
32
+      $currcat = $recfields[0];
33
+    }
34
+    $subtitle = "";
35
+    if ($recfields[2]){ $subtitle = " - ".$recfields[2];}
36
+    print "  <li><a href=\"?cat=".escape_for_html($recfields[0])."&t1=".escape_for_html($recfields[1])."&t2=".escape_for_html($recfields[2])."\"  data-ajax='false' >{$recfields[1]} $subtitle</a></li>\n";
37
+  }
38
+  print "</ul>";
39
+  ?>
40
+  </div><!-- /content -->
41
+
42
+</div><!-- /page -->
43
+
44
+</body>
45
+</html>
46
+
0 47
new file mode 100644
... ...
@@ -0,0 +1,40 @@
1
+<?php
2
+  // 2nd level: item titles
3
+  $currcat = "";
4
+  print "<ul title=\"Search Results\" selected=\"true\">\n";
5
+  if(count($records)==0){
6
+    print "<li>no item matching '".$_REQUEST["s"]."'</li>";
7
+  }
8
+  foreach ($records as $recfields){
9
+    if($currcat != $recfields["cat"]){ // new category has started
10
+      print "<li class=\"group\">{$recfields['cat']}</li>\n";  // category title
11
+      $currcat = $recfields["cat"];
12
+    }
13
+    $subtitle = "";
14
+    if ($recfields["t2"]){ $subtitle = " - ".$recfields["t2"];}
15
+    print "  <li><a href=\"#".strtr($recfields["cat"].$recfields["t1"].$recfields["t2"]," ","_")."\">{$recfields['t1']} $subtitle</a></li>\n";
16
+  }
17
+  print "</ul>";
18
+?>
19
+
20
+<?php
21
+  // 3rd level: items
22
+  foreach ($records as $recfields){
23
+?>
24
+
25
+<form id="<?php echo strtr($recfields["cat"].$recfields["t1"].$recfields["t2"]," ","_"); ?>" title="Decrypt" class="panel" method="post" action="index.php">
26
+  <h2><?php echo $recfields["cat"]; ?></h2>
27
+  <fieldset>
28
+    <div class="row"><label>Title</label><p class="prow"><?php echo $recfields["t1"]; ?></p></div>
29
+    <div class="row"><label>Subtitle</label><p class="prow"><?php echo $recfields["t2"]; ?></p></div>
30
+  </fieldset>
31
+  <h2>more</h2>
32
+  <fieldset>
33
+    <div class="row"><label>Password</label><input type="password" name="pf" value="" /></div>
34
+  </fieldset>
35
+  <input name="cat" type="hidden" value="<?php echo $recfields["cat"]; ?>"/>
36
+  <input name="t1"  type="hidden" value="<?php echo $recfields["t1"]; ?>"/>
37
+  <input name="t2"  type="hidden" value="<?php echo $recfields["t2"]; ?>"/>
38
+  <input type="submit" name="entrydecrypt" value="decrypt" />
39
+</form>
40
+<?php } ?>
0 41
new file mode 100644
... ...
@@ -0,0 +1,38 @@
1
+/*
2
+.panel p.ptext {
3
+	text-align: left;
4
+	padding: 0 10px 0 10px;
5
+}
6
+
7
+.panel > h2 {
8
+	margin: 3px 0 10px 10px;
9
+}
10
+.row > label {
11
+	position: absolute;
12
+	text-align: right;
13
+	width: 80px;
14
+    color: #7388a5;
15
+}
16
+.row > p.prow {
17
+	display:block;
18
+	margin: 0;
19
+	border: none;
20
+	padding: 12px 10px 0px 100px;
21
+	text-align: left;
22
+	font-weight: normal;
23
+	height: 30px;
24
+}
25
+
26
+select {
27
+	box-sizing: border-box;
28
+	-webkit-box-sizing: border:box;
29
+	width: 100%;
30
+	margin: 15px 0 0 0;
31
+	padding: 6px 6px 6px 144px;
32
+	font-size: 16px;
33
+	font-weight: normal;
34
+}
35
+select.category {
36
+	width: 70%;
37
+}
38
+*/