<?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>Web Development Blog by Serdar AKARCA &#187; yui</title>
	<atom:link href="http://yuix.org/category/yui/feed" rel="self" type="application/rss+xml" />
	<link>http://yuix.org</link>
	<description>a web development blog focusing on linux, codeigniter and yui</description>
	<lastBuildDate>Thu, 12 Aug 2010 14:46:11 +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>YUI&#8217;ye Baslangic: YUI Nasil Kullanilir?</title>
		<link>http://yuix.org/web-development/yuiy-dersi-yui-nasil-kullanilir/94</link>
		<comments>http://yuix.org/web-development/yuiy-dersi-yui-nasil-kullanilir/94#comments</comments>
		<pubDate>Fri, 13 Nov 2009 00:30:34 +0000</pubDate>
		<dc:creator>Serdar</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://yuix.org/?p=94</guid>
		<description><![CDATA[YUI, YAHOO tarafından geliştirilen içerisinde javascript ve css kodları bulunduran gelişmiş bir arayüz kütüphanesidir. Arayüz geliştiricilerinin tüm ihtiyaçlarını karşılayacak kadar zengindir. YUI&#8217;nin nasıl kullanıldığını adım adım öğreneceğiz. Devamını okumak için lütfen tıklayınız&#8230; 1. YUI&#8217;yi sayfamıza eklemek YUI&#8217;yi sayfamıza eklememizin en kolay yolu YUI depency configurator sayfasındaki aracı kullanmaktır. Bu araç sayesinde istediğimiz YUI modullerini kolayca [...]]]></description>
			<content:encoded><![CDATA[<p><script src="http://yui.yahooapis.com/combo?2.8.0r4/build/utilities/utilities.js&amp;2.8.0r4/build/selector/selector-min.js" type="text/javascript"></script><br />
 <script src="/yui2.8/form_validation.js" type="text/javascript"></script></p>
<p>YUI, YAHOO tarafından geliştirilen içerisinde javascript ve css kodları bulunduran gelişmiş bir arayüz kütüphanesidir. Arayüz geliştiricilerinin tüm ihtiyaçlarını karşılayacak kadar zengindir. YUI&#8217;nin nasıl kullanıldığını adım adım öğreneceğiz.</p>
<h3><a href="http://yuix.org/web-development/yuiy-dersi-yui-nasil-kullanilir/94">Devamını okumak için lütfen tıklayınız&#8230;</a></h3>
<p><span id="more-94"></span></p>
<h2>1. YUI&#8217;yi sayfamıza eklemek</h2>
<p>YUI&#8217;yi sayfamıza eklememizin en kolay yolu <a href="http://developer.yahoo.com/yui/articles/hosting/">YUI depency configurator</a> sayfasındaki aracı kullanmaktır. Bu araç sayesinde istediğimiz YUI modullerini kolayca ekleyebiliriz. Resimde göründüğü gibi seçimlerimi başlangıç olarak şöyle yapıyorum:</p>
<p><strong>Filter</strong> sekmesinden YUI dosyalarının nerede host edileceğini seçtim. YUI&#8217;yi kendi bilgisayarıma indirmeden ya da host alanıma koymadan kullanacağız. Hızlı başlangıç yapmak için bu şimdilik en iyi yöntem.</p>
<p><strong>YUI CSS Packages</strong> sekmesinden sayfamız için gerekli ve yararlı CSS kütüphanelerini seçtim. Bu kütüphanelerin ne işe yaradığını bir sonraki adımda açıklayacağız.</p>
<p><strong>YUI JavaScript Utilities</strong> sekmesinden Selector Utility ve son olarak utilities.js yi seçtim.</p>
<p>Seçimleri yaptıktan sonra YUI Depency Configurator&#8217;un benim için hazırladığı &#8216;Loading Script and CSS Directly&#8217; sekmesinin altındaki kodu kopyalıyorum.</p>
<pre class="html">  <!-- Combo-handled YUI CSS files: -->
  &lt;link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0r4/build/reset-fonts-grids/reset-fonts-grids.css"&gt;
  <!-- Combo-handled YUI JS files: -->
  &lt;script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.0r4/build/utilities/utilities.js&amp;2.8.0r4/build/selector/selector-min.js"&gt;&lt;/script&gt;</pre>
<p><strong>Kopyaladığımız kodu sayfamızın &lt;head&gt; tag&#8217;i içine yapıştırarak YUI&#8217;yi sayfamıza eklemiş oluyoruz.</strong></p>
<p><img class="wp-image-95" title="yui_2_dependency_configurator" src="http://yuix.org/wp-content/uploads/2009/11/yui_2_dependency_configurator.png" alt="" width="556" /></p>
<h3>Eklediğimiz dosyalar ne işe yarıyor?</h3>
<p>Sayfamıza şu kütüphaneleri yükledik:</p>
<ul>
<li><strong>YUI Fonts, Grids, Reset CSS:</strong> Bu CSS kütüphaneleri web tarayıcıları(browser) arasındaki farkları ortadan kaldırıyor. Hazırladığımız sayfaların her browserda aynı görünmesi için Reset CSS&#8217;i eklememiz gerekmektedir. Ayrıca Font&#8217;ların düzgün render edilmesi için de YUI Fonts kütüphanesi gereklidir. Grids CSS ise layout oluşturmamız için yardımcı bir kütüphanedir. Layout oluşturmak için ayrıca yardımcı bir aracımız var: <a href="http://developer.yahoo.com/yui/grids/builder/">YUI Grid Builder</a></li>
<li><strong>utilities.js:</strong> Utilities.js dosyası çok kullanılan kütüphanelerin toplamıdır. Utilities.js&#8217;yi ekleyerek yui, dom, event, animation, connection, drag&amp;drop, element ve get kütüphanelerini yüklemiş oluyoruz.</li>
</ul>
<h2>2. Hello World: YUI&#8217;yle ilk javascript kodunu yazmak</h2>
<p>YUI&#8217;nin javascript kütüphaneleri sayesinde html elementleri seçmek, seçtiğimiz elementlere listener eklemek ve bu elementlerin özelliklerini değiştirmek çok kolay.</p>
<p>Kolay bir örnekle başlayabiliriz. Hazırladığımız html form&#8217;ları javascript&#8217;le kontrol edelim. Doldurulması zorunlu alanlar varsa kullanıcıyı uyaran form validation kodunu yazalım.</p>
<p>Aşağıdaki formda tüm alanları doldurmak zorunludur.</p>
<form id="form1" action="#" method="post">
<table border="0" cellspacing="4" cellpadding="4" width="100%">
<tbody>
<tr>
<th>Adınız*</th>
<td>
<input class="zorunlu" name="adiniz" type="text" /></td>
<td>adınızı giriniz</td>
</tr>
<tr>
<th>Doğum yılınız*</th>
<td>
<input class="zorunlu yil" name="adiniz" type="text" /></td>
<td>sadece 4 haneli sayı giriniz</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Gönder" /></td>
<td></td>
</tr>
</tbody>
</table>
</form>
<p>Formu şu şekilde oluşturduk:</p>
<pre class="html">&lt;form id="form1" action="#" method="post"&gt;
  &lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;
  &lt;tr&gt;
    &lt;th&gt;Adınız*&lt;/th&gt;
    &lt;td&gt;&lt;input type="text" name="adiniz" class="zorunlu" /&gt;&lt;/td&gt;
    &lt;td&gt;adınızı giriniz&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;th&gt;Doğum yılınız*&lt;/th&gt;
    &lt;td&gt;&lt;input type="text" name="adiniz" class="zorunlu yil" /&gt;&lt;/td&gt;
    &lt;td&gt;sadece 4 haneli sayı giriniz&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt; &lt;/td&gt;
    &lt;td&gt;&lt;input type="submit" value="Gönder"&gt;&lt;/td&gt;
    &lt;td&gt; &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
&lt;/form&gt;</pre>
<p>Form&#8217;a kolayca erişebilmek için &#8220;id&#8221; tanımladık(id=&#8221;form1&#8243;). Adınız alanı için &#8220;zorunlu&#8221; class&#8217;ını ekledik. &#8220;zorunlu&#8221; class&#8217;ına sahip olan input&#8217;ların yazılmasını zorulu yapacağız. Doğum yılı için de hem &#8220;zorunlu&#8221; hem de &#8220;yil&#8221; class&#8217;ını ekledik. Her birini ayrı ayrı kontrol edeceğiz. İlk adım form&#8217;a listener eklemek. Yani form gönderilirken(submit edilirken) kontrolleri yapacak fonksiyonu atamak. Ama ondan önce birkaç kısayol tanımlayacağız.</p>
<pre class="javascript"> var $D = YAHOO.util.Dom;       // elementlerin DOM objesine erişmek için gerekli class
 var $E = YAHOO.util.Event;     // elementlere listener eklemek için gerekli class
 var select = YAHOO.util.Selector.query; // elementleri seçmek için gerekli class</pre>
<pre class="javascript">$E.on('form1', 'submit', function(e) {
  formu_dogrula(e);
}); // 'form1' formuna listener ekledik</pre>
<p>&#8220;form1&#8243; id&#8217;li element &#8216;submit&#8217; edilirken formu_dogrula. Şimdi formu_dogrula fonksiyonunu yazalım.</p>
<pre class="javascript">function formu_dogrula(e) {

  // CSS3 Selector'leri kullanarak istediğimiz elementleri Selector class'ı sayesinde seçebiliyoruz. Detaylar için: http://developer.yahoo.com/yui/selector/
  var zorunlu_alanlar = select('input.zorunlu');  // zorunlu class'ına sahip tüm input elemanlarını -array olarak- seçtik. YAHOO.util.Selector.query fonksiyonu elementleri seçip array olarak döndürür. Seçilen elementlerin tüm DOM özelliklerine erişmek mümkündür. ör: select('input.zorunlu')[0].style.display
  var yil_alanlari = select('input.yil');         // yil class'ına sahip tüm input elemanlarını -array olarak- seçtik.

  // Seçtiğimiz zorunlu_alanlar'ı kontrol etmek için hepsini teker teker for döngüsüyle gezeceğiz.
  for(var i=0;i &lt; zorunlu_alanlar.length;i++) {

    if(zorunlu_alanlar[i].value == "") { // value boş ise
      $D.setStyle(zorunlu_alanlar[i], 'background', '#FF7791'); // doldurulmamış alanı kırmızıya boyuyoruz. Dom fonksiyonları için: http://developer.yahoo.com/yui/dom/
      alert('Lütfen gerekli alanları doldurunuz.');  // uyarı gösteriyoruz.
      zorunlu_alanlar[i].focus(); // Doldurulmamış alana focus ettik.
      $E.preventDefault(e); // formun submit edilmesini engelliyoruz. Tüm Event fonksiyonları için: http://developer.yahoo.com/yui/event/
      return false;
    }
    else {
      $D.setStyle(zorunlu_alanlar[i], 'background', '#97F297'); // Herhangi bir CSS kuralını setStyle fonksiyonuyla elementlere atayabiliriz.
    }

  }

  // Zorunlu alanlar için kontrolleri yaptık şimdi de yil_alanlari'ni kontrol edeceğiz. Bu kez for döngüsü yerine YUI'nin batch fonksiyonunu kullanacağız. batch, fonksiyonel dillerdeki map'in karşılığır. For döngüsünden daha hızlı ve verimli çalışır. Ayrıca anlaşılması da daha kolaydır.

  $D.batch(yil_alanlari, function(el) {

    if(!YAHOO.lang.isNumber(el.value*1)) { // YAHOO.lang class'ı javascript yazarken sıkça kullanılan yardımcı fonksiyonları barındırıyor. Detaylar için:XXXXXXXXX
      $D.setStyle(el, 'background', '#FF7791'); // yanlış doldurulmuş alanı kırmızıya boyuyoruz.
      alert('Yıl alanına yalnızca rakam giriniz.');  // uyarı gösteriyoruz.
      $E.preventDefault(e); // formun submit edilmesini engelliyoruz.
      return false;
    }
    else {
      $D.setStyle(el, 'background', '#97F297');
    }

  });

  return true; // Burada tüm doğrulamalardan geçmiş olan formumuzun post edilmesi için true değerini döndürüyoruz.
}</pre>
<p>Yaptığımız örneği ayrı bir sayfada görmek için <a href="/yui2.8/yui_form_dogrulama.html">buraya tıklayınız</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://yuix.org/web-development/yuiy-dersi-yui-nasil-kullanilir/94/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI Selector IE8 Bug and Solution</title>
		<link>http://yuix.org/web-development/yui-selector-ie8-bug-and-solution/77</link>
		<comments>http://yuix.org/web-development/yui-selector-ie8-bug-and-solution/77#comments</comments>
		<pubDate>Mon, 09 Nov 2009 12:26:37 +0000</pubDate>
		<dc:creator>Serdar</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://yuix.org/?p=77</guid>
		<description><![CDATA[We used YUI 2.5.2 version for a long time on markafoni.com. With the new face of markafoni I decided to update YUI version. I updated YUI to 2.8rc version, but surprisingly I saw javascript errors in all IE8 pages. After googling I found the solution. The problem is was here in selector.js (or selector-min.js): if(YAHOO.env.ua.ie [...]]]></description>
			<content:encoded><![CDATA[<p>We used YUI 2.5.2 version for a long time on <a href="http://markafoni.com">markafoni.com</a>. With the new face of markafoni I decided to update YUI version. I updated YUI to 2.8rc version, but surprisingly I saw javascript errors in all IE8 pages. After googling I found the solution. The problem is was here in selector.js (or selector-min.js):</p>
<pre name="code" class="javascript">
if(YAHOO.env.ua.ie &#038;&#038; YAHOO.env.ua.ie<8)
</pre>
<p>Change to:</p>
<pre name="code" class="javascript">
if(YAHOO.env.ua.ie &#038;&#038; ((!document.documentMode &#038;&#038; YAHOO.env.ua.ie<8) || document.documentMode < 8))
</pre>
]]></content:encoded>
			<wfw:commentRss>http://yuix.org/web-development/yui-selector-ie8-bug-and-solution/77/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI 3 experimental example</title>
		<link>http://yuix.org/web-development/yui-3-experimental-example/19</link>
		<comments>http://yuix.org/web-development/yui-3-experimental-example/19#comments</comments>
		<pubDate>Tue, 09 Sep 2008 11:59:10 +0000</pubDate>
		<dc:creator>Serdar</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[yui]]></category>
		<category><![CDATA[random colors]]></category>
		<category><![CDATA[recursive methods]]></category>
		<category><![CDATA[yui 3]]></category>

		<guid isPermaLink="false">http://yuix.org/?p=19</guid>
		<description><![CDATA[As a YUI fan, I am excited about new release of YUI. There is a total diffrence between YUI 2.x and YUI 3.x. Now it is time to try new YUI 3.x I made an experimental example using Node and Event modules. Here is the example. Creating elements are very easy with new YUI: Y.Node.create('&#60;div [...]]]></description>
			<content:encoded><![CDATA[<p>As a YUI fan, I am excited about new release of YUI. There is a total diffrence between YUI 2.x and YUI 3.x. Now it is time to try new YUI 3.x</p>
<p>I made an experimental example using Node and Event modules. Here is <a target="_blank" href="http://yuix.org/examples/yui3-example.html">the example</a>.</p>
<p>Creating elements are very easy with new YUI:</p>
<pre name="code" class="javascript">
Y.Node.create('&lt;div class="class" style="style:value;"&gt;
Lorem ipsum
&lt;/div&gt;');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://yuix.org/web-development/yui-3-experimental-example/19/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Portfolio</title>
		<link>http://yuix.org/portfolio/hello-world/1</link>
		<comments>http://yuix.org/portfolio/hello-world/1#comments</comments>
		<pubDate>Fri, 05 Sep 2008 12:18:00 +0000</pubDate>
		<dc:creator>Serdar</dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://yuix.org/?p=1</guid>
		<description><![CDATA[markafoni.com : Markafoni is an e-commerce site. It is a Django Project, so I worked only front-end. icanfootball.com: I Can Football is a football game by Sobee. I used Codeigniter and YUI on this site. It was my first MSSQL project. usaksofrasi.com : Uşak Sofrası is my experimental project. It is a clone of Yemek [...]]]></description>
			<content:encoded><![CDATA[<p><strong>markafoni.com :</strong> <a href="http://markafoni.com">Markafoni</a> is an e-commerce site. It is a Django Project, so I worked only front-end.</p>
<p><strong>icanfootball.com:</strong> <a href="http://icanfootball.com">I Can Football</a> is a football game by <a href="sobee.com.tr">Sobee</a>. I used Codeigniter and YUI on this site. It was my first MSSQL project.</p>
<p><strong>usaksofrasi.com :</strong> <a href="http://usaksofrasi.com">Uşak Sofrası</a> is my experimental project. It is a clone of <a href="http://yemeksepeti.com">Yemek Sepeti</a> -food order site-. Usaksofrasi is my first codeigniter project.</p>
<p><strong>trabzoncell.com.tr :</strong> <a href="http://trabzoncell.com.tr">Trabzoncell</a> I fully coded backend and frontend. As my favourites I used YUI and Codeigniter.</p>
<p><strong>turkolimpiyattakimi.gov.tr :</strong> <a href="http://turkolimpiyattakimi.gov.tr">Türk Olimpiyat Takımı</a> is the offical site of Turkish Olympic Team. I developed all front-end on this site.</p>
]]></content:encoded>
			<wfw:commentRss>http://yuix.org/portfolio/hello-world/1/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
