-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UMD wrapper #209
base: master
Are you sure you want to change the base?
Add UMD wrapper #209
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/bower_components | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,20 @@ | |
* | ||
*/ | ||
|
||
;(function( $ ){ | ||
!function(factory) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please keep the style of the IIFE. The semicolon actually makes sense: #192. |
||
if ("object" == typeof exports && "undefined" != typeof module) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Single quotes instead of doubles. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also use strict equals, to calm down jshint and for code quality. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these comment apply the the code under this as well. |
||
module.exports = factory; | ||
} | ||
else if ("function" == typeof define && define.amd) { | ||
define(['jquery'], factory); | ||
} | ||
else { | ||
var n; | ||
"undefined" != typeof window ? n = window : "undefined" != typeof global ? n = global : "undefined" != typeof self && (n = self); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this line takes a while to parse for humans. There's no deal with trying to make code as small as possible in non-minified source so let's format it. |
||
// Works with either jQuery or Zepto | ||
factory(n.jQuery || n.Zepto); | ||
} | ||
}(function( $ ){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. try to keep the code style consistent (spacing I mean) |
||
|
||
'use strict'; | ||
|
||
|
@@ -79,5 +92,4 @@ | |
}); | ||
}); | ||
}; | ||
// Works with either jQuery or Zepto | ||
})( window.jQuery || window.Zepto ); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "fitvids", | ||
"version": "1.1.0", | ||
"description": "FitVids makes video embeds responsive", | ||
"keywords": [ | ||
"FitVids", | ||
"Responsive", | ||
"RWD", | ||
"YouTube", | ||
"Vimeo" | ||
], | ||
"license": "WTFPL", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @davatron5000 is this correct? |
||
"main": "jquery.fitvids.js", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"components", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
"dependencies": {}, | ||
"devDependencies": {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove these two lines. no deal with empty stuff. if npm needs them, it will include it again. |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope. Should be in a global gitignore, not project-specific.