source: cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/examples/yui/yui-more.html @ 5259

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/examples/yui/yui-more.html@5259
Revision 5259, 12.4 KB checked in by domlowe, 11 years ago (diff)

adding yui javascript

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3<head>
4        <title>YUI Library Examples: The YUI Global Object: Load All Modules</title>
5    <meta http-equiv="content-type" content="text/html; charset=utf-8">
6        <link rel="stylesheet" type="text/css" href="../../assets/yui.css" >
7
8<style>
9    /*Supplemental CSS for the YUI distribution*/
10    #custom-doc { width: 95%; min-width: 950px; }
11    #pagetitle {background-image: url(../../assets/bg_hd.gif);}
12    #pagetitle h1 {background-image: url(../../assets/title_h_bg.gif);}
13</style>
14
15<link rel="stylesheet" type="text/css" href="../../assets/dpSyntaxHighlighter.css">
16
17<!--there is no custom header content for this example-->
18
19<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" />
20<script type="text/javascript" src="../../build/yui/yui-debug.js"></script>
21
22</head>
23<body id="yahoo-com" class=" yui-skin-sam">
24<div id="custom-doc" class="yui-t2">
25<div id="hd">
26        <div id="ygunav">
27                <p>
28            <em>
29                <a href="http://developer.yahoo.com/yui/3/">YUI 3.x Home</a> <i> - </i> 
30            </em>
31                </p>
32                <form action="http://search.yahoo.com/search" id="sitesearchform">
33            <input name="vs" type="hidden" value="developer.yahoo.com">
34            <input name="vs" type="hidden" value="yuiblog.com">
35                    <div id="sitesearch">
36                        <label for="searchinput">Site Search (YDN &amp; YUIBlog): </label>
37                            <input type="text" id="searchinput" name="p">
38                            <input type="submit" value="Search" id="searchsubmit" class="ygbt">
39                    </div>
40                </form>
41    </div>
42        <div id="ygma"><a href="../../"><img src="../../assets/logo.gif"  border="0" width="200" height="93"></a></div>
43        <div id="pagetitle"><h1>YUI Library Examples: The YUI Global Object: Load All Modules</h1></div>
44</div>
45<div id="bd">
46
47        <div id="bar-note"><p><strong>Note:</strong> This is YUI 3.x. Looking for <a href="http://developer.yahoo.com/yui/">YUI 2.x</a>?</p></div>
48
49        <div id="yui-main">
50                <div class="yui-b">
51                  <div class="yui-ge">
52                          <div class="yui-u first example" id="main">
53
54        <h2>The YUI Global Object: Load All Modules</h2>
55
56        <div id="example" class="promo">
57        <p>
58        <p>This example shows how to work with all the modules that are available on a page.</p>
59        </p>   
60
61        <div class="module example-container ">
62                        <div class="hd exampleHd">
63                        <p class="newWindowButton yui-skin-sam">
64                <a href="yui-more_clean.html" target="_blank">View example in new window.</a>
65            </p>
66                </div>          <div id="example-canvas" class="bd">
67
68               
69        <!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
70       
71        <!-- include all requirements for node -->
72<script type="text/javascript" src="../../build/oop/oop.js"></script>
73<script type="text/javascript" src="../../build/event/event.js"></script>
74<script type="text/javascript" src="../../build/dom/dom.js"></script>
75<script type="text/javascript" src="../../build/node/node.js"></script>
76
77<style>
78    #demo {
79        border: 1px solid black;
80        background-color: #8DD5E7;
81    }
82    #demo strong {
83        font-weight: bold;
84    }
85</style>
86</head>
87<body>
88
89<div id="demo"></div>
90
91<script>
92
93YUI().use('*', 
94function(Y) {
95    var node = Y.get('#demo');
96    var used = [];
97    Y.each(Y.Env._attached, function(v, k) {
98        used[used.length] = k;
99    });
100    used.sort();
101    node.set('innerHTML', '<strong>Modules Loaded:</strong> ' + used.join(', '));
102});
103</script>
104
105       
106        <!--END SOURCE CODE FOR EXAMPLE =============================== -->
107       
108               
109                </div>
110        </div>                 
111        </div>
112               
113        <h3>Including YUI and Additional Modules on the Page</h3>
114<p>Here we are including any additional dependencies we need within the page instead of relying on loader to pull them in dynamically.</p>
115<textarea name="code" class="JScript">
116<!-- include yui core -->
117<script type="text/javascript" src="../../build/yui/yui.js"></script>
118
119<!-- include all requirements for node -->
120<script type="text/javascript" src="../../build/oop/oop.js"></script>
121<script type="text/javascript" src="../../build/event/event.js"></script>
122<script type="text/javascript" src="../../build/dom/dom.js"></script>
123<script type="text/javascript" src="../../build/node/node.js"></script>
124</textarea>
125
126<h3>Setting up the YUI Instance</h3>
127
128<p>When we create our <code>YUI</code> instance, we'll tell it to load the <code>*</code> module.
129
130<p>The <code>*</code> module is a shorthand module name for all modules on the page.  This way you don't
131have to supply the full list of requirements to the <code>use</code> method.</p>
132<textarea name="code" class="JScript">
133YUI().use('*' ...
134</textarea>
135
136<h3>Using the callback</h3>
137<p>You can pass a function as the last argument to the <code>use</code>. This function will execute after the <code>YUI</code> instance loads all the modules.</p>
138<p>The function is supplied one argument: the <code>YUI</code> instance that we have just created.  When this function executes, all
139of the modules have been loaded and attached to the instance, ready to use.</p>
140<textarea name="code" class="JScript">
141YUI().use('*', function(Y) {
142    // the Y var passed in here will be our YUI instance
143});
144</textarea>
145
146
147<p>Now that we know all of the modules are loaded, we will show a list of the modules loaded in this <code>YUI</code> instance.</p>
148<textarea name="code" class="JScript">
149YUI().use('*', function(Y) {
150    var node = Y.get('#demo');
151    var used = [];
152    Y.each(Y.Env._attached, function(v, k) {
153        used[used.length] = k;
154    });
155    used.sort();
156    node.set('innerHTML', '<strong>Modules Loaded:</strong> ' + used.join(', '));
157});
158</textarea>
159                                </div>
160                                <div class="yui-u sidebar">
161                                       
162                               
163                                        <div id="examples" class="mod box4">
164                        <div class="hd">
165                                                <h4>
166    The YUI Global Object Examples:</h4>
167                        </div>
168                                                <div class="bd">
169                                                        <ul>
170                                                                <li><a href='../yui/yui-core.html'>YUI Core</a></li><li class='selected'><a href='../yui/yui-more.html'>Load All Modules</a></li><li><a href='../yui/yui-multi.html'>Multiple Instances</a></li><li><a href='../yui/yui-compat.html'>YUI 2.x and 3.x</a></li><li><a href='../yui/yui-loader-ext.html'>YUI Loader - Dynamically Adding YUI and External Modules</a></li><li><a href='../yui/yui-extend.html'>Create Class Hierarchies with <code>extend</code></a></li><li><a href='../yui/yui-augment.html'>Compose Classes of Objects with <code>augment</code></a></li><li><a href='../yui/yui-mix.html'>Add Behaviors to Objects with <code>mix</code></a></li><li><a href='../yui/yui-merge.html'>Combine Data Sets with <code>merge</code></a></li><li><a href='../yui/yui-isa.html'>Check Data Types with <code>Lang</code></a></li><li><a href='../yui/yui-ua.html'>Browser Detection with <code>UA</code></a></li>                                                      </ul>
171                                                </div>
172                                        </div>
173                                       
174                                        <div class="mod box4">
175                        <div class="hd">
176                                                <h4>More The YUI Global Object Resources:</h4>
177                        </div>
178                        <div class="bd">
179                                                <ul>
180                                                        <!-- <li><a href="http://developer.yahoo.com/yui/yui/">User's Guide</a> (external)</li> -->
181                                                <li><a href="../../api/module_yui.html">API Documentation</a></li>
182</ul>
183                        </div>
184                                        </div>
185                          </div>
186                </div>
187               
188                </div>
189        </div>
190
191
192<div class="yui-b toc3" id="tocWrapper">
193<!-- TABLE OF CONTENTS -->
194<div id="toc">
195       
196<ul>
197<li class="sect first">YUI 3.x Project</li><li class="item"><a title="The Yahoo! User Interface (YUI) Library, 3.x Branch, " href="http://developer.yahoo.com/yui/3/">YUI 3 Web Site (external)</a></li><li class="item"><a title="Examples of every YUI utility and control in action" href="../../examples/">YUI 3 Examples</a></li><li class="item"><a title="Instantly searchable API documentation for the entire YUI library." href="../../api/">YUI 3 API Docs</a></li><li class="item"><a title="The YUI Library can be downloaded from SourceForge" href="http://sourceforge.net/projects/yui/">YUI 3 on Sourceforge (external)</a></li><li class="item"><a title="YUI is free and open, offered under a BSD license." href="http://developer.yahoo.com/yui/3/license.html">YUI License (external)</a></li><li class="sect">YUI 3 Core - Examples</li><li class="selected "><a title="YUI (Global Prerequisite) - Functional Examples" href="../../examples/yui/index.html">YUI (Global Prerequisite)</a></li><li class="item"><a title="Event - Functional Examples" href="../../examples/event/index.html">Event</a></li><li class="item"><a title="Node - Functional Examples" href="../../examples/node/index.html">Node</a></li><li class="sect">YUI 3 Component Infrastructure - Examples</li><li class="item"><a title="Attribute - Functional Examples" href="../../examples/attribute/index.html">Attribute</a></li><li class="item"><a title="Base - Functional Examples" href="../../examples/base/index.html">Base</a></li><li class="sect">YUI 3 Utilities - Examples</li><li class="item"><a title="Animation - Functional Examples" href="../../examples/anim/index.html">Animation</a></li><li class="item"><a title="Cookie - Functional Examples" href="../../examples/cookie/index.html">Cookie</a></li><li class="item"><a title="Drag &amp; Drop - Functional Examples" href="../../examples/dd/index.html">Drag &amp; Drop</a></li><li class="item"><a title="Get - Functional Examples" href="../../examples/get/index.html">Get</a></li><li class="item"><a title="IO - Functional Examples" href="../../examples/io/index.html">IO</a></li><li class="item"><a title="JSON (JavaScript Object Notation) - Functional Examples" href="../../examples/json/index.html">JSON</a></li><li class="item"><a title="Queue - Functional Examples" href="../../examples/queue/index.html">Queue</a></li><li class="sect">YUI 3 CSS - Examples</li><li class="item"><a title="YUI CSS Reset - Functional Examples" href="../../examples/cssreset/index.html">CSS Reset</a></li><li class="item"><a title="YUI Fonts - Functional Examples" href="../../examples/cssfonts/index.html">CSS Fonts</a></li><li class="item"><a title="YUI Grids - Functional Examples" href="../../examples/cssgrids/index.html">CSS Grids</a></li><li class="item"><a title="YUI Base - Functional Examples" href="../../examples/cssbase/index.html">CSS Base</a></li><li class="sect">The YUI Community</li><li class="item"><a title="The Yahoo! User Interface Blog" href="http://yuiblog.com">YUI Blog (external)</a></li><li class="item"><a title="The Yahoo! Group YDN-JavaScript hosts the YUI community forum" href="http://tech.groups.yahoo.com/group/ydn-javascript/">YUI Forum (external)</a></li><li class="item"><a title="The Yahoo! Group yui3 is dedicated to the 3.x branch of the Yahoo! User Interface (YUI) Library." href="http://tech.groups.yahoo.com/group/yui3/">YUI 3 Forum (external)</a></li><li class="item"><a title="YUI is used by Yahoo! and by hundreds of other sites, including many you know and love." href="/yui/poweredby/">YUI Sightings (external)</a></li><li class="item"><a title="Videos and podcasts from the YUI Team and from the Yahoo! frontend engineering community." href="http://developer.yahoo.com/yui/theater/">YUI Theater (external)</a></li><li class="sect">YUI Articles on the YUI Website</li><li class="item"><a title="Answers to Frequently Asked Questions about the YUI Library" href="http://developer.yahoo.com/yui/articles/faq/">YUI FAQ (external)</a></li><li class="item"><a title="Yahoo!'s philosophy of Graded Browser Support" href="http://developer.yahoo.com/yui/articles/gbs/">Graded Browser Support (external)</a></li><li class="item"><a title="Reporting Bugs and Making Feature Requests for YUI Components" href="http://developer.yahoo.com/yui/articles/reportingbugs/">Bug Reports/Feature Requests (external)</a></li><li class="item"><a title="Serve YUI source files from Yahoo! -- free, fast, and simple" href="http://developer.yahoo.com/yui/3/articles/hosting/">Serving YUI Files from Yahoo! (external)</a></li></ul>
198</div>
199</div>
200        </div><!--closes bd-->
201
202        <div id="ft">
203        <p class="first">Copyright &copy; 2008 Yahoo! Inc. All rights reserved.</p>
204        <p><a href="http://privacy.yahoo.com/privacy/us/devel/index.html">Privacy Policy</a> -
205            <a href="http://docs.yahoo.com/info/terms/">Terms of Service</a> -
206            <a href="http://docs.yahoo.com/info/copyright/copyright.html">Copyright Policy</a> -
207            <a href="http://careers.yahoo.com/">Job Openings</a></p>
208        </div>
209</div>
210<script src="../../assets/dpSyntaxHighlighter.js"></script>
211<script language="javascript"> 
212dp.SyntaxHighlighter.HighlightAll('code'); 
213</script>
214</body>
215</html>
216<!-- delightfuture.corp.yahoo.com uncompressed/chunked Wed Aug 13 16:45:34 PDT 2008 -->
Note: See TracBrowser for help on using the repository browser.