From 960a39f5937a50b4d999a3fc5e7465412eb377a0 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Thu, 21 Aug 2014 14:38:23 +0200 Subject: 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. --- web/public/css/taginfo.css | 5 +++-- web/public/img/sources/projects.16.png | Bin 0 -> 951 bytes web/public/img/sources/projects.24.png | Bin 0 -> 1309 bytes web/public/img/sources/projects.32.png | Bin 0 -> 2658 bytes web/public/img/sources/projects.48.png | Bin 0 -> 4733 bytes web/public/js/taginfo.js | 38 +++++++++++++++++++++++++++++++++ 6 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 web/public/img/sources/projects.16.png create mode 100644 web/public/img/sources/projects.24.png create mode 100644 web/public/img/sources/projects.32.png create mode 100644 web/public/img/sources/projects.48.png (limited to 'web/public') 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 Binary files /dev/null and b/web/public/img/sources/projects.16.png 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 Binary files /dev/null and b/web/public/img/sources/projects.24.png 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 Binary files /dev/null and b/web/public/img/sources/projects.32.png 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 Binary files /dev/null and b/web/public/img/sources/projects.48.png 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; -- cgit v1.2.3