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:"),
'$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)?')
));

View File

@ -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
}

View File

@ -158,8 +158,12 @@ function enableOnUser(){
});
function deleteCheckedItems() {
if(confirm('$delitems')) {
var checkedstr = '';
$("#item-delete-selected").hide();
$('#item-delete-selected-rotator').show();
$('.item-select').each( function() {
if($(this).is(':checked')) {
if(checkedstr.length != 0) {
@ -174,6 +178,7 @@ function enableOnUser(){
window.location.reload();
});
}
}
function jotGetLink() {
reply = prompt("$linkurl");

View File

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

View File

@ -900,9 +900,12 @@ function wallInitEditor() {
$j("#prvmail-text").contact_autocomplete(baseurl+"/acl");
}
function deleteCheckedItems() {
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) {
@ -916,6 +919,7 @@ function deleteCheckedItems() {
$j.post('item', { dropitems: checkedstr }, function(data) {
window.location.reload();
});
}
}

View File

@ -1,8 +1,9 @@
{{ 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-desc" >$dropping</div>
</div>
<img id="item-delete-selected-top-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
{{ endif }}
$live_update
@ -14,9 +15,10 @@ $live_update
<div id="conversation-end"></div>
{{ 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-desc" >$dropping</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>
{{ endif }}

View File

@ -17,9 +17,10 @@ $live_update
<div id="conversation-end"></div>
{{ 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>
</a>
<img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
{{ endif }}
<script>

View File

@ -194,8 +194,12 @@ function initEditor(cb) {
});
function deleteCheckedItems() {
if(confirm('$delitems')) {
var checkedstr = '';
$("#item-delete-selected").hide();
$('#item-delete-selected-rotator').show();
$('.item-select').each( function() {
if($(this).is(':checked')) {
if(checkedstr.length != 0) {
@ -210,6 +214,7 @@ function initEditor(cb) {
window.location.reload();
});
}
}
function jotGetLink() {
reply = prompt("$linkurl");

View File

@ -195,8 +195,12 @@ function initEditor(cb) {
});
function deleteCheckedItems() {
if(confirm('$delitems')) {
var checkedstr = '';
$("#item-delete-selected").hide();
$('#item-delete-selected-rotator').show();
$('.item-select').each( function() {
if($(this).is(':checked')) {
if(checkedstr.length != 0) {
@ -211,6 +215,7 @@ function initEditor(cb) {
window.location.reload();
});
}
}
function jotGetLink() {
reply = prompt("$linkurl");

View File

@ -17,9 +17,10 @@ $live_update
<div id="conversation-end"></div>
{{ 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>
</a>
<img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
{{ endif }}
<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-desc" >$dropping</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>
{{ endif }}