Commits

ryanackley  committed b668d6d

Added support for file://localhost

  • Participants
  • Parent commits 0607956

Comments (0)

Files changed (2)

File FileUrlProject.js

 FileUrlProject.prototype = {
 	filePathForUrl : function(url){
 		if (url.indexOf('file://') == 0){
-			var path = url.substring(7);
+			var path;
+			if (url.indexOf('localhost') == 7){
+				path = url.substring(16);
+			}
+			else{
+				path = url.substring(7);
+			}
 			this.projectUrls[path] = url;
 			return path;
 		}
 		// It's not necessary to cache the urls since it's just a matter of tacking on the 'file://' 
 		// in the front but I don't want to post an update 
 		// to the devtools panel unless I know it's an actual project url.
-		return [this.projectUrls[path]];
+		var url = this.projectUrls[path];
+		if (url){
+			return[url];
+		}
+		return [];
 	},
 	resetUrls : function(){
 		this.projectUrls = {};

File FileWatcher.js

 				}
 				
 				if (url.indexOf('file://') == 0){
-					Gito.FileUtils.readFile(self.fsRoot, url.substring(7), 'Text', sendContentToDevtools, done);
+					var startIdx = 7;
+					if (url.indexOf('localhost') == 7){
+						startIdx = 16;
+					}
+					Gito.FileUtils.readFile(self.fsRoot, url.substring(startIdx), 'Text', sendContentToDevtools, done);
 				}
 				else{
 					$.ajax({type: 'GET',