publisher works through ajax filters
This commit is contained in:
parent
f02c13ee73
commit
e6ae5e13e2
10 changed files with 58 additions and 42 deletions
9
app/views/aspects/_aspect_stream.haml
Normal file
9
app/views/aspects/_aspect_stream.haml
Normal 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
|
||||||
|
|
@ -15,13 +15,14 @@
|
||||||
= info_text(t('.handle_explanation'))
|
= info_text(t('.handle_explanation'))
|
||||||
|
|
||||||
.span-15.append-1
|
.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_contacts_message', :aspect => @aspect, :contact_count => @contacts.count
|
||||||
/= render 'aspects/no_posts_message', :post_count => @post_hashes.length, :contact_count => @contacts.count
|
/= render 'aspects/no_posts_message', :post_count => @post_hashes.length, :contact_count => @contacts.count
|
||||||
|
|
||||||
#main_stream.stream
|
#aspect_stream_container
|
||||||
= render 'shared/stream', :posts => @post_hashes
|
= render 'aspect_stream',
|
||||||
= will_paginate @posts
|
:aspect => @aspect,
|
||||||
|
:aspect_ids => @aspect_ids,
|
||||||
|
:post_hashes => @post_hashes
|
||||||
|
|
||||||
.span-6.last
|
.span-6.last
|
||||||
= render 'aspects/all_aspects_contacts'
|
= render 'aspects/all_aspects_contacts'
|
||||||
|
|
|
||||||
|
|
@ -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)) %>");
|
||||||
|
|
|
||||||
|
|
@ -52,4 +52,4 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onload = createUploader;
|
createUploader();
|
||||||
|
|
|
||||||
|
|
@ -3,32 +3,6 @@
|
||||||
-# the COPYRIGHT file.
|
-# 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"}
|
#publisher{:class=>"closed"}
|
||||||
|
|
||||||
#click_to_share
|
#click_to_share
|
||||||
|
|
@ -61,9 +35,9 @@
|
||||||
#fileInfo
|
#fileInfo
|
||||||
= image_tag 'ajax-loader.gif', :class => 'hidden', :id => "publisher_spinner"
|
= image_tag 'ajax-loader.gif', :class => 'hidden', :id => "publisher_spinner"
|
||||||
- if aspect == :all
|
- 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
|
- 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
|
- if aspect == :all
|
||||||
.public_toggle
|
.public_toggle
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ javascripts:
|
||||||
- public/javascripts/aspect-edit.js
|
- public/javascripts/aspect-edit.js
|
||||||
- public/javascripts/contact-list.js
|
- public/javascripts/contact-list.js
|
||||||
home:
|
home:
|
||||||
|
- public/javascripts/publisher.js
|
||||||
- public/javascripts/aspect-filters.js
|
- public/javascripts/aspect-filters.js
|
||||||
people:
|
people:
|
||||||
- public/javascripts/contact-list.js
|
- public/javascripts/contact-list.js
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* the COPYRIGHT file.
|
* the COPYRIGHT file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(function(){
|
$(document).ready(function(){
|
||||||
var selectedGUIDS = [];
|
var selectedGUIDS = [];
|
||||||
|
|
||||||
$("#aspect_nav li").each(function(){
|
$("#aspect_nav li").each(function(){
|
||||||
|
|
@ -20,7 +20,7 @@ $(function(){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// loading animation
|
// loading animation
|
||||||
$("#main_stream").fadeTo(100, 0.4);
|
$("#aspect_stream_container").fadeTo(100, 0.4);
|
||||||
|
|
||||||
|
|
||||||
// filtering //////////////////////
|
// filtering //////////////////////
|
||||||
|
|
@ -53,6 +53,7 @@ $(function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate new url
|
// generate new url
|
||||||
|
baseURL = baseURL.replace('#','');
|
||||||
baseURL += '?';
|
baseURL += '?';
|
||||||
for(i=0; i < selectedGUIDS.length; i++){
|
for(i=0; i < selectedGUIDS.length; i++){
|
||||||
baseURL += 'a_ids[]='+ selectedGUIDS[i] +'&';
|
baseURL += 'a_ids[]='+ selectedGUIDS[i] +'&';
|
||||||
|
|
@ -66,7 +67,7 @@ $(function(){
|
||||||
url : baseURL,
|
url : baseURL,
|
||||||
dataType : 'script',
|
dataType : 'script',
|
||||||
success : function(data){
|
success : function(data){
|
||||||
$("#main_stream").fadeTo(100, 1);
|
$("#aspect_stream_container").fadeTo(100, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
29
public/javascripts/publisher.js
Normal file
29
public/javascripts/publisher.js
Normal 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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -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();
|
$("#photodropzone").find('li').remove();
|
||||||
$("#publisher textarea").removeClass("with_attachments");
|
$("#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);
|
json = $.parseJSON(json);
|
||||||
WebSocketReceiver.addPostToStream(json.post_id, json.html);
|
WebSocketReceiver.addPostToStream(json.post_id, json.html);
|
||||||
//collapse publisher
|
//collapse publisher
|
||||||
|
|
|
||||||
|
|
@ -937,6 +937,7 @@ label
|
||||||
> li
|
> li
|
||||||
:display inline
|
:display inline
|
||||||
:margin 0
|
:margin 0
|
||||||
|
:right 2px
|
||||||
:padding 4px 0
|
:padding 4px 0
|
||||||
a
|
a
|
||||||
:-webkit-border-radius 2px
|
:-webkit-border-radius 2px
|
||||||
|
|
@ -945,9 +946,9 @@ label
|
||||||
|
|
||||||
:text-shadow 0 1px 0 #444
|
:text-shadow 0 1px 0 #444
|
||||||
|
|
||||||
:padding 1px 7px
|
:padding 1px 5px
|
||||||
|
|
||||||
:color #CCC
|
:color #999
|
||||||
:max-width 120px
|
:max-width 120px
|
||||||
:overflow hidden
|
:overflow hidden
|
||||||
:text-overflow ellipsis
|
:text-overflow ellipsis
|
||||||
|
|
@ -958,7 +959,7 @@ label
|
||||||
:color #eee
|
:color #eee
|
||||||
|
|
||||||
&.selected a
|
&.selected a
|
||||||
:text-shadow 0 1px 0 #eee
|
:text-shadow 0 1px 0 #fff
|
||||||
:font
|
:font
|
||||||
:weight bold
|
:weight bold
|
||||||
:background
|
:background
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue