Skip to content

Commit

Permalink
#64 Add wake-event.bundle.js lib
Browse files Browse the repository at this point in the history
  • Loading branch information
pantunes committed May 4, 2020
1 parent 5cb97cd commit f6c4a27
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
23 changes: 23 additions & 0 deletions xtcryptosignals/client/static/js/wake-event.bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(function(e){if("function"==typeof bootstrap)bootstrap("wakeevent",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeWakeEvent=e}else"undefined"!=typeof window?window.wakeEvent=e():global.wakeEvent=e()})(function(){var define,ses,bootstrap,module,exports;
return (function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){
var timeout = 5000;
var lastTime = Date.now();
var callbacks = [];

setInterval(function() {
var currentTime = Date.now();
if (currentTime > (lastTime + timeout + 2000)) {
callbacks.forEach(function (fn) {
fn();
});
}
lastTime = currentTime;
}, timeout);

module.exports = function (fn) {
callbacks.push(fn);
};

},{}]},{},[1])(1)
});
;
1 change: 1 addition & 0 deletions xtcryptosignals/client/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<script src="/static/js/modals.js" type="text/javascript"></script>
<script src="/static/js/actions.js" type="text/javascript"></script>
<script src="/static/js/notify/styles/bootstrap.js" type="text/javascript"></script>
<script src="/static/js/wake-event.bundle.js" type="text/javascript"></script>

<!-- custom -->
<script type="text/javascript">
Expand Down
6 changes: 6 additions & 0 deletions xtcryptosignals/client/templates/tools/coin-token.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
}
</script>

<script type="text/javascript">
wakeEvent(function () {
alert('Computer Awakes!!!');
});
</script>

<br/>

<div class="u-pull-right">
Expand Down

0 comments on commit f6c4a27

Please sign in to comment.