Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Conversation

cmcculloh-kr
Copy link

@cmcculloh-kr cmcculloh-kr commented Aug 17, 2016

Fixes issue #1841

Fixes JIRA issue ABSETUP-538 & FUELUX-238

Adds cleanInput method which URI Encodes < by default, but can be overwritten if necessary.

Also relates to #1692 in that it incorporates the hbs template for pillbox into the index.html page.

Adds eslint to file to conform to our dev standards and makes pillbox.js conform to eslint standards.

var isDeleteKey = function isDeleteKey(e) { return e.keyCode === 46; };
var isTabKey = function isTabKey(e) { return e.keyCode === 9; };
var isUpArrow = function isUpArrow(e) { return e.keyCode === 38; };
var isDownArrow = function isDownArrow(e) { return e.keyCode === 40; };
Copy link
Contributor

@swilliamset swilliamset Aug 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move keyCode numbers all to constants.

Dry is*Key methods like so:

var isKeyCode = function isKey(e, specificKey) { 
    return e.keyCode === specificKey;
}
.
.
.
if (isKeyCode(e, SPECIFIC_KEYCODE)) {
    .
    .
    .
}

if (this.acceptKeyCodes[e.keyCode]) {
// If we test for keycode only, it will match for `<` & `,` instead of just `,`
// This way users can type `<3` and `1 < 3`, etc...
if (this.acceptKeyCodes[e.keyCode] && !isShiftHeld(e)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting! that's why it was catching <

@swilliamset
Copy link
Contributor

swilliamset commented Aug 19, 2016

TODO:

For consideration:

@@ -53,18 +38,25 @@
var TAB_KEYCODE = 9;
var UP_ARROW_KEYCODE = 38;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swilliamset
Copy link
Contributor

swilliamset commented Aug 22, 2016

TODO:

@swilliamset swilliamset merged commit c0221fc into ExactTarget:master Aug 22, 2016
@cmcculloh-kr cmcculloh-kr deleted the GH1841---xss-when-pasting-script-into-pillbox-control_or_fuelux branch September 14, 2016 21:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants