Skip to content

Commit

Permalink
SAK-32075 Add a11y checker plugin to ckeditor. (sakaiproject#4041)
Browse files Browse the repository at this point in the history
* SAK-32075 Add a11y checker plugin to ckeditor.

This plugin is disabled by default, to enable it you need to build with the maven profile:

    mvn -Pckeditor-a11ychecker install

This is because it’s license isn’t compatible with the ECL.

* SAK-32075 Make the config more generic.

We can include more of the config by default an it all still works.
Also update the profile to be the more generic ckeditor-extras with property based profile activation.

* SAK-32075 Update property name to be more specific
  • Loading branch information
buckett authored and jonespm committed Mar 21, 2017
1 parent 347c6ba commit 3b75ba3
Show file tree
Hide file tree
Showing 8 changed files with 233 additions and 1 deletion.
43 changes: 43 additions & 0 deletions library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<properties>
<bootstrap-version>3.3.7</bootstrap-version>
<font-awesome-version>4.7.0</font-awesome-version>
<!-- Empty defaults -->
<ckeditor-a11y-extra-plugins></ckeditor-a11y-extra-plugins>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -61,6 +63,7 @@
<version>${ckeditor.wordcount.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.webjars</groupId>
<artifactId>dropzone</artifactId>
Expand Down Expand Up @@ -363,9 +366,37 @@
</execution>
</executions>
</plugin>

</plugins>
</build>
</profile>
<profile>
<!-- These plugins can't be part of the standard build -->
<id>ckeditor-extras</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>ckeditor-extras</name>
</property>
</activation>
<properties>
<ckeditor-a11y-extra-plugins>,a11ychecker</ckeditor-a11y-extra-plugins>
</properties>
<dependencies>
<dependency>
<groupId>org.sakaiproject.webjars</groupId>
<artifactId>ckeditor-a11ychecker</artifactId>
<version>${ckeditor.a11ychecker.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.sakaiproject.webjars</groupId>
<artifactId>ckeditor-balloonpanel</artifactId>
<version>${ckeditor.balloonpanel.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
Expand All @@ -384,6 +415,18 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<webResources>
<resource>
<directory>src/webapp-filtered</directory>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ sakai.editor.editors.ckeditor.launch = function(targetId, config, w, h) {
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
['Maximize', 'ShowBlocks']
,['A11ychecker']
],
toolbar: 'Full',
resize_dir: 'both',
Expand Down Expand Up @@ -215,6 +216,9 @@ sakai.editor.editors.ckeditor.launch = function(targetId, config, w, h) {
CKEDITOR.plugins.addExternal('wordcount',webJars+'wordcount/4897cb23a9f2ca7fb6b792add4350fb9e2a1722c/', 'plugin.js');
CKEDITOR.plugins.addExternal('notification',basePath+'notification/', 'plugin.js');
CKEDITOR.plugins.addExternal('fontawesome',basePath+'fontawesome/', 'plugin.js');
// Accessibility checker has a dependency on balloonpanel
CKEDITOR.plugins.addExternal('balloonpanel',webJars+'balloonpanel/4.6.2/', 'plugin.js');
CKEDITOR.plugins.addExternal('a11ychecker',webJars+'a11ychecker/1.1.0/', 'plugin.js');
/*
To enable after the deadline uncomment these two lines and add atd-ckeditor to toolbar
and to extraPlugins. This also needs extra stylesheets.
Expand All @@ -231,7 +235,7 @@ sakai.editor.editors.ckeditor.launch = function(targetId, config, w, h) {
//ckconfig.extraPlugins+="atd-ckeditor,";
//ckconfig.contentsCss = [basePath+'atd-ckeditor/atd.css'];

ckconfig.extraPlugins+="image2,audiorecorder,movieplayer,wordcount,fmath_formula,autosave,fontawesome,notification";
ckconfig.extraPlugins+="image2,audiorecorder,movieplayer,wordcount,fmath_formula,autosave,fontawesome,notification${ckeditor-a11y-extra-plugins}";

//SAK-29648
ckconfig.contentsCss = [basePath+'/fontawesome/font-awesome/css/font-awesome.min.css'];
Expand Down
2 changes: 2 additions & 0 deletions master/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
<ckeditor.autosave.version>8541f541d9985cfd0859c7d8eb6be404afe95a2d</ckeditor.autosave.version>
<!-- Source at https://github.com/w8tcha/CKEditor-WordCount-Plugin -->
<ckeditor.wordcount.version>4897cb23a9f2ca7fb6b792add4350fb9e2a1722c</ckeditor.wordcount.version>
<ckeditor.a11ychecker.version>1.1.0</ckeditor.a11ychecker.version>
<ckeditor.balloonpanel.version>4.6.2</ckeditor.balloonpanel.version>
</properties>
<distributionManagement>
<snapshotRepository>
Expand Down
3 changes: 3 additions & 0 deletions webjars/ckeditor-a11ychecker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
WebJar for CKEditor autosave

More info: http://webjars.org
82 changes: 82 additions & 0 deletions webjars/ckeditor-a11ychecker/pom.xml
Original file line number Diff line number Diff line change
@@ -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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>webjars</artifactId>
<groupId>org.sakaiproject.webjars</groupId>
<version>12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<packaging>jar</packaging>
<groupId>org.sakaiproject.webjars</groupId>
<artifactId>ckeditor-a11ychecker</artifactId>
<version>${ckeditor.a11ychecker.version}</version>
<name>CKEditor-a11ychecker-webjar</name>
<description>WebJar for CKEditor-a11ychecker</description>
<url>http://webjars.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<upstream.version>${ckeditor.a11ychecker.version}</upstream.version>
<upstream.url>http://download.ckeditor.com/a11ychecker/releases/a11ychecker</upstream.url>
<destDir>${project.build.outputDirectory}/META-INF/resources/webjars/a11ychecker/${upstream.version}</destDir>
<requirejs>
{
"paths": {
"a11ychecker": "a11ychecker",
}
}
</requirejs>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals><goal>run</goal></goals>
<configuration>
<target>
<mkdir dir="${destDir}" />
<get src="${upstream.url}_${upstream.version}.zip" dest="${project.build.directory}/${project.artifactId}.zip" />
<echo message="unzip archives" />
<unzip src="${project.build.directory}/${project.artifactId}.zip" dest="${project.build.directory}">
<cutdirsmapper dirs="1"/>
</unzip>

<echo message="moving resources" />
<move todir="${destDir}">
<fileset dir="${project.build.directory}" excludes="tests/" />
</move>
</target>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>

</project>
3 changes: 3 additions & 0 deletions webjars/ckeditor-balloonpanel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
WebJar for CKEditor autosave

More info: http://webjars.org
82 changes: 82 additions & 0 deletions webjars/ckeditor-balloonpanel/pom.xml
Original file line number Diff line number Diff line change
@@ -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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>webjars</artifactId>
<groupId>org.sakaiproject.webjars</groupId>
<version>12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<packaging>jar</packaging>
<groupId>org.sakaiproject.webjars</groupId>
<artifactId>ckeditor-balloonpanel</artifactId>
<version>${ckeditor.balloonpanel.version}</version>
<name>CKEditor-balloonpanel-webjar</name>
<description>WebJar for CKEditor-balloonpanel</description>
<url>http://webjars.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<upstream.version>${ckeditor.balloonpanel.version}</upstream.version>
<upstream.url>http://download.ckeditor.com/balloonpanel/releases/balloonpanel</upstream.url>
<destDir>${project.build.outputDirectory}/META-INF/resources/webjars/balloonpanel/${upstream.version}</destDir>
<requirejs>
{
"paths": {
"balloonpanel": "balloonpanel",
}
}
</requirejs>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals><goal>run</goal></goals>
<configuration>
<target>
<mkdir dir="${destDir}" />
<get src="${upstream.url}_${upstream.version}.zip" dest="${project.build.directory}/${project.artifactId}.zip" />
<echo message="unzip archives" />
<unzip src="${project.build.directory}/${project.artifactId}.zip" dest="${project.build.directory}">
<cutdirsmapper dirs="1"/>
</unzip>

<echo message="moving resources" />
<move todir="${destDir}">
<fileset dir="${project.build.directory}"/>
</move>
</target>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>

</project>
13 changes: 13 additions & 0 deletions webjars/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,18 @@
<module>ckeditor-wordcount</module>
</modules>
</profile>
<profile>
<id>ckeditor-extras</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>ckeditor-extras</name>
</property>
</activation>
<modules>
<module>ckeditor-balloonpanel</module>
<module>ckeditor-a11ychecker</module>
</modules>
</profile>
</profiles>
</project>

0 comments on commit 3b75ba3

Please sign in to comment.