Skip to content

Commit

Permalink
fullscreen, dockerfile update
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjid committed Jan 11, 2020
1 parent ad2b6b1 commit c767578
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 14 deletions.
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
COPY . /app
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS base
WORKDIR /app
COPY . .

RUN dotnet restore
RUN dotnet build

EXPOSE 5000/tcp
ENV ASPNETCORE_URLS http://*:5000
ENV ASPNETCORE_ENVIRONMENT docker

ENTRYPOINT [ "dotnet", "watch", "run", "--no-restore", "--urls", "http://0.0.0.0:5000" ]
CMD ASPNETCORE_URLS=http://*:$PORT dotnet routine-explorer.dll
4 changes: 2 additions & 2 deletions Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@
<div class="modal-content">
<div class="row">
<div class="col s6 l6">
<h4 id="semesterName">Class Schedule</h4>
<h5 id="semesterName">Class Schedule</h5>
</div>
<div class="col s6 l6">
<div class="right-align">
<a href="#" class="modal-close waves-effect waves-green btn-flat red-text">Close</a>
<a id="closeBtn" class="modal-close waves-effect waves-green btn-flat red-text">Close</a>
</div>
</div>
</div>
Expand Down
49 changes: 48 additions & 1 deletion wwwroot/app/src/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ $(document).ready(function() {
}, {})
});
});


$('#closeBtn').click(function () {
$('#modal1').modal('close');
exitFullScreen();
});

$('#btnStudentRoutine').click(function () {
$('.progress').show();
Expand All @@ -33,6 +37,8 @@ $(document).ready(function() {
});
$('#semesterName').text('Class Schedule : ' + response[0]["status"]["nameOfFilesUploaded"]);
$('#modal1').modal('open');

toggleFullScreen(document.body);
}
}).always(function() {
$('.progress').hide();
Expand All @@ -54,4 +60,45 @@ $(document).ready(function() {
function replaceAll(str, find, replace) {
return str.replace(new RegExp(find, 'g'), replace);
}

function isInFullScreen() {
const document = window.document;
return (document.fullscreenElement && true) || (document.webkitFullscreenElement && true) || (document.mozFullScreenElement && true) || (document.msFullscreenElement && true);
}

function requestFullScreen(elem) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullScreen) {
elem.webkitRequestFullScreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
} else {
console.warn("Did not find a requestFullScreen method on this element", elem);
}
}

function exitFullScreen() {
const document = window.document;
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}

function toggleFullScreen(elem) {
// based on https://stackoverflow.com/questions/36672561/how-to-exit-fullscreen-onclick-using-javascript
if (isInFullScreen()) {
exitFullScreen();
} else {
requestFullScreen(elem || document.body);
}
}
});
2 changes: 1 addition & 1 deletion wwwroot/app/src/scripts/app.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c767578

Please sign in to comment.