You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2009/12/11 00:29:05 UTC

svn commit: r889467 - /tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/blackbird_1_0/blackbird.js

Author: hlship
Date: Thu Dec 10 23:29:05 2009
New Revision: 889467

URL: http://svn.apache.org/viewvc?rev=889467&view=rev
Log:
TAP5-908: Blackbird console should not add cookies to requests

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/blackbird_1_0/blackbird.js

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/blackbird_1_0/blackbird.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/blackbird_1_0/blackbird.js?rev=889467&r1=889466&r2=889467&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/blackbird_1_0/blackbird.js (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/blackbird_1_0/blackbird.js Thu Dec 10 23:29:05 2009
@@ -17,7 +17,7 @@
     var outputList;
     var cache = [];
 
-    var state = getState();
+    var state = { pos:null, size:null, load:null };
     var classes = {};
     var profiler = {};
 
@@ -83,12 +83,6 @@
 
         left.insert();
 
-        var label = new Element("label")
-        label.insert(checkbox = new Element("input", { 'type': 'checkbox' }));
-        label.insert("Visible on page load");
-
-        left.insert(label);
-
         footer.insert(new Element("div", { 'class': 't-right' }));
 
         bbird.insert(footer);
@@ -215,14 +209,6 @@
         outputList.className = disabledTypes.join('Hidden ');
     }
 
-    function clickVis(evt)
-    {
-        var el = evt.element();
-
-        state.load = el.checked;
-        saveState();
-    }
-
 
     function scrollToBottom()
     { //scroll list output to the bottom
@@ -288,11 +274,6 @@
 
     function saveState()
     {
-        var expiration = new Date();
-        expiration.setDate(expiration.getDate() + 14);
-        document.cookie =
-        [ 'blackbird=', Object.toJSON(state), '; expires=', expiration.toUTCString() ,';' ].join('');
-
         var newClass = [];
         for (word in classes)
         {
@@ -301,13 +282,6 @@
         bbird.className = newClass.join(' ');
     }
 
-    function getState()
-    {
-        var re = new RegExp(/blackbird=({[^;]+})(;|\b|$)/);
-        var match = re.exec(document.cookie);
-        return ( match && match[ 1 ] ) ? eval('(' + match[ 1 ] + ')') : { pos:null, size:null, load:null };
-    }
-
     //event handler for 'keyup' event for window
     function readKey(evt)
     {
@@ -409,21 +383,13 @@
 
                 backgroundImage();
 
-                checkbox.observe("click", clickVis.bindAsEventListener());
-
                 filters.observe("click", clickFilter.bindAsEventListener());
                 controls.observe("click", clickControl.bindAsEventListener());
 
                 document.observe("keyup", readKey.bindAsEventListener());
 
                 resize(state.size);
-                reposition(state.pos);
-
-                if (state.load)
-                {
-                    show();
-                    $(checkbox).checked = true;
-                }
+                reposition(state.pos);              
 
                 scrollToBottom();