remove old stream initialization from js pages; remove websocket js code

from the layout; rename templates to have a .jst extension
(JavaScriptTemplate?)
This commit is contained in:
danielgrippi 2011-12-29 14:15:09 -05:00 committed by Dennis Collinson
parent 3268726a9a
commit 42276a73c8
18 changed files with 19 additions and 44 deletions

View file

@ -61,6 +61,10 @@
- unless @landing_page - unless @landing_page
= include_javascripts :main = include_javascripts :main
:javascript :javascript
Diaspora.I18n.loadLocale(#{get_javascript_strings_for(I18n.locale).to_json}, "#{I18n.locale}");
Diaspora.Page = "#{params[:controller].camelcase}#{params[:action].camelcase}";
- if current_user
app.user({ app.user({
current_user: #{current_user.person.as_api_response(:backbone).to_json} current_user: #{current_user.person.as_api_response(:backbone).to_json}
}); });

View file

@ -2,33 +2,16 @@
-# licensed under the Affero General Public License version 3 or later. See -# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file. -# the COPYRIGHT file.
%script{:id => "header-template", :type => 'text/template'} - ["header",
!= File.read("#{Rails.root}/app/views/templates/header.ujs") "feedback",
"static_text",
%script{:id => "feedback-template", :type => 'text/template'} "stream_element",
!= File.read("#{Rails.root}/app/views/templates/feedback.ujs") "comment_stream",
"comment",
%script{:id => "static-text-template", :type => 'text/template'} "status_message",
!= File.read("#{Rails.root}/app/views/templates/static_text.ujs") "activity_streams_photo",
"reshare",
%script{:id => "stream-element-template", :type => 'text/template'} "likes_info"].each do |template_name|
!= File.read("#{Rails.root}/app/views/templates/stream_element.ujs")
%script{:id => "comment-template", :type => 'text/template'}
!= File.read("#{Rails.root}/app/views/templates/comment.ujs")
%script{:id => "comment-stream-template", :type => 'text/template'}
!= File.read("#{Rails.root}/app/views/templates/comment_stream.ujs")
%script{:id => "status-message-template", :type => 'text/template'}
!= File.read("#{Rails.root}/app/views/templates/status_message.ujs")
%script{:id => "reshare-template", :type => 'text/template'}
!= File.read("#{Rails.root}/app/views/templates/reshare.ujs")
%script{:id => "activity-streams-photo-template", :type => 'text/template'}
!= File.read("#{Rails.root}/app/views/templates/activity-streams-photo.ujs")
%script{:id => "likes-info-template", :type => 'text/template'}
!= File.read("#{Rails.root}/app/views/templates/likes_info.ujs")
%script{:id => "#{template_name.gsub("_","-")}-template", :type => 'text/template'}
!= File.read("#{Rails.root}/app/views/templates/#{template_name}.jst")

View file

@ -5,9 +5,9 @@ gzip_assets: off
javascripts: javascripts:
flash_socket: flash_socket:
- public/javascripts/vendor/FABridge.js #- public/javascripts/vendor/FABridge.js
- public/javascripts/vendor/swfobject.js #- public/javascripts/vendor/swfobject.js
- public/javascripts/vendor/web_socket.js #- public/javascripts/vendor/web_socket.js
jquery: jquery:
- public/javascripts/vendor/jquery-1.7.1.min.js - public/javascripts/vendor/jquery-1.7.1.min.js

View file

@ -3,7 +3,5 @@ Diaspora.Pages.AspectsIndex = function() {
this.subscribe("page/ready", function(evt, document) { this.subscribe("page/ready", function(evt, document) {
self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav")); self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav"));
self.stream = self.instantiate("Stream", document.find("#aspect_stream_container"));
self.infiniteScroll = self.instantiate("InfiniteScroll");
}); });
}; };

View file

@ -2,10 +2,7 @@ Diaspora.Pages.CommentStreamIndex = function() {
var self = this; var self = this;
this.subscribe("page/ready", function(evt, document) { this.subscribe("page/ready", function(evt, document) {
self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav")); self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav"));
self.stream = self.instantiate("Stream", document.find("#aspect_stream_container"));
self.infiniteScroll = self.instantiate("InfiniteScroll");
}); });
}; };

View file

@ -3,7 +3,6 @@ Diaspora.Pages.ContactsIndex = function() {
this.subscribe("page/ready", function(evt, document) { this.subscribe("page/ready", function(evt, document) {
self.infiniteScroll = self.instantiate("InfiniteScroll"); self.infiniteScroll = self.instantiate("InfiniteScroll");
$('.conversation_button').twipsy({position: 'below'}); $('.conversation_button').twipsy({position: 'below'});
}); });
}; };

View file

@ -2,9 +2,6 @@ Diaspora.Pages.LikeStreamIndex = function() {
var self = this; var self = this;
this.subscribe("page/ready", function(evt, document) { this.subscribe("page/ready", function(evt, document) {
self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav")); self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav"));
self.stream = self.instantiate("Stream", document.find("#aspect_stream_container"));
self.infiniteScroll = self.instantiate("InfiniteScroll");
}); });
}; };

View file

@ -2,9 +2,6 @@ Diaspora.Pages.PostsIndex = function() {
var self = this; var self = this;
this.subscribe("page/ready", function(evt, document) { this.subscribe("page/ready", function(evt, document) {
self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav")); self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav"));
self.stream = self.instantiate("Stream", document.find("#aspect_stream_container"));
self.infiniteScroll = self.instantiate("InfiniteScroll");
}); });
}; };