Controller = window.require 'spine/controller'

class EntryController extends Controller
	tag: 'span'
	className: 'browser-entry'
	constructor:->
		super
		# remove the extension from item's title
		itemTitle = @item.name?.replace(/\.[a-zA-Z]{3,4}$/, '') or 'No Title'

		@preview = $('<div class="browser-entry-prew"><span class="browser-entry-icon"></span></div>')
		@info    = $('<div class="browser-entry-info">'+(itemTitle)+'</div>')
		@el.append @preview, @info

	show: =>
		@item.onShow?()

module.exports = EntryController