basic functionality done, fixing rough edges
This commit is contained in:
parent
349aa13c05
commit
f08b5dfafe
5 changed files with 47 additions and 0 deletions
|
|
@ -13,4 +13,5 @@ class SessionsController < Devise::SessionsController
|
|||
}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -25,6 +25,13 @@ class StatusMessagesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def bookmarklet
|
||||
puts "foo"
|
||||
@aspects = current_user.aspects
|
||||
@aspect_ids = @aspects.map{|x| x.id}
|
||||
render :layout => nil
|
||||
end
|
||||
|
||||
def create
|
||||
params[:status_message][:aspect_ids] = params[:aspect_ids]
|
||||
|
||||
|
|
|
|||
|
|
@ -50,3 +50,10 @@
|
|||
%br
|
||||
#resp
|
||||
|
||||
|
||||
%br
|
||||
%a{:href => "javascript:(function(){f='#{AppConfig[:pod_url]}bookmarklet?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'¬es='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=6&';a=function(){if(!window.open(f+'noui=1&jump=doclose','deliciousuiv6','location=yes,links=no,scrollbars=no,toolbar=no,width=600,height=300'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"}
|
||||
post to Diaspora!
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
31
app/views/status_messages/bookmarklet.html.haml
Normal file
31
app/views/status_messages/bookmarklet.html.haml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
-# Copyright (c) 2010, Diaspora Inc. This file is
|
||||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
= include_javascripts :jquery
|
||||
= include_javascripts :main
|
||||
= include_stylesheets :default, :media => 'all'
|
||||
= stylesheet_link_tag "blueprint/screen", :media => 'screen'
|
||||
= javascript_include_tag "publisher.js"
|
||||
|
||||
:javascript
|
||||
Diaspora.widgets.i18n.loadLocale(#{get_javascript_strings_for(current_user.language).to_json}, "#{current_user.language}");
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#publisher").bind('ajax:success', function(){
|
||||
$('h4').text("Your post was successful! Closing!");
|
||||
window.setTimeout(window.close, 2000, true);
|
||||
});
|
||||
$("#publisher #status_message_fake_text").val("#{params[:url]} - #{params[:notes]}");
|
||||
$("#publisher #status_message_text").val("#{params[:url]}");
|
||||
Publisher.open();
|
||||
});
|
||||
|
||||
#new_status_message_pane
|
||||
.span-15.last
|
||||
#facebox_header
|
||||
%h4
|
||||
Post something to Diaspora
|
||||
|
||||
= render :partial => 'shared/publisher', :locals => { :aspect => :profile, :aspects_with_person => @aspects, :aspect_ids => @aspect_ids}
|
||||
|
||||
|
|
@ -64,6 +64,7 @@ Diaspora::Application.routes.draw do
|
|||
get 'admin_inviter' => :admin_inviter
|
||||
end
|
||||
|
||||
get 'bookmarklet' => 'status_messages#bookmarklet'
|
||||
resource :profile
|
||||
|
||||
resources :requests, :only => [:destroy, :create]
|
||||
|
|
|
|||
Loading…
Reference in a new issue