Sha256: 6d2bbd60cbeedccf02dd85f1f97a77086b4c860eabbf63b95cd741643d89a824

Contents?: true

Size: 1.09 KB

Versions: 62

Compression:

Stored size: 1.09 KB

Contents

/**
 * @namespace WORKAREA.jQuery
 */
WORKAREA.registerModule('jQuery', (function () {
    'use strict';

    var createXhrWithoutXhrHeader = function () {
            // Get new xhr object using default factory
            var xhr = jQuery.ajaxSettings.xhr();

            // Copy the browser's native setRequestHeader method
            var setRequestHeader = xhr.setRequestHeader;

            // Replace with a wrapper
            xhr.setRequestHeader = function(name, value) {
                // Ignore the X-Requested-With header
                if (name === 'X-Requested-With' || name === 'If-None-Match') {
                    return;
                }

                // Otherwise call the native setRequestHeader method
                // Note: setRequestHeader requires its 'this' to be the xhr
                // object, which is what 'this' is here when executed.
                setRequestHeader.call(this, name, value);
            };

            // pass it on to jQuery
            return xhr;
        };

    return {
        createXhrWithoutXhrHeader: createXhrWithoutXhrHeader
    };
}()));

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.15 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.4.36 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.5.14 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.4.35 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.5.13 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.4.34 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.5.12 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.4.33 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.5.11 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.5.10 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.4.32 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.5.9 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.4.31 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.5.8 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.4.30 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.5.7 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.4.29 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.5.6 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.4.28 app/assets/javascripts/workarea/core/modules/jquery.js
workarea-core-3.5.5 app/assets/javascripts/workarea/core/modules/jquery.js