mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
44 lines
1.3 KiB
CoffeeScript
44 lines
1.3 KiB
CoffeeScript
{Chrome, File, Dir, Process} = require 'lib/osx'
|
|
|
|
exports.show = ->
|
|
root = OSX.NSBundle.mainBundle.resourcePath + '/HTML/'
|
|
html = OSX.NSString.stringWithContentsOfFile "#{root}/tabs.html"
|
|
|
|
Chrome.addPane('main', html)
|
|
|
|
# awesome hover effect
|
|
if false
|
|
$('#tabs ul li:not(".active") a').mousemove (e) ->
|
|
originalBG = $(this).css("background-color")
|
|
x = e.pageX - @offsetLeft
|
|
y = e.pageY - @offsetTop
|
|
xy = x + " " + y
|
|
|
|
bgWebKit = "-webkit-gradient(radial, #{xy}, 0, #{xy}, 100, from(rgba(255,255,255,0.8)), to(rgba(255,255,255,0.0))), #{originalBG}"
|
|
|
|
$(this).css background: bgWebKit
|
|
|
|
$('#tabs ul li:not(".active") a').mouseleave (e) ->
|
|
$(this).removeAttr 'style'
|
|
|
|
# events
|
|
$('#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
|