Merge branch 'master' of github.com:shish/shimmie2
This commit is contained in:
commit
d21b9e58ab
@ -142,7 +142,6 @@ class ImageIO extends Extension {
|
||||
if(function_exists("exif_read_data")) {
|
||||
$config->set_default_bool('image_show_meta', false);
|
||||
}
|
||||
$config->set_default_bool('image_jquery_confirm', true);
|
||||
$config->set_default_string('image_ilink', '');
|
||||
$config->set_default_string('image_tlink', '');
|
||||
$config->set_default_string('image_tip', '$tags // $size // $filesize');
|
||||
@ -170,10 +169,15 @@ class ImageIO extends Extension {
|
||||
if($image) {
|
||||
send_event(new ImageDeletionEvent($image));
|
||||
$page->set_mode("redirect");
|
||||
if(isset($_SERVER['HTTP_REFERER']) && !strstr($_SERVER['HTTP_REFERER'], 'post/view')) {
|
||||
$page->set_redirect($_SERVER['HTTP_REFERER']);
|
||||
}
|
||||
else {
|
||||
$page->set_redirect(make_link("post/list"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($event->page_matches("image_admin/replace")) {
|
||||
global $page, $user;
|
||||
if($user->can("replace_image") && isset($_POST['image_id']) && $user->check_auth_token()) {
|
||||
@ -244,10 +248,9 @@ class ImageIO extends Extension {
|
||||
//$sb->add_text_option("image_tlink", "<br>Thumbnail link: ");
|
||||
$sb->add_text_option("image_tip", "Image tooltip: ");
|
||||
$sb->add_choice_option("upload_collision_handler", array('Error'=>'error', 'Merge'=>'merge'), "<br>Upload collision handler: ");
|
||||
if(!in_array("OS", $_SERVER) || $_SERVER["OS"] != 'Windows_NT') {
|
||||
if(function_exists("exif_read_data")) {
|
||||
$sb->add_bool_option("image_show_meta", "<br>Show metadata: ");
|
||||
}
|
||||
$sb->add_bool_option("image_jquery_confirm", "<br>Confirm Delete with jQuery: ");
|
||||
|
||||
$expires = array();
|
||||
$expires['1 Minute'] = 60;
|
||||
|
@ -9,21 +9,12 @@ class ImageIOTheme {
|
||||
public function get_deleter_html(/*int*/ $image_id) {
|
||||
global $config;
|
||||
|
||||
if($config->get_bool("image_jquery_confirm")) {
|
||||
$html = "
|
||||
".make_form(make_link("image_admin/delete"),'POST',false,'delete_image')."
|
||||
<input type='hidden' name='image_id' value='$image_id' />
|
||||
<input type='submit' value='Delete' id='delete_image_submit' />
|
||||
</form>
|
||||
";
|
||||
} else {
|
||||
$html = "
|
||||
".make_form(make_link("image_admin/delete"))."
|
||||
<input type='hidden' name='image_id' value='$image_id' />
|
||||
<input type='submit' value='Delete' onclick='return confirm(\"Delete the image?\");' />
|
||||
</form>
|
||||
";
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
@ -1,31 +1,6 @@
|
||||
|
||||
// Adding jQuery ui stuff
|
||||
$(document).ready(function() {
|
||||
|
||||
var $confirm = $('<div id="dialog-confirm"></div>')
|
||||
.html('<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>This image will be permanently deleted and cannot be recovered. Are you sure?</p>')
|
||||
.dialog({
|
||||
resizable: false,
|
||||
height:220,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
title: 'Delete Image?',
|
||||
buttons: {
|
||||
"Delete Image": function() {
|
||||
$( this ).dialog( "close" );
|
||||
$('form#delete_image').submit();
|
||||
},
|
||||
Cancel: function() {
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('form#delete_image #delete_image_submit').click(function(e){
|
||||
e.preventDefault();
|
||||
$confirm.dialog('open');
|
||||
});
|
||||
|
||||
$("time").timeago();
|
||||
|
||||
$('.autocomplete_tags').autocomplete(base_href + '/api/internal/tag_list/complete', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user