ghost 5.40.2 → 5.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/components/tryghost-adapter-cache-memory-ttl-5.42.0.tgz +0 -0
- package/components/tryghost-adapter-cache-redis-5.42.0.tgz +0 -0
- package/components/{tryghost-adapter-manager-5.40.2.tgz → tryghost-adapter-manager-5.42.0.tgz} +0 -0
- package/components/tryghost-api-framework-5.42.0.tgz +0 -0
- package/components/{tryghost-api-version-compatibility-service-5.40.2.tgz → tryghost-api-version-compatibility-service-5.42.0.tgz} +0 -0
- package/components/{tryghost-audience-feedback-5.40.2.tgz → tryghost-audience-feedback-5.42.0.tgz} +0 -0
- package/components/tryghost-bootstrap-socket-5.42.0.tgz +0 -0
- package/components/tryghost-constants-5.42.0.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.42.0.tgz +0 -0
- package/components/{tryghost-data-generator-5.40.2.tgz → tryghost-data-generator-5.42.0.tgz} +0 -0
- package/components/tryghost-domain-events-5.42.0.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.42.0.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.42.0.tgz +0 -0
- package/components/{tryghost-email-analytics-service-5.40.2.tgz → tryghost-email-analytics-service-5.42.0.tgz} +0 -0
- package/components/tryghost-email-content-generator-5.42.0.tgz +0 -0
- package/components/tryghost-email-events-5.42.0.tgz +0 -0
- package/components/tryghost-email-service-5.42.0.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.42.0.tgz +0 -0
- package/components/tryghost-event-aware-cache-wrapper-5.42.0.tgz +0 -0
- package/components/{tryghost-express-dynamic-redirects-5.40.2.tgz → tryghost-express-dynamic-redirects-5.42.0.tgz} +0 -0
- package/components/tryghost-external-media-inliner-5.42.0.tgz +0 -0
- package/components/{tryghost-extract-api-key-5.40.2.tgz → tryghost-extract-api-key-5.42.0.tgz} +0 -0
- package/components/tryghost-html-to-plaintext-5.42.0.tgz +0 -0
- package/components/tryghost-i18n-5.42.0.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.42.0.tgz +0 -0
- package/components/{tryghost-importer-revue-5.40.2.tgz → tryghost-importer-revue-5.42.0.tgz} +0 -0
- package/components/{tryghost-job-manager-5.40.2.tgz → tryghost-job-manager-5.42.0.tgz} +0 -0
- package/components/{tryghost-link-redirects-5.40.2.tgz → tryghost-link-redirects-5.42.0.tgz} +0 -0
- package/components/{tryghost-link-replacer-5.40.2.tgz → tryghost-link-replacer-5.42.0.tgz} +0 -0
- package/components/{tryghost-link-tracking-5.40.2.tgz → tryghost-link-tracking-5.42.0.tgz} +0 -0
- package/components/tryghost-magic-link-5.42.0.tgz +0 -0
- package/components/tryghost-mailgun-client-5.42.0.tgz +0 -0
- package/components/tryghost-member-attribution-5.42.0.tgz +0 -0
- package/components/{tryghost-member-events-5.40.2.tgz → tryghost-member-events-5.42.0.tgz} +0 -0
- package/components/tryghost-members-api-5.42.0.tgz +0 -0
- package/components/{tryghost-members-csv-5.40.2.tgz → tryghost-members-csv-5.42.0.tgz} +0 -0
- package/components/tryghost-members-events-service-5.42.0.tgz +0 -0
- package/components/{tryghost-members-importer-5.40.2.tgz → tryghost-members-importer-5.42.0.tgz} +0 -0
- package/components/{tryghost-members-offers-5.40.2.tgz → tryghost-members-offers-5.42.0.tgz} +0 -0
- package/components/tryghost-members-payments-5.42.0.tgz +0 -0
- package/components/tryghost-members-ssr-5.42.0.tgz +0 -0
- package/components/{tryghost-members-stripe-service-5.40.2.tgz → tryghost-members-stripe-service-5.42.0.tgz} +0 -0
- package/components/{tryghost-mentions-email-report-5.40.2.tgz → tryghost-mentions-email-report-5.42.0.tgz} +0 -0
- package/components/tryghost-milestones-5.42.0.tgz +0 -0
- package/components/tryghost-minifier-5.42.0.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.42.0.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.42.0.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.42.0.tgz +0 -0
- package/components/tryghost-mw-session-from-token-5.42.0.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.42.0.tgz +0 -0
- package/components/tryghost-mw-version-match-5.42.0.tgz +0 -0
- package/components/tryghost-mw-vhost-5.42.0.tgz +0 -0
- package/components/tryghost-oembed-service-5.42.0.tgz +0 -0
- package/components/tryghost-package-json-5.42.0.tgz +0 -0
- package/components/tryghost-posts-service-5.42.0.tgz +0 -0
- package/components/{tryghost-referrers-5.40.2.tgz → tryghost-referrers-5.42.0.tgz} +0 -0
- package/components/{tryghost-security-5.40.2.tgz → tryghost-security-5.42.0.tgz} +0 -0
- package/components/tryghost-session-service-5.42.0.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.42.0.tgz +0 -0
- package/components/tryghost-slack-notifications-5.42.0.tgz +0 -0
- package/components/tryghost-staff-service-5.42.0.tgz +0 -0
- package/components/{tryghost-stats-service-5.40.2.tgz → tryghost-stats-service-5.42.0.tgz} +0 -0
- package/components/tryghost-tiers-5.42.0.tgz +0 -0
- package/components/{tryghost-update-check-service-5.40.2.tgz → tryghost-update-check-service-5.42.0.tgz} +0 -0
- package/components/tryghost-verification-trigger-5.42.0.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.42.0.tgz +0 -0
- package/components/{tryghost-webmentions-5.40.2.tgz → tryghost-webmentions-5.42.0.tgz} +0 -0
- package/content/themes/casper/default.hbs +1 -1
- package/content/themes/casper/package.json +2 -2
- package/core/built/admin/assets/chunk.143.5883751093d1b6e535c0.js +35 -0
- package/core/built/admin/assets/{chunk.178.ca167199fe31a5836b26.js → chunk.178.bc2da086492043bfc5c8.js} +4 -4
- package/core/built/admin/assets/{chunk.462.b66cfed1f66c8d2678b2.js → chunk.580.ca53e3417715b59cfb59.js} +5958 -5228
- package/core/built/admin/assets/{chunk.462.b66cfed1f66c8d2678b2.js.LICENSE.txt → chunk.580.ca53e3417715b59cfb59.js.LICENSE.txt} +18 -0
- package/core/built/admin/assets/codemirror/{codemirror-3f3b9966a7237652dd31484694e38ad5.js → codemirror-31d641cdd0cb3388688402609608cb10.js} +1 -1
- package/core/built/admin/assets/ghost-0b2e282fd281b16ee656b554d7bc4863.css +1 -0
- package/core/built/admin/assets/{ghost-467b96c17c6bc0d06fa88e85074fbecf.js → ghost-744b6bcb745893e43bbdfaed2b931347.js} +4503 -4435
- package/core/built/admin/assets/ghost-dark-c05706ed6261cfa7944426e1ef933462.css +1 -0
- package/core/built/admin/assets/simplemde/{simplemde-9cd5549b68db674742d6ec2ecd72ac30.js → simplemde-d16ff9bcc5bf6ad4916fb0034a30adb1.js} +47 -47
- package/core/built/admin/assets/{vendor-d08b4de6f990b9cd7b5a92d61952a5bb.js → vendor-fcd4f09ebc985b1bd9ea37bdf7954c18.js} +140 -141
- package/core/built/admin/index.html +6 -6
- package/core/frontend/helpers/ghost_head.js +2 -1
- package/core/server/api/endpoints/posts.js +1 -1
- package/core/server/api/endpoints/utils/serializers/input/settings.js +2 -0
- package/core/server/data/migrations/versions/5.40/2023-03-21-19-02-add-self-serve-integration-api-key.js +1 -1
- package/core/server/data/migrations/versions/5.41/2023-03-27-15-00-add-newsletter-colors.js +22 -0
- package/core/server/data/migrations/versions/5.41/2023-03-27-17-51-fix-self-serve-integration-api-key-type.js +36 -0
- package/core/server/data/migrations/versions/5.42/2023-04-04-07-03-add-portal-terms-settings.js +16 -0
- package/core/server/data/schema/default-settings/default-settings.json +12 -0
- package/core/server/data/schema/schema.js +3 -0
- package/core/server/models/newsletter.js +3 -0
- package/core/server/services/i18n.js +31 -9
- package/core/server/services/members/api.js +10 -10
- package/core/server/services/members/middleware.js +1 -1
- package/core/server/services/members/utils.js +1 -0
- package/core/server/services/mentions-email-report/service.js +7 -2
- package/core/server/services/posts/posts-service.js +2 -1
- package/core/shared/config/defaults.json +1 -1
- package/core/shared/config/env/config.testing-browser.json +2 -1
- package/core/shared/config/env/config.testing-mysql.json +1 -1
- package/core/shared/config/env/config.testing.json +1 -1
- package/core/shared/labs.js +2 -1
- package/core/shared/settings-cache/public.js +2 -0
- package/package.json +146 -145
- package/yarn.lock +2212 -1199
- package/components/tryghost-adapter-cache-memory-ttl-5.40.2.tgz +0 -0
- package/components/tryghost-adapter-cache-redis-5.40.2.tgz +0 -0
- package/components/tryghost-api-framework-5.40.2.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.40.2.tgz +0 -0
- package/components/tryghost-constants-5.40.2.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.40.2.tgz +0 -0
- package/components/tryghost-domain-events-5.40.2.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.40.2.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.40.2.tgz +0 -0
- package/components/tryghost-email-content-generator-5.40.2.tgz +0 -0
- package/components/tryghost-email-events-5.40.2.tgz +0 -0
- package/components/tryghost-email-service-5.40.2.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.40.2.tgz +0 -0
- package/components/tryghost-event-aware-cache-wrapper-5.40.2.tgz +0 -0
- package/components/tryghost-external-media-inliner-5.40.2.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.40.2.tgz +0 -0
- package/components/tryghost-i18n-5.40.2.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.40.2.tgz +0 -0
- package/components/tryghost-magic-link-5.40.2.tgz +0 -0
- package/components/tryghost-mailgun-client-5.40.2.tgz +0 -0
- package/components/tryghost-member-attribution-5.40.2.tgz +0 -0
- package/components/tryghost-members-api-5.40.2.tgz +0 -0
- package/components/tryghost-members-events-service-5.40.2.tgz +0 -0
- package/components/tryghost-members-payments-5.40.2.tgz +0 -0
- package/components/tryghost-members-ssr-5.40.2.tgz +0 -0
- package/components/tryghost-milestones-5.40.2.tgz +0 -0
- package/components/tryghost-minifier-5.40.2.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.40.2.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.40.2.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.40.2.tgz +0 -0
- package/components/tryghost-mw-session-from-token-5.40.2.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.40.2.tgz +0 -0
- package/components/tryghost-mw-version-match-5.40.2.tgz +0 -0
- package/components/tryghost-mw-vhost-5.40.2.tgz +0 -0
- package/components/tryghost-oembed-service-5.40.2.tgz +0 -0
- package/components/tryghost-package-json-5.40.2.tgz +0 -0
- package/components/tryghost-posts-service-5.40.2.tgz +0 -0
- package/components/tryghost-session-service-5.40.2.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.40.2.tgz +0 -0
- package/components/tryghost-slack-notifications-5.40.2.tgz +0 -0
- package/components/tryghost-staff-service-5.40.2.tgz +0 -0
- package/components/tryghost-tiers-5.40.2.tgz +0 -0
- package/components/tryghost-verification-trigger-5.40.2.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.40.2.tgz +0 -0
- package/core/built/admin/assets/chunk.143.712450fcbf0ea1950e24.js +0 -49
- package/core/built/admin/assets/chunk.808.2e76eb12fa4d7be8cb23.js +0 -5
- package/core/built/admin/assets/ghost-68ea49029c6d45b4aa090f4e218917aa.css +0 -1
- package/core/built/admin/assets/ghost-dark-c9b38252afc29364507e8c92e4ba9933.css +0 -1
|
@@ -1757,22 +1757,22 @@ else{var n=Array(e.options.tabSize+1).join(" ")
|
|
|
1757
1757
|
e.replaceSelection(n)}}},{codemirror:10}],18:[function(e,t,n){"use strict"
|
|
1758
1758
|
var r=e("codemirror")
|
|
1759
1759
|
e("codemirror/addon/edit/continuelist.js"),e("./codemirror/tablist"),e("codemirror/addon/display/fullscreen.js"),e("codemirror/mode/markdown/markdown.js"),e("codemirror/addon/mode/overlay.js"),e("codemirror/addon/display/placeholder.js"),e("codemirror/addon/selection/mark-selection.js"),e("codemirror/mode/gfm/gfm.js"),e("codemirror/mode/xml/xml.js")
|
|
1760
|
-
var i=e("codemirror-spell-checker"),o=navigator.userAgent,a=navigator.platform,l=!/Edge\/(\d+)/.exec(o)&&/AppleWebKit/.test(o)&&/Mobile\/\w+/.test(o)||/Mac/.test(a),s=/win/i.test(a),u={toggleBold:
|
|
1761
|
-
return
|
|
1762
|
-
function d(e){return l?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}function h(e,t,n){e=e||{}
|
|
1760
|
+
var i=e("codemirror-spell-checker"),o=navigator.userAgent,a=navigator.platform,l=!/Edge\/(\d+)/.exec(o)&&/AppleWebKit/.test(o)&&/Mobile\/\w+/.test(o)||/Mac/.test(a),s=/win/i.test(a),u={toggleBold:v,toggleItalic:y,drawLink:E,toggleHeadingSmaller:C,toggleHeadingBigger:k,drawImage:D,toggleBlockquote:w,toggleOrderedList:A,toggleUnorderedList:M,toggleCodeBlock:b,togglePreview:W,toggleStrikethrough:x,toggleHeading1:S,toggleHeading2:L,toggleHeading3:T,cleanBlock:N,drawTable:F,drawHorizontalRule:O,undo:I,redo:B,toggleSideBySide:H,toggleFullScreen:g},c={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"}
|
|
1761
|
+
function f(e){return l?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}function d(e,t,n){e=e||{}
|
|
1763
1762
|
var r=document.createElement("a")
|
|
1764
1763
|
return t=null==t||t,e.title&&t&&(r.title=function(e,t,n){var r,i=e
|
|
1765
|
-
return t&&n[r=
|
|
1766
|
-
return e.
|
|
1764
|
+
return t&&n[r=function(e){for(var t in u)if(u[t]===e)return t
|
|
1765
|
+
return null}(t)]&&(i+=" ("+f(n[r])+")"),i}(e.title,e.action,n),l&&!e.useCtrlOnMac&&(r.title=r.title.replace("Ctrl","⌘")),l&&(r.title=r.title.replace("Alt","⌥"))),r.tabIndex=-1,r.className=e.className,r}function h(){var e=document.createElement("i")
|
|
1766
|
+
return e.className="separator",e.innerHTML="|",e}function p(e,t){t=t||e.getCursor("start")
|
|
1767
1767
|
var n=e.getTokenAt(t)
|
|
1768
1768
|
if(!n.type)return{}
|
|
1769
1769
|
for(var r,i,o=n.type.split(" "),a={},l=0;l<o.length;l++)"strong"===(r=o[l])?a.bold=!0:"variable-2"===r?(i=e.getLine(t.line),/^\s*\d+\.\s/.test(i)?a["ordered-list"]=!0:a["unordered-list"]=!0):"atom"===r?a.quote=!0:"em"===r?a.italic=!0:"quote"===r?a.quote=!0:"strikethrough"===r?a.strikethrough=!0:"comment"===r?a.code=!0:"link"===r?a.link=!0:"tag"===r?a.image=!0:r.match(/^header(\-[1-6])?$/)&&(a[r.replace("header","heading")]=!0)
|
|
1770
|
-
return a}var
|
|
1771
|
-
function
|
|
1772
|
-
t.setOption("fullScreen",!t.getOption("fullScreen")),t.getOption("fullScreen")?(
|
|
1770
|
+
return a}var m=""
|
|
1771
|
+
function g(e){var t=e.codemirror
|
|
1772
|
+
t.setOption("fullScreen",!t.getOption("fullScreen")),t.getOption("fullScreen")?(m=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=m
|
|
1773
1773
|
var n=t.getWrapperElement();/fullscreen/.test(n.previousSibling.className)?n.previousSibling.className=n.previousSibling.className.replace(/\s*fullscreen\b/,""):n.previousSibling.className+=" fullscreen"
|
|
1774
1774
|
var r=e.toolbarElements.fullscreen;/active/.test(r.className)?r.className=r.className.replace(/\s*active\s*/g,""):r.className+=" active"
|
|
1775
|
-
var i=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(i.className)&&
|
|
1775
|
+
var i=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(i.className)&&H(e)}function v(e){j(e,"bold",e.options.blockStyles.bold)}function y(e){j(e,"italic",e.options.blockStyles.italic)}function x(e){j(e,"strikethrough","~~")}function b(e){var t=e.options.blockStyles.code
|
|
1776
1776
|
function n(e){if("object"!=typeof e)throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof e+": "+e
|
|
1777
1777
|
return e.styles&&e.styles[2]&&-1!==e.styles[2].indexOf("formatting-code-block")}function r(e){return e.state.base.base||e.state.base}function i(e,t,i,o,a){i=i||e.getLineHandle(t),o=o||e.getTokenAt({line:t,ch:1}),a=a||!!i.text&&e.getTokenAt({line:t,ch:i.text.length-1})
|
|
1778
1778
|
var l=o.type?o.type.split(" "):[]
|
|
@@ -1788,54 +1788,54 @@ k&&r(k).indentedCode&&s.replaceRange("\n",{line:a+1,ch:0})
|
|
|
1788
1788
|
for(var S=o;S<=a;S++)s.indentLine(S,"subtract")
|
|
1789
1789
|
s.focus()}else{var L=u.line===c.line&&u.ch===c.ch&&0===u.ch,T=u.line!==c.line
|
|
1790
1790
|
L||T?function(e,t,n,r){var i=t.line+1,o=n.line+1,a=t.line!==n.line,l=r+"\n",s="\n"+r
|
|
1791
|
-
a&&o++,a&&0===n.ch&&(s=r+"\n",o--),
|
|
1791
|
+
a&&o++,a&&0===n.ch&&(s=r+"\n",o--),P(e,!1,[l,s]),e.setSelection({line:i,ch:0},{line:o,ch:0})}(s,u,c,t):P(s,!1,["`","`"])}}function w(e){z(e.codemirror,"quote")}function C(e){R(e.codemirror,"smaller")}function k(e){R(e.codemirror,"bigger")}function S(e){R(e.codemirror,void 0,1)}function L(e){R(e.codemirror,void 0,2)}function T(e){R(e.codemirror,void 0,3)}function M(e){z(e.codemirror,"unordered-list")}function A(e){z(e.codemirror,"ordered-list")}function N(e){!function(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),r=e.getCursor("end"),i=n.line;i<=r.line;i++)t=(t=e.getLine(i)).replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:i,ch:0},{line:i,ch:99999999999999})}(e.codemirror)}function E(e){var t=e.codemirror,n=p(t),r=e.options,i="http://"
|
|
1792
1792
|
if(r.promptURLs&&!(i=prompt(r.promptTexts.link)))return!1
|
|
1793
|
-
|
|
1793
|
+
P(t,n.link,r.insertTexts.link,i)}function D(e){var t=e.codemirror,n=p(t),r=e.options,i="http://"
|
|
1794
1794
|
if(r.promptURLs&&!(i=prompt(r.promptTexts.image)))return!1
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
t.undo(),t.focus()}function
|
|
1799
|
-
t.redo(),t.focus()}function
|
|
1795
|
+
P(t,n.image,r.insertTexts.image,i)}function F(e){var t=e.codemirror,n=p(t),r=e.options
|
|
1796
|
+
P(t,n.table,r.insertTexts.table)}function O(e){var t=e.codemirror,n=p(t),r=e.options
|
|
1797
|
+
P(t,n.image,r.insertTexts.horizontalRule)}function I(e){var t=e.codemirror
|
|
1798
|
+
t.undo(),t.focus()}function B(e){var t=e.codemirror
|
|
1799
|
+
t.redo(),t.focus()}function H(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.nextSibling,i=e.toolbarElements["side-by-side"],o=!1;/editor-preview-active-side/.test(r.className)?(r.className=r.className.replace(/\s*editor-preview-active-side\s*/g,""),i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout((function(){t.getOption("fullScreen")||g(e),r.className+=" editor-preview-active-side"}),1),i.className+=" active",n.className+=" CodeMirror-sided",o=!0)
|
|
1800
1800
|
var a=n.lastChild
|
|
1801
1801
|
if(/editor-preview-active/.test(a.className)){a.className=a.className.replace(/\s*editor-preview-active\s*/g,"")
|
|
1802
1802
|
var l=e.toolbarElements.preview,s=n.previousSibling
|
|
1803
|
-
l.className=l.className.replace(/\s*active\s*/g,""),s.className=s.className.replace(/\s*disabled-for-preview*/g,"")}t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=function(){r.innerHTML=e.options.previewRender(e.value(),r)}),o?(r.innerHTML=e.options.previewRender(e.value(),r),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction),t.refresh()}function
|
|
1803
|
+
l.className=l.className.replace(/\s*active\s*/g,""),s.className=s.className.replace(/\s*disabled-for-preview*/g,"")}t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=function(){r.innerHTML=e.options.previewRender(e.value(),r)}),o?(r.innerHTML=e.options.previewRender(e.value(),r),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction),t.refresh()}function W(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.previousSibling,i=!!e.options.toolbar&&e.toolbarElements.preview,o=n.lastChild
|
|
1804
1804
|
o&&/editor-preview/.test(o.className)||((o=document.createElement("div")).className="editor-preview",n.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),r.className=r.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout((function(){o.className+=" editor-preview-active"}),1),i&&(i.className+=" active",r.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o)
|
|
1805
|
-
var a=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(a.className)&&
|
|
1806
|
-
r&&(a=a.replace("#url#",r)),t?(o=(i=e.getLine(l.line)).slice(0,l.ch),a=i.slice(l.ch),e.replaceRange(o+a,{line:l.line,ch:0})):(i=e.getSelection(),e.replaceSelection(o+i+a),l.ch+=o.length,l!==s&&(s.ch+=o.length)),e.setSelection(l,s),e.focus()}}function
|
|
1805
|
+
var a=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(a.className)&&H(e)}function P(e,t,n,r){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){var i,o=n[0],a=n[1],l=e.getCursor("start"),s=e.getCursor("end")
|
|
1806
|
+
r&&(a=a.replace("#url#",r)),t?(o=(i=e.getLine(l.line)).slice(0,l.ch),a=i.slice(l.ch),e.replaceRange(o+a,{line:l.line,ch:0})):(i=e.getSelection(),e.replaceSelection(o+i+a),l.ch+=o.length,l!==s&&(s.ch+=o.length)),e.setSelection(l,s),e.focus()}}function R(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var r=e.getCursor("start"),i=e.getCursor("end"),o=r.line;o<=i.line;o++)!function(r){var i=e.getLine(r),o=i.search(/[^#]/)
|
|
1807
1807
|
i=void 0!==t?o<=0?"bigger"==t?"###### "+i:"# "+i:6==o&&"smaller"==t?i.substr(7):1==o&&"bigger"==t?i.substr(2):"bigger"==t?i.substr(1):"#"+i:1==n?o<=0?"# "+i:o==n?i.substr(o+1):"# "+i.substr(o+1):2==n?o<=0?"## "+i:o==n?i.substr(o+1):"## "+i.substr(o+1):o<=0?"### "+i:o==n?i.substr(o+1):"### "+i.substr(o+1),e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(o)
|
|
1808
|
-
e.focus()}}function
|
|
1808
|
+
e.focus()}}function z(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=p(e),r=e.getCursor("start"),i=e.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},a={quote:"> ","unordered-list":"* ","ordered-list":"1. "},l=r.line;l<=i.line;l++)!function(r){var i=e.getLine(r)
|
|
1809
1809
|
i=n[t]?i.replace(o[t],"$1"):a[t]+i,e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(l)
|
|
1810
|
-
e.focus()}}function
|
|
1811
|
-
var i,o=e.codemirror,a=
|
|
1812
|
-
a[t]?(l=(i=o.getLine(u.line)).slice(0,u.ch),s=i.slice(u.ch),"bold"==t?(l=l.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),s=s.replace(/(\*\*|__)/,"")):"italic"==t?(l=l.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),s=s.replace(/(\*|_)/,"")):"strikethrough"==t&&(l=l.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),s=s.replace(/(\*\*|~~)/,"")),o.replaceRange(l+s,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==c&&(c.ch-=2)):"italic"==t&&(u.ch-=1,u!==c&&(c.ch-=1))):(i=o.getSelection(),"bold"==t?i=(i=i.split("**").join("")).split("__").join(""):"italic"==t?i=(i=i.split("*").join("")).split("_").join(""):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(l+i+s),u.ch+=n.length,c.ch=u.ch+i.length),o.setSelection(u,c),o.focus()}}function
|
|
1813
|
-
return e}function
|
|
1814
|
-
return e}function
|
|
1810
|
+
e.focus()}}function j(e,t,n,r){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){r=void 0===r?n:r
|
|
1811
|
+
var i,o=e.codemirror,a=p(o),l=n,s=r,u=o.getCursor("start"),c=o.getCursor("end")
|
|
1812
|
+
a[t]?(l=(i=o.getLine(u.line)).slice(0,u.ch),s=i.slice(u.ch),"bold"==t?(l=l.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),s=s.replace(/(\*\*|__)/,"")):"italic"==t?(l=l.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),s=s.replace(/(\*|_)/,"")):"strikethrough"==t&&(l=l.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),s=s.replace(/(\*\*|~~)/,"")),o.replaceRange(l+s,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==c&&(c.ch-=2)):"italic"==t&&(u.ch-=1,u!==c&&(c.ch-=1))):(i=o.getSelection(),"bold"==t?i=(i=i.split("**").join("")).split("__").join(""):"italic"==t?i=(i=i.split("*").join("")).split("_").join(""):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(l+i+s),u.ch+=n.length,c.ch=u.ch+i.length),o.setSelection(u,c),o.focus()}}function _(e,t){for(var n in t)t.hasOwnProperty(n)&&(t[n]instanceof Array?e[n]=t[n].concat(e[n]instanceof Array?e[n]:[]):null!==t[n]&&"object"==typeof t[n]&&t[n].constructor===Object?e[n]=_(e[n]||{},t[n]):e[n]=t[n])
|
|
1813
|
+
return e}function U(e){for(var t=1;t<arguments.length;t++)e=_(e,arguments[t])
|
|
1814
|
+
return e}function q(e){var t=e.match(/[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g),n=0
|
|
1815
1815
|
if(null===t)return n
|
|
1816
1816
|
for(var r=0;r<t.length;r++)t[r].charCodeAt(0)>=19968?n+=t[r].length:n+=1
|
|
1817
|
-
return n}var
|
|
1818
|
-
function
|
|
1817
|
+
return n}var G={bold:{name:"bold",action:v,className:"fa fa-bold",title:"Bold",default:!0},italic:{name:"italic",action:y,className:"fa fa-italic",title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:x,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:C,className:"fa fa-header",title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:C,className:"fa fa-header fa-header-x fa-header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:k,className:"fa fa-header fa-header-x fa-header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:S,className:"fa fa-header fa-header-x fa-header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:L,className:"fa fa-header fa-header-x fa-header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:T,className:"fa fa-header fa-header-x fa-header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:b,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:w,className:"fa fa-quote-left",title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:M,className:"fa fa-list-ul",title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:A,className:"fa fa-list-ol",title:"Numbered List",default:!0},"clean-block":{name:"clean-block",action:N,className:"fa fa-eraser fa-clean-block",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:E,className:"fa fa-link",title:"Create Link",default:!0},image:{name:"image",action:D,className:"fa fa-picture-o",title:"Insert Image",default:!0},table:{name:"table",action:F,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:O,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:W,className:"fa fa-eye no-disable",title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:H,className:"fa fa-columns no-disable no-mobile",title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:g,className:"fa fa-arrows-alt no-disable no-mobile",title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://simplemde.com/markdown-guide",className:"fa fa-question-circle",title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:I,className:"fa fa-undo no-disable",title:"Undo"},redo:{name:"redo",action:B,className:"fa fa-repeat no-disable",title:"Redo"}},V={link:["[","](#url#)"],image:[""],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],horizontalRule:["","\n\n-----\n\n"]},$={link:"URL for the link:",image:"URL of the image:"},X={bold:"**",code:"```",italic:"*"}
|
|
1818
|
+
function K(e){(e=e||{}).parent=this
|
|
1819
1819
|
var t=!0
|
|
1820
1820
|
if(!1===e.autoDownloadFontAwesome&&(t=!1),!0!==e.autoDownloadFontAwesome)for(var n=document.styleSheets,r=0;r<n.length;r++)n[r].href&&n[r].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(t=!1)
|
|
1821
1821
|
if(t){var i=document.createElement("link")
|
|
1822
1822
|
i.rel="stylesheet",i.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(i)}if(e.element)this.element=e.element
|
|
1823
1823
|
else if(null===e.element)return void console.log("SimpleMDE: Error. No element was found.")
|
|
1824
|
-
if(void 0===e.toolbar)for(var o in e.toolbar=[],
|
|
1825
|
-
e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=
|
|
1826
|
-
try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}
|
|
1824
|
+
if(void 0===e.toolbar)for(var o in e.toolbar=[],G)G.hasOwnProperty(o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(!0===G[o].default||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o))
|
|
1825
|
+
e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=U({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=U({},V,e.insertTexts||{}),e.promptTexts=$,e.blockStyles=U({},X,e.blockStyles||{}),e.shortcuts=U({},c,e.shortcuts||{}),null!=e.autosave&&null!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),this.options=e,this.render(),!e.initialValue||this.options.autosave&&!0===this.options.autosave.foundSavedValue||this.value(e.initialValue)}function Y(){if("object"!=typeof localStorage)return!1
|
|
1826
|
+
try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}K.prototype.markdown=function(e){},K.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e
|
|
1827
1827
|
var t,n,o=this.options,a=this,l={}
|
|
1828
|
-
for(var c in o.shortcuts)null!==o.shortcuts[c]&&null!==u[c]&&function(e){l[
|
|
1829
|
-
if(l.Enter="newlineAndIndentContinueMarkdownList",l.Tab="tabAndIndentMarkdownList",l["Shift-Tab"]="shiftTabAndUnindentMarkdownList",l.Esc=function(e){e.getOption("fullScreen")&&
|
|
1830
|
-
|
|
1828
|
+
for(var c in o.shortcuts)null!==o.shortcuts[c]&&null!==u[c]&&function(e){l[f(o.shortcuts[e])]=function(){u[e](a)}}(c)
|
|
1829
|
+
if(l.Enter="newlineAndIndentContinueMarkdownList",l.Tab="tabAndIndentMarkdownList",l["Shift-Tab"]="shiftTabAndUnindentMarkdownList",l.Esc=function(e){e.getOption("fullScreen")&&g(a)},s&&(l.Home="goLineLeftSmart",l.End="goLineRight"),document.addEventListener("keydown",(function(e){27==(e=e||window.event).keyCode&&a.codemirror.getOption("fullScreen")&&g(a)}),!1),!1!==o.spellChecker?(t="spell-checker",(n=o.parsingConfig).name="gfm",n.gitHubSpice=!1,i({codeMirrorInstance:r})):((t=o.parsingConfig).name="gfm",t.gitHubSpice=!1),this.codemirror=r.fromTextArea(e,{mode:t,backdrop:n,theme:"paper",tabSize:null!=o.tabSize?o.tabSize:2,indentUnit:null!=o.tabSize?o.tabSize:2,indentWithTabs:!1!==o.indentWithTabs,lineNumbers:!1,autofocus:!0===o.autofocus,extraKeys:l,lineWrapping:!1!==o.lineWrapping,allowDropFileTypes:["text/plain"],placeholder:o.placeholder||e.getAttribute("placeholder")||"",styleSelectedText:null==o.styleSelectedText||o.styleSelectedText}),!0===o.forceSync){var d=this.codemirror
|
|
1830
|
+
d.on("change",(function(){d.save()}))}this.gui={},!1!==o.toolbar&&(this.gui.toolbar=this.createToolbar()),!1!==o.status&&(this.gui.statusbar=this.createStatusbar()),null!=o.autosave&&!0===o.autosave.enabled&&this.autosave(),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element
|
|
1831
1831
|
var h=this.codemirror
|
|
1832
|
-
setTimeout(function(){h.refresh()}.bind(h),0)}},
|
|
1832
|
+
setTimeout(function(){h.refresh()}.bind(h),0)}},K.prototype.autosave=function(){if(Y()){var e=this
|
|
1833
1833
|
if(null==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to use the autosave feature")
|
|
1834
1834
|
null!=e.element.form&&null!=e.element.form&&e.element.form.addEventListener("submit",(function(){localStorage.removeItem("smde_"+e.options.autosave.uniqueId)})),!0!==this.options.autosave.loaded&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0),localStorage.setItem("smde_"+this.options.autosave.uniqueId,e.value())
|
|
1835
1835
|
var t=document.getElementById("autosaved")
|
|
1836
1836
|
if(null!=t&&null!=t&&""!=t){var n=new Date,r=n.getHours(),i=n.getMinutes(),o="am",a=r
|
|
1837
|
-
a>=12&&(a=r-12,o="pm"),0==a&&(a=12),i=i<10?"0"+i:i,t.innerHTML="Autosaved: "+a+":"+i+" "+o}this.autosaveTimeoutId=setTimeout((function(){e.autosave()}),this.options.autosave.delay||1e4)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},
|
|
1838
|
-
localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},
|
|
1837
|
+
a>=12&&(a=r-12,o="pm"),0==a&&(a=12),i=i<10?"0"+i:i,t.innerHTML="Autosaved: "+a+":"+i+" "+o}this.autosaveTimeoutId=setTimeout((function(){e.autosave()}),this.options.autosave.delay||1e4)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},K.prototype.clearAutosavedValue=function(){if(Y()){if(null==this.options.autosave||null==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to clear the autosave value")
|
|
1838
|
+
localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},K.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling
|
|
1839
1839
|
n&&/editor-preview-side/.test(n.className)||((n=document.createElement("div")).className="editor-preview-side",t.parentNode.insertBefore(n,t.nextSibling))
|
|
1840
1840
|
var r=!1,i=!1
|
|
1841
1841
|
return e.on("scroll",(function(e){if(r)r=!1
|
|
@@ -1844,31 +1844,31 @@ var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,o=parseFloat(e.get
|
|
|
1844
1844
|
n.scrollTop=a}})),n.onscroll=function(){if(i)i=!1
|
|
1845
1845
|
else{r=!0
|
|
1846
1846
|
var t=n.scrollHeight-n.clientHeight,o=parseFloat(n.scrollTop)/t,a=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*o
|
|
1847
|
-
e.scrollTo(0,a)}},n},
|
|
1848
|
-
for(t=0;t<e.length;t++)null!=
|
|
1847
|
+
e.scrollTo(0,a)}},n},K.prototype.createToolbar=function(e){if((e=e||this.options.toolbar)&&0!==e.length){var t
|
|
1848
|
+
for(t=0;t<e.length;t++)null!=G[e[t]]&&(e[t]=G[e[t]])
|
|
1849
1849
|
var n=document.createElement("div")
|
|
1850
1850
|
n.className="editor-toolbar"
|
|
1851
1851
|
var r,i,o=this,a={}
|
|
1852
1852
|
for(o.toolbar=e,t=0;t<e.length;t++)if(("guide"!=e[t].name||!1!==o.options.toolbarGuideIcon)&&!(o.options.hideIcons&&-1!=o.options.hideIcons.indexOf(e[t].name)||("fullscreen"==e[t].name||"side-by-side"==e[t].name)&&(r=void 0,i=void 0,i=!1,r=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(r)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(r.substr(0,4)))&&(i=!0),i))){if("|"===e[t]){for(var l=!1,s=t+1;s<e.length;s++)"|"===e[s]||o.options.hideIcons&&-1!=o.options.hideIcons.indexOf(e[s].name)||(l=!0)
|
|
1853
1853
|
if(!l)continue}!function(e){var t
|
|
1854
|
-
t="|"===e?
|
|
1854
|
+
t="|"===e?h():d(e,o.options.toolbarTips,o.options.shortcuts),e.action&&("function"==typeof e.action?t.onclick=function(t){t.preventDefault(),e.action(o)}:"string"==typeof e.action&&(t.href=e.action,t.target="_blank")),a[e.name||e]=t,n.appendChild(t)}(e[t])}o.toolbarElements=a
|
|
1855
1855
|
var u=this.codemirror
|
|
1856
|
-
u.on("cursorActivity",(function(){var e=
|
|
1856
|
+
u.on("cursorActivity",(function(){var e=p(u)
|
|
1857
1857
|
for(var t in a)!function(t){var n=a[t]
|
|
1858
1858
|
e[t]?n.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&"spellcheck"!=t&&"hemmingway"!=t&&(n.className=n.className.replace(/\s*active\s*/g,""))}(t)}))
|
|
1859
1859
|
var c=u.getWrapperElement()
|
|
1860
|
-
return c.parentNode.insertBefore(n,c),n}},
|
|
1860
|
+
return c.parentNode.insertBefore(n,c),n}},K.prototype.createStatusbar=function(e){e=e||this.options.status
|
|
1861
1861
|
var t=this.options,n=this.codemirror
|
|
1862
1862
|
if(e&&0!==e.length){var r,i,o,a=[]
|
|
1863
1863
|
for(r=0;r<e.length;r++)if(i=void 0,o=void 0,"object"==typeof e[r])a.push({className:e[r].className,defaultValue:e[r].defaultValue,onUpdate:e[r].onUpdate})
|
|
1864
1864
|
else{var l=e[r]
|
|
1865
|
-
"words"===l?(o=function(e){e.innerHTML=
|
|
1865
|
+
"words"===l?(o=function(e){e.innerHTML=q(n.getValue())},i=function(e){e.innerHTML=q(n.getValue())}):"lines"===l?(o=function(e){e.innerHTML=n.lineCount()},i=function(e){e.innerHTML=n.lineCount()}):"cursor"===l?(o=function(e){e.innerHTML="0:0"},i=function(e){var t=n.getCursor()
|
|
1866
1866
|
e.innerHTML=t.line+":"+t.ch}):"autosave"===l&&(o=function(e){null!=t.autosave&&!0===t.autosave.enabled&&e.setAttribute("id","autosaved")}),a.push({className:l,defaultValue:o,onUpdate:i})}var s=document.createElement("div")
|
|
1867
1867
|
for(s.className="editor-statusbar",r=0;r<a.length;r++){var u=a[r],c=document.createElement("span")
|
|
1868
1868
|
c.className=u.className,"function"==typeof u.defaultValue&&u.defaultValue(c),"function"==typeof u.onUpdate&&this.codemirror.on("update",function(e,t){return function(){t.onUpdate(e)}}(c,u)),s.appendChild(c)}var f=this.codemirror.getWrapperElement()
|
|
1869
|
-
return f.parentNode.insertBefore(s,f.nextSibling),s}},
|
|
1870
|
-
return/editor-preview-active/.test(e.className)},
|
|
1871
|
-
return/editor-preview-active-side/.test(e.className)},
|
|
1872
|
-
t.parentNode&&(this.gui.toolbar&&t.parentNode.removeChild(this.gui.toolbar),this.gui.statusbar&&t.parentNode.removeChild(this.gui.statusbar),this.gui.sideBySide&&t.parentNode.removeChild(this.gui.sideBySide)),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},t.exports=
|
|
1869
|
+
return f.parentNode.insertBefore(s,f.nextSibling),s}},K.prototype.value=function(e){return void 0===e?this.codemirror.getValue():(this.codemirror.getDoc().setValue(e),this)},K.toggleBold=v,K.toggleItalic=y,K.toggleStrikethrough=x,K.toggleBlockquote=w,K.toggleHeadingSmaller=C,K.toggleHeadingBigger=k,K.toggleHeading1=S,K.toggleHeading2=L,K.toggleHeading3=T,K.toggleCodeBlock=b,K.toggleUnorderedList=M,K.toggleOrderedList=A,K.cleanBlock=N,K.drawLink=E,K.drawImage=D,K.drawTable=F,K.drawHorizontalRule=O,K.undo=I,K.redo=B,K.togglePreview=W,K.toggleSideBySide=H,K.toggleFullScreen=g,K.prototype.toggleBold=function(){v(this)},K.prototype.toggleItalic=function(){y(this)},K.prototype.toggleStrikethrough=function(){x(this)},K.prototype.toggleBlockquote=function(){w(this)},K.prototype.toggleHeadingSmaller=function(){C(this)},K.prototype.toggleHeadingBigger=function(){k(this)},K.prototype.toggleHeading1=function(){S(this)},K.prototype.toggleHeading2=function(){L(this)},K.prototype.toggleHeading3=function(){T(this)},K.prototype.toggleCodeBlock=function(){b(this)},K.prototype.toggleUnorderedList=function(){M(this)},K.prototype.toggleOrderedList=function(){A(this)},K.prototype.cleanBlock=function(){N(this)},K.prototype.drawLink=function(){E(this)},K.prototype.drawImage=function(){D(this)},K.prototype.drawTable=function(){F(this)},K.prototype.drawHorizontalRule=function(){O(this)},K.prototype.undo=function(){I(this)},K.prototype.redo=function(){B(this)},K.prototype.togglePreview=function(){W(this)},K.prototype.toggleSideBySide=function(){H(this)},K.prototype.toggleFullScreen=function(){g(this)},K.prototype.isPreviewActive=function(){var e=this.codemirror.getWrapperElement().lastChild
|
|
1870
|
+
return/editor-preview-active/.test(e.className)},K.prototype.isSideBySideActive=function(){var e=this.codemirror.getWrapperElement().nextSibling
|
|
1871
|
+
return/editor-preview-active-side/.test(e.className)},K.prototype.isFullscreenActive=function(){return this.codemirror.getOption("fullScreen")},K.prototype.getState=function(){return p(this.codemirror)},K.prototype.toTextArea=function(){var e=this.codemirror,t=e.getWrapperElement()
|
|
1872
|
+
t.parentNode&&(this.gui.toolbar&&t.parentNode.removeChild(this.gui.toolbar),this.gui.statusbar&&t.parentNode.removeChild(this.gui.statusbar),this.gui.sideBySide&&t.parentNode.removeChild(this.gui.sideBySide)),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},t.exports=K},{"./codemirror/tablist":17,codemirror:10,"codemirror-spell-checker":4,"codemirror/addon/display/fullscreen.js":5,"codemirror/addon/display/placeholder.js":6,"codemirror/addon/edit/continuelist.js":7,"codemirror/addon/mode/overlay.js":8,"codemirror/addon/selection/mark-selection.js":9,"codemirror/mode/gfm/gfm.js":11,"codemirror/mode/markdown/markdown.js":12,"codemirror/mode/xml/xml.js":14}]},{},[18])(18)}))
|
|
1873
1873
|
|
|
1874
|
-
//# sourceMappingURL=simplemde-
|
|
1874
|
+
//# sourceMappingURL=simplemde-d16ff9bcc5bf6ad4916fb0034a30adb1.map
|