if (type) {
if (type === 'keypress') {
} else {
}
} else {
}
};
function setUp() {
body;
if (!testbed) {
}
'<ul id="items">' +
'<li id="item1">' +
'<div id="div1"><input type="text" id="text1" name="text1"></div>' +
'</li>' +
'<li id="item2">' +
'<div id="div2"><input type="text" id="text2" name="text2"></div>' +
'</li>' +
'<li id="item3">' +
'<div id="div3"><textarea id="area1" name="area1"></textarea></div>' +
'</li>' +
'</ul>');
}
function tearDown() {
if (testbed) {
}
}
name: "node.on('key',...)",
"test node.on('key', fn, '65')": function () {
thisObj = this;
}, '65');
},
"test node.on('key', fn, '65', thisObj)": function () {
thisObj = this;
}, '65', obj);
},
"test node.on('key', fn, '65', thisObj, args)": function () {
thisObj = this;
arg = x;
}
}));
name: "nodelist.on('key',...)",
"test nodelist.on('key', fn, '65')": function () {
target = [],
type = [],
currentTarget = [],
keyCode = [],
thisObj = [];
}, '65');
// Synth infrastructure iterates nodelist input for individual
// subscription for each node, so 'this' is not the nodelist as
// it is with nodelist.on('click');
//Y.ArrayAssert.itemsAreSame([inputs, inputs], thisObj);
},
"test nodelist.on('key', fn, '65', thisObj)": function () {
target = [],
type = [],
currentTarget = [],
keyCode = [],
thisObj = [];
}, '65', obj);
},
"test nodelist.on('key', fn, '65', thisObj, args)": function () {
target = [],
type = [],
currentTarget = [],
keyCode = [],
thisObj = [],
arg = [];
}
}));
name: "Y.on('key',...)",
"test Y.on('key', fn, selector, '65')": function () {
Y.on("key", function (e) {
thisObj = this;
}, '#text1', '65');
},
"test Y.on('key', fn, node, '65')": function () {
Y.on("key", function (e) {
thisObj = this;
}, input, '65');
},
"test Y.on('key', fn, selector, '65', thisObj)": function () {
Y.on("key", function (e) {
thisObj = this;
},
"test Y.on('key', fn, selector, '65', thisObj, args)": function () {
Y.on("key", function (e, x) {
thisObj = this;
arg = x;
}
}));
name: "node.delegate('key',...)",
"test node.delegate('key', fn, '65', filter)": function () {
target = [],
type = [],
container = [],
currentTarget = [],
keyCode = [],
thisObj = [];
}, '65', 'input');
},
"test node.delegate('key', fn, '65', filter, thisObj)": function () {
target = [],
type = [],
container = [],
currentTarget = [],
keyCode = [],
thisObj = [];
},
"test node.delegate('key', fn, '65', filter, thisObj, args)": function () {
target = [],
type = [],
container = [],
currentTarget = [],
keyCode = [],
thisObj = [],
args = [];
}
}));
name: "Y.delegate('key',...)",
"test Y.delegate('key', fn, '65', selector, filter)": function () {
target = [],
type = [],
container = [],
currentTarget = [],
keyCode = [],
thisObj = [];
Y.delegate("key", function (e) {
}, '#items', '65', 'input');
},
"test Y.delegate('key', fn, '65', node, filter)": function () {
target = [],
type = [],
container = [],
currentTarget = [],
keyCode = [],
thisObj = [];
Y.delegate("key", function (e) {
},
"test Y.delegate('key', fn, '65', selector, filter, thisObj)": function () {
target = [],
type = [],
container = [],
currentTarget = [],
keyCode = [],
thisObj = [];
Y.delegate("key", function (e) {
},
"test Y.delegate('key', fn, '65', selector, filter, thisObj, args)": function () {
target = [],
type = [],
container = [],
currentTarget = [],
keyCode = [],
thisObj = [],
args = [];
Y.delegate("key", function (e, x) {
}
}));
"test 'down:65'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'up:65'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'press:65'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'a'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'down:a'": function () {
count = 0;
function inc() {
count++;
}
// keydown sends keyCode, which for 'a' is 65, but I can't calculate
// the keyCode from a character, only the charCode (97). So none of
// these should match.
// FIXME: bug confirmation that a different keyCode will trigger the
// subscriber (keyCode 97 is NOT 'a' in keydown phase).
},
"test 'up:a'": function () {
count = 0;
function inc() {
count++;
}
// keydown sends keyCode, which for 'a' is 65, but I can't calculate
// the keyCode from a character, only the charCode (97). So none of
// these should match.
// FIXME: bug confirmation that a different keyCode will trigger the
// subscriber (keyCode 97 is NOT 'a' in keyup phase).
},
"test 'press:a'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'A'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'enter', 'esc', 'backspace', 'tab', 'pageup', 'pagedown'": function () {
count = 0,
map = {
enter : 13,
esc : 27,
backspace: 8,
tab : 9,
pageup : 33,
pagedown : 34
};
function inc() {
count++;
}
count = 0;
// default for named keys is keydown
});
},
"test 'a,b'": function () {
count = 0;
function inc() {
count++;
}
},
"test '65,b,esc'": function () {
count = 0;
function inc() {
count++;
}
// FIXME: I want this to work, but 'esc' triggers keydown subscription,
// which breaks the charCode mapping from 'b'.
// subscribed to keydown, so this misses.
// FIXME: cont.
},
"test 'unknownKeyName'": function () {
count = 0;
function inc() {
count++;
}
// Uses first character
},
"test '65,unknownKeyName'": function () {
},
"test '65,unknownKeyName+alt'": function () {
},
"test 'press:a,b'": function () {
},
"test 'a+shift'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'enter+ctrl'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'up:a+alt'": function () {
},
"test 'a,b+shift+meta'": function () {
count = 0;
function inc() {
count++;
}
},
"test spec with spaces 'down:65, 66, 67'": function () {
count = 0;
function inc() {
count++;
}
},
"test spec with no keyCodes 'down:'": function () {
count = 0;
function inc() {
count++;
}
},
"test spec with only modifiers '+ctrl+shift'": function () {
count = 0;
function inc() {
count++;
}
}
}));
name: "detach",
"test node.on() + node.detach()": function () {
},
"test Y.on() + node.detach()": function () {
},
"test node.on() + handle.detach()": function () {
},
"test node.on('cat|key',...) + node.detach('cat|...')": function () {
},
"test node.delegate() + node.detach()": function () {
},
"test node.delegate() + handle.detach()": function () {
}
}));