This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var groups = ['basic', 'green', 'light', 'dark']; | |
| groups.forEach(function (group) { | |
| gulp.task('sprites-' + group, function () { | |
| gulp.src('./src/' + group + '/png/*.png') | |
| .pipe(tasks.spritesmith({ | |
| imgName: 'sprite' + group + '.png', | |
| styleName: 'sprite' + group + '.css', | |
| imgPath: '../img/sprite' + group + '.png' | |
| })) | |
| .pipe(gulpif('*.png', gulp.dest('./dist/img/'))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Returns a function, that, as long as it continues to be invoked, will not | |
| // be triggered. The function will be called after it stops being called for | |
| // N milliseconds. If `immediate` is passed, trigger the function on the | |
| // leading edge, instead of the trailing. | |
| function debounce(func, wait, immediate) { | |
| var timeout; | |
| return function() { | |
| var context = this, args = arguments; | |
| var later = function() { | |
| timeout = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * jquery plugin template | |
| * @authors Kimi (huanggengtao@gmail.com) | |
| * @date 2014-10-15 09:54:42 | |
| * @version 0.0.1 | |
| */ | |
| ;(function($){ | |
| var Plugin = function( elem, options ) { | |
| this.elem = elem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function createXHR() { | |
| if(typeof XMLHttpRequest != undefined) { | |
| return new XMLHttpRequest(); | |
| }else if(typeof ActiveXObject != undefined) { | |
| if(typeof arguments.callee.activeXString != 'string') { | |
| var versions = ['MSXML2.XMLHttp.6.0', 'MSXML2.XMLHttp.3.0', 'MSXML2.XMLHttp'], | |
| i, len; | |
| for(i = 0, len = versions.length; i < len; i++ ) { | |
| try { | |
| new ActiveXObject(versions[i]); |