<commit_before>{SelectListView, $, $$} = require 'atom-space-pen-views'
fs = require 'fs'
shell = require 'shell'

module.exports =
class WebShortcutterView extends SelectListView
  self_: this

  initialize: ->
    super
    @addClass 'overlay from-top'
    @setItems(@getBookmarks())

  getBookmarks: ->
    path = __dirname + '\\bookmark.json'
    JSON.parse fs.readFileSync(path, 'utf8')

  getFilterKey: ->
    'name'

  viewForItem: (item) ->
    "<li>#{item.name}</li>"

  confirmed: (item) ->
    thisPlatform = process.platform
    switch thisPlatform
      when 'win32' then shell.openExternal(item.url)
      when 'darwin' then exec (item.url)
      when 'linux' then exec (item.url)
    @hide();

  cancelled: ->
    @hide();

  show: ->
    @populateList()
    @panel ?= atom.workspace.addModalPanel(item: this)
    @panel.show()
    @focusFilterEditor()<commit_msg>fix bug - To Open bookmarks<commit_after>{SelectListView, $, $$} = require 'atom-space-pen-views'
fs = require 'fs'
open = require 'open'

module.exports =
class WebShortcutterView extends SelectListView
  self_: this

  initialize: ->
    super
    @addClass 'overlay from-top'
    @setItems(@getBookmarks())

  getBookmarks: ->
    path = __dirname + '\\bookmark.json'
    JSON.parse fs.readFileSync(path, 'utf8')

  getFilterKey: ->
    'name'

  viewForItem: (item) ->
    "<li>#{item.name}</li>"

  confirmed: (item) ->
    open item.url
    @hide();

  cancelled: ->
    @hide();

  show: ->
    @populateList()
    @panel ?= atom.workspace.addModalPanel(item: this)
    @panel.show()
    @focusFilterEditor()
{'fraction_non_alphanumeric': 0.15432873274780426, 'fraction_numerical': 0.002509410288582183, 'mean_word_length': 3.175392670157068, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3722196', 'n_tokens_mistral': 547, 'n_tokens_neox': 533, 'n_words': 115}