index.html (14472B)
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 == 68) { 112 $$('#DUB').trigger('click'); 113 } else if (event.which == 97) { 114 $$('#CAMERA0').trigger('click'); 115 } else if (event.which == 98) { 116 $$('#CAMERA1').trigger('click'); 117 } else if (event.which == 99) { 118 $$('#CAMERA2').trigger('click'); 119 } else if (event.which == 100) { 120 $$('#CAMERA3').trigger('click'); 121 } else if (event.which == 101) { 122 $$('#CAMERA4').trigger('click'); 123 } else if (event.which == 102) { 124 $$('#CAMERA5').trigger('click'); 125 } else if (event.which == 103) { 126 $$('#CAMERA6').trigger('click'); 127 } else if (event.which == 104) { 128 $$('#CAMERA7').trigger('click'); 129 } else if (event.which == 105) { 130 $$('#CAMERA8').trigger('click'); 131 } else if (event.which == 106) { 132 $$('#CAMERA9').trigger('click'); 133 } else if (event.which == 229) { 134 $$('#CAMERA0').trigger('click'); 135 } else if (event.which == 98) { 136 $$('#CAMERA1').trigger('click'); 137 } else if (event.which == 99) { 138 $$('#CAMERA2').trigger('click'); 139 } else if (event.which == 100) { 140 $$('#CAMERA3').trigger('click'); 141 } else if (event.which == 101) { 142 $$('#CAMERA4').trigger('click'); 143 } else if (event.which == 102) { 144 $$('#CAMERA5').trigger('click'); 145 } else if (event.which == 103) { 146 $$('#CAMERA6').trigger('click'); 147 } else if (event.which == 104) { 148 $$('#CAMERA7').trigger('click'); 149 } else if (event.which == 105) { 150 $$('#CAMERA8').trigger('click'); 151 } else if (event.which == 106) { 152 $$('#CAMERA9').trigger('click'); 153 } else if (event.which == 77) { 154 $$('#MOVE').trigger('click'); 155 } else if (event.which == 67) { 156 $$('#COPY').trigger('click'); 157 } else if (event.which == 80) { 158 $$('#PASTE').trigger('click'); 159 } 160 }); 161 </script> 162 connected 163 <pre>use keyboard to control</pre> 164 $for i in cameras: 165 $i 166 167 $if thumb != '': 168 $ picture= '/'+filmfolder + name + "/scene" + str(scene).zfill(3) + "/shot" + str(shot).zfill(3) + "/picture" + str(take).zfill(3) + ".jpeg" 169 $else: 170 $ picture= '/'+filmfolder + name + "/scene" + str(scene).zfill(3) + "/shot" + str(shot).zfill(3) + "/take" + str(take).zfill(3) + ".jpeg" 171 172 173 $ take_link='/'+filmfolder + name + "/scene" + str(scene).zfill(3) + "/shot" + str(shot).zfill(3) + "/take" + str(take).zfill(3) + ".mp4" 174 $ scene_link='/'+filmfolder + name + "/scene" + str(scene).zfill(3) + "/scene.mp4" 175 $ film_link='/'+filmfolder + name + "/" +name+ ".mp4" 176 $if thumb != '': 177 $if selected == 0: 178 <a href='$film_link'><img width="80%" src="$picture?$randhash"/></a><br> 179 $elif selected == 1: 180 <a href='$scene_link'><img width="80%" src="$picture?$randhash"/></a><br> 181 $elif selected > 1: 182 <a href='$take_link'><img width="80%" src="$picture?$randhash"/></a><br> 183 <br> 184 185 <div class="responsive-div"> 186 187 <div class="controller"> 188 <a id="VIEW">VIEW</a> <a id="UP">UP</a> <a id="RECORD">RECORD</a><br> 189 <a id="LEFT">LEFT</a> <a id="MIDDLE">MIDDLE</a> <a id="RIGHT">RIGHT</a><br> 190 <a id="DELETE">DELETE</a> <a id="DOWN">DOWN</a> <a id="RETAKE">RETAKE</a><br> 191 </div> 192 193 <div class="controller2"> 194 <a id="CAMERA0">CAM1</a> <a id="CAMERA1">CAM2</a> <a id="CAMERA2">CAM3</a><br> 195 <a id="CAMERA3">CAM4</a> <a id="CAMERA4">CAM5</a> <a id="CAMERA5">CAM6</a><br> 196 </div> 197 198 <div class="controller3"> 199 <a id="MOVE">MOVE</a> <a id="COPY">COPY</a> <a id="PASTE">PASTE</a> <a id="DUB">DUB</a> <br> 200 </div> 201 202 </div> 203 204 <div id="menu2" style="width:95%; max-width:800px;" ></div> 205 <div id="menu" style="width:95%; max-width:800px;"> 206 </div> 207 208 <script> 209 $$('#CAMERA0').on('click', function () { 210 $$.ajax({ 211 method: "POST", 212 type: "Content-type", 213 url:"/api?func=camera0", 214 success: function(result) { 215 }, 216 error: function(result) { 217 console.log('error', result); 218 } 219 }) 220 }); 221 $$('#CAMERA1').on('click', function () { 222 $$.ajax({ 223 method: "POST", 224 type: "Content-type", 225 url:"/api?func=camera1", 226 success: function(result) { 227 }, 228 error: function(result) { 229 console.log('error', result); 230 } 231 }) 232 }); 233 $$('#CAMERA2').on('click', function () { 234 $$.ajax({ 235 method: "POST", 236 type: "Content-type", 237 url:"/api?func=camera2", 238 success: function(result) { 239 }, 240 error: function(result) { 241 console.log('error', result); 242 } 243 }) 244 }); 245 $$('#CAMERA3').on('click', function () { 246 $$.ajax({ 247 method: "POST", 248 type: "Content-type", 249 url:"/api?func=camera3", 250 success: function(result) { 251 }, 252 error: function(result) { 253 console.log('error', result); 254 } 255 }) 256 }); 257 $$('#CAMERA4').on('click', function () { 258 $$.ajax({ 259 method: "POST", 260 type: "Content-type", 261 url:"/api?func=camera4", 262 success: function(result) { 263 }, 264 error: function(result) { 265 console.log('error', result); 266 } 267 }) 268 }); 269 $$('#CAMERA5').on('click', function () { 270 $$.ajax({ 271 method: "POST", 272 type: "Content-type", 273 url:"/api?func=camera5", 274 success: function(result) { 275 }, 276 error: function(result) { 277 console.log('error', result); 278 } 279 }) 280 }); 281 $$('#CAMERA6').on('click', function () { 282 $$.ajax({ 283 method: "POST", 284 type: "Content-type", 285 url:"/api?func=camera6", 286 success: function(result) { 287 }, 288 error: function(result) { 289 console.log('error', result); 290 } 291 }) 292 }); 293 $$('#CAMERA7').on('click', function () { 294 $$.ajax({ 295 method: "POST", 296 type: "Content-type", 297 url:"/api?func=camera7", 298 success: function(result) { 299 }, 300 error: function(result) { 301 console.log('error', result); 302 } 303 }) 304 }); 305 306 $$('#LEFT').on('click', function () { 307 $$.ajax({ 308 method: "POST", 309 type: "Content-type", 310 url:"/api?func=left", 311 success: function(result) { 312 }, 313 error: function(result) { 314 console.log('error', result); 315 } 316 }) 317 }); 318 $$('#RIGHT').on('click', function () { 319 $$.ajax({ 320 method: "POST", 321 type: "Content-type", 322 url:"/api?func=right", 323 success: function(result) { 324 }, 325 error: function(result) { 326 console.log('error', result); 327 } 328 }) 329 }); 330 $$('#DOWN').on('click', function () { 331 $$.ajax({ 332 method: "POST", 333 type: "Content-type", 334 url:"/api?func=down", 335 success: function(result) { 336 }, 337 error: function(result) { 338 console.log('error', result); 339 } 340 }) 341 }); 342 $$('#UP').on('click', function () { 343 $$.ajax({ 344 method: "POST", 345 type: "Content-type", 346 url:"/api?func=up", 347 success: function(result) { 348 }, 349 error: function(result) { 350 console.log('error', result); 351 } 352 }) 353 }); 354 $$('#RECORD').on('click', function () { 355 $$.ajax({ 356 method: "POST", 357 type: "Content-type", 358 url:"/api?func=record", 359 success: function(result) { 360 }, 361 error: function(result) { 362 console.log('error', result); 363 } 364 }) 365 }); 366 $$('#RETAKE').on('click', function () { 367 $$.ajax({ 368 method: "POST", 369 type: "Content-type", 370 url:"/api?func=retake", 371 success: function(result) { 372 }, 373 error: function(result) { 374 console.log('error', result); 375 } 376 }) 377 }); 378 $$('#DELETE').on('click', function () { 379 $$.ajax({ 380 method: "POST", 381 type: "Content-type", 382 url:"/api?func=delete", 383 success: function(result) { 384 }, 385 error: function(result) { 386 console.log('error', result); 387 } 388 }) 389 }); 390 $$('#VIEW').on('click', function () { 391 $$.ajax({ 392 method: "POST", 393 type: "Content-type", 394 url:"/api?func=view", 395 success: function(result) { 396 }, 397 error: function(result) { 398 console.log('error', result); 399 } 400 }) 401 }); 402 $$('#MIDDLE').on('click', function () { 403 $$.ajax({ 404 method: "POST", 405 type: "Content-type", 406 url:"/api?func=middle", 407 success: function(result) { 408 }, 409 error: function(result) { 410 console.log('error', result); 411 } 412 }) 413 }); 414 $$('#CAMERA0').on('click', function () { 415 $$.ajax({ 416 method: "POST", 417 type: "Content-type", 418 url:"/api?func=camera0", 419 success: function(result) { 420 }, 421 error: function(result) { 422 console.log('error', result); 423 } 424 }) 425 }); 426 $$('#CAMERA1').on('click', function () { 427 $$.ajax({ 428 method: "POST", 429 type: "Content-type", 430 url:"/api?func=camera1", 431 success: function(result) { 432 }, 433 error: function(result) { 434 console.log('error', result); 435 } 436 }) 437 }); 438 $$('#CAMERA2').on('click', function () { 439 $$.ajax({ 440 method: "POST", 441 type: "Content-type", 442 url:"/api?func=camera2", 443 success: function(result) { 444 }, 445 error: function(result) { 446 console.log('error', result); 447 } 448 }) 449 }); 450 $$('#CAMERA3').on('click', function () { 451 $$.ajax({ 452 method: "POST", 453 type: "Content-type", 454 url:"/api?func=camera3", 455 success: function(result) { 456 }, 457 error: function(result) { 458 console.log('error', result); 459 } 460 }) 461 }); 462 $$('#CAMERA4').on('click', function () { 463 $$.ajax({ 464 method: "POST", 465 type: "Content-type", 466 url:"/api?func=camera4", 467 success: function(result) { 468 }, 469 error: function(result) { 470 console.log('error', result); 471 } 472 }) 473 }); 474 $$('#CAMERA5').on('click', function () { 475 $$.ajax({ 476 method: "POST", 477 type: "Content-type", 478 url:"/api?func=camera5", 479 success: function(result) { 480 }, 481 error: function(result) { 482 console.log('error', result); 483 } 484 }) 485 }); 486 $$('#CAMERA6').on('click', function () { 487 $$.ajax({ 488 method: "POST", 489 type: "Content-type", 490 url:"/api?func=camera6", 491 success: function(result) { 492 }, 493 error: function(result) { 494 console.log('error', result); 495 } 496 }) 497 }); 498 $$('#CAMERA7').on('click', function () { 499 $$.ajax({ 500 method: "POST", 501 type: "Content-type", 502 url:"/api?func=camera7", 503 success: function(result) { 504 }, 505 error: function(result) { 506 console.log('error', result); 507 } 508 }) 509 }); 510 $$('#CAMERA8').on('click', function () { 511 $$.ajax({ 512 method: "POST", 513 type: "Content-type", 514 url:"/api?func=camera8", 515 success: function(result) { 516 }, 517 error: function(result) { 518 console.log('error', result); 519 } 520 }) 521 }); 522 $$('#CAMERA9').on('click', function () { 523 $$.ajax({ 524 method: "POST", 525 type: "Content-type", 526 url:"/api?func=camera9", 527 success: function(result) { 528 }, 529 error: function(result) { 530 console.log('error', result); 531 } 532 }) 533 }); 534 $$('#MOVE').on('click', function () { 535 $$.ajax({ 536 method: "POST", 537 type: "Content-type", 538 url:"/api?func=move", 539 success: function(result) { 540 }, 541 error: function(result) { 542 console.log('error', result); 543 } 544 }) 545 }); 546 $$('#COPY').on('click', function () { 547 $$.ajax({ 548 method: "POST", 549 type: "Content-type", 550 url:"/api?func=copy", 551 success: function(result) { 552 }, 553 error: function(result) { 554 console.log('error', result); 555 } 556 }) 557 }); 558 $$('#PASTE').on('click', function () { 559 $$.ajax({ 560 method: "POST", 561 type: "Content-type", 562 url:"/api?func=paste", 563 success: function(result) { 564 }, 565 error: function(result) { 566 console.log('error', result); 567 } 568 }) 569 }); 570 $$('#DUB').on('click', function () { 571 $$.ajax({ 572 method: "POST", 573 type: "Content-type", 574 url:"/api?func=dub", 575 success: function(result) { 576 }, 577 error: function(result) { 578 console.log('error', result); 579 } 580 }) 581 }); 582 583 </script> 584