-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbind.html
More file actions
83 lines (74 loc) · 3.24 KB
/
Copy pathbind.html
File metadata and controls
83 lines (74 loc) · 3.24 KB
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
<!DOCTYPE html>
<html>
<head>
<title>OpenCrop Upload</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link href="//netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" media="screen">
<style>
.jumbotron h1, .jumbotron p {
padding-left: 60px;
padding-right: 60px;
}
.col-md {
margin: 0 auto;
max-width: 500px
}
</style>
<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fingerprintjs2/1.5.1/fingerprint2.min.js"></script>
<script src="http://chriszarate.github.io/sheetrock/dist/sheetrock.min.js"></script>
<script src="https://apis.google.com/js/api.js"></script>
<script src="app.js"></script>
<link href="https://sdkcarlos.github.io/sites/holdon-resources/css/HoldOn.css" rel="stylesheet">
<script src="https://sdkcarlos.github.io/sites/holdon-resources/js/HoldOn.js"></script>
<script>
$(function(){
$('#upload_name').val(decodeURIComponent(getUrlParameter('name')));
$('#upload_id').val(decodeURIComponent(getUrlParameter('id')));
$.each(get_opencrops(), function(idx, li) {
text = li['fields']['id'] + '. ' + li['fields']['common_names_zh'];
text += ' (' + (li['fields']['variety']?li['fields']['variety']:'') + ' ';
text += (li['fields']['variety_zh']?li['fields']['variety_zh']:'') + ')';
$('#opencrop_id').append($("<option></option>").attr("value", li['id']).text(text));
});
$("#activity_form").submit(function( event ) {
event.preventDefault();
form = $('#activity_form').serializeArray();
if(binding_opencrop(form[1]['value'], form[2]['value']) && append_opencrop_common_name(form[2]['value'], form[0]['value'])){
alert('Success!');
window.history.back();
} else {
alert('Error!');
};
event.preventDefault();
});
});
</script>
</head>
<body>
<div class="jumbotron">
<!-- <h1>Upload</h1> -->
<p>開放作物資料庫 - 條目綁定</p>
</div>
<div class="col-md">
<form id="activity_form">
<div class="form-group">
<label for="inputdefault">* Source Name</label>
<input class="form-control" id="upload_name" name="upload_name" type="text" readonly>
</div>
<div class="form-group">
<label for="inputdefault">* Source Id</label>
<input class="form-control" id="upload_id" name="upload_id" type="text" readonly>
</div>
<div class="form-group">
<label for="exampleFormControlSelect1">條目</label>
<select id="opencrop_id" class="form-control" name="opencrop_id">
<!-- <option value="" selected></option>; -->
</select>
</div>
<button type="submit" class="btn btn-primary btn-lg btn-block">加入</button>
</form>
</div>
</body>
</html>