Permalink
Browse files

much better main supressor

  • Loading branch information...
1 parent e3ca894 commit bad23ab9fdf32a62b4843decf03af2955112e853 @onkis onkis committed with Charles Jolley Feb 20, 2010
Showing with 6 additions and 33 deletions.
  1. +1 −0 lib/sproutcore/builders/html.rb
  2. +1 −28 lib/sproutcore/helpers/static_helper.rb
  3. +4 −5 lib/sproutcore/rack/builder.rb
@@ -186,6 +186,7 @@ def render_partial(entry)
# Renders a single entry. The entry will be staged and then its
# render task will be executed.
def render_entry(entry)
+ @content_for_designer = '<script type="text/javascript">SC.suppressMain = YES;</script>' if $design_mode
entry.stage!
entry.target.buildfile.invoke entry.render_task,
:entry => entry,
@@ -166,34 +166,7 @@ def inline_javascript(resource_name, opts ={})
return %(<script type="text/javascript">\n#{ret}\n</script>)
end
- # Attempts to include the named javascript entry inline to the file
- #
- # === Options
- # language:: the language to use. defaults to current
- #
- def inline_designer_javascript(resource_name, opts ={})
-
- resource_name = resource_name.to_s
-
- # determine which manifest to search. if a language is explicitly
- # specified, lookup manifest for that language. otherwise use
- # current manifest.
- m = self.manifest
- if opts[:language]
- m = target.manifest_for(:language => opts[:language]).build!
- end
-
- entry = m.find_entry(resource_name, :entry_type => :javascript)
- if entry.nil?
- entry = m.find_entry(resource_name, :hidden => true, :entry_type => :javascript)
- end
-
- return '' if entry.nil? || !$design_mode
-
- ret = entry.stage!.inline_contents*''
- return %(<script type="text/javascript">\n#{ret}\n</script>)
- end
- # Attempts to include the named javascript entry inline to the file
+ # Attempts to include the named javascript entry inline to the file
#
# === Options
# language:: the language to use. defaults to current
@@ -95,9 +95,8 @@ def call(env)
url = '/sproutcore/welcome' if url == '/'
#designer mode?
- $design_mode = false
$design_mode = ((/designMode=YES/ =~ env['QUERY_STRING']) != nil) ? true : false
- SC.logger.fatal $design_mode
+
# look for a matching target
target = target_for(url)
ret = not_found("No matching target") if target.nil?
@@ -120,12 +119,12 @@ def call(env)
end
if ret.nil?
-
build_path = entry.build_path
if [:html, :test].include?(entry.entry_type)
- if did_reload || !File.exist?(build_path)
+ #if did_reload || !File.exist?(build_path)
+ #always clean html files...
entry.clean!.build!
- end
+ #end
else
entry.build!
end

0 comments on commit bad23ab

Please sign in to comment.