aboutsummaryrefslogtreecommitdiffstats
path: root/interface
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2016-12-30 16:14:00 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2016-12-30 16:14:00 +0300
commit6376057981199bb1a3e51babf8b446a5a0681977 (patch)
tree186a1f36f7975ce42e6430443e189f45ec05f316 /interface
parent3a98d054f54cd3f558dc3596fdde46d7c456d0fc (diff)
downloadrspamd-6376057981199bb1a3e51babf8b446a5a0681977.tar.gz
rspamd-6376057981199bb1a3e51babf8b446a5a0681977.zip
[WebUI] Add Visibility.js library
Diffstat (limited to 'interface')
-rw-r--r--interface/index.html1
-rw-r--r--interface/js/visibility.min.js5
2 files changed, 6 insertions, 0 deletions
diff --git a/interface/index.html b/interface/index.html
index 5e7e9e4b6..5b0dda706 100644
--- a/interface/index.html
+++ b/interface/index.html
@@ -364,6 +364,7 @@
<script src="./js/jquery-3.1.1.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/jquery.cookie.min.js"></script>
+<script src="./js/visibility.min.js"></script>
<script src="./js/d3.min.js"></script>
<script src="./js/d3pie.min.js"></script>
<script src="./js/d3evolution.min.js"></script>
diff --git a/interface/js/visibility.min.js b/interface/js/visibility.min.js
new file mode 100644
index 000000000..08b1cfe5f
--- /dev/null
+++ b/interface/js/visibility.min.js
@@ -0,0 +1,5 @@
+/*
+ * Visibility.js 1.2.4 (https://github.com/ai/visibilityjs)
+ * Copyright (c) 2011, Andrey Sitnik, MIT
+ */
+!function(e){"use strict";var i=-1,t={onVisible:function(e){var i=t.isSupported();if(!i||!t.hidden())return e(),i;var n=t.change(function(i,r){t.hidden()||(t.unbind(n),e())});return n},change:function(e){if(!t.isSupported())return!1;i+=1;var n=i;return t._callbacks[n]=e,t._listen(),n},unbind:function(e){delete t._callbacks[e]},afterPrerendering:function(e){var i=t.isSupported(),n="prerender";if(!i||n!=t.state())return e(),i;var r=t.change(function(i,d){n!=d&&(t.unbind(r),e())});return r},hidden:function(){return!(!t._doc.hidden&&!t._doc.webkitHidden)},state:function(){return t._doc.visibilityState||t._doc.webkitVisibilityState||"visible"},isSupported:function(){return!(!t._doc.visibilityState&&!t._doc.webkitVisibilityState)},_doc:document||{},_callbacks:{},_change:function(e){var i=t.state();for(var n in t._callbacks)t._callbacks[n].call(t._doc,e,i)},_listen:function(){if(!t._init){var e="visibilitychange";t._doc.webkitVisibilityState&&(e="webkit"+e);var i=function(){t._change.apply(t,arguments)};t._doc.addEventListener?t._doc.addEventListener(e,i):t._doc.attachEvent(e,i),t._init=!0}}};"undefined"!=typeof module&&module.exports?module.exports=t:e.Visibility=t}(this),function(e){"use strict";var i=-1,t=function(t){return t.every=function(e,n,r){t._time(),r||(r=n,n=null),i+=1;var d=i;return t._timers[d]={visible:e,hidden:n,callback:r},t._run(d,!1),t.isSupported()&&t._listen(),d},t.stop=function(e){return!!t._timers[e]&&(t._stop(e),delete t._timers[e],!0)},t._timers={},t._time=function(){t._timed||(t._timed=!0,t._wasHidden=t.hidden(),t.change(function(){t._stopRun(),t._wasHidden=t.hidden()}))},t._run=function(i,n){var r,d=t._timers[i];if(t.hidden()){if(null===d.hidden)return;r=d.hidden}else r=d.visible;var a=function(){d.last=new Date,d.callback.call(e)};if(n){var o=new Date,c=o-d.last;r>c?d.delay=setTimeout(function(){d.id=setInterval(a,r),a()},r-c):(d.id=setInterval(a,r),a())}else d.id=setInterval(a,r)},t._stop=function(e){var i=t._timers[e];clearInterval(i.id),clearTimeout(i.delay),delete i.id,delete i.delay},t._stopRun=function(e){var i=t.hidden(),n=t._wasHidden;if(i&&!n||!i&&n)for(var r in t._timers)t._stop(r),t._run(r,!i)},t};"undefined"!=typeof module&&module.exports?module.exports=t(require("./visibility.core")):t(e.Visibility)}(window); \ No newline at end of file