publisher works through ajax filters

This commit is contained in:
danielvincent 2011-01-04 18:20:52 -08:00
parent f02c13ee73
commit e6ae5e13e2
10 changed files with 58 additions and 42 deletions

View file

@ -0,0 +1,9 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= render 'shared/publisher', :aspect => aspect, :aspect_ids => aspect_ids
#main_stream.stream
= render 'shared/stream', :posts => post_hashes
= will_paginate @posts

View file

@ -15,13 +15,14 @@
= info_text(t('.handle_explanation'))
.span-15.append-1
= render 'shared/publisher', :aspect => @aspect, :aspect_ids => @aspect_ids
/= render 'aspects/no_contacts_message', :aspect => @aspect, :contact_count => @contacts.count
/= render 'aspects/no_posts_message', :post_count => @post_hashes.length, :contact_count => @contacts.count
#main_stream.stream
= render 'shared/stream', :posts => @post_hashes
= will_paginate @posts
#aspect_stream_container
= render 'aspect_stream',
:aspect => @aspect,
:aspect_ids => @aspect_ids,
:post_hashes => @post_hashes
.span-6.last
= render 'aspects/all_aspects_contacts'

View file

@ -1 +1 @@
$('#main_stream').html("<%= escape_javascript(render('shared/stream', :posts => @post_hashes)) %>");
$('#aspect_stream_container').html("<%= escape_javascript(render('aspects/aspect_stream', :aspect => @aspect, :aspect_ids => @aspect_ids, :post_hashes => @post_hashes)) %>");

View file

@ -52,4 +52,4 @@
});
}
window.onload = createUploader;
createUploader();

View file

@ -3,32 +3,6 @@
-# the COPYRIGHT file.
- content_for :head do
:javascript
$(document).ready(function(){
$("div.public_toggle input").bind("click", function(evt){
$("#publisher_service_icons").toggleClass("dim");
if($(this).attr('checked') == true){
$(".question_mark").click();
};
});
if($("textarea#status_message_message").val() != ""){
$("#publisher").removeClass("closed");
$("#publisher").find("textarea").focus();
$("#publisher .options_and_submit").show();
}
$("#publisher textarea, #publisher input").bind("focus", function(evt){
$("#publisher .options_and_submit").show();
});
$("#click_to_share").find("a").bind("click", function(evt){
$("#publisher").removeClass("closed");
$("#publisher").find("textarea").focus();
});
});
#publisher{:class=>"closed"}
#click_to_share
@ -61,9 +35,9 @@
#fileInfo
= image_tag 'ajax-loader.gif', :class => 'hidden', :id => "publisher_spinner"
- if aspect == :all
= status.submit t('.share'), :title => t('.share_with_all'), :disable_with => t('.posting')
= status.submit t('.share'), :title => t('.share_with_all'), :disable_with => t('.posting'), :class => 'button'
- else
= status.submit t('.share'), :title => t('.share_with', :aspect => aspect), :disable_with => t('.posting')
= status.submit t('.share'), :title => t('.share_with', :aspect => aspect), :disable_with => t('.posting'), :class => 'button'
- if aspect == :all
.public_toggle

View file

@ -31,6 +31,7 @@ javascripts:
- public/javascripts/aspect-edit.js
- public/javascripts/contact-list.js
home:
- public/javascripts/publisher.js
- public/javascripts/aspect-filters.js
people:
- public/javascripts/contact-list.js

View file

@ -3,7 +3,7 @@
* the COPYRIGHT file.
*/
$(function(){
$(document).ready(function(){
var selectedGUIDS = [];
$("#aspect_nav li").each(function(){
@ -20,7 +20,7 @@ $(function(){
e.preventDefault();
// loading animation
$("#main_stream").fadeTo(100, 0.4);
$("#aspect_stream_container").fadeTo(100, 0.4);
// filtering //////////////////////
@ -53,6 +53,7 @@ $(function(){
}
// generate new url
baseURL = baseURL.replace('#','');
baseURL += '?';
for(i=0; i < selectedGUIDS.length; i++){
baseURL += 'a_ids[]='+ selectedGUIDS[i] +'&';
@ -66,7 +67,7 @@ $(function(){
url : baseURL,
dataType : 'script',
success : function(data){
$("#main_stream").fadeTo(100, 1);
$("#aspect_stream_container").fadeTo(100, 1);
}
});

View file

@ -0,0 +1,29 @@
/* Copyright (c) 2010, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
$(document).ready(function(){
$("div.public_toggle input").live("click", function(evt){
$("#publisher_service_icons").toggleClass("dim");
if($(this).attr('checked') == true){
$(".question_mark").click();
};
});
if($("textarea#status_message_message").val() != ""){
$("#publisher").removeClass("closed");
$("#publisher").find("textarea").focus();
$("#publisher .options_and_submit").show();
}
$("#publisher textarea, #publisher input").live("focus", function(evt){
$("#publisher .options_and_submit").show();
});
$("#click_to_share").find("a").live("click", function(evt){
$("#publisher").removeClass("closed");
$("#publisher").find("textarea").focus();
});
});

View file

@ -106,12 +106,12 @@ var Stream = {
});
});
$(".new_status_message").bind('ajax:loading', function(data, json, xhr) {
$(".new_status_message").live('ajax:loading', function(data, json, xhr) {
$("#photodropzone").find('li').remove();
$("#publisher textarea").removeClass("with_attachments");
});
$(".new_status_message").bind('ajax:success', function(data, json, xhr) {
$(".new_status_message").live('ajax:success', function(data, json, xhr) {
json = $.parseJSON(json);
WebSocketReceiver.addPostToStream(json.post_id, json.html);
//collapse publisher

View file

@ -937,6 +937,7 @@ label
> li
:display inline
:margin 0
:right 2px
:padding 4px 0
a
:-webkit-border-radius 2px
@ -945,9 +946,9 @@ label
:text-shadow 0 1px 0 #444
:padding 1px 7px
:padding 1px 5px
:color #CCC
:color #999
:max-width 120px
:overflow hidden
:text-overflow ellipsis
@ -958,7 +959,7 @@ label
:color #eee
&.selected a
:text-shadow 0 1px 0 #eee
:text-shadow 0 1px 0 #fff
:font
:weight bold
:background