From 9072de5096040881d6d61c07fa4ec9604cefb075 Mon Sep 17 00:00:00 2001 From: vcuculo Date: Fri, 2 Sep 2011 10:21:23 +0200 Subject: [PATCH 1/2] fixed bookmarklet --- public/javascripts/publisher.js | 34 +++++++++++++----------- public/stylesheets/sass/application.sass | 1 + 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index e17751999..aa08b783c 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -5,6 +5,7 @@ //TODO: make this a widget var Publisher = { + bookmarklet : false, close: function(){ Publisher.form().addClass('closed'); Publisher.form().find("#publisher_textarea_wrapper").removeClass('active'); @@ -374,24 +375,25 @@ var Publisher = { } }, onSuccess: function(data, json, xhr){ - var isPostVisible = AspectFilters.selectedGUIDS.length == 0; - var postedTo = Publisher.selectedAspectIds(); - $.each(AspectFilters.selectedGUIDS, function(index, value){ - if(postedTo.indexOf(parseInt(value))>-1) - isPostVisible = true; - }); - - if(isPostVisible) { - ContentUpdater.addPostToStream(json.html); - Diaspora.page.stream.addPost($("#" + json.post_id)); - } - else { - Diaspora.widgets.flashMessages.render({ - success: true, - message: Diaspora.I18n.t('successfully_posted_message_to_an_aspects_that_is_not_visible') + if(Publisher.bookmarklet == false){ + var isPostVisible = AspectFilters.selectedGUIDS.length == 0; + var postedTo = Publisher.selectedAspectIds(); + $.each(AspectFilters.selectedGUIDS, function(index, value){ + if(postedTo.indexOf(parseInt(value))>-1) + isPostVisible = true; }); - } + if(isPostVisible) { + ContentUpdater.addPostToStream(json.html); + Diaspora.page.stream.addPost($("#" + json.post_id)); + } + else { + Diaspora.widgets.flashMessages.render({ + success: true, + message: Diaspora.I18n.t('successfully_posted_message_to_an_aspects_that_is_not_visible') + }); + } + } //collapse publisher Publisher.close(); Publisher.clear(); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 1f1058bd0..ff9da4f0c 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -899,6 +899,7 @@ label textarea :resize none :width 455px + :height 50px :margin 0 &.mention_popup From 8919d0c0cea8aeeee7b18d66dfbe08614c73e482 Mon Sep 17 00:00:00 2001 From: vcuculo Date: Fri, 2 Sep 2011 10:28:32 +0200 Subject: [PATCH 2/2] fixed bookmarklet --- app/views/status_messages/bookmarklet.html.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/status_messages/bookmarklet.html.haml b/app/views/status_messages/bookmarklet.html.haml index adb24271c..bbb2133c4 100644 --- a/app/views/status_messages/bookmarklet.html.haml +++ b/app/views/status_messages/bookmarklet.html.haml @@ -13,6 +13,7 @@ $(document).ready(function() { Publisher.open(); + Publisher.bookmarklet = true; $("#publisher").bind('ajax:success', function(){ $('h4').text("#{t('bookmarklet.post_success')}"); Publisher.close();