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
# Layer::createChildrenRefs | |
# Creates convenience refs on targetd layers from the design tab so that we don't have to use Layer::childrenWithName. | |
# Pass recursive=true to do this for all descendant layers while maintaining hierarchy. | |
Layer::createChildrenRefs = (recursive=false, camelCase=true, ignoreLayers=true) -> | |
for layer in @children | |
# Filter any layer with a name starting with '_' as 'private layers'. | |
unless ignoreLayers is false | |
if _.startsWith(layer.name, '_') | |
return true |
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
# Layer::createChildrenRefs | |
# Creates convenience refs on targetd layers from the design tab so that we don't have to use Layer::childrenWithName. | |
# Pass recursive=true to do this for all descendant layers while maintaining hierarchy. | |
Layer::createChildrenRefs = (recursive=false) -> | |
for layer in @children | |
# Get layer name for the key | |
key = layer.name | |
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
send = -> | |
xhr = new XMLHttpRequest | |
url = baseUrl | |
xhr.open 'POST', url, true | |
xhr.setRequestHeader 'Content-type', 'application/json' | |
xhr.setRequestHeader 'Authorization', 'Bearer ' + accessToken | |
xhr.onreadystatechange = -> | |
if xhr.readyState == 4 and xhr.status == 200 | |
print JSON.parse(xhr.responseText) |
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
if Utils.isDesktop() is true | |
HTMLPreviewBackground = new Layer | |
backgroundColor: "#2d383e" | |
HTMLPreview = Screen | |
Screen = new Layer | |
width: 750 | |
height: 1334 | |
clip: true |
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
# This is my first full blow coffeescript class Im working on | |
# thoughts? | |
class Request | |
constructor: -> | |
@xhrObjects = [ | |
-> new XMLHttpRequest() | |
-> new ActiveXObject("Msxml2.XMLHTTP") | |
-> new ActiveXObject("Microsoft.XMLHTTP") | |
] |