Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a bug that was adding additional Path slashes. This was causing…

… certain webservers to reject the path.
  • Loading branch information...
commit 6f696fba23c1a5391fdf02b853870d874fb12c37 1 parent 5def9e1
Josh Fisher authored
Showing with 19 additions and 13 deletions.
  1. +6 −2 .project
  2. +9 −8 dist/CAM.js
  3. +4 −3 src/CAM.js
8 .project
View
@@ -7,12 +7,16 @@
</projects>
<buildSpec>
<buildCommand>
- <name>org.python.pydev.PyDevBuilder</name>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>full,incremental,</triggers>
<arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/org.python.pydev.PyDevBuilder.launch</value>
+ </dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
- <nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
17 dist/CAM.js
View
@@ -1,8 +1,9 @@
-// CAM.js r1 - CAM.js
-(function(b,h){function i(e){function c(){FU.LoadFile({fileType:FU.FILE_TYPE.TXT,loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:b.RemoteRootPath.concat(b.AssetConfig),loaded:function(a){a=JSON.parse(a);g(a,"");for(a=0;a<b.Directories.length;a++){var c=b.LocalRootPath.concat(b.Directories[a]);FU.CreateDirectory(c,!1,function(){})}for(var d=0,a=0;a<b.Assets.length;a++){c=b.Assets[a];j(c.binary?FU.FILE_TYPE.BINARY:FU.FILE_TYPE.TXT,c.Filename);var j=function(a,c){FU.CheckFileSystemForFile(b.LocalRootPath.concat(c),
-!1,function(f){f!==h?(d++,console.log("File: "+b.LocalRootPath.concat(c)+" is already on Local FileSystem"),d===b.Assets.length&&e()):FU.LoadFile({fileType:a,loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:b.RemoteRootPath.concat(c),loaded:function(a){FU.SaveFile({remoteAsset:a,filePath:b.LocalRootPath.concat(c),temporary:!1,saved:function(a){d++;console.log(a+" Saved To local Filesystem");d===b.Assets.length&&e()}})}})})}}}})}FU.CreateDirectory(b.LocalRootPath,!1,function(){});FU.LoadFile({fileType:FU.FILE_TYPE.TXT,
-loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:b.RemoteRootPath.concat(b.VersionAsset),loaded:function(a){var f=JSON.parse(a);FU.CheckFileSystemForFile(b.LocalRootPath.concat(b.VersionAsset),!1,function(d){d!==h?FU.LoadFile({fileType:FU.FILE_TYPE.TXT,loadMechanism:FU.LOAD_MECHANISM.FILESYSTEM,file:d,loaded:function(d){JSON.parse(d).version!==f.version?(console.log("Assets have changed ... updating assets."),FU.SaveFile({remoteAsset:a,filePath:b.LocalRootPath.concat(b.VersionAsset),temporary:!1,saved:function(a){console.log(a+
-" Saved To local Filesystem")}}),c()):(console.log("All assets are up to date!"),FU.LoadFile({fileType:FU.FILE_TYPE.TXT,loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:b.RemoteRootPath.concat(b.AssetConfig),loaded:function(a){a=JSON.parse(a);g(a,"");e()}}))}}):(FU.SaveFile({remoteAsset:a,filePath:b.LocalRootPath.concat(b.VersionAsset),temporary:!1,saved:function(a){console.log(a+" Saved To local Filesystem")}}),c())})}})}function g(e,c){for(var a in e)if(e.hasOwnProperty(a)){var f=e[a];if(a!=="Files"){var d=
-c+"/"+a;b.Directories.push(d);g(f,d)}else for(d=0;d<f.length;d++)f[d].Filename=c+"/"+f[d].Filename,b.Assets.push(f[d])}}if(!window.FU)throw Error("Required library FU.js is not loaded. Aborting ...");b.Assets=[];b.Directories=[];b.Initialize=function(e,c){FU.CLIENT_FEATURES.FilesystemAPI?FU.InitLocalFileSystem(function(){c?(e(),i(c)):i(e)}):(e(),FU.LoadFile({fileType:FU.FILE_TYPE.TXT,loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:b.RemoteRootPath.concat(b.AssetConfig),loaded:function(a){a=JSON.parse(a);
-g(a,"");c()}}))};b.GetPathFromFilename=function(e){for(var c=h,a=0;a<b.Assets.length;a++){var f=a,d=b.Assets[f],g=-1;d.Filename.indexOf(e)!==-1&&(g=f);if(g>=0){c=b.RemoteRootPath.concat(d.Filename);break}}return c};b.Load=function(e){var c,a,f,d;c=e.assetName;a=e.returnType;f=e.fileType;d=e.callback;FU.CLIENT_FEATURES.FilesystemAPI?FU.LoadFile({fileType:f,loadMechanism:FU.LOAD_MECHANISM.FILESYSTEM,fileName:c,returnType:a,temporary:!1,loaded:d}):(c=b.GetPathFromFilename(c),e.returnType&&a==="url"?
-d(c):FU.LoadFile({fileType:f,loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:c,loaded:d}))}})(window.CAM=window.CAM||{});
+// CAM.js r1 (02/17/2012) - CAM.js
+(function(a,i){function j(f){function d(){FU.LoadFile({fileType:FU.FILE_TYPE.TXT,loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:a.RemoteRootPath.concat(a.AssetConfig),loaded:function(b){b=JSON.parse(b);h(b,"");for(b=0;b<a.Directories.length;b++){var e=a.LocalRootPath.concat(a.Directories[b]);FU.CreateDirectory(e,!1,function(){})}for(var c=0,b=0;b<a.Assets.length;b++){e=a.Assets[b];d(e.binary?FU.FILE_TYPE.BINARY:FU.FILE_TYPE.TXT,e.Filename);var d=function(b,d){FU.CheckFileSystemForFile(a.LocalRootPath.concat(d),
+!1,function(e){e!==i?(c++,console.log("File: "+a.LocalRootPath.concat(d)+" is already on Local FileSystem"),c===a.Assets.length&&f()):FU.LoadFile({fileType:b,loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:a.RemoteRootPath.concat(d),loaded:function(b){FU.SaveFile({remoteAsset:b,filePath:a.LocalRootPath.concat(d),temporary:!1,saved:function(b){c++;console.log(b+" Saved To local Filesystem");c===a.Assets.length&&f()}})}})})}}}})}FU.CreateDirectory(a.LocalRootPath,!1,function(){});FU.LoadFile({fileType:FU.FILE_TYPE.TXT,
+loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:a.RemoteRootPath.concat(a.VersionAsset),loaded:function(b){var e=JSON.parse(b);FU.CheckFileSystemForFile(a.LocalRootPath.concat(a.VersionAsset),!1,function(c){c!==i?FU.LoadFile({fileType:FU.FILE_TYPE.TXT,loadMechanism:FU.LOAD_MECHANISM.FILESYSTEM,file:c,loaded:function(c){JSON.parse(c).version!==e.version?(console.log("Assets have changed ... updating assets."),FU.SaveFile({remoteAsset:b,filePath:a.LocalRootPath.concat(a.VersionAsset),temporary:!1,saved:function(a){console.log(a+
+" Saved To local Filesystem")}}),d()):(console.log("All assets are up to date!"),FU.LoadFile({fileType:FU.FILE_TYPE.TXT,loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:a.RemoteRootPath.concat(a.AssetConfig),loaded:function(a){a=JSON.parse(a);h(a,"");f()}}))}}):(FU.SaveFile({remoteAsset:b,filePath:a.LocalRootPath.concat(a.VersionAsset),temporary:!1,saved:function(a){console.log(a+" Saved To local Filesystem")}}),d())})}})}function h(f,d){for(var b in f)if(f.hasOwnProperty(b)){var e=f[b];if(b!=="Files"){var c=
+d+"/"+b;a.Directories.push(c);h(e,c)}else for(c=0;c<e.length;c++)e[c].Filename=d+"/"+e[c].Filename,a.Assets.push(e[c])}}if(!window.FU)throw Error("Required library FU.js is not loaded. Aborting ...");a.Assets=[];a.Directories=[];a.Initialized=!1;a.Initialize=function(f,d){FU.CLIENT_FEATURES.FilesystemAPI?FU.InitLocalFileSystem(function(){d?(j(d),a.Initialized=!0,f()):j(f)}):(a.Initialized=!0,f(),FU.LoadFile({fileType:FU.FILE_TYPE.TXT,loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:a.RemoteRootPath.concat(a.AssetConfig),
+loaded:function(a){a=JSON.parse(a);h(a,"");d()}}))};a.GetPathFromFilename=function(f){for(var d=i,b=0;b<a.Assets.length;b++){var e=b,c=a.Assets[e],g=-1;c.Filename.indexOf(f)!==-1&&(g=e);if(g>=0){d=a.RemoteRootPath.concat(c.Filename);break}}return d};a.Load=function(f){var d,b,e,c,g;d=f.assetName;e=f.returnType;c=f.fileType;sliceParams=f.sliceParams;b=f.file;g=f.callback;FU.CLIENT_FEATURES.FilesystemAPI?b?FU.LoadFile({fileType:c,loadMechanism:FU.LOAD_MECHANISM.FILE,file:b,returnType:e,temporary:!1,
+sliceParams:sliceParams,loaded:g}):FU.LoadFile({fileType:c,loadMechanism:FU.LOAD_MECHANISM.FILESYSTEM,fileName:d,returnType:e,temporary:!1,sliceParams:sliceParams,loaded:g}):FU.CLIENT_FEATURES.FileAPI&&b?FU.LoadFile({fileType:c,loadMechanism:FU.LOAD_MECHANISM.FILE,file:b,returnType:e,temporary:!1,sliceParams:sliceParams,loaded:g}):(d=a.GetPathFromFilename(d),f.returnType&&e==="url"?g(d):FU.LoadFile({fileType:c,loadMechanism:FU.LOAD_MECHANISM.XHR,remoteURL:d,sliceParams:sliceParams,loaded:g}))}})(window.CAM=
+window.CAM||{});
7 src/CAM.js
View
@@ -228,7 +228,7 @@
if(assetProp !== "Files"){
//Set Path
- var newPath = path + "/" + assetProp;
+ var newPath = path + assetProp + "/";
//Push Path
CAM.Directories.push(newPath);
@@ -239,7 +239,7 @@
else{
for (var i=0; i < assetObj.length; i++) {
var fileName = assetObj[i].Filename;
- var tmpPath = path + "/" + fileName;
+ var tmpPath = path + fileName;
assetObj[i].Filename = tmpPath;
CAM.Assets.push(assetObj[i]);
};
@@ -303,7 +303,7 @@
});
}
}
- else if(FU.CLIENT_FEATURES.FileAPI){
+ else if(FU.CLIENT_FEATURES.FileAPI && file){
FU.LoadFile({
fileType: fileType,
loadMechanism: FU.LOAD_MECHANISM.FILE,
@@ -317,6 +317,7 @@
else{
var remoteURL = CAM.GetPathFromFilename(assetName);
+
if(params.returnType && returnType === "url"){
callback(remoteURL);
}
Please sign in to comment.
Something went wrong with that request. Please try again.