Last active
July 24, 2018 19:27
-
-
Save sbilodeau/63c7587f125f668684fb to your computer and use it in GitHub Desktop.
Slaask with requireJS workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['require', 'https://cdn.slaask.com/chat.js'], function(require, platform) { | |
window.platform = platform; | |
window._slaask = new window.slaaskApp(); | |
window._slaask.createScriptTag = function (url) { | |
var app = this; | |
var virtualStriptTag = {}; | |
require([url], function(emoji) { | |
if(!app.emoji) | |
app.emoji = emoji; | |
if(virtualStriptTag.onload) | |
virtualStriptTag.onload(); | |
}); | |
return virtualStriptTag; | |
}; | |
return window._slaask; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check this simpler one using only script tag
https://gist.github.com/sbilodeau/29c8016b67485614944e