Permalink
Browse files

Add autocomplete example

  • Loading branch information...
koenbok committed Apr 2, 2015
1 parent 42b6bf1 commit 3098d23630b758f65d5afcaef65038c504463e49
Showing with 531 additions and 0 deletions.
  1. +30 −0 test/studio/Autocomplete.framer/.gitignore
  2. +54 −0 test/studio/Autocomplete.framer/app.coffee
  3. +12 −0 test/studio/Autocomplete.framer/framer/coffee-script.js
  4. +8 −0 test/studio/Autocomplete.framer/framer/config.json
  5. +126 −0 test/studio/Autocomplete.framer/framer/framer.init.js
  6. +14 −0 test/studio/Autocomplete.framer/framer/framer.js
  7. BIN test/studio/Autocomplete.framer/framer/images/background.png
  8. BIN test/studio/Autocomplete.framer/framer/images/cursor.png
  9. BIN test/studio/Autocomplete.framer/framer/images/cursor@2x.png
  10. BIN test/studio/Autocomplete.framer/framer/images/icon-120.png
  11. BIN test/studio/Autocomplete.framer/framer/images/icon-152.png
  12. BIN test/studio/Autocomplete.framer/framer/images/icon-180.png
  13. BIN test/studio/Autocomplete.framer/framer/images/icon-192.png
  14. BIN test/studio/Autocomplete.framer/framer/images/icon-76.png
  15. BIN test/studio/Autocomplete.framer/framer/images/icon-arrow.png
  16. BIN test/studio/Autocomplete.framer/framer/images/icon-arrow@2x.png
  17. BIN test/studio/Autocomplete.framer/framer/images/icon-close.png
  18. BIN test/studio/Autocomplete.framer/framer/images/icon-close@2x.png
  19. BIN test/studio/Autocomplete.framer/framer/images/icon-framer.png
  20. BIN test/studio/Autocomplete.framer/framer/images/icon-framer@2x.png
  21. BIN test/studio/Autocomplete.framer/framer/images/icon-share.png
  22. BIN test/studio/Autocomplete.framer/framer/images/icon-share@2x.png
  23. +196 −0 test/studio/Autocomplete.framer/framer/mirror.css
  24. +44 −0 test/studio/Autocomplete.framer/framer/style.css
  25. +1 −0 test/studio/Autocomplete.framer/framer/version
  26. BIN test/studio/Autocomplete.framer/images/framer-icon.png
  27. +36 −0 test/studio/Autocomplete.framer/index.html
  28. +10 −0 test/studio/Autocomplete.framer/modules/myModule.coffee
@@ -0,0 +1,30 @@
# Default Framer gitignore file
# Mac specific
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Framer specific
.temp.html
framer/*.old.*
framer/backup.coffee
framer/backup/*
framer/.*.hash
@@ -0,0 +1,54 @@
document.body.style.cursor = "auto"
OUTPUT = []
layer = new Layer
size: Screen.size
backgroundColor: "white"
ignoreEvents: false
layer.scrollVertical = true
print = (args...) ->
layer.html += args.join(" ") + "<br>"
framerObjects = [
"Layer",
"BackgroundLayer",
"VideoLayer",
"Animation",
"ScrollComponent",
"PageComponent",
"SliderComponent",
"DeviceComponent",
]
# All the Framer objects
for cls in framerObjects
print ""
print cls
instance = new Framer[cls]
keys = for k, v of instance
continue if _.startsWith(k, "_")
continue if _.startsWith(k, "get")
continue if _.startsWith(k, "set")
k
print keys.join(" ")
layer.bringToFront()
Utils.delay .1, ->
layer._element.scrollTop = layer._element.scrollHeight
layer.style =
color: "black"
font: "14px/1.5em Menlo"
padding: "30px"
"-webkit-user-select": "auto"
"pointer-events": "auto"
layer._elementHTML.style["-webkit-user-select"] = "auto"

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,8 @@
{
"updateDelay" : 0.3,
"deviceScale" : -1,
"deviceOrientation" : 0,
"contentScale" : 1,
"sharedPrototype" : 0,
"deviceType" : "fullscreen"
}
@@ -0,0 +1,126 @@
(function() {
function isFileLoadingAllowed() {
return (window.location.protocol.indexOf("file") == -1)
}
function isHomeScreened() {
return ("standalone" in window.navigator) && window.navigator.standalone == true
}
function isCompatibleBrowser() {
return Utils.isWebKit()
}
var alertNode;
function dismissAlert() {
alertNode.parentElement.removeChild(alertNode)
loadProject()
}
function showAlert(html) {
alertNode = document.createElement("div")
alertNode.classList.add("framerAlertBackground")
alertNode.innerHTML = html
document.addEventListener("DOMContentLoaded", function(event) {
document.body.appendChild(alertNode)
})
window.dismissAlert = dismissAlert;
}
function showBrowserAlert() {
var html = ""
html += "<div class='framerAlert'>"
html += "<strong>Error: Not A WebKit Browser</strong>"
html += "Your browser is not supported. <br> Please use Safari or Chrome.<br>"
html += "<a class='btn' href='javascript:void(0)' onclick='dismissAlert();'>Try anyway</a>"
html += "</div>"
showAlert(html)
}
function showFileLoadingAlert() {
var html = ""
html += "<div class='framerAlert'>"
html += "<strong>Error: Local File Restrictions</strong>"
html += "Preview this prototype with Framer Mirror or learn more about "
html += "<a href='https://github.com/koenbok/Framer/wiki/LocalLoading'>file restrictions</a>.<br>"
html += "<a class='btn' href='javascript:void(0)' onclick='dismissAlert();'>Try anyway</a>"
html += "</div>"
showAlert(html)
}
function showHomeScreenAlert() {
link = document.createElement("link");
link.href = "framer/mirror.css"
link.type = "text/css"
link.rel = "stylesheet"
link.media = "screen"
document.addEventListener("DOMContentLoaded", function(event) {
document.getElementsByTagName("head")[0].appendChild(link)
})
var html = ""
html += "<figure class='icon-close' href='javascript:void(0)' onclick='dismissAlert();'></figure>"
html += "<section class='wrapper'>"
html += "<figure class='icon-framer'></figure><h1>Install Prototype</h1>"
html += "<p>Tap <div class='share'><figure class='icon-share'></figure> Share</div>, then choose 'Add to Home Screen'</p> "
html += "<section class='arrow'><figure class='icon-arrow'></figure></section>"
html += "</section>"
showAlert(html)
}
function loadProject() {
CoffeeScript.load("app.coffee")
}
function setDefaultPageTitle() {
// If no title was set we set it to the project folder name so
// you get a nice name on iOS if you bookmark to desktop.
document.addEventListener("DOMContentLoaded", function() {
if (document.title == "") {
if (window.FramerStudioInfo && window.FramerStudioInfo.documentTitle) {
document.title = window.FramerStudioInfo.documentTitle
} else {
document.title = window.location.pathname.replace(/\//g, "")
}
}
})
}
function init() {
if (Utils.isFramerStudio()) {
return
}
setDefaultPageTitle()
if (!isCompatibleBrowser()) {
return showBrowserAlert()
}
if (!isFileLoadingAllowed()) {
return showFileLoadingAlert()
}
// if (Utils.isMobile() && !isHomeScreened()) {
// return showHomeScreenAlert()
// }
loadProject()
}
init()
})()

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit 3098d23

Please sign in to comment.