]> git.wh0rd.org Git - tt-rss.git/commitdiff
add some puffing to pub and mark icons
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 11 Aug 2007 04:04:45 +0000 (05:04 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 11 Aug 2007 04:04:45 +0000 (05:04 +0100)
viewfeed.js

index 17a1b6b1542d2b29ee971b8f31a874ea9ed6bc22..e7c6303229214c8a938c50d4f3955bdad00c138d 100644 (file)
@@ -338,6 +338,39 @@ function tPub(id) {
        return togglePub(id);
 }
 
+function tMark_afh_off(effect) {
+       try {
+               var elem = effect.effects[0].element;
+
+               debug("tMark_afh_off : " + elem.id);
+
+               if (elem) {
+                       elem.src = "images/mark_unset.png";
+                       elem.alt = "Set mark";
+                       Element.show(elem);
+               }
+
+       } catch (e) {
+               exception_error("tMark_afh_off", e);
+       }
+}
+
+function tPub_afh_off(effect) {
+       try {
+               var elem = effect.effects[0].element;
+
+               debug("tPub_afh_off : " + elem.id);
+
+               if (elem) {
+                       elem.src = "images/pub_unset.png";
+                       elem.alt = "Publish";
+                       Element.show(elem);
+               }
+
+       } catch (e) {
+               exception_error("tPub_afh_off", e);
+       }
+}
 
 function toggleMark(id) {
 
@@ -370,14 +403,16 @@ function toggleMark(id) {
                }
 
        } else {
-               mark_img.src = "images/mark_unset.png";
-               mark_img.alt = "Set mark";
+               //mark_img.src = "images/mark_unset.png";
+               mark_img.alt = "Please wait...";
                query = query + "&mark=0";
 
                if (vfeedu && crow.className.match("Unread")) {
                        vfeedu.innerHTML = (+vfeedu.innerHTML) - 1;
                }
 
+               Effect.Puff(mark_img, {duration : 0.25, afterFinish: tMark_afh_off});
+
        }
 
        var vfeedctr = document.getElementById("FEEDCTR--1");
@@ -434,14 +469,16 @@ function togglePub(id) {
                        }
        
                } else {
-                       mark_img.src = "images/pub_unset.png";
-                       mark_img.alt = "Publish";
+                       //mark_img.src = "images/pub_unset.png";
+                       mark_img.alt = "Please wait...";
                        query = query + "&pub=0";
        
                        if (vfeedu && crow.className.match("Unread")) {
                                vfeedu.innerHTML = (+vfeedu.innerHTML) - 1;
                        }
        
+                       Effect.Puff(mark_img, {duration : 0.25, afterFinish: tPub_afh_off});
+
                }
        
                var vfeedctr = document.getElementById("FEEDCTR--2");
@@ -674,14 +711,20 @@ function selectionToggleMarked(cdm_mode) {
                                if (mark_img.alt == "Set mark") {
                                        mark_img.src = "images/mark_set.png";
                                        mark_img.alt = "Reset mark";
-                                       mark_img.setAttribute('onclick', 
-                                               'javascript:toggleMark('+rows[i]+', false)');
-
+                                       //mark_img.setAttribute('onclick', 
+                                       //      'javascript:toggleMark('+rows[i]+', false)');
+               
                                } else {
-                                       mark_img.src = "images/mark_unset.png";
-                                       mark_img.alt = "Set mark";
-                                       mark_img.setAttribute('onclick', 
-                                               'javascript:toggleMark('+rows[i]+', true)');
+                                       //mark_img.src = "images/mark_unset.png";
+                                       //mark_img.alt = "Set mark";
+
+                                       mark_img.alt = "Please wait...";
+
+                                       //mark_img.setAttribute('onclick', 
+                                       //      'javascript:toggleMark('+rows[i]+', true)');
+
+                                       Effect.Puff(mark_img, {duration : 0.25, afterFinish: tMark_afh_off});
+
                                }
                        }
                }
@@ -739,14 +782,17 @@ function selectionTogglePublished(cdm_mode) {
                                if (mark_img.alt == "Publish") {
                                        mark_img.src = "images/pub_set.png";
                                        mark_img.alt = "Unpublish";
-                                       mark_img.setAttribute('onclick', 
-                                               'javascript:togglePub('+rows[i]+', false)');
+//                                     mark_img.setAttribute('onclick', 
+//                                             'javascript:togglePub('+rows[i]+', false)');
 
                                } else {
-                                       mark_img.src = "images/pub_unset.png";
+                                       //mark_img.src = "images/pub_unset.png";
                                        mark_img.alt = "Publish";
-                                       mark_img.setAttribute('onclick', 
-                                               'javascript:togglePub('+rows[i]+', true)');
+//                                     mark_img.setAttribute('onclick', 
+//                                             'javascript:togglePub('+rows[i]+', true)');
+
+                                       Effect.Puff(mark_img, {duration : 0.25, afterFinish: tPub_afh_off});
+
                                }
                        }
                }