-
Notifications
You must be signed in to change notification settings - Fork 0
/
screen_config_24_Sep.html
206 lines (171 loc) · 5.25 KB
/
screen_config_24_Sep.html
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<html>
<head>
<h2>Configure your Billing Screen</h2>
<style>
body {font-family: Arial, Helvetica, sans-serif;}
* {box-sizing: border-box;}
/* Button used to open the contact form - fixed at the bottom of the page */
.open-button {
background-color: #555;
color: white;
padding: 16px 20px;
border: none;
cursor: pointer;
opacity: 0.8;
position: fixed;
bottom: 23px;
right: 28px;
width: 280px;
}
/* The popup form - hidden by default */
.form-popup {
display: block;
position: absolute;
cursor: move;
top: 200;
bottom: 0;
right: 15px;
border: 3px solid #f1f1f1;
z-index: 9;
}
#form-header {
padding: 10px;
max-width: 300px;
cursor: move;
z-index: 10;
background-color: #2196F3;
color: #fff;
}
/* Add styles to the form container */
.form-container {
max-width: 300px;
padding: 10px;
background-color: white;
}
/* Full-width input fields */
.form-container input[type=text], .form-container input[type=password] {
width: 100%;
padding: 15px;
margin: 5px 0 22px 0;
border: none;
background: #f1f1f1;
}
/* When the inputs get focus, do something */
.form-container input[type=text]:focus, .form-container input[type=password]:focus {
background-color: #ddd;
outline: none;
}
/* Set a style for the submit/login button */
.form-container .btn {
background-color: #4CAF50;
color: white;
padding: 16px 20px;
border: none;
cursor: pointer;
width: 100%;
margin-bottom:10px;
opacity: 0.8;
}
/* Add a red background color to the cancel button */
.form-container .cancel {
background-color: red;
}
/* Add some hover effects to buttons */
.form-container .btn:hover, .open-button:hover {
opacity: 1;
}
</style>
</head>
<body>
<img alt="My Image" ismap" id='backImg'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
var up_file=(vars['up_file'])
console.log(up_file)
document.getElementById('backImg').src='/static/Uploaded_Images/'+up_file
//document.getElementById("backImg").src = up_file;
</script>
<script type="text/javascript">
$(document).ready(function() {
$("img").on("click", function(event) {
var x = event.pageX - this.offsetLeft;
var y = event.pageY - this.offsetTop;
document.getElementById(focusedId).value=x+";"+y;
console.log(document.getElementById(focusedId).value);
//alert("X Coordinate: " + x + " Y Coordinate: " + y);
});
});
</script>
<body>
<button class="open-button" onclick="openForm()">Open Form</button>
<div class="form-popup" id="headerForm">
<div id="form-header">Click here to move</div>
<form method=post class="form-container">
<h1>Set Co-Ordinates</h1>
<label for="item"><b>Item</b></label>
<input type="text" placeholder="0" name="item" id="item" onfocus="focusFunction(this.id)" required>
<label for="price"><b>Price</b></label>
<input type="text" placeholder="0" name="price" id="price" onfocus="focusFunction(this.id)" required>
<label for="qty"><b>Quantity</b></label>
<input type="text" placeholder="0" name="qty" id="qty" onfocus="focusFunction(this.id)" required>
<label for="amount"><b>Amount</b></label>
<input type="text" placeholder="0" name="amount" id="amount" onfocus="focusFunction(this.id)"required>
<button type="submit" class="btn">Set Co-Ordinates</button>
<button type="button" class="btn cancel" onclick="closeForm()">Close</button>
</form>
</div>
<script>
function openForm() {
document.getElementById("headerForm").style.display = "block";
}
function closeForm() {
document.getElementById("headerForm").style.display = "none";
}
function focusFunction(id) {
{focusedId=id}
};
dragElement(document.getElementById("headerForm"));
function dragElement(elmnt) {
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
if (document.getElementById("form-header")) {
// if present, the header is where you move the DIV from:
document.getElementById("form-header").onmousedown = dragMouseDown;
} else {
// otherwise, move the DIV from anywhere inside the DIV:
elmnt.onmousedown = dragMouseDown;
}
function dragMouseDown(e) {
e = e || window.event;
e.preventDefault();
// get the mouse cursor position at startup:
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = closeDragElement;
// call a function whenever the cursor moves:
document.onmousemove = elementDrag;
}
function elementDrag(e) {
e = e || window.event;
e.preventDefault();
// calculate the new cursor position:
pos1 = pos3 - e.clientX;
pos2 = pos4 - e.clientY;
pos3 = e.clientX;
pos4 = e.clientY;
// set the element's new position:
elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
}
function closeDragElement() {
// stop moving when mouse button is released:
document.onmouseup = null;
document.onmousemove = null;
}
}
</script>
</body>
</html>