From 510eaabcfb4577ed0f703d54ca0fc888a87bbfc9 Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Sat, 6 Mar 2010 01:57:10 -0800 Subject: [PATCH] Fix some MHTML generation stuff. Reviewed by me. --- Objective-J/CFBundle.js | 14 +++++--------- .../CommonJS/lib/objective-j/jake/bundletask.js | 4 +++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Objective-J/CFBundle.js b/Objective-J/CFBundle.js index 790a51b24..cae1aeb2a 100644 --- a/Objective-J/CFBundle.js +++ b/Objective-J/CFBundle.js @@ -584,11 +584,9 @@ function decompileStaticFile(/*Bundle*/ aBundle, /*String*/ aString, /*String*/ mappedURL, mappedURLString = stream.getString(); - if (mappedURLString.toLowerCase().indexOf("mhtml:") === 0) + if (mappedURLString.indexOf("mhtml:") === 0) { - mappedURLString = "mhtml:" + new CFURL(URLString.substr("mhtml:".length), bundleURL); -/* - URLString = "mhtml:" + URL; + mappedURLString = "mhtml:" + new CFURL(mappedURLString.substr("mhtml:".length), bundleURL); if (CFBundleSupportedSpriteType === CFBundleMHTMLUncachedSpriteType) { @@ -596,15 +594,13 @@ function decompileStaticFile(/*Bundle*/ aBundle, /*String*/ aString, /*String*/ firstPart = URLString.substring(0, exclamationIndex), lastPart = URLString.substring(exclamationIndex); - URLString = firstPart + "?" + CFCacheBuster + lastPart; + mappedURLString = firstPart + "?" + CFCacheBuster + lastPart; } - mappedURL = new CFURL(URLString);*/ - } - else mappedURL = new CFURL(mappedURLString); + } - CFURL.setMappedURLForURL(URL, mappedURL); + CFURL.setMappedURLForURL(URL, new CFURL(mappedURLString)); // The unresolved directories must not be bundles. var parent = StaticResource.resourceAtURL(new CFURL(".", URL), YES); diff --git a/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js b/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js index 20af5bdba..09b008594 100644 --- a/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js +++ b/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js @@ -647,9 +647,11 @@ BundleTask.prototype.defineSpritedImagesTask = function() if (!isDataResource(aFilename)) return; - var resourcePath = "Resources/" + FILE.relative(resourcesPath, aFilename); + var resourcePath = "Resources/" + FILE.relative(resourcesPath, aFilename), + MHTMLResourcePath = "mhtml:" + FILE.join(folder, "MHTMLData.txt!") + resourcePath; MHTMLStream.write("u;" + resourcePath.length + ";" + resourcePath); + MHTMLStream.write(MHTMLResourcePath.length + ";" + MHTMLResourcePath); }); MHTMLStream.close();