Comparing version 0.8.18 to 0.8.19
// window.requestAnimationFrame / window.cancelAnimationFrame | ||
( function( global, factory ) { | ||
"use strict"; | ||
if ( typeof module === "object" && typeof module.exports === "object" ) { | ||
// For CommonJS and CommonJS-like environments where a proper `window` | ||
// For environments that do not have a `window` with a `document` | ||
// (such as Node.js), expose a factory as module.exports. | ||
// This accentuates the need for the creation of a real `window`. | ||
module.exports = global.document ? | ||
factory( global, true ) : | ||
function( w ) { | ||
if ( !w.document ) { | ||
throw new Error( "febs requires a window with a document" ); | ||
} | ||
return factory( w ); | ||
}; | ||
} else { | ||
factory( global ); | ||
} | ||
// Pass this if window is not defined yet | ||
} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { | ||
var animationFrame = {}; | ||
@@ -57,4 +33,2 @@ | ||
return animationFrame; | ||
} | ||
); | ||
module.exports = animationFrame; |
@@ -1,26 +0,2 @@ | ||
( function( global, factory ) { | ||
"use strict"; | ||
if ( typeof module === "object" && typeof module.exports === "object" ) { | ||
// For CommonJS and CommonJS-like environments where a proper `window` | ||
// For environments that do not have a `window` with a `document` | ||
// (such as Node.js), expose a factory as module.exports. | ||
// This accentuates the need for the creation of a real `window`. | ||
module.exports = global.document ? | ||
factory( global, true ) : | ||
function( w ) { | ||
if ( !w.document ) { | ||
throw new Error( "febs requires a window with a document" ); | ||
} | ||
return factory( w ); | ||
}; | ||
} else { | ||
factory( global ); | ||
} | ||
// Pass this if window is not defined yet | ||
} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { | ||
var utils = require('./utils'); | ||
@@ -44,4 +20,2 @@ var stringUtils = require('./string'); | ||
name = name.substr(1); | ||
} else { | ||
name = name.toUpperCase(); | ||
} | ||
@@ -86,3 +60,3 @@ | ||
else { | ||
if (node[j].nodeName.toUpperCase() == name) { | ||
if (node[j].nodeName.toUpperCase() == name.toUpperCase()) { | ||
elems.push(node[j]); | ||
@@ -832,6 +806,8 @@ continue; | ||
} | ||
if (ee.addEventListener) | ||
ee.addEventListener(eventname, foo); | ||
else | ||
ee.attachEvent('on'+eventname, foo); | ||
if ('on'+eventname in ee) { | ||
if (ee.addEventListener) | ||
ee.addEventListener(eventname, foo); | ||
else | ||
ee.attachEvent('on'+eventname, foo); | ||
} | ||
} | ||
@@ -875,7 +851,9 @@ return this; | ||
var j; | ||
for (j = 0; j < env.length; j++) { | ||
if (ee.removeEventListener) | ||
ee.removeEventListener(eventname, env[j]); | ||
else | ||
ee.detachEvent('on'+eventname, env[j]); | ||
if ('on'+eventname in ee) { | ||
for (j = 0; j < env.length; j++) { | ||
if (ee.removeEventListener) | ||
ee.removeEventListener(eventname, env[j]); | ||
else | ||
ee.detachEvent('on'+eventname, env[j]); | ||
} | ||
} | ||
@@ -910,6 +888,8 @@ ee.__events[eventname] = []; | ||
} | ||
if (ee.removeEventListener) | ||
ee.removeEventListener(eventname, foo); | ||
else | ||
ee.detachEvent('on'+eventname, foo); | ||
if ('on'+eventname in ee) { | ||
if (ee.removeEventListener) | ||
ee.removeEventListener(eventname, foo); | ||
else | ||
ee.detachEvent('on'+eventname, foo); | ||
} | ||
} | ||
@@ -923,3 +903,3 @@ | ||
*/ | ||
trigger(eventname) { | ||
trigger(eventname, extraParameters) { | ||
if (!eventname) | ||
@@ -941,9 +921,42 @@ throw new Error('need event name'); | ||
if (ee) { | ||
if (!window.document.addEventListener) { | ||
ee.fireEvent('on'+eventname); | ||
} | ||
if ('on'+eventname in ee) { | ||
if (!window.document.addEventListener) { | ||
ee.fireEvent('on'+eventname); | ||
} | ||
else { | ||
var env = window.document.createEvent('HTMLEvents'); | ||
env.initEvent(eventname, true, true); | ||
ee.dispatchEvent(env); | ||
} | ||
} | ||
else { | ||
var env = window.document.createEvent('HTMLEvents'); | ||
env.initEvent(eventname, true, true); | ||
ee.dispatchEvent(env); | ||
if (ee.__events && ee.__events[eventname]) | ||
{ | ||
var env = ee.__events[eventname]; | ||
var j; | ||
var enve; | ||
// if (!window.document.addEventListener) { | ||
enve = { | ||
bubbles: false, | ||
cancelable: false, | ||
cancelBubble: false, | ||
defaultPrevented: false, | ||
// currentTarget: ee, | ||
// target: ee, | ||
type: eventname | ||
}; | ||
// } | ||
// else { | ||
// enve = window.document.createEvent('HTMLEvents'); | ||
// enve.initEvent(eventname, false, false); | ||
// } | ||
enve.currentTarget = ee; | ||
enve.target = ee; | ||
for (j = 0; j < env.length; j++) { | ||
env[j](enve, extraParameters); | ||
} | ||
} // if. | ||
} | ||
@@ -1386,4 +1399,3 @@ } // if. | ||
return {Dom, CreateDom}; | ||
} | ||
); | ||
exports.Dom = Dom; | ||
exports.CreateDom = CreateDom; |
@@ -9,27 +9,2 @@ /** | ||
( function( global, factory ) { | ||
"use strict"; | ||
if ( typeof module === "object" && typeof module.exports === "object" ) { | ||
// For CommonJS and CommonJS-like environments where a proper `window` | ||
// For environments that do not have a `window` with a `document` | ||
// (such as Node.js), expose a factory as module.exports. | ||
// This accentuates the need for the creation of a real `window`. | ||
module.exports = global.document ? | ||
factory( global, true ) : | ||
function( w ) { | ||
if ( !w.document ) { | ||
throw new Error( "febs requires a window with a document" ); | ||
} | ||
return factory( w ); | ||
}; | ||
} else { | ||
factory( global ); | ||
} | ||
// Pass this if window is not defined yet | ||
} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { | ||
'use strict'; | ||
@@ -178,3 +153,2 @@ | ||
return net; | ||
} ); | ||
module.exports = net; |
@@ -9,27 +9,2 @@ /** | ||
( function( global, factory ) { | ||
"use strict"; | ||
if ( typeof module === "object" && typeof module.exports === "object" ) { | ||
// For CommonJS and CommonJS-like environments where a proper `window` | ||
// For environments that do not have a `window` with a `document` | ||
// (such as Node.js), expose a factory as module.exports. | ||
// This accentuates the need for the creation of a real `window`. | ||
module.exports = global.document ? | ||
factory( global, true ) : | ||
function( w ) { | ||
if ( !w.document ) { | ||
throw new Error( "febs requires a window with a document" ); | ||
} | ||
return factory( w ); | ||
}; | ||
} else { | ||
factory( global ); | ||
} | ||
// Pass this if window is not defined yet | ||
} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { | ||
'use strict'; | ||
@@ -469,3 +444,2 @@ | ||
return net; | ||
} ); | ||
module.exports = net; |
@@ -13,27 +13,2 @@ /** | ||
( function( global, factory ) { | ||
"use strict"; | ||
if ( typeof module === "object" && typeof module.exports === "object" ) { | ||
// For CommonJS and CommonJS-like environments where a proper `window` | ||
// For environments that do not have a `window` with a `document` | ||
// (such as Node.js), expose a factory as module.exports. | ||
// This accentuates the need for the creation of a real `window`. | ||
module.exports = global.document ? | ||
factory( global, true ) : | ||
function( w ) { | ||
if ( !w.document ) { | ||
throw new Error( "febs requires a window with a document" ); | ||
} | ||
return factory( w ); | ||
}; | ||
} else { | ||
factory( global ); | ||
} | ||
// Pass this if window is not defined yet | ||
} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { | ||
'use strict'; | ||
@@ -47,3 +22,2 @@ | ||
return net; | ||
} ); | ||
module.exports = net; |
@@ -9,27 +9,2 @@ /** | ||
( function( global, factory ) { | ||
"use strict"; | ||
if ( typeof module === "object" && typeof module.exports === "object" ) { | ||
// For CommonJS and CommonJS-like environments where a proper `window` | ||
// For environments that do not have a `window` with a `document` | ||
// (such as Node.js), expose a factory as module.exports. | ||
// This accentuates the need for the creation of a real `window`. | ||
module.exports = global.document ? | ||
factory( global, true ) : | ||
function( w ) { | ||
if ( !w.document ) { | ||
throw new Error( "febs requires a window with a document" ); | ||
} | ||
return factory( w ); | ||
}; | ||
} else { | ||
factory( global ); | ||
} | ||
// Pass this if window is not defined yet | ||
} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { | ||
'use strict'; | ||
@@ -115,3 +90,2 @@ | ||
return net; | ||
} ); | ||
module.exports = net; |
@@ -484,3 +484,3 @@ febs 库是一些常用的工具的合集; | ||
off(eventname:string, foo?:any): $; | ||
trigger(eventname:string): $; | ||
trigger(eventname:string, extraParameters?:any): $; // extraParameters仅支持自定义事件. | ||
ready(f?:any):$; | ||
@@ -487,0 +487,0 @@ unload(f?:any):$; |
@@ -464,3 +464,3 @@ // Type definitions for febs | ||
*/ | ||
trigger(eventname:string): dom; | ||
trigger(eventname:string, extraParameters?:any): dom; | ||
@@ -467,0 +467,0 @@ ready(f?:any):dom; |
@@ -86,3 +86,3 @@ { | ||
"name": "febs", | ||
"version": "0.8.18" | ||
"version": "0.8.19" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
2365457
60
24200
4