Mercurial > hg > Members > nobuyasu > html > graphViewer
changeset 18:cfdce8445a14 draft
modified show.html for post edgeInfoId
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 21 Mar 2013 18:43:04 +0900 |
parents | 02b5c7fe5d08 |
children | 3c02336869d4 |
files | show.html |
diffstat | 1 files changed, 38 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/show.html Thu Mar 21 03:56:26 2013 +0900 +++ b/show.html Thu Mar 21 18:43:04 2013 +0900 @@ -1,18 +1,23 @@ #{extends 'main.html' /} #{set title:messages.get('AAEvidenceSiftingModel.userdesktops.show.title') /} -<link rel='stylesheet' href="/aat/public/viewer/css/viewer_form.css"> -<script type="text/javascript" src="@{'/public/viewer/js/lib/jquery-ui-1.8.23-min.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/lib/jquery.ui.touch-punch.min.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/lib/jsBezier-0.4-min.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-util-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-dom-adapter-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-defaults-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-renderers-svg-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-renderers-canvas-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-renderers-vml-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jquery.jsPlumb-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> -<script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jquery.jsPlumb-1.3.15-all-min.js'}" charset="${_response_encoding}"></script> + +#{set 'moreStyles'} + <link rel="stylesheet" href="/aat/public/viewer/css/viewer_form.css"> +#{/set} +#{set 'moreScripts'} + <script type="text/javascript" src="@{'/public/viewer/js/lib/jquery-ui-1.8.23-min.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/lib/jquery.ui.touch-punch.min.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/lib/jsBezier-0.4-min.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-util-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-dom-adapter-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-defaults-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-renderers-svg-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-renderers-canvas-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-renderers-vml-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jquery.jsPlumb-1.3.15-RC1.js'}" charset="${_response_encoding}"></script> + <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jquery.jsPlumb-1.3.15-all-min.js'}" charset="${_response_encoding}"></script> +#{/set} <div id="page"> <div class="title"> @@ -22,7 +27,7 @@ <li>> <a href="@{AAEvidenceSiftingModel.UserHomes.index()}">&{'navigation.back'}</a></li> <li>> <a href="@{AAEvidenceSiftingModel.Projects.show(desktop.id)}">&{'AAEvidenceSiftingModel.projects.show.title'}</a></li> </ul> - + <script type="text/javascript">var _desktopid = ${desktop.id};function desktopid(){return _desktopid;}</script> <div id="traverseDisplay" style='position:fixed; width:250px; height:250px; border:solid 1px; border-radius:5px; opacity:1; z-index:10; visibility:visible;'> <div style='position:absolute; left:0; top:0; width:100%; height:100%; background:black; opacity:0.7;'></div> @@ -59,7 +64,7 @@ <nobr style='position:absolute; width:100%; bottom:5px;'> <span class='button' id="acceptButton" style='position:absolute; width:50px; left:5px; bottom:5px; opacity:1;' value='accept' onclick="statePost($('#acceptButton'));">accept</span> <span class='button' id="rejectButton" style='position:absolute; width:50px; left:65px; bottom:5px; opacity:1; ' value='rejecte' onclick="statePost($('#rejectButton'));">reject</span> - <span class='button' id="lateButton" style='position:absolute; width:50px; left:125px; bottom:5px; opacity:1; ' value='later' onclick="statePost($('#lateButton'));">later</span> + <span class='button' id="retractButton" style='position:absolute; width:50px; left:125px; bottom:5px; opacity:1; ' value='retract' onclick="statePost($('#retractButton'));">retract</span> </nobr> </div> @@ -68,7 +73,6 @@ </div> </div> - <script type="text/javascript"> var BASE_URL = ""; if(!Array.prototype.filter){ @@ -146,7 +150,7 @@ node.position.y = nextY; } return false; - }, + }, _dragEnd : function() { var oElem = DragHandler._oElem; document.onmousemove = null; @@ -302,8 +306,8 @@ showAllEdge(graphData); } -function getEvidence(id, kind, direction) { - var u = "/aat/aaevidencesiftingmodel.userdesktops/get?id="+id+"&kind="+kind+"&direction="+direction; +function getEvidence(id, kind, direction, edgeInfoId) { + var u = "/aat/aaevidencesiftingmodel.userdesktops/get?desktopid="+desktopid() + "&id="+id+"&kind="+kind+"&direction="+direction+"&edgeinfoid="+edgeInfoId; $.ajax({ url:u, success:function(o) { parseJSONGraphData(GRAPH_DATA, o); recursiveCalcPosition(GRAPH_DATA, GRAPH_DATA.nodes[id]); showEdgesAndNodes(GRAPH_DATA, o, kind);}, @@ -327,8 +331,8 @@ postToServer("id="+id+"&state="+state); } -function nodePositionPost(id, coordx, coordy) { - postToServer("id="+id+"&corrdx="+coordx+"&corrdy="+coordy); +function nodePositionPost(id, coordX, coordY) { + postToServer("id="+id+"&coordX="+coordX+"&coordY="+coordY); } function traverseAction() { @@ -343,12 +347,20 @@ } } var id = this.id; + var edgeInfoArray = GRAPH_DATA.nodes[id].property.edgeInfo; + var edgeInfos = {}; + for (var i=0; i<edgeInfoArray.length; i++) { + var edgeInfo = edgeInfoArray[i]; + var kind = edgeInfo.kind; + edgeInfos[kind] = {}; + edgeInfos[kind][edgeInfo.direction] = edgeInfo; + } for (var i=0; i<kinds.length; i++) { var kind = kinds[i]; - if (inDirChecked) getEvidence(id, kind, "in"); - if (outDirChecked) getEvidence(id, kind, "out"); + var edgeInfo = edgeInfos[kind]; + if (inDirChecked && edgeInfo.in) getEvidence(id, kind, "in", edgeInfo.in.id); + if (outDirChecked && edgeInfo.out ) getEvidence(id, kind, "out", edgeInfo.out.id); } - } function createNodeDiv(node) { @@ -630,6 +642,7 @@ } var GRAPH_DATA = new GraphData(); + function startUserDesktopUI() { function showFirstEvidenceList(graphData) { var nodes = graphData.nodes; @@ -644,7 +657,7 @@ function start() { init(); $.ajax({ - url:"/aat/aaevidencesiftingmodel.userdesktops/get", + url:"/aat/aaevidencesiftingmodel.userdesktops/get?desktopid="+desktopid(), success:function(o) { parseJSONGraphData(GRAPH_DATA, o); startUserDesktopUI();}, type:"GET", cache:false, error:function(o) { console.log("first get error : ",o); }