Skip to content

Commit

Permalink
Updated Mailpile.notification to new spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bnvk committed Aug 21, 2014
1 parent 7a710d6 commit 6e5e33e
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion static/default/html/jsapi/app/drag_drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Mailpile.sidebar_tags_droppable_opts = {

Mailpile.API.tag_post({ add: tid, del: tags_delete, mid: Mailpile.messages_cache}, function(result) {

console.log(result);
// Show
Mailpile.notification(result);

// Update Pile View
Expand Down
2 changes: 1 addition & 1 deletion static/default/html/jsapi/compose/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ $(document).on('click', '.compose-action', function(e) {
Mailpile.compose_render_message_thread(response.result.thread_ids[0]);
}
else {
Mailpile.notification(response.status, response.message);
Mailpile.notification(response);
}
},
error: function() {
Expand Down
4 changes: 2 additions & 2 deletions static/default/html/jsapi/message/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $(document).on('click', '.message-action-forward', function() {
if (response.status === 'success') {
window.location.href = Mailpile.urls.message_draft + response.result.created + '/';
} else {
Mailpile.notification(response.status, response.message);
Mailpile.notification(response);
}
}
});
Expand Down Expand Up @@ -72,7 +72,7 @@ $(document).on('click', '.message-action-unthread', function() {
.addClass('thread-notification')
.html(_.template($('#template-thread-notification-unthreaded').html(), notification_data));
} else {
Mailpile.notification(response.status, response.message);
Mailpile.notification(response);
}
}
});
Expand Down
8 changes: 1 addition & 7 deletions static/default/html/jsapi/message/thread.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Mailpile.render_thread_message = function(mid) {

$.ajax({
url : Mailpile.api.message + mid + "/single.jhtml",
type : 'GET',
Expand All @@ -11,18 +10,16 @@ Mailpile.render_thread_message = function(mid) {
}
},
error: function() {
Mailpile.notification('error', 'Could not retrieve message');
Mailpile.notification({status: 'error', message: 'Could not retrieve message'});
}
});
};


/* Thread - iframe styling */
Mailpile.thread_html_iframe = function(element) {

var new_iframe_height = $(element).contents().height();
$('.thread-item-html').height(new_iframe_height);

$(element).contents().find('body div').addClass('thread-item-html-text');
};

Expand Down Expand Up @@ -62,7 +59,6 @@ $(document).on('click', '.show-thread-tags', function() {

/* Thread - Show Security */
$(document).on('click', '.show-thread-security', function() {

alert('FIXME: Show details about security of thread');
});

Expand Down Expand Up @@ -121,11 +117,9 @@ $('div.thread-draggable').draggable({

// Add Draggable MID
var mid = location.href.split("thread/=")[1].split("/")[0];
console.log('dragging mid: ' + mid);
Mailpile.bulk_cache_add('messages_cache', mid);

// Update Bulk UI

// Style & Select Checkbox

},
Expand Down
7 changes: 6 additions & 1 deletion static/default/html/jsapi/setup/profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ var ProfilesView = Backbone.View.extend({
e.preventDefault();
var profile_id = $(e.target).data('id');
Mailpile.API.profiles_remove_post({ rid: profile_id }, function(result) {
$('#setup-profile-' + profile_id).fadeOut();
$('#setup-profile-' + profile_id).fadeOut(function() {
$(this).remove();
});
if ($('#setup-profiles-list-items li.setup-item').length === 1) {
$('.setup-profile-remove').parent().hide();
}
});
}
});
12 changes: 6 additions & 6 deletions static/default/html/jsapi/tags/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Mailpile.tag_add = function(tag_add, mids, complete) {
if (response.status == 'success') {
complete(response.result);
} else {
Mailpile.notification(response.status, response.message);
Mailpile.notification(response);
}
}
});
Expand All @@ -35,7 +35,7 @@ Mailpile.tag_update = function(tid, setting, value, complete) {
if (response.status == 'success') {
complete(response.result);
} else {
Mailpile.notification(response.status, response.message);
Mailpile.notification(response);
}
}
});
Expand Down Expand Up @@ -147,7 +147,7 @@ $(document).on('click', '#button-tag-toggle-archive', function(e) {
$(document).on('blur', '#data-tag-add-tag', function(e) {
Mailpile.tag_update($('#data-tag-tid').val(), 'name', $(this).val(), function(response) {
Mailpile.tag_update($('#data-tag-tid').val(), 'slug', $('#data-tag-add-slug').val(), function(response) {
Mailpile.notification(response.status, '{{_("Tag Name & Slug Updated")}}');
Mailpile.notification(response);
});
});
});
Expand All @@ -156,23 +156,23 @@ $(document).on('blur', '#data-tag-add-tag', function(e) {
/* Tag - Update the Slug */
$(document).on('blur', '#data-tag-add-slug', function(e) {
Mailpile.tag_update($('#data-tag-tid').val(), 'slug', $('#data-tag-add-slug').val(), function(response) {
Mailpile.notification(response.status, '{{("Tag Name & Slug Updated")}}');
Mailpile.notification(response);
});
});


/* Tag - Update (multiple attribute events) */
$(document).on('change', '#data-tag-display', function(e) {
Mailpile.tag_update($('#data-tag-tid').val(), 'display', $(this).val(), function(response) {
Mailpile.notification(response.status, response.message);
Mailpile.notification(response);
});
});


/* Tag - Update parent */
$(document).on('change', '#data-tag-parent', function(e) {
Mailpile.tag_update($('#data-tag-tid').val(), 'parent', $(this).val(), function(response) {
Mailpile.notification(response.status, response.message);
Mailpile.notification(response);
});
});

Expand Down
2 changes: 1 addition & 1 deletion static/default/html/jsapi/ui/topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $(document).on('click', '#button-compose', function(e) {
if (response.status === 'success') {
window.location.href = Mailpile.urls.message_draft + response.result.created[0] + '/';
} else {
Mailpile.notification(response.status, response.message);
Mailpile.notification(response);
}
});
});
Expand Down

0 comments on commit 6e5e33e

Please sign in to comment.