From 46394e999b20c9c264717ee448510a2dd57458d3 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Mon, 29 Jan 2018 17:53:31 -0800 Subject: [PATCH] allow local testing --- index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index f4483ee..1c3dcde 100644 --- a/index.html +++ b/index.html @@ -162,12 +162,14 @@

Webcharts Visual Tests

} -function initTestSuite(version){ - var root = "https://rawgit.com/RhoInc/Webcharts/"+version+"/test"; - var rendererPath = "https://rawgit.com/RhoInc/Webcharts/"+version+"/build/webcharts.js"; +function initTestSuite(version,path){ + //attempt to load from a relative path if one is given (allows for local testing) + var location = version.slice(0,3)=="../" ? version : path+version + var root = location+"/test"; + var rendererPath = location+"/build/webcharts.js"; var link = document.createElement("link"); - link.href ="https://rawgit.com/RhoInc/Webcharts/"+version+"/css/webcharts.css" + link.href =location+"/css/webcharts.css" link.type = "text/css"; link.rel = "stylesheet"; document.getElementsByTagName("head")[0].appendChild(link); @@ -227,7 +229,7 @@

Webcharts Visual Tests

d3.selectAll(".charts *").remove() d3.selectAll(".controls *").remove() var version = webchartsVersion.node().value - initTestSuite(version) + initTestSuite(version,"https://rawgit.com/RhoInc/Webcharts/") })