Skip to content

Commit

Permalink
merging changes from repo (I forgot to do a git pull before making la…
Browse files Browse the repository at this point in the history
…test changes)
  • Loading branch information
shaefner-usgs committed Feb 17, 2017
2 parents 7a5f04a + f82d442 commit 6fdf907
Show file tree
Hide file tree
Showing 19 changed files with 819 additions and 720 deletions.
2 changes: 1 addition & 1 deletion gruntconfig/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ var MOUNT_PATH = config.ini.MOUNT_PATH;

var addMiddleware = function (connect, options, middlewares) {
middlewares.unshift(
require('grunt-connect-rewrite/lib/utils').rewriteRequest,
require('grunt-connect-proxy/lib/utils').proxyRequest,
require('grunt-connect-rewrite/lib/utils').rewriteRequest,
require('gateway')(options.base[0], {
'.php': 'php-cgi',
'env': {
Expand Down
20 changes: 20 additions & 0 deletions gruntconfig/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,26 @@ var copy = {
src: [
'**/*'
]
},

leaflet: {
expand: true,
cwd: 'node_modules/leaflet/dist',
dest: config.build + '/' + config.src + '/htdocs/lib/leaflet-0.7.7',
rename: function (dest, src) {
var newName;

// swap -src version to be default and add -min to compressed version
// this is nice for debugging but allows production to use default
// version as compressed
newName = src.replace('leaflet.js', 'leaflet-min.js');
newName = newName.replace('leaflet-src.js', 'leaflet.js');

return dest + '/' + newName;
},
src: [
'**/*'
]
}

};
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"hazdev-template": "^1.2.0",
"hazdev-webutils": "~0.1.8",
"ini": "^1.2.1",
"jquery": "^3.1.0",
"leaflet": "^0.7.7",
"mocha": "^2.1.0",
"postcss-calc": "^5.0.0",
"postcss-import": "^7.1.0",
Expand Down
19 changes: 19 additions & 0 deletions src/htdocs/_feeds.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

include_once '../conf/config.inc.php'; // app config

$feeds = '
<h3>Video Podcast</h3>
<ul class="feeds no-style">
<li class="itunes">
<a href="http://itunes.apple.com/us/podcast/usgs-earthquake-science-center/id413770595">
iTunes
</a>
</li>
<li class="xml">
<a href="' . $GLOBALS['MOUNT_PATH'] . '/feed">
RSS Feed
</a>
</li>
</ul>
';
18 changes: 18 additions & 0 deletions src/htdocs/css/_feeds.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.feeds {
display: flex;

a {
padding: 2px 0 2px 25px;
background-repeat: no-repeat;
background-size: 20px;
background-position: 0px 4px;
margin-right: 1em;
}

.itunes a {
background-image: url('../img/itunes.png');
}
.xml a {
background-image: url('../img/xml.png');
}
}
20 changes: 1 addition & 19 deletions src/htdocs/css/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import '_feeds.scss';
@import '_subnav.scss';
@import '_variables.scss';

Expand All @@ -11,25 +12,6 @@ h2 {
display: none;
}

.feeds {
display: flex;

a {
padding: 2px 0 2px 25px;
background-repeat: no-repeat;
background-size: 20px;
background-position: 0px 4px;
margin-right: 1em;
}

.itunes a {
background-image: url('../img/itunes.png');
}
.xml a {
background-image: url('../img/xml.png');
}
}

.seminars {
margin: 0 0 3.5em;

Expand Down
1 change: 1 addition & 0 deletions src/htdocs/css/seminar.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '_variables.scss';
@import '_feeds.scss';

dl {
> dd {
Expand Down
17 changes: 17 additions & 0 deletions src/htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
include_once '../lib/_functions.inc.php'; // app functions
include_once '../lib/classes/Db.class.php'; // db connector, queries

include_once '_feeds.inc.php'; // sets $feeds

include_once '../lib/classes/Seminar.class.php'; // model
include_once '../lib/classes/SeminarListView.class.php'; // view
include_once '../lib/classes/SeminarCollection.class.php'; // collection
Expand Down Expand Up @@ -38,4 +40,19 @@
}

$view = new SeminarListView($seminarCollection);

?>

<p>Seminars typically take place at <strong>10:30 AM Wednesdays</strong> in
the <strong>Rambo Auditorium</strong> (main USGS Conference Room). The USGS
Campus is located at <a href="/contactus/menlo/menloloc.php" title="Campus
Map and Directions">345 Middlefield Road, Menlo Park, CA</a>.</p>

<p>We record most seminars. You can watch live or
<a href="<?php print $MOUNT_PATH; ?>/archives/<?php print $currentYear; ?>">check
the archives</a> to view a past seminar.</p>

<?php

print $feeds;
$view->render();
19 changes: 6 additions & 13 deletions src/htdocs/js/VideoPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var Video = function (options) {

_COUNT ++;
jwplayerOpts = _buildOptions();
if (jwplayerOpts.file) {
if (jwplayerOpts.file) { // file prop is required by jwplayer
_setupPlayer(jwplayerOpts);
}
};
Expand Down Expand Up @@ -224,8 +224,7 @@ var Video = function (options) {
* jwplayer options
*/
_setupPlayer = function (opts) {
var fixedOpts,
player;
var fixedOpts;

// fixedOpts are applied to all jwplayer instances
fixedOpts = {
Expand All @@ -243,15 +242,16 @@ var Video = function (options) {
opts = Util.extend({}, fixedOpts, opts);

// instantiate player
player = jwplayer(opts.id);
player.setup(opts);
jwplayer(opts.id).setup(opts);

// if player can't be setup in livestream mode, assume no Flash, alert user
jwplayer().onSetupError(function(/*e*/) {
jwplayer(opts.id).on('setupError', function(e) {
var flash,
p,
video;

console.log(e);

if (opts.livestream) {
flash = document.querySelector('.' + 'flash');
if (flash) {
Expand All @@ -267,13 +267,6 @@ var Video = function (options) {
}
}
});

// repeatedly try to play livestream when server is offline
jwplayer().onBuffer(function() {
setTimeout(function(){
jwplayer().play();
}, 15000);
});
};


Expand Down
8 changes: 4 additions & 4 deletions src/htdocs/live/monitor/getHostName.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
function gethost($ip) {
$host = exec("dig +short +time=1 -x $ip 2>&1");

if (!$host || preg_match('/not found/', $host) || preg_match('/timed out/', $host)) {
$r = 'unknown';
if (!$host || preg_match('/not found/', $host) || preg_match('/timed out/', $host)) {
$r = 'unknown';
} else {
$r = substr($host, 0, -1);
$r = substr($host, 0, -1);
}
return $r;
}

?>
?>
78 changes: 39 additions & 39 deletions src/htdocs/live/monitor/index.php
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="/library/com/leaflet-0.7.1/leaflet.css">
<link rel="stylesheet" href="/library/com/leaflet-0.7.1/leaflet.markercluster.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="print.css" media="print">
<script src="/template/js/jquery-1.7.1.min.js"></script>
<meta charset="utf-8">
<title>Live Webcast Viewers</title>
<link rel="stylesheet" href="/library/com/leaflet-0.7.1/leaflet.css">
<link rel="stylesheet" href="/library/com/leaflet-0.7.1/leaflet.markercluster.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="print.css" media="print">
<script src="/template/js/jquery-1.7.1.min.js"></script>
<meta charset="utf-8">
<title>Live Webcast Viewers</title>
</head>
<body>
<main>
<div id="map"></div>
</main>
<section class="sidebar">
<header id="title" class="sidebar-container">
<h1>Live Webcast Viewers</h1>
<p><?php print date('l, F j, Y'); ?> <time></time></p>
</header>
<section id="video" class="sidebar-container">
<video src="mplive?streamer=rtmp://video2.wr.usgs.gov/live" width="500" height="281" controls></video>
</section>
<section id="status" class="sidebar-container">
<h2>Loading&hellip;</h2>
<p class="expand hide" title="Expand table">Expand/Collapse</p>
</section>
<section id="details" class="sidebar-container">
<div class="fade-top"></div>
<table></table>
<div class="fade-bottom"></div>
</section>
<section id="alerts" class="sidebar-container"></section>
<section id="options" class="sidebar-container">
<input type="checkbox" id="extent" checked="checked">
<label for="extent">Reposition map when webcast viewers are updated</label>
</section>
</section>
<script src="/library/com/leaflet-0.7.1/leaflet.js"></script>
<script src="/library/com/leaflet-0.7.1/leaflet.markercluster.js"></script>
<script src="/template/widgets/jwplayer/jwplayer.js"></script>
<script src="/template/widgets/jwplayer/script.js"></script>
<script src="script.js"></script>
<main>
<div id="map"></div>
</main>
<section class="sidebar">
<header id="title" class="sidebar-container">
<h1>Live Webcast Viewers</h1>
<p><?php print date('l, F j, Y'); ?> <time></time></p>
</header>
<section id="video" class="sidebar-container">
<video src="mplive?streamer=rtmp://video2.wr.usgs.gov/live" width="500" height="281" controls></video>
</section>
<section id="status" class="sidebar-container">
<h2>Loading&hellip;</h2>
<p class="expand hide" title="Expand table">Expand/Collapse</p>
</section>
<section id="details" class="sidebar-container">
<div class="fade-top"></div>
<table></table>
<div class="fade-bottom"></div>
</section>
<section id="alerts" class="sidebar-container"></section>
<section id="options" class="sidebar-container">
<input type="checkbox" id="extent" checked="checked">
<label for="extent">Reposition map when webcast viewers are updated</label>
</section>
</section>
<script src="/library/com/leaflet-0.7.1/leaflet.js"></script>
<script src="/library/com/leaflet-0.7.1/leaflet.markercluster.js"></script>
<script src="/template/widgets/jwplayer/jwplayer.js"></script>
<script src="/template/widgets/jwplayer/script.js"></script>
<script src="script.js"></script>
</body>
</html>
</html>
Loading

0 comments on commit 6fdf907

Please sign in to comment.