Browse code

mobile layout improvements

Rolf Brugger authored on 30.12.2011 15:44:11
Showing 8 changed files

... ...
@@ -95,6 +95,7 @@ if (preg_match("/android|iphone/i", $_SERVER["HTTP_USER_AGENT"])) {
95 95
 }
96 96
 else{
97 97
   $defaulttemplate = 'tpl-std';
98
+  $defaulttemplate = 'tpl-mobile';
98 99
 }
99 100
 
100 101
 // Override template using HTTP GET variable. Mostly for debugging purposes
... ...
@@ -186,11 +187,13 @@ if(isset($_POST['entrysave'])){
186 187
     include "$template/entryform.php";
187 188
     return;
188 189
   }
190
+  /*
189 191
   else if(!isset($_POST['newp3']) or strlen($_POST['newp3'])==0){
190 192
     $errormsg[] = "Could not save entry: no password set.";
191 193
     include "$template/entryform.php";
192 194
     return;
193 195
   }
196
+  */
194 197
   else if ($forcesamepf == 'a' and count($vlt)>=1 and svcountdecodeableentries($_POST['pf'], "")==0){
195 198
     $errormsg[] = "Could not save entry!";
196 199
     $errormsg[] = "You have entered an invalid pass phrase. All entries have to be encoded with the same pass phrase. Go back an use the same pass phrase that was used to encode the other entries.";
... ...
@@ -359,7 +362,7 @@ if (isset($_GET['edt']) or isset($_POST['entryedit']   ) ){ $decrmode = "edit";
359 362
 
360 363
 if(isset($decrmode)) {
361 364
   // decrypt the specified entry
362
-  print_r($_POST);
365
+  //print_r($_POST);
363 366
 
364 367
   // for security reasons, strip off all html special characters
365 368
   $pf  = escape_for_db($_POST['pf']);
... ...
@@ -371,10 +374,8 @@ if(isset($decrmode)) {
371 374
   if (isset($_POST['entrydecrypt']) or isset($_POST['entrydelete']) or isset($_POST['entryedit'])){
372 375
     // find and decrypt it
373 376
     $i = entry_index($vlt, $cat, $t1, $t2);
374
-print "found? ";
375 377
 
376 378
     if ($i >= 0){
377
-print " YES ";
378 379
       $recfields = explode ("\t", $vlt[$i], $nbfields);
379 380
       $decfields = svdecrypt($pf, $recfields[$nbfields-1]);
380 381
       if ($decfields[0] == $preamble){
... ...
@@ -427,7 +428,6 @@ print " YES ";
427 428
       }
428 429
     }
429 430
     else{
430
-print " NO ";
431 431
       $errormsg[] =  "Internal Error: Could not find an entry to decrypt.";
432 432
     }
433 433
   }
... ...
@@ -7,13 +7,13 @@
7 7
 <div data-role="page" data-add-back-btn="true" >
8 8
 
9 9
   <div data-role="header">
10
-    <h1>Entry</h1>
10
+    <h1>View/Modify Entry</h1>
11 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 12
   </div><!-- /header -->
13 13
 
14 14
   <div data-role="content">    
15
-
16 15
     <?php include "$template/incl-entry-title.php"; ?>
16
+    <?php include "$template/incl-titlebar.php"; ?>
17 17
     
18 18
     <?php if($pwdmsg){ ?>
19 19
     <p><span class="warning"><?php echo $pwdmsg ?></span></p>
... ...
@@ -29,7 +29,7 @@
29 29
       <p>
30 30
       <div data-role="fieldcontain">
31 31
         <label for="name">Passphrase:</label>
32
-        <input id="pf" name="pf" type="password" value="" size="20" maxlength="200" />
32
+        <input id="pf" name="pf" type="password" value="" size="20" maxlength="200" class="passphrase" />
33 33
       </div>
34 34
     
35 35
       <input type="submit" data-role="button" name="entrydecrypt" value="Decrypt" /> 
... ...
@@ -12,6 +12,7 @@
12 12
   </div><!-- /header -->
13 13
 
14 14
   <div data-role="content">    
15
+  <?php include "$template/incl-titlebar.php"; ?>
15 16
 
16 17
 
17 18
     <table class="entry">
... ...
@@ -21,22 +22,30 @@
21 22
 		    <th scope="row">Title</th>
22 23
 		    <td><?php echo escape_for_html($t1) ?></td>
23 24
 		  </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>
25
+          <?php  if(strlen($t2) > 0){ ?>
26
+		    <tr>
27
+		      <th scope="row">Subtitle</th>
28
+		      <td><?php echo escape_for_html($t2) ?></td>
29
+		    </tr>
30
+          <?php  } ?>
31
+          <?php  if(strlen($decfields[2]) > 0){ ?>
32
+		    <tr>
33
+		      <th scope="row">URL</th>
34
+		      <td><?php echo escape_for_html( print_url($decfields[2]) ) ?></td>
35
+		    </tr>
36
+          <?php  } ?>
37
+          <?php  if(strlen($decfields[1]) > 0){ ?>
38
+		    <tr>
39
+		      <th scope="row">Login</th>
40
+		      <td><?php echo escape_for_html( $decfields[1] )  ?></td>
41
+		    </tr>
42
+          <?php  } ?>
43
+          <?php  if(strlen($decfields[3]) > 0){ ?>
44
+		    <tr>
45
+		      <th scope="row">Password</th>
46
+		      <td><?php echo escape_for_html( $decfields[3] )  ?></td>
47
+		    </tr>
48
+          <?php  } ?>
40 49
           <?php  if(strlen($decfields[8]) > 0){ ?>
41 50
 		    <tr>
42 51
 		      <th scope="row"><?php echo escape_for_html( $decfields[8] ) ?></th>
... ...
@@ -7,11 +7,12 @@
7 7
 <div data-role="page" >
8 8
 
9 9
   <div data-role="header"  data-theme="b">
10
-    <h1>New Entry</h1>
10
+    <h1>Edit Entry</h1>
11 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 12
   </div><!-- /header -->
13 13
 
14 14
   <div data-role="content">    
15
+  <?php include "$template/incl-titlebar.php"; ?>
15 16
 
16 17
 
17 18
     <form title="Edit Item" class="panel" method="post" action="index.php">
... ...
@@ -38,9 +39,12 @@
38 39
         <li data-role="fieldcontain"><label for="name">URL     </label><input type="text" name="newp2" value="<?php echo escape_for_html($encfields[2]) ?>" /></li>
39 40
         <li data-role="fieldcontain"><label for="name">Login   </label><input type="text" name="newp1" value="<?php echo escape_for_html($encfields[1]) ?>" /></li>
40 41
         <li data-role="fieldcontain"><label for="name">Password</label><input type="text" name="newp3" value="<?php echo escape_for_html($encfields[3]) ?>" /></li>
42
+        <li data-role="fieldcontain"><label for="name">(Custom)</label><br/>
43
+                                     <input type="text" name="newp8" value="<?php echo escape_for_html($encfields[8]) ?>" class="speclabel" />
44
+                                     <input type="text" name="newp9" value="<?php echo escape_for_html($encfields[9]) ?>" class="speccontent"/></li>
41 45
         <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 46
 
43
-        <li data-role="fieldcontain"><label for="name">Passphrase</label><input type="password" name="pf" value="" /></li>
47
+        <li data-role="fieldcontain"><label for="name">Passphrase</label><input type="password" name="pf" value="" class="passphrase" /></li>
44 48
       </ul>
45 49
 
46 50
       <br/>
... ...
@@ -2,6 +2,7 @@
2 2
 <meta charset="UTF-8">
3 3
 <meta name="viewport" content="width=device-width, initial-scale=1"> 
4 4
 <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
5
+<link rel="stylesheet" href="tpl-mobile/tpl.css" />
5 6
 <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
6 7
 <script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
7 8
 
... ...
@@ -1,34 +1,7 @@
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 1
 <?php foreach($errormsg as $msg){ ?>
28
-<p><span class="warning"><?php echo escape_for_html($msg) ?></span></p>
2
+<p><div class="warning"><?php echo escape_for_html($msg) ?></div></p>
29 3
 <?php } ?>
30 4
 
31 5
 <?php foreach($infomsg as $msg){ ?>
32
-<p><span class="info"><?php echo escape_for_html($msg) ?></span></p>
6
+<p><div class="info"><?php echo escape_for_html($msg) ?></div></p>
33 7
 <?php } ?>
34
-
... ...
@@ -1,38 +1,29 @@
1
-/*
2
-.panel p.ptext {
3
-	text-align: left;
4
-	padding: 0 10px 0 10px;
1
+th[scope="row"] {
2
+	text-align: right;
3
+	padding-right: 10px;
4
+}
5
+*.warning{
6
+	font-weight: bold;
7
+	color: #990806;
8
+	background-color: #ff7b7a;
9
+	border: 2px solid #990806;
10
+	margin-bottom: 0.5px;
11
+}
12
+*.info{
13
+	font-weight: bold;
14
+	color: #008f58;
15
+	background-color: #cefa8b;
16
+	border: 2px solid #008f58;
17
+	margin-bottom: 0.5px;
5 18
 }
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
-*/
19
+input.speclabel{
20
+	width: 25%;
21
+	display: inline;
22
+}
23
+input.speccontent{
24
+	width: 60%;	
25
+	display: inline;
26
+}
27
+input.passphrase{
28
+	background-color: #a4e0fc;
29
+}
39 30
\ No newline at end of file
... ...
@@ -1,5 +1,5 @@
1 1
 Accounts	AAA test	subtitle	1262997216						%94%154mf%A6%DA%CC%AErw%1E%B3%F3%0C%7Fw%C6%81%84%97pL%8B%CD%A7%1F%80%09Z%D4E%3B%9Ex%23%ABe%B3%DFq%90E%EDP%CEY%CE%05%B7%3DY%CAs%FD%E7%95%7D%29z5%B9%C4%B3%F3%DAo%03%02%23%7D%DD%EF%8EB%F7%E3%B7L7%1A%F4_%A71%9A%FC%A00%C4%D0%08%FC%0E%7F%FB
2
-Accounts	Amazon	S3	1261323488						%2A%29%A7%ECcU%1Am%01Ov%A8%D7%DF%BC%D5%07%BE%ECN%F0%16%EA%19U%8D%E4%99%9C%DC%0B%B1%C5%86%F3%920m%13%AC4%FE%BB%E2%22D%DF%B1%D4%B3py%AE%3A%DC%8E%00w%BF%B4%AD%1B_S%FE-%E4%01%02%19%1A%2FQG%D6%12%8Cp%119X%85%3C%8C%C12Jx%A2%11l%E0%CEf%B5%8F%2AS%8C4%7Bw%F0u%9D%7C%89Gm%29%3FH%81%E1%BD%CFc2%A8%FE%01%90%BF%8C%84%195%FE%F8%03%AE%E4%CF%2A%E0d%84%DB%1E%B7%C2%C6%3D%8E%90%E2%92sf%95%AE%5B%03s%C8%83%F4%C4%2A%2A%EF%D93%F7k%C2%A2%5D%92%2A%0B%23%A4%1D%CD%CB%13%ABH%E54%C4T%3C%D8%D6%1Cm%AA7%E7%A4%08%A9%BD%EA%8B%16%14%CB%1Bf%21%60%FE%FB%11%E5%BB%E7%18%A3%E6R%B0%19%5B%AFc%0D%8A%D01%E3%FC%84l%D2%EA%3D%D6%93%C9%3A%3C%99%8B%01l%CD%7E%ACEX%EF%08%5C%FC%2C7%13%5B%91%3A%A9%AE%2C%90%CF1%B8%9EJ%1F%0F%2F%CCH3%B0%A9%87jk9b%C3%9E%FB%02%A2%DA%D5%98%E9n8%92%25%9F%F4%90%D2%0D%03%BB%F9qX%CA%00%E9%5B%C5%FA%A2%94%9A11%DD%10%B1%89%5C%19%19%94%5B%8CA%94%3EA%EA%86%FF%AB%A3%5ES%C1%91%E2%B1%C9QP%D0%1Ac%A9%7CeDeI%29%F5%9A%23%83%B6l%B1%D9%87S%DFg%94%15%00%A5%D0%C5%91%B4%60%15Wl%BE%AB%1E%12I%25%90%F5%F2%01%A17%16%29%2F%23FO%3C%82%B7%8F%ADJ%7B%F7%1A%06%AE%C9%E9u%F4gpk%92A%CD%C7%3Al%86i%9B%5E%81K%11%F5%F0%DC%2A2%60%0AU%3DN%DD%97%FB%7D%947%A4%F9%F4%CD4%1E%13%16%ED%2B%D1
2
+Accounts	Amazon	S3	1325255551						%F8%0C%A3i%1EU8L%B1%CA%B0%1FG%1C%B8C%18%C3%D3%8E%60a%80%90U%19LG%D6%B31C%40%AA%15%B8%C1%AB%C0%91D%17uM%FD%1D%AB%FC%C0%29b%E8%00m%92%BD%2F%D4%28%D4%E0%E84%D6%FA%E4%3Ew%28%40%F7%A5%F2Z%19%89%26%FA%94%03%ACUS%C1n.z%D9%D9n%80%EDo%3D%A6%B2%A3%AD%B7%C7%E2W%F89%F1O%89N%25%1Fg%3E%1F%26o%24hUT%21%E4%1E%9Aqk%959c%91%A5%5B%AD%9D%40%7Ef%C4%14%85%D5%8A%9Cp%B6%3A%F0%A5X%FE%CE%99%99%82g%88%04%D8%F3%B2%17%11%EC%F6%E5%C9n%16%BEF%A9%01%F5%13%81%5D%EB%E3ZR%1EH%22%1F%00%BD+%FFx%F8%B9%05%C6QF%EF%C4%EE%E0%C9%CEb%F3%3A%9CF%2F%15%84%D0%7E11%D3%AAx%5B%27l%C6%F2%C8%85u%80%95%25%E4W%CBX%DE%E5%05%CC%D7%19J%DB%00%12%B5%26r%92b%EAd%B9%96%92%0C%95%D7%E1BaSK%85%BB%5C%89%DE2%C3%8B%3FT%09%05%1F%C4Q%3D%98i%D1%DE%EA%D3aNg%0D%14%0C%01%CD%18g%BCf%9B%2Bq%19%88%A1%7D%80%C1%EC%86%A2%5D%12%CBn%B8%E3P%F5%AFN%BF%FB%E8%9F%D9%92%11%FA%25%04%27%04%063%E9A%81w%85O.%5D%2A%3F%FA%8D%AA%FD%9B%990%9E%FBv.K%16%7F%1C83%B4%5B%9A%BF%B6_q%0D%1C%7C%E1%E7%DDc8%E3%8E%F4%16%BF%D0%0F%DA%F1%8B%88%CA%F1%E3HK%24%01%1FO%C3H%DA%E0%FB%E2%C1%99%86%FD%F1r1%A6%88%88%C0%3B.%10%1E%FFo%F3T%19HJ%82%9C%BE%EF9Fs%12%FB%C4%EC%D9%93lI%40e%7B%28%87%5DQ%E9%25g%C8%15%21%9F%09
3 3
 Accounts	Amazon	Store	1261323535						%24g%5C%1D%DE%1FW%18%00%DF%03%E0%1F%0Fj%B1%8D%3D%7F.%19%CC%D9%E8s%15%13W%CB%8C%9C%DE%E6%5C%95%F1%14%FB%B1%05%16%13%E0%22%9D%E0%86V%5C%CA%FCR%B1%9CY%D4%E33%99%A4%C8%AD%AC%94
4 4
 Accounts	Apple	Developer	1261326629						%A4%11%FA%F0q%D5%0C%7F%B3%2B%CA%E8%2C%EC%17%DDCaoX%BA%16%5E%16%A5%BB%5Ec%CD%95%E8%89%DA%2F%B9%2F%F2eA%BBQ%87%E5%96%29%00%9A%17%8C%E2%CAf%22%B1%9C%C4%F0%284%D9%ED%24%F9_
5 5
 Accounts	Apple	iTunes Store	1261327367						1%10%D1%879%7C%5E%0F%CC%0C%98i%C0%FEYCj%B55%A6%05%BF%DA%10%F6%863%9A%13Fg%BBh%1C%23%C2%CD%98%F6%0DyBZd%01%DE%2A%F6%5D%F3%83%C2%94%8B%09%BA%C4%9DR%A6K%3E%A0%0D