spee.ch/public/assets/js/generalFunctions.js

57 lines
2.1 KiB
JavaScript
Raw Normal View History

// Create new error objects, that prototypically inherit from the Error constructor
function FileError(message) {
this.name = 'FileError';
this.message = message || 'Default Message';
this.stack = (new Error()).stack;
}
FileError.prototype = Object.create(Error.prototype);
FileError.prototype.constructor = FileError;
function NameError(message) {
this.name = 'NameError';
this.message = message || 'Default Message';
this.stack = (new Error()).stack;
}
NameError.prototype = Object.create(Error.prototype);
2017-09-20 00:39:54 +02:00
NameError.prototype.constructor = NameError;
2017-09-20 18:49:05 +02:00
function ChannelNameError(message) {
this.name = 'ChannelNameError';
2017-09-20 00:39:54 +02:00
this.message = message || 'Default Message';
this.stack = (new Error()).stack;
}
2017-09-20 18:49:05 +02:00
ChannelNameError.prototype = Object.create(Error.prototype);
ChannelNameError.prototype.constructor = ChannelNameError;
function ChannelPasswordError(message) {
this.name = 'ChannelPasswordError';
this.message = message || 'Default Message';
this.stack = (new Error()).stack;
}
ChannelPasswordError.prototype = Object.create(Error.prototype);
2017-10-12 23:37:25 +02:00
ChannelPasswordError.prototype.constructor = ChannelPasswordError;
function AuthenticationError(message) {
this.name = 'AuthenticationError';
this.message = message || 'Default Message';
this.stack = (new Error()).stack;
}
AuthenticationError.prototype = Object.create(Error.prototype);
2017-10-25 20:22:15 +02:00
AuthenticationError.prototype.constructor = AuthenticationError;
function showAssetDetails(event) {
var thisAssetHolder = document.getElementById(event.target.id);
var thisAssetImage = thisAssetHolder.firstElementChild;
var thisAssetDetails = thisAssetHolder.lastElementChild;
thisAssetImage.style.opacity = 0.2;
2017-10-30 18:07:23 +01:00
thisAssetDetails.setAttribute('class', 'grid-item-details flex-container--column flex-container--center-center');
2017-10-25 20:22:15 +02:00
}
function hideAssetDetails(event) {
var thisAssetHolder = document.getElementById(event.target.id);
var thisAssetImage = thisAssetHolder.firstElementChild;
var thisAssetDetails = thisAssetHolder.lastElementChild;
thisAssetImage.style.opacity = 1;
thisAssetDetails.setAttribute('class', 'hidden');
}