From f9e9a3500ee844436a5afc495daf8632c6eff72e Mon Sep 17 00:00:00 2001 From: Dennis Collinson Date: Mon, 23 Jan 2012 19:38:38 -0800 Subject: [PATCH] rebased, removed orphaned callbacks --- public/javascripts/publisher.js | 56 --------------------------------- 1 file changed, 56 deletions(-) diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index 0f7d3c641..865a0941e 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -150,13 +150,6 @@ var Publisher = { }); }, - beforeSubmit: function(){ - if($("#publisher .content_creation form #aspect_ids_").length == 0){ - alert(Diaspora.I18n.t('publisher.at_least_one_aspect')); - return false; - } - }, - keyUp : function(){ Publisher.determineSubmitAvailability() Publisher.input().mentionsInput("val", function(value) { @@ -164,55 +157,6 @@ var Publisher = { }); }, - onSubmit: function(data, json, xhr){ - $("#photodropzone").find('li').remove(); - Publisher.input().removeClass("with_attachments").css('paddingBottom', ''); - }, - onFailure: function(data, json, xhr){ - json = $.parseJSON(json.responseText); - if(json.errors.length !== 0){ - Diaspora.Alert.show(json.errors); - }else{ - Diaspora.Alert.show(Diaspora.I18n.t('failed_to_post_message')); - } - }, - onSuccess: function(data, json, xhr){ - if (Publisher.bookmarklet == false) { - var isPostVisible = Diaspora.page.aspectNavigation.selectedAspects().length == 0; - var postedTo = Publisher.selectedAspectIds(); - - - if(Publisher.isPublicPost() || Publisher.isToAllAspects()){ - isPostVisible = true; - - } else { - $.each(Diaspora.page.aspectNavigation.selectedAspects(), function(index, value) { - if (postedTo.indexOf(parseInt(value)) > -1) - isPostVisible = true; - }); - } - - if(isPostVisible) { - 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') - }); - } - } - - //Stream.setUpImageLinks(); - Stream.setUpAudioLinks(); - }, - - bindAjax: function(){ - Publisher.form().bind('ajax:loading', Publisher.onSubmit); - Publisher.form().bind('ajax:failure', Publisher.onFailure); - Publisher.form().bind('ajax:success', Publisher.onSuccess); - }, - triggerGettingStarted: function(){ Publisher.setUpPopovers("#publisher .dropdown", {trigger: 'manual', offset: 10, id: "message_visibility_explain", placement:'below', html:true}, 1000); Publisher.setUpPopovers("#publisher #status_message_fake_text", {trigger: 'manual', placement: 'right', offset: 30, id: "first_message_explain", html:true}, 600);