@ -2303,29 +2303,42 @@ define([
var priv = metadataMgr . getPrivateData ( ) ;
var origin = priv . origin ;
Messages . help _faq = "Review our list of frequently asked questions" ; // XXX
var faqLine = h ( 'p' ,
h ( 'a' , {
target : '_blank' ,
rel : 'noreferrer noopener' ,
href : origin + '/faq.html' ,
} , Messages . help _faq )
) ;
// XXX link to the most recent changelog/release notes
// XXX FAQ
// XXX GitHub
// XXX privacy policy
// XXX legal notice
var content = h ( 'div' , [
// CryptPad version number
// TODO link to the most recent changelog/release notes
// https://github.com/xwiki-labs/cryptpad/releases/latest/ ?
Messages . info _imprintFlavour = "Legally mandated information about this service's operators can be found <a>here</a>." ; // XXX
Messages . info _privacyFlavour = "Our <a>privacy policy</a> describes how we treat your data." ; // XXX
Messages . info _faqFlavour = "Consult our <a>FAQ</a> for answers to common questions." ; // XXX
var template = function ( line , link ) {
if ( ! line || ! link ) { return ; }
var p = $ ( '<p>' ) . html ( line ) [ 0 ] ;
var sub = link . cloneNode ( true ) ;
/ * T h i s i s a h a c k t o m a k e r e l a t i v e U R L s p o i n t t o t h e m a i n d o m a i n
instead of the sandbox domain . It will break if the admins have specified
some less common URL formats for their customizable links , such as if they ' ve
used a protocal - relative absolute URL . The URL API isn ' t quite safe to use
because of IE ( thanks , Bill ) . * /
var href = sub . getAttribute ( 'href' ) ;
if ( /^\// . test ( href ) ) { sub . setAttribute ( 'href' , origin + href ) ; }
var a = p . querySelector ( 'a' ) ;
if ( ! a ) { return ; }
sub . innerText = a . innerText ;
p . replaceChild ( sub , a ) ;
return p ;
} ;
var legalLine = template ( Messages . info _imprintFlavour , Pages . imprintLink ) ;
var privacyLine = template ( Messages . info _privacyFlavour , Pages . privacyLink ) ;
var faqLine = template ( Messages . info _faqFlavour , Pages . faqLink ) ;
var content = h ( 'div.cp-info-menu-container' , [
h ( 'h6' , Pages . versionString ) ,
// First point users to our FAQ
h ( 'hr' ) ,
legalLine ,
privacyLine ,
faqLine ,
// Link to the support ticket form in case their
// question isn't answered by the FAQ
//supportLine,
] ) ;
var buttons = [
@ -2373,15 +2386,21 @@ define([
content : $userAdminContent . html ( )
} ) ;
}
options . push ( {
tag : 'a' ,
attributes : {
'target' : '_blank' ,
'href' : origin + '/index.html' ,
'class' : 'fa fa-home'
} ,
content : h ( 'span' , Messages . homePage )
} ) ;
if ( accountName && ! AppConfig . disableProfile ) {
options . push ( {
tag : 'a' ,
attributes : { 'class' : 'cp-toolbar-menu-profile fa fa-user-circle' } ,
content : h ( 'span' , Messages . profileButton ) ,
action : function ( ) {
if ( padType ) {
window . open ( origin + '/profile/' ) ;
} else {
window . parent . location = origin + '/profile/' ;
}
} ,
} ) ;
}
if ( padType !== 'drive' || ( ! accountName && priv . newSharedFolder ) ) {
options . push ( {
tag : 'a' ,
@ -2415,29 +2434,6 @@ define([
content : h ( 'span' , Messages . type . contacts )
} ) ;
}
options . push ( { tag : 'hr' } ) ;
// Add the change display name button if not in read only mode
if ( config . changeNameButtonCls && config . displayChangeName && ! AppConfig . disableProfile ) {
options . push ( {
tag : 'a' ,
attributes : { 'class' : config . changeNameButtonCls + ' fa fa-user' } ,
content : h ( 'span' , Messages . user _rename )
} ) ;
}
if ( accountName && ! AppConfig . disableProfile ) {
options . push ( {
tag : 'a' ,
attributes : { 'class' : 'cp-toolbar-menu-profile fa fa-user-circle' } ,
content : h ( 'span' , Messages . profileButton ) ,
action : function ( ) {
if ( padType ) {
window . open ( origin + '/profile/' ) ;
} else {
window . parent . location = origin + '/profile/' ;
}
} ,
} ) ;
}
if ( padType !== 'settings' ) {
options . push ( {
tag : 'a' ,
@ -2452,6 +2448,7 @@ define([
} ,
} ) ;
}
options . push ( { tag : 'hr' } ) ;
// Add administration panel link if the user is an admin
if ( priv . edPublic && Array . isArray ( Config . adminKeys ) && Config . adminKeys . indexOf ( priv . edPublic ) !== - 1 ) {
@ -2482,30 +2479,6 @@ define([
} ,
} ) ;
}
options . push ( { tag : 'hr' } ) ;
if ( Config . allowSubscriptions ) {
options . push ( {
tag : 'a' ,
attributes : {
'target' : '_blank' ,
'href' : priv . plan ? priv . accounts . upgradeURL : origin + '/features.html' ,
'class' : 'fa fa-star-o'
} ,
content : h ( 'span' , priv . plan ? Messages . settings _cat _subscription : Messages . pricing )
} ) ;
}
if ( ! priv . plan && ! Config . removeDonateButton ) {
options . push ( {
tag : 'a' ,
attributes : {
'target' : '_blank' ,
'rel' : 'noopener' ,
'href' : priv . accounts . donateURL ,
'class' : 'fa fa-gift'
} ,
content : h ( 'span' , Messages . crowdfunding _button2 )
} ) ;
}
if ( AppConfig . surveyURL ) {
options . push ( {
tag : 'a' ,
@ -2533,6 +2506,49 @@ define([
} ,
} ) ;
options . push ( {
tag : 'a' ,
attributes : {
'target' : '_blank' ,
'href' : origin + '/index.html' ,
'class' : 'fa fa-home'
} ,
content : h ( 'span' , Messages . homePage )
} ) ;
// Add the change display name button if not in read only mode
/ *
if ( config . changeNameButtonCls && config . displayChangeName && ! AppConfig . disableProfile ) {
options . push ( {
tag : 'a' ,
attributes : { 'class' : config . changeNameButtonCls + ' fa fa-user' } ,
content : h ( 'span' , Messages . user _rename )
} ) ;
} * /
options . push ( { tag : 'hr' } ) ;
if ( Config . allowSubscriptions ) {
options . push ( {
tag : 'a' ,
attributes : {
'target' : '_blank' ,
'href' : priv . plan ? priv . accounts . upgradeURL : origin + '/features.html' ,
'class' : 'fa fa-star-o'
} ,
content : h ( 'span' , priv . plan ? Messages . settings _cat _subscription : Messages . pricing )
} ) ;
}
if ( ! priv . plan && ! Config . removeDonateButton ) {
options . push ( {
tag : 'a' ,
attributes : {
'target' : '_blank' ,
'rel' : 'noopener' ,
'href' : priv . accounts . donateURL ,
'class' : 'fa fa-gift'
} ,
content : h ( 'span' , Messages . crowdfunding _button2 )
} ) ;
}
options . push ( { tag : 'hr' } ) ;
// Add login or logout button depending on the current status
if ( priv . loggedIn ) {