Changeset 2713
- Timestamp:
- 24/10/07 11:18:39 (11 months ago)
- Files:
-
- Trunk/core/js/Saving.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/core/js/Saving.js
r2135 r2713 127 127 function saveBackup(localPath,original) 128 128 { 129 // Save the backup129 //# Save the backup 130 130 if(config.options.chkSaveBackups) { 131 131 var backupPath = getBackupPath(localPath); … … 221 221 } 222 222 223 function getBackupPath(localPath )224 { 225 var backSlash = true;223 function getBackupPath(localPath,title,extension) 224 { 225 var slash = "\\"; 226 226 var dirPathPos = localPath.lastIndexOf("\\"); 227 227 if(dirPathPos == -1) { 228 228 dirPathPos = localPath.lastIndexOf("/"); 229 backSlash = false;229 slash = "/"; 230 230 } 231 231 var backupFolder = config.options.txtBackupFolder; 232 232 if(!backupFolder || backupFolder == "") 233 233 backupFolder = "."; 234 var backupPath = localPath.substr(0,dirPathPos) + (backSlash ? "\\" : "/") + backupFolder + localPath.substr(dirPathPos); 235 backupPath = backupPath.substr(0,backupPath.lastIndexOf(".")) + "." + (new Date()).convertToYYYYMMDDHHMMSSMMM() + ".html"; 234 var backupPath = localPath.substr(0,dirPathPos) + slash + backupFolder + localPath.substr(dirPathPos); 235 backupPath = backupPath.substr(0,backupPath.lastIndexOf(".")) + "."; 236 //# replace illegal filename characters(// \/:*?"<>|) and space with underscore 237 if(title) 238 backupPath += title.replace(/[\\\/\*\?\":<> ]/g,"_") + "."; 239 backupPath += (new Date()).convertToYYYYMMDDHHMMSSMMM() + "." + (extension ? extension : "html"); 236 240 return backupPath; 237 241 }