<?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>{5} Setfive - Talking to the World &#187; javascript</title>
	<atom:link href="http://shout.setfive.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://shout.setfive.com</link>
	<description></description>
	<lastBuildDate>Wed, 18 Jan 2012 21:09:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Toggle non-consecutive checkboxes with jQuery UI</title>
		<link>http://shout.setfive.com/2011/12/27/toggle-non-consecutive-checkboxes-with-jquery-ui/</link>
		<comments>http://shout.setfive.com/2011/12/27/toggle-non-consecutive-checkboxes-with-jquery-ui/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 16:19:38 +0000</pubDate>
		<dc:creator>Ashish Datta</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://shout.setfive.com/?p=1272</guid>
		<description><![CDATA[You&#8217;re all probably familiar with the UI convention of allowing users to select ALL or NONE for a list of checkboxes (like in Gmail). Recently I was working on a project that had a large table full of checkboxes (imagine a 10&#215;10 grid) where the user would need to toggle some but not all of [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;re all probably familiar with the UI convention of allowing users to select ALL or NONE for a list of checkboxes (like in Gmail). Recently I was working on a project that had a large table full of checkboxes (imagine a 10&#215;10 grid) where the user would need to toggle some but not all of the checkboxes in a given row. And to make matters more complex, they would need to toggle groups of non-consecutive checkboxes (say 15, skip 10, 5, etc.). I threw on the thinking cap but couldn&#8217;t think of any similar interactions I&#8217;d seen and couldn&#8217;t think of a particularly good way to achieve this.</p>
<p><strong>Enter jQuery UI</strong>. I happened to stumble across the jQuery UI Selectable documentation and realized it would provide a good UI experience to toggle some but not all of the checkboxes. The code to implement this is surprisingly simple:</p>
<p><strong>Note: You don&#8217;t actually need the div container &#8211; that was just for JSFiddle.</strong></p>
<pre name="code" class="php">
&lt;div id=&quot;checkboxes&quot;&gt;

&lt;table id=&quot;checkboxTable&quot;&gt;
     &lt;tr&gt;
         &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
         &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
         &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
         &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
         &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/td&gt;
     &lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
</pre>
<p>And then the Javascript (jQuery + jQuery UI):</p>
<pre name="code" class="php">
$("#checkboxes").selectable( {filter: "input:checkbox",
            stop: function(event, ui) {

                $(".ui-selected").each( function(){

                    $(this).each( function(){
                        var val = $(this).attr("checked") ? null : "checked";
                        $(this).attr("checked", val);
                    });

                });
}});
</pre>
<p>You can check out a live demo at <a href="http://jsfiddle.net/whMyQ/3/" target="_blank">http://jsfiddle.net/whMyQ/3/</a></p>
<p>As always, questions and comments are welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://shout.setfive.com/2011/12/27/toggle-non-consecutive-checkboxes-with-jquery-ui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload directly to S3 with SWFUpload</title>
		<link>http://shout.setfive.com/2011/04/21/upload-directly-to-s3-with-swfupload/</link>
		<comments>http://shout.setfive.com/2011/04/21/upload-directly-to-s3-with-swfupload/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 03:56:01 +0000</pubDate>
		<dc:creator>Ashish Datta</dc:creator>
				<category><![CDATA[Free Advice]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[SWFUpload]]></category>

		<guid isPermaLink="false">http://shout.setfive.com/?p=652</guid>
		<description><![CDATA[I was working on an application earlier today that required allowing a user to upload a large file (several hundred MB) which would eventually be stored on Amazon S3. After reviewing the requirements, I realized it made sense to just upload the file directly to S3 instead of having to first stage the file on [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on an application earlier today that required allowing a user to upload a large file (several hundred MB) which would eventually be stored on <a href="http://aws.amazon.com/s3/" target="_blank">Amazon S3</a>. After reviewing the requirements, I realized it made sense to just upload the file directly to S3 instead of having to first stage the file on a server and then use PHP to push the file to S3.</p>
<p>Amazon has a nice walk through of using a plain HTML form to upload a file directly to S3 <a href="http://doc.s3.amazonaws.com/proposals/post.html" target="_blank">here</a>.</p>
<p>I had all ready been using <a href="http://swfupload.org/" target="_blank">SWFUpload</a> to upload files to the server so I decided to look into using it to uploading directly to S3. After some head banging, I finally got it to work &#8211; here&#8217;s the quick n dirty.</p>
<ol>
<li>Download <a target="_blank" href="http://code.google.com/p/swfupload/downloads/list">SWFUpload 2.5</a></li>
<li>Get SWFUpload ready to use in your project. Copy the SWF file somewhere accessible and include their swfupload.js Javascript file. More info <a href="http://demo.swfupload.org/Documentation/" target="_blank">here</a></li>
<li>Setup an S3 bucket. You&#8217;ll need to set the policy to allow uploads from your own user (its the default).</li>
<li>Place a crossdomain.xml file in the root of your S3 bucket. This file &#8220;authorizes&#8221; flash player to upload files into this host. The content of the file is below.</li>
<li>Initialize the SWFUpload object (example below).</li>
<li>Before beginning the upload, you need to set the appropriate postParams in the SWFUpload object. This is really the &#8220;magic&#8221; of this process. Example is below.</li>
<li>Start the upload with startUpload()</li>
</ol>
<p>Thats it! It&#8217;s pretty straight forward once you have things going. As an FYI, you can put SWFUpload into &#8220;debug&#8221; mode by adding debug: true as a property to the initialization object. You can also debug the responses from Amazon by using a packet sniffer like <a href="http://www.wireshark.org/" target="_blank">Wireshark</a>. </p>
<h3>crossdomain.xml</h3>
<p>You probably want to make this file a little less permissive. More details <a href="http://kb2.adobe.com/cps/142/tn_14213.html" target="_blank">here</a>. Also note, there are differences in the implementation of the file between various versions of Flash player.</p>
<pre class="xml" name="code">
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" secure="false" />
</cross-domain-policy>
</pre>
<h3>Initialize SWFUpload</h3>
<pre class="javascript" name="code">
        var swfu = new SWFUpload(
                       {  flash_url: "/assets/swfupload.swf",
                          flash9_url: "/assets/swfupload_fp9.swf",
                          file_size_limit: "1000 MB",
                          file_types: "*.*",
                          debug: false,
                          upload_url: "http://your-bucket.s3.amazonaws.com",
                          button_placeholder_id : "SWFUploadButton",
                          button_image_url : "/assets/select_filesbtn.png",
                          button_width: '112',
                          button_height: '33',
                          button_cursor : SWFUpload.CURSOR.HAND,
                          http_success : [201, 303, 200], /* Amazon returns a 303 on success */
                          file_post_name: "file", /* Amazon expects the file data to be in a input named "file"

                          file_queued_handler: function(f){

                            // track the filenames so you can upload them later
                            cachedUploadFiles[ f.index ] = f.name;
                          },
                          upload_complete_handler: function(e){ uploadSWFFile( ); },
                          upload_start_handler: function(e){
                                  // reset the progress bar
                        	  $("#progressBar").progressbar( 'value', 0 );
                          },
                          upload_error_handler: function(e){

                          },
                          upload_progress_handler: function(f, c, t){
                             // update the progress bar as the process continues
                             $("#progressBar").progressbar( 'value', Math.ceil( ( c/t ) * 100 ) );
                          }
        });
</pre>
<h3>Set SWFUpload postParams</h3>
<p>The HMAC signature MUST be calculated on the server because it uses your S3 secret. You MUST keep that value secret in order to maintain the security of your S3 buckets. I&#8217;m using <a href="https://github.com/tpyo/amazon-s3-php-class" target="_blank">Don Schonknecht&#8217;s S3 PHP</a> library to calculate the HMAC signatures but you could just as easily do it in straight PHP.</p>
<pre class="php" name="code">

/* In PHP */
$encodedPolicy = json_encode( array(
              "expiration" => "2011-4-22T13:54:23.000Z",
              "conditions" => array(
                  0 => array( "acl" => "public-read" ),
                  1 => array( "bucket" => "your-bucket" ),
                  2 => array( "x-amz-meta-sig" => 'some meta signature to ensure authentic requests'),
                  3 => array( "redirect" => $'URL to redirect a success request (its doesnt matter)' ),
                  4 => array( "key" => "the S3 key for the file (the S3 filename)" ),
                  5 => array( "Filename" => "The original filename of the file. THIS IS IMPORTANT." )
              ),
            )
);

$encodedPolicy = base64_encode( $encodedPolicy );
$s3 = new S3( sfConfig::get("app_amazon_s3_id"), sfConfig::get("app_amazon_s3_secret") );
list($dist, $hmacSignature) = explode(":", $s3->__getSignature( $encodedPolicy ));

/* END PHP */

            var swfConfig = {
                    'AWSAccessKeyId': 'your amazon ID',
                    'acl': 'public-read',
                    'key': 'the S3 key for the file (the S3 filename)',
                    'policy': '&lt;?php echo $encodedPolicy?&gt;',
                    'signature': '&lt;?php echo $signature'?&gt;,
                    'redirect': 'URL to redirect a success request (its doesnt matter)',
                    'x-amz-meta-sig': 'some meta signature to ensure authentic requests',
            };

            // this line sets the post params so that SWFUpload will send the additional fields when it uploads the file.
            $.swfu.setPostParams( swfConfig );
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shout.setfive.com/2011/04/21/upload-directly-to-s3-with-swfupload/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>iPhone style checkboxes for Symfony</title>
		<link>http://shout.setfive.com/2010/10/13/iphone-style-checkboxes-for-symfony/</link>
		<comments>http://shout.setfive.com/2010/10/13/iphone-style-checkboxes-for-symfony/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 22:46:13 +0000</pubDate>
		<dc:creator>Ashish Datta</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://shout.setfive.com/?p=412</guid>
		<description><![CDATA[No one worry, I did in fact survive my birthday and subsequent party! Anyway, I was poking around for some cool UI elements for checkboxes and stumbled across this neat jQuery plugin &#8211; http://github.com/tdreyno/iphone-style-checkboxes Basically, what it does is converts checkboxes into iPhone style toggles. Check out a demo at http://tdreyno.github.com/iphone-style-checkboxes/ This is for a [...]]]></description>
			<content:encoded><![CDATA[<p>No one worry, I did in fact survive my birthday and subsequent party!</p>
<p>Anyway, I was poking around for some cool UI elements for checkboxes and stumbled across this neat jQuery plugin &#8211; <a href="http://github.com/tdreyno/iphone-style-checkboxes" target="_blank">http://github.com/tdreyno/iphone-style-checkboxes</a> Basically, what it does is converts checkboxes into iPhone style toggles.</p>
<p>Check out a demo at <a href="http://tdreyno.github.com/iphone-style-checkboxes/" target="_blank">http://tdreyno.github.com/iphone-style-checkboxes/</a></p>
<p>This is for a symfony project (shocker!), so I figured I&#8217;d roll it into a widget and share.</p>
<p>You&#8217;ll need to download and include the JS+CSS+images for the plugin yourself and then copy the following code into your project:</p>
<pre name="code" class="php">

class sfWidgetFormInputiPhoneCheckbox extends sfWidgetFormInputCheckbox {

	public function __construct($options = array(), $attributes = array())
	{

		$this->addOption('checked_label');
        $this->addOption('un_checked_label');

		parent::__construct($options, $attributes);
	}

	public function render($name, $value = null, $attributes = array(), $errors = array())
	{
		$str = parent::render( $name, $value, $attributes, $errors );

		$checkedLabel = $this->getOption("checked_label");
        $uncheckedLabel = $this->getOption("un_checked_label");
        $id = $this->generateId($name);

		$str .= <<<EOF
		<script type='text/javascript'>

		  $(document).ready( function(){

                $('#$id').iphoneStyle({
                    checkedLabel: '$checkedLabel',
                    uncheckedLabel: '$uncheckedLabel'
                });

		  });
		</script>
EOF;

		return $str;
	}

}
</pre>
<p>Using it is straightforward:</p>
<pre name="code" class="php">
    $this->setWidgets(array(
      'show-upcoming-events-nav' => new sfWidgetFormInputiPhoneCheckbox( array("checked_label" => "on", "un_checked_label" => "off") ),
    ));
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shout.setfive.com/2010/10/13/iphone-style-checkboxes-for-symfony/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Streaming Foursquare checkins with Google Maps</title>
		<link>http://shout.setfive.com/2010/09/13/streaming-foursquare-checkins-with-google-maps/</link>
		<comments>http://shout.setfive.com/2010/09/13/streaming-foursquare-checkins-with-google-maps/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 02:26:42 +0000</pubDate>
		<dc:creator>Ashish Datta</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[foursquare]]></category>
		<category><![CDATA[fun stuff]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://shout.setfive.com/?p=394</guid>
		<description><![CDATA[This Saturday was the second annual Redline Challenge which is a bar crawl from Downtown Crossing to Davis Square that loosely tracks the MBTA Redline. This year, we decided to use Foursquare to allow the website to track the position of several of the participants on the challenge. Foursquare natively allows you to track your [...]]]></description>
			<content:encoded><![CDATA[<p>This Saturday was the second annual <a href="http://redlinechallenge.com/" target="_blank">Redline Challenge</a> which is a bar crawl from Downtown Crossing to Davis Square that loosely tracks the MBTA Redline.</p>
<p>This year, we decided to use <a href="http://foursquare.com/" target="_blank">Foursquare</a> to allow the website to track the position of several of the participants on the challenge. Foursquare natively allows you to track your checkin history with private URLs. Currently, they support a handful of formats with KML being the most interesting for our purposes. You can find your private URLs by navigating to <a href="http://foursquare.com/feeds/" target="_blank">http://foursquare.com/feeds/</a></p>
<p>We used the Google Maps API along with the KML stream from Foursquare to dynamically place markers on the map as different users checked in to different venues.</p>
<p>Here is the PHP we used to pull back the KML feed, transform it to JSON, and spit it back to our jQuery on the client side:</p>
<pre name="code" class="php">
$xml = simplexml_load_file( "http://feeds.foursquare.com/history/myurl.kml" );
$arr["a"] = $xml->Folder;
$xml = simplexml_load_file( "http://feeds.foursquare.com/history/ackleysurl.kml" );
$arr["m"] = $xml->Folder;

echo json_encode( $arr );
</pre>
<p>Pretty straight forward. Here is the jQuery code on the client side to add markers to the map:</p>
<pre name="code" class="javascript">
       $.getJSON( "location.php", {}, function(data){

    	   data.a.Placemark = data.a.Placemark.reverse();

         var hasStarted = false;
         var barIndex = 1;

         $.each( data.a.Placemark, function(i, val){

               if( val.published.indexOf("Sat, 11") == -1 ){
                    return true;
               }

               if( !hasStarted &#038;&#038; val.name == "Setfive Consulting" ){
                  hasStarted = true;
               }else if( !hasStarted ){
                  return true;
               }

               var latLng = val.Point["coordinates"].split(",");

               var point = new GLatLng( latLng[1], latLng[0] );

               var marker = new GMarker(point);

               marker.bindInfoWindowHtml( "
<div style='font-size: 18px; font-weight: bold; text-align: center'>"
                                             + barIndex + ". " + val.name + "</div>
<div style='text-align: center; color: blue; font-size: 14px'><a style='color: blue' href='http://maps.google.com/maps?f=d&#038;source=s_d&#038;saddr=&#038;daddr=" + latLng[1] + "," + latLng[0] + "&#038;hl=en&#038;geocode=&#038;mra=mift&#038;mrsp=0&#038;sz=11&#038;sll=" + latLng[1] + "," + latLng[0] + "&#038;sspn=0.344495,0.617294&#038;ie=UTF8&#038;z=14' target='_blank'>Get Directions</a></div>

" );
               map.addOverlay(marker);

               latLngList.push( point );

               if( i == data.a.Placemark.length-1 ){
            	   map.setCenter(point, 14);
                   $(marker).click();

                   marker.openInfoWindowHtml( "
<div style='font-size: 18px; font-weight: bold; text-align: center'>We are at "
                		                      + barIndex + ". " + val.name
                                              + "</div>
<div style='text-align: center; color: blue; font-size: 14px'><a style='color: blue' href='http://maps.google.com/maps?f=d&#038;source=s_d&#038;saddr=&#038;daddr=" + latLng[1] + "," + latLng[0] + "&#038;hl=en&#038;geocode=&#038;mra=mift&#038;mrsp=0&#038;sz=11&#038;sll=" + latLng[1] + "," + latLng[0] + "&#038;sspn=0.344495,0.617294&#038;ie=UTF8&#038;z=14' target='_blank'>Get Directions</a></div>

" );

               }

               barIndex++;

           });
           var polyline = new GPolyline( latLngList, "#ff0000", 5 );
           map.addOverlay(polyline);

         latLngList = [];
         data.m.Placemark = data.m.Placemark.reverse();

        var blueIcon = new GIcon(G_DEFAULT_ICON);
        blueIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
        markerOptions = { icon:blueIcon };

        barIndex = 1;

        $.each( data.m.Placemark, function(i, val){

               if( val.published.indexOf("Sat, 11") == -1 ){
                    return true;
               }

               var latLng = val.Point["coordinates"].split(",");

               var point = new GLatLng( latLng[1], latLng[0] );

               var marker = new GMarker(point, markerOptions);

               marker.bindInfoWindowHtml( "
<div style='font-size: 18px; font-weight: bold; text-align: center'>"
                                             + barIndex + ". " + val.name + "</div>
<div style='text-align: center; color: blue; font-size: 14px'><a style='color: blue' href='http://maps.google.com/maps?f=d&#038;source=s_d&#038;saddr=&#038;daddr=" + latLng[1] + "," + latLng[0] + "&#038;hl=en&#038;geocode=&#038;mra=mift&#038;mrsp=0&#038;sz=11&#038;sll=" + latLng[1] + "," + latLng[0] + "&#038;sspn=0.344495,0.617294&#038;ie=UTF8&#038;z=14' target='_blank'>Get Directions</a></div>

" );
               map.addOverlay(marker);

               barIndex++;

               latLngList.push( point );

           });
           var polyline = new GPolyline( latLngList, "#001299", 5 );
           map.addOverlay(polyline);

       })
</pre>
<p>That&#8217;s about it. </p>
]]></content:encoded>
			<wfw:commentRss>http://shout.setfive.com/2010/09/13/streaming-foursquare-checkins-with-google-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UPDATED: New Facebook Phonebook Script</title>
		<link>http://shout.setfive.com/2010/07/19/updated-new-facebook-phonebook-script/</link>
		<comments>http://shout.setfive.com/2010/07/19/updated-new-facebook-phonebook-script/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 19:05:24 +0000</pubDate>
		<dc:creator>Ashish Datta</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fun stuff]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://shout.setfive.com/?p=382</guid>
		<description><![CDATA[I realized this morning that Anonymous Coward&#8217;s Facebook Phonebook Greasemonkey script broke awhile back so I decided to rewrite it from scratch. The original instructions for how to install the script are available here. I updated the original Userscripts page with the new script so you can download it here. Once again, this probably breaks [...]]]></description>
			<content:encoded><![CDATA[<p>I realized this morning that Anonymous Coward&#8217;s Facebook Phonebook Greasemonkey script broke awhile back so I decided to rewrite it from scratch.</p>
<p>The original instructions for how to install the script are available <a target="_blank" href="http://shout.setfive.com/2009/03/06/use-greasemonkey-to-extract-your-facebook-phonebook/">here</a>.</p>
<p>I updated the original Userscripts page with the new script so you can download it <a target="_blank" href="http://userscripts.org/scripts/show/43681">here</a>.</p>
<div style="font-size: 18px; font-weight: bold">
Once again, this probably breaks your Facebook TOS so I can&#8217;t vouch for the safety of your account if you do decide to do this.
</div>
]]></content:encoded>
			<wfw:commentRss>http://shout.setfive.com/2010/07/19/updated-new-facebook-phonebook-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QR Bookmarklet</title>
		<link>http://shout.setfive.com/2010/06/13/qr-bookmarklet/</link>
		<comments>http://shout.setfive.com/2010/06/13/qr-bookmarklet/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 03:16:43 +0000</pubDate>
		<dc:creator>Ashish Datta</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[fun stuff]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://shout.setfive.com/?p=372</guid>
		<description><![CDATA[I got tired of having to find the same website (mostly recipes) on my phone after looking at them on my workstation or laptop so I decided to whip together a bookmarklet to throw a Google powered QR code on any page. The bookmarklet will just slap a QR code image with the current page&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I got tired of having to find the same website (mostly recipes) on my phone after looking at them on my workstation or laptop so I decided to whip together a bookmarklet to throw a Google powered QR code on any page.</p>
<p>The bookmarklet will just slap a QR code image with the current page&#8217;s URL (window.location) so that you can open the page on your phone. ps. <a href="http://www.androidtapp.com/barcode-scanner/" target="_blank">Barcode Scanner</a> for Android will automatically open the URL in a browser.</p>
<p>Without further ado, <a href="http://code.setfive.com/qrbklt/" target="_blank">QR Code Bookmarklet</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://shout.setfive.com/2010/06/13/qr-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery.trigger weirdness</title>
		<link>http://shout.setfive.com/2010/06/10/jquery-trigger-weirdness/</link>
		<comments>http://shout.setfive.com/2010/06/10/jquery-trigger-weirdness/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 03:44:42 +0000</pubDate>
		<dc:creator>Ashish Datta</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://shout.setfive.com/?p=369</guid>
		<description><![CDATA[Earlier today, I was trying to use jQuery to trigger the submission of a form after a radio button was clicked. The form tag looked something like: ...form.. function saysomething(){ alert("Hello world from saysomething()"); } So for a regular submit button: Everything works fine, you&#8217;ll see the alert() and the form won&#8217;t submit because of [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier today, I was trying to use jQuery to trigger the submission of a form after a radio button was clicked. The form tag looked something like:</p>
<pre name="code" class="html">
<form action="" id="someForm" method="GET" onsubmit="saysomething(); return false">
   ...form..
   </form>

    <script type="text/javascript">

    function saysomething(){
      alert("Hello world from saysomething()");
    }

   </script>
</pre>
<p>So for a regular submit button:</p>
<pre name="code" class="html">
<input type="submit" value="Submit Form" />
</pre>
<p>Everything works fine, you&#8217;ll see the alert() and the form won&#8217;t submit because of the return false.</p>
<p>I ran into issues when I tried to trigger() the submit event with jQuery. I was trying to trigger the submit() event on the form via jQuery. The problem I ran into, was that the saysomething() function was getting called, but the &#8220;return false&#8221; seemed to have no effect.</p>
<p>The final form looked something like:</p>
<pre name="code" class="html">
<form action="" id="someForm"
          method="GET" onsubmit="saysomething(); return false">
<input type="text" name="someshit" />
<input type="submit" value="Submit Form" />
<input type="button" value="jQuery.submit()" id="clickIt" />
    </form>

    <script type="text/javascript">

    function saysomething(){
      alert("Hello world from saysomething()");
    }

    $(document).ready( function(){
      $("#clickIt").click( function(){ $("#someForm").submit(); });
    });

    </script>
</pre>
<p>For some reason, if you submit the form via a jQuery trigger the form submits even though saysomething() gets called. I&#8217;m not sure if this is the expected behavior but it was certainly something of a shock. Anyway, a live version of the form is running <a href="http://code.setfive.com/shout/formsubmit.html" target="_blank">here</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://shout.setfive.com/2010/06/10/jquery-trigger-weirdness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery blank() modified for password fields</title>
		<link>http://shout.setfive.com/2010/04/28/jquery-blank-modified-for-password-fields/</link>
		<comments>http://shout.setfive.com/2010/04/28/jquery-blank-modified-for-password-fields/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 04:58:20 +0000</pubDate>
		<dc:creator>Ashish Datta</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://shout.setfive.com/?p=353</guid>
		<description><![CDATA[We&#8217;ve been using Jeff Hui&#8217;s very awesome jquery.blank plugin for sometime over at Setfive HQ. What blank() is allow you to basically move the labels for text inputs into the input themselves (to save space). We use this technique frequently for login boxes in headers since it&#8217;s easier not to have to stick in labels [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been using Jeff Hui&#8217;s very awesome <a target="_blank" href="http://blog.jeffhui.net/work/jquery-blank/">jquery.blank</a> plugin for sometime over at Setfive HQ. What blank() is allow you to basically move the labels for text inputs into the input themselves (to save space). We use this technique frequently for login boxes in headers since it&#8217;s easier not to have to stick in labels next to text boxes.</p>
<p>The problem is, you can&#8217;t use blank() on a password field since a password field won&#8217;t display clear text (obviously). To get around this, I&#8217;ve always manually stuck in a &#8220;shadow&#8221; text box next to the password field and toggled the text box or password box in order to make blank() work correctly.</p>
<p>Anyway, I finally got tired of doing this so I decided to patch the plugin to do this automatically. Jeff incorporated the code back into blank() and it&#8217;s available on GitHub <a target="_blank" href="http://github.com/jeffh/jquery.blank">here</a>. </p>
<p>Happy coding. </p>
]]></content:encoded>
			<wfw:commentRss>http://shout.setfive.com/2010/04/28/jquery-blank-modified-for-password-fields/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>javascript &#8211; $(document).ready getting called twice?  Here&#8217;s why.</title>
		<link>http://shout.setfive.com/2010/02/22/javascript-document-ready-getting-called-twice-heres-why/</link>
		<comments>http://shout.setfive.com/2010/02/22/javascript-document-ready-getting-called-twice-heres-why/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 03:38:40 +0000</pubDate>
		<dc:creator>Matt Daum</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://shout.setfive.com/?p=330</guid>
		<description><![CDATA[Recently we found ourselves having a really weird problem on a project: Every time a page was loaded it seemed a bunch of different Javascript functions were being called multiple times and making many widgets on the page break and we couldn&#8217;t figure it out. Some of the functions were our own code, some part [...]]]></description>
			<content:encoded><![CDATA[<p>Recently we found ourselves having a really weird problem on a project:  Every time a page was loaded it seemed a bunch of different Javascript functions were being called multiple times and making many widgets on the page break and we couldn&#8217;t figure it out.  Some of the functions were our own code, some part of the package we were using.  After a while we narrowed it down to that all the functions in the </p>
<pre name="code" class="javascript">
$(document).ready(...);
</pre>
<p>we&#8217;re being called twice.  We had never seen this.  After about an hour of removing javascript files and just headbanging, and many thanks to Ashish, we found the root cause.  We had written in a quick hack for a late proof of concept to string replace on the entire HTML of a page a specific string.  We did it this way:</p>
<pre name="code" class="javascript">
$('body').html($('body').html().replace(/{REPLACETEXT}/i, "More important text"));
</pre>
<p>Basically we used a regex to parse the entire HTML tree and then replace it with the updated text.  Unknowingly this caused the document ready event to be triggered again(though now it makes sense), causing many widgets to get extra HTML.</p>
<p>Let this save you some headbanging. </p>
]]></content:encoded>
			<wfw:commentRss>http://shout.setfive.com/2010/02/22/javascript-document-ready-getting-called-twice-heres-why/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery UI $.dialog &#8211; on the fly HTML</title>
		<link>http://shout.setfive.com/2009/11/13/jquery-ui-dialog-on-the-fly-html/</link>
		<comments>http://shout.setfive.com/2009/11/13/jquery-ui-dialog-on-the-fly-html/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 03:44:59 +0000</pubDate>
		<dc:creator>Ashish Datta</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://shout.setfive.com/?p=317</guid>
		<description><![CDATA[Wow its been awhile! We&#8217;ve been insanely busy over the last month or so. We launched Setfive Ventures and are anxiously anticipating the launch of both WeGov and OmniStrat in the immediate future. There are also a handful of internal project that should be rolling out before Christmas. Get Excited. Anyway, the jQuery UI Dialog [...]]]></description>
			<content:encoded><![CDATA[<p>Wow its been awhile!</p>
<p>We&#8217;ve been insanely busy over the last month or so. We launched <a href="http://www.setfiveventures.com" target="_blank">Setfive Ventures</a> and are anxiously anticipating the launch of both <a href="http://www.wegov.com" target="_blank">WeGov</a> and <a href="http://www.omnistrat.com" target="_blank">OmniStrat</a> in the immediate future. There are also a handful of internal project that should be rolling out before Christmas. Get Excited.</p>
<p>Anyway, the jQuery UI <a href="http://docs.jquery.com/UI/Dialog" target="_blank">Dialog</a> class is pretty sweet. Basically, it provides a class to display a modal dialog box from a regular old DOM element (a div, span, or whatever.)</p>
<p>One of the thing that isn&#8217;t explained well (or at all?) in the documentation is that you can create a dialog with on the fly HTML! I found this out after posting on the <a href="http://groups.google.com/group/jquery-ui/browse_thread/thread/9b0b64da244d0c3/796962caab4fda88?lnk=gst">Google Group</a> asking why this feature didn&#8217;t exist (it does. Ashish fail.)</p>
<p>So if you want to create a dialog with on the fly HTML all you need to do is:</p>
<pre class="javascript" name="code">
$("&lt;p&gt;Hello World!&lt;/p&gt;").dialog();
</pre>
<p>Pretty sweet. </p>
]]></content:encoded>
			<wfw:commentRss>http://shout.setfive.com/2009/11/13/jquery-ui-dialog-on-the-fly-html/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

