Commit 062db0ca872b9e4dd347c7d068de7a0e8eeeec69
1 parent
6b11c1c7
Exists in
master
and in
5 other branches
Static files for files app #132
Showing
2 changed files
with
66 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,63 @@ | @@ -0,0 +1,63 @@ | ||
1 | +function get_modal_file(url, id, div_content){ | ||
2 | + | ||
3 | + $.get(url, function (data) { | ||
4 | + $(div_content).empty(); | ||
5 | + $(div_content).append(data); | ||
6 | + $(id).modal('show'); | ||
7 | + }); | ||
8 | + | ||
9 | +} | ||
10 | + | ||
11 | +// $(document).ready(function (){ | ||
12 | +// // alert('Oi'); | ||
13 | +// var frm = $("#form-file"); | ||
14 | +// frm.submit(function(event) { | ||
15 | +// $.ajax({ | ||
16 | +// type: frm.attr('method'), | ||
17 | +// url: frm.attr('action'), | ||
18 | +// data: { | ||
19 | +// 'file_url': $('#id_file_url'), | ||
20 | +// 'name': $('#id_name'), | ||
21 | +// csrfmiddlewaretoken: csrf | ||
22 | +// }, | ||
23 | +// success: function (data) { | ||
24 | +// alert(data); | ||
25 | +// // $("#posts_list").append(data); | ||
26 | +// // frm[0].reset(); | ||
27 | +// }, | ||
28 | +// processData : false, | ||
29 | +// error: function(data) { | ||
30 | +// alert('Error'); | ||
31 | +// // console.log(frm.serialize()); | ||
32 | +// // console.log('Error'); | ||
33 | +// } | ||
34 | +// }); | ||
35 | +// $('#fileModal').modal('hide'); | ||
36 | +// event.preventDefault(); | ||
37 | +// }); | ||
38 | +// }); | ||
39 | + | ||
40 | +// var Submite = { | ||
41 | +// post: function(url,dados){ | ||
42 | +// $('#fileModal').modal('hide'); | ||
43 | +// $.post(url,dados, function(data){ | ||
44 | +// }).fail(function(data){ | ||
45 | +// $("div.modal-backdrop.fade.in").remove(); | ||
46 | +// $("#modal_poll").empty(); | ||
47 | +// $("#modal_poll").append(data.responseText); | ||
48 | +// }); | ||
49 | +// } | ||
50 | +// , | ||
51 | +// remove: function(url,dados, id_li_link){ | ||
52 | +// $('#fileModal').modal('hide'); | ||
53 | +// $.post(url,dados, function(data){ | ||
54 | +// $(id_li_link).remove(); | ||
55 | +// $("#modal_poll").empty(); | ||
56 | +// $("div.modal-backdrop.fade.in").remove(); | ||
57 | +// }).fail(function(){ | ||
58 | +// $("#modal_poll").empty(); | ||
59 | +// $("#modal_poll").append(data); | ||
60 | +// $('#fileModal').modal('show'); | ||
61 | +// }); | ||
62 | +// } | ||
63 | +// } | ||
0 | \ No newline at end of file | 64 | \ No newline at end of file |