Adds check for browser svg support and redirects to error page if not supported

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1916 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Adrian Jones 2011-01-16 03:18:19 +00:00
parent b34d721491
commit b6263bc7ff
1 changed files with 12 additions and 1 deletions

View File

@ -20,6 +20,15 @@ if (!svgedit.browser) {
svgedit.browser = {};
}
var supportsSvg_ = (function() {
return !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;
})();
svgedit.browser.supportsSvg = function() { return supportsSvg_; }
if(!svgedit.browser.supportsSvg()) {
window.location = "browser-not-supported.html";
}
else{
var svgns = 'http://www.w3.org/2000/svg';
var userAgent = navigator.userAgent;
var svg = document.createElementNS(svgns, 'svg');
@ -128,4 +137,6 @@ svgedit.browser.supportsGoodDecimals = function() { return supportsGoodDecimals_
svgedit.browser.supportsNonScalingStroke = function() { return supportsNonScalingStroke_; }
svgedit.browser.supportsNativeTransformLists = function() { return supportsNativeSVGTransformLists_; }
})();
}
})();