@ -294,81 +294,6 @@ define([
return $div ;
} ;
create [ 'registration' ] = function ( ) {
var key = 'registration' ;
var $div = makeBlock ( key ) ; // Msg.admin_registrationHint, .admin_registrationTitle, .admin_registrationButton
var state = APP . instanceStatus . restrictRegistration ;
var $cbox = $ ( UI . createCheckbox ( 'cp-settings-' + key ,
Messages . admin _registrationTitle ,
state , { label : { class : 'noTitle' } } ) ) ;
var spinner = UI . makeSpinner ( $cbox ) ;
var $checkbox = $cbox . find ( 'input' ) . on ( 'change' , function ( ) {
spinner . spin ( ) ;
var val = $checkbox . is ( ':checked' ) || false ;
$checkbox . attr ( 'disabled' , 'disabled' ) ;
sFrameChan . query ( 'Q_ADMIN_RPC' , {
cmd : 'ADMIN_DECREE' ,
data : [ 'RESTRICT_REGISTRATION' , [ val ] ]
} , function ( e , response ) {
if ( e || response . error ) {
UI . warn ( Messages . error ) ;
console . error ( e , response ) ;
}
APP . updateStatus ( function ( ) {
spinner . done ( ) ;
state = APP . instanceStatus . restrictRegistration ;
$checkbox [ 0 ] . checked = state ;
$checkbox . removeAttr ( 'disabled' ) ;
} ) ;
} ) ;
} ) ;
$cbox . appendTo ( $div ) ;
return $div ;
} ;
Messages . admin _disableembedsTitle = "Disable remote embedding" ; // XXX
Messages . admin _disableembedsHint = "Remove options to embed pads and media-tags hosted on third party websites from sharing menus." ; // XXX
//Messages.admin_disableembedsButton = "admin_disableembedsButton";
Messages . admin _cacheEvictionRequired = "XXX YOU MAY NEED TO USE THE 'FLUSH CACHE' BUTTON FOR THIS TO TAKE EFFECT" ; // XXX
create [ 'disableembeds' ] = function ( ) {
var key = 'disableembeds' ;
var $div = makeBlock ( key ) ;
// Msg.admin_disableembedsHint, .admin_disableembedsTitle, .admin_disableembedsButton
var state = APP . instanceStatus . disableEmbedding ;
var $cbox = $ ( UI . createCheckbox ( 'cp-settings-' + key ,
Messages . admin _disableembedsTitle ,
state , { label : { class : 'noTitle' } } ) ) ;
var spinner = UI . makeSpinner ( $cbox ) ;
var $checkbox = $cbox . find ( 'input' ) . on ( 'change' , function ( ) {
spinner . spin ( ) ;
var val = $checkbox . is ( ':checked' ) || false ;
$checkbox . attr ( 'disabled' , 'disabled' ) ;
sFrameChan . query ( 'Q_ADMIN_RPC' , {
cmd : 'ADMIN_DECREE' ,
data : [ 'DISABLE_EMBEDDING' , [ val ] ]
} , function ( e , response ) {
if ( e || response . error ) {
UI . warn ( Messages . error ) ;
console . error ( e , response ) ;
}
APP . updateStatus ( function ( ) {
spinner . done ( ) ;
state = APP . instanceStatus . disableEmbedding ;
$checkbox [ 0 ] . checked = state ;
$checkbox . removeAttr ( 'disabled' ) ;
UI . alert ( Messages . admin _cacheEvictionRequired ) ;
} ) ;
} ) ;
} ) ;
$cbox . appendTo ( $div ) ;
return $div ;
} ;
var makeAdminCheckbox = function ( data ) {
return function ( ) {
var state = data . getState ( ) ;
@ -396,8 +321,17 @@ define([
} ;
} ;
// Msg.admin_registrationHint, .admin_registrationTitle, .admin_registrationButton
create [ 'registration' ] = makeAdminCheckbox ( {
Messages . admin _cacheEvictionRequired = "Your server's internal state has been updated, but you may need to use the 'flush cache' button for clients to experience the intended effect." ; // XXX
Messages . admin _reviewCheckupNotice = "It is also recommended that you review this instance's checkup page to confirm that it is configured correctly." ; // XXX
var flushCacheNotice = function ( ) {
UI . alert ( h ( 'span' , [
h ( 'p' , Messages . admin _cacheEvictionRequired ) ,
h ( 'p' , Messages . admin _reviewCheckupNotice ) ,
] ) ) ;
} ;
// Msg.admin_registrationHint, .admin_registrationTitle
create [ 'registration' ] = makeAdminCheckbox ( { // XXX
key : 'registration' ,
getState : function ( ) {
return APP . instanceStatus . restrictRegistration ;
@ -413,6 +347,32 @@ define([
}
APP . updateStatus ( function ( ) {
setState ( APP . instanceStatus . restrictRegistration ) ;
flushCacheNotice ( ) ;
} ) ;
} ) ;
} ,
} ) ;
Messages . admin _disableembedsTitle = "Disable remote embedding" ; // XXX
Messages . admin _disableembedsHint = "Remove options to embed pads and media-tags hosted on third party websites from sharing menus." ; // XXX
// Msg.admin_disableembedsHint, .admin_disableembedsTitle
create [ 'disableembeds' ] = makeAdminCheckbox ( {
key : 'disableembeds' ,
getState : function ( ) {
return APP . instanceStatus . disableEmbedding ;
} ,
query : function ( val , setState ) {
sFrameChan . query ( 'Q_ADMIN_RPC' , {
cmd : 'ADMIN_DECREE' ,
data : [ 'DISABLE_EMBEDDING' , [ val ] ]
} , function ( e , response ) {
if ( e || response . error ) {
UI . warn ( Messages . error ) ;
console . error ( e , response ) ;
}
APP . updateStatus ( function ( ) {
setState ( APP . instanceStatus . disableEmbedding ) ;
flushCacheNotice ( ) ;
} ) ;
} ) ;
} ,
@ -1999,7 +1959,6 @@ define([
Messages . admin _bytesWrittenTitle = "Disk performance measurement window" ; // XXX
Messages . admin _bytesWrittenHint = "If you have enabled disk performance measurements then the duration of the window can be configured below." ; // XXX
Messages . admin _bytesWrittenDuration = "Duration of the window in milliseconds: {0}" ; // XXX
//Messages.admin_defaultDuration = "admin_defaultDuration"; // XXX
Messages . admin _setDuration = "Set duration" ; // XXX
var isPositiveInteger = function ( n ) {