Skip to content

Commit

Permalink
server code
Browse files Browse the repository at this point in the history
  • Loading branch information
kalmera committed Jul 2, 2014
1 parent 1c771d7 commit 95b8964
Show file tree
Hide file tree
Showing 12 changed files with 1,748 additions and 19 deletions.
3 changes: 3 additions & 0 deletions resources/frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<a id="function-button" class="button blue-bg">
main
</a>
<!--<a class="button yellow-bg" href="javascript:goblintNext()">-->
<!--next-->
<!--</a>-->
<a id="global-button" class="button yellow-bg" href="javascript:show_info_self('globals')">
globals
</a>
Expand Down
1 change: 0 additions & 1 deletion resources/iframeResizer.contentWindow.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion resources/jquery.iframeResizer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions resources/node.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<xsl:template match="map">
<xsl:choose>
<xsl:when test="normalize-space(.) != '' or ./@* != ''">
<xsl:for-each select="key" >
<xsl:for-each select="key" >
<xsl:choose>
<xsl:when test="following-sibling::*[1]//value">
<div class="toggle">
Expand Down Expand Up @@ -43,9 +43,9 @@
<xsl:template match="set">
<xsl:choose>
<xsl:when test="normalize-space(.) != '' or ./@* != ''">
<xsl:for-each select="value" >
<xsl:for-each select="value" >
<div class="nontoggle">
<xsl:apply-templates select="." />
<xsl:apply-templates select="." />
</div>
</xsl:for-each>
</xsl:when>
Expand All @@ -60,20 +60,20 @@
<xsl:when test="value//value">
<div class="toggle">
<span>
<xsl:value-of select="@name" />
<xsl:value-of select="@name" />
</span> &#8594;
<div>
<xsl:apply-templates select="value" />
<xsl:apply-templates select="value" />
</div>
</div>
</xsl:when>
<xsl:otherwise>
<div class="nontoggle">
<span class="emph">
<xsl:value-of select="@name" />
<xsl:value-of select="@name" />
</span> &#8594;
<span class="emph">
<xsl:apply-templates select="value" />
<xsl:apply-templates select="value" />
</span>
</div>
</xsl:otherwise>
Expand All @@ -86,22 +86,22 @@
<div class="toggle">
<span>path:</span>
<div>
<xsl:apply-templates select="analysis" />
<xsl:apply-templates select="analysis" />
</div>
</div>
</xsl:when>
<xsl:otherwise>
<div class="nontoggle">
<span>path:</span>
<span>
<xsl:apply-templates select="analysis" />
<xsl:apply-templates select="analysis" />
</span>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="loc">
<xsl:template match="call">
<a target="_top" class="node-wrap">
<xsl:attribute name="href">../frame.html?file=<xsl:value-of select="@file"/>&amp;fun=<xsl:value-of select="@fun"/>&amp;node=<xsl:value-of select="@id" /></xsl:attribute>
<div class="node-id">
Expand Down Expand Up @@ -131,7 +131,7 @@
<script type="text/javascript" src="../script.js"/>
</head>
<body onload="init_node()">
<xsl:apply-templates select="loc" />
<xsl:apply-templates select="loc/call" />
</body>
</html>
</xsl:template>
Expand Down
25 changes: 25 additions & 0 deletions resources/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,31 @@ function show_info_self(x){
window.postMessage("load:1:"+x,"*");
}

// step forward with analysis
function goblintNext() {
// if we know the function then show the graph, else try to show the whole file
if (getURLParameter("file")!=null) {
if (getURLParameter("fun")!=null) {
// we know the function so we can show the graph
$('#file-view-frame-div').load("cfgs/"+encodeURIComponent(encodeURIComponent(getURLParameter("file")))+"/"+getURLParameter("fun")+'.svg?goblint=next',
function f(){
$("#file-view-frame-div svg").attr("width","100%");
$("#file-view-frame-div svg").attr("height","100%");
svgPanZoom.init({selector:"#file-view-frame-div svg"});
});
$('#function-button').text(getURLParameter("fun"));
$('#function-button').attr("href","frame.html?fun="+getURLParameter("fun")+"&file="+getURLParameter("file"));
} else {
// we know the file only, so we show the file listing
$('#file-view-frame-div').empty();
$('#file-view-frame-div').append("<iframe class=\"borderless fill\"src=\"files/"+encodeURIComponent(encodeURIComponent(getURLParameter("file")))+".xml?line="+getURLParameter("line")+"\"></iframe>");

// fix breadcrumbs: function -- not avaliable
$('#function-button').css("display","none");
$('#function-slash').css("display","none");
}
}
}


// select lines from the code-listing
Expand Down
Loading

0 comments on commit 95b8964

Please sign in to comment.