-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfirm.sublime-snippet
42 lines (42 loc) · 1.05 KB
/
Confirm.sublime-snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<snippet>
<content><![CDATA[
$.confirm({
theme : 'material',
type: '${1:red}',
title: '${2}',
content : '${3}',
buttons: {
confirm: function() {
$.ajax({
type: '{$4}',
url: '${5}',
success: function(data) {
if(data.success)
{
var n = noty({
text: data.message,
theme: 'relax',
type: 'success',
timeout : 5000,
});
${6}
}
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status);
console.log(xhr.responseText);
console.log(thrownError);
}
});
},
cancel: function() {
${7:return;}
}
}
});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>.confirm</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>