add a confirm dialog and a busy rotator for delete selected

This commit is contained in:
Zach Prezkuta 2012-11-01 17:42:40 -06:00
parent e9b26ffbb3
commit 6effdd570c
11 changed files with 91 additions and 65 deletions

View File

@ -896,7 +896,8 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
'$audurl' => t("Please enter an audio link/URL:"), '$audurl' => t("Please enter an audio link/URL:"),
'$term' => t('Tag term:'), '$term' => t('Tag term:'),
'$fileas' => t('Save to Folder:'), '$fileas' => t('Save to Folder:'),
'$whereareu' => t('Where are you right now?') '$whereareu' => t('Where are you right now?'),
'$delitems' => t('Delete item(s)?')
)); ));

View File

@ -3901,10 +3901,10 @@ function drop_item($id,$interactive = true) {
// send the notification upstream/downstream as the case may be // send the notification upstream/downstream as the case may be
proc_run('php',"include/notifier.php","drop","$drop_id");
if(! $interactive) if(! $interactive)
return $owner; return $owner;
proc_run('php',"include/notifier.php","drop","$drop_id");
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']); goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
//NOTREACHED //NOTREACHED
} }

View File

@ -158,21 +158,26 @@ function enableOnUser(){
}); });
function deleteCheckedItems() { function deleteCheckedItems() {
var checkedstr = ''; if(confirm('$delitems')) {
var checkedstr = '';
$('.item-select').each( function() { $("#item-delete-selected").hide();
if($(this).is(':checked')) { $('#item-delete-selected-rotator').show();
if(checkedstr.length != 0) {
checkedstr = checkedstr + ',' + $(this).val(); $('.item-select').each( function() {
if($(this).is(':checked')) {
if(checkedstr.length != 0) {
checkedstr = checkedstr + ',' + $(this).val();
}
else {
checkedstr = $(this).val();
}
} }
else { });
checkedstr = $(this).val(); $.post('item', { dropitems: checkedstr }, function(data) {
} window.location.reload();
} });
}); }
$.post('item', { dropitems: checkedstr }, function(data) {
window.location.reload();
});
} }
function jotGetLink() { function jotGetLink() {

View File

@ -12,5 +12,6 @@
window.baseURL = "$baseurl"; window.baseURL = "$baseurl";
window.geoTag = function () { $geotag } window.geoTag = function () { $geotag }
window.ajaxType = 'jot-header'; window.ajaxType = 'jot-header';
window.delItems = '$delitems';
</script> </script>

View File

@ -900,22 +900,26 @@ function wallInitEditor() {
$j("#prvmail-text").contact_autocomplete(baseurl+"/acl"); $j("#prvmail-text").contact_autocomplete(baseurl+"/acl");
} }
function deleteCheckedItems() { function deleteCheckedItems(delID) {
var checkedstr = ''; if(confirm(window.delItems)) {
var checkedstr = '';
$j('.item-select').each( function() { $j(delID).hide();
if($j(this).is(':checked')) { $j(delID + '-rotator').show();
if(checkedstr.length != 0) { $j('.item-select').each( function() {
checkedstr = checkedstr + ',' + $j(this).val(); if($j(this).is(':checked')) {
if(checkedstr.length != 0) {
checkedstr = checkedstr + ',' + $j(this).val();
}
else {
checkedstr = $j(this).val();
}
} }
else { });
checkedstr = $j(this).val(); $j.post('item', { dropitems: checkedstr }, function(data) {
} window.location.reload();
} });
}); }
$j.post('item', { dropitems: checkedstr }, function(data) {
window.location.reload();
});
} }

View File

@ -1,8 +1,9 @@
{{ if $dropping }} {{ if $dropping }}
<div id="item-delete-selected-top" class="fakelink" onclick="deleteCheckedItems();"> <div id="item-delete-selected-top" class="fakelink" onclick="deleteCheckedItems('#item-delete-selected-top');">
<div id="item-delete-selected-top-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div> <div id="item-delete-selected-top-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div>
<div id="item-delete-selected-top-desc" >$dropping</div> <div id="item-delete-selected-top-desc" >$dropping</div>
</div> </div>
<img id="item-delete-selected-top-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
{{ endif }} {{ endif }}
$live_update $live_update
@ -14,9 +15,10 @@ $live_update
<div id="conversation-end"></div> <div id="conversation-end"></div>
{{ if $dropping }} {{ if $dropping }}
<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();"> <div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems('#item-delete-selected');">
<div id="item-delete-selected-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div> <div id="item-delete-selected-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div>
<div id="item-delete-selected-desc" >$dropping</div> <div id="item-delete-selected-desc" >$dropping</div>
</div> </div>
<img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
<div id="item-delete-selected-end"></div> <div id="item-delete-selected-end"></div>
{{ endif }} {{ endif }}

View File

@ -17,9 +17,10 @@ $live_update
<div id="conversation-end"></div> <div id="conversation-end"></div>
{{ if $dropping }} {{ if $dropping }}
<a href="#" onclick="deleteCheckedItems();return false;"> <a id="item-delete-selected" href="#" onclick="deleteCheckedItems();return false;">
<span class="icon s22 delete text">$dropping</span> <span class="icon s22 delete text">$dropping</span>
</a> </a>
<img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
{{ endif }} {{ endif }}
<script> <script>

View File

@ -194,21 +194,26 @@ function initEditor(cb) {
}); });
function deleteCheckedItems() { function deleteCheckedItems() {
var checkedstr = ''; if(confirm('$delitems')) {
var checkedstr = '';
$('.item-select').each( function() { $("#item-delete-selected").hide();
if($(this).is(':checked')) { $('#item-delete-selected-rotator').show();
if(checkedstr.length != 0) {
checkedstr = checkedstr + ',' + $(this).val(); $('.item-select').each( function() {
if($(this).is(':checked')) {
if(checkedstr.length != 0) {
checkedstr = checkedstr + ',' + $(this).val();
}
else {
checkedstr = $(this).val();
}
} }
else { });
checkedstr = $(this).val(); $.post('item', { dropitems: checkedstr }, function(data) {
} window.location.reload();
} });
}); }
$.post('item', { dropitems: checkedstr }, function(data) {
window.location.reload();
});
} }
function jotGetLink() { function jotGetLink() {

View File

@ -195,21 +195,26 @@ function initEditor(cb) {
}); });
function deleteCheckedItems() { function deleteCheckedItems() {
var checkedstr = ''; if(confirm('$delitems')) {
var checkedstr = '';
$('.item-select').each( function() { $("#item-delete-selected").hide();
if($(this).is(':checked')) { $('#item-delete-selected-rotator').show();
if(checkedstr.length != 0) {
checkedstr = checkedstr + ',' + $(this).val(); $('.item-select').each( function() {
if($(this).is(':checked')) {
if(checkedstr.length != 0) {
checkedstr = checkedstr + ',' + $(this).val();
}
else {
checkedstr = $(this).val();
}
} }
else { });
checkedstr = $(this).val(); $.post('item', { dropitems: checkedstr }, function(data) {
} window.location.reload();
} });
}); }
$.post('item', { dropitems: checkedstr }, function(data) {
window.location.reload();
});
} }
function jotGetLink() { function jotGetLink() {

View File

@ -17,9 +17,10 @@ $live_update
<div id="conversation-end"></div> <div id="conversation-end"></div>
{{ if $dropping }} {{ if $dropping }}
<a href="#" onclick="deleteCheckedItems();return false;"> <a id="item-delete-selected" href="#" onclick="deleteCheckedItems();return false;">
<span class="icon s22 delete text">$dropping</span> <span class="icon s22 delete text">$dropping</span>
</a> </a>
<img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
{{ endif }} {{ endif }}
<script> <script>

View File

@ -11,5 +11,6 @@ $live_update
<div id="item-delete-selected-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div> <div id="item-delete-selected-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div>
<div id="item-delete-selected-desc" >$dropping</div> <div id="item-delete-selected-desc" >$dropping</div>
</div> </div>
<img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
<div id="item-delete-selected-end"></div> <div id="item-delete-selected-end"></div>
{{ endif }} {{ endif }}