regeneration du js
This commit is contained in:
parent
0586f797d2
commit
04fa0ea1ce
1 changed files with 25 additions and 40 deletions
65
js.json
65
js.json
|
@ -1,40 +1,25 @@
|
|||
|
||||
snippet jq
|
||||
jQuery(function() {
|
||||
`!v vim_snippets#Filename()`();
|
||||
//onAjaxLoad(`!v vim_snippets#Filename()`);
|
||||
|
||||
function `!v vim_snippets#Filename()`(){
|
||||
${0}
|
||||
}
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet con
|
||||
console.log(${1});
|
||||
endsnippet
|
||||
|
||||
snippet ajax_action "req ajax jquery"
|
||||
data = {
|
||||
|
||||
};
|
||||
var request = jQuery.ajax({
|
||||
url: ${1},
|
||||
data: data,
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
});
|
||||
request.done(function(){
|
||||
${0}
|
||||
// console.log(ma_variable_php_de_retour);
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet ajax_reload "Reload ajax spip"
|
||||
ajaxReload('${1}', {
|
||||
args:{
|
||||
${2}:$2,${0}
|
||||
},
|
||||
callback: function(){}
|
||||
});
|
||||
endsnippet
|
||||
{
|
||||
"jq": {
|
||||
"prefix": "jq",
|
||||
"body": "jQuery(function() {\n\t`!v vim_snippets#Filename()`();\n\t//onAjaxLoad(`!v vim_snippets#Filename()`);\n\n\tfunction `!v vim_snippets#Filename()`(){\n\t\t${0}\n\t}\n});"
|
||||
},
|
||||
"con": {
|
||||
"prefix": "con",
|
||||
"body": "console.log(${1});"
|
||||
},
|
||||
"ajax_action": {
|
||||
"prefix": "ajax_action",
|
||||
"body": "data = {\n\n};\nvar request = $.ajax({\n\turl: ${1},\n\tdata: data,\n\tasync: true,\n\tdataType: 'json',\n});\nrequest.done(function(){\n\t${0}\n\t// console.log(ma_variable_php_de_retour);\n});",
|
||||
"description": "req ajax jquery"
|
||||
},
|
||||
"ajax_reload": {
|
||||
"prefix": "ajax_reload",
|
||||
"body": "ajaxReload('${1}', {\n\targs:{\n\t\t${2}:$2,${0}\n\t},\n\tcallback: function(){}\n});",
|
||||
"description": "Reload ajax SPIP"
|
||||
},
|
||||
"url": {
|
||||
"prefix": "url",
|
||||
"body": "let url_${1} = window.location.protocol + '//' + window.location.hostname + '/spip.php?action=$1';\n${0}",
|
||||
"description": "url action auteur SPIP"
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue