├── .gitignore ├── .nb-gradle-properties ├── LICENSE.md ├── README.md ├── build.gradle ├── build.xml ├── gradle.properties ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── manifest.mf ├── settings.gradle └── src ├── main ├── java │ └── tf │ │ └── ownnote │ │ └── ui │ │ ├── commentdata │ │ ├── CommentDataMapper.java │ │ ├── ICommentDataHolder.java │ │ └── ICommentDataInfo.java │ │ ├── helper │ │ ├── FileContentChangeType.java │ │ ├── FormatHelper.java │ │ ├── IFileChangeSubscriber.java │ │ ├── IFileContentChangeSubscriber.java │ │ ├── IGroupListContainer.java │ │ ├── OwnNoteDirectoryMonitor.java │ │ ├── OwnNoteEditorParameters.java │ │ ├── OwnNoteEditorPreferences.java │ │ ├── OwnNoteFileManager.java │ │ ├── OwnNoteHTMLEditor.java │ │ ├── OwnNoteMetaDataEditor.java │ │ ├── OwnNoteTab.java │ │ ├── OwnNoteTabPane.java │ │ ├── OwnNoteTableColumn.java │ │ ├── OwnNoteTableView.java │ │ ├── RecentNoteForGroup.java │ │ └── VerifyNoteContent.java │ │ ├── main │ │ ├── OwnNoteEditor.java │ │ └── OwnNoteEditorManager.java │ │ ├── notes │ │ ├── INoteCRMDS.java │ │ ├── Note.java │ │ ├── NoteMetaData.java │ │ ├── NoteMetaDataEditor.java │ │ └── NoteVersion.java │ │ ├── tags │ │ ├── ITagHolder.java │ │ ├── ITagTreeCell.java │ │ ├── TagCheckBoxTreeCell.java │ │ ├── TagData.java │ │ ├── TagDataEditor.java │ │ ├── TagDataWrapper.java │ │ ├── TagManager.java │ │ ├── TagTextFieldTreeCell.java │ │ ├── TagTreeCellBase.java │ │ ├── TagTreeCellFactory.java │ │ ├── TagsEditor.java │ │ └── TagsTreeView.java │ │ └── tasks │ │ ├── TaskBoard.java │ │ ├── TaskBoardLane.java │ │ ├── TaskCard.java │ │ ├── TaskCount.java │ │ ├── TaskData.java │ │ ├── TaskDataEditor.java │ │ ├── TaskList.java │ │ └── TaskManager.java └── resources │ ├── OwnNoteEditor.fxml │ ├── OwnNoteEditorManager.ico │ ├── OwnNoteEditorManager.png │ ├── css │ ├── customize-metro.css │ ├── customize-metro.min.css │ ├── delete-hover.png │ ├── delete.png │ ├── metro-base.css │ ├── metro-base.min.css │ ├── metro-light_theme.css │ ├── metro-light_theme.min.css │ ├── ownnote.css │ └── ownnote.min.css │ ├── editor.css │ ├── editor.min.css │ ├── insertcheckbox.png │ ├── insertcheckbox.svg │ ├── insertimage.png │ ├── insertimage.svg │ ├── tinymce │ ├── icons │ │ └── default │ │ │ └── icons.min.js │ ├── jquery-3.6.0.slim.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 │ │ │ └── plugin.min.js │ │ ├── colorpicker │ │ │ └── plugin.min.js │ │ ├── contextmenu │ │ │ └── plugin.min.js │ │ ├── directionality │ │ │ └── plugin.min.js │ │ ├── emoticons │ │ │ ├── js │ │ │ │ ├── emojiimages.js │ │ │ │ ├── emojiimages.min.js │ │ │ │ ├── emojis.js │ │ │ │ └── emojis.min.js │ │ │ └── plugin.min.js │ │ ├── fullpage │ │ │ └── plugin.min.js │ │ ├── fullscreen │ │ │ └── plugin.min.js │ │ ├── help │ │ │ └── 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 │ │ ├── quickbars │ │ │ └── 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 │ │ │ └── plugin.min.js │ │ ├── visualchars │ │ │ └── plugin.min.js │ │ └── wordcount │ │ │ └── plugin.min.js │ ├── skins │ │ ├── content │ │ │ ├── dark │ │ │ │ └── content.min.css │ │ │ ├── default │ │ │ │ └── content.min.css │ │ │ ├── document │ │ │ │ └── content.min.css │ │ │ └── writer │ │ │ │ └── content.min.css │ │ └── ui │ │ │ ├── oxide-dark │ │ │ ├── content.inline.min.css │ │ │ ├── content.min.css │ │ │ ├── content.mobile.min.css │ │ │ ├── fonts │ │ │ │ └── tinymce-mobile.woff │ │ │ ├── skin.min.css │ │ │ ├── skin.mobile.min.css │ │ │ └── skin.shadowdom.min.css │ │ │ └── oxide │ │ │ ├── content.inline.min.css │ │ │ ├── content.min.css │ │ │ ├── content.mobile.min.css │ │ │ ├── fonts │ │ │ └── tinymce-mobile.woff │ │ │ ├── skin.min.css │ │ │ ├── skin.mobile.min.css │ │ │ └── skin.shadowdom.min.css │ ├── themes │ │ ├── mobile │ │ │ └── theme.min.js │ │ └── silver │ │ │ └── theme.min.js │ └── tinymce.min.js │ ├── tinymceEditor.html │ └── tinymceEditor.min.html └── test ├── java └── tf │ └── ownnote │ └── ui │ ├── helper │ └── TestVerifyNoteContent.java │ ├── main │ ├── TestGroupTabsLookAndFeel.java │ └── TestTagTreeLookAndFeel.java │ ├── notes │ ├── TestNoteAppVersion.java │ └── TestNoteData.java │ ├── propertyextractor │ ├── PropertyHolder.java │ └── TestPropertyExtractor.java │ ├── tags │ ├── TestTagData.java │ └── TestTagManager.java │ └── tasks │ ├── TestTaskData.java │ └── TestTaskManager.java └── resources ├── LookAndFeel ├── MetaData │ └── tag_info.xml ├── [Test1] test1.htm ├── [Test1] test2.htm ├── [Test2] test3.htm └── [Test3] test1.htm ├── MetaData └── tag_info.xml ├── OwnNoteEditorManager.jpg ├── [Test] TestTasks.htm ├── [Test] TestVerify_ADD_ATTR.htm ├── [Test] TestVerify_DUPL_COM.htm ├── [Test] TestVerify_DUPL_ID.htm ├── [Test] TestVerify_OK.htm └── dummy.txt /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | build 15 | .gradle 16 | 17 | #NetBeans ignores 18 | nbproject/private/ 19 | build/ 20 | nbbuild/ 21 | dist/ 22 | nbdist/ 23 | nbactions.xml 24 | nb-configuration.xml 25 | .nb-gradle/ 26 | -------------------------------------------------------------------------------- /.nb-gradle-properties: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | j2se 5 | 11 6 | 1.9 7 | 8 | 9 | debugWithArgs 10 | no 11 | 12 | ${project}:debug 13 | 14 | 15 | -PcmdLineArgs=-lookAndFeel="classic" 16 | 17 | 18 | 19 | 20 | runWithArgs 21 | no 22 | 23 | ${project}:run 24 | 25 | 26 | -PcmdLineArgs=-lookAndFeel="oneNote" 27 | 28 | 29 | 30 | 31 | 32 | j2se 33 | 11 34 | 35 | 36 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2016, Thomas Feuster 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | Builds, tests, and runs the project ownNoteEditor. 3 | 4 | 53 | 54 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | netbeans.org-netbeans-modules-javascript2-requirejs.enabled=true 2 | action.custom-1=unzip 3 | action.custom-1.args=--configure-on-demand -w -x check unzip 4 | action.custom-2=dependencyUpdates 5 | action.custom-2.args=--configure-on-demand -w -x check -x test dependencyUpdates 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'markus' at '06.10.15 11:58' with Gradle 2.7 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.7/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'ownNoteEditor' 20 | -------------------------------------------------------------------------------- /src/main/java/tf/ownnote/ui/commentdata/ICommentDataHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014ff Thomas Feuster 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 3. The name of the author may not be used to endorse or promote products 13 | * derived from this software without specific prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | package tf.ownnote.ui.commentdata; 27 | 28 | import java.util.List; 29 | 30 | /** 31 | * Interface for all classes that support get / set values from (list of) strings 32 | * 33 | * @author thomas 34 | */ 35 | public interface ICommentDataHolder { 36 | public abstract ICommentDataInfo[] getCommentDataInfo(); 37 | 38 | public abstract void setFromString(final ICommentDataInfo name, final String value); 39 | public abstract void setFromList(final ICommentDataInfo name, final List values); 40 | public abstract String getAsString(final ICommentDataInfo name); 41 | public abstract List getAsList(final ICommentDataInfo name); 42 | 43 | public abstract String getDataHolderInfo(); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/tf/ownnote/ui/commentdata/ICommentDataInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014ff Thomas Feuster 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 3. The name of the author may not be used to endorse or promote products 13 | * derived from this software without specific prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | package tf.ownnote.ui.commentdata; 27 | 28 | /** 29 | * Interface for info to be used in get / set data from / to comment strings. 30 | * 31 | * @author thomas 32 | */ 33 | public interface ICommentDataInfo { 34 | public static enum Multiplicity { 35 | SINGLE, 36 | MULTIPLE 37 | } 38 | 39 | public String getDataName(); 40 | public Multiplicity getDataMultiplicity(); 41 | 42 | public abstract int ordinal(); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/tf/ownnote/ui/helper/FileContentChangeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package tf.ownnote.ui.helper; 7 | 8 | /** 9 | * 10 | * @author thomas 11 | */ 12 | public enum FileContentChangeType { 13 | CHECKBOX_CHANGED, 14 | CONTENT_CHANGED 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/tf/ownnote/ui/helper/IFileChangeSubscriber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package tf.ownnote.ui.helper; 7 | 8 | import java.nio.file.Path; 9 | import java.nio.file.WatchEvent; 10 | 11 | /** 12 | * Subscriber interface for file changes. 13 | * 14 | * Option to break propagation chain by returning FALSE. 15 | * 16 | * @author thomas 17 | */ 18 | public interface IFileChangeSubscriber { 19 | abstract boolean processFileChange(final WatchEvent.Kind eventKind, final Path filePath); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/tf/ownnote/ui/helper/IFileContentChangeSubscriber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package tf.ownnote.ui.helper; 7 | 8 | import tf.ownnote.ui.notes.Note; 9 | 10 | /** 11 | * Subscriber interface for editor content changes. 12 | * 13 | * Option to break propagation chain by returning FALSE. 14 | * 15 | * @author thomas 16 | */ 17 | public interface IFileContentChangeSubscriber { 18 | abstract boolean processFileContentChange(final FileContentChangeType changeType, final Note note, final String oldContent, final String newContent); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/tf/ownnote/ui/helper/IGroupListContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Thomas Feuster 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 3. The name of the author may not be used to endorse or promote products 13 | * derived from this software without specific prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | package tf.ownnote.ui.helper; 27 | 28 | import javafx.collections.ObservableList; 29 | import tf.ownnote.ui.notes.Note; 30 | import tf.ownnote.ui.tags.TagData; 31 | 32 | /** 33 | * Things you need to provide in order to act as a container 34 | * for OwnNote groups... 35 | * 36 | * @author Thomas Feuster 37 | */ 38 | public interface IGroupListContainer { 39 | 40 | public abstract void setGroups(final ObservableList groupsList, final boolean updateOnly); 41 | 42 | public abstract TagData getCurrentGroup(); 43 | 44 | public abstract void selectGroupForNote(final Note note); 45 | 46 | public abstract void setBackgroundColor(final String style); 47 | 48 | public abstract void setDisable(final boolean b); 49 | 50 | public abstract void setVisible(final boolean b); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/tf/ownnote/ui/helper/OwnNoteEditorParameters.java: -------------------------------------------------------------------------------- 1 | package tf.ownnote.ui.helper; 2 | 3 | import java.util.Optional; 4 | import org.apache.commons.cli.CommandLine; 5 | import org.apache.commons.cli.CommandLineParser; 6 | import org.apache.commons.cli.DefaultParser; 7 | import org.apache.commons.cli.HelpFormatter; 8 | import org.apache.commons.cli.Options; 9 | import org.apache.commons.cli.ParseException; 10 | 11 | public class OwnNoteEditorParameters { 12 | // this is a singleton for everyones use 13 | // http://www.javaworld.com/article/2073352/core-java/simply-singleton.html 14 | private final static OwnNoteEditorParameters INSTANCE = new OwnNoteEditorParameters(); 15 | 16 | // list of command line parameters we can understand 17 | public static enum CmdOps { 18 | ownCloudDir, 19 | lookAndFeel 20 | }; 21 | 22 | public static enum LookAndFeel { 23 | // TFE, 202100402: goodbye, classic look & feel... 24 | // classic, 25 | groupTabs, 26 | tagTree 27 | }; 28 | 29 | // value for owncloud path, if set 30 | private String ownCloudDir = null; 31 | 32 | // value for lookAndFeel, if set 33 | private LookAndFeel lookAndFeel = null; 34 | 35 | private OwnNoteEditorParameters() { 36 | // Exists only to defeat instantiation. 37 | } 38 | 39 | public static OwnNoteEditorParameters getInstance() { 40 | return INSTANCE; 41 | } 42 | 43 | public void init(final String [ ] args) { 44 | // thats all options we can handle 45 | Options options = new Options(); 46 | options.addOption( 47 | OwnNoteEditorParameters.CmdOps.lookAndFeel.toString(), 48 | OwnNoteEditorParameters.CmdOps.lookAndFeel.toString(), 49 | true, 50 | "Layout to use - can be \"groupTabs\" or \"tagTree\""); 51 | options.addOption( 52 | OwnNoteEditorParameters.CmdOps.ownCloudDir.toString(), 53 | OwnNoteEditorParameters.CmdOps.ownCloudDir.toString(), 54 | true, 55 | "Path of ownCloud Notes directory"); 56 | 57 | // lets parse them by code from other people 58 | CommandLineParser parser = new DefaultParser(); 59 | try { 60 | CommandLine command = parser.parse(options, args); 61 | 62 | // get path to owncloud notes directory 63 | if (command.hasOption(OwnNoteEditorParameters.CmdOps.ownCloudDir.toString())) { 64 | ownCloudDir = command.getOptionValue(OwnNoteEditorParameters.CmdOps.ownCloudDir.toString()); 65 | // System.out.println("Option ownCloudDir found: " + ownCloudDir); 66 | } 67 | 68 | String value = ""; 69 | if (command.hasOption(OwnNoteEditorParameters.CmdOps.lookAndFeel.toString())) { 70 | value = command.getOptionValue(OwnNoteEditorParameters.CmdOps.lookAndFeel.toString()); 71 | 72 | switch (value) { 73 | case "groupTabs": 74 | // System.out.println("Option lookAndFeel found: " + laf); 75 | lookAndFeel = LookAndFeel.groupTabs; 76 | break; 77 | case "tagTree": 78 | // System.out.println("Option lookAndFeel found: " + laf); 79 | lookAndFeel = LookAndFeel.tagTree; 80 | break; 81 | default: 82 | System.out.println("Value \"" + value + "\" for option lookAndFeel not recognized."); 83 | } 84 | } 85 | 86 | } catch (ParseException|NumberFormatException ex) { 87 | //Logger.getLogger(OwnNoteEditorParameters.class.getName()).log(Level.SEVERE, null, ex); 88 | // fix for issue #19: add usage screen in case of incorrect options 89 | help(options); 90 | } 91 | } 92 | 93 | public Optional getOwnCloudDir() { 94 | return Optional.ofNullable(ownCloudDir); 95 | } 96 | 97 | public void setOwnCloudDir(final String ownCloudDir) { 98 | this.ownCloudDir = ownCloudDir; 99 | } 100 | 101 | public Optional getLookAndFeel() { 102 | return Optional.ofNullable(lookAndFeel); 103 | } 104 | 105 | public void setLookAndFeel(final LookAndFeel lookAndFeel) { 106 | this.lookAndFeel = lookAndFeel; 107 | } 108 | 109 | private void help(final Options options) { 110 | // This prints out some help 111 | HelpFormatter formater = new HelpFormatter(); 112 | 113 | formater.printHelp("OwnNoteEditor", "Valid options are:", options, "Continue using only recognized options"); 114 | //System.exit(0); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/main/java/tf/ownnote/ui/helper/OwnNoteEditorPreferences.java: -------------------------------------------------------------------------------- 1 | package tf.ownnote.ui.helper; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.io.OutputStream; 6 | import java.util.logging.Level; 7 | import java.util.logging.Logger; 8 | import java.util.prefs.BackingStoreException; 9 | import java.util.prefs.InvalidPreferencesFormatException; 10 | import java.util.prefs.Preferences; 11 | import tf.helper.general.GeneralParser; 12 | import tf.helper.general.IPreferencesStore; 13 | import tf.helper.general.ObjectsHelper; 14 | import tf.ownnote.ui.main.OwnNoteEditor; 15 | 16 | public enum OwnNoteEditorPreferences implements IPreferencesStore { 17 | INSTANCE("instance", "", String.class), 18 | RECENT_OWNCLOUDPATH("recentOwnCloudPath", "", String.class), 19 | RECENT_LOOKANDFEEL("recentLookAndFeel", OwnNoteEditorParameters.LookAndFeel.groupTabs.name(), OwnNoteEditorParameters.LookAndFeel.class), 20 | // issue #30 store percentage for group column width 21 | RECENT_GROUPTABS_GROUPWIDTH("recentGroupTabsGroupWidth", Double.toString(30.0), Double.class), 22 | RECENT_TASKLIST_WIDTH("recentTaskListWidth", Double.toString(15.0), Double.class), 23 | RECENT_TASKLIST_VISIBLE("recentTaskListVisible", Boolean.toString(true), Boolean.class), 24 | RECENT_WINDOW_WIDTH("recentWindowWidth", Double.toString(1200.0), Double.class), 25 | RECENT_WINDOW_HEIGTH("recentWindowHeigth", Double.toString(600.0), Double.class), 26 | RECENT_WINDOW_LEFT("recentWindowLeft", Double.toString(0.0), Double.class), 27 | RECENT_WINDOW_TOP("recentWindowTop", Double.toString(0.0), Double.class), 28 | // issue #45 store sort order for tables 29 | RECENT_NOTESTABLE_SORTORDER("recentNotesTableSortOrder", "recentNotesTableSortOrder", String.class), 30 | // TFE, 20201205: store everything for tables :-) 31 | RECENT_NOTESTABLE_SETTINGS("recentNotesTableSettings", "recentNotesTableSettings", String.class), 32 | // TFE, 20201030: store last edited file 33 | LAST_EDITED_NOTE("lastEditedNote", "", String.class), 34 | LAST_EDITED_GROUP("lastEditedGroup", "", String.class), 35 | // TFE, 20201204: new layout: tag tree as first column 36 | RECENT_TAGTREE_WIDTH("recentTagTreeWidth", Double.toString(18.3333333), Double.class), 37 | // TFE, 20210111: store location & size of KANBAN window 38 | RECENT_KANBAN_WINDOW_WIDTH("recentKanbanWindowWidth", Double.toString(800.0), Double.class), 39 | RECENT_KANBAN_WINDOW_HEIGTH("recentKanbanWindowHeigth", Double.toString(600.0), Double.class), 40 | RECENT_KANBAN_WINDOW_LEFT("recentKanbanWindowLeft", Double.toString(Double.NaN), Double.class), 41 | RECENT_KANBAN_WINDOW_TOP("recentKanbanWindowTop", Double.toString(Double.NaN), Double.class), 42 | // TFE, 20200907: store tab order 43 | RECENT_TAB_ORDER("recentTabOrder", "", String.class), 44 | // TFE, 20210716: store recent note per group 45 | RECENT_NOTE_FOR_GROUP("recentNoteForGroup", "", String.class); 46 | 47 | public static final String PREF_STRING_PREFIX = "[ "; 48 | public static final String PREF_STRING_SUFFIX = " ]"; 49 | public static final String PREF_DATA_SEP = "---"; 50 | public static final String PREF_STRING_SEP = " ::: "; 51 | 52 | private final static Preferences MYPREFERENCES = Preferences.userNodeForPackage(OwnNoteEditor.class); 53 | 54 | private final String myPrefKey; 55 | private final String myDefaultValue; 56 | private final Class myClass; 57 | 58 | private OwnNoteEditorPreferences(final String key, final String defaultValue, final Class classP) { 59 | myPrefKey = key; 60 | myDefaultValue = defaultValue; 61 | myClass = classP; 62 | } 63 | 64 | public String getAsString() { 65 | return get(myPrefKey, myDefaultValue); 66 | } 67 | 68 | public T getAsType() { 69 | // TODO: check type against own class - needs add Class variable... 70 | 71 | // see https://ideone.com/WtNDN2 for the general idea 72 | try { 73 | return ObjectsHelper.uncheckedCast(GeneralParser.parse(getAsString(), ObjectsHelper.uncheckedCast(myClass))); 74 | } catch (Exception ex) { 75 | return getDefaultAsType(); 76 | } 77 | } 78 | 79 | public void put(final T value) { 80 | put(myPrefKey, value.toString()); 81 | } 82 | 83 | public T getDefaultAsType() { 84 | // TODO: check type against own class - needs add Class variable... 85 | 86 | // see https://ideone.com/WtNDN2 for the general idea 87 | return ObjectsHelper.uncheckedCast(GeneralParser.parse(myDefaultValue, ObjectsHelper.uncheckedCast(myClass))); 88 | } 89 | 90 | private static String getImpl(final String key, final String defaultValue) { 91 | String result = defaultValue; 92 | 93 | try { 94 | result= MYPREFERENCES.get(key, defaultValue); 95 | } catch (SecurityException ex) { 96 | Logger.getLogger(OwnNoteEditorPreferences.class.getName()).log(Level.SEVERE, null, ex); 97 | } 98 | 99 | return result; 100 | } 101 | @Override 102 | public String get(final String key, final String defaultValue) { 103 | return getImpl(key, defaultValue); 104 | } 105 | 106 | private static void putImpl(final String key, final String value) { 107 | MYPREFERENCES.put(key, value); 108 | } 109 | @Override 110 | public void put(final String key, final String value) { 111 | putImpl(key, value); 112 | } 113 | 114 | public static void clearImpl() { 115 | try { 116 | MYPREFERENCES.clear(); 117 | } catch (BackingStoreException ex) { 118 | Logger.getLogger(OwnNoteEditorPreferences.class.getName()).log(Level.SEVERE, null, ex); 119 | } 120 | } 121 | @Override 122 | public void clear() { 123 | clearImpl(); 124 | } 125 | 126 | public static void removeImpl(String key) { 127 | MYPREFERENCES.remove(key); 128 | } 129 | @Override 130 | public void remove(String key) { 131 | removeImpl(key); 132 | } 133 | 134 | public static void exportPreferencesImpl(final OutputStream os) { 135 | try { 136 | MYPREFERENCES.exportSubtree(os); 137 | } catch (BackingStoreException | IOException ex) { 138 | Logger.getLogger(OwnNoteEditorPreferences.class.getName()).log(Level.SEVERE, null, ex); 139 | } 140 | } 141 | @Override 142 | public void exportPreferences(final OutputStream os) { 143 | exportPreferencesImpl(os); 144 | } 145 | 146 | public void importPreferencesImpl(final InputStream is) { 147 | try { 148 | Preferences.importPreferences(is); 149 | } catch (InvalidPreferencesFormatException | IOException ex) { 150 | Logger.getLogger(OwnNoteEditorPreferences.class.getName()).log(Level.SEVERE, null, ex); 151 | } 152 | } 153 | @Override 154 | public void importPreferences(final InputStream is) { 155 | importPreferencesImpl(is); 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /src/main/java/tf/ownnote/ui/helper/RecentNoteForGroup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014ff Thomas Feuster 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 3. The name of the author may not be used to endorse or promote products 13 | * derived from this software without specific prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | package tf.ownnote.ui.helper; 27 | 28 | import java.util.HashMap; 29 | import java.util.stream.Collectors; 30 | import tf.ownnote.ui.notes.Note; 31 | import tf.ownnote.ui.tags.TagManager; 32 | 33 | /** 34 | * Map that keeps track of the most recent edited note for each group. 35 | * 36 | * Supports storing to / reading from preferences. 37 | * 38 | * @author thomas 39 | */ 40 | public class RecentNoteForGroup extends HashMap { 41 | private final static RecentNoteForGroup INSTANCE = new RecentNoteForGroup(); 42 | 43 | private RecentNoteForGroup() { 44 | super(); 45 | } 46 | 47 | public static RecentNoteForGroup getInstance() { 48 | return INSTANCE; 49 | } 50 | 51 | public String toPreferenceString() { 52 | return OwnNoteEditorPreferences.PREF_STRING_PREFIX + 53 | entrySet().stream().map((t) -> { 54 | if (t.getValue() != null) { 55 | return t.getKey() + OwnNoteEditorPreferences.PREF_DATA_SEP + t.getValue().getNoteName(); 56 | } else { 57 | return null; 58 | } 59 | }).collect( Collectors.joining(OwnNoteEditorPreferences.PREF_STRING_SEP)) + 60 | OwnNoteEditorPreferences.PREF_STRING_SUFFIX; 61 | } 62 | 63 | public void fromPreferenceString(final String prefString) { 64 | // not long enough to be a valid preference string 65 | if (prefString.length() < (OwnNoteEditorPreferences.PREF_STRING_PREFIX + OwnNoteEditorPreferences.PREF_STRING_SUFFIX).length()) { 66 | return; 67 | } 68 | if (!prefString.startsWith(OwnNoteEditorPreferences.PREF_STRING_PREFIX)) { 69 | return; 70 | } 71 | if (!prefString.endsWith(OwnNoteEditorPreferences.PREF_STRING_SUFFIX)) { 72 | return; 73 | } 74 | 75 | // list of key - value pairs (as single string) for the map 76 | final String [] prefs = prefString.substring(OwnNoteEditorPreferences.PREF_STRING_PREFIX.length(), prefString.length()-OwnNoteEditorPreferences.PREF_STRING_SUFFIX.length()). 77 | strip().split(OwnNoteEditorPreferences.PREF_STRING_SEP); 78 | 79 | for (String pref : prefs) { 80 | // no two elements in preference string 81 | if (pref.split(OwnNoteEditorPreferences.PREF_DATA_SEP).length != 2) { 82 | continue; 83 | } 84 | 85 | final String[] recentNote = pref.split(OwnNoteEditorPreferences.PREF_DATA_SEP); 86 | put(recentNote[0], OwnNoteFileManager.getInstance().getNote(TagManager.getInstance().groupForExternalName(recentNote[0], false), recentNote[1])); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/tf/ownnote/ui/helper/VerifyNoteContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014ff Thomas Feuster 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 3. The name of the author may not be used to endorse or promote products 13 | * derived from this software without specific prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | package tf.ownnote.ui.helper; 27 | 28 | import java.util.ArrayList; 29 | import java.util.HashMap; 30 | import java.util.List; 31 | import java.util.Map; 32 | import java.util.function.BiFunction; 33 | import java.util.regex.Matcher; 34 | import java.util.regex.Pattern; 35 | import tf.ownnote.ui.notes.Note; 36 | 37 | /** 38 | * Helper class to find & fix common issues in note content, e.g. from previous bugs :-) 39 | * 40 | * @author thomas 41 | */ 42 | public class VerifyNoteContent { 43 | private final static VerifyNoteContent INSTANCE = new VerifyNoteContent(); 44 | 45 | private enum ContentIssues { 46 | REPEATED_METADATA("Repeated Metadata", "-->/g,function(e,t){return unescape(t)}))})})}(); -------------------------------------------------------------------------------- /src/main/resources/tinymce/plugins/hr/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.10.1 (2021-11-03) 8 | */ 9 | !function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",function(n){var o,t;function e(){return t.execCommand("InsertHorizontalRule")}(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"
")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:e}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:e})})}(); -------------------------------------------------------------------------------- /src/main/resources/tinymce/plugins/importcss/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.10.1 (2021-11-03) 8 | */ 9 | !function(){"use strict";function t(n){return function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}}function y(t){return t.getParam("importcss_selector_converter")}function u(e){return l(e)?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e}function h(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var o=n[1],i=n[2].substr(1).split(".").join(" "),c=x.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[o]?r.block=o:t.schema.getBlockElements()[o]||c[o.toLowerCase()]?r.selector=o:r.inline=o):n[2]&&(r={inline:"span",title:e.substr(1),classes:i}),!1!==t.getParam("importcss_merge_classes")?r.classes=i:r.attributes={class:i},r}}function d(t,e){return null===e||!1!==t.getParam("importcss_exclusive")}function r(v){v.on("init",function(){function o(t,e){if(f=t,p=g,!(d(v,m=e)?f in p:f in m.selectors)){a=t,l=g,d(v,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(i=(o=v).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:y(o)?y(o):function(){return h(o,c)}).call(i,c,s));if(r){var n=r.name||_.DOM.uniqueId();return v.formatter.register(n,r),{title:r.title,format:n}}}var o,i,c,s,a,u,l,f,m,p;return null}var e,r,n,t,i=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return function(t){for(var e=[],r=0,n=t.length;r'+n+"")):e.insertContent(d(e,t))}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),i="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" "),g=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",function(e){var n,r,t,a,i,o,u,c;function m(e){return r.execCommand("mceInsertDate",!1,e)}(n=e).addCommand("mceInsertDate",function(e,t){p(n,null!=t?t:n.getParam("insertdatetime_dateformat",n.translate("%Y-%m-%d")))}),n.addCommand("mceInsertTime",function(e,t){p(n,null!=t?t:l(n))}),u=s(r=e),t=0<(o=s(i=r)).length?o[0]:l(i),a=t,c={get:function(){return a},set:function(e){a=e}},r.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===c.get()},fetch:function(e){e(g.map(u,function(e){return{type:"choiceitem",text:d(r,e),value:e}}))},onAction:function(e){m(c.get())},onItemAction:function(e,t){c.set(t),m(t)}}),r.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return g.map(u,function(e){return{type:"menuitem",text:d(r,e),onAction:(t=e,function(){c.set(t),m(t)})};var t})}})})}(); -------------------------------------------------------------------------------- /src/main/resources/tinymce/plugins/legacyoutput/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.10.1 (2021-11-03) 8 | */ 9 | !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("legacyoutput",function(e){var s,t;(t=s=e).settings.inline_styles=!1,t.getParam("fontsize_formats")||(t.settings.fontsize_formats="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t.getParam("font_formats")||(t.settings.font_formats="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),s.on("PreInit",function(){var e=s,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),a=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(l.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}(); -------------------------------------------------------------------------------- /src/main/resources/tinymce/plugins/nonbreaking/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.10.1 (2021-11-03) 8 | */ 9 | !function(){"use strict";function o(n,e){for(var a="",o=0;o'+o(" ",e)+"":o(" ",e);n.undoManager.transact(function(){return n.insertContent(a)})}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.VK");n.add("nonbreaking",function(n){var e,a,o,t,i;function r(){return a.execCommand("mceNonBreaking")}(e=n).addCommand("mceNonBreaking",function(){s(e,1)}),(a=n).ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:r}),a.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:r}),0<(i="boolean"==typeof(t=(o=n).getParam("nonbreaking_force_tab",0))?!0===t?3:0:t)&&o.on("keydown",function(n){n.keyCode!==c.TAB||n.isDefaultPrevented()||n.shiftKey||(n.preventDefault(),n.stopImmediatePropagation(),s(o,i))})})}(); -------------------------------------------------------------------------------- /src/main/resources/tinymce/plugins/noneditable/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.10.1 (2021-11-03) 8 | */ 9 | !function(){"use strict";function l(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")}function u(e){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(e)}}function e(e){var t,r="contenteditable",n=" "+f.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",a=" "+f.trim(l(e))+" ",i=u(n),o=u(a),c=(t=e.getParam("noneditable_regexp",[]))&&t.constructor===RegExp?[t]:t;e.on("PreInit",function(){0"===r){var a=o.lastIndexOf("<",n);if(-1!==a&&-1!==o.substring(a,n).indexOf('contenteditable="false"'))return t}return''+i.dom.encode("string"==typeof e[1]?e[1]:e[0])+""}}(t,a,l(t)));n.content=a}}(e,c,t)}),e.parser.addAttributeFilter("class",function(t){for(var e,n=t.length;n--;)e=t[n],i(e)?e.attr(r,"true"):o(e)&&e.attr(r,"false")}),e.serializer.addAttributeFilter(r,function(t){for(var e,n=t.length;n--;)e=t[n],(i(e)||o(e))&&(0';return e?"

"+a+"

":a}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),m="mce-pagebreak";e.add("pagebreak",function(e){var a,n,o,i,t,r;function c(){return n.execCommand("mcePageBreak")}function g(){return u(o)}(a=e).addCommand("mcePageBreak",function(){a.insertContent(l(u(a)))}),(n=e).ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:c}),n.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:c}),i=(o=e).getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e"),t=new RegExp(i.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),o.on("BeforeSetContent",function(e){e.content=e.content.replace(t,l(g()))}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var a,n,t,r=e.length;r--;)(t=(n=e[r]).attr("class"))&&-1!==t.indexOf(m)&&(a=n.parent,o.schema.getBlockElements()[a.name]&&g()?(a.type=3,a.value=i,a.raw=!0,n.remove()):(n.type=3,n.value=i,n.raw=!0))})}),(r=e).on("ResolveName",function(e){"IMG"===e.target.nodeName&&r.dom.hasClass(e.target,m)&&(e.name="pagebreak")})})}(); -------------------------------------------------------------------------------- /src/main/resources/tinymce/plugins/preview/plugin.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 | * Licensed under the LGPL or a commercial license. 4 | * For LGPL see License.txt in the project root for license information. 5 | * For commercial licenses see https://www.tiny.cloud/ 6 | * 7 | * Version: 5.10.1 (2021-11-03) 8 | */ 9 | !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.Env"),w=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("preview",function(e){var n,t;function i(){return t.execCommand("mcePreview")}(n=e).addCommand("mcePreview",function(){var e,t;t=function(t){var n="",i=t.dom.encode,e=t.getParam("content_style","","string");n+='';var o=t.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"";w.each(t.contentCSS,function(e){n+='"}),e&&(n+='");var a,r,s,c,d,l,m,y=-1===(c=(a=t).getParam("body_id","tinymce","string")).indexOf("=")?c:(s=(r=a).getParam("body_id","","hash"))[r.id]||s,u=-1===(m=(d=t).getParam("body_class","","string")).indexOf("=")?m:(l=d).getParam("body_class","","hash")[l.id]||"",v='