チェンジセット 198 : SPARQLBuilderWWW/web/jsgui.html

差分発生行の前後
無視リスト:
更新日時:
2014/10/28 15:52:29 (10 年 前)
更新者:
lenz
ログメッセージ:

セレクトボックスのイベントハンドラを変更
内容変更時に自動で読み込みを開始

ファイル:
1 変更

凡例:

変更なし
追加
削除
  • SPARQLBuilderWWW/web/jsgui.html

    r195 r198  
    130130                $("*[name=selectendpoint]").append('<option value="' + ep[i] + '">' + ep[i]); 
    131131        } 
     132        $("*[name=selectendpoint]").change(setEndpoint()); 
    132133} 
    133134 
     
    153154                        $("*[name=startclass] option").remove(); 
    154155                        $("*[name=endclass] option").remove(); 
     156 
     157                        $("*[name=startclass]").append('<option value="startclass">StartClass (Instance num)'); 
     158                        $("*[name=endclass]").append('<option value="endclass">EndClass (Path num)'); 
     159 
    155160                        for (var i = 0; i < epclass.length; i++){ 
    156161                                $("*[name=startclass]").append('<option value="' + epclass[i]["uri"] + '">' + epclass[i]["display"]); 
     
    173178        MAXDEPTH = 0; 
    174179 
    175         document.getElementById("selectpath").innerHTML = ""; 
    176         document.getElementById("showpath").style.display = "none"; 
    177  
    178180        var selstart = $("*[name=startclass]").val(); 
    179181        var selend = $("*[name=endclass]").val(); 
    180182 
    181         ajaxload("view"); 
    182         $.ajax({ 
    183                 type: "GET", 
    184                 url : getPathListURL, 
    185                 data: { 
    186                     ep: sel, 
    187                     startclass: selstart, 
    188                     endclass: selend 
    189                 }, 
    190                 dataType: 'text', 
    191                 success : function(nodes) { 
    192                         jsontext = nodes; 
    193                         pathlimit = 10; 
    194                         view_map(); 
    195                         ajaxload("hide"); 
    196                         document.getElementById("graph").style.top = document.getElementById("menu").offsetHeight + "px"; 
    197                         document.getElementById("ajaxload").style.height = document.getElementById("menu").offsetHeight + "px"; 
    198                 }, 
    199                 error : function(XMLHttpRequest, textStatus, errorThrown) { 
    200                         alert("繝ェ繧ッ繧ィ繧ケ繝域凾縺ォ縺ェ繧薙i縺九�繧ィ繝ゥ繝シ縺檎匱逕溘@縺セ縺励◆�� + textStatus +":\n" + errorThrown); 
    201                         ajaxload("hide"); 
    202                 } 
    203         }); 
     183        if(selstart != "startclass" && selend != "endclass"){ 
     184 
     185                document.getElementById("selectpath").innerHTML = ""; 
     186                document.getElementById("showpath").style.display = "none"; 
     187 
     188                ajaxload("view"); 
     189                $.ajax({ 
     190                        type: "GET", 
     191                        url : getPathListURL, 
     192                        data: { 
     193                            ep: sel, 
     194                            startclass: selstart, 
     195                            endclass: selend 
     196                        }, 
     197                        dataType: 'text', 
     198                        success : function(nodes) { 
     199                                jsontext = nodes; 
     200                                pathlimit = 10; 
     201                                view_map(); 
     202                                ajaxload("hide"); 
     203                                document.getElementById("graph").style.top = document.getElementById("menu").offsetHeight + "px"; 
     204                                document.getElementById("ajaxload").style.height = document.getElementById("menu").offsetHeight + "px"; 
     205                        }, 
     206                        error : function(XMLHttpRequest, textStatus, errorThrown) { 
     207                                alert("繝ェ繧ッ繧ィ繧ケ繝域凾縺ォ縺ェ繧薙i縺九�繧ィ繝ゥ繝シ縺檎匱逕溘@縺セ縺励◆�� + textStatus +":\n" + errorThrown); 
     208                                ajaxload("hide"); 
     209                        } 
     210                }); 
     211        } 
    204212} 
    205213 
     
    279287                        <form name="seclass"> 
    280288                                StartClass<br> 
    281                                 <select size=1 name="startclass" style="width: 200px;"> 
     289                                <select size=1 name="startclass" style="width: 200px;" onChange="setSEClass()"> 
    282290                                </select><br> 
    283291                                EndClass<br> 
    284                                 <select size=1 name="endclass" style="width: 200px;"> 
     292                                <select size=1 name="endclass" style="width: 200px;" onChange="setSEClass()> 
    285293                                </select><br> 
    286294                                <input type="button" name="setclass" value="SetClass" onClick="setSEClass()">