Skip to content
Snippets Groups Projects
Commit 30464b55 authored by deuce's avatar deuce
Browse files

Simply EXT parsing as with index.xjs

parent 51f7ccb0
No related branches found
No related tags found
No related merge requests found
......@@ -3,20 +3,18 @@ for(var g in e) {
var fn = file_getname(e[g]);
if(!checkWebCtrl(webIni.RootDirectory + "/pages/", fn))
continue;
var ext = e[g].toUpperCase().split(".").slice(1).join(".");
var ext = file_getext(e[g]).toUpperCase();
var h = new File(e[g]);
h.open("r");
var i = h.readAll();
h.close();
if(file_isdir(e[g]) || ext == "XJS.SSJS")
continue;
if(ext == "JS" || ext == "SSJS") {
if(ext == ".JS" || (ext == ".SSJS" && e[g].search(/\.xjs\.ssjs$/i)==-1)) {
var title = i[0].replace(/\/\//g, "");
if(title == "HIDDEN")
continue;
print("<a class='link' href=./index.xjs?page=" + file_getname(e[g]) + ">" + title + "</a><br />");
}
if(ext == "HTML" || ext == "XJS") {
if(ext == ".HTML" || ext == ".XJS") {
// Seek first comment line in an HTML document
for(j = 0; j < i.length; j++) {
var k = i[j].match(/^\<\!\-\-.*\-\-\>$/);
......@@ -29,9 +27,9 @@ for(var g in e) {
break;
}
}
if(ext == "TXT") {
if(ext == ".TXT") {
if(i[0] == "HIDDEN")
continue;
print("<a class='link' href=./index.xjs?page=" + file_getname(e[g]) + ">" + i[0] + "</a><br />");
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment