From c9c26794af7c9059ee7e5ac377f87c4827b2de99 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 15 Jul 2012 17:36:25 +0100 Subject: [PATCH] Moved browser feature detection out of startup.js --- core/modules/utils/dom/browser.js | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 core/modules/utils/dom/browser.js diff --git a/core/modules/utils/dom/browser.js b/core/modules/utils/dom/browser.js new file mode 100644 index 000000000..5a0a42e37 --- /dev/null +++ b/core/modules/utils/dom/browser.js @@ -0,0 +1,33 @@ +/*\ +title: $:/core/modules/utils/dom/browser.js +type: application/javascript +module-type: utils + +Browser feature detection + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports.getBrowserInfo = function(info) { + info.unHyphenateCss = document.body.style["background-color"] === undefined; + info.prefix = document.body.style.webkitTransform !== undefined ? "webkit" : + document.body.style.MozTransform !== undefined ? "Moz" : + document.body.style.MSTransform !== undefined ? "MS" : + document.body.style.OTransform !== undefined ? "O" : ""; + info.transition = info.prefix + "Transition"; + info.transform = info.prefix + "Transform"; + info.transformorigin = info.prefix + "TransformOrigin"; + info.transitionEnd = { + "": "transitionEnd", + "O": "oTransitionEnd", + "MS": "msTransitionEnd", + "Moz": "transitionend", + "webkit": "webkitTransitionEnd" + }[info.prefix]; +}; + +})();