Take JS out of landing page

This commit is contained in:
Raphael 2010-11-28 16:45:23 -08:00
parent c35be73978
commit ec6f42eaf0
2 changed files with 23 additions and 19 deletions

View file

@ -8,6 +8,7 @@ class HomeController < ApplicationController
if current_user if current_user
redirect_to aspects_path redirect_to aspects_path
else else
@landing_page = true
render :show render :show
end end
end end

View file

@ -28,11 +28,12 @@
= javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" = javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"
= javascript_include_tag "vendor/jquery144.min"
:javascript :javascript
!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.4.4.js"%3E%3C/script%3E')) !window.jQuery && document.write(unescape('%3Cscript src="/javascripts/vendor/jquery144.min.js"%3E%3C/script%3E'))
= include_javascripts :main
- unless @landing_page
= include_javascripts :main
- if current_user - if current_user
= include_javascripts :flash_socket unless modern_browser? = include_javascripts :flash_socket unless modern_browser?
@ -60,10 +61,11 @@
%link{:rel => "alternate", :href => "#{current_user.public_url}", :type => "application/atom+xml", :title => "Public Diaspora Feed for #{current_user.real_name}"} %link{:rel => "alternate", :href => "#{current_user.public_url}", :type => "application/atom+xml", :title => "Public Diaspora Feed for #{current_user.real_name}"}
%body %body
#notification -unless @landing_page
#notification
- flash.each do |name, msg| - flash.each do |name, msg|
= content_tag :div, msg, :id => "flash_#{name}" = content_tag :div, msg, :id => "flash_#{name}"
%header{:class=>('landing' unless current_user)} %header{:class=>('landing' unless current_user)}
= render 'layouts/header' = render 'layouts/header'
@ -82,18 +84,19 @@
%li= link_to 'github', "https://github.com/diaspora/diaspora" %li= link_to 'github', "https://github.com/diaspora/diaspora"
%li= link_to t('layouts.header.blog'), "http://blog.joindiaspora.com" %li= link_to t('layouts.header.blog'), "http://blog.joindiaspora.com"
:javascript -unless @landing_page
var is_ssl = ("https:" == document.location.protocol); :javascript
var asset_host = is_ssl ? "https://s3.amazonaws.com/getsatisfaction.com/" : "http://s3.amazonaws.com/getsatisfaction.com/"; var is_ssl = ("https:" == document.location.protocol);
document.write(unescape("%3Cscript src='" + asset_host + "javascripts/feedback-v2.js' type='text/javascript'%3E%3C/script%3E")); var asset_host = is_ssl ? "https://s3.amazonaws.com/getsatisfaction.com/" : "http://s3.amazonaws.com/getsatisfaction.com/";
document.write(unescape("%3Cscript src='" + asset_host + "javascripts/feedback-v2.js' type='text/javascript'%3E%3C/script%3E"));
:javascript :javascript
var feedback_widget_options = {}; var feedback_widget_options = {};
feedback_widget_options.display = "overlay"; feedback_widget_options.display = "overlay";
feedback_widget_options.company = "diaspora"; feedback_widget_options.company = "diaspora";
feedback_widget_options.placement = "right"; feedback_widget_options.placement = "right";
feedback_widget_options.color = "#222"; feedback_widget_options.color = "#222";
feedback_widget_options.style = "idea"; feedback_widget_options.style = "idea";
var feedback_widget = new GSFN.feedback_widget(feedback_widget_options); var feedback_widget = new GSFN.feedback_widget(feedback_widget_options);