more bookmarklet improvements
This commit is contained in:
parent
f08b5dfafe
commit
9e5890288c
3 changed files with 14 additions and 7 deletions
|
|
@ -26,7 +26,6 @@ class StatusMessagesController < ApplicationController
|
|||
end
|
||||
|
||||
def bookmarklet
|
||||
puts "foo"
|
||||
@aspects = current_user.aspects
|
||||
@aspect_ids = @aspects.map{|x| x.id}
|
||||
render :layout => nil
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@
|
|||
|
||||
|
||||
%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!
|
||||
%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=1&';a=function(){if(!window.open(f+'noui=1&jump=doclose','diasporav1','location=yes,links=no,scrollbars=no,toolbar=no,width=620,height=250'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"}
|
||||
post to Diaspora v1
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,14 +12,22 @@
|
|||
Diaspora.widgets.i18n.loadLocale(#{get_javascript_strings_for(current_user.language).to_json}, "#{current_user.language}");
|
||||
$(document).ready(function()
|
||||
{
|
||||
Publisher.open();
|
||||
$("#publisher").bind('ajax:success', function(){
|
||||
$('h4').text("Your post was successful! Closing!");
|
||||
Publisher.close();
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
var contents = "#{params[:title]} - #{params[:url]}";
|
||||
if ("#{params[:notes]}".length > 0){
|
||||
contents = contents + " - #{params[:notes]}";
|
||||
}
|
||||
|
||||
$("#publisher #status_message_fake_text").val(contents);
|
||||
$("#publisher #status_message_text").val(contents);
|
||||
});
|
||||
|
||||
#new_status_message_pane
|
||||
.span-15.last
|
||||
|
|
|
|||
Loading…
Reference in a new issue