application.ui.preview.server.resource-files.utils.js Maven / Gradle / Ivy
view1 = null;
view2 = null;
onload=function() {
if (document.getElementsByClassName == undefined) {
document.getElementsByClassName = function(className)
{
var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
var allElements = document.getElementsByTagName("*");
var results = [];
var element;
for (var i = 0; (element = allElements[i]) != null; i++) {
var elementClass = element.className;
if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass))
results.push(element);
}
return results;
}
}
shortcut.add("Page_down", function() {
i = yPos();
movePage(1);
// if nothing happened, try again
if (i == yPos()) {
movePage(1);
}
});
shortcut.add("Page_up", function() {
i = yPos();
movePage(-1);
// if nothing happened, try again
if (i == yPos()) {
movePage(-1);
}
});
shortcut.add("Cltr+1", function() {
toggleViews();
});
}
visible = true;
function toggleVisibility() {
visible = !visible;
alert(visible);
}
function toggleById(id) {
toggle(document.getElementById(obj));
}
function toggleAllByName(className) {
elements = document.getElementsByClassName(className);
toggleAll(elements);
}
function toggleAll(elements) {
for (i=0;i