<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Elegando &#187; JavaScript</title>
	<atom:link href="http://elegando.jcg3.org/cat/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegando.jcg3.org</link>
	<description>elegant » being unusually effective and simple...</description>
	<lastBuildDate>Thu, 30 Jun 2011 01:51:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Firefox: Remember All Passwords</title>
		<link>http://elegando.jcg3.org/2009/02/firefox-remember-all-passwords/</link>
		<comments>http://elegando.jcg3.org/2009/02/firefox-remember-all-passwords/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 05:18:28 +0000</pubDate>
		<dc:creator>Jason G.</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.elegando.com/2009/02/firefox-remember-all-passwords/</guid>
		<description><![CDATA[From cybernetnews&#8230; you can make it so websites can&#8217;t override the password saving feature in Firefox. Edit the file nsLoginManager.js, and modify line 770 to return false all the time. _isAutocompleteDisabled : function (element) { if (element &#38;&#38; element.hasAttribute("autocomplete") &#38;&#38; element.getAttribute("autocomplete").toLowerCase() == "off") /** Change this line to be return false **/ return false; return [...]]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://cybernetnews.com/2009/02/13/firefox-remember-passwords/">cybernetnews</a>&#8230; you can make it so websites can&#8217;t override the password saving feature in Firefox. Edit the file nsLoginManager.js, and modify line 770 to return false all the time.<br />
<span id="more-94"></span></p>
<pre class="java" name="code">    _isAutocompleteDisabled :  function (element) {
        if (element &amp;&amp; element.hasAttribute("autocomplete") &amp;&amp;
            element.getAttribute("autocomplete").toLowerCase() == "off")
            /** Change this line to be return false **/
            return false;

        return false;
    },</pre>
]]></content:encoded>
			<wfw:commentRss>http://elegando.jcg3.org/2009/02/firefox-remember-all-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX + JavaScript + Multiple Monitors</title>
		<link>http://elegando.jcg3.org/2008/04/osx-javascript-multiple-monitors/</link>
		<comments>http://elegando.jcg3.org/2008/04/osx-javascript-multiple-monitors/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 02:34:22 +0000</pubDate>
		<dc:creator>Jason G.</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.elegando.com/2008/04/osx-javascript-multiple-monitors/</guid>
		<description><![CDATA[As I posted a while back, there&#8217;s no real definitive help for doing javascript with multiple monitors. Now that I&#8217;m on Mac OSX, I thought I&#8217;d update with the info for that platform. Firefox sees various values differently on the main screen and on the secondary screen&#8230; here is a quick table with the info [...]]]></description>
			<content:encoded><![CDATA[<p>As I posted <a href="http://elegando.jcg3.org/2008/02/javascript-on-multiple-monitor-systems/">a while back</a>, there&#8217;s no real definitive help for doing javascript with multiple monitors.  Now that I&#8217;m on Mac OSX, I thought I&#8217;d update with the info for that platform.</p>
<p>Firefox sees various values differently on the main screen and on the secondary screen&#8230;  here is a quick table with the info &#8212; for reference sake, the secondary display is vertically positioned above the primary display, and my Dock is on the left side of the primary screen&#8230;</p>
<table>
<tr>
<td>Variable</td>
<td>Primary</td>
<td>Secondary</td>
</tr>
<tr>
<td>Actual Resolution</td>
<td>1440&#215;900</td>
<td>1920&#215;1200</td>
</tr>
<tr>
<td>screen.top</td>
<td>0</td>
<td>-1200</td>
</tr>
<tr>
<td>screen.left</td>
<td>0</td>
<td>-269</td>
</tr>
<tr>
<td>screen.width</td>
<td>1440</td>
<td>1920</td>
</tr>
<tr>
<td>screen.height</td>
<td>900</td>
<td>1200</td>
</tr>
<tr>
<td>screen.availTop</td>
<td>22</td>
<td>-1200</td>
</tr>
<tr>
<td>screen.availLeft</td>
<td>53</td>
<td>-269</td>
</tr>
<tr>
<td>screen.availWidth</td>
<td>1387</td>
<td>1920</td>
</tr>
<tr>
<td>screen.availHeight</td>
<td>878</td>
<td>1200</td>
</tr>
</table>
<p>So, you&#8217;d think the same script would work fine&#8230;  but on the primary screen, moving to (0,0) put you at (availTop, availLeft), aka (22,53) because of the Dock and the OSX menu.</p>
<p>The code that worked for me&#8230;</p>
<pre name="code" class="java">
resizeTo( 1024, screen.availHeight );
var screenTop = screen.availTop;
if( screen.availHeight != screen.height ) {
    screenTop = 0;
}
moveTo( screen.availLeft, screenTop );
</pre>
]]></content:encoded>
			<wfw:commentRss>http://elegando.jcg3.org/2008/04/osx-javascript-multiple-monitors/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript on Multiple Monitor Systems</title>
		<link>http://elegando.jcg3.org/2008/02/javascript-on-multiple-monitor-systems/</link>
		<comments>http://elegando.jcg3.org/2008/02/javascript-on-multiple-monitor-systems/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 18:19:24 +0000</pubDate>
		<dc:creator>Jason G.</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.elegando.com/2008/02/javascript-on-multiple-monitor-systems/</guid>
		<description><![CDATA[I have a preference to keep my browser windows a certain width (1024 pixels for various reasons), flush against the right side of my monitor display, and taking the full height of the screen.  To do this, I have the following javascript on my start page: resizeTo( 1024, screen.availHeight ); moveTo( (screen.availWidth - 1024), 0 [...]]]></description>
			<content:encoded><![CDATA[<p>I have a preference to keep my browser windows a certain width (1024 pixels for various reasons), flush against the right side of my monitor display, and taking the full height of the screen.  To do this, I have the following javascript on my start page:</p>
<p><code>resizeTo( 1024, screen.availHeight );<br />
moveTo( (screen.availWidth - 1024), 0 );<br />
</code></p>
<p>For some reason though, Firefox has always had some strange behavior when running this script on my systems with multiple monitors.</p>
<p><span id="more-53"></span></p>
<p>When on the second display, the window will resize itself properly, but will not position itself according to the math above.  Even inspecting the availWidth field turns out what I&#8217;d expect&#8230;</p>
<p>I finally figured out why. The moveTo method doesn&#8217;t work on the same origin point as the availWidth fields. The important javascript properties that I need to know about are the screen.availLeft and screen.availTop.</p>
<p>In Firefox&#8230;  When multiple monitors are positioned side-by-side, availLeft on the left monitor will be zero, and on the right monitor it will be 1024 (or whatever the width resolution is on monitor on the left).  When there is only one screen, availLeft will be zero.</p>
<p>When multiple monitors are stacked vertically, availLeft will be zero on both monitors, and availTop will be zero on your main monitor (the one with the windows task bar) and will be -768 on the other monitor.  This is inconsistent with the availLeft behavior, but once we know about it, it is easy to work around.</p>
<p>So now, my start page script has the following code:</p>
<p><code>resizeTo( 1024, screen.availHeight );<br />
moveTo( screen.availLeft + (screen.availWidth - 1024), 0 );</code></p>
<p>When on a single screen, availLeft is zero, and doesn&#8217;t affect the calculation.  When on a multi-screen display, it will position the browser as I desire, regardless of which screen the browser is on.</p>
<p><strong>Updated April 08</strong>: Also see my follow-up post on <a href="http://elegando.jcg3.org/2008/04/osx-javascript-multiple-monitors/">OSX + Javascript + Multiple Monitors</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegando.jcg3.org/2008/02/javascript-on-multiple-monitor-systems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JavaScript Cookbook</title>
		<link>http://elegando.jcg3.org/2007/11/javascript-cookbook/</link>
		<comments>http://elegando.jcg3.org/2007/11/javascript-cookbook/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 03:04:15 +0000</pubDate>
		<dc:creator>Jason G.</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.elegando.com/2007/11/javascript-cookbook/</guid>
		<description><![CDATA[No, not the O&#8217;Reily book, this is a good website that has a lot of JavaScript code, in case you find yourself in need&#8230; http://www.java2s.com/Code/JavaScript/CatalogJavaScript.htm As you might imagine, there are examples for more things in the entire website&#8230; http://java2s.com/]]></description>
			<content:encoded><![CDATA[<p>No, not the O&#8217;Reily book, this is a good website that has a lot of JavaScript code, in case you find yourself in need&#8230;</p>
<p><a href="http://www.java2s.com/Code/JavaScript/CatalogJavaScript.htm">http://www.java2s.com/Code/JavaScript/CatalogJavaScript.htm</a></p>
<p>As you might imagine, there are examples for more things in the entire website&#8230;</p>
<p><a href="http://java2s.com/">http://java2s.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://elegando.jcg3.org/2007/11/javascript-cookbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client Side Collapse/Expand</title>
		<link>http://elegando.jcg3.org/2007/11/client-side-collapseexpand/</link>
		<comments>http://elegando.jcg3.org/2007/11/client-side-collapseexpand/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 03:01:27 +0000</pubDate>
		<dc:creator>Jason G.</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.elegando.com/2007/11/client-side-collapseexpand/</guid>
		<description><![CDATA[Want to do it directly with javascript? Here&#8217;s an example, including changing a collapse/expand button, that I snagged from somewhere&#8230; if( expandedAccountSummaryLayer ) { expandedAccountSummaryLayer = false; if (agt.indexOf('msie') != -1) { theButton.childNodes[0].src = imgpath + "/expandButton.gif"; } else { theButton.childNodes[1].src = imgpath + "/expandButton.gif"; } if ( theLayer != null ) { theLayer.style.height = [...]]]></description>
			<content:encoded><![CDATA[<p>Want to do it directly with javascript?  Here&#8217;s an example, including changing a collapse/expand button, that I snagged from somewhere&#8230;<span id="more-44"></span></p>
<pre>
<code>
     if( expandedAccountSummaryLayer )
     {
       expandedAccountSummaryLayer = false;
	if (agt.indexOf('msie') != -1) {
 	       theButton.childNodes[0].src = imgpath + "/expandButton.gif";
        } else {
 	       theButton.childNodes[1].src = imgpath + "/expandButton.gif";
        }
       if ( theLayer != null ) {
         theLayer.style.height = "138";
         theLayer.style.overflow = "auto";
       }
     }
     else
     {
       expandedAccountSummaryLayer = true;
	if (agt.indexOf('msie') != -1) {
 	      	theButton.childNodes[0].src = imgpath + "/collapseButton.gif";
        } else {
 	      	theButton.childNodes[1].src = imgpath + "/collapseButton.gif";
        }
       if ( theLayer != null ) {
         theLayer.style.height = "auto";
         theLayer.style.overflow = "auto";
       }
     }
</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://elegando.jcg3.org/2007/11/client-side-collapseexpand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Block Enter Key Submit</title>
		<link>http://elegando.jcg3.org/2007/11/block-enter-key-submit/</link>
		<comments>http://elegando.jcg3.org/2007/11/block-enter-key-submit/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 02:56:07 +0000</pubDate>
		<dc:creator>Jason G.</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.elegando.com/2007/11/block-enter-key-submit/</guid>
		<description><![CDATA[Sometimes you want a form to submit when the enter key is pressed, most times you don&#8217;t&#8230; here&#8217;s the code to block it from happening&#8230; function blockEnter(evt) { evt = (evt) ? evt : event; var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode); if (charCode == 13) { return false; } [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want a form to submit when the enter key is pressed, most times you don&#8217;t&#8230;  here&#8217;s the code to block it from happening&#8230;<span id="more-43"></span></p>
<pre><code>
function blockEnter(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode :
          ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13) {
        return false;
    } else {
        return true;
    }
}
&lt;input onkeydown="return blockEnter(event);" name="search" size="40" type="text" /&gt;
</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://elegando.jcg3.org/2007/11/block-enter-key-submit/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Protected: IE6 &amp; Radio Buttons</title>
		<link>http://elegando.jcg3.org/2007/08/ie6-radio-buttons/</link>
		<comments>http://elegando.jcg3.org/2007/08/ie6-radio-buttons/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 19:43:49 +0000</pubDate>
		<dc:creator>Jason G.</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.elegando.com/2007/08/ie6-radio-buttons/</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://elegando.jcg3.org/wordpress/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-28">Password:<br />
<input name="post_password" id="pwbox-28" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://elegando.jcg3.org/2007/08/ie6-radio-buttons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

