index.html (14139B)
1 $def with (films, cameras, menu, selected,name,scene,shot,take,str,randhash,thumb,vumetermessage,func,filmfolder,dsk) 2 3 <script> 4 function Get(yourUrl){ 5 var Httpreq = new XMLHttpRequest(); // a new request 6 Httpreq.open("POST",yourUrl,false); 7 Httpreq.send(null); 8 return Httpreq.responseText; 9 } 10 (function($$) 11 { 12 $$(document).ready(function() 13 { 14 var refreshtime = 1000; 15 var oldrefreshtime = 100; 16 idleTime = 0; 17 //Increment the idle time counter every second. 18 var idleInterval = setInterval(timerIncrement, 1000); 19 function timerIncrement() 20 { 21 idleTime++; 22 if (idleTime > 1) 23 { 24 refreshtime = 1000; 25 } 26 if (oldrefreshtime != refreshtime) 27 { 28 refreshtime = 500; 29 } 30 else 31 { 32 refreshtime = 100; 33 } 34 oldrefreshtime = refreshtime; 35 } 36 37 $$.ajaxSetup( 38 { 39 cache: false, 40 beforeSend: function() { 41 $$('#content').hide(); 42 $$('#loading').show(); 43 }, 44 complete: function() { 45 $$('#loading').hide(); 46 $$('#content').show(); 47 }, 48 success: function() { 49 $$('#loading').hide(); 50 $$('#content').show(); 51 } 52 }); 53 54 var myFunction = function(){ 55 refresh(); 56 console.log(refreshtime); 57 clearInterval(interval); 58 interval = setInterval(myFunction, refreshtime); 59 } 60 var interval = setInterval(myFunction, refreshtime); 61 }); 62 63 function refresh(){ 64 var $$container = $$("#menu2"); 65 $$container.load('/static/menu.html'); 66 $$.ajax({ 67 method: "POST", 68 type: "Content-type", 69 url:"/api", 70 success: function(result) { 71 }, 72 error: function(result) { 73 console.log('error', result); 74 } 75 }) 76 } 77 $$(this).on('keydown', function (event) { 78 idleTime = 0; 79 refreshtime = 10; 80 }); 81 })(jQuery); 82 83 $$(document).on('keydown', function (event) { 84 console.log('error', event.which); 85 if (event.which == 37) { 86 $$('#LEFT').trigger('click'); 87 } else if (event.which == 39) { 88 $$('#RIGHT').trigger('click'); 89 } else if (event.which == 38) { 90 event.preventDefault(); 91 $$('#UP').trigger('click'); 92 } else if (event.which == 40) { 93 event.preventDefault(); 94 $$('#DOWN').trigger('click'); 95 } else if (event.which == 33) { 96 event.preventDefault(); 97 $$('#RECORD').trigger('click'); 98 } else if (event.which == 32) { 99 event.preventDefault(); 100 $$('#RECORD').trigger('click'); 101 } else if (event.which == 34) { 102 event.preventDefault(); 103 $$('#RETAKE').trigger('click'); 104 } else if (event.which == 9) { 105 event.preventDefault(); 106 $$('#VIEW').trigger('click'); 107 } else if (event.which == 46) { 108 $$('#DELETE').trigger('click'); 109 } else if (event.which == 13) { 110 $$('#MIDDLE').trigger('click'); 111 } else if (event.which == 97) { 112 $$('#CAMERA0').trigger('click'); 113 } else if (event.which == 98) { 114 $$('#CAMERA1').trigger('click'); 115 } else if (event.which == 99) { 116 $$('#CAMERA2').trigger('click'); 117 } else if (event.which == 100) { 118 $$('#CAMERA3').trigger('click'); 119 } else if (event.which == 101) { 120 $$('#CAMERA4').trigger('click'); 121 } else if (event.which == 102) { 122 $$('#CAMERA5').trigger('click'); 123 } else if (event.which == 103) { 124 $$('#CAMERA6').trigger('click'); 125 } else if (event.which == 104) { 126 $$('#CAMERA7').trigger('click'); 127 } else if (event.which == 105) { 128 $$('#CAMERA8').trigger('click'); 129 } else if (event.which == 106) { 130 $$('#CAMERA9').trigger('click'); 131 } else if (event.which == 229) { 132 $$('#CAMERA0').trigger('click'); 133 } else if (event.which == 98) { 134 $$('#CAMERA1').trigger('click'); 135 } else if (event.which == 99) { 136 $$('#CAMERA2').trigger('click'); 137 } else if (event.which == 100) { 138 $$('#CAMERA3').trigger('click'); 139 } else if (event.which == 101) { 140 $$('#CAMERA4').trigger('click'); 141 } else if (event.which == 102) { 142 $$('#CAMERA5').trigger('click'); 143 } else if (event.which == 103) { 144 $$('#CAMERA6').trigger('click'); 145 } else if (event.which == 104) { 146 $$('#CAMERA7').trigger('click'); 147 } else if (event.which == 105) { 148 $$('#CAMERA8').trigger('click'); 149 } else if (event.which == 106) { 150 $$('#CAMERA9').trigger('click'); 151 } else if (event.which == 77) { 152 $$('#MOVE').trigger('click'); 153 } else if (event.which == 67) { 154 $$('#COPY').trigger('click'); 155 } else if (event.which == 80) { 156 $$('#PASTE').trigger('click'); 157 } 158 }); 159 </script> 160 connected 161 <pre>use keyboard to control</pre> 162 $for i in cameras: 163 $i 164 165 $if thumb != '': 166 $ picture= '/'+filmfolder + name + "/scene" + str(scene).zfill(3) + "/shot" + str(shot).zfill(3) + "/picture" + str(take).zfill(3) + ".jpeg" 167 $else: 168 $ picture= '/'+filmfolder + name + "/scene" + str(scene).zfill(3) + "/shot" + str(shot).zfill(3) + "/take" + str(take).zfill(3) + ".jpeg" 169 170 171 $ take_link='/'+filmfolder + name + "/scene" + str(scene).zfill(3) + "/shot" + str(shot).zfill(3) + "/take" + str(take).zfill(3) + ".mp4" 172 $ scene_link='/'+filmfolder + name + "/scene" + str(scene).zfill(3) + "/scene.mp4" 173 $ film_link='/'+filmfolder + name + "/" +name+ ".mp4" 174 $if thumb != '': 175 $if selected == 0: 176 <a href='$film_link'><img width="80%" src="$picture?$randhash"/></a><br> 177 $elif selected == 1: 178 <a href='$scene_link'><img width="80%" src="$picture?$randhash"/></a><br> 179 $elif selected > 1: 180 <a href='$take_link'><img width="80%" src="$picture?$randhash"/></a><br> 181 <br> 182 183 <div class="responsive-div"> 184 185 <div class="controller"> 186 <a id="VIEW">VIEW</a> <a id="UP">UP</a> <a id="RECORD">RECORD</a><br> 187 <a id="LEFT">LEFT</a> <a id="MIDDLE">MIDDLE</a> <a id="RIGHT">RIGHT</a><br> 188 <a id="DELETE">DELETE</a> <a id="DOWN">DOWN</a> <a id="RETAKE">RETAKE</a><br> 189 </div> 190 191 <div class="controller2"> 192 <a id="CAMERA0">CAM1</a> <a id="CAMERA1">CAM2</a> <a id="CAMERA2">CAM3</a><br> 193 <a id="CAMERA3">CAM4</a> <a id="CAMERA4">CAM5</a> <a id="CAMERA5">CAM6</a><br> 194 </div> 195 196 <div class="controller3"> 197 <a id="MOVE">MOVE</a> <a id="COPY">COPY</a> <a id="PASTE">PASTE</a><br> 198 </div> 199 200 </div> 201 202 <div id="menu2" style="width:95%; max-width:800px;" ></div> 203 <div id="menu" style="width:95%; max-width:800px;"> 204 </div> 205 206 <script> 207 $$('#CAMERA0').on('click', function () { 208 $$.ajax({ 209 method: "POST", 210 type: "Content-type", 211 url:"/api?func=camera0", 212 success: function(result) { 213 }, 214 error: function(result) { 215 console.log('error', result); 216 } 217 }) 218 }); 219 $$('#CAMERA1').on('click', function () { 220 $$.ajax({ 221 method: "POST", 222 type: "Content-type", 223 url:"/api?func=camera1", 224 success: function(result) { 225 }, 226 error: function(result) { 227 console.log('error', result); 228 } 229 }) 230 }); 231 $$('#CAMERA2').on('click', function () { 232 $$.ajax({ 233 method: "POST", 234 type: "Content-type", 235 url:"/api?func=camera2", 236 success: function(result) { 237 }, 238 error: function(result) { 239 console.log('error', result); 240 } 241 }) 242 }); 243 $$('#CAMERA3').on('click', function () { 244 $$.ajax({ 245 method: "POST", 246 type: "Content-type", 247 url:"/api?func=camera3", 248 success: function(result) { 249 }, 250 error: function(result) { 251 console.log('error', result); 252 } 253 }) 254 }); 255 $$('#CAMERA4').on('click', function () { 256 $$.ajax({ 257 method: "POST", 258 type: "Content-type", 259 url:"/api?func=camera4", 260 success: function(result) { 261 }, 262 error: function(result) { 263 console.log('error', result); 264 } 265 }) 266 }); 267 $$('#CAMERA5').on('click', function () { 268 $$.ajax({ 269 method: "POST", 270 type: "Content-type", 271 url:"/api?func=camera5", 272 success: function(result) { 273 }, 274 error: function(result) { 275 console.log('error', result); 276 } 277 }) 278 }); 279 $$('#CAMERA6').on('click', function () { 280 $$.ajax({ 281 method: "POST", 282 type: "Content-type", 283 url:"/api?func=camera6", 284 success: function(result) { 285 }, 286 error: function(result) { 287 console.log('error', result); 288 } 289 }) 290 }); 291 $$('#CAMERA7').on('click', function () { 292 $$.ajax({ 293 method: "POST", 294 type: "Content-type", 295 url:"/api?func=camera7", 296 success: function(result) { 297 }, 298 error: function(result) { 299 console.log('error', result); 300 } 301 }) 302 }); 303 304 $$('#LEFT').on('click', function () { 305 $$.ajax({ 306 method: "POST", 307 type: "Content-type", 308 url:"/api?func=left", 309 success: function(result) { 310 }, 311 error: function(result) { 312 console.log('error', result); 313 } 314 }) 315 }); 316 $$('#RIGHT').on('click', function () { 317 $$.ajax({ 318 method: "POST", 319 type: "Content-type", 320 url:"/api?func=right", 321 success: function(result) { 322 }, 323 error: function(result) { 324 console.log('error', result); 325 } 326 }) 327 }); 328 $$('#DOWN').on('click', function () { 329 $$.ajax({ 330 method: "POST", 331 type: "Content-type", 332 url:"/api?func=down", 333 success: function(result) { 334 }, 335 error: function(result) { 336 console.log('error', result); 337 } 338 }) 339 }); 340 $$('#UP').on('click', function () { 341 $$.ajax({ 342 method: "POST", 343 type: "Content-type", 344 url:"/api?func=up", 345 success: function(result) { 346 }, 347 error: function(result) { 348 console.log('error', result); 349 } 350 }) 351 }); 352 $$('#RECORD').on('click', function () { 353 $$.ajax({ 354 method: "POST", 355 type: "Content-type", 356 url:"/api?func=record", 357 success: function(result) { 358 }, 359 error: function(result) { 360 console.log('error', result); 361 } 362 }) 363 }); 364 $$('#RETAKE').on('click', function () { 365 $$.ajax({ 366 method: "POST", 367 type: "Content-type", 368 url:"/api?func=retake", 369 success: function(result) { 370 }, 371 error: function(result) { 372 console.log('error', result); 373 } 374 }) 375 }); 376 $$('#DELETE').on('click', function () { 377 $$.ajax({ 378 method: "POST", 379 type: "Content-type", 380 url:"/api?func=delete", 381 success: function(result) { 382 }, 383 error: function(result) { 384 console.log('error', result); 385 } 386 }) 387 }); 388 $$('#VIEW').on('click', function () { 389 $$.ajax({ 390 method: "POST", 391 type: "Content-type", 392 url:"/api?func=view", 393 success: function(result) { 394 }, 395 error: function(result) { 396 console.log('error', result); 397 } 398 }) 399 }); 400 $$('#MIDDLE').on('click', function () { 401 $$.ajax({ 402 method: "POST", 403 type: "Content-type", 404 url:"/api?func=middle", 405 success: function(result) { 406 }, 407 error: function(result) { 408 console.log('error', result); 409 } 410 }) 411 }); 412 $$('#CAMERA0').on('click', function () { 413 $$.ajax({ 414 method: "POST", 415 type: "Content-type", 416 url:"/api?func=camera0", 417 success: function(result) { 418 }, 419 error: function(result) { 420 console.log('error', result); 421 } 422 }) 423 }); 424 $$('#CAMERA1').on('click', function () { 425 $$.ajax({ 426 method: "POST", 427 type: "Content-type", 428 url:"/api?func=camera1", 429 success: function(result) { 430 }, 431 error: function(result) { 432 console.log('error', result); 433 } 434 }) 435 }); 436 $$('#CAMERA2').on('click', function () { 437 $$.ajax({ 438 method: "POST", 439 type: "Content-type", 440 url:"/api?func=camera2", 441 success: function(result) { 442 }, 443 error: function(result) { 444 console.log('error', result); 445 } 446 }) 447 }); 448 $$('#CAMERA3').on('click', function () { 449 $$.ajax({ 450 method: "POST", 451 type: "Content-type", 452 url:"/api?func=camera3", 453 success: function(result) { 454 }, 455 error: function(result) { 456 console.log('error', result); 457 } 458 }) 459 }); 460 $$('#CAMERA4').on('click', function () { 461 $$.ajax({ 462 method: "POST", 463 type: "Content-type", 464 url:"/api?func=camera4", 465 success: function(result) { 466 }, 467 error: function(result) { 468 console.log('error', result); 469 } 470 }) 471 }); 472 $$('#CAMERA5').on('click', function () { 473 $$.ajax({ 474 method: "POST", 475 type: "Content-type", 476 url:"/api?func=camera5", 477 success: function(result) { 478 }, 479 error: function(result) { 480 console.log('error', result); 481 } 482 }) 483 }); 484 $$('#CAMERA6').on('click', function () { 485 $$.ajax({ 486 method: "POST", 487 type: "Content-type", 488 url:"/api?func=camera6", 489 success: function(result) { 490 }, 491 error: function(result) { 492 console.log('error', result); 493 } 494 }) 495 }); 496 $$('#CAMERA7').on('click', function () { 497 $$.ajax({ 498 method: "POST", 499 type: "Content-type", 500 url:"/api?func=camera7", 501 success: function(result) { 502 }, 503 error: function(result) { 504 console.log('error', result); 505 } 506 }) 507 }); 508 $$('#CAMERA8').on('click', function () { 509 $$.ajax({ 510 method: "POST", 511 type: "Content-type", 512 url:"/api?func=camera8", 513 success: function(result) { 514 }, 515 error: function(result) { 516 console.log('error', result); 517 } 518 }) 519 }); 520 $$('#CAMERA9').on('click', function () { 521 $$.ajax({ 522 method: "POST", 523 type: "Content-type", 524 url:"/api?func=camera9", 525 success: function(result) { 526 }, 527 error: function(result) { 528 console.log('error', result); 529 } 530 }) 531 }); 532 $$('#MOVE').on('click', function () { 533 $$.ajax({ 534 method: "POST", 535 type: "Content-type", 536 url:"/api?func=move", 537 success: function(result) { 538 }, 539 error: function(result) { 540 console.log('error', result); 541 } 542 }) 543 }); 544 $$('#COPY').on('click', function () { 545 $$.ajax({ 546 method: "POST", 547 type: "Content-type", 548 url:"/api?func=copy", 549 success: function(result) { 550 }, 551 error: function(result) { 552 console.log('error', result); 553 } 554 }) 555 }); 556 $$('#PASTE').on('click', function () { 557 $$.ajax({ 558 method: "POST", 559 type: "Content-type", 560 url:"/api?func=paste", 561 success: function(result) { 562 }, 563 error: function(result) { 564 console.log('error', result); 565 } 566 }) 567 }); 568 569 </script> 570