Skip to content

Commit

Permalink
Use newer version of html2canvas directly for now
Browse files Browse the repository at this point in the history
It takes better quality "screenshots" of html elements.

Found it from here:
niklasvh/html2canvas#1087 (comment)

If that gets merged in then I'll stop using a custom build.
  • Loading branch information
mikavilpas committed Jul 18, 2017
1 parent 0c25d68 commit eff1011
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
1 change: 0 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
[cljsjs/react-select "1.0.0-rc.3" :exclusions [cljsjs/react]]
[cljsjs/react-bootstrap "0.31.0-0"]
[quil "2.6.0"]
[cljsjs/html2canvas "0.4.1-0"]
[cljsjs/download "1.4.6-0"]]

:plugins [[lein-figwheel "0.5.9"]
Expand Down
1 change: 1 addition & 0 deletions resources/public/cards.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<link rel="stylesheet" href="https://unpkg.com/react-select/dist/react-select.css">
</head>
<body>
<script src="/js/html2canvas.min.js" type="text/javascript"></script>
<script src="/js/compiled/squanmate_devcards.js" type="text/javascript"></script>
</body>
</html>
1 change: 1 addition & 0 deletions resources/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</head>
<body>
<div id="main-app-area"></div>
<script src="/js/html2canvas.min.js" type="text/javascript"></script>
<script src="./js/compiled/squanmate.js" type="text/javascript"></script>
</body>
</html>
10 changes: 10 additions & 0 deletions resources/public/js/html2canvas.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/squanmate/ui/exporting.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns squanmate.ui.exporting
(:require [cljsjs.html2canvas]
[cljsjs.download :as download]))
(:require [cljsjs.download :as download]))

(defn download-html-node-as-png [& {:keys [id-string filename]}]
(let [node (js/document.getElementById id-string)]
Expand Down

0 comments on commit eff1011

Please sign in to comment.