-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.js
81 lines (81 loc) · 2.59 KB
/
init.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
72
73
74
75
76
77
78
79
80
81
function init(){
$( "a#rect" ).click( function( e ){
if( select_shape != undefined ){
select_shape.bounds.length = 0;
select_shape.unStroke();
// select_shape = undefined;
}
global_color = undefined;
active_tool = "rectangle";
if( select_shape && select_shape.id == 1 )
select_shape.bounds.length = 0;
return false;
});
$( "a#select" ).click( function( e ){
if( select_shape != undefined ){
select_shape.bounds.length = 0;
// select_shape = undefined;
}
global_color = undefined;
active_tool = "select";
if( select_shape )
select_shape.bounds.length = 0;
return false;
});
$( "a#resize" ).click( function( e ){
if( select_shape != undefined ){
select_shape.bounds.length = 0;
// select_shape = undefined;
}
global_color = undefined;
active_tool = "resize";
if( select_shape != undefined )
draw_bounds( select_shape.id );
else
alert( "You must select a shape.\n" );
return false;
});
$( "a#line" ).click( function( e ){
if( select_shape != undefined ){
select_shape.bounds.length = 0;
select_shape.unStroke();
// select_shape = undefined;
}
global_color = undefined;
active_tool = "line";
return false;
});
$( "a#fhand" ).click( function( e ){
if( select_shape != undefined ){
select_shape.bounds.length = 0;
select_shape.unStroke();
// select_shape = undefined;
}
global_color = undefined;
active_tool = "fhand";
return false;
});
$( "a#circle" ).click( function( e ){
if( select_shape != undefined ){
select_shape.bounds.length = 0;
select_shape.unStroke();
// select_shape = undefined;
}
global_color = undefined;
active_tool = "circle";
return false;
});
$( "div#color_tray" ).click( function( e ){
if( select_shape != undefined ){
select_shape.bounds.length = 0;
}
global_color = undefined;
if( select_shape != undefined ){
active_tool = "fill";
global_color = $(event.target).attr( "id" );
}
else{
alert( "you must select a shape.\n" );
}
});
}