Skip to content

Instantly share code, notes, and snippets.

val MustBeAdmin = If(() => User.superUser_?, "")
val entries = List(Menu("Home") / "index" >> LocGroup("main"),
Menu("Page 3") / "page3" >> LocGroup("main") >> PlaceHolder submenus (
Menu("Page 3a") / "page3a" ,
Menu("Page 3b") / "page3b" ,
Menu("Page 3c") / "page3c",
Menu("Admin 4") / "admin4" >> MustBeAdmin ),
Menu("Admin") / "dummyAdmin" >> MustBeAdmin >> LocGroup("main") >> PlaceHolder submenus (
Menu("Admin 1") / "admin1" ,
// a utility class for building up the bits that encodes a char as we trawl down the CodeTree
case class Coding(char: Char, bits: List[Bit]) {
def addBit(b: Bit): Coding = this.copy(bits = b :: bits)
}
// this method builds up a list of codings for each character in the tree. E.g
// for a input of Fork(Fork(Leaf('a', 2), Leaf('b', 3), List('a', 'b'), 5), Leaf('d', 4), List('a', 'b', 'd'), 9)
// it returns List(Coding(a,List(0, 0)), Coding(b,List(0, 1)), Coding(d,List(1)))
//
// recurse down the tree, at each fork, add '0' to each bit pattern from the codings formed from the
$(document).ready( function() {
$('#container_id').fileTree({
root: '/some/folder/',
script: 'jqueryFileTree.asp',
expandSpeed: 1000,
collapseSpeed: 1000,
multiFolder: false
}, function(file) {
alert(file);
});