diff --git a/public/cache.manifest b/public/cache.manifest index cfabe26c..8eb56c89 100644 --- a/public/cache.manifest +++ b/public/cache.manifest @@ -1,5 +1,5 @@ CACHE MANIFEST -#Date Mon Apr 21 2014 17:31:32 +#Date Mon Apr 21 2014 18:45:42 CACHE: res/worker.js diff --git a/public/res-min/main.js b/public/res-min/main.js index af209d68..ca65e609 100644 --- a/public/res-min/main.js +++ b/public/res-min/main.js @@ -649,12 +649,12 @@ if(0===t.usedFootnotes.length)return e;e+='\n\n
\n\n'}),define("extensions/dialogManageSharing",["jquery","underscore","classes/Extension","text!html/dialogManageSharingLocation.html"],function(e,t,n,i){var r,o=new n("dialogManageSharing",'Button "Share"',!1,!0);o.onEventMgrCreated=function(e){r=e};var a,s,l,c,u=function(e){if(void 0===e||e===a){var n=t.reduce(a.publishLocations,function(e,n){return n.sharingLink&&(e+=t.template(i,{link:n.sharingLink,title:a.title})),e},"");s.innerHTML=n,r.onTweet(),l.toggleClass("hide",0===n.length),c.toggleClass("hide",0!==n.length)}};return o.onFileSelected=function(e){a=e,u(e)},o.onNewPublishSuccess=function(t,n){u(t),n.sharingLink&&(e(".modal").modal("hide"),e(".modal-manage-sharing").modal("show"))},o.onPublishRemoved=u,o.onReady=function(){var t=document.querySelector(".modal-manage-sharing");s=t.querySelector(".share-list"),l=e(t.querySelectorAll(".msg-share-list")),c=e(t.querySelectorAll(".msg-no-share"))},o}),function(){var e=this,t={},n=!1;"undefined"!=typeof module&&module.exports?(module.exports=t,e.toMarkdown=t,n=!0):e.toMarkdown=t,t.converter=function(e){e&&e.elements&&$.isArray(e.elements)&&(c=c.concat(e.elements)),this.makeMd=function(e,t){var r;if(n){var o=require("jsdom");o.env({html:e,scripts:["http://code.jquery.com/jquery-1.6.4.min.js"],done:function(n,r){"function"==typeof t&&t(i(e,r.$))}})}else r=i(e,$);return r}};var i=function(e,t){e=e.replace(/(\d+)\. /g,"$1\\. ");var n=t(""),i=n.html(e);i.find("*:not(pre, code)").contents().filter(function(){return 3===this.nodeType&&/^\s+$/.test(this.nodeValue)}).remove();for(var r=[],o=0,s=c.length;s>o;o++)r.push(c[o].selector);for(r=r.join(",");i.find(r).length;)for(var o=0,s=c.length;s>o;o++)$matches=i.find(c[o].selector+':not(:has("'+r+'"))'),$matches.each(function(e,n){var i=t(n);i.before(c[o].replacement(i.html(),i)).remove()});return a(i.html())},r=function(e){return e.replace(/^[\n\r\f]+|[\n\r\f]+$/g,"")},o=function(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')},a=function(e){return e=e.replace(/^[\t\r\n]+|[\t\r\n]+$/g,""),e=e.replace(/\n\s+\n/g,"\n\n"),e=e.replace(/\n{3,}/g,"\n\n"),e=o(e)},s=function(e){return e=r(e),e?"**"+e+"**":""},l=function(e){return e=r(e),e?"_"+e+"_":""},c=[{selector:"p",replacement:function(e){return e=$.trim(e),e?"\n\n"+e+"\n\n":""}},{selector:"br",replacement:function(){return"\n"}},{selector:"h1,h2,h3,h4,h5,h6",replacement:function(e,t){e=$.trim(e);for(var n=t.prop("nodeName").charAt(1),i="",r=0;n>r;r++)i+="#";return e?"\n\n"+i+" "+e+"\n\n":""}},{selector:"hr",replacement:function(){return"\n\n* * *\n\n"}},{selector:"a[href]",replacement:function(e,t){if(e){e=r(e);var n=t.attr("href"),i=t.attr("title")||"";return"["+e+"]("+n+(i?' "'+i+'"':"")+")"}return!1}},{selector:"b",replacement:s},{selector:"strong",replacement:s},{selector:"i",replacement:l},{selector:"em",replacement:l},{selector:"code",replacement:function(e){return e=r(e),e?"`"+e+"`":""}},{selector:"img",replacement:function(e,t){var n=t.attr("alt")||"",i=t.attr("src")||"",r=t.attr("title")||"";return"!["+n+"]("+i+(r?' "'+r+'"':"")+")"}},{selector:"pre",replacement:function(e){return/^\s*\`/.test(e)?(e=e.replace(/\`/g,"")," "+e.replace(/\n/g,"\n ")):""}},{selector:"li",replacement:function(e,t){e=e.replace(/^\s+|\s+$/,"").replace(/\n/gm,"\n ");var n="* ",i="",r=t.parent(),o=r.contents().filter(function(){return 1===this.nodeType&&"LI"===this.nodeName||3===this.nodeType}),a=o.index(t)+1;return n=r.is("ol")?a+". ":"* ",a==o.length&&(t.parents("li").length||(i="\n"),e=e.replace(/\s+$/,""),t.unwrap()),n+e+i+"\n"}},{selector:"blockquote",replacement:function(e){return e=e=$.trim(e).replace(/\n{3,}/g,"\n\n"),e=e.replace(/\n/g,"\n> "),"> "+e}}]}(),define("toMarkdown",["jquery"],function(e){return function(){var t;return t||e.toMarkdown}}(this)),define("extensions/dialogOpenHarddrive",["jquery","underscore","constants","utils","classes/Extension","toMarkdown"],function(e,t,n,i,r,o){function a(i){i.stopPropagation(),i.preventDefault();var r=(i.dataTransfer||i.target).files;e(".modal-import-harddrive-markdown, .modal-import-harddrive-html").modal("hide"),t.each(r,function(t){if(!e(i.target).is("#wmd-input *")||!t.name.match(/.(jpe?g|png|gif)$/i)){var r=new FileReader;r.onload=function(e){return function(t){var n=t.target.result;if(n.match(/\uFFFD/))return void p.onError(e.name+" is a binary file.");if(n=f?f(n):n,void 0===n)return void p.onError(e.name+" is not a valid HTML file.");var i=e.name,r=i.lastIndexOf(".");i=-1!==r?i.substring(0,r):i;var o=u.createFile(i,n);u.selectFile(o)}}(t);var o=t.slice(0,n.IMPORT_FILE_MAX_CONTENT_SIZE);r.readAsText(o)}})}function s(e){f=void 0,a(e)}function l(e){f=m,a(e)}function c(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy"}var u,d=new r("dialogOpenHarddrive",'Dialog "Open from"');d.onFileMgrCreated=function(e){u=e};var p;d.onEventMgrCreated=function(e){p=e};var f,h,m=function(e){return h.makeMd(e)};return d.onReady=function(){h=new o.converter,e("#input-file-import-harddrive-markdown").change(s),e("#dropzone-import-harddrive-markdown, #wmd-input").each(function(){this.addEventListener("dragover",c,!1),this.addEventListener("drop",s,!1)}),e("#input-file-import-harddrive-html").change(l),e("#dropzone-import-harddrive-html").each(function(){this.addEventListener("dragover",c,!1),this.addEventListener("drop",l,!1)}),e(".action-convert-html").click(function(e){var t=i.getInputTextValue("#input-convert-html",e);if(void 0!==t){if(t=h.makeMd(t),void 0===t)return void p.onError("Invalid HTML code.");var n=u.createFile(void 0,t);u.selectFile(n)}})},d}),define("extensions/documentTitle",["jquery","underscore","classes/Extension"],function(e,t,n){var i,r,o=new n("documentTitle","Document Title"),a=t.debounce(function(t){if(t===i){var n=i.title;document.title="StackEdit – "+n,r.html(i.composeTitle()),e(".file-title").text(n),e(".input-file-title").val(n)}},50);return o.onFileSelected=function(e){i=e,a(e)},o.onTitleChanged=a,o.onSyncExportSuccess=a,o.onSyncRemoved=a,o.onNewPublishSuccess=a,o.onPublishRemoved=a,o.onReady=a,o.onReady=function(){r=e(".file-title-navbar"),r.hover(function(){var e=r[0].scrollWidth-r.outerWidth();r.stop(!0,!0).animate({scrollLeft:e},15*e,"linear")},function(){r.stop(!0,!0).scrollLeft(0)}).click(function(){r.stop(!0,!0).scrollLeft(0)})},o}),function(e,t){function n(e,t,n){return e.addEventListener?void e.addEventListener(t,n,!1):void e.attachEvent("on"+t,n)}function i(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return E[e.which]?E[e.which]:T[e.which]?T[e.which]:String.fromCharCode(e.which).toLowerCase()}function r(e,t){return e.sort().join(",")===t.sort().join(",")}function o(e){e=e||{};var t,n=!1;for(t in N)e[t]?n=!0:N[t]=0;n||(A=!1)}function a(e,t,n,i,o,a){var s,l,c=[],u=n.type;if(!I[e])return[];for("keyup"==u&&f(e)&&(t=[e]),s=0;s95&&112>e||E.hasOwnProperty(e)&&(S[E[e]]=e)}return S}function g(e,t,n){return n||(n=m()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function v(e,t,n,r){function a(t){return function(){A=t,++N[e],h()}}function s(t){u(n,t,e),"keyup"!==r&&(L=i(t)),setTimeout(o,10)}N[e]=0;for(var l=0;lAllows toggling document with keyboard shortcuts.
\nShows notification messages in the bottom-right corner of the\n screen.
\nGenerates a table of contents when a [TOC] marker is found.
\nConverts email adresses in the form <email@example.com> into clickable links.
",t.onPagedownConfigure=function(e){e.getConverter().hooks.chain("postConversion",function(e){return e.replace(/<(mailto\:)?([^\s>]+@[^\s>]+\.\S+?)>/g,function(e,t,n){return''+n+""})})},t}),define("text!html/scrollSyncSettingsBlock.html",[],function(){return"Binds together editor and preview scrollbars.
\n\n Note: The mapping between Markdown and HTML is based on the\n position of the title elements (h1, h2...) in the page. Therefore if\n your document does not contain any title, the mapping will be linear and\n consequently less accurate.\n"}),define("extensions/scrollSync",["jquery","underscore","classes/Extension","text!html/scrollSyncSettingsBlock.html"],function(e,t,n,i){var r=new n("scrollSync","Scroll Sync",!0,!0);r.settingsBlock=i,e.easing.easeOutSine=function(e){return Math.cos((1-e)*Math.PI/2)};var o;r.onSectionsCreated=function(e){o=e};var a,s,l,c,u=!0,d=[],p=[],f=t.debounce(function(){if(u){d=[];var t,n,i=a.scrollTop();a.find(".wmd-input-section").each(function(){if(void 0===t)return void(t=0);var n=e(this.firstChild),r=n.position().top+i;d.push({startOffset:t,endOffset:r,height:r-t}),t=r}),n=a.prop("scrollHeight"),d.push({startOffset:t,endOffset:n,height:n-t}),p=[];var r,o=s.scrollTop();s.find(".wmd-preview-section").each(function(){if(void 0===r)return void(r=0);var t=e(this),n=t.position().top+o;p.push({startOffset:r,endOffset:n,height:n-r}),r=n}),n=s.prop("scrollHeight"),p.push({startOffset:r,endOffset:n,height:n-r}),l=-10,c=-10,y()}},500),h=!1,m=!1,g=!1,v=!1,b=e("
Adds a "Synchronize documents" button in the navigation bar.
\nAdds a "Document statistics" button over the preview.
\nAdds a "HTML code" button over the preview.
\nAdds a "Viewer" button over the preview.
',i.onCreatePreviewButton=function(){return n},i}),"undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,i=this;e(this).one(e.support.transition.end,function(){n=!0});var r=function(){n||e(i).trigger(e.support.transition.end)};return setTimeout(r,t),this},e(function(){e.support.transition=t()})}(jQuery),+function(e){var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function n(){o.trigger("closed.bs.alert").remove()}var i=e(this),r=i.attr("data-target");r||(r=i.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var o=e(r);t&&t.preventDefault(),o.length||(o=i.hasClass("alert")?i:i.parent()),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one(e.support.transition.end,n).emulateTransitionEnd(150):n())};var i=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var i=e(this),r=i.data("bs.alert");r||i.data("bs.alert",r=new n(this)),"string"==typeof t&&r[t].call(i)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=i,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}(jQuery),+function(e){var t=function(n,i){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,i)};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(e){var t="disabled",n=this.$element,i=n.is("input")?"val":"html",r=n.data();e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){"loadingText"==e?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons"]'),t=!0;if(e.length){var n=this.$element.find("input");"radio"===n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var i=e(this),r=i.data("bs.button"),o="object"==typeof n&&n;r||i.data("bs.button",r=new t(this,o)),"toggle"==n?r.toggle():n&&r.setState(n)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle"),t.preventDefault()})}(jQuery),+function(e){var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},t.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},t.prototype.to=function(t){var n=this,i=this.getActiveIndex();return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){n.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",e(this.$items[t]))},t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},t.prototype.next=function(){return this.sliding?void 0:this.slide("next")},t.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},t.prototype.slide=function(t,n){var i=this.$element.find(".item.active"),r=n||i[t](),o=this.interval,a="next"==t?"left":"right",s="next"==t?"first":"last",l=this;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[s]()}this.sliding=!0,o&&this.pause();var c=e.Event("slide.bs.carousel",{relatedTarget:r[0],direction:a});if(!r.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var t=e(l.$indicators.children()[l.getActiveIndex()]);t&&t.addClass("active")})),e.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(c),c.isDefaultPrevented())return;r.addClass(t),r[0].offsetWidth,i.addClass(a),r.addClass(a),i.one(e.support.transition.end,function(){r.removeClass([t,a].join(" ")).addClass("active"),i.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(c),c.isDefaultPrevented())return;i.removeClass("active"),r.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")}return o&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var i=e(this),r=i.data("bs.carousel"),o=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n),a="string"==typeof n?n:o.slide;r||i.data("bs.carousel",r=new t(this,o)),"number"==typeof n?r.to(n):a?r[a]():o.interval&&r.pause().cycle()})},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n,i=e(this),r=e(i.attr("data-target")||(n=i.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"")),o=e.extend({},r.data(),i.data()),a=i.attr("data-slide-to");a&&(o.interval=!1),r.carousel(o),(a=i.attr("data-slide-to"))&&r.data("bs.carousel").to(a),t.preventDefault()}),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var t=e(this);t.carousel(t.data())})})}(jQuery),+function(e){var t=function(n,i){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,i),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e=this.$element.hasClass("width");return e?"width":"height"},t.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t=e.Event("show.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.$parent&&this.$parent.find("> .panel > .in");if(n&&n.length){var i=n.data("bs.collapse");if(i&&i.transitioning)return;n.collapse("hide"),i||n.data("bs.collapse",null)}var r=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[r](0),this.transitioning=1;var o=function(){this.$element.removeClass("collapsing").addClass("in")[r]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse") };if(!e.support.transition)return o.call(this);var a=e.camelCase(["scroll",r].join("-"));this.$element.one(e.support.transition.end,e.proxy(o,this)).emulateTransitionEnd(350)[r](this.$element[0][a])}}},t.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return e.support.transition?void this.$element[n](0).one(e.support.transition.end,e.proxy(i,this)).emulateTransitionEnd(350):i.call(this)}}},t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var i=e(this),r=i.data("bs.collapse"),o=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n);r||i.data("bs.collapse",r=new t(this,o)),"string"==typeof n&&r[n]()})},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(t){var n,i=e(this),r=i.attr("data-target")||t.preventDefault()||(n=i.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""),o=e(r),a=o.data("bs.collapse"),s=a?"toggle":i.data(),l=i.attr("data-parent"),c=l&&e(l);a&&a.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+l+'"]').not(i).addClass("collapsed"),i[o.hasClass("in")?"addClass":"removeClass"]("collapsed")),o.collapse(s)})}(jQuery),+function(e){function t(){e(i).remove(),e(r).each(function(t){var i=n(e(this));i.hasClass("open")&&(i.trigger(t=e.Event("hide.bs.dropdown")),t.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown"))})}function n(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var i=n&&e(n);return i&&i.length?i:t.parent()}var i=".dropdown-backdrop",r="[data-toggle=dropdown]",o=function(t){e(t).on("click.bs.dropdown",this.toggle)};o.prototype.toggle=function(i){var r=e(this);if(!r.is(".disabled, :disabled")){var o=n(r),a=o.hasClass("open");if(t(),!a){if("ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&e('').insertAfter(e(this)).on("click",t),o.trigger(i=e.Event("show.bs.dropdown")),i.isDefaultPrevented())return;o.toggleClass("open").trigger("shown.bs.dropdown"),r.focus()}return!1}},o.prototype.keydown=function(t){if(/(38|40|27)/.test(t.keyCode)){var i=e(this);if(t.preventDefault(),t.stopPropagation(),!i.is(".disabled, :disabled")){var o=n(i),a=o.hasClass("open");if(!a||a&&27==t.keyCode)return 27==t.which&&o.find(r).focus(),i.click();var s=e("[role=menu] li:not(.divider):visible a",o);if(s.length){var l=s.index(s.filter(":focus"));38==t.keyCode&&l>0&&l--,40==t.keyCode&&lWhat's new?
","Please provide your feedback here and declare issues on GitHub... Thanks!
',''].join(""),placement:"bottom",onShown:function(){o.onTweet()}}]),e.has(n,"welcomeTour")||a.start(),t(".action-welcome-tour").click(function(){a.restart()})},a}),define("text!extensions/shortcutsDefaultMapping.settings",[],function(){return"{\n 'mod+b': bindPagedownButton('bold'),\n 'mod+i': bindPagedownButton('italic'),\n 'mod+l': bindPagedownButton('link'),\n 'mod+q': bindPagedownButton('quote'),\n 'mod+k': bindPagedownButton('code'),\n 'mod+g': bindPagedownButton('image'),\n 'mod+o': bindPagedownButton('olist'),\n 'mod+u': bindPagedownButton('ulist'),\n 'mod+h': bindPagedownButton('heading'),\n 'mod+r': bindPagedownButton('hr'),\n 'mod+z': bindPagedownButton('undo'),\n 'mod+y': bindPagedownButton('redo'),\n 'mod+shift+z': bindPagedownButton('redo'),\n 'mod+m': function(evt) {\n $('.button-open-discussion').click();\n evt.preventDefault();\n },\n '= = > space': function() {\n expand('==> ', '⇒ ');\n },\n '< = = space': function() {\n expand('<== ', '⇐ ');\n },\n 'S t a c k E d i t': function() {\n eventMgr.onMessage(\"You are stunned!!! Aren't you?\");\n }\n}\n"}),define("text!html/shortcutsSettingsBlock.html",[],function(){return'Maps keyboard shortcuts to JavaScript functions.
\nAllows users to implement their own extension.
\n0)return t.prev();break;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,r;if(!this.backdrop.overlayElementShown)return this.backdrop.overlayElementShown=!0,i=e(t),n=e(""),r=i.offset(),r.top=r.top,r.left=r.left,n.width(i.innerWidth()).height(i.innerHeight()).addClass("tour-step-background").offset(r),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.prototype._clearTimer=function(){return t.clearTimeout(this._timer),this._timer=null,this._duration=null},n}(),t.Tour=n}(jQuery,window),define("bootstrap-tour",["bootstrap"],function(e){return function(){var t;return t||e.Tour}}(this)),define("extensions/welcomeTour",["underscore","jquery","storage","classes/Extension","bootstrap-tour"],function(e,t,n,i,r){var o,a=new i("welcomeTour","Welcome tour",!1,!0);return a.onEventMgrCreated=function(e){o=e},a.onReady=function(){function i(e,n,i){var r=t(e).tooltip({html:!0,placement:i,trigger:"manual",title:n}).tooltip("show").addClass("info-tooltip");r.one("click",function(){r.tooltip("hide").removeClass("info-tooltip")}),setTimeout(function(){r.tooltip("hide").removeClass("info-tooltip")},2e4)}var a=new r({keyboard:!1,storage:{getItem:function(){},setItem:function(){},removeItem:function(){}},onEnd:function(){n.welcomeTour="done",i(".menu-panel .toggle-button *","Synchronize, publish and more...","right"),i(".document-panel .toggle-button *","Create and manage documents","left"),i(".extension-preview-buttons .btn-group:first","Need help with Markdown syntax?","left"),i(".layout-toggler-preview","Toggle preview","right")},template:['What's new?
","Please provide your feedback here and declare issues on GitHub... Thanks!
',''].join(""),placement:"bottom",onShown:function(){o.onTweet()}}]),e.has(n,"welcomeTour")||a.start(),t(".action-welcome-tour").click(function(){a.restart()})},a}),define("text!extensions/shortcutsDefaultMapping.settings",[],function(){return"{\n 'mod+b': bindPagedownButton('bold'),\n 'mod+i': bindPagedownButton('italic'),\n 'mod+l': bindPagedownButton('link'),\n 'mod+q': bindPagedownButton('quote'),\n 'mod+k': bindPagedownButton('code'),\n 'mod+g': bindPagedownButton('image'),\n 'mod+o': bindPagedownButton('olist'),\n 'mod+u': bindPagedownButton('ulist'),\n 'mod+h': bindPagedownButton('heading'),\n 'mod+r': bindPagedownButton('hr'),\n 'mod+z': bindPagedownButton('undo'),\n 'mod+y': bindPagedownButton('redo'),\n 'mod+shift+z': bindPagedownButton('redo'),\n 'mod+m': function(evt) {\n $('.button-open-discussion').click();\n evt.preventDefault();\n },\n '= = > space': function() {\n expand('==> ', '⇒ ');\n },\n '< = = space': function() {\n expand('<== ', '⇐ ');\n },\n 'S t a c k E d i t': function() {\n eventMgr.onMessage(\"You are stunned!!! Aren't you?\");\n }\n}\n"}),define("text!html/shortcutsSettingsBlock.html",[],function(){return'Maps keyboard shortcuts to JavaScript functions.
\nAllows users to implement their own extension.
\n=e.length?[i,r,o,s,u]:null}if(this.Diff_Timeout<=0)return null;var i=e.length>t.length?e:t,r=e.length>t.length?t:e;if(i.length<4||2*r.length'+c+"";break;case DIFF_EQUAL:t[a]=""+c+""}}return t.join("")},diff_match_patch.prototype.diff_text1=function(e){for(var t=[],n=0;n\n
\n
Insert Hyperlink
http://example.com/ "optional title"
',quote:"BlockquoteCtrl/Cmd+Q",quoteexample:"Blockquote",code:"Code Sample"),e=e.replace(/(\*|_)(?=\S)(.+?)(?=\S)\1/g,"$2")}};n.setOptions(r),M=new Markdown.Editor(n,void 0,{undoManager:i.undoMgr}),M.hooks.set("insertLinkDialog",function(t){return E.insertLinkCallback=t,a.resetModalInputs(),e(".modal-insert-link").modal(),!0}),M.hooks.set("insertImageDialog",function(t){return E.insertLinkCallback=t,E.catchModal?!0:(a.resetModalInputs(),e(".modal-insert-image").modal(),!0)}),c.onPagedownConfigure(M),M.hooks.chain("onPreviewRefresh",c.onAsyncPreview),M.run(),i.undoMgr.init(),e(".wmd-button-row li").addClass("btn btn-success").css("left",0).find("span").hide();var o=e(".wmd-button-group1");e("#wmd-bold-button").append(e('')).appendTo(o),e("#wmd-italic-button").append(e('')).appendTo(o),o=e(".wmd-button-group2"),e("#wmd-link-button").append(e('')).appendTo(o),e("#wmd-quote-button").append(e('')).appendTo(o),e("#wmd-code-button").append(e('')).appendTo(o),e("#wmd-image-button").append(e('')).appendTo(o),o=e(".wmd-button-group3"),e("#wmd-olist-button").append(e('')).appendTo(o),e("#wmd-ulist-button").append(e('')).appendTo(o),e("#wmd-heading-button").append(e('')).appendTo(o),e("#wmd-hr-button").append(e('')).appendTo(o),o=e(".wmd-button-group5"),e("#wmd-undo-button").append(e('')).appendTo(o),e("#wmd-redo-button").append(e('')).appendTo(o)},E.onReady=function(){document.body.className+=" "+l.editMode,document.body.innerHTML=window.viewerMode===!0?d:u,a.init(),e(window).on("offline",E.setOffline),e(window).on("online",b),navigator.onLine===!1&&E.setOffline(),e(document).mousemove(m).keypress(m),r.init(),i.init(),S=window.setInterval(function(){a.updateCurrentTime(),v(),(g()===!0||window.viewerMode===!0)&&(c.onPeriodicRun(),y())},1e3),c.onReady()},c.addListener("onReady",function(){function n(e){if(e=e||"default",u!=e){var t="less!themes/"+e;-1!==window.baseDir.indexOf("-min")&&(t="css!themes/"+e),requirejs.undef(t),require([t]),u=e}}function r(n,i){t.each(document.querySelectorAll(n),function(t){var n=e(t);n.tooltip({html:!0,container:n.parents(".modal-content"),placement:"right",trigger:"manual",title:i}).click(function(){var t=this;m&&m[0]===t||a.defer(function(){e(document).on("click.close-tooltip",function(){m&&m.tooltip("hide"),m=void 0,e(document).off("click.close-tooltip")}),m=e(t).tooltip("show")})})})}e(".modal").on("shown.bs.modal",function(){var t=e(this);setTimeout(function(){t.find(".btn:first").focus(),t.find("button:first").focus(),t.find("input:enabled:visible:first").focus()},50)}).on("hidden.bs.modal",function(){i.focus(),n(window.theme)}).keyup(function(t){13!=t.which||e(t.target).is("textarea")||e(this).find(".modal-footer a:last").click()}),e(".action-insert-link").click(function(t){var n=a.getInputTextValue(e("#input-insert-link"),t);void 0!==n&&(E.insertLinkCallback(n),E.insertLinkCallback=void 0)}),e(".action-insert-image").click(function(t){var n=a.getInputTextValue(e("#input-insert-image"),t);void 0!==n&&(E.insertLinkCallback(n),E.insertLinkCallback=void 0)}),e(".modal-insert-link, .modal-insert-image").on("hidden.bs.modal",function(){void 0!==E.insertLinkCallback&&(E.insertLinkCallback(null),E.insertLinkCallback=void 0)}),e(".action-load-settings").click(function(){x()}),e(".action-apply-settings").click(function(e){w(e),e.isPropagationStopped()||window.location.reload()}),e(".action-add-google-drive-account").click(function(){3!==l.gdriveMultiAccount&&(l.gdriveMultiAccount++,s.settings=JSON.stringify(l),window.location.reload())});var u=window.theme;L=e("#input-settings-theme"),L.on("change",function(){n(this.value)}),e(".action-import-docs-settings").click(function(){e("#input-file-import-docs-settings").click()});var d;e("#input-file-import-docs-settings").change(function(n){var i=(n.dataTransfer||n.target).files;e(".modal-settings").modal("hide"),t.each(i,function(t){var n=new FileReader;n.onload=function(t){return function(n){try{d=JSON.parse(n.target.result);var i=parseInt(d.version.match(/^v(\d+)$/)[1],10),r=parseInt(s.version.match(/^v(\d+)$/)[1],10);i>r?c.onError("Incompatible version. Please upgrade StackEdit."):e(".modal-import-docs-settings").modal("show")}catch(o){c.onError("Wrong format: "+t.name)}e("#input-file-import-docs-settings").val("")}}(t),n.readAsText(t)})}),e(".action-import-docs-settings-confirm").click(function(){s.clear();var e=/^file\.|^folder\.|^publish\.|^settings$|^sync\.|^google\.|^author\.|^themeV3$|^version$/;t.each(d,function(t,n){e.test(n)&&(s[n]=t)}),window.location.reload()}),e(".action-export-docs-settings").click(function(){a.saveAs(JSON.stringify(s),"StackEdit local storage.json")}),e(".action-default-settings").click(function(){s.removeItem("settings"),s.removeItem("theme"),l.dropboxFullAccess||s.removeItem("dropbox.lastChangeId"),window.location.reload()}),e(".action-app-reset").click(function(){s.clear(),window.location.reload()}),e(".action-reset-input").click(function(){a.resetModalInputs()});var m;if(r(".tooltip-lazy-rendering","Disable preview rendering while typing in order to offload CPU. Refresh preview after 500 ms of inactivity."),r(".tooltip-default-content",["Thanks for supporting StackEdit by adding a backlink in your documents!Ctrl/Cmd+K",codeexample:"enter code here",image:"Image Ctrl/Cmd+G",imagedescription:"enter image description here",imagedialog:"
Insert Image
http://example.com/images/diagram.jpg \"optional title\"
",olist:"Numbered List
Need free image hosting?Ctrl/Cmd+O",ulist:"Bulleted List
Ctrl/Cmd+U",litem:"List item",heading:"Heading
/
Ctrl/Cmd+H",headingexample:"Heading",hr:"Horizontal Rule
Ctrl/Cmd+R",undo:"Undo - Ctrl/Cmd+Z",redo:"Redo - Ctrl/Cmd+Y",help:"Markdown Editing Help"},v="http://",b="http://";Markdown.Editor=function(e,i,s){s=s||{},"function"==typeof s.handler&&(s={helpButton:s}),s.strings=s.strings||{},s.helpButton&&(s.strings.help=s.strings.help||s.helpButton.title);var l=function(e){return s.strings[e]||g[e]};i=i||"";var c=this.hooks=new Markdown.HookCollection;c.addNoop("onPreviewRefresh"),c.addNoop("postBlockquoteCreation"),c.addFalse("insertImageDialog"),c.addFalse("insertLinkDialog"),this.getConverter=function(){return e};var u,p,f=this;this.run=function(){if(!u){u=new t(i);var h,m=new a(c,l),g=new r(e,u,function(){c.onPreviewRefresh()});s.undoManager?(p=s.undoManager,p.onButtonStateChange=function(){h.setUndoRedoButtonStates()},h&&h.setUndoRedoButtonStates()):/\?noundo/.test(d.location.href)||(p=new n(function(){g.refresh(),h&&h.setUndoRedoButtonStates()},u),this.textOperation=function(e){p.setCommandMode(),e(),f.refreshPreview()}),h=new o(i,u,p,g,m,s.helpButton,l),h.setUndoRedoButtonStates();{f.refreshPreview=function(){g.refresh(!0)}}f.undoManager=p,f.uiManager=h}}},e.prototype.findTags=function(e,t){var n,i=this;e&&(n=l.extendRegExp(e,"","$"),this.before=this.before.replace(n,function(e){return i.startTag=i.startTag+e,""}),n=l.extendRegExp(e,"^",""),this.selection=this.selection.replace(n,function(e){return i.startTag=i.startTag+e,""})),t&&(n=l.extendRegExp(t,"","$"),this.selection=this.selection.replace(n,function(e){return i.endTag=e+i.endTag,""}),n=l.extendRegExp(t,"^",""),this.after=this.after.replace(n,function(e){return i.endTag=e+i.endTag,""}))},e.prototype.trimWhitespace=function(e){var t,n,i=this;e?t=n="":(t=function(e){return i.before+=e,""},n=function(e){return i.after=e+i.after,""}),this.selection=this.selection.replace(/^(\s*)/,t).replace(/(\s*)$/,n)},e.prototype.skipLines=function(e,t,n){void 0===e&&(e=1),void 0===t&&(t=1),e++,t++;var i,r;if(navigator.userAgent.match(/Chrome/)&&"X".match(/()./),this.selection=this.selection.replace(/(^\n*)/,""),this.startTag=this.startTag+p.$1,this.selection=this.selection.replace(/(\n*$)/,""),this.endTag=this.endTag+p.$1,this.startTag=this.startTag.replace(/(^\n*)/,""),this.before=this.before+p.$1,this.endTag=this.endTag.replace(/(\n*$)/,""),this.after=this.after+p.$1,this.before){for(i=r="";e--;)i+="\\n?",r+="\n";n&&(i="\\n*"),this.before=this.before.replace(new p(i+"$",""),r)}if(this.after){for(i=r="";t--;)i+="\\n?",r+="\n";n&&(i="\\n*"),this.after=this.after.replace(new p(i,""),r)}},l.isVisible=function(e){return window.getComputedStyle?"none"!==window.getComputedStyle(e,null).getPropertyValue("display"):e.currentStyle?"none"!==e.currentStyle.display:void 0},l.addEvent=function(e,t,n){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},l.removeEvent=function(e,t,n){e.detachEvent?e.detachEvent("on"+t,n):e.removeEventListener(t,n,!1)},l.fixEolChars=function(e){return e=e.replace(/\r\n/g,"\n"),e=e.replace(/\r/g,"\n")},l.extendRegExp=function(e,t,n){(null===t||void 0===t)&&(t=""),(null===n||void 0===n)&&(n="");var i,r=e.toString();return r=r.replace(/\/([gim]*)$/,function(e,t){return i=t,""}),r=r.replace(/(^\/|\/$)/g,""),r=t+r+n,new p(r,i)},c.getTop=function(e,t){var n=e.offsetTop;if(!t)for(;e=e.offsetParent;)n+=e.offsetTop;return n},c.getHeight=function(e){return e.offsetHeight||e.scrollHeight},c.getWidth=function(e){return e.offsetWidth||e.scrollWidth},c.getPageSize=function(){var e,t,n,i;self.innerHeight&&self.scrollMaxY?(e=d.body.scrollWidth,t=self.innerHeight+self.scrollMaxY):d.body.scrollHeight>d.body.offsetHeight?(e=d.body.scrollWidth,t=d.body.scrollHeight):(e=d.body.offsetWidth,t=d.body.offsetHeight),self.innerHeight?(n=self.innerWidth,i=self.innerHeight):d.documentElement&&d.documentElement.clientHeight?(n=d.documentElement.clientWidth,i=d.documentElement.clientHeight):d.body&&(n=d.body.clientWidth,i=d.body.clientHeight);var r=Math.max(e,n),o=Math.max(t,i);return[r,o,n,i]},u.createBackground=function(){var e=d.createElement("div"),t=e.style;e.className="wmd-prompt-background",t.position="absolute",t.top="0",t.zIndex="1000",m.isIE?t.filter="alpha(opacity=50)":t.opacity="0.5";var n=c.getPageSize();return t.height=n[1]+"px",m.isIE?(t.left=d.documentElement.scrollLeft,t.width=d.documentElement.clientWidth):(t.left="0",t.width="100%"),d.body.appendChild(e),e},u.prompt=function(e,t,n){var i,r;void 0===t&&(t="");var o=function(e){var t=e.charCode||e.keyCode;27===t&&a(!0)},a=function(e){l.removeEvent(d.body,"keydown",o);var t=r.value;return e?t=null:(t=t.replace(/^http:\/\/(https?|ftp):\/\//,"$1://"),/^(?:https?|ftp):\/\//.test(t)||(t="http://"+t)),i.parentNode.removeChild(i),n(t),!1},s=function(){i=d.createElement("div"),i.className="wmd-prompt-dialog",i.style.padding="10px;",i.style.position="fixed",i.style.width="400px",i.style.zIndex="1001";var n=d.createElement("div");n.innerHTML=e,n.style.padding="5px",i.appendChild(n);var s=d.createElement("form"),u=s.style;s.onsubmit=function(){return a(!1)},u.padding="0",u.margin="0",u.cssFloat="left",u.width="100%",u.textAlign="center",u.position="relative",i.appendChild(s),r=d.createElement("input"),r.type="text",r.value=t,u=r.style,u.display="block",u.width="80%",u.marginLeft=u.marginRight="auto",s.appendChild(r);var p=d.createElement("input");p.type="button",p.onclick=function(){return a(!1)},p.value="OK",u=p.style,u.margin="10px",u.display="inline",u.width="7em";var f=d.createElement("input");f.type="button",f.onclick=function(){return a(!0)},f.value="Cancel",u=f.style,u.margin="10px",u.display="inline",u.width="7em",s.appendChild(p),s.appendChild(f),l.addEvent(d.body,"keydown",o),i.style.top="50%",i.style.left="50%",i.style.display="block",m.isIE_5or6&&(i.style.position="absolute",i.style.top=d.documentElement.scrollTop+200+"px",i.style.left="50%"),d.body.appendChild(i),i.style.marginTop=-(c.getHeight(i)/2)+"px",i.style.marginLeft=-(c.getWidth(i)/2)+"px"};setTimeout(function(){s();var e=t.length;if(void 0!==r.selectionStart)r.selectionStart=0,r.selectionEnd=e;else if(r.createTextRange){var n=r.createTextRange();n.collapse(!1),n.moveStart("character",-e),n.moveEnd("character",e),n.select()}r.focus()},0)};var y=a.prototype;y.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",y.unwrap=function(e){var t=new p("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");e.selection=e.selection.replace(t,"$1 $2")},y.wrap=function(e,t){this.unwrap(e);var n=new p("(.{1,"+t+"})( +|$\\n?)","gm"),i=this;e.selection=e.selection.replace(n,function(e,t){return new p("^"+i.prefixes,"").test(e)?e:t+"\n"}),e.selection=e.selection.replace(/\s+$/,"")},y.doBold=function(e,t){return this.doBorI(e,t,2,this.getString("boldexample"))},y.doItalic=function(e,t){return this.doBorI(e,t,1,this.getString("italicexample"))},y.doBorI=function(e,t,n,i){e.trimWhitespace(),e.selection=e.selection.replace(/\n{2,}/g,"\n");var r=/(\**$)/.exec(e.before)[0],o=/(^\**)/.exec(e.after)[0],a=Math.min(r.length,o.length);if(a>=n&&(2!=a||1!=n))e.before=e.before.replace(p("[*]{"+n+"}$",""),""),e.after=e.after.replace(p("^[*]{"+n+"}",""),"");else if(!e.selection&&o){e.after=e.after.replace(/^([*_]*)/,""),e.before=e.before.replace(/(\s?)$/,"");var s=p.$1;e.before=e.before+o+s}else{e.selection||o||(e.selection=i);var l=1>=n?"*":"**";e.before=e.before+l,e.after=l+e.after}},y.stripLinkDefs=function(e,t){return e=e.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,function(e,n,i,r,o){return t[n]=e.replace(/\s*$/,""),r?(t[n]=e.replace(/["(](.+?)[")]$/,""),r+o):""})},y.addLinkDef=function(e,t){var n=0,i={};e.before=this.stripLinkDefs(e.before,i),e.selection=this.stripLinkDefs(e.selection,i),e.after=this.stripLinkDefs(e.after,i);var r="",o=/(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g,a=function(e){n++,e=e.replace(/^[ ]{0,3}\[(\d+)\]:/," ["+n+"]:"),r+="\n"+e},s=function(e,t,r,l,c,u){return r=r.replace(o,s),i[c]?(a(i[c]),t+r+l+n+u):e};e.before=e.before.replace(o,s),t?a(t):e.selection=e.selection.replace(o,s);var l=n;return e.after=e.after.replace(o,s),e.after&&(e.after=e.after.replace(/\n*$/,"")),e.after||(e.selection=e.selection.replace(/\n*$/,"")),e.after+="\n\n"+r,l},y.doLinkOrImage=function(e,t,n){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\(.*?\))?/);var i;if(!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var r=this,o=function(o){i.parentNode.removeChild(i),null!==o&&(e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1),e.startTag=n?"![":"[",e.endTag="]("+s(o)+")",e.selection||(e.selection=r.getString(n?"imagedescription":"linkdescription"))),t()};return i=u.createBackground(),n?this.hooks.insertImageDialog(o)||u.prompt(this.getString("imagedialog"),v,o):this.hooks.insertLinkDialog(o)||u.prompt(this.getString("linkdialog"),b,o),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},y.doAutoindent=function(e){var t=this,n=!1;e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),e.selection||/^[ \t]*(?:\n|$)/.test(e.after)||(e.after=e.after.replace(/^[^\n]*/,function(t){return e.selection=t,""}),n=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&t.doList&&t.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&t.doBlockquote&&t.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&t.doCode&&t.doCode(e),n&&(e.after=e.selection+e.after,e.selection="")},y.doBlockquote=function(e){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(t,n,i,r){return e.before+=n,e.after=r+e.after,i}),e.before=e.before.replace(/(>[ \t]*)$/,function(t,n){return e.selection=n+e.selection,""}),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var t,n="",i="";if(e.before){for(var r=e.before.replace(/\n$/,"").split("\n"),o=!1,a=0;a0,/^>/.test(t)?(s=!0,!o&&t.length>1&&(o=!0)):s=/^[ \t]*$/.test(t)?!0:o,s?n+=t+"\n":(i+=n+t,n="\n")}/(^|\n)>/.test(n)||(i+=n,n="")}e.startTag=n,e.before=i,e.after&&(e.after=e.after.replace(/^\n?/,"\n")),e.after=e.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(t){return e.endTag=t,""});var l=function(t){var n=t?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"})),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"}))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,h.lineLength-2),e.selection=e.selection.replace(/^/gm,"> "),l(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),l(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,function(t,n){return e.startTag+=n,""}))},y.doCode=function(e){var t=/\S[ ]*$/.test(e.before),n=/^[ ]*\S/.test(e.after);if(!n&&!t||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,function(t){return e.selection=t+e.selection,""});var i=1,r=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(i=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(r=0),e.skipLines(i,r),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm," "):e.before+=" ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag=" ",e.selection=this.getString("codeexample"))}else e.trimWhitespace(),e.findTags(/`/,/`/),e.startTag||e.endTag?e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag="":(e.startTag=e.endTag="`",e.selection||(e.selection=this.getString("codeexample")))},y.doList=function(e,t,n){var i=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,r=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,o="-",a=1,s=function(){var e;return n?(e=" "+a+". ",a++):e=" "+o+" ",e},l=function(e){return void 0===n&&(n=/^\s*\d/.test(e)),e=e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(){return s()})};if(e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),!e.before||/\n$/.test(e.before)||/^\n/.test(e.startTag)||(e.before+=e.startTag,e.startTag=""),e.startTag){var c=/\d+[.]/.test(e.startTag);if(e.startTag="",e.selection=e.selection.replace(/\n[ ]{4}/g,"\n"),this.unwrap(e),e.skipLines(),c&&(e.after=e.after.replace(r,l)),n==c)return}var u=1;e.before=e.before.replace(i,function(e){return/^\s*([*+-])/.test(e)&&(o=p.$1),u=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.selection||(e.selection=this.getString("litem"));var d=s(),f=1;e.after=e.after.replace(r,function(e){return f=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.trimWhitespace(!0),e.skipLines(u,f,!0),e.startTag=d;var m=d.replace(/./g," ");this.wrap(e,h.lineLength-m.length),e.selection=e.selection.replace(/\n/g,"\n"+m)},y.doHeading=function(e){if(e.selection=e.selection.replace(/\s+/g," "),e.selection=e.selection.replace(/(^\s+|\s+$)/g,""),!e.selection)return e.startTag="## ",e.selection=this.getString("headingexample"),void(e.endTag=" ##");var t=0;e.findTags(/#+[ ]*/,/[ ]*#+/),/#+/.test(e.startTag)&&(t=p.lastMatch.length),e.startTag=e.endTag="",e.findTags(null,/\s?(-+|=+)/),/=+/.test(e.endTag)&&(t=1),/-+/.test(e.endTag)&&(t=2),e.startTag=e.endTag="",e.skipLines(1,1);var n=0==t?2:t-1;if(n>0){var i=n>=2?"-":"=",r=e.selection.length;for(r>h.lineLength&&(r=h.lineLength),e.endTag="\n";r--;)e.endTag+=i}},y.doHorizontalRule=function(e){e.startTag="----------\n",e.selection="",e.skipLines(2,1,!0)}}(),define("pagedown",function(){}),define("core",["jquery","underscore","crel","editor","layout","constants","utils","storage","settings","eventMgr","text!html/bodyIndex.html","text!html/bodyViewer.html","text!html/settingsTemplateTooltip.html","text!html/settingsShortcutsExtensionTooltip.html","text!html/settingsUserCustomExtensionTooltip.html","storage","pagedown"],function(e,t,n,i,r,o,a,s,l,c,u,d,p,f,h){function m(){T=!0,k=!0;var e=a.currentTime;e>I+1e3&&(I=e,c.onUserActive())}function g(){return a.currentTime-I>o.USER_IDLE_THRESHOLD&&(k=!1),k&&_}function v(){if(T!==!1&&_!==!1){void 0===C&&(C=a.randomString(),s.frontWindowId=C);var t=s.frontWindowId;t!=C&&(_=!1,void 0!==S&&clearInterval(S),e(".modal").modal("hide"),e(".modal-non-unique").modal("show"),window.close())}}function b(){D===!0&&(D=!1,c.onOfflineChanged(!1))}function y(){D===!0&&navigator.onLine===!0&&N+o.CHECK_ONLINE_PERIOD $2