├── data ├── editor │ ├── EventEmitter.js │ ├── README │ ├── api.js │ ├── editor.css │ ├── index.html │ ├── medium-style-confirm │ │ ├── css │ │ │ ├── msc-style.css │ │ │ └── style.css │ │ └── js │ │ │ └── msc-script.js │ ├── sidebar.css │ ├── sidebar.js │ ├── tinymce.css │ ├── tinymce.js │ ├── tinymce │ │ ├── LICENSE.TXT │ │ ├── changelog.txt │ │ └── js │ │ │ └── tinymce │ │ │ ├── jquery.tinymce.min.js │ │ │ ├── langs │ │ │ └── readme.md │ │ │ ├── license.txt │ │ │ ├── plugins │ │ │ ├── advlist │ │ │ │ └── plugin.min.js │ │ │ ├── anchor │ │ │ │ └── plugin.min.js │ │ │ ├── autolink │ │ │ │ └── plugin.min.js │ │ │ ├── autoresize │ │ │ │ └── plugin.min.js │ │ │ ├── autosave │ │ │ │ └── plugin.min.js │ │ │ ├── bbcode │ │ │ │ └── plugin.min.js │ │ │ ├── charmap │ │ │ │ └── plugin.min.js │ │ │ ├── code │ │ │ │ └── plugin.min.js │ │ │ ├── codesample │ │ │ │ ├── css │ │ │ │ │ └── prism.css │ │ │ │ └── plugin.min.js │ │ │ ├── colorpicker │ │ │ │ └── plugin.min.js │ │ │ ├── contextmenu │ │ │ │ └── plugin.min.js │ │ │ ├── directionality │ │ │ │ └── plugin.min.js │ │ │ ├── emoticons │ │ │ │ ├── img │ │ │ │ │ ├── smiley-cool.gif │ │ │ │ │ ├── smiley-cry.gif │ │ │ │ │ ├── smiley-embarassed.gif │ │ │ │ │ ├── smiley-foot-in-mouth.gif │ │ │ │ │ ├── smiley-frown.gif │ │ │ │ │ ├── smiley-innocent.gif │ │ │ │ │ ├── smiley-kiss.gif │ │ │ │ │ ├── smiley-laughing.gif │ │ │ │ │ ├── smiley-money-mouth.gif │ │ │ │ │ ├── smiley-sealed.gif │ │ │ │ │ ├── smiley-smile.gif │ │ │ │ │ ├── smiley-surprised.gif │ │ │ │ │ ├── smiley-tongue-out.gif │ │ │ │ │ ├── smiley-undecided.gif │ │ │ │ │ ├── smiley-wink.gif │ │ │ │ │ └── smiley-yell.gif │ │ │ │ └── plugin.min.js │ │ │ ├── fullpage │ │ │ │ └── plugin.min.js │ │ │ ├── fullscreen │ │ │ │ └── plugin.min.js │ │ │ ├── help │ │ │ │ ├── img │ │ │ │ │ └── logo.png │ │ │ │ └── plugin.min.js │ │ │ ├── hr │ │ │ │ └── plugin.min.js │ │ │ ├── image │ │ │ │ └── plugin.min.js │ │ │ ├── imagetools │ │ │ │ └── plugin.min.js │ │ │ ├── importcss │ │ │ │ └── plugin.min.js │ │ │ ├── insertdatetime │ │ │ │ └── plugin.min.js │ │ │ ├── legacyoutput │ │ │ │ └── plugin.min.js │ │ │ ├── link │ │ │ │ └── plugin.min.js │ │ │ ├── lists │ │ │ │ └── plugin.min.js │ │ │ ├── media │ │ │ │ └── plugin.min.js │ │ │ ├── nonbreaking │ │ │ │ └── plugin.min.js │ │ │ ├── noneditable │ │ │ │ └── plugin.min.js │ │ │ ├── pagebreak │ │ │ │ └── plugin.min.js │ │ │ ├── paste │ │ │ │ └── plugin.min.js │ │ │ ├── preview │ │ │ │ └── plugin.min.js │ │ │ ├── print │ │ │ │ └── plugin.min.js │ │ │ ├── save │ │ │ │ └── plugin.min.js │ │ │ ├── searchreplace │ │ │ │ └── plugin.min.js │ │ │ ├── spellchecker │ │ │ │ └── plugin.min.js │ │ │ ├── tabfocus │ │ │ │ └── plugin.min.js │ │ │ ├── table │ │ │ │ └── plugin.min.js │ │ │ ├── template │ │ │ │ └── plugin.min.js │ │ │ ├── textcolor │ │ │ │ └── plugin.min.js │ │ │ ├── textpattern │ │ │ │ └── plugin.min.js │ │ │ ├── toc │ │ │ │ └── plugin.min.js │ │ │ ├── visualblocks │ │ │ │ ├── css │ │ │ │ │ └── visualblocks.css │ │ │ │ └── plugin.min.js │ │ │ ├── visualchars │ │ │ │ └── plugin.min.js │ │ │ └── wordcount │ │ │ │ └── plugin.min.js │ │ │ ├── skins │ │ │ └── lightgray │ │ │ │ ├── content.inline.min.css │ │ │ │ ├── content.min.css │ │ │ │ ├── content.mobile.min.css │ │ │ │ ├── fonts │ │ │ │ ├── tinymce-mobile.woff │ │ │ │ ├── tinymce-small.eot │ │ │ │ ├── tinymce-small.svg │ │ │ │ ├── tinymce-small.ttf │ │ │ │ ├── tinymce-small.woff │ │ │ │ ├── tinymce.eot │ │ │ │ ├── tinymce.svg │ │ │ │ ├── tinymce.ttf │ │ │ │ └── tinymce.woff │ │ │ │ ├── img │ │ │ │ ├── anchor.gif │ │ │ │ ├── loader.gif │ │ │ │ ├── object.gif │ │ │ │ └── trans.gif │ │ │ │ ├── skin.min.css │ │ │ │ └── skin.mobile.min.css │ │ │ ├── themes │ │ │ ├── inlite │ │ │ │ └── theme.min.js │ │ │ ├── mobile │ │ │ │ └── theme.min.js │ │ │ └── modern │ │ │ │ └── theme.min.js │ │ │ └── tinymce.min.js │ └── vanillatree │ │ ├── target.png │ │ ├── vanillatree-draggable.js │ │ ├── vanillatree.css │ │ └── vanillatree.js ├── icons │ ├── 128.png │ ├── 16.png │ ├── 256.png │ ├── 32.png │ ├── 48.png │ └── 64.png └── options │ ├── index.html │ └── index.js ├── manifest.json └── worker.js /data/editor/EventEmitter.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* 4 | var a = new EventEmitter({ 5 | 'log-event': { 6 | first: () => console.log('we have at least one "log-event" listener. do whatever is needed'), 7 | last: () => console.log('all event listeners of type "log-event" are destroyed. do whatever is needed.') 8 | } 9 | }); 10 | 11 | a.on('log-event', d => console.log('test with "ignore" condition', d)).ignore(d => d === 'ignore-me'); 12 | a.on('log-event', d => console.log('test with "if" condition' ,d)).if(d => d === 'ignore-me'); 13 | a.emit('log-event', 'this is a sample text'); 14 | a.emit('log-event', 'ignore-me'); 15 | 16 | */ 17 | var EventEmitter = function(process = {}, obj) { 18 | Object.assign(this, { 19 | callbacks: {}, 20 | ifs: {}, 21 | ignores: {}, 22 | onces: {}, 23 | process 24 | }, obj); 25 | }; 26 | EventEmitter.prototype.on = function(id, callback) { 27 | if (this.callbacks[id] === undefined || this.callbacks[id].length === 0) { 28 | // run constructor only once when there is at least one listener 29 | if (this.process[id] && this.process[id].first) { 30 | // console.log('first is called for', id); 31 | this.process[id].first(); 32 | } 33 | this.callbacks[id] = []; 34 | this.ifs[id] = []; 35 | this.ignores[id] = []; 36 | this.onces[id] = []; 37 | } 38 | const index = this.callbacks[id].push(callback) - 1; 39 | this.ignores[id][index] = null; 40 | this.ifs[id][index] = null; 41 | return { 42 | get id() { 43 | return index; 44 | }, 45 | ignore: fun => this.ignores[id][index] = fun, 46 | if: fun => this.ifs[id][index] = fun 47 | }; 48 | }; 49 | EventEmitter.prototype.once = function(id, callback) { 50 | const r = this.on(id, callback); 51 | this.onces[id][r.id] = true; 52 | return r; 53 | }; 54 | EventEmitter.prototype.off = function(id, callback) { 55 | const index = (this.callbacks[id] || []).indexOf(callback); 56 | if (index !== -1) { 57 | this.callbacks[id].splice(index, 1); 58 | this.ignores[id].splice(index, 1); 59 | this.ifs[id].splice(index, 1); 60 | this.onces[id].splice(index, 1); 61 | // run deconstructor once there is no other listener 62 | if (this.callbacks[id].length === 0 && this.process[id] && this.process[id].last) { 63 | // console.log('last is called for', id); 64 | this.process[id].last(); 65 | } 66 | } 67 | }; 68 | EventEmitter.prototype.emit = function(id, ...data) { 69 | const offs = []; 70 | const rtns = (this.callbacks[id] || []).map((c, i) => { 71 | const run = () => { 72 | if (this.onces[id][i]) { 73 | offs.push(c); 74 | } 75 | return c(...data); 76 | }; 77 | 78 | // ignore callback if it has ignore 79 | if (this.ignores[id][i]) { 80 | if (this.ignores[id][i](...data)) { 81 | return; 82 | } 83 | } 84 | if (this.ifs[id][i]) { 85 | if (this.ifs[id][i](...data)) { 86 | return run(); 87 | } 88 | } 89 | else { 90 | return run(); 91 | } 92 | }); 93 | offs.forEach(c => this.off(id, c)); 94 | 95 | return rtns; 96 | }; 97 | -------------------------------------------------------------------------------- /data/editor/README: -------------------------------------------------------------------------------- 1 | https://download.tiny.cloud/tinymce/community/tinymce_4.7.4.zip 2 | -------------------------------------------------------------------------------- /data/editor/api.js: -------------------------------------------------------------------------------- 1 | /* global editor */ 2 | 'use strict'; 3 | 4 | /* 5 | Events: note-selected 6 | 7 | */ 8 | const api = {}; 9 | 10 | // api.note.get() 11 | // api.note.add() 12 | // api.api.notebook.add() 13 | 14 | chrome.runtime.onMessage.addListener((request, sender, response) => { 15 | if (request.method === 'append-content') { 16 | response(true); 17 | 18 | editor.instance.insertContent(request.content); 19 | } 20 | else if (request.method === 'close') { 21 | window.close(); 22 | } 23 | }); 24 | 25 | // confirm 26 | api.user = { 27 | confirm: (title, description) => new Promise(resolve => window.mscConfirm(title, description, resolve)), 28 | alert: (title, description) => window.mscAlert(title, description) 29 | }; 30 | 31 | chrome.runtime.onMessage.addListener((request, sender, response) => { 32 | if (request.method === 'exists') { 33 | response(true); 34 | chrome.runtime.sendMessage({ 35 | method: 'bring-to-front' 36 | }); 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /data/editor/editor.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: 13px; 3 | font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; 4 | background-color: #fff; 5 | color: #4d5156; 6 | } 7 | #sidebar button, 8 | #sidebar input[type=submit], 9 | #sidebar input[type=button] { 10 | height: 24px; 11 | color: #444; 12 | background-image: linear-gradient(rgb(237, 237, 237), rgb(237, 237, 237) 38%, rgb(222, 222, 222)); 13 | box-shadow: rgba(0, 0, 0, 0.08) 0 1px 0, rgba(255, 255, 255, 0.75) 0 1px 2px inset; 14 | text-shadow: rgb(240, 240, 240) 0 1px 0; 15 | border: solid 1px rgba(0, 0, 0, 0.25); 16 | } 17 | #sidebar input[type=button]:disabled { 18 | opacity: 0.5; 19 | } 20 | [data-visible="false"] { 21 | display: none; 22 | } 23 | 24 | [hbox] { 25 | display: flex; 26 | flex-direction: row; 27 | } 28 | [vbox] { 29 | display: flex; 30 | flex-direction: column; 31 | } 32 | [flex="1"] { 33 | flex: 1; 34 | } 35 | [pack=center] { 36 | justify-content: center; 37 | } 38 | [pack=end] { 39 | justify-content: flex-end; 40 | } 41 | [align=center] { 42 | align-items: center; 43 | } 44 | [align=end] { 45 | align-items: flex-end; 46 | } 47 | -------------------------------------------------------------------------------- /data/editor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /data/editor/medium-style-confirm/css/msc-style.css: -------------------------------------------------------------------------------- 1 | @-webkit-keyframes scale-fade{ 2 | 0%{opacity:0;-webkit-transform:scale(.8) rotateX(-40deg);transform:scale(.8) rotateX(-40deg)} 3 | 50%{opacity:1}70%{-webkit-transform:scale(1.05) rotateX(0);transform:scale(1.05) rotateX(0)} 4 | 100%{-webkit-transform:scale(1) rotateX(0);transform:scale(1) rotateX(0)} 5 | } 6 | @keyframes scale-fade{ 7 | 0%{opacity:0;-webkit-transform:scale(.8) rotateX(-40deg);transform:scale(.8) rotateX(-40deg)} 8 | 50%{opacity:1}70%{-webkit-transform:scale(1.05) rotateX(0);transform:scale(1.05) rotateX(0)} 9 | 100%{-webkit-transform:scale(1) rotateX(0);transform:scale(1) rotateX(0)} 10 | } 11 | 12 | .msc-confirm--animate { 13 | -webkit-transform-origin: bottom center; 14 | -ms-transform-origin: bottom center; 15 | transform-origin: bottom center; 16 | -webkit-animation: scale-fade 300ms forwards cubic-bezier(.8, .02, .45, -1.09); 17 | animation: scale-fade 300ms forwards cubic-bezier(.8, .02, .45, .91); 18 | } 19 | 20 | .msc-confirm { 21 | display: none; 22 | color: #252525; 23 | -webkit-font-smoothing: antialiased; 24 | position: fixed; 25 | top: 0; 26 | left: 0; 27 | width: 100%; 28 | height: 100%; 29 | z-index: 3; 30 | } 31 | .msc-overlay { 32 | position: fixed; 33 | top: 0; 34 | height: 100%; 35 | width: 100%; 36 | opacity: 0.9; 37 | left: 0; 38 | background-color: rgba(0, 0, 0, 0.3); 39 | z-index: 20; 40 | } 41 | 42 | .msc-confirm button { 43 | background: none; 44 | border: none; 45 | cursor: pointer; 46 | transition: all 0.2s ease-in; 47 | } 48 | 49 | .msc-confirm button:focus { 50 | outline: none; 51 | } 52 | 53 | .msc-close { 54 | position: absolute; 55 | top: 0; 56 | right: 0; 57 | width: 40px; 58 | height: 40px; 59 | border-radius: 20px; 60 | font-size: 1.2em; 61 | text-align: center; 62 | vertical-align: middle; 63 | } 64 | .msc-close:hover { 65 | background: #eee; 66 | } 67 | 68 | .msc-content { 69 | position: relative; 70 | z-index: 21; 71 | background: #fff; 72 | opacity: 1.0; 73 | max-width: 480px; 74 | margin: 10% auto 10% auto; 75 | padding: 40px; 76 | text-align: center; 77 | } 78 | 79 | @media (max-width: 600px) { 80 | .msc-content { 81 | padding: 10px 0; 82 | } 83 | } 84 | 85 | .msc-title { 86 | font-size: 2em; 87 | margin: 0 0 0.1em 0; 88 | } 89 | .msc-body { 90 | font-size: 1.2em; 91 | margin-bottom: 1em; 92 | color: #666; 93 | } 94 | .msc-body p { 95 | margin: 0 0 10px 0; 96 | } 97 | 98 | .msc-input { 99 | box-sizing: border-box; 100 | width: 100%; 101 | height: 38px; 102 | font-size: 14px; 103 | text-align: center; 104 | letter-spacing: 0.02em; 105 | font-weight: 400; 106 | font-style: normal; 107 | font-family: "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif; 108 | border: none; 109 | border-bottom: 1px solid rgba(0,0,0,0.15); 110 | padding: 0 15px; 111 | } 112 | 113 | .msc-input:focus { 114 | outline: none; 115 | border-color: #0F985A; 116 | } 117 | 118 | 119 | .msc-action button { 120 | border: 1px solid #ccc; 121 | padding: 10px 20px; 122 | border-radius: 25px; 123 | min-width: 80px; 124 | background: #fff; 125 | } 126 | .msc-action button:focus { 127 | outline: none; 128 | } 129 | .msc-ok { 130 | margin-right: 10px; 131 | } 132 | button.msc-ok:hover, button.msc-ok:focus { 133 | border: 1px solid #0F985A; 134 | color: #0F985A; 135 | } 136 | button.msc-cancel:hover, button.msc-cancel:focus { 137 | border: 1px solid #111; 138 | color: #111; 139 | } 140 | 141 | .msc-sub{ 142 | white-space: pre-line; 143 | } 144 | 145 | -------------------------------------------------------------------------------- /data/editor/medium-style-confirm/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | a, a:visited { 6 | color: #08c; 7 | text-decoration: none; 8 | } 9 | header { 10 | box-sizing: border-box; 11 | width: 100%; 12 | padding: 10px; 13 | border-bottom: 1px solid #e5e5e5; 14 | } 15 | header h1, header h2 { 16 | display: inline-block; 17 | margin: 0; 18 | padding: 0; 19 | } 20 | header h2 { 21 | margin-left: 10px; 22 | } 23 | 24 | ul li { 25 | margin-bottom: 10px; 26 | } 27 | .content { 28 | max-width: 600px; 29 | margin: 0 auto; 30 | } 31 | code, pre { 32 | background: #F2F2F2; 33 | display: inline-block; 34 | padding: 2px 4px; 35 | font-size: 1.1em; 36 | } 37 | pre { 38 | width: 99%; 39 | overflow-x: scroll; 40 | } 41 | .msc-action button { 42 | background: #fff; 43 | cursor: pointer; 44 | } 45 | hr { 46 | border: 1px solid #e5e5e5; 47 | } 48 | .pull-right { 49 | float: right; 50 | } 51 | nav ul { 52 | list-style: none; 53 | margin: 0; 54 | padding: 0; 55 | } 56 | nav li { 57 | display: inline-block; 58 | margin: 0; 59 | padding-top: 5px; 60 | } -------------------------------------------------------------------------------- /data/editor/medium-style-confirm/js/msc-script.js: -------------------------------------------------------------------------------- 1 | (function (root, factory) { 2 | if (typeof define === 'function' && define.amd) { 3 | define([], factory); 4 | } else if (typeof module === 'object' && module.exports) { 5 | module.exports = factory(); 6 | } else { 7 | var expData = factory(); 8 | for(var key in expData) { 9 | if (expData.hasOwnProperty(key)) { 10 | root[key] = expData[key]; 11 | } 12 | } 13 | } 14 | }(this, function(){ 15 | function ce(tag, clas, txt) { 16 | var ele = document.createElement(tag); 17 | ele.setAttribute('class', clas); 18 | if(typeof txt === 'undefined' || txt === null){ 19 | return ele; 20 | } 21 | var tn = document.createTextNode(txt); 22 | ele.appendChild(tn); 23 | return ele; 24 | } 25 | var KEY_ESC = 27; 26 | var KEY_ENTER = 13; 27 | 28 | function buildUI(title, sub, onOk, onCancel, type) { 29 | if (typeof window === 'undefined') { 30 | throw 'Cannot use this in node.'; 31 | } 32 | var prev = document.getElementsByClassName('msc-confirm'); 33 | if(prev.length > 0){ 34 | document.body.removeChild(prev[0]); 35 | } 36 | 37 | var options = { 38 | title: 'Confirm', 39 | subtitle: '', 40 | onOk: null, 41 | onCancel: null, 42 | okText: 'OK', 43 | cancelText: 'Cancel', 44 | placeholder: 'Enter value', 45 | dismissOverlay: false, 46 | defaultValue: '' 47 | }; 48 | 49 | if(typeof title === 'object') { 50 | for(var key in title) { 51 | options[key] = title[key]; 52 | } 53 | if(typeof options.onOk !== 'function') { 54 | options.onOk = null; 55 | } 56 | if(typeof options.onCancel !== 'function') { 57 | options.onCancel = null; 58 | } 59 | } else { 60 | options.title = (typeof title === 'string') ? title : options.title; 61 | options.subtitle = (typeof sub === 'string') ? sub : options.subtitle; 62 | options.onOk = (typeof onOk === 'function') ? onOk : options.onOk; 63 | options.onCancel = (typeof onCancel === 'function') ? onCancel : options.onCancel; 64 | 65 | if(typeof sub === 'function') { 66 | options.onOk = sub; 67 | } 68 | } 69 | 70 | var dialog = ce('div', 'msc-confirm'), 71 | overlay = ce('div', 'msc-overlay'), 72 | closeBtn = ce('button', 'msc-close'); 73 | closeBtn.innerHTML = '×'; 74 | overlay.appendChild(closeBtn); 75 | 76 | if(options.dismissOverlay) { 77 | overlay.addEventListener("click", destroy); 78 | } 79 | 80 | closeBtn.addEventListener('click', destroy); 81 | 82 | var content = ce('div', 'msc-content'), 83 | cTitle = ce('h3', 'msc-title', options.title), 84 | body = ce('div', 'msc-body'), 85 | action = ce('div', 'msc-action'), 86 | okBtn = ce('button', 'msc-ok', options.okText), 87 | cancelbtn = ce('button', 'msc-cancel', options.cancelText), 88 | input = ce('input', 'msc-input'); 89 | 90 | body.appendChild(ce('p','msc-sub', options.subtitle)); 91 | 92 | action.appendChild(okBtn); 93 | if(type !== "alert") { 94 | action.appendChild(cancelbtn); 95 | cancelbtn.addEventListener('click', cancel); 96 | } 97 | 98 | okBtn.addEventListener('click', ok); 99 | 100 | content.appendChild(cTitle); 101 | content.appendChild(body); 102 | content.appendChild(action); 103 | 104 | dialog.appendChild(overlay); 105 | dialog.appendChild(content); 106 | document.body.appendChild(dialog); 107 | dialog.style.display = 'block'; 108 | content.classList.add('msc-confirm--animate'); 109 | if(type === "prompt") { 110 | input.setAttribute("type", "text"); 111 | input.setAttribute("placeholder", options.placeholder); 112 | input.value = options.defaultValue; 113 | input.addEventListener("keyup", function(e) { 114 | if(e.keyCode === KEY_ENTER) { 115 | ok(); 116 | } 117 | }); 118 | body.appendChild(input); 119 | input.focus(); 120 | }else if(type==="alert") { 121 | okBtn.focus(); 122 | }else { 123 | cancelbtn.focus(); 124 | } 125 | 126 | document.addEventListener('keyup', _hide); 127 | 128 | function destroy() { 129 | closeBtn.removeEventListener('click', destroy); 130 | okBtn.removeEventListener('click', ok); 131 | cancelbtn.removeEventListener('click', cancel); 132 | if(options.dismissOverlay) { 133 | overlay.removeEventListener("click", destroy); 134 | } 135 | document.removeEventListener('keyup', _hide); 136 | document.body.removeChild(dialog); 137 | } 138 | 139 | function ok() { 140 | destroy(); 141 | if(options.onOk !== null) { 142 | if(type === "prompt") { 143 | options.onOk(input.value); 144 | }else { 145 | options.onOk(); 146 | } 147 | } 148 | } 149 | 150 | function cancel() { 151 | destroy(); 152 | if(options.onCancel !== null) { 153 | options.onCancel(); 154 | } 155 | } 156 | 157 | function _hide(e) { 158 | if(e.keyCode == 27) { 159 | destroy(); 160 | } 161 | } 162 | }; 163 | var exportData = { 164 | mscConfirm: function(title, sub, onOk, onCancel) { 165 | buildUI(title, sub, onOk, onCancel, "confirm"); 166 | }, 167 | mscPrompt: function(title, sub, onOk, onCancel) { 168 | buildUI(title, sub, onOk, onCancel, "prompt"); 169 | }, 170 | mscAlert: function(title, sub, onOk, onCancel) { 171 | buildUI(title, sub, onOk, onCancel, "alert"); 172 | }, 173 | mscClose: function() { 174 | var prev = document.getElementsByClassName('msc-confirm'); 175 | if(prev.length > 0){ 176 | document.body.removeChild(prev[0]); 177 | } 178 | } 179 | }; 180 | return exportData; 181 | })); 182 | -------------------------------------------------------------------------------- /data/editor/sidebar.css: -------------------------------------------------------------------------------- 1 | #sidebar-button { 2 | cursor: pointer; 3 | position: absolute; 4 | right: 0; 5 | top: 0; 6 | z-index: 2; 7 | padding: 0 5px; 8 | } 9 | #sidebar-button * { 10 | pointer-events: none; 11 | } 12 | #sidebar-button:hover { 13 | background-color: rgba(0, 0, 0, 0.1); 14 | } 15 | #sidebar { 16 | position: absolute; 17 | right: 0; 18 | top: 0; 19 | height: 100%; 20 | width: 300px; 21 | background-color: #fff; 22 | transition-property: transform, opacity; 23 | opacity: 0; 24 | transform: translateX(100%); 25 | z-index: 3; 26 | box-shadow: 0 0 10px #ccc; 27 | } 28 | body[data-ready=true] #sidebar { 29 | transition: all 300ms ease; 30 | } 31 | #sidebar[data-open=true] { 32 | transform: translateX(0); 33 | opacity: 1; 34 | } 35 | #sidebar ul { 36 | margin: 0; 37 | padding: 0; 38 | } 39 | 40 | #sidebar #tree { 41 | overflow: auto; 42 | padding: 0 10px; 43 | user-select: none; 44 | } 45 | #sidebar #tree [data-vtree-id^=notebook-] > a { 46 | color: #8995a8; 47 | } 48 | #sidebar [data-id=details] { 49 | background-color: #f4f4f4; 50 | } 51 | #sidebar [data-id=details] form { 52 | gap: 5px; 53 | height: 64px; 54 | padding: 0 10px; 55 | } 56 | 57 | #sidebar [data-id=name] { 58 | padding: 0 3px; 59 | height: 24px; 60 | outline: none; 61 | } 62 | 63 | #sidebar input:disabled { 64 | opacity: 0.5; 65 | } 66 | 67 | /* drag and drop */ 68 | #sidebar a.dragged::before { 69 | content: '........'; 70 | } 71 | 72 | #sidebar [data-id=toolbox] { 73 | gap: 5px; 74 | height: 64px; 75 | background-color: #f4f4f4; 76 | } 77 | -------------------------------------------------------------------------------- /data/editor/sidebar.js: -------------------------------------------------------------------------------- 1 | /* globals VanillaTree, editor, EventEmitter, api */ 2 | 'use strict'; 3 | 4 | const sidebar = new EventEmitter(); 5 | sidebar.selected = {}; 6 | 7 | // open and close 8 | { 9 | const element = document.getElementById('sidebar'); 10 | // theme 11 | if (localStorage.getItem('skin') === 'charcoal') { 12 | document.getElementById('sidebar-button').style.color = '#b5b9bf'; 13 | } 14 | // open 15 | document.getElementById('sidebar-button').addEventListener('click', () => { 16 | element.dataset.open = true; 17 | sidebar.emit('open', true); 18 | }); 19 | // close 20 | document.addEventListener('DOMContentLoaded', () => { 21 | editor.on('click', () => { 22 | if (element.dataset.open === 'true') { 23 | element.dataset.open = false; 24 | sidebar.emit('open', false); 25 | } 26 | }); 27 | }); 28 | sidebar.on('toggle', () => { 29 | const bol = element.dataset.open === 'false'; 30 | element.dataset.open = bol; 31 | sidebar.emit('open', bol); 32 | }); 33 | document.addEventListener('keydown', ({ctrlKey, altKey, code}) => { 34 | if (code === 'Escape' || (ctrlKey && altKey && code === 'KeyS')) { 35 | const bol = code === 'Escape' ? false : element.dataset.open === 'false'; 36 | element.dataset.open = bol; 37 | sidebar.emit('open', bol); 38 | } 39 | }); 40 | // focus editor 41 | sidebar.on('open', () => editor.instance.focus()).if(b => b === false); 42 | } 43 | // content 44 | const tree = new VanillaTree('#tree', { 45 | placeholder: 'to prevent losing your content, create a new note right now.' 46 | }); 47 | sidebar.root = tree.tree; 48 | 49 | sidebar.notes = () => new Promise(resolve => chrome.storage.local.get({ 50 | selected: 'note--1', 51 | headers: [{ 52 | name: 'First note', 53 | id: 'note--1', 54 | selected: true 55 | }] 56 | }, ({headers, selected}) => resolve(headers.map(h => { 57 | h.selected = h.id === selected; 58 | return h; 59 | })))); 60 | 61 | sidebar.save = (...changes) => sidebar.notes().then(headers => { 62 | // update existing headers 63 | headers = headers.map(h => { 64 | const e = changes.filter(e => e.id === h.id).shift(); 65 | if (e) { 66 | sidebar.cache[e.id] = e; 67 | } 68 | return e || h; 69 | }); 70 | // add new headers 71 | changes.filter(h => !sidebar.cache[h.id]).forEach(h => { 72 | sidebar.cache[h.id] = h; 73 | headers.push(h); 74 | }); 75 | 76 | return chrome.storage.local.set({ 77 | headers 78 | }); 79 | }); 80 | 81 | sidebar.cache = {}; 82 | 83 | sidebar.once('open', () => sidebar.notes().then(headers => { 84 | const max = headers.length * 3; 85 | let i = 0; 86 | const one = () => { 87 | i += 1; 88 | const header = headers.shift(); 89 | if (header) { 90 | if (i > max) { // if parent is not detected, add to root 91 | delete header.parent; 92 | } 93 | if (header.parent && !sidebar.cache[header.parent]) { 94 | headers.push(header); 95 | } 96 | else { 97 | sidebar.cache[header.id] = header; 98 | tree.add({ 99 | label: header.name, 100 | id: header.id, 101 | selected: header.selected, 102 | parent: header.parent 103 | }); 104 | } 105 | one(); 106 | } 107 | }; 108 | one(); 109 | // open selected note; 110 | let parent = sidebar.selected; 111 | while (parent && parent.id) { 112 | tree.open(parent.id); 113 | parent = sidebar.cache[parent.parent]; 114 | } 115 | })).if(status => status === true); 116 | 117 | // events 118 | sidebar.root.addEventListener('vtree-select', ({detail}) => { 119 | sidebar.selected = sidebar.cache[detail.id] || {}; 120 | sidebar.emit('selected', detail.id); 121 | chrome.storage.local.set({ 122 | selected: detail.id 123 | }); 124 | }); 125 | 126 | // get closest notebook 127 | sidebar.parent = n => n.id ? (n.id.startsWith('notebook-') ? n.id : n.parent) : null; 128 | // add a new note 129 | sidebar.add = { 130 | note: (name, content = false) => { 131 | name = name || 'new note'; 132 | const note = { 133 | name, 134 | id: 'note-' + Math.random(), 135 | selected: true 136 | }; 137 | const pid = sidebar.selected ? sidebar.parent(sidebar.selected) : null; 138 | 139 | if (pid) { 140 | note.parent = pid; 141 | tree.open(note.parent); 142 | } 143 | 144 | sidebar.save(note).then(() => { 145 | const next = () => tree.add(Object.assign({ 146 | label: name 147 | }, note)); 148 | if (content) { 149 | editor.write(note.id).then(next); 150 | } 151 | else { 152 | next(); 153 | } 154 | }); 155 | 156 | return note; 157 | }, 158 | notebook: (name, content = false) => { 159 | name = name || 'new notebook'; 160 | const parent = sidebar.parent(sidebar.selected); 161 | const notebook = { 162 | name, 163 | id: 'notebook-' + Math.random(), 164 | parent, 165 | selected: true, 166 | opened: true 167 | }; 168 | 169 | sidebar.save(notebook).then(() => { 170 | tree.add(Object.assign({ 171 | label: name 172 | }, notebook)); 173 | sidebar.add.note(null, content); 174 | }); 175 | 176 | return notebook; 177 | } 178 | }; 179 | sidebar.delete = {}; 180 | sidebar.delete.note = (id = sidebar.selected.id, del = true) => { 181 | const perform = () => { 182 | sidebar.notes().then(headers => { 183 | delete sidebar.cache[id]; 184 | if (del) { 185 | chrome.storage.local.set({ 186 | headers: headers.filter(h => h.id !== id) 187 | }); 188 | } 189 | chrome.runtime.sendMessage({ 190 | method: 'delete-note', 191 | id 192 | }); 193 | if (del) { 194 | tree.remove(id); 195 | } 196 | if (id === sidebar.selected.id) { 197 | editor.id = null; 198 | editor.update.title(null); 199 | sidebar.selected = {}; 200 | } 201 | sidebar.emit('deleted', [id]); 202 | }); 203 | }; 204 | if (del) { 205 | api.user.confirm( 206 | 'Delete', 207 | `Are you sure you want to delete "${sidebar.cache[id].name}"? This action is irreversible.` 208 | ).then(perform); 209 | } 210 | else { 211 | perform(); 212 | } 213 | }; 214 | sidebar.delete.notebook = (id = sidebar.selected.id) => { 215 | api.user.confirm( 216 | 'Delete', 217 | `Are you sure you want ot delete "${sidebar.cache[id].name}" and all its child notes? This action is irreversible.` 218 | ).then(() => { 219 | const ids = [...tree.getChildList(id).querySelectorAll('[data-vtree-id]')].map(e => e.dataset.vtreeId); 220 | const notebooks = [id, ...ids.filter(i => i.startsWith('notebook-'))]; 221 | const notes = ids.filter(i => i.startsWith('note-')); 222 | 223 | sidebar.notes().then(headers => { 224 | chrome.storage.local.set({ 225 | headers: headers.filter(h => notebooks.indexOf(h.id) === -1 && notes.indexOf(h.id) === -1) 226 | }); 227 | }); 228 | notes.forEach(id => sidebar.delete.note(id, false)); 229 | notebooks.forEach(id => delete sidebar.cache[id]); 230 | tree.remove(id); 231 | // current note is in the list 232 | if (ids.indexOf(editor.id) !== -1) { 233 | editor.id = null; 234 | editor.update.title(null); 235 | sidebar.selected = {}; 236 | } 237 | if (id === sidebar.selected.id) { 238 | sidebar.selected = {}; 239 | } 240 | if (editor.id) { 241 | tree.select(editor.id); 242 | } 243 | sidebar.emit('deleted', ids); 244 | }); 245 | }; 246 | 247 | api.note = {}; 248 | api.note.add = sidebar.add.note; 249 | api.note.delete = sidebar.delete.note; 250 | api.notebook = {}; 251 | api.notebook.add = sidebar.add.notebook; 252 | 253 | // details 254 | { 255 | const name = document.querySelector('#sidebar [data-id=details] [data-id=name]'); 256 | const del = document.querySelector('#sidebar [data-cmd="delete"]'); 257 | const save = document.querySelector('#sidebar [type="submit"]'); 258 | sidebar.on('selected', id => { 259 | name.value = sidebar.cache[id].name; 260 | name.select(); 261 | name.focus(); 262 | del.disabled = save.disabled = false; 263 | }); 264 | document.querySelector('#sidebar [data-id=details]').addEventListener('submit', e => { 265 | e.preventDefault(); 266 | const label = name.value || 'no name'; 267 | document.querySelector('#tree .vtree-selected a').textContent = label; 268 | sidebar.selected.name = label; 269 | 270 | sidebar.save(sidebar.selected).then(() => sidebar.emit('name-changed', sidebar.selected)); 271 | }); 272 | 273 | sidebar.on('deleted', () => { 274 | del.disabled = save.disabled = sidebar.root.querySelector('.vtree-selected') === null; 275 | }); 276 | } 277 | 278 | // commands 279 | document.querySelector('#sidebar [data-id=toolbox]').addEventListener('click', ({target}) => { 280 | const cmd = target.dataset.cmd; 281 | if (cmd === 'new-note') { 282 | sidebar.add.note(null, editor.id ? null : true); 283 | } 284 | else if (cmd === 'new-notebook') { 285 | sidebar.add.notebook(null, editor.id ? null : true); 286 | } 287 | else if (cmd === 'delete') { 288 | if (sidebar.selected.id.startsWith('note-')) { 289 | sidebar.delete.note(); 290 | } 291 | else { 292 | sidebar.delete.notebook(); 293 | } 294 | } 295 | }); 296 | 297 | // api (sidebar might not yet be loaded) 298 | api.note.get = id => { 299 | const empty = Promise.resolve([{ 300 | name: '* untracked note', 301 | id: null 302 | }]); 303 | 304 | if (id) { 305 | return sidebar.notes().then(headers => { 306 | let parent = headers.filter(h => h.id === id).shift(); 307 | if (parent) { 308 | const cache = headers.reduce((p, c) => { 309 | p[c.id] = c; 310 | return p; 311 | }, {}); 312 | const list = []; 313 | while (parent) { 314 | list.unshift(parent); 315 | parent = cache[parent.parent]; 316 | } 317 | return list; 318 | } 319 | return empty; 320 | }); 321 | } 322 | else { 323 | return empty; 324 | } 325 | }; 326 | 327 | document.addEventListener('DOMContentLoaded', () => { 328 | document.body.dataset.ready = true; 329 | }); 330 | -------------------------------------------------------------------------------- /data/editor/tinymce.css: -------------------------------------------------------------------------------- 1 | html { 2 | height: 100%; 3 | } 4 | body { 5 | height: 100%; 6 | margin: 0; 7 | } 8 | 9 | #article, .mce-tinymce,.mce-stack-layout, .mce-edit-area{ 10 | display: flex; 11 | flex-direction: column; 12 | flex: 1; 13 | height: 100%; 14 | box-sizing: border-box; 15 | } 16 | .mce-tinymce iframe{ 17 | flex: 1; 18 | } 19 | -------------------------------------------------------------------------------- /data/editor/tinymce.js: -------------------------------------------------------------------------------- 1 | /* global tinymce, EventEmitter, sidebar, api */ 2 | 'use strict'; 3 | 4 | const editor = new EventEmitter(); 5 | 6 | function debounce(func, wait) { 7 | let time = 0; 8 | const context = this; 9 | 10 | return function() { 11 | const now = Date.now(); 12 | if (now - time > wait) { 13 | func.apply(context, arguments); 14 | time = now; 15 | } 16 | }; 17 | } 18 | 19 | tinymce.init({ 20 | selector: 'textarea', 21 | branding: false, 22 | menu: { 23 | notepad: {title: 'Notepad', items: 'options | save'}, 24 | edit: {title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall | searchreplace'}, 25 | insert: {title: 'Insert', items: 'insertdatetime | charmap | inserttable tableprops deletetable cell row column'}, 26 | view: {title: 'View', items: 'visualaid'}, 27 | format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript code | formats | removeformat'} 28 | }, 29 | paste_data_images: false, 30 | toolbar: 'undo redo | styleselect | bold italic | ' + 31 | 'forecolor backcolor | ' + 32 | 'alignleft aligncenter alignright alignjustify | ' + 33 | 'bullist numlist outdent indent | link image', 34 | plugins: [ 35 | 'charmap searchreplace insertdatetime table lists advlist', 36 | 'textcolor colorpicker code save' 37 | ], 38 | setup(editor) { 39 | // shortcuts 40 | editor.shortcuts.add('access+s', 'Toggle sidebar', () => sidebar.emit('toggle')); 41 | // menu 42 | editor.addMenuItem('options', { 43 | text: 'Options', 44 | onclick: () => chrome.runtime.openOptionsPage() 45 | }); 46 | editor.addMenuItem('save', { 47 | text: 'Save', 48 | cmd: 'mceSave', 49 | disabled: true, 50 | onPostRender: function() { 51 | const self = this; 52 | editor.on('nodeChange', function() { 53 | self.disabled(editor.getParam('save_enablewhendirty', true) && !editor.isDirty()); 54 | }); 55 | } 56 | }); 57 | }, 58 | save_onsavecallback() { 59 | editor.write(); 60 | } 61 | }); 62 | tinymce.on('AddEditor', e => { 63 | editor.instance = e.editor; 64 | 65 | e.editor.on('Init', e => { 66 | chrome.storage.local.get({ 67 | 'selected-note': 'note--1' 68 | }, prefs => { 69 | const id = prefs['selected-note']; 70 | editor.update.content(id); 71 | editor.update.title(id); 72 | editor.emit('init', e); 73 | editor.instance.focus(); 74 | editor.instance.on('Change', debounce(e => editor.emit('change', e), 1000)); 75 | editor.instance.on('NodeChange', debounce(e => editor.emit('selection', e), 1000)); 76 | 77 | const style = localStorage.getItem('editor-css'); 78 | if (style) { 79 | editor.instance.getBody().style = style; 80 | } 81 | }); 82 | }); 83 | e.editor.on('Click', e => editor.emit('click', e)); 84 | e.editor.on('Dirty', e => editor.emit('dirty', e)); 85 | }); 86 | 87 | editor.write = ( 88 | id = editor.id, 89 | content = editor.instance.getContent(), 90 | bookmark = editor.instance.selection.getBookmark(2, true) 91 | ) => new Promise(resolve => chrome.runtime.sendMessage({ 92 | method: 'save-note', 93 | id, 94 | content: content, 95 | bookmark 96 | }, resolve)); 97 | // editor.on('change', () => editor.id && editor.write()); 98 | editor.on('selection', () => { 99 | const id = editor.id; 100 | const bookmark = editor.instance.selection.getBookmark(2, true); 101 | if (bookmark && id) { 102 | chrome.runtime.sendMessage({ 103 | method: 'save-bookmark', 104 | id, 105 | bookmark 106 | }); 107 | } 108 | }); 109 | 110 | editor.update = {}; 111 | editor.update.content = id => chrome.storage.local.get({ 112 | [id + '-content']: '', 113 | [id + '-bookmark']: null 114 | }, prefs => { 115 | const instance = editor.instance; 116 | if (editor.id && instance.isDirty()) { 117 | editor.instance.execCommand('mceSave'); 118 | } 119 | 120 | instance.setContent(prefs[id + '-content']); 121 | if (prefs[id + '-bookmark']) { 122 | instance.selection.moveToBookmark(prefs[id + '-bookmark']); 123 | } 124 | editor.id = id; 125 | instance.setDirty(false); 126 | }); 127 | editor.update.title = id => api.note.get(id).then(notes => { 128 | editor.emit('updating', id); 129 | const note = notes.pop(); 130 | editor.id = note.id; // if not is untracked, removes the id 131 | document.title = '[' + note.name + '] - /' + notes.map(n => n.name).join('/'); 132 | }); 133 | 134 | // unbeforeunload 135 | window.addEventListener('beforeunload', () => { 136 | if (editor.id && editor.instance.isDirty()) { 137 | editor.write(); 138 | } 139 | }); 140 | 141 | document.addEventListener('DOMContentLoaded', () => { 142 | // when a new note is selected 143 | sidebar.on('selected', id => { 144 | editor.update.content(id); 145 | editor.update.title(id); 146 | chrome.storage.local.set({ 147 | 'selected-note': id 148 | }); 149 | }).if(id => id.startsWith('note-') && id !== editor.id); 150 | // when note's name is selected 151 | sidebar.on('name-changed', note => editor.update.title(note.id)).if(note => editor.id === note.id); 152 | }); 153 | -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/jquery.tinymce.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0&&(c=j().get(d[0].id)))return c.getContent()},c=function(a){var b=null;return a&&a.id&&h.tinymce&&(b=j().get(a.id)),b},e=function(a){return!!(a&&a.length&&h.tinymce&&a.is(":tinymce"))},f={};g.each(["text","html","val"],function(a,h){var i=f[h]=g.fn[h],j="text"===h;g.fn[h]=function(a){var f=this;if(!e(f))return i.apply(f,arguments);if(a!==d)return b.call(f.filter(":tinymce"),a),i.apply(f.not(":tinymce"),arguments),f;var h="",k=arguments;return(j?f:f.eq(0)).each(function(a,b){var d=c(b);h+=d?j?d.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):d.getContent({save:!0}):i.apply(g(b),k)}),h}}),g.each(["append","prepend"],function(a,b){var h=f[b]=g.fn[b],i="prepend"===b;g.fn[b]=function(a){var b=this;return e(b)?a!==d?("string"==typeof a&&b.filter(":tinymce").each(function(b,d){var e=c(d);e&&e.setContent(i?a+e.getContent():e.getContent()+a)}),h.apply(b.not(":tinymce"),arguments),b):void 0:h.apply(b,arguments)}}),g.each(["remove","replaceWith","replaceAll","empty"],function(b,c){var d=f[c]=g.fn[c];g.fn[c]=function(){return a.call(this,c),d.apply(this,arguments)}}),f.attr=g.fn.attr,g.fn.attr=function(a,h){var i=this,j=arguments;if(!a||"value"!==a||!e(i))return h!==d?f.attr.apply(i,j):f.attr.apply(i,j);if(h!==d)return b.call(i.filter(":tinymce"),h),f.attr.apply(i.not(":tinymce"),j),i;var k=i[0],l=c(k);return l?l.getContent({save:!0}):f.attr.apply(g(k),j)}}}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/langs/readme.md: -------------------------------------------------------------------------------- 1 | This is where language files should be placed. 2 | 3 | Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ 4 | -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/advlist/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0&&j[0].nodeName===c)})}},h=function(a){return function(b){var c=d.getSelectedStyleType(a);b.control.items().each(function(a){a.active(a.settings.data===c)})}},i=function(a,b,d,f,i,j){a.addButton(b,{active:!1,type:"splitbutton",tooltip:d,menu:e.toMenuItems(j),onPostRender:g(a,i),onshow:h(a),onselect:function(b){c.applyListFormat(a,i,b.control.settings.data)},onclick:function(){a.execCommand(f)}})},j=function(a,b,c,d,e,f){a.addButton(b,{active:!1,type:"button",tooltip:c,onPostRender:g(a,e),onclick:function(){a.execCommand(d)}})},k=function(a,b,c,d,e,f){f.length>0?i(a,b,c,d,e,f):j(a,b,c,d,e,f)},l=function(a){k(a,"numlist","Numbered list","InsertOrderedList","OL",b.getNumberStyles(a)),k(a,"bullist","Bullet list","InsertUnorderedList","UL",b.getBulletStyles(a))};return{register:l}}),g("0",["1","2","3","4"],function(a,b,c,d){return a.add("advlist",function(a){var e=function(a,c){var d=a.settings.plugins?a.settings.plugins:"";return b.inArray(d.split(/[ ,]/),c)!==-1};e(a,"lists")&&(d.register(a),c.register(a))}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/anchor/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;ic&&(b=c)}return b},i=function(a,b,c){1!==b.nodeType||b.hasChildNodes()?a.setStart(b,h(b,c)):a.setStartBefore(b)},j=function(a,b,c){1!==b.nodeType||b.hasChildNodes()?a.setEnd(b,h(b,c)):a.setEndAfter(b)},k=function(a,b,e){var f,g,h,k,l,m,n,o,p,q,r=c.getAutoLinkPattern(a),s=c.getDefaultLinkTarget(a);if("A"!==a.selection.getNode().tagName){if(f=a.selection.getRng(!0).cloneRange(),f.startOffset<5){if(o=f.endContainer.previousSibling,!o){if(!f.endContainer.firstChild||!f.endContainer.firstChild.nextSibling)return;o=f.endContainer.firstChild.nextSibling}if(p=o.length,i(f,o,p),j(f,o,p),f.endOffset<5)return;g=f.endOffset,k=o}else{if(k=f.endContainer,3!==k.nodeType&&k.firstChild){for(;3!==k.nodeType&&k.firstChild;)k=k.firstChild;3===k.nodeType&&(i(f,k,0),j(f,k,k.nodeValue.length))}g=1===f.endOffset?2:f.endOffset-1-b}h=g;do i(f,k,g>=2?g-2:0),j(f,k,g>=1?g-1:0),g-=1,q=f.toString();while(" "!==q&&""!==q&&160!==q.charCodeAt(0)&&g-2>=0&&q!==e);d(f.toString(),e)?(i(f,k,g),j(f,k,h),g+=1):0===f.startOffset?(i(f,k,0),j(f,k,h)):(i(f,k,g),j(f,k,h)),m=f.toString(),"."===m.charAt(m.length-1)&&j(f,k,h-1),m=f.toString().trim(),n=m.match(r),n&&("www."===n[1]?n[1]="http://www.":/@$/.test(n[1])&&!/^mailto:/.test(n[1])&&(n[1]="mailto:"+n[1]),l=a.selection.getBookmark(),a.selection.setRng(f),a.execCommand("createlink",!1,n[1]+n[2]),s&&a.dom.setAttrib(a.selection.getNode(),"target",s),a.selection.moveToBookmark(l),a.nodeChanged())}},l=function(b){var c;return b.on("keydown",function(a){if(13===a.keyCode)return g(b)}),a.ie?void b.on("focus",function(){if(!c){c=!0;try{b.execCommand("AutoUrlDetect",!1,!0)}catch(a){}}}):(b.on("keypress",function(a){if(41===a.keyCode)return e(b)}),void b.on("keyup",function(a){if(32===a.keyCode)return f(b)}))};return{setup:l}}),g("0",["1","2","3"],function(a,b,c){return b.add("autolink",function(a){c.setup(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/autoresize/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;ic.getAutoResizeMinHeight(b)&&(k=l);var t=c.getAutoResizeMaxHeight(b);t&&l>t?(k=t,f(b,!0)):f(b,!1),k!==e.get()&&(h=k-e.get(),s.setStyle(b.iframeElement,"height",k+"px"),e.set(k),a.webKit&&h<0&&g(b))}},h=function(a,b){a.on("init",function(){var b,d,e=a.dom;b=c.getAutoResizeOverflowPadding(a),d=c.getAutoResizeBottomMargin(a),b!==!1&&e.setStyles(a.getBody(),{paddingLeft:b,paddingRight:b}),d!==!1&&e.setStyles(a.getBody(),{paddingBottom:d})}),a.on("nodechange setcontent keyup FullscreenStateChanged",function(c){g(a,b)}),c.shouldAutoResizeOnInit(a)&&a.on("init",function(){e(a,b,20,100,function(){e(a,b,5,1e3)})})};return{setup:h,resize:g}}),g("3",["4"],function(a){var b=function(b,c){b.addCommand("mceAutoResize",function(){a.resize(b,c)})};return{register:b}}),g("0",["1","2","3","4"],function(a,b,c,d){return b.add("autoresize",function(b){if(!b.inline){var e=a(0);c.register(b,e),d.setup(b,e)}}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/autosave/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i]*>((\xa0| |[ \t]|]*>)+?|)|
$","i").test(b)},g=function(a){var c=parseInt(b.getItem(e.getAutoSavePrefix(a)+"time"),10)||0;return!((new Date).getTime()-c>e.getAutoSaveRetention(a))||(h(a,!1),!1)},h=function(a,c){var f=e.getAutoSavePrefix(a);b.removeItem(f+"draft"),b.removeItem(f+"time"),c!==!1&&d.fireRemoveDraft(a)},i=function(a){var c=e.getAutoSavePrefix(a);!f(a)&&a.isDirty()&&(b.setItem(c+"draft",a.getContent({format:"raw",no_events:!0})),b.setItem(c+"time",(new Date).getTime()),d.fireStoreDraft(a))},j=function(a){var c=e.getAutoSavePrefix(a);g(a)&&(a.setContent(b.getItem(c+"draft"),{format:"raw"}),d.fireRestoreDraft(a))},k=function(b,c){var d=e.getAutoSaveInterval(b);c.get()||(a(function(){b.removed||i(b)},d),c.set(!0))},l=function(a){a.undoManager.transact(function(){j(a),h(a)}),a.focus()};return{isEmpty:f,hasDraft:g,removeDraft:h,storeDraft:i,restoreDraft:j,startStoreDraft:k,restoreLastDraft:l}}),g("3",["7"],function(a){var b=function(a,b){return function(){var c=Array.prototype.slice.call(arguments);return a.apply(null,[b].concat(c))}},c=function(c){return{hasDraft:b(a.hasDraft,c),storeDraft:b(a.storeDraft,c),restoreDraft:b(a.restoreDraft,c),removeDraft:b(a.removeDraft,c),isEmpty:b(a.isEmpty,c)}};return{get:c}}),h("8",window),g("9",["6"],function(a){return a("tinymce.EditorManager")}),g("4",["8","9","a","b"],function(a,b,c,d){b._beforeUnloadHandler=function(){var a;return c.each(b.get(),function(b){b.plugins.autosave&&b.plugins.autosave.storeDraft(),!a&&b.isDirty()&&d.shouldAskBeforeUnload(b)&&(a=b.translate("You have unsaved changes are you sure you want to navigate away?"))}),a};var e=function(c){a.onbeforeunload=b._beforeUnloadHandler};return{setup:e}}),g("5",["7"],function(a){var b=function(b,c){return function(d){var e=d.control;e.disabled(!a.hasDraft(b)),b.on("StoreDraft RestoreDraft RemoveDraft",function(){e.disabled(!a.hasDraft(b))}),a.startStoreDraft(b,c)}},c=function(c,d){c.addButton("restoredraft",{title:"Restore last draft",onclick:function(){a.restoreLastDraft(c)},onPostRender:b(c,d)}),c.addMenuItem("restoredraft",{text:"Restore last draft",onclick:function(){a.restoreLastDraft(c)},onPostRender:b(c,d),context:"file"})};return{register:c}}),g("0",["1","2","3","4","5"],function(a,b,c,d,e){return b.add("autosave",function(b){var f=a(!1);return d.setup(b),e.register(b,f),c.get(b)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/bbcode/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i(.*?)<\/a>/gi,"[url=$1]$2[/url]"),c(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),c(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),c(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),c(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),c(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),c(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),c(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),c(/(.*?)<\/font>/gi,"$1"),c(//gi,"[img]$1[/img]"),c(/(.*?)<\/span>/gi,"[code]$1[/code]"),c(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),c(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),c(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),c(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),c(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),c(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),c(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),c(/<\/(strong|b)>/gi,"[/b]"),c(/<(strong|b)>/gi,"[b]"),c(/<\/(em|i)>/gi,"[/i]"),c(/<(em|i)>/gi,"[i]"),c(/<\/u>/gi,"[/u]"),c(/(.*?)<\/span>/gi,"[u]$1[/u]"),c(//gi,"[u]"),c(/]*>/gi,"[quote]"),c(/<\/blockquote>/gi,"[/quote]"),c(/
/gi,"\n"),c(//gi,"\n"),c(/
/gi,"\n"),c(/

/gi,""),c(/<\/p>/gi,"\n"),c(/ |\u00a0/gi," "),c(/"/gi,'"'),c(/</gi,"<"),c(/>/gi,">"),c(/&/gi,"&"),b},c=function(b){b=a.trim(b);var c=function(a,c){b=b.replace(a,c)};return c(/\n/gi,"
"),c(/\[b\]/gi,""),c(/\[\/b\]/gi,""),c(/\[i\]/gi,""),c(/\[\/i\]/gi,""),c(/\[u\]/gi,""),c(/\[\/u\]/gi,""),c(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),c(/\[url\](.*?)\[\/url\]/gi,'$1'),c(/\[img\](.*?)\[\/img\]/gi,''),c(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),c(/\[code\](.*?)\[\/code\]/gi,'$1 '),c(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),b};return{html2bbcode:b,bbcode2html:c}}),g("0",["1","2"],function(a,b){return a.add("bbcode",function(){return{init:function(a){a.on("beforeSetContent",function(a){a.content=b.bbcode2html(a.content)}),a.on("postProcess",function(a){a.set&&(a.content=b.bbcode2html(a.content)),a.get&&(a.content=b.html2bbcode(a.content))})}}}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/charmap/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i',d=0;d",c=0;c

'+j+"
"}else b+=""}b+=""}return b+=""};return{getHtml:a}}),g("8",["6","7","c"],function(a,b,c){var d=function(a){for(;a;){if("TD"===a.nodeName)return a;a=a.parentNode}},e=function(e){var f,g={type:"container",html:c.getHtml(b.getCharMap(e)),onclick:function(b){var c=b.target;if(/^(TD|DIV)$/.test(c.nodeName)){var g=d(c).firstChild;if(g&&g.hasAttribute("data-chr")){var h=g.getAttribute("data-chr"),i=parseInt(h,10);isNaN(i)||a.insertChar(e,String.fromCharCode(i)),b.ctrlKey||f.close()}}},onmouseover:function(a){var b=d(a.target);b&&b.firstChild?(f.find("#preview").text(b.firstChild.firstChild.data),f.find("#previewTitle").text(b.title)):(f.find("#preview").text(" "),f.find("#previewTitle").text(" "))}};f=e.windowManager.open({title:"Special character",spacing:10,padding:10,items:[g,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"spacer",minHeight:20},{type:"label",name:"previewTitle",text:" ",style:"white-space: pre-wrap;",border:1,minWidth:140}]}],buttons:[{text:"Close",onclick:function(){f.close()}}]})};return{open:e}}),g("3",["8"],function(a){var b=function(b){b.addCommand("mceShowCharmap",function(){a.open(b)})};return{register:b}}),g("4",[],function(){var a=function(a){a.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),a.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"})};return{register:a}}),g("0",["1","2","3","4"],function(a,b,c,d){return a.add("charmap",function(a){return c.register(a),d.register(a),b.get(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/code/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i code[class*="language-"], 58 | pre[class*="language-"] { 59 | background: #f5f2f0; 60 | } 61 | 62 | /* Inline code */ 63 | :not(pre) > code[class*="language-"] { 64 | padding: .1em; 65 | border-radius: .3em; 66 | } 67 | 68 | .token.comment, 69 | .token.prolog, 70 | .token.doctype, 71 | .token.cdata { 72 | color: slategray; 73 | } 74 | 75 | .token.punctuation { 76 | color: #999; 77 | } 78 | 79 | .namespace { 80 | opacity: .7; 81 | } 82 | 83 | .token.property, 84 | .token.tag, 85 | .token.boolean, 86 | .token.number, 87 | .token.constant, 88 | .token.symbol, 89 | .token.deleted { 90 | color: #905; 91 | } 92 | 93 | .token.selector, 94 | .token.attr-name, 95 | .token.string, 96 | .token.char, 97 | .token.builtin, 98 | .token.inserted { 99 | color: #690; 100 | } 101 | 102 | .token.operator, 103 | .token.entity, 104 | .token.url, 105 | .language-css .token.string, 106 | .style .token.string { 107 | color: #a67f59; 108 | background: hsla(0, 0%, 100%, .5); 109 | } 110 | 111 | .token.atrule, 112 | .token.attr-value, 113 | .token.keyword { 114 | color: #07a; 115 | } 116 | 117 | .token.function { 118 | color: #DD4A68; 119 | } 120 | 121 | .token.regex, 122 | .token.important, 123 | .token.variable { 124 | color: #e90; 125 | } 126 | 127 | .token.important, 128 | .token.bold { 129 | font-weight: bold; 130 | } 131 | .token.italic { 132 | font-style: italic; 133 | } 134 | 135 | .token.entity { 136 | cursor: help; 137 | } 138 | 139 | -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i'}),d+=""}),d+=""};return{getHtml:c}}),g("2",["4"],function(a){var b=function(a,b,c){a.insertContent(a.dom.createHTML("img",{src:b,alt:c}))},c=function(c,d){var e=a.getHtml(d);c.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:e,onclick:function(a){var d=c.dom.getParent(a.target,"a");d&&(b(c,d.getAttribute("data-mce-url"),d.getAttribute("data-mce-alt")),this.hide())}},tooltip:"Emoticons"})};return{register:c}}),g("0",["1","2"],function(a,b){return a.add("emoticons",function(a,c){b.register(a,c)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/fullpage/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i")};return{shouldHideInSourceView:a,getDefaultXmlPi:b,getDefaultEncoding:c,getDefaultFontFamily:d,getDefaultFontSize:e,getDefaultTextColor:f,getDefaultTitle:g,getDefaultDocType:h}}),g("a",["c","d","e","8","9"],function(a,b,c,d,e){var f=function(b){return new a({validate:!1,root_name:"#document"}).parse(b)},g=function(a,b){function c(a,b){var c=a.attr(b);return c||""}var g,h,i=f(b),j={};return j.fontface=e.getDefaultFontFamily(a),j.fontsize=e.getDefaultFontSize(a),g=i.firstChild,7===g.type&&(j.xml_pi=!0,h=/encoding="([^"]+)"/.exec(g.value),h&&(j.docencoding=h[1])),g=i.getAll("#doctype")[0],g&&(j.doctype=""),g=i.getAll("title")[0],g&&g.firstChild&&(j.title=g.firstChild.value),d.each(i.getAll("meta"),function(a){var b,c=a.attr("name"),d=a.attr("http-equiv");c?j[c.toLowerCase()]=a.attr("content"):"Content-Type"===d&&(b=/charset\s*=\s*(.*)\s*/gi.exec(a.attr("content")),b&&(j.docencoding=b[1]))}),g=i.getAll("html")[0],g&&(j.langcode=c(g,"lang")||c(g,"xml:lang")),j.stylesheets=[],d.each(i.getAll("link"),function(a){"stylesheet"===a.attr("rel")&&j.stylesheets.push(a.attr("href"))}),g=i.getAll("body")[0],g&&(j.langdir=c(g,"dir"),j.style=c(g,"style"),j.visited_color=c(g,"vlink"),j.link_color=c(g,"link"),j.active_color=c(g,"alink")),j},h=function(a,e,g){function h(a,b,c){a.attr(b,c?c:void 0)}function i(a){k.firstChild?k.insert(a,k.firstChild):k.append(a)}var j,k,l,m,n,o=a.dom;j=f(g),k=j.getAll("head")[0],k||(m=j.getAll("html")[0],k=new b("head",1),m.firstChild?m.insert(k,m.firstChild,!0):m.append(k)),m=j.firstChild,e.xml_pi?(n='version="1.0"',e.docencoding&&(n+=' encoding="'+e.docencoding+'"'),7!==m.type&&(m=new b("xml",7),j.insert(m,j.firstChild,!0)),m.value=n):m&&7===m.type&&m.remove(),m=j.getAll("#doctype")[0],e.doctype?(m||(m=new b("#doctype",10),e.xml_pi?j.insert(m,j.firstChild):i(m)),m.value=e.doctype.substring(9,e.doctype.length-1)):m&&m.remove(),m=null,d.each(j.getAll("meta"),function(a){"Content-Type"===a.attr("http-equiv")&&(m=a)}),e.docencoding?(m||(m=new b("meta",1),m.attr("http-equiv","Content-Type"),m.shortEnded=!0,i(m)),m.attr("content","text/html; charset="+e.docencoding)):m&&m.remove(),m=j.getAll("title")[0],e.title?(m?m.empty():(m=new b("title",1),i(m)),m.append(new b("#text",3)).value=e.title):m&&m.remove(),d.each("keywords,description,author,copyright,robots".split(","),function(a){var c,d,f=j.getAll("meta"),g=e[a];for(c=0;c"))};return{parseHeader:f,htmlToData:g,dataToHtml:h}}),g("7",["8","a"],function(a,b){var c=function(c,d){var e=b.htmlToData(c,d.get());c.windowManager.open({title:"Document properties",data:e,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(f){var g=b.dataToHtml(c,a.extend(e,f.data),d.get());d.set(g)}})};return{open:c}}),g("3",["7"],function(a){var b=function(b,c){b.addCommand("mceFullPageProperties",function(){a.open(b,c)})};return{register:b}}),g("b",["8"],function(a){var b=function(b,c){return a.each(b,function(a){c=c.replace(a,function(a){return""})}),c},c=function(a){return a.replace(//g,function(a,b){return unescape(b)})};return{protectHtml:b,unprotectHtml:c}}),g("4",["8","9","a","b"],function(a,b,c,d){var e=a.each,f=function(a){return a.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase()})},g=function(g,i,j,k){var l,m,n,o,p,q="",r=g.dom;if(!(k.selection||(n=d.protectHtml(g.settings.protect,k.content),"raw"===k.format&&i.get()||k.source_view&&b.shouldHideInSourceView(g)))){0!==n.length||k.source_view||(n=a.trim(i.get())+"\n"+a.trim(n)+"\n"+a.trim(j.get())),n=n.replace(/<(\/?)BODY/gi,"<$1body"),l=n.indexOf("",l),i.set(f(n.substring(0,l+1))),m=n.indexOf("\n")),o=c.parseHeader(i.get()),e(o.getAll("style"),function(a){a.firstChild&&(q+=a.firstChild.value)}),p=o.getAll("body")[0],p&&r.setAttribs(g.getBody(),{style:p.attr("style")||"",dir:p.attr("dir")||"",vLink:p.attr("vlink")||"",link:p.attr("link")||"",aLink:p.attr("alink")||""}),r.remove("fullpage_styles");var s=g.getDoc().getElementsByTagName("head")[0];q&&(r.add(s,"style",{id:"fullpage_styles"},q),p=r.get("fullpage_styles"),p.styleSheet&&(p.styleSheet.cssText=q));var t={};a.each(s.getElementsByTagName("link"),function(a){"stylesheet"===a.rel&&a.getAttribute("data-mce-fullpage")&&(t[a.href]=a)}),a.each(o.getAll("link"),function(a){var b=a.attr("href");return!b||(t[b]||"stylesheet"!==a.attr("rel")||r.add(s,"link",{rel:"stylesheet",text:"text/css",href:b,"data-mce-fullpage":"1"}),void delete t[b])}),a.each(t,function(a){a.parentNode.removeChild(a)})}},h=function(a){var c,d="",e="";if(b.getDefaultXmlPi(a)){var f=b.getDefaultEncoding(a);d+='\n'}return d+=b.getDefaultDocType(a),d+="\n\n\n",(c=b.getDefaultTitle(a))&&(d+=""+c+"\n"),(c=b.getDefaultEncoding(a))&&(d+='\n'),(c=b.getDefaultFontFamily(a))&&(e+="font-family: "+c+";"),(c=b.getDefaultFontSize(a))&&(e+="font-size: "+c+";"),(c=b.getDefaultTextColor(a))&&(e+="color: "+c+";"),d+="\n\n"},i=function(c,e,f,g){g.selection||g.source_view&&b.shouldHideInSourceView(c)||(g.content=d.unprotectHtml(a.trim(e)+"\n"+a.trim(g.content)+"\n"+a.trim(f)))},j=function(a,b,c){a.on("BeforeSetContent",function(d){g(a,b,c,d)}),a.on("GetContent",function(d){i(a,b.get(),c.get(),d)})};return{setup:j}}),g("5",[],function(){var a=function(a){a.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),a.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"})};return{register:a}}),g("0",["1","2","3","4","5"],function(a,b,c,d,e){return b.add("fullpage",function(b){var f=a(""),g=a("");c.register(b,f),e.register(b),d.setup(b,f,g)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i")})};return{register:a}}),g("3",[],function(){var a=function(a){a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};return{register:a}}),g("0",["1","2","3"],function(a,b,c){return a.add("hr",function(a){b.register(a),c.register(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/importcss/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0)d.each(b,function(b){var c=q(a,b);c&&b.item.menu.push(c)});else{var c=q(a,null);c&&j.add(c)}}}),d.each(m,function(a){a.item.menu.length>0&&j.add(a.item)}),c.control.renderNew()})};return{defaultConvertSelectorToFormat:j,setup:q}}),g("2",["3"],function(a){var b=function(b){var c=function(c){return a.defaultConvertSelectorToFormat(b,c)};return{convertSelectorToFormat:c}};return{get:b}}),g("0",["1","2","3"],function(a,b,c){return a.add("importcss",function(a){return c.setup(a),b.get(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i")};return{shouldHideInSourceView:a,getDefaultXmlPi:b,getDefaultEncoding:c,getDefaultFontFamily:d,getDefaultFontSize:e,getDefaultTextColor:f,getDefaultTitle:g,getDefaultDocType:h}}),g("8",["5"],function(a){return a("tinymce.util.Tools")}),g("9",[],function(){var a=function(a){return a.getParam("insertdatetime_dateformat",a.translate("%Y-%m-%d"))},b=function(a){return a.getParam("insertdatetime_timeformat",a.translate("%H:%M:%S"))},c=function(a){return a.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},d=function(a){var d=c(a);return d.length>0?d[0]:b(a)},e=function(a){return a.getParam("insertdatetime_element",!1)};return{getDateFormat:a,getTimeFormat:b,getFormats:c,getDefaultDateTime:d,shouldInsertTimeElement:e}}),g("7",["8","9"],function(a,b){var c="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),e="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),f="January February March April May June July August September October November December".split(" "),g=function(a,b){if(a=""+a,a.length'+e+"")}else a.insertContent(h(a,c))};return{insertDateTime:j,getDateTime:h}}),g("3",["6","7"],function(a,b){var c=function(c){c.addCommand("mceInsertDate",function(){b.insertDateTime(c,a.getDateFormat())}),c.addCommand("mceInsertTime",function(){b.insertDateTime(c,a.getTimeFormat())})};return{register:c}}),g("4",["8","9","7"],function(a,b,c){var d=function(d,e){var f=b.getFormats(d);return a.map(f,function(a){return{text:c.getDateTime(d,a),onclick:function(){e.set(a),c.insertDateTime(d,a)}}})},e=function(a,e){var f=d(a,e);a.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",menu:f,onclick:function(){var d=e.get();c.insertDateTime(a,d?d:b.getDefaultDateTime(a))}}),a.addMenuItem("insertdatetime",{icon:"date",text:"Date/time",menu:f,context:"insert"})};return{register:e}}),g("0",["1","2","3","4"],function(a,b,c,d){return b.add("insertdatetime",function(b){var e=a(null);c.register(b),d.register(b,e)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/legacyoutput/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i1&&(d=f[0],e=f[1]),b.push({text:d,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:b,fixedWidth:!0,onPostRender:function(){var b=this;a.on("NodeChange",function(){var c;c=a.dom.getParent(a.selection.getNode(),"font"),c?b.value(c.size):b.value("")})},onclick:function(b){b.control.settings.value&&a.execCommand("FontSize",!1,b.control.settings.value)}}}),a.addButton("fontselect",function(){function b(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}var c="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",d=[],e=b(a.settings.font_formats||c);return a.$.each(e,function(a,b){d.push({text:{raw:b[0]},value:b[1],textStyle:b[1].indexOf("dings")===-1?"font-family:"+b[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:d,fixedWidth:!0,onPostRender:function(){var b=this;a.on("NodeChange",function(){var c;c=a.dom.getParent(a.selection.getNode(),"font"),c?b.value(c.face):b.value("")})},onselect:function(b){b.control.settings.value&&a.execCommand("FontName",!1,b.control.settings.value)}}})};return{register:a}}),g("0",["1","2","3"],function(a,b,c){return a.add("legacyoutput",function(a){b.setup(a),c.register(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/nonbreaking/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i 
':" ";c.insertContent(a(e,d)),c.dom.setAttrib(c.dom.select("span.mce-nbsp"),"data-mce-bogus","1")};return{insertNbsp:c}}),g("2",["6"],function(a){var b=function(b){b.addCommand("mceNonBreaking",function(){a.insertNbsp(b,1)})};return{register:b}}),g("7",[],function(){var a=function(a){var b=a.getParam("nonbreaking_force_tab",0);return"boolean"==typeof b?b===!0?3:0:b};return{getKeyboardSpaces:a}}),g("3",["7","6"],function(a,b){var c=function(c){var d=a.getKeyboardSpaces(c);d>0&&c.on("keydown",function(a){if(9===a.keyCode){if(a.shiftKey)return;a.preventDefault(),b.insertNbsp(c,d)}})};return{setup:c}}),g("4",[],function(){var a=function(a){a.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),a.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"})};return{register:a}}),g("0",["1","2","3","4"],function(a,b,c,d){return a.add("nonbreaking",function(a){b.register(a),d.register(a),c.setup(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/noneditable/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0?b.charAt(f-1):"";if('"'===g)return d;if(">"===g){var h=b.lastIndexOf("<",f);if(h!==-1){var i=b.substring(h,f);if(i.indexOf('contenteditable="false"')!==-1)return d}}return''+a.dom.encode("string"==typeof e[1]?e[1]:e[0])+""}},e=function(a,c,e){var f=c.length,g=e.content;if("raw"!==e.format){for(;f--;)g=g.replace(c[f],d(a,g,b.getNonEditableClass(a)));e.content=g}},f=function(d){var f,g,h="contenteditable";f=" "+a.trim(b.getEditableClass(d))+" ",g=" "+a.trim(b.getNonEditableClass(d))+" ";var i=c(f),j=c(g),k=b.getNonEditableRegExps(d);d.on("PreInit",function(){k.length>0&&d.on("BeforeSetContent",function(a){e(d,k,a)}),d.parser.addAttributeFilter("class",function(a){for(var b,c=a.length;c--;)b=a[c],i(b)?b.attr(h,"true"):j(b)&&b.attr(h,"false")}),d.serializer.addAttributeFilter(h,function(a){for(var b,c=a.length;c--;)b=a[c],(i(b)||j(b))&&(k.length>0&&b.attr("data-mce-content")?(b.name="#text",b.type=3,b.raw=!0,b.value=b.attr("data-mce-content")):b.attr(h,null))})})};return{setup:f}}),g("0",["1","2"],function(a,b){return a.add("noneditable",function(a){b.setup(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/pagebreak/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i")},b=function(a){return a.getParam("pagebreak_split_block",!1)};return{getSeparatorHtml:a,shouldSplitBlock:b}}),g("4",["1","8"],function(a,b){var c=function(){return"mce-pagebreak"},d=function(){return''},e=function(a){var c=b.getSeparatorHtml(a),e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi");a.on("BeforeSetContent",function(a){a.content=a.content.replace(e,d())}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(d){for(var e,f,g=d.length;g--;)if(e=d[g],f=e.attr("class"),f&&f.indexOf("mce-pagebreak")!==-1){var h=e.parent;if(a.schema.getBlockElements()[h.name]&&b.shouldSplitBlock(a)){h.type=3,h.value=c,h.raw=!0,e.remove();continue}e.type=3,e.value=c,e.raw=!0}})})};return{setup:e,getPlaceholderHtml:d,getPageBreakClass:c}}),g("3",["4"],function(a){var b=function(b){b.addCommand("mcePageBreak",function(){b.settings.pagebreak_split_block?b.insertContent("

"+a.getPlaceholderHtml()+"

"):b.insertContent(a.getPlaceholderHtml())})};return{register:b}}),g("5",["4"],function(a){var b=function(b){b.on("ResolveName",function(c){"IMG"===c.target.nodeName&&b.dom.hasClass(c.target,a.getPageBreakClass())&&(c.name="pagebreak")})};return{setup:b}}),g("6",[],function(){var a=function(a){a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"})};return{register:a}}),g("0",["1","2","3","4","5","6"],function(a,b,c,d,e,f){return b.add("pagebreak",function(a){c.register(a),f.register(a),d.setup(a),e.setup(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/preview/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i',g&&(e+='"),a.each(c.contentCSS,function(a){e+=''});var h=c.settings.body_id||"tinymce";h.indexOf("=")!==-1&&(h=c.getParam("body_id","","hash"),h=h[c.id]||h);var i=c.settings.body_class||"";i.indexOf("=")!==-1&&(i=c.getParam("body_class","","hash"),i=i[c.id]||"");var j=' ',k=c.settings.directionality?' dir="'+c.settings.directionality+'"':"";return d=""+e+'"+c.getContent()+j+""},d=function(a,b,d){var e=c(a);if(d)b.src="data:text/html;charset=utf-8,"+encodeURIComponent(e);else{var f=b.contentWindow.document;f.open(),f.write(e),f.close()}};return{getPreviewHtml:c,injectIframeContent:d}}),g("5",["6","7","8","9"],function(a,b,c,d){var e=function(b){var e=!a.ie,f='",g=c.getPreviewDialogWidth(b),h=c.getPreviewDialogHeight(b);b.windowManager.open({title:"Preview",width:g,height:h,html:f,buttons:{text:"Close",onclick:function(a){a.control.parent().parent().close()}},onPostRender:function(a){var c=a.control.getEl("body").firstChild;d.injectIframeContent(b,c,e)}})};return{open:e}}),g("2",["5"],function(a){var b=function(b){b.addCommand("mcePreview",function(){a.open(b)})};return{register:b}}),g("3",[],function(){var a=function(a){a.addButton("preview",{title:"Preview",cmd:"mcePreview"}),a.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})};return{register:a}}),g("0",["1","2","3"],function(a,b,c){return a.add("preview",function(a){b.register(a),c.register(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/print/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0){var d=a[b];if(!d)throw"Invalid capture group";c+=a[0].indexOf(d),a[0]=d}return[c,c+a[0].length,[a[0]]]}function h(b){var c;if(3===b.nodeType)return b.data;if(o[b.nodeName]&&!n[b.nodeName])return"";if(c="",a(b))return"\n";if((n[b.nodeName]||p[b.nodeName])&&(c+="\n"),b=b.firstChild)do c+=h(b);while(b=b.nextSibling);return c}function i(b,c,d){var e,f,g,h,i=[],j=0,k=b,l=c.shift(),m=0;a:for(;;){if((n[k.nodeName]||p[k.nodeName]||a(k))&&j++,3===k.nodeType&&(!f&&k.length+j>=l[1]?(f=k,h=l[1]-j):e&&i.push(k),!e&&k.length+j>l[0]&&(e=k,g=l[0]-j),j+=k.length),e&&f){if(k=d({startNode:e,startNodeIndex:g,endNode:f,endNodeIndex:h,innerNodes:i,match:l[2],matchIndex:m}),j-=f.length-h,e=null,f=null,i=[],l=c.shift(),m++,!l)break}else if(o[k.nodeName]&&!n[k.nodeName]||!k.firstChild){if(k.nextSibling){k=k.nextSibling;continue}}else if(!a(k)){k=k.firstChild;continue}for(;;){if(k.nextSibling){k=k.nextSibling;break}if(k.parentNode===b)break a;k=k.parentNode}}}function j(a){var b;if("function"!=typeof a){var c=a.nodeType?a:m.createElement(a);b=function(a,b){var d=c.cloneNode(!1);return d.setAttribute("data-mce-index",b),a&&d.appendChild(m.createTextNode(a)),d}}else b=a;return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex;if(f===g){var i=f;e=i.parentNode,a.startNodeIndex>0&&(c=m.createTextNode(i.data.substring(0,a.startNodeIndex)),e.insertBefore(c,i));var j=b(a.match[0],h);return e.insertBefore(j,i),a.endNodeIndex0},m=function(b,d,f,g,i){var m,n,q,r,s,t,u=d.get();for(g=g!==!1,q=b.getBody(),n=a.grep(a.toArray(q.getElementsByTagName("span")),l),m=0;md.get()&&n[m].setAttribute("data-mce-index",s-1)}return d.set(u),g?(t=o(b,d),j(b,d)):(t=p(b,d),k(b,d)),!i&&t},n=function(b,d,f){var g,h,i,j;for(h=a.toArray(b.getBody().getElementsByTagName("span")),g=0;g0},p=function(a,b){return f(a,b.get()-1).length>0};return{done:n,find:i,next:j,prev:k,replace:m,hasNext:o,hasPrev:p}}),g("3",["7"],function(a){var b=function(b,c){var d=function(d){return a.done(b,c,d)},e=function(d,e,f){return a.find(b,c,d,e,f)},f=function(){return a.next(b,c)},g=function(){return a.prev(b,c)},h=function(d,e,f){return a.replace(b,c,d,e,f)};return{done:d,find:e,next:f,prev:g,replace:h}};return{get:b}}),g("8",["9","7"],function(a,b){var c=function(c,d){function e(){i.statusbar.find("#next").disabled(b.hasNext(c,d)===!1),i.statusbar.find("#prev").disabled(b.hasPrev(c,d)===!1)}function f(){c.windowManager.alert("Could not find the specified string.",function(){i.find("#find")[0].focus()})}var g,h={};c.undoManager.add(),g=a.trim(c.selection.getContent({format:"text"}));var i=c.windowManager.open({layout:"flex",pack:"center",align:"center",onClose:function(){c.focus(),b.done(c,d),c.undoManager.add()},onSubmit:function(a){var g,j,k,l;return a.preventDefault(),j=i.find("#case").checked(),l=i.find("#words").checked(),k=i.find("#find").value(),k.length?h.text===k&&h.caseState===j&&h.wholeWord===l?b.hasNext(c,d)?(b.next(c,d),void e()):void f():(g=b.find(c,d,k,j,l),g||f(),i.statusbar.items().slice(1).disabled(0===g),e(),void(h={text:k,caseState:j,wholeWord:l})):(b.done(c,d,!1),void i.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",subtype:"primary",onclick:function(){i.submit()}},{text:"Replace",disabled:!0,onclick:function(){b.replace(c,d,i.find("#replace").value())||(i.statusbar.items().slice(1).disabled(!0),d.set(-1),h={})}},{text:"Replace all",disabled:!0,onclick:function(){b.replace(c,d,i.find("#replace").value(),!0,!0),i.statusbar.items().slice(1).disabled(!0),h={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){b.prev(c,d),e()}},{text:"Next",name:"next",disabled:!0,onclick:function(){b.next(c,d),e()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:g},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}})};return{open:c}}),g("4",["8"],function(a){var b=function(b,c){b.addCommand("SearchReplace",function(){a.open(b,c)})};return{register:b}}),g("5",["8"],function(a){var b=function(b,c){return function(){a.open(b,c)}},c=function(a,c){a.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:b(a,c),separator:"before",context:"edit"}),a.addButton("searchreplace",{tooltip:"Find and replace",onclick:b(a,c)}),a.shortcuts.add("Meta+F","",b(a,c))};return{register:c}}),g("0",["1","2","3","4","5"],function(a,b,c,d,e){return b.add("searchreplace",function(b){var f=a(-1);return d.register(b,f),e.register(b,f),c.get(b,f)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0){for(o=l+1;o=0;o--)if(e(m[o]))return m[o];return null}var l,m,n,o;if(!(j.keyCode!==g.TAB||j.ctrlKey||j.altKey||j.metaKey||j.isDefaultPrevented())&&(n=f.explode(h.getTabFocus(b)),1===n.length&&(n[1]=n[0],n[0]=":prev"),m=j.shiftKey?":prev"===n[0]?k(-1):i.get(n[0]):":next"===n[1]?k(1):i.get(n[1]))){var p=c.get(m.id||m.name);m.id&&p?p.focus():e.setTimeout(function(){d.webkit||a.focus(),m.focus()},10),j.preventDefault()}}b.on("init",function(){b.inline&&i.setAttrib(b.getBody(),"tabIndex",null),b.on("keyup",j),d.gecko?b.on("keypress keydown",k):b.on("keydown",k)})};return{setup:k}}),g("0",["1","2"],function(a,b){return a.add("tabfocus",function(a){b.setup(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/template/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0&&(j=l.create("div",null),j.appendChild(k[0].cloneNode(!0))),a.each(l.select("*",j),function(a){h(a,c.getCreationDateClasses(b).replace(/\s+/g,"|"))&&(a.innerHTML=d.getDateTime(b,c.getCdateFormat(b))),h(a,c.getModificationDateClasses(b).replace(/\s+/g,"|"))&&(a.innerHTML=d.getDateTime(b,c.getMdateFormat(b))),h(a,c.getSelectedContentClasses(b).replace(/\s+/g,"|"))&&(a.innerHTML=m)}),g(b,j),b.execCommand("mceInsertContent",!1,j.innerHTML),b.addVisual()};return{createTemplateList:e,replaceTemplateValues:f,replaceVals:g,insertTemplate:i}}),g("2",["6","7"],function(a,b){var c=function(c){c.addCommand("mceInsertTemplate",a.curry(b.insertTemplate,c))};return{register:c}}),g("3",["8","9","a","7"],function(a,b,c,d){var e=function(e){e.on("PreProcess",function(f){var g=e.dom,h=b.getMdateFormat(e);a.each(g.select("div",f.node),function(b){g.hasClass(b,"mceTmpl")&&(a.each(g.select("*",b),function(a){g.hasClass(a,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(a.innerHTML=c.getDateTime(e,h))}),d.replaceVals(e,b))})})};return{setup:e}}),g("b",["f","8","e","9","7"],function(a,b,c,d,e){var f=function(a,c,f){if(f.indexOf("")===-1){var g="";b.each(a.contentCSS,function(b){g+=''});var h=a.settings.body_class||"";h.indexOf("=")!==-1&&(h=a.getParam("body_class","","hash"),h=h[a.id]||""),f=""+g+''+f+""}f=e.replaceTemplateValues(a,f,d.getPreviewReplaceValues(a));var i=c.find("iframe")[0].getEl().contentWindow.document;i.open(),i.write(f),i.close()},g=function(a,g){var h,i,j=[];if(!g||0===g.length){var k=a.translate("No templates defined.");return void a.notificationManager.open({text:k,type:"info"})}b.each(g,function(a){j.push({selected:!j.length,text:a.title,value:{url:a.url,content:a.content,description:a.description}})});var l=function(b){var d=b.control.value();d.url?c.send({url:d.url,success:function(b){i=b,f(a,h,i)}}):(i=d.content,f(a,h,i)),h.find("#description")[0].text(b.control.value().description)};h=a.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:j,onselect:l}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){e.insertTemplate(a,!1,i)},minWidth:d.getDialogWidth(a),minHeight:d.getDialogHeight(a)}),h.find("listbox")[0].fire("select")};return{open:g}}),g("4",["7","b"],function(a,b){var c=function(a){return function(c){b.open(a,c)}},d=function(b){b.addButton("template",{title:"Insert template",onclick:a.createTemplateList(b.settings,c(b))}),b.addMenuItem("template",{text:"Template",onclick:a.createTemplateList(b.settings,c(b)),icon:"template",context:"insert"})};return{register:d}}),g("0",["1","2","3","4"],function(a,b,c,d){return a.add("template",function(a){d.register(a),b.register(a),c.setup(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/textcolor/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i
'+(d?"×":"")+"
"};for(h=d.mapColors(f),h.push({text:b.translate("No color"),color:"transparent"}),j='',k=h.length-1,m=0;m",l=0;lk?j+="":(i=h[n],j+=q(i.color,i.text));j+=""}if(g){for(j+='",j+="",l=0;lb.start.length?-1:a.start.length0},e=function(b,e,f,g){var h,i,j=a(b);for(i=0;i0?a.splitText(d):a,a.splitText(c-d+b.end.length),a.deleteData(0,b.start.length),a.deleteData(a.data.length-b.end.length,b.end.length),a},f=function(b,c,e){if(c.collapsed!==!1){var f=c.startContainer,g=f.data,h=e===!0?1:0;if(3===f.nodeType){var i=d.findEndPattern(b,g,c.startOffset,h);if(void 0!==i){var j=g.lastIndexOf(i.end,c.startOffset-h),k=g.lastIndexOf(i.start,j-i.end.length);if(j=g.indexOf(i.end,k+i.start.length),k!==-1){var l=a.createRange();l.setStart(f,k),l.setEnd(f,j+i.end.length);var m=d.findPattern(b,l.toString());if(!(void 0===i||m!==i||f.data.length<=i.start.length+i.end.length))return{pattern:i,startOffset:k,endOffset:j}}}}}},g=function(a,b,d,f){var g=c.isArray(d.pattern.format)?d.pattern.format:[d.pattern.format],h=c.grep(g,function(b){var c=a.formatter.get(b);return c&&c[0].inline});if(0!==h.length)return a.undoManager.transact(function(){b=e(b,d.pattern,d.endOffset,d.startOffset,f),g.forEach(function(c){a.formatter.apply(c,{},b)})}),b},h=function(a,b,c){var d=a.selection.getRng(!0),e=f(b,d,c);if(e)return g(a,d.startContainer,e,c)},i=function(a,b){return h(a,b,!0)},j=function(a,b){return h(a,b,!1)},k=function(a,e){var f,g,h,i,j,k,l,m,n,o,p;if(f=a.selection,g=a.dom,f.isCollapsed()&&(l=g.getParent(f.getStart(),"p"))){for(n=new b(l,l);j=n.next();)if(3===j.nodeType){i=j;break}if(i){if(m=d.findPattern(e,i.data),!m)return;if(o=f.getRng(!0),h=o.startContainer,p=o.startOffset,i===h&&(p=Math.max(0,p-m.start.length)),c.trim(i.data).length===m.start.length)return;m.format&&(k=a.formatter.get(m.format),k&&k[0].block&&(i.deleteData(0,m.start.length),a.formatter.apply(m.format,{},i),o.setStart(h,p),o.collapse(!0),f.setRng(o))),m.cmd&&a.undoManager.transact(function(){i.deleteData(0,m.start.length),a.execCommand(m.cmd)})}}};return{patternFromRng:f,applyInlineFormatSpace:i,applyInlineFormatEnter:j,applyBlockFormat:k}}),g("9",["8","a"],function(a,b){function c(a,c){var d,e;d=b.applyInlineFormatEnter(a,c),d&&(e=a.dom.createRng(),e.setStart(d,d.data.length),e.setEnd(d,d.data.length),a.selection.setRng(e)),b.applyBlockFormat(a,c)}function d(a,c){var d,e,f,g,h;d=b.applyInlineFormatSpace(a,c),d&&(h=a.dom,e=d.data.slice(-1),/[\u00a0 ]/.test(e)&&(d.deleteData(d.data.length-1,1),f=h.doc.createTextNode(e),h.insertAfter(f,d.parentNode),g=h.createRng(),g.setStart(f,1),g.setEnd(f,1),a.selection.setRng(g)))}var e=function(a,b,c){for(var d=0;d=1&&b<=9?b:3};return{getTocClass:a,getTocHeader:b,getTocDepth:c}}),g("b",[],function(){var a=function(a){var b=0;return function(){var c=(new Date).getTime().toString(32);return a+c+(b++).toString(32)}};return{create:a}}),g("7",["8","9","a","3","b"],function(a,b,c,d,e){var f=e.create("mcetoc_"),g=function(a){var b,c=[];for(b=1;b<=a;b++)c.push("h"+b);return c.join(",")},h=function(a){return i(a).length>0},i=function(a){var b=d.getTocClass(a),e=d.getTocHeader(a),h=g(d.getTocDepth(a)),i=a.$(h);return i.length&&/^h[1-9]$/i.test(e)&&(i=i.filter(function(c,d){return!a.dom.hasClass(d.parentNode,b)})),c.map(i,function(b){return{id:b.id?b.id:f(),level:parseInt(b.nodeName.replace(/^H/i,""),10),title:a.$.text(b),element:b}})},j=function(a){var b,c=9;for(b=0;b',e="";return d+a.DOM.encode(c)+e},l=function(a){var b=m(a);return'
'+b+"
"},m=function(a){var c,e,f,g,h="",l=i(a),m=j(l)-1;if(!l.length)return"";for(h+=k(d.getTocHeader(a),b.translate("Table of Contents")),c=0;c";else for(e=m;e
  • ";if(h+=''+f.title+"",g!==f.level&&g)for(e=f.level;e>g;e--)h+="
  • ";else h+="
  • ",g||(h+="");m=f.level}return h},n=function(a,b){return!b.length||a.dom.getParents(b[0],".mce-offscreen-selection").length>0},o=function(a){var b=d.getTocClass(a),c=a.$("."+b);n(a,c)?a.insertContent(l(a)):p(a)},p=function(a){var b=d.getTocClass(a),c=a.$("."+b);c.length&&a.undoManager.transact(function(){c.html(m(a))})};return{hasHeaders:h,insertToc:o,updateToc:p}}),g("2",["7"],function(a){var b=function(b){b.addCommand("mceInsertToc",function(){a.insertToc(b)}),b.addCommand("mceUpdateToc",function(){a.updateToc(b)})};return{register:b}}),g("4",["3"],function(a){var b=function(b){var c=b.$,d=a.getTocClass(b);b.on("PreProcess",function(a){var b=c("."+d,a.node);b.length&&(b.removeAttr("contentEditable"),b.find("[contenteditable]").removeAttr("contentEditable"))}),b.on("SetContent",function(){var a=c("."+d);a.length&&(a.attr("contentEditable",!1),a.children(":first-child").attr("contentEditable",!0))})};return{setup:b}}),g("5",["3","7"],function(a,b){var c=function(a){return function(c){var d=c.control;a.on("LoadContent SetContent change",function(){d.disabled(a.readonly||!b.hasHeaders(a))})}},d=function(b){return function(c){return c&&b.dom.is(c,"."+a.getTocClass(b))&&b.getBody().contains(c)}},e=function(a){a.addButton("toc",{tooltip:"Table of Contents",cmd:"mceInsertToc",icon:"toc",onPostRender:c(a)}),a.addButton("tocupdate",{tooltip:"Update",cmd:"mceUpdateToc",icon:"reload"}),a.addMenuItem("toc",{text:"Table of Contents",context:"insert",cmd:"mceInsertToc",onPostRender:c(a)}),a.addContextToolbar(d(a),"tocupdate")};return{register:e}}),g("0",["1","2","3","4","5"],function(a,b,c,d,e){return a.add("toc",function(a){b.register(a),e.register(a),d.setup(a)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/visualblocks/css/visualblocks.css: -------------------------------------------------------------------------------- 1 | .mce-visualblocks p { 2 | padding-top: 10px; 3 | border: 1px dashed #BBB; 4 | margin-left: 3px; 5 | background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); 6 | background-repeat: no-repeat; 7 | } 8 | 9 | .mce-visualblocks h1 { 10 | padding-top: 10px; 11 | border: 1px dashed #BBB; 12 | margin-left: 3px; 13 | background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); 14 | background-repeat: no-repeat; 15 | } 16 | 17 | .mce-visualblocks h2 { 18 | padding-top: 10px; 19 | border: 1px dashed #BBB; 20 | margin-left: 3px; 21 | background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); 22 | background-repeat: no-repeat; 23 | } 24 | 25 | .mce-visualblocks h3 { 26 | padding-top: 10px; 27 | border: 1px dashed #BBB; 28 | margin-left: 3px; 29 | background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); 30 | background-repeat: no-repeat; 31 | } 32 | 33 | .mce-visualblocks h4 { 34 | padding-top: 10px; 35 | border: 1px dashed #BBB; 36 | margin-left: 3px; 37 | background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); 38 | background-repeat: no-repeat; 39 | } 40 | 41 | .mce-visualblocks h5 { 42 | padding-top: 10px; 43 | border: 1px dashed #BBB; 44 | margin-left: 3px; 45 | background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); 46 | background-repeat: no-repeat; 47 | } 48 | 49 | .mce-visualblocks h6 { 50 | padding-top: 10px; 51 | border: 1px dashed #BBB; 52 | margin-left: 3px; 53 | background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); 54 | background-repeat: no-repeat; 55 | } 56 | 57 | .mce-visualblocks div:not([data-mce-bogus]) { 58 | padding-top: 10px; 59 | border: 1px dashed #BBB; 60 | margin-left: 3px; 61 | background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); 62 | background-repeat: no-repeat; 63 | } 64 | 65 | .mce-visualblocks section { 66 | padding-top: 10px; 67 | border: 1px dashed #BBB; 68 | margin: 0 0 1em 3px; 69 | background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); 70 | background-repeat: no-repeat; 71 | } 72 | 73 | .mce-visualblocks article { 74 | padding-top: 10px; 75 | border: 1px dashed #BBB; 76 | margin: 0 0 1em 3px; 77 | background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); 78 | background-repeat: no-repeat; 79 | } 80 | 81 | .mce-visualblocks blockquote { 82 | padding-top: 10px; 83 | border: 1px dashed #BBB; 84 | background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); 85 | background-repeat: no-repeat; 86 | } 87 | 88 | .mce-visualblocks address { 89 | padding-top: 10px; 90 | border: 1px dashed #BBB; 91 | margin: 0 0 1em 3px; 92 | background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); 93 | background-repeat: no-repeat; 94 | } 95 | 96 | .mce-visualblocks pre { 97 | padding-top: 10px; 98 | border: 1px dashed #BBB; 99 | margin-left: 3px; 100 | background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); 101 | background-repeat: no-repeat; 102 | } 103 | 104 | .mce-visualblocks figure { 105 | padding-top: 10px; 106 | border: 1px dashed #BBB; 107 | margin: 0 0 1em 3px; 108 | background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); 109 | background-repeat: no-repeat; 110 | } 111 | 112 | .mce-visualblocks hgroup { 113 | padding-top: 10px; 114 | border: 1px dashed #BBB; 115 | margin: 0 0 1em 3px; 116 | background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); 117 | background-repeat: no-repeat; 118 | } 119 | 120 | .mce-visualblocks aside { 121 | padding-top: 10px; 122 | border: 1px dashed #BBB; 123 | margin: 0 0 1em 3px; 124 | background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); 125 | background-repeat: no-repeat; 126 | } 127 | 128 | .mce-visualblocks figcaption { 129 | border: 1px dashed #BBB; 130 | } 131 | 132 | .mce-visualblocks ul { 133 | padding-top: 10px; 134 | border: 1px dashed #BBB; 135 | margin: 0 0 1em 3px; 136 | background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); 137 | background-repeat: no-repeat; 138 | } 139 | 140 | .mce-visualblocks ol { 141 | padding-top: 10px; 142 | border: 1px dashed #BBB; 143 | margin: 0 0 1em 3px; 144 | background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); 145 | background-repeat: no-repeat; 146 | } 147 | 148 | .mce-visualblocks dl { 149 | padding-top: 10px; 150 | border: 1px dashed #BBB; 151 | margin: 0 0 1em 3px; 152 | background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); 153 | background-repeat: no-repeat; 154 | } 155 | -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/plugins/visualblocks/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i-1},h=function(a,b){return t(a,b).isSome()},i=function(a,b){for(var c=[],d=0;d=0;c--){var d=a[c];b(d,c,a)}},n=function(a,b){for(var c=[],d=[],e=0,f=a.length;e1)throw d.error("HTML does not have a single root node",a),"HTML must have a single root node";return i(f.childNodes[0])},g=function(a,b){var c=b||e,d=c.createElement(a);return i(d)},h=function(a,b){var c=b||e,d=c.createTextNode(a);return i(d)},i=function(b){if(null===b||void 0===b)throw new c("Node cannot be null or undefined");return{dom:a.constant(b)}},j=function(a,c,d){return b.from(a.dom().elementFromPoint(c,d)).map(i)};return{fromHtml:f,fromTag:g,fromText:h,fromDom:i,fromPoint:j}}),g("o",[],function(){return{ATTRIBUTE:2,CDATA_SECTION:4,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,ELEMENT:1,TEXT:3,PROCESSING_INSTRUCTION:7,ENTITY_REFERENCE:5,ENTITY:6,NOTATION:12}}),g("g",["o"],function(a){var b=function(a){var b=a.dom().nodeName;return b.toLowerCase()},c=function(a){return a.dom().nodeType},d=function(a){return a.dom().nodeValue},e=function(a){return function(b){return c(b)===a}},f=function(d){return c(d)===a.COMMENT||"#comment"===b(d)},g=e(a.ELEMENT),h=e(a.TEXT),i=e(a.DOCUMENT);return{name:b,type:c,value:d,isElement:g,isText:h,isDocument:i,isComment:f}}),g("p",["c"],function(a){var b=function(b){return''+b+""};return{wrapCharWithSpan:b}}),g("d",["e","f","g","c","p"],function(a,b,c,d,e){var f=function(a){return c.isText(a)&&void 0!==c.value(a)&&d.regExp.test(c.value(a))},g=function(c,d){var e=[],f=c.dom(),h=a.map(f.childNodes,b.fromDom);return a.each(h,function(a){d(a)&&(e=e.concat([a])),e=e.concat(g(a,d))}),e},h=function(a,b){for(;a.parentNode;){if(a.parentNode===b)return a;a=a.parentNode}},i=function(a){return a.replace(d.regExpGlobal,e.wrapCharWithSpan)};return{isMatch:f,filterDescendants:g,findParentElm:h,replaceWithSpans:i}}),g("a",["c","d","e","f","g"],function(a,b,c,d,e){var f=function(a,f){var g,h,i=b.filterDescendants(d.fromDom(f),b.isMatch);c.each(i,function(c){var d=b.replaceWithSpans(e.value(c));for(h=a.dom.create("div",null,d);g=h.lastChild;)a.dom.insertAfter(g,c.dom());a.dom.remove(c.dom())})},g=function(b,d){var e=b.dom.select(a.selector,d);c.each(e,function(a){b.dom.remove(a,1)})},h=function(a){var c=a.getBody(),d=a.selection.getBookmark(),e=b.findParentElm(a.selection.getNode(),c);e=void 0!==e?e:c,g(a,e),f(a,e),a.selection.moveToBookmark(d)};return{show:f,hide:g,toggle:h}}),g("8",["b","a"],function(a,b){var c=function(c,d){var e,f=c.getBody(),g=c.selection;d.set(!d.get()),a.fireVisualChars(c,d.get()),e=g.getBookmark(),d.get()===!0?b.show(c,f):b.hide(c,f),g.moveToBookmark(e)};return{toggleVisualChars:c}}),g("4",["8"],function(a){var b=function(b,c){b.addCommand("mceVisualChars",function(){a.toggleVisualChars(b,c)})};return{register:b}}),g("9",["7"],function(a){return a("tinymce.util.Delay")}),g("5",["9","a"],function(a,b){var c=function(c,d){var e=a.debounce(function(){b.toggle(c)},300);c.settings.forced_root_block!==!1&&c.on("keydown",function(a){d.get()===!0&&(13===a.keyCode?b.toggle(c):e())})};return{setup:c}}),g("6",[],function(){var a=function(a){return function(b){var c=b.control;a.on("VisualChars",function(a){c.active(a.state)})}},b=function(b){b.addButton("visualchars",{active:!1,title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:a(b)}),b.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:a(b),selectable:!0,context:"view",prependToContext:!0})};return{register:b}}),g("0",["1","2","3","4","5","6"],function(a,b,c,d,e,f){return b.add("visualchars",function(b){var g=a(!1);return d.register(b,g),f.register(b),e.setup(b,g),c.get(g)}),function(){}}),d("0")()}(); -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/content.inline.min.css: -------------------------------------------------------------------------------- 1 | .word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid rgba(208,2,27,0.5);cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#2276d2 !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2276d2}.mce-content-body *[data-mce-selected="inline-boundary"]{background:#bfe6ff}.mce-content-body .mce-item-anchor[data-mce-selected]{background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-content-body hr{cursor:default}.ephox-snooker-resizer-bar{background-color:#2276d2;opacity:0}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:.2}.mce-content-body{line-height:1.3} -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/content.min.css: -------------------------------------------------------------------------------- 1 | body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;line-height:1.3;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px}.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid rgba(208,2,27,0.5);cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#2276d2 !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2276d2}.mce-content-body *[data-mce-selected="inline-boundary"]{background:#bfe6ff}.mce-content-body .mce-item-anchor[data-mce-selected]{background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-content-body hr{cursor:default}.ephox-snooker-resizer-bar{background-color:#2276d2;opacity:0}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:.2} -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/content.mobile.min.css: -------------------------------------------------------------------------------- 1 | .tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{position:absolute;display:inline-block;background-color:green;opacity:.5}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%} -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-mobile.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-mobile.woff -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.eot -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce-small.woff -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.eot -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.ttf -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/fonts/tinymce.woff -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/img/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/img/anchor.gif -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/img/loader.gif -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/img/object.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/img/object.gif -------------------------------------------------------------------------------- /data/editor/tinymce/js/tinymce/skins/lightgray/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/tinymce/js/tinymce/skins/lightgray/img/trans.gif -------------------------------------------------------------------------------- /data/editor/vanillatree/target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/editor/vanillatree/target.png -------------------------------------------------------------------------------- /data/editor/vanillatree/vanillatree-draggable.js: -------------------------------------------------------------------------------- 1 | /* globals sidebar, tree, api */ 2 | 'use strict'; 3 | 4 | // make all a elements draggable 5 | sidebar.root.addEventListener('vtree-add', e => { 6 | const source = e.target.querySelector('a'); 7 | source.draggable = true; 8 | }); 9 | 10 | sidebar.once('open', () => { 11 | const img = document.createElement('img'); 12 | img.src = 'vanillatree/target.png'; 13 | let source; 14 | sidebar.root.addEventListener('dragstart', e => { 15 | e.dataTransfer.setData('text', e.target.closest('li').dataset.vtreeId); 16 | e.dataTransfer.setDragImage(img, 0, 0); 17 | e.target.source = true; 18 | source = e.target; 19 | }); 20 | // clean-up 21 | sidebar.root.addEventListener('dragend', () => source && delete source.source); 22 | // allow drop 23 | sidebar.root.addEventListener('dragover', e => { 24 | const target = e.target; 25 | if (target.draggable === true && target.source !== true) { 26 | e.preventDefault(); 27 | } 28 | }); 29 | // add a new class on drag enter 30 | sidebar.root.addEventListener('dragenter', e => { 31 | const target = e.target; 32 | 33 | if (target.draggable === true && target.source !== true) { 34 | target.classList.add('dragged'); 35 | } 36 | }); 37 | // remove the class on drag leave 38 | sidebar.root.addEventListener('dragleave', e => { 39 | const target = e.target; 40 | 41 | if (target.draggable === true) { 42 | target.classList.remove('dragged'); 43 | e.stopPropagation(); 44 | } 45 | }); 46 | // change the header on drop and dispatch an event 47 | sidebar.root.addEventListener('drop', e => { 48 | const sid = e.dataTransfer.getData('text'); 49 | // clean up 50 | e.target.classList.remove('dragged'); 51 | delete tree.getLeaf(sid).querySelector('a').source; 52 | 53 | let did = e.target.closest('li').dataset.vtreeId; 54 | did = sidebar.parent(sidebar.cache[did]); 55 | 56 | const note = sidebar.cache[sid]; 57 | note.parent = did; 58 | try { 59 | tree.move(sid, did); 60 | sidebar.save(note).then(() => sidebar.emit('position-changed', sidebar.cache[sid])); 61 | } 62 | catch (e) { 63 | api.user.alert('Operation not permitted', e.message); 64 | } 65 | }); 66 | }); 67 | -------------------------------------------------------------------------------- /data/editor/vanillatree/vanillatree.css: -------------------------------------------------------------------------------- 1 | .vtree ul.vtree-subtree, .vtree li.vtree-leaf { 2 | margin: 0; 3 | padding: 0; 4 | list-style-type: none; 5 | position: relative; 6 | } 7 | 8 | .vtree li.vtree-leaf { 9 | background-position: -90px 0; 10 | background-repeat: repeat-y; 11 | min-height: 18px; 12 | line-height: 18px; 13 | } 14 | 15 | .vtree li.vtree-leaf::before { 16 | content: ''; 17 | width: 18px; 18 | height: 18px; 19 | position: absolute; 20 | background-position: -36px 0; 21 | } 22 | 23 | .vtree li.vtree-leaf li.vtree-leaf { 24 | margin-left: 18px; 25 | } 26 | 27 | .vtree li.vtree-leaf:last-child { 28 | background-image: none; 29 | } 30 | 31 | .vtree li.vtree-leaf.closed ul.vtree-subtree { 32 | display: none; 33 | } 34 | 35 | .vtree li.vtree-leaf.vtree-has-children > span.vtree-toggle { 36 | display: block; 37 | width: 18px; 38 | height: 18px; 39 | background-position: -72px 0; 40 | position: absolute; 41 | left: 0; 42 | top: 0; 43 | } 44 | 45 | .vtree li.vtree-leaf.vtree-has-children.closed > span.vtree-toggle { 46 | background-position: -54px 0; 47 | } 48 | 49 | .vtree a.vtree-leaf-label { 50 | line-height: 18px; 51 | display: inline-block; 52 | vertical-align: top; 53 | cursor: pointer; 54 | max-width: 100%; 55 | margin-left: 18px; 56 | padding: 0 2px; 57 | } 58 | 59 | .vtree li.vtree-leaf a.vtree-leaf-label:hover { 60 | background-color: #e7f4f9; 61 | outline: 1px solid #d8f0fa; 62 | } 63 | 64 | .vtree li.vtree-leaf.vtree-selected > a.vtree-leaf-label { 65 | background-color: #beebff; 66 | outline: 1px solid #99defd; 67 | } 68 | 69 | .vtree-contextmenu { 70 | position: absolute; 71 | z-index: 9999999; 72 | border: solid 1px #ccc; 73 | background: #eee; 74 | padding: 0px; 75 | margin: 0px; 76 | display: none; 77 | } 78 | 79 | .vtree-contextmenu li { 80 | list-style: none; 81 | padding: 1px 5px; 82 | margin: 0px; 83 | color: #333; 84 | line-height: 20px; 85 | height: 20px; 86 | cursor: default; 87 | } 88 | 89 | .vtree-contextmenu li:hover { 90 | color: #fff; 91 | background-color: #3399ff; 92 | } 93 | 94 | .vtree li.vtree-leaf, .vtree li.vtree-leaf::before, .vtree li.vtree-leaf.vtree-has-children > span.vtree-toggle { 95 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAASCAYAAAC+Tjt8AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfeAgYPCDEpEBZMAAABNElEQVRYw+2YIRKDMBBFdzu9AOgOlgNwBCQKh8RyBjRXQKOYSBSSG3AAbKcajrBVzFRACiGFUPabCDI7+/j7QwYkImCdR7ezNew4D7pyHeSEccI4YZww1teElWX5Eydd16UjJ3rk0p2MvbikR6IQgnSbtTXRz+cLt/YhhCAddcZ+9uSSGub7PhRFQbrM8jwPEBGOTNjZuaSGWZYFQRBAnuekA0rXRG+tcWYuqWGICLZtQxiGkGUZHQ31OYlz66Kb1gTX2jpzXCr9rNl/lz0kIhiGAaqqgjRNUcUsIoK2bbUZNk7i3LpEU1xr6si4VPpZs19qWN/3UNc1JEmidAx1XYdgoEzkcpzHoovQTTaFTdNAHMdGvnRVmcq1+RuGiBBF0V+ZZTIX/+m42p8OFieMxQm7XsLeiBbbT7ejthwAAAAASUVORK5CYII=); 96 | } 97 | -------------------------------------------------------------------------------- /data/editor/vanillatree/vanillatree.js: -------------------------------------------------------------------------------- 1 | (function (root, factory) { 2 | if (typeof define == 'function' && define.amd) { 3 | define( factory ); 4 | } else if (typeof module === 'object' && module.exports) { 5 | module.exports = factory(); 6 | } else { 7 | root.VanillaTree = factory(); 8 | } 9 | }(this, function () { 10 | "use strict"; 11 | // Look at the Balalaika https://github.com/finom/balalaika 12 | var $=function(n,e,k,h,p,m,l,b,d,g,f,c){c=function(a,b){return new c.i(a,b)};c.i=function(a,d){k.push.apply(this,a?a.nodeType||a==n?[a]:""+a===a?/' + this.placeholder + '' 97 | } else if( p = this.tree.querySelector( '.vtree-placeholder' ) ) { 98 | this.tree.removeChild( p ); 99 | } 100 | return this; 101 | }, 102 | getLeaf: function( id, notThrow ) { 103 | var leaf = $( '[data-vtree-id="' + id + '"]', this.tree )[ 0 ]; 104 | if( !notThrow && !leaf ) throw Error( 'No VanillaTree leaf with id "' + id + '"' ) 105 | return leaf; 106 | }, 107 | getChildList: function( id ) { 108 | var list, 109 | parent; 110 | if( id ) { 111 | parent = this.getLeaf( id ); 112 | if( !( list = $( 'ul', parent )[ 0 ] ) ) { 113 | list = parent.appendChild( create( 'ul', { 114 | className: 'vtree-subtree' 115 | }) ); 116 | } 117 | } else { 118 | list = this.tree; 119 | } 120 | 121 | return list; 122 | }, 123 | add: function( options ) { 124 | var id, 125 | leaf = create( 'li', { 126 | className: 'vtree-leaf' 127 | }), 128 | parentList = this.getChildList( options.parent ); 129 | 130 | leaf.setAttribute( 'data-vtree-id', id = options.id || Math.random() ); 131 | 132 | leaf.appendChild( create( 'span', { 133 | className: 'vtree-toggle' 134 | }) ); 135 | 136 | leaf.appendChild( create( 'a', { 137 | className: 'vtree-leaf-label', 138 | innerHTML: options.label 139 | }) ); 140 | 141 | parentList.appendChild( leaf ); 142 | 143 | if( parentList !== this.tree ) { 144 | parentList.parentNode.classList.add( 'vtree-has-children' ); 145 | } 146 | 147 | this.leafs[ id ] = options; 148 | 149 | if( !options.opened ) { 150 | this.close( id ); 151 | } 152 | 153 | if( options.selected ) { 154 | this.select( id ); 155 | } 156 | 157 | return this._placeholder()._dispatch( 'add', id ); 158 | }, 159 | move: function( id, parentId ) { 160 | var leaf = this.getLeaf( id ), 161 | oldParent = leaf.parentNode, 162 | newParent = this.getLeaf( parentId, true ); 163 | 164 | if( newParent ) { 165 | newParent.classList.add( 'vtree-has-children' ); 166 | } 167 | 168 | this.getChildList( parentId ).appendChild( leaf ); 169 | oldParent.parentNode.classList.toggle( 'vtree-has-children', !!oldParent.children.length ); 170 | 171 | return this._dispatch( 'move', id ); 172 | }, 173 | remove: function( id ) { 174 | var leaf = this.getLeaf( id ), 175 | oldParent = leaf.parentNode; 176 | oldParent.removeChild( leaf ); 177 | oldParent.parentNode.classList.toggle( 'vtree-has-children', !!oldParent.children.length ); 178 | 179 | return this._placeholder()._dispatch( 'remove', id ); 180 | }, 181 | open: function( id ) { 182 | this.getLeaf( id ).classList.remove( 'closed' ); 183 | return this._dispatch( 'open', id ); 184 | }, 185 | close: function( id ) { 186 | this.getLeaf( id ).classList.add( 'closed' ); 187 | return this._dispatch( 'close', id ); 188 | }, 189 | toggle: function( id ) { 190 | return this[ this.getLeaf( id ).classList.contains( 'closed' ) ? 'open' : 'close' ]( id ); 191 | }, 192 | select: function( id ) { 193 | var leaf = this.getLeaf( id ); 194 | 195 | if( !leaf.classList.contains( 'vtree-selected' ) ) { 196 | $( 'li.vtree-leaf', this.tree ).forEach( function( leaf ) { 197 | leaf.classList.remove( 'vtree-selected' ); 198 | }); 199 | 200 | leaf.classList.add( 'vtree-selected' ); 201 | this._dispatch( 'select', id ); 202 | } 203 | 204 | return this; 205 | } 206 | }; 207 | 208 | return Tree; 209 | // Look at the Balalaika https://github.com/finom/balalaika 210 | })); 211 | -------------------------------------------------------------------------------- /data/icons/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/icons/128.png -------------------------------------------------------------------------------- /data/icons/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/icons/16.png -------------------------------------------------------------------------------- /data/icons/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/icons/256.png -------------------------------------------------------------------------------- /data/icons/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/icons/32.png -------------------------------------------------------------------------------- /data/icons/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/icons/48.png -------------------------------------------------------------------------------- /data/icons/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inbasic/notepad/48de9174d196285e3fd1347e7221d45391677a91/data/icons/64.png -------------------------------------------------------------------------------- /data/options/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Notepad :: Options 7 | 8 | 9 | 24 | 25 | Apply the following styles to the editor (e.g.: color: red !important): 26 | 27 | Apply the following CSS rules to the root element: 28 | 29 | 30 |

    31 | 32 | 33 | 34 | 35 |

    36 |

    37 | 38 | 1 39 | 2 40 |

    41 |
      42 |
    • 1: In Firefox browser, if the internal popup blocker prevents the browse window to appear, open the options page in a browser tab using the "Open in Page" button and then append notes
    • 43 |
    • 2: All the saved notes will be deleted. There is no undo for this action.
    • 44 |
    45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /data/options/index.js: -------------------------------------------------------------------------------- 1 | /* global mscConfirm */ 2 | 3 | 'use strict'; 4 | 5 | document.getElementById('editor-css').value = (localStorage.getItem('editor-css') || ''); 6 | document.getElementById('root-css').value = (localStorage.getItem('root-css') || ''); 7 | 8 | document.getElementById('save').addEventListener('click', () => { 9 | localStorage.setItem('editor-css', document.getElementById('editor-css').value); 10 | localStorage.setItem('root-css', document.getElementById('root-css').value); 11 | 12 | const info = document.getElementById('info'); 13 | info.textContent = 'Options saved'; 14 | window.setTimeout(() => info.textContent = '', 750); 15 | }); 16 | document.getElementById('support').addEventListener('click', () => chrome.tabs.create({ 17 | url: chrome.runtime.getManifest().homepage_url + '?rd=donate' 18 | })); 19 | 20 | document.getElementById('export').addEventListener('click', () => chrome.storage.local.get(null, prefs => { 21 | const p = {}; 22 | p.headers = (prefs.headers || []); 23 | p.headers.forEach(({id}) => { 24 | p[id + '-content'] = prefs[id + '-content']; 25 | p[id + '-bookmark'] = prefs[id + '-bookmark']; 26 | }); 27 | 28 | const text = JSON.stringify(p, null, '\t'); 29 | const blob = new Blob([text], {type: 'application/json'}); 30 | const objectURL = URL.createObjectURL(blob); 31 | Object.assign(document.createElement('a'), { 32 | href: objectURL, 33 | type: 'application/json', 34 | download: 'my-notes.json' 35 | }).dispatchEvent(new MouseEvent('click')); 36 | setTimeout(() => URL.revokeObjectURL(objectURL)); 37 | })); 38 | 39 | function close() { 40 | chrome.runtime.sendMessage({ 41 | method: 'close' 42 | }); 43 | } 44 | 45 | document.getElementById('import').addEventListener('click', () => { 46 | chrome.storage.local.get(null, prefs => { 47 | const fileInput = document.createElement('input'); 48 | fileInput.style.display = 'none'; 49 | fileInput.type = 'file'; 50 | fileInput.accept = '.json'; 51 | fileInput.acceptCharset = 'utf-8'; 52 | 53 | document.body.appendChild(fileInput); 54 | fileInput.initialValue = fileInput.value; 55 | fileInput.onchange = readFile; 56 | fileInput.click(); 57 | 58 | function readFile() { 59 | if (fileInput.value !== fileInput.initialValue) { 60 | const file = fileInput.files[0]; 61 | if (file.size > 100e6) { 62 | console.warn('100MB backup? I don\'t believe you.'); 63 | return; 64 | } 65 | const fReader = new FileReader(); 66 | fReader.onloadend = event => { 67 | fileInput.remove(); 68 | const json = JSON.parse(event.target.result); 69 | const ids = []; 70 | json.headers.forEach(o => ids.push(o.id)); 71 | // remove duplicated ids 72 | prefs.headers = (prefs.headers || []).filter(o => ids.indexOf(o.id) === -1); 73 | prefs.headers = [...prefs.headers, ...json.headers]; 74 | const p = { 75 | headers: prefs.headers 76 | }; 77 | json.headers.map(o => o.id).forEach(id => { 78 | p[id + '-content'] = json[id + '-content']; 79 | p[id + '-bookmark'] = json[id + '-bookmark']; 80 | }); 81 | close(); 82 | window.setTimeout(() => chrome.storage.local.set(p, () => chrome.runtime.reload()), 1000); 83 | }; 84 | fReader.readAsText(file, 'utf-8'); 85 | } 86 | } 87 | }); 88 | }); 89 | document.getElementById('reset').addEventListener('click', () => { 90 | mscConfirm('All your notes will be deleted. Are you sure?', () => { 91 | close(); 92 | window.setTimeout(() => { 93 | chrome.storage.local.clear(() => chrome.runtime.reload()); 94 | }, 500); 95 | }); 96 | }); 97 | 98 | document.getElementById('open').addEventListener('click', () => chrome.tabs.create({ 99 | url: '/data/options/index.html' 100 | })); 101 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 3, 3 | "version": "0.2.0", 4 | "name": "Notepad", 5 | "description": "A simple yet powerful notepad with HTML5 support and more", 6 | "icons": { 7 | "16": "data/icons/16.png", 8 | "32": "data/icons/32.png", 9 | "48": "data/icons/48.png", 10 | "64": "data/icons/64.png", 11 | "128": "data/icons/128.png", 12 | "256": "data/icons/256.png" 13 | }, 14 | "permissions": [ 15 | "storage", 16 | "contextMenus" 17 | ], 18 | "homepage_url": "https://webextension.org/listing/notepad.html", 19 | "action": {}, 20 | "background": { 21 | "service_worker": "worker.js" 22 | }, 23 | "options_ui": { 24 | "page": "data/options/index.html" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /worker.js: -------------------------------------------------------------------------------- 1 | const store = prefs => new Promise(resolve => chrome.storage.local.set(prefs, resolve)); 2 | 3 | chrome.runtime.onMessage.addListener((request, sender, response) => { 4 | if (request.method === 'save-note') { 5 | const {id, content, bookmark} = request; 6 | 7 | store({ 8 | [id + '-content']: content, 9 | [id + '-bookmark']: bookmark 10 | }).then(response); 11 | 12 | return true; 13 | } 14 | else if (request.method === 'save-bookmark') { 15 | const {id, bookmark} = request; 16 | 17 | store({ 18 | [id + '-bookmark']: bookmark 19 | }).then(response); 20 | 21 | return true; 22 | } 23 | else if (request.method === 'delete-note') { 24 | const {id} = request; 25 | 26 | chrome.storage.local.remove([ 27 | id + '-content', 28 | id + '-bookmark' 29 | ]); 30 | } 31 | else if (request.method === 'bring-to-front') { 32 | chrome.tabs.update(sender.tab.id, { 33 | highlighted: true 34 | }); 35 | chrome.windows.update(sender.tab.windowId, { 36 | focused: true 37 | }); 38 | } 39 | }); 40 | 41 | chrome.contextMenus.onClicked.addListener(info => { 42 | const {menuItemId, selectionText} = info; 43 | 44 | if (menuItemId.startsWith('note-')) { 45 | chrome.runtime.sendMessage({ 46 | method: 'append-content', 47 | content: selectionText 48 | }, r => { 49 | chrome.runtime.lastError; 50 | if (r !== true) { 51 | const id = menuItemId + '-content'; 52 | 53 | chrome.storage.local.get({ 54 | [id]: '' 55 | }, prefs => { 56 | const content = prefs[id] + '

    ' + selectionText; 57 | store({ 58 | [id]: content 59 | }); 60 | }); 61 | } 62 | }); 63 | } 64 | }); 65 | 66 | // browser action UI opening 67 | chrome.action.onClicked.addListener(tab => { 68 | chrome.runtime.sendMessage({ 69 | method: 'exists' 70 | }, async r => { 71 | chrome.runtime.lastError; 72 | const win = await chrome.windows.getCurrent(); 73 | 74 | chrome.storage.local.get({ 75 | 'mode': 'tab', 76 | 'width': 800, 77 | 'height': 600, 78 | 'content-height': 300, 79 | 'left': win.left + Math.round((win.width - 700) / 2), 80 | 'top': win.top + Math.round((win.height - 500) / 2) 81 | }, prefs => { 82 | if (prefs.mode === 'tab') { 83 | if (r !== true) { 84 | chrome.tabs.create({ 85 | index: tab.index + 1, 86 | url: '/data/editor/index.html' 87 | }); 88 | } 89 | } 90 | else if (prefs.mode === 'application-content') { 91 | chrome.windows.get(tab.windowId, win => { 92 | chrome.windows.update(tab.windowId, { 93 | top: win.top, 94 | height: win.height - prefs['content-height'] 95 | }); 96 | if (r !== true) { 97 | chrome.windows.create({ 98 | url: 'data/editor/index.html', 99 | width: win.width, 100 | height: prefs['content-height'], 101 | left: win.left, 102 | top: win.top + win.height - 300, 103 | type: 'popup' 104 | }); 105 | } 106 | }); 107 | } 108 | else if (r !== true) { 109 | chrome.windows.create({ 110 | url: 'data/editor/index.html', 111 | width: prefs.width, 112 | height: prefs.height, 113 | left: prefs.left, 114 | top: prefs.top, 115 | type: 'popup' 116 | }); 117 | } 118 | }); 119 | }); 120 | }); 121 | 122 | // context-menu creation 123 | const menu = () => { 124 | chrome.storage.local.get({ 125 | mode: 'tab', 126 | headers: [{ 127 | name: 'My first note', 128 | id: 'note--1' 129 | }] 130 | }, ({headers, mode}) => { 131 | const cache = {}; 132 | headers.forEach(h => cache[h.id] = h); 133 | const items = headers.filter(h => h.id.startsWith('note-')).map(h => ({ 134 | type: 'normal', 135 | id: h.id, 136 | title: (h.parent && cache[h.parent] ? cache[h.parent].name + '/' + h.name : h.name) || 'no name', 137 | contexts: ['selection'], 138 | documentUrlPatterns: ['*://*/*'] 139 | })); 140 | // browser-action 141 | items.push({ 142 | id: 'browser-mode-tab', 143 | title: 'Mode: Tab', 144 | contexts: ['action'], 145 | type: 'radio', 146 | checked: mode === 'tab' 147 | }, { 148 | id: 'browser-mode-window', 149 | title: 'Mode: Window', 150 | contexts: ['action'], 151 | type: 'radio', 152 | checked: mode === 'window' 153 | }, { 154 | id: 'browser-mode-application-content', 155 | title: 'Mode: Application Content', 156 | contexts: ['action'], 157 | type: 'radio', 158 | checked: mode === 'application-content' 159 | }); 160 | chrome.contextMenus.removeAll(() => { 161 | for (const item of items) { 162 | chrome.contextMenus.create(item); 163 | } 164 | }); 165 | }); 166 | }; 167 | chrome.runtime.onInstalled.addListener(menu); 168 | chrome.runtime.onStartup.addListener(menu); 169 | chrome.storage.onChanged.addListener(ps => ps.headers && menu()); 170 | 171 | chrome.contextMenus.onClicked.addListener(({menuItemId}) => { 172 | store({ 173 | mode: menuItemId.replace('browser-mode-', '') 174 | }); 175 | }); 176 | 177 | /* FAQs & Feedback */ 178 | { 179 | const {management, runtime: {onInstalled, setUninstallURL, getManifest}, storage, tabs} = chrome; 180 | if (navigator.webdriver !== true) { 181 | const page = getManifest().homepage_url; 182 | const {name, version} = getManifest(); 183 | onInstalled.addListener(({reason, previousVersion}) => { 184 | management.getSelf(({installType}) => installType === 'normal' && storage.local.get({ 185 | 'faqs': true, 186 | 'last-update': 0 187 | }, prefs => { 188 | if (reason === 'install' || (prefs.faqs && reason === 'update')) { 189 | const doUpdate = (Date.now() - prefs['last-update']) / 1000 / 60 / 60 / 24 > 45; 190 | if (doUpdate && previousVersion !== version) { 191 | tabs.query({active: true, currentWindow: true}, tbs => tabs.create({ 192 | url: page + '?version=' + version + (previousVersion ? '&p=' + previousVersion : '') + '&type=' + reason, 193 | active: reason === 'install', 194 | ...(tbs && tbs.length && {index: tbs[0].index + 1}) 195 | })); 196 | storage.local.set({'last-update': Date.now()}); 197 | } 198 | } 199 | })); 200 | }); 201 | setUninstallURL(page + '?rd=feedback&name=' + encodeURIComponent(name) + '&version=' + version); 202 | } 203 | } 204 | --------------------------------------------------------------------------------