rebased, removed orphaned callbacks

This commit is contained in:
Dennis Collinson 2012-01-23 19:38:38 -08:00
parent 18cd151456
commit f9e9a3500e

View file

@ -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);