Skip to content
Permalink
Browse files

More utils

  • Loading branch information
Koen Bok
Koen Bok committed Apr 4, 2013
1 parent 64dee09 commit f149a9a85a5cf3d28aeb75435792c6d29f1a52aa
Showing with 10 additions and 12 deletions.
  1. +10 −12 src/utils.coffee
@@ -155,6 +155,9 @@ exports.sum = (a) ->
else
0

exports.pointInRect = (point, rect) ->
alert "Not implemented, you lazy man"

exports.uuid = ->

chars = '0123456789abcdefghijklmnopqrstuvwxyz'.split('')
@@ -169,17 +172,12 @@ exports.uuid = ->

output.join('')



exports.isWebKit = ->

isChrome = /Chrome/.test(navigator.userAgent) and \
/Google Inc/.test(navigator.vendor)
isSafari = /Safari/.test(navigator.userAgent) and \
/Apple Computer/.test(navigator.vendor)
window.WebKitCSSMatrix isnt null

return true in [isChrome, isSafari]




exports.isTouch = ->
window.ontouchstart is null

exports.isMobile = ->
(/iphone|ipod|android|ie|blackberry|fennec/).test \
navigator.userAgent.toLowerCase()

0 comments on commit f149a9a

Please sign in to comment.