- First version of new HTML editor
- Integration of new HTML editor into build system 


git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5201 8810af33-2d31-482b-a856-94f89814c4df
jensp 2018-01-18 13:15:54 +00:00
parent 31cca7cb4f
commit 83d9e64014
12 changed files with 1342 additions and 4 deletions

View File

@ -90,6 +90,11 @@
<artifactId>maven-war-plugin</artifactId>
<configuration>
<overlays>
<overlay>
<groupId>org.libreccm</groupId>
<artifactId>ccm-editor</artifactId>
<type>jar</type>
</overlay>
<overlay>
<groupId>org.libreccm</groupId>
<artifactId>ccm-theme-foundry</artifactId>

View File

@ -0,0 +1,67 @@
requirejs(["./ccm-editor",
"../node_modules/requirejs-domready/domReady!"],
function(editor, doc) {
editor.addEditor(".editor", {
"actionGroups": [
{
"name": "blocks",
"title": "Format blocks",
"actions": [
editor.FormatBlockAction
]
},
{
"name": "format-text",
"title": "Format text",
"actions": [
editor.MakeBoldAction,
editor.MakeItalicAction,
editor.MakeUnderlineAction,
editor.StrikeThroughAction,
editor.SubscriptAction,
editor.SuperscriptAction,
editor.RemoveFormatAction,
editor.InsertExternalLinkAction
]
},
{
"name": "insert-list",
"title": "Insert list",
"actions": [
editor.InsertUnorderedListAction,
editor.InsertOrderedListAction
]
},
{
"name": "html",
"title": "HTML",
"actions": [editor.ToggleHtmlAction]
}
],
"settings": {
"formatBlock.blocks": [
{
"element": "h3",
"title": "Heading 3"
},
{
"element": "h4",
"title": "Heading 4"
},
{
"element": "h5",
"title": "Heading 5"
},
{
"element": "h6",
"title": "Heading 6"
},
{
"element": "p",
"title": "Paragraph"
}
]
}
});
});

View File

@ -26,6 +26,11 @@
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.libreccm</groupId>
<artifactId>ccm-editor</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.libreccm</groupId>
<artifactId>ccm-theme-foundry</artifactId>

View File

@ -27,7 +27,7 @@ import javax.persistence.EntityManager;
import javax.transaction.Transactional;
/**
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
* @version created on 11/7/16
*/
@RequestScoped

View File

@ -29,7 +29,7 @@ import javax.persistence.EntityManager;
import javax.transaction.Transactional;
/**
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
* @author <a href="mailto:tosmers@uni-bremen.de">Tobias Osmers</a>
* @version created on 11/7/16
*/
@RequestScoped

View File

@ -67,8 +67,8 @@ import javax.inject.Inject;
@RequestScoped
class ImportHelper {
//private String repoPath = "/home/jensp/pwi/libreccm/ccm/";
private final String repoPath = "/home/tosmers/Svn/libreccm/";
private final String repoPath = "/home/jensp/pwi/libreccm/ccm/";
// private final String repoPath = "/home/tosmers/Svn/libreccm/";
private final String projectPath = "ccm_ng/ccm-core/src/test/resources/" +
"portation/trunk-iaw-exports";
private final boolean indentation = false;

View File

@ -0,0 +1,17 @@
module.exports = function(grunt) {
grunt.initConfig({
ts: {
default : {
src: ["src/main/typescript/**/*.ts"],
options: {
module: "amd"
}
}
},
clean: ['scripts/*.js', 'scripts/*.js.map', 'scripts/.tscache']
});
grunt.loadNpmTasks("grunt-ts");
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask("default", ["ts"]);
};

View File

@ -0,0 +1,23 @@
{
"name": "ccm-editor",
"version": "7.0.0",
"description": "Simple HTML editor for LibreCCM",
"repository": {
"type": "svn",
"url": "https://svn.libreccm.org/ccm/ccm_ng/ccm-editor"
},
"author": "Jens Pelzetter",
"license": "GPL-3.0",
"dependencies": {
"font-awesome": "^4.7.0",
"fontawesome": "^4.7.2",
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0",
"grunt-contrib-clean": "^1.1.0",
"grunt-ts": "^6.0.0-beta.17",
"requirejs": "^2.3.5",
"requirejs-domready": "^2.0.3",
"typescript": "^2.6.2"
},
"devDependencies": {}
}

82
ccm-editor/pom.xml 100644
View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'Z</maven.build.timestamp.format>
</properties>
<parent>
<groupId>org.libreccm</groupId>
<artifactId>libreccm-parent</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<groupId>org.libreccm</groupId>
<artifactId>ccm-editor</artifactId>
<version>7.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>LibreCCM Editor</name>
<licenses>
<license>
<name>Lesser GPL 2.1</name>
<url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1</url>
</license>
</licenses>
<build>
<finalName>ccm-editor</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/typescript</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>Install node.js and NPM</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v6.12.3</nodeVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>grunt build</id>
<goals>
<goal>grunt</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,102 @@
.ccm-editor {
box-sizing: border-box;
width: 60em;
}
.ccm-editor-accessibility {
box-sizing: inherit;
position: absolute;
display: block;
width: 1px;
height: 1px;
overflow: hidden;
}
.ccm-editor-dialog {
background-color: #ccc;
border: 1px solid #aaa;
box-sizing: border-box;
padding: 1em 0.75em;
position: absolute;
left: 50%;
top: 50%;
margin-top: -10em;
margin-left: -20em;
width: 40em;
/*height: 20em;*/
}
.ccm-editor-dialog h1 {
margin-top: 0;
}
.ccm-editor-dialog form {
display: grid;
grid-template-columns: 1fr 2fr;
}
.ccm-editor-dialog form input[type="checkbox"] {
justify-self: start;
}
.ccm-editor-dialog form button {
justify-self: center;
}
.ccm-editor-editable {
background-color: #fff;
color: #000;
border: 1px solid #bbb;
box-sizing: inherit;
height: 20em;
padding: 0.5em 0.3em;
}
.ccm-editor-hidden {
display: none;
}
.ccm-editor-textarea {
background-color: #fff;
color: #000;
box-sizing: inherit;
width: 60em;
}
.ccm-editor-toolbar {
box-sizing: inherit;
background-color: #ccc;
border: 1px solid #ccc;
padding: 0.2em 0.33em;
}
.ccm-editor-toolbar-actiongroup {
box-sizing: inherit;
display: inline-block;
margin-left: 0.5em;
margin-right: 0.5em;
}

File diff suppressed because it is too large Load Diff

View File

@ -62,6 +62,9 @@
<module>ccm-docrepo</module>
<module>ccm-shortcuts</module>
<!-- Simple HTML editor for use in the backend -->
<module>ccm-editor</module>
<!-- Modules providing themes -->
<module>ccm-theme-foundry</module>
@ -216,6 +219,11 @@
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>