Commit cdbd9df1 authored by maxwell's avatar maxwell

Merge branch 'master' of github.com:diaspora/diaspora

parents ae2b3d75 108ac9fd
......@@ -5,7 +5,8 @@
- content_for :head do
:javascript
$(document).ready( function(){
$("#edit_photo_toggle").bind('click', function() {
$("#edit_photo_toggle").bind('click', function(evt) {
evt.preventDefault();
$("#photo_edit_options").toggle();
$(".edit_photo input[type='text']").first().focus();
});
......@@ -38,12 +39,11 @@
#show_photo
-if @ownership
= image_tag 'ajax-loader.gif', :id => "photo_spinner", :class => "hidden"
.edit_pane
.controls{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_medium)}"}}
= link_to t('.make_profile_photo'), '#', :class => "make_profile_photo"
|
= link_to 'edit', '#', :id => "edit_photo_toggle"
= image_tag @photo.url(:scaled_full)
= image_tag @photo.url(:scaled_full)
.photo_options{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_medium)}"}}
= link_to t('.make_profile_photo'), '#', :class => 'make_profile_photo'
|
= link_to 'edit', '#', :id => "edit_photo_toggle"
-else
= image_tag @photo.url(:scaled_full)
......
......@@ -2,7 +2,7 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h3= markdownify(post.message)
= markdownify(post.message)
%br
- for photo in post.photos
= link_to (image_tag photo.url(:thumb_medium)), object_path(photo)
......@@ -138,19 +138,27 @@ function openVideo(type, videoid, link) {
link.onclick = function() { $container.slideToggle('fast', function() { } ); }
}
$(".make_profile_photo").live("click", function(){
$(".make_profile_photo").live("click", function(evt){
evt.preventDefault();
var $this = $(this),
$controls = $this.closest(".controls"),
$controls = $this.closest(".photo_options"),
user_id = $controls.attr('data-actor');
person_id = $controls.attr('data-actor_person');
photo_url = $controls.attr('data-image_url');
$("img[data-person_id='"+ person_id +"']").each( function() {
$(this).fadeTo(200,0.3);
});
$.ajax({
type: "PUT",
url: '/people/'+user_id,
data: {"person":{"profile":{ "image_url": photo_url }}},
success: function(){
$("img[data-person_id='"+ person_id +"']").each( function() {
$(this).fadeTo(200,1);
this.src = photo_url;
});
}
......
......@@ -665,6 +665,7 @@ li.message .from .right
:margin-right 1em
#show_photo
:position relative
:display inline-block
:background
:color #fff
......@@ -680,6 +681,8 @@ li.message .from .right
:border-radius 3px
img
:z-index 2
:position relative
:max-width 100%
:margin
:bottom 10px
......@@ -687,6 +690,7 @@ li.message .from .right
:bottom 1px solid #ddd
#photo_spinner
:z-index 1
:position absolute
:height 100px
:width 100px
......@@ -1351,32 +1355,13 @@ input[type="search"]
:border-radius 5px
.edit_pane
.photo_options
:display inline
:position relative
.controls
:display none
:background
:color rgba(51,51,51,0.9)
:padding 10px
:position absolute
:right 1px
:margin
:top 1px
a
:font
:weight bold
:color #eee
:text-shadow 0 1px #000
:position absolute
:bottom 5px
:right 13px
&:hover
:color #fff
&:hover
.controls
:display inline
:color #999
ul#breadcrumb
:list
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment