mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 01:52:50 -06:00
RGL browser: bug in "show local". better screen-space usage.
This commit is contained in:
@@ -13,7 +13,6 @@
|
|||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<h1>GF RGL Browser</h1>
|
<h1>GF RGL Browser</h1>
|
||||||
<p style="font-style:italic;margin-top:-0.5em;">Updated 2012-05-15</p>
|
|
||||||
</header>
|
</header>
|
||||||
<div role="main">
|
<div role="main">
|
||||||
<div class="pane left">
|
<div class="pane left">
|
||||||
@@ -72,21 +71,21 @@
|
|||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<h3>About</h3>
|
<h3>About</h3>
|
||||||
<p>A basic tool for looking up module scopes and quickly looking at module sources, created out of necessity. It is experimental and has only been tested on the latest Chrome under Ubuntu. Even then, the page sometimes crashes and has to be closed. All feedback is welcome.</p>
|
<p>A basic tool for looking up module scopes and quickly looking at module sources, created out of necessity. It is experimental and is known to hang when handling large files. All feedback is welcome.</p>
|
||||||
|
|
||||||
<h3>Known issues and To-do</h3>
|
<h3>Known issues and To-do</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Some way of browsing just the API</li>
|
<li>Some way of browsing just the API</li>
|
||||||
<li>Some visual cue for </li>
|
<li>Better visual cues for functions in scope</li>
|
||||||
|
<li>Customised GF syntax highlighting (currently using a Haskell default)</li>
|
||||||
<li>The page sometimes stalls when handling large files (in particular the dictionary modules)</li>
|
<li>The page sometimes stalls when handling large files (in particular the dictionary modules)</li>
|
||||||
<li>Syntax highlighting is using a Haskell default, could cusomtise for GF</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br style="clear:both" />
|
<br style="clear:both" />
|
||||||
</div>
|
</div>
|
||||||
<footer id="footer">
|
<footer id="footer">
|
||||||
<p><em>John J. Camilleri, 2012</em></p>
|
John J. Camilleri. <em>Updated 2012-05-15.</em>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
||||||
<script src="google-code-prettify/prettify.js"></script>
|
<script src="google-code-prettify/prettify.js"></script>
|
||||||
|
|||||||
@@ -34,8 +34,21 @@ $(document).ready(function() {
|
|||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
var clearCode = function(code) {
|
var clearScope = function(msg) {
|
||||||
|
$('#scope_list').empty();
|
||||||
|
updateScopeCount();
|
||||||
|
if (msg) {
|
||||||
|
$('#scope_list').html("<em>"+msg+"</em>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var setScope = function(code) {
|
||||||
|
$('#scope_list').html(code);
|
||||||
|
}
|
||||||
|
var clearCode = function(msg) {
|
||||||
$('#code pre').empty();
|
$('#code pre').empty();
|
||||||
|
if (msg) {
|
||||||
|
$('#codes pre').html("<em>"+msg+"</em>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var setCode = function(code) {
|
var setCode = function(code) {
|
||||||
$('#code pre').html(code);
|
$('#code pre').html(code);
|
||||||
@@ -118,7 +131,7 @@ $(document).ready(function() {
|
|||||||
showPanel(b);
|
showPanel(b);
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
.insertBefore("#loading");
|
.appendTo("#tabbar");
|
||||||
});
|
});
|
||||||
showPanel(".panel:first");
|
showPanel(".panel:first");
|
||||||
|
|
||||||
@@ -139,9 +152,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// Load a tags file
|
// Load a tags file
|
||||||
var loadTagsFile = function(module) {
|
var loadTagsFile = function(module) {
|
||||||
$('#search').val("");
|
clearScope();
|
||||||
$('#scope dl').empty();
|
|
||||||
updateScopeCount();
|
|
||||||
loading(true);
|
loading(true);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "tags/"+module+".gf-tags",
|
url: "tags/"+module+".gf-tags",
|
||||||
@@ -159,7 +170,7 @@ $(document).ready(function() {
|
|||||||
return '<tr class="local" name="'+b+'"><th>'+b+'</th><td>'+c+'</td><td></td><td></td><td>'+anchor+'</td><td>'+s[1]+'</td></tr>'
|
return '<tr class="local" name="'+b+'"><th>'+b+'</th><td>'+c+'</td><td></td><td></td><td>'+anchor+'</td><td>'+s[1]+'</td></tr>'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#scope_list').html(data);
|
setScope(data);
|
||||||
$('#scope_list a').click(function(){
|
$('#scope_list a').click(function(){
|
||||||
var href = $(this).attr('href');
|
var href = $(this).attr('href');
|
||||||
var m = href.match(/([^\/]+)\/([^\/]+)\.(gf(-tags)?)(:\d+)?/);
|
var m = href.match(/([^\/]+)\/([^\/]+)\.(gf(-tags)?)(:\d+)?/);
|
||||||
@@ -188,10 +199,11 @@ $(document).ready(function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
updateScopeCount();
|
updateScopeCount();
|
||||||
|
runFilter();
|
||||||
loading(false);
|
loading(false);
|
||||||
},
|
},
|
||||||
error: function(data){
|
error: function(data){
|
||||||
$('#scope_list').html("<em>No scope available</em>");
|
clearScope("No scope available");
|
||||||
loading(false);
|
loading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -223,7 +235,7 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(data){
|
error: function(data){
|
||||||
setCode("<em>No code available</em>");
|
clearCode("No code available");
|
||||||
loading(false);
|
loading(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -241,7 +253,7 @@ $(document).ready(function() {
|
|||||||
else
|
else
|
||||||
return haystack.toLowerCase().indexOf(needle.toLowerCase())>=0;
|
return haystack.toLowerCase().indexOf(needle.toLowerCase())>=0;
|
||||||
};
|
};
|
||||||
var runfilter = function() {
|
var runFilter = function() {
|
||||||
// Hide anything which doesn't match
|
// Hide anything which doesn't match
|
||||||
var s = $("#search").val();
|
var s = $("#search").val();
|
||||||
loading(true);
|
loading(true);
|
||||||
@@ -263,23 +275,23 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Instant results
|
// Instant results
|
||||||
$("#search").keyup(runfilter);
|
$("#search").keyup(runFilter);
|
||||||
$("#submit").hide();
|
$("#submit").hide();
|
||||||
|
|
||||||
// Filter & clear buttons
|
// Filter & clear buttons
|
||||||
// $("#submit").click(runfilter);
|
// $("#submit").click(runFilter);
|
||||||
|
|
||||||
$("#search").keypress(function(e){
|
$("#search").keypress(function(e){
|
||||||
var code = (e.keyCode ? e.keyCode : e.which);
|
var code = (e.keyCode ? e.keyCode : e.which);
|
||||||
if(code == 13) { // Enter
|
if(code == 13) { // Enter
|
||||||
runfilter();
|
runFilter();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("#clear").click(function(){
|
$("#clear").click(function(){
|
||||||
$("#search").val('');
|
$("#search").val('');
|
||||||
runfilter();
|
runFilter();
|
||||||
});
|
});
|
||||||
$("#case_sensitive").change(runfilter);
|
$("#case_sensitive").change(runFilter);
|
||||||
$("#show_all").change(runfilter);
|
$("#show_all").change(runFilter);
|
||||||
$("#show_local").change(runfilter);
|
$("#show_local").change(runFilter);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
header h1
|
header h1
|
||||||
{
|
{
|
||||||
text-align:left;
|
text-align:left;
|
||||||
|
margin:0 0 0.2em;
|
||||||
}
|
}
|
||||||
div[role='main']
|
div[role='main']
|
||||||
{
|
{
|
||||||
@@ -60,10 +61,13 @@ div[role='main']
|
|||||||
.tab
|
.tab
|
||||||
{
|
{
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
padding:0.5em;
|
padding:0.3em 0.5em;
|
||||||
margin-right:0.5em;
|
margin-right:0.5em;
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
text-transform:capitalize;
|
text-transform:capitalize;
|
||||||
|
text-decoration:none;
|
||||||
|
font-family:sans-serif;
|
||||||
|
font-weight:bold;
|
||||||
}
|
}
|
||||||
#loading
|
#loading
|
||||||
{
|
{
|
||||||
@@ -124,7 +128,9 @@ input#search
|
|||||||
#scope_list th, #scope_list td
|
#scope_list th, #scope_list td
|
||||||
{
|
{
|
||||||
padding:0.4em;
|
padding:0.4em;
|
||||||
border: 1px solid #aaa;
|
border-style: solid;
|
||||||
|
border-width: 0 0 1px 0;
|
||||||
|
border-color: #ddd;
|
||||||
background:none;
|
background:none;
|
||||||
white-space:nowrap;
|
white-space:nowrap;
|
||||||
}
|
}
|
||||||
@@ -144,7 +150,6 @@ dt
|
|||||||
footer
|
footer
|
||||||
{
|
{
|
||||||
padding-left: 0.5em;
|
padding-left: 0.5em;
|
||||||
border-top: 1px solid #999;
|
|
||||||
margin-top: 1em;
|
|
||||||
color:#333;
|
color:#333;
|
||||||
|
text-align:right;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user