omg new tab

This commit is contained in:
Chris Wanstrath
2011-08-23 23:20:50 -07:00
parent f57d112098
commit af8b09cc2b
4 changed files with 40 additions and 9 deletions

View File

@@ -1,3 +1,5 @@
# nice!
Chrome.init()
editor = ace.edit "editor"

View File

@@ -16,11 +16,22 @@ if false
$(this).removeAttr 'style'
# events
$('#tabs ul a').click ->
$('#tabs ul li:not(.add) a').live 'click', ->
$('#tabs ul .active').removeClass()
$(this).parents('li').addClass 'active'
idx = $('#tabs ul a').index this
$('.content iframe').hide().eq(idx).show().focus()
false
$('#tabs .add a').click ->
$('#tabs ul .active').removeClass()
$('#tabs ul .add').before '<li><a href="#">untitled</a></li>'
$('.content iframe').hide()
$('.content').append '<iframe src="editor.html" width="100%" height="100%"></iframe>'
$('#tabs ul .add').prev().addClass 'active'
false