Subversion Repositories SmartDukaan

Rev

Rev 11240 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11238 kshitij.so 1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<link href="/css/imgareaselect-default.css" type="text/css" rel="stylesheet">
11240 kshitij.so 5
<script type="text/javascript" src="/js/jquery.js"></script>
11238 kshitij.so 6
<script src="/js/jquery.imgareaselect.pack.js" type="text/javascript"></script>
7
<script type="text/javascript">
8
function preview(img, selection) {
9
    if (!selection.width || !selection.height)
10
        return;
11
 
12
    var scaleX = 100 / selection.width;
13
    var scaleY = 100 / selection.height;
14
 
15
    $('#preview img').css({
16
        width: Math.round(scaleX * 300),
17
        height: Math.round(scaleY * 300),
18
        marginLeft: -Math.round(scaleX * selection.x1),
19
        marginTop: -Math.round(scaleY * selection.y1)
20
    });
11244 kshitij.so 21
 
22
	$('#coor').val((Math.round(selection.x1))+','+(Math.round(selection.y1))+','+(Math.round(selection.x2))+','+(Math.round(selection.y2)));
11238 kshitij.so 23
 
24
}
25
 
26
$(function () {
27
    $('#photo').imgAreaSelect({ handles: true,
28
        fadeSpeed: 200, onSelectChange: preview });
29
});
30
</script>
31
</head>
32
<body>
33
<div id="image" style="padding-bottom: 10px">
11244 kshitij.so 34
	<img src='/images/campaignImages/$action.getLink()' id="photo" style="border: 1px solid gray;">
35
</div>
36
<div style="margin-top: 20px;" class="coordinates">
37
<label style="margin-right: 10px;">Coordiates</label>
38
<input type="text" readonly="" id="coor">
39
</div>
11238 kshitij.so 40
</body>
41
</html>