This repository has been archived by the owner on Aug 3, 2020. It is now read-only.
forked from axismaps/climatecommons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
submit.html
87 lines (87 loc) · 2.3 KB
/
submit.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Serif|Archivo+Narrow:700,400' rel='stylesheet' type='text/css'>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<style>
body{
font: 13px/16px 'Droid Sans', sans-serif;
padding: 30px;
margin: auto;
background-color: #f2f2f2;
}
h1{
font: bold 24px 'Archivo Narrow', sans-serif;
margin: 10px 0;
}
p{
font: 12px / 16px 'Droid Serif', serif;
color: #666;
}
label input{
width: 100%;
}
#submit{
font-size: 15px;
}
.invalid{
color: red;
}
</style>
</head>
<body>
<h1>Submit a story</h1>
<!-- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> -->
<br /><br />
<label>
<b>Title</b><br />
<input type="text" id="title" />
</label>
<br /><br />
<label>
<b>Source</b><br />
<input type="text" id="source" />
</label>
<br /><br />
<label>
<b>Story URL</b><br />
<input type="url" id="url" />
</label>
<br /><br />
<input type="submit" value="Submit" id="submit" />
</body>
<script type="text/javascript">
$( "#submit" ).click( function()
{
var valid = true;
$( "label input" ).each( function()
{
if( $( this ).val() == "" )
{
$( this ).parent().addClass( "invalid" );
valid = false;
}
else
{
$( this ).parent().removeClass( "invalid" );
}
});
if( valid )
{
$( "label, input" ).fadeOut( "slow" );
$.ajax({
url : "data/submit_story.php",
data : {
"title" : $( "#title" ).val(),
"source" : $( "#source" ).val(),
"url" : $( "#url" ).val()
},
success : function( d )
{
$( "body" ).html( "<h1>Thanks for your submission</h1><p>Your story will be reviewed by our administrators and marked for inclusion on the map</p>" );
}
});
}
});
</script>
</html>