From f7e10b86983aa3e397187a6e705c1b135dc76f6a Mon Sep 17 00:00:00 2001 From: Offerel <14041522+Offerel@users.noreply.github.com> Date: Sun, 7 Feb 2021 12:47:12 +0100 Subject: [PATCH] Fixed wrong links --- CHANGELOG.md | 3 +++ composer.json | 2 +- js/notes.js | 20 +++++++++++++++--- js/notes.min.js | 4 ++-- js/primitivenotes.js | 2 +- js/primitivenotes.min.js | 2 +- notes.php | 40 +++++++++++------------------------- primitivenotes.php | 2 +- skins/primitivenotes.css | 15 +++++++++++--- skins/primitivenotes.min.css | 2 +- 10 files changed, 51 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd00ac3..a505f09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### v2.0.3 +- Fixed an issue, where links are converted wrong + ### v2.0.2 - Added option button to jump directly to plugin options (thanks to Aleksander Machniak) - Added function to paste selected text from browser, converted automatically to Markdown with [Turndown](https://github.com/domchristie/turndown) diff --git a/composer.json b/composer.json index adddf82..f5edccb 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "homepage": "https://github.com/Offerel/roundcube_primitivenotes", "type": "roundcube-plugin", "license": "AGPL-3.0", - "version": "2.0.2", + "version": "2.0.3", "authors": [ { "name": "Offerel", diff --git a/js/notes.js b/js/notes.js index faaa3bb..ee6e8bf 100644 --- a/js/notes.js +++ b/js/notes.js @@ -1,7 +1,7 @@ /** * Roundcube Notes Plugin * - * @version 2.0.2 + * @version 2.0.3 * @author Offerel * @copyright Copyright (c) 2021, Offerel * @license GNU General Public License, version 3 @@ -33,19 +33,32 @@ $(document).ready(function(){ } }); + let cookiesArr = document.cookie.split(';'); + var media_folder; + cookiesArr.forEach(function(element){ + let cookie = element.split('='); + if(cookie[0].indexOf('pn_') > 0) media_folder = JSON.parse(decodeURIComponent(cookie[1])); + }); + var mde = new EasyMDE({ element: document.getElementById('editor1'), autoDownloadFontAwesome: false, autofocus: true, + previewImagesInEditor: false, spellChecker: false, autofocus: true, status: false, promptURLs: true, inputStyle: 'contenteditable', nativeSpellcheck: true, + forceSync: true, //sideBySideFullscreen: false, renderingConfig: { codeSyntaxHighlighting: true, + sanitizerFunction: function(renderedHTML) { + let output = renderedHTML.replaceAll(media_folder,'notes.php?blink='); + return output; + }, }, toolbar: [{ name: 'Save', action: saveFile, @@ -189,7 +202,6 @@ $(document).ready(function(){ let cstart = pastedText.indexOf('---',4) + 3; for(var i = 1; i < 10; i++) { if(textArr[i] == '---') break; - console.log(textArr[i]); let yentry = textArr[i].split(':'); if(yentry[0] == 'title') document.getElementById('note_name').value = yentry[1].trim(); if(yentry[0] == 'tags') tagify.addTags(yentry[1]); @@ -305,13 +317,15 @@ $(document).ready(function(){ document.querySelector('.EasyMDEContainer').style = 'display: block;'; document.getElementById('editor1').style = 'display none;'; - mde.value(note.content); + document.getElementById('editor1').value = note.content; + mde.value(note.content); if(note.mime_type.substr(0, 4) == 'text') { if(document.getElementById('estate').value == 'e') { document.getElementById('estate').value = 's'; mde.togglePreview(); + //if(mde.isPreviewActive()) mde.togglePreview(); } var headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); if(headings.length > 0) { diff --git a/js/notes.min.js b/js/notes.min.js index ce4df6f..7f38217 100644 --- a/js/notes.min.js +++ b/js/notes.min.js @@ -1,9 +1,9 @@ /** * Roundcube Notes Plugin * - * @version 2.0.2 + * @version 2.0.3 * @author Offerel * @copyright Copyright (c) 2021, Offerel * @license GNU General Public License, version 3 */ -$(document).ready((function(){var tagify=new Tagify(document.querySelector("#ntags"),{whitelist:[],dropdown:{classname:"color-blue",enabled:0,maxItems:0,position:"text",closeOnSelect:!1,highlightFirst:!0},trim:!0,duplicates:!1,enforceWhitelist:!1,delimiters:",|;| ",placeholder:"Tags"});$.ajax({type:"POST",url:"notes.php",data:{action:"getTags"},success:function(data){tagify.settings.whitelist=JSON.parse(data)}});var mde=new EasyMDE({element:document.getElementById("editor1"),autoDownloadFontAwesome:!1,autofocus:!0,spellChecker:!1,autofocus:!0,status:!1,promptURLs:!0,inputStyle:"contenteditable",nativeSpellcheck:!0,renderingConfig:{codeSyntaxHighlighting:!0},toolbar:[{name:"Save",action:saveFile,className:"fa fa-floppy-o",title:"Save"},"|","undo","redo","|","bold","italic","strikethrough","clean-block","|","heading","heading-smaller","heading-bigger","|","code","quote","unordered-list","ordered-list","|","link",{name:"Image",action:uplInsertImage,className:"fa fa-picture-o",title:"Add image from URL"},{name:"Image",action:uplLocalImage,className:"fa fa-file-image-o",title:"Upload and insert local image"},"table","|","preview","side-by-side","fullscreen","guide","|"]});function pasteParse(event){const pastedText=event.clipboardData.getData("text"),pastedHTML=event.clipboardData.getData("text/html");let textArr=pastedText.split("\n");if("---"==textArr[0]){let cstart=pastedText.indexOf("---",4)+3;for(var i=1;i<10&&"---"!=textArr[i];i++){console.log(textArr[i]);let yentry=textArr[i].split(":");"title"==yentry[0]&&(document.getElementById("note_name").value=yentry[1].trim()),"tags"==yentry[0]&&tagify.addTags(yentry[1]),"author"==yentry[0]&&(document.getElementById("author").value=yentry[1].trim()),"date"==yentry[0]&&(document.getElementById("date").value=yentry.slice(1).join(":").trim()),"source"==yentry[0]&&(document.getElementById("source").value=yentry.slice(1).join(":").trim())}mde.value(pastedText.substr(cstart).trim())}if(pastedHTML){var options={headingStyle:"atx",hr:"-",bulletListMarker:"-",codeBlockStyle:"fenced",fence:"```",emDelimiter:"*",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",collapseMultipleWhitespaces:!0,preformattedCode:!0},turndownService=new window.TurndownService(options);turndownService.keep(["kbd","ins"]),mde.value(turndownService.turndown(pastedHTML))}}function firstNote(){showNote(document.getElementById("filelist").firstElementChild.classList[0])}function sbfile(){let tags=tagify.value,tArr=[];for(let tag in tags)tArr.push(tags[tag].value);$.ajax({type:"POST",url:"notes.php",data:{action:"sbfile",name:document.getElementById("note_name").value,fname:document.getElementById("fname").value,tags:tArr,content:document.getElementById("editor1").value},success:function(response){""==response?(console.log("Note saved successfully"),location.reload()):alert(response)}})}function showNote(id){document.querySelector("#main_area .editor-toolbar").style.display="none",document.getElementById("atoolbar")&&document.getElementById("atoolbar").remove(),document.getElementById("tbutton")&&document.getElementById("tbutton").remove();let loader=document.createElement("div");loader.classList.add("db-spinner"),loader.id="db-spinner",document.getElementById("main").appendChild(loader),document.getElementById("save_button").style.display="none";for(var elements=document.getElementsByClassName("selected");elements.length>0;)elements[0].classList.remove("selected");document.getElementById(id).classList.add("selected"),window.parent.document.getElementById("editnote").classList.remove("disabled"),window.parent.document.getElementById("deletenote").classList.remove("disabled"),window.parent.document.getElementById("sendnote").classList.remove("disabled");var fname=document.getElementById("entry"+id).value;$.ajax({type:"POST",url:"notes.php",data:{action:"showNote",filename:fname,id:id},success:function(data){var note=JSON.parse(data);document.getElementById("bcontent")&&document.getElementById("bcontent").remove(),document.querySelector(".EasyMDEContainer").classList.remove("EasyMDEContainerH"),document.getElementById("tocdiv")&&document.getElementById("tocdiv").remove();let headerTitle=document.createElement("span");if(headerTitle.id="headerTitle",headerTitle.classList.add("headerTitle"),document.querySelector("#main_header #note_name")&&document.querySelector("#main_header #note_name").replaceWith(headerTitle),document.querySelector("tags").classList.remove("edit"),document.getElementById("headerTitle").innerText=note.notename,document.getElementById("fname").value=note.filename,document.getElementById("author").value=note.author,document.getElementById("date").value=note.date,document.getElementById("source").value=note.source,tagify.setReadonly(!0),tagify.removeAllTags(),tagify.addTags(note.tags),document.querySelector(".EasyMDEContainer").style="display: block;",document.getElementById("editor1").style="display none;",mde.value(note.content),document.getElementById("editor1").value=note.content,"text"==note.mime_type.substr(0,4)){"e"==document.getElementById("estate").value&&(document.getElementById("estate").value="s",mde.togglePreview());var headings=document.querySelectorAll("h1, h2, h3, h4, h5, h6");if(headings.length>0){let tbutton=document.createElement("button");tbutton.id="tbutton",tbutton.innerText="ToC",document.getElementById("main_header").appendChild(tbutton);let tocdiv=document.createElement("div");tocdiv.id="tocdiv";let o=0,a=0,list="c%";headings.forEach((function(element){a=element.tagName.substr(1,1),list=o"):o>a?list.replace("c%",'
  • '+element.innerText+"
  • c%"):list.replace("c%",'
  • '+element.innerText+"
  • c%"),o=a})),list=list.replace("c%",""),tocdiv.innerHTML=list,tbutton.addEventListener("click",(function(e){e.preventDefault(),tocdiv.classList.toggle("tdhidden")})),document.querySelector(".EasyMDEContainer").appendChild(tocdiv),document.querySelectorAll("#tocdiv a").forEach((function(elem){elem.addEventListener("click",(function(){tocdiv.classList.toggle("tdhidden")}))}))}}else{let bcontent=document.createElement("object");bcontent.data="data:"+note.mime_type+";base64,"+note.content,bcontent.type=note.mime_type,bcontent.id="bcontent",note.mime_type.includes("pdf")&&(bcontent.style="width: 100%; height: 100%;"),document.querySelector(".EasyMDEContainer").classList.add("EasyMDEContainerH"),document.getElementById("main_area").appendChild(bcontent),document.getElementById("editor1").style="display: none",document.getElementById("atoolbar")&&document.getElementById("atoolbar").remove()}document.getElementById("db-spinner").parentNode.removeChild(loader)}})}function simage(){for(var allowed_extensions=new Array("jpg","jpeg","png"),file_extension=document.getElementById("localimg").value.split(".").pop().toLowerCase(),i=0;i<=allowed_extensions.length;i++)if(allowed_extensions[i]==file_extension){var file_data=$("#localimg").prop("files")[0],formData=new FormData;return formData.append("localFile",file_data),$.ajax({type:"POST",url:"notes.php",dataType:"text",cache:!1,contentType:!1,processData:!1,data:formData,success:function(data){pos=mde.codemirror.getCursor(),mde.codemirror.setSelection(pos,pos),mde.codemirror.replaceSelection("![]("+data+")")}}),!0}return alert("Unsupported file format"),!1}function saveFile(editor){let loader=document.createElement("div");loader.classList.add("db-spinner"),loader.id="db-spinner",document.getElementById("main").appendChild(loader);let fname=document.getElementById("fname").value,extb=fname.lastIndexOf(".")+1,tags=tagify.value,tArr=[];for(let tag in tags)tArr.push(tags[tag].value);$.ajax({type:"POST",url:"notes.php",data:{action:"editNote",note_name:document.getElementById("note_name").value,fname:fname,ntags:tArr,editor1:mde.value(),ftype:fname.substr(extb),author:document.getElementById("author").value,date:document.getElementById("date").value,source:document.getElementById("source").value},success:function(response){""==response?(console.log("Note saved successfully"),location.reload()):alert(response),loader.remove()}})}function uplLocalImage(){document.getElementById("localimg").click()}function uplInsertImage(){var imageURL=prompt("URL of the image","");if(!imageURL)return!1;$.ajax({type:"POST",url:"notes.php",data:{action:"uplImage",imageURL:imageURL},success:function(data){pos=mde.codemirror.getCursor(),mde.codemirror.setSelection(pos,pos),mde.codemirror.replaceSelection("![]("+data+")")}})}function searchList(){var input,filter,ul,li,a,i;for(filter=(input=document.getElementById("notesearch")).value.toUpperCase(),li=(ul=document.getElementById("filelist")).getElementsByTagName("li"),i=0;i-1?li[i].style.display="":li[i].style.display="none"}document.querySelectorAll("#filelist li a").forEach((function(note){note.addEventListener("click",(function(){showNote(note.parentElement.id),tagify.setReadonly(!0)}))})),window.addEventListener("message",e=>{let estate=document.getElementById("estate");if("tstate"in e.data&&tagify.setReadonly(e.data.tstate),"ttags"in e.data&&""==e.data.ttags&&tagify.removeAllTags(),"editor"in e.data&&"new"==e.data.editor){"s"==estate.value&&(mde.togglePreview(),estate.value="e"),mde.value(""),document.getElementById("fname").value="";let editor1=document.getElementById("editor1");if(editor1.value="","md"==e.data.format)document.querySelector("#main_area .editor-toolbar").style.display="block",document.querySelector(".EasyMDEContainer").style="display: block",mde.value(""),editor1.style="display: none;",document.getElementById("author").value="",document.getElementById("date").value="",document.getElementById("source").value="",document.querySelector("#main_area .EasyMDEContainer").addEventListener("paste",pasteParse,!1);else{let toolbar=document.createElement("div");toolbar.id="atoolbar";let bSave=document.createElement("li");bSave.id="bSave",bSave.classList.add("fa","fa-floppy-o"),bSave.addEventListener("click",sbfile,!1),toolbar.appendChild(bSave);let bSeperator=document.createElement("i");bSeperator.classList.add("separator"),toolbar.appendChild(bSeperator),editor1.parentNode.insertBefore(toolbar,editor1),document.querySelector(".EasyMDEContainer").style="display: none",editor1.style="display: block"}}if("editor"in e.data&&"edit"==e.data.editor){"s"==estate.value&&(mde.togglePreview(),estate.value="e");let file=document.getElementById("fname").value.split("."),format=file[file.length-1];switch(document.getElementById("atoolbar")&&document.getElementById("atoolbar").remove(),format){case"md":document.querySelector(".EasyMDEContainer").style="display: block;",document.querySelector("#main_area .editor-toolbar").style.display="block",document.querySelector("#editor1").style="display: none;";break;default:let toolbar=document.createElement("div"),editor=document.getElementById("editor1");toolbar.id="atoolbar";let bSave=document.createElement("li");bSave.id="bSave",bSave.classList.add("fa","fa-floppy-o"),bSave.addEventListener("click",sbfile,!1),toolbar.appendChild(bSave);let bSeperator=document.createElement("i");bSeperator.classList.add("separator"),toolbar.appendChild(bSeperator),editor.parentNode.insertBefore(toolbar,editor),document.querySelector(".EasyMDEContainer").style="display: none",editor.style="display: block",document.getElementById("bcontent")&&(document.getElementById("editor1").style="display: none")}}}),document.addEventListener("keyup",event=>{if("Escape"==event.key&&"e"==document.getElementById("estate").value){mde.togglePreview(),document.querySelector("#main_area .editor-toolbar").style.display="none",document.getElementById("estate").value="s";let headerTitle=document.createElement("span");headerTitle.id="headerTitle",headerTitle.classList.add("headerTitle"),headerTitle.innerText=document.getElementById("note_name").value,document.querySelector("#main_header #note_name").replaceWith(headerTitle),document.querySelector("tags").classList.remove("edit"),tagify.setReadonly(!0)}}),document.getElementById("notesearch").addEventListener("keyup",searchList,!1),document.getElementById("save_button").addEventListener("click",(function(){document.getElementById("metah").submit()})),document.getElementById("localimg").addEventListener("change",simage,!1),new rcube_splitter({id:"notessplitter",p1:"#sidebar",p2:"#main",orientation:"v",relative:!0,start:400,min:250,size:12}).init(),firstNote()})); \ No newline at end of file +$(document).ready((function(){var tagify=new Tagify(document.querySelector("#ntags"),{whitelist:[],dropdown:{classname:"color-blue",enabled:0,maxItems:0,position:"text",closeOnSelect:!1,highlightFirst:!0},trim:!0,duplicates:!1,enforceWhitelist:!1,delimiters:",|;| ",placeholder:"Tags"});let cookiesArr;var media_folder;$.ajax({type:"POST",url:"notes.php",data:{action:"getTags"},success:function(data){tagify.settings.whitelist=JSON.parse(data)}}),document.cookie.split(";").forEach((function(element){let cookie=element.split("=");cookie[0].indexOf("pn_")>0&&(media_folder=JSON.parse(decodeURIComponent(cookie[1])))}));var mde=new EasyMDE({element:document.getElementById("editor1"),autoDownloadFontAwesome:!1,autofocus:!0,previewImagesInEditor:!1,spellChecker:!1,autofocus:!0,status:!1,promptURLs:!0,inputStyle:"contenteditable",nativeSpellcheck:!0,forceSync:!0,renderingConfig:{codeSyntaxHighlighting:!0,sanitizerFunction:function(renderedHTML){let output;return renderedHTML.replaceAll(media_folder,"notes.php?blink=")}},toolbar:[{name:"Save",action:saveFile,className:"fa fa-floppy-o",title:"Save"},"|","undo","redo","|","bold","italic","strikethrough","clean-block","|","heading","heading-smaller","heading-bigger","|","code","quote","unordered-list","ordered-list","|","link",{name:"Image",action:uplInsertImage,className:"fa fa-picture-o",title:"Add image from URL"},{name:"Image",action:uplLocalImage,className:"fa fa-file-image-o",title:"Upload and insert local image"},"table","|","preview","side-by-side","fullscreen","guide","|"]});function pasteParse(event){const pastedText=event.clipboardData.getData("text"),pastedHTML=event.clipboardData.getData("text/html");let textArr=pastedText.split("\n");if("---"==textArr[0]){let cstart=pastedText.indexOf("---",4)+3;for(var i=1;i<10&&"---"!=textArr[i];i++){let yentry=textArr[i].split(":");"title"==yentry[0]&&(document.getElementById("note_name").value=yentry[1].trim()),"tags"==yentry[0]&&tagify.addTags(yentry[1]),"author"==yentry[0]&&(document.getElementById("author").value=yentry[1].trim()),"date"==yentry[0]&&(document.getElementById("date").value=yentry.slice(1).join(":").trim()),"source"==yentry[0]&&(document.getElementById("source").value=yentry.slice(1).join(":").trim())}mde.value(pastedText.substr(cstart).trim())}if(pastedHTML){var options={headingStyle:"atx",hr:"-",bulletListMarker:"-",codeBlockStyle:"fenced",fence:"```",emDelimiter:"*",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",collapseMultipleWhitespaces:!0,preformattedCode:!0},turndownService=new window.TurndownService(options);turndownService.keep(["kbd","ins"]),mde.value(turndownService.turndown(pastedHTML))}}function firstNote(){showNote(document.getElementById("filelist").firstElementChild.classList[0])}function sbfile(){let tags=tagify.value,tArr=[];for(let tag in tags)tArr.push(tags[tag].value);$.ajax({type:"POST",url:"notes.php",data:{action:"sbfile",name:document.getElementById("note_name").value,fname:document.getElementById("fname").value,tags:tArr,content:document.getElementById("editor1").value},success:function(response){""==response?(console.log("Note saved successfully"),location.reload()):alert(response)}})}function showNote(id){document.querySelector("#main_area .editor-toolbar").style.display="none",document.getElementById("atoolbar")&&document.getElementById("atoolbar").remove(),document.getElementById("tbutton")&&document.getElementById("tbutton").remove();let loader=document.createElement("div");loader.classList.add("db-spinner"),loader.id="db-spinner",document.getElementById("main").appendChild(loader),document.getElementById("save_button").style.display="none";for(var elements=document.getElementsByClassName("selected");elements.length>0;)elements[0].classList.remove("selected");document.getElementById(id).classList.add("selected"),window.parent.document.getElementById("editnote").classList.remove("disabled"),window.parent.document.getElementById("deletenote").classList.remove("disabled"),window.parent.document.getElementById("sendnote").classList.remove("disabled");var fname=document.getElementById("entry"+id).value;$.ajax({type:"POST",url:"notes.php",data:{action:"showNote",filename:fname,id:id},success:function(data){var note=JSON.parse(data);document.getElementById("bcontent")&&document.getElementById("bcontent").remove(),document.querySelector(".EasyMDEContainer").classList.remove("EasyMDEContainerH"),document.getElementById("tocdiv")&&document.getElementById("tocdiv").remove();let headerTitle=document.createElement("span");if(headerTitle.id="headerTitle",headerTitle.classList.add("headerTitle"),document.querySelector("#main_header #note_name")&&document.querySelector("#main_header #note_name").replaceWith(headerTitle),document.querySelector("tags").classList.remove("edit"),document.getElementById("headerTitle").innerText=note.notename,document.getElementById("fname").value=note.filename,document.getElementById("author").value=note.author,document.getElementById("date").value=note.date,document.getElementById("source").value=note.source,tagify.setReadonly(!0),tagify.removeAllTags(),tagify.addTags(note.tags),document.querySelector(".EasyMDEContainer").style="display: block;",document.getElementById("editor1").style="display none;",document.getElementById("editor1").value=note.content,mde.value(note.content),"text"==note.mime_type.substr(0,4)){"e"==document.getElementById("estate").value&&(document.getElementById("estate").value="s",mde.togglePreview());var headings=document.querySelectorAll("h1, h2, h3, h4, h5, h6");if(headings.length>0){let tbutton=document.createElement("button");tbutton.id="tbutton",tbutton.innerText="ToC",document.getElementById("main_header").appendChild(tbutton);let tocdiv=document.createElement("div");tocdiv.id="tocdiv";let o=0,a=0,list="c%";headings.forEach((function(element){a=element.tagName.substr(1,1),list=o"):o>a?list.replace("c%",'
  • '+element.innerText+"
  • c%"):list.replace("c%",'
  • '+element.innerText+"
  • c%"),o=a})),list=list.replace("c%",""),tocdiv.innerHTML=list,tbutton.addEventListener("click",(function(e){e.preventDefault(),tocdiv.classList.toggle("tdhidden")})),document.querySelector(".EasyMDEContainer").appendChild(tocdiv),document.querySelectorAll("#tocdiv a").forEach((function(elem){elem.addEventListener("click",(function(){tocdiv.classList.toggle("tdhidden")}))}))}}else{let bcontent=document.createElement("object");bcontent.data="data:"+note.mime_type+";base64,"+note.content,bcontent.type=note.mime_type,bcontent.id="bcontent",note.mime_type.includes("pdf")&&(bcontent.style="width: 100%; height: 100%;"),document.querySelector(".EasyMDEContainer").classList.add("EasyMDEContainerH"),document.getElementById("main_area").appendChild(bcontent),document.getElementById("editor1").style="display: none",document.getElementById("atoolbar")&&document.getElementById("atoolbar").remove()}document.getElementById("db-spinner").parentNode.removeChild(loader)}})}function simage(){for(var allowed_extensions=new Array("jpg","jpeg","png"),file_extension=document.getElementById("localimg").value.split(".").pop().toLowerCase(),i=0;i<=allowed_extensions.length;i++)if(allowed_extensions[i]==file_extension){var file_data=$("#localimg").prop("files")[0],formData=new FormData;return formData.append("localFile",file_data),$.ajax({type:"POST",url:"notes.php",dataType:"text",cache:!1,contentType:!1,processData:!1,data:formData,success:function(data){pos=mde.codemirror.getCursor(),mde.codemirror.setSelection(pos,pos),mde.codemirror.replaceSelection("![]("+data+")")}}),!0}return alert("Unsupported file format"),!1}function saveFile(editor){let loader=document.createElement("div");loader.classList.add("db-spinner"),loader.id="db-spinner",document.getElementById("main").appendChild(loader);let fname=document.getElementById("fname").value,extb=fname.lastIndexOf(".")+1,tags=tagify.value,tArr=[];for(let tag in tags)tArr.push(tags[tag].value);$.ajax({type:"POST",url:"notes.php",data:{action:"editNote",note_name:document.getElementById("note_name").value,fname:fname,ntags:tArr,editor1:mde.value(),ftype:fname.substr(extb),author:document.getElementById("author").value,date:document.getElementById("date").value,source:document.getElementById("source").value},success:function(response){""==response?(console.log("Note saved successfully"),location.reload()):alert(response),loader.remove()}})}function uplLocalImage(){document.getElementById("localimg").click()}function uplInsertImage(){var imageURL=prompt("URL of the image","");if(!imageURL)return!1;$.ajax({type:"POST",url:"notes.php",data:{action:"uplImage",imageURL:imageURL},success:function(data){pos=mde.codemirror.getCursor(),mde.codemirror.setSelection(pos,pos),mde.codemirror.replaceSelection("![]("+data+")")}})}function searchList(){var input,filter,ul,li,a,i;for(filter=(input=document.getElementById("notesearch")).value.toUpperCase(),li=(ul=document.getElementById("filelist")).getElementsByTagName("li"),i=0;i-1?li[i].style.display="":li[i].style.display="none"}document.querySelectorAll("#filelist li a").forEach((function(note){note.addEventListener("click",(function(){showNote(note.parentElement.id),tagify.setReadonly(!0)}))})),window.addEventListener("message",e=>{let estate=document.getElementById("estate");if("tstate"in e.data&&tagify.setReadonly(e.data.tstate),"ttags"in e.data&&""==e.data.ttags&&tagify.removeAllTags(),"editor"in e.data&&"new"==e.data.editor){"s"==estate.value&&(mde.togglePreview(),estate.value="e"),mde.value(""),document.getElementById("fname").value="";let editor1=document.getElementById("editor1");if(editor1.value="","md"==e.data.format)document.querySelector("#main_area .editor-toolbar").style.display="block",document.querySelector(".EasyMDEContainer").style="display: block",mde.value(""),editor1.style="display: none;",document.getElementById("author").value="",document.getElementById("date").value="",document.getElementById("source").value="",document.querySelector("#main_area .EasyMDEContainer").addEventListener("paste",pasteParse,!1);else{let toolbar=document.createElement("div");toolbar.id="atoolbar";let bSave=document.createElement("li");bSave.id="bSave",bSave.classList.add("fa","fa-floppy-o"),bSave.addEventListener("click",sbfile,!1),toolbar.appendChild(bSave);let bSeperator=document.createElement("i");bSeperator.classList.add("separator"),toolbar.appendChild(bSeperator),editor1.parentNode.insertBefore(toolbar,editor1),document.querySelector(".EasyMDEContainer").style="display: none",editor1.style="display: block"}}if("editor"in e.data&&"edit"==e.data.editor){"s"==estate.value&&(mde.togglePreview(),estate.value="e");let file=document.getElementById("fname").value.split("."),format=file[file.length-1];switch(document.getElementById("atoolbar")&&document.getElementById("atoolbar").remove(),format){case"md":document.querySelector(".EasyMDEContainer").style="display: block;",document.querySelector("#main_area .editor-toolbar").style.display="block",document.querySelector("#editor1").style="display: none;";break;default:let toolbar=document.createElement("div"),editor=document.getElementById("editor1");toolbar.id="atoolbar";let bSave=document.createElement("li");bSave.id="bSave",bSave.classList.add("fa","fa-floppy-o"),bSave.addEventListener("click",sbfile,!1),toolbar.appendChild(bSave);let bSeperator=document.createElement("i");bSeperator.classList.add("separator"),toolbar.appendChild(bSeperator),editor.parentNode.insertBefore(toolbar,editor),document.querySelector(".EasyMDEContainer").style="display: none",editor.style="display: block",document.getElementById("bcontent")&&(document.getElementById("editor1").style="display: none")}}}),document.addEventListener("keyup",event=>{if("Escape"==event.key&&"e"==document.getElementById("estate").value){mde.togglePreview(),document.querySelector("#main_area .editor-toolbar").style.display="none",document.getElementById("estate").value="s";let headerTitle=document.createElement("span");headerTitle.id="headerTitle",headerTitle.classList.add("headerTitle"),headerTitle.innerText=document.getElementById("note_name").value,document.querySelector("#main_header #note_name").replaceWith(headerTitle),document.querySelector("tags").classList.remove("edit"),tagify.setReadonly(!0)}}),document.getElementById("notesearch").addEventListener("keyup",searchList,!1),document.getElementById("save_button").addEventListener("click",(function(){document.getElementById("metah").submit()})),document.getElementById("localimg").addEventListener("change",simage,!1),new rcube_splitter({id:"notessplitter",p1:"#sidebar",p2:"#main",orientation:"v",relative:!0,start:400,min:250,size:12}).init(),firstNote()})); \ No newline at end of file diff --git a/js/primitivenotes.js b/js/primitivenotes.js index ee1debd..c091ef5 100644 --- a/js/primitivenotes.js +++ b/js/primitivenotes.js @@ -1,7 +1,7 @@ /** * Roundcube Notes Plugin * - * @version 2.0.2 + * @version 2.0.3 * @author Offerel * @copyright Copyright (c) 2021, Offerel * @license GNU General Public License, version 3 diff --git a/js/primitivenotes.min.js b/js/primitivenotes.min.js index c3843a7..fe47099 100644 --- a/js/primitivenotes.min.js +++ b/js/primitivenotes.min.js @@ -1,7 +1,7 @@ /** * Roundcube Notes Plugin * - * @version 2.0.2 + * @version 2.0.3 * @author Offerel * @copyright Copyright (c) 2021, Offerel * @license GNU General Public License, version 3 diff --git a/notes.php b/notes.php index d12f90a..b8e4169 100644 --- a/notes.php +++ b/notes.php @@ -2,7 +2,7 @@ /** * Roundcube Notes Plugin * - * @version 2.0.2 + * @version 2.0.3 * @author Offerel * @copyright Copyright (c) 2021, Offerel * @license GNU General Public License, version 3 @@ -24,6 +24,7 @@ $notes_path = $rcmail->config->get('notes_basepath', false).$rcmail->user->get_username().$rcmail->config->get('notes_folder', false); $media_folder = $rcmail->config->get('media_folder', false); + setcookie('pn_', json_encode($media_folder), 0, parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '.'.$_SERVER['HTTP_HOST'], true); $default_format = $rcmail->config->get('default_format', false); $language = $rcmail->get_user_language(); $yh_begin = $rcmail->config->get('yaml_start', ''); @@ -44,26 +45,12 @@ if(isset($_GET['blink'])) { $file = urldecode($_GET['blink']); - $type = $_GET['t']; if(file_exists($notes_path.$media_folder.$file)) { $fileh = file_get_contents($notes_path.$media_folder.$file); - if($type == 'i') { - $imagev = imagecreatefromstring($fileh); - list($width, $height, $type, $attr) = getimagesizefromstring($fileh); - if($width > 860) { - $imagev = imagescale($imagev, 860); - } - header("Content-Type: image/jpeg"); - header("Content-Disposition: inline; filename=\"".pathinfo($file)['filename'].".jpg\""); - imagejpeg($imagev); - imagedestroy($imagev); - } - elseif($type == 'l') { - $mime = mime_content_type($notes_path.$media_folder.$file); - header("Content-type: $mime"); - header("Content-Disposition: inline; filename=\"$file\""); - echo $fileh; - } + $mime_type = mime_content_type($notes_path.$media_folder.$file); + header("Content-type: $mime_type"); + header("Content-Disposition: inline; filename=\"$file\""); + echo $fileh; } die(); } @@ -181,6 +168,7 @@ 'date' => $date, 'source' => $source, ]; + die(json_encode($noteArr)); break; case 'getTags': @@ -375,23 +363,19 @@ function read_note($id, $filename, $mode, $format) { if(file_exists($file)) { $fcontent = file_get_contents($file); - $re = '/(?:[!]?\[(.*?)\]\((.*?)\))/m'; if($mode != 'edit') { - $scontent = preg_replace_callback($re, "parseLink", $fcontent); if($rcmail->config->get('yaml_support', '')) { - $yhb_pos = strpos($scontent, $yh_begin); - $yhe_pos = strlen($scontent) >= strlen($yh_begin) ? strpos($scontent, $yh_end, strlen($yh_begin)) : 0; - if($yhb_pos == 0 && $yhe_pos > 0) $scontent = substr($scontent,$yhe_pos + strlen($yh_end)); + $yhb_pos = strpos($fcontent, $yh_begin); + $yhe_pos = strlen($fcontent) >= strlen($yh_begin) ? strpos($fcontent, $yh_end, strlen($yh_begin)) : 0; + if($yhb_pos == 0 && $yhe_pos > 0) $fcontent = substr($fcontent,$yhe_pos + strlen($yh_end)); } - } else { - $scontent = $fcontent; } $mime_type = mime_content_type($file); - $scontent = (substr($mime_type, 0, 4) == 'text') ? $scontent:base64_encode($scontent); + $fcontent = (substr($mime_type, 0, 4) == 'text') ? $fcontent:base64_encode($fcontent); $note = array( 'name' => substr($filename, 0, stripos($filename, "[")), - 'content' => trim($scontent), + 'content' => trim($fcontent), 'format' => $format, 'id' => $id, 'mime_type' => $mime_type, diff --git a/primitivenotes.php b/primitivenotes.php index 50d3955..26a5e58 100644 --- a/primitivenotes.php +++ b/primitivenotes.php @@ -2,7 +2,7 @@ /** * Roundcube Notes Plugin * - * @version 2.0.2 + * @version 2.0.3 * @author Offerel * @copyright Copyright (c) 2021, Offerel * @license GNU General Public License, version 3 diff --git a/skins/primitivenotes.css b/skins/primitivenotes.css index 4af57a0..2a405bc 100644 --- a/skins/primitivenotes.css +++ b/skins/primitivenotes.css @@ -364,6 +364,7 @@ object { .editor-preview pre code { color: unset; background: unset; + display: block; } .editor-preview { background: #fff; @@ -413,9 +414,6 @@ object { display: block; max-width: 860px; } -.editor-preview p > img { - display: initial; -} .EasyMDEContainer { top: 0; position: relative; @@ -586,4 +584,15 @@ tags.edit:focus-within { width: 100%; display: inline-block; font-size: 0.9em; +} +.editor-preview code::-webkit-scrollbar { + height: 6px; + background: #dee2e6; +} +.editor-preview code::-webkit-scrollbar-thumb { + background: #bbb; + border-radius: 6px; +} +.editor-preview code::-webkit-scrollbar-thumb:hover { + background: #737677; } \ No newline at end of file diff --git a/skins/primitivenotes.min.css b/skins/primitivenotes.min.css index b8e3139..146cddd 100644 --- a/skins/primitivenotes.min.css +++ b/skins/primitivenotes.min.css @@ -1 +1 @@ -.iframebox.simplenotes_{height:100%}.uibox{border:0!important;border-radius:0}#notessplitter{display:none}body{font-size:unset;background:unset}.editor-toolbar button{border:0;background:0 0}.editor-toolbar button:hover{background:#d3d3d3}#suggest{position:absolute;background-color:#fff;border:1px solid #ccf;z-index:100;left:9px;padding:5px;top:70px;overflow:auto}#suggest div{white-space:nowrap;font-family:'Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:.8em}#suggest div.select{color:#fff;background-color:#36f}#suggest div.over{background-color:#9cf}object{max-width:100%;max-height:100%;width:initial;height:initial;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;z-index:10}.headerTitle{margin:10px;font-size:2em;font-family:'Lucida Grande',Verdana,Arial,Helvetica,sans-serif;position:relative;top:5px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:inherit;margin-top:0}.headerTags{margin:10px;font-size:11px;font-family:'Lucida Grande',Verdana,Arial,Helvetica,sans-serif;position:relative;top:-20px}#content{height:100%;overflow:auto;padding:0 15px}.save_button{position:absolute;right:16px;top:14px;height:24px;width:24px;background:url(images/button_save.png) no-repeat;display:none}.save_button a{width:100%;height:100%;position:absolute}#sidebar .searchbox{position:absolute;width:350px}#sidebar .searchbox input{font-weight:400;background:#fff;height:21px;background-image:url(./../../../skins/larry/images/buttons.png);width:100%;padding:0 4px 0 24px;background-repeat:no-repeat;background-position:-7px -671px;background-size:36px}#sidebar{width:400px;position:absolute;float:left;overflow:hidden;border-radius:0;margin-right:5px;top:0;bottom:0;left:0;right:0;border-right:1px solid #d4dbde!important}#filelist_header{display:block;top:0;left:0;right:0;height:34px;padding:6px;background:#efefef;white-space:nowrap;border-bottom:1px solid #dfdfdf;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#taglist{display:none}#note_tags{border:thin solid #ced4da}.filelist{width:100%;height:calc(100% - 34px);overflow:auto;background:#dcdcdc}.cke_chrome{border:0!important}#main{position:absolute;left:0;right:0;top:0;bottom:0}.main{left:395px!important;border-radius:0!important}.main_header{height:100px;background:#efefef;width:100%;top:0;position:sticky}.main_header input{width:calc(100% - 20px);padding:0;margin-left:6px;margin-top:5px;padding-left:5px;border:thin solid #ced4da!important}.main_area{position:absolute;top:90px;height:calc(100% - 90px);width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px;background:#fff;overflow:auto}.main_area textarea{border:0;width:calc(100% - 20px);height:calc(100% - 61px);white-space:pre;padding:10px;top:35px;position:absolute;font-family:revert;border-radius:revert;resize:none;outline:0}.main_area textarea:focus{box-shadow:revert}#atoolbar{background:#efefef;border-bottom:1px solid #bbb;padding:0 10px;z-index:12;position:absolute;right:0;left:0}#atoolbar li{border-radius:4px;cursor:pointer;margin:4px 3px;padding:5px;color:#525252}#atoolbar li:hover{background:#e3e3e3}#atoolbar i.separator{display:inline;width:2px;border-left:1px solid #d9d9d9;border-right:1px solid #fff;margin:0 5px}#filelist{margin:0;padding:0}.fsize{text-align:right;float:right;width:50px;border-radius:9px;padding:0 6px;background:#929292;position:relative;color:#fff!important;font-weight:700!important;line-height:15px}.filelist li{white-space:nowrap;padding:3px 5px 2px 40px;font-weight:700;color:#2c363a;border-bottom:1px solid #f1f3f4;font-family:"Lucida Grande",Verdana,Arial,Helvetica,sans-serif;font-size:12px;height:35px}.filelist a:hover span#taglist{display:block;background:#000!important;z-index:10;position:absolute;max-width:300px;border-radius:5px;padding:5px;color:#fff;white-space:normal;margin-top:-55px;box-shadow:1px 1px 3px gray;left:10px}.filelist li.pdf{background:#fff url(images/pdf-icon.png) 5px 7px/27px no-repeat}.filelist li.html,li.htm{background:#fff url(images/html-icon.png) 5px 7px/27px no-repeat}.filelist li.jpg{background:#fff url(images/jpg-icon.png) 5px 7px/27px no-repeat}.filelist li.md{background:#fff url(images/md-icon.png) 5px 7px/27px no-repeat}.filelist li.txt{background:#fff url(images/txt-icon.png) 5px 7px/27px no-repeat}.filelist li{background:#fff url(images/unknown-icon.png) 5px 7px/27px no-repeat}.selected,.selected a,.selected span{background-color:#ebf9ff!important}.selected span.fsize{background:#13aff8!important}.filelist li:hover{background-color:#e8eaf6;text-decoration:none!important}.filelist a>span{color:#666;font-weight:400;font-size:11px;font-family:"Lucida Grande",Verdana,Arial,Helvetica,sans-serif}.filelist a{text-decoration:none!important;color:#536871;width:100%;height:100%;display:inline-block;text-overflow:ellipsis;overflow:hidden}.cke_editable{cursor:text;font-family:Helvetica Neue,Helvetica,Segoe UI,Arial,freesans,sans-serif}.editor-preview blockquote,.editor-preview-side blockquote{color:#3c763d;background-color:rgba(66,185,131,.1);padding:0;margin:15px 0;border-left:4px solid #42b983;margin-left:auto;margin-right:auto}.editor-preview blockquote p,.editor-preview-side blockquote p{padding:5px}.editor-preview code{overflow-x:auto;scrollbar-width:thin;margin:0 0 -5px 0;user-select:all;width:unset;background:#eed7d7;font-size:.92em;font-family:Consolas,Monaco,monospace!important;color:#e93700;padding:2px 4px;border-radius:5px;display:inline-block;white-space:pre}.editor-preview a,.editor-preview-side a{color:#42b983;text-decoration:none;font-style:normal;font-size:15px;font-weight:600}.editor-preview pre,.editor-preview-side pre{background:#f8f8f8;margin-bottom:10px;padding:7px;font-size:85%;line-height:1.45;border-radius:4px;border:thin solid #dfe2e5;overflow:hidden;margin-left:auto;margin-right:auto;padding-right:10px}.editor-preview pre code{color:unset;background:unset}.editor-preview{background:#fff;font-family:Helvetica Neue,Helvetica,Segoe UI,Arial,freesans,sans-serif;color:#333;background:#fff}.editor-preview *{max-width:860px;margin-left:auto;margin-right:auto}.editor-preview table,.editor-preview-side table{border-spacing:0;border-collapse:collapse;text-shadow:1px 1px 0 #fff}.editor-preview table thead th,.editor-preview-side table thead th{background-color:#e0e0e0;border:1px solid #ddd;padding:5px}.editor-preview table tr:nth-child(2n),.editor-preview-side table tr:nth-child(2n){background:linear-gradient(to bottom,#f8f8f8 0,#f6f6f6 100%)}.editor-preview table td,.editor-preview table th,.editor-preview-side table td,.editor-preview-side table th{border:1px solid #ddd;padding:5px}.editor-preview kbd,.editor-preview-side kbd{font-family:Consolas,"Courier New",monospace;display:inline-block;border-radius:5px;padding:0 4px;margin:2px;font-size:.9em;vertical-align:text-bottom;background:#fff;color:#555;user-select:none;border-width:1px 3px 3px 1px;border-color:#ccc #aaa #888 #bbb;white-space:nowrap;border-style:solid}.editor-preview img{display:block;max-width:860px}.editor-preview p>img{display:initial}.EasyMDEContainer{top:0;position:relative}.EasyMDEContainer .CodeMirror{position:inherit;border:0}.EasyMDEContainerH{display:none!important}.editor-preview-full{position:fixed;left:395px;width:calc(100% - 396px);top:80px;height:calc(100% - 74px);padding-top:20px}.CodeMirror-vscrollbar{overflow-y:hidden}.editor-toolbar{position:fixed;width:calc(100% - 432px);background:#efefef;border:0;border-bottom:1px solid;border-color:#bbb;z-index:101;border-radius:0;top:86px}.EasyMDEContainer .CodeMirror-scroll{padding-top:30px}.editor-toolbar::after{margin-top:2px}.editor-toolbar::before{margin-bottom:2px}.editor-toolbar button.active,.editor-toolbar button:hover{background:#e3e3e3;border-color:#95a5a6}.editor-toolbar.fullscreen{background:#f4f4f4}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{font-size:smaller}.tagify{--tags-border-color:transparent!important;z-index:100;width:calc(100% - 15px);font-size:.7em;font-style:italic;flex-wrap:unset!important;left:7px;border-radius:4px;border:thin solid transparent!important;position:absolute;top:50px}.tagify[readonly]:not(.tagify--mix) .tagify__tag>div::before{box-shadow:0 0 0 var(--tag-inset-shadow-size,1.1em) var(--tag-hover,#d3e2e2) inset!important}tags{overflow:auto!important}tags.edit{background:#fff;border:thin solid #ced4da!important}tags.edit:focus-within{box-shadow:0 0 5px 2px rgba(71,135,177,.9)!important;z-index:102}.tagify__tag+.tagify__input::before{display:none}.cm-s-easymde .cm-comment{font-family:Consolas,inherit monospace}.db-spinner{width:30px;height:30px;border-radius:50%;background-color:transparent;border:10px solid #2229;border-top:10px solid #03a9f4;border-bottom:100x solid #03a9f4;-webkit-animation:1s spin linear infinite;animation:1s spin linear infinite;position:absolute;top:50%;left:50%;z-index:100}@-webkit-keyframes spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}#tocdiv{position:fixed;z-index:10;background:#efefef;width:300px;top:77px;right:-310px;white-space:nowrap;padding:10px 0;box-shadow:1px 3px 3px 0 rgba(50,50,50,.3);border-bottom-left-radius:5px;border-bottom-right-radius:5px;border:1px solid #bbb;border-top:0;overflow:auto;max-height:calc(100% - 140px)}#tocdiv.tdhidden{right:26px}#tbutton{position:absolute;z-index:100;top:15px;right:10px;background:#f4f4f4;border:1px solid #ced4da;border-radius:5px;cursor:pointer;color:#535252;font-size:.8em;padding:3px;outline:0;box-shadow:revert}#tocdiv ul{margin:0;padding-left:20px}#tocdiv li{list-style:none;padding-right:10px}#tocdiv a{color:#42b983;text-decoration:none;font-weight:bolder;overflow:hidden;text-overflow:ellipsis;width:100%;display:inline-block;font-size:.9em} \ No newline at end of file +.iframebox.simplenotes_{height:100%}.uibox{border:0!important;border-radius:0}#notessplitter{display:none}body{font-size:unset;background:unset}.editor-toolbar button{border:0;background:0 0}.editor-toolbar button:hover{background:#d3d3d3}#suggest{position:absolute;background-color:#fff;border:1px solid #ccf;z-index:100;left:9px;padding:5px;top:70px;overflow:auto}#suggest div{white-space:nowrap;font-family:'Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:.8em}#suggest div.select{color:#fff;background-color:#36f}#suggest div.over{background-color:#9cf}object{max-width:100%;max-height:100%;width:initial;height:initial;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;z-index:10}.headerTitle{margin:10px;font-size:2em;font-family:'Lucida Grande',Verdana,Arial,Helvetica,sans-serif;position:relative;top:5px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:inherit;margin-top:0}.headerTags{margin:10px;font-size:11px;font-family:'Lucida Grande',Verdana,Arial,Helvetica,sans-serif;position:relative;top:-20px}#content{height:100%;overflow:auto;padding:0 15px}.save_button{position:absolute;right:16px;top:14px;height:24px;width:24px;background:url(images/button_save.png) no-repeat;display:none}.save_button a{width:100%;height:100%;position:absolute}#sidebar .searchbox{position:absolute;width:350px}#sidebar .searchbox input{font-weight:400;background:#fff;height:21px;background-image:url(./../../../skins/larry/images/buttons.png);width:100%;padding:0 4px 0 24px;background-repeat:no-repeat;background-position:-7px -671px;background-size:36px}#sidebar{width:400px;position:absolute;float:left;overflow:hidden;border-radius:0;margin-right:5px;top:0;bottom:0;left:0;right:0;border-right:1px solid #d4dbde!important}#filelist_header{display:block;top:0;left:0;right:0;height:34px;padding:6px;background:#efefef;white-space:nowrap;border-bottom:1px solid #dfdfdf;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#taglist{display:none}#note_tags{border:thin solid #ced4da}.filelist{width:100%;height:calc(100% - 34px);overflow:auto;background:#dcdcdc}.cke_chrome{border:0!important}#main{position:absolute;left:0;right:0;top:0;bottom:0}.main{left:395px!important;border-radius:0!important}.main_header{height:100px;background:#efefef;width:100%;top:0;position:sticky}.main_header input{width:calc(100% - 20px);padding:0;margin-left:6px;margin-top:5px;padding-left:5px;border:thin solid #ced4da!important}.main_area{position:absolute;top:90px;height:calc(100% - 90px);width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px;background:#fff;overflow:auto}.main_area textarea{border:0;width:calc(100% - 20px);height:calc(100% - 61px);white-space:pre;padding:10px;top:35px;position:absolute;font-family:revert;border-radius:revert;resize:none;outline:0}.main_area textarea:focus{box-shadow:revert}#atoolbar{background:#efefef;border-bottom:1px solid #bbb;padding:0 10px;z-index:12;position:absolute;right:0;left:0}#atoolbar li{border-radius:4px;cursor:pointer;margin:4px 3px;padding:5px;color:#525252}#atoolbar li:hover{background:#e3e3e3}#atoolbar i.separator{display:inline;width:2px;border-left:1px solid #d9d9d9;border-right:1px solid #fff;margin:0 5px}#filelist{margin:0;padding:0}.fsize{text-align:right;float:right;width:50px;border-radius:9px;padding:0 6px;background:#929292;position:relative;color:#fff!important;font-weight:700!important;line-height:15px}.filelist li{white-space:nowrap;padding:3px 5px 2px 40px;font-weight:700;color:#2c363a;border-bottom:1px solid #f1f3f4;font-family:"Lucida Grande",Verdana,Arial,Helvetica,sans-serif;font-size:12px;height:35px}.filelist a:hover span#taglist{display:block;background:#000!important;z-index:10;position:absolute;max-width:300px;border-radius:5px;padding:5px;color:#fff;white-space:normal;margin-top:-55px;box-shadow:1px 1px 3px gray;left:10px}.filelist li.pdf{background:#fff url(images/pdf-icon.png) 5px 7px/27px no-repeat}.filelist li.html,li.htm{background:#fff url(images/html-icon.png) 5px 7px/27px no-repeat}.filelist li.jpg{background:#fff url(images/jpg-icon.png) 5px 7px/27px no-repeat}.filelist li.md{background:#fff url(images/md-icon.png) 5px 7px/27px no-repeat}.filelist li.txt{background:#fff url(images/txt-icon.png) 5px 7px/27px no-repeat}.filelist li{background:#fff url(images/unknown-icon.png) 5px 7px/27px no-repeat}.selected,.selected a,.selected span{background-color:#ebf9ff!important}.selected span.fsize{background:#13aff8!important}.filelist li:hover{background-color:#e8eaf6;text-decoration:none!important}.filelist a>span{color:#666;font-weight:400;font-size:11px;font-family:"Lucida Grande",Verdana,Arial,Helvetica,sans-serif}.filelist a{text-decoration:none!important;color:#536871;width:100%;height:100%;display:inline-block;text-overflow:ellipsis;overflow:hidden}.cke_editable{cursor:text;font-family:Helvetica Neue,Helvetica,Segoe UI,Arial,freesans,sans-serif}.editor-preview blockquote,.editor-preview-side blockquote{color:#3c763d;background-color:rgba(66,185,131,.1);padding:0;margin:15px 0;border-left:4px solid #42b983;margin-left:auto;margin-right:auto}.editor-preview blockquote p,.editor-preview-side blockquote p{padding:5px}.editor-preview code{overflow-x:auto;scrollbar-width:thin;margin:0 0 -5px 0;user-select:all;width:unset;background:#eed7d7;font-size:.92em;font-family:Consolas,Monaco,monospace!important;color:#e93700;padding:2px 4px;border-radius:5px;display:inline-block;white-space:pre}.editor-preview a,.editor-preview-side a{color:#42b983;text-decoration:none;font-style:normal;font-size:15px;font-weight:600}.editor-preview pre,.editor-preview-side pre{background:#f8f8f8;margin-bottom:10px;padding:7px;font-size:85%;line-height:1.45;border-radius:4px;border:thin solid #dfe2e5;overflow:hidden;margin-left:auto;margin-right:auto;padding-right:10px}.editor-preview pre code{color:unset;background:unset;display:block}.editor-preview{background:#fff;font-family:Helvetica Neue,Helvetica,Segoe UI,Arial,freesans,sans-serif;color:#333;background:#fff}.editor-preview *{max-width:860px;margin-left:auto;margin-right:auto}.editor-preview table,.editor-preview-side table{border-spacing:0;border-collapse:collapse;text-shadow:1px 1px 0 #fff}.editor-preview table thead th,.editor-preview-side table thead th{background-color:#e0e0e0;border:1px solid #ddd;padding:5px}.editor-preview table tr:nth-child(2n),.editor-preview-side table tr:nth-child(2n){background:linear-gradient(to bottom,#f8f8f8 0,#f6f6f6 100%)}.editor-preview table td,.editor-preview table th,.editor-preview-side table td,.editor-preview-side table th{border:1px solid #ddd;padding:5px}.editor-preview kbd,.editor-preview-side kbd{font-family:Consolas,"Courier New",monospace;display:inline-block;border-radius:5px;padding:0 4px;margin:2px;font-size:.9em;vertical-align:text-bottom;background:#fff;color:#555;user-select:none;border-width:1px 3px 3px 1px;border-color:#ccc #aaa #888 #bbb;white-space:nowrap;border-style:solid}.editor-preview img{display:block;max-width:860px}.EasyMDEContainer{top:0;position:relative}.EasyMDEContainer .CodeMirror{position:inherit;border:0}.EasyMDEContainerH{display:none!important}.editor-preview-full{position:fixed;left:395px;width:calc(100% - 396px);top:80px;height:calc(100% - 74px);padding-top:20px}.CodeMirror-vscrollbar{overflow-y:hidden}.editor-toolbar{position:fixed;width:calc(100% - 432px);background:#efefef;border:0;border-bottom:1px solid;border-color:#bbb;z-index:101;border-radius:0;top:86px}.EasyMDEContainer .CodeMirror-scroll{padding-top:30px}.editor-toolbar::after{margin-top:2px}.editor-toolbar::before{margin-bottom:2px}.editor-toolbar button.active,.editor-toolbar button:hover{background:#e3e3e3;border-color:#95a5a6}.editor-toolbar.fullscreen{background:#f4f4f4}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{font-size:smaller}.tagify{--tags-border-color:transparent!important;z-index:100;width:calc(100% - 15px);font-size:.7em;font-style:italic;flex-wrap:unset!important;left:7px;border-radius:4px;border:thin solid transparent!important;position:absolute;top:50px}.tagify[readonly]:not(.tagify--mix) .tagify__tag>div::before{box-shadow:0 0 0 var(--tag-inset-shadow-size,1.1em) var(--tag-hover,#d3e2e2) inset!important}tags{overflow:auto!important}tags.edit{background:#fff;border:thin solid #ced4da!important}tags.edit:focus-within{box-shadow:0 0 5px 2px rgba(71,135,177,.9)!important;z-index:102}.tagify__tag+.tagify__input::before{display:none}.cm-s-easymde .cm-comment{font-family:Consolas,inherit monospace}.db-spinner{width:30px;height:30px;border-radius:50%;background-color:transparent;border:10px solid #2229;border-top:10px solid #03a9f4;border-bottom:100x solid #03a9f4;-webkit-animation:1s spin linear infinite;animation:1s spin linear infinite;position:absolute;top:50%;left:50%;z-index:100}@-webkit-keyframes spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}#tocdiv{position:fixed;z-index:10;background:#efefef;width:300px;top:77px;right:-310px;white-space:nowrap;padding:10px 0;box-shadow:1px 3px 3px 0 rgba(50,50,50,.3);border-bottom-left-radius:5px;border-bottom-right-radius:5px;border:1px solid #bbb;border-top:0;overflow:auto;max-height:calc(100% - 140px)}#tocdiv.tdhidden{right:26px}#tbutton{position:absolute;z-index:100;top:15px;right:10px;background:#f4f4f4;border:1px solid #ced4da;border-radius:5px;cursor:pointer;color:#535252;font-size:.8em;padding:3px;outline:0;box-shadow:revert}#tocdiv ul{margin:0;padding-left:20px}#tocdiv li{list-style:none;padding-right:10px}#tocdiv a{color:#42b983;text-decoration:none;font-weight:bolder;overflow:hidden;text-overflow:ellipsis;width:100%;display:inline-block;font-size:.9em}.editor-preview code::-webkit-scrollbar{height:6px;background:#dee2e6}.editor-preview code::-webkit-scrollbar-thumb{background:#bbb;border-radius:6px}.editor-preview code::-webkit-scrollbar-thumb:hover{background:#737677} \ No newline at end of file