@ -53,14 +53,18 @@ define([
'general' : [ // Msg.admin_cat_general
'general' : [ // Msg.admin_cat_general
'cp-admin-flush-cache' ,
'cp-admin-flush-cache' ,
'cp-admin-update-limit' ,
'cp-admin-update-limit' ,
'cp-admin-archive' ,
'cp-admin-unarchive' ,
'cp-admin-registration' ,
'cp-admin-registration' ,
'cp-admin-email' ,
'cp-admin-email' ,
'cp-admin-name' ,
'cp-admin-description' ,
'cp-admin-jurisdiction' ,
] ,
] ,
'quota' : [ // Msg.admin_cat_quota
'quota' : [ // Msg.admin_cat_quota
'cp-admin-defaultlimit' ,
'cp-admin-defaultlimit' ,
'cp-admin-setlimit' ,
'cp-admin-setlimit' ,
'cp-admin-archive' ,
'cp-admin-unarchive' ,
'cp-admin-getquota' ,
'cp-admin-getquota' ,
'cp-admin-getlimits' ,
'cp-admin-getlimits' ,
] ,
] ,
@ -93,10 +97,6 @@ define([
//'cp-admin-provide-aggregate-statistics',
//'cp-admin-provide-aggregate-statistics',
'cp-admin-list-my-instance' ,
'cp-admin-list-my-instance' ,
'cp-admin-name' ,
'cp-admin-description' ,
'cp-admin-jurisdiction' ,
'cp-admin-consent-to-contact' ,
'cp-admin-consent-to-contact' ,
'cp-admin-remove-donate-button' ,
'cp-admin-remove-donate-button' ,
'cp-admin-instance-purpose' ,
'cp-admin-instance-purpose' ,
@ -151,8 +151,6 @@ define([
return $div ;
return $div ;
} ;
} ;
Messages . admin _archiveReason = "// XXX REASON" ; // XXX
var archiveForm = function ( archive , $div , $button ) {
var archiveForm = function ( archive , $div , $button ) {
var label = h ( 'label' , { for : 'cp-admin-archive' } , Messages . admin _archiveInput ) ;
var label = h ( 'label' , { for : 'cp-admin-archive' } , Messages . admin _archiveInput ) ;
var input = h ( 'input#cp-admin-archive' , {
var input = h ( 'input#cp-admin-archive' , {
@ -168,11 +166,10 @@ define([
} ) ;
} ) ;
var input3 = h ( 'input' , {
var input3 = h ( 'input' , {
id : 'cp-admin-archive-reason' ,
id : 'cp-admin-archive-reason' ,
placeholder : Messages . admin _archiveReason ,
} ) ;
} ) ;
var label3 = h ( 'label' , {
var label3 = h ( 'label' , {
for : 'cp-admin-archive-reason' ,
for : 'cp-admin-archive-reason' ,
} , Messages . admin _archive Reason ) ;
} , Messages . admin _archive Note ) ;
var $pw = $ ( input2 ) ;
var $pw = $ ( input2 ) ;
$pw . addClass ( 'cp-admin-pw' ) ;
$pw . addClass ( 'cp-admin-pw' ) ;
@ -377,8 +374,8 @@ define([
create [ 'email' ] = function ( ) {
create [ 'email' ] = function ( ) {
var key = 'email' ;
var key = 'email' ;
var $div = makeBlock ( key , true ) ; // Msg.admin_emailHint, Msg.admin_emailTitle, Msg.admin_emailButton
var $div = makeBlock ( key , true ) ; // Msg.admin_emailHint, Msg.admin_emailTitle, Msg.admin_emailButton // XXX drop 'emailButton'
var $button = $div . find ( 'button' ) ;
var $button = $div . find ( 'button' ) .text ( Messages . settings _save ) ;
var input = h ( 'input' , {
var input = h ( 'input' , {
type : 'email' ,
type : 'email' ,
@ -414,15 +411,10 @@ define([
return $div ;
return $div ;
} ;
} ;
Messages . admin _jurisdictionHint = 'Jurisdiction hint' ; // XXX
Messages . admin _jurisdictionTitle = 'Jurisdiction title' ; // XXX
Messages . admin _jurisdictionButton = 'Jurisdiction button' ; // XXX
Messages . admin _jurisdictionPlaceholder = 'Jurisdiction placeholder' ; // XXX
create [ 'jurisdiction' ] = function ( ) {
create [ 'jurisdiction' ] = function ( ) {
var key = 'jurisdiction' ;
var key = 'jurisdiction' ;
var $div = makeBlock ( key , true ) ; // Msg.admin_jurisdictionHint, Msg.admin_jurisdictionTitle, Msg.admin_jurisdictionButton
var $div = makeBlock ( key , true ) ; // Msg.admin_jurisdictionHint, Msg.admin_jurisdictionTitle, Msg.admin_jurisdictionButton
var $button = $div . find ( 'button' ) . addClass ( 'cp-listing-action' ) ;
var $button = $div . find ( 'button' ) . addClass ( 'cp-listing-action' ) . text ( Messages . settings _save ) ;
var input = h ( 'input.cp-listing-info' , {
var input = h ( 'input.cp-listing-info' , {
type : 'text' ,
type : 'text' ,
@ -434,12 +426,12 @@ define([
var spinner = UI . makeSpinner ( $ ( innerDiv ) ) ;
var spinner = UI . makeSpinner ( $ ( innerDiv ) ) ;
$button . click ( function ( ) {
$button . click ( function ( ) {
if ( ! $input . val ( ) ) { return ; }
if ( ! $input . val ( ) ) { return ; } // XXX
spinner . spin ( ) ;
spinner . spin ( ) ;
$button . attr ( 'disabled' , 'disabled' ) ;
$button . attr ( 'disabled' , 'disabled' ) ;
sFrameChan . query ( 'Q_ADMIN_RPC' , {
sFrameChan . query ( 'Q_ADMIN_RPC' , {
cmd : 'ADMIN_DECREE' ,
cmd : 'ADMIN_DECREE' ,
data : [ 'SET_INSTANCE_JURISDICTION' , [ $input . val ( ) ] ] // XXX not implemented
data : [ 'SET_INSTANCE_JURISDICTION' , [ $input . val ( ) ] ] // XXX
} , function ( e , response ) {
} , function ( e , response ) {
$button . removeAttr ( 'disabled' ) ;
$button . removeAttr ( 'disabled' ) ;
if ( e || response . error ) {
if ( e || response . error ) {
@ -450,7 +442,7 @@ define([
return ;
return ;
}
}
spinner . done ( ) ;
spinner . done ( ) ;
UI . log ( Messages . saved) ;
UI . log ( Messages . _getKey( 'ui_ saved', [ Messages . admin _jurisdictionTitle ] ) ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -459,21 +451,16 @@ define([
return $div ;
return $div ;
} ;
} ;
Messages . admin _nameHint = 'instance name hint' ; // XXX
Messages . admin _nameTitle = 'instance name title' ; // XXX
Messages . admin _nameButton = 'instance name button' ; // XXX
Messages . admin _namePlaceholder = 'instance name placeholder' ; // XXX
create [ 'name' ] = function ( ) {
create [ 'name' ] = function ( ) {
var key = 'name' ;
var key = 'name' ;
var $div = makeBlock ( key , true ) ;
var $div = makeBlock ( key , true ) ;
// Msg.admin_nameHint, Msg.admin_nameTitle, Msg.admin_nameButton
// Msg.admin_nameHint, Msg.admin_nameTitle, Msg.admin_nameButton
var $button = $div . find ( 'button' ) . addClass ( 'cp-listing-action' ) ;
var $button = $div . find ( 'button' ) . addClass ( 'cp-listing-action' ) . text ( Messages . settings _save ) ;
var input = h ( 'input.cp-listing-info' , {
var input = h ( 'input.cp-listing-info' , {
type : 'text' ,
type : 'text' ,
value : APP . instanceStatus . instanceName || '' ,
value : APP . instanceStatus . instanceName || ApiConfig . httpUnsafeOrigin || '' ,
placeholder : Messages . admin _namePlaceholder ,
placeholder : ApiConfig. httpUnsafeOrigin , // Messages.admin_namePlaceholder, // XXX
style : 'margin-bottom: 5px;' ,
style : 'margin-bottom: 5px;' ,
} ) ;
} ) ;
var $input = $ ( input ) ;
var $input = $ ( input ) ;
@ -481,7 +468,7 @@ define([
var spinner = UI . makeSpinner ( $ ( innerDiv ) ) ;
var spinner = UI . makeSpinner ( $ ( innerDiv ) ) ;
$button . click ( function ( ) {
$button . click ( function ( ) {
if ( ! $input . val ( ) ) { return ; }
if ( ! $input . val ( ) ) { return ; } // XXX
spinner . spin ( ) ;
spinner . spin ( ) ;
$button . attr ( 'disabled' , 'disabled' ) ;
$button . attr ( 'disabled' , 'disabled' ) ;
sFrameChan . query ( 'Q_ADMIN_RPC' , {
sFrameChan . query ( 'Q_ADMIN_RPC' , {
@ -497,7 +484,7 @@ define([
return ;
return ;
}
}
spinner . done ( ) ;
spinner . done ( ) ;
UI . log ( Messages . saved) ;
UI . log ( Messages . _getKey( 'ui_ saved', [ Messages . admin _nameTitle ] ) ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -506,21 +493,15 @@ define([
return $div ;
return $div ;
} ;
} ;
Messages . admin _descriptionHint = 'Description hint' ; // XXX
Messages . admin _descriptionTitle = 'Description title' ; // XXX
Messages . admin _descriptionButton = 'Description button' ; // XXX
Messages . admin _descriptionPlaceholder = 'Description placeholder' ; // XXX
create [ 'description' ] = function ( ) {
create [ 'description' ] = function ( ) {
var key = 'description' ;
var key = 'description' ;
var $div = makeBlock ( key , true ) ;
var $div = makeBlock ( key , true ) ;
var textarea = h ( 'textarea.cp-admin-description-text.cp-listing-info' , { // XXX use something from UI elements?
var textarea = h ( 'textarea.cp-admin-description-text.cp-listing-info' , { // XXX use something from UI elements?
placeholder : Messages . admin_descriptionPlaceholder ,
placeholder : Messages . home _host || '' , // XXX
} , APP . instanceStatus . instanceDescription || '' ) ;
} , APP . instanceStatus . instanceDescription || '' ) ;
var $button = $div . find ( 'button' ) ;
var $button = $div . find ( 'button' ) .text ( Messages . settings _save ) ;
$button . addClass ( 'cp-listing-action' ) ;
$button . addClass ( 'cp-listing-action' ) ;
@ -535,7 +516,7 @@ define([
var spinner = UI . makeSpinner ( $ ( innerDiv ) ) ;
var spinner = UI . makeSpinner ( $ ( innerDiv ) ) ;
$button . click ( function ( ) {
$button . click ( function ( ) {
if ( ! $input . val ( ) ) { return ; }
if ( ! $input . val ( ) ) { return ; } // XXX
spinner . spin ( ) ;
spinner . spin ( ) ;
$button . attr ( 'disabled' , 'disabled' ) ;
$button . attr ( 'disabled' , 'disabled' ) ;
sFrameChan . query ( 'Q_ADMIN_RPC' , {
sFrameChan . query ( 'Q_ADMIN_RPC' , {
@ -551,7 +532,7 @@ define([
return ;
return ;
}
}
spinner . done ( ) ;
spinner . done ( ) ;
UI . log ( Messages . saved) ;
UI . log ( Messages . _getKey( 'ui_ saved', [ Messages . admin _descriptionTitle ] ) ) ;
} ) ;
} ) ;
} ) ;
} ) ;