Add custom css slots to prepare for donators feature

This commit is contained in:
Jeremy Zhang
2017-09-11 07:52:13 +00:00
parent 214bbfa162
commit 10b5deffe4
10 changed files with 121 additions and 17 deletions

View File

@ -1,12 +1,20 @@
/*global $, ace, Materialize, newCSS*/
(function () {
var editor = ace.edit("css_editor");
if($("#css_editor").length != 0) {
var editor = ace.edit("css_editor");
}
function postForm() {
var name = $('#css_name').val();
var var_enabled = $("#toggleCSSVar").is(':checked');
var variables = JSON.stringify(formatCSSVars());
var css = editor.getValue();
var css = null;
if($("#css_editor").length != 0) {
css = editor.getValue();
if (css.length == 0) {
css = null;
}
}
var funct = $.ajax({
dataType: "json",
method: "POST",
@ -16,8 +24,10 @@
}
$(function(){
editor.getSession().setMode("ace/mode/css");
editor.setTheme("ace/theme/chrome");
if($("#css_editor").length != 0) {
editor.getSession().setMode("ace/mode/css");
editor.setTheme("ace/theme/chrome");
}
$("#submit-btn").click(submitForm);
if (!newCSS) {