mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-06 21:57:14 +02:00
* feat(v2): embed Canny feedback widget * docs(v2): Mention source of Canny widget * misc(v2): add newline
37 lines
948 B
JavaScript
37 lines
948 B
JavaScript
/**
|
|
* Copyright (c) 2017-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
// Provided by Canny.
|
|
|
|
function canny() {
|
|
!(function(w, d, i, s) {
|
|
function l() {
|
|
if (!d.getElementById(i)) {
|
|
var f = d.getElementsByTagName(s)[0],
|
|
e = d.createElement(s);
|
|
(e.type = 'text/javascript'),
|
|
(e.async = !0),
|
|
(e.src = 'https://canny.io/sdk.js'),
|
|
f.parentNode.insertBefore(e, f);
|
|
}
|
|
}
|
|
if ('function' != typeof w.Canny) {
|
|
var c = function() {
|
|
c.q.push(arguments);
|
|
};
|
|
(c.q = []),
|
|
(w.Canny = c),
|
|
'complete' === d.readyState
|
|
? l()
|
|
: w.attachEvent
|
|
? w.attachEvent('onload', l)
|
|
: w.addEventListener('load', l, !1);
|
|
}
|
|
})(window, document, 'canny-jssdk', 'script');
|
|
}
|
|
|
|
export default canny;
|