Browse Source

fixing date display in browser

pull/1/head
jngrt 10 years ago
parent
commit
17a82a94fc
  1. 48
      webapp.html

48
webapp.html

@ -10,29 +10,29 @@
<style> <style>
body, html{margin: 0;padding: 0;} body, html{margin: 0;padding: 0;}
body{ body{
font-size:20px; font-size:20px;
text-shadow: 1px 1px orange; text-shadow: 1px 1px orange;
font-family: times, 'times new roman', helvetica,serif; font-family: times, 'times new roman', helvetica,serif;
line-height:1.5em; line-height:1.5em;
color:#444; color:#444;
background:#fff; background:#fff;
background-image: url(css/marble.jpg); background-image: url(css/marble.jpg);
} }
textarea{ textarea{
-webkit-appearance: none; -moz-appearance: none; -webkit-appearance: none; -moz-appearance: none;
display: block; display: block;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
width: 90%; height: 50px; width: 90%; height: 50px;
line-height: 40px; font-size: 17px; line-height: 40px; font-size: 17px;
border: 1px solid #bbb; border: 1px solid #bbb;
-webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;
background-image: url(css/aqua.jpg); background-image: url(css/aqua.jpg);
font-family: inherit; font-family: inherit;
font-size: inherit; font-size: inherit;
font-size: 20px; font-size: 20px;
@ -60,18 +60,18 @@
font-size: 20px; font-size: 20px;
} }
h2{ h2{
font-size: 40px; font-size: 40px;
} }
hr{ hr{
height:10px; height:10px;
border: 10; border: 10;
width:87%; width:87%;
background-image: url(css/bg1.gif); background-image: url(css/bg1.gif);
} }
ul{ ul{
@ -80,7 +80,7 @@
padding-left:30px; padding-left:30px;
} }
li{ li{
word-wrap:break-word; word-wrap:break-word;
list-style: none; list-style: none;
overflow: visible; overflow: visible;
@ -101,7 +101,7 @@
border-bottom-right-radius:123px; border-bottom-right-radius:123px;
border-bottom-left-radius:123px; border-bottom-left-radius:123px;
left:-35px; left:-35px;
width:100%; width:100%;
//overflow:hidden; //overflow:hidden;
position:relative; position:relative;
@ -117,7 +117,7 @@
text-align: center; text-align: center;
} }
#name{ #name{
} }
</style> </style>
@ -128,28 +128,28 @@
<body> <body>
<div id="header"> <div id="header">
<h2>Meshenger</h2> <h2>Meshenger</h2>
</div> </div>
<textarea id="name" rows="1" placeholder="Your Name (leave empty for anonymous)"></textarea> <textarea id="name" rows="1" placeholder="Your Name (leave empty for anonymous)"></textarea>
<textarea id="message" rows="3" placeholder="Your Message"></textarea> <textarea id="message" rows="3" placeholder="Your Message"></textarea>
<button style="width:100%" id="send">Send</button> <button style="width:100%" id="send">Send</button>
<select id="messagesort" name="messageSort"> <select id="messagesort" name="messageSort">
<option value="dateReceived">Sort by Date Received</option> <option value="dateReceived">Sort by Date Received</option>
<option value="dateSend">Sort by Date Send</option> <option value="dateSend">Sort by Date Send</option>
</select> </select>
<ul id="inbox"></ul> <ul id="inbox"></ul>
<!--<h2>outbox</h2>--> <!--<h2>outbox</h2>-->
<ul id="outbox"></ul> <ul id="outbox"></ul>
<script type="text/javascript"> <script type="text/javascript">
/* /*
@ -160,7 +160,7 @@ document.getElementById( 'send' ).onclick = function() {
var outStr = localStorage.getItem( 'outbox' ) || ''; var outStr = localStorage.getItem( 'outbox' ) || '';
if (document.getElementById('name').value == ""){ if (document.getElementById('name').value == ""){
var namm= "anonymous"; var namm= "anonymous";
} }
else{ else{
var namm= document.getElementById('name').value; var namm= document.getElementById('name').value;
} }
@ -276,8 +276,8 @@ function updateInboxView() {
continue; continue;
} }
var date = new Date(parseInt(orderStorage[i].time)); var date = new Date(parseInt(orderStorage[i].time));
// date.setHours(date.getHours() + 2); // date.setHours(date.getHours() + 2);
var datereadable = date.getDate()+"/"+date.getMonth()+"/"+date.getFullYear()+" "+date.getHours()+":"+date.getMinutes(); var datereadable = date.getDate()+"/"+(date.getMonth()+1)+"/"+date.getFullYear()+" "+date.getHours()+":"+date.getMinutes();
contentString += '<li><b>' + datereadable + ' </b>' + ' <i>'+ orderStorage[i].user +'</i><br/> '+orderStorage[i].message+'</li>'; contentString += '<li><b>' + datereadable + ' </b>' + ' <i>'+ orderStorage[i].user +'</i><br/> '+orderStorage[i].message+'</li>';
} }
document.getElementById( 'inbox' ).innerHTML = contentString; document.getElementById( 'inbox' ).innerHTML = contentString;
@ -298,7 +298,7 @@ function onIndex( index ) {
var f = lines[i]; var f = lines[i];
if (f == k){ l = 0; } if (f == k){ l = 0; }
} }
if (l == 1){ if (l == 1){
localStorage.removeItem(k); localStorage.removeItem(k);
} }
} }
@ -310,7 +310,7 @@ updateInboxView();
//localStorage.setItem( ts, lines[i].substr(lines[i].indexOf(' ')) ); //localStorage.setItem( ts, lines[i].substr(lines[i].indexOf(' ')) );
downloadMessage( fname ); downloadMessage( fname );
} }
} }
} }

Loading…
Cancel
Save