1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
---|
2 | <HTML> |
---|
3 | <HEAD> |
---|
4 | <script type="text/javascript" src="jscripts/wz_jsgraphics.js"></script> |
---|
5 | <script type="text/javascript" src="jscripts/EditorContent.js"></script> |
---|
6 | <style> |
---|
7 | <!-- |
---|
8 | .crop{cursor:crosshair;} |
---|
9 | .selection{ |
---|
10 | border: dotted 1px #000000; |
---|
11 | position:absolute; |
---|
12 | width: 0px; |
---|
13 | height: 1px; |
---|
14 | z-index:5; |
---|
15 | } |
---|
16 | .selectionWhite{ |
---|
17 | border: dotted 1px #FFFFFF; |
---|
18 | position:absolute; |
---|
19 | width: 0px; |
---|
20 | height: 1px; |
---|
21 | z-index:5; |
---|
22 | } |
---|
23 | .handleBox{ |
---|
24 | z-index:105; |
---|
25 | } |
---|
26 | |
---|
27 | --> |
---|
28 | </style> |
---|
29 | <script type="text/javascript"> |
---|
30 | |
---|
31 | var t_cx = MM_findObj('cx', window.top.document); |
---|
32 | var t_cy = MM_findObj('cy', window.top.document); |
---|
33 | var t_cw = MM_findObj('cw', window.top.document); |
---|
34 | var t_ch = MM_findObj('ch', window.top.document); |
---|
35 | |
---|
36 | var m_sx = MM_findObj('sx', window.top.document); |
---|
37 | var m_sy = MM_findObj('sy', window.top.document); |
---|
38 | var m_w = MM_findObj('mw', window.top.document); |
---|
39 | var m_h = MM_findObj('mh', window.top.document); |
---|
40 | var m_a = MM_findObj('ma', window.top.document); |
---|
41 | var m_d = MM_findObj('md', window.top.document); |
---|
42 | |
---|
43 | var s_sw = MM_findObj('sw', window.top.document); |
---|
44 | var s_sh = MM_findObj('sh', window.top.document); |
---|
45 | |
---|
46 | var r_ra = MM_findObj('ra', window.top.document); |
---|
47 | |
---|
48 | var mode = "<? echo $action; ?>" //crop, scale, measure |
---|
49 | var pattern = "2x2.gif"; |
---|
50 | |
---|
51 | function doSubmit(action) |
---|
52 | { |
---|
53 | var image = escape("<? echo $path.$image; ?>"); |
---|
54 | |
---|
55 | if (action == 'crop') |
---|
56 | { |
---|
57 | |
---|
58 | var url = "load_image.php?img="+image+"&action=crop¶ms="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value); |
---|
59 | |
---|
60 | //alert(url); |
---|
61 | location.href = url; |
---|
62 | |
---|
63 | //location.reload(); |
---|
64 | } |
---|
65 | else if (action == 'scale') |
---|
66 | { |
---|
67 | var url = "load_image.php?img="+image+"&action=scale¶ms="+parseInt(s_sw.value)+','+parseInt(s_sh.value); |
---|
68 | //alert(url); |
---|
69 | location.href = url; |
---|
70 | |
---|
71 | } |
---|
72 | else if (action == 'rotate') |
---|
73 | { |
---|
74 | var flip = MM_findObj('flip', window.top.document); |
---|
75 | |
---|
76 | if(flip.value == 'hoz' || flip.value == 'ver') |
---|
77 | location.href = "load_image.php?img="+image+"&action=flip¶ms="+flip.value; |
---|
78 | else if (isNaN(parseFloat(r_ra.value))==false) |
---|
79 | location.href = "load_image.php?img="+image+"&action=rotate¶ms="+parseFloat(r_ra.value); |
---|
80 | } |
---|
81 | else if(action == 'save') { |
---|
82 | var s_file = MM_findObj('save_filename', window.top.document); |
---|
83 | var s_format = MM_findObj('save_format', window.top.document); |
---|
84 | var s_quality = MM_findObj('quality',window.top.document); |
---|
85 | |
---|
86 | var format = s_format.value.split(","); |
---|
87 | if(s_file.value.length <= 0) { |
---|
88 | alert('Please enter a filename to save.'); |
---|
89 | } |
---|
90 | else |
---|
91 | { |
---|
92 | var filename = escape(s_file.value); |
---|
93 | var quality = parseInt(s_quality.value); |
---|
94 | var url = "load_image.php?img="+image+"&action=save¶ms="+format[0]+","+quality+"&file="+filename; |
---|
95 | //alert(url); |
---|
96 | location.href = url; |
---|
97 | } |
---|
98 | } |
---|
99 | } |
---|
100 | |
---|
101 | |
---|
102 | </script> |
---|
103 | </HEAD> |
---|
104 | |
---|
105 | <BODY bgcolor="#CCCCCC" onLoad="init();"> |
---|
106 | <div id="status"></div> |
---|
107 | <div id="ant" class="selection" style="visibility:hidden"><IMG SRC="spacer.gif" WIDTH="0" HEIGHT="0" BORDER="0" ALT="" id="cropContent"></div> |
---|
108 | <table cellpadding="0" cellspacing="0" width="100%" height="100%"> |
---|
109 | <Tr height="100%"> |
---|
110 | <Td align="center" height="100%"> |
---|
111 | <span id="imgCanvas" class="crop"><IMG SRC="<? echo $path.$image; ?>" <? echo $dimensions; ?> BORDER=0 ALT="" id="theImage" name="theImage"></span> |
---|
112 | </td> |
---|
113 | </tr> |
---|
114 | </table> |
---|
115 | <script type="text/javascript"> |
---|
116 | <!-- |
---|
117 | |
---|
118 | var jg_doc = new jsGraphics("imgCanvas"); // draw directly into document |
---|
119 | jg_doc.setColor("#000000"); // black |
---|
120 | |
---|
121 | <? |
---|
122 | if(isset($save_file) && is_file($BASE_DIR.$path.$save_file)) { |
---|
123 | echo "alert('$save_file saved')"; |
---|
124 | } |
---|
125 | |
---|
126 | ?> |
---|
127 | |
---|
128 | //--> |
---|
129 | </script> |
---|
130 | </BODY> |
---|
131 | </HTML> |
---|