mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +00:00
add click function for button.removedocument, pass formtoken to ajax calls
This commit is contained in:
parent
0b63fe6960
commit
0e27982c08
|
@ -117,6 +117,41 @@ $(document).ready( function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('body').on('click', 'button.removedocument', function(ev){
|
||||||
|
ev.preventDefault();
|
||||||
|
attr_rel = $(ev.currentTarget).attr('rel');
|
||||||
|
attr_msg = $(ev.currentTarget).attr('msg');
|
||||||
|
attr_formtoken = $(ev.currentTarget).attr('formtoken');
|
||||||
|
id = attr_rel;
|
||||||
|
$.get('../op/op.Ajax.php',
|
||||||
|
{ command: 'deletedocument', id: id, formtoken: attr_formtoken },
|
||||||
|
function(data) {
|
||||||
|
// console.log(data);
|
||||||
|
if(data.success) {
|
||||||
|
$('#table-row-document-'+id).hide('slow');
|
||||||
|
noty({
|
||||||
|
text: attr_msg,
|
||||||
|
type: 'success',
|
||||||
|
dismissQueue: true,
|
||||||
|
layout: 'topRight',
|
||||||
|
theme: 'defaultTheme',
|
||||||
|
timeout: 1500,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
noty({
|
||||||
|
text: data.message,
|
||||||
|
type: 'error',
|
||||||
|
dismissQueue: true,
|
||||||
|
layout: 'topRight',
|
||||||
|
theme: 'defaultTheme',
|
||||||
|
timeout: 3500,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'json'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
$('a.addtoclipboard').click(function(ev){
|
$('a.addtoclipboard').click(function(ev){
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
attr_rel = $(ev.currentTarget).attr('rel');
|
attr_rel = $(ev.currentTarget).attr('rel');
|
||||||
|
@ -126,18 +161,21 @@ $(document).ready( function() {
|
||||||
$.get('../op/op.Ajax.php',
|
$.get('../op/op.Ajax.php',
|
||||||
{ command: 'addtoclipboard', type: type, id: id },
|
{ command: 'addtoclipboard', type: type, id: id },
|
||||||
function(data) {
|
function(data) {
|
||||||
console.log(data);
|
if(data.success) {
|
||||||
$('#menu-clipboard ul').remove();
|
console.log(data);
|
||||||
$(data).appendTo('#menu-clipboard');
|
$('#menu-clipboard ul').remove();
|
||||||
noty({
|
$(data).appendTo('#menu-clipboard');
|
||||||
text: attr_msg,
|
noty({
|
||||||
type: 'success',
|
text: attr_msg,
|
||||||
dismissQueue: true,
|
type: 'success',
|
||||||
layout: 'topRight',
|
dismissQueue: true,
|
||||||
theme: 'defaultTheme',
|
layout: 'topRight',
|
||||||
timeout: 1500,
|
theme: 'defaultTheme',
|
||||||
});
|
timeout: 1500,
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'json'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -146,19 +184,23 @@ $(document).ready( function() {
|
||||||
attr_source = $(ev.currentTarget).attr('source');
|
attr_source = $(ev.currentTarget).attr('source');
|
||||||
attr_dest = $(ev.currentTarget).attr('dest');
|
attr_dest = $(ev.currentTarget).attr('dest');
|
||||||
attr_msg = $(ev.currentTarget).attr('msg');
|
attr_msg = $(ev.currentTarget).attr('msg');
|
||||||
|
attr_formtoken = $(ev.currentTarget).attr('formtoken');
|
||||||
$.get('../op/op.Ajax.php',
|
$.get('../op/op.Ajax.php',
|
||||||
{ command: 'movefolder', folderid: attr_source, targetfolderid: attr_dest },
|
{ command: 'movefolder', folderid: attr_source, targetfolderid: attr_dest, formtoken: attr_formtoken },
|
||||||
function(data) {
|
function(data) {
|
||||||
console.log(data);
|
if(data.success) {
|
||||||
noty({
|
console.log(data);
|
||||||
text: data.msg,
|
noty({
|
||||||
type: data.success ? 'success' : 'error',
|
text: data.msg,
|
||||||
dismissQueue: true,
|
type: data.success ? 'success' : 'error',
|
||||||
layout: 'topRight',
|
dismissQueue: true,
|
||||||
theme: 'defaultTheme',
|
layout: 'topRight',
|
||||||
timeout: 1500,
|
theme: 'defaultTheme',
|
||||||
});
|
timeout: 1500,
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'json'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -167,19 +209,23 @@ $(document).ready( function() {
|
||||||
attr_source = $(ev.currentTarget).attr('source');
|
attr_source = $(ev.currentTarget).attr('source');
|
||||||
attr_dest = $(ev.currentTarget).attr('dest');
|
attr_dest = $(ev.currentTarget).attr('dest');
|
||||||
attr_msg = $(ev.currentTarget).attr('msg');
|
attr_msg = $(ev.currentTarget).attr('msg');
|
||||||
|
attr_formtoken = $(ev.currentTarget).attr('formtoken');
|
||||||
$.get('../op/op.Ajax.php',
|
$.get('../op/op.Ajax.php',
|
||||||
{ command: 'movedocument', docid: attr_source, targetfolderid: attr_dest },
|
{ command: 'movedocument', docid: attr_source, targetfolderid: attr_dest, formtoken: attr_formtoken },
|
||||||
function(data) {
|
function(data) {
|
||||||
console.log(data);
|
if(data.success) {
|
||||||
noty({
|
console.log(data);
|
||||||
text: data.msg,
|
noty({
|
||||||
type: data.success ? 'success' : 'error',
|
text: data.msg,
|
||||||
dismissQueue: true,
|
type: data.success ? 'success' : 'error',
|
||||||
layout: 'topRight',
|
dismissQueue: true,
|
||||||
theme: 'defaultTheme',
|
layout: 'topRight',
|
||||||
timeout: 1500,
|
theme: 'defaultTheme',
|
||||||
});
|
timeout: 1500,
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'json'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user