maj des snippets

This commit is contained in:
Christophe 2020-01-16 16:55:37 +01:00
parent d1f17b149f
commit f1dcf1c509
4 changed files with 31 additions and 22 deletions

View file

@ -23,6 +23,10 @@ snippet bb "SPIP <B_>"
</B_$1> </B_$1>
endsnippet endsnippet
snippet icon "#ICON{}" w
#ICON{img/sprite_symbol_pictos.svg#${1},${2:icon-font}${3:,mon title}}${0}
endsnippet
snippet id_art "SPIP #ID_ARTICLE" w snippet id_art "SPIP #ID_ARTICLE" w
#ID_ARTICLE${0} #ID_ARTICLE${0}
endsnippet endsnippet

View file

@ -20,7 +20,7 @@ snippet ajax_action "req ajax jquery"
data = { data = {
}; };
var request = jQuery.ajax({ var request = $.ajax({
url: ${1}, url: ${1},
data: data, data: data,
async: true, async: true,
@ -32,7 +32,7 @@ request.done(function(){
}); });
endsnippet endsnippet
snippet ajax_reload "Reload ajax spip" snippet ajax_reload "Reload ajax SPIP"
ajaxReload('${1}', { ajaxReload('${1}', {
args:{ args:{
${2}:$2,${0} ${2}:$2,${0}
@ -40,3 +40,8 @@ ajaxReload('${1}', {
callback: function(){} callback: function(){}
}); });
endsnippet endsnippet
snippet url "url action auteur SPIP"
let url_${1} = window.location.protocol + '//' + window.location.hostname + '/spip.php?action=$1';
${0}
endsnippet

View file

@ -14,7 +14,7 @@ function action_`!v vim_snippets#Filename()`_dist(){
$securiser_action = charger_fonction('securiser_action', 'inc'); $securiser_action = charger_fonction('securiser_action', 'inc');
$arg = $securiser_action(); $arg = $securiser_action();
$$1 = $arg; $$1 = $arg;
list($${1:var1},$${2:var2}) = preg_split(',[^0-9],',$arg); list($${1:var1},$${2:var2}) = explode('-', $arg);
${0} ${0}
// Cache // Cache