<?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>Feelinc.Me &#187; Tips</title>
	<atom:link href="http://www.feelinc.me/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.feelinc.me</link>
	<description>It&#039;s All About Me</description>
	<lastBuildDate>Tue, 24 Aug 2010 21:46:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Preloading Images using jQuery for Slideshow</title>
		<link>http://www.feelinc.me/experience/preloading-images-using-jquery-for-slideshow/</link>
		<comments>http://www.feelinc.me/experience/preloading-images-using-jquery-for-slideshow/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 18:00:57 +0000</pubDate>
		<dc:creator>Feelinc</dc:creator>
				<category><![CDATA[Experience]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[preload]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://www.feelinc.me/?p=362</guid>
		<description><![CDATA[jQuery Cycle Plugin is a good jQuery Plugin for creating image slideshow, but does not having a preloading image feature. So here i&#8217;ll explain how to implement the preloading image using jQuery integrated with jQuery Cycle Plugin. Requirements jQuery jQuery Cycle Plugin loading.gif (for loading indicator, you can create from http://ajaxload.info/) your images Step 1 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jquery.malsup.com/cycle/" target="_blank">jQuery Cycle Plugin</a> is a good jQuery Plugin for creating image slideshow, but does not having a preloading image feature. So here i&#8217;ll explain how to implement the preloading image using jQuery integrated with <a href="http://jquery.malsup.com/cycle/" target="_blank">jQuery Cycle Plugin</a>.<span id="more-362"></span></p>
<h3>Requirements</h3>
<ul>
<li> <a href="http://jquery.com/" target="_blank">jQuery</a></li>
<li><a href="http://jquery.malsup.com/cycle/" target="_blank">jQuery Cycle Plugin</a></li>
<li>loading.gif (for loading indicator, you can create from <a href="http://ajaxload.info/" target="_blank">http://ajaxload.info/</a>)</li>
<li>your images</li>
</ul>
<h3>Step 1</h3>
<p>Load all needed libraries inside your HTML head tag:</p>
<pre class="brush: plain;">
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.cycle.all.js&quot;&gt;&lt;/script&gt;
</pre>
<h3>Step 2</h3>
<p>Create HTML tags for your slideshow:</p>
<pre class="brush: plain;">
&lt;!-- For loading indicator --&gt;
&lt;img id=&quot;loading-indicator&quot; src=&quot;loading.gif&quot; alt=&quot;loading&quot; style=&quot;display:none;&quot; /&gt;

&lt;!-- Your slideshow --&gt;
&lt;div id=&quot;myslides&quot;&gt;
 &lt;img src=&quot;banner1.jpg&quot; alt=&quot;banner1&quot; /&gt;
 &lt;img src=&quot;banner2.jpg&quot; alt=&quot;banner2&quot; /&gt;
 &lt;img src=&quot;banner3.jpg&quot; alt=&quot;banner3&quot; /&gt;
 &lt;img src=&quot;banner4.jpg&quot; alt=&quot;banner4&quot; /&gt;
&lt;/div&gt;
</pre>
<h3>Step 3</h3>
<p>Put below JavaSript codes at HTML head and don&#8217;t forget to read the code comment:</p>
<pre class="brush: plain;">
&lt;script type=&quot;text/javascript&quot;&gt;
 jQuery(document).ready(function(){
  // Get the slide show container first
  var objSlideshow = jQuery('#myslides');

  // Get slide show container position
  var objPosistion = objSlideshow.position();

  // Create loading interface, to wait the preload
  var objLoading = jQuery('&lt;div&gt;&lt;/div&gt;').css({
    position: 'absolute',
    top: objPosistion.top,
    left: objPosistion.left,
    width: objSlideshow.width(),
    height: objSlideshow.height(),
    background: 'url(&quot;' + jQuery('#loading-indicator').attr('src') + '&quot;) center no-repeat'
  }).appendTo(objSlideshow.parent());

  // Hide the slide show container first, to wait the preload finish
  objSlideshow.css('visibility', 'hidden');

  // Do preload, after all images loaded, start the cycle
  var imagesSlideshow = jQuery('img', objSlideshow);
  var totalImages = imagesSlideshow.length;
  var iTotalImage = 0;

  imagesSlideshow.each(function(){
    jQuery('&lt;img /&gt;').attr('src', jQuery(this).attr('src')).load(function(){
      iTotalImage++;

      if (totalImages == iTotalImage) {
        // Destroy the loading object
        objLoading.remove();

       // Start the cycle
       objSlideshow.css('visibility', 'visible').cycle({
         fx: 'fade',
         speed: 1000,
         timeout: 4000
      });
    }
  });
});
&lt;/script&gt;
</pre>
<p>Thanks for reading! ^_^</p>
]]></content:encoded>
			<wfw:commentRss>http://www.feelinc.me/experience/preloading-images-using-jquery-for-slideshow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lotus Domino – Dojo Pie Chart Legend Color Hack Tips On Zero Value</title>
		<link>http://www.feelinc.me/lotus-domino/dojo-pie-chart-legend-color-hack-tips-on-zero-value/</link>
		<comments>http://www.feelinc.me/lotus-domino/dojo-pie-chart-legend-color-hack-tips-on-zero-value/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 15:55:35 +0000</pubDate>
		<dc:creator>Feelinc</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[domino]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[lotus]]></category>
		<category><![CDATA[pie]]></category>

		<guid isPermaLink="false">http://www.feelinc.me/?p=176</guid>
		<description><![CDATA[Dojo Toolkit is a best free JavaScript library currently exist, which had a lot of ready to use widget for web application UI. One of the widget that we can use is the Dojo Chart Widget. This is quite a common issue when we are using the Dojo Pie Chart Widget with Legend and if [...]]]></description>
			<content:encoded><![CDATA[<p>Dojo Toolkit is a best free JavaScript library currently exist, which had a lot of ready to use widget for web application UI. One of the widget that we can use is the Dojo Chart Widget.</p>
<p>This is quite a common issue when we are using the Dojo Pie Chart Widget with Legend and if some of our data are had zero values then the color at the pie slice is different with the needed legend. In here i came up with a simple solution using XHTML JavaScript manipulation to show the right legends color.</p>
<p>Now we start from the beginning of implementing the Dojo Pie Chart.<span id="more-176"></span></p>
<p>Before we go through to the code implementation, we should think about the JSON data format. What do i know is we have to create this below JSON format for Dojo Pie Chart:</p>
<pre class="brush: plain;">
[
{text:&quot;Lhokga Plant (BU)&quot;,stroke:&quot;black&quot;,color:&quot;#5D8AA8&quot;,y:7},
{text:&quot;Lhoknga Project&quot;,stroke:&quot;black&quot;,color:&quot;#F0F8FF&quot;,y:3},
{text:&quot;Lhoknga Terminal&quot;,stroke:&quot;black&quot;,color:&quot;#E32636&quot;,y:0},
{text:&quot;Belawan Terminal&quot;,stroke:&quot;black&quot;,color:&quot;#E52B50&quot;,y:2},
{text:&quot;Dumai Terminal&quot;,stroke:&quot;black&quot;,color:&quot;#CD2682&quot;,y:0},
{text:&quot;Lhokseumawe Terminal&quot;,stroke:&quot;black&quot;,color:&quot;#9F2B68&quot;,y:0},
{text:&quot;Batam Terminal&quot;,stroke:&quot;black&quot;,color:&quot;#ED3CCA&quot;,y:0}
]
</pre>
<p>Let me explain a little bit about the above format.</p>
<p>&#8220;text&#8221; =&gt; is the label for pie slice<br />
&#8220;stroke&#8221; =&gt; is the pie slice stroke color<br />
&#8220;color&#8221; =&gt; is the pie slice color<br />
&#8220;y&#8221; =&gt; is the pie slice data number</p>
<p>Then we have to prepare an LotusScript Agent to create an JSON data output, let&#8217;s create a simple one.</p>
<pre class="brush: plain;">
Sub Initialize
  Print |Content-Type: text/plain|
  Print |[|
  Print |{text:&quot;Lhokga Plant  (BU)&quot;,stroke:&quot;black&quot;,color:&quot;#5D8AA8&quot;,y:7},|
  Print |{text:&quot;Lhoknga  Project&quot;,stroke:&quot;black&quot;,color:&quot;#F0F8FF&quot;,y:3},|
  Print |{text:&quot;Lhoknga  Terminal&quot;,stroke:&quot;black&quot;,color:&quot;#E32636&quot;,y:0},|
  Print |{text:&quot;Belawan  Terminal&quot;,stroke:&quot;black&quot;,color:&quot;#E52B50&quot;,y:2},|
  Print |{text:&quot;Dumai  Terminal&quot;,stroke:&quot;black&quot;,color:&quot;#CD2682&quot;,y:0},|
  Print |{text:&quot;Lhokseumawe  Terminal&quot;,stroke:&quot;black&quot;,color:&quot;#9F2B68&quot;,y:0},|
  Print |{text:&quot;Batam  Terminal&quot;,stroke:&quot;black&quot;,color:&quot;#ED3CCA&quot;,y:0}|
  Print |]|
End Sub
</pre>
<p>Then you have to place needed HTML code container on your HTML page</p>
<pre class="brush: plain;">
&lt;div id=&quot;chart_data&quot; style=&quot;width: 800px; height: 200px;&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;legend_list right&quot;&gt;
    &lt;div class=&quot;legend_example&quot;&gt;
      &lt;div class=&quot;left&quot;&gt;&amp;nbsp;&lt;/div&gt;
      &lt;label class=&quot;legend_text left&quot;&gt;&lt;/label&gt;
      &lt;div style=&quot;clear:both;&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Then we put the JavaScript code</p>
<pre class="brush: plain;">
dojo.addOnLoad(function() {
  dojo.addClass(dojo.body(), &quot;soria&quot;);

  dojo.xhrPost({
    url:  &quot;http://domain.com/database.nsf/dataAgent?OpenAgent&amp;ur=&quot; + new Date().getMilliseconds(),
    handleAs: &quot;json&quot;,
    error: function(response, ioArgs){
      if (ioArgs.xhr.status != 200) {
        console.error(&quot;HTTP status code: &quot;, ioArgs.xhr.status);
      }
    },
    load: function(response, ioArgs){
      if (response.length &gt; 0) {
        dojo.require(&quot;dojox.charting.plot2d.Pie&quot;);
        dojo.require(&quot;dojox.charting.themes.MiamiNice&quot;);

        var chart = new dojox.charting.Chart2D(&quot;chart_data&quot;);
        chart.setTheme(dojox.charting.themes.MiamiNice).addPlot(&quot;default&quot;, {
          type: &quot;Pie&quot;,
          radius: 150,
          precision: 0
        }).addSeries(&quot;Series A&quot;, response);
        chart.render();

        var i_item = 0;
        var item = {};
        for(i_item in response) {
          item = dojo.clone(dojo.query(&quot;.legend_example&quot;));
          item.removeClass(&quot;legend_example&quot;);
          item.addClass(&quot;legend&quot;);
          item.removeClass(&quot;hidden&quot;);
          item.query(&quot;div.left&quot;).style({backgroundColor: response[i_item].color});
          item.query(&quot;.legend_text&quot;).addContent(response[i_item].text + &quot; &lt;strong&gt;(&quot; + response[i_item].y + &quot;)&lt;/strong&gt;&quot;);
          dojo.place(item[0], dojo.byId(&quot;legend_list&quot;), &quot;last&quot;);
        }

        delete i_item;
        delete item;
        delete chart;
      }
    }
  });
});
</pre>
<p>Hope this tips will be very helpfull for Lotus Domino Developer who want to integrate the Dojo Toolkit especially for the Pie Chart.</p>
<p><span style="color: #ff0000;">*Before running any of those above code, please replace all the double quote with your own.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.feelinc.me/lotus-domino/dojo-pie-chart-legend-color-hack-tips-on-zero-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
