		console.error(err);
		}
		{{if .ID}}{{else}}if (val != orig) {
			publishing = false;
			$publishBtn.removeClass("no");
			$publishBtn.text("publish");
		} else {
			publishing = true;
			$publishBtn.addClass("no");
			$publishBtn.text("publish" + (!hasBuilt ? " (edit first)" : ""));
		}{{end}}
	}
	var justPublished = false;
	var editor = ace.edit("editor");
	var $view = $('#preview');
	editor.setTheme("ace/theme/chrome");
	editor.session.setMode("ace/mode/html");
	editor.getSession().on('change', updateP