<?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>techrageo.us &#187; Web design</title>
	<atom:link href="http://techrageo.us/taxonomy/categories/web-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://techrageo.us</link>
	<description>insight on technology</description>
	<lastBuildDate>Sun, 30 May 2010 14:29:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Communicating Charts with Flex</title>
		<link>http://techrageo.us/2007/06/19/communicating-charts-with-flex/</link>
		<comments>http://techrageo.us/2007/06/19/communicating-charts-with-flex/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 08:59:46 +0000</pubDate>
		<dc:creator>grant</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web design]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://techrageo.us/2007/06/19/communicating-charts-with-flex/</guid>
		<description><![CDATA[Getting started Creating graphs with Adobe&#8217;s Flex 2 is a pretty simple task, just throw together some short XML and you&#8217;re done. But like most &#8220;easy&#8221; technologies things get a little more difficult when you want to do more advanced things like making sections of the graphs stand out or keeping multiple graphs in sync [...]]]></description>
			<content:encoded><![CDATA[<h3>Getting started</h3>
<p>Creating graphs with <a href="http://www.adobe.com/products/flex/">Adobe&#8217;s Flex 2</a> is a pretty simple task, just throw together some short XML and you&#8217;re done.  But like most &#8220;easy&#8221; technologies things get a little more difficult when you want to do more advanced things like making sections of the graphs stand out or keeping multiple graphs in sync with one another.  In this tutorial I will take you through how to give your graphs a little more &#8220;flash&#8221; and how to make things happen in one graph when you click on another graph.</p>
<p>If you haven&#8217;t already you can <a href="http://www.adobe.com/products/flex/">download the free Flex 2 SDK from Adobe</a>. And you can <a href="http://www.adobe.com/products/flex/charting/">download a free trial of the Flex 2 charting library</a>.</p>
<p>In your favorite text editor (<a href="http://www.eclipse.org/">Eclipse</a> anyone?) start a new file and start with some basic code:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;*&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:local</span>=<span style="color: #ff0000;">&quot;*&quot;</span> <span style="color: #000066;">xmlns:view</span>=<span style="color: #ff0000;">&quot;view.*&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">    import mx.collections.ArrayCollection;</span>
&nbsp;
<span style="color: #339933;">    [Bindable]</span>
<span style="color: #339933;">    private var profitPeriods:ArrayCollection = new ArrayCollection( [</span>
<span style="color: #339933;">    { period: &quot;Qtr1 2006&quot;, profit: 32 },</span>
<span style="color: #339933;">    { period: &quot;Qtr2 2006&quot;, profit: 47 },</span>
<span style="color: #339933;">    { period: &quot;Qtr3 2006&quot;, profit: 62 },</span>
<span style="color: #339933;">    { period: &quot;Qtr4 2006&quot;, profit: 35 },</span>
<span style="color: #339933;">    { period: &quot;Qtr1 2007&quot;, profit: 25 },</span>
<span style="color: #339933;">    { period: &quot;Qtr2 2007&quot;, profit: 55 } ]);</span>
<span style="color: #339933;">  ]]&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Panel</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Profit By Period&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:PieChart</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;profitPie&quot;</span> <span style="color: #000066;">dataProvider</span>=<span style="color: #ff0000;">&quot;{profitPeriods}&quot;</span> <span style="color: #000066;">showDataTips</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:series<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:PieSeries</span> <span style="color: #000066;">field</span>=<span style="color: #ff0000;">&quot;profit&quot;</span> <span style="color: #000066;">nameField</span>=<span style="color: #ff0000;">&quot;period&quot;</span> <span style="color: #000066;">labelPosition</span>=<span style="color: #ff0000;">&quot;callout&quot;</span> <span style="color: #000066;">showDataEffect</span>=<span style="color: #ff0000;">&quot;{interpolate}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:series<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:PieChart<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Panel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Getting more advanced</h3>
<p>This code basically creates a sample dataset and a pie chart to display it.  Nothing fancy and if we were using an XML feed we wouldn&#8217;t have any need for ActionScript at all, since we are only using it to create the data in this example.</p>
<p>Now let&#8217;s say that your customer (or boss) wants to have the data shown in multiple ways.  For our example let&#8217;s say that he wants to see a pie graph, a bar graph and a data grid.  So he can see the data in whatever way he wants to.  No problem there, throwing another chart and grid on the page is just a few more lines of xml, but what if they are to interact?  Say your boss wants to be able to click on a piece of the pie chart and have the same record highlighted in the pie chart, the column chart and the data grid.  Now we&#8217;re going to have to whip out the ActionScript.</p>
<p>We are going to need three methods, one to highlight the pie graph, one for the column chart and a final one for the data grid.  Then we can call all three of these methods whenever a chart or grid is clicked on.  We are using three methods instead of just one giant method in case we ever want to use them again, in a different circumstance.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">DisplayObject</span>;  <span style="color: #808080; font-style: italic;">//The items in the column chart are DisplayObjects</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> prevSelectedColumn:DisplayObject;
<span style="color: #808080; font-style: italic;">/*
We want to be able to &quot;unhighlight&quot; whatever column we highlighted last time, so
we'll create a variable to keep it simple. If you are using a graph with
multiple datasets then you'll obviously want to loop through them and reset them
that way instead of using this method.
*/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*
* This function will highlight a column/bar in a column/bar chart
* @param barName  The name/id of the bar/column chart
* @param barIndex The position of the column you want to highlight
*/</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> barHighlight<span style="color: #66cc66;">&#40;</span> barName:<span style="color: #0066CC;">String</span>, barIndex:<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>prevSelectedColumn<span style="color: #66cc66;">&#41;</span>  <span style="color: #808080; font-style: italic;">//If we selected something before, unselect it:</span>
  <span style="color: #66cc66;">&#123;</span>
    prevSelectedColumn.<span style="color: #006600;">alpha</span> = .8;
    prevSelectedColumn.<span style="color: #006600;">filters</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;  <span style="color: #808080; font-style: italic;">//remove the filters</span>
  <span style="color: #66cc66;">&#125;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">//This gets the individual column that we are looking for</span>
  prevSelectedColumn = <span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#91;</span>barName<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">series</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">getChildAt</span><span style="color: #66cc66;">&#40;</span> barIndex <span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>prevSelectedColumn<span style="color: #66cc66;">&#41;</span>  <span style="color: #808080; font-style: italic;">//highlight the new column:</span>
  <span style="color: #66cc66;">&#123;</span>
    prevSelectedColumn.<span style="color: #006600;">alpha</span> = <span style="color: #cc66cc;">1</span>;
    prevSelectedColumn.<span style="color: #006600;">filters</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #000000; font-weight: bold;">new</span> GlowFilter<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> DropShadowFilter<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*
* This function will highlight a row in a data grid
* @param dataGridName The name of the data grid that contains the row to highlight
* @param rowIndex   The position of the row in the grid to highlight
*/</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> rowHighlight<span style="color: #66cc66;">&#40;</span> dataGridName:<span style="color: #0066CC;">String</span>, rowIndex:<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">&#41;</span>: <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#91;</span>dataGridName<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">selectedIndex</span> = rowIndex;  <span style="color: #808080; font-style: italic;">//the easy one...</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*
* This function &quot;explodes&quot; a piece of pie from a pie chart
* @param pieName  The name of the pie chart that is to be modified
* @param pieIndex The index of the pie piece that is to be modified
*/</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> pieHighlight<span style="color: #66cc66;">&#40;</span> pieName:<span style="color: #0066CC;">String</span>, pieIndex:<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">var</span> explodeData:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;  <span style="color: #808080; font-style: italic;">//create an empty array</span>
  explodeData<span style="color: #66cc66;">&#91;</span> pieIndex <span style="color: #66cc66;">&#93;</span> = <span style="color: #cc66cc;">0.15</span>; <span style="color: #808080; font-style: italic;">//Set the index of our pie piece to &gt; 0</span>
  <span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#91;</span>pieName<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">series</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">perWedgeExplodeRadius</span> = explodeData;
  <span style="color: #808080; font-style: italic;">/*
  The pie's wedges can be &quot;exploded&quot; outward to highlight them. The amount is
  controlled by an array, so we just create a empty array (which would set
  everything to no padding) and add padding for the index that is to be
  highlighted. This has the added bonus of un-highlighting the piece that was last
  highlighted (if any). Sweet!
  */</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h3>Adding events</h3>
<p>Of course, this is using inline ActionScript.  If you want to separate it into another file you&#8217;ll have to use &#8220;Application.application&#8221; instead of &#8220;this&#8221; (see the downloadable GraphHighlighting.as file below).  That should give us a snazzy little effect every time we click on an item in any of the charts or in the grid.   But they won&#8217;t be doing any effects unless we add event handlers to our objects.  Let&#8217;s do that now.</p>
<p>So change the xml for your pie chart and add this to the PieChart tag:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">itemClick=<span style="color: #ff0000;">&quot;pieChartClick(event, 'profitGrid', 'profitBar');&quot;</span></pre></div></div>

<p>And then you can add the ActionScript to handle that event (which, of course, will call our handy three functions):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
* This is run when the pie chart is clicked on
* @param event    The click event
* @param dataGridName The string name of the data grid that should be highlighted
* @param barName  The string name of the column chart that should be highlighted
*/</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> pieChartClick<span style="color: #66cc66;">&#40;</span> event:ChartItemEvent, dataGridName:<span style="color: #0066CC;">String</span>, barName:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
  pieHighlight<span style="color: #66cc66;">&#40;</span> event.<span style="color: #006600;">currentTarget</span>.<span style="color: #006600;">id</span> , event.<span style="color: #006600;">hitData</span>.<span style="color: #006600;">chartItem</span>.<span style="color: #0066CC;">index</span> <span style="color: #66cc66;">&#41;</span>;
  rowHighlight<span style="color: #66cc66;">&#40;</span> dataGridName, event.<span style="color: #006600;">hitData</span>.<span style="color: #006600;">chartItem</span>.<span style="color: #0066CC;">index</span><span style="color: #66cc66;">&#41;</span>;
  barHighlight<span style="color: #66cc66;">&#40;</span> barName, event.<span style="color: #006600;">hitData</span>.<span style="color: #006600;">chartItem</span>.<span style="color: #0066CC;">index</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Then do this for the other chart and the datagrid and you&#8217;ll be set.</p>
<h3>Conclusion and downloads</h3>
<p>So, if you did your calculations correctly, remembered to carry the one and crossed your fingers you probably ended up with something like this:</p>
<div style="width: 490px">
<object width="480" height="480" codebase="http://active.macromedia.com/flash7/cabs/ swflash.cab#version=9,0,0,0"><param name="src" value="http://www.techrageo.us/code/communicateflex/Chart.swf"><param name="quality" value="high"><embed src="http://www.techrageo.us/code/communicateflex/Chart.swf" width="480" height="480" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object>
</div>
<p>Actually, it probably won&#8217;t look like that, but the sample code download does (see below).</p>
<p>It is more likely that you&#8217;ll probably be making the charts communicate using different data (click on one part of a chart and get detailed information in another chart), but this should at least get you started in the right direction.</p>
<p>Download the <a href="http://techrageo.us/code/communicateflex/Chart.mxml">complete inline ActionScript example</a>: This file is the complete example and you should be able to save it and compile it with the mxml compiler that came with the Flex 2 SDK (assuming you have the charting library, or the charting trial library).</p>
<p>Download the <a href="http://techrageo.us/code/communicateflex/GraphHighlighting.as">&#8220;external&#8221; ActionScript methods</a>: This file is what you can use if you want to keep these functions in your library for future use.  I put this in the FlexAS.GraphHighlighting package, so if you don&#8217;t change the package name you should put this into a &#8220;FlexAS/GraphHighlighting/&#8221; subfolder off of your main flex directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://techrageo.us/2007/06/19/communicating-charts-with-flex/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Gmail Super Clean Greasemonkey Script</title>
		<link>http://techrageo.us/2007/04/23/gmail-super-clean-greasemonkey-script/</link>
		<comments>http://techrageo.us/2007/04/23/gmail-super-clean-greasemonkey-script/#comments</comments>
		<pubDate>Mon, 23 Apr 2007 11:13:22 +0000</pubDate>
		<dc:creator>bill</dc:creator>
				<category><![CDATA[Free]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://techrageo.us/2007/04/23/gmail-super-clean-greasemonkey-script/</guid>
		<description><![CDATA[Customize Gmail Gmail Super Clean is a Greasemonkey script that renders a cleaner Gmail experience. Aside from the snazzy white interface, it removes the Gmail bookmark links, AdSense ads, tweaks the fonts, and slaps a groovy icon up top. Gmail Super Clean Options What&#8217;s more, under Tools-&#62;Greasemonkey-&#62;UserScript Commands, there are options to enable and disable [...]]]></description>
			<content:encoded><![CDATA[<h3>Customize Gmail</h3>
<p><a href="http://userscripts.org/scripts/show/7646">Gmail Super Clean</a> is a <a href="http://www.greasespot.net/">Greasemonkey</a> script that renders a cleaner Gmail experience. Aside from the snazzy white interface, it removes the Gmail bookmark links, AdSense ads, tweaks the fonts, and slaps a groovy icon up top.</p>
<h3>Gmail Super Clean Options</h3>
<p>What&#8217;s more, under Tools-&gt;Greasemonkey-&gt;UserScript Commands, there are options to enable and disable the custom logo, the ads, the Google account bookmarks, change the font and font size. It even gives you the option to use a custom logo image.</p>
<p><img src="/images/gmailsupercleansm.jpg"/></p>
<p>Of course, Firefox only, and you must have Greasemonkey installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://techrageo.us/2007/04/23/gmail-super-clean-greasemonkey-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP and WordPress SVG Basics</title>
		<link>http://techrageo.us/2007/04/07/php-and-wordpress-svg-basics/</link>
		<comments>http://techrageo.us/2007/04/07/php-and-wordpress-svg-basics/#comments</comments>
		<pubDate>Sun, 08 Apr 2007 01:54:58 +0000</pubDate>
		<dc:creator>bill</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Web design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://techrageo.us/2007/04/07/php-and-wordpress-svg-basics/</guid>
		<description><![CDATA[Scalable Vector Graphics, or SVG, is an XML standard for vector graphics (of course). That means that it contains descriptions of shapes, such as rectangles, lines, circles, and text, in an XML format. SVG provides a robust definition language for drawings. The drawing at the right was a sample SVG drawing included in Jasc&#8217;s WebDraw. [...]]]></description>
			<content:encoded><![CDATA[<p><img align="right" src="/wp-content/code/svgbutterfly.jpg"/>Scalable Vector Graphics, or SVG, is an XML standard for vector graphics (of course). That means that it contains descriptions of shapes, such as rectangles, lines, circles, and text, in an XML format.</p>
<p>SVG provides a robust definition language for drawings. The drawing at the right was a sample SVG drawing included in Jasc&#8217;s WebDraw. There are many other examples on the web of complex SVG drawings.</p>
<p>I&#8217;ve been playing around with SVG just a bit and thought I&#8217;d record the basics of getting simple shapes embedded in a page and how to do it with PHP and in WordPress.</p>
<p>Grant posted an article here a couple years ago on creating <a href="http://techrageo.us/2005/06/22/svg-graphs-with-php/">SVG Graphs With PHP</a>, so check that out too if you want a more complicated example.</p>
<h3>SVG in HTML</h3>
<p>The simplest way to get SVG vector drawings in an HTML file is to embed an .svg file. The HTML and SVG source will look something like the following</p>
<p><strong>HTML Code</strong><br />
<code><br />
&lt;html&gt;<br />
&lt;body&gt;<br />
Circle In A Square&lt;br/&gt;<br />
&lt;embed width="100" height="100" src="/wp-content/code/phpsvg1.svg"/&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></p>
<p><strong>SVG Code</strong><br />
<code><br />
&lt;?xml version="1.0"?&gt;<br />
&lt;svg width="100px" height="100px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"&gt;<br />
	&lt;rect x="10" y="10" width="50" height="50"<br />
		fill="#777" stroke="red" stroke-width="3"  /&gt;<br />
	&lt;circle cx="16" cy="16" r="8" fill="black" stroke="yellow" stroke-width="3"/&gt;<br />
&lt;/svg&gt;<br />
</code></p>
<p><strong>Output</strong></p>
<p>Circle In A Square<br />
<embed width="100" height="100" src="/wp-content/code/phpsvg1.svg"/></p>
<h3>WordPress and SVG</h3>
<p>To include an SVG drawing in a WordPress post, simply create and upload an SVG file then put the HTML EMBED tag in your WordPress post.<br />
<code><br />
&lt;embed width="100" height="100" src="/wp-content/code/phpsvg1.svg"/&gt;<br />
</code></p>
<h3>Basic SVG Tags</h3>
<p>There are plenty of exhaustive SVG references on the web, so let&#8217;s look at just the tags used above.</p>
<div style="padding-left:10px">
<p><strong>svg</strong> &#8211; This tag indicates the beginning of an SVG drawing. The attibutes used above are width and height, both self-<br />
describing, viewBox which describes a clipping rectangle for the drawing, and xmlns which simply defines the default namespace for<br />
the XML tags used in the drawing.</p>
<p><strong>rect</strong> &#8211; Here we define the rectangle, with x and y being the upper-left corner, width and height again are obvious, fill<br />
is the rectangle&#8217;s color in hex digits, stroke is the color of the line used to draw the outside boundary of the rectangle, and<br />
stroke-width is the width of that line.</p>
<p><strong>circle</strong> &#8211; This defines the circle. cx and cy determine the center point of the circle, while r is the radius; fill,<br />
stroke, and stroke-width have the same meanings as was used for the rectangle.</p>
</div>
<h3>PHP SVG</h3>
<p>Of course, outputting SVG from PHP requires that you output the SVG source back to the browser. However, PHP output will normally be marked as being of <em>Content-Type: text/html</em>, so you have to do two things to send back SVG:
<ol>
<li>First, set the Content-Type header to <em>image/svg+xml</em></li>
<li>Second, make sure your php file does not contain any text outside the script tags.</li>
</ol>
<p>So, the following PHP generates the above SVG drawing.<br />
<code><br />
&lt;?php<br />
$svg = &lt;&lt;&lt;END<br />
&lt;?xml version="1.0" standalone="no"?&gt;<br />
&lt;svg width="100px" height="100px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"&gt;<br />
	&lt;rect x="10" y="10" width="50" height="50"<br />
		fill="navy" stroke="red" stroke-width="3"  /&gt;<br />
	&lt;circle cx="16" cy="16" r="8" fill="black" stroke="yellow" stroke-width="3"/&gt;<br />
&lt;/svg&gt;<br />
END;<br />
header("Content-Type: image/svg+xml");<br />
echo $svg;<br />
?&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://techrageo.us/2007/04/07/php-and-wordpress-svg-basics/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mass Comment Reply</title>
		<link>http://techrageo.us/2006/06/22/mass-comment-reply/</link>
		<comments>http://techrageo.us/2006/06/22/mass-comment-reply/#comments</comments>
		<pubDate>Thu, 22 Jun 2006 09:29:20 +0000</pubDate>
		<dc:creator>bill</dc:creator>
				<category><![CDATA[Free]]></category>
		<category><![CDATA[Site News]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://techrageo.us/2006/06/22/mass-comment-reply/</guid>
		<description><![CDATA[We get so much feedback in our comments (I mean sometimes hundreds of comments per day) that I&#8217;m just going to reply here. Sorry but I have to clip and edit some of the comments. peto4o said Best site I see. Thanks. drugs celebrate &#124; nokia 6230 camera phone &#8230; No, thank you peto40. I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>We get so much feedback in our comments (I mean sometimes hundreds of comments per day) that I&#8217;m just going to reply here. Sorry but I have to clip and edit some of the comments.</p>
<p><strong>peto4o </strong>said <em>Best site I see. Thanks. drugs celebrate | nokia 6230 camera phone  &#8230;</em></p>
<p>No, thank you peto40. I&#8217;m not sure about the rest of your comment, and boy do you have a lot of links!</p>
<p><strong>paspart </strong>said <em>Your home page its great. clonespam | renterofmine accepts cod | teen | nokia 6230 covers &#8230;</em></p>
<p>Thanks. I know we can do better, but your comment its encouragement.</p>
<p><strong>health </strong>said <em>Hi! Your site appeared very useful to me. Excellent work, thanks.</em></p>
<p>health, we are happy that we appeared useful to you. Appearance is half the battle. We&#8217;ll try to appear even better in the future!</p>
<p><strong>nikeli </strong>said <em>Your site is very cognitive. I think you will have good future.:) ibex online cheap | nokia purchase online | coding workshop ringtone converter | without | Long Term Effects | hydra boco clones | 6230 nokia | NEC VT770 without brescriptio | rumsfeld | motorola e398 &#8230;</em></p>
<p>nikeli, most people overlook the cognitive abilities of our site so it came as a pleasant surpise that you picked up on that. And thanks, I appreciate your prognostication! (I&#8217;m not sure about all those links in your comment. I didn&#8217;t have time to visit them but I&#8217;m sure they&#8217;re cognitive too.)</p>
<p><strong>cirky </strong>said <em>Great website! Bookmarked! I am impressed at your work! es | sony ericsson k300i | weight loss side effects | bird control is myban anti-happy | cheap thunder problem | Long Term Effects of Bookmarks | buy Sony suziphone| Nokia Mobile Phone | 3300 cellular nokia phone | coding ringtone converter | order my halitosis &#8230;</em></p>
<p>cirky, thanks. We try, but it&#8217;s people like you who make it worth all the effort! I&#8217;m impressed that you use Bookmarks already; it&#8217;s an upcoming technology and doesn&#8217;t have all the bugs worked out yet. Do you mind sharing your experience with Bookmarks?</p>
<p><strong>arvilkg </strong>said <em>Best site I see. Thanks. generic annex | motorola v265 phone | balirum on line | on line w/o scription | snorfling ibex | buy mine without problems | nokia unlock code | yellow | evita | troma | mature woman | nokia 3120 headset | nokia ringtones &#8230;</em></p>
<p>Thank you arvilkg, but I think you&#8217;re exagerating. We&#8217;re not above hyperbole, though. You are the greatest!</p>
<p><strong>peto4o </strong>said <em>Best site I see. Thanks. free mature | tamy has the flu | Sess Con | Men And Nature | video | alternative to Niagra | dolphin jewelry | Zaphod | cheap online troma doll | buy | Japanese Diet | well butane | swim dolphins | nokia unlocked &#8230;</em></p>
<p>peto40, you&#8217;re back! Return visitors are the lifeblood of cheap online troma dolls. Swim dolphins indeed!</p>
<p><strong>kipeto </strong>said <em>I&#8217;m really impressed! discount Bob and Alice | Niagra online | nokia 6230 | hydro chromedome | online posing | Grannies | soft tabs | motorola e398 phone &#8230;</em></p>
<p>Thank you jipeto. Thank you thank you. Tell Bob and Alice &#8220;hi&#8221; from us.</p>
<p><strong>temnota </strong>said <em>May we exchange links with your site? Nialus online | nokia 3120 data cable | Nialis | online troma doll | teen titans | SonyEricsson ringtones | dead or alive | palm treo &#8230;</em></p>
<p>temnota, Sure! Please send some information on your site and we&#8217;ll discuss it (I sure hope &#8220;dead or alive&#8221; isn&#8217;t a threat). Can you get those troma dolls?</p>
<p><strong>ppionerk </strong>said <em>I like your site discount loptochopto | cheapest Nialus | garmin street pilot | clone spam | ladies intercoursing | free ringtones for motorola | sites that ship cash on delivery | mature ibex | handiwork&#8230;</em></p>
<p>ppionerk, I&#8217;m sorry; we&#8217;re all out of the discount loptochopto, but we&#8217;ll get more in soon.</p>
<p><strong>bezdax </strong>said <em>I&#8217;m really impressed! successful stories | diaz spam | Free Pictures | Niagra for women | purchase Naliux | cheap Boris Karloff | ambling side effects | hydra chromedome | free avitar chewy | ladies parts | MP3 Ringtone Converter &#8230;</em></p>
<p>We are impressed by successful stories too. Some are really amazing. Have you heard of <a href="http://www.liddyshow.us/">Gordon Liddy</a>? Pretty amazing guy. Worked his way up, Marine, FBI, White House, etc. etc. Then he had a decent-sized scrape with the law. But, after being released from prison he has worked his way up other ladders.</p>
<p><strong>ssborni </strong>said <em>Very good site. Thanks for author! asian titmouse | axle withdrawal | celebrate side effects | hydra chromedome bit rate | Evening Attire | anime prawns | sony ericsson p800 | sharks &#8230;</em></p>
<p>ssborni, very good comment. Thanks for writer!</p>
<p><strong>pasty </strong>said <em>Your home page its great ibex bill | verizon treo | sonyericsson phones | verizon motorola v265 | night attire | pre teens ringtones | zombie ringtone motorola&#8230;</em></p>
<p>Thank you pasty ibex bill. <img src='http://techrageo.us/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>geroin </strong>siad <em>Hello Jane, great site! hydra chromedome bit rate | accessory cellular motorola review v66 | motorola v551 accessory | motorola v551 | faceplates | download ringtone | paris france&#8230;</em></p>
<p>geroin, I&#8217;m sorry but there&#8217;s no Jane here. Wrong number?</p>
<p><strong>utilize </strong>said <em>May we exchange links with your site? nokia 3120 specs | bird watching | Mr. Chewbacca | treo software | garmin forerunner 301 | ericsson | ibex online</em></p>
<p>Sure, utilize! red rover red rover! Land Cruiser FJ 4&#215;4 ! V8 Hemi Carburator Injection! Dog walking! Monkey excitement! GPS Big dog Pampilut. Elderly Monkey prawns!</p>
<p><strong>pastry </strong>said <em>Your home page its great buy in the uk | order Scion | swimming with sharks | side effects of yasmine bleethee | order ibex | order Spamax | cod liver earl | NEC HT410 | garmin ique 3600 | nec plasma tv | ringtone</em></p>
<p>pastry, thank you but we&#8217;re not for sale in the uk. US and Canada orders only.</p>
<p><strong>nikel </strong>said <em>Your site is very cognitive. I think you will have good future.:) online order | motorola v600 cellular phone | cerebus | free prawns | 30kg | yasmine bleethee | sonic animation</em></p>
<p>Thank you so much, nikel. Again. Your cognitive too.</p>
<p><strong>Sefny </strong>said <em>http://techrageo.us/, http://techrageo.us/taxonomy/categories/free, http://techrageo.us/taxonomy/categories/hardware, http://techrageo.us/taxonomy/categories/software, http://techrageo.us/taxonomy/categories/windows, http://techrageo.us/taxonomy/categories/programming/php, http://techrageo.us/taxonomy/categories/mapping, http://techrageo.us/taxonomy/categories/programming/javascript &#8230;</em></p>
<p>Sefny, thanks for the links. Something happened and I had to fix them up a bit.</p>
<p><strong>casinox </strong>said <em>health.html</em></p>
<p>No kidding. You&#8217;ve really captured it there, casinox. If you don&#8217;t have it, you&#8217;ve got nothing.</p>
<p><strong>shoppix </strong>said <em>Hello, nice site look this: dating1111.html health2222.html computers3333.html careers11111.html finance99999.html End ^) See you</em></p>
<p>shoppix, thanks for the compliment. Oh, those are nice. Where did you get them?</p>
<p><strong>Micaelel </strong>said <em>http://techrageo.us/, http://techrageo.us/taxonomy/categories/microprocessor, http://techrageo.us/taxonomy/categories/linux, http://techrageo.us/taxonomy/categories/mac, http://techrageo.us/taxonomy/categories/tips, http://techrageo.us/taxonomy/categories/best-practices, http://techrageo.us/taxonomy/categories/security, http://techrageo.us/taxonomy/categories/security/encryption&#8230;</em></p>
<p>Micaelel, thanks for the links. Something happened (again) and I had to fix them up a bit (again).</p>
<p><strong>ppionerkuh </strong>said <em>I like your site axle related injury harm | buy online | motorola v600 battery | ibex price | discount Niagra | Niagra for women | little | buy Niagra retail discount | Niagra | clonealarm anxiety | buy evita | Niagra generic</em></p>
<p>ppionerkuh, uh, okay thanks! Do you like the US or Canadian side? BTW, I think it&#8217;s &#8220;Niagara.&#8221;</p>
<p><strong>marvilk </strong>said <em>So interesting site, thanks! close up of a cat | nokia 3120 price | sonyericsson | side effects of lojack | cheap evita | misty</em></p>
<p>Thank you, marvilk. So interesting comment, thanks! <img src='http://techrageo.us/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  What kind of cats do you have?</p>
<p><strong>temnota </strong>said <em>Hello Jane, great site! cocoa | cheap Niagra purchase | asian front parts | happy monkey</em></p>
<p>Hello? No Jane here.</p>
<p><strong>paspar</strong> said <em>Your home page its great. online bug purchase evita | generic lojack | wet wild cat | marzipan | effects | bird mouse | cell motorola phone v265 | long term | shark jewelry | latest news | zombie | cheapest Niagra price&#8230;</em></p>
<p>Thanks, paspar. Those wild cats, you never know what they&#8217;re going to get into.</p>
<p><strong>Alvintard</strong> said <em>http://techrageo.us Windows url=http://techrageo.us link=http://techrageo.us</em></p>
<p>Indeed, Alvintard.</p>
<p><strong>barryc</strong> said <em>So interesting site, thanks! &#8230; &#8230;</em></p>
<p>Thank you, barryc. (Sorry but I had to cut the rest of your comment.)</p>
<p><strong>paspar</strong> said <em>I like your site generic effects handiwork | sonic hedgehog | nokia 2600 ringtone | cat macro | asian cat | nokia model 3230 | fresh cat&#8230;</em></p>
<p>Thank you, and welcome back, paspar.</p>
<p><a href="http://www.amazon.com/exec/obidos/ASIN/B000CSOXTO/mumeishi-20"><img align="right" src="http://ec3.images-amazon.com/images/P/B000CSOXTO.01._SCTHUMBZZZ_V55597774_.jpg" /></a><strong>paspar</strong> said <em>I like your site prawn gallery | ringtone | more cats | cod liver oil | garmin gps v&#8230;</em></p>
<p>paspar, you&#8217;re a regular, so you should know we don&#8217;t have a prawn gallery. Yet! Do your cats enjoy cod liver oil? Oh, the GPS V is pretty old. You should try the <a href="http://www.amazon.com/exec/obidos/ASIN/B000CSOXTO/mumeishi-20">Garmin 60CSx</a> &#8212; it&#8217;s superb.</p>
<p><strong>geroin</strong> said <em>Hello Jane, great site! 10kg | motorola v66 | cheerleaders | ringtones | ibex overnight | birds | mitsubishi | nokia | yasmine bleethee | mature prawns | motorola usb driver&#8230;</em></p>
<p>No Jane. Let me introduce you to temnota.</p>
<p><strong>Kathyann</strong> said <em>http://techrageo.us desk3 url=http://techrageo.us link=http://techrageo.us</em></p>
<p>Yes, I know.</p>
<p><strong>cicada</strong> said <em>Great website! Bookmarked! I am impressed at your work! Niagra alternatives | motorola v600 cell phone | ibex | katie holmes at home | free handiwork | modes | canadian farms&#8230;</em></p>
<p>Thanks. Bookmarks rule. I&#8217;m learning about them now!</p>
<p><strong>geroin</strong> said <em>Hello Jane, great site! teens | several ladies | free old prawn snapshots | celebarte | online farm vital | cats&#8230;</em></p>
<p>Sigh. Thank you.</p>
<p><strong>paspar</strong> said <em>I like your site motorola v551 | Free Nokia Ringtones | shark watching | nec dvd | Bottlenose Monkeys | handiwork | purchase tracadolop | nokia phone&#8230;</em></p>
<p>thanks paspar.</p>
<p><strong>perroxtox</strong> said <em>gooyeti. http://search.yahoo.com/search?p=prawns http://maps.yahoo.com/beta/index.php happy prawns free happy prawns happy prawns star black happy prawns free happy prawns movie free happy prawns video happy prawns video happy male prawns happy prawns movie happy teen prawns happy sapiens prawns happy prawns site free happy prawns pic free happy black prawns free happy prawns clip happy prawns pic happy prawns blog free happy male prawns happy asian prawns happy sax prawns hardcore happy prawns happy&#8230;</em></p>
<p>perroxtox, I don&#8217;t know what to say, except that you must love your prawns. gooyeti?</p>
<p><strong>kickatoxa</strong> said <em>I&#8217;m really impressed! lookatmine on line without description | free elderly prawn | ericsson mobile phones | milk prawns | free prawn | cartoons | girls with protusions on their noggins | extreme fishing&#8230;</em></p>
<p>kickatoxa, thank you. Impression is nine tenths, you know. Have you met perroxtox?</p>
<p><strong>paris france video</strong> said <em>hilton hotels movie. body paint big cats. prawn photo asian macro black advice. Cheerleaders striping in college.</em></p>
<p>paris france video, is the movie to sell conference space, or just marketing to folks travelling? I am not sure I understand the next sentence, but I think some of the players in Cats must have had some body paint, but mostly I&#8217;d think it was actual costumes. Closeups of prawns on a black backdrop might be okay, but make sure the lighting is right. If you&#8217;ve got asian lenses, use them; otherwise, use what you&#8217;ve got. Cheerleaders do a lot of things, but I thought striping is usually done by road crews&#8230;?</p>
<p><strong>tixbix</strong> said <em>tight bum. phantom of the opera movie. bum. music videos &#8230;</em></p>
<p>tixbix, &#8220;bums&#8221; are tight because they don&#8217;t have money. Don&#8217;t you see them asking for loose change, a buck, or all your money? It&#8217;s because they&#8217;re down on their luck and need money for booze and drugs. Instead of walking by them, next time take a &#8220;bum&#8221; to the PotO movie with you. Or put them in your music videos.</p>
<p><strong>big chest round bum</strong> said <em>big chest round bum. hollywood torture&#8230;</em></p>
<p>Hi, big chest round bum (is that like Dances With Wolves?). I agree &#8212; most of what comes out of Hollywood is torture. You can just not go see the movies and not watch them on the TV. Send a message.</p>
<p><strong>girlmode tongs</strong> said <em>girlmode tongs. cat prawn gallery magick&#8230;</em></p>
<p>girlmode tongs, do you cook? Wow, that sounds like an exciting show!</p>
<p><strong>jujucat </strong>said <em>redhead prawns rooster cats&#8230;</em></p>
<p>jujucat, that&#8217;s amazing. Thanks for sharing.</p>
<p><strong>ppioner </strong>said <em>I like your site. Granny prawn pics&#8230;</em></p>
<p>Thanks, ppioner. You should put up a flickr gallery.</p>
<p><strong>kipetoe </strong>said <em>Your home page its great. Mature Grannies&#8230;</em></p>
<p>Thank you so much, kipetoe.</p>
<p>Again, we granny really just want thank you all you folks take time comment. It mean alot to us really make it all worth it to author. Applejacks monkeyshine rascal fisherfax. Pfestive massive master tunky Enjoy!!! Cat granny dog rooster. Horse dolphonic shippy fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://techrageo.us/2006/06/22/mass-comment-reply/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating a Drag and Drop Schedule For Your Web Application</title>
		<link>http://techrageo.us/2005/08/09/creating-a-drag-and-drop-schedule-for-your-web-application/</link>
		<comments>http://techrageo.us/2005/08/09/creating-a-drag-and-drop-schedule-for-your-web-application/#comments</comments>
		<pubDate>Tue, 09 Aug 2005 19:14:29 +0000</pubDate>
		<dc:creator>grant</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://techrageo.us/?p=40</guid>
		<description><![CDATA[If you are creating a web application and you need to have the ability to schedule resources (people, machines, Precious Moments figurines, etc) it can sometimes be a cumbersome task. With this drag and drop schedule you won&#8217;t have to worry about the end user making typos in an html form and causing more trouble [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://techrageo.us/wp-content/schedule_normal_big.jpg"><img align="right" src="http://techrageo.us/wp-content/schedule_normal_small.jpg" style="border: thin solid black;" /></a></p>
<p>If you are creating a web application and you need to have the ability to schedule resources (people, machines, Precious Moments figurines, etc) it can sometimes be a cumbersome task.  With this drag and drop schedule you won&#8217;t have to worry about the end user making typos in an html form and causing more trouble for you later.</p>
<p>Let&#8217;s start off by putting the obvious header information along with some javascript variables that we will use later:</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html&gt;<br />
  &lt;head&gt;<br />
    &lt;title&gt;Test Schedule&lt;/title&gt;<br />
    &lt;script&gt;<br />
      var moving_object = &#8220;&#8221;;<br />
      var mX, mY, devX, devY;<br />
      var set_to_grid = true;<br />
      var lock_x_axis = false;<br />
      var lock_y_axis = false;<br />
      var gridX = 10;<br />
      var gridY = 10;
</p></blockquote>
<p>Next, while still in the script tag we need a function that will keep track of our mouse movements so that we know when the user is dragging an object.<br />
This function will also be responsible for moving the floating schedule objects and should be able to restrict the movement of the floating objects so that they only move horizontally or vertically (depending on your schedule type).<br />
Another nice feature would be to lock the floater to an invisible grid so that placing your object in the correct spot is easier.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
      function setCoords( e )<br />
      {<br />
        &nbsp;if( document.all )<br />
        &nbsp;{<br />
          &nbsp;&nbsp;mX = event.clientX;<br />
          &nbsp;&nbsp;mY = event.clientY;<br />
        &nbsp;}<br />
        &nbsp;else<br />
        &nbsp;{<br />
          &nbsp;&nbsp;mX = e.pageX;<br />
          &nbsp;&nbsp;mY = e.pageY;<br />
        &nbsp;}<br />
        &nbsp;if( moving_object )<br />
        &nbsp;{<br />
          &nbsp;&nbsp;if( moving_object != &#8220;&#8221; )<br />
          &nbsp;&nbsp;{<br />
            &nbsp;&nbsp;&nbsp;if( set_to_grid )<br />
            &nbsp;&nbsp;&nbsp;{<br />
              &nbsp;&nbsp;&nbsp;&nbsp;useY = parseInt( (mY &#8211; devY) / gridY) * gridY;<br />
              &nbsp;&nbsp;&nbsp;&nbsp;useX = parseInt( (mX &#8211; devX) / gridX) * gridX;<br />
            &nbsp;&nbsp;&nbsp;}<br />
            &nbsp;&nbsp;&nbsp;else<br />
            &nbsp;&nbsp;&nbsp;{<br />
              &nbsp;&nbsp;&nbsp;&nbsp;useY = mY &#8211; devY;<br />
              &nbsp;&nbsp;&nbsp;&nbsp;useX = mX &#8211; devX;<br />
            &nbsp;&nbsp;&nbsp;}<br />
            &nbsp;&nbsp;&nbsp;if( lock_y_axis == false )<br />
            &nbsp;&nbsp;&nbsp;{<br />
              &nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(moving_object).style.top = useY + &#8220;px&#8221;;<br />
            &nbsp;&nbsp;&nbsp;}</p>
<p>            &nbsp;&nbsp;&nbsp;if( lock_x_axis == false )<br />
            &nbsp;&nbsp;&nbsp;{<br />
              &nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(moving_object).style.left = useX + &#8220;px&#8221;;<br />
            &nbsp;&nbsp;&nbsp;}<br />
          &nbsp;&nbsp;}<br />
        &nbsp;}<br />
      }
</p></blockquote>
<p>We also need a function that is called when we click on the floating object that tells the <b>setCoords()</b> function some basic information, like which object is moving and if it should lock the movement in any way.<br />
This function should also bring the floating object above the rest of the objects on the page.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
      function setMover( object_id , lock_y, lock_x, use_grid )<br />
      {<br />
        &nbsp;moving_object = object_id;<br />
        &nbsp;set_to_grid = use_grid;<br />
        &nbsp;lock_x_axis = lock_x;<br />
        &nbsp;lock_y_axis = lock_y;</p>
<p>        &nbsp;if( object_id != &#8220;&#8221; )<br />
        &nbsp;{<br />
          &nbsp;&nbsp;devY = mY &#8211; parseInt( document.getElementById( moving_object ).style.top );<br />
          &nbsp;&nbsp;devX = mX &#8211; parseInt( document.getElementById( moving_object ).style.left );<br />
          &nbsp;&nbsp;document.getElementById( moving_object ).style.zIndex=99;<br />
        &nbsp;}<br />
      }
</p></blockquote>
<p>Lastly, we need a function that is called when the user &#8220;let&#8217;s go&#8221; of the floating (i.e. they dropped it).  This function basically undoes everything that <b>setMover()</b> does and moves the floating object back down with the rest of the objects.</p>
<p>If you want to get really fancy you can update a database from this function, which comes in handy if you want to automatically save the new position of your floater.  To do this just create an invisible iframe document with a form in it.  Update the form from within this function and use the form&#8217;s submit() function to send the new coordinates to the database.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
      function unSetMover( object_id )<br />
      {<br />
        &nbsp;moving_object = &#8220;&#8221;;<br />
        &nbsp;lock_x_axis = false;<br />
        &nbsp;lock_y_axis = false;<br />
        &nbsp;if( object_id != &#8220;&#8221; )<br />
        &nbsp;{<br />
          &nbsp;&nbsp;document.getElementById( object_id ).style.zIndex=10;<br />
        &nbsp;}<br />
        &nbsp;//Something like this might help you update the database:<br />
        &nbsp;//frames['hidden_iframe'].document.editform.x_coord.value = mX;<br />
        &nbsp;//frames['hidden_iframe'].document.editform.y_coord.value = mY;<br />
        &nbsp;//frames['hidden_iframe'].document.editform.submit();<br />
      }<br />
    &lt;/script&gt;<br />
  &lt;/head&gt;
</p></blockquote>
<p>The next thing our page needs is some style.  We need a class for our floater objects, for consistancy. Most of this is just fluff, the &#8216;position&#8217; is the only essential part.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
  &lt;style&gt;<br />
    .floater<br />
    {<br />
      &nbsp;z-index: 10;<br />
      &nbsp;text-align: center;<br />
      &nbsp;position: absolute;<br />
      &nbsp;border: thin solid black;<br />
    }
</p></blockquote>
<p><img align="right" src='http://techrageo.us/wp-content/schedule_transparent.jpg' alt='Transparent Hovering' style="border: thin solid black;" /><br />
It would be nice if our &#8216;floater&#8217; class did something to highlight itself when the mouse was floating over it.  It would also be nice if it became semi-transparent while it was moving over the other objects so we could see what was underneath it.   <em>(This is all fluff&#8230;you can leave this out if you want to)</em></p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
    .floater:hover<br />
    {<br />
      &nbsp;opacity: .75;<br />
      &nbsp;filter: alpha( opacity = 75 );<br />
      &nbsp;border: thin dashed blue;<br />
    }
</p></blockquote>
<p>The last part of the style is just to setup the background and x/y axis so that it resembles a schedule.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
    body<br />
    {<br />
      &nbsp;background-image: url(&#8216;images/background_time_grid.gif&#8217;);<br />
    }</p>
<p>    .axis-background, .row-background<br />
    {<br />
      &nbsp;opacity: .35;<br />
      &nbsp;filter: alpha(opacity=35);<br />
      &nbsp;position: absolute;<br />
    }<br />
    .axis-background<br />
    {<br />
      &nbsp;background-color: #aaaadd;<br />
    }<br />
    .row-background<br />
    {<br />
      &nbsp;background-color: #ddddaa;<br />
    }<br />
    .axis-label<br />
    {<br />
      &nbsp;background-color: #ffffee;<br />
      &nbsp;position: absolute;<br />
      &nbsp;text-align: center;<br />
      &nbsp;font-size: 90%;<br />
      &nbsp;border: thin solid black;<br />
    }<br />
  &lt;/style&gt;
</p></blockquote>
<p>When declaring the &#8216;body&#8217; element we need to make sure that it runs the <b>setCoords()</b> function each time the mouse moves, so we will know where the pointer is if we are moving an floating object.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
  &lt;body onMouseMove=&#8221;setCoords(event);&#8221;&gt;
</p></blockquote>
<p>Next, we are going to create a nice background for our x and y axis.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
    &lt;div class=&#8221;axis-background&#8221; style=&#8221;top: 0px; left: 0px; height: 50px; width: 100%;&#8221;&gt;&amp;nbsp;&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-background&#8221; style=&#8221;top: 50px; left: 0px; height: 100%; width: 100px;&#8221;&gt;&amp;nbsp;&lt;/div&gt;
</p></blockquote>
<p>Now let&#8217;s put some times along the top of the page on the x-axis.  You&#8217;ll probably want generate these out of a database, but to show you how it is done we will just use static html.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 5px; left: 70px; width: 60px;&#8221;&gt;8:00AM&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 5px; left: 170px; width: 60px;&#8221;&gt;9:00AM&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 5px; left: 270px; width: 60px;&#8221;&gt;10:00AM&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 5px; left: 370px; width: 60px;&#8221;&gt;11:00AM&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 5px; left: 470px; width: 60px;&#8221;&gt;12:00AM&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 5px; left: 570px; width: 60px;&#8221;&gt;1:00AM&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 5px; left: 670px; width: 60px;&#8221;&gt;2:00AM&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 5px; left: 770px; width: 60px;&#8221;&gt;3:00AM&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 5px; left: 870px; width: 60px;&#8221;&gt;4:00AM&lt;/div&gt;
</p></blockquote>
<p>We need to create the y-axis labels now.  Again, you&#8217;ll probably generate these values from a database but for our example we&#8217;ll just use assume we are scheduling &#8220;work stations&#8221;.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 60px; left: 5px; width: 90px;&#8221;&gt;Work Station 1&lt;/div&gt;<br />
    &lt;div class=&#8221;row-background&#8221; style=&#8221;top: 160px; left: 100px; height: 100px; width: 100%;&#8221;&gt;&amp;nbsp;&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 160px; left: 5px; width: 90px;&#8221;&gt;Work Station 2&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 260px; left: 5px; width: 90px;&#8221;&gt;Work Station 3&lt;/div&gt;<br />
    &lt;div class=&#8221;row-background&#8221; style=&#8221;top: 360px; left: 100px; height: 100px; width: 100%;&#8221;&gt;&amp;nbsp;&lt;/div&gt;<br />
    &lt;div class=&#8221;axis-label&#8221; style=&#8221;top: 360px; left: 5px; width: 90px;&#8221;&gt;Work Station 4&lt;/div&gt;
</p></blockquote>
<p>Finally (at last!) we can create the actual floating objects.  We are going to make these all a different color (and all pastel at that).  These you would definitely want to generate from a database&#8230;else the purpose of this article is probably lost on you.  Our object needs to run the <b>setMover()</b> function when it is clicked and it needs to run the <b>unSetMover()</b> function when that click is released (when it is &#8216;dropped&#8217;).  If you are scheduling people you can even put a thumbnail image in these floaters so that the end user will really feel at home&#8211;pushing around his/her co-workers.</p>
<p>You&#8217;ll notice that the third floater does not restrict the movement at all, the user can move it up, down, left and right.  This should give you an idea of how movements can be done.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;">
<p>    &lt;div id=&#8221;floater1&#8243; class=&#8221;floater&#8221; style=&#8221;background-color:#cccccc; top: 50px; left: 100px; width: 100px&#8221; onmousedown=&#8221; setMover( &#8216;floater1&#8242;, true, false, true );&#8221; onmouseup=&#8221; unSetMover( &#8216;floater1&#8242; );&#8221; &gt;Order 1991-01A&lt;br /&gt;&lt;hr&gt;&lt;small&gt;Shearer, Grant&lt;/small&gt;&lt;/div&gt;</p>
<p>    &lt;div id=&#8221;floater2&#8243; class=&#8221;floater&#8221; style=&#8221;background-color:#ffccff; top: 50px; left: 200px; width: 80px&#8221; onmousedown=&#8221; setMover( &#8216;floater2&#8242;, true, false, true );&#8221; onmouseup=&#8221; unSetMover( &#8216;floater2&#8242; );&#8221; &gt;Order 2491-01A&lt;br /&gt;&lt;hr&gt;&lt;small&gt;Dummy, Test&lt;/small&gt;&lt;/div&gt;</p>
<p>    &lt;div id=&#8221;floater3&#8243; class=&#8221;floater&#8221; style=&#8221;background-color:#ccccff; top: 50px; left: 280px; width: 120px&#8221; onmousedown=&#8221; setMover( &#8216;floater3&#8242;, false, false, false );&#8221; onmouseup=&#8221; unSetMover( &#8216;floater3&#8242; );&#8221; &gt;Order 1431-01A&lt;br /&gt;&lt;hr&gt;&lt;small&gt;Smith, Bob&lt;/small&gt;&lt;/div&gt;</p>
<p>    &lt;div id=&#8221;floater4&#8243; class=&#8221;floater&#8221; style=&#8221;background-color:#ccffcc; top: 50px; left: 400px; width: 70px&#8221; onmousedown=&#8221; setMover( &#8216;floater4&#8242;, true, false, true );&#8221; onmouseup=&#8221; unSetMover( &#8216;floater4&#8242; );&#8221; &gt;Order 2236-09A&lt;br /&gt;&lt;hr&gt;&lt;small&gt;Springer, Jerry&lt;/small&gt;&lt;/div&gt;</p>
<p>    &lt;div id=&#8221;floater5&#8243; class=&#8221;floater&#8221; style=&#8221;background-color:#ffcccc; top: 50px; left: 470px; width: 110px&#8221; onmousedown=&#8221; setMover( &#8216;floater5&#8242;, true, false, true );&#8221; onmouseup=&#8221; unSetMover( &#8216;floater5&#8242; );&#8221; &gt;Order 3507-00&lt;br /&gt;&lt;hr&gt;&lt;small&gt;Simpleton Sr, Gary&lt;/small&gt;&lt;/div&gt;</p>
<p>    &lt;div id=&#8221;floater6&#8243; class=&#8221;floater&#8221; style=&#8221;background-color:#ffffcc; top: 50px; left: 580px; width: 170px&#8221; onmousedown=&#8221; setMover( &#8216;floater6&#8242;, true, false, true );&#8221; onmouseup=&#8221; unSetMover( &#8216;floater6&#8242; );&#8221; &gt;Order 3567-00&lt;br /&gt;&lt;hr&gt;&lt;small&gt;Simpleton Jr, Gary&lt;/small&gt;&lt;/div&gt;</p>
<p>    &lt;div id=&#8221;floater7&#8243; class=&#8221;floater&#8221; style=&#8221;background-color:#ccffff; top: 50px; left: 750px; width: 90px&#8221; onmousedown=&#8221; setMover( &#8216;floater7&#8242;, true, false, true );&#8221; onmouseup=&#8221; unSetMover( &#8216;floater7&#8242; );&#8221; &gt;Order 3337-00&lt;br /&gt;&lt;hr&gt;&lt;small&gt;Jingleheimer, Jerry&lt;/small&gt;&lt;/div&gt;</p>
<p>    &lt;div id=&#8221;floater8&#8243; class=&#8221;floater&#8221; style=&#8221;background-color:#ffcccc; top: 150px; left: 100px; width: 110px&#8221; onmousedown=&#8221; setMover( &#8216;floater8&#8242;, true, false, true );&#8221; onmouseup=&#8221; unSetMover( &#8216;floater8&#8242; );&#8221; &gt;Order 5507-00&lt;br /&gt;&lt;hr&gt;&lt;small&gt;Simpleton Sr, Gary&lt;/small&gt;&lt;/div&gt;</p>
<p>    &lt;div id=&#8221;floater9&#8243; class=&#8221;floater&#8221; style=&#8221;background-color:#ffffcc; top: 150px; left: 210px; width: 170px&#8221; onmousedown=&#8221; setMover( &#8216;floater9&#8242;, true, false, true );&#8221; onmouseup=&#8221; unSetMover( &#8216;floater9&#8242; );&#8221; &gt;Order 8456-00&lt;br /&gt;&lt;hr&gt;&lt;small&gt;Simpleton Jr, Gary&lt;/small&gt;&lt;/div&gt;</p>
<p>    &lt;div id=&#8221;floater10&#8243; class=&#8221;floater&#8221; style=&#8221;background-color:#ccffff; top: 150px; left: 380px; width: 90px&#8221; onmousedown=&#8221; setMover( &#8216;floater10&#8242;, true, false, true );&#8221; onmouseup=&#8221; unSetMover( &#8216;floater10&#8242; );&#8221; &gt;Order 4321-00&lt;br /&gt;&lt;hr&gt;&lt;small&gt;Jingleheimer, Jerry&lt;/small&gt;&lt;/div&gt;
   </p></blockquote>
<p>   The ending.  The iframe and it&#8217;s contents are only needed if you plan on updating your database every time the user &#8220;drops&#8221; one of the floating objects.</p>
<blockquote style="border: thin solid black; background-color: #ffffee;"><p>
  &lt;iframe name=&#8221;hidden_iframe&#8221; style=&#8221;visibility: hidden;&#8221;&gt;<br />
 		&lt;form name=&#8221;editform&#8221; method=&#8221;post&#8221; action=&#8221;myupdatepage.php&#8221;&gt;<br />
 		 &lt;input type=&#8221;hidden&#8221; name=&#8221;x_coord&#8221; /&gt;<br />
 		 &lt;input type=&#8221;hidden&#8221; name=&#8221;y_coord&#8221; /&gt;<br />
    &lt;/form><br />
  &lt;/iframe&gt;<br />
  &lt;/body&gt;<br />
&lt;/html&gt;
</p></blockquote>
<p><center><a href="http://techrageo.us/wp-content/code/schedule.html"><b>See it in action</b></a></center><br />
(To use the code, just click on &#8220;See it in action&#8221; and save the page from there)</p>
<p><small style="color: #992222;">Some of the css used in the code above does not work in all browsers.  The opacity property, for instance, does not appear to work in Internet Explorer.  YMMV.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://techrageo.us/2005/08/09/creating-a-drag-and-drop-schedule-for-your-web-application/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>del.icio.us Javascript Linkrolls</title>
		<link>http://techrageo.us/2005/08/05/delicious-javascript-linkrolls/</link>
		<comments>http://techrageo.us/2005/08/05/delicious-javascript-linkrolls/#comments</comments>
		<pubDate>Fri, 05 Aug 2005 20:40:33 +0000</pubDate>
		<dc:creator>bill</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://techrageo.us/?p=37</guid>
		<description><![CDATA[del.icio.us now provides linkrolls via javascript. All you have to do to use it is copy the following script to your editor (it&#8217;s all one line, so remove any line breaks): &#60;script type="text/javascript"src="http://del.icio.us/feeds/js/techrageo.us/tech?tags;extended;count=14;title=my%20del.icio.us;bullet=%C2%BB;icon;sort=alpha"&#62;&#60;/script&#62; Then adjust the querystring to your needs as follows Modify &#8220;techrageo.us&#8221; to whoever&#8217;s del.icio.us links you want to monitor Modify &#8220;tech&#8221; to [...]]]></description>
			<content:encoded><![CDATA[<p>del.icio.us now provides <a href="http://del.icio.us/doc/feeds/js/">linkrolls via javascript</a>.<br />
<blockquote><script type="text/javascript" src="http://del.icio.us/feeds/js/techrageo.us?bullet=%C2%BB"></script>
</p></blockquote>
<p>All you have to do to use it is copy the following script to your editor (it&#8217;s all one line, so remove any line breaks):</p>
<blockquote><p>
<code>&lt;script type="text/javascript"<br />src="http://del.icio.us/feeds/js/techrageo.us/tech?tags;<br />extended;count=14;title=my%20del.icio.us;<br />bullet=%C2%BB;icon;sort=alpha"&gt;&lt;/script&gt;<br />
</code>
</p></blockquote>
<p>Then adjust the querystring to your needs as follows</p>
<ul>
<li>Modify &#8220;techrageo.us&#8221; to whoever&#8217;s del.icio.us links you want to monitor</li>
<li>Modify &#8220;tech&#8221; to filter by a certain tag, combine them with &#8220;+&#8221; as in &#8220;tech+diy&#8221;, or remove the &#8220;/tech&#8221; altogether to not filter by tags.</li>
<li><strong>extended</strong> &#8212; include &#8220;extended&#8221; if you want to see the extended text for each link</li>
<li><strong>tags</strong> &#8212; include &#8220;tags&#8221; if you want to see the tags for each link</li>
<li><strong>count</strong> &#8212; include &#8220;count&#8221; if you want some number of links displayed besides the default (20, I believe)</li>
<li><strong>title</strong> &#8212; include &#8220;title&#8221; if you want del.icio.us to add a title, or simply remove the title portion of the querystring</li>
<li><strong>bullet</strong> &#8212; include &#8220;bullet&#8221; and set it to a character if you want a bullet displayed before each link</li>
<li><strong>icon</strong> &#8212; include &#8220;icon&#8221; if you want the del.icio.us icon to appear, or remove it for no icon.</li>
<li><strong>sort</strong> &#8212; include &#8220;sort=alpha&#8221; if you want the links to be sorted alphabetically. If the <em>sort</em> key is not included, the default is to list the links chronologically.</li>
<li>Drop the resulting script into your web code where you want the links to appear</li>
<li>del.icio.us delivers the link feed inline</li>
</ul>
<p>Kind of snazzy.</p>
]]></content:encoded>
			<wfw:commentRss>http://techrageo.us/2005/08/05/delicious-javascript-linkrolls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
