UNPKG

5.75 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["BBHelpClient"] = factory();
8 else
9 root["BBHelpClient"] = factory();
10})(this, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // identity function for calling harmony imports with the correct context
47/******/ __webpack_require__.i = function(value) { return value; };
48/******/
49/******/ // define getter function for harmony exports
50/******/ __webpack_require__.d = function(exports, name, getter) {
51/******/ if(!__webpack_require__.o(exports, name)) {
52/******/ Object.defineProperty(exports, name, {
53/******/ configurable: false,
54/******/ enumerable: true,
55/******/ get: getter
56/******/ });
57/******/ }
58/******/ };
59/******/
60/******/ // getDefaultExport function for compatibility with non-harmony modules
61/******/ __webpack_require__.n = function(module) {
62/******/ var getter = module && module.__esModule ?
63/******/ function getDefault() { return module['default']; } :
64/******/ function getModuleExports() { return module; };
65/******/ __webpack_require__.d(getter, 'a', getter);
66/******/ return getter;
67/******/ };
68/******/
69/******/ // Object.prototype.hasOwnProperty.call
70/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
71/******/
72/******/ // __webpack_public_path__
73/******/ __webpack_require__.p = "";
74/******/
75/******/ // Load entry module and return exports
76/******/ return __webpack_require__(__webpack_require__.s = 1);
77/******/ })
78/************************************************************************/
79/******/ ([
80/* 0 */
81/***/ (function(module, exports, __webpack_require__) {
82
83"use strict";
84
85Object.defineProperty(exports, "__esModule", { value: true });
86var register_script_1 = __webpack_require__(2);
87var BBHelpClient = (function () {
88 function BBHelpClient() {
89 }
90 BBHelpClient.addStyles = function () {
91 var css = "\n .bb-omnibar-bar.bar { padding-right: 50px !important; }\n .bb-omnibar > .bb-omnibar-desktop > .bb-omnibar-accountflyout { right: 50px !important; }\n #bb-help-container { z-index: 9999; }\n ";
92 var style = document.createElement('style');
93 style.type = 'text/css';
94 style.appendChild(document.createTextNode(css));
95 document.head.appendChild(style);
96 };
97 BBHelpClient.load = function (config) {
98 if (config === void 0) { config = {}; }
99 if (config.defaultHelpKey !== undefined) {
100 BBHelpClient.defaultHelpKey = config.defaultHelpKey;
101 }
102 config.getCurrentHelpKey = BBHelpClient.getCurrentHelpKey;
103 return register_script_1.registerScript('https://cdn.blackbaudcloud.com/bb-help/bb-help.js')
104 .then(function () {
105 BBHelpClient.addStyles();
106 // Initialize the widget.
107 BBHELP.HelpWidget.load(config);
108 });
109 };
110 BBHelpClient.setCurrentHelpKey = function (helpKey) {
111 if (helpKey === void 0) { helpKey = BBHelpClient.defaultHelpKey; }
112 BBHelpClient.currentHelpKey = helpKey;
113 };
114 BBHelpClient.setHelpKeyToDefault = function () {
115 BBHelpClient.setCurrentHelpKey(BBHelpClient.defaultHelpKey);
116 };
117 BBHelpClient.openWidgetToHelpKey = function (helpKey) {
118 if (helpKey === void 0) { helpKey = BBHelpClient.currentHelpKey; }
119 BBHELP.HelpWidget.open(helpKey);
120 };
121 BBHelpClient.getCurrentHelpKey = function () {
122 return BBHelpClient.currentHelpKey || BBHelpClient.defaultHelpKey;
123 };
124 return BBHelpClient;
125}());
126BBHelpClient.defaultHelpKey = 'default.html';
127exports.BBHelpClient = BBHelpClient;
128
129
130/***/ }),
131/* 1 */
132/***/ (function(module, exports, __webpack_require__) {
133
134"use strict";
135
136function __export(m) {
137 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
138}
139Object.defineProperty(exports, "__esModule", { value: true });
140__export(__webpack_require__(0));
141
142
143/***/ }),
144/* 2 */
145/***/ (function(module, exports, __webpack_require__) {
146
147"use strict";
148
149Object.defineProperty(exports, "__esModule", { value: true });
150exports.registerScript = function (url) {
151 return new Promise(function (resolve, reject) {
152 var scriptEl = document.createElement('script');
153 scriptEl.onload = resolve;
154 scriptEl.onerror = reject;
155 scriptEl.src = url;
156 document.body.appendChild(scriptEl);
157 });
158};
159
160
161/***/ })
162/******/ ]);
163});
\No newline at end of file