3 Jappix - An open social platform
4 These are the notification board JS script for Jappix
6 -------------------------------------------------
10 Last revision: 12/03/11
14 // Creates a board panel
15 function createBoard(type, id) {
24 text = _e("Your password has been changed, now you can connect to your account with your new login data.");
30 text = _e("Your XMPP account has been removed, bye!");
36 text = _e("You have been logged out of your XMPP account, have a nice day!");
42 text = _e("The room you joined seems not to exist. You should create it!");
48 text = _e("The groupchat has been removed, now someone else will be able to recreate it.");
52 // Non-existant groupchat user
54 text = _e("The user that you want to reach is not present in the room.");
65 text = '<b>' + _e("Error") + '</b> » <span></span>';
71 text = _e("Jappix has been interrupted by a network issue, a bug or bad login (check that you entered the right credentials), sorry for the inconvenience.");
75 // List retrieving error
77 text = _e("The element list on this server could not be obtained!");
83 text = printf(_e("An error occured while uploading your file: maybe it is too big (%s maximum) or forbidden!"), JAPPIX_MAX_UPLOAD);
94 $('#board').append('<div class="one-board ' + type + '" data-id="' + id + '">' + text + '</div>');
96 // Events (click and auto-hide)
97 $('#board .one-board.' + type + '[data-id=' + id + ']')
100 closeThisBoard(this);
103 .oneTime('5s', function() {
104 closeThisBoard(this);
112 // Destroys the existing board notifications
113 function destroyBoard() {
117 // Executes a given action on the notification board
118 function actionBoard(id, type) {
119 // In a first, we destroy other boards
122 // Then we display the board
123 createBoard(type, id);
126 // Opens a given error ID
127 function openThisError(id) {
128 actionBoard(id, 'error');
131 // Opens a given info ID
132 function openThisInfo(id) {
133 actionBoard(id, 'info');
136 // Closes a given board
137 function closeThisBoard(board) {
138 $(board).slideUp('normal', function() {