summaryrefslogtreecommitdiff
path: root/web/public
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2014-08-21 14:38:23 +0200
committerJochen Topf <jochen@topf.org>2014-08-21 14:38:23 +0200
commit960a39f5937a50b4d999a3fc5e7465412eb377a0 (patch)
treeafd6af6c77f8f30e862ed80c3f2b3279d577e9f0 /web/public
parentcd12010108e17dfab6ebf6f2902663430505bcfe (diff)
downloadtaginfo-960a39f5937a50b4d999a3fc5e7465412eb377a0.tar
taginfo-960a39f5937a50b4d999a3fc5e7465412eb377a0.tar.gz
Add new 'projects' source.
Any kind of project using OSM tags can create a json-formatted taginfo project file and after its URL is added to the taginfo config, taginfo will integrate this data into its database.
Diffstat (limited to 'web/public')
-rw-r--r--web/public/css/taginfo.css5
-rw-r--r--web/public/img/sources/projects.16.pngbin0 -> 951 bytes
-rw-r--r--web/public/img/sources/projects.24.pngbin0 -> 1309 bytes
-rw-r--r--web/public/img/sources/projects.32.pngbin0 -> 2658 bytes
-rw-r--r--web/public/img/sources/projects.48.pngbin0 -> 4733 bytes
-rw-r--r--web/public/js/taginfo.js38
6 files changed, 41 insertions, 2 deletions
diff --git a/web/public/css/taginfo.css b/web/public/css/taginfo.css
index a5bae87..797074f 100644
--- a/web/public/css/taginfo.css
+++ b/web/public/css/taginfo.css
@@ -558,7 +558,7 @@ table.drilldown td#feature {
/* ========== */
table.desc {
- background-color: #b8b8b0;
+ background-color: #ddddd4;
border-radius: 4px;
padding: 6px;
width: 100%;
@@ -574,8 +574,9 @@ table.desc > tbody > tr > th {
table.desc > tbody > tr > td {
vertical-align: top;
- background-color: #e8e8e4;
+ background-color: #f8f8f8;
padding: 2px 4px;
+ border-radius: 1px;
}
table.apiresults {
diff --git a/web/public/img/sources/projects.16.png b/web/public/img/sources/projects.16.png
new file mode 100644
index 0000000..205216d
--- /dev/null
+++ b/web/public/img/sources/projects.16.png
Binary files differ
diff --git a/web/public/img/sources/projects.24.png b/web/public/img/sources/projects.24.png
new file mode 100644
index 0000000..c959426
--- /dev/null
+++ b/web/public/img/sources/projects.24.png
Binary files differ
diff --git a/web/public/img/sources/projects.32.png b/web/public/img/sources/projects.32.png
new file mode 100644
index 0000000..4759626
--- /dev/null
+++ b/web/public/img/sources/projects.32.png
Binary files differ
diff --git a/web/public/img/sources/projects.48.png b/web/public/img/sources/projects.48.png
new file mode 100644
index 0000000..ff82029
--- /dev/null
+++ b/web/public/img/sources/projects.48.png
Binary files differ
diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js
index 23a0ad7..88f3745 100644
--- a/web/public/js/taginfo.js
+++ b/web/public/js/taginfo.js
@@ -73,6 +73,10 @@ function url_for_rtype(rtype) {
}
}
+function url_for_project(id) {
+ return '/projects/' + encodeURIComponent(id);
+}
+
function url_for_wiki(title, options) {
var path = '//wiki.openstreetmap.org/';
if (options && options.edit) {
@@ -193,6 +197,14 @@ function link_to_rtype(rtype, attr) {
);
}
+function link_to_project(id, name, attr) {
+ return /*img({ src: '/api/v4/project/icon?project=' + id, alt: '' }) + ' ' +*/ link(
+ url_for_project(id),
+ html_escape(name),
+ attr
+ );
+}
+
function link_to_wiki(title, options) {
if (title == '') {
return '';
@@ -205,6 +217,14 @@ function link_to_wiki(title, options) {
);
}
+function link_to_url(url) {
+ return link(
+ encodeURI(url),
+ html_escape(url.replace(/^http:\/\//, '')),
+ { target: '_blank', 'class': 'extlink' }
+ );
+}
+
/* ============================ */
function html_escape(text) {
@@ -685,6 +705,21 @@ function comparison_list_change(key, value) {
return false;
}
+/* ============================ */
+
+function project_tag_desc(description, icon, url) {
+ var out = '';
+ if (icon) {
+ out += img({src: icon, alt: '', width: 16, height: 16}) + ' ';
+ }
+ if (description) {
+ out += html_escape(description) + ' ';
+ }
+ if (url) {
+ out += '[' + link(url, 'More...', { target: '_blank', 'class': 'extlink' }) + ']'
+ }
+ return out;
+}
/* ============================ */
@@ -758,6 +793,9 @@ jQuery(document).ready(function() {
case 75: // k
window.location = '/keys';
break;
+ case 80: // p
+ window.location = '/projects';
+ break;
case 82: // r
window.location = '/relations';
break;