Commit 817803a09e22c841cfb0aed5e3d51c3525b9b008
1 parent
e082e3cd
Committing updated files
Showing
3 changed files
with
30 additions
and
0 deletions
400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj
@@ -45180,6 +45180,7 @@ | @@ -45180,6 +45180,7 @@ | ||
45180 | <Content Include="libs\angular-ui\js\slider.js" /> | 45180 | <Content Include="libs\angular-ui\js\slider.js" /> |
45181 | <Content Include="libs\angular\1.4.9\angular-route.min.js" /> | 45181 | <Content Include="libs\angular\1.4.9\angular-route.min.js" /> |
45182 | <Content Include="libs\angular\1.4.9\ngStorage.js" /> | 45182 | <Content Include="libs\angular\1.4.9\ngStorage.js" /> |
45183 | + <Content Include="libs\check_browser_close.js" /> | ||
45183 | <Content Include="libs\colorpicker\jquery.minicolors.min.js" /> | 45184 | <Content Include="libs\colorpicker\jquery.minicolors.min.js" /> |
45184 | <Content Include="libs\FileSaver.js" /> | 45185 | <Content Include="libs\FileSaver.js" /> |
45185 | <Content Include="libs\html2canvas.js" /> | 45186 | <Content Include="libs\html2canvas.js" /> |
400-SOURCECODE/AIAHTML5.Web/index.html
@@ -1471,6 +1471,7 @@ | @@ -1471,6 +1471,7 @@ | ||
1471 | <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>--> | 1471 | <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>--> |
1472 | <script src="libs/html2canvas.js"></script> | 1472 | <script src="libs/html2canvas.js"></script> |
1473 | <script src="libs/FileSaver.js"></script> | 1473 | <script src="libs/FileSaver.js"></script> |
1474 | + <script src="libs/check_browser_close.js"></script> | ||
1474 | <!--<script type="text/javascript"> | 1475 | <!--<script type="text/javascript"> |
1475 | $(function () { | 1476 | $(function () { |
1476 | $('#canvas').sketch(); | 1477 | $('#canvas').sketch(); |
400-SOURCECODE/AIAHTML5.Web/libs/check_browser_close.js
0 → 100644
1 | + | ||
2 | +$(window).on('mouseover', (function () { | ||
3 | + window.onbeforeunload = null; | ||
4 | +})); | ||
5 | +$(window).on('mouseout', (function () { | ||
6 | + window.onbeforeunload = ConfirmLeave; | ||
7 | +})); | ||
8 | +function ConfirmLeave() { | ||
9 | + if (typeof (localStorage.getItem("loggedInUserDetails")) !== 'undefined') { | ||
10 | + localStorage.removeItem('loggedInUserDetails'); | ||
11 | + } | ||
12 | +} | ||
13 | +var prevKey = ""; | ||
14 | +$(document).keydown(function (e) { | ||
15 | + if (e.key == "F5") { | ||
16 | + window.onbeforeunload = null; // ConfirmLeave; | ||
17 | + } | ||
18 | + else if (e.key.toUpperCase() == "W" && prevKey == "CONTROL") { | ||
19 | + window.onbeforeunload = ConfirmLeave; | ||
20 | + } | ||
21 | + else if (e.key.toUpperCase() == "R" && prevKey == "CONTROL") { | ||
22 | + window.onbeforeunload = null; //ConfirmLeave; | ||
23 | + } | ||
24 | + else if (e.key.toUpperCase() == "F4" && (prevKey == "ALT" || prevKey == "CONTROL")) { | ||
25 | + window.onbeforeunload = ConfirmLeave; | ||
26 | + } | ||
27 | + prevKey = e.key.toUpperCase(); | ||
28 | +}); | ||
0 | \ No newline at end of file | 29 | \ No newline at end of file |