Language
Login
Language Setting
X
English
日本語 [Japanese]
about this App
須高地域AED設置場所一覧
useful
1
Loading...
window.onload = function () { var ctv = getParameterFromURL("ctv"); // obtain keyword from the URL "?ctv=" var count = 0; // number of subjects whose URI matches keyword var datas = new Array(); var org = $('#aed'); var update = new Date("1970-01-01"); var date; // 検索 $('#search').click(function(){ showTable(); }); $('#key').keypress( function ( e ) { if ( e.which == 13 ) { showTable(); return false; } }); $('input[name="ocode[]"]').click(function() { showTable(); }); if(ctv != undefined && ctv != "" && $.inArray(ctv,["202070","205419","205435"]) >= 0){ $('#'+ctv).prop('checked', true); }else{ $('#202070,#205419,#205435').prop('checked', true); } function showTable() { count = 0; $("#resultCount").empty(); $('#aed').replaceWith(org.clone()); var tableRow = ''; var ocodes = []; $('input[name="ocode[]"]:checked').each(function() { ocodes.push($(this).val()); }); var newDatas = datas.filter(function(item, index){ if ($.inArray(item['Organization_code'],ocodes) >= 0) return true; }); var key = $("#key").val(); if(key != "") { newDatas = newDatas.filter(function(item, index){ if ((item['設置場所']).indexOf(key) >= 0) return true; }); } for(var num in newDatas) { var data = newDatas[num]; tableRow = '<tr id="rc">' // 行の内容を生成 tableRow += '<td>' + data['分類'] + '</td>'; tableRow += '<td>' + data['設置場所'] + '</td>'; tableRow += '<td>' + data['住所'] + '</td>'; tableRow += '<td>' + (data['電話番号'] ? '<a href="tel:' + data['電話番号'] + '">' + data['電話番号'] + '</a>' : ' ') + '</td>'; tableRow += '<td><a href="http://www.google.com/maps?q=' + data['lat'] + ',' + data['long'] + '" target="_blank">地図</a></td>'; tableRow += '<td>' + (data['備考'] ? data['備考'] : ' ') + '</td>'; tableRow += '</tr>'; $('#aed tr:last').after(tableRow); ++count; } if (count > 0) { $("#resultCount").append(count + " 件のデータを表示しています。"); } }; // Work loop $.each(LinkData.getWorks(), function (workKey, workValue) { // File loop $.each(LinkData.getFiles(workValue), function (fileKey, fileValue) { // Subject loop $.each(LinkData.getSubjects(workValue, fileValue), function (subjKey, subjValue) { var data = {}; $.each(LinkData.getTriplesBySubject(workValue, fileValue, subjValue), function (tripleKey, tripleValue) { var prop = tripleValue.property; var obj = tripleValue.object; var propertyName = getLastName(prop); data[propertyName] = obj; }); date = new Date(data['UpdateDate']); if(date > update) update = date; datas.push(data); }); }); }); $('#title').append("【" + update.getFullYear() + "年" + (update.getMonth()+1) + "月" + update.getDate() + "日現在】"); showTable(); }; // Get a parameter value in URL (e.g. ?paramString=value ) function getParameterFromURL(paramString) { var value = ""; var topWindow = top.window.location.search; if (topWindow) { var q = decodeURIComponent(topWindow.substring(1, topWindow.length)).split("&"); for (var i = 0; i < q.length; i++) { var r = q[i].split("="); if (r[0] == paramString) value = r[1]; } } return value; } // Highlight keyword in the string function highlight(string, keyword) { if (keyword.length > 0) { var ss = string.split(keyword); var len = ss.length; if (len > 1) { string = ss[0]; for (i = 1; i < len; i++) string += "<span class=\"highlight\">" + keyword + "</span>" + ss[i]; } } return string; } // get the last name of the string separated with # and / function getLastName(string) { string = decodeURIComponent(string); var sharp = string.split("#"); var slash = sharp[sharp.length - 1].split("/"); var lastName = slash[slash.length - 1]; return lastName; }
span.highlight {color: red;} span.propertyName {color: gray;} span.subject { color: blue; } span.object{ color: black; } body { background: white; font-family: "Hiragino Kaku Gothic ProN", Meiryo, sans-serif; padding: 1em 2em 4em; } a, a span { text-decoration: underline; } a:hover, a span:hover { text-decoration: none; } .type {} .place {} .address {} .tel { width: 150px; } .map { width: 50px; } .remarks {} /* -------------------------------------------------- coder Table -------------------------------------------------- */ .coder { width: 1200px; table-layout: fixed; border-spacing: 0; border: 1px solid #CCC; -webkit-border-radius: 6px; -moz-border-radius: 6px; -o-border-radius: 6px; border-radius: 6px; box-shadow: 0 1px 1px #CCC; } .coder th, .coder td { padding:10px; background:#FFF; border-bottom:solid 1px #CCC; border-right:solid 1px #CCC; font-family: "Hiragino Kaku Gothic ProN", Meiryo, sans-serif; word-break: break-all; } .coder td a { text-decoration: none; } .coder th { background:#e3dcd5; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset; color: black; } /* ----------------------- 左上角丸 最初の行の最初のセル ----------------------- */ .coder tr:first-child th:first-child, .coder tr:first-child td:first-child { -webkit-border-radius: 6px 0 0 0; -moz-border-radius: 6px 0 0 0; -o-border-radius: 6px 0 0 0; border-radius: 6px 0 0 0; } /* ----------------------- 右上角丸 最初の行の最後のセル ----------------------- */ .coder tr:first-child th:last-child, .coder tr:first-child td:last-child { -webkit-border-radius: 0 6px 0 0; -moz-border-radius: 0 6px 0 0; -o-border-radius: 0 6px 0 0; border-radius: 0 6px 0 0; } /* ----------------------- 左下角丸 最後の行の最初のセル ----------------------- */ .coder tr:last-child th:first-child, .coder tr:last-child td:first-child { -webkit-border-radius: 0 0 0 6px; -moz-border-radius: 0 0 0 6px; -o-border-radius: 0 0 0 6px; border-radius: 0 0 0 6px; } /* ----------------------- 右下角丸 最後の行の最後のセル ----------------------- */ .coder tr:last-child th:last-child, .coder tr:last-child td:last-child { -webkit-border-radius: 0 0 6px 0; -moz-border-radius: 0 0 6px 0; -o-border-radius: 0 0 6px 0; border-radius: 0 0 6px 0; } /* -------------------------------------------- thaed,tbodyを使う場合の設定 -------------------------------------------- */ .coder thead th {background:#e3dcd5;} .coder thead+tbody th {background:#f4ede6;} .coder tbody th {text-align:left;}/*IE*/ /* ----------------------- 左上角丸 thead内 最初の行の最初のセル ----------------------- */ .coder thead tr:first-child th:first-child, .coder thead tr:first-child td:first-child { -webkit-border-radius: 6px 0 0 0; -moz-border-radius: 6px 0 0 0; -o-border-radius: 6px 0 0 0; border-radius: 6px 0 0 0; } /* ----------------------- 右上角丸 thead内 最初の行の最後のセル ----------------------- */ .coder thead tr:first-child th:last-child, .coder thead tr:first-child td:last-child { -webkit-border-radius: 0 6px 0 0; -moz-border-radius: 0 6px 0 0; -o-border-radius: 0 6px 0 0; border-radius: 0 6px 0 0; } /* ----------------------- 角丸なし thaedの後のtbody 最初の行の最初のセル 角丸なし thaedの後のtbody 最初の行の最後のセル ----------------------- */ .coder thead+tbody tr:first-child th:first-child, .coder thead+tbody tr:first-child td:first-child, .coder thead+tbody tr:first-child th:last-child, .coder thead+tbody tr:first-child td:last-child { -webkit-border-radius:0px; -moz-border-radius:0px; -o-border-radius:0px; border-radius:0px; } /* ----------------------- 左下角丸 thaedの後のtbody 最後の行の最初のセル ----------------------- */ .coder thead+tbody tr:last-child th:first-child, .coder thead+tbody tr:last-child td:first-child { -webkit-border-radius: 0 0 0 6px; -moz-border-radius: 0 0 0 6px; -o-border-radius: 0 0 0 6px; border-radius: 0 0 0 6px; } /* ----------------------- 右下角丸 thaedの後のtbody 最後の行の最後のセル ----------------------- */ .coder thead+tbody tr:last-child th:last-child, .coder thead+tbody tr:last-child td:last-child { -webkit-border-radius: 0 0 6px 0; -moz-border-radius: 0 0 6px 0; -o-border-radius: 0 0 6px 0; border-radius: 0 0 6px 0; }
<h1 id="title">須高地域AED設置場所一覧</h1> <div> <label><input type="checkbox" name="ocode[]" value="202070" id="202070">須坂市</label> <label><input type="checkbox" name="ocode[]" value="205419" id="205419">小布施町</label> <label><input type="checkbox" name="ocode[]" value="205435" id="205435">高山村</label> </div> <span class="searchBox"> 設置場所で検索: <input id="key" type="text" name="myext"/> <img id="search" class="searchImage" src="http://app.linkdata.org/asset/95f23270.png"/> </span> <p id="resultCount"></p> <table class="coder" id="aed"> <tr> <th class="type">施設分類</th> <th class="place">設置場所</th> <th class="address">住所</th> <th class="tel">電話番号</th> <th class="map">地図</th> <th class="remarks">備考</th> </tr> </table>
Preview
Input Data
ReadMe
Snapshots
LinkData Work
Table Data
須高地域AED設置場所
Contributor:長野県須坂市
Update:Nov 2, 2022
1818 Downloads, 6 Applications
須高地域(須坂市、小布施町、高山村)AED設置場所(市町村関連施設)
suko_AED
[
]
Add LinkData work(LinkData)
Link http://app.linkdata.org/run/app1s1639i?tab=readme
jquery-1.11.2.min.js
Work
Add
Clear
insert work id or work name.