Comparing version 1.2.0 to 1.3.0
@@ -31,12 +31,13 @@ (function (global, factory) { | ||
} | ||
// create temporary buffer | ||
var queue = []; | ||
var buffer = function () { | ||
queue.push(arguments); | ||
// create temporary tasks | ||
var tasks = []; | ||
var queue = function () { | ||
tasks.push(arguments); | ||
}; | ||
buffer.q = queue; | ||
window.HelpHero = buffer; | ||
queue.q = tasks; | ||
window.HelpHero = queue; | ||
// add script to page | ||
var script = document.createElement("script"); | ||
script.src = "//app.helphero.co/embed/" + appId; | ||
var hasHttp = /^https?:$/.test(document.location.protocol || ""); | ||
script.src = (hasHttp ? "" : "https:") + "//app.helphero.co/embed/" + appId; | ||
script.async = true; | ||
@@ -53,2 +54,3 @@ document.body.appendChild(script); | ||
} | ||
// @ts-ignore | ||
return window.HelpHero.apply(null, [method].concat(args)); | ||
@@ -55,0 +57,0 @@ }; |
{ | ||
"name": "helphero", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Offical HelpHero SDK for browsers", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/HelpHero/helphero-javascript.git", |
7791
152