diff --git a/Gruntfile.js b/Gruntfile.js index 8d3f7415..c83a2471 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -62,6 +62,9 @@ module.exports = function(grunt) { }, less: { compile: { + options: { + compress: true, + }, files: [ { expand: true, @@ -71,40 +74,15 @@ module.exports = function(grunt) { ], dest: 'public/res-min/themes', ext: '.css', - } - ] - }, - compress: { - options: { - compress: true, - paths: 'public/res/styles' - }, - files: [ + }, { - expand: true, - cwd: 'public/res-min/themes', - src: [ - '*.css' - ], - dest: 'public/res-min/themes', + src: 'public/res/styles/base.less', + dest: 'public/res-min/themes/base.css', } - ] + ], }, }, 'string-replace': { - 'css-import': { - files: { - './': 'public/res-min/themes/*.css', - }, - options: { - replacements: [ - { - pattern: /@import /g, - replacement: '@import (less) ' - }, - ] - } - }, 'font-parameters': { files: { './': 'public/res-min/themes/*.css', @@ -161,14 +139,6 @@ module.exports = function(grunt) { ], dest: 'public/res-min/font/' }, - { - expand: true, - cwd: 'public/res/libs/fontello/font', - src: [ - '**' - ], - dest: 'public/res-min/font/' - }, // Images { expand: true, @@ -243,10 +213,6 @@ module.exports = function(grunt) { // First compile less files grunt.task.run('less:compile'); - // Then force evaluation of CSS imports - grunt.task.run('string-replace:css-import'); - // Run less another time with CSS evaluation and compression - grunt.task.run('less:compress'); // Remove fontello checksum arguments grunt.task.run('string-replace:font-parameters'); diff --git a/bower.json b/bower.json index 37e83d68..445860f9 100644 --- a/bower.json +++ b/bower.json @@ -7,8 +7,8 @@ "jquery": "2.0.3", "underscore": "1.5.1", "requirejs": "~2.1.8", - "require-css": "~0.0.7", - "require-less": "~0.0.7", + "require-css": "0.1.0", + "require-less": "0.1.0", "mousetrap": "~1.4.4", "jgrowl": "~1.2.10", "google-code-prettify": "~1.0.0", diff --git a/public/cache.manifest b/public/cache.manifest index 2e897a3b..27aea1d5 100644 --- a/public/cache.manifest +++ b/public/cache.manifest @@ -1,5 +1,5 @@ CACHE MANIFEST -#Date Sat Nov 23 2013 15:42:13 +#Date Mon Dec 02 2013 00:08:34 CACHE: res/worker.js @@ -11,6 +11,12 @@ libs/MathJax/images/MenuArrow-15.png libs/MathJax/jax/output/HTML-CSS/jax.js #DynamicResourcesBegin +res-min/font/OpenSans-Bold.woff +res-min/font/OpenSans-BoldItalic.woff +res-min/font/OpenSans-Italic.woff +res-min/font/OpenSans-Light.woff +res-min/font/OpenSans.woff +res-min/font/OpenSansLight-Italic.woff res-min/font/cursive_standard-webfont.eot res-min/font/cursive_standard-webfont.svg res-min/font/cursive_standard-webfont.ttf @@ -24,14 +30,15 @@ res-min/img/glyphicons-halflings-white.png res-min/img/glyphicons-halflings.png res-min/img/icons.png res-min/img/icons2x.png +res-min/img/logo-promo-128.png +res-min/img/menu-icon.png res-min/img/school-line.png res-min/img/stackedit-32.ico -res-min/img/stackedit-64.png -res-min/img/stackedit-promo.png res-min/main.js res-min/require.js -res-min/themes/blue-gray.css +res-min/themes/base.css res-min/themes/default.css +res-min/themes/gray.css res-min/themes/night.css res-min/themes/school.css libs/dictionaries/de_DE.aff.lz diff --git a/public/index.html b/public/index.html index a05cddcb..ac382d2c 100644 --- a/public/index.html +++ b/public/index.html @@ -2,7 +2,7 @@ - StackEdit - Markdown editor + StackEdit - Your markdown editor diff --git a/public/res-min/font/OpenSans-Bold.woff b/public/res-min/font/OpenSans-Bold.woff new file mode 100644 index 00000000..a8b5bc26 Binary files /dev/null and b/public/res-min/font/OpenSans-Bold.woff differ diff --git a/public/res-min/font/OpenSans-BoldItalic.woff b/public/res-min/font/OpenSans-BoldItalic.woff new file mode 100644 index 00000000..6a183381 Binary files /dev/null and b/public/res-min/font/OpenSans-BoldItalic.woff differ diff --git a/public/res-min/font/OpenSans-Italic.woff b/public/res-min/font/OpenSans-Italic.woff new file mode 100644 index 00000000..039a2949 Binary files /dev/null and b/public/res-min/font/OpenSans-Italic.woff differ diff --git a/public/res-min/font/OpenSans-Light.woff b/public/res-min/font/OpenSans-Light.woff new file mode 100644 index 00000000..8025ba6c Binary files /dev/null and b/public/res-min/font/OpenSans-Light.woff differ diff --git a/public/res-min/font/OpenSans.woff b/public/res-min/font/OpenSans.woff new file mode 100644 index 00000000..58e6cb38 Binary files /dev/null and b/public/res-min/font/OpenSans.woff differ diff --git a/public/res-min/font/OpenSansLight-Italic.woff b/public/res-min/font/OpenSansLight-Italic.woff new file mode 100644 index 00000000..c1e29dc5 Binary files /dev/null and b/public/res-min/font/OpenSansLight-Italic.woff differ diff --git a/public/res-min/font/fontello.eot b/public/res-min/font/fontello.eot index 833234c0..3899c95a 100644 Binary files a/public/res-min/font/fontello.eot and b/public/res-min/font/fontello.eot differ diff --git a/public/res-min/font/fontello.svg b/public/res-min/font/fontello.svg index b4b37e74..cd208f44 100644 --- a/public/res-min/font/fontello.svg +++ b/public/res-min/font/fontello.svg @@ -1,329 +1,329 @@ -Copyright (C) 2012 by original authors @ fontello.com +Copyright (C) 2013 by original authors @ fontello.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/res-min/font/fontello.ttf b/public/res-min/font/fontello.ttf index 285230a7..67268b8b 100644 Binary files a/public/res-min/font/fontello.ttf and b/public/res-min/font/fontello.ttf differ diff --git a/public/res-min/font/fontello.woff b/public/res-min/font/fontello.woff index 0237315e..c0eb19e1 100644 Binary files a/public/res-min/font/fontello.woff and b/public/res-min/font/fontello.woff differ diff --git a/public/res-min/img/logo-promo-128.png b/public/res-min/img/logo-promo-128.png new file mode 100644 index 00000000..3c67f3cf Binary files /dev/null and b/public/res-min/img/logo-promo-128.png differ diff --git a/public/res/img/stackedit-64.png b/public/res-min/img/menu-icon.png similarity index 59% rename from public/res/img/stackedit-64.png rename to public/res-min/img/menu-icon.png index ae99f641..5daffe86 100644 Binary files a/public/res/img/stackedit-64.png and b/public/res-min/img/menu-icon.png differ diff --git a/public/res-min/img/stackedit-32.ico b/public/res-min/img/stackedit-32.ico index 3d5d2858..a2e8be58 100644 Binary files a/public/res-min/img/stackedit-32.ico and b/public/res-min/img/stackedit-32.ico differ diff --git a/public/res-min/img/stackedit-64.png b/public/res-min/img/stackedit-64.png deleted file mode 100644 index db5ad961..00000000 Binary files a/public/res-min/img/stackedit-64.png and /dev/null differ diff --git a/public/res-min/img/stackedit-promo.png b/public/res-min/img/stackedit-promo.png deleted file mode 100644 index 5312fa42..00000000 Binary files a/public/res-min/img/stackedit-promo.png and /dev/null differ diff --git a/public/res-min/main.js b/public/res-min/main.js index ebdb3764..a00e6cc6 100644 --- a/public/res-min/main.js +++ b/public/res-min/main.js @@ -347,7 +347,7 @@ THE SOFTWARE. * Mousetrap is a simple keyboard shortcut library for Javascript with * no external dependencies * - * @version 1.4.5 + * @version 1.4.6 * @url craig.is/killing/mice */ @@ -705,7 +705,7 @@ THE SOFTWARE. * ======================================================================== */ /* =========================================================== -# bootstrap-tour - v0.6.1 +# bootstrap-tour - v0.7.1 # http://bootstraptour.com # ============================================================== # Copyright 2012-2013 Ulrich Sossou @@ -11548,7 +11548,7 @@ function printStackTrace(e) { e.GITHUB_CLIENT_ID = "d2943d6074b2d9c4a830", e.GATEKEEPER_URL = "https://stackedit-gatekeeper-insomnia.herokuapp.com/", e.TUMBLR_PROXY_URL = "https://stackedit-tumblr-proxy-beta.herokuapp.com/"), e.THEME_LIST = { "default": "Default", - "blue-gray": "Blue-Gray", + gray: "Gray", night: "Night", school: "School" }, e; @@ -13657,8 +13657,8 @@ var saveAs = saveAs || "undefined" != typeof navigator && navigator.msSaveOrOpen var i = { layoutOrientation: "horizontal", lazyRendering: !0, - editorFontFamily: 'Menlo, Consolas, "Courier New", Courier, monospace', - editorFontSize: 12, + editorFontFamily: '"Courier New", Courier, monospace', + editorFontSize: 14, maxWidth: 960, defaultContent: "\n\n\n> Written with [StackEdit](" + t.MAIN_URL + ").", commitMsg: "Published with " + t.MAIN_URL, @@ -18885,7 +18885,7 @@ function() { e; } function l(e, t) { - return o(c(e, t), g); + return o(c(e, t), f); } function c(e, t) { var n = t.blockGamutHookCallback(e); @@ -18909,18 +18909,7 @@ function() { n = n.replace(/&\#8217;/g, "'"), n = n.replace(/&\#8212;/g, "---"), n = n.replace(/&\#8211;/g, "--"), n = n.replace(/&\#8230;/g, "..."); } - function f(e) { - return e = e.replace(/``/g, "“").replace(/''/g, "”"), e = e.replace(/---/g, "—").replace(/--/g, "–"), - e = e.replace(/\.\.\./g, "…").replace(/\.\s\.\s\./g, "…"), e = e.replace(/^'(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/g, "‘"), - e = e.replace(/^"(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/g, "“"), - e = e.replace(/^"(?=\w)/g, "“"), e = e.replace(/^'(?=\w)/g, "‘"), e = e.replace(/"'(?=\w)/g, "“‘"), - e = e.replace(/'"(?=\w)/g, "‘“"), e = e.replace(/'(?=\d{2}s)/g, "’"), - e = e.replace(/(>|\t|\n|\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)'(?=\w)/g, "$1‘"), - e = e.replace(/([^<>\\ \t\r\n\[\{\(\-])'(?=\s | s\b)/g, "$1’"), e = e.replace(/`/g, "‘").replace(/'/g, "’"), - e = e.replace(/(>|\t|\n|\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)"(?=\w)/g, "$1“"), - e = e.replace(/([^<>\\ \t\r\n\[\{\(\-])"(?=\s | s\b)/g, "$1”"), e = e.replace(/"/gi, "”"); - } - var g = new RegExp([ "^(<\\/?(a|abbr|acronym|applet|area|b|basefont|", "bdo|big|button|cite|code|del|dfn|em|figcaption|", "font|i|iframe|img|input|ins|kbd|label|map|", "mark|meter|object|param|progress|q|ruby|rp|rt|s|", "samp|script|select|small|span|strike|strong|", "sub|sup|textarea|time|tt|u|var|wbr)[^>]*>|", "<(br)\\s?\\/?>)$" ].join(""), "i"); + var f = new RegExp([ "^(<\\/?(a|abbr|acronym|applet|area|b|basefont|", "bdo|big|button|cite|code|del|dfn|em|figcaption|", "font|i|iframe|img|input|ins|kbd|label|map|", "mark|meter|object|param|progress|q|ruby|rp|rt|s|", "samp|script|select|small|span|strike|strong|", "sub|sup|textarea|time|tt|u|var|wbr)[^>]*>|", "<(br)\\s?\\/?>)$" ].join(""), "i"); Array.indexOf || (Array.prototype.indexOf = function(e) { for (var t = 0; t < this.length; t++) if (this[t] == e) return t; return -1; @@ -19059,16 +19048,29 @@ function() { var c = [ "", t(s), "" ].join(""); return n.hashExtraBlock(c); }); - }; - var m = function(e) { - var t = "", n = 0; - return e.replace(/(<)([a-zA-Z1-6]+)([^\n]*?>)([\s\S]*?)(<\/\2>)/g, function(i, o, r, s, a, l, c) { - t += f(e.substring(n, c)), n = c + i.length, /code|kbd|pre|script|noscript|iframe|math|ins|del|pre/i.test(r) || (a = m(a)), - t += o + r + s + a + l; - }), t + f(e.substring(n)); - }; - Markdown.Extra.prototype.runSmartyPants = function(e) { - return e = m(e), e = e.replace(/(<([a-zA-Z1-6]+)\b([^\n>]*?)(\/)?>)/g, p); + }, Markdown.Extra.prototype.educatePants = function(e) { + var t = this, n = "", i = 0; + e.replace(/(<)([a-zA-Z1-6]+)([^\n]*?>)([\s\S]*?)(<\/\2>)/g, function(o, r, s, a, l, c, u) { + var d = e.substring(i, u); + n += t.applyPants(d), t.smartyPantsLastChar = n.substring(n.length - 1), i = u + o.length, + /code|kbd|pre|script|noscript|iframe|math|ins|del|pre/i.test(s) ? t.smartyPantsLastChar = l.substring(l.length - 1) : l = t.educatePants(l), + n += r + s + a + l + c; + }); + var o = e.substring(i); + return n += t.applyPants(o), t.smartyPantsLastChar = n.substring(n.length - 1), + n; + }, Markdown.Extra.prototype.applyPants = function(e) { + return e = e.replace(/---/g, "—").replace(/--/g, "–"), e = e.replace(/\.\.\./g, "…").replace(/\.\s\.\s\./g, "…"), + e = e.replace(/``/g, "“").replace(/''/g, "”"), /^'$/.test(e) ? /\S/.test(this.smartyPantsLastChar) ? "’" : "‘" : /^"$/.test(e) ? /\S/.test(this.smartyPantsLastChar) ? "”" : "“" : (e = e.replace(/^'(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/, "’"), + e = e.replace(/^"(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/, "”"), e = e.replace(/"'(?=\w)/g, "“‘"), + e = e.replace(/'"(?=\w)/g, "‘“"), e = e.replace(/'(?=\d{2}s)/g, "’"), + e = e.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)'(?=\w)/g, "$1‘"), + e = e.replace(/([^\s\[\{\(\-])'/g, "$1’"), e = e.replace(/'(?=\s|s\b)/g, "’"), + e = e.replace(/'/g, "‘"), e = e.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)"(?=\w)/g, "$1“"), + e = e.replace(/([^\s\[\{\(\-])"/g, "$1”"), e = e.replace(/"(?=\s)/g, "”"), + e = e.replace(/"/gi, "“")); + }, Markdown.Extra.prototype.runSmartyPants = function(e) { + return this.smartyPantsLastChar = "", e = this.educatePants(e), e = e.replace(/(<([a-zA-Z1-6]+)\b([^\n>]*?)(\/)?>)/g, p); }, Markdown.Extra.prototype.definitionLists = function(t) { var n = new RegExp([ "(\\x02\\n?|\\n\\n)", "(?:", "(", "(", "[ ]{0,3}", "((?:[ \\t]*\\S.*\\n)+)", "\\n?", "[ ]{0,3}:[ ]+", ")", "([\\s\\S]+?)", "(", "(?=\\0x03)", "|", "(?=", "\\n{2,}", "(?=\\S)", "(?!", "[ ]{0,3}", "(?:\\S.*\\n)+?", "\\n?", "[ ]{0,3}:[ ]+", ")", "(?!", "[ ]{0,3}:[ ]+", ")", ")", ")", ")", ")" ].join(""), "gm"), i = this; return t = s(t), t = t.replace(n, function(t, n, o) { @@ -19394,7 +19396,7 @@ function() { m = !0; }, l; }), define("text!html/buttonMarkdownSyntax.html", [], function() { - return '\n\n'; + return '\n\n'; }), define("extensions/buttonMarkdownSyntax", [ "jquery", "classes/Extension", "text!html/buttonMarkdownSyntax.html" ], function(e, t, n) { var i = new t("buttonMarkdownSyntax", 'Button "Markdown syntax', !0, !0); return i.settingsBlock = '

Adds a "Markdown syntax" button over the preview.

', @@ -19462,7 +19464,7 @@ function() { !t.isString(e) && e.message && _gaq.push([ "_trackEvent", "Error", "message", e.message + i.formatEventList() ]); }, a; }), define("text!html/dialogAbout.html", [], function() { - return '\n'; + return '\n'; }), define("extensions/dialogAbout", [ "underscore", "constants", "utils", "classes/Extension", "text!html/dialogAbout.html" ], function(e, t, n, i, o) { var r = new i("dialogAbout", 'Dialog "About"'), s = { ACE: "http://ace.c9.io/", @@ -19579,6 +19581,26 @@ function() { l = t.querySelector(".sync-list"), c = e(t.querySelectorAll(".msg-sync-list")), u = e(t.querySelectorAll(".msg-no-sync")); }, r; +}), define("text!html/dialogManageSharingLocation.html", [], function() { + return '
\n \n
\n'; +}), define("extensions/dialogManageSharing", [ "jquery", "underscore", "classes/Extension", "text!html/dialogManageSharingLocation.html" ], function(e, t, n, i) { + var o, r, s, a, l = new n("dialogManageSharing", 'Button "Share"', !1, !0), c = function(e) { + if (void 0 === e || e === o) { + var n = t.reduce(o.publishLocations, function(e, n) { + return n.sharingLink && (e += t.template(i, { + link: n.sharingLink + })), e; + }, ""); + r.innerHTML = n, s.toggleClass("hide", 0 === n.length), a.toggleClass("hide", 0 !== n.length); + } + }; + return l.onFileSelected = function(e) { + o = e, c(e); + }, l.onNewPublishSuccess = c, l.onPublishRemoved = c, l.onReady = function() { + var t = document.querySelector(".modal-manage-sharing"); + r = t.querySelector(".share-list"), s = e(t.querySelectorAll(".msg-share-list")), + a = e(t.querySelectorAll(".msg-no-share")); + }, l; }), function() { var e = this, t = {}, n = !1; "undefined" != typeof module && module.exports ? (module.exports = t, e.toMarkdown = t, @@ -19800,7 +19822,7 @@ function() { var t = String.fromCharCode(e.which); return e.shiftKey || (t = t.toLowerCase()), t; } - return C[e.which] ? C[e.which] : k[e.which] ? k[e.which] : String.fromCharCode(e.which).toLowerCase(); + return E[e.which] ? E[e.which] : S[e.which] ? S[e.which] : String.fromCharCode(e.which).toLowerCase(); } function o(e, t) { return e.sort().join(",") === t.sort().join(","); @@ -19808,16 +19830,16 @@ function() { function r(e) { e = e || {}; var t, n = !1; - for (t in F) e[t] ? n = !0 : F[t] = 0; - n || (D = !1); + for (t in $) e[t] ? n = !0 : $[t] = 0; + n || (B = !1); } function s(e, t, n, i, r, s) { var a, l, c = [], u = n.type; - if (!A[e]) return []; - for ("keyup" == u && d(e) && (t = [ e ]), a = 0; a < A[e].length; ++a) if (l = A[e][a], - (i || !l.seq || F[l.seq] == l.level) && u == l.action && ("keypress" == u && !n.metaKey && !n.ctrlKey || o(t, l.modifiers))) { - var h = !i && l.combo == r, p = i && l.seq == i && l.level == s; - (h || p) && A[e].splice(a, 1), c.push(l); + if (!F[e]) return []; + for ("keyup" == u && p(e) && (t = [ e ]), a = 0; a < F[e].length; ++a) if (l = F[e][a], + (i || !l.seq || $[l.seq] == l.level) && u == l.action && ("keypress" == u && !n.metaKey && !n.ctrlKey || o(t, l.modifiers))) { + var d = !i && l.combo == r, h = i && l.seq == i && l.level == s; + (d || h) && F[e].splice(a, 1), c.push(l); } return c; } @@ -19826,78 +19848,84 @@ function() { return e.shiftKey && t.push("shift"), e.altKey && t.push("alt"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), t; } - function l(e, t, n) { - B.stopCallback(t, t.target || t.srcElement, n) || e(t, n) === !1 && (t.preventDefault && t.preventDefault(), - t.stopPropagation && t.stopPropagation(), t.returnValue = !1, t.cancelBubble = !0); + function l(e) { + return e.preventDefault ? (e.preventDefault(), void 0) : (e.returnValue = !1, void 0); } - function c(e, t, n) { - var i, o = s(e, t, n), a = {}, c = 0, u = !1; - for (i = 0; i < o.length; ++i) o[i].seq && (c = Math.max(c, o[i].level)); - for (i = 0; i < o.length; ++i) if (o[i].seq) { - if (o[i].level != c) continue; - u = !0, a[o[i].seq] = 1, l(o[i].callback, n, o[i].combo); - } else u || l(o[i].callback, n, o[i].combo); - var h = "keypress" == n.type && $; - n.type != D || d(e) || h || r(a), $ = u && "keydown" == n.type; - } - function u(e) { - "number" != typeof e.which && (e.which = e.keyCode); - var t = i(e); - if (t) return "keyup" == e.type && T === t ? (T = !1, void 0) : (B.handleKey(t, a(e), e), + function c(e) { + return e.stopPropagation ? (e.stopPropagation(), void 0) : (e.cancelBubble = !0, void 0); } - function d(e) { + function u(e, t, n, i) { + M.stopCallback(t, t.target || t.srcElement, n, i) || e(t, n) === !1 && (l(t), c(t)); + } + function d(e, t, n) { + var i, o = s(e, t, n), a = {}, l = 0, c = !1; + for (i = 0; i < o.length; ++i) o[i].seq && (l = Math.max(l, o[i].level)); + for (i = 0; i < o.length; ++i) if (o[i].seq) { + if (o[i].level != l) continue; + c = !0, a[o[i].seq] = 1, u(o[i].callback, n, o[i].combo, o[i].seq); + } else c || u(o[i].callback, n, o[i].combo); + var d = "keypress" == n.type && L; + n.type != B || p(e) || d || r(a), L = c && "keydown" == n.type; + } + function h(e) { + "number" != typeof e.which && (e.which = e.keyCode); + var t = i(e); + if (t) return "keyup" == e.type && D === t ? (D = !1, void 0) : (M.handleKey(t, a(e), e), + void 0); + } + function p(e) { return "shift" == e || "ctrl" == e || "alt" == e || "meta" == e; } - function h() { - clearTimeout(x), x = setTimeout(r, 1e3); + function f() { + clearTimeout(k), k = setTimeout(r, 1e3); } - function p() { - if (!w) { - w = {}; - for (var e in C) e > 95 && 112 > e || C.hasOwnProperty(e) && (w[C[e]] = e); + function g() { + if (!C) { + C = {}; + for (var e in E) e > 95 && 112 > e || E.hasOwnProperty(e) && (C[E[e]] = e); } - return w; + return C; } - function f(e, t, n) { - return n || (n = p()[e] ? "keydown" : "keypress"), "keypress" == n && t.length && (n = "keydown"), + function m(e, t, n) { + return n || (n = g()[e] ? "keydown" : "keypress"), "keypress" == n && t.length && (n = "keydown"), n; } - function g(e, t, n, o) { + function v(e, t, n, o) { function s(t) { return function() { - D = t, ++F[e], h(); + B = t, ++$[e], f(); }; } function a(t) { - l(n, t, e), "keyup" !== o && (T = i(t)), setTimeout(r, 10); + u(n, t, e), "keyup" !== o && (D = i(t)), setTimeout(r, 10); } - F[e] = 0; - for (var c = 0; c < t.length; ++c) { - var u = c + 1 === t.length, d = u ? a : s(o || v(t[c + 1]).action); - b(t[c], d, o, e, c); + $[e] = 0; + for (var l = 0; l < t.length; ++l) { + var c = l + 1 === t.length, d = c ? a : s(o || y(t[l + 1]).action); + w(t[l], d, o, e, l); } } - function m(e) { + function b(e) { return "+" === e ? [ "+" ] : e.split("+"); } - function v(e, t) { + function y(e, t) { var n, i, o, r = []; - for (n = m(e), o = 0; o < n.length; ++o) i = n[o], S[i] && (i = S[i]), t && "keypress" != t && E[i] && (i = E[i], - r.push("shift")), d(i) && r.push(i); - return t = f(i, r, t), { + for (n = b(e), o = 0; o < n.length; ++o) i = n[o], _[i] && (i = _[i]), t && "keypress" != t && A[i] && (i = A[i], + r.push("shift")), p(i) && r.push(i); + return t = m(i, r, t), { key: i, modifiers: r, action: t }; } - function b(e, t, n, i, o) { - _[e + ":" + n] = t, e = e.replace(/\s+/g, " "); + function w(e, t, n, i, o) { + T[e + ":" + n] = t, e = e.replace(/\s+/g, " "); var r, a = e.split(" "); - return a.length > 1 ? (g(e, a, t, n), void 0) : (r = v(e, n), A[r.key] = A[r.key] || [], + return a.length > 1 ? (v(e, a, t, n), void 0) : (r = y(e, n), F[r.key] = F[r.key] || [], s(r.key, r.modifiers, { type: r.action - }, i, e, o), A[r.key][i ? "unshift" : "push"]({ + }, i, e, o), F[r.key][i ? "unshift" : "push"]({ callback: t, modifiers: r.modifiers, action: r.action, @@ -19906,10 +19934,10 @@ function() { combo: e }), void 0); } - function y(e, t, n) { - for (var i = 0; i < e.length; ++i) b(e[i], t, n); + function x(e, t, n) { + for (var i = 0; i < e.length; ++i) w(e[i], t, n); } - for (var w, x, C = { + for (var C, k, E = { 8: "backspace", 9: "tab", 13: "enter", @@ -19932,7 +19960,7 @@ function() { 91: "meta", 93: "meta", 224: "meta" - }, k = { + }, S = { 106: "*", 107: "+", 109: "-", @@ -19949,7 +19977,7 @@ function() { 220: "\\", 221: "]", 222: "'" - }, E = { + }, A = { "~": "`", "!": "1", "@": "2", @@ -19969,34 +19997,34 @@ function() { ">": ".", "?": "/", "|": "\\" - }, S = { + }, _ = { option: "alt", command: "meta", "return": "enter", escape: "esc", mod: /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl" - }, A = {}, _ = {}, F = {}, T = !1, $ = !1, D = !1, L = 1; 20 > L; ++L) C[111 + L] = "f" + L; - for (L = 0; 9 >= L; ++L) C[L + 96] = L; - n(t, "keypress", u), n(t, "keydown", u), n(t, "keyup", u); - var B = { + }, F = {}, T = {}, $ = {}, D = !1, L = !1, B = !1, I = 1; 20 > I; ++I) E[111 + I] = "f" + I; + for (I = 0; 9 >= I; ++I) E[I + 96] = I; + n(t, "keypress", h), n(t, "keydown", h), n(t, "keyup", h); + var M = { bind: function(e, t, n) { - return e = e instanceof Array ? e : [ e ], y(e, t, n), this; + return e = e instanceof Array ? e : [ e ], x(e, t, n), this; }, unbind: function(e, t) { - return B.bind(e, function() {}, t); + return M.bind(e, function() {}, t); }, trigger: function(e, t) { - return _[e + ":" + t] && _[e + ":" + t]({}, e), this; + return T[e + ":" + t] && T[e + ":" + t]({}, e), this; }, reset: function() { - return A = {}, _ = {}, this; + return F = {}, T = {}, this; }, stopCallback: function(e, t) { return (" " + t.className + " ").indexOf(" mousetrap ") > -1 ? !1 : "INPUT" == t.tagName || "SELECT" == t.tagName || "TEXTAREA" == t.tagName || t.isContentEditable; }, - handleKey: c + handleKey: d }; - e.Mousetrap = B, "function" == typeof define && define.amd && define("mousetrap", B); + e.Mousetrap = M, "function" == typeof define && define.amd && define("mousetrap", M); }(window, document), define("classes/FileDescriptor", [ "underscore", "utils", "storage", "ace/range" ], function(e, t, n, i) { function o(t, i, o, s) { this.fileIndex = t, this._title = i || n[t + ".title"], this._editorScrollTop = parseInt(n[t + ".editorScrollTop"]) || 0, @@ -20112,7 +20140,7 @@ function() { l.onFileMgrCreated = function(e) { u = e; }; - var d, h, p, f, g, m, v, b = [ '
  • " data-file-index="<%= fileDesc.fileIndex %>">', ' ', " <%= fileDesc.composeTitle() %>", " ", "
  • " ].join(""), y = function() { + var d, h, p, f, g, m, v, b = [ '
  • " data-file-index="<%= fileDesc.fileIndex %>">', ' ', " <%= fileDesc.composeTitle() %>", " ", "
  • " ].join(""), y = t.debounce(function() { var n = t.chain(s).sortBy(f).reduce(function(e, n) { return e + t.template(b, { fileDesc: n, @@ -20127,7 +20155,7 @@ function() { m = void 0, n.hasClass("disabled") ? void 0 !== c ? c.focus() : v.focus() : u.selectFile(i); }); }); - }; + }, 50); return l.onFileSelected = function(e) { g = e, y(); }, l.onFileCreated = y, l.onFileDeleted = y, l.onTitleChanged = y, l.onSyncExportSuccess = y, @@ -20216,7 +20244,7 @@ function() { l.onFileMgrCreated = function(e) { a = e; }; - var c, u, d, h, p, f, g = [ '', '
    ', " <%= _.size(folderDesc.fileList) %>", "
    ", ' <%= folderDesc.name %>', "
    ", '
    ', " <%= fileListHtml %>", "
    " ].join(""), m = [ '"', ' data-file-index="<%= fileDesc.fileIndex %>"', ' data-toggle="collapse"', ' data-target=".document-panel">', " <%= fileDesc.composeTitle() %>", "" ].join(""), v = function() { + var c, u, d, h, p, f, g = [ '', '
    ', " <%= _.size(folderDesc.fileList) %>", "
    ", ' <%= folderDesc.name %>', "
    ", '
    ', " <%= fileListHtml %>", "
    " ].join(""), m = [ '"', ' data-file-index="<%= fileDesc.fileIndex %>"', ' data-toggle="collapse"', ' data-target=".document-panel">', " <%= fileDesc.composeTitle() %>", "" ].join(""), v = t.debounce(function() { var n = t.filter(r, function(e) { return void 0 === e.folder; }), i = t.chain(n).sortBy(function(e) { @@ -20259,7 +20287,7 @@ function() { e && e !== f && a.selectFile(e); }); }); - }; + }, 50); l.onFileSelected = function(e) { f = e, v(); }, l.onFileCreated = v, l.onFileDeleted = v, l.onTitleChanged = v, l.onSyncExportSuccess = v, @@ -20323,7 +20351,7 @@ function() { f.onEventMgrCreated = function(e) { g = e; }; - var m, v, b, y, w, x, C, k, E, S = [ '', '', '', '', '
    <%= _.size(folderDesc.fileList) %>
    ', '
    ', "<%= folderDesc.name %>
    ", '
    ', '
    <%= fileListHtml %>
    ' ].join(""), A = [ '
  • ', '', '', '', '
    <%= fileDesc.composeTitle() %>
    ', '
  • ' ].join(""), _ = [ '', '
    <%= _.size(folderDesc.fileList) %>
    ', '
    ', "<%= folderDesc.name %>
    " ].join(""), F = [ '
  • ', '
    <%= fileDesc.composeTitle() %>
  • ' ].join(""), T = [], $ = [], D = function() { + var m, v, b, y, w, x, C, k, E, S = [ '', '', '', '', '
    <%= _.size(folderDesc.fileList) %>
    ', '
    ', "<%= folderDesc.name %>
    ", '
    ', '
    <%= fileListHtml %>
    ' ].join(""), A = [ '
  • ', '', '', '', '
    <%= fileDesc.composeTitle() %>
    ', '
  • ' ].join(""), _ = [ '', '
    <%= _.size(folderDesc.fileList) %>
    ', '
    ', "<%= folderDesc.name %>
    " ].join(""), F = [ '
  • ', '
    <%= fileDesc.composeTitle() %>
  • ' ].join(""), T = [], $ = [], D = t.debounce(function() { if (m !== !1) { h(), k.text(t.size(l)), E.text(t.size(a) + 1), C = t.filter(l, function(e) { return void 0 === e.folder; @@ -20394,7 +20422,7 @@ function() { }); }), e(b.querySelectorAll("[type=checkbox]")).change(h); } - }; + }, 50); return f.onFileCreated = D, f.onFileDeleted = D, f.onTitleChanged = D, f.onSyncExportSuccess = D, f.onSyncRemoved = D, f.onNewPublishSuccess = D, f.onPublishRemoved = D, f.onFoldersChanged = D, f.onReady = function() { @@ -20457,8 +20485,8 @@ function() { }, r.onReady = function() { i = e(document.body), o = e('
    '), e(".working-indicator").append(o); for (var t = 0; 4 > t; t++) o.append(e('
    ').css({ - "animation-delay": (2 * t / 10).toPrecision(3) + "s", - "-webkit-animation-delay": (2 * t / 10).toPrecision(3) + "s" + "animation-delay": (15 * t / 100).toPrecision(3) + "s", + "-webkit-animation-delay": (15 * t / 100).toPrecision(3) + "s" })); }, r; }), function(e) { @@ -20633,9 +20661,9 @@ function() { l(t.provider.providerName + " publish location has been removed."); }, c; }), define("text!html/buttonToc.html", [], function() { - return '\n\n'; + return '\n\n'; }), define("text!html/tocSettingsBlock.html", [], function() { - return '

    Generates a table of contents when a [TOC] marker is found.

    \n
    \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n \n
    '; + return '

    Generates a table of contents when a [TOC] marker is found.

    \n
    \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n \n
    '; }), define("extensions/toc", [ "jquery", "underscore", "utils", "classes/Extension", "text!html/buttonToc.html", "text!html/tocSettingsBlock.html" ], function(e, t, n, i, o, r) { function s(e, t, n) { this.tagName = e, this.anchor = t, this.text = n, this.children = []; @@ -20647,7 +20675,8 @@ function() { n = n || 1; var o, r = "H" + n, l = []; return t.each(e, function(e) { - e.tagName != r ? (void 0 === o && (o = new s()), o.children.push(e)) : (i(), o = e); + e.tagName != r ? n !== c.config.maxDepth && (void 0 === o && (o = new s()), o.children.push(e)) : (i(), + o = e); }), i(), l; } function l() { @@ -20663,11 +20692,14 @@ function() { var c = new i("toc", "Table of Contents", !0); c.settingsBlock = r, c.defaultConfig = { marker: "\\[(TOC|toc)\\]", + maxDepth: 6, button: !0 }, c.onLoadSettings = function() { - n.setInputValue("#input-toc-marker", c.config.marker), n.setInputChecked("#input-toc-button", c.config.button); + n.setInputValue("#input-toc-marker", c.config.marker), n.setInputValue("#input-toc-maxdepth", c.config.maxDepth), + n.setInputChecked("#input-toc-button", c.config.button); }, c.onSaveSettings = function(e, t) { - e.marker = n.getInputRegExpValue("#input-toc-marker", t), e.button = n.getInputChecked("#input-toc-button"); + e.marker = n.getInputRegExpValue("#input-toc-marker", t), e.maxDepth = n.getInputIntValue("#input-toc-maxdepth"), + e.button = n.getInputChecked("#input-toc-button"); }, c.onCreatePreviewButton = function() { return c.config.button ? o : void 0; }, s.prototype.childrenToString = function() { @@ -20913,34 +20945,8 @@ function() { return l.onFileSelected = function(e) { s = e, h(); }, l.onPublishRemoved = h, l.onNewPublishSuccess = h, l; -}), define("text!html/buttonShare.html", [], function() { - return '\n\n'; -}), define("text!html/buttonShareLocation.html", [], function() { - return '
    \n \n
    \n'; -}), define("extensions/buttonShare", [ "jquery", "underscore", "classes/Extension", "text!html/buttonShare.html", "text!html/buttonShareLocation.html" ], function(e, t, n, i, o) { - var r = new n("buttonShare", 'Button "Share"', !0, !0); - r.settingsBlock = '

    Adds a "Share document" button in the navigation bar.

    ', - r.onCreateButton = function() { - return i; - }; - var s, a, l, c = function(e) { - if (void 0 === e || e === s) { - var n = t.reduce(s.publishLocations, function(e, n) { - return n.sharingLink && (e += t.template(o, { - link: n.sharingLink - })), e; - }, ""); - a.innerHTML = n, l.toggleClass("hide", 0 !== n.length); - } - }; - return r.onFileSelected = function(e) { - s = e, c(e); - }, r.onNewPublishSuccess = c, r.onPublishRemoved = c, r.onReady = function() { - var t = document.querySelector(".link-container"); - a = t.querySelector(".link-list"), l = e(t.querySelector(".no-link")); - }, r; }), define("text!html/buttonStat.html", [], function() { - return '\n\n'; + return '\n\n'; }), define("text!html/buttonStatSettingsBlock.html", [], function() { return '

    Adds a "Document statistics" button over the preview.

    \n
    \n
    \n RegExp \n
    \n
    \n RegExp \n
    \n
    \n RegExp \n
    \n
    \n'; }), define("extensions/buttonStat", [ "jquery", "underscore", "utils", "classes/Extension", "text!html/buttonStat.html", "text!html/buttonStatSettingsBlock.html" ], function(e, t, n, i, o, r) { @@ -20977,7 +20983,7 @@ function() { u.textContent = (o.match(new RegExp(s.config.value3, "g")) || []).length; }, s; }), define("text!html/buttonHtmlCode.html", [], function() { - return '\n\n'; + return '\n\n'; }), define("text!html/buttonHtmlCodeSettingsBlock.html", [], function() { return '

    Adds a "HTML code" button over the preview.

    \n
    \n
    \n \n
    \n \n
    \n
    \n
    '; }), define("extensions/buttonHtmlCode", [ "jquery", "underscore", "utils", "classes/Extension", "text!html/buttonHtmlCode.html", "text!html/buttonHtmlCodeSettingsBlock.html" ], function(e, t, n, i, o, r) { @@ -21024,7 +21030,7 @@ function() { }); }, s; }), define("text!html/buttonViewer.html", [], function() { - return '\n \n\n'; + return '\n \n\n'; }), define("extensions/buttonViewer", [ "jquery", "classes/Extension", "text!html/buttonViewer.html" ], function(e, t, n) { var i = new t("buttonViewer", 'Button "Viewer"', !0, !0); return i.settingsBlock = '

    Adds a "Viewer" button over the preview.

    ', i.onCreatePreviewButton = function() { @@ -21691,248 +21697,268 @@ function() { n.offsetTop && (n.offset.top = n.offsetTop), t.affix(n); }); }); -}(window.jQuery), define("bootstrap", function() {}), function() { - !function(e, t) { - var n, i; - return i = t.document, n = function() { - function n(n) { - this._options = e.extend({ - name: "tour", - container: "body", - keyboard: !0, - storage: t.localStorage, - debug: !1, - backdrop: !1, - redirect: !0, - orphan: !1, - basePath: "", - template: "

    ", - afterSetState: function() {}, - afterGetState: function() {}, - afterRemoveState: function() {}, - onStart: function() {}, - onEnd: function() {}, - onShow: function() {}, - onShown: function() {}, - onHide: function() {}, - onHidden: function() {}, - onNext: function() {}, - onPrev: function() {} - }, n), this._steps = [], this.setCurrentStep(), this.backdrop = { - overlay: null, - $element: null, - $background: null - }; +}(window.jQuery), define("bootstrap", function() {}), function(e, t) { + var n, i; + return i = t.document, n = function() { + function n(n) { + this._options = e.extend({ + name: "tour", + container: "body", + keyboard: !0, + storage: t.localStorage, + debug: !1, + backdrop: !1, + redirect: !0, + orphan: !1, + basePath: "", + template: "

    ", + afterSetState: function() {}, + afterGetState: function() {}, + afterRemoveState: function() {}, + onStart: function() {}, + onEnd: function() {}, + onShow: function() {}, + onShown: function() {}, + onHide: function() {}, + onHidden: function() {}, + onNext: function() {}, + onPrev: function() {} + }, n), this._force = !1, this._inited = !1, this._steps = [], this.backdrop = { + overlay: null, + $element: null, + $background: null, + backgroundShown: !1, + overlayElementShown: !1 + }; + } + return n.prototype.setState = function(e, t) { + var n, i; + if (this._options.storage) { + i = "" + this._options.name + "_" + e; + try { + this._options.storage.setItem(i, t); + } catch (o) { + n = o, n.code === DOMException.QUOTA_EXCEEDED_ERR && this.debug("LocalStorage quota exceeded. setState failed."); + } + return this._options.afterSetState(i, t); } - return n.prototype.setState = function(e, t) { - var n; - return this._options.storage ? (n = "" + this._options.name + "_" + e, this._options.storage.setItem(n, t), - this._options.afterSetState(n, t)) : (null == this._state && (this._state = {}), - this._state[e] = t); - }, n.prototype.removeState = function(e) { + return null == this._state && (this._state = {}), this._state[e] = t; + }, n.prototype.removeState = function(e) { + var t; + return this._options.storage ? (t = "" + this._options.name + "_" + e, this._options.storage.removeItem(t), + this._options.afterRemoveState(t)) : null != this._state ? delete this._state[e] : void 0; + }, n.prototype.getState = function(e) { + var t, n; + return this._options.storage ? (t = "" + this._options.name + "_" + e, n = this._options.storage.getItem(t)) : null != this._state && (n = this._state[e]), + (void 0 === n || "null" === n) && (n = null), this._options.afterGetState(e, n), + n; + }, n.prototype.addSteps = function(e) { + var t, n, i, o; + for (o = [], n = 0, i = e.length; i > n; n++) t = e[n], o.push(this.addStep(t)); + return o; + }, n.prototype.addStep = function(e) { + return this._steps.push(e); + }, n.prototype.getStep = function(t) { + return null != this._steps[t] ? e.extend({ + id: "step-" + t, + path: "", + placement: "right", + title: "", + content: "

    ", + next: t === this._steps.length - 1 ? -1 : t + 1, + prev: t - 1, + animation: !0, + container: this._options.container, + backdrop: this._options.backdrop, + redirect: this._options.redirect, + orphan: this._options.orphan, + template: this._options.template, + onShow: this._options.onShow, + onShown: this._options.onShown, + onHide: this._options.onHide, + onHidden: this._options.onHidden, + onNext: this._options.onNext, + onPrev: this._options.onPrev + }, this._steps[t]) : void 0; + }, n.prototype.init = function(e) { + var t = this; + return this._force = e, this.ended() ? this._debug("Tour ended, init prevented.") : (this.setCurrentStep(), + this._setupMouseNavigation(), this._setupKeyboardNavigation(), this._onResize(function() { + return t.showStep(t._current); + }), null !== this._current && this.showStep(this._current), this._inited = !0, this); + }, n.prototype.start = function(e) { + var t; + return null == e && (e = !1), this._inited || this.init(e), null === this._current ? (t = this._makePromise(null != this._options.onStart ? this._options.onStart(this) : void 0), + this._callOnPromiseDone(t, this.showStep, 0)) : void 0; + }, n.prototype.next = function() { + var e; + return this.ended() ? this._debug("Tour ended, next prevented.") : (e = this.hideStep(this._current), + this._callOnPromiseDone(e, this._showNextStep)); + }, n.prototype.prev = function() { + var e; + return this.ended() ? this._debug("Tour ended, prev prevented.") : (e = this.hideStep(this._current), + this._callOnPromiseDone(e, this._showPrevStep)); + }, n.prototype.goTo = function(e) { + var t; + return this.ended() ? this._debug("Tour ended, goTo prevented.") : (t = this.hideStep(this._current), + this._callOnPromiseDone(t, this.showStep, e)); + }, n.prototype.end = function() { + var n, o, r = this; + return n = function() { + return e(i).off("click.tour-" + r._options.name), e(i).off("keyup.tour-" + r._options.name), + e(t).off("resize.tour-" + r._options.name), r.setState("end", "yes"), r._inited = !1, + r._force = !1, null != r._options.onEnd ? r._options.onEnd(r) : void 0; + }, o = this.hideStep(this._current), this._callOnPromiseDone(o, n); + }, n.prototype.ended = function() { + return !this._force && !!this.getState("end"); + }, n.prototype.restart = function() { + return this.removeState("current_step"), this.removeState("end"), this.setCurrentStep(0), + this.start(); + }, n.prototype.hideStep = function(t) { + var n, i, o, r = this; + return (o = this.getStep(t)) ? (i = this._makePromise(null != o.onHide ? o.onHide(this, t) : void 0), + n = function() { var t; - return this._options.storage ? (t = "" + this._options.name + "_" + e, this._options.storage.removeItem(t), - this._options.afterRemoveState(t)) : null != this._state ? delete this._state[e] : void 0; - }, n.prototype.getState = function(e) { - var t, n; - return this._options.storage ? (t = "" + this._options.name + "_" + e, n = this._options.storage.getItem(t)) : null != this._state && (n = this._state[e]), - (void 0 === n || "null" === n) && (n = null), this._options.afterGetState(e, n), - n; - }, n.prototype.addSteps = function(e) { - var t, n, i, o; - for (o = [], n = 0, i = e.length; i > n; n++) t = e[n], o.push(this.addStep(t)); - return o; - }, n.prototype.addStep = function(e) { - return this._steps.push(e); - }, n.prototype.getStep = function(t) { - return null != this._steps[t] ? e.extend({ - id: "step-" + t, - path: "", - placement: "right", - title: "", - content: "

    ", - next: t === this._steps.length - 1 ? -1 : t + 1, - prev: t - 1, - animation: !0, - container: this._options.container, - backdrop: this._options.backdrop, - redirect: this._options.redirect, - orphan: this._options.orphan, - template: this._options.template, - onShow: this._options.onShow, - onShown: this._options.onShown, - onHide: this._options.onHide, - onHidden: this._options.onHidden, - onNext: this._options.onNext, - onPrev: this._options.onPrev - }, this._steps[t]) : void 0; - }, n.prototype.start = function(t) { - var n, o = this; - return null == t && (t = !1), this.ended() && !t ? this._debug("Tour ended, start prevented.") : (e(i).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=next]").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=next]:not(.disabled)", function(e) { - return e.preventDefault(), o.next(); - }), e(i).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=prev]").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=prev]:not(.disabled)", function(e) { - return e.preventDefault(), o.prev(); - }), e(i).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=end]").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=end]", function(e) { - return e.preventDefault(), o.end(); - }), this._onResize(function() { - return o.showStep(o._current); - }), this._setupKeyboardNavigation(), n = this._makePromise(null != this._options.onStart ? this._options.onStart(this) : void 0), - this._callOnPromiseDone(n, this.showStep, this._current)); - }, n.prototype.next = function() { - var e; - return this.ended() ? this._debug("Tour ended, next prevented.") : (e = this.hideStep(this._current), - this._callOnPromiseDone(e, this._showNextStep)); - }, n.prototype.prev = function() { - var e; - return this.ended() ? this._debug("Tour ended, prev prevented.") : (e = this.hideStep(this._current), - this._callOnPromiseDone(e, this._showPrevStep)); - }, n.prototype.goto = function(e) { - var t; - return this.ended() ? this._debug("Tour ended, goto prevented.") : (t = this.hideStep(this._current), - this._callOnPromiseDone(t, this.showStep, e)); - }, n.prototype.end = function() { - var n, o, r = this; - return n = function() { - return e(i).off("click.tour-" + r._options.name), e(i).off("keyup.tour-" + r._options.name), - e(t).off("resize.tour-" + r._options.name), r.setState("end", "yes"), null != r._options.onEnd ? r._options.onEnd(r) : void 0; - }, o = this.hideStep(this._current), this._callOnPromiseDone(o, n); - }, n.prototype.ended = function() { - return !!this.getState("end"); - }, n.prototype.restart = function() { - return this.removeState("current_step"), this.removeState("end"), this.setCurrentStep(0), - this.start(); - }, n.prototype.hideStep = function(t) { - var n, i, o, r = this; - return o = this.getStep(t), i = this._makePromise(null != o.onHide ? o.onHide(this, t) : void 0), - n = function() { - var t; - return t = r._isOrphan(o) ? e("body") : e(o.element), t.popover("destroy"), o.reflex && t.css("cursor", "").off("click.tour-" + r._options.name), - o.backdrop && r._hideBackdrop(), null != o.onHidden ? o.onHidden(r) : void 0; - }, this._callOnPromiseDone(i, n), i; - }, n.prototype.showStep = function(t) { - var n, o, r, s, a = this; - return (s = this.getStep(t)) ? (r = t < this._current, n = this._makePromise(null != s.onShow ? s.onShow(this, t) : void 0), - o = function() { - var n, o; - if (a.setCurrentStep(t), o = e.isFunction(s.path) ? s.path.call() : a._options.basePath + s.path, - n = [ i.location.pathname, i.location.hash ].join(""), a._isRedirect(o, n)) return a._redirect(s, o), - void 0; - if (a._isOrphan(s)) { - if (!s.orphan) return a._debug("Skip the orphan step " + (a._current + 1) + ". Orphan option is false and the element doesn't exist or is hidden."), - r ? a._showPrevStep() : a._showNextStep(), void 0; - a._debug("Show the orphan step " + (a._current + 1) + ". Orphans option is true."); - } - return s.backdrop && a._showBackdrop(a._isOrphan(s) ? void 0 : s.element), a._showPopover(s, t), + return t = r._isOrphan(o) ? e("body") : e(o.element), t.popover("destroy"), o.reflex && t.css("cursor", "").off("click.tour-" + r._options.name), + o.backdrop && r._hideBackdrop(), null != o.onHidden ? o.onHidden(r) : void 0; + }, this._callOnPromiseDone(i, n), i) : void 0; + }, n.prototype.showStep = function(t) { + var n, o, r, s, a = this; + return (s = this.getStep(t)) ? (r = t < this._current, n = this._makePromise(null != s.onShow ? s.onShow(this, t) : void 0), + o = function() { + var n, o; + if (a.setCurrentStep(t), o = e.isFunction(s.path) ? s.path.call() : a._options.basePath + s.path, + n = [ i.location.pathname, i.location.hash ].join(""), a._isRedirect(o, n)) return a._redirect(s, o), + void 0; + if (a._isOrphan(s)) { + if (!s.orphan) return a._debug("Skip the orphan step " + (a._current + 1) + ". Orphan option is false and the element doesn't exist or is hidden."), + r ? a._showPrevStep() : a._showNextStep(), void 0; + a._debug("Show the orphan step " + (a._current + 1) + ". Orphans option is true."); + } + return s.backdrop && a._showBackdrop(a._isOrphan(s) ? void 0 : s.element), a._scrollIntoView(s.element, function() { + return null != s.element && s.backdrop && a._showOverlayElement(s.element), a._showPopover(s, t), null != s.onShown && s.onShown(a), a._debug("Step " + (a._current + 1) + " of " + a._steps.length); - }, this._callOnPromiseDone(n, o)) : void 0; - }, n.prototype.setCurrentStep = function(e) { - return null != e ? (this._current = e, this.setState("current_step", e)) : (this._current = this.getState("current_step"), - this._current = null === this._current ? 0 : parseInt(this._current, 10)); - }, n.prototype._showNextStep = function() { - var e, t, n, i = this; - return n = this.getStep(this._current), t = function() { - return i.showStep(n.next); - }, e = this._makePromise(null != n.onNext ? n.onNext(this) : void 0), this._callOnPromiseDone(e, t); - }, n.prototype._showPrevStep = function() { - var e, t, n, i = this; - return n = this.getStep(this._current), t = function() { - return i.showStep(n.prev); - }, e = this._makePromise(null != n.onPrev ? n.onPrev(this) : void 0), this._callOnPromiseDone(e, t); - }, n.prototype._debug = function(e) { - return this._options.debug ? t.console.log("Bootstrap Tour '" + this._options.name + "' | " + e) : void 0; - }, n.prototype._isRedirect = function(e, t) { - return null != e && "" !== e && e.replace(/\?.*$/, "").replace(/\/?$/, "") !== t.replace(/\/?$/, ""); - }, n.prototype._redirect = function(t, n) { - return e.isFunction(t.redirect) ? t.redirect.call(this, n) : t.redirect === !0 ? (this._debug("Redirect to " + n), - i.location.href = n) : void 0; - }, n.prototype._isOrphan = function(t) { - return null == t.element || !e(t.element).length || e(t.element).is(":hidden"); - }, n.prototype._showPopover = function(t, n) { - var i, o, r, s, a, l, c = this; - return l = e.extend({}, this._options), r = e.isFunction(t.template) ? e(t.template(n, t)) : e(t.template), - o = r.find(".popover-navigation"), a = this._isOrphan(t), a && (t.element = "body", - t.placement = "top", r = r.addClass("orphan")), i = e(t.element), r.addClass("tour-" + this._options.name), - t.options && e.extend(l, t.options), t.reflex && i.css("cursor", "pointer").on("click.tour-" + this._options.name, function() { - return c._current < c._steps.length - 1 ? c.next() : c.end(); - }), t.prev < 0 && o.find("*[data-role=prev]").addClass("disabled"), t.next < 0 && o.find("*[data-role=next]").addClass("disabled"), - t.template = r.clone().wrap("
    ").parent().html(), i.popover({ - placement: t.placement, - trigger: "manual", - title: t.title, - content: t.content, - html: !0, - animation: t.animation, - container: t.container, - template: t.template, - selector: t.element - }).popover("show"), s = i.data("bs.popover") ? i.data("bs.popover").tip() : i.data("popover").tip(), - s.attr("id", t.id), this._scrollIntoView(s), this._reposition(s, t), a ? this._center(s) : void 0; - }, n.prototype._reposition = function(t, n) { - var o, r, s, a, l, c, u; - if (a = t[0].offsetWidth, r = t[0].offsetHeight, u = t.offset(), l = u.left, c = u.top, - o = e(i).outerHeight() - u.top - t.outerHeight(), 0 > o && (u.top = u.top + o), - s = e("html").outerWidth() - u.left - t.outerWidth(), 0 > s && (u.left = u.left + s), - u.top < 0 && (u.top = 0), u.left < 0 && (u.left = 0), t.offset(u), "bottom" === n.placement || "top" === n.placement) { - if (l !== u.left) return this._replaceArrow(t, 2 * (u.left - l), a, "left"); - } else if (c !== u.top) return this._replaceArrow(t, 2 * (u.top - c), r, "top"); - }, n.prototype._center = function(n) { - return n.css("top", e(t).outerHeight() / 2 - n.outerHeight() / 2); - }, n.prototype._replaceArrow = function(e, t, n, i) { - return e.find(".arrow").css(i, t ? 50 * (1 - t / n) + "%" : ""); - }, n.prototype._scrollIntoView = function(n) { - return e("html, body").stop().animate({ - scrollTop: Math.ceil(n.offset().top - e(t).height() / 2) }); - }, n.prototype._onResize = function(n, i) { - return e(t).on("resize.tour-" + this._options.name, function() { - return clearTimeout(i), i = setTimeout(n, 100); - }); - }, n.prototype._setupKeyboardNavigation = function() { - var t = this; - return this._options.keyboard ? e(i).on("keyup.tour-" + this._options.name, function(e) { - if (e.which) switch (e.which) { - case 39: - return e.preventDefault(), t._current < t._steps.length - 1 ? t.next() : t.end(); + }, this._callOnPromiseDone(n, o), n) : void 0; + }, n.prototype.setCurrentStep = function(e) { + return null != e ? (this._current = e, this.setState("current_step", e)) : (this._current = this.getState("current_step"), + this._current = null === this._current ? null : parseInt(this._current, 10)), this; + }, n.prototype._showNextStep = function() { + var e, t, n, i = this; + return n = this.getStep(this._current), t = function() { + return i.showStep(n.next); + }, e = this._makePromise(null != n.onNext ? n.onNext(this) : void 0), this._callOnPromiseDone(e, t); + }, n.prototype._showPrevStep = function() { + var e, t, n, i = this; + return n = this.getStep(this._current), t = function() { + return i.showStep(n.prev); + }, e = this._makePromise(null != n.onPrev ? n.onPrev(this) : void 0), this._callOnPromiseDone(e, t); + }, n.prototype._debug = function(e) { + return this._options.debug ? t.console.log("Bootstrap Tour '" + this._options.name + "' | " + e) : void 0; + }, n.prototype._isRedirect = function(e, t) { + return null != e && "" !== e && e.replace(/\?.*$/, "").replace(/\/?$/, "") !== t.replace(/\/?$/, ""); + }, n.prototype._redirect = function(t, n) { + return e.isFunction(t.redirect) ? t.redirect.call(this, n) : t.redirect === !0 ? (this._debug("Redirect to " + n), + i.location.href = n) : void 0; + }, n.prototype._isOrphan = function(t) { + return null == t.element || !e(t.element).length || e(t.element).is(":hidden") && "http://www.w3.org/2000/svg" !== e(t.element)[0].namespaceURI; + }, n.prototype._showPopover = function(t, n) { + var i, o, r, s, a, l, c = this; + return l = e.extend({}, this._options), r = e.isFunction(t.template) ? e(t.template(n, t)) : e(t.template), + o = r.find(".popover-navigation"), a = this._isOrphan(t), a && (t.element = "body", + t.placement = "top", r = r.addClass("orphan")), i = e(t.element), r.addClass("tour-" + this._options.name), + t.options && e.extend(l, t.options), t.reflex && i.css("cursor", "pointer").on("click.tour-" + this._options.name, function() { + return c._current < c._steps.length - 1 ? c.next() : c.end(); + }), t.prev < 0 && o.find("*[data-role=prev]").addClass("disabled"), t.next < 0 && o.find("*[data-role=next]").addClass("disabled"), + t.template = r.clone().wrap("
    ").parent().html(), i.popover({ + placement: t.placement, + trigger: "manual", + title: t.title, + content: t.content, + html: !0, + animation: t.animation, + container: t.container, + template: t.template, + selector: t.element + }).popover("show"), s = i.data("bs.popover") ? i.data("bs.popover").tip() : i.data("popover").tip(), + s.attr("id", t.id), this._reposition(s, t), a ? this._center(s) : void 0; + }, n.prototype._reposition = function(t, n) { + var o, r, s, a, l, c, u; + if (a = t[0].offsetWidth, r = t[0].offsetHeight, u = t.offset(), l = u.left, c = u.top, + o = e(i).outerHeight() - u.top - t.outerHeight(), 0 > o && (u.top = u.top + o), + s = e("html").outerWidth() - u.left - t.outerWidth(), 0 > s && (u.left = u.left + s), + u.top < 0 && (u.top = 0), u.left < 0 && (u.left = 0), t.offset(u), "bottom" === n.placement || "top" === n.placement) { + if (l !== u.left) return this._replaceArrow(t, 2 * (u.left - l), a, "left"); + } else if (c !== u.top) return this._replaceArrow(t, 2 * (u.top - c), r, "top"); + }, n.prototype._center = function(n) { + return n.css("top", e(t).outerHeight() / 2 - n.outerHeight() / 2); + }, n.prototype._replaceArrow = function(e, t, n, i) { + return e.find(".arrow").css(i, t ? 50 * (1 - t / n) + "%" : ""); + }, n.prototype._scrollIntoView = function(n, i) { + var o, r, s, a, l, c = this; + return n ? (o = e(n), r = e(t), s = o.offset().top, l = r.height(), a = Math.max(0, s - l / 2), + this._debug("Scroll into view. ScrollTop: " + a + ". Element offset: " + s + ". Window height: " + l + "."), + e("body").stop().animate({ + scrollTop: Math.ceil(a) + }, function() { + return i(), c._debug("Scroll into view. Animation end element offset: " + o.offset().top + ". Window height: " + r.height() + "."); + })) : i(); + }, n.prototype._onResize = function(n, i) { + return e(t).on("resize.tour-" + this._options.name, function() { + return clearTimeout(i), i = setTimeout(n, 100); + }); + }, n.prototype._setupMouseNavigation = function() { + var t = this; + return e(i).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=next]:not(.disabled)").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=next]:not(.disabled)", function(e) { + return e.preventDefault(), t.next(); + }), e(i).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=prev]:not(.disabled)").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=prev]:not(.disabled)", function(e) { + return e.preventDefault(), t.prev(); + }), e(i).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=end]").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=end]", function(e) { + return e.preventDefault(), t.end(); + }); + }, n.prototype._setupKeyboardNavigation = function() { + var t = this; + if (this._options.keyboard) return e(i).on("keyup.tour-" + this._options.name, function(e) { + if (e.which) switch (e.which) { + case 39: + return e.preventDefault(), t._current < t._steps.length - 1 ? t.next() : t.end(); - case 37: - if (e.preventDefault(), t._current > 0) return t.prev(); - break; + case 37: + if (e.preventDefault(), t._current > 0) return t.prev(); + break; - case 27: - return e.preventDefault(), t.end(); - } - }) : void 0; - }, n.prototype._makePromise = function(t) { - return t && e.isFunction(t.then) ? t : null; - }, n.prototype._callOnPromiseDone = function(e, t, n) { - var i = this; - return e ? e.then(function() { - return t.call(i, n); - }) : t.call(this, n); - }, n.prototype._showBackdrop = function(e) { - return null === this.backdrop.overlay ? (this._showOverlay(), null != e ? this._showOverlayElement(e) : void 0) : void 0; - }, n.prototype._hideBackdrop = function() { - return null !== this.backdrop.overlay ? (this.backdrop.$element && this._hideOverlayElement(), - this._hideOverlay()) : void 0; - }, n.prototype._showOverlay = function() { - return this.backdrop = e("
    ", { - "class": "tour-backdrop" - }), e("body").append(this.backdrop); - }, n.prototype._hideOverlay = function() { - return this.backdrop.remove(), this.backdrop.overlay = null; - }, n.prototype._showOverlayElement = function(t) { - var n, i, o; - return i = e(t), n = e("
    "), o = i.offset(), o.top = o.top, o.left = o.left, - n.width(i.innerWidth()).height(i.innerHeight()).addClass("tour-step-background").offset(o), - i.addClass("tour-step-backdrop"), e("body").append(n), this.backdrop.$element = i, - this.backdrop.$background = n; - }, n.prototype._hideOverlayElement = function() { - return this.backdrop.$element.removeClass("tour-step-backdrop"), this.backdrop.$background.remove(), - this.backdrop.$element = null, this.backdrop.$background = null; - }, n; - }(), t.Tour = n; - }(jQuery, window); -}.call(this), define("bootstrap-tour", [ "bootstrap" ], function(e) { + case 27: + return e.preventDefault(), t.end(); + } + }); + }, n.prototype._makePromise = function(t) { + return t && e.isFunction(t.then) ? t : null; + }, n.prototype._callOnPromiseDone = function(e, t, n) { + var i = this; + return e ? e.then(function() { + return t.call(i, n); + }) : t.call(this, n); + }, n.prototype._showBackdrop = function() { + return this.backdrop.backgroundShown ? void 0 : (this.backdrop = e("
    ", { + "class": "tour-backdrop" + }), this.backdrop.backgroundShown = !0, e("body").append(this.backdrop)); + }, n.prototype._hideBackdrop = function() { + return this._hideOverlayElement(), this._hideBackground(); + }, n.prototype._hideBackground = function() { + return this.backdrop.remove(), this.backdrop.overlay = null, this.backdrop.backgroundShown = !1; + }, n.prototype._showOverlayElement = function(t) { + var n, i, o; + if (!this.backdrop.overlayElementShown) return this.backdrop.overlayElementShown = !0, + i = e(t), n = e("
    "), o = i.offset(), o.top = o.top, o.left = o.left, n.width(i.innerWidth()).height(i.innerHeight()).addClass("tour-step-background").offset(o), + i.addClass("tour-step-backdrop"), e("body").append(n), this.backdrop.$element = i, + this.backdrop.$background = n; + }, n.prototype._hideOverlayElement = function() { + return this.backdrop.overlayElementShown ? (this.backdrop.$element.removeClass("tour-step-backdrop"), + this.backdrop.$background.remove(), this.backdrop.$element = null, this.backdrop.$background = null, + this.backdrop.overlayElementShown = !1) : void 0; + }, n; + }(), t.Tour = n; +}(jQuery, window), define("bootstrap-tour", [ "bootstrap" ], function(e) { return function() { var t; return t || e.Tour; @@ -21958,7 +21984,7 @@ function() { content: [ '', '

    You are using the new secured platform. If you want to recover your documents from the old platform click here.

    ', "Please click Next to take a quick tour." ].join(""), placement: "bottom" }, { - element: ".navbar .action-create-file", + element: ".navbar-inner > .nav .action-create-file, .navbar .right-buttons-dropdown > .nav > .btn:not(:hidden)", title: "New document", content: 'Click the New document button to create a new document.', placement: "left", @@ -21966,7 +21992,7 @@ function() { }, { element: ".document-panel .collapse-button", title: "Toggle document", - content: [ '

    Click the Select document button to switch to another document.

    ', "NOTE: Use Ctrl+[ and Ctrl+] shortcuts to toggle quickly." ].join(""), + content: [ '

    Click the Select document button to switch to another document.

    ', "Use Ctrl+[ and Ctrl+] shortcuts to toggle quickly." ].join(""), placement: "left", reflex: !0 }, { @@ -21976,21 +22002,21 @@ function() { placement: "right", reflex: !0 }, { - element: "#extension-buttons .button-synchronize", + element: ".navbar-inner > .nav .button-synchronize, .navbar .right-buttons-dropdown > .nav > .btn:not(:hidden)", title: "Synchronize", - content: '

    Once imported/exported, use the Synchronize button to force the synchronization (this is done automatically every 3 minutes).

    ', - placement: "bottom", + content: '

    Once imported or exported, use the Synchronize button to force the synchronization

    This is done automatically every 3 minutes.', + placement: "left", reflex: !0 }, { - element: "#extension-buttons .button-publish", - title: "Update publications", - content: 'Once published, use the Publish button to update your publication.', - placement: "bottom", + element: ".navbar-inner > .nav .button-publish, .navbar .right-buttons-dropdown > .nav > .btn:not(:hidden)", + title: "Update publication", + content: 'Once published, use the Publish button to update the publication.', + placement: "left", reflex: !0 }, { element: ".navbar-inner", title: "Happy StackWriting!", - content: [ 'Enjoy, and don\'t forget to rate StackEdit on Chrome Web Store.' ].join(""), + content: [ 'Enjoy, and don\'t forget to rate StackEdit on Chrome Web Store...' ].join(""), placement: "bottom" } ]), e.has(n, "welcomeTour") || i.start(), t(".action-welcome-tour").click(function() { i.restart(); @@ -22043,7 +22069,7 @@ function() { var e = []; t.each(x, function(t) { t.range.start.row < C ? e.push(t) : v.session.removeMarker(t.id); - }), x = e, b = setTimeout(d, 700); + }), x = e, b = setTimeout(d, 2e3); } } var f = new o("spellCheck", "Spell Check", !0, !0, !0); @@ -22075,7 +22101,7 @@ function() { }); }, f; }), define("text!html/userCustomSettingsBlock.html", [], function() { - return '

    Allows users to implement their own extension.

    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \nMore info'; + return '

    Allows users to implement their own extension.

    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \nMore info'; }), define("extensions/userCustom", [ "jquery", "underscore", "utils", "classes/Extension", "fileSystem", "settings", "text!html/userCustomSettingsBlock.html" ], function($, _, utils, Extension, fileSystem, settings, userCustomSettingsBlockHTML) { var userCustom = new Extension("userCustom", "UserCustom extension", !0); userCustom.settingsBlock = userCustomSettingsBlockHTML, userCustom.defaultConfig = { @@ -22152,7 +22178,7 @@ function() { }); }); }; -}(jQuery), define("jquery-waitforimages", function() {}), define("eventMgr", [ "jquery", "underscore", "crel", "utils", "logger", "classes/Extension", "settings", "text!html/settingsExtensionsAccordion.html", "extensions/yamlFrontMatterParser", "extensions/markdownSectionParser", "extensions/partialRendering", "extensions/buttonMarkdownSyntax", "extensions/googleAnalytics", "extensions/dialogAbout", "extensions/dialogManagePublication", "extensions/dialogManageSynchronization", "extensions/dialogOpenHarddrive", "extensions/documentTitle", "extensions/documentSelector", "extensions/documentPanel", "extensions/documentManager", "extensions/workingIndicator", "extensions/notifications", "extensions/markdownExtra", "extensions/toc", "extensions/mathJax", "extensions/emailConverter", "extensions/scrollLink", "extensions/buttonFocusMode", "extensions/buttonSync", "extensions/buttonPublish", "extensions/buttonShare", "extensions/buttonStat", "extensions/buttonHtmlCode", "extensions/buttonViewer", "extensions/welcomeTour", "extensions/spellCheck", "extensions/userCustom", "bootstrap", "jquery-waitforimages" ], function(e, t, n, i, o, r, s, a) { +}(jQuery), define("jquery-waitforimages", function() {}), define("eventMgr", [ "jquery", "underscore", "crel", "utils", "logger", "classes/Extension", "settings", "text!html/settingsExtensionsAccordion.html", "extensions/yamlFrontMatterParser", "extensions/markdownSectionParser", "extensions/partialRendering", "extensions/buttonMarkdownSyntax", "extensions/googleAnalytics", "extensions/dialogAbout", "extensions/dialogManagePublication", "extensions/dialogManageSynchronization", "extensions/dialogManageSharing", "extensions/dialogOpenHarddrive", "extensions/documentTitle", "extensions/documentSelector", "extensions/documentPanel", "extensions/documentManager", "extensions/workingIndicator", "extensions/notifications", "extensions/markdownExtra", "extensions/toc", "extensions/mathJax", "extensions/emailConverter", "extensions/scrollLink", "extensions/buttonFocusMode", "extensions/buttonSync", "extensions/buttonPublish", "extensions/buttonStat", "extensions/buttonHtmlCode", "extensions/buttonViewer", "extensions/welcomeTour", "extensions/spellCheck", "extensions/userCustom", "bootstrap", "jquery-waitforimages" ], function(e, t, n, i, o, r, s, a) { function l(e) { return t.chain(h).map(function(t) { return t.enabled && t[e]; @@ -22253,7 +22279,7 @@ function() { var s = l("onCreateButton"), c = document.createDocumentFragment(); t.each(s, function(e) { c.appendChild(i(e)); - }), document.getElementById("extension-buttons").appendChild(c), o.log("onCreateEditorButton"); + }), document.querySelector(".extension-buttons").appendChild(c), o.log("onCreateEditorButton"); var u = l("onCreateEditorButton"), d = document.createDocumentFragment(); t.each(u, function(e) { d.appendChild(i(e)); @@ -22552,9 +22578,9 @@ function() { }); }, r; }), define("text!html/bodyIndex.html", [], function() { - return '\n
    \n
    \n
    \n
    \n\n\n\n\n
    \n \n \n
    \n
    \n
    \n
    \n
    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    \n
    '; + return '\n
    \n
    \n
    \n
    \n\n\n\n\n
    \n \n \n
    \n
    \n
    \n
    \n
    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    \n
    '; }), define("text!html/bodyViewer.html", [], function() { - return '\n\n
    \n
    \n
    \n\n\n\n
    \n \n \n
    \n
    \n
    \n
    \n
    \n\n\n'; + return '\n\n
    \n
    \n
    \n\n\n\n
    \n \n \n
    \n
    \n
    \n
    \n
    \n\n\n'; }), define("text!html/settingsTemplateTooltip.html", [], function() { return 'Available variables:\n
    \n
      \n
    • \n documentTitle: document title
    • \n
    • \n documentMarkdown: document in Markdown format
    • \n
    • \n strippedDocumentMarkdown: document without front matter
    • \n
    • \n documentHTML: document in HTML format
    • \n
    • \n frontMatter: YAML front matter object (undefined if not present)
    • \n
    • \n publishAttributes: attributes of the publish location (undefined if\n not publishing)
    • \n
    \nExamples:\n
    <title><%= documentTitle %></title>\n
    <div><%- documentHTML %></div>\n
    <%\n
    if(publishAttributes.provider.providerId == "github") print(documentMarkdown);\n%>\n
    \n
    \nMore\n info\n
    \n
    \n\n Careful! Template is subject to malicious code. Don\'t copy/paste untrusted\n content.'; }), define("text!html/settingsUserCustomExtensionTooltip.html", [], function() { @@ -26664,16 +26690,10 @@ function() { token: "markup.list", regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", next: "listblock-start" - }, { - token: "text", - regex: "\\\\\\$" }, { token: "constant.language.escape", regex: "\\$\\$|\\\\\\\\\\[|\\\\\\\\\\\\\\\\\\(", next: "mathblock" - }, { - token: [ "constant.language.escape", "keyword", "constant.language.escape" ], - regex: "(\\$)(.*)(\\$)" }, { token: [ "keyword", "text" ], regex: "(\\\\?\\\\begin)(\\{[a-z]*\\*?\\})", @@ -26684,6 +26704,12 @@ function() { basic: [ { token: "constant.language.escape", regex: /\\[\\`*_{}\[\]()#+\-.!]/ + }, { + token: "text", + regex: "\\\\\\$" + }, { + token: [ "constant.language.escape", "keyword", "constant.language.escape" ], + regex: "(\\$)(.*?)(\\$)" }, { token: "code", regex: "(`+)(.*?[^`])(\\1)" @@ -27041,26 +27067,26 @@ function() { }; }), define("core", [ "jquery", "underscore", "crel", "ace", "constants", "utils", "storage", "settings", "eventMgr", "shortcutMgr", "mousetrap", "text!html/bodyIndex.html", "text!html/bodyViewer.html", "text!html/settingsTemplateTooltip.html", "text!html/settingsUserCustomExtensionTooltip.html", "storage", "uilayout", "pagedown-ace", "libs/ace_mode", "ace/requirejs/text!ace/css/editor.css", "ace/requirejs/text!ace/theme/textmate.css", "ace/ext/spellcheck", "ace/ext/searchbox" ], function(e, t, n, i, o, r, s, a, l, c, u, d, h, p, f) { function g() { - T = !0, $ = !0; + $ = !0, D = !0; var e = r.currentTime; - e > L + 1e3 && (L = e, l.onUserActive()); + e > B + 1e3 && (B = e, l.onUserActive()); } function m() { - return r.currentTime - L > o.USER_IDLE_THRESHOLD && ($ = !1), $ && D; + return r.currentTime - B > o.USER_IDLE_THRESHOLD && (D = !1), D && L; } function v() { - if (T !== !1 && D !== !1) { - void 0 === _ && (_ = r.randomString(), s.frontWindowId = _); + if ($ !== !1 && L !== !1) { + void 0 === F && (F = r.randomString(), s.frontWindowId = F); var t = s.frontWindowId; - t != _ && (D = !1, void 0 !== A && clearInterval(A), e(".modal").modal("hide"), + t != F && (L = !1, void 0 !== _ && clearInterval(_), e(".modal").modal("hide"), e(".modal-non-unique").modal("show")); } } function b() { - B === !0 && (B = !1, l.onOfflineChanged(!1)); + I === !0 && (I = !1, l.onOfflineChanged(!1)); } function y() { - B === !0 && navigator.onLine === !0 && I + o.CHECK_ONLINE_PERIOD < r.currentTime && (I = r.currentTime, + I === !0 && navigator.onLine === !0 && M + o.CHECK_ONLINE_PERIOD < r.currentTime && (M = r.currentTime, e.ajax({ url: "//www.google.com/jsapi", timeout: o.AJAX_TIMEOUT, @@ -27070,8 +27096,8 @@ function() { })); } function w() { - r.setInputRadio("radio-layout-orientation", a.layoutOrientation), r.setInputValue(M, window.theme), - M.change(), r.setInputChecked("#input-settings-lazy-rendering", a.lazyRendering), + r.setInputRadio("radio-layout-orientation", a.layoutOrientation), r.setInputValue(R, window.theme), + R.change(), r.setInputChecked("#input-settings-lazy-rendering", a.lazyRendering), r.setInputValue("#input-settings-editor-font-family", a.editorFontFamily), r.setInputValue("#input-settings-editor-font-size", a.editorFontSize), r.setInputValue("#input-settings-max-width", a.maxWidth), r.setInputValue("#textarea-settings-default-content", a.defaultContent), r.setInputValue("#input-settings-publish-commit-msg", a.commitMsg), r.setInputChecked("#input-settings-gdrive-full-access", a.gdriveFullAccess), @@ -27082,7 +27108,7 @@ function() { function x(t) { var n = {}; n.layoutOrientation = r.getInputRadio("radio-layout-orientation"); - var i = r.getInputValue(M); + var i = r.getInputValue(R); n.lazyRendering = r.getInputChecked("#input-settings-lazy-rendering"), n.editorFontFamily = r.getInputTextValue("#input-settings-editor-font-family", t), n.editorFontSize = r.getInputIntValue("#input-settings-editor-font-size", t, 1, 99), n.maxWidth = r.getInputIntValue("#input-settings-max-width", t, 1), n.defaultContent = r.getInputValue("#textarea-settings-default-content"), @@ -27093,15 +27119,15 @@ function() { t.isPropagationStopped() || (e.extend(a, n), s.settings = JSON.stringify(a), s.theme = i); } function C(e) { - e === !0 || R.state.north.isClosed ? (P.hide(), N.hide()) : (P.show(), N.show()); + e === !0 || P.state.north.isClosed ? (N.hide(), O.hide()) : (N.show(), O.show()); } function k(e) { - e === !0 || R.state.east.isClosed ? O.hide() : O.show(); + e === !0 || P.state.east.isClosed ? z.hide() : z.show(); } function E() { - z = i.edit("wmd-input"), z.setOption("spellcheck", !0), z.renderer.setShowGutter(!1), - z.renderer.setPrintMarginColumn(!1), z.renderer.setPadding(o.EDITOR_DEFAULT_PADDING), - z.session.setUseWrapMode(!0), z.session.setNewLineMode("unix"), z.session.setMode("libs/ace_mode"), + j = i.edit("wmd-input"), j.setOption("spellcheck", !0), j.renderer.setShowGutter(!1), + j.renderer.setPrintMarginColumn(!1), j.renderer.setPadding(o.EDITOR_DEFAULT_PADDING), + j.session.setUseWrapMode(!0), j.session.setNewLineMode("unix"), j.session.setMode("libs/ace_mode"), function(e) { function n(n) { var i = e.lines[n]; @@ -27126,7 +27152,7 @@ function() { e.lines.splice(0, e.lines.length), e.states.splice(0, e.states.length), e.currentLine = 0, i(); }; - }(z.session.bgTokenizer), c.configureAce(z), l.onAceCreated(z); + }(j.session.bgTokenizer), c.configureAce(j), l.onAceCreated(j); } function S() { var t = { @@ -27136,15 +27162,17 @@ function() { livePaneResizing: !0, enableCursorHotkey: !1, resizerDblClickToggle: !1, - north__spacing_open: 6, - north__spacing_closed: 6, + resizeWithWindow: !1, + north__spacing_open: 1, + north__spacing_closed: 1, spacing_open: 35, spacing_closed: 35, togglerLength_open: 60, togglerLength_closed: 60, stateManagement__enabled: !1, - center__minWidth: 200, - center__minHeight: 200, + north__minSize: 49, + center__minWidth: 300, + center__minHeight: 300, fxSettings: { easing: "easeInOutQuad", duration: 350 @@ -27156,13 +27184,13 @@ function() { "north" == e ? C(!0) : "east" == e && k(!0); }, onresize_end: function(e) { - if (void 0 !== z && "center" == e) { - z.resize(); - var t = (z.renderer.$size.scrollerHeight - z.renderer.lineHeight) / 2; - 0 > t && (t = 0), z.renderer.setScrollMargin(0, t, 0, 0), setTimeout(function() { - var e = (z.renderer.$size.scrollerWidth - a.maxWidth) / 2; - e < o.EDITOR_DEFAULT_PADDING && (e = o.EDITOR_DEFAULT_PADDING), e !== z.renderer.$padding && (z.renderer.setPadding(e), - z.resize(!0)); + if (void 0 !== j && "center" == e) { + j.resize(); + var t = (j.renderer.$size.scrollerHeight - j.renderer.lineHeight) / 2; + 0 > t && (t = 0), j.renderer.setScrollMargin(0, t, 0, 0), setTimeout(function() { + var e = (j.renderer.$size.scrollerWidth - a.maxWidth) / 2; + e < o.EDITOR_DEFAULT_PADDING && (e = o.EDITOR_DEFAULT_PADDING), e !== j.renderer.$padding && (j.renderer.setPadding(e), + j.resize(!0)); }, 5); } l.onLayoutResize(e); @@ -27170,54 +27198,62 @@ function() { }; l.onLayoutConfigure(t), "horizontal" == a.layoutOrientation ? (e(".ui-layout-south").remove(), e(".preview-container").html('
    '), - R = e("body").layout(e.extend(t, { + P = e("body").layout(e.extend(t, { east__resizable: !0, east__size: .5, - east__minSize: 260 + east__minSize: 300 }))) : "vertical" == a.layoutOrientation && (e(".ui-layout-east").remove(), e(".preview-container").html('
    '), - R = e("body").layout(e.extend(t, { + P = e("body").layout(e.extend(t, { south__resizable: !0, south__size: .5, south__minSize: 200 }))), a.maxWidth && e("#preview-contents").css("max-width", a.maxWidth + 30 + "px"), e(".navbar").click(function() { - R.allowOverflow("north"); + P.allowOverflow("north"); }), e(".ui-layout-toggler-south").addClass("btn btn-info").html(''), e(".ui-layout-toggler-east").addClass("btn btn-info").html(''); var n = e(".ui-layout-toggler-north").addClass("btn btn-info").html(''), i = e('
    '); - O = e('
    '), j = e('
    '), - window.viewerMode || "horizontal" == a.layoutOrientation ? (e(".ui-layout-resizer-north").append(i).append(O), - e(".ui-layout-resizer-east").append(n).append(j)) : (e(".ui-layout-resizer-north").append(i), - e(".ui-layout-resizer-south").append(O).append(j).append(n)), C(), k(), l.onLayoutCreated(R); + z = e('
    '), H = e('
    '), + window.viewerMode || "horizontal" == a.layoutOrientation ? (e(".ui-layout-resizer-north").append(z), + e(".ui-layout-resizer-east").append(i).append(n).append(H)) : e(".ui-layout-resizer-south").append(i).append(z).append(H).append(n), + C(), k(), l.onLayoutCreated(P); } - var A, _, F = {}, T = !1, $ = !1, D = !0, L = 0, B = !1, I = r.currentTime; - F.setOffline = function() { - I = r.currentTime, B === !1 && (B = !0, l.onOfflineChanged(!0)); - }; - var M, R, P, N, O, z, j, H, q, W, U, G = require("ace/undomanager").UndoManager; - F.initEditor = function(n) { - function i() { - var e = q.val(); - void 0 !== z && (e = z.getValue()), void 0 !== U && U != e && (W.content = e, l.onContentChanged(W)), - U = e; + function A() { + if (!window.viewerMode) { + var e = q.width() - 10; + J + Q + et + tt > e ? (V.show().find(".dropdown-menu").append(U), J + Q + et + nt > e ? G.show().find(".dropdown-menu").append(W) : G.hide().after(W)) : (G.hide().after(W), + V.hide().after(U)), window.lightMode && (W.hide(), G.hide()); } - void 0 !== W && l.onFileClosed(W), W = n, U = void 0; - var o = W.content; - if (void 0 !== z ? (z.setValue(o, -1), z.getSession().setUndoManager(new G())) : q.val(o), - void 0 !== H) return z && z.selection.setSelectionRange(W.editorSelectRange), z && z.focus() || q.focus(), - H.refreshPreview(), void 0; + P.resizeAll(); + } + var _, F, T = {}, $ = !1, D = !1, L = !0, B = 0, I = !1, M = r.currentTime; + T.setOffline = function() { + M = r.currentTime, I === !1 && (I = !0, l.onOfflineChanged(!0)); + }; + var R, P, N, O, z, j, H, q, W, U, G, V, K, X, Y, Z, J = 90, Q = 373, et = window.lightMode ? 0 : 603, tt = 215, nt = 44, it = require("ace/undomanager").UndoManager; + T.initEditor = function(n) { + function i() { + var e = X.val(); + void 0 !== j && (e = j.getValue()), void 0 !== Z && Z != e && (Y.content = e, l.onContentChanged(Y)), + Z = e; + } + void 0 !== Y && l.onFileClosed(Y), Y = n, Z = void 0; + var o = Y.content; + if (void 0 !== j ? (j.setValue(o, -1), j.getSession().setUndoManager(new it())) : X.val(o), + void 0 !== K) return j && j.selection.setSelectionRange(Y.editorSelectRange), j && j.focus() || X.focus(), + K.refreshPreview(), void 0; var s = e(".preview-container"); if (!window.lightMode) { var u = t.debounce(function() { - void 0 !== U && (W.editorScrollTop = z.renderer.getScrollTop()); + void 0 !== Z && (Y.editorScrollTop = j.renderer.getScrollTop()); }, 100); - z.session.on("changeScrollTop", u); + j.session.on("changeScrollTop", u); var d = t.debounce(function() { - void 0 !== U && (W.editorSelectRange = z.getSelectionRange()); + void 0 !== Z && (Y.editorSelectRange = j.getSelectionRange()); }, 100); - z.session.selection.on("changeSelection", d), z.session.selection.on("changeCursor", d), + j.session.selection.on("changeSelection", d), j.session.selection.on("changeCursor", d), s.scroll(function() { - void 0 !== U && (W.previewScrollTop = s.scrollTop()); + void 0 !== Z && (Y.previewScrollTop = s.scrollTop()); }); } var h, p = new Markdown.Converter(); @@ -27225,12 +27261,12 @@ function() { var f = e("#wmd-preview"), g = new Markdown.HookCollection(); g.addNoop("onPreviewRefresh"); var m = function() { - var e = q.val(); + var e = X.val(); e = p.makeHtml(e), f.html(e), g.onPreviewRefresh(); }, v = t.debounce(m, 1e3), b = function() { - void 0 === U ? (m(), l.onFileOpen(W)) : v(), i(); + void 0 === Z ? (m(), l.onFileOpen(Y)) : v(), i(); }; - q.on("input propertychange", b), H = { + X.on("input propertychange", b), K = { hooks: g, getConverter: function() { return p; @@ -27238,30 +27274,30 @@ function() { run: b, refreshPreview: b }; - } else H = new Markdown.Editor(p, void 0, { + } else K = new Markdown.Editor(p, void 0, { keyStrokes: c.getPagedownKeyStrokes() - }), H.hooks.set("insertLinkDialog", function(t) { - return F.insertLinkCallback = t, r.resetModalInputs(), e(".modal-insert-link").modal(), + }), K.hooks.set("insertLinkDialog", function(t) { + return T.insertLinkCallback = t, r.resetModalInputs(), e(".modal-insert-link").modal(), !0; - }), H.hooks.set("insertImageDialog", function(t) { - return F.insertLinkCallback = t, F.catchModal ? !0 : (r.resetModalInputs(), e(".modal-insert-image").modal(), + }), K.hooks.set("insertImageDialog", function(t) { + return T.insertLinkCallback = t, T.catchModal ? !0 : (r.resetModalInputs(), e(".modal-insert-image").modal(), !0); }), h = a.lazyRendering === !0 ? function(e) { var n = t.debounce(e, 500); return function() { - void 0 === U ? (e(), l.onFileOpen(W), s.scrollTop(W.previewScrollTop), t.defer(function() { - z.renderer.scrollToY(W.editorScrollTop); + void 0 === Z ? (e(), l.onFileOpen(Y), s.scrollTop(Y.previewScrollTop), t.defer(function() { + j.renderer.scrollToY(Y.editorScrollTop); })) : n(), i(); }; } : function(e) { return function() { - e(), void 0 === U && (l.onFileOpen(W), s.scrollTop(W.previewScrollTop), t.defer(function() { - z.renderer.scrollToY(W.editorScrollTop); + e(), void 0 === Z && (l.onFileOpen(Y), s.scrollTop(Y.previewScrollTop), t.defer(function() { + j.renderer.scrollToY(Y.editorScrollTop); })), i(); }; }; - l.onPagedownConfigure(H), H.hooks.chain("onPreviewRefresh", l.onAsyncPreview), H.run(z, h), - z && z.selection.setSelectionRange(W.editorSelectRange), z && z.focus() || q.focus(), + l.onPagedownConfigure(K), K.hooks.chain("onPreviewRefresh", l.onAsyncPreview), K.run(j, h), + j && j.selection.setSelectionRange(Y.editorSelectRange), j && j.focus() || X.focus(), e(".wmd-button-row li").addClass("btn btn-success").css("left", 0).find("span").hide(); var y = e(".wmd-button-group1"); e("#wmd-bold-button").append(e('')).appendTo(y), e("#wmd-italic-button").append(e('')).appendTo(y), @@ -27273,96 +27309,117 @@ function() { e("#wmd-hr-button").append(e('')).appendTo(y), y = e(".wmd-button-group4"), e("#wmd-undo-button").append(e('')).appendTo(y), e("#wmd-redo-button").append(e('')).appendTo(y); }; - var V, K; - F.redirectConfirm = function(t, n, i) { - V = n, K = i, e(".modal-redirect-confirm .redirect-msg").html(t), e(".modal-redirect-confirm").modal("show"); + var ot, rt; + T.redirectConfirm = function(t, n, i) { + ot = n, rt = i, e(".modal-redirect-confirm .redirect-msg").html(t), e(".modal-redirect-confirm").modal("show"); }; - var X = !1, Y = !1; - return F.onReady = function() { - document.body.innerHTML = window.viewerMode === !0 ? h : d, c.addSettingEntries(), - e(window).on("offline", F.setOffline), e(window).on("online", b), navigator.onLine === !1 && F.setOffline(), - e(document).mousemove(g).keypress(g), e(".dropdown-submenu > a").click(function(e) { + var st = !1, at = !1; + return T.onReady = function() { + document.body.innerHTML = window.viewerMode === !0 ? h : d, q = e(".navbar"), W = q.find(".left-buttons"), + U = q.find(".right-buttons"), G = q.find(".left-buttons-dropdown"), V = q.find(".right-buttons-dropdown"), + e(window).bind("resize", A), c.addSettingEntries(), e(window).on("offline", T.setOffline), + e(window).on("online", b), navigator.onLine === !1 && T.setOffline(), e(document).mousemove(g).keypress(g), + e(".dropdown-submenu > a").click(function(e) { e.stopPropagation(); - }), P = e(".menu-panel").collapse({ + }), N = e(".menu-panel").collapse({ toggle: !1 }); var t; - P.on("show.bs.collapse", function(e) { - e.target === P[0] ? (Y = !0, t = r.createBackdrop("collapse", ".menu-panel"), P.addClass("move-to-front")) : P.find(".in").collapse("hide"); + N.on("show.bs.collapse", function(e) { + e.target === N[0] ? (at = !0, t = r.createBackdrop("collapse", ".menu-panel"), N.addClass("move-to-front")) : N.find(".in").collapse("hide"); }).on("hide.bs.collapse", function(e) { - e.target === P[0] && (Y = !1, t.parentNode.removeChild(t), P.removeClass("move-to-front"), - z && z.focus() || q.focus()); + e.target === N[0] && (at = !1, t.parentNode.removeChild(t), N.removeClass("move-to-front"), + j && j.focus() || X.focus()); }).on("hidden.bs.collapse", function(e) { - e.target === P[0] && P.find(".in").collapse("hide"); - }), N = e(".document-panel").collapse({ + e.target === N[0] && N.find(".in").collapse("hide"); + }), O = e(".document-panel").collapse({ toggle: !1 }); var n; - N.on("show.bs.collapse", function(e) { - e.target === N[0] ? (X = !0, n = r.createBackdrop("collapse", ".document-panel"), - N.addClass("move-to-front")) : N.find(".in").collapse("hide"); + O.on("show.bs.collapse", function(e) { + e.target === O[0] ? (st = !0, n = r.createBackdrop("collapse", ".document-panel"), + O.addClass("move-to-front")) : O.find(".in").collapse("hide"); }).on("hide.bs.collapse", function(e) { - e.target === N[0] && (X = !1, n.parentNode.removeChild(n), N.removeClass("move-to-front"), - z && z.focus() || q.focus()); + e.target === O[0] && (st = !1, n.parentNode.removeChild(n), O.removeClass("move-to-front"), + j && j.focus() || X.focus()); }).on("hidden.bs.collapse", function(e) { - e.target === N[0] && N.find(".in").collapse("hide"); + e.target === O[0] && O.find(".in").collapse("hide"); }), window.lightMode && e("#wmd-input").replaceWith(function() { return e('