Former-commit-id: 18a1b6540895d83370677bea474ac7dd8cfa1bd2
This commit is contained in:
Henrique Dias
2017-01-02 12:20:20 +00:00
parent df4a030843
commit abcaf3aba7
8 changed files with 129 additions and 84 deletions

View File

@@ -72,21 +72,6 @@ Element.prototype.changeToDone = function(error, html) {
return false;
}
function getCSSRule(ruleName) {
ruleName = ruleName.toLowerCase();
var result = null,
find = Array.prototype.find;
find.call(document.styleSheets, styleSheet => {
result = find.call(styleSheet.cssRules, cssRule => {
return cssRule instanceof CSSStyleRule &&
cssRule.selectorText.toLowerCase() == ruleName;
});
return result != null;
});
return result;
}
function toWebDavURL(url) {
return window.location.origin + url.replace(baseURL + "/", webdavURL + "/");
}
@@ -100,6 +85,33 @@ var removeLastDirectoryPartOf = function(url) {
return (arr.join('/'));
}
function getCSSRule(rules) {
for (let i = 0; i < rules.length; i++) {
rules[i] = rules[i].toLowerCase();
}
var result = null,
find = Array.prototype.find;
find.call(document.styleSheets, styleSheet => {
result = find.call(styleSheet.cssRules, cssRule => {
let found = false;
if (cssRule instanceof CSSStyleRule) {
for (let i = 0; i < rules.length; i++) {
if (cssRule.selectorText.toLowerCase() == rules[i]) found = true;
}
}
return found;
});
return result != null;
});
return result;
}
/* * * * * * * * * * * * * * * *
* *
* EVENTS *