Sha256: 1c6bf19a5f79cc2891eb3e804588751ee5324c7d43581a6f5cba810423e03ff5

Contents?: true

Size: 906 Bytes

Versions: 1

Compression:

Stored size: 906 Bytes

Contents

Ext.ns('Rwiki.Search');

Rwiki.Search.FuzzyFinderWindow = Ext.extend(Rwiki.Search.Window, {
  constructor: function() {
    Rwiki.Search.FuzzyFinderWindow.superclass.constructor.apply(this, [{
      title: 'FuzzyFinder'
    }]);
  },

  _getDataStore: function() {
    return new Ext.data.Store({
      proxy: new Ext.data.HttpProxy({
        method: 'GET',
        url: '/fuzzy_finder'
      }),

      reader: new Ext.data.JsonReader({
        root: 'results',
        totalProperty: 'count',
        id: 'path'
      }, [
        {name: 'path', mapping: 'path'},
        {name: 'score', mapping: 'score'},
        {name: 'highlighted_path', mapping: 'highlighted_path'}
      ])
    });
  },

  // Custom rendering Template
  _getResultTemplate: function() {
    return new Ext.XTemplate(
      '<tpl for="."><div class="search-item">',
        '{highlighted_path}',
      '</div></tpl>'
    );
  }
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rwiki-0.2.5 public/javascripts/Rwiki/Search/FuzzyFinderWindow.js