mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
RGL browser: add ability to search for module name
This commit is contained in:
@@ -158,7 +158,7 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<footer id="footer">
|
<footer id="footer">
|
||||||
John J. Camilleri<br/><em>Updated 2013-07-23</em>
|
John J. Camilleri<br/><em>Updated 2014-01-29</em>
|
||||||
</footer>
|
</footer>
|
||||||
</div><!-- ui-layout-north -->
|
</div><!-- ui-layout-north -->
|
||||||
|
|
||||||
@@ -168,4 +168,4 @@
|
|||||||
</div><!-- ui-layout-west -->
|
</div><!-- ui-layout-west -->
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -216,6 +216,20 @@ function Thing() {
|
|||||||
}
|
}
|
||||||
t.setLanguage("english");
|
t.setLanguage("english");
|
||||||
|
|
||||||
|
// Module search box
|
||||||
|
var module_search = $("<input>")
|
||||||
|
.attr('id', 'module_search')
|
||||||
|
.keyup(function(){
|
||||||
|
t.searchModule($(this).val());
|
||||||
|
})
|
||||||
|
.appendTo("#languages");
|
||||||
|
|
||||||
|
$("<a>")
|
||||||
|
.attr('href','#')
|
||||||
|
.click(t.clearSearchModule)
|
||||||
|
.html("Clear")
|
||||||
|
.appendTo("#languages");
|
||||||
|
|
||||||
// Initialize API results
|
// Initialize API results
|
||||||
t.initAPI();
|
t.initAPI();
|
||||||
|
|
||||||
@@ -251,6 +265,8 @@ function Thing() {
|
|||||||
t.state.current.set(lang, module);
|
t.state.current.set(lang, module);
|
||||||
t.loadTagsFile(module);
|
t.loadTagsFile(module);
|
||||||
t.loadSourceFile(lang, module, lineNo);
|
t.loadSourceFile(lang, module, lineNo);
|
||||||
|
if ($('.tab.api').hasClass('active'))
|
||||||
|
t.showPanel("#scope");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load a tags file
|
// Load a tags file
|
||||||
@@ -382,6 +398,35 @@ function Thing() {
|
|||||||
t.hideLoading();
|
t.hideLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===== Module search =====
|
||||||
|
|
||||||
|
this.searchModule = function(s) {
|
||||||
|
if (!s) {
|
||||||
|
return t.clearSearchModule();
|
||||||
|
}
|
||||||
|
$('#language_select').hide();
|
||||||
|
$("#modules").empty();
|
||||||
|
for (var lang in t.state.index['languages']) {
|
||||||
|
var modules = t.state.index['languages'][lang];
|
||||||
|
for (var j in modules) {
|
||||||
|
var module = modules[j];
|
||||||
|
var full_module = lang+'/'+module;
|
||||||
|
if (!module) continue;
|
||||||
|
if (full_module.toLowerCase().indexOf(s.toLowerCase())==-1) continue;
|
||||||
|
$('<a>')
|
||||||
|
.html(full_module)
|
||||||
|
.attr('href', "#"+lang+"/"+module+".gf")
|
||||||
|
.appendTo("#modules");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.clearSearchModule = function() {
|
||||||
|
$('#module_search').val('');
|
||||||
|
$('#language_select').show();
|
||||||
|
t.setLanguage(t.state.language);
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
// ===== Filtering of scope info =====
|
// ===== Filtering of scope info =====
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user