Last active
January 18, 2023 01:27
-
-
Save wcervini/9afcb67b8396354d5cfa8c37932e401a to your computer and use it in GitHub Desktop.
Visual Studio Code Axios Snippet
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
{"lastUpload":"2020-11-08T03:07:45.364Z","extensionVersion":"v3.4.3"} |
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
[ | |
{ | |
"metadata": { | |
"id": "d3836729-9cc1-42c1-b2af-d50071f57d29", | |
"publisherId": "formulahendry.auto-close-tag", | |
"publisherDisplayName": "formulahendry" | |
}, | |
"name": "auto-close-tag", | |
"publisher": "formulahendry", | |
"version": "0.5.9" | |
}, | |
{ | |
"metadata": { | |
"id": "366a9f01-2d1b-48b9-b7df-014ff8dea46b", | |
"publisherId": "formulahendry.auto-complete-tag", | |
"publisherDisplayName": "formulahendry" | |
}, | |
"name": "auto-complete-tag", | |
"publisher": "formulahendry", | |
"version": "0.1.0" | |
}, | |
{ | |
"metadata": { | |
"id": "6e440e71-8ed9-4f25-bb78-4b13096b8a03", | |
"publisherId": "formulahendry.auto-rename-tag", | |
"publisherDisplayName": "formulahendry" | |
}, | |
"name": "auto-rename-tag", | |
"publisher": "formulahendry", | |
"version": "0.1.5" | |
}, | |
{ | |
"metadata": { | |
"id": "e337c67b-55c2-4fef-8949-eb260e7fb7fd", | |
"publisherId": "Shan.code-settings-sync", | |
"publisherDisplayName": "Shan" | |
}, | |
"name": "code-settings-sync", | |
"publisher": "Shan", | |
"version": "3.4.3" | |
}, | |
{ | |
"metadata": { | |
"id": "1ec62ca5-d7f9-4ddb-a882-e8d018c0aefd", | |
"publisherId": "msjsdiag.debugger-for-chrome", | |
"publisherDisplayName": "msjsdiag" | |
}, | |
"name": "debugger-for-chrome", | |
"publisher": "msjsdiag", | |
"version": "4.12.11" | |
}, | |
{ | |
"metadata": { | |
"id": "f60a60a6-95ba-42d4-b41c-3d24c1b89588", | |
"publisherId": "EditorConfig.EditorConfig", | |
"publisherDisplayName": "EditorConfig" | |
}, | |
"name": "EditorConfig", | |
"publisher": "EditorConfig", | |
"version": "0.15.1" | |
}, | |
{ | |
"metadata": { | |
"id": "f7b92b60-6a15-4e0b-bb0c-4fcfe44b6276", | |
"publisherId": "FernandoToledo.ft-extension-pack", | |
"publisherDisplayName": "FernandoToledo" | |
}, | |
"name": "ft-extension-pack", | |
"publisher": "FernandoToledo", | |
"version": "0.0.1" | |
}, | |
{ | |
"metadata": { | |
"id": "5960f38e-0bbe-4644-8f9c-9c8824e82511", | |
"publisherId": "donjayamanne.githistory", | |
"publisherDisplayName": "donjayamanne" | |
}, | |
"name": "githistory", | |
"publisher": "donjayamanne", | |
"version": "0.6.13" | |
}, | |
{ | |
"metadata": { | |
"id": "4de763bd-505d-4978-9575-2b7696ecf94e", | |
"publisherId": "eamodio.gitlens", | |
"publisherDisplayName": "eamodio" | |
}, | |
"name": "gitlens", | |
"publisher": "eamodio", | |
"version": "10.2.3" | |
}, | |
{ | |
"metadata": { | |
"id": "a9b8f02e-09f1-4a8a-9fb3-e233d3dd20ff", | |
"publisherId": "lior-chamla.google-fonts", | |
"publisherDisplayName": "lior-chamla" | |
}, | |
"name": "google-fonts", | |
"publisher": "lior-chamla", | |
"version": "0.0.1" | |
}, | |
{ | |
"metadata": { | |
"id": "7b71fc1b-190d-4f7d-95d1-93e422649b0a", | |
"publisherId": "Zignd.html-css-class-completion", | |
"publisherDisplayName": "Zignd" | |
}, | |
"name": "html-css-class-completion", | |
"publisher": "Zignd", | |
"version": "1.19.0" | |
}, | |
{ | |
"metadata": { | |
"id": "be992f3f-9f22-4b66-a1d2-ecad04c28a28", | |
"publisherId": "abusaidm.html-snippets", | |
"publisherDisplayName": "abusaidm" | |
}, | |
"name": "html-snippets", | |
"publisher": "abusaidm", | |
"version": "0.2.1" | |
}, | |
{ | |
"metadata": { | |
"id": "f45dc69c-8d62-4ea1-b01f-3ab90854acb6", | |
"publisherId": "sidthesloth.html5-boilerplate", | |
"publisherDisplayName": "sidthesloth" | |
}, | |
"name": "html5-boilerplate", | |
"publisher": "sidthesloth", | |
"version": "1.1.1" | |
}, | |
{ | |
"metadata": { | |
"id": "17a873c7-491e-4797-9172-186de70f5e98", | |
"publisherId": "idleberg.icon-fonts", | |
"publisherDisplayName": "idleberg" | |
}, | |
"name": "icon-fonts", | |
"publisher": "idleberg", | |
"version": "2.4.0" | |
}, | |
{ | |
"metadata": { | |
"id": "a2cec723-5349-460d-9de9-0fd1f8d3456f", | |
"publisherId": "xabikos.JavaScriptSnippets", | |
"publisherDisplayName": "xabikos" | |
}, | |
"name": "JavaScriptSnippets", | |
"publisher": "xabikos", | |
"version": "1.8.0" | |
}, | |
{ | |
"metadata": { | |
"id": "5db78037-f674-459f-a236-db622c427c5b", | |
"publisherId": "PKief.material-icon-theme", | |
"publisherDisplayName": "PKief" | |
}, | |
"name": "material-icon-theme", | |
"publisher": "PKief", | |
"version": "4.4.0" | |
}, | |
{ | |
"metadata": { | |
"id": "dff6b801-247e-40e9-82e8-8c9b1d19d1b8", | |
"publisherId": "christian-kohler.npm-intellisense", | |
"publisherDisplayName": "christian-kohler" | |
}, | |
"name": "npm-intellisense", | |
"publisher": "christian-kohler", | |
"version": "1.3.1" | |
}, | |
{ | |
"metadata": { | |
"id": "a41c1549-4053-44d4-bf30-60fc809b4a86", | |
"publisherId": "christian-kohler.path-intellisense", | |
"publisherDisplayName": "christian-kohler" | |
}, | |
"name": "path-intellisense", | |
"publisher": "christian-kohler", | |
"version": "2.3.0" | |
}, | |
{ | |
"metadata": { | |
"id": "96fa4707-6983-4489-b7c5-d5ffdfdcce90", | |
"publisherId": "esbenp.prettier-vscode", | |
"publisherDisplayName": "esbenp" | |
}, | |
"name": "prettier-vscode", | |
"publisher": "esbenp", | |
"version": "5.7.1" | |
}, | |
{ | |
"metadata": { | |
"id": "2f5dd8cb-d251-4d70-abfe-ddebcb077483", | |
"publisherId": "octref.vetur", | |
"publisherDisplayName": "octref" | |
}, | |
"name": "vetur", | |
"publisher": "octref", | |
"version": "0.29.0" | |
}, | |
{ | |
"metadata": { | |
"id": "7f60a80e-1ca5-46ab-83a9-31013576f584", | |
"publisherId": "JakeWilson.vscode-cdnjs", | |
"publisherDisplayName": "JakeWilson" | |
}, | |
"name": "vscode-cdnjs", | |
"publisher": "JakeWilson", | |
"version": "0.18.0" | |
}, | |
{ | |
"metadata": { | |
"id": "583b2b34-2c1e-4634-8c0b-0b82e283ea3a", | |
"publisherId": "dbaeumer.vscode-eslint", | |
"publisherDisplayName": "dbaeumer" | |
}, | |
"name": "vscode-eslint", | |
"publisher": "dbaeumer", | |
"version": "2.1.13" | |
}, | |
{ | |
"metadata": { | |
"id": "829a192d-496c-44ac-87f3-0a84ce36a853", | |
"publisherId": "emmanuelbeziat.vscode-great-icons", | |
"publisherDisplayName": "emmanuelbeziat" | |
}, | |
"name": "vscode-great-icons", | |
"publisher": "emmanuelbeziat", | |
"version": "2.1.60" | |
}, | |
{ | |
"metadata": { | |
"id": "aaee577c-f062-495a-9816-0cbd442f1d25", | |
"publisherId": "ecmel.vscode-html-css", | |
"publisherDisplayName": "ecmel" | |
}, | |
"name": "vscode-html-css", | |
"publisher": "ecmel", | |
"version": "0.2.3" | |
}, | |
{ | |
"metadata": { | |
"id": "56c1f2d5-5d32-4a45-93e4-b1429142ef1f", | |
"publisherId": "lonefy.vscode-JS-CSS-HTML-formatter", | |
"publisherDisplayName": "lonefy" | |
}, | |
"name": "vscode-JS-CSS-HTML-formatter", | |
"publisher": "lonefy", | |
"version": "0.2.3" | |
}, | |
{ | |
"metadata": { | |
"id": "28fcf0b8-26a5-4e99-9b8d-02e990366c6f", | |
"publisherId": "tombonnike.vscode-status-bar-format-toggle", | |
"publisherDisplayName": "tombonnike" | |
}, | |
"name": "vscode-status-bar-format-toggle", | |
"publisher": "tombonnike", | |
"version": "2.0.0" | |
}, | |
{ | |
"metadata": { | |
"id": "90a37ca1-92a2-488a-b196-7a8c0b0127ea", | |
"publisherId": "ms-vscode.vscode-typescript-tslint-plugin", | |
"publisherDisplayName": "ms-vscode" | |
}, | |
"name": "vscode-typescript-tslint-plugin", | |
"publisher": "ms-vscode", | |
"version": "1.2.3" | |
}, | |
{ | |
"metadata": { | |
"id": "876e8f93-74d0-4f4f-91b7-34a09f19f444", | |
"publisherId": "VisualStudioExptTeam.vscodeintellicode", | |
"publisherDisplayName": "VisualStudioExptTeam" | |
}, | |
"name": "vscodeintellicode", | |
"publisher": "VisualStudioExptTeam", | |
"version": "1.2.10" | |
}, | |
{ | |
"metadata": { | |
"id": "c8d95916-cf54-455f-b324-cbd887b7d3a8", | |
"publisherId": "sdras.vue-vscode-snippets", | |
"publisherDisplayName": "sdras" | |
}, | |
"name": "vue-vscode-snippets", | |
"publisher": "sdras", | |
"version": "2.1.5" | |
}, | |
{ | |
"metadata": { | |
"id": "cbf3bf40-02cc-4efa-b596-aa4cb09851f7", | |
"publisherId": "mubaidr.vuejs-extension-pack", | |
"publisherDisplayName": "mubaidr" | |
}, | |
"name": "vuejs-extension-pack", | |
"publisher": "mubaidr", | |
"version": "1.2.1" | |
} | |
] |
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
{ | |
// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "prefix": "log", | |
// "body": [ | |
// "console.log('$1');", | |
// "$2" | |
// ], | |
// "description": "Log output to console" | |
// } | |
"create a axios request": { | |
"prefix": "axios", | |
"body": [ | |
"axios({", | |
"\tmethod:'post',", | |
"\turl: ${1:requestUrl},", | |
"\tdata: {", | |
"\t\tid:${1:paramId}", | |
"\t}", | |
"})" | |
], | |
"description": "创建一个axios请求" | |
}, | |
"axios.get request": { | |
"prefix": "axios.get", | |
"body": [ | |
"axios.get(${url},${params})", | |
".then(res => {", | |
"\tconsole.log(res)", | |
"})", | |
".catch(err => {", | |
"\tconsole.error(err); ", | |
"})" | |
], | |
"description": "发送一个get请求" | |
}, | |
"axios.get request with params": { | |
"prefix": "axios.get_params", | |
"body": [ | |
"axios.get(${url}, {", | |
"\tparams: {", | |
"\t\t${key1}: ${value1}", | |
"\t}", | |
"})", | |
".then(res => {", | |
"\tconsole.log(res);", | |
"})" | |
], | |
"description": "发送一个get请求" | |
}, | |
"axios.post request": { | |
"prefix": "axios.post", | |
"body": [ | |
"axios.post(${url},${params})", | |
".then(res => {", | |
"\tconsole.log(res)", | |
"})", | |
".catch(err => {", | |
"\tconsole.error(err); ", | |
"})" | |
], | |
"description": "发送一个post请求" | |
}, | |
"axios.delete request": { | |
"prefix": "axios.delete", | |
"body": [ | |
"axios.delete(${url},${params})", | |
".then(res => {", | |
"\tconsole.log(res)", | |
"})", | |
".catch(err => {", | |
"\tconsole.error(err); ", | |
"})" | |
], | |
"description": "发送一个delete请求" | |
}, | |
"axios.head request": { | |
"prefix": "axios.head", | |
"body": [ | |
"axios.head(${url},${params})", | |
".then(res => {", | |
"\tconsole.log(res)", | |
"})", | |
".catch(err => {", | |
"\tconsole.error(err); ", | |
"})" | |
], | |
"description": "发送一个head请求" | |
}, | |
"axios.put request": { | |
"prefix": "axios.put", | |
"body": [ | |
"axios.put(${url},${params})", | |
".then(res => {", | |
"\tconsole.log(res)", | |
"})", | |
".catch(err => {", | |
"\tconsole.error(err); ", | |
"})" | |
], | |
"description": "发送一个put请求" | |
}, | |
"axios.all([iterable])": { | |
"prefix": "axios.all", | |
"body": [ | |
"axios.all([callback1,callback2])", | |
".then(axios.spread((res1, res2)=>{", | |
"}))" | |
], | |
"description": "Concurrent Program 并发执行多个请求 params[callback1,callback2]" | |
}, | |
"axios.spread(callback)": { | |
"prefix": "axios.spread", | |
"body": [ | |
".then(axios.spread((res1, res2)=>{", | |
"}))" | |
], | |
"description": "Concurrent Program sucessed 多个请求执行都成功后执行" | |
}, | |
"axios.create([config])": { | |
"prefix": "axios.create", | |
"body": [ | |
"axios.create({", | |
"\tbaseURL: ${baseURL}", | |
"\ttimeout: ${timeout}", | |
"\theaders: ${headers}", | |
"})" | |
], | |
"description": "create a axios instance" | |
}, | |
"axios.CancelToken": { | |
"prefix": "axios.CancelToken", | |
"body": [ | |
"axios.CancelToken" | |
], | |
"description": "Cancel Token" | |
}, | |
"new CancelToken": { | |
"prefix": "new CancelToken", | |
"body": [ | |
"new CancelToken(()=>{})" | |
], | |
"description": "创键一个CancelToken实例" | |
}, | |
"axios.defaults": { | |
"prefix": "axios.defaults", | |
"body": [ | |
"axios.defaults" | |
], | |
"description": "axios defaults" | |
}, | |
"axios.defaults.baseURL": { | |
"prefix": "axios.defaults.baseURL", | |
"body": [ | |
"axios.defaults.baseURL=" | |
], | |
"description": "axios default baseUrl setting" | |
}, | |
"axios.defaults.timeout": { | |
"prefix": "axios.defaults.timeout", | |
"body": [ | |
"axios.defaults.timeout=" | |
], | |
"description": "axios default timeout setting" | |
}, | |
"axios.defaults.headers": { | |
"prefix": "axios.defaults.headers", | |
"body": [ | |
"axios.defaults.headers" | |
], | |
"description": "axios default headers setting" | |
}, | |
"axios.interceptors.request": { | |
"prefix": "axios.interceptors.request.use", | |
"body": [ | |
"axios.interceptors.request.use(config => {", | |
"// Do something before request is sent", | |
"return config;", | |
"},error => {", | |
"// Do something with request error", | |
"return Promise.reject(error);", | |
"});" | |
], | |
"description": "intercept axios request" | |
}, | |
"axios.interceptors.response": { | |
"prefix": "axios.interceptors.response.use", | |
"body": [ | |
"axios.interceptors.response.use(response => {", | |
"// Do something before response is sent", | |
"return response;", | |
"},error => {", | |
"// Do something with response error", | |
"return Promise.reject(error);", | |
"});" | |
], | |
"description": "intercept axios response" | |
}, | |
"proxy": { | |
"prefix": "proxy", | |
"body": [ | |
"proxy:{\n}" | |
], | |
"description": "axios config proxy" | |
}, | |
"cancelToken": { | |
"prefix": "cancelToken", | |
"body": [ | |
"cancelToken: new CancelToken(()=>{})" | |
], | |
"description": "axios config cancelToken" | |
}, | |
"transformRequest": { | |
"prefix": "transformRequest", | |
"body": [ | |
"transformRequest[(${1:data})=>{}]" | |
], | |
"description": "axios config transformRequest" | |
}, | |
"baseURL": { | |
"prefix": "baseURL", | |
"body": [ | |
"baseURL:${1:url}" | |
], | |
"description": "axios config baseURL" | |
}, | |
"paramsSerializer": { | |
"prefix": "paramsSerializer", | |
"body": [ | |
"paramsSerializer:${1:param}=>{return serialize param}" | |
], | |
"description": "axios config baseURL" | |
}, | |
"xsrfCookieName": { | |
"prefix": "xsrfCookieName", | |
"body": [ | |
"xsrfCookieName: 'XSRF-TOKEN'" | |
], | |
"description": "axios config xsrfCookieName" | |
}, | |
"onUploadProgress": { | |
"prefix": "onUploadProgress", | |
"body": [ | |
"onUploadProgress: progressEvent=>{}" | |
], | |
"description": "axios config onUploadProgress" | |
}, | |
"onDownloadProgress": { | |
"prefix": "onDownloadProgress", | |
"body": [ | |
"onDownloadProgress: progressEvent=>{}" | |
], | |
"description": "axios config onDownloadProgress" | |
}, | |
"xsrfHeaderName": { | |
"prefix": "xsrfHeaderName", | |
"body": [ | |
"xsrfHeaderName: 'X-XSRF-TOKEN'" | |
], | |
"description": "axios config xsrfHeaderName" | |
}, | |
"validateStatus": { | |
"prefix": "validateStatus", | |
"body": [ | |
"validateStatus: status=>{return true}" | |
], | |
"description": "axios config validateStatus" | |
}, | |
"httpsAgent": { | |
"prefix": "httpsAgent", | |
"body": [ | |
"httpsAgent: new https.Agent({ keepAlive: true })" | |
], | |
"description": "axios config httpsAgent" | |
}, | |
"responseType": { | |
"prefix": "responseType", | |
"body": [ | |
"responseType: 'json'" | |
], | |
"description": "axios config responseType" | |
}, | |
"withCredentials": { | |
"prefix": "withCredentials", | |
"body": [ | |
"withCredentials: false" | |
], | |
"description": "axios config withCredentials" | |
}, | |
"adapter": { | |
"prefix": "adapter", | |
"body": [ | |
"adapter: config=>{}" | |
], | |
"description": "axios config adapter" | |
}, | |
"auth": { | |
"prefix": "auth", | |
"body": [ | |
"auth: {", | |
"username: ${1:name}", | |
"password: ${1:password}", | |
"}" | |
], | |
"description": "axios config Authorization" | |
}, | |
"maxRedirects": { | |
"prefix": "maxRedirects", | |
"body": [ | |
"maxRedirects:5" | |
], | |
"description": "axios config maxRedirects" | |
}, | |
" maxContentLength": { | |
"prefix": "maxContentLength", | |
"body": [ | |
"maxContentLength: ${1:length}" | |
], | |
"description": "axios config maxContentLength" | |
}, | |
" data": { | |
"prefix": "data", | |
"body": [ | |
"data:{}" | |
], | |
"description": "axios config data" | |
}, | |
"console.dir": { | |
"prefix": "cd", | |
"body": [ | |
"console.dir($1);" | |
], | |
"description": "Code snippet for \"console.dir\"" | |
}, | |
"console.error": { | |
"prefix": "ce", | |
"body": [ | |
"console.error($1);" | |
], | |
"description": "Code snippet for \"console.error\"" | |
}, | |
"console.info": { | |
"prefix": "ci", | |
"body": [ | |
"console.info($1);" | |
], | |
"description": "Code snippet for \"console.info\"" | |
}, | |
"console.log": { | |
"prefix": "cl", | |
"body": [ | |
"console.log($1);" | |
], | |
"description": "Code snippet for \"console.log\"" | |
}, | |
"console.warn": { | |
"prefix": "cw", | |
"body": [ | |
"console.warn($1);" | |
], | |
"description": "Code snippet for \"console.warn\"" | |
}, | |
"debugger": { | |
"prefix": "de", | |
"body": [ | |
"debugger;$1" | |
], | |
"description": "Code snippet for \"debugger\"" | |
}, | |
"addEventListener": { | |
"prefix": "ae", | |
"body": [ | |
"${1:document}.addEventListener('${2:load}', function (e) {", | |
"\t${3:// body}", | |
"});" | |
], | |
"description": "Code snippet for \"addEventListener\"" | |
}, | |
"appendChild": { | |
"prefix": "ac", | |
"body": [ | |
"${1:document}.appendChild(${2:elem});" | |
], | |
"description": "Code snippet for \"appendChild\"" | |
}, | |
"removeChild": { | |
"prefix": "rc", | |
"body": [ | |
"${1:document}.removeChild(${2:elem});" | |
], | |
"description": "Code snippet for \"removeChild\"" | |
}, | |
"createElement": { | |
"prefix": "cel", | |
"body": [ | |
"${1:document}.createElement(${2:elem});" | |
], | |
"description": "Code snippet for \"createElement\"" | |
}, | |
"createDocumentFragment": { | |
"prefix": "cdf", | |
"body": [ | |
"${1:document}.createDocumentFragment();$2" | |
], | |
"description": "Code snippet for \"createDocumentFragment\"" | |
}, | |
"classList.add": { | |
"prefix": "ca", | |
"body": [ | |
"${1:document}.classList.add('${2:class}');" | |
], | |
"description": "Code snippet for \"classList.add\"" | |
}, | |
"classList.toggle": { | |
"prefix": "ct", | |
"body": [ | |
"${1:document}.classList.toggle('${2:class}');" | |
], | |
"description": "Code snippet for \"classList.toggle\"" | |
}, | |
"classList.remove": { | |
"prefix": "cr", | |
"body": [ | |
"${1:document}.classList.remove('${2:class}');" | |
], | |
"description": "Code snippet for \"classList.remove\"" | |
}, | |
"getElementById": { | |
"prefix": "gi", | |
"body": [ | |
"${1:document}.getElementById('${2:id}');" | |
], | |
"description": "Code snippet for \"getElementById\"" | |
}, | |
"getElementsByClassName": { | |
"prefix": "gc", | |
"body": [ | |
"${1:document}.getElementsByClassName('${2:class}');" | |
], | |
"description": "Code snippet for \"getElementsByClassName\"" | |
}, | |
"getElementsByTagName": { | |
"prefix": "gt", | |
"body": [ | |
"${1:document}.getElementsByTagName('${2:tag}');" | |
], | |
"description": "Code snippet for \"getElementsByTagName\"" | |
}, | |
"getAttribute": { | |
"prefix": "ga", | |
"body": [ | |
"${1:document}.getAttribute('${2:attr}');" | |
], | |
"description": "Code snippet for \"getAttribute\"" | |
}, | |
"setAttribute": { | |
"prefix": "sa", | |
"body": [ | |
"${1:document}.setAttribute('${2:attr}', ${3:value});" | |
], | |
"description": "Code snippet for \"setAttribute\"" | |
}, | |
"removeAttribute": { | |
"prefix": "ra", | |
"body": [ | |
"${1:document}.removeAttribute('${2:attr}');" | |
], | |
"description": "Code snippet for \"removeAttribute\"" | |
}, | |
"innerHTML": { | |
"prefix": "ih", | |
"body": [ | |
"${1:document}.innerHTML = '${2:elem}';" | |
], | |
"description": "Code snippet for \"innerHTML\"" | |
}, | |
"textContent": { | |
"prefix": "tc", | |
"body": [ | |
"${1:document}.textContent = '${2:content}';" | |
], | |
"description": "Code snippet for \"textContent\"" | |
}, | |
"querySelector": { | |
"prefix": "qs", | |
"body": [ | |
"${1:document}.querySelector('${2:selector}');" | |
], | |
"description": "Code snippet for \"querySelector\"" | |
}, | |
"querySelectorAll": { | |
"prefix": "qsa", | |
"body": [ | |
"${1:document}.querySelectorAll('${2:selector}');" | |
], | |
"description": "Code snippet for \"querySelectorAll\"" | |
}, | |
"forEach": { | |
"prefix": "fe", | |
"body": [ | |
"${1:array}.forEach(function(item) {", | |
"\t${2:// body}", | |
"});" | |
], | |
"description": "Code snippet for \"forEach\"" | |
}, | |
"function": { | |
"prefix": "fn", | |
"body": [ | |
"function ${1:methodName} (${2:arguments}) {", | |
"\t${3:// body}", | |
"}" | |
], | |
"description": "Code snippet for function" | |
}, | |
"anonymous function": { | |
"prefix": "afn", | |
"body": [ | |
"function(${1:arguments}) {", | |
"\t${2:// body}", | |
"}" | |
], | |
"description": "Code snippet for anonymous function" | |
}, | |
"prototype": { | |
"prefix": "pr", | |
"body": [ | |
"${1:object}.prototype.${2:method} = function(${3:arguments}) {", | |
"\t${4:// body}", | |
"}" | |
], | |
"description": "Code snippet for prototype" | |
}, | |
"immediately-invoked function expression": { | |
"prefix": "iife", | |
"body": [ | |
"(function(${1:window}, ${2:document}) {", | |
"\t${3:// body}", | |
"})(${1:window}, ${2:document});" | |
], | |
"description": "Code snippet for immediately-invoked function expression" | |
}, | |
"function call": { | |
"prefix": "call", | |
"body": [ | |
"${1:method}.call(${2:context}, ${3:arguments});" | |
], | |
"description": "Code snippet for function call" | |
}, | |
"function apply": { | |
"prefix": "apply", | |
"body": [ | |
"${1:method}.apply(${2:context}, [${3:arguments}]);" | |
], | |
"description": "Code snippet for function apply" | |
}, | |
"function as a property of an object": { | |
"prefix": "ofn", | |
"body": [ | |
"${1:functionName}: function(${2:arguments}) {", | |
"\t${3:// body}", | |
"}" | |
], | |
"description": "Code snippet for function as a property of an object" | |
}, | |
"JSON.parse": { | |
"prefix": "jp", | |
"body": [ | |
"JSON.parse(${1:obj});" | |
], | |
"description": "Code snippet for 'JSON.parse'" | |
}, | |
"JSON.stringify": { | |
"prefix": "js", | |
"body": [ | |
"JSON.stringify(${1:obj});" | |
], | |
"description": "Code snippet for 'JSON.stringify'" | |
}, | |
"setInterval": { | |
"prefix": "si", | |
"body": [ | |
"setInterval(function() {", | |
"\t${0:// body}", | |
"}, ${1:1000});" | |
], | |
"description": "Code snippet for 'setInterval'" | |
}, | |
"setTimeout": { | |
"prefix": "st", | |
"body": [ | |
"setTimeout(function() {", | |
"\t${0:// body}", | |
"}, ${1:1000});" | |
], | |
"description": "Code snippet for 'setTimeout'" | |
}, | |
"use strict": { | |
"prefix": "us", | |
"body": [ | |
"'use strict';" | |
], | |
"description": "Code snippet for 'use strict'" | |
}, | |
"alert": { | |
"prefix": "al", | |
"body": [ | |
"alert('${1:msg}');" | |
], | |
"description": "Code snippet for 'alert'" | |
}, | |
"confirm": { | |
"prefix": "co", | |
"body": [ | |
"confirm('${1:msg}');" | |
], | |
"description": "Code snippet for 'confirm'" | |
}, | |
"prompt": { | |
"prefix": "pm", | |
"body": [ | |
"prompt('${1:msg}');" | |
], | |
"description": "Code snippet for 'prompt'" | |
}, | |
"func": { | |
"prefix": "func", | |
"body": [ | |
"function (${param}) { }" | |
], | |
"description": "An anonymous function." | |
}, | |
"jqAfter": { | |
"prefix": "jqAfter", | |
"body": [ | |
"$(${selector}).after(${content});" | |
], | |
"description": "Insert content, specified by the parameter, after each element in the set of matched elements." | |
}, | |
"jqAjax": { | |
"prefix": "jqAjax", | |
"body": [ | |
"$.ajax({", | |
"\ttype: \"${method}\",", | |
"\turl: \"${url}\",", | |
"\tdata: \"${data}\",", | |
"\tdataType: \"${dataType}\",", | |
"\tsuccess: function (response) {", | |
"\t\t$0", | |
"\t}", | |
"});" | |
], | |
"description": "Perform an asynchronous HTTP (Ajax) request." | |
}, | |
"jqAjaxAspNetWebService": { | |
"prefix": "jqAjaxAspNetWebService", | |
"body": [ | |
"$.ajax({", | |
"\ttype: \"POST\",", | |
"\tcontentType: \"application/json; charset=utf-8\",", | |
"\tdataType: \"${dataType}\",", | |
"\turl: \"${url}\",", | |
"\tdata: \"${data}\",", | |
"\tsuccess: function (response) {", | |
"\t\t$0", | |
"\t}", | |
"});" | |
], | |
"description": "Perform an asynchronous HTTP (Ajax) request to a ASP.NET web service." | |
}, | |
"jqAppend": { | |
"prefix": "jqAppend", | |
"body": [ | |
"$(${selector}).append(${content});" | |
], | |
"description": "Insert content, specified by the parameter, to the end of each element in the set of matched elements." | |
}, | |
"jqAppendTo": { | |
"prefix": "jqAppendTo", | |
"body": [ | |
"$(${content}).appendTo(${selector});" | |
], | |
"description": "Insert every element in the set of matched elements to the end of the target." | |
}, | |
"jqAttrGet": { | |
"prefix": "jqAttrGet", | |
"body": [ | |
"$(${selector}).attr(${attributeName});" | |
], | |
"description": "Get the value of an attribute for the first element in the set of matched elements." | |
}, | |
"jqAttrRemove": { | |
"prefix": "jqAttrRemove", | |
"body": [ | |
"$(${selector}).removeAttr(${attributeName});" | |
], | |
"description": "Remove an attribute from each element in the set of matched elements." | |
}, | |
"jqAttrSet": { | |
"prefix": "jqAttrSet", | |
"body": [ | |
"$(${selector}).attr(${attributeName}, ${value});" | |
], | |
"description": "Set one or more attributes for the set of matched elements." | |
}, | |
"jqAttrSetFn": { | |
"prefix": "jqAttrSetFn", | |
"body": [ | |
"$(${selector}).attr(${attributeName}, function (index, attr) { ", | |
"\t$0 ", | |
"});" | |
], | |
"description": "Set one or more attributes for the set of matched elements." | |
}, | |
"jqAttrSetObj": { | |
"prefix": "jqAttrSetObj", | |
"body": [ | |
"$(${selector}).attr({", | |
"\t${name}: ${value}", | |
"\t$0", | |
"});" | |
], | |
"description": "Set one or more attributes for the set of matched elements." | |
}, | |
"jqBefore": { | |
"prefix": "jqBefore", | |
"body": [ | |
"$(${selector}).before(${content});" | |
], | |
"description": "Insert content, specified by the parameter, before each element in the set of matched elements." | |
}, | |
"jqBind": { | |
"prefix": "jqBind", | |
"body": [ | |
"$(${selector}).bind(${eventType}, function (e) {", | |
"\t$0", | |
"});" | |
], | |
"description": "Attach a handler to an event for the elements." | |
}, | |
"jqBindWithData": { | |
"prefix": "jqBindWithData", | |
"body": [ | |
"$(${selector}).bind(${eventType}, ${eventData}, function (e) {", | |
"\t$0", | |
"});" | |
], | |
"description": "Attach a handler to an event for the elements." | |
}, | |
"jqBlur": { | |
"prefix": "jqBlur", | |
"body": [ | |
"$(${selector}).blur(function (e) { ", | |
"\te.preventDefault();", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"blur\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqChange": { | |
"prefix": "jqChange", | |
"body": [ | |
"$(${selector}).change(function (e) { ", | |
"\te.preventDefault();", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"change\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqClassAdd": { | |
"prefix": "jqClassAdd", | |
"body": [ | |
"$(${selector}).addClass(${className});" | |
], | |
"description": "Adds the specified class(es) to each of the set of matched elements." | |
}, | |
"jqClassRemove": { | |
"prefix": "jqClassRemove", | |
"body": [ | |
"$(${selector}).removeClass(${className});" | |
], | |
"description": "Remove a single class, multiple classes, or all classes from each element in the set of matched elements." | |
}, | |
"jqClassToggle": { | |
"prefix": "jqClassToggle", | |
"body": [ | |
"$(${selector}).toggleClass(${className});" | |
], | |
"description": "Add or remove one or more classes from each element in the set of matched elements, depending on either the class\u0027s presence." | |
}, | |
"jqClassToggleSwitch": { | |
"prefix": "jqClassToggleSwitch", | |
"body": [ | |
"$(${selector}).toggleClass(${className}, ${switch});" | |
], | |
"description": "Add or remove one or more classes from each element in the set of matched elements, depending on either the class\u0027s presence or the value of the switch argument." | |
}, | |
"jqClick": { | |
"prefix": "jqClick", | |
"body": [ | |
"$(${selector}).click(function (e) { ", | |
"\te.preventDefault();", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"click\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqClone": { | |
"prefix": "jqClone", | |
"body": [ | |
"$(${selector}).clone();" | |
], | |
"description": "Create a deep copy of the set of matched elements." | |
}, | |
"jqCloneWithEvents": { | |
"prefix": "jqCloneWithEvents", | |
"body": [ | |
"$(${selector}).clone(true);" | |
], | |
"description": "Create a deep copy of the set of matched elements." | |
}, | |
"jqCssGet": { | |
"prefix": "jqCssGet", | |
"body": [ | |
"$(${selector}).css(${propertyName});" | |
], | |
"description": "Get the computed style properties for the first element in the set of matched elements." | |
}, | |
"jqCssSet": { | |
"prefix": "jqCssSet", | |
"body": [ | |
"$(${selector}).css(${propertyName}, ${value});" | |
], | |
"description": "Set one or more CSS properties for the set of matched elements." | |
}, | |
"jqCssSetObj": { | |
"prefix": "jqCssSetObj", | |
"body": [ | |
"$(${selector}).css({", | |
"\t${propertyName}: ${value}", | |
"\t$0", | |
"});" | |
], | |
"description": "Set one or more CSS properties for the set of matched elements." | |
}, | |
"jqDataGet": { | |
"prefix": "jqDataGet", | |
"body": [ | |
"$(${selector}).data(${key});" | |
], | |
"description": "Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute." | |
}, | |
"jqDataRemove": { | |
"prefix": "jqDataRemove", | |
"body": [ | |
"$(${selector}).removeData(${element});" | |
], | |
"description": "Remove a previously-stored piece of data." | |
}, | |
"jqDataSet": { | |
"prefix": "jqDataSet", | |
"body": [ | |
"$(${selector}).data(${key}, ${value});" | |
], | |
"description": "Store arbitrary data associated with the matched elements." | |
}, | |
"jqDataSetObj": { | |
"prefix": "jqDataSetObj", | |
"body": [ | |
"$(${selector}).data({", | |
"\t${key}: ${value}", | |
"\t$0", | |
"});" | |
], | |
"description": "Store arbitrary data associated with the matched elements." | |
}, | |
"jqDie": { | |
"prefix": "jqDie", | |
"body": [ | |
"$(${selector}).die(${eventType});" | |
], | |
"description": "Remove event handlers previously attached using .live() from the elements." | |
}, | |
"jqDieAll": { | |
"prefix": "jqDieAll", | |
"body": [ | |
"$(${selector}).die();" | |
], | |
"description": "Remove event handlers previously attached using .live() from the elements." | |
}, | |
"jqDieFn": { | |
"prefix": "jqDieFn", | |
"body": [ | |
"$(${selector}).die(${eventType}, ${handler});" | |
], | |
"description": "Remove event handlers previously attached using .live() from the elements." | |
}, | |
"jqDocReady": { | |
"prefix": "jqDocReady", | |
"body": [ | |
"$(document).ready(function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Function to execute when the DOM is fully loaded." | |
}, | |
"jqDocReadyShort": { | |
"prefix": "jqDocReadyShort", | |
"body": [ | |
"$(function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Function to execute when the DOM is fully loaded." | |
}, | |
"jqEach": { | |
"prefix": "jqEach", | |
"body": [ | |
"$.each(${collection}, function (indexInArray, valueOfElement) { ", | |
"\t$0 ", | |
"});" | |
], | |
"description": "A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function\u0027s arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties." | |
}, | |
"jqEachElement": { | |
"prefix": "jqEachElement", | |
"body": [ | |
"$(${selector}).each(function (index, element) {", | |
"\t// element == this", | |
"\t$0", | |
"});" | |
], | |
"description": "Iterate over a jQuery object, executing a function for each matched element. " | |
}, | |
"jqEmpty": { | |
"prefix": "jqEmpty", | |
"body": [ | |
"$(${selector}).empty();" | |
], | |
"description": "Remove all child nodes of the set of matched elements from the DOM." | |
}, | |
"jqFadeIn": { | |
"prefix": "jqFadeIn", | |
"body": [ | |
"$(${selector}).fadeIn();" | |
], | |
"description": "Display the matched elements by fading them to opaque." | |
}, | |
"jqFadeInFull": { | |
"prefix": "jqFadeInFull", | |
"body": [ | |
"$(${selector}).fadeIn(${duration}, function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Display the matched elements by fading them to opaque." | |
}, | |
"jqFadeOut": { | |
"prefix": "jqFadeOut", | |
"body": [ | |
"$(${selector}).fadeOut();" | |
], | |
"description": "Hide the matched elements by fading them to transparent." | |
}, | |
"jqFadeOutFull": { | |
"prefix": "jqFadeOutFull", | |
"body": [ | |
"$(${selector}).fadeOut(${duration}, function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Hide the matched elements by fading them to transparent." | |
}, | |
"jqFadeTo": { | |
"prefix": "jqFadeTo", | |
"body": [ | |
"$(${selector}).fadeTo(${duration}, ${opacity});" | |
], | |
"description": "Adjust the opacity of the matched elements." | |
}, | |
"jqFadeToFull": { | |
"prefix": "jqFadeToFull", | |
"body": [ | |
"$(${selector}).fadeTo(${duration}, ${opacity}, function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Adjust the opacity of the matched elements." | |
}, | |
"jqFind": { | |
"prefix": "jqFind", | |
"body": [ | |
"$(${selector}).find(${selector2});" | |
], | |
"description": "Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element." | |
}, | |
"jqFocus": { | |
"prefix": "jqFocus", | |
"body": [ | |
"$(${selector}).focus(function (e) { ", | |
"\te.preventDefault();", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"focus\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqGet": { | |
"prefix": "jqGet", | |
"body": [ | |
"$.get(\"${url}\", ${data},", | |
"\tfunction (data, textStatus, jqXHR) {", | |
"\t\t$0", | |
"\t},", | |
"\t\"${dataType}\"", | |
");" | |
], | |
"description": "Load data from the server using a HTTP GET request." | |
}, | |
"jqGetJson": { | |
"prefix": "jqGetJson", | |
"body": [ | |
"$.getJSON(\"${url}\", ${data},", | |
"\tfunction (data, textStatus, jqXHR) {", | |
"\t\t$0", | |
"\t}", | |
");" | |
], | |
"description": "Load JSON-encoded data from the server using a GET HTTP request." | |
}, | |
"jqGetScript": { | |
"prefix": "jqGetScript", | |
"body": [ | |
"$.getScript(\"${url}\", function (script, textStatus, jqXHR) {", | |
"\t$0", | |
"});" | |
], | |
"description": "Load a JavaScript file from the server using a GET HTTP request, then execute it." | |
}, | |
"jqHasClass": { | |
"prefix": "jqHasClass", | |
"body": [ | |
"$(${selector}).hasClass(${className});" | |
], | |
"description": "Determine whether any of the matched elements are assigned the given class." | |
}, | |
"jqHeightGet": { | |
"prefix": "jqHeightGet", | |
"body": [ | |
"$(${selector}).height();" | |
], | |
"description": "Get the current computed height for the first element in the set of matched elements." | |
}, | |
"jqHeightSet": { | |
"prefix": "jqHeightSet", | |
"body": [ | |
"$(${selector}).height(${value});" | |
], | |
"description": "Set the CSS height of every matched element." | |
}, | |
"jqHide": { | |
"prefix": "jqHide", | |
"body": [ | |
"$(${selector}).hide();" | |
], | |
"description": "Hide the matched elements." | |
}, | |
"jqHideFull": { | |
"prefix": "jqHideFull", | |
"body": [ | |
"$(${selector}).hide(${duration}, function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Hide the matched elements." | |
}, | |
"jqHover": { | |
"prefix": "jqHover", | |
"body": [ | |
"$(${selector}).hover(function () {", | |
"\t\t// over", | |
"\t\t$0", | |
"\t}, function () {", | |
"\t\t// out", | |
"\t}", | |
");" | |
], | |
"description": "Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements." | |
}, | |
"jqHtmlGet": { | |
"prefix": "jqHtmlGet", | |
"body": [ | |
"$(${selector}).html();" | |
], | |
"description": "Get the HTML contents of the first element in the set of matched elements." | |
}, | |
"jqHtmlSet": { | |
"prefix": "jqHtmlSet", | |
"body": [ | |
"$(${selector}).html(${htmlString});" | |
], | |
"description": "Set the HTML contents of each element in the set of matched elements." | |
}, | |
"jqInnerHeight": { | |
"prefix": "jqInnerHeight", | |
"body": [ | |
"$(${selector}).innerHeight();" | |
], | |
"description": "Get the current computed height for the first element in the set of matched elements, including padding but not border." | |
}, | |
"jqInnerWidth": { | |
"prefix": "jqInnerWidth", | |
"body": [ | |
"$(${selector}).innerWidth();" | |
], | |
"description": "Get the current computed inner width for the first element in the set of matched elements, including padding but not border." | |
}, | |
"jqInsertAfter": { | |
"prefix": "jqInsertAfter", | |
"body": [ | |
"$(${target}).insertAfter(${selector});" | |
], | |
"description": "Insert every element in the set of matched elements after the target." | |
}, | |
"jqInsertBefore": { | |
"prefix": "jqInsertBefore", | |
"body": [ | |
"$(${target}).insertBefore(${selector});" | |
], | |
"description": "Insert every element in the set of matched elements before the target." | |
}, | |
"jqKeyDown": { | |
"prefix": "jqKeyDown", | |
"body": [ | |
"$(${selector}).keydown(function (e) { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"keydown\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqKeyPress": { | |
"prefix": "jqKeyPress", | |
"body": [ | |
"$(${selector}).keypress(function (e) { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"keypress\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqKeyUp": { | |
"prefix": "jqKeyUp", | |
"body": [ | |
"$(${selector}).keyup(function (e) { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"keyup\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqLoadGet": { | |
"prefix": "jqLoadGet", | |
"body": [ | |
"$(${selector}).load(\"${url}\", \"${data}\", function (response, status, request) {", | |
"\tthis; // dom element", | |
"\t$0", | |
"});" | |
], | |
"description": "Load data from the server and place the returned HTML into the matched element." | |
}, | |
"jqLoadPost": { | |
"prefix": "jqLoadPost", | |
"body": [ | |
"$(${selector}).load(\"${url}\", \"${data}\", function (response, status, request) {", | |
"\tthis; // dom element", | |
"\t$0", | |
"});" | |
], | |
"description": "Load data from the server and place the returned HTML into the matched element." | |
}, | |
"jqMap": { | |
"prefix": "jqMap", | |
"body": [ | |
"$.map(${arrayOrObject}, function (elementOrValue, indexOrKey) {", | |
"\t$0", | |
"});" | |
], | |
"description": "Translate all items in an array or object to new array of items." | |
}, | |
"jqMouseDown": { | |
"prefix": "jqMouseDown", | |
"body": [ | |
"$(${selector}).mousedown(function () { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"mousedown\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqMouseEnter": { | |
"prefix": "jqMouseEnter", | |
"body": [ | |
"$(${selector}).mouseenter(function () { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element." | |
}, | |
"jqMouseLeave": { | |
"prefix": "jqMouseLeave", | |
"body": [ | |
"$(${selector}).mouseleave(function () { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element." | |
}, | |
"jqMouseMove": { | |
"prefix": "jqMouseMove", | |
"body": [ | |
"$(${selector}).mousemove(function (e) { ", | |
"\t// values: e.clientX, e.clientY, e.pageX, e.pageY", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"mousemove\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqMouseOut": { | |
"prefix": "jqMouseOut", | |
"body": [ | |
"$(${selector}).mouseout(function () { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"mouseout\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqMouseOver": { | |
"prefix": "jqMouseOver", | |
"body": [ | |
"$(${selector}).mouseover(function () { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"mouseover\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqMouseUp": { | |
"prefix": "jqMouseUp", | |
"body": [ | |
"$(${selector}).mouseup(function () { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"mouseup\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqNamespace": { | |
"prefix": "jqNamespace", | |
"body": [ | |
"(function ( ${name}, $, undefined ) {", | |
"\t// Private Property", | |
"\tmyPrivateProperty = \"Private Property\";", | |
"\t\t", | |
"\t// Public Property", | |
"\t${name}.myPublicProperty = \"Publically Accessible Property\";", | |
"\t\t", | |
"\t// Private Method", | |
"\tfunction myPrivateMethod () {", | |
"\t\t", | |
"\t}", | |
"\t\t", | |
"\t// Public Method", | |
"\t${name}.myPublicMethod = function () {", | |
"\t\t", | |
"\t}; ", | |
"}(window.${name} = window.${name} || {}, jQuery ));" | |
], | |
"description": "A namespace template. ref: http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/" | |
}, | |
"jqOffsetGet": { | |
"prefix": "jqOffsetGet", | |
"body": [ | |
"var offset = $(${selector}).offset();", | |
"var top = offset.top;", | |
"var left = offset.left;", | |
"$0" | |
], | |
"description": "Get the current coordinates of the first element, or set the coordinates of every element, in the set of matched elements, relative to the document." | |
}, | |
"jqOffsetParent": { | |
"prefix": "jqOffsetParent", | |
"body": [ | |
"var offset = $(${selector}).offsetParent();", | |
"var top = offset.top;", | |
"var left = offset.left;", | |
"$0" | |
], | |
"description": "Get the closest ancestor element that is positioned." | |
}, | |
"jqOn": { | |
"prefix": "jqOn", | |
"body": [ | |
"$(${selector}).on(${events}, function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Attach an event handler function for one or more events to the selected elements." | |
}, | |
"jqOne": { | |
"prefix": "jqOne", | |
"body": [ | |
"$(${selector}).one(${events}, function (e) {", | |
"\t$0", | |
"});" | |
], | |
"description": "Attach a handler to an event for the elements. The handler is executed at most once per element per event type." | |
}, | |
"jqOneWithData": { | |
"prefix": "jqOneWithData", | |
"body": [ | |
"$(${selector}).one(${events}, ${data}, function (e) {", | |
"\t$0", | |
"});" | |
], | |
"description": "Attach a handler to an event for the elements. The handler is executed at most once per element per event type." | |
}, | |
"jqOuterHeight": { | |
"prefix": "jqOuterHeight", | |
"body": [ | |
"$(${selector}).outerHeight(${includeMargin});" | |
], | |
"description": "Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns a number (without \"px\") representation of the value or null if called on an empty set of elements." | |
}, | |
"jqOuterWidth": { | |
"prefix": "jqOuterWidth", | |
"body": [ | |
"$(${selector}).outerWidth(${includeMargin});" | |
], | |
"description": "Get the current computed width for the first element in the set of matched elements, including padding and border." | |
}, | |
"jqPlugin": { | |
"prefix": "jqPlugin", | |
"body": [ | |
"(function ($) {", | |
"\tjQuery.fn.${pluginName} = function (settings) {", | |
"\t\tvar config = {\u0027foo\u0027: \u0027bar\u0027};", | |
" ", | |
"\t\tif (settings) jQuery.extend(config, settings);", | |
" ", | |
"\t\tthis.each(function () {", | |
"\t\t\t// element-specific code here", | |
"\t\t\t$0", | |
"\t\t});", | |
" ", | |
"\t\treturn this;", | |
"\t};", | |
"})(jQuery);" | |
], | |
"description": "Plugin template." | |
}, | |
"jqPosition": { | |
"prefix": "jqPosition", | |
"body": [ | |
"var position = $(${selector}).position();", | |
"var top = position.top;", | |
"var left = position.left;", | |
"$0" | |
], | |
"description": "Get the current coordinates of the first element in the set of matched elements, relative to the offset parent." | |
}, | |
"jqPost": { | |
"prefix": "jqPost", | |
"body": [ | |
"$.post(\"${url}\", ${data},", | |
"\tfunction (data, textStatus, jqXHR) {", | |
"\t\t$0", | |
"\t},", | |
"\t\"${dataType}\"", | |
");" | |
], | |
"description": "Load data from the server using a HTTP POST request." | |
}, | |
"jqPrepend": { | |
"prefix": "jqPrepend", | |
"body": [ | |
"$(${selector}).prepend(${content});" | |
], | |
"description": "Insert content, specified by the parameter, to the beginning of each element in the set of matched elements." | |
}, | |
"jqPrependTo": { | |
"prefix": "jqPrependTo", | |
"body": [ | |
"$(${content}).prependTo(${selector});" | |
], | |
"description": "Insert every element in the set of matched elements to the beginning of the target." | |
}, | |
"jqRemove": { | |
"prefix": "jqRemove", | |
"body": [ | |
"$(${selector}).remove();" | |
], | |
"description": "Remove the set of matched elements from the DOM." | |
}, | |
"jqRemoveExp": { | |
"prefix": "jqRemoveExp", | |
"body": [ | |
"$(${selector}).remove(${expression});" | |
], | |
"description": "Remove the set of matched elements from the DOM." | |
}, | |
"jqReplaceAll": { | |
"prefix": "jqReplaceAll", | |
"body": [ | |
"$(${selector}).replaceAll(${target});" | |
], | |
"description": "Replace each target element with the set of matched elements." | |
}, | |
"jqReplaceWith": { | |
"prefix": "jqReplaceWith", | |
"body": [ | |
"$(${selector}).replaceWith(${newContent});" | |
], | |
"description": "Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed." | |
}, | |
"jqResize": { | |
"prefix": "jqResize", | |
"body": [ | |
"$(${selector}).resize(function () { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"resize\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqScroll": { | |
"prefix": "jqScroll", | |
"body": [ | |
"$(${selector}).scroll(function () { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"scroll\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqScrollLeftGet": { | |
"prefix": "jqScrollLeftGet", | |
"body": [ | |
"$(${selector}).scrollLeft();" | |
], | |
"description": "Get the current horizontal position of the scroll bar for the first element in the set of matched elements." | |
}, | |
"jqScrollLeftSet": { | |
"prefix": "jqScrollLeftSet", | |
"body": [ | |
"$(${selector}).scrollLeft(${value});" | |
], | |
"description": "Set the current horizontal position of the scroll bar for each of the set of matched elements." | |
}, | |
"jqScrollTopGet": { | |
"prefix": "jqScrollTopGet", | |
"body": [ | |
"$(${selector}).scrollTop();" | |
], | |
"description": "Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element." | |
}, | |
"jqScrollTopSet": { | |
"prefix": "jqScrollTopSet", | |
"body": [ | |
"$(${selector}).scrollTop(${value});" | |
], | |
"description": "Set the current vertical position of the scroll bar for each of the set of matched elements." | |
}, | |
"jqSelect": { | |
"prefix": "jqSelect", | |
"body": [ | |
"$(${selector}).select(function () { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"select\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqSelectTrigger": { | |
"prefix": "jqSelectTrigger", | |
"body": [ | |
"$(${selector}).select();" | |
], | |
"description": "Bind an event handler to the \"select\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqShow": { | |
"prefix": "jqShow", | |
"body": [ | |
"$(${selector}).show();" | |
], | |
"description": "Display the matched elements." | |
}, | |
"jqShowFull": { | |
"prefix": "jqShowFull", | |
"body": [ | |
"$(${selector}).show(${duration}, function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Display the matched elements." | |
}, | |
"jqSlideDown": { | |
"prefix": "jqSlideDown", | |
"body": [ | |
"$(${selector}).slideDown();" | |
], | |
"description": "Display the matched elements with a sliding motion." | |
}, | |
"jqSlideDownFull": { | |
"prefix": "jqSlideDownFull", | |
"body": [ | |
"$(${selector}).slideDown(${duration}, function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Display the matched elements with a sliding motion." | |
}, | |
"jqSlideToggle": { | |
"prefix": "jqSlideToggle", | |
"body": [ | |
"$(${selector}).slideToggle();" | |
], | |
"description": "Display or hide the matched elements with a sliding motion." | |
}, | |
"jqSlideToggleFull": { | |
"prefix": "jqSlideToggleFull", | |
"body": [ | |
"$(${selector}).slideToggle(${duration}, function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Display or hide the matched elements with a sliding motion." | |
}, | |
"jqSlideUp": { | |
"prefix": "jqSlideUp", | |
"body": [ | |
"$(${selector}).slideUp();" | |
], | |
"description": "Display the matched elements with a sliding motion." | |
}, | |
"jqSlideUpFull": { | |
"prefix": "jqSlideUpFull", | |
"body": [ | |
"$(${selector}).slideUp(${duration}, function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Display the matched elements with a sliding motion." | |
}, | |
"jqSubmit": { | |
"prefix": "jqSubmit", | |
"body": [ | |
"$(${selector}).submit(function (e) { ", | |
"\te.preventDefault();", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"submit\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqSubmitTrigger": { | |
"prefix": "jqSubmitTrigger", | |
"body": [ | |
"$(${selector}).submit();" | |
], | |
"description": "Bind an event handler to the \"submit\" JavaScript event, or trigger that event on an element." | |
}, | |
"jqTextGet": { | |
"prefix": "jqTextGet", | |
"body": [ | |
"$(${selector}).text();" | |
], | |
"description": "Get the combined text contents of each element in the set of matched elements, including their descendants." | |
}, | |
"jqTextSet": { | |
"prefix": "jqTextSet", | |
"body": [ | |
"$(${selector}).text(${textString});" | |
], | |
"description": "Set the content of each element in the set of matched elements to the specified text." | |
}, | |
"jqToggle": { | |
"prefix": "jqToggle", | |
"body": [ | |
"$(${selector}).toggle();" | |
], | |
"description": "Display or hide the matched elements." | |
}, | |
"jqToggleFull": { | |
"prefix": "jqToggleFull", | |
"body": [ | |
"$(${selector}).toggle(${duration}, function () {", | |
"\t$0", | |
"});" | |
], | |
"description": "Display or hide the matched elements." | |
}, | |
"jqToggleSwitch": { | |
"prefix": "jqToggleSwitch", | |
"body": [ | |
"$(${selector}).toggle(${showOrHide});" | |
], | |
"description": "Display or hide the matched elements." | |
}, | |
"jqTrigger": { | |
"prefix": "jqTrigger", | |
"body": [ | |
"$(${selector}).trigger(${eventType});" | |
], | |
"description": "Execute all handlers and behaviors attached to the matched elements for the given event type." | |
}, | |
"jqTriggerHandler": { | |
"prefix": "jqTriggerHandler", | |
"body": [ | |
"$(${selector}).triggerHandler(${eventType});" | |
], | |
"description": "Execute all handlers attached to an element for an event." | |
}, | |
"jqTriggerHandlerWithData": { | |
"prefix": "jqTriggerHandlerWithData", | |
"body": [ | |
"$(${selector}).triggerHandler(${eventType}, { ${name}: ${value} });" | |
], | |
"description": "Execute all handlers attached to an element for an event." | |
}, | |
"jqTriggerWithData": { | |
"prefix": "jqTriggerWithData", | |
"body": [ | |
"$(${selector}).trigger(${eventType}, { ${name}: ${value} });" | |
], | |
"description": "Execute all handlers and behaviors attached to the matched elements for the given event type." | |
}, | |
"jqUnbind": { | |
"prefix": "jqUnbind", | |
"body": [ | |
"$(${selector}).unbind(${eventType});" | |
], | |
"description": "Remove a previously-attached event handler from the elements." | |
}, | |
"jqUnbindAll": { | |
"prefix": "jqUnbindAll", | |
"body": [ | |
"$(${selector}).unbind();" | |
], | |
"description": "Remove a previously-attached event handler from the elements." | |
}, | |
"jqUnload": { | |
"prefix": "jqUnload", | |
"body": [ | |
"$(${selector}).unload(function () { ", | |
"\t$0", | |
"});" | |
], | |
"description": "Bind an event handler to the \"unload\" JavaScript event." | |
}, | |
"jqValGet": { | |
"prefix": "jqValGet", | |
"body": [ | |
"$(${selector}).val();" | |
], | |
"description": "Get the current value of the first element in the set of matched elements." | |
}, | |
"jqValSet": { | |
"prefix": "jqValSet", | |
"body": [ | |
"$(${selector}).val(${value});" | |
], | |
"description": "Set the value of each element in the set of matched elements." | |
}, | |
"jqWidthGet": { | |
"prefix": "jqWidthGet", | |
"body": [ | |
"$(${selector}).width();" | |
], | |
"description": "Get the current computed width for the first element in the set of matched elements." | |
}, | |
"jqWidthSet": { | |
"prefix": "jqWidthSet", | |
"body": [ | |
"$(${selector}).width(${value});" | |
], | |
"description": "Set the CSS width of each element in the set of matched elements." | |
}, | |
"jqWrap": { | |
"prefix": "jqWrap", | |
"body": [ | |
"$(${selector}).wrap(\"\u003c${wrappingElement}\u003e\u003c/${wrappingElement}\u003e\");" | |
], | |
"description": "Wrap an HTML structure around each element in the set of matched elements." | |
}, | |
"jqWrapAll": { | |
"prefix": "jqWrapAll", | |
"body": [ | |
"$(${selector}).wrapAll(\"\u003c${wrappingElement}\u003e\u003c/${wrappingElement}\u003e\");" | |
], | |
"description": "Wrap an HTML structure around all elements in the set of matched elements." | |
}, | |
"jqWrapInner": { | |
"prefix": "jqWrapInner", | |
"body": [ | |
"$(${selector}).wrapInner(\"\u003c${wrappingElement}\u003e\u003c/${wrappingElement}\u003e\");" | |
], | |
"description": "Wrap an HTML structure around the content of each element in the set of matched elements." | |
} | |
} |
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
{ | |
"sync.gist": "9afcb67b8396354d5cfa8c37932e401a", | |
"sync.autoDownload": true, | |
"sync.forceDownload": true, | |
"sync.forceUpload": true, | |
"sync.quietSync": true, | |
"sync.autoUpload": true, | |
"editor.suggestSelection": "first", | |
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment