Scripts Compression"

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

Line 23: Line 23:
 
To restart using the "compressed" files again, just recover the backed-up "fckeditor.html" file.
 
To restart using the "compressed" files again, just recover the backed-up "fckeditor.html" file.
  
=== Generating the compressed scripts ===
+
=== Generating the compressed scripts ===
  
An application has been developed to make it easy to update the compressed file in the "js" directory with the changes you may do in the "_source" files. Since version 2.4 there's a new version created in PHP, named FCKpackager and available (for the moment) only in http://svn.fckeditor.net/FCKpackager/trunk/fckpackager.exe
+
An application has been developed to make it easy to update the compressed file in the "js" directory with the changes you may do in the "_source" files. Since version 2.4 there's a new version created in PHP, named FCKpackager and available (for the moment) only in http://svn.fckeditor.net/FCKpackager/trunk/fckpackager.exe.
The packager functions are designed to :
 
# remove comments : one important thing to provide code quality and maintainability is good documentation, in the form of inline comments in the code. The problem is that comments take lots of space and have no real value at run-time. So, all comments are being removed.
 
# minimalize  white space  : every single unnecessary white space character is being removed, including tabs and line breaks.
 
so the files from the "_source" directory are compressed to the editor's code files
 
  
==== Using FCKpackager ====
+
The packager functions are designed to :
  
FCKpackager is a simple command line application. Here's a step by step instruction of how to use it:
+
*remove comments: one important thing to provide code quality and maintainability is good documentation, in the form of inline comments in the code. The problem is that comments take lots of space and have no real value at run-time. So, all comments are being removed.
 +
*minimalize white space: every single unnecessary white space character is being removed, including tabs and line breaks.
  
# Make the changes you want in the "_source" files.
+
==== Using FCKpackager  ====
# Copy the downloaded file "fckpackager.exe" into the FCKeditor main directory.
 
# Run the program "fckpackager.exe".<br> You will see that the application is running and adding the code from the "_source" files to the "js" files.
 
  
'''TIP''': When working on Windows, if you simply run fckpackager.exe from Windows Explorer, the program will run in a command prompt window and close immediately. If you want to view the information about the compressing process statistics (number of file processed, original size, output file size) run the program from the command prompt manually (cmd.exe in Windows).
+
FCKpackager is a simple command line application. Here's a step by step instruction of how to use it:
 +
 
 +
#Make the changes you want in the "_source" files.
 +
#Copy the [http://svn.fckeditor.net/FCKpackager/trunk/fckpackager.exe downloaded file "fckpackager.exe"] into the FCKeditor main directory.
 +
#Run the program "fckpackager.exe".<br> You will see that the application is running and adding the code from the "_source" files to the "js" files.
 +
 
 +
'''TIP''': When working on Windows, if you simply run fckpackager.exe from Windows Explorer, the program will run in a command prompt window and close immediately. If you want to view the information about the compressing process statistics (number of file processed, original size, output file size) run the program from the command prompt manually (cmd.exe).

Revision as of 09:24, 4 June 2008

Scripts Compression

The editor scripts source code can be found in the package at the "editor/_source/" directory. It is "human readable" as well as commented. There are a lot of files there, organized by groups.

To maximize loading and execution performance, the production distribution code in compressed to fewer and smaller files, as described in "Performance". These files are found at the "editor/js/" directory.

Using the "_source" files

It is possible to run the editor using the original scripts in the "_source" directory. It is useful when developing or debugging the editor. It is quite easy to do that.

Using a special URL parameter

The first way is the easiest on, but it depends on the integration files you are using. For now, only the JavaScript integration can do this.

Just add the "fcksource=true" parameter (QueryString) to the URL of the page where the editor is loaded.

Using the "original" file

There is also a definitive way to tell the editor to use the "_source" files.

Just go the "editor" directory and overwrite fckeditor.html with fckeditor.original.html (remember to backup the first one).

To restart using the "compressed" files again, just recover the backed-up "fckeditor.html" file.

Generating the compressed scripts

An application has been developed to make it easy to update the compressed file in the "js" directory with the changes you may do in the "_source" files. Since version 2.4 there's a new version created in PHP, named FCKpackager and available (for the moment) only in http://svn.fckeditor.net/FCKpackager/trunk/fckpackager.exe.

The packager functions are designed to :

  • remove comments: one important thing to provide code quality and maintainability is good documentation, in the form of inline comments in the code. The problem is that comments take lots of space and have no real value at run-time. So, all comments are being removed.
  • minimalize white space: every single unnecessary white space character is being removed, including tabs and line breaks.

Using FCKpackager

FCKpackager is a simple command line application. Here's a step by step instruction of how to use it:

  1. Make the changes you want in the "_source" files.
  2. Copy the downloaded file "fckpackager.exe" into the FCKeditor main directory.
  3. Run the program "fckpackager.exe".
    You will see that the application is running and adding the code from the "_source" files to the "js" files.

TIP: When working on Windows, if you simply run fckpackager.exe from Windows Explorer, the program will run in a command prompt window and close immediately. If you want to view the information about the compressing process statistics (number of file processed, original size, output file size) run the program from the command prompt manually (cmd.exe).