 getCurrentWindow = require('electron').remote.getCurrentWindow
 BrowserWindow = require('electron').remote.BrowserWindow
 fs = require 'fs'
+path = require 'path'
 
 module.exports =
 class Viewer extends Disposable

    return true

class PDFView
  constructor: (url) ->
    @element = document.createElement 'iframe'
    @element.setAttribute 'src', url
    @element.setAttribute 'width', '100%'
    @element.setAttribute 'height', '100%'
    @element.setAttribute 'frameborder', 0

  getTitle: ->
    return 'Atom-LaTeX PDF Viewer'

  serialize: ->
    return @element.getAttribute 'src'

    if @tabView? and atom.workspace.paneForItem(@tabView)?
      atom.workspace.paneForItem(@tabView).activateItem(@tabView)
    else
      @tabView = new PDFView(@url,"""#{path.basename(pdfPath)}""")
      atom.workspace.getActivePane().splitRight().addItem(@tabView)

  getUrl: ->
