##// END OF EJS Templates
users: in case of multiple personal groups, return the first instead of an error....
users: in case of multiple personal groups, return the first instead of an error. - backward compat fix from previous error we had

File last commit:

r2487:fcee5614 default
r3039:12ce4f25 stable
Show More
notifications.js
66 lines | 2.6 KiB | application/javascript | JavascriptLexer
release: update copyright year to 2018
r2487 // # Copyright (C) 2010-2018 RhodeCode GmbH
project: added all source files and assets
r1 // #
// # This program is free software: you can redistribute it and/or modify
// # it under the terms of the GNU Affero General Public License, version 3
// # (only), as published by the Free Software Foundation.
// #
// # This program is distributed in the hope that it will be useful,
// # but WITHOUT ANY WARRANTY; without even the implied warranty of
// # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// # GNU General Public License for more details.
// #
// # You should have received a copy of the GNU Affero General Public License
// # along with this program. If not, see <http://www.gnu.org/licenses/>.
// #
// # This program is dual-licensed. If you wish to learn more about the
// # RhodeCode Enterprise Edition, including its added features, Support services,
// # and proprietary license terms, please see https://rhodecode.com/licenses/
var _run_callbacks = function(callbacks){
if (callbacks !== undefined){
var _l = callbacks.length;
for (var i=0;i<_l;i++){
var func = callbacks[i];
if(typeof(func)=='function'){
try{
func();
}catch (err){};
}
}
}
};
notifications: ported views to pyramid
r1920 var deleteNotification = function(notification_id, callbacks){
project: added all source files and assets
r1 var callback = function(o){
var obj = $("#notification_"+notification_id);
obj.remove();
_run_callbacks(callbacks);
};
notifications: ported views to pyramid
r1920 var postData = {'csrf_token': CSRF_TOKEN};
var sUrl = pyroutes.url('notifications_delete', {'notification_id': notification_id});
var request =
$.post(sUrl, postData)
.done(callback)
.fail(function(data, textStatus, errorThrown){
alert("Error while deleting notification.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(this)[0].url));
});
project: added all source files and assets
r1 };
notifications: ported views to pyramid
r1920 var readNotification = function(notification_id, callbacks){
project: added all source files and assets
r1 var callback = function(o){
var obj = $("#notification_"+notification_id);
obj.removeClass('unread');
notifications: ported views to pyramid
r1920 var r_button = $('.read-notification', obj)[0];
project: added all source files and assets
r1 r_button.remove();
_run_callbacks(callbacks);
};
notifications: ported views to pyramid
r1920 var postData = {'csrf_token': CSRF_TOKEN};
var sUrl = pyroutes.url('notifications_update', {'notification_id': notification_id});
var request =
$.post(sUrl, postData)
.done(callback)
.fail(function(data, textStatus, errorThrown){
alert("Error while saving notification.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(this)[0].url));
});
project: added all source files and assets
r1 };