Remove dead code.
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Thu, 1 Nov 2007 22:10:42 +0000 (22:10 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:56 +0000 (00:35 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@299 9869982d-c50d-0410-be91-f2a2ec7c7c7b

Makefile
banana/banana.inc.php.in
banana/spool.inc.php
javascript/spool_toggle.js [deleted file]

index 233a303..ac99fff 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,6 @@ dist: clean pkg-dist
 
 clean:
        rm -rf locale banana/banana.inc.php
-       rm javascript/jquery.js
        make -C po clean
        make -C mbox-helper clean
 
@@ -34,16 +33,13 @@ clean:
        -rm $@
        sed -e 's,@VERSION@,$(VERSION) The Bearded Release,g' $< > $@
 
-javascript/jquery.js: 
-       wget "http://jquery.com/src/jquery-latest.pack.js" -O $@
-
 spool spool/templates_c:
        mkdir -p $@
        chmod o+w $@
 
 # banana package targets
 
-pkg-build: banana/banana.inc.php javascript/jquery.js
+pkg-build: banana/banana.inc.php
        make -C po
        make -C po clean
        make -C mbox-helper
index 1ebd1ea..26cb3a5 100644 (file)
@@ -574,16 +574,12 @@ class Banana
         }
         if (isset($_POST['cancel'])) {
             $this->loadSpool($group);
-            $ndx = Banana::$spool->getNdX($id) - 1;
             if (!Banana::$protocole->cancel($msg)) {
                 return _b_('Une erreur s\'est produite lors de l\'annulation du message :') . '<br />'
                        . Banana::$protocole->lastError();
             }
-            if ($ndx < 50) {
-                 $ndx = 0;
-            }
             $this->removeMessage($group, $artid);
-            Banana::$page->redirect(Array('group' => $group, 'first' => $ndx));
+            Banana::$page->redirect(Array('group' => $group));
         }
 
         Banana::$page->assign_by_ref('message', $msg);
index 04c6f7c..015dd5d 100644 (file)
@@ -527,37 +527,6 @@ class BananaSpool
         return Banana::$first ? Banana::$spool_tmax : Banana::$spool_tcontext;
     }
 
-
-    /** computes linear post index
-     * @param $_id INTEGER MSGNUM of post
-     * @return INTEGER linear index of post
-     */
-    public function getNdX($_id)
-    {
-        $ndx    = 1;
-        $id_cur = $_id;
-        while (true) {
-            $id_parent = $this->overview[$id_cur]->parent;
-            if (is_null($id_parent)) break;
-            $pos = array_search($id_cur, $this->overview[$id_parent]->children);
-
-            for ($i = 0; $i < $pos ; $i++) {
-                $ndx += $this->overview[$this->overview[$id_parent]->children[$i]]->desc;
-            }
-            $ndx++; //noeud père
-
-            $id_cur = $id_parent;
-        }
-
-        foreach ($this->roots as $i) {
-            if ($i==$id_cur) {
-                break;
-            }
-            $ndx += $this->overview[$i]->desc;
-        }
-        return $ndx;
-    }
-
     /** Return root message of the given thread
      * @param id INTEGER id of a message
      */
diff --git a/javascript/spool_toggle.js b/javascript/spool_toggle.js
deleted file mode 100644 (file)
index 264773d..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/********************************************************************************
-* javascript/spool_toggle : script for folding/unfolding threads in spool
-* ------------------------
-*
-* This file is part of the banana distribution
-* Copyright: See COPYING files that comes with this distribution
-********************************************************************************/
-
-/** prevent IE from launching two opposite toggle actions at the same time
- * Usual parameters are:
- *  - 0 : no action is running
- *  - 1 : folding
- *  - 2 : unfolding  
- */
-var banana_toggle = 0;
-
-/** Release banana_toggle a little time after action is done
- *  called with : setTimeout(banana_release_toggle, 10);
- */
-function banna_release_toggle() {
-  banana_toggle = 0;
-}
-
-/** Unfold a thread by showing all its sons
- * called on the img element of the thread
- */ 
-function banana_unfold_thread() {
-  // don't unfold if already folding somewhere
-  if (banana_toggle == 1) {
-    return;
-  }
-  banana_toggle = 2;
-  var myid = $(this).parent().parent().parent().attr("id").replace(/[0-9]+_/,"");
-  // show all sons
-  $("tr[@id^="+myid+"_]").each(banana_subunfold_thread);
-  // change tree icon and prepare for folding
-  $(this).
-    attr("src",this.src.replace(/k3/,"k2")).
-    attr("alt","*").
-    unbind("click",banana_unfold_thread).
-    click(banana_fold_thread);
-  setTimeout(banna_release_toggle, 10);
-}
-
-/** Fold a thread by hiding all its sons
- * called on the img element of the thread
- */ 
-function banana_fold_thread() {
-  // don't fold if already unfolding somewhere
-  if (banana_toggle == 2) {
-    return;
-  }
-  banana_toggle = 1;
-  var myid = $(this).parent().parent().parent().attr("id").replace(/[0-9]+_/,"");
-  // hide all sons
-  $("tr[@id^="+myid+"_]").each(banana_subfold_thread);
-  // change tree icon and prepare for unfolding
-  $(this).
-    attr("src",this.src.replace(/k2/,"k3")).
-    attr("alt","+").
-    unbind("click",banana_fold_thread).
-    click(banana_unfold_thread);
-  setTimeout(banna_release_toggle, 10);
-}
-
-/** Show a son of a thread when unfolding
- * called on the tr element of the son
- */ 
-function banana_subunfold_thread() {
-  // show the element before working on sons
-  // otherwise they could be hidden and not managed
-  $(this).show();
-  // if this son has subsons and is unfold
-  if ($("img[@alt='*']", this).size()) {
-    // show subsons
-    var myid = $(this).attr("id").replace(/[0-9]+_/,"");
-    $("tr[@id^="+myid+"_]").each(banana_subunfold_thread);
-  }
-}
-
-/** Hide a son of a thread when folding
- * called on the tr element of the son
- */ 
-function banana_subfold_thread() {
-  // if this son has subsons and is unfold
-  if ($("img[@alt='*']", this).size()) {
-    // hide subsons
-    var myid = $(this).attr("id").replace(/[0-9]+_/,"");
-    $("tr[@id^="+myid+"_]").each(banana_subfold_thread);
-  }
-  // hide element only after working on sons
-  // otherwise they could be hidden and not managed  
-  $(this).hide();
-}
-
-/** Fold all threads in page
- */
-function banana_fold_all() {
-  $("tr img[alt='*'][@src*=k2]").each(banana_fold_thread);
-}
-
-/** Unfold all threads in page
- */
-function banana_unfold_all() {
-  $("tr img[alt='+'][@src*=k3]").each(banana_unfold_thread);
-}
-
-// prepare for folding
-$(document).ready( function() {
- $("tr img[@alt='*'][@src*='k2']").
-  css("cursor","pointer").
-  click(banana_fold_thread);
-});