@ -390,7 +390,6 @@ define([
} ,
} ) ;
// XXX remove emailButton
create [ 'email' ] = function ( ) {
var key = 'email' ;
var $div = makeBlock ( key , true ) ; // Msg.admin_emailHint, Msg.admin_emailTitle
@ -401,7 +400,7 @@ define([
value : ApiConfig . adminEmail || ''
} ) ;
var $input = $ ( input ) ;
var innerDiv = h ( 'div.cp-admin-set limit-form', input ) ;
var innerDiv = h ( 'div.cp-admin-set ter.cp-admin-set limit-form', input ) ;
var spinner = UI . makeSpinner ( $ ( innerDiv ) ) ;
$button . click ( function ( ) {
@ -434,24 +433,24 @@ define([
var val = APP . instanceStatus [ attr ] ;
var type = typeof ( val ) ;
switch ( type ) {
case 'string' : return val ;
case 'object' : return val . default ;
default : return ;
case 'string' : return val || '' ;
case 'object' : return val . default || '' ;
default : return '' ;
}
} ;
create [ 'jurisdiction' ] = function ( ) { // XXX make translateable
create [ 'jurisdiction' ] = function ( ) { // TODO make translateable
var key = 'jurisdiction' ;
var $div = makeBlock ( key , true ) ; // Msg.admin_jurisdictionHint, Msg.admin_jurisdictionTitle, Msg.admin_jurisdictionButton
var $button = $div . find ( 'button' ) . addClass ( 'cp-listing-action' ) . text ( Messages . settings _save ) ;
var input = h ( 'input .cp-listing-info ', {
var input = h ( 'input ', {
type : 'text' ,
value : getInstanceString ( 'instanceJurisdiction' ) || '' , // XXX
value : getInstanceString ( 'instanceJurisdiction' ) ,
placeholder : Messages . owner _unknownUser || '' ,
} ) ;
var $input = $ ( input ) ;
var innerDiv = h ( 'div.cp-admin-set jurisdiction-form ', input ) ;
var innerDiv = h ( 'div.cp-admin-set ter ', input ) ;
var spinner = UI . makeSpinner ( $ ( innerDiv ) ) ;
$button . click ( function ( ) {
@ -480,19 +479,19 @@ define([
} ;
create [ 'notice' ] = function ( ) { // XXX make translateable
create [ 'notice' ] = function ( ) { // TODO make translateable
var key = 'notice' ;
var $div = makeBlock ( key , true ) ;
var $button = $div . find ( 'button' ) . addClass ( 'cp-listing-action' ) . text ( Messages . settings _save ) ;
var input = h ( 'input .cp-listing-info ', {
var input = h ( 'input ', {
type : 'text' ,
value : getInstanceString ( 'instanceNotice' ) || '' , // XXX
value : getInstanceString ( 'instanceNotice' ) ,
placeholder : '' ,
} ) ;
var $input = $ ( input ) ;
var innerDiv = h ( 'div.cp-admin-set no tic e-fo rm ', input ) ;
var innerDiv = h ( 'div.cp-admin-set ter', input ) ;
var spinner = UI . makeSpinner ( $ ( innerDiv ) ) ;
$button . click ( function ( ) {
@ -529,20 +528,20 @@ define([
) ) ;
} ;
create [ 'name' ] = function ( ) { // XXX make translateable
create [ 'name' ] = function ( ) { // TODO make translateable
var key = 'name' ;
var $div = makeBlock ( key , true ) ;
// Msg.admin_nameHint, Msg.admin_nameTitle, Msg.admin_nameButton
var $button = $div . find ( 'button' ) . addClass ( 'cp-listing-action' ) . text ( Messages . settings _save ) ;
var input = h ( 'input .cp-listing-info ', {
var input = h ( 'input ', {
type : 'text' ,
value : getInstanceString ( 'instanceName' ) || ApiConfig . httpUnsafeOrigin || '' ,
placeholder : ApiConfig . httpUnsafeOrigin ,
style : 'margin-bottom: 5px;' ,
} ) ;
var $input = $ ( input ) ;
var innerDiv = h ( 'div.cp-admin-set name-form ', input ) ;
var innerDiv = h ( 'div.cp-admin-set ter ', input ) ;
var spinner = UI . makeSpinner ( $ ( innerDiv ) ) ;
$button . click ( function ( ) {
@ -570,19 +569,19 @@ define([
return $div ;
} ;
create [ 'description' ] = function ( ) { // XXX support translation
create [ 'description' ] = function ( ) { // TODO support translation
var key = 'description' ;
var $div = makeBlock ( key , true ) ; // Msg.admin_descriptionHint
var textarea = h ( 'textarea.cp-admin-description-text .cp-listing-info ', {
var textarea = h ( 'textarea.cp-admin-description-text ', {
placeholder : Messages . home _host || '' ,
} , getInstanceString ( 'instanceDescription' ) || '' ) ;
} , getInstanceString ( 'instanceDescription' ) ) ;
var $button = $div . find ( 'button' ) . text ( Messages . settings _save ) ;
$button . addClass ( 'cp-listing-action' ) ;
var innerDiv = h ( 'div.cp-admin-set description-form ', [
var innerDiv = h ( 'div.cp-admin-set ter ', [
textarea ,
] ) ;
$button . before ( innerDiv ) ;
@ -1470,7 +1469,7 @@ define([
} ;
create [ 'broadcast' ] = function ( ) { // XXX
create [ 'broadcast' ] = function ( ) {
var key = 'broadcast' ;
var $div = makeBlock ( key ) ; // Msg.admin_broadcastHint, admin_broadcastTitle
@ -2341,20 +2340,6 @@ define([
if ( ! Array . isArray ( data ) ) { return void cb ( 'EINVAL' ) ; }
APP . instanceStatus = data [ 0 ] ;
console . log ( "Status" , APP . instanceStatus ) ;
/ *
var isListed = Boolean ( APP . instanceStatus . listMyInstance ) ;
var $actions = $ ( '.cp-listing-action' ) ;
var $fields = $ ( '.cp-listing-info' ) ;
if ( isListed ) {
$actions . removeAttr ( 'disabled' ) ;
$fields . removeAttr ( 'disabled' ) ;
} else {
$actions . attr ( 'disabled' , 'disabled' ) ;
$fields . attr ( 'disabled' , 'disabled' ) ;
}
* /
cb ( ) ;
} ) ;
} ;