UNPKG

ddd-jquery

Version:

de-bowerified, de-amdified, de-gruntified... jQuery.

74 lines 3.28 kB
var fireNative, jQuery = this.jQuery || 'jQuery', $ = this.$ || '$', originaljQuery = jQuery, original$ = $; (function () { QUnit.config.urlConfig.push({ id: 'basic', label: 'Bypass optimizations', tooltip: 'Force use of the most basic code by disabling native querySelectorAll; contains; compareDocumentPosition' }); if (QUnit.urlParams.basic) { document.querySelectorAll = null; document.documentElement.contains = null; document.documentElement.compareDocumentPosition = null; document.getElementsByClassName = function () { return [ 0, 1 ]; }; } }()); function q() { var r = [], i = 0; for (; i < arguments.length; i++) { r.push(document.getElementById(arguments[i])); } return r; } function t(a, b, c) { var f = Sizzle(b), s = '', i = 0; for (; i < f.length; i++) { s += (s && ',') + '"' + f[i].id + '"'; } deepEqual(f, q.apply(q, c), a + ' (' + b + ')'); } function url(value) { return value + (/\?/.test(value) ? '&' : '?') + new Date().getTime() + '' + parseInt(Math.random() * 100000); } var createWithFriesXML = function () { var string = '<?xml version="1.0" encoding="UTF-8"?> \t<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" \t\txmlns:xsd="http://www.w3.org/2001/XMLSchema" \t\txmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> \t\t<soap:Body> \t\t\t<jsconf xmlns="http://www.example.com/ns1"> \t\t\t\t<response xmlns:ab="http://www.example.com/ns2"> \t\t\t\t\t<meta> \t\t\t\t\t\t<component id="seite1" class="component"> \t\t\t\t\t\t\t<properties xmlns:cd="http://www.example.com/ns3"> \t\t\t\t\t\t\t\t<property name="prop1"> \t\t\t\t\t\t\t\t\t<thing /> \t\t\t\t\t\t\t\t\t<value>1</value> \t\t\t\t\t\t\t\t</property> \t\t\t\t\t\t\t\t<property name="prop2"> \t\t\t\t\t\t\t\t\t<thing att="something" /> \t\t\t\t\t\t\t\t</property> \t\t\t\t\t\t\t\t<foo_bar>foo</foo_bar> \t\t\t\t\t\t\t</properties> \t\t\t\t\t\t</component> \t\t\t\t\t</meta> \t\t\t\t</response> \t\t\t</jsconf> \t\t</soap:Body> \t</soap:Envelope>'; return jQuery.parseXML(string); }; fireNative = document.createEvent ? function (node, type) { var event = document.createEvent('HTMLEvents'); event.initEvent(type, true, true); node.dispatchEvent(event); } : function (node, type) { var event = document.createEventObject(); node.fireEvent('on' + type, event); }; function testIframeWithCallback(title, fileName, func) { test(title, function () { var iframe; stop(); window.iframeCallback = function () { var self = this, args = arguments; setTimeout(function () { window.iframeCallback = undefined; iframe.remove(); func.apply(self, args); func = function () { }; start(); }, 0); }; iframe = jQuery('<div/>').css({ position: 'absolute', width: '500px', left: '-600px' }).append(jQuery('<iframe/>').attr('src', url('./data/' + fileName))).appendTo('#qunit-fixture'); }); } ; window.iframeCallback = undefined; function moduleTeardown() { }