jquery.initialize icon indicating copy to clipboard operation
jquery.initialize copied to clipboard

Include deprecated warning for old API

Open bezborodow opened this issue 7 years ago • 1 comments

Add console warning for old API from #6.

bezborodow avatar Jul 11 '18 14:07 bezborodow

Example:

console.warn("Calling deprecated function!");

bezborodow avatar Jul 17 '18 08:07 bezborodow

Call console.error() if the jQuery version (jQuery().jquery) is >= 3.1.1.

Maybe something like:

console.info('jQuery.initialiaze: Deprecated API, see: https://github.com/pie6k/jquery.initialize/issues/6');
if (jQuery().jquery.localeCompare('3.1.1', undefined, { numeric: true, sensitivity: 'base' }) == -1) {
    console.warn('jQuery.initialiaze: $.fn.initialize() is deprecated. Use $.fn.initialize() instead.');
} else {
    console.error('jQuery.initialiaze: $.fn.initialize() is not supported. Use $.fn.initialize() instead.');
    throw new Error("jQuery.initialiaze deprecated API call.");
}

Although it might just be more semantic (and easier) to check for this.selector being null. localeCompare may not be that reliable also.

bezborodow avatar Jan 30 '23 14:01 bezborodow

Release 1.3.1

~/src/jquery.initialize$ npm publish
npm notice 
npm notice 📦  [email protected]
npm notice === Tarball Contents === 
npm notice 1.1kB LICENSE                 
npm notice 3.0kB README.md               
npm notice 352B  bower.json              
npm notice 7.3kB jquery.initialize.js    
npm notice 2.7kB jquery.initialize.min.js
npm notice 501B  package.json            
npm notice 1.5kB test.html               
npm notice 3.6kB test2.html              
npm notice === Tarball Details === 
npm notice name:          jquery.initialize                       
npm notice version:       1.3.1                                   
npm notice filename:      jquery.initialize-1.3.1.tgz             
npm notice package size:  6.1 kB                                  
npm notice unpacked size: 20.1 kB                                 
npm notice shasum:        96c6da43dbc555b615513639b971c7d0b5332dc1
npm notice integrity:     sha512-jQzVQaUi89m0J[...]IkG9K2BJKZ2ag==
npm notice total files:   8                                       
npm notice 
npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access
+ [email protected]

bezborodow avatar Jan 31 '23 08:01 bezborodow