break out configuration
This commit is contained in:
parent
e9de6b7f9c
commit
1ef76b1945
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
$config = [
|
||||
'page_title' => 'Route 8 - Stow' //html page title
|
||||
];
|
||||
|
||||
$camList = [ //list of cam titles and urls - currently must be 6
|
||||
['Hudson Dr', 'https://itscameras.dot.state.oh.us/images/CLE/CLE034.jpg'],
|
||||
['Graham Rd', 'https://itscameras.dot.state.oh.us/images/CLE/CLE036a-L.jpg'],
|
||||
['Hampshire Rd', 'https://itscameras.dot.state.oh.us/images/CLE/CLE040-L.jpg'],
|
||||
['Steels Corners', 'https://itscameras.dot.state.oh.us/images/CLE/CLE038-L.jpg'],
|
||||
['Barlow Rd', 'https://itscameras.dot.state.oh.us/images/CLE/CLE044-L.jpg'],
|
||||
['SR 303', 'https://itscameras.dot.state.oh.us/images/CLE/CLE013-L.jpg']
|
||||
];
|
||||
?>
|
||||
|
|
@ -1,10 +1,16 @@
|
|||
<?php
|
||||
require("config.php");
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<title>Route 8 Cameras</title>
|
||||
<title><?=$config['page_title']?></title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
|
||||
<script>
|
||||
var camList = <?=json_encode($camList);?>;
|
||||
</script>
|
||||
<script src="script.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
14
script.js
14
script.js
|
|
@ -1,12 +1,4 @@
|
|||
$(document).ready(function(){
|
||||
|
||||
var camList = [];
|
||||
camList[1] = ["CLE/CLE034", "Hudson Dr"];
|
||||
camList[2] = ["CLE/CLE036a-L", "Graham Rd"];
|
||||
camList[3] = ["CLE/CLE040-L", "Hampshire Rd"];
|
||||
camList[4] = ["CLE/CLE038-L", "Steels Corners"];
|
||||
camList[5] = ["CLE/CLE044-L", "Barlow Rd"];
|
||||
camList[6] = ["CLE/CLE013-L", "SR 303"];
|
||||
|
||||
camList.forEach(loadTitle); //set titles
|
||||
|
||||
|
|
@ -20,7 +12,7 @@ $(document).ready(function(){
|
|||
|
||||
function loadTitle(camDat, camNum){
|
||||
|
||||
$("#title" + camNum).text(camDat[1]);
|
||||
$("#title" + (camNum+1)).text(camDat[0]);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -33,8 +25,8 @@ function setIMG(camList){
|
|||
function loadIMG(camDat, camNum){
|
||||
|
||||
datestr = Date.now();
|
||||
camURL = "https://itscameras.dot.state.oh.us/images/" + camDat[0] + ".jpg?date=" + datestr;
|
||||
$("#cam" + camNum).attr("src", camURL);
|
||||
camURL = camDat[1] + "?date=" + datestr;
|
||||
$("#cam" + (camNum+1)).attr("src", camURL);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue