-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
37 lines (23 loc) · 1020 Bytes
/
index.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
28
29
30
31
32
33
34
35
36
37
function update(){
$("iframe").contents().find("html").html("<html><head><style type='text/css'>" + $("#cssPanel").val() + "</style></head><body>" + $("#htmlPanel").val() + "</body></html>");
document.getElementById("outputPanel").contentWindow.eval($("#javascriptPanel").val());
}
$(".togglebutton").hover(function(){
$(this).addClass("highlightedButton");
}, function() {
$(this).removeClass("highlightedButton");
});
$(".togglebutton").click(function(){
$(this).toggleClass("active");
$(this).removeClass("highlightedButton");
var panelId = $(this).attr("id") + "Panel";
$("#" + panelId).toggleClass("hidden");
var numberOfActivePanels = $(".hidden").length;
$(".panel").width(($(window).width()/(4 - numberOfActivePanels)) - 10);
});
$("textarea").height($(window).height()-$("#header").height()+1);
$(".panel").width(($(window).width()/2)-10);
update();
$("textarea").on('change keyup paste',function(){
update();
});