Skip to content

Instantly share code, notes, and snippets.

@ntr-808
Created November 1, 2013 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntr-808/7261760 to your computer and use it in GitHub Desktop.
Save ntr-808/7261760 to your computer and use it in GitHub Desktop.
manager
# Webclient.ViewManager
# Usage:
# chatView: new Webclient.ViewManager.view('ChatView') @model
# rotateNotice: Webclient.ViewManager.el('ClientRotateNotice')
ChatViewDesktop = require './ChatViewDesktop'
ChatViewMobile = require './ChatViewMobile'
module.exports = class ViewManager
constructor: (format) ->
@format = format
@views =
{
ChatView:
desktop: ChatViewDesktop
mobile: ChatViewMobile
}
@els = {
ClientRotateNotice:
desktop: $ "<span class='blanketNotice-text'>Please rotate your screen to landscape position to play <span class='blanketNotice-textLink'>or go back to Lobby</span></span>"
mobile: $ "<span class='blanketNotice-text'>Please increase your browser width to play <span class='blanketNotice-textLink'>or go back to Lobby</span></span>"
}
view: (id) =>
return @views[id][@format]
view: (id) =>
return @els[id][@format]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment