Created
November 1, 2013 06:53
-
-
Save ntr-808/7261760 to your computer and use it in GitHub Desktop.
manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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