├── 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 | 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;i]*>/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 "};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 '+j+""}else b+=""}b+=""}return b+=" 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 ",a.each(b,function(a){var b=c+"/img/smiley-"+a+".gif";d+=' '}),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