This repository was archived by the owner on Nov 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditor.html
More file actions
176 lines (144 loc) · 4.75 KB
/
editor.html
File metadata and controls
176 lines (144 loc) · 4.75 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>openstreetmap.cz guidepost editor</title>
<!--jQuery-->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<link id="ui-theme" rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.0/themes/ui-lightness/jquery-ui.css"/>
<!--jui_pagination-->
<link rel="stylesheet" type="text/css" href="http://pontikis.github.com/jui_pagination/v2.0.0/jquery.jui_pagination.css"/>
<script type="text/javascript" src="http://pontikis.github.com/jui_pagination/v2.0.0/jquery.jui_pagination.min.js"></script>
<script type="text/javascript" src="http://pontikis.github.com/jui_pagination/v2.0.0/i18n/en.js"></script>
<!-- jeditable -->
<script src="http://www.appelsiini.net/download/jquery.jeditable.mini.js" type="text/javascript"></script>
<script src="wheelzoom.js"></script>
<!--our styleshit-->
<link rel="stylesheet" type="text/css" href="editor.css"/>
<script>
var page = 0;
var page_length = 5;
var gp_count = 0;
function response(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$("#error").html(msg + xhr.status + " " + xhr.statusText);
}
/*alert("done, status:"+ status);*/
}
function get_page_count()
{
return Math.ceil(gp_count / page_length);
}
function left()
{
page--;
if (page < 0) {
page = get_page_count();
}
load_page(page);
}
function right()
{
page++;
if (page > get_page_count()) {
page = 0;
}
load_page(page);
}
function load_page(page)
{
//alert("page " + page);
var from = page * page_length;
var to = from + page_length;
uri = "http://api.openstreetmap.cz/table/get/" + from + "/" + to;
// alert(uri);
$("#new-nav").load("http://api.openstreetmap.cz/table/get/" + from + "/" + to, response);
$("#currpage").html("page:" + page);
$('.edit').editable('http://www.example.com/save.php', {
indicator : 'Saving...',
cancel : 'Cancel',
submit : 'OK',
event : "mouseover",
tooltip : 'Click to edit...'
});
}
function paginator()
{
$(function() {
$("#demo_pag1").jui_pagination({
currentPage: 1,
visiblePageLinks: 8,
totalPages: get_page_count(),
containerClass: 'container1',
useSlider: true,
sliderInsidePane: true,
sliderClass: 'slider1',
showGoToPage: true,
showNavButtons: true,
disableSelectionNavPane: true,
navRowsPerPageClass: 'rows-per-page1 ui-state-default ui-corner-all',
navGoToPageClass: 'goto-page1 ui-state-default ui-corner-all',
onChangePage: function(event, page_num) {
if(isNaN(page_num) || page_num <= 0) {
alert('Invalid page' + ' (' + page_num + ')');
} else {
page = page_num - 1;
load_page(page);
}
},
onSetRowsPerPage: function(event, rpp) {
if(isNaN(rpp) || rpp <= 0) {
alert('Invalid rows per page' + ' (' + rpp + ')');
} else {
alert('rows per page successfully changed' + ' (' + rpp + ')');
$(this).jui_pagination({
rowsPerPage: rpp
})
}
},
onDisplay: function() {
var showRowsInfo = $(this).jui_pagination('getOption', 'showRowsInfo');
var page_num = $(this).jui_pagination('getOption', 'currentPage');
if(showRowsInfo) {
var prefix = $(this).jui_pagination('getOption', 'nav_rows_info_id_prefix');
$("#" + prefix + $(this).attr("id")).text('Total rows: ');
}
page = page_num - 1;
load_page(page);
}
});
// $("#result").html('Current page : ' + $("#demo_pag1").jui_pagination('getOption', 'currentPage'));
});
}
</script>
</head>
<body>
<script>
gp_count = $.ajax({
url: "http://api.openstreetmap.cz/table/count",
async: false
}).responseText;
//alert(gp_count);
paginator();
load_page(1);
</script>
<span style="float:left;"><a href="http://map.openstreetmap.cz"><img src="http://map.openstreetmap.cz/img/guidepost_nice.png"></a></span>
<span style="float:right;"><h1>Guidepost editor</h1></span>
<br><br>
<p><a href="http://map.openstreetmap.cz">See them on the Map</a></p>
<div id="demo_pag1"></div>
<div id="new-nav"></div>
<p>
<a href="#" onclick="javascript:left()"> < </a>
<a href="#" onclick="javascript:right()"> > </a>
<div id="currpage">currpage</div>
</p>
<hr>
<b>Possible Error Response:</b>
<div id="error">none</div>
<br>
<script id='fbswir2'>(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//api.flattr.com/button/view/?uid=walley&button=compact&url='+encodeURIComponent(document.URL);f.title='Flattr';f.height=20;f.width=110;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('fbswir2');</script>
</body>
</html>