• forked:砺波市連絡先一覧
Import an externally hosted application
Check style

  • JavaScript
  • CSS
  • HTML
  • Images
  • Input Data
  • ReadMe
  • forked:砺波市連絡先一覧
  • jquery-1.7.1.min.js  
  •  
  • history

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
 
/*
This is a Example program to retrieve and display the data. 
Press the Run button on the right of the screen (described the behavior of the Example program below). 
Please create a new application rewrite this program work. 
*/
 
//infoウィンドウの初期化
var currentwindow=null;
 
window.onload = function() {
//LinkDataからのデータ取得
    var fileValue = 'suzakacity_contact_app ';
    tmp_a_data = new Array();
 
    $.each(LinkData.getWorks(), function(workKey, workValue) {
        $.each(LinkData.getFiles(workValue), function(fileKey, fileValue) {
            $.each(LinkData.getSubjects(workValue,fileValue),function(subjKey,subjValue) {
                var tmp_data = {}
                tmp_data["id"] = subjValue;
                    $.each(LinkData.getProperties(workValue, fileValue), function(propKey, propValue) {
                        $.each(LinkData.getObjects(workValue, fileValue, subjValue, propValue), function(objKey, objValue) {
                            if(propValue == "http://linkdata.org/property/rdf1s4732i#Department_name"){
                                tmp_data["name"] = objValue;
                            } else if(propValue == "http://linkdata.org/property/rdf1s4732i#telephone_number"){
                            tmp_data["tel"] = objValue;
                            } else if(propValue == "http://linkdata.org/property/rdf1s4732i#email_address"){
                            tmp_data["mail"] = objValue;
                            } else if(propValue == "http://linkdata.org/property/rdf1s4732i#furigana"){
                            tmp_data["kana"] = objValue;
                            } 
                    });
                });
                tmp_a_data.push(tmp_data);
            });
        });
    });
    //全データ
    all_data = tmp_a_data;
    //課のデータを表示
    $(".selectka").append("<option value='-1' selected='selected'>部署を選択してください。</option>");
    for (var i in all_data){
        if (all_data[i].name ){ 
                var all_id=all_data[i].name;
 
            $(".selectka").append("<option value='"+ all_data[i].id +"'>" + all_data[i].name+ "</option>");
        }
        }
 
 
    
    //課が選択、変更された時の処理
    $(".selectka").change(function() {
        //詳細データのリセット
        $("#result").empty();
        
        //選択された課の詳細データの表示
        var sectionKaKey = $("option:selected", $(this)).val();
        if (sectionKaKey == -1) {
            //$("#result").html("");
            return;
        }
        $("#result").append("<div style='padding-left:10px;'>【連絡先】</div>");
        for (var i in all_data){
            var detail_c = sectionKaKey;
            if (all_data[i].id === detail_c){
                $("#result").append("<div style='padding-left:10px;'>"+all_data[i].kana+ "<br/>"+"TEL:" + "<a href=tel:" + all_data[i].tel + ">" + all_data[i].tel + "</a>"+ "</div>");
                $("#result").append("<div style='padding-left:10px;'>Mail:"  + "<a href=mailto:" + all_data[i].mail +  ">" + all_data[i].mail + "</a></div>");
    }
        }
    });
}
 
jquery-1.7.1.min.js
Playing...

jquery-1.7.1.min.js