From 345d9f37123697f70a1b79a5bfb33c0561a02cb1 Mon Sep 17 00:00:00 2001 From: John Woodlock Date: Sat, 25 Aug 2012 14:51:41 +1000 Subject: [PATCH] put links in new tab (mostly) --- api-docs/apiLive.htm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm index c9a19dca3..0ce29c2ee 100644 --- a/api-docs/apiLive.htm +++ b/api-docs/apiLive.htm @@ -39,8 +39,12 @@ function clickAPILink(apiLink) if (apiLink.indexOf("?") < 0) currentLink += "?" + defQueryParams; else currentLink += "&" + defQueryParams; - //alert(currentLink); - location.href = currentLink; + + if ((/MSIE (\d+\.\d+);/.test(navigator.userAgent)) || (apiLink.indexOf("exportCSV") > -1) || (apiLink.indexOf("type=CSV") > -1) || (apiLink.indexOf("type=XLS") > -1) ) + { // test for MSIE (not a great browser for the api docs anyhow) or a file download + location.href = currentLink; + } + else window.open(currentLink); }