Last active
August 29, 2015 14:04
-
-
Save selfsame/c09f6123455b5fa6ab19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;saved documents have data for :filesystem, :filepath, :unsaved-changes, :file-uid | |
(defn get-iframe [data] | |
"Returns the iframe element for the given | |
Workspace cursor" | |
(let [id (:iframe-id data)] | |
(.getElementById js/document id))) | |
(defn to-html [element] | |
"Returns the HTML string of the element and it's contents, when given an iframe returns only content HTML.") | |
(defn save [data owner] | |
(let [target (chan) | |
iframe nil | |
html (.inner text iframe)] | |
(dialogue {:callback target | |
:title "save" | |
:view :file-browser | |
:role :save-as}) | |
(go (while true | |
(save-to-system (!< target) html))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment