Permalink
Browse files

Killed the webchat widget - just made the irc chat button a simple ne…

…w window link to the irc chat website
  • Loading branch information...
balupton committed Feb 10, 2013
1 parent b0d92f9 commit 690b77eaecee039007de15f2a98a44674e683b3a
@@ -49,6 +49,10 @@ class BevryApp
window.open(url,'_blank')
else if action is 'same'
wait(100, -> document.location.href = url)
+ else if action is 'default'
+ # ignore, and handle by the browser
+ else
+ console?.log?('unknown link action', action)
# Chain
@
@@ -73,10 +77,10 @@ class BevryApp
return @ unless url
# Discover how we should handle the link
- if event.which is 2 or event.metaKey
+ if event.which is 2 or event.metaKey or event.shiftKey
action = 'default'
else
- action = 'same'
+ action = 'new'
event.preventDefault()
# Open the link
@@ -5,51 +5,6 @@ standalone: true
# App
class App extends BevryApp
- # Dom Ready
- onDomReady: =>
- $webchat = $('.webchat')
- $iframe = $webchat.find('iframe')
- $wrapper = $webchat.find('.wrapper')
- $close = $webchat.find('.close')
- $open = $webchat.find('.open')
-
- normalizeHeights = ->
- wrapperIsVisible = $wrapper.is(':visible')
- if wrapperIsVisible
- $webchat.add($iframe,$wrapper)
- .height(Math.max($iframe.height(),500))
- .width(Math.max($iframe.width(),350))
- else
- $webchat.add($iframe,$wrapper)
- .height($open.height())
- .width($open.width())
-
- $wrapper
- .hide()
- .resizable(
- alsoResize: $iframe
- handles: "e"
- )
- .on 'resizestart', ->
- $iframe.hide()
- .on 'resizestop', (event,ui) ->
- $webchat.add($iframe).height(ui.size.height)
- $webchat.add($iframe).width(ui.size.width)
- $iframe.show()
- $close.add($open)
- .on 'click', (event) ->
- event.preventDefault()
- event.stopImmediatePropagation()
- $wrapper.toggle()
- $open.toggle()
- normalizeHeights()
-
- $webchat.show()
- normalizeHeights()
-
- # Super
- super
-
# State Change
stateChange: (event,data) =>
# Check
@@ -287,42 +287,17 @@ nav li
.webchat
position: fixed
- left: 0%
+ left: 0
bottom: 0
- width: 100%
- height: 500px
- display: none
- .wrapper
- border: 1px solid hsl(209, 32%, 82%)
- background: hsl(209, 70%, 94%)
- width: 30%
- height: 500px
- iframe
- background: white
- border: none
- width: 100%
- height: 500px
- .close
- position: absolute
- top: 0
- right: 0
- width: 20px
- height: 20px
- padding-top:3px
- cursor: pointer
- text-align: center
- .open
- display: block
- position: absolute
- bottom: 0
- left: 0
- width: 100px
- height: 25px
- cursor: pointer
- border: 1px solid hsl(209, 32%, 82%)
- background: hsl(209, 70%, 94%)
- text-align: center
- padding-top: 0.3em
+
+ width: 100px
+ height: 25px
+
+ cursor: pointer
+ border: 1px solid hsl(209, 32%, 82%)
+ background: hsl(209, 70%, 94%)
+ text-align: center
+ padding-top: 0.3em
@@ -23,9 +23,4 @@ footer '.bottombar', ->
for own page, url of @navigation.bottom
a href: url, -> page
-aside '.webchat', ->
- div '.wrapper', ->
- iframe src:'http://webchat.freenode.net/?randomnick=1&channels=docpad', ->
- div '.close', -> text 'X'
- a '.open', href:'http://webchat.freenode.net/?channels=docpad', ->
- text 'IRC Chat'
+a '.webchat', href:'http://webchat.freenode.net/?channels=docpad', target:'_blank', -> 'IRC Chat'

0 comments on commit 690b77e

Please sign in to comment.