PageSourceSearch

https://jotterpad.app/jotterpod3/assets/editor-legacy.51735b05.js

js jotterpad.app collected 2026-10-01 13:00:25 UTC 12,682 bytes, 19 lines download raw bytes

vendor: 2,965 bytes, lines 1-19
1
2/*!
3     ██╗ ██████╗ ████████╗████████╗███████╗██████╗ ██████╗  ██████╗ ██████╗
4     ██║██╔═══██╗╚══██╔══╝╚══██╔══╝██╔════╝██╔══██╗██╔══██╗██╔═══██╗██╔══██╗
5     ██║██║   ██║   ██║      ██║   █████╗  ██████╔╝██████╔╝██║   ██║██║  ██║
6██   ██║██║   ██║   ██║      ██║   ██╔══╝  ██╔══██╗██╔═══╝ ██║   ██║██║  ██║
7╚█████╔╝╚██████╔╝   ██║      ██║   ███████╗██║  ██║██║     ╚██████╔╝██████╔╝
8 ╚════╝  ╚═════╝    ╚═╝      ╚═╝   ╚══════╝╚═╝  ╚═╝╚═╝      ╚═════╝ ╚═════╝
9
10* Copyright © 2024 Two App Studio Pte. Ltd. - ALL RIGHTS RESERVED
11* Unauthorized copying of this file, via any medium is strictly prohibited
12* https://2appstudio.com
13*
14* JotterPod Version: 3.1.2
15* Built on: Thu Nov 21 2024 14:46:17 GMT+0800 (Singapore Standard Time)
16*/
17/* */
18  
19!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(o,r)}function n(e){return function(){var n=this,o=arguments;return new Promise((function(r,i){var a=e.apply(n,o);function s(e){t(a,r,i,s,c,"next",e)}function c(e){t(a,r,i,s,c,"throw",e)}s(void 0)}))}}function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}function i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=s(e);if(t){var r=s(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return a(this,n)}}function a(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}
19function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}System.register(["./preload-helper-legacy.a5ae5050.js","./generic-legacy.d7685b1e.js"],(function(e,t){"use strict";var a,s;return{setters:[function(e){a=e._},function(e){s=e.GenericCommands}],execute:function(){var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&r(e,t)}(v,e);var s,c,u,l,d,f,h=i(v);function v(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v),(n=h.call(this)).savedSelection=null,n.repeatCount=0,n.editor=e,n.callback=t,n}return s=v,c=[{key:"toggleDelay",value:function(e,t,n){var o=this;this.editor.view.composing?(this.editor.commands.blur(),setTimeout((function(){return o.toggle(e,t,n)}),200)):this.toggle(e,t,n)}},{key:"wrapText",value:function(e,t){var n=this.editor.view.state.selection,o=n.from,r=n.to;if(t){var i=this.editor.state.tr.insertText(t,r,r);this.editor.view.dispatch(i)}if(e){var a=this.editor.state.tr.insertText(e,o,o);this.editor.view.dispatch(a)}}},{key:"saveFocus",value:function(){var e=this.editor.state.selection,t=e.from,n=e.to;this.savedSelection={from:t,to:n}}},{key:"restoreAndRequestFocus",value:function(){this.savedSelection&&(this.editor.commands.setTextSelection(this.savedSelection),this.savedSelection=null),this.editor.chain().focus().scrollIntoView().run()}},{key:"requestFocus",value:function(){this.editor.commands.focus()}},{key:"requestFocusAt",value:function(e,t){this.editor.commands.focus(e,{scrollIntoView:t})}},{key:"scrollIntoView",value:function(){this.editor.commands.scrollIntoView()}},{key:"history",value:function(e){switch(e){case"undo":return void this.editor.commands.undo();case"redo":return void this.editor.commands.redo()}}},{key:"configureEditorLook",value:function(e,t,n,o,r){var i,a;this.callback.changeAccentColor(e),this.callback.changeTheme(t),this.callback.changeWantsBottom(o),this.callback.changeNightVision(n),r?null===(i=document.querySelector(".scroller"))||void 0===i||i.classList.add("showScroll"):null===(a=document.querySelector(".scroller"))||void 0===a||a.classList.remove("showScroll")}},{key:"configureEditorText",value:function(e,t,n,o,r,i){this.callback.changeFontFamily(e),this.callback.changeBaseFontSize(t),this.callback.changeFontSize(n),this.callback.changeLineHeight(o),this.callback.changeLineWidth(r),this.callback.changeLigatures(i)}},{key:"injectCssRules",value:function(e){this.callback.overrideStyleCss(e)}},{key:"injectLinkHead",value:function(e,t,n){this.callback.injectLinkHead(e,t,n)}},{key:"configureEditable",value:function(e){this.callback.changeEditable(e)}},{key:"configureScrollMode",value:function(e){this.callback.changeEditable(!0),this.callback.changeScrollMode(e)}},{key:"configureManuallyAdjustHeight",value:function(e,t){this.callback.changeManuallyAdjustHeight(e,t)}},{key:"configurePlaceholder",value:function(e,t){this.callback.changePlaceholder(e,t)}},{key:"requestSetupText",value:function(e){var t=this.sendToClientRequest("requestText");this.setupText(t||"",e)}},{key:"setupTextAsync",value:function(e,t){this.setupText(e,t)}},{key:"sendActiveStates",value:function(e){this.sendToClientObject("activeStates",e)}},{key:"sendHistoryStates",value:function(e,t){this.sendToClientBooleanBoolean("history","canUndo",e,"canRedo",t)}},{key:"sendLiftSinkStates",value:function(e,t){this.sendToClientBooleanBoolean("liftSink","canLift",e,"canSink",t)}},{key:"sendDirtyState",value:function(e){this.sendToClientBoolean("dirty","dirtyState",e)}},{key:"sendWordCharCount",value:function(e,t){this.sendToClientNumberNumber("wordCharCount","wordCount",t,"charCount",e)}},{key:"getSelectedText",value:function(){var e=this.editor.view.state.selection.content(),t="";return e&&(t=this.gatherText(e).trim()),t}},{key:"startFind",value:function(e,t,n){var o,r,i,a;return this.editor.commands.setSearchTerm(e,t,n),this.scrollToActiveSearchResult(),(null===(o=this.editor)||void 0===o||null===(r=o.storage)||void 0===r||null===(i=r.search)||void 0===i||null===(a=i.count)||void 0===a?void 0:a.value)||0}},{key:"findNext",value:function(){this.editor.commands.findNext(
19),this.scrollToActiveSearchResult()}},{key:"findPrev",value:function(){this.editor.commands.findPrev(),this.scrollToActiveSearchResult()}},{key:"endFind",value:function(){this.editor.commands.setSearchTerm("",!0,!1)}},{key:"replace",value:function(e,t){this.editor.commands.setReplaceTerm(e),t?this.editor.commands.replaceAll():this.editor.commands.replace()}},{key:"save",value:function(){this.callback.didSave()}},{key:"setContent",value:function(e){this.editor.chain().command((function(t){var n=t.tr;return t.commands.setContent(e),n.setMeta("addToHistory",!1),!0})).run()}},{key:"onPlaceholderButtonClicked",value:function(e){this.sendToClientStringString("open","what","placeholder","val",null!=e?e:"")}},{key:"nudge",value:function(){this.sendToClientString("trigger","what","nudge")}},{key:"handleMacCatalystBug",value:function(){var e,t,n,o=this;null!==(e=this.editor)&&void 0!==e&&null!==(t=e.options)&&void 0!==t&&null!==(n=t.editorProps)&&void 0!==n&&n.attributes?this.editor.options.editorProps.attributes.spellcheck="false":this.editor.options.editorProps.attributes={spellCheck:"false"},document.addEventListener("keydown",(function(e){var t=o.editor.state.selection.anchor;if(t<1&&("ArrowLeft"===e.key||"ArrowUp"===e.key)||t>=o.editor.state.doc.content.size-1&&("ArrowRight"===e.key||"ArrowDown"===e.key))e.preventDefault();else if(e.repeat&&e.key.startsWith("Arrow")){if(o.repeatCount<3)return e.preventDefault(),void o.repeatCount++;o.repeatCount=0}}),!1)}},{key:"testIO",value:(f=n(regeneratorRuntime.mark((function e(n){var o,r,i,s,c,u,l,d,f,h,v,m,y,p,k,b,g,x,w,S,T,C,j,P;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.editor.getHTML(),"html"!==n){e.next=15;break}return e.next=4,a((function(){return t.import("./html-legacy.1b5b63ff.js")}),void 0);case 4:return r=e.sent,i=r.convert,e.next=8,i(o);case 8:s=e.sent,c=s.value,window.save={render:o,output:c},this.setupText(c,"html"),e.next=66;break;case 15:if("md"!==n){e.next=29;break}return e.next=18,a((function(){return t.import("./md-legacy.f597f58a.js")}),void 0);case 18:return u=e.sent,l=u.convert,e.next=22,l(o);case 22:d=e.sent,f=d.value,window.save={render:o,output:f},this.setupText(f,"md"),e.next=66;break;case 29:if("fountain"!==n){e.next=42;break}return e.next=32,a((function(){return t.import("./FountainFormatter-legacy.ea8426f6.js")}),void 0);case 32:h=e.sent,v=h.FountainFormatter,m=new v,y=this.editor.storage.titlePageStorage.titlePage,p=m.format(o,y),window.save={render:o,output:p},this.setupText(p,"fountain"),e.next=66;break;case 42:if("fdx"!==n){e.next=55;break}return e.next=45,a((function(){return t.import("./FdxFormatter-legacy.3c9d2925.js")}),void 0);case 45:k=e.sent,b=k.FdxFormatter,g=new b,x=this.editor.storage.titlePageStorage.titlePage,w=g.format(o,x),window.save={render:o,output:w},this.setupText(w,"fdx"),e.next=66;break;case 55:if("latex"!==n){e.next=66;break}return e.next=58,a((function(){return t.import("./LatexFormatter-legacy.8af32b55.js")}),void 0);case 58:S=e.sent,T=S.LatexFormatter,C=new T,j=this.editor.storage.preambleStorage.preamble,P=C.format(o,j),window.save={render:o,output:P},this.setupText(P,"latex");case 66:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"undoTestIO",value:(d=n(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setupText((null===(t=window)||void 0===t||null===(n=t.save)||void 0===n?void 0:n.render)||"","html"),window.save=null;case 2:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"testText",value:(l=n(regeneratorRuntime.mark((function e(t){var n,o,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n="/",o="","book"===t?(n="/test/html/book.txt",o="html"):"md"===t?(n="/test/md/all.txt",o="md"):"fountain"===t?(n="/test/fountain/test.fountain",o="fountain"):"fountain2"===t?(n="/test/fountain/big_fish.fountain",o="fountain"):"brickandsteel"===t?(n="/test/fountain/brick-and-steel.fountain",o="fountain"):"fdx"===t?(n="/test/fdx/test.fdx",o="fdx"):"latex"===t?(n="/test/latex/test.tex",o="latex"):"space"===t?(n="/test/html/space.html",o="html"):["stageplay-us","stageplay-uk","screenplay-film","screenplay-tv","tv-tape-live-us-studio","tv-three-camera-us-sitcom","radio-drama-us","tv-taped-drama-bbc","tv-taped-sitcom-bbc","radio-drama-bbc-scene","radio-sitc
19om-bbc-cue","broadway-musical","dg-modern-musical"].includes(t)&&(n="/test/fountain/".concat(t,".fountain"),o="fountain"),!n||!o){e.next=12;break}return e.next=6,fetch(n);case 6:return r=e.sent,e.next=9,r.text();case 9:i=e.sent,this.setupText(i,o);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"scrollToActiveSearchResult",value:function(){var e;null===(e=document.querySelector(".search-result.active"))||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})}},{key:"gatherText",value:function(e){var t,n=this,o="";return e.content.forEach((function(e){e.text?o+=e.text:o+=n.gatherText(e)})),null!=e&&null!==(t=e.type)&&void 0!==t&&t.isBlock&&(o+="\n"),o}}],c&&o(s.prototype,c),u&&o(s,u),Object.defineProperty(s,"prototype",{writable:!1}),v}(s);e("EditorCommands",c)}}}))}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.