-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathscript.js
27 lines (18 loc) · 822 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function outputUpdate() {
$("#outputContent").contents().find("html").html("<html><head><style type='text/css'>" + $("#cssContent").val() + "</style></head><body>" + $("#htmlContent").val() + "</body></html>");
document.getElementById("outputContent").contentWindow.eval($("#jsContent").val());
}
$(".Btn").click(function () {
var panelId = $(this).attr("id") + "Content";
$("#" + panelId).toggleClass("hidden");
var panelsActive = 4 - $(".hidden").length;
$(".panel").width(($(window).width() / panelsActive) - 21);
});
// On Page load
$(".panel").height($(window).height() - $("#navBar").height() - 48);
$(".panel").width(($(window).width() / 2) - 21);
outputUpdate();
// on change on any textarea
$("textarea").on('change keyup paste', function () {
outputUpdate();
});