From 6effdd570c4905d3921859c0780a093e544defcb Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Thu, 1 Nov 2012 17:42:40 -0600 Subject: [PATCH] add a confirm dialog and a busy rotator for delete selected --- include/conversation.php | 3 +- include/items.php | 4 +-- view/jot-header.tpl | 33 ++++++++++-------- view/theme/frost/jot-header.tpl | 1 + view/theme/frost/js/theme.js | 34 ++++++++++--------- view/theme/frost/threaded_conversation.tpl | 6 ++-- view/theme/quattro/threaded_conversation.tpl | 3 +- view/theme/smoothly/jot-header.tpl | 35 +++++++++++--------- view/theme/testbubble/jot-header.tpl | 33 ++++++++++-------- view/theme/vier/threaded_conversation.tpl | 3 +- view/threaded_conversation.tpl | 1 + 11 files changed, 91 insertions(+), 65 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 45736051d..56d34f3d8 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 9203f663c..939cefc3d 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 64bcf27ca..d6f39d6c4 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 16fd47317..04169beb5 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 37d06c80c..801b94e07 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 = ''; +function deleteCheckedItems(delID) { + if(confirm(window.delItems)) { + 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(); - }); + $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 1e77f91c2..0f7f9a986 100644 --- a/view/theme/frost/threaded_conversation.tpl +++ b/view/theme/frost/threaded_conversation.tpl @@ -1,8 +1,9 @@ {{ if $dropping }} -