Home
Knitting
All Knitting
Knitting Needles
Buttons
Knitting Tools
Sock Blockers
Addi Knitting Products
Weaving
All Weaving
Loom Kits
Looms
Loom Tools
Kitchen
Garden
Desktop
Bespoke
{{shopper.order.total_VIEW}}
Order Number: {{shopper.orderNumber}}
Check Out
OpenForum
Javascript
Tree
//OpenForum/Javascript/Tree/get.sjs
var action = transaction.getParameter("action"); if(action===null) { transaction.setResult(transaction.SHOW_PAGE); return; } try{ action = ""+action; if(action==="getPageTree") { var targetPage = ""+transaction.getParameter("pageName"); if(targetPage.charAt(0)!='/') { targetPage = "/"+targetPage; } var matcher = transaction.getParameter("match"); if(matcher!=null) matcher = "" + matcher; var pageOffset = transaction.getParameter("pageOffset"); if(pageOffset==null) { pageOffset = 0; } else { pageOffset = parseInt(""+pageOffset,10); } var fileOffset = transaction.getParameter("fileOffset"); if(fileOffset==null) { fileOffset = 0; } else { fileOffset = parseInt(""+fileOffset,10); } var treeData = null; var tree = js.getObject("/OpenForum/Javascript/Tree","Tree.sjs"); treeData = JSON.stringify( tree.createFileTree(targetPage,matcher,fileOffset,pageOffset) ); transaction.sendJSON( treeData ); } else if(action==="getSubPages") { var targetPage = ""+transaction.getParameter("pageName"); if(targetPage.charAt(0)!='/') { targetPage = "/"+targetPage; } var pages = js.getObject("/OpenForum/Javascript/Tree","Pages.sjs"); var list = pages.getSubPages(targetPage); transaction.sendJSON( JSON.stringify(list) ); } }catch(e) { transaction.sendJSON( JSON.stringify({result: "error",message: "Error:"+e+" on line "+e.lineNumber})); }
An error has occurred.
{{OpenForum.errorMessage}}
See technical details
×
Error details.
{{OpenForum.error}}
×
{{OpenForum.alert.title}}
{{OpenForum.alert.message}}
×