META-INF.resources.jquery-plusastab.test.basic.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-plus-as-tab Show documentation
Show all versions of jwebmp-plus-as-tab Show documentation
The JWebSwing implementation for Plus As Tab Plugin
The newest version!
(function(g){var x,y=1;function c(){try{console.log.call(console,arguments)}catch(I){}}function B(K,J){var I=new g.Deferred();setTimeout(g.proxy(function(){try{var L=K();I.resolve(L)}catch(M){I.reject(M)}},this),J);return I.promise()}function v(J,I,K){return B(function(){var M;function L(N){M=N}I.on(J+".deferredPressKey",L);I.simulate(J,K);I.off(J+".deferredPressKey",L);return M},y)}function l(I,J,K){K=K||g.noop;return v("keydown",I,J).then(K)}function H(I,J){return v("keypress",I,J)}function r(I,J){return v("keyup",I,J)}function j(I,J,K){return g.when(l(I,J,K).pipe(function(){return H(I,J).pipe(function(){return r(I,J)})}))}function D(K,I){I=!!I;var J={keyCode:K,shiftKey:I};return J}function C(J,L,I){var K=D(L,I);return j(J,K,g.noop)}function s(){return g(document.activeElement)}function t(J,I){return C(s(),J,I)}function p(J,I){return t(J,I).pipe(s)}var i=13;var E=40;var f=107;function o(I){return p(i,I)}function u(I){return p(E,I)}function a(I){return p(f,I)}function d(){var J=g("#qunit-fixture");var I=g("");I.appendTo(J);x=I}function h(){JoelPurra.PlusAsTab.setOptions({key:f})}function m(){JoelPurra.PlusAsTab.setOptions({key:i})}function F(){JoelPurra.PlusAsTab.setOptions({key:[i,E]})}function A(){g("#a").plusAsTab()}function k(){g("#container").plusAsTab()}function z(I,K){if(I.attr("id")!==K){try{console.error([I,I.attr("id"),K])}catch(J){}}strictEqual(I.attr("id"),K,"The id did not match for element "+I)}function b(I){z(s(),I)}function w(){g("#start").focus();b("start")}function q(){b("end")}function G(J,I){return function(){return o(I).pipe(function(K){z(K,J)})}}function e(J,I){return function(){return u(I).pipe(function(K){z(K,J)})}}function n(J,I){return function(){return a(I).pipe(function(K){z(K,J)})}}(function(){module("Library load");test("Object exists",3,function(){notStrictEqual(typeof(JoelPurra.PlusAsTab),"undefined","JoelPurra.PlusAsTab is undefined.");strictEqual(typeof(JoelPurra.PlusAsTab),"object","JoelPurra.PlusAsTab is not an object.");strictEqual(typeof(g.fn.plusAsTab),"function","$.fn.plusAsTab is not a function.")})}());(function(){module("init");asyncTest("Static elements",5,function(){var I=g("#elements-initialized-at-startup");g.when().pipe(w).pipe(n("a")).pipe(n("b")).pipe(n("end")).pipe(q).pipe(start).pipe(function(){I.remove()})})}());(function(){module("Elements forward",{setup:d});asyncTest("With class name",3,function(){x.append('').append('');g.when().pipe(w).pipe(n("end")).pipe(q).pipe(start)});asyncTest("With data attribute",3,function(){x.append('').append('');g.when().pipe(w).pipe(n("end")).pipe(q).pipe(start)})}());(function(){module("Elements reverse",{setup:d});asyncTest("With class name",3,function(){x.append('').append('');g.when().pipe(w).pipe(n("end",true)).pipe(q).pipe(start)});asyncTest("With data attribute",3,function(){x.append('').append('');g.when().pipe(w).pipe(n("end",true)).pipe(q).pipe(start)})}());(function(){module("setOptions",{setup:d});asyncTest("Enter as tab",5,function(){m();x.append('').append('').append('');g.when().pipe(w).pipe(G("a")).pipe(n("a")).pipe(G("end")).pipe(q).pipe(start).pipe(h)});asyncTest("Enter as tab reverse",5,function(){m();x.append('').append('').append('');g.when().pipe(w).pipe(G("a",true)).pipe(n("a",true)).pipe(G("end",true)).pipe(q).pipe(start).pipe(h)})}());(function(){module("setOptions multiple keys",{setup:d});asyncTest("Elements forward",5,function(){F();x.append('').append('').append('');g.when().pipe(w).pipe(G("a")).pipe(n("a")).pipe(e("end")).pipe(q).pipe(start).pipe(h)});asyncTest("Elements reverse",5,function(){F();x.append('').append('').append('');g.when().pipe(w).pipe(G("a",true)).pipe(n("a",true)).pipe(e("end",true)).pipe(q).pipe(start).pipe(h)})}());(function(){module("Containers forward",{setup:d});asyncTest("With class name",4,function(){x.append(g('').append('').append('')).append('');g.when().pipe(w).pipe(n("a")).pipe(n("end")).pipe(q).pipe(start)});asyncTest("With data attribute",4,function(){x.append(g('').append('').append('')).append('');g.when().pipe(w).pipe(n("a")).pipe(n("end")).pipe(q).pipe(start)});asyncTest("Exclude with class name",5,function(){x.append(g('').append('').append('').append(''));g.when().pipe(w).pipe(n("a")).pipe(n("end")).pipe(n("end")).pipe(q).pipe(start)});asyncTest("Exclude with data attribute",5,function(){x.append(g('').append('').append('').append(''));g.when().pipe(w).pipe(n("a")).pipe(n("end")).pipe(n("end")).pipe(q).pipe(start)})}());(function(){module("Containers reverse",{setup:d});asyncTest("With class name",4,function(){x.append('').append(g('').append('').append(''));g.when().pipe(w).pipe(n("a",true)).pipe(n("end",true)).pipe(q).pipe(start)});asyncTest("With data attribute",4,function(){x.append('').append(g('').append('').append(''));g.when().pipe(w).pipe(n("a",true)).pipe(n("end",true)).pipe(q).pipe(start)});asyncTest("Exclude with class name",5,function(){x.append(g('').append('').append('').append(''));g.when().pipe(w).pipe(n("a",true)).pipe(n("end",true)).pipe(n("end",true)).pipe(q).pipe(start)});asyncTest("Exclude with data attribute",5,function(){x.append(g('').append('').append('').append(''));g.when().pipe(w).pipe(n("a",true)).pipe(n("end",true)).pipe(n("end",true)).pipe(q).pipe(start)})}());(function(){module("$.fn.plusAsTab elements forward enable",{setup:d});asyncTest("Element",3,function(){x.append('').append('');g.when().pipe(function(){g("#start").plusAsTab()}).pipe(w).pipe(n("end")).pipe(q).pipe(start)})}());(function(){module("$.fn.plusAsTab elements reverse enable",{setup:d});asyncTest("Element",3,function(){x.append('').append('');g.when().pipe(function(){g("#start").plusAsTab()}).pipe(w).pipe(n("end",true)).pipe(q).pipe(start)})}());(function(){module("$.fn.plusAsTab containers forward enable",{setup:d});asyncTest("Container",4,function(){x.append(g('').append('').append('')).append('');g.when().pipe(function(){g("#container").plusAsTab()}).pipe(w).pipe(n("a")).pipe(n("end")).pipe(q).pipe(start)});asyncTest("Exclude",5,function(){x.append(g('').append('').append('').append(''));g.when().pipe(function(){g("#container").plusAsTab()}).pipe(w).pipe(n("a")).pipe(n("end")).pipe(n("end")).pipe(q).pipe(start)})}());(function(){module("$.fn.plusAsTab containers reverse enable",{setup:d});asyncTest("Container",4,function(){x.append('').append(g('').append('').append(''));g.when().pipe(function(){g("#container").plusAsTab()}).pipe(w).pipe(n("a",true)).pipe(n("end",true)).pipe(q).pipe(start)});asyncTest("Exclude",5,function(){x.append(g('').append('').append('').append(''));g.when().pipe(function(){g("#container").plusAsTab()}).pipe(w).pipe(n("a",true)).pipe(n("end",true)).pipe(n("end",true)).pipe(q).pipe(start)})}());(function(){module("$.fn.plusAsTab elements forward disable",{setup:d});asyncTest("Element",4,function(){x.append(g('').append('').append(''));g.when().pipe(function(){g("#end").plusAsTab(false)}).pipe(w).pipe(n("end")).pipe(n("end")).pipe(q).pipe(start)})}());(function(){module("$.fn.plusAsTab elements reverse disable",{setup:d});asyncTest("Element",4,function(){x.append(g('').append('').append(''));g.when().pipe(function(){g("#end").plusAsTab(false)}).pipe(w).pipe(n("end",true)).pipe(n("end",true)).pipe(q).pipe(start)})}());(function(){module("$.fn.plusAsTab containers forward disable",{setup:d});asyncTest("Container",4,function(){x.append(g('').append('').append(g('').append('')));g.when().pipe(function(){g("#container").plusAsTab(false)}).pipe(w).pipe(n("end")).pipe(n("end")).pipe(q).pipe(start)})}());(function(){module("$.fn.plusAsTab containers reverse disable",{setup:d});asyncTest("Container",4,function(){x.append(g('').append(g('').append('')).append(''));g.when().pipe(function(){g("#container").plusAsTab(false)}).pipe(w).pipe(n("end",true)).pipe(n("end",true)).pipe(q).pipe(start)})}())}(jQuery));
© 2015 - 2024 Weber Informatics LLC | Privacy Policy