From: Zach Prezkuta Date: Thu, 1 Nov 2012 23:42:40 +0000 (-0600) Subject: add a confirm dialog and a busy rotator for delete selected X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6effdd570c4905d3921859c0780a093e544defcb;p=friendica.git add a confirm dialog and a busy rotator for delete selected --- diff --git a/include/conversation.php b/include/conversation.php index 45736051d0..56d34f3d85 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -896,7 +896,8 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { '$audurl' => t("Please enter an audio link/URL:"), '$term' => t('Tag term:'), '$fileas' => t('Save to Folder:'), - '$whereareu' => t('Where are you right now?') + '$whereareu' => t('Where are you right now?'), + '$delitems' => t('Delete item(s)?') )); diff --git a/include/items.php b/include/items.php index 9203f663cf..939cefc3dd 100755 --- a/include/items.php +++ b/include/items.php @@ -3901,10 +3901,10 @@ function drop_item($id,$interactive = true) { // send the notification upstream/downstream as the case may be + proc_run('php',"include/notifier.php","drop","$drop_id"); + if(! $interactive) return $owner; - - proc_run('php',"include/notifier.php","drop","$drop_id"); goaway($a->get_baseurl() . '/' . $_SESSION['return_url']); //NOTREACHED } diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 64bcf27cab..d6f39d6c4e 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -158,21 +158,26 @@ function enableOnUser(){ }); function deleteCheckedItems() { - var checkedstr = ''; + if(confirm('$delitems')) { + var checkedstr = ''; - $('.item-select').each( function() { - if($(this).is(':checked')) { - if(checkedstr.length != 0) { - checkedstr = checkedstr + ',' + $(this).val(); - } - else { - checkedstr = $(this).val(); - } - } - }); - $.post('item', { dropitems: checkedstr }, function(data) { - window.location.reload(); - }); + $("#item-delete-selected").hide(); + $('#item-delete-selected-rotator').show(); + + $('.item-select').each( function() { + if($(this).is(':checked')) { + if(checkedstr.length != 0) { + checkedstr = checkedstr + ',' + $(this).val(); + } + else { + checkedstr = $(this).val(); + } + } + }); + $.post('item', { dropitems: checkedstr }, function(data) { + window.location.reload(); + }); + } } function jotGetLink() { diff --git a/view/theme/frost/jot-header.tpl b/view/theme/frost/jot-header.tpl index 16fd473170..04169beb58 100644 --- a/view/theme/frost/jot-header.tpl +++ b/view/theme/frost/jot-header.tpl @@ -12,5 +12,6 @@ window.baseURL = "$baseurl"; window.geoTag = function () { $geotag } window.ajaxType = 'jot-header'; + window.delItems = '$delitems'; diff --git a/view/theme/frost/js/theme.js b/view/theme/frost/js/theme.js index 37d06c80cb..801b94e07f 100644 --- a/view/theme/frost/js/theme.js +++ b/view/theme/frost/js/theme.js @@ -900,22 +900,26 @@ function wallInitEditor() { $j("#prvmail-text").contact_autocomplete(baseurl+"/acl"); } -function deleteCheckedItems() { - var checkedstr = ''; - - $j('.item-select').each( function() { - if($j(this).is(':checked')) { - if(checkedstr.length != 0) { - checkedstr = checkedstr + ',' + $j(this).val(); - } - else { - checkedstr = $j(this).val(); - } - } - }); - $j.post('item', { dropitems: checkedstr }, function(data) { - window.location.reload(); - }); +function deleteCheckedItems(delID) { + if(confirm(window.delItems)) { + var checkedstr = ''; + + $j(delID).hide(); + $j(delID + '-rotator').show(); + $j('.item-select').each( function() { + if($j(this).is(':checked')) { + if(checkedstr.length != 0) { + checkedstr = checkedstr + ',' + $j(this).val(); + } + else { + checkedstr = $j(this).val(); + } + } + }); + $j.post('item', { dropitems: checkedstr }, function(data) { + window.location.reload(); + }); + } } diff --git a/view/theme/frost/threaded_conversation.tpl b/view/theme/frost/threaded_conversation.tpl index 1e77f91c2c..0f7f9a986f 100644 --- a/view/theme/frost/threaded_conversation.tpl +++ b/view/theme/frost/threaded_conversation.tpl @@ -1,8 +1,9 @@ {{ if $dropping }} -