Added fullscreen button.
This commit is contained in:
parent
0a083ba8cc
commit
bf20564858
@ -1 +1 @@
|
||||
1
|
||||
4
|
||||
|
@ -37,6 +37,7 @@
|
||||
<li><a href="#" class=pause-continue>Pause Monitoring</a></li>
|
||||
<li><a href="#" class=refresh>Refresh Now</a></li>
|
||||
<li><a href="#" class=show-config>Config</a></li>
|
||||
<li><a href="#" class=toggle-fullscreen>Go Fullscreen</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
<section id=config-dialog>
|
||||
|
@ -341,7 +341,8 @@
|
||||
events: {
|
||||
"click a.refresh" : "refresh",
|
||||
"click a.pause-continue" : "toggleSync",
|
||||
"click a.show-config" : "showConfig" },
|
||||
"click a.show-config" : "showConfig",
|
||||
"click a.toggle-fullscreen" : "toggleFullscreen" },
|
||||
|
||||
initialize: function() {
|
||||
|
||||
@ -373,6 +374,7 @@
|
||||
|
||||
// Schedule future refreshes.
|
||||
PD.refreshIntervalId = setInterval(this.refresh, PD.refreshPeriod ? PD.refreshPeriod : 15000);
|
||||
|
||||
},
|
||||
|
||||
refresh: function(evt) {
|
||||
@ -504,6 +506,32 @@
|
||||
|
||||
showConfig: function() { PD.configDialog.show(); },
|
||||
|
||||
toggleFullscreen: function(evt) {
|
||||
var $button = $(evt.target);
|
||||
if ($button.text() == "Go Fullscreen") {
|
||||
|
||||
if (document.documentElement.requestFullscreen) {
|
||||
document.documentElement.requestFullscreen(); }
|
||||
else if (document.documentElement.webkitRequestFullscreen) {
|
||||
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); }
|
||||
else if (document.documentElement.mozRequestFullScreen) {
|
||||
document.documentElement.mozRequestFullScreen(); }
|
||||
else { alert ("Not supported by this browser."); }
|
||||
|
||||
$button.text("Leave Fullscreen"); }
|
||||
|
||||
else {
|
||||
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen(); }
|
||||
else if (document.webkitExitFullscreen) {
|
||||
document.webkitExitFullscreen(); }
|
||||
else if (document.mozCancelFullscreen) {
|
||||
document.documentElement.mozCancelFullscreen(); }
|
||||
else { alert ("Not supported by this browser."); }
|
||||
|
||||
$button.text("Go Fullscreen"); } },
|
||||
|
||||
toggleSync: function(evt) {
|
||||
if (PD.refreshIntervalId == null) {
|
||||
PD.refreshIntervalId = setInterval(this.refresh,
|
||||
|
Loading…
x
Reference in New Issue
Block a user