1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-25 17:40:29 +00:00

Moved browser feature detection out of startup.js

This commit is contained in:
Jeremy Ruston 2012-07-15 17:36:25 +01:00
parent dde26f8103
commit c9c26794af

View File

@ -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];
};
})();