This file ISN'T part of Snap!. It's only plug-in made by ~DeKrain
Types of query:
exts = ['#']
Query function:
window.$s = (
query string
query,
optional world
wrld
) ->
ext = query[0]
world = wrld or window.world
result = undefined
ext = '[default]' if exts.indexOf(ext) is -1
query = query[1..] if ext isnt '[default]'
allchilds = world.allChildren()
switch ext
when '#'
result = allchilds.filter (child) ->
sprite name, etc.
child.name is query or
dialog boxes
child.key is query or
blocks
child.selector is query
Class:
else
result = allchilds.filter (child) -> child.constructor.name is query
if result.length > 1 then result else (if result.length isnt 0 then result[0] else null)