Permalink
Browse files

Added new tabfocus plugin, this enables you to tab to/from editor usi…

…ng the keyboard.

Added new build process so it uses the YUI Compressor and Apache Ant.
Added new logic to the paste plugin to remove all formatting to avoid issues with MS Word or other sources.
Fixed bug where selecting all contents didn't work the first time due to a bug in the forceblocks plugin.
Fixed bug where selection.setContent didn't place the caret after the inserted contents.
Fixed bug where the dom.getPos method didn't return correct values on FF.
Fixed bug where the editor would scroll the entire page to top if you pressed return/enter.
Fixed bug where it was impossible to submit two editor instances using form.submit.
Fixed bug where http:// and ftp:// could be converted into emoticons.

git-svn-id: http://punymce.googlecode.com/svn/trunk@35 bac5f1eb-4f33-0410-b5f2-5fb0db2f108a
  • Loading branch information...
1 parent dcc9b67 commit 229076af09b5c3eede138ecc17e030b090ed6f22 @spocke committed Apr 6, 2009
Showing with 1,481 additions and 1,174 deletions.
  1. +0 −32 JSTrim.config
  2. BIN JSTrim.exe
  3. BIN JSTrim_mono.exe
  4. +2 −0 build.bat
  5. +93 −0 build.xml
  6. +1 −1 js/punymce/plugins/bbcode.js
  7. +49 −47 js/punymce/plugins/bbcode_src.js
  8. +1 −1 js/punymce/plugins/editsource/editsource.js
  9. +64 −62 js/punymce/plugins/editsource/editsource_src.js
  10. +1 −1 js/punymce/plugins/emoticons/emoticons.js
  11. +248 −240 js/punymce/plugins/emoticons/emoticons_src.js
  12. +1 −1 js/punymce/plugins/entities.js
  13. +31 −29 js/punymce/plugins/entities_src.js
  14. +1 −1 js/punymce/plugins/forceblocks.js
  15. +405 −348 js/punymce/plugins/forceblocks_src.js
  16. +1 −1 js/punymce/plugins/image/image.js
  17. +25 −23 js/punymce/plugins/image/image_src.js
  18. +1 −1 js/punymce/plugins/link/link.js
  19. +27 −25 js/punymce/plugins/link/link_src.js
  20. +1 −1 js/punymce/plugins/paste.js
  21. +131 −19 js/punymce/plugins/paste_src.js
  22. +1 −1 js/punymce/plugins/protect.js
  23. +24 −22 js/punymce/plugins/protect_src.js
  24. +1 −1 js/punymce/plugins/safari2x.js
  25. +223 −221 js/punymce/plugins/safari2x_src.js
  26. +1 −0 js/punymce/plugins/tabfocus.js
  27. +45 −0 js/punymce/plugins/tabfocus_src.js
  28. +1 −1 js/punymce/plugins/textcolor/textcolor.js
  29. +58 −56 js/punymce/plugins/textcolor/textcolor_src.js
  30. +1 −1 js/punymce/puny_mce.js
  31. +1 −1 js/punymce/puny_mce_full.js
  32. +42 −37 js/punymce/puny_mce_src.js
  33. BIN tools/ant/ant-contrib.jar
  34. BIN tools/ant/js_build_tools.jar
  35. BIN tools/ant/svnClientAdapter.jar
  36. BIN tools/ant/svnant.jar
  37. BIN tools/ant/svnjavahl.jar
  38. BIN tools/ant/svnkit.jar
  39. BIN tools/ant/yuicompressor.jar
View
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<jstrim mode="high">
- <!-- Compress core and all plugins -->
- <trim mode="high" src="js/punymce/puny_mce_src.js" dest="js/punymce/puny_mce.js" />
- <trim mode="high" src="js/punymce/plugins/forceblocks_src.js" dest="js/punymce/plugins/forceblocks.js" />
- <trim mode="high" src="js/punymce/plugins/emoticons/emoticons_src.js" dest="js/punymce/plugins/emoticons/emoticons.js" />
- <trim mode="high" src="js/punymce/plugins/editsource/editsource_src.js" dest="js/punymce/plugins/editsource/editsource.js" />
- <trim mode="low" src="js/punymce/plugins/image/image_src.js" dest="js/punymce/plugins/image/image.js" />
- <trim mode="low" src="js/punymce/plugins/link/link_src.js" dest="js/punymce/plugins/link/link.js" />
- <trim mode="low" src="js/punymce/plugins/textcolor/textcolor_src.js" dest="js/punymce/plugins/textcolor/textcolor.js" />
- <trim mode="low" src="js/punymce/plugins/paste_src.js" dest="js/punymce/plugins/paste.js" />
- <trim mode="low" src="js/punymce/plugins/bbcode_src.js" dest="js/punymce/plugins/bbcode.js" />
- <trim mode="low" src="js/punymce/plugins/entities_src.js" dest="js/punymce/plugins/entities.js" />
- <trim mode="low" src="js/punymce/plugins/protect_src.js" dest="js/punymce/plugins/protect.js" />
- <trim mode="high" src="js/punymce/plugins/safari2x_src.js" dest="js/punymce/plugins/safari2x.js" />
-
- <!-- Merge core and all plugins into one big file -->
- <trim mode="high" dest="js/punymce/puny_mce_full.js">
- <add src="js/punymce/puny_mce_src.js" />
- <add src="js/punymce/plugins/forceblocks_src.js" />
- <add src="js/punymce/plugins/emoticons/emoticons_src.js" />
- <add src="js/punymce/plugins/editsource/editsource_src.js" />
- <add src="js/punymce/plugins/image/image_src.js" />
- <add src="js/punymce/plugins/link/link_src.js" />
- <add src="js/punymce/plugins/textcolor/textcolor_src.js" />
- <add src="js/punymce/plugins/paste_src.js" />
- <add src="js/punymce/plugins/bbcode_src.js" />
- <add src="js/punymce/plugins/entities_src.js" />
- <add src="js/punymce/plugins/protect_src.js" />
- <add src="js/punymce/plugins/safari2x_src.js" />
- </trim>
-</jstrim>
View
Binary file not shown.
View
Binary file not shown.
View
@@ -0,0 +1,2 @@
+@echo off
+ant -q %*
View
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="PunyMCE" default="build" basedir=".">
+ <!-- Path properties -->
+ <property description="Export directory" name="export_dir" value="export" />
+
+ <!-- Setup classpath for js-build-tools ant tasks -->
+ <path id="tasks.classpath">
+ <pathelement location="."/>
+
+ <fileset dir="tools\ant">
+ <include name="**/*.jar"/>
+ </fileset>
+ </path>
+
+ <!-- Register new js-build-tools ant tasks -->
+ <taskdef name="preprocess" classname="com.moxiecode.ant.tasks.PreProcessTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
+ <taskdef name="yuicompress" classname="com.moxiecode.ant.tasks.YuiCompressTask" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
+ <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
+ <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="tasks.classpath" loaderref="tasks.classpath.loader" />
+
+ <target name="build">
+ <!-- Concat multuple JS files together -->
+ <concat destfile="js/punymce/puny_mce.full.tmp.js">
+ <fileset dir="js" includes="punymce/puny_mce_src.js" />
+ <fileset dir="js" includes="punymce/plugins/forceblocks_src.js" />
+ <fileset dir="js" includes="punymce/plugins/emoticons/emoticons_src.js" />
+ <fileset dir="js" includes="punymce/plugins/editsource/editsource_src.js" />
+ <fileset dir="js" includes="punymce/plugins/image/image_src.js" />
+ <fileset dir="js" includes="punymce/plugins/link/link_src.js" />
+ <fileset dir="js" includes="punymce/plugins/textcolor/textcolor_src.js" />
+ <fileset dir="js" includes="punymce/plugins/paste_src.js" />
+ <fileset dir="js" includes="punymce/plugins/bbcode_src.js" />
+ <fileset dir="js" includes="punymce/plugins/entities_src.js" />
+ <fileset dir="js" includes="punymce/plugins/protect_src.js" />
+ <fileset dir="js" includes="punymce/plugins/tabfocus_src.js" />
+ <fileset dir="js" includes="punymce/plugins/safari2x_src.js" />
+ </concat>
+
+ <!-- Compress PunyMCE full and base using the YUI Compressor -->
+ <yuicompress infile="js/punymce/puny_mce.full.tmp.js" outfile="js/punymce/puny_mce_full.js" />
+ <yuicompress infile="js/punymce/puny_mce_src.js" outfile="js/punymce/puny_mce.js" />
+
+ <!-- Compress all PunyMCE plugins using the YUI Compressor -->
+ <yuicompress infile="js/punymce/plugins/forceblocks_src.js" outfile="js/punymce/plugins/forceblocks.js" />
+ <yuicompress infile="js/punymce/plugins/emoticons/emoticons_src.js" outfile="js/punymce/plugins/emoticons/emoticons.js" />
+ <yuicompress infile="js/punymce/plugins/editsource/editsource_src.js" outfile="js/punymce/plugins/editsource/editsource.js" />
+ <yuicompress infile="js/punymce/plugins/image/image_src.js" outfile="js/punymce/plugins/image/image.js" />
+ <yuicompress infile="js/punymce/plugins/link/link_src.js" outfile="js/punymce/plugins/link/link.js" />
+ <yuicompress infile="js/punymce/plugins/textcolor/textcolor_src.js" outfile="js/punymce/plugins/textcolor/textcolor.js" />
+ <yuicompress infile="js/punymce/plugins/paste_src.js" outfile="js/punymce/plugins/paste.js" />
+ <yuicompress infile="js/punymce/plugins/bbcode_src.js" outfile="js/punymce/plugins/bbcode.js" />
+ <yuicompress infile="js/punymce/plugins/entities_src.js" outfile="js/punymce/plugins/entities.js" />
+ <yuicompress infile="js/punymce/plugins/protect_src.js" outfile="js/punymce/plugins/protect.js" />
+ <yuicompress infile="js/punymce/plugins/tabfocus_src.js" outfile="js/punymce/plugins/tabfocus.js" />
+ <yuicompress infile="js/punymce/plugins/safari2x_src.js" outfile="js/punymce/plugins/safari2x.js" />
+
+ <delete file="js/punymce/puny_mce.full.tmp.js" quiet="true" />
+ </target>
+
+ <target name="release">
+ <!-- Export -->
+ <delete dir="${export_dir}/punymce" quiet="true" />
+
+ <svn javahl="${javahl}">
+ <export srcUrl="http://punymce.googlecode.com/svn/trunk/" destPath="${export_dir}/punymce" />
+ </svn>
+
+ <!-- Parse minor version, major version and release date from changelog -->
+ <loadfile property="changelog" srcFile="${export_dir}/punymce/changelog.txt" />
+ <propertyregex property="version" input="${changelog}" regexp="^Version ([0-9xabrc.]+)" select="\1" />
+ <propertyregex property="release_date" input="${changelog}" regexp="^Version [^\(]+\(([^\)]+)\)" select="\1" />
+ <propertyregex property="file_version" input="${version}" regexp="\." replace="_" />
+
+ <!-- Compress production package -->
+ <delete file="${export_dir}/punymce_${file_version}.zip" quiet="true" />
+ <zip destfile="${export_dir}/punymce_${file_version}.zip">
+ <fileset dir="${export_dir}/punymce">
+ <include name="*/**" />
+ <exclude name="tools/**" />
+ <exclude name="build.xml" />
+ <exclude name="build.bat" />
+ </fileset>
+ </zip>
+
+ <!-- Compress dev package -->
+ <delete file="${export_dir}/punymce_${file_version}_dev.zip" quiet="true" />
+ <zip destfile="${export_dir}/punymce_${file_version}_dev.zip">
+ <fileset dir="${export_dir}/punymce">
+ <include name="*/**" />
+ </fileset>
+ </zip>
+ </target>
+</project>

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,48 +1,50 @@
-punymce.plugins.BBCode = function(ed) {
- // Convert XML into BBCode
- ed.onGetContent.add(function(ed, o) {
- if (o.format == 'bbcode' || o.save) {
- // example: <strong> to [b]
- punymce.each([
- [/<a href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"],
- [/<font.*?color=\"([^\"]+)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"],
- [/<img.*?src=\"([^\"]+)\".*?\/>/gi,"[img]$1[/img]"],
- [/<(br\s*\/)>/gi, "\n"],
- [/<(\/?)(strong|b)[^>]*>/gi, "[$1b]"],
- [/<(\/?)(em|i)[^>]*>/gi, "[$1i]"],
- [/<(\/?)u[^>]*>/gi, "[$1u]"],
- [/<(\/?)(code|pre)[^>]*>/gi, "[$1code]"],
- [/<(\/?)(span.*?class=\"quote\")[^>]*>(.*?)<\/span>/gi, "[$1quote]$3[/quote]"],
- [/<p>/gi, ""],
- [/<\/p>/gi, "\n"],
- [/&quot;/gi, "\""],
- [/&lt;/gi, "<"],
- [/&gt;/gi, ">"],
- [/&amp;/gi, "&"],
- [/<[^>]+>/gi, ""]
- ], function (v) {
- o.content = o.content.replace(v[0], v[1]);
- });
- }
- });
+(function(punymce) {
+ punymce.plugins.BBCode = function(ed) {
+ // Convert XML into BBCode
+ ed.onGetContent.add(function(ed, o) {
+ if (o.format == 'bbcode' || o.save) {
+ // example: <strong> to [b]
+ punymce.each([
+ [/<a href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"],
+ [/<font.*?color=\"([^\"]+)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"],
+ [/<img.*?src=\"([^\"]+)\".*?\/>/gi,"[img]$1[/img]"],
+ [/<(br\s*\/)>/gi, "\n"],
+ [/<(\/?)(strong|b)[^>]*>/gi, "[$1b]"],
+ [/<(\/?)(em|i)[^>]*>/gi, "[$1i]"],
+ [/<(\/?)u[^>]*>/gi, "[$1u]"],
+ [/<(\/?)(code|pre)[^>]*>/gi, "[$1code]"],
+ [/<(\/?)(span.*?class=\"quote\")[^>]*>(.*?)<\/span>/gi, "[$1quote]$3[/quote]"],
+ [/<p>/gi, ""],
+ [/<\/p>/gi, "\n"],
+ [/&quot;/gi, "\""],
+ [/&lt;/gi, "<"],
+ [/&gt;/gi, ">"],
+ [/&amp;/gi, "&"],
+ [/<[^>]+>/gi, ""]
+ ], function (v) {
+ o.content = o.content.replace(v[0], v[1]);
+ });
+ }
+ });
- ed.onSetContent.add(function(ed, o) {
- if (o.format == 'bbcode' || o.load) {
- // example: [b] to <strong>
- punymce.each([
- [/\n/gi,"<br />"],
- [/\[(\/?)b\]/gi,"<$1strong>"],
- [/\[(\/?)i\]/gi,"<$1em>"],
- [/\[(\/?)u\]/gi,"<$1u>"],
- [/\[(\/?)code\]/gi,"<$1pre>"],
- [/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>"],
- [/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>"],
- [/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />"],
- [/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'],
- [/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quote">$1</span>']
- ], function (v) {
- o.content = o.content.replace(v[0], v[1]);
- });
- }
- });
-};
+ ed.onSetContent.add(function(ed, o) {
+ if (o.format == 'bbcode' || o.load) {
+ // example: [b] to <strong>
+ punymce.each([
+ [/\n/gi,"<br />"],
+ [/\[(\/?)b\]/gi,"<$1strong>"],
+ [/\[(\/?)i\]/gi,"<$1em>"],
+ [/\[(\/?)u\]/gi,"<$1u>"],
+ [/\[(\/?)code\]/gi,"<$1pre>"],
+ [/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>"],
+ [/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>"],
+ [/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />"],
+ [/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'],
+ [/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quote">$1</span>']
+ ], function (v) {
+ o.content = o.content.replace(v[0], v[1]);
+ });
+ }
+ });
+ };
+})(punymce);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 229076a

Please sign in to comment.