Commit 30854434ead168851d567c2d2f883490360843b4
1 parent
baafa646
this is the solution for the bug 25385
Showing
2 changed files
with
59 additions
and
20 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -4926,10 +4926,20 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | @@ -4926,10 +4926,20 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | ||
4926 | }; | 4926 | }; |
4927 | 4927 | ||
4928 | $rootScope.ShowExportImageWindow = function () { | 4928 | $rootScope.ShowExportImageWindow = function () { |
4929 | - $(".export-image").modal("show").draggable({ handle: ".modal-header" }); | ||
4930 | 4929 | ||
4931 | - $(".modal-backdrop").css("opacity", ".5"); | ||
4932 | - $(".modal-backdrop").css("z-index", "1200001"); | 4930 | + var $ua = navigator.userAgent; |
4931 | + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { | ||
4932 | + $(".export-image-ipad").modal("show").draggable({ handle: ".modal-header" }); | ||
4933 | + | ||
4934 | + $(".modal-backdrop").css("opacity", ".5"); | ||
4935 | + $(".modal-backdrop").css("z-index", "1200001"); | ||
4936 | + } | ||
4937 | + else { | ||
4938 | + $(".export-image").modal("show").draggable({ handle: ".modal-header" }); | ||
4939 | + | ||
4940 | + $(".modal-backdrop").css("opacity", ".5"); | ||
4941 | + $(".modal-backdrop").css("z-index", "1200001"); | ||
4942 | + } | ||
4933 | }; | 4943 | }; |
4934 | 4944 | ||
4935 | 4945 |
400-SOURCECODE/AIAHTML5.Web/index.html
@@ -1076,7 +1076,36 @@ | @@ -1076,7 +1076,36 @@ | ||
1076 | </div> | 1076 | </div> |
1077 | </div> | 1077 | </div> |
1078 | </div> | 1078 | </div> |
1079 | + <div class="modal fade export-image-ipad ui-draggable in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" | ||
1080 | + style="z-index: 1200002;"> | ||
1081 | + <div class="modal-dialog modal-sm" role="document"> | ||
1082 | + <div class="modal-content"> | ||
1083 | + <div class="modal-header annotation-modal-header ui-draggable-handle"> | ||
1084 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | ||
1085 | + <h4 class="modal-title" id="">Download Export Image</h4> | ||
1086 | + </div> | ||
1087 | + <div class="modal-body"> | ||
1088 | + <div class="row paddTopbtm15"> | ||
1089 | + <div class="col-sm-12"> | ||
1090 | + <div class="form-group"> | ||
1091 | + <label for="filename">Exported image open in next Teb. Please download it</label> | ||
1092 | + | ||
1093 | + </div> | ||
1094 | + </div> | ||
1095 | + </div> | ||
1079 | 1096 | ||
1097 | + </div> | ||
1098 | + <div class="modal-footer"> | ||
1099 | + <div class="row"> | ||
1100 | + <input type="file" id="file1" style="display:none"> | ||
1101 | + <!--<a href="data:application/xml;charset=utf-8,your code here" download="filename.html">Save</a--> | ||
1102 | + <div class="col-sm-12"><button id="btnPrintPreview" class="btn btn-primary" data-dismiss="modal" type="button">Ok</button></div> <!--onclick="makeScreenshot();"--><!--ng-click="dialogs.saveAs()"--><!--ng-click="ShowAlert()"--> | ||
1103 | + </div> | ||
1104 | + </div> | ||
1105 | + | ||
1106 | + </div> | ||
1107 | + </div> | ||
1108 | + </div> | ||
1080 | <!--Print Active Viewer--> | 1109 | <!--Print Active Viewer--> |
1081 | <div class="print-box-active portrait-box-active" id="printBox" style="display: none;"> | 1110 | <div class="print-box-active portrait-box-active" id="printBox" style="display: none;"> |
1082 | <div id="printDivContent"> | 1111 | <div id="printDivContent"> |
@@ -1894,23 +1923,23 @@ | @@ -1894,23 +1923,23 @@ | ||
1894 | <!-- Export Image Save Click--> | 1923 | <!-- Export Image Save Click--> |
1895 | <script> | 1924 | <script> |
1896 | $(function () { | 1925 | $(function () { |
1926 | + $("#btnPrintPreview").click(function () { | ||
1927 | + $("#canvasDiv").append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>"); | ||
1928 | + html2canvas($("#canvasDiv"), { | ||
1929 | + onrendered: function (canvas) { | ||
1930 | + var imgsrc = canvas.toDataURL("image/png"); | ||
1931 | + console.log(imgsrc); | ||
1932 | + var html = '<div id="img"><img src="' + imgsrc + '" id="newimg" style="margin:auto;top:0px;left:0px;right:0px;position:absolute;border:1px solid #ccc;" /></div>'; | ||
1933 | + var w = window.open(); | ||
1934 | + $(w.document.body).html(html); | ||
1935 | + $("#filename").val(""); | ||
1936 | + $("#exportlogo").remove(); | ||
1937 | + } | ||
1938 | + }); | ||
1939 | + | ||
1940 | + }); | ||
1897 | $("#btnSaveEI").click(function () { | 1941 | $("#btnSaveEI").click(function () { |
1898 | - var $ua = navigator.userAgent; | ||
1899 | - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { | ||
1900 | - $("#canvasDiv").append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>"); | ||
1901 | - html2canvas($("#canvasDiv"), { | ||
1902 | - onrendered: function (canvas) { | ||
1903 | - var imgsrc = canvas.toDataURL("image/png"); | ||
1904 | - console.log(imgsrc); | ||
1905 | - var html = '<div id="img"><img src="' + imgsrc + '" id="newimg" style="margin:auto;top:0px;left:0px;right:0px;position:absolute;border:1px solid #ccc;" /></div>'; | ||
1906 | - var w = window.open(); | ||
1907 | - $(w.document.body).html(html); | ||
1908 | - $("#filename").val(""); | ||
1909 | - } | ||
1910 | - }); | ||
1911 | - } | ||
1912 | - else { | ||
1913 | - $("#canvasDiv").append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>"); | 1942 | + $("#canvasDiv").append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>"); |
1914 | html2canvas($("#canvasDiv"), { | 1943 | html2canvas($("#canvasDiv"), { |
1915 | onrendered: function (canvas) { | 1944 | onrendered: function (canvas) { |
1916 | theCanvas = canvas; | 1945 | theCanvas = canvas; |
@@ -1926,7 +1955,7 @@ | @@ -1926,7 +1955,7 @@ | ||
1926 | } | 1955 | } |
1927 | }); | 1956 | }); |
1928 | $(".export-image").css("display", "none"); | 1957 | $(".export-image").css("display", "none"); |
1929 | - } | 1958 | + |
1930 | }); | 1959 | }); |
1931 | }); | 1960 | }); |
1932 | function dataURItoBlob(dataURI) { | 1961 | function dataURItoBlob(dataURI) { |