Trinithis
05-20-2007, 04:58 PM
This is a script I came up with for site development. It provides a GUI for viewing objects, their properties, and their methods. Any variable type is acceptable.
HowTo:
Place this code at the beginning of your page and in your following scripts you
call the function viewObject(object, bool). The bool argument is optional and has
a default value of false. If explicitly set as true, the window the viewObject function
creates is minimized. viewObject creates a window that has all the inside stuff of the object
displayed, along with all their values (if there are any). You can drag the window by clicking
and holding down on the numbered box of the window's top right corner. The number in the box
signifies the number of times the function has been called. If that region is double clicked,
then the window minimizes. You can click on the bullets before each property to view that object
in a GUI window. Hitting Ctr+Shift+Z closes all the GUI windows. Crt+Shift+MouseClick views the object
that the mouse hovers over.
Edit: Both the key codes for both the shortcuts are customizable. You can add, change, and/or remove the key shortcuts for either command. There is a place early on in the source code with customizable variables.
Oh, and if the object has innerHTML, outerHTML, innerText, outerText, or textContent, the code does not display them due to speed issues. But that shouldn't be an issue. Just use other attributes, such as childNodes and nodeValue.
(Updated Code; you may have to recache the script.)
Source Code:
http://trinithis.awardspace.com/viewObject/viewObject.js
Demo:
http://trinithis.awardspace.com/viewObject/Test.html
If you so desire, you can make this in to a greasemonkey .user.js file, but seeing that I don't have greasemonkey, I won't do it. (I don't have greasemonkey because I have to use an old FF browser 1.0.7 since all the other ones I have tried hang my dial-up. Yes, dial-up. And I can't seem to find an old greasemonkey anymore...)
HowTo:
Place this code at the beginning of your page and in your following scripts you
call the function viewObject(object, bool). The bool argument is optional and has
a default value of false. If explicitly set as true, the window the viewObject function
creates is minimized. viewObject creates a window that has all the inside stuff of the object
displayed, along with all their values (if there are any). You can drag the window by clicking
and holding down on the numbered box of the window's top right corner. The number in the box
signifies the number of times the function has been called. If that region is double clicked,
then the window minimizes. You can click on the bullets before each property to view that object
in a GUI window. Hitting Ctr+Shift+Z closes all the GUI windows. Crt+Shift+MouseClick views the object
that the mouse hovers over.
Edit: Both the key codes for both the shortcuts are customizable. You can add, change, and/or remove the key shortcuts for either command. There is a place early on in the source code with customizable variables.
Oh, and if the object has innerHTML, outerHTML, innerText, outerText, or textContent, the code does not display them due to speed issues. But that shouldn't be an issue. Just use other attributes, such as childNodes and nodeValue.
(Updated Code; you may have to recache the script.)
Source Code:
http://trinithis.awardspace.com/viewObject/viewObject.js
Demo:
http://trinithis.awardspace.com/viewObject/Test.html
If you so desire, you can make this in to a greasemonkey .user.js file, but seeing that I don't have greasemonkey, I won't do it. (I don't have greasemonkey because I have to use an old FF browser 1.0.7 since all the other ones I have tried hang my dial-up. Yes, dial-up. And I can't seem to find an old greasemonkey anymore...)