Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tweaks to filesystem and added $design_mode

  • Loading branch information...
commit 66e05e6a95152cf313fb593aef3521c110fa3913 1 parent c1b70b5
@onkis onkis authored Charles Jolley committed
View
7 lib/sproutcore/rack/builder.rb
@@ -89,11 +89,14 @@ def call(env)
project_mutex.synchronize do
did_reload = reload_project! # if needed
-
+
# collect some standard info
url = env['PATH_INFO']
url = '/sproutcore/welcome' if url == '/'
-
+
+ #designer mode?
+ $design_mode = true if /designMode=YES/ =~ env['QUERY_STRING']
+ SC.logger.info $design_mode
# look for a matching target
target = target_for(url)
ret = not_found("No matching target") if target.nil?
View
9 lib/sproutcore/rack/filesystem.rb
@@ -102,6 +102,7 @@ def call(env)
def list_files(original_path)
results = []
+ @id = 0
with_sanitized_path(original_path) do |root_path|
results = folder_contents(root_path, root_path)
end
@@ -109,7 +110,8 @@ def list_files(original_path)
end
def folder_contents(dir, root_path)
- results = [];
+ results = []
+
Dir.new(dir).each do |path|
name = path
path = dir + path
@@ -117,10 +119,11 @@ def folder_contents(dir, root_path)
sc_path = sc_path.gsub(name,"")
if FileTest.directory?(path)
if not (File.basename(path)[0] == ?. or @ignore_directories.include?(File.basename(path)))
- results<< {:type => :dir, :dir => sc_path, :name =>name, :contents=> folder_contents(path+"/", root_path)}
+ results<< {:type => :Dir, :dir => sc_path, :name =>name,
+ :contents=> folder_contents(path+"/", root_path), :id => @id+=1}
end
else #just a regular file
- results<< {:type => :file, :dir => sc_path, :name => name}
+ results<< {:type => :File, :dir => sc_path, :name => name, :id => @id+=1 }
end
end
return results
Please sign in to comment.
Something went wrong with that request. Please try again.