Browse code

add account page (html, css, js)

Dario Rodriguez authored on 23/07/2014 10:27:12
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,77 @@
1
+body {
2
+        font-family: Sans;
3
+        color: #8080a5;
4
+        padding: 0px 0px 0px 0px;
5
+}
6
+
7
+div.banner {
8
+	width: 820px;
9
+        margin-left: auto;
10
+        margin-right: auto;
11
+	float: top;
12
+}
13
+
14
+div.centeredbutton {
15
+        text-align: center;
16
+        width: 450px;
17
+        margin-left: auto;
18
+        margin-right: auto;
19
+}
20
+
21
+
22
+div.settings {
23
+        width: 650px;
24
+        margin-left: auto;
25
+        margin-right: auto;
26
+	margin-top: 20px;
27
+	float: top;
28
+}
29
+
30
+.aligned {
31
+        list-style-type: none;
32
+        padding-left: 30px;
33
+}
34
+
35
+.aligned .label {
36
+        float: left;
37
+        width: 170px;
38
+	margin-top: 14px;
39
+        padding: 4px 10px 0px 0px;
40
+}
41
+
42
+
43
+input.rounded {
44
+        border: 1px solid #ccc;
45
+}
46
+
47
+input.roundedtext {
48
+        border: 0px solid #ccc;
49
+}
50
+
51
+
52
+input.rounded, input.roundedtext {
53
+        -moz-border-radius: 5px;
54
+        -webkit-border-radius: 5px;
55
+        border-radius: 5px;
56
+        font-size: 20px;
57
+        padding: 2px 7px 4px;
58
+        outline: 0;
59
+        -webkit-appearance: none;
60
+        border: 1px solid #eee;
61
+}
62
+
63
+input.rounded:focus, input.roundedtext:focus {
64
+        border: 1px solid #ccc;
65
+        border-color: #339933;
66
+        -moz-box-shadow: 0px 0px 4px 1px rgba(0,0,0,0.3);
67
+        -webkit-box-shadow: 0px 0px 4px 1px rgba(0,0,0,0.3);
68
+        box-shadow: 0px 0px 4px 1px rgba(0,0,0,0.3);
69
+}
70
+
71
+input.roundedtext {
72
+        width: 400px;
73
+        margin: 10px 0px 20px;
74
+        float: right
75
+}
76
+
77
+
0 78
new file mode 100644
... ...
@@ -0,0 +1,22 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+ <meta charset="utf-8"/>
5
+ <title>kakumei account</title>
6
+ <link rel="stylesheet" type="text/css" href="reset.css">
7
+ <link rel="stylesheet" type="text/css" href="account.css">
8
+</head>
9
+<body>
10
+<!-- HEADER_START -->
11
+<!-- HEADER_END -->
12
+   <div class='banner'><img src="banner.png" /></div>
13
+   <div class='centeredbutton'><input class='rounded' id='save' type ='button' value='Guardar'/></div>
14
+   <div class='settings'>
15
+    <p class="aligned">
16
+     <span class='label'>e-mail notificaciones:</span> 
17
+     <input id="email" class="roundedtext" placeholder="e-mail"/>
18
+    </p>
19
+   </div>
20
+ <script src='account.js'></script>
21
+</body>
22
+</html>
0 23
new file mode 100644
... ...
@@ -0,0 +1,48 @@
1
+(function () {
2
+"use strict";
3
+
4
+function request(querytext, func, errorfunc) {
5
+        var req = new XMLHttpRequest();
6
+        req.onreadystatechange = function() {
7
+                if (req.readyState !== 4) {
8
+                        return;
9
+                }
10
+                if (req.status !== 200) {
11
+                        errorfunc();
12
+                        return;
13
+                }
14
+                func(req.responseText);
15
+        };
16
+        req.open("GET",querytext);
17
+        req.send();
18
+}
19
+
20
+function getvar(name) {
21
+        var re=new RegExp("[?&]"+name+"=\([^&]*\)");
22
+        var value=window.location.search.match(re);
23
+        if(value===null || value.length<2)
24
+                return(name+"=");
25
+        return(name+"="+value[1]);
26
+}
27
+
28
+save.onclick = function(e) {
29
+        var requri=[];
30
+        requri.push("/changeemail?");
31
+	requri.push(getvar("s"));
32
+	requri.push("&a=");
33
+        requri.push(encodeURIComponent(document.getElementById("email").value));
34
+        request(requri.join(""),function(r) {
35
+                window.location="/posts.html?"+getvar("s");},function() {});
36
+};
37
+
38
+function refreshemail() {
39
+        request("/getemail?"+getvar("s"), function(r1) {
40
+		document.getElementById("email").value=decodeURIComponent(r1);
41
+        },function() {
42
+		document.getElementById("email").value='';
43
+        });
44
+}
45
+
46
+refreshemail();
47
+
48
+}());