@ -1,6 +1,8 @@
|
||||
Version 2.1 ()
|
||||
------------------------------------------------------------------------
|
||||
|
||||
* Fixed media item delete handler (#371)
|
||||
|
||||
* Rewrote Routing code for index.php to be outsourced into
|
||||
include/functions_routing
|
||||
|
||||
|
@ -76,7 +76,6 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
$messages[] = serendipity_deleteImage($serendipity['GET']['fid']);
|
||||
$messages[] = sprintf('<span class="msg_notice"><span class="icon-info-circled"></span> ' . RIP_ENTRY . "</span>\n", $serendipity['GET']['fid']);
|
||||
|
||||
$data['showML'] = showMediaLibrary();
|
||||
$data['messages'] = $messages;
|
||||
unset($messages);
|
||||
break;
|
||||
|
@ -564,8 +564,55 @@
|
||||
serendipity.deleteFromML = function(id, fname) {
|
||||
if (confirm('{$CONST.DELETE}')) {
|
||||
var media_token_url = $('input[name*="serendipity[token]"]').val();
|
||||
$.post('?serendipity[adminModule]=images&serendipity[adminAction]=doDelete&serendipity[fid]='+ escape(id) +'&serendipity[token]='+ media_token_url);
|
||||
window.location.reload(false);
|
||||
$.post('?serendipity[adminModule]=images&serendipity[adminAction]=doDelete&serendipity[fid]='+ escape(id) +'&serendipity[token]='+ media_token_url)
|
||||
.done(function(jqXHR, textStatus) {
|
||||
if (textStatus == 'success') {
|
||||
$.magnificPopup.open({
|
||||
items: {
|
||||
type: 'inline',
|
||||
src: $('<div id="delete_msg">\
|
||||
<h4>{$CONST.MEDIA_DELETE}</h4>\
|
||||
'+ jqXHR + '\
|
||||
<button id="delete_ok" class="button_link state_submit" type="button" >{$CONST.GO}</button>\
|
||||
</div>')
|
||||
},
|
||||
type: 'inline',
|
||||
midClick: true,
|
||||
callbacks: {
|
||||
open: function() {
|
||||
this.content.on('click', '#delete_ok', function() {
|
||||
window.parent.parent.location.href= '?serendipity[adminModule]=images&serendipity[adminAction]=default';
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
.fail(function(jqXHR, textStatus, errorThrown) {
|
||||
if (textStatus != null) { // what could that be ? "timeout", "error", "abort", "parsererror" ?
|
||||
$.magnificPopup.open({
|
||||
items: {
|
||||
type: 'inline',
|
||||
src: $('<div id="delete_msg">\
|
||||
<h4>{$CONST.MEDIA_DELETE}</h4>\
|
||||
'+ jqXHR + '\
|
||||
<p>"Status: " + textStatus</p>\
|
||||
'+ errorThrown +'\
|
||||
<button id="delete_error" class="button_link state_submit" type="button" >{$CONST.GO}</button>\
|
||||
</div>')
|
||||
},
|
||||
type: 'inline',
|
||||
midClick: true,
|
||||
callbacks: {
|
||||
open: function() {
|
||||
this.content.on('click', '#delete_error', function() {
|
||||
window.parent.parent.location.href= '?serendipity[adminModule]=images&serendipity[adminAction]=default';
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1864,6 +1864,7 @@ form > .button_link:first-of-type,
|
||||
padding-bottom: .583335em;
|
||||
}
|
||||
|
||||
.mfp-content #delete_msg,
|
||||
.mfp-content #rename_msg {
|
||||
width: 40em;
|
||||
background-color: #FFF;
|
||||
@ -1872,11 +1873,13 @@ form > .button_link:first-of-type,
|
||||
border: 2px double #00FFDB;
|
||||
padding: 0.5em;
|
||||
}
|
||||
.mfp-content #delete_ok,
|
||||
.mfp-content #rename_ok {
|
||||
margin-bottom: 1em;
|
||||
color: #FFF;
|
||||
text-shadow: inherit;
|
||||
}
|
||||
.mfp-content #delete_msg button.mfp-close,
|
||||
.mfp-content #rename_msg button.mfp-close {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
|
Reference in New Issue
Block a user