Commit 36123b26 authored by Siong-Ui Te's avatar Siong-Ui Te

better argument passing

parent c1f836bd
......@@ -63,7 +63,7 @@ func main() {
json.Unmarshal(b, &tree)
treeview.NewTreeview("treeview", tree, xmlAction)
SetupXSLTProcessor()
SetupXSLTProcessor(libfrontend.GetXslUrl())
SetupModal()
SetupMobileTreeviewToggle()
SetupModalInput("#modal-input")
......
......@@ -2,7 +2,6 @@ package main
import (
. "github.com/siongui/godom"
"github.com/siongui/gopalilib/libfrontend"
)
var xsltProcessor *XSLTProcessor
......@@ -11,12 +10,12 @@ func GetXSLTProcessor() *XSLTProcessor {
return xsltProcessor
}
func SetupXSLTProcessor() {
func SetupXSLTProcessor(xslUrl string) {
xsltProcessor = NewXSLTProcessor()
// Load the xsl file using synchronous (third param is set to false) XMLHttpRequest
myXMLHTTPRequest := NewXMLHttpRequest()
myXMLHTTPRequest.Open("GET", libfrontend.GetXslUrl(), false)
myXMLHTTPRequest.Open("GET", xslUrl, false)
myXMLHTTPRequest.Send()
xslStylesheet := myXMLHTTPRequest.ResponseXML()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment