TimelineFilter.js

From disqus.com, 7 Months ago, written in Plain Text, viewed 3 times.
URL https://pastebin.freepbx.org/view/b82a5b86 Embed
Download Paste or View Raw
  1. define('home/models/TimelineFilter',[
  2.     'backbone',
  3.  
  4.     'core/api',
  5.     'core/config',
  6. ], function (
  7.     Backbone,
  8.  
  9.     api,
  10.     config
  11. ) {
  12.     'use strict';
  13.  
  14.     return Backbone.Model.extend({
  15.  
  16.         urls: {
  17.             'update': api.getURL('timelines/filters/add'),
  18.             'delete': api.getURL('timelines/filters/remove'),
  19.         },
  20.  
  21.         parse: function (response) {
  22.             return response.response || response;
  23.         },
  24.  
  25.         serializeData: function () {
  26.             return {
  27.                 filter: this.id,
  28.                 api_key: config.keys.api,
  29.             };
  30.         },
  31.  
  32.         sync: function (method, model, options) {
  33.             options.emulateHTTP = true;
  34.             options.emulateJSON = false;
  35.             options.processData = true;
  36.             if (method === 'update' || method === 'delete')
  37.                 options.data = model.serializeData();
  38.             options.url = this.urls[method];
  39.             return Backbone.Model.prototype.sync.call(this, method, model, options);
  40.         },
  41.  
  42.     }, {
  43.         // IDs of filters
  44.         FILTER_LIKEPOST: 'likepost',
  45.         FILTER_INVITE: 'invite',
  46.         FILTER_RECOMMEND: 'favoritethread',
  47.         FILTER_THREADREPLIES: 'threadreplies',
  48.         FILTER_MENTIONS: 'mentions',
  49.     });
  50. });
  51.  
  52. // https://c.disquscdn.com/next/82c6de3/home/js/models/TimelineFilter.js

Replies to TimelineFilter.js rss

Title Name Language When
Re: TimelineFilter.js disqus.com javascript 7 Months ago.

Reply to "TimelineFilter.js"

Here you can reply to the paste above