Sha256: 064a6fe63e5150d4bc413c767d0b54c822e9c158edec11eefd7bafcfc1176f79

Contents?: true

Size: 724 Bytes

Versions: 2

Compression:

Stored size: 724 Bytes

Contents

class window.TS.LinkFinder
  constructor: (@elements) ->

  enable: ->
    setTimeout(->
      $('.ts-link-finder, .medium-editor-toolbar-input').textcomplete [
        {
          match: /^\/(\w*)$/
          index: 1
          search: (term, callback) ->
            $.ajax
              method: 'GET'
              url: window.TS.ADMIN_PAGES_URL
              dataType: 'json'
              contentType: 'application/json'
              data: {path: term}
              success: (data, status) -> 
                callback(data.pages)
          replace: (page) -> page.path#.substring(1)
          template: (page) -> "#{page.title} (#{page.path})"
        }
      ], 
        zIndex: 10000
    , 500)
    
  disable: ->

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
type_station-0.1.3 app/assets/javascripts/type_station/editables/link_finder.js.coffee
type_station-0.1.1 app/assets/javascripts/type_station/editables/link_finder.js.coffee