]> git.mxchange.org Git - friendica.git/commitdiff
add a confirm dialog and a busy rotator for delete selected
authorZach Prezkuta <fermion@gmx.com>
Thu, 1 Nov 2012 23:42:40 +0000 (17:42 -0600)
committerZach Prezkuta <fermion@gmx.com>
Thu, 1 Nov 2012 23:42:40 +0000 (17:42 -0600)
include/conversation.php
include/items.php
view/jot-header.tpl
view/theme/frost/jot-header.tpl
view/theme/frost/js/theme.js
view/theme/frost/threaded_conversation.tpl
view/theme/quattro/threaded_conversation.tpl
view/theme/smoothly/jot-header.tpl
view/theme/testbubble/jot-header.tpl
view/theme/vier/threaded_conversation.tpl
view/threaded_conversation.tpl

index 45736051d046313113aaf85e4f331009cb19d93a..56d34f3d85ee87739b904739bed8acba58d48897 100644 (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)?')
        ));
 
 
index 9203f663cfa8ba3a5638977a21aa48228df08c66..939cefc3dd70578635ed5f378dc9217ee845662f 100755 (executable)
@@ -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
        }
index 64bcf27cab950b0a7aee1c38aa7201bbd016e417..d6f39d6c4e1621982834a75b565d3d53a0cc7658 100644 (file)
@@ -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() {
index 16fd4731705ae7cd10801aa984426cedbf1aee72..04169beb58b0d05f83a06015667a1eeac435aea6 100644 (file)
@@ -12,5 +12,6 @@
        window.baseURL = "$baseurl";
        window.geoTag = function () { $geotag }
        window.ajaxType = 'jot-header';
+       window.delItems = '$delitems';
 </script>
 
index 37d06c80cb05c8e1523ef22831011eaa00d5a28f..801b94e07f0858cb3c5b53323c1d2b304c2b3d26 100644 (file)
@@ -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();
+               });
+       }
 }
 
 
index 1e77f91c2c2340a8000731dd260416f1eb4f8478..0f7f9a986f70d417d7a5b2069fea41ef6ddca81d 100644 (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 }}
index 7eadf7e9f42c59ad59082b8f963f7304d462da7b..5c534b5856ff20be27fdee6e1ae83f37fc6bd8bb 100644 (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>
index dbff99563c4382a5728d444351dcbbe37496ce1e..b5cfcd988234799fc2d71206747c0e5c2bdacf9a 100644 (file)
@@ -194,21 +194,26 @@ function initEditor(cb) {
        });
 
        function deleteCheckedItems() {
-               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();
-               });
+               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) {
+                                               checkedstr = checkedstr + ',' + $(this).val();
+                                       }
+                                       else {
+                                               checkedstr = $(this).val();
+                                       }
+                               }       
+                       });
+                       $.post('item', { dropitems: checkedstr }, function(data) {
+                               window.location.reload();
+                       });
+               }
        }
 
        function jotGetLink() {
@@ -356,4 +361,4 @@ function initEditor(cb) {
 
        $geotag
 
-</script>
\ No newline at end of file
+</script>
index 0d11da271758c35e6df778d90fbae59f9b17ea37..79f489e786ed69955f5f357efe6636fca97de8c1 100644 (file)
@@ -195,21 +195,26 @@ function initEditor(cb) {
        });
 
        function deleteCheckedItems() {
-               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();
-               });
+               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) {
+                                               checkedstr = checkedstr + ',' + $(this).val();
+                                       }
+                                       else {
+                                               checkedstr = $(this).val();
+                                       }
+                               }       
+                       });
+                       $.post('item', { dropitems: checkedstr }, function(data) {
+                               window.location.reload();
+                       });
+               }
        }
 
        function jotGetLink() {
index 7eadf7e9f42c59ad59082b8f963f7304d462da7b..5c534b5856ff20be27fdee6e1ae83f37fc6bd8bb 100644 (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>
index 56adc8c969047eebd22a125cce812b773d18f12d..24dab9c57bdd9f9071f2926e1aa57bd37e20ebe5 100644 (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 }}