refactoring

This commit is contained in:
2017-06-14 12:28:08 +02:00
parent 52d12985c7
commit 76889c82c5
46 changed files with 3129 additions and 552 deletions

View File

@ -1,26 +1,5 @@
+(function($) {
var allowCircleToBlog = function(e) {
var allow = $(this).prop('checked');
var circleid = $(this).data('circle-id');
var targetid = $(this).data('target-id');
var auth = { CircleId: circleid, BlogPostId: targetid };
var url = '/api/blogacl';
if (!allow) url += '/' + circleid;
console.log(auth);
$.ajax({
url: url,
type: allow ? 'POST' : 'DELETE',
data: JSON.stringify(auth),
contentType: "application/json;charset=utf-8",
success: function(data) {
console.log('auth ' + allow ? 'POSTED' : 'DELETED' + data);
},
error: function() {
console.log('Error @' + allow ? 'POSTed' : 'DELETEd');
}
});
e.preventDefault();
};
function notifClick(nid) {
if (nid > 0) { 
@ -29,7 +8,4 @@
.always(function() {});
}
}
$(document).ready(function() {
$('input.Blogcirle[type=checkbox]').on('change', allowCircleToBlog);
});
})(jQuery);