bbcookiemanager
Version:
./README.md
272 lines (268 loc) • 13.3 kB
JavaScript
/**
* @fileoverview added by tsickle
* Generated from: lib/bbcookiemanager.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @enum {string} */
var CookieEvents = {
onLoad: "BBCookieManagerOnLoad",
onAccept: "BBCookieManagerOnAccept",
onWidthdraw: "BBCookieManagerOnWithdraw",
onDialogInit: "BBCookieManagerOnDialogInit",
onDialogDisplay: "BBCookieManagerOnDialogDisplay",
onMandatoryOnly: "BBCookieManagerOnMandatoryOnly",
onDialogSettingsInit: "BBCookieManagerOnDialogSettingsInit",
onDialogSettingsDisplay: "BBCookieManagerOnDialogSettingsDisplay",
onDecline: "BBCookieManagerOnDecline",
};
var BbCookieManagerComponent = /** @class */ (function () {
function BbCookieManagerComponent() {
}
/**
* This function appends a DOM element with the “src” attribute into the parent node as the last child and set the cookie category attribute. The appended DOM element is disabled (e.g. script DOM element has attribute “text/plain” and the iframe DOM element does not have the “src” attribute).
* @param tag - DOM element which can contain “src” attribute or script HTML element
* @param categoryIdentifier - The cookie category identifier from 2B Advice PrIME application
* @param parentNode - DOM element where the “tag” is inserted as last child
*/
/**
* This function appends a DOM element with the “src” attribute into the parent node as the last child and set the cookie category attribute. The appended DOM element is disabled (e.g. script DOM element has attribute “text/plain” and the iframe DOM element does not have the “src” attribute).
* @param {?} tag - DOM element which can contain “src” attribute or script HTML element
* @param {?} categoryIdentifier - The cookie category identifier from 2B Advice PrIME application
* @param {?} parentNode - DOM element where the “tag” is inserted as last child
* @return {?}
*/
BbCookieManagerComponent.prototype.appendSrcTag = /**
* This function appends a DOM element with the “src” attribute into the parent node as the last child and set the cookie category attribute. The appended DOM element is disabled (e.g. script DOM element has attribute “text/plain” and the iframe DOM element does not have the “src” attribute).
* @param {?} tag - DOM element which can contain “src” attribute or script HTML element
* @param {?} categoryIdentifier - The cookie category identifier from 2B Advice PrIME application
* @param {?} parentNode - DOM element where the “tag” is inserted as last child
* @return {?}
*/
function (tag, categoryIdentifier, parentNode) {
if (typeof bbCookieApi === "undefined") {
console.log("In your page missing bb-manager.js file!");
}
else {
bbCookieApi.appendSrcTag(tag, categoryIdentifier, parentNode);
}
};
/**
* This function executes the callback function according to the web site visitor’s consent. The call back function is only executed if the visitor has consented to the category specified in the parameter “categoryIdentifier”.
* @param categoryIdentifier - The cookie category identifier from 2B Advice PrIME application
* @param callbackFunction - The function is executed when the cookie category is enabled
*/
/**
* This function executes the callback function according to the web site visitor’s consent. The call back function is only executed if the visitor has consented to the category specified in the parameter “categoryIdentifier”.
* @param {?} categoryIdentifier - The cookie category identifier from 2B Advice PrIME application
* @param {?} callbackFunction - The function is executed when the cookie category is enabled
* @return {?}
*/
BbCookieManagerComponent.prototype.callbackByCategory = /**
* This function executes the callback function according to the web site visitor’s consent. The call back function is only executed if the visitor has consented to the category specified in the parameter “categoryIdentifier”.
* @param {?} categoryIdentifier - The cookie category identifier from 2B Advice PrIME application
* @param {?} callbackFunction - The function is executed when the cookie category is enabled
* @return {?}
*/
function (categoryIdentifier, callbackFunction) {
if (typeof bbCookieApi === "undefined") {
console.log("In your page missing bb-manager.js file!");
}
else {
bbCookieApi.callbackByCategory(categoryIdentifier, callbackFunction);
}
};
/**
* This function registers a callback function for the cookie consent manager. Multiple bindings for the same cookie consent event is allowed.
* @param eventName - Name of the cookie manager event
* @param eventCallback - The javascript function which is fired after the event
*/
/**
* This function registers a callback function for the cookie consent manager. Multiple bindings for the same cookie consent event is allowed.
* @param {?} eventName - Name of the cookie manager event
* @param {?} eventCallback - The javascript function which is fired after the event
* @return {?}
*/
BbCookieManagerComponent.prototype.registerEvent = /**
* This function registers a callback function for the cookie consent manager. Multiple bindings for the same cookie consent event is allowed.
* @param {?} eventName - Name of the cookie manager event
* @param {?} eventCallback - The javascript function which is fired after the event
* @return {?}
*/
function (eventName, eventCallback) {
if (typeof bbCookieApi === "undefined") {
console.log("In your page missing bb-manager.js file!");
}
else {
bbCookieApi.registerEvent(eventName, eventCallback);
}
};
/**
* The API function renders the cookie declaration as a last child of the parent node. The render mode must be set.
* @param parentNode - DOM element where is the cookie declaration should be appended as a last child
*/
/**
* The API function renders the cookie declaration as a last child of the parent node. The render mode must be set.
* @param {?} parentNode - DOM element where is the cookie declaration should be appended as a last child
* @return {?}
*/
BbCookieManagerComponent.prototype.renderCookieDeclaration = /**
* The API function renders the cookie declaration as a last child of the parent node. The render mode must be set.
* @param {?} parentNode - DOM element where is the cookie declaration should be appended as a last child
* @return {?}
*/
function (parentNode) {
if (typeof bbCookieApi === "undefined") {
console.log("In your page missing bb-manager.js file!");
}
else {
bbCookieApi.renderCookieDeclaration(parentNode);
}
};
/**
* The API function renders the policy declaration as a last child of the parent node. The render mode must be set.
* @param parentNode - DOM element where is the policy declaration should be appended as a last child
*/
/**
* The API function renders the policy declaration as a last child of the parent node. The render mode must be set.
* @param {?} parentNode - DOM element where is the policy declaration should be appended as a last child
* @return {?}
*/
BbCookieManagerComponent.prototype.renderPolicyDeclaration = /**
* The API function renders the policy declaration as a last child of the parent node. The render mode must be set.
* @param {?} parentNode - DOM element where is the policy declaration should be appended as a last child
* @return {?}
*/
function (parentNode) {
if (typeof bbCookieApi === "undefined") {
console.log("In your page missing bb-ps.js file!");
}
else {
bbCookieApi.renderPolicyDeclaration(parentNode);
}
};
/**
* This function detects all tags of type=“text/plain” and enables/executes the tags according to the visitor’s consent.
* */
/**
* This function detects all tags of type=“text/plain” and enables/executes the tags according to the visitor’s consent.
*
* @return {?}
*/
BbCookieManagerComponent.prototype.runSrcTags = /**
* This function detects all tags of type=“text/plain” and enables/executes the tags according to the visitor’s consent.
*
* @return {?}
*/
function () {
if (typeof bbCookieApi === "undefined") {
console.log("In your page missing bb-manager.js file!");
}
else {
bbCookieApi.runSrcTags();
}
};
/**
* The API function sets a cookie for the website. If the cookie category for the cookie is disabled, then the cookie is not set.
* @param name - Name of the cookie
* @param value - Value of the cookie
* @param hours - Expiration time of the cookie (in hours)
*/
/**
* The API function sets a cookie for the website. If the cookie category for the cookie is disabled, then the cookie is not set.
* @param {?} name - Name of the cookie
* @param {?} value - Value of the cookie
* @param {?} hours - Expiration time of the cookie (in hours)
* @return {?}
*/
BbCookieManagerComponent.prototype.setCookie = /**
* The API function sets a cookie for the website. If the cookie category for the cookie is disabled, then the cookie is not set.
* @param {?} name - Name of the cookie
* @param {?} value - Value of the cookie
* @param {?} hours - Expiration time of the cookie (in hours)
* @return {?}
*/
function (name, value, hours) {
if (typeof bbCookieApi === "undefined") {
console.log("In your page missing bb-manager.js file!");
}
else {
bbCookieApi.setCookie(name, value, hours);
}
};
/**
* This API function displays the cookie consent banner.
* */
/**
* This API function displays the cookie consent banner.
*
* @return {?}
*/
BbCookieManagerComponent.prototype.showBanner = /**
* This API function displays the cookie consent banner.
*
* @return {?}
*/
function () {
if (typeof bbCookieApi === "undefined") {
console.log("In your page missing bb-manager.js file!");
}
else {
bbCookieApi.showBanner();
}
};
/**
* This API function displays the cookie consent dialog with the category selection.
* */
/**
* This API function displays the cookie consent dialog with the category selection.
*
* @return {?}
*/
BbCookieManagerComponent.prototype.showSettings = /**
* This API function displays the cookie consent dialog with the category selection.
*
* @return {?}
*/
function () {
if (typeof bbCookieApi === "undefined") {
console.log("In your page missing bb-manager.js file!");
}
else {
bbCookieApi.showSettings();
}
};
/**
*This API function disables all script HTML elements and HTML elements with the “src” attribute and removes website cookies which belong to categories which are not set as mandatory categories.
* */
/**
* This API function disables all script HTML elements and HTML elements with the “src” attribute and removes website cookies which belong to categories which are not set as mandatory categories.
*
* @return {?}
*/
BbCookieManagerComponent.prototype.withdraw = /**
* This API function disables all script HTML elements and HTML elements with the “src” attribute and removes website cookies which belong to categories which are not set as mandatory categories.
*
* @return {?}
*/
function () {
if (typeof bbCookieApi === "undefined") {
console.log("In your page missing bb-manager.js file!");
}
else {
bbCookieApi.withdraw();
}
};
return BbCookieManagerComponent;
}());
/**
* @fileoverview added by tsickle
* Generated from: public_api.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* Generated from: bbcookiemanager.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
export { CookieEvents, BbCookieManagerComponent };
//# sourceMappingURL=bbcookiemanager.js.map