2018-05-09 10:18:28 +00:00
/ * *
* Privacy settings section
*
* @ author Pierre HUBERT
* /
ComunicWeb . pages . settings . sections . privacy = {
/ * *
* Open settings section
*
* @ param { object } args Additionnal arguments
* @ param { HTMLElement } target The target for the page
* /
open : function ( args , target ) {
2018-05-09 12:57:46 +00:00
//Delete account box
this . showDeleteAccountBox ( target ) ;
} ,
2018-05-09 10:18:28 +00:00
2018-05-09 12:57:46 +00:00
/ * *
* Display delete account box
*
* @ param { HTMLElement } target The target for the box
* /
showDeleteAccountBox : function ( target ) {
2018-05-09 10:18:28 +00:00
//Create a box
var box = createElem2 ( {
appendTo : target ,
type : "div" ,
2018-05-09 12:57:46 +00:00
class : "box box-danger box-delete-account-settings"
2018-05-09 10:18:28 +00:00
} ) ;
//Add box header
var boxHead = createElem2 ( {
appendTo : box ,
type : "div" ,
class : "box-header" ,
} ) ;
var boxTitle = createElem2 ( {
appendTo : boxHead ,
type : "h3" ,
class : "box-title" ,
2018-05-09 12:57:46 +00:00
innerHTML : "Delete account"
2018-05-09 10:18:28 +00:00
} ) ;
//Create box body
var boxBody = createElem2 ( {
appendTo : box ,
type : "div" ,
class : "box-body"
} ) ;
2018-05-09 12:57:46 +00:00
//Add a notice
createElem2 ( {
2018-05-09 10:18:28 +00:00
appendTo : boxBody ,
2018-05-09 12:57:46 +00:00
type : "p" ,
innerHTML : "You can decide here to delete your account. <br /><b>Warning! Warning! Warning! This operation CAN NOT BE REVERTED !!!! All your data (post, conversation " +
"messages, comments...) will be permanently deleted ! You will not be able to recover from this operation !</b>"
} ) ;
//Add delete account button
var deleteAccountBtn = createElem2 ( {
appendTo : boxBody ,
type : "div" ,
class : "btn btn-danger" ,
innerHTML : "Delete your account"
} ) ;
deleteAccountBtn . addEventListener ( "click" , function ( e ) {
//Request account deletion
ComunicWeb . components . settings . helper . requestAccountDeletion ( ) ;
2018-05-09 10:18:28 +00:00
} ) ;
} ,
}