Comparing version 0.1.11 to 0.1.12
@@ -1,13 +0,14 @@ | ||
function md5(s) { | ||
var md5 = function (s) { | ||
function add32(a, b) { | ||
var add32 = function (a, b) { | ||
return (a + b) & 0xFFFFFFFF; | ||
} | ||
}; | ||
if (md5('hello') != '5d41402abc4b2a76b9719d911017c592') { | ||
function add32(x, y) { | ||
// Fix old IE bug. | ||
if (s != 'hello' && md5('hello') != '5d41402abc4b2a76b9719d911017c592') { | ||
add32 = function (x, y) { | ||
var lsw = (x & 0xFFFF) + (y & 0xFFFF), | ||
msw = (x >> 16) + (y >> 16) + (lsw >> 16); | ||
return (msw << 16) | (lsw & 0xFFFF); | ||
} | ||
}; | ||
} | ||
@@ -180,2 +181,2 @@ | ||
return hex(md51(s)); | ||
} | ||
}; |
46
jymin.js
/** | ||
* _ _ ___ _ _ _ | ||
* | |_ _ _ __ ___ (_)_ __ __ __/ _ \ / | / / | | ||
* _ | | | | | '_ ` _ \| | '_ \ \ \ / / | | || | | | | | ||
* | |_| | |_| | | | | | | | | | | \ V /| |_| || |_| | | | ||
* \___/ \__, |_| |_| |_|_|_| |_| \_/ \___(_)_(_)_|_| | ||
* _ _ ___ _ _ ____ | ||
* | |_ _ _ __ ___ (_)_ __ __ __/ _ \ / | / |___ \ | ||
* _ | | | | | '_ ` _ \| | '_ \ \ \ / / | | || | | | __) | | ||
* | |_| | |_| | | | | | | | | | | \ V /| |_| || |_| |/ __/ | ||
* \___/ \__, |_| |_| |_|_|_| |_| \_/ \___(_)_(_)_|_____| | ||
* |___/ | ||
@@ -33,3 +33,3 @@ * | ||
this.jymin = {version: '0.1.11'}; | ||
this.jymin = {version: '0.1.12'}; | ||
@@ -518,3 +518,3 @@ /** | ||
/** | ||
* Create a DOM element, and prepend it to a parent element. | ||
* Create a DOM element, and append it to a parent element. | ||
*/ | ||
@@ -797,3 +797,9 @@ var appendElement = function ( | ||
) { | ||
flipClass(element, className, !hasClass(element, className)); | ||
var turnOn = false; | ||
element = getElement(element); | ||
if (element) { | ||
turnOn = !hasClass(element, className); | ||
flipClass(element, className, turnOn); | ||
} | ||
return turnOn; | ||
}; | ||
@@ -820,3 +826,27 @@ | ||
}; | ||
/** | ||
* Run a callback on each element with a given tag and class. | ||
*/ | ||
var forElements = function ( | ||
tagAndClass, | ||
callback | ||
) { | ||
var elements = getElementsByTagAndClass(tagAndClass); | ||
forEach(elements, callback); | ||
}; | ||
/** | ||
* Run a callback on an element with a given id. | ||
*/ | ||
var forElement = function ( | ||
id, | ||
callback | ||
) { | ||
var element = getElement(id); | ||
if (element) { | ||
callback(element); | ||
} | ||
}; | ||
/** | ||
* Bind a handler to listen for a particular event on an element. | ||
@@ -823,0 +853,0 @@ */ |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"main": "chug/chug.js", | ||
@@ -50,10 +50,10 @@ "homepage": "http://lighter.io/jymin", | ||
"devDependencies": { | ||
"zeriousify": "0.1.3", | ||
"zeriousify": "0.1.5", | ||
"assert-plus": "0.1.5", | ||
"mocha": "1.18.2", | ||
"istanbul": "0.2.9", | ||
"mocha": "1.20.1", | ||
"istanbul": "0.2.10", | ||
"coveralls": "2.10.0", | ||
"chug": "0.1.12", | ||
"chug": "0.1.26", | ||
"figlet": "1.0.8" | ||
} | ||
} |
@@ -131,3 +131,3 @@ /** | ||
/** | ||
* Create a DOM element, and prepend it to a parent element. | ||
* Create a DOM element, and append it to a parent element. | ||
*/ | ||
@@ -410,3 +410,9 @@ var appendElement = function ( | ||
) { | ||
flipClass(element, className, !hasClass(element, className)); | ||
var turnOn = false; | ||
element = getElement(element); | ||
if (element) { | ||
turnOn = !hasClass(element, className); | ||
flipClass(element, className, turnOn); | ||
} | ||
return turnOn; | ||
}; | ||
@@ -433,1 +439,25 @@ | ||
}; | ||
/** | ||
* Run a callback on each element with a given tag and class. | ||
*/ | ||
var forElements = function ( | ||
tagAndClass, | ||
callback | ||
) { | ||
var elements = getElementsByTagAndClass(tagAndClass); | ||
forEach(elements, callback); | ||
}; | ||
/** | ||
* Run a callback on an element with a given id. | ||
*/ | ||
var forElement = function ( | ||
id, | ||
callback | ||
) { | ||
var element = getElement(id); | ||
if (element) { | ||
callback(element); | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84463
3076
21