Sha256: b4f8028548bf8806c74eb265bb73210619d7e20fd0c7e26f25b40de5a4df8bf5

Contents?: true

Size: 1.27 KB

Versions: 44

Compression:

Stored size: 1.27 KB

Contents

jQuery ($) ->
  displayIgnoreCiMessage = ->
    ignoreCiMessage = $(".ignoring-ci")
    return unless ignoreCiMessage
    $('.dismiss-ignore-ci-warning').click (event) ->
      event.preventDefault()
      dismissIgnoreCiMessage()

    if localStorage.getItem(getLocalStorageKey())
      ignoreCiMessage.hide()

  dismissIgnoreCiMessage = ->
    localStorage.setItem(getLocalStorageKey(), true)
    ignoreCiMessage = $(".ignoring-ci")
    ignoreCiMessage.hide() if ignoreCiMessage

  getLocalStorageKey = ->
    stackName = $('.repo-name').data('repo-full-name')
    "ignoreCIDismissed" + stackName

  displayIgnoreCiMessage()

  updatePage = (message) ->
    payload = JSON.parse(message.data)
    $('[data-layout-content]').load("#{payload.url} [data-layout-content] > *", -> $('time[data-time-ago]').timeago())

  retries = 0
  listenToEventSource = (url) ->
    source = new EventSource(url)
    source.addEventListener 'stack.update', updatePage
    interval = setInterval ->
      switch source.readyState
        when source.CLOSED
          clearInterval(interval)
          if retries > 0
            retries -= 1
            listenToEventSource(url)
        else
          retries = 2
    , 30000

  $('[data-event-stream]').each ->
    listenToEventSource($(this).data('event-stream'))

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
shipit-engine-0.15.0 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.14.0 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.13.0 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.12.1 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.12.0 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.11.0 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.10.0 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.9.0 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.8.9 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.8.8 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.8.7 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.8.6 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.8.5 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.8.4 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.8.3 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.8.2 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.8.1 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.8.0 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.7.0 app/assets/javascripts/shipit/stacks.js.coffee
shipit-engine-0.6.4 app/assets/javascripts/shipit/stacks.js.coffee