Browse files

Delete useless code files. Relocate remotestart code to the frontpage…

… file
  • Loading branch information...
1 parent 379f9ee commit 66d4011965479cf7e192d831d8a4c45814b2cd63 @jpkorhonen jpkorhonen committed Jul 26, 2012
Showing with 44 additions and 98 deletions.
  1. +44 −0 client/frontpage.coffee
  2. +0 −46 client/remotestart.coffee
  3. +0 −24 client/stylesheets/remotestart.styl
  4. +0 −2 configure.coffee
  5. +0 −22 views/remote-start.jade
  6. +0 −4 whiteboard.coffee
View
44 client/frontpage.coffee
@@ -1,7 +1,51 @@
+server = window.location.protocol + "//" + window.location.host
+
+socket = io.connect().of("/remote-start")
+
+socket.on "open-browser", (opts) ->
+ window.open server + opts.url
+
+currentRemoteKey = ""
$ ->
buttons = $("form input[type='submit']")
buttons.bind "tap", ->
$(this).click()
+ $(".startProjector input[type=submit]").click ->
+ newRemoteKey = $('.startProjector [name=remoteKey]').val()
+ e = $('.projectorInfo')
+ e.css 'top', $(this).position().top + $(this).height() - e.height()
+ $('.projectorInfo input[name=remoteKey]').val(newRemoteKey)
+ $('.cameraId').html(newRemoteKey)
+ e.show()
+ $('.pageOverlay').show()
+ startListening newRemoteKey
+ false
+
+ $(".projectorInfo input[type=submit]").click ->
+ newRemoteKey = $('.projectorInfo input[name=remoteKey]').val()
+ $('.cameraId').html(newRemoteKey)
+ startListening newRemoteKey
+ false
+
+ $(".projectorInfo a.close").click ->
+ if currentRemoteKey isnt ""
+ socket.emit "leave-desktop", { remote_key: currentRemoteKey }
+ currentRemoteKey = ""
+ $('.startProjector [name=remoteKey]').val("")
+ $('.projectorInfo').hide(500)
+ $('.pageOverlay').hide()
+ false
+
+startListening = (newRemoteKey) ->
+ if currentRemoteKey isnt ""
+ socket.emit "leave-desktop", { remote_key: currentRemoteKey }
+ socket.emit "join-desktop", { remote_key: newRemoteKey }
+ # Set client resolution
+ socket.emit "set resolution",
+ width: $(window).width(),
+ height: $(window).height()
+ currentRemoteKey = newRemoteKey
+
View
46 client/remotestart.coffee
@@ -1,46 +0,0 @@
-console.log "walma-remote-start"
-
-server = window.location.protocol + "//" + window.location.host
-
-socket = io.connect().of("/remote-start")
-
-socket.on "open-browser", (opts) ->
- console.log "Open new window"
- window.open server + opts.url
-
-currentRemoteKey = ""
-
-$ ->
- $(".startProjector input[type=submit]").click ->
- newRemoteKey = $('.startProjector [name=remoteKey]').val()
- e = $('.projectorInfo')
- e.css 'top', $(this).position().top + $(this).height() - e.height()
- $('.projectorInfo input[name=remoteKey]').val(newRemoteKey)
- $('.cameraId').html(newRemoteKey)
- e.show()
- $('.pageOverlay').show()
- startListening newRemoteKey
- false
- $(".projectorInfo input[type=submit]").click ->
- newRemoteKey = $('.projectorInfo input[name=remoteKey]').val()
- $('.cameraId').html(newRemoteKey)
- startListening newRemoteKey
- false
- $(".projectorInfo a.close").click ->
- if currentRemoteKey isnt ""
- socket.emit "leave-desktop", { remote_key: currentRemoteKey }
- currentRemoteKey = ""
- $('.startProjector [name=remoteKey]').val("")
- $('.projectorInfo').hide(500)
- $('.pageOverlay').hide()
- false
-
-startListening = (newRemoteKey) ->
- if currentRemoteKey isnt ""
- socket.emit "leave-desktop", { remote_key: currentRemoteKey }
- socket.emit "join-desktop", { remote_key: newRemoteKey }
- # Set client resolution
- socket.emit "set resolution",
- width: $(window).width(),
- height: $(window).height()
- currentRemoteKey = newRemoteKey
View
24 client/stylesheets/remotestart.styl
@@ -1,24 +0,0 @@
-
-
-.content
- width 500px
- text-align center
- margin 0px auto
-
- margin-top 5em
-
-
- h1
- margin-bottom 1em
- font-size 30pt
-
- h2
- font-size 20pt
- margin 1em
-
-
- input
- width 100%
- height 4em
- font-size 20pt
-
View
2 configure.coffee
@@ -73,8 +73,6 @@ exports.setUp = (app, io) ->
js.addFile "frontpage", clientFiles + "/frontpage.coffee"
css.addFile "frontpage", clientFiles + "/stylesheets/frontpage.styl"
- js.addFile "remotestart", clientFiles + "/remotestart.coffee"
- css.addFile "remotestart", clientFiles + "/stylesheets/remotestart.styl"
View
22 views/remote-start.jade
@@ -1,22 +0,0 @@
-!!! 5
-html(lang="en")
- head
- title Walma Whiteboard
- !{renderStyleTags("remotestart")}
- !{renderScriptTags("remotestart")}
- body
-
- .content
-
- h1 Walma - remote start
-
- form(action="/remote-start", method="post", accept-charset="utf-8")
- span Remote key
- input.remoteKey(type="text", name="remoteKey")
- input(type="submit", value="Start listening")
-
- .footer
- a(href="http://walma.opinsys.fi") About
-
-
- div.
View
4 whiteboard.coffee
@@ -75,10 +75,6 @@ app.post "/", (req, res) ->
res.setHeader "Location", "/" + req.body.roomName
res.send 302
-app.get "/remote-start", (req, res) ->
- res.render "remote-start.jade",
- layout: false
-
app.get "/delete", (req, res) ->
Drawing.deleteExpiredRooms (err, count) ->
if err

0 comments on commit 66d4011

Please sign in to comment.