<?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>YUI Coder &#187; YUI Loader</title>
	<atom:link href="http://www.yuicoder.com/category/yui-loader/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yuicoder.com</link>
	<description>Manipulating the Yahoo User Interface to your will!</description>
	<lastBuildDate>Fri, 19 Mar 2010 23:59:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a FIXED element with re-size and scroll detection using YUI dom and event</title>
		<link>http://www.yuicoder.com/2009/03/creating-a-fixed-element-with-re-size-and-scroll-detection-using-yui-dom-and-event/</link>
		<comments>http://www.yuicoder.com/2009/03/creating-a-fixed-element-with-re-size-and-scroll-detection-using-yui-dom-and-event/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 00:05:05 +0000</pubDate>
		<dc:creator>Jeffrey Cobb</dc:creator>
				<category><![CDATA[YUI Loader]]></category>
		<category><![CDATA[YUI Mish Mash]]></category>
		<category><![CDATA[YUI Util DOM]]></category>
		<category><![CDATA[createElement]]></category>
		<category><![CDATA[Get]]></category>
		<category><![CDATA[getPreviousSibling()]]></category>
		<category><![CDATA[getViewPortHeight()]]></category>
		<category><![CDATA[getViewPortWidth()]]></category>
		<category><![CDATA[inDocument()]]></category>
		<category><![CDATA[insertAfter]]></category>
		<category><![CDATA[setStyle()]]></category>
		<category><![CDATA[window.resize]]></category>
		<category><![CDATA[YAHOO.Dom.Event]]></category>
		<category><![CDATA[YAHOO.util.Event.addListner]]></category>
		<category><![CDATA[YUI Event]]></category>

		<guid isPermaLink="false">http://www.yuicoder.com/?p=85</guid>
		<description><![CDATA[We have all see them and some of us love them. It&#8217;s those elements that seem to float on the page like hovering little angels. Ok enough with the sappy crap&#8230;down to business. So you need to create a browser independent simple script to position an element on a page. I put together a simple [...]]]></description>
			<content:encoded><![CDATA[<p>We have all see them and some of us love them. It&#8217;s those elements that seem to float on the page like hovering little angels. Ok enough with the sappy crap&#8230;down to business. So you need to create a browser independent simple script to position an element on a page. I put together a simple script that will handle such a task and is flexible enough for even a newbie to&nbsp;configure. </p>
<p>In this example my task is to create a footer element that will stay on the bottom of the browser window during re-size and scroll events.<a href="http://yuicoder.com/examples/fixedFooter.html" target="blank">View the completed&nbsp;project</a>\n</p>
<h2>CSS</h2>
<p>First you will need to specify the position and size of your&nbsp;element.</p>
<pre>
<textarea name="code" class="css" cols="60" rows="10">#screenFooter {
  position: absolute;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 25px;}
</textarea>
</pre>
<h2>HTML</h2>
<p>Assign your element an&nbsp;ID!</p>
<pre>
<textarea name="code" class="html" cols="60" rows="10">
<div id="screenFooter">YuiCoder.com</div>

</textarea>
</pre>
<h2>Javascript</h2>
<p>Insert the following code to the bottom of the page just before the body tag.<br />
In this example I am using the YUI Loader to speed up deployment of my examples. You do not need to user YUI Loader but remember you will need to load the yahoo, dom and event scripts from the YUI Library in order for this to&nbsp;work.</p>
<pre>
<textarea name="code" class="javascript" cols="60" rows="10">
<!--
var loader = new YAHOO.util.YUILoader({
    require: ["dom","event"],
    loadOptional: true,
    onSuccess: function() {
    Ydom = YAHOO.util.Dom;

// Start LoadFooter Code
// Fires of the LoadFooter function when the browser dom is ready
Yevent.onDOMReady(LoadFooter);

// Scroll event listner
YAHOO.util.Event.addListener(window, 'scroll',
    function(){
       var Ydom = YAHOO.util.Dom;
       Ydom.setStyle(Ydom.get('screenFooter'),'visibility','hidden');
       LoadFooter();
      }
);

YAHOO.util.Event.addListener(window, 'resize', LoadFooter );
},
    timeout: 10000,
    combine: true
});
loader.insert();

function LoadFooter(){
// Get the footer element as an object
var footer = Ydom.get('screenFooter');
// Get the element loaded BEFORE the footer
var footer2 = Ydom.getPreviousSibling(footer);

    // Create an element just before the footer. This will ensure the footer does not hide anything
	//on the bottom of your page
    if(!Ydom.inDocument('footerBreak') ){
      var b = document.createElement('div');
          b.style.height = '37px';
          b.id = 'footerBreak';
       Ydom.insertAfter(b,footer2);
    }

    // Get the document scroll TOP position
    var sfS = Ydom.getDocumentScrollTop();
	// Get the document ViewPort size - subtract the footer size then add the scroll top position
    var sfH = Ydom.getViewportHeight() - 37 + sfS;
	// Note if you are dealing with an element that is smaller than 100% of the document viewport
	// add calculations for the getViewportWidth() for horizonal scrolling detection

	// Here we set the style properties of the footer
    Ydom.setStyle(footer,'position','absolute');
    Ydom.setStyle(footer,'top',sfH+'px');
    Ydom.setStyle(footer,'visibility','visible');
}

-->
</textarea>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.yuicoder.com/2009/03/creating-a-fixed-element-with-re-size-and-scroll-detection-using-yui-dom-and-event/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Override alert() with a YUI Dialog</title>
		<link>http://www.yuicoder.com/2009/03/override-alert-with-a-yui-dialog/</link>
		<comments>http://www.yuicoder.com/2009/03/override-alert-with-a-yui-dialog/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 12:34:18 +0000</pubDate>
		<dc:creator>Jeffrey Cobb</dc:creator>
				<category><![CDATA[Dialog]]></category>
		<category><![CDATA[YUI Animation]]></category>
		<category><![CDATA[YUI Container]]></category>
		<category><![CDATA[YUI Get]]></category>
		<category><![CDATA[YUI Loader]]></category>
		<category><![CDATA[YUI Mish Mash]]></category>
		<category><![CDATA[Container]]></category>
		<category><![CDATA[Panel]]></category>
		<category><![CDATA[Simple Dialog]]></category>
		<category><![CDATA[window.alert]]></category>

		<guid isPermaLink="false">http://www.yuicoder.com/?p=51</guid>
		<description><![CDATA[You know and I know and everyone knows the alert boxes generated by the browsers are OLD-SCHOOL and look like garbage. Well using YUI you can easily change that by just including a little code in you page. Simply add the code below to the bottom of your page just before the end body tag [...]]]></description>
			<content:encoded><![CDATA[<p>You know and I know and everyone knows the alert boxes generated by the browsers are OLD-SCHOOL and look like garbage. Well using YUI you can easily change that by just including a little code in you page. Simply add the code below to the bottom of your page just before the end body tag then add the body style to the begining body tag called &#8220;yui-skin-sam&#8221; and that&#8217;s it. Oh and don&#8217;t forget to include your YUI Framework base and the additional scripts &#8220;container&#8221;, &#8220;dragdrop&#8221; and &#8220;animation&#8221;. For an example on how to included the YUI Framework and load specific parts check out <a href="http://www.yuicoder.com/2009/03/override-alert-with-a-yui-dialog/">for a quick start guide for YUI Loader and Yahoo&nbsp;CDN</a>.</p>
<pre name="code" class="JavaScript">
AlertDialog = new YAHOO.widget.SimpleDialog("dlg1", {
  width: "200px",
  effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.15},
  fixedcenter:true,
  modal:true,
  visible:false,
  close: true,
  constraintoviewport: true,
  buttons: [ { text:"close", handler: function(){this.hide();}, isDefault:true }],
  draggable:false,
                effect: [
                      { effect:YAHOO.widget.ContainerEffect.FADE,duration:0.1 }]
});

AlertDialog.setHeader("Alert");
AlertDialog.render(document.body);
window.alert = function(text) {
  AlertDialog.cfg.setProperty("text",text);
  AlertDialog.show();
};
</pre>
<p><a href="#" onclick="alert('Hello');return false; ">Click HERE</a> for an&nbsp;example:</p>
<h3>A permanent&nbsp;solution!</h3>
<p>If you would like to override the alert box throughout your entire site or application, save the code to your server in a public script folder. Example: as alertBox.js. Then load the script using YUI Get with-in the YUI Loader BEFORE firing off your init() routine. Here is an&nbsp;example.</p>
<pre name="code" class="JavaScript">
<script src="http://yui.yahooapis.com/2.7.0/build/yuiloader/yuiloader-min.js"</script>

<script>
var loader = new YAHOO.util.YUILoader({
    require: ["get","dom","event"],
    loadOptional: true,
    onSuccess: function() {
    Yevent = YAHOO.util.Event;
    Ydom = YAHOO.util.Dom;
    var objTransaction = YAHOO.util.Get.script("http://www.yuicoder.com/scripts/application/view/alertBox.js",	
{ onSuccess: function() {
                    	alert("file loaded");
                             });
    Yevent.onDOMReady(init);
    },
    timeout: 10000,
    combine: true
});
loader.insert();
function init(){
console.warn('YUI Loaded');
}
</script>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.yuicoder.com/2009/03/override-alert-with-a-yui-dialog/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using the YUI Loader and Yahoo&#8217;s CDN Rollup</title>
		<link>http://www.yuicoder.com/2009/03/using-the-yui-loader-and-yahoos-cdn-rollup/</link>
		<comments>http://www.yuicoder.com/2009/03/using-the-yui-loader-and-yahoos-cdn-rollup/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 21:07:04 +0000</pubDate>
		<dc:creator>Jeffrey Cobb</dc:creator>
				<category><![CDATA[YUI Loader]]></category>
		<category><![CDATA[YUI Mish Mash]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[FireBug]]></category>
		<category><![CDATA[Get]]></category>
		<category><![CDATA[HTML DOM]]></category>
		<category><![CDATA[init()]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[onDomReady]]></category>
		<category><![CDATA[Rollup]]></category>
		<category><![CDATA[Yahoo User Interface]]></category>
		<category><![CDATA[YUI Framework]]></category>

		<guid isPermaLink="false">http://www.yuicoder.com/?p=26</guid>
		<description><![CDATA[Using the YUI Loader and the script below will allow you to implement the YUI framework within your application with out downloading and installing the YUI framework to your&#160;server.


 
var loader = new YAHOO.util.YUILoader({
    require: ["get","dom","event"],
    loadOptional: true,
    onSuccess: function() {
    YAHOO.util.Event.onDOMReady(init);
  [...]]]></description>
			<content:encoded><![CDATA[<p>Using the YUI Loader and the script below will allow you to implement the YUI framework within your application with out downloading and installing the YUI framework to your&nbsp;server.</p>
<pre name="code" class="JavaScript">
<script src="http://yui.yahooapis.com/2.7.0/build/yuiloader/yuiloader-min.js"></script>
<script> 
var loader = new YAHOO.util.YUILoader({
    require: ["get","dom","event"],
    loadOptional: true,
    onSuccess: function() {
    YAHOO.util.Event.onDOMReady(init);
    },
    timeout: 10000,
    combine: true
});
loader.insert();

function init(){
console.warn('YUI Loaded');
}
</script>
</pre>
<h3>Verify&nbsp;Installation:</h3>
<p>I have included a console function that will send a warning to your FireBug application telling you that everything has loaded correctly. If you run this code and see the warning message in your FireBug console, then your code is installed&nbsp;correctly.</p>
<h3>Adding your own&nbsp;code:</h3>
<p>Replace the following line with your code and your ready to&nbsp;run.</p>
<pre name="code" class="JavaScript">
console.warn('YUI Loaded');
</pre>
<h3>Adding resources from&nbsp;YUI:</h3>
<p>In order to use specific parts of the YUI framework you will need to request the files from the YUI CDN. To do this simply add the required YUI library to the require array as shown&nbsp;below.</p>
<pre name="code" class="JavaScript">
"require: ["get","dom","event","datatable","animation"],
</pre>
<h3>Things to&nbsp;remember</h3>
<p>
The YUI Loader may cause problems when working with older browsers such as IE6. Be sure to wrap you loader using the onDOMReady method like&nbsp;so.</p>
<pre name="code" class="JavaScript">
Yevent.onDOMReady(init);</pre>
<p>This will ensure that the browser has finished loading the DOM before firing off your&nbsp;scripts.</p>
<p> UPDATED (2009-07-22):  &#8220;missing > in code and removed Yevent&nbsp;shortcuts&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yuicoder.com/2009/03/using-the-yui-loader-and-yahoos-cdn-rollup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
