You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by pulse00 <gi...@git.apache.org> on 2015/05/26 20:12:15 UTC

[GitHub] wicket pull request: Added DebugBar improvements

GitHub user pulse00 opened a pull request:

    https://github.com/apache/wicket/pull/120

    Added DebugBar improvements

    - Add `positionBottom` method to position it at the bottom of the screen
    - Remember expanded/collapsed state

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pulse00/wicket feature/debugbar

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/wicket/pull/120.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #120
    
----
commit 49714c0dee16447d083f5de2f795a34b8671e1a9
Author: Robert Gruendler <ro...@dubture.com>
Date:   2015-05-26T18:11:05Z

    Added DebugBar improvements:
    
    - Add `positionBottom` method to position it at the bottom of the screen
    - Remember expanded/collapsed state

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by sebfz1 <gi...@git.apache.org>.
Github user sebfz1 commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/120#discussion_r31129691
  
    --- Diff: wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/wicket-debugbar.js ---
    @@ -26,5 +26,45 @@ function wicketDebugBarToggleVisibility(elemID) {
     	var elem = document.getElementById(elemID);
     	var vis  = elem.style.display != 'none';
     	elem.style.display = (vis ? 'none' : '');
    +    // alter the state cookie so we can initialize it properly on domReady
    +	wicketDebugBarSetExpandedCookie(vis ? 'collapsed' : 'expanded')
     }
     
    +function wicketDebugBarSetExpandedCookie(value) {
    +	document.cookie =  "wicketDebugBarState=" + window.escape(value);
    +}
    +
    +function wicketDebugBarGetExpandedCookie() {
    +	var name = 'wicketDebugBarState';
    +	if (document.cookie.length > 0) {
    +		var start = document.cookie.indexOf (name + "=");
    +		if (start !== -1) {
    +			start = start + name.length + 1;
    +			var end = document.cookie.indexOf(";", start);
    +			if (end === -1) {
    +				end = document.cookie.length;
    +			}
    +			return window.unescape(document.cookie.substring(start,end));
    +		} else {
    +			return null;
    +		}
    +	} else {
    +		return null;
    +	}
    +}
    +
    +function wicketDebugBarCheckState() {
    +	var state = wicketDebugBarGetExpandedCookie();
    +    // state cookie has not been set. determine state and set it
    +	if (state === null) {
    +		var isVisible = $('#wicketDebugBarContents').is(':visible');
    +		wicketDebugBarSetExpandedCookie(isVisible ? 'expanded' : 'collapsed');
    +    // set state of debug bar according to cookie
    +	} else {
    +		if (state === 'expanded') {
    +			$('#wicketDebugBarContents').css('display', 'inherit');
    --- End diff --
    
    Yes it does, thanks!
    By default `inherit` gets the parent's value which is `block` (specified by `.wicketDebugBar`), not specifying it lead to the default value which is `inline` for a span. It's not so weird, as I was previously thinking... ;)
    For the resolution, you can either remove the display css-property (like you did) or restore the default value (`inline`), as you prefer...



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by pulse00 <gi...@git.apache.org>.
Github user pulse00 commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/120#discussion_r31127101
  
    --- Diff: wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/wicket-debugbar.js ---
    @@ -26,5 +26,45 @@ function wicketDebugBarToggleVisibility(elemID) {
     	var elem = document.getElementById(elemID);
     	var vis  = elem.style.display != 'none';
     	elem.style.display = (vis ? 'none' : '');
    +    // alter the state cookie so we can initialize it properly on domReady
    +	wicketDebugBarSetExpandedCookie(vis ? 'collapsed' : 'expanded')
     }
     
    +function wicketDebugBarSetExpandedCookie(value) {
    +	document.cookie =  "wicketDebugBarState=" + window.escape(value);
    +}
    +
    +function wicketDebugBarGetExpandedCookie() {
    +	var name = 'wicketDebugBarState';
    +	if (document.cookie.length > 0) {
    +		var start = document.cookie.indexOf (name + "=");
    +		if (start !== -1) {
    +			start = start + name.length + 1;
    +			var end = document.cookie.indexOf(";", start);
    +			if (end === -1) {
    +				end = document.cookie.length;
    +			}
    +			return window.unescape(document.cookie.substring(start,end));
    +		} else {
    +			return null;
    +		}
    +	} else {
    +		return null;
    +	}
    +}
    +
    +function wicketDebugBarCheckState() {
    +	var state = wicketDebugBarGetExpandedCookie();
    +    // state cookie has not been set. determine state and set it
    +	if (state === null) {
    +		var isVisible = $('#wicketDebugBarContents').is(':visible');
    +		wicketDebugBarSetExpandedCookie(isVisible ? 'expanded' : 'collapsed');
    +    // set state of debug bar according to cookie
    +	} else {
    +		if (state === 'expanded') {
    +			$('#wicketDebugBarContents').css('display', 'inherit');
    --- End diff --
    
    @sebfz1 if you replace
    
    ```javascript
    $('#wicketDebugBarContents').css('display', 'inherit');
    ```
    
    with 
    
    ```javascript
    $('#wicketDebugBarContents').css('display', '');
    ```
    
    does it fix the issue in firefox for you? I cannot reproduce this glitch here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/wicket/pull/120


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by sebfz1 <gi...@git.apache.org>.
Github user sebfz1 commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/120#discussion_r31118609
  
    --- Diff: wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/wicket-debugbar.js ---
    @@ -26,5 +26,45 @@ function wicketDebugBarToggleVisibility(elemID) {
     	var elem = document.getElementById(elemID);
     	var vis  = elem.style.display != 'none';
     	elem.style.display = (vis ? 'none' : '');
    +    // alter the state cookie so we can initialize it properly on domReady
    +	wicketDebugBarSetExpandedCookie(vis ? 'collapsed' : 'expanded')
     }
     
    +function wicketDebugBarSetExpandedCookie(value) {
    +	document.cookie =  "wicketDebugBarState=" + window.escape(value);
    +}
    +
    +function wicketDebugBarGetExpandedCookie() {
    +	var name = 'wicketDebugBarState';
    +	if (document.cookie.length > 0) {
    +		var start = document.cookie.indexOf (name + "=");
    +		if (start !== -1) {
    +			start = start + name.length + 1;
    +			var end = document.cookie.indexOf(";", start);
    +			if (end === -1) {
    +				end = document.cookie.length;
    +			}
    +			return window.unescape(document.cookie.substring(start,end));
    +		} else {
    +			return null;
    +		}
    +	} else {
    +		return null;
    +	}
    +}
    +
    +function wicketDebugBarCheckState() {
    +	var state = wicketDebugBarGetExpandedCookie();
    +    // state cookie has not been set. determine state and set it
    +	if (state === null) {
    +		var isVisible = $('#wicketDebugBarContents').is(':visible');
    +		wicketDebugBarSetExpandedCookie(isVisible ? 'expanded' : 'collapsed');
    +    // set state of debug bar according to cookie
    +	} else {
    +		if (state === 'expanded') {
    +			$('#wicketDebugBarContents').css('display', 'inherit');
    --- End diff --
    
    If it can help, the display issue is corrected when clicking on collapse/expand... It seems to be related only to the original state...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by pulse00 <gi...@git.apache.org>.
Github user pulse00 commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/120#discussion_r31130907
  
    --- Diff: wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/wicket-debugbar.js ---
    @@ -26,5 +26,45 @@ function wicketDebugBarToggleVisibility(elemID) {
     	var elem = document.getElementById(elemID);
     	var vis  = elem.style.display != 'none';
     	elem.style.display = (vis ? 'none' : '');
    +    // alter the state cookie so we can initialize it properly on domReady
    +	wicketDebugBarSetExpandedCookie(vis ? 'collapsed' : 'expanded')
     }
     
    +function wicketDebugBarSetExpandedCookie(value) {
    +	document.cookie =  "wicketDebugBarState=" + window.escape(value);
    +}
    +
    +function wicketDebugBarGetExpandedCookie() {
    +	var name = 'wicketDebugBarState';
    +	if (document.cookie.length > 0) {
    +		var start = document.cookie.indexOf (name + "=");
    +		if (start !== -1) {
    +			start = start + name.length + 1;
    +			var end = document.cookie.indexOf(";", start);
    +			if (end === -1) {
    +				end = document.cookie.length;
    +			}
    +			return window.unescape(document.cookie.substring(start,end));
    +		} else {
    +			return null;
    +		}
    +	} else {
    +		return null;
    +	}
    +}
    +
    +function wicketDebugBarCheckState() {
    +	var state = wicketDebugBarGetExpandedCookie();
    +    // state cookie has not been set. determine state and set it
    +	if (state === null) {
    +		var isVisible = $('#wicketDebugBarContents').is(':visible');
    +		wicketDebugBarSetExpandedCookie(isVisible ? 'expanded' : 'collapsed');
    +    // set state of debug bar according to cookie
    +	} else {
    +		if (state === 'expanded') {
    +			$('#wicketDebugBarContents').css('display', 'inherit');
    --- End diff --
    
    i've removed it, since this is what the version prior to this PR was using :) 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by sebfz1 <gi...@git.apache.org>.
Github user sebfz1 commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/120#discussion_r31115107
  
    --- Diff: wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/wicket-debugbar.js ---
    @@ -26,5 +26,45 @@ function wicketDebugBarToggleVisibility(elemID) {
     	var elem = document.getElementById(elemID);
     	var vis  = elem.style.display != 'none';
     	elem.style.display = (vis ? 'none' : '');
    +    // alter the state cookie so we can initialize it properly on domReady
    +	wicketDebugBarSetExpandedCookie(vis ? 'collapsed' : 'expanded')
     }
     
    +function wicketDebugBarSetExpandedCookie(value) {
    +	document.cookie =  "wicketDebugBarState=" + window.escape(value);
    +}
    +
    +function wicketDebugBarGetExpandedCookie() {
    +	var name = 'wicketDebugBarState';
    +	if (document.cookie.length > 0) {
    +		var start = document.cookie.indexOf (name + "=");
    +		if (start !== -1) {
    +			start = start + name.length + 1;
    +			var end = document.cookie.indexOf(";", start);
    +			if (end === -1) {
    +				end = document.cookie.length;
    +			}
    +			return window.unescape(document.cookie.substring(start,end));
    +		} else {
    +			return null;
    +		}
    +	} else {
    +		return null;
    +	}
    +}
    +
    +function wicketDebugBarCheckState() {
    +	var state = wicketDebugBarGetExpandedCookie();
    +    // state cookie has not been set. determine state and set it
    +	if (state === null) {
    +		var isVisible = $('#wicketDebugBarContents').is(':visible');
    +		wicketDebugBarSetExpandedCookie(isVisible ? 'expanded' : 'collapsed');
    +    // set state of debug bar according to cookie
    +	} else {
    +		if (state === 'expanded') {
    +			$('#wicketDebugBarContents').css('display', 'inherit');
    --- End diff --
    
    `display:inherit` leads to a display issue for me (firefox 38).
    If I remove the inline `display:inherit`, it works. I admit this is weird...
    It does not repro on Chrome.
    
    ![debugbar](https://cloud.githubusercontent.com/assets/1717144/7832602/8998dd50-0460-11e5-85e7-70e1dfa38b1a.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the pull request:

    https://github.com/apache/wicket/pull/120#issuecomment-105766552
  
    Okay, I will investigate it when I got some time left.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the pull request:

    https://github.com/apache/wicket/pull/120#issuecomment-105766408
  
    Yes. `$` -> vanilla JS.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by sebfz1 <gi...@git.apache.org>.
Github user sebfz1 commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/120#discussion_r31130747
  
    --- Diff: wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/wicket-debugbar.js ---
    @@ -26,5 +26,45 @@ function wicketDebugBarToggleVisibility(elemID) {
     	var elem = document.getElementById(elemID);
     	var vis  = elem.style.display != 'none';
     	elem.style.display = (vis ? 'none' : '');
    +    // alter the state cookie so we can initialize it properly on domReady
    +	wicketDebugBarSetExpandedCookie(vis ? 'collapsed' : 'expanded')
     }
     
    +function wicketDebugBarSetExpandedCookie(value) {
    +	document.cookie =  "wicketDebugBarState=" + window.escape(value);
    +}
    +
    +function wicketDebugBarGetExpandedCookie() {
    +	var name = 'wicketDebugBarState';
    +	if (document.cookie.length > 0) {
    +		var start = document.cookie.indexOf (name + "=");
    +		if (start !== -1) {
    +			start = start + name.length + 1;
    +			var end = document.cookie.indexOf(";", start);
    +			if (end === -1) {
    +				end = document.cookie.length;
    +			}
    +			return window.unescape(document.cookie.substring(start,end));
    +		} else {
    +			return null;
    +		}
    +	} else {
    +		return null;
    +	}
    +}
    +
    +function wicketDebugBarCheckState() {
    +	var state = wicketDebugBarGetExpandedCookie();
    +    // state cookie has not been set. determine state and set it
    +	if (state === null) {
    +		var isVisible = $('#wicketDebugBarContents').is(':visible');
    +		wicketDebugBarSetExpandedCookie(isVisible ? 'expanded' : 'collapsed');
    +    // set state of debug bar according to cookie
    +	} else {
    +		if (state === 'expanded') {
    +			$('#wicketDebugBarContents').css('display', 'inherit');
    --- End diff --
    
    Yes right, and better IMO... I forgot this one :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by pulse00 <gi...@git.apache.org>.
Github user pulse00 commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/120#discussion_r31118027
  
    --- Diff: wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/wicket-debugbar.js ---
    @@ -26,5 +26,45 @@ function wicketDebugBarToggleVisibility(elemID) {
     	var elem = document.getElementById(elemID);
     	var vis  = elem.style.display != 'none';
     	elem.style.display = (vis ? 'none' : '');
    +    // alter the state cookie so we can initialize it properly on domReady
    +	wicketDebugBarSetExpandedCookie(vis ? 'collapsed' : 'expanded')
     }
     
    +function wicketDebugBarSetExpandedCookie(value) {
    +	document.cookie =  "wicketDebugBarState=" + window.escape(value);
    +}
    +
    +function wicketDebugBarGetExpandedCookie() {
    +	var name = 'wicketDebugBarState';
    +	if (document.cookie.length > 0) {
    +		var start = document.cookie.indexOf (name + "=");
    +		if (start !== -1) {
    +			start = start + name.length + 1;
    +			var end = document.cookie.indexOf(";", start);
    +			if (end === -1) {
    +				end = document.cookie.length;
    +			}
    +			return window.unescape(document.cookie.substring(start,end));
    +		} else {
    +			return null;
    +		}
    +	} else {
    +		return null;
    +	}
    +}
    +
    +function wicketDebugBarCheckState() {
    +	var state = wicketDebugBarGetExpandedCookie();
    +    // state cookie has not been set. determine state and set it
    +	if (state === null) {
    +		var isVisible = $('#wicketDebugBarContents').is(':visible');
    +		wicketDebugBarSetExpandedCookie(isVisible ? 'expanded' : 'collapsed');
    +    // set state of debug bar according to cookie
    +	} else {
    +		if (state === 'expanded') {
    +			$('#wicketDebugBarContents').css('display', 'inherit');
    --- End diff --
    
    thanks, i'll have a look at this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/120#discussion_r31130617
  
    --- Diff: wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/wicket-debugbar.js ---
    @@ -26,5 +26,45 @@ function wicketDebugBarToggleVisibility(elemID) {
     	var elem = document.getElementById(elemID);
     	var vis  = elem.style.display != 'none';
     	elem.style.display = (vis ? 'none' : '');
    +    // alter the state cookie so we can initialize it properly on domReady
    +	wicketDebugBarSetExpandedCookie(vis ? 'collapsed' : 'expanded')
     }
     
    +function wicketDebugBarSetExpandedCookie(value) {
    +	document.cookie =  "wicketDebugBarState=" + window.escape(value);
    +}
    +
    +function wicketDebugBarGetExpandedCookie() {
    +	var name = 'wicketDebugBarState';
    +	if (document.cookie.length > 0) {
    +		var start = document.cookie.indexOf (name + "=");
    +		if (start !== -1) {
    +			start = start + name.length + 1;
    +			var end = document.cookie.indexOf(";", start);
    +			if (end === -1) {
    +				end = document.cookie.length;
    +			}
    +			return window.unescape(document.cookie.substring(start,end));
    +		} else {
    +			return null;
    +		}
    +	} else {
    +		return null;
    +	}
    +}
    +
    +function wicketDebugBarCheckState() {
    +	var state = wicketDebugBarGetExpandedCookie();
    +    // state cookie has not been set. determine state and set it
    +	if (state === null) {
    +		var isVisible = $('#wicketDebugBarContents').is(':visible');
    +		wicketDebugBarSetExpandedCookie(isVisible ? 'expanded' : 'collapsed');
    +    // set state of debug bar according to cookie
    +	} else {
    +		if (state === 'expanded') {
    +			$('#wicketDebugBarContents').css('display', 'inherit');
    --- End diff --
    
    Or use `initial`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the pull request:

    https://github.com/apache/wicket/pull/120#issuecomment-105766171
  
    My shell script for merging GitHub PRs was already in process when @klopfdreh commented.
    @klopfdreh Please apply your improvements in master branch.
    
    @pulse00 Thank you!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Added DebugBar improvements

Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the pull request:

    https://github.com/apache/wicket/pull/120#issuecomment-105766314
  
    You mean the improvements of the comments in here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---