As a suggestion. Two ways to make your font size setting more concise.
If you're married to the current space-bearing names:
var settingFontSizeNames = ["15 px", "16 px", "17 px", "18 px", "19 px", "20 px", "21 px"];
var settingFontSizeHandler = function () {
var pxSize = Number.parseInt(settings.font_size, 10);
$("#story").css("font-size", pxSize + "px");
};
Setting.addList("font_size", {
label : "Font size:",
list : settingFontSizeNames,
onInit : settingFontSizeHandler,
onChange : settingFontSizeHandler,
default : "18 px"
});
Or, if ditching the space within the names would be acceptable:
var settingFontSizeNames = ["15px", "16px", "17px", "18px", "19px", "20px", "21px"];
var settingFontSizeHandler = function () {
$("#story").css("font-size", settings.font_size);
};
Setting.addList("font_size", {
label : "Font size:",
list : settingFontSizeNames,
onInit : settingFontSizeHandler,
onChange : settingFontSizeHandler,
default : "18px"
});