From 69f4c3aaecf257e75f3ef36f4bfc3abfacc59d16 Mon Sep 17 00:00:00 2001 From: Fernando van Loenhout Date: Fri, 9 Jun 2017 21:44:12 +0200 Subject: [PATCH 1/2] Implement disable smooth scroll option for ScrollSync --- public/res/extensions/scrollSync.js | 16 +++++++++++++++- public/res/html/scrollSyncSettingsBlock.html | 12 +++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/public/res/extensions/scrollSync.js b/public/res/extensions/scrollSync.js index d9bfdd511..877bc3709 100644 --- a/public/res/extensions/scrollSync.js +++ b/public/res/extensions/scrollSync.js @@ -1,13 +1,23 @@ define([ "jquery", "underscore", + "utils", "classes/Extension", "text!html/scrollSyncSettingsBlock.html" -], function($, _, Extension, scrollSyncSettingsBlockHTML) { +], function($, _, utils, Extension, scrollSyncSettingsBlockHTML) { var scrollSync = new Extension("scrollSync", "Scroll Sync", true, true); scrollSync.settingsBlock = scrollSyncSettingsBlockHTML; + scrollSync.defaultConfig = { + noSmooth: false + }; + scrollSync.onLoadSettings = function() { + utils.setInputChecked("#input-scrollsync-smooth", scrollSync.config.noSmooth); + }; + scrollSync.onSaveSettings = function(newConfig) { + newConfig.noSmooth = utils.getInputChecked("#input-scrollsync-smooth"); + }; var sectionList; scrollSync.onSectionsCreated = function(sectionListParam) { sectionList = sectionListParam; @@ -105,6 +115,10 @@ define([ var currentEndCb; function animate(elt, startValue, endValue, stepCb, endCb) { + if(scrollSync.config.noSmooth) { + elt.scrollTop = endValue; + return; + } if(currentEndCb) { clearTimeout(timeoutId); currentEndCb(); diff --git a/public/res/html/scrollSyncSettingsBlock.html b/public/res/html/scrollSyncSettingsBlock.html index 4ca4936f9..1c4add3fe 100644 --- a/public/res/html/scrollSyncSettingsBlock.html +++ b/public/res/html/scrollSyncSettingsBlock.html @@ -4,4 +4,14 @@ position of the title elements (h1, h2...) in the page. Therefore if your document does not contain any title, the mapping will be linear and consequently less accurate.

- \ No newline at end of file + +
+
+ +
+
+ +
+
+
+
From af693069c98950257f2bb3394fd244e60fcb493e Mon Sep 17 00:00:00 2001 From: Fernando van Loenhout Date: Fri, 9 Jun 2017 21:48:21 +0200 Subject: [PATCH 2/2] Include minified result files --- public/res-min/main.js | 26497 ++++++++++++++++++------------------ public/res-min/require.js | 137 +- 2 files changed, 13341 insertions(+), 13293 deletions(-) diff --git a/public/res-min/main.js b/public/res-min/main.js index a7f199565..3264b556b 100644 --- a/public/res-min/main.js +++ b/public/res-min/main.js @@ -3,34 +3,34 @@ function diff_match_patch() { this.Patch_DeleteThreshold = .5, this.Patch_Margin = 4, this.Match_MaxBits = 32; } -!function(e, t) { - function n(e) { - var t = e.length, n = ot.type(e); - return ot.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === n || "function" !== n && (0 === t || "number" == typeof t && t > 0 && t - 1 in e); +!function(t, e) { + function n(t) { + var e = t.length, n = ot.type(t); + return !ot.isWindow(t) && (!(1 !== t.nodeType || !e) || ("array" === n || "function" !== n && (0 === e || "number" == typeof e && e > 0 && e - 1 in t))); } - function i(e) { - var t = ft[e] = {}; - return ot.each(e.match(st) || [], function(e, n) { - t[n] = !0; - }), t; + function r(t) { + var e = ft[t] = {}; + return ot.each(t.match(st) || [], function(t, n) { + e[n] = !0; + }), e; } - function r() { + function i() { Object.defineProperty(this.cache = {}, 0, { get: function() { return {}; } }), this.expando = ot.expando + Math.random(); } - function o(e, n, i) { - var r; - if (i === t && 1 === e.nodeType) if (r = "data-" + n.replace(bt, "-$1").toLowerCase(), - i = e.getAttribute(r), "string" == typeof i) { + function o(t, n, r) { + var i; + if (r === e && 1 === t.nodeType) if (i = "data-" + n.replace(bt, "-$1").toLowerCase(), + r = t.getAttribute(i), "string" == typeof r) { try { - i = "true" === i ? !0 : "false" === i ? !1 : "null" === i ? null : +i + "" === i ? +i : vt.test(i) ? JSON.parse(i) : i; + r = "true" === r || "false" !== r && ("null" === r ? null : +r + "" === r ? +r : vt.test(r) ? JSON.parse(r) : r); } catch (o) {} - mt.set(e, n, i); - } else i = t; - return i; + mt.set(t, n, r); + } else r = e; + return r; } function a() { return !0; @@ -41,146 +41,146 @@ function diff_match_patch() { function l() { try { return z.activeElement; - } catch (e) {} + } catch (t) {} } - function c(e, t) { - for (;(e = e[t]) && 1 !== e.nodeType; ) ; - return e; + function c(t, e) { + for (;(t = t[e]) && 1 !== t.nodeType; ) ; + return t; } - function u(e, t, n) { - if (ot.isFunction(t)) return ot.grep(e, function(e, i) { - return !!t.call(e, i, e) !== n; + function u(t, e, n) { + if (ot.isFunction(e)) return ot.grep(t, function(t, r) { + return !!e.call(t, r, t) !== n; }); - if (t.nodeType) return ot.grep(e, function(e) { - return e === t !== n; + if (e.nodeType) return ot.grep(t, function(t) { + return t === e !== n; }); - if ("string" == typeof t) { - if (It.test(t)) return ot.filter(t, e, n); - t = ot.filter(t, e); + if ("string" == typeof e) { + if (It.test(e)) return ot.filter(e, t, n); + e = ot.filter(e, t); } - return ot.grep(e, function(e) { - return tt.call(t, e) >= 0 !== n; + return ot.grep(t, function(t) { + return et.call(e, t) >= 0 !== n; }); } - function d(e, t) { - return ot.nodeName(e, "table") && ot.nodeName(1 === t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e; + function d(t, e) { + return ot.nodeName(t, "table") && ot.nodeName(1 === e.nodeType ? e : e.firstChild, "tr") ? t.getElementsByTagName("tbody")[0] || t.appendChild(t.ownerDocument.createElement("tbody")) : t; } - function p(e) { - return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e; + function p(t) { + return t.type = (null !== t.getAttribute("type")) + "/" + t.type, t; } - function h(e) { - var t = jt.exec(e.type); - return t ? e.type = t[1] : e.removeAttribute("type"), e; + function h(t) { + var e = jt.exec(t.type); + return e ? t.type = e[1] : t.removeAttribute("type"), t; } - function f(e, t) { - for (var n = e.length, i = 0; n > i; i++) gt.set(e[i], "globalEval", !t || gt.get(t[i], "globalEval")); + function f(t, e) { + for (var n = t.length, r = 0; r < n; r++) gt.set(t[r], "globalEval", !e || gt.get(e[r], "globalEval")); } - function m(e, t) { - var n, i, r, o, a, s, l, c; - if (1 === t.nodeType) { - if (gt.hasData(e) && (o = gt.access(e), a = gt.set(t, o), c = o.events)) { + function m(t, e) { + var n, r, i, o, a, s, l, c; + if (1 === e.nodeType) { + if (gt.hasData(t) && (o = gt.access(t), a = gt.set(e, o), c = o.events)) { delete a.handle, a.events = {}; - for (r in c) for (n = 0, i = c[r].length; i > n; n++) ot.event.add(t, r, c[r][n]); + for (i in c) for (n = 0, r = c[i].length; n < r; n++) ot.event.add(e, i, c[i][n]); } - mt.hasData(e) && (s = mt.access(e), l = ot.extend({}, s), mt.set(t, l)); + mt.hasData(t) && (s = mt.access(t), l = ot.extend({}, s), mt.set(e, l)); } } - function g(e, n) { - var i = e.getElementsByTagName ? e.getElementsByTagName(n || "*") : e.querySelectorAll ? e.querySelectorAll(n || "*") : []; - return n === t || n && ot.nodeName(e, n) ? ot.merge([ e ], i) : i; + function g(t, n) { + var r = t.getElementsByTagName ? t.getElementsByTagName(n || "*") : t.querySelectorAll ? t.querySelectorAll(n || "*") : []; + return n === e || n && ot.nodeName(t, n) ? ot.merge([ t ], r) : r; } - function v(e, t) { - var n = t.nodeName.toLowerCase(); - "input" === n && Ot.test(e.type) ? t.checked = e.checked : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue); + function v(t, e) { + var n = e.nodeName.toLowerCase(); + "input" === n && Ot.test(t.type) ? e.checked = t.checked : "input" !== n && "textarea" !== n || (e.defaultValue = t.defaultValue); } - function b(e, t) { - if (t in e) return t; - for (var n = t.charAt(0).toUpperCase() + t.slice(1), i = t, r = Zt.length; r--; ) if (t = Zt[r] + n, - t in e) return t; - return i; + function b(t, e) { + if (e in t) return e; + for (var n = e.charAt(0).toUpperCase() + e.slice(1), r = e, i = Zt.length; i--; ) if (e = Zt[i] + n, + e in t) return e; + return r; } - function y(e, t) { - return e = t || e, "none" === ot.css(e, "display") || !ot.contains(e.ownerDocument, e); + function y(t, e) { + return t = e || t, "none" === ot.css(t, "display") || !ot.contains(t.ownerDocument, t); } - function x(t) { - return e.getComputedStyle(t, null); + function x(e) { + return t.getComputedStyle(e, null); } - function w(e, t) { - for (var n, i, r, o = [], a = 0, s = e.length; s > a; a++) i = e[a], i.style && (o[a] = gt.get(i, "olddisplay"), - n = i.style.display, t ? (o[a] || "none" !== n || (i.style.display = ""), "" === i.style.display && y(i) && (o[a] = gt.access(i, "olddisplay", k(i.nodeName)))) : o[a] || (r = y(i), - (n && "none" !== n || !r) && gt.set(i, "olddisplay", r ? n : ot.css(i, "display")))); - for (a = 0; s > a; a++) i = e[a], i.style && (t && "none" !== i.style.display && "" !== i.style.display || (i.style.display = t ? o[a] || "" : "none")); - return e; + function w(t, e) { + for (var n, r, i, o = [], a = 0, s = t.length; a < s; a++) r = t[a], r.style && (o[a] = gt.get(r, "olddisplay"), + n = r.style.display, e ? (o[a] || "none" !== n || (r.style.display = ""), "" === r.style.display && y(r) && (o[a] = gt.access(r, "olddisplay", k(r.nodeName)))) : o[a] || (i = y(r), + (n && "none" !== n || !i) && gt.set(r, "olddisplay", i ? n : ot.css(r, "display")))); + for (a = 0; a < s; a++) r = t[a], r.style && (e && "none" !== r.style.display && "" !== r.style.display || (r.style.display = e ? o[a] || "" : "none")); + return t; } - function S(e, t, n) { - var i = Vt.exec(t); - return i ? Math.max(0, i[1] - (n || 0)) + (i[2] || "px") : t; + function S(t, e, n) { + var r = Vt.exec(e); + return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : e; } - function C(e, t, n, i, r) { - for (var o = n === (i ? "border" : "content") ? 4 : "width" === t ? 1 : 0, a = 0; 4 > o; o += 2) "margin" === n && (a += ot.css(e, n + Jt[o], !0, r)), - i ? ("content" === n && (a -= ot.css(e, "padding" + Jt[o], !0, r)), "margin" !== n && (a -= ot.css(e, "border" + Jt[o] + "Width", !0, r))) : (a += ot.css(e, "padding" + Jt[o], !0, r), - "padding" !== n && (a += ot.css(e, "border" + Jt[o] + "Width", !0, r))); + function C(t, e, n, r, i) { + for (var o = n === (r ? "border" : "content") ? 4 : "width" === e ? 1 : 0, a = 0; o < 4; o += 2) "margin" === n && (a += ot.css(t, n + Jt[o], !0, i)), + r ? ("content" === n && (a -= ot.css(t, "padding" + Jt[o], !0, i)), "margin" !== n && (a -= ot.css(t, "border" + Jt[o] + "Width", !0, i))) : (a += ot.css(t, "padding" + Jt[o], !0, i), + "padding" !== n && (a += ot.css(t, "border" + Jt[o] + "Width", !0, i))); return a; } - function _(e, t, n) { - var i = !0, r = "width" === t ? e.offsetWidth : e.offsetHeight, o = x(e), a = ot.support.boxSizing && "border-box" === ot.css(e, "boxSizing", !1, o); - if (0 >= r || null == r) { - if (r = qt(e, t, o), (0 > r || null == r) && (r = e.style[t]), Wt.test(r)) return r; - i = a && (ot.support.boxSizingReliable || r === e.style[t]), r = parseFloat(r) || 0; + function _(t, e, n) { + var r = !0, i = "width" === e ? t.offsetWidth : t.offsetHeight, o = x(t), a = ot.support.boxSizing && "border-box" === ot.css(t, "boxSizing", !1, o); + if (i <= 0 || null == i) { + if (i = qt(t, e, o), (i < 0 || null == i) && (i = t.style[e]), Wt.test(i)) return i; + r = a && (ot.support.boxSizingReliable || i === t.style[e]), i = parseFloat(i) || 0; } - return r + C(e, t, n || (a ? "border" : "content"), i, o) + "px"; + return i + C(t, e, n || (a ? "border" : "content"), r, o) + "px"; } - function k(e) { - var t = z, n = Qt[e]; - return n || (n = E(e, t), "none" !== n && n || (Ht = (Ht || ot("