barisusakli 11 years ago
commit 822cf56af1

@ -0,0 +1,23 @@
"use strict";
var admin = {};
(function() {
admin.enableColorPicker = function(inputEl, callback) {
(inputEl instanceof jQuery ? inputEl : $(inputEl)).each(function() {
var $this = $(this);
$this.ColorPicker({
color: $this.val() || '#000',
onChange: function(hsb, hex) {
$this.val('#' + hex);
if (typeof callback === 'function') {
callback(hsb, hex);
}
}
});
});
};
}());

@ -142,10 +142,7 @@ define(['uploader'], function(uploader) {
var $inputEl = $(inputEl),
previewEl = $inputEl.parents('[data-cid]').find('.preview-box');
$inputEl.ColorPicker({
color: $inputEl.val() || '#000',
onChange: function(hsb, hex) {
$inputEl.val('#' + hex);
admin.enableColorPicker($inputEl, function(hsb, hex) {
if ($inputEl.attr('data-name') === 'bgColor') {
previewEl.css('background', '#' + hex);
} else if ($inputEl.attr('data-name') === 'color') {
@ -153,7 +150,6 @@ define(['uploader'], function(uploader) {
}
modified($inputEl[0]);
}
});
}

@ -120,6 +120,8 @@ define(['forum/admin/settings'], function(Settings) {
Themes.prepareWidgets();
populateBranding();
admin.enableColorPicker($('.branding'));
Settings.prepare();
};
@ -320,6 +322,7 @@ define(['forum/admin/settings'], function(Settings) {
});
};
function populateBranding() {
require(['settings'], function (settings) {
var wrapper = $('#branding');
@ -333,6 +336,7 @@ define(['forum/admin/settings'], function(Settings) {
event.preventDefault();
});
});
}
return Themes;
});

@ -155,15 +155,14 @@ var fs = require('fs'),
db.setObject('config', themeData, next);
}
], callback);
Meta.restartRequired = true;
break;
case 'bootswatch':
db.setObjectField('config', 'theme:src', data.src, callback);
Meta.configs.set('theme:src', data.src, callback);
break;
}
// Restart Required flag
Meta.restartRequired = true;
}
};

Loading…
Cancel
Save