PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / 1.3.1
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel v1.3.1
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / static / codemirror / autorefresh.js
wp-all-export / static / codemirror Last commit date
autorefresh.js 9 years ago clike.js 10 years ago codemirror.css 9 years ago codemirror.js 9 years ago htmlmixed.js 10 years ago javascript.js 10 years ago matchbrackets.js 10 years ago php.js 10 years ago xml.js 10 years ago
autorefresh.js
48 lines
1 // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 // Distributed under an MIT license: http://codemirror.net/LICENSE
3
4 (function(mod) {
5 if (typeof exports == "object" && typeof module == "object") // CommonJS
6 mod(require("../../lib/codemirror"))
7 else if (typeof define == "function" && define.amd) // AMD
8 define(["../../lib/codemirror"], mod)
9 else // Plain browser env
10 mod(CodeMirror)
11 })(function(CodeMirror) {
12 "use strict"
13
14 CodeMirror.defineOption("autoRefresh", false, function(cm, val) {
15 if (cm.state.autoRefresh) {
16 stopListening(cm, cm.state.autoRefresh)
17 cm.state.autoRefresh = null
18 }
19 if (val && cm.display.wrapper.offsetHeight == 0)
20 startListening(cm, cm.state.autoRefresh = {delay: val.delay || 250})
21 })
22
23 function startListening(cm, state) {
24 function check() {
25 if (cm.display.wrapper.offsetHeight) {
26 stopListening(cm, state)
27 if (cm.display.lastWrapHeight != cm.display.wrapper.clientHeight)
28 cm.refresh()
29 } else {
30 state.timeout = setTimeout(check, state.delay)
31 }
32 }
33 state.timeout = setTimeout(check, state.delay)
34 state.hurry = function() {
35 clearTimeout(state.timeout)
36 state.timeout = setTimeout(check, 50)
37 }
38 CodeMirror.on(window, "mouseup", state.hurry)
39 CodeMirror.on(window, "keyup", state.hurry)
40 }
41
42 function stopListening(_cm, state) {
43 clearTimeout(state.timeout)
44 CodeMirror.off(window, "mouseup", state.hurry)
45 CodeMirror.off(window, "keyup", state.hurry)
46 }
47 });
48