define ( [
'jquery' ,
'/common/hyperscript.js' ,
'/customize/messages.js' ,
'/customize/application_config.js' ,
'/common/outer/local-store.js' ,
'/customize/pages.js' ,
'/api/config' ,
] , function ( $ , h , Msg , AppConfig , LocalStore , Pages , Config ) {
var origin = encodeURIComponent ( window . location . hostname ) ;
var accounts = {
donateURL : AppConfig . donateURL || "https://opencollective.com/cryptpad/" ,
upgradeURL : AppConfig . upgradeURL || 'https://accounts.cryptpad.fr/#/?on=' + origin ,
} ;
// XXX translations
Msg . features _title = "Features" ;
return function ( ) {
// Non-registered column
Msg . features _anon = "Non-registered" ;
Msg . features _f _apps = "Access to all the applications" ;
// Msg.features_f_apps_note = "";
Msg . features _f _core = "Common features" ;
// Msg.features_f_core_note = "";
Msg . features _f _file0 = "Open documents" ;
Msg . features _f _file0 _note = "View and download documents shared by other users" ;
// Msg.features_f_cryptdrive0 = "";
// Msg.features_f_cryptdrive0_note = "";
// Msg.features_f_storage0 = "";
Msg . features _f _storage0 _note = "Documents are deleted after 3 months of inactivity" ;
// Registered column
Msg . features _registered = "Registered" ; //
// Msg.features_f_anon = "";
Msg . features _f _anon _note = "With additional functionality" ;
Msg . features _f _social = "Social Features" ;
Msg . features _f _social _note = "Add contacts for secure collaboration, create a profile, fine-grained access controls" ;
// Msg.features_f_file1 = "";
// XXX add instance limit
Msg . features _f _file1 _note = "Store files in your CryptDrive: images, PDFs, videos, and more. Share them with your contacts or embed them in your documents. (up to 25MB)" ;
// Msg.features_f_cryptdrive1 = "";
// Msg.features_f_cryptdrive1_note = "";
// Msg.features_f_devices = "";
// Msg.features_f_devices_note = "";
// XXX add instance limit
Msg . features _f _storage1 = "Permanent Storage (1GB)" ;
Msg . features _f _storage1 _note = "Documents stored in your CryptDrive are never deleted for inactivity" ;
// Premium column
Msg . features _premium = "Premium" ;
Msg . features _pricing = "{0} to {2}€ per month" ;
// Msg.features_f_reg = ""
Msg . features _f _reg _note = "With additional benefits" ;
// Msg.features_f_storage2 = ""
Msg . features _f _storage2 _note = "From 5GB to 50GB depending on the plan. Increased limit of 150MB for file uploads." ;
// Msg.features_f_support = ""
Msg . features _f _support _note = "Priority response from the administration team via email and built in ticket system." ;
Msg . features _f _supporter = "Support privacy" ;
Msg . features _f _supporter _note = "Help CryptPad financially sustainable and show that privacy-enhancing software willingly funded by users should be the norm" ;
Msg . features _f _subscribe = "Subscribe" ;
Msg . features _f _subscribe _note = "Registered account needed to subscribe" ;
Msg . features _f _apps _note = AppConfig . availablePadTypes . map ( function ( app ) {
if ( AppConfig . registeredOnlyTypes . indexOf ( app ) !== - 1 ) { return ; }
return Msg . type [ app ] ;
} ) . filter ( function ( x ) { return x ; } ) . join ( ', ' ) ;
var premiumButton = h ( 'a' , {
href : accounts . upgradeURL ,
target : '_blank' ,
rel : 'noopener noreferrer'
} , h ( 'button.cp-features-register-button' , Msg . features _f _subscribe ) ) ;
var anonymousFeatures =
h ( 'div.col-12.col-sm-4.cp-anon-user' , [
h ( 'div.card' , [
h ( 'div.title-card' , [
h ( 'h3.text-center' , Msg . features _anon )
] ) ,
h ( 'div.card-body.cp-pricing' , [
h ( 'div.text-center' , '0€' ) ,
h ( 'div.text-center' , Msg . features _noData ) ,
] ) ,
h ( 'ul.list-group.list-group-flush' ,
[ 'apps' , 'file0' , 'core' , 'cryptdrive0' , 'storage0' ] . map ( function ( f ) {
return h ( 'li.list-group-item' , [
h ( 'div.cp-check' ) ,
h ( 'div.cp-content' , [
h ( 'div.cp-feature' , Msg [ 'features_f_' + f ] ) ,
h ( 'div.cp-note' , Msg [ 'features_f_' + f + '_note' ] )
] )
] ) ;
} )
) ,
] ) ,
] ) ;
var registeredFeatures =
h ( 'div.col-12.col-sm-4.cp-regis-user' , [
h ( 'div.card' , [
h ( 'div.title-card' , [
h ( 'h3.text-center' , Msg . features _registered )
] ) ,
h ( 'div.card-body.cp-pricing' , [
h ( 'div.text-center' , '0€' ) ,
h ( 'div.text-center' , Msg . features _noData ) ,
] ) ,
h ( 'ul.list-group.list-group-flush' , [
[ 'anon' , 'social' , 'file1' , 'cryptdrive1' , 'devices' , 'storage1' ] . map ( function ( f ) {
return h ( 'li.list-group-item' , [
h ( 'div.cp-check' ) ,
h ( 'div.cp-content' , [
h ( 'div.cp-feature' , Msg [ 'features_f_' + f ] ) ,
h ( 'div.cp-note' , Msg [ 'features_f_' + f + '_note' ] )
] )
] ) ;
} ) ,
] ) ,
h ( 'div.card-body' , [
h ( 'div.cp-features-register#cp-features-register' , [
h ( 'a' , {
href : '/register/'
} , h ( 'button.cp-features-register-button' , Msg . features _f _register ) )
] ) ,
] ) ,
] ) ,
] ) ;
var premiumFeatures =
h ( 'div.col-12.col-sm-4.cp-anon-user' , [
h ( 'div.card' , [
h ( 'div.title-card' , [
h ( 'h3.text-center' , Msg . features _premium )
] ) ,
h ( 'div.card-body.cp-pricing' , [
h ( 'div.text-center' , h ( 'a' , {
href : accounts . upgradeURL ,
target : '_blank'
} , Msg . _getKey ( 'features_pricing' , [ '5' , '10' , '15' ] ) ) ) ,
h ( 'div.text-center' , Msg . features _emailRequired ) ,
] ) ,
h ( 'ul.list-group.list-group-flush' , [
[ 'reg' , 'storage2' , 'support' , 'supporter' ] . map ( function ( f ) {
console . log ( 'features_f_' + f ) ;
console . log ( 'features_f_' + f + '_note' ) ;
return h ( 'li.list-group-item' , [
h ( 'div.cp-check' ) ,
h ( 'div.cp-content' , [
h ( 'div.cp-feature' , Msg [ 'features_f_' + f ] ) ,
h ( 'div.cp-note' , Msg [ 'features_f_' + f + '_note' ] )
] )
] ) ;
} ) ,
] ) ,
h ( 'div.card-body' , [
h ( 'div.cp-features-register#cp-features-subscribe' , [
premiumButton
] ) ,
LocalStore . isLoggedIn ( ) ? undefined : h ( 'div.cp-note' , Msg . features _f _subscribe _note )
] ) ,
] ) ,
] ) ;
var availableFeatures =
Config . allowSubscriptions ?
[ anonymousFeatures , registeredFeatures , premiumFeatures ] :
[ anonymousFeatures , registeredFeatures ] ;
return h ( 'div#cp-main' , [
Pages . infopageTopbar ( ) ,
h ( 'div.container.cp-container' , [
h ( 'div.row.cp-page-title' , [
h ( 'div.col-12.text-center' , h ( 'h1' , Msg . features _title ) ) ,
] ) ,
h ( 'div.row.cp-container.cp-features-web.justify-content-sm-center' , availableFeatures ) ,
] ) ,
Pages . infopageFooter ( )
] ) ;
} ;
} ) ;