<commit_before>window.JobsListApp = class JobsListApp extends Backbone.Model

  initialize: ->
    window.jobsList = new JobsList()

  bootstrap: ->
    # add the paragraph which will contain the add to list link or text
    addToListParagraphElements = $('<p class="add-to-list" />').appendTo('li.job div.job-options')

    # live bind to the add to list links, so the binding updates as they're added and removed
    $('p.add-to-list a').live('click', ->
      jobsList.create($(this).parents('li').data())
      return false
    )

    # if anything changes in the jobsList, then refresh the add to list links
    jobsList.bind('all', ->
      $('p.add-to-list').html('<a href="#">Add to list</a>')

      _.each(jobsList.models, (job) ->
        $("li.job[data-id='#{job.id}'] p.add-to-list").text("Already in list")
      )
    )

    # finally, extract what we've already got in localstorage
    jobsList.fetch()

    # now build out the jobs list
    jobsListContainer = $('<div class="job-bookmarks-position" />')
    $('div.search-container').after(jobsListContainer)
    jobsListContent = $('<div class="job-bookmarks" />').appendTo(jobsListContainer)

    jobsListView = new JobsListView(model: jobsList, el: jobsListContent)
    jobsListView.render()

<commit_msg>span for disabled add to list buttons<commit_after>window.JobsListApp = class JobsListApp extends Backbone.Model

  initialize: ->
    window.jobsList = new JobsList()

  bootstrap: ->
    # add the paragraph which will contain the add to list link or text
    addToListParagraphElements = $('<p class="add-to-list" />').appendTo('li.job div.job-options')

    # live bind to the add to list links, so the binding updates as they're added and removed
    $('p.add-to-list a').live('click', ->
      jobsList.create($(this).parents('li').data())
      return false
    )

    # if anything changes in the jobsList, then refresh the add to list links
    jobsList.bind('all', ->
      $('p.add-to-list').html('<a href="#">Add to list</a>')

      _.each(jobsList.models, (job) ->
        $("li.job[data-id='#{job.id}'] p.add-to-list").html("<span class='disabled'>Already in list</span>")
      )
    )

    # finally, extract what we've already got in localstorage
    jobsList.fetch()

    # now build out the jobs list
    jobsListContainer = $('<div class="job-bookmarks-position" />')
    $('div.search-container').after(jobsListContainer)
    jobsListContent = $('<div class="job-bookmarks" />').appendTo(jobsListContainer)

    jobsListView = new JobsListView(model: jobsList, el: jobsListContent)
    jobsListView.render()


{'fraction_non_alphanumeric': 0.15118956254796623, 'fraction_numerical': 0.0, 'mean_word_length': 3.4111675126903553, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 25, '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': '5625362', 'n_tokens_mistral': 824, 'n_tokens_neox': 779, 'n_words': 215}