-
Notifications
You must be signed in to change notification settings - Fork 0
/
stylize.js
executable file
·71 lines (64 loc) · 1.8 KB
/
stylize.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var shorten = false;
var lineCol='#23A4FF';
var nodeCol='#333333' ;
var selLineCol= "#111111";
var selNodeCol="#E32D2D";
var bgCol="#FFFFFF";
var labelCol="#FFFFFF";
$(document).ready(function() {
loadSettings();
$("<style type='text/css'> .node { \
background-color:transparent; \
font-weight:bold; \
font-size:11px;\
overflow:hidden; \
color:"+labelCol+"; \
position:absolute; \
text-align:center;\
border:hidden;\
height:30px;\
width:100px;\
-moz-focus-inner { border: 0; }\
} </style>").appendTo("head");
$("#infovis").css("background-color",bgCol);
$("#btn").val(shorten?"on":"off");
$("#btn").attr("class",shorten?"on":"off");
$("#lineColor").val(lineCol);
$("#nodeColor").val(nodeCol);
$("#selLineColor").val(selLineCol);
$("#selNodeColor").val(selNodeCol);
$("#bgColor").val(bgCol);
$("#labelColor").val(labelCol);
for(var i =0;i<$(".colorInput").length;i++){
$('#colorpicker'+$(".colorInput")[i].id).farbtastic("#"+$(".colorInput")[i].id);
}
stylizeBtn("bt","#444","#00aadd","#222");
if(!skip){
var windowHeight = $(window).height()-50;
$("#topframe").height(windowHeight);
$("#midframe").height(1);
document.getElementById("in").focus();
}
$("#cover").fadeOut();
});
function stylizeBtn(classname,normal,hover,active){
$("."+classname).hover(function(){
$(this).animate({ backgroundColor: hover }, 250);
},function() {
$(this).animate({ backgroundColor: normal }, 250);
});
$("."+classname).mousedown(function(){
$(this).css("background-color",active);
});
$("."+classname).mouseup(function(){$(this).css("background-color",hover);
});
}
function togglestyle(el){
if(el.className == "on") {
el.className="off";
el.value="off";
} else {
el.className="on";
el.value="on";
}
}