|
|
@ -131,6 +131,7 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var createIndentUnitSelector = function (obj) {
|
|
|
|
var createIndentUnitSelector = function (obj) {
|
|
|
|
var proxy = obj.proxy;
|
|
|
|
var proxy = obj.proxy;
|
|
|
|
|
|
|
|
proxy.settings = proxy.settings || {};
|
|
|
|
|
|
|
|
|
|
|
|
var $div = $('<div>', {
|
|
|
|
var $div = $('<div>', {
|
|
|
|
'class': 'indentUnit element'
|
|
|
|
'class': 'indentUnit element'
|
|
|
@ -148,26 +149,28 @@ define([
|
|
|
|
}).on('change', function () {
|
|
|
|
}).on('change', function () {
|
|
|
|
var val = parseInt($input.val());
|
|
|
|
var val = parseInt($input.val());
|
|
|
|
if (typeof(val) !== 'number') { return; }
|
|
|
|
if (typeof(val) !== 'number') { return; }
|
|
|
|
proxy['cryptpad.indentUnit'] = val;
|
|
|
|
proxy.settings.indentUnit = val;
|
|
|
|
}).appendTo($inputBlock);
|
|
|
|
}).appendTo($inputBlock);
|
|
|
|
|
|
|
|
|
|
|
|
proxy.on('change', [ 'cryptpad.indentUnit', ], function (o, n) { $input.val(n); });
|
|
|
|
proxy.on('change', [ 'settings', 'indentUnit', ], function (o, n) { $input.val(n); });
|
|
|
|
|
|
|
|
|
|
|
|
Cryptpad.getAttribute('indentUnit', function (e, val) {
|
|
|
|
//Cryptpad.getAttribute('indentUnit', function (e, val) {
|
|
|
|
if (e) { return void console.error(e); }
|
|
|
|
//if (e) { return void console.error(e); }
|
|
|
|
|
|
|
|
var val = proxy.settings.indentUnit;
|
|
|
|
if (typeof(val) !== 'number') {
|
|
|
|
if (typeof(val) !== 'number') {
|
|
|
|
$input.val(2);
|
|
|
|
$input.val(2);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$input.val(val);
|
|
|
|
$input.val(val);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
//});
|
|
|
|
return $div;
|
|
|
|
return $div;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var createIndentTypeSelector = function (obj) {
|
|
|
|
var createIndentTypeSelector = function (obj) {
|
|
|
|
var proxy = obj.proxy;
|
|
|
|
var proxy = obj.proxy;
|
|
|
|
|
|
|
|
proxy.settings = proxy.settings || {};
|
|
|
|
|
|
|
|
|
|
|
|
var key = 'cryptpad.indentWithTabs';
|
|
|
|
var key = 'indentWithTabs';
|
|
|
|
|
|
|
|
|
|
|
|
var $div = $('<div>', {
|
|
|
|
var $div = $('<div>', {
|
|
|
|
'class': 'indentType element'
|
|
|
|
'class': 'indentType element'
|
|
|
@ -184,11 +187,11 @@ define([
|
|
|
|
}).on('change', function () {
|
|
|
|
}).on('change', function () {
|
|
|
|
var val = $input.is(':checked');
|
|
|
|
var val = $input.is(':checked');
|
|
|
|
if (typeof(val) !== 'boolean') { return; }
|
|
|
|
if (typeof(val) !== 'boolean') { return; }
|
|
|
|
proxy[key] = val;
|
|
|
|
proxy.settings[key] = val;
|
|
|
|
}).appendTo($inputBlock);
|
|
|
|
}).appendTo($inputBlock);
|
|
|
|
|
|
|
|
|
|
|
|
$input[0].checked = !!proxy[key];
|
|
|
|
$input[0].checked = !!proxy.settings[key];
|
|
|
|
proxy.on('change', [key], function (o, n) { $input[0].checked = !!n; });
|
|
|
|
proxy.on('change', ['settings', key], function (o, n) { $input[0].checked = !!n; });
|
|
|
|
|
|
|
|
|
|
|
|
return $div;
|
|
|
|
return $div;
|
|
|
|
};
|
|
|
|
};
|
|
|
|