		**** SaveToWardrobe v0.4 Beta ****
		********* by Fredledingue *********

DESCRIPTION

SaveToWardrobe is a plugin for Maxthon used to save complete web pages (with pictures and everything) in another fashion.

While saving, it stores the attached files to a unique folder (set in the ini file). Doing this it avoids duplicate files and the creation of _files folders.
It works as a separate process, avoid browser freeze and won't popup  "This page could not be saved." errors.
It allows many options such as removing scripts from your saved web pages. It also tries to fix links, flags, and other things.
___________

INSTALLATION

-Unzip the files to the Maxthon\Plugin directory (The subfolder for the plugin will be created automaticaly)

-(re)Start Maxthon
___________

OPTIONAL INI FILE SETTINGS

"WardrobeMode="
The WardrobeMode defines how many and where and why Wardrobe folders will be created.

0	One folder called "Wardrobe" for everything
1	One subfolder per domain in a single folder called "Wardrobe"	(Default/Recommanded)
2	One subfolder per domain in the folder where the page is saved
3	One subfolder per domain in a subfolder called "Wardrobe" in the folder where the page is saved

	NOTES: Behavior if you displace html files later:
	
	0 or 1:
	You will be able to move the html files from one folder to another
	without losing the picture sources as long as you keep them on the same drive.
	This is easier to manage and sort your documents
	but somewhat less easy when you make a back up copy.
	To move them to another drive or a CD-R/DVD-R,
	you will have to recreate the directory structure of the
	Wardrobe folder (or of the Domain folder inside it) up to the root of drive
	and copy the entire content of the Wardrobe or their Domain folders there.
	In this case, you can put the html file anywhere on the new drive or CD-R/DVD-R.

	2 or 3:
	You will not be able to move the html files from one folder
	to another without losing the picture sources unless
	you move the Wardrobe or Domain folder with them.
	This is easier to make a back up copy of entire folders but less easy
	to manage and sort your documents across folders.
	To move them to a directory on another drive or a CD-R/DVD-R,
	you will have to copy the Wardrobe or their Domain folders into this directory.

"WardrobePath="

Default: none. If "none", it will prompt you for a Wardrobe folder location if required. After that you should not change this setting. 

Advanced users can copy-paste the path for the Wardrobe straight into plugin.ini.
If WardrobeMode is set to 0 or 1 it must be a full path. Long and short paths are both accepted.
If set to 3, it must be a simple name without a path.
If set to 2, it will be ignored.

	ATTENTION:
	If WardrobeMode is set to 0 or 1, the letter of drive will be ignored.
	The drive of the Wardrobe will be the one where the html file is be saved.
	If you save webpages on different drives, there will a Wardrobe created on each of these drives.
	The program will automaticaly replace the drive letter in the Wardrobe path
	by ".." , which means in html language "root of drive or domain".

"UpDateIllu=" 
0	Take as many things as possible from the cache, download the rest	(Default/Recommanded)
1	Download all the illustrations anew everytime					(Slower)
2	Prompt for updating them									(If you realy need it)
3	Never download anything, pick only from cache					(Not recommanded but will work off line)

"CleanHtml="
0	Keep everthing									(Default, yet not the very best)
1	Erase scripts and  references to js and vbs files in code	(Recommanded but option 5 is, in my opinion, better)
2	Erase references to css files in code					(Not recommanded, page styles may disapear)
3	Erase references to swf files						(Useful to remove disturbing flash movies)
4	No script, no js, no vbs, no css						(Not recommanded, page styles may disapear)
5	No script, no js, no vbs, no swf						(Highly Recommanded)
6	No script, no js, no vbs, no css, no swf				(Not recommanded, page styles may disapear)
7	Keep only pictures (jpg, png and gif) + css				(Radical)
8	Keep only pictures (jpg, png and gif)					(Extreme)
____________

HOW TO USE

-From Maxthon plug-in bar, click on the "Wardrobe" icon
___________

SOFTWARE REQUIREMENT

	Windows XP should have no problem. Just make sure that all users have rights on the Wardrobe forlder location.

	Windows Vista: Untested

	Windows w98 and other old Windows versions may or may not need one or two of the following add-ons:

- Windows Script Host 5.6 (Not necessary if you have installed uSP2 or above)
Normaly installed with uSP2.01a for w98se.
If you see an error message, please download it from:
http://www.microsoft.com/downloads/details.aspx?FamilyId=0A8A18F6-249C-4A72-BFCF-FC6AF26DC390&displaylang=en
or
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.asp

- JSDlgBox.dll (28 Kb) (recommanded)
Downlaod it from "http://www.jsware.net/". 
May not be needed if you have a not too old version of MS Excell installed. But I still recommand the add-on for speed reasons.
Direct link:
http://www.jsware.net/jsware/zips/jsdlgbox.zip
If it doesn work, open:
http://www.jsware.net/jsware/scripts.php3#brows
Download jsdlgbox.zip (8 KB)

- The above requires VB6 Runtime Files.

- jsTP.exe (72 Kb) (recommanded)
Also from "http://www.jsware.net/". 
I thought this one would be needed on every w98 system. To my great surprise, my regularly updated and fully patched w98SE-uSP2++ doesn't need it...
Direct link:
http://www.jsware.net/jsware/zips/ryopack.zip
If it doesn work, open:
http://www.jsware.net/jsware/jryo.php3#dld
and download the "ZIP version of RYO StartPage - ryopack.zip (45 KB)" file.

Thanks to Joe Pristley for writting them and making them available for free.
___________

MORE EXPLANATION

1/ When you save a webpage with this plug-in, it's the equivalent of saving  as "html complete". The difference is that all the files (pictures, sounds, flash, js scripts etc) are stored in the Wardrobe, a special directory which path and method of creation are set in "plugin.ini".

The Wardrobe is the folder where the local html pages come there to dress up.
No more "..._Files" folders disturbing your document folder tree!
No more duplicated files: the same files are used for all the pages which use them.
Instead of having 57 identical "logo.gif" in 57 "_Files" folders, you will have only one "logo.gif" in the Wardrobe.

If two websites use the same file name, the file name will be incremented to avoid having the wrong picture on your page.
For example, if you see logo.gif, logo1.gif, logo2.gif, etc it meas that they are all different and come from different websites. They are not duplicates.

2/ If a page link to another page already saved with this plug-in, it will link to the local, saved page instead of the on-line one or instead of, what happens too often, to nothing at all.

3/ It atempts to fix links and bookmarks which don't work anymore once a webpage is saved on you computer. That happens because the links are not complete so the plug-in complete them with the full url.

4/ Instead of downloading all the files again as IE does, it first look in the cache (the "Temporary Internet Files") to see if it cannot find them. That makes the process not only faster (especialy with large multimedia files), but also more reliable and, when he can find all the files there, not dependant from the internet connection.

5/ The process of saving and dowloading is independant from Maxthon or IE. If Maxthon crashes, the plug-in keep on working and vice versa.
During the saving process you are still able to work with Maxthon.

6/ Process second level or cascaded html, framed html, css and no-extention files which were downloaded during the processing of the main web page. This should allow to display more stuffs and save pages impossible to save otherwise.

7/ The "CleanHtml" options allows you to erase completely all scripts from the saved webpage, making it much faster to read off line and much safer. It can remove also swf flash movies which are usualy disturbing advertisements. You can also discard css files if you want but it's not recomanded because some pages may look ugly after that. 
___________

KNOWN BUGS, LIMITATIONS AND OTHER DISAPOINTEMENTS


Note  Don't be afraid of what you read here! I listed all the obsrved or potential problems. It doesn't mean they happen all the time. In some case the plug-in gives better results than the original "save as" method.
This is an experimental version: it's still in developement and each new version brings lots of improvements.

Note: If the process is slow, it doesn't hang Maxthon or IE as the original save-as does. So as it works in the background, you won't be blocked by that. Only the final message will come longer. Most of the time, the proces should be faster.

1/ The process can be slow due to several factors (I'm working to avoid them as much as possible):

	-slow download of files not found in the Cache
 ==> The plug-in, may have to download more files than with the original "save as" method. I haven't have time to track down this problem. I'll beworking on it in the future version.

	-slow download of files not found on server
 ==> Depending on the download method, the process can be significantly longer when the plug-in attempts to download inexisting files (wrong name or address). 

	-huge index.dat
 ==> Empty your Internet Files Folder (Cache) from times to time.

	-huge number of files and huge index files in the Wardrobe
 ==> Not yet observed, but a possibility. In the ini file set a date 20 days earlier than today after "LastCleaning=". Restart Maxthon. Use the plug-in. This should launch the Wardrobe Cleaner if available.

2/ Complicated pages don't display exactely the same as the original: Some text area may be displaced, some text may be using another font etc
I cannot promise that I will be able to fix that one day.

3/ Sometimes when two different logos or pictures have the same name, the saved page may use the wrong one.
Normaly it shouldn't. It happens only when there are two files with the same name in the Cache.
I will try to limit this type of error in future versions.

4/ Some pictures may not appear. Trying hard to fix it.

5/ Complicated, script-generated, externaly based, rotating adds etc may not display as intended.
Links containing scripts are hard to modify.

6/ Eventhought the files are in the Cache, sometimes it will still download them again. That's because the script is, for the moment, unable to read index.dat reliably.
I hope this is solved in the current version.

7/ If you delete an html file saved with this plug-in, the files related to it will remains uselessly in the Wardrobe. This can be fixed  with a Wardrobe Cleaner.
The Wardrobe Cleaner is very experimental so be careful and make a back up of the wardrobe before.

8/ I have read that the download process can be slow and eat memory with large files. I haven't experienced that since I still didn't test it with large files. It also depends on which method is used to download.

9/ The Wardrobe Cleaner doesn't seem to erase obsolete entries in "LocalLinksIndex.txt". This has to be fixed in future releases. The Wardrobe Cleaner is still in developementstage and for experimental use only.

10/ The Wardrobe Cleaner works only when the Wardrobe mode is 0 and a "\" is included in the the Wardrobe path. This will be fixed in future releases. The Wardrobe Cleaner is still in developement stage and for experimental use only.
___________

HISTORY

0.1
-First public release

0.2
-Fixed an error after the "save as" dialog box

0.3
-Added Wradrobe Cleaner to delete obsolete files and datas from the Wardrobe
-Added Process second level or cascaded html, css and no-extention files which were downloaded
-Fixed erroneous correction/completion of page links (href)
-Discard invalid url and filepaths from the download list
-Discard or correct invalid "save as" filenames input

0.4
-Added Html auto-cleaner options
-Added "WardrobeMode" options
-Added "Never download anything" option
-Added "WardrobConfig.vbs" UI
-Fixed very slow and erroneous reading of index.dat
-Fixed file failing to download afile when its url starts with "../"
-Fixed files written in indexes while they failed to download and don't exist in the Wardrobe
-Fixed failure to launch jsTP component (when used)
___________

TERM OF USE

Free to use and distribute for private and non commercial purpose. 
This script is under copyright protection.

This script is provided freely and without warranty. The author can not be held responsible for damage or loss of data resulting from the direct or indirect use of this script.

The pages saved with this plugin MAY DIFFER FROM THE ORIGINAL web page.

Use at your own risk.
___________

CONTACT

e-mail me at fredledingo@yahoo.com
