Created
October 10, 2018 20:07
-
-
Save coreymcollins/53fce21f45c03d68b98086f78458881c to your computer and use it in GitHub Desktop.
VS Code JS/jQuery Snippetes
This file contains 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
"WDS jQuery Block": { | |
"prefix": "jq", | |
"body": [ | |
"/**", | |
" * ${1:Name File} Script.", | |
" */", | |
"window.WDS${2:Name Object}Object = {};", | |
"( function( window, \\$, app ) {", | |
"", | |
" // Constructor.", | |
" app.init = function() {", | |
" app.cache();", | |
"", | |
" if ( app.meetsRequirements() ) {", | |
" app.bindEvents();", | |
" }", | |
" };", | |
"", | |
" // Cache all the things.", | |
" app.cache = function() {", | |
" app.\\$c = {", | |
" window: \\$(window),", | |
" ${3:Selector}: \\$( '${4:div}' ),", | |
" };", | |
" };", | |
"", | |
" // Combine all events.", | |
" app.bindEvents = function() {", | |
" app.\\$c.window.on( 'load', app.do${5:Do Function} );", | |
" };", | |
"", | |
" // Do we meet the requirements?", | |
" app.meetsRequirements = function() {", | |
" return app.\\$c.${3:Selector}.length;", | |
" };", | |
"", | |
" // ${1:Name File}.", | |
" app.do${5:Do Function} = function() {", | |
"", | |
" // ${6: Do Stuff}" | |
" };", | |
"", | |
" // Engage!", | |
" \\$( app.init );", | |
"", | |
"}( window, jQuery, window.WDS${2:Name Object}Object ) );" | |
"", | |
], | |
"description": "Javascript - WDS jQuery" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment