diaspora/app/views/status_messages/bookmarklet.html.haml
2011-08-18 16:48:20 -07:00

38 lines
1.3 KiB
Text

-# 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.open();
$("#publisher").bind('ajax:success', function(){
$('h4').text("#{t('bookmarklet.post_success')}");
Publisher.close();
window.setTimeout(window.close, 2000, true);
});
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);
$('input.button')[0].removeAttribute('disabled');
});
#new_status_message_pane
.span-15.last
%h4
=t('bookmarklet.post_something')
= render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids }