Skip to content

Instantly share code, notes, and snippets.

@fredsterss
Created July 6, 2012 20:22
Show Gist options
  • Save fredsterss/3062570 to your computer and use it in GitHub Desktop.
Save fredsterss/3062570 to your computer and use it in GitHub Desktop.
Phail
checkTurk: () ->
# If the turk browser chars do not match assignment requirements, redirect
requirements = @assignmentModel.get('requirements')
if /\d/.test(requirements.browser) is true and requirements.browser != (@browser.browser + @browser.version)
# The beef is requirements does not appear in the view
new JobHoldingView({ assignmentId: @assignment, state: @state, browser: @browser, requirements: 'lol' })
# or when the version is not required but the browser doesn't match
else if /\d/.test(requirements.browser) is false and requirements.browser != @browser.browser
new JobHoldingView({ assignmentId: @assignment, state: @state, browser: @browser })
# Otherwise render the frame
else
@renderFrame()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment