Created
July 4, 2017 13:19
-
-
Save marckrenn/04aaf5c1ca75c56412468721fa4d5511 to your computer and use it in GitHub Desktop.
testDrive snippet for Framer
This file contains hidden or 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
plugin.run = (contents, options) -> | |
""" | |
# <fold> | |
# Include testDrive + Instructions | |
td = "testDrive.js" | |
if localStorage.getItem(td)? | |
exports = window | |
eval(localStorage.getItem(td)) | |
else | |
Utils.domLoadData "http://krenn.me/td.js", (err, module) -> | |
localStorage.setItem(td, module) | |
window.location.reload() | |
# • LOG AVAILABLE MODULES (see Inspect → Console) | |
#testDrive.availableModules (modules) -> console.log(modules) | |
# • USAGE: | |
# testDrive.modules [<availableModules>] | |
# or | |
# testDrive.module "<availableModule>" | |
# or just type e.g. | |
# fb = new Firebase # and wait 2-3 seconds, "Autopilot"-feature | |
# • NOTE: All module-classes, -methods and -functions are added to your project's global scope, so you may not use the usual yourModule.function-prefix! | |
# • UPDATE testDrive (de-comment temporarily) | |
#localStorage.removeItem(td) | |
# </fold> | |
#{contents} | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment