<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Anthology of Ideas &#187; javascript</title>
	<atom:link href="http://anthologyoi.com/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://anthologyoi.com</link>
	<description>Anthology of Ideas is an archive of thoughts and form.</description>
	<lastBuildDate>Sat, 03 Mar 2012 11:16:55 +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>Short Ajax Script</title>
		<link>http://anthologyoi.com/dev/short-ajax-script.html</link>
		<comments>http://anthologyoi.com/dev/short-ajax-script.html#comments</comments>
		<pubDate>Tue, 13 May 2008 15:40:50 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Web Developing]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://anthologyoi.com/blogish/asides/minimalist-ajax-script.html</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div id="flickrImage_4" class="wp-caption alignleft" style="width: 250px"><a href="http://www.flickr.com/photos/jaywood/" rel="nofollow"  target="_blank"><img src="http://farm7.static.flickr.com/6065/6126357875_ca3058c8fd_m.jpg" width="240" height="160" /></a><p class="wp-caption-text">AJAX - it</p></div>
<p>I wanted to see how small you could make a fully functional AJAX script that worked cross-browser and degraded gracefully, so I went through an old custom AJAX script and made it as small as I possibly could. In the resulting AJAX scripts, the post version is 410 characters and the GET version is only 359 characters long. The scripts are fully functional and accept the following parameters: URL, DATA (in string form), and ELEMENT (to update).</p>
<p>The scripts could be a little smaller, but it would really kill readability. </p>
<h3>&#8220;Get&#8221; AJAX Script</h3>
<p><pre class="brush: php">function a(l,d,u){
try{r = new XMLHttpRequest();}catch(e){try {r = new ActiveXObject(&#039;Msxml2.XMLHTTP&#039;);}catch(e){r = new ActiveXObject(&#039;Microsoft.XMLHTTP&#039;);}}
if(r){
r.onreadystatechange = function() {if (r.readyState == 4 &amp;&amp; r.status == 200){document.getElementById(u).innerHTML = r.responseText;}}
r.open(&#039;GET&#039;, l+&#039;?&#039;+d, true);r.send(d);
}
}</pre></p>
<h3>&#8220;Post&#8221; AJAX Script</h3>
<p><pre class="brush: php">function b(l,d,u){
try{r = new XMLHttpRequest();} catch(e){try {r = new ActiveXObject(&#039;Msxml2.XMLHTTP&#039;);} catch(e){r = new ActiveXObject(&#039;Microsoft.XMLHTTP&#039;);}}
if(r){
r.onreadystatechange = function() {if (r.readyState == 4 &amp;&amp; r.status == 200){document.getElementById(u).innerHTML=r.responseText;}}
r.open(&#039;POST&#039;, l, true);r.setRequestHeader(&#039;Content-type&#039;, &#039;application/x-www-form-urlencoded&#039;);r.send(d);
}
}</pre></p>
<h3>Combined AJAX Script</h3>
<p>This combined script also accepts a fourth parameter &#8216;p&#8217; that should evaluate true if the data is to be sent by post.</p>
<p><pre class="brush: php">function a(l,d,u,p){
try{r = new XMLHttpRequest();}catch(e){try {r = new ActiveXObject(&#039;Msxml2.XMLHTTP&#039;);}catch(e){r = new ActiveXObject(&#039;Microsoft.XMLHTTP&#039;);}}
if(r){
r.onreadystatechange = function() {if (r.readyState == 4 &amp;&amp; r.status == 200){document.getElementById(u).innerHTML = r.responseText;}}
if(p){r.open(&#039;POST&#039;, l, true);r.setRequestHeader(&#039;Content-type&#039;, &#039;application/x-www-form-urlencoded&#039;);}else{r.open(&#039;GET&#039;, l+&#039;?&#039;+d, true);}
}
}</pre></p>
<p>Demo: (Sorry but you will have to go to the full page so the JavaScript is loaded.) <span id="more-220"></span><br />
<a href="?p=220" onclick="b('http://anthologyoi.com/index.php','p=220','hi'); return false;">Click here to see the POST HTML of the homepage</a><br />
<a href="?p=220" onclick="a('http://anthologyoi.com/index.php','p=220','hi'); return false;">Click here to see the GET HTML of the homepage</a><br />
 (they are the same)<br />
<textarea id="hi" rows="5" columns="5"></textarea></p>
]]></content:encoded>
			<wfw:commentRss>http://anthologyoi.com/dev/short-ajax-script.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Displaying WordPress categories in a horizontal dropdown menu.</title>
		<link>http://anthologyoi.com/wordpress/displaying-wordpress-categories-in-a-horizontal-dropdown-menu.html</link>
		<comments>http://anthologyoi.com/wordpress/displaying-wordpress-categories-in-a-horizontal-dropdown-menu.html#comments</comments>
		<pubDate>Wed, 16 Jan 2008 18:05:51 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[drop-down menus]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://anthologyoi.com/wordpress/displaying-wordpress-categories-in-a-horizontal-dropdown-menu.html</guid>
		<description><![CDATA[One of my readers recently asked how I created my horizontal menu bar: the short answer is by mixing CSS and Javascript. The first step is to get WordPress to display the menu as a hierarchical list without a title. &#8230; <a href="http://anthologyoi.com/wordpress/displaying-wordpress-categories-in-a-horizontal-dropdown-menu.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p> One of my readers recently asked how I created my horizontal menu bar: the short answer is by mixing CSS and Javascript.</p>
<p>The first step is to get WordPress to display the menu as a hierarchical list without a title. <span class="inline-code">&lt;?php wp_list_categories(&#039;sort_column=name&amp;sort_order=asc&amp;style=list&amp;children=true&amp;hierarchical=true&amp;title_li=0&#039;); ?&gt;</span></p>
<p>We then wrap this WordPress code in the following so we can style it.<br />
<pre class="brush: php">&lt;div style=&quot;text-align:center;&quot;&gt;
    &lt;ul id=&quot;menu&quot; style=&quot;padding:0; margin:0;&quot;&gt;
        &lt;?php wp_list_categories(&#039;sort_column=name&amp;sort_order=asc&amp;style=list&amp;children=true&amp;hierarchical=true&amp;title_li=0&#039;); ?&gt;
    &lt;/ul&gt;
&lt;/div&gt;</pre></p>
<p>I added this to my header.php, but you can add it anywhere you want it to appear.</p>
<p>The CSS is fairly simple and you just need to add it to your theme&#8217;s <u>style.css</u> file.</p>
<p><pre class="brush: php">ul#menu {
	margin: 0;
	padding: 0;
	list-style: none;
	width: 100%;
	font-size:1.2em;
}

ul#menu li {
	float: left;
	padding: 0;
	margin: 0;
	border-right:solid 1px #fff;
}

ul#menu ul li {
	float: none;
	position: relative;
	border-bottom: 1px solid #7EAED7; /* fixes gap problem in IE */
	border-left: 1px solid #FFF;
	z-index:1000;
}

ul#menu li ul {
	margin: 0;
	padding: 0;
	display:none;
	list-style: none;
	position: absolute;
	background: #9CC;
}
ul#menu ul ul{
	margin-left: .2em;
	position: absolute;
	top: 0; /* if using borders, -1px to align top borders */
	left: 100%;
}

ul#menu * a:hover, ul#menu li a:active{
background:#7EAED7 !important;
color: #FFFFFF;
}

ul#menu li a:link,
ul#menu li a:visited,
ul#menu li a:hover,
ul#menu  li a:active{
	display: block;
	padding: .2em .3em;
	text-decoration: none;
	background: #5587B3;
	 color: #FFFFFF;
}


ul#menu ul li a:link,
ul#menu ul li a:visited,
ul#menu ul li a:hover,
ul#menu ul li a:active {
	width: 8em;
}</pre></p>
<p>Of course you will need to change the colors and text sizes to ensure it blends with the rest of the theme.</p>
<p>Now the last step is the to make it work as a drop-down list on all browsers. This could be done in Firefox with a simple CSS declaration, but Internet Explorer doesn&#8217;t understand the :hover pseudo classes, so we mimic this in Javascript.</p>
<p><pre class="brush: php">&lt;script type=&quot;text/javascript&quot;&gt;
 /*&lt;![CDATA[*/

var mbA,mbT,mbTf,mbSf;
var mbR = [];

function mbSet(m) {
if (document.getElementById&amp;&amp;document.createElement) {
	var m=document.getElementById(m);
	mbR[mbR.length] = m;
	var i;

	e=m.getElementsByTagName(&#039;a&#039;);
	if (!mbTf) mbTf=new Function(&#039;mbHT();&#039;);
	if (!mbSf) mbSf=new Function(&#039;mbS(this);&#039;);
	for (i=0;i&lt;e.length;i++) {
		e[i].onmouseout=e[i].onblur=mbTf;
		e[i].onmouseover=e[i].onfocus=mbSf;
	}

	m=m.getElementsByTagName(&#039;ul&#039;);
	for (i=0;i&lt;m.length;i++) {
		mbH(mbL(m[i]));
	}
}}

function mbHA() {
	if (mbA) {
		while (mbA) mbH(mbA);
		mbHE(&#039;block&#039;);
	}
}

function mbHT() {
	if (!mbT) mbT=setTimeout(&#039;mbHA();&#039;, 0);
}

function mbTC() {
	if (mbT) {
		clearTimeout(mbT);
		mbT=null;
	}
}

function mbS(m) {
	mbTC();
	if (mbA) while (mbA&amp;&amp;m!=mbA&amp;&amp;mbP(m)!=mbA) mbH(mbA);
	else mbHE(&#039;none&#039;);

	if (mbM(m)) {
		mbSH(m,&#039;block&#039;);
		mbA=m;
	}
}

function mbH(m) {
	if (m==mbA) mbA=mbP(m);
	mbSH(m,&#039;none&#039;);
	mbT=null;
}

function mbL(m) {
	while (m &amp;&amp; m.tagName != &#039;A&#039;) m = m.previousSibling;
	return m;
}

function mbM(l) {
	while (l &amp;&amp; l.tagName != &#039;UL&#039;) l = l.nextSibling;
	return l;
}

function mbP(m) {
	var p = m.parentNode.parentNode;
	if (p.tagName == &#039;UL&#039;) {
		var i = 0;
		while (i &lt; mbR.length) {
			if (mbR[i] == p) return null;
			i++;
		}
	} else {
		return null;
	}
	return mbL(p);
}

function mbSH(m,v) {
	m.className=v;
	mbM(m).style.display=v;
}

function mbHE(v) {
	mbHEV(v,document.getElementsByTagName(&#039;select&#039;));
}

function mbHEV(v,e) {
	for (var i=0;i&lt;e.length;i++) e[i].style.display=v;
}
/*]]&gt;*/
&lt;/script&gt;</pre></p>
<p>A couple notes on the previous code. </p>
<ol>
<li>To activate it, change your theme&#8217;s &lt;body> tag to &lt;body onload=&#8221;mbSet(&#8216;menu&#8217;);></li>
<li>It was not written by me, but I&#8217;ve been using it for a long time and don&#8217;t remember where I got it. </li>
<li>It can occasionally create a JavaScript error, and I&#8217;ve intended to rewrite it for a long time, but it usually works fine. </li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://anthologyoi.com/wordpress/displaying-wordpress-categories-in-a-horizontal-dropdown-menu.html/feed</wfw:commentRss>
		<slash:comments>323</slash:comments>
		</item>
		<item>
		<title>DIY Javascript Effects Library</title>
		<link>http://anthologyoi.com/dev/diy-javascript-effects-library.html</link>
		<comments>http://anthologyoi.com/dev/diy-javascript-effects-library.html#comments</comments>
		<pubDate>Wed, 12 Sep 2007 10:00:34 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Web Developing]]></category>
		<category><![CDATA[cross browser]]></category>
		<category><![CDATA[effects library]]></category>
		<category><![CDATA[extensibility]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[special effects]]></category>

		<guid isPermaLink="false">http://anthologyoi.com/dev/diy-javascript-effects-library.html</guid>
		<description><![CDATA[As part of a project I needed an extremely light-weight special effects library that would allow queuing of effects (required), multiple effects, the ability to set a per-effect &#8220;framerate&#8221;, and enough extensibility to fill any need, but it had to &#8230; <a href="http://anthologyoi.com/dev/diy-javascript-effects-library.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As part of a project I needed an extremely light-weight special effects library that would allow queuing of effects (required), multiple effects, the ability to set a per-effect &#8220;framerate&#8221;, and enough extensibility to fill any need, but it had to be independent of any Javascript library or OS.</p>
<p>For the &#8220;core&#8221;: I needed it to be able to queue effects to run one after another, but still be able to run effects synchronously with their own queues. Setting up the effects should take no more than a few lines, and the library should be easy adapted to the website or app it is currently running on. The library must also be cross browser, run well on lower end computers, and very very small (the main reason for creating it was as a replacement in a project for people who didn&#8217;t want to use jQuery or Scriptaculous just for the effects.) The core should be able to do everything with only being told the element&#8217;s ID, whether we are showing or hiding it (if applicable), and the effect to use. An added &#8220;feature&#8221; I wanted was something that could be used to create a tutorial, so no features could be used that were too fancy.</p>
<p>For the effects: I needed each individual effect to take no more than a few lines of setup, processing and finishing, so the framework needed to control everything, but each effect should be able to set its own duration using the framerate set. It should also be extremely simple to add new effects to the library.</p>
<p>The results: A library that is only 8KB in size (without compression or comments) or 2.9KB with natural (not gZip) compression and no comments with 4 built-in effects. While I&#8217;ll admit that the syntax to call effects isn&#8217;t as &#8220;pretty&#8221; as some of the other libraries, it is very simple, and queuing is powerful and easy to set up. If you want to jump ahead and see the finished product go <a href='http://anthologyoi.com/wp-content/uploads/2007/09/effects.js' title='Effects Library v1'>here</a></p>
<p>This is just a demonstration post. The actual code will be explained in the future.</p>
<p>To test the effects library click <a href="#test" id='test' onclick="AOI_eff.start('test_1', {'mode': 'show', 'eff': 'Expand', 'queue': ['hide::test_1::Fade','show::test_2::ScrollLeft::450','hide::test_2::ScrollLeft::50','show::test_1::Fade::25']} ); return false;">here</a></p>
<input type="button" style="display:none;" value="I'm test one" id="test_1"/>
<input type="button" style="display:none;" value="I'm test two" id="test_2"/>
<p>The that group of effects was done with the following code:<br />
<span class="inline-code">AOI_eff.start(&#039;test_1&#039;, {&#039;mode&#039;: &#039;show&#039;, &#039;eff&#039;: &#039;Expand&#039;, &#039;queue&#039;: [&#039;hide::test_1::Fade&#039;,&#039;show::test_2::ScrollLeft::450&#039;,&#039;hide::test_2::ScrollLeft::50&#039;,&#039;show::test_1::Fade::25&#039;]} );</span></p>
<p>Something a little more interesting: <a href="#test" id='test' onclick="AOI_eff.start('test_3', {'mode': 'show', 'eff': 'Expand', 'delay': 75, 'queue': ['show::test_4::Fade','show::test_5::ScrollLeft','show::test_6::SlideUp::50']} ); AOI_eff.start('test_5', {'mode': 'show', 'eff': 'Expand', 'delay': 75, 'queue': ['show::test_3::Fade']} );<br />
return false;">here</a> or the same thing, but with opposite displays  <a href="#test" id='test' onclick="AOI_eff.start('test_3', {'mode': 'hide', 'eff': 'Expand', 'delay': 75, 'queue': ['hide::test_4::Fade','hide::test_5::ScrollLeft','hide::test_6::SlideUp::50']} ); AOI_eff.start('test_5', {'mode': 'hide', 'eff': 'Expand', 'delay': 75, 'queue': ['hide::test_3::Fade']} );<br />
return false;">here</a> or the same thing, but the effects depend on the display. <a href="#test" id='test' onclick="AOI_eff.start('test_3', {'eff': 'Expand', 'delay': 75, 'queue': ['::test_4::Fade','::test_5::ScrollLeft','::test_6::SlideUp::50']} ); AOI_eff.start('test_5', {'eff': 'Expand', 'delay': 75, 'queue': ['::test_3::Fade']} );<br />
return false;">here</a></p>
<input type="button" style="display:none;" value="I'm test three" id="test_3"/>
<input type="button" style="display:none;" value="I'm test four" id="test_4"/>
<input type="button" style="display:block;" value="I'm test five" id="test_5"/>
<input type="button" style="display:none;" value="I'm test six" id="test_6"/>
<p>The onClick commands for those effects are, respectively, as follows.</p>
<p><pre class="brush: php">AOI_eff.start(&#039;test_3&#039;, {&#039;mode&#039;: &#039;show&#039;, &#039;eff&#039;: &#039;Expand&#039;, &#039;delay&#039;: 75, &#039;queue&#039;: [&#039;show::test_4::Fade&#039;,&#039;show::test_5::ScrollLeft&#039;,&#039;show::test_6::SlideUp::50&#039;]} ); AOI_eff.start(&#039;test_5&#039;, {&#039;mode&#039;: &#039;show&#039;, &#039;eff&#039;: &#039;Expand&#039;, &#039;delay&#039;: 75, &#039;queue&#039;: [&#039;show::test_3::Fade&#039;]} );
AOI_eff.start(&#039;test_3&#039;, {&#039;mode&#039;: &#039;hide&#039;, &#039;eff&#039;: &#039;Expand&#039;, &#039;delay&#039;: 75, &#039;queue&#039;: [&#039;hide::test_4::Fade&#039;,&#039;hide::test_5::ScrollLeft&#039;,&#039;hide::test_6::SlideUp::50&#039;]} ); AOI_eff.start(&#039;test_5&#039;, {&#039;mode&#039;: &#039;hide&#039;, &#039;eff&#039;: &#039;Expand&#039;, &#039;delay&#039;: 75, &#039;queue&#039;: [&#039;hide::test_3::Fade&#039;]} );
AOI_eff.start(&#039;test_3&#039;, {&#039;eff&#039;: &#039;Expand&#039;, &#039;delay&#039;: 75, &#039;queue&#039;: [&#039;::test_4::Fade&#039;,&#039;::test_5::ScrollLeft&#039;,&#039;::test_6::SlideUp::50&#039;]} ); AOI_eff.start(&#039;test_5&#039;, {&#039;eff&#039;: &#039;Expand&#039;, &#039;delay&#039;: 75, &#039;queue&#039;: [&#039;::test_3::Fade&#039;]} );</pre></p>
<p>As you can see this is still a work in progress, but I think over time it will improve greatly.</p>
]]></content:encoded>
			<wfw:commentRss>http://anthologyoi.com/dev/diy-javascript-effects-library.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Online Desktop.</title>
		<link>http://anthologyoi.com/computers/the-online-desktop.html</link>
		<comments>http://anthologyoi.com/computers/the-online-desktop.html#comments</comments>
		<pubDate>Wed, 08 Aug 2007 16:45:08 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://anthologyoi.com/computers/the-online-desktop.html</guid>
		<description><![CDATA[Is anyone using StartForce? It is an online desktop that is built in JavaScript, I played around with it a little bit and was impressed, but at 424KB compressed and 1305KB uncompressed it is definitely not for the lower end &#8230; <a href="http://anthologyoi.com/computers/the-online-desktop.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Is anyone using <a href="http://www.startforce.com/">StartForce</a>? It is an online desktop that is built in JavaScript, I played around with it a little bit and was impressed, but at 424KB compressed and 1305KB uncompressed it is definitely not for the lower end computer if you like to do other things on it.</p>
<p><strong>Update:</strong><br />
Sorry, I forgot there was this thing called anchor text in links. </p>
]]></content:encoded>
			<wfw:commentRss>http://anthologyoi.com/computers/the-online-desktop.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP classes = &#8216;Happy&#8217;; Javascript &#8220;classes&#8221; = &#8216;Pull your hair out&#8217;;</title>
		<link>http://anthologyoi.com/blogish/asides/php-classes-happy-javascript-classes-pull-your-hair-out.html</link>
		<comments>http://anthologyoi.com/blogish/asides/php-classes-happy-javascript-classes-pull-your-hair-out.html#comments</comments>
		<pubDate>Sun, 29 Jul 2007 06:35:55 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[INAP]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://anthologyoi.com/asides/php-classes-happy-javascript-classes-pull-your-hair-out.html</guid>
		<description><![CDATA[As mentioned previously I have been trying to move INAP away from a simply function based system to a class based system. The PHP was unbelievably easy to convert. It literally took a couple hours to convert the entire program &#8230; <a href="http://anthologyoi.com/blogish/asides/php-classes-happy-javascript-classes-pull-your-hair-out.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As mentioned previously I have been trying to move INAP away from a simply function based system to a class based system. The PHP was unbelievably easy to convert. It literally took a couple hours to convert the entire program from prefixed functions to nice, neat and easy-to-read classes. It was rolled out with a few bugfixes and very little stress.</p>
<p>Then I started to do the same to Javascript, so the plugin could clarify its variables and functions and still &#8220;play nice,&#8221; and I swear the all the Javascript was specifically coded to make it difficult. Getting all the variables alone to be readable where and when they needed to be was bad by itself, throw on top of it some of the bad coding style that has just perpetuated itself over the past year in the scripts and the fact that Javascript doesn&#8217;t have <em>real</em> classes.</p>
<p>Oh well, I think switching over to Javascript design patterns will be worth it in the long run. I just wish that Javascript had real classes like PHP, so you didn&#8217;t have to fake it so much.</p>
]]></content:encoded>
			<wfw:commentRss>http://anthologyoi.com/blogish/asides/php-classes-happy-javascript-classes-pull-your-hair-out.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adsense Creator</title>
		<link>http://anthologyoi.com/blogish/catch-all/adsense-creator.html</link>
		<comments>http://anthologyoi.com/blogish/catch-all/adsense-creator.html#comments</comments>
		<pubDate>Fri, 16 Feb 2007 01:32:33 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Catch-All]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://anthologyoi.com/catch-all/adsense-creator.html</guid>
		<description><![CDATA[<p>This creator makes it painlessly simple for you to adjust your adsense ads.  Just select the options you want, and once you are done adjusting the adsense code the creator will update your code and you can move on with life. The creator includes an advanced color picker to make it easy for you to pick just the right color. Originally, I made the following creator for my Wordpress Adsense widget; however, I decided that it was being wasted, and I wanted to see if I could make Wordpress pages behave as real HTML files, so this became a one-day project to get it working.</p>

<em>There are a few things that don't work correctly when viewing this in a category. Please click the title to go to the full page.</em> <a href="http://anthologyoi.com/blogish/catch-all/adsense-creator.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This creator makes it painlessly simple for you to adjust your adsense ads.  Just select the options you want, and once you are done adjusting the adsense code the creator will update your code and you can move on with life. The creator includes an advanced color picker to make it easy for you to pick just the right color. Originally, I made the following creator for my WordPress Adsense widget; however, I decided that it was being wasted, and I wanted to see if I could make WordPress pages behave as real HTML files, so this became a one-day project to get it working.</p>
<p><b>A few Preliminary Questions</b>:</p>
<p><label for="max_ad-frame">Will these ads be on a framed page?</label> Yes<br />
<input type="radio" id="max_ad-frame" name="max_ad-frame" value="1"  /> No<br />
<input type="radio" id="max_ad-frame" name="max_ad-frame" checked="checked" value="0" /></p>
<p><label for="max_ad-user_id">What is your ad client number?<br />
<input style="width: 150px;" id="max_ad-user_id" name="max_ad-user_id" type="text" value="pub-" /></label></p>
<p><label for="max_ad-channel_id">What channel id do you want (optional)?<br />
<input style="width: 150px;" id="max_ad-channel_id" name="max_ad-channel_id" type="text" value="" /></label></p>
<p><label for="max_ad-alt">What Alternate Ads should I use?</label> Public Service<br />
<input type="radio" id="max_ad-alt" name="max_ad-alt" checked="checked" onchange="show('none')" value="0" /> Another Ad Url<br />
<input type="radio" id="max_ad-alt" name="max_ad-alt" onchange="show('url')" value="1" /> Block Of color<br />
<input type="radio" id="max_ad-alt" name="max_ad-alt"  onchange="show('color')" value="2" /></p>
<p>	<b>Now onto the basics:</b></p>
<p><label for="max_ad-type">What type of Ads should I use?</label></p>
<p><strong>Ad Boxes</strong>:Text<br />
<input type="radio" id="max_ad-type" name="max_ad-type" onchange="show('ad_boxes')" value="text" /> Text and Image<br />
<input type="radio" id="max_ad-type" name="max_ad-type" onchange="show('ad_boxes')" value="both" /> Image<br />
<input type="radio" id="max_ad-type" name="max_ad-type"  onchange="show('ad_boxes')" value="image" /></p>
<p><strong>Link Units</strong>5 links<br />
<input type="radio" id="max_ad-type" name="max_ad-type" checked="checked" onchange="show('link_boxes')" value="5link" /> 4 links<br />
<input type="radio" id="max_ad-type" name="max_ad-type"  onchange="show('link_boxes')" value="4link" /></p>
<p id="size"><label for="max_ad-size">Pick your ad size (width x height):<br />
<select id="max_ad-size" name ="max_ad-size">
<option value="120x600">120&#215;600</option>
<option value="160x600">160&#215;600</option>
<option value="120x240" selected="selected">120&#215;240</option>
<option value="125x125">125&#215;125</option>
<option value="300x250">300&#215;250</option>
<option value="250x250">250&#215;250</option>
<option value="336x280">336&#215;280</option>
<option value="180x150">180&#215;150</option>
<option value="728x90">728&#215;90</option>
<option value="468x60">468&#215;60</option>
<option value="234x60">234&#215;60</option>
</select>
<p></label></p>
<p><label for="max_ad-alt_url">Alternate URL:<br />
<input style="width: 150px;" id="max_ad-alt_url" name="max_ad-alt_url" type="text" disabled="disabled" value="" /></label></p>
<p>	<b>Now let&#8217;s style your ads:</b></p>
<p><label for="max_ad-border_color">Border Color:</label><br />
<input style="width: 75px;" id="max_ad-border_color" name="max_ad-border_color" type="text" value="" /><a href="javascript:send_hex('max_ad-border_color')">Copy Color To Picker</a></p>
<p><label for="max_ad-bg_color">BG Color:</label><br />
<input style="width: 75px;" id="max_ad-bg_color" name="max_ad-bg_color" type="text" value="" /><a href="javascript:send_hex('max_ad-bg_color')">Copy Color To Picker</a></p>
<p><label for="max_ad-link_color">Link Color:</label><br />
<input style="width: 75px;" id="max_ad-link_color" name="max_ad-link_color" type="text" value="" /><a href="javascript:send_hex('max_ad-link_color')">Copy Color To Picker</a></p>
<p><label for="max_ad-text_color">Text Color:</label><br />
<input style="width: 75px;" id="max_ad-text_color" name="max_ad-text_color" type="text" value="" /><a href="javascript:send_hex('max_ad-text_color')">Copy Color To Picker</a></p>
<p><label for="max_ad-url_color">URL Color:</label><br />
<input style="width: 75px;" id="max_ad-url_color" name="max_ad-url_color" type="text" value="" /><a href="javascript:send_hex('max_ad-url_color')">Copy Color To Picker</a></p>
<p><label for="max_ad-alt_color">Alternate Color (optional):</label><br />
<input style="width: 75px;" id="max_ad-alt_color" name="max_ad-alt_color" disabled="disabled" type="text" value=""  /><a href="javascript:send_hex('max_ad-alt_color')">Copy Color To Picker</a></p>
<p>To easily pick a color use the following color pickers. The second picker sends the selected color to the first for adjustment</p>
<table id="color_picker">
<tr>
<td>Color</td>
<td>Value</td>
<td>Increase slow</td>
<td>Increase Fast</td>
<td>Decrease Fast</td>
<td>Decrease Slow</td>
</tr>
<tr>
<td align="right">Red:</td>
<td>
<input size="5" id="color_red" value="127" onchange="update_bg();" type="text"/></td>
<td><a href="#" onmouseover="count('color_red','go','up',70)" onmouseout="count('color_red','stop','up',70)">More Red</a></td>
<td><a href="#" onmouseover="count('color_red','go','up',20)" onmouseout="count('color_red','stop','up',20)">More Red</a></td>
<td><a href="#" onmouseover="count('color_red','go','down',20)" onmouseout="count('color_red','stop','down',20)">Less Red</a></td>
<td><a href="#" onmouseover="count('color_red','go','down',70)" onmouseout="count('color_red','stop','down',70)">Less Red</a></td>
</tr>
<tr>
<td align="right">Green:</td>
<td>
<input size="5" id="color_green" value="127" onchange="update_bg();" type="text"/></td>
<td><a href="#" onmouseover="count('color_green','go','up',70)" onmouseout="count('color_green','stop','up',70)">More Green</a></td>
<td><a href="#" onmouseover="count('color_green','go','up',20)" onmouseout="count('color_green','stop','up',20)">More Green</a></td>
<td><a href="#" onmouseover="count('color_green','go','down',20)" onmouseout="count('color_green','stop','down',20)">Less Green</a></td>
<td><a href="#" onmouseover="count('color_green','go','down',70)" onmouseout="count('color_green','stop','down',70)">Less Green</a></td>
</tr>
<tr>
<td align="right">Blue:</td>
<td>
<input size="5" id="color_blue" value="127" onchange="update_bg();" onkeyup="update_bg();" type="text"/></td>
<td><a href="#" onmouseover="count('color_blue','go','up',70)" onmouseout="count('color_blue','stop','up',70)">More Blue</a></td>
<td><a href="#" onmouseover="count('color_blue','go','up',20)" onmouseout="count('color_blue','stop','up',20)">More Blue</a></td>
<td><a href="#" onmouseover="count('color_blue','go','down',20)" onmouseout="count('color_blue','stop','down',20)">Less Blue</a></td>
<td><a href="#" onmouseover="count('color_blue','go','down',70)" onmouseout="count('color_blue','stop','down',70)">Less Blue</a></td>
</tr>
<tr>
<td colspan ="6">Hex value: #<br />
<input size="7" id="color_hex" value="127" onchange="set_hex(document.getElementById('color_hex').value);" type="text"/></td>
</tr>
</table>
<table border="0" cellpadding="1" cellspacing="1">
<tr>
<td><a style="background: rgb(0, 0, 0) none repeat scroll 0%; " title="#000000" href="javascript:setColor('000000');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(51, 51, 51) none repeat scroll 0%;" title="#333333" href="javascript:setColor('333333');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(102, 102, 102) none repeat scroll 0%;  " title="#666666" href="javascript:setColor('666666');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(136, 136, 136) none repeat scroll 0%; color: rgb(136, 136, 136); " title="#888888" href="javascript:setColor('888888');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(153, 153, 153) none repeat scroll 0%;color: rgb(153, 153, 153); " title="#999999" href="javascript:setColor('999999');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(170, 170, 170) none repeat scroll 0%;color: rgb(170, 170, 170); " title="#AAAAAA" href="javascript:setColor('AAAAAA');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(204, 204, 204) none repeat scroll 0%;color: rgb(204, 204, 204); " title="#CCCCCC" href="javascript:setColor('CCCCCC');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(238, 238, 238) none repeat scroll 0%;color: rgb(238, 238, 238); " title="#EEEEEE" href="javascript:setColor('EEEEEE');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 255, 255) none repeat scroll 0%;color: rgb(255, 255, 255); " title="#FFFFFF" href="javascript:setColor('FFFFFF');">&nbsp;&nbsp;&nbsp;</a></td>
</tr>
<tr>
<td><a style="background: rgb(0, 0, 51) none repeat scroll 0%;color: rgb(0, 0, 51); " title="#000033" href="javascript:setColor('000033');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 0, 102) none repeat scroll 0%;color: rgb(0, 0, 102); " title="#000066" href="javascript:setColor('000066');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 0, 153) none repeat scroll 0%;color: rgb(0, 0, 153); " title="#000099" href="javascript:setColor('000099');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 0, 204) none repeat scroll 0%;color: rgb(0, 0, 204); " title="#0000CC" href="javascript:setColor('0000CC');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 0, 255) none repeat scroll 0%;color: rgb(0, 0, 255); " title="#0000FF" href="javascript:setColor('0000FF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(51, 51, 255) none repeat scroll 0%;color: rgb(51, 51, 255); " title="#3333FF" href="javascript:setColor('3333FF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(102, 102, 255) none repeat scroll 0%;color: rgb(102, 102, 255); " title="#6666FF" href="javascript:setColor('6666FF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(153, 153, 255) none repeat scroll 0%;color: rgb(153, 153, 255); " title="#9999FF" href="javascript:setColor('9999FF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(204, 204, 255) none repeat scroll 0%;color: rgb(204, 204, 255); " title="#CCCCFF" href="javascript:setColor('CCCCFF');">&nbsp;&nbsp;&nbsp;</a></td>
</tr>
<tr>
<td><a style="background: rgb(0, 51, 0) none repeat scroll 0%;color: rgb(0, 51, 0); " title="#003300" href="javascript:setColor('003300');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 102, 0) none repeat scroll 0%;color: rgb(0, 102, 0); " title="#006600" href="javascript:setColor('006600');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 153, 0) none repeat scroll 0%;color: rgb(0, 153, 0); " title="#009900" href="javascript:setColor('009900');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 204, 0) none repeat scroll 0%;color: rgb(0, 204, 0); " title="#00CC00" href="javascript:setColor('00CC00');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 255, 0) none repeat scroll 0%;color: rgb(0, 255, 0); " title="#00FF00" href="javascript:setColor('00FF00');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(51, 255, 51) none repeat scroll 0%;color: rgb(51, 255, 51); " title="#33FF33" href="javascript:setColor('33FF33');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(102, 255, 102) none repeat scroll 0%;color: rgb(102, 255, 102); " title="#66FF66" href="javascript:setColor('66FF66');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(153, 255, 153) none repeat scroll 0%;color: rgb(153, 255, 153); " title="#99FF99" href="javascript:setColor('99FF99');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(204, 255, 204) none repeat scroll 0%;color: rgb(204, 255, 204); " title="#CCFFCC" href="javascript:setColor('CCFFCC');">&nbsp;&nbsp;&nbsp;</a></td>
</tr>
<tr>
<td><a style="background: rgb(51, 0, 0) none repeat scroll 0%;color: rgb(51, 0, 0); " title="#330000" href="javascript:setColor('330000');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(102, 0, 0) none repeat scroll 0%;color: rgb(102, 0, 0); " title="#660000" href="javascript:setColor('660000');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(153, 0, 0) none repeat scroll 0%;color: rgb(153, 0, 0); " title="#990000" href="javascript:setColor('990000');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(204, 0, 0) none repeat scroll 0%;color: rgb(204, 0, 0); " title="#CC0000" href="javascript:setColor('CC0000');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 0, 0) none repeat scroll 0%;color: rgb(255, 0, 0); " title="#FF0000" href="javascript:setColor('FF0000');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 51, 51) none repeat scroll 0%;color: rgb(255, 51, 51); " title="#FF3333" href="javascript:setColor('FF3333');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 102, 102) none repeat scroll 0%;color: rgb(255, 102, 102); " title="#FF6666" href="javascript:setColor('FF6666');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 153, 153) none repeat scroll 0%;color: rgb(255, 153, 153); " title="#FF9999" href="javascript:setColor('FF9999');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 204, 204) none repeat scroll 0%;color: rgb(255, 204, 204); " title="#FFCCCC" href="javascript:setColor('FFCCCC');">&nbsp;&nbsp;&nbsp;</a></td>
</tr>
<tr>
<td><a style="background: rgb(51, 51, 0) none repeat scroll 0%;color: rgb(51, 51, 0); " title="#333300" href="javascript:setColor('333300');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(102, 102, 0) none repeat scroll 0%;color: rgb(102, 102, 0); " title="#666600" href="javascript:setColor('666600');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(153, 153, 0) none repeat scroll 0%;color: rgb(153, 153, 0); " title="#999900" href="javascript:setColor('999900');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(204, 204, 0) none repeat scroll 0%;color: rgb(204, 204, 0); " title="#CCCC00" href="javascript:setColor('CCCC00');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 255, 0) none repeat scroll 0%;color: rgb(255, 255, 0); " title="#FFFF00" href="javascript:setColor('FFFF00');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 255, 51) none repeat scroll 0%;color: rgb(255, 255, 51); " title="#FFFF33" href="javascript:setColor('FFFF33');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 255, 102) none repeat scroll 0%;color: rgb(255, 255, 102); " title="#FFFF66" href="javascript:setColor('FFFF66');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 255, 153) none repeat scroll 0%;color: rgb(255, 255, 153); " title="#FFFF99" href="javascript:setColor('FFFF99');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 255, 204) none repeat scroll 0%;color: rgb(255, 255, 204); " title="#FFFFCC" href="javascript:setColor('FFFFCC');">&nbsp;&nbsp;&nbsp;</a></td>
</tr>
<tr>
<td><a style="background: rgb(0, 51, 51) none repeat scroll 0%;color: rgb(0, 51, 51); " title="#003333" href="javascript:setColor('003333');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 102, 102) none repeat scroll 0%;color: rgb(0, 102, 102); " title="#006666" href="javascript:setColor('006666');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 153, 153) none repeat scroll 0%;color: rgb(0, 153, 153); " title="#009999" href="javascript:setColor('009999');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 204, 204) none repeat scroll 0%;color: rgb(0, 204, 204); " title="#00CCCC" href="javascript:setColor('00CCCC');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(0, 255, 255) none repeat scroll 0%;color: rgb(0, 255, 255); " title="#00FFFF" href="javascript:setColor('00FFFF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(51, 255, 255) none repeat scroll 0%;color: rgb(51, 255, 255); " title="#33FFFF" href="javascript:setColor('33FFFF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(102, 255, 255) none repeat scroll 0%;color: rgb(102, 255, 255); " title="#66FFFF" href="javascript:setColor('66FFFF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(153, 255, 255) none repeat scroll 0%;color: rgb(153, 255, 255); " title="#99FFFF" href="javascript:setColor('99FFFF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(204, 255, 255) none repeat scroll 0%;color: rgb(204, 255, 255); " title="#CCFFFF" href="javascript:setColor('CCFFFF');">&nbsp;&nbsp;&nbsp;</a></td>
</tr>
<tr>
<td><a style="background: rgb(51, 0, 51) none repeat scroll 0%;color: rgb(51, 0, 51); " title="#330033" href="javascript:setColor('330033');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(102, 0, 102) none repeat scroll 0%;color: rgb(102, 0, 102); " title="#660066" href="javascript:setColor('660066');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(153, 0, 153) none repeat scroll 0%;color: rgb(153, 0, 153); " title="#990099" href="javascript:setColor('990099');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(204, 0, 204) none repeat scroll 0%;color: rgb(204, 0, 204); " title="#CC00CC" href="javascript:setColor('CC00CC');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 0, 255) none repeat scroll 0%; " title="#FF00FF" href="javascript:setColor('FF00FF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 51, 255) none repeat scroll 0%;color: rgb(255, 51, 255); " title="#FF33FF" href="javascript:setColor('FF33FF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 102, 255) none repeat scroll 0%; " title="#FF66FF" href="javascript:setColor('FF66FF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 153, 255) " title="#FF99FF" href="javascript:setColor('FF99FF');">&nbsp;&nbsp;&nbsp;</a></td>
<td><a style="background: rgb(255, 204, 255) none repeat scroll 0%;" title="#FFCCFF" href="javascript:setColor('FFCCFF');">&nbsp;&nbsp;&nbsp;</a></td>
</tr>
</table>
<p><a  title="Click to update" href="javascript:rebuild();">Click to update Adcode</a><br />
<textarea id="adcode" style="width:100%; height:300px;"></textarea></p>
]]></content:encoded>
			<wfw:commentRss>http://anthologyoi.com/blogish/catch-all/adsense-creator.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

