It does this in a number of ways, many of which are configurable by the coder to suit their requirements. However it was written to suit my own coding style and so has certain limitations.
So far it has been tested on Windows 2000, Windows 2000 Professional and Windows 98SE and runs fine.
NOTE that this is the first release and is somewhat of a BETA PRODUCT. I especially welcome bug reports (break it if you can ;-) and suggestions for future enhancements.
Removing SpacesBy default, Compactor removes all tab characters and unnecessary spaces from your code. Certain spaces are necessary however, and spaces after the following keywords are always preserved:
Removing LinesBy default the Compactor will remove all blank lines and lines containing only spaces and tab characters. In addition to this it can remove:
Appending FilesMultiple files can be loaded into the Compactor and output to a single file. This can save memory on a Set-Top Box but often the files must be loaded into the STB memory in a certain order. Check the "Append Multiple JS Files" checkbox and use the "FILE/Open JS File" menu option. Once chosen the files can be dragged into the correct order using the LEFT mouse button. Any loaded files not required for the build can be removed by RIGHT-CLICKING on them. Of course you can also process one file at a time. There is an option to add file separators (consisting of each file's name) between each of the appended files to help with any post-compilation debugging.
Processing FilesWhen you are ready to process your files, click the RUN menu option. When the operation is complete you will be prompted for a filename to save your files to.
HTML FilesYou can also reduce the weight of HTML pages by choosing the "FILE/Open HTML File" meu option. This will clean all html-style comments ONLY and will handle comments that span more than line.
Future EnhancementsMail your suggestions to me HERE
DISCLAIMERThis program is provided "as is" without express or implied warranty. The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness, in no event shall the author Mark Serlin be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortuous action, arising out of or in connection with the use or performance of this software. Any damage to or corruption of your source code is your own responsibility so make sure you have READ and UNDERSTOOD these instructions! The Compactor was developed on Windows 2000, runs fine on 2K Professional and 98SE and should run fine on other platforms. However no liability either express or implied is accepted by me for any damage caused to computers or operating systems in the normal course of operating this software.
LICENCEFor the time being this product is distributed free but I ask you not to distribute it to friends and colleagues but to direct them to here so that they have the opportunity to read the instructions for themselves.
Other problemsLines of code may be removed because there is an inline comment on the same line:
var card = 1; // Reset the deck
The interpreter usually complains if there is an empty for loop, for instance where the only thing in the block was a debugtext statement:
debugtext(myArray[i].name + ", " + myArray[i].value) - this line removed!
Be aware that the Compactor does write some stuff to your registry and as there's no installer, they get left behind. It's only a few strings which save your options for you anyway, and they can be deleted using regedit. You'll find them in HK_CURRENT_USER/Software/Northview and HK_USERS/Software/Northview or just search for keys of name Northview and delete them. If you're worried about a few extra bytes. Future releases may have an uninstaller built in so (coming soon) Register For Upgrades!
Issues, comments or bug reports they can be sent to me at this address. There are quite a few user-friendly features missing from this release, I plan to develop the Compactor once I am sure the code is rock-solid, and for this I would appreciate your help.