confirmBlacklistUser.js

From disqus.com, 8 Months ago, written in JavaScript, viewed 3 times. This paste is a reply to BaseSettings.js from disqus.com - go back
URL https://pastebin.freepbx.org/view/eda38f56/diff Embed
Viewing differences between BaseSettings.js and confirmBlacklistUser.js
define('home/models/common/BaseSettings',[
    'underscore',
    'backbone',

    'home/models/Session',
], function (
    _,
    Backbone,

    Session
define('home/templates/confirmBlacklistUser',['handlebars', 'handlebars.partials', 'core/extensions/handlebars.helpers'], function(Handlebars) {

return Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) 
{
    'use strict';

    
var BaseSettings = Backbone.Model.extend({
        shouldFetch: function () {
            
alias1=depth0 != null ? depth0 : {}, alias2=container.escapeExpression;

  
return !this.fetched && !this.fetching;
        },

        ensureFetched: function () {
            if (!this.shouldFetch())
                return;

            var self = this;
            self.fetching = true;
            self.fetch({
                success: function () {
                    self.fetched = true;
                    self.fetching = false;
                },
                error: function () {
                    self.fetched = false;
                    self.fetching = false;
                },
            });
        },

        toFormData: function (attrs) {
            attrs = attrs || this.toJSON();
            return _.reduce(attrs, function (formData, value, key) {
                formData.append(key, _.isString(value) 
"<div class=\"modal-header\">\n<h4 class=\"modal-title\">"
    + alias2(helpers.gettext.call(alias1,"Ban %(username)s?",{"name":"gettext","hash":{"username":helpers.tag.call(alias1,"b",{"name":"tag","hash":{"text":(depth0 != null 
value.trim() depth0.username value);
                return formData;
            }, new window.FormData());
        },

        // set 
depth0)},"data":data})},"data":data}))
    + "</h4>\n</div>\n<div class=\"modal-body\">\n<p>"
    + alias2(helpers.gettext.call(alias1,"Click Confirm 
to true if form has a file upload input field
        useMultiPartForm: false,

        save: function (attrs, options) {
            attrs = attrs || this.toJSON();
            options = options || {};
            if (this.useMultiPartForm) {
                options.data = this.toFormData(attrs);
                options.contentType = false;
            }
            options.beforeSend = this.setCSRFHeader;
            return Backbone.Model.prototype.save.call(this, attrs, options);
        },

        setCSRFHeader: function (xhr, settings) {
            var csrftoken = Session.get().getCsrfToken();
            if (!/^(GET|HEAD|OPTIONS|TRACE)$/.test(settings.type))
                xhr.setRequestHeader('X-CSRFToken', csrftoken);
        },

        destroy: function (options) {
            options = options || {};
            options.beforeSend = this.setCSRFHeader;
            return Backbone.Model.prototype.destroy.call(this, options);
        },
    });

    return BaseSettings;
});


ban and remove this user's recent comments and discussions. This user will no longer be able to post comments.",{"name":"gettext","hash":{},"data":data}))
    + "</p>\n</div>\n";
},"useData":true})

});
// https://c.disquscdn.com/next/82c6de3/home/js/models/common/BaseSettings.com/next/82c6de3/home/js/templates/confirmBlacklistUser.js

Replies to confirmBlacklistUser.js rss

Title Name Language When
backboneUtils.js disqus.com javascript 8 Months ago.

Reply to "confirmBlacklistUser.js"

Here you can reply to the paste above