Merge lp:~sidnei/lazr-js/combo-service into lp:lazr-js

Proposed by Sidnei da Silva
Status: Merged
Merged at revision: not available
Proposed branch: lp:~sidnei/lazr-js/combo-service
Merge into: lp:lazr-js
Diff against target: 2210 lines (+1015/-564)
32 files modified
Makefile (+7/-4)
combo.tac (+30/-0)
examples/activator/index.html (+15/-21)
examples/anim/index.html (+27/-18)
examples/autocomplete/index.html (+273/-276)
examples/choiceedit/index.html (+26/-37)
examples/combo.html (+201/-0)
examples/effects/index.html (+46/-27)
examples/error/index.html (+18/-37)
examples/formoverlay/index.html (+24/-28)
examples/inlineeditor/index.html (+25/-16)
examples/lazr/index.html (+27/-17)
examples/overlay/index.html (+24/-27)
examples/picker/index.html (+20/-20)
src-js/lazrjs/activator/activator.js (+3/-2)
src-js/lazrjs/autocomplete/autocomplete.js (+2/-1)
src-js/lazrjs/choiceedit/assets/choiceedit-core.css (+1/-1)
src-js/lazrjs/choiceedit/assets/skins/sam/choiceedit-skin.css (+3/-0)
src-js/lazrjs/choiceedit/choiceedit.js (+4/-3)
src-js/lazrjs/effects/effects.js (+2/-1)
src-js/lazrjs/error/assets/skins/sam/error-skin.css (+3/-0)
src-js/lazrjs/error/error.js (+1/-1)
src-js/lazrjs/formoverlay/assets/skins/sam/formoverlay-skin.css (+3/-0)
src-js/lazrjs/formoverlay/formoverlay.js (+1/-1)
src-js/lazrjs/inlineedit/editor.js (+2/-1)
src-js/lazrjs/lazr/lazr.js (+1/-1)
src-js/lazrjs/overlay/assets/pretty-overlay-core.css (+10/-5)
src-js/lazrjs/overlay/overlay.js (+2/-2)
src-js/lazrjs/picker/picker.js (+2/-1)
src-py/lazr/js/build.py (+0/-11)
src-py/lazr/js/meta.py (+94/-2)
src-py/lazr/js/tests/test_meta.py (+118/-3)
To merge this branch: bzr merge lp:~sidnei/lazr-js/combo-service
Reviewer Review Type Date Requested Status
Māris Fogels (community) Approve
Edwin Grubbs Pending
Review via email: mp+15009@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sidnei da Silva (sidnei) wrote :

- Implements a demo combo-service which is able to serve the contents of the 'build' directory (see examples/combo.html)
- Fix all examples to use pure loader goodness.

Revision history for this message
Māris Fogels (mars) wrote :

Hi Sidnei,

This looks good. If you have to, I think you could land it as-is, but I do have some comments about the branch:

• Nice formoverlay example in combo.html. It is very straight forward
• Why did some of the lazr module dependencies get updated?
• Do we need to include the css* module dependencies, or can they be inlined on the page? I worry about the two approaches confusing developers.
• test_extract_skinnable() and test_extract_skinnable_with_lazr_conventions() look like copy-n-paste code. Can the common parts be put into a parameterized method?
• Use Y.one() instead of Y.get()

I think we can define a global LAZR() function in lazr-meta to replace YUI(), but that can be saved for another branch.

Maris

review: Approve
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

On November 19, 2009, Māris Fogels wrote:
> I think we can define a global LAZR() function in lazr-meta to replace
> YUI(), but that can be saved for another branch.
>

I don't think that is particularly interesting since all applications will
need to merge in their own modules in the LAZR config. So why define a LAZR()
wrapper, when you'll need to define a LP(), U1(), LANDSCAPE() one?

--
Francis J. Lacoste
<email address hidden>

lp:~sidnei/lazr-js/combo-service updated
194. By Sidnei da Silva

- Move css modules inline

Revision history for this message
Sidnei da Silva (sidnei) wrote :

Thanks for the review.

- CSS modules: I've updated the examples to inline them.
- Module dependencies: Only overlay was changed, to make the dependencies more explicit, the other changes were about adding 'skinnable'.
- Tests: they look very similar, you have to look a bit closer to notice the difference yeah. :)
- Y.get(): I didn't introduce any new one. But it would be nice to do a once-over and clear them all.

Revision history for this message
Sidnei da Silva (sidnei) wrote :

FWIW, I don't think it's a good idea to define a global LAZR, since the plan to include lazr-meta.js other projects, each of which will have to define it's own YUI() instance.

Revision history for this message
Māris Fogels (mars) wrote :

On Thu, Nov 19, 2009 at 12:34 PM, Sidnei da Silva
<email address hidden> wrote:
> FWIW, I don't think it's a good idea to define a global LAZR, since the plan to include lazr-meta.js other projects, each of which will have to define it's own YUI() instance.

So, I was suggesting the global LAZR() YUI wrapper because there is
code in each example that constructs a LAZR_YUI_CONFIG, and then
passes that into a YUI() constructor. Instead of doing so, why not
combine the two steps into a project-specific LZR() convenience
function? The function would *not* be for use outside of lazr-js,
just for convenience inside. I can see every individual YUI project
going this route, wrapping the YUI constructor as their needs dictate.

Regarding including lazr-meta.js: we will have to see how it works in
practice. I assumed that lazr-meta was for the purpose of running the
lazr project for development and demonstration purposes. I did not
think other projects would ever import lazr-meta.

I am wary of the idea of combining meta-dependencies like this: at
most, you could pull in the YUI config object's "modules" section.
All of the other configuation settings should be left to the
individual project.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2009-11-13 20:43:37 +0000
+++ Makefile 2009-11-19 17:33:11 +0000
@@ -21,11 +21,12 @@
2121
22# Update the build directory22# Update the build directory
23build: $(PY)23build: $(PY)
24 $(PYTHON) -S bin/jsbuild24 cp -r src-js/lazrjs/yui/* build
25 $(PYTHON) -S bin/jsbuild -b build/lazr -s src-js/lazrjs -n lazr -x lazr/yui
25 $(PYTHON) -S bin/yuimeta -n LAZR_MODULES \26 $(PYTHON) -S bin/yuimeta -n LAZR_MODULES \
26 -s build \27 -s build/lazr \
27 -p lazrjs -x "(-min|-debug|-all|-meta|build/lazr.js|lazr/yui|test)" \28 -p lazr -x "(-min|-debug|-all|-meta|build/lazr/lazr.js|test)" \
28 -o build/lazrjs-meta.js29 -o build/lazr/lazr-meta.js
2930
30lint:31lint:
31 $(PYTHON) -S bin/jslint32 $(PYTHON) -S bin/jslint
@@ -51,6 +52,8 @@
51$(PY): bin/buildout buildout.cfg setup.py52$(PY): bin/buildout buildout.cfg setup.py
52 $(PYTHON) -S ./bin/buildout53 $(PYTHON) -S ./bin/buildout
5354
55run: $(PY)
56 $(PY) `which twistd` -ny combo.tac
5457
55clean:58clean:
56 rm -fr build/* bin59 rm -fr build/* bin
5760
=== added file 'combo.tac'
--- combo.tac 1970-01-01 00:00:00 +0000
+++ combo.tac 2009-11-19 17:33:11 +0000
@@ -0,0 +1,30 @@
1import os
2
3from lazr.js.combo import combo_app
4
5from twisted.application import service, strports
6from twisted.internet import reactor
7from twisted.python import threadpool
8from twisted.web import server, wsgi
9from twisted.web.static import File
10from twisted.web.resource import Resource
11
12
13resource = Resource()
14for path in os.listdir("build"):
15 folder = os.path.join("build", path)
16 if os.path.isdir(folder):
17 resource.putChild(path, File(folder))
18
19threadpool = threadpool.ThreadPool(0, 10)
20threadpool.start()
21reactor.addSystemEventTrigger("during", "shutdown", threadpool.stop)
22
23resource.putChild("combo", wsgi.WSGIResource(reactor, threadpool,
24 combo_app("build")))
25
26application = service.Application("combo-service")
27site = server.Site(resource)
28
29s = strports.service("tcp:9876", site)
30s.setServiceParent(application)
031
=== modified file 'examples/activator/index.html'
--- examples/activator/index.html 2009-10-22 20:22:12 +0000
+++ examples/activator/index.html 2009-11-19 17:33:11 +0000
@@ -3,17 +3,24 @@
3<html>3<html>
4<head>4<head>
5 <title>Lazr-js examples: Activator</title>5 <title>Lazr-js examples: Activator</title>
6 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>6
7 <script type="text/javascript" src="../../build/anim/anim.js"></script>7 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset-min.css"></link>
8 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>8 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts-min.css"></link>
9 <script type="text/javascript" src="../../build/activator/activator.js"></script>9 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base-min.css"></link>
10
11 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
12 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
13 <script type="text/javascript">
14 var LAZR_YUI_CONFIG = {
15 filter: "min",
16 base: "../../build/",
17 modules: LAZR_MODULES,
18 };
19 </script>
1020
11<script id="example-script" type="text/javascript">21<script id="example-script" type="text/javascript">
1222
13YUI({23YUI(LAZR_YUI_CONFIG).use('node', 'lazr.activator', function(Y) {
14 base: '../../build/yui/current/build/',
15 filter: 'raw'
16 }).use('node', 'lazr.activator', function(Y) {
1724
18 Y.log('hooking up widget');25 Y.log('hooking up widget');
19 var content_box = Y.get('#example-activator');26 var content_box = Y.get('#example-activator');
@@ -92,19 +99,6 @@
92});99});
93</script>100</script>
94101
95 <!--
96 We need to include individual css files because some of them have
97 relative paths to images.
98 -->
99 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssreset/reset.css" />
100 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssfonts/fonts.css" />
101 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssbase/base.css" />
102
103 <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"></link>
104 <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"></link>
105 <link type="text/css" rel="stylesheet" href="../../build/activator/assets/activator-core.css"></link>
106 <link type="text/css" rel="stylesheet" href="../../build/activator/assets/skins/sam/activator-skin.css"></link>
107</head>
108<body class="yui-skin-sam" style="margin: 1em">102<body class="yui-skin-sam" style="margin: 1em">
109103
110<h1>Activator Widget</h1>104<h1>Activator Widget</h1>
111105
=== modified file 'examples/anim/index.html'
--- examples/anim/index.html 2009-11-10 22:57:58 +0000
+++ examples/anim/index.html 2009-11-19 17:33:11 +0000
@@ -1,21 +1,26 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html>3<html>
4<head>4<head>
5 <title>Lazr-js examples: anim</title>5 <title>Lazr-js examples: anim</title>
6 <script type="text/javascript" src="../../build/yui/current/build/yui/yui-min.js"></script>6
7 <script type="text/javascript" src="../../build/yui/current/build/oop/oop-min.js"></script>7 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset-min.css"></link>
8 <script type="text/javascript" src="../../build/yui/current/build/event/event-min.js"></script>8 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts-min.css"></link>
9 <script type="text/javascript" src="../../build/yui/current/build/attribute/attribute-min.js"></script>9 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base-min.css"></link>
10 <script type="text/javascript" src="../../build/yui/current/build/base/base-min.js"></script>10
11 <script type="text/javascript" src="../../build/yui/current/build/dom/dom-min.js"></script>11 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
12 <script type="text/javascript" src="../../build/yui/current/build/node/node-min.js"></script>12 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
13 <script type="text/javascript" src="../../build/yui/current/build/anim/anim-min.js"></script>13 <script type="text/javascript">
1414 var LAZR_YUI_CONFIG = {
15 <script type="text/javascript" src="../../build/anim/anim.js"></script>15 filter: "min",
16 <script type="text/javascript">16 base: "../../build/",
1717 modules: LAZR_MODULES,
18YUI().use('node', 'event', 'lazr.anim', function(Y) {18 insertBefore: "style-overrides",
19 };
20 </script>
21 <script type="text/javascript">
22
23YUI(LAZR_YUI_CONFIG).use('node', 'event', 'lazr.anim', function(Y) {
1924
20 Y.on('click', function(ev) {25 Y.on('click', function(ev) {
21 var id = ev.target ? ev.target.getAttribute('id') : null;26 var id = ev.target ? ev.target.getAttribute('id') : null;
@@ -64,9 +69,8 @@
64});69});
6570
66 </script>71 </script>
67 <style>72 <style id="style-overrides" type="text/css">
68 #flash73 #flash {
69 {
70 width:200px;74 width:200px;
71 height: 200px;75 height: 200px;
72 margin-bottom: 20px;76 margin-bottom: 20px;
@@ -92,7 +96,12 @@
92pre-configured animation objects.</p>96pre-configured animation objects.</p>
9397
94<pre>98<pre>
95YUI().use('lazr.anim', function(Y) {99var LAZR_YUI_CONFIG = {
100 filter: "min",
101 base: "../../build/",
102 modules: LAZR_MODULES,
103};
104YUI(LAZR_YUI_CONFIG).use('lazr.anim', function(Y) {
96105
97 var yellow = Y.lazr.anim.flash_in(...); // A yellow flash.106 var yellow = Y.lazr.anim.flash_in(...); // A yellow flash.
98 var green = Y.lazr.anim.green_flash(...); // A green flash.107 var green = Y.lazr.anim.green_flash(...); // A green flash.
99108
=== modified file 'examples/autocomplete/index.html'
--- examples/autocomplete/index.html 2009-11-12 18:00:07 +0000
+++ examples/autocomplete/index.html 2009-11-19 17:33:11 +0000
@@ -4,284 +4,274 @@
4<head>4<head>
5 <title>Lazr-js examples: autocomplete</title>5 <title>Lazr-js examples: autocomplete</title>
66
7 <link type="text/css" rel="stylesheet" href="../../build/yui/current/build/cssreset/reset.css"></link>7 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset-min.css"></link>
8 <link type="text/css" rel="stylesheet" href="../../build/yui/current/build/cssfonts/fonts.css"></link>8 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts-min.css"></link>
9 <link type="text/css" rel="stylesheet" href="../../build/yui/current/build/cssbase/base.css"></link>9 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base-min.css"></link>
1010
1111 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
12 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>12 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
13 <script type="text/javascript" src="../../build/yui/current/build/widget/widget-position-debug.js"></script>
14 <script type="text/javascript" src="../../build/yui/current/build/widget/widget-position-ext-debug.js"></script>
15 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>
16 <script type="text/javascript" src="../../build/autocomplete/autocomplete.js"></script>
17 <script type="text/javascript">13 <script type="text/javascript">
1814 var LAZR_YUI_CONFIG = {
19var LP = YUI({15 filter: "min",
20 base: '../../build/yui/current/build/',16 base: "../../build/",
21 filter: 'raw'17 modules: LAZR_MODULES,
22});18 insertBefore: "style-overrides",
2319 };
24var countries = [20
25 "European Union",21 var LP = YUI(LAZR_YUI_CONFIG);
26 "United States",22
27 "Japan",23 var countries = [
28 "Germany",24 "European Union",
29 "China (PRC)",25 "United States",
30 "United Kingdom",26 "Japan",
31 "France",27 "Germany",
32 "Italy",28 "China (PRC)",
33 "Spain",29 "United Kingdom",
34 "Canada",30 "France",
35 "Brazil",31 "Italy",
36 "Russia",32 "Spain",
37 "India",33 "Canada",
38 "South Korea",34 "Brazil",
39 "Australia",35 "Russia",
40 "Mexico",36 "India",
41 "Netherlands",37 "South Korea",
42 "Turkey",38 "Australia",
43 "Sweden",39 "Mexico",
44 "Belgium",40 "Netherlands",
45 "Indonesia",41 "Turkey",
46 "Switzerland",42 "Sweden",
47 "Poland",43 "Belgium",
48 "Norway",44 "Indonesia",
49 "Republic of China",45 "Switzerland",
50 "Saudi Arabia",46 "Poland",
51 "Austria",47 "Norway",
52 "Greece",48 "Republic of China",
53 "Denmark",49 "Saudi Arabia",
54 "Iran",50 "Austria",
55 "South Africa",51 "Greece",
56 "Argentina",52 "Denmark",
57 "Ireland",53 "Iran",
58 "Thailand",54 "South Africa",
59 "Finland",55 "Argentina",
60 "Venezuela",56 "Ireland",
61 "Portugal",57 "Thailand",
62 "Hong Kong",58 "Finland",
63 "United Arab Emirates",59 "Venezuela",
64 "Malaysia",60 "Portugal",
65 "Czech Republic",61 "Hong Kong",
66 "Colombia",62 "United Arab Emirates",
67 "Nigeria",63 "Malaysia",
68 "Romania",64 "Czech Republic",
69 "Chile",65 "Colombia",
70 "Israel",66 "Nigeria",
71 "Singapore",67 "Romania",
72 "Philippines",68 "Chile",
73 "Pakistan",69 "Israel",
74 "Ukraine",70 "Singapore",
75 "Hungary",71 "Philippines",
76 "Algeria",72 "Pakistan",
77 "New Zealand",73 "Ukraine",
78 "Egypt",74 "Hungary",
79 "Kuwait",75 "Algeria",
80 "Peru",76 "New Zealand",
81 "Kazakhstan",77 "Egypt",
82 "Slovakia",78 "Kuwait",
83 "Morocco",79 "Peru",
84 "Bangladesh",80 "Kazakhstan",
85 "Vietnam",81 "Slovakia",
86 "Qatar",82 "Morocco",
87 "Angola",83 "Bangladesh",
88 "Libya",84 "Vietnam",
89 "Iraq",85 "Qatar",
90 "Croatia",86 "Angola",
91 "Luxembourg",87 "Libya",
92 "Sudan",88 "Iraq",
93 "Slovenia",89 "Croatia",
94 "Cuba",90 "Luxembourg",
95 "Belarus",91 "Sudan",
96 "Ecuador",92 "Slovenia",
97 "Serbia",93 "Cuba",
98 "Oman",94 "Belarus",
99 "Bulgaria",95 "Ecuador",
100 "Lithuania",96 "Serbia",
101 "Syria",97 "Oman",
102 "Dominican Republic",98 "Bulgaria",
103 "Tunisia",99 "Lithuania",
104 "Guatemala",100 "Syria",
105 "Azerbaijan",101 "Dominican Republic",
106 "Sri Lanka",102 "Tunisia",
107 "Kenya",103 "Guatemala",
108 "Latvia",104 "Azerbaijan",
109 "Turkmenistan",105 "Sri Lanka",
110 "Costa Rica",106 "Kenya",
111 "Lebanon",107 "Latvia",
112 "Uruguay",108 "Turkmenistan",
113 "Uzbekistan",109 "Costa Rica",
114 "Yemen",110 "Lebanon",
115 "Cyprus",111 "Uruguay",
116 "Estonia",112 "Uzbekistan",
117 "Trinidad and Tobago",113 "Yemen",
118 "Cameroon",114 "Cyprus",
119 "El Salvador",115 "Estonia",
120 "Iceland",116 "Trinidad and Tobago",
121 "Panama",117 "Cameroon",
122 "Bahrain",118 "El Salvador",
123 "Ivory Coast",119 "Iceland",
124 "Ethiopia",120 "Panama",
125 "Tanzania",121 "Bahrain",
126 "Jordan",122 "Ivory Coast",
127 "Ghana",123 "Ethiopia",
128 "Bosnia and Herzegovina",124 "Tanzania",
129 "Macau",125 "Jordan",
130 "Burma",126 "Ghana",
131 "Bolivia",127 "Bosnia and Herzegovina",
132 "Brunei",128 "Macau",
133 "Botswana",129 "Burma",
134 "Honduras",130 "Bolivia",
135 "Gabon",131 "Brunei",
136 "Uganda",132 "Botswana",
137 "Jamaica",133 "Honduras",
138 "Zambia",134 "Gabon",
139 "Senegal",135 "Uganda",
140 "Paraguay",136 "Jamaica",
141 "Albania",137 "Zambia",
142 "Equatorial Guinea",138 "Senegal",
143 "Georgia",139 "Paraguay",
144 "Democratic Republic of the Congo",140 "Albania",
145 "Nepal",141 "Equatorial Guinea",
146 "Afghanistan",142 "Georgia",
147 "Cambodia",143 "Democratic Republic of the Congo",
148 "Armenia",144 "Nepal",
149 "Republic of the Congo",145 "Afghanistan",
150 "Mozambique",146 "Cambodia",
151 "Republic of Macedonia",147 "Armenia",
152 "Malta",148 "Republic of the Congo",
153 "Namibia",149 "Mozambique",
154 "Madagascar",150 "Republic of Macedonia",
155 "Chad",151 "Malta",
156 "Burkina Faso",152 "Namibia",
157 "Mauritius",153 "Madagascar",
158 "Mali",154 "Chad",
159 "The Bahamas",155 "Burkina Faso",
160 "Papua New Guinea",156 "Mauritius",
161 "Nicaragua",157 "Mali",
162 "Haiti",158 "The Bahamas",
163 "Benin",159 "Papua New Guinea",
164 "Palestinian flag West Bank and Gaza",160 "Nicaragua",
165 "Jersey",161 "Haiti",
166 "Fiji",162 "Benin",
167 "Guinea",163 "Palestinian flag West Bank and Gaza",
168 "Moldova",164 "Jersey",
169 "Niger",165 "Fiji",
170 "Laos",166 "Guinea",
171 "Mongolia",167 "Moldova",
172 "French Polynesia",168 "Niger",
173 "Kyrgyzstan",169 "Laos",
174 "Barbados",170 "Mongolia",
175 "Tajikistan",171 "French Polynesia",
176 "Malawi",172 "Kyrgyzstan",
177 "Liechtenstein",173 "Barbados",
178 "New Caledonia",174 "Tajikistan",
179 "Kosovo",175 "Malawi",
180 "Rwanda",176 "Liechtenstein",
181 "Montenegro",177 "New Caledonia",
182 "Swaziland",178 "Kosovo",
183 "Guam",179 "Rwanda",
184 "Mauritania",180 "Montenegro",
185 "Guernsey",181 "Swaziland",
186 "Isle of Man",182 "Guam",
187 "Togo",183 "Mauritania",
188 "Somalia",184 "Guernsey",
189 "Suriname",185 "Isle of Man",
190 "Aruba",186 "Togo",
191 "North Korea",187 "Somalia",
192 "Zimbabwe",188 "Suriname",
193 "Central African Republic",189 "Aruba",
194 "Faroe Islands",190 "North Korea",
195 "Greenland",191 "Zimbabwe",
196 "Sierra Leone",192 "Central African Republic",
197 "Lesotho",193 "Faroe Islands",
198 "Cape Verde",194 "Greenland",
199 "Eritrea",195 "Sierra Leone",
200 "Bhutan",196 "Lesotho",
201 "Belize",197 "Cape Verde",
202 "Antigua and Barbuda",198 "Eritrea",
203 "Gibraltar",199 "Bhutan",
204 "Maldives",200 "Belize",
205 "San Marino",201 "Antigua and Barbuda",
206 "Guyana",202 "Gibraltar",
207 "Burundi",203 "Maldives",
208 "Saint Lucia",204 "San Marino",
209 "Djibouti",205 "Guyana",
210 "British Virgin Islands",206 "Burundi",
211 "Liberia",207 "Saint Lucia",
212 "Seychelles",208 "Djibouti",
213 "The Gambia",209 "British Virgin Islands",
214 "Northern Mariana Islands",210 "Liberia",
215 "Grenada",211 "Seychelles",
216 "Saint Vincent and the Grenadines",212 "The Gambia",
217 "Saint Kitts and Nevis",213 "Northern Mariana Islands",
218 "East Timor",214 "Grenada",
219 "Vanuatu",215 "Saint Vincent and the Grenadines",
220 "Comoros",216 "Saint Kitts and Nevis",
221 "Samoa",217 "East Timor",
222 "Solomon Islands",218 "Vanuatu",
223 "Guinea-Bissau",219 "Comoros",
224 "American Samoa",220 "Samoa",
225 "Dominica",221 "Solomon Islands",
226 "Micronesia",222 "Guinea-Bissau",
227 "Tonga",223 "American Samoa",
228 "Cook Islands",224 "Dominica",
229 "Palau",225 "Micronesia",
230 "Marshall Islands",226 "Tonga",
231 "S o Tom and Pr ncipe",227 "Cook Islands",
232 "Anguilla",228 "Palau",
233 "Kiribati",229 "Marshall Islands",
234 "Tuvalu",230 "S o Tom and Pr ncipe",
235 "Niue"231 "Anguilla",
236];232 "Kiribati",
237233 "Tuvalu",
234 "Niue"
235 ];
238 </script>236 </script>
239237
240 <!--238 <style id="style-overrides" type="text/css">
241 We need to include individual css files because some of them have239 #example {
242 relative paths to images.240 background-color: #ecf5fa;
243 -->241 border: 1px solid #8899dd;
244 <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"></link>242 padding: 2em;
245 <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"></link>243 }
246 <link type="text/css" rel="stylesheet" href="../../build/autocomplete/assets/skins/sam/autocomplete.css"></link>244
247245 #example label { display: block; line-height: 2em; font-weight: bold; }
248 <style type="text/css">246 #example input { margin-bottom: 1em; }
249 #example {247 #example h4 { font-weight: normal; }
250 background-color: #ecf5fa;248 #example #keys li { line-height: 2em; }
251 border: 1px solid #8899dd;249 #example #keys kbd {
252 padding: 2em;250 background-color: #eee;
253 }251 border: 1px solid #bbb;
254252 padding-left: 3px;
255 #example label { display: block; line-height: 2em; font-weight: bold; }253 padding-right: 3px;
256 #example input { margin-bottom: 1em; }254 }
257 #example h4 { font-weight: normal; }
258 #example #keys li { line-height: 2em; }
259 #example #keys kbd {
260 background-color: #eee;
261 border: 1px solid #bbb;
262 padding-left: 3px;
263 padding-right: 3px;
264 }
265 </style>255 </style>
266</head>256</head>
267257
268<body class="yui-skin-sam">258<body class="yui-skin-sam">
269259
270<h1>A Simple auto-complete Widget</h1>260 <h1>A Simple auto-complete Widget</h1>
271261
272<h2>Demonstration</h2>262 <h2>Demonstration</h2>
273<div id="example">263 <div id="example">
274 <label for="ac-input">Enter a country name:</label>264 <label for="ac-input">Enter a country name:</label>
275 <input id="ac-input" type="text" value="" />265 <input id="ac-input" type="text" value="" />
276 <h4>Some useful keyboard shortcuts:</h4>266 <h4>Some useful keyboard shortcuts:</h4>
277 <ul id="keys">267 <ul id="keys">
278 <li><kbd>Tab</kbd> or <kbd>Enter</kbd> completes the current input.</li>268 <li><kbd>Tab</kbd> or <kbd>Enter</kbd> completes the current input.</li>
279 <li><kbd>Up Arrow</kbd> and <kbd>Down Arrow</kbd> navigate the completions list</li>269 <li><kbd>Up Arrow</kbd> and <kbd>Down Arrow</kbd> navigate the completions list</li>
280 <li><kbd>Esc</kbd> closes the completion list</li>270 <li><kbd>Esc</kbd> closes the completion list</li>
281 </ul>271 </ul>
282272
283 <script type="text/javascript">273 <script type="text/javascript">
284LP.use('node', 'event', 'dump', 'lazr.autocomplete', function(Y) {274 LP.use('node', 'event', 'dump', 'lazr.autocomplete', function(Y) {
285275
286 function log(msg) {276 function log(msg) {
287 Y.log(msg, 'info');277 Y.log(msg, 'info');
@@ -319,8 +309,8 @@
319 <h3>Javascript</h3>309 <h3>Javascript</h3>
320 Add the following javascript and css tags into your page.310 Add the following javascript and css tags into your page.
321 <pre>311 <pre>
322 &lt;script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"&gt;&lt;/script&gt;312 &lt;script type="text/javascript" src="../../build/yui/yui-min.js"&gt;&lt;/script&gt;
323 &lt;script type="text/javascript" src="../../build/autocomplete/autocomplete.js"&gt;&lt;/script&gt;313 &lt;script type="text/javascript" src="../../build/lazr/lazr-meta.js"&gt;&lt;/script&gt;
324 </pre>314 </pre>
325315
326 <p>316 <p>
@@ -338,11 +328,18 @@
338 The AutoComplete widget requires two ATTRs on creation: a node id and an328 The AutoComplete widget requires two ATTRs on creation: a node id and an
339 array containing data.329 array containing data.
340 <pre>330 <pre>
341 var autocomplete = new Y.lazr.AutoComplete({331 var LAZR_YUI_CONFIG = {
342 input: '#input-box',332 filter: "min",
343 data: ['Mike', 'Fred', 'Barney']333 base: "../../build/",
334 modules: LAZR_MODULES,
335 };
336 YUI(LAZR_YUI_CONFIG).use("lazr.autocomplete", function(Y) {
337 var autocomplete = new Y.lazr.AutoComplete({
338 input: '#input-box',
339 data: ['Mike', 'Fred', 'Barney']
340 });
341 autocomplete.render();
344 });342 });
345 autocomplete.render();
346 </pre>343 </pre>
347</body>344</body>
348</html>345</html>
349346
=== modified file 'examples/choiceedit/index.html'
--- examples/choiceedit/index.html 2009-10-22 20:22:12 +0000
+++ examples/choiceedit/index.html 2009-11-19 17:33:11 +0000
@@ -2,27 +2,20 @@
2<html>2<html>
3<head>3<head>
4 <title>Lazr-js examples: Choice editing</title>4 <title>Lazr-js examples: Choice editing</title>
5 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>5
6 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>6 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset-min.css"></link>
7 <script type="text/javascript" src="../../build/anim/anim.js"></script>7 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts-min.css"></link>
8 <script type="text/javascript" src="../../build/overlay/overlay.js"></script>8 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base-min.css"></link>
99
10 <!--10 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
11 We need to include individual css files because some of them have11 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
12 relative paths to images.12 <script type="text/javascript">
13 -->13 var LAZR_YUI_CONFIG = {
14 <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"></link>14 filter: "min",
15 <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"></link>15 base: "../../build/",
16 <link type="text/css" rel="stylesheet" href="../../build/inlineedit/assets/skins/sam/editor.css"></link>16 modules: LAZR_MODULES,
1717 };
18 <script type="text/javascript" src="../../build/choiceedit/choiceedit.js"></script>18 </script>
19
20 <link type="text/css" rel="stylesheet"
21 href="../../build/overlay/assets/pretty-overlay-core.css">
22 <link type="text/css" rel="stylesheet"
23 href="../../build/overlay/assets/skins/sam/pretty-overlay-skin.css">
24 <link type="text/css" rel="stylesheet"
25 href="../../build/choiceedit/assets/choiceedit-core.css">
26</head>19</head>
27<body class="yui-skin-sam">20<body class="yui-skin-sam">
2821
@@ -36,23 +29,21 @@
3629
37<h2>Required include dependencies</h2>30<h2>Required include dependencies</h2>
38<pre>31<pre>
39 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/current/build/yui/yui.js&quot;&gt;&lt;/script&gt;32 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/yui-min.js&quot;&gt;&lt;/script&gt;
40 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/choiceedit/choiceedit.js&quot;&gt;&lt;/script&gt;33 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/lazr/lazr-meta.js&quot;&gt;&lt;/script&gt;
41 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/anim/anim.js&quot;&gt;&lt;/script&gt;
42
43 &lt;!-- overlay required files --&gt;
44 &lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;../../build/overlay/assets/pretty-overlay-core.css&quot;&gt;&lt;/link&gt;
45 &lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;../../build/overlay/assets/skins/sam/pretty-overlay-skin.css&quot;&gt;&lt;/link&gt;
46 &lt;!-- choiceedit required files --&gt;
47 &lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;../../build/choiceedit/assets/choiceedit-core.css&quot;&gt;&lt;/link&gt;
48
49</pre>34</pre>
5035
51<h2>Example instantiation</h2>36<h2>Example instantiation</h2>
5237
53<pre>38<pre>
54 YUI().use('node', 'event', 'widget', 'plugin', 'overlay', 'lazr.choiceedit', function(Y) {39 var LAZR_YUI_CONFIG = {
55 40 filter: "min",
41 base: "../../build/",
42 modules: LAZR_MODULES,
43 };
44 YUI(LAZR_YUI_CONFIG).use('node', 'event', 'widget', 'plugin', 'overlay',
45 'lazr.choiceedit', function(Y) {
46
56 var choice_edit = new Y.ChoiceSource({47 var choice_edit = new Y.ChoiceSource({
57 contentBox: '#status',48 contentBox: '#status',
58 value: 'incomplete',49 value: 'incomplete',
@@ -175,10 +166,8 @@
175</pre>166</pre>
176167
177 <script>168 <script>
178 YUI({169 YUI(LAZR_YUI_CONFIG).use('node', 'event', 'widget', 'plugin',
179 base: '../../build/yui/current/build/',170 'overlay', 'lazr.choiceedit', function(Y) {
180 filter: 'raw'
181 }).use('node', 'event', 'widget', 'plugin', 'overlay', 'lazr.choiceedit', function(Y) {
182171
183 // Add a delay between the start and end of the inline editor widget's172 // Add a delay between the start and end of the inline editor widget's
184 // "save" event.173 // "save" event.
185174
=== added file 'examples/combo.html'
--- examples/combo.html 1970-01-01 00:00:00 +0000
+++ examples/combo.html 2009-11-19 17:33:11 +0000
@@ -0,0 +1,201 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<head>
5 <title>LAZR JS Examples: lazr.formoverlay</title>
6 <meta http-equiv="content-type" content="text/html;charset=utf-8" />
7
8 <link rel="stylesheet" type="text/css" href="../build/cssreset/reset-min.css"></link>
9 <link rel="stylesheet" type="text/css" href="../cssfonts/fonts-min.css"></link>
10 <link rel="stylesheet" type="text/css" href="../cssbase/base-min.css"></link>
11
12 <script type="text/javascript" src="../build/yui/yui.js"></script>
13 <script type="text/javascript" src="../build/lazr/lazr-meta.js"></script>
14 <script type="text/javascript">
15 var LAZR_YUI_CONFIG = {
16 filter: "min",
17 comboBase: "http://localhost:9876/combo?",
18 root: "",
19 combine: true,
20 modules: LAZR_MODULES,
21 };
22 </script>
23
24 <script type="text/javascript">
25
26YUI(LAZR_YUI_CONFIG).use('lazr.formoverlay', 'node', 'event',
27 'dump', function(Y) {
28
29 var big_error = [
30 'Traceback (most recent call last):',
31 ' File "/foo/bar/baz.py", line 130, in publish',
32 ' obj = request.traverse(obj)',
33 ' File "/foo/bar/baz.py", line 1348, in traverse',
34 ' result = super(WebServiceRequestTraversal, self).traverse(ob)',
35 ' File "/foo/bar/baz.py", line 513, in traverse',
36 ' ob = super(BrowserRequest, self).traverse(obj)',
37 ' File "/foo/bar/baz.py", line 453, in traverse',
38 ' ob = super(HTTPRequest, self).traverse(obj)',
39 ' File "/foo/bar/baz.py", line 263, in traverse',
40 ' obj = publication.traverseName(self, obj, entry_name)',
41 ' File "/foo/bar/baz.py", line 1157, in traverseName',
42 ' return super(WebServicePublication, self).traverseName(',
43 ' File "/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/baz.py", ' +
44 'line 61, in traverseName',
45 ' File "/foo/bar/baz.py", line 659, in publishTraverse',
46 ' nextobj = self._publishTraverse(request, name)',
47 ' File "/foo/bar/baz.py", line 763, in _publishTraverse',
48 ' nextstep)',
49 ' File "/foo/bar/baz.py", line 689, in _handle_next_object',
50 ' raise NotFound(self.context, name)',
51 "NotFound: Object: , name: u'1asdfasdf'"
52 ].join("\n");
53
54 var formoverlay;
55 var submit_callback = function(data){
56 if (data['firstname'][0] == "Harry"){
57 formoverlay.showError([
58 '"Harry" is not allowed.',
59 big_error,
60 ]);
61 }
62
63 Y.get("#data-display").set("innerHTML", Y.dump(data));
64 };
65
66 formoverlay = new Y.lazr.FormOverlay({
67 headerContent: '<h2>Your details</h2>',
68 form_header: [
69 '<p>Enter the firstname "Harry" to see an example error.</p>',
70 '<p id="formoverview">Please fill in the following details:</p>'
71 ].join(""),
72 form_content: [
73 '<div id="myform">',
74 '<table>',
75 '<tr>',
76 ' <td><label for="firstname">First name: </label></td>',
77 ' <td><input type="text" name="firstname" id="firstname"/></td>',
78 '</tr>',
79 '<tr>',
80 ' <td><label for="lastname">Last name: </label></td>',
81 ' <td><input type="text" name="lastname" id="lastname"/></td>',
82 '</tr>',
83 '<tr>',
84 ' <td><label for="gender">Gender: </label></td>',
85 ' <td><select name="gender">',
86 ' <option value="female">Female</option>',
87 ' <option value="male">Male</option>',
88 ' </select></td>',
89 '</tr>',
90 '</table>',
91 '</div>'
92 ].join(""),
93 form_submit_callback: submit_callback,
94 centered: true,
95 visible: false
96 });
97 formoverlay.render();
98
99 Y.on("domready", function(){
100 formoverlay.show();
101 });
102
103 Y.on('click', function(e) {
104 Y.log("Showing overlay", "info");
105 formoverlay.show();
106 }, '#show-overlay');
107});
108 </script>
109</head>
110
111<body class="yui-skin-sam">
112 <h1>Using forms in a LAZR overlay</h1>
113
114 <p>The <code>FormOverlay</code> widget allows the display and data
115 extraction of any form.
116 </p>
117
118 <h2>Demonstration</h2>
119 <div id="example">
120 <button id="show-overlay">Re-display form</button>
121
122 <p>Data returned upon form submission: <span id="data-display"></span>
123 </p>
124 </div>
125
126 <h2>Page Setup</h2>
127 <p>The following Javascript and CSS files will need to be included on your page:</p>
128
129 <h3>Javascript</h3>
130 <pre>
131 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/current/build/yui/yui-min.js&quot;&gt;&lt;/script&gt;
132 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/lazr/lazr-meta.js&quot;&gt;&lt;/script&gt;
133 </pre>
134
135 <h2>Widget Setup</h2>
136 <p>The FormOverlay requires only form content during initialization.
137 The normal Overlay attributes (such as headerContent) can be used
138 as expected.</p>
139 <pre><code>
140 var LAZR_YUI_CONFIG = {
141 filter: "min",
142 base: "../../build/",
143 modules: LAZR_MODULES,
144 };
145 YUI(LAZR_YUI_CONFIG).use("lazr.formoverlay", function(Y){
146 var form_content = 'Enter name: &lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;';
147 var formoverlay = new Y.lazr.FormOverlay({
148 headerContent: '&lt;h2&gt;Your Form Title&lt;/h2&gt;',
149 form_content: form_content});
150 formoverlay.render();
151 });
152 </code></pre>
153 <p><strong>Note:</strong> The form content can be passed as either a string
154 of HTML (as is useful if the form is obtained via an AJAX request) or
155 as an instance of a Y.Node (as is useful if the form is obtained from
156 the current page).
157 </p>
158 <h3>Providing the submit callback</h3>
159 <p>To do something useful with the FormOverlay, you will want to provide
160 your own submit callback, so that you can do something with the data.
161 Data is returned to your callback as a hash, where each value is
162 a list, due to the ability to select multiple values for a single key
163 with HTML check input elements.
164 </p>
165 <pre><code>
166 ...
167 var submit_callback = function(data){
168 // Do something useful with the data...
169 Y.get("#data-display").set("innerHTML", Y.dump(data));
170 };
171 var formoverlay = new Y.lazr.FormOverlay({
172 headerContent: '&lt;h2&gt;Your Form Title&lt;/h2&gt;',
173 form_content: form_content,
174 form_submit_callback: submit_callback});
175 formoverlay.render();
176 </code></pre>
177
178 <h3>Displaying error messages</h3>
179 <p> The FormOverlay includes showError() and clearError() methods that
180 can be used to display an error (or a list of errors) inside the
181 FormOverlay, as demonstrated in the example.
182 </p>
183
184 <h3>Providing a custom submit button</h3>
185 <p>By default, the FormOverlay will create a submit button and include
186 it in the form element.
187 If you would like your own submit button, with it's own text etc.,
188 you can also pass it in as an attribute:</p>
189 <pre><code>
190 ...
191 var submit_button = Y.Node.create('&lt;input type="submit" value="Hit me!"&gt;');
192 var formoverlay = new Y.lazr.FormOverlay({
193 headerContent: '&lt;h2&gt;Your Form Title&lt;/h2&gt;',
194 form_content: form_content,
195 form_submit_callback: submit_callback,
196 form_submit_button: submit_button});
197 formoverlay.render();
198 </code></pre>
199
200</body>
201</html>
0202
=== modified file 'examples/effects/index.html'
--- examples/effects/index.html 2009-10-22 20:22:12 +0000
+++ examples/effects/index.html 2009-11-19 17:33:11 +0000
@@ -4,23 +4,22 @@
4<head>4<head>
5 <title>Lazr-js examples: lazr.effects</title>5 <title>Lazr-js examples: lazr.effects</title>
66
7 <link type="text/css" rel="stylesheet" href="../../build/yui/current/build/cssreset/reset.css"></link>7 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset-min.css"></link>
8 <link type="text/css" rel="stylesheet" href="../../build/yui/current/build/cssfonts/fonts.css"></link>8 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts-min.css"></link>
9 <link type="text/css" rel="stylesheet" href="../../build/yui/current/build/cssbase/base.css"></link>9 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base-min.css"></link>
1010
11 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>11 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
12 <script type="text/javascript" src="../../build/lazr.js"></script>12 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
13 <script type="text/javascript" src="../../build/effects/effects.js"></script>13 <script type="text/javascript">
1414 var LAZR_YUI_CONFIG = {
15 <!--15 filter: "min",
16 We need to include individual css files because some of them have16 base: "../../build/",
17 relative paths to images.17 modules: LAZR_MODULES,
18 -->18 insertBefore: "style-overrides",
19 <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"></link>19 };
20 <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"></link>20 </script>
21 <link type="text/css" rel="stylesheet" href="../../build/effects/assets/skins/sam/effects.css"></link>21
2222 <style id="style-overrides" type="text/css">
23 <style type="text/css">
24 .example {23 .example {
25 background-color: #ecf5fa;24 background-color: #ecf5fa;
26 border: 1px solid #8899dd;25 border: 1px solid #8899dd;
@@ -76,7 +75,12 @@
7675
77<h3>Usage</h3>76<h3>Usage</h3>
78<pre>77<pre>
79YUI().use('node', 'event', 'lazr.effects', function(Y) {78var LAZR_YUI_CONFIG = {
79 filter: "min",
80 base: "../../build/",
81 modules: LAZR_MODULES,
82};
83YUI(LAZR_YUI_CONFIG).use('node', 'event', 'lazr.effects', function(Y) {
8084
81 var reset_height = null;85 var reset_height = null;
82 var slide_node;86 var slide_node;
@@ -107,7 +111,12 @@
107111
108<h3>Usage</h3>112<h3>Usage</h3>
109<pre>113<pre>
110YUI().use('node', 'event', 'lazr.effects', function(Y) {114var LAZR_YUI_CONFIG = {
115 filter: "min",
116 base: "../../build/",
117 modules: LAZR_MODULES,
118};
119YUI(LAZR_YUI_CONFIG).use('node', 'event', 'lazr.effects', function(Y) {
111120
112 var reset_height = null;121 var reset_height = null;
113 var slide_node;122 var slide_node;
@@ -147,7 +156,12 @@
147</p>156</p>
148157
149<pre>158<pre>
150YUI().use('node', 'event', 'lazr.effects', function(Y) {159var LAZR_YUI_CONFIG = {
160 filter: "min",
161 base: "../../build/",
162 modules: LAZR_MODULES,
163};
164YUI(LAZR_YUI_CONFIG).use('node', 'event', 'lazr.effects', function(Y) {
151165
152 var slide;166 var slide;
153167
@@ -176,7 +190,12 @@
176190
177<h3>Usage</h3>191<h3>Usage</h3>
178<pre>192<pre>
179YUI().use('lazr.effects-async', function(Y) {193var LAZR_YUI_CONFIG = {
194 filter: "min",
195 base: "../../build/",
196 modules: LAZR_MODULES,
197};
198YUI(LAZR_YUI_CONFIG).use('lazr.effects-async', function(Y) {
180199
181Y.lazr.effects.async_slideout(200Y.lazr.effects.async_slideout(
182 '#drawer', // The node to slide opened and closed.201 '#drawer', // The node to slide opened and closed.
@@ -190,11 +209,12 @@
190</pre>209</pre>
191210
192<script type="text/javascript">211<script type="text/javascript">
193212var LAZR_YUI_CONFIG = {
194YUI({213 filter: "min",
195 base: '../../build/yui/current/build/',214 base: "../../build/",
196 filter: 'raw'215 modules: LAZR_MODULES,
197 }).use('node', 'event', 'lazr.effects', function(Y) {216};
217YUI(LAZR_YUI_CONFIG).use('node', 'event', 'lazr.effects', function(Y) {
198218
199 var reset_height = null;219 var reset_height = null;
200 var slide_node;220 var slide_node;
@@ -227,6 +247,5 @@
227});247});
228248
229</script>249</script>
230
231</body>250</body>
232</html>251</html>
233252
=== modified file 'examples/error/index.html'
--- examples/error/index.html 2009-11-13 16:15:25 +0000
+++ examples/error/index.html 2009-11-19 17:33:11 +0000
@@ -3,21 +3,28 @@
3<html>3<html>
4<head>4<head>
5 <title>Lazr-js examples: error</title>5 <title>Lazr-js examples: error</title>
6 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>6
7 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>7 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset-min.css"></link>
8 <script type="text/javascript" src="../../build/anim/anim.js"></script>8 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts-min.css"></link>
9 <script type="text/javascript" src="../../build/overlay/overlay.js"></script>9 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base-min.css"></link>
10 <script type="text/javascript" src="../../build/error/error.js"></script>10
11 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
12 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
13 <script type="text/javascript">
14 var LAZR_YUI_CONFIG = {
15 filter: "min",
16 base: "../../build/",
17 modules: LAZR_MODULES,
18 };
19 </script>
20
11 <script type="text/javascript">21 <script type="text/javascript">
1222
13// We create a global variable here to reference our display_error23// We create a global variable here to reference our display_error
14// method only so that the call to setTimeout() below used for24// method only so that the call to setTimeout() below used for
15// demonstration has access to the function.25// demonstration has access to the function.
16var display_error;26var display_error;
17YUI({27YUI(LAZR_YUI_CONFIG).use(
18 base: '../../build/yui/current/build/',
19 filter: 'raw'
20 }).use(
21 'lazr.error', 'lazr.anim', 'node', 'event',28 'lazr.error', 'lazr.anim', 'node', 'event',
22 'dump', function(Y) {29 'dump', function(Y) {
2330
@@ -44,19 +51,6 @@
44});51});
45 </script>52 </script>
4653
47 <!--
48 We need to include individual css files because some of them have
49 relative paths to images.
50 -->
51 <link rel="stylesheet" href="../../build/yui/current/build/cssreset/reset.css"/>
52 <link rel="stylesheet" href="../../build/yui/current/build/cssfonts/fonts.css"/>
53 <link rel="stylesheet" href="../../build/yui/current/build/cssbase/base.css"/>
54 <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"/>
55 <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"/>
56 <link rel="stylesheet" href="../../build/overlay/assets/pretty-overlay-core.css"/>
57 <link rel="stylesheet" href="../../build/overlay/assets/skins/sam/pretty-overlay-skin.css"/>
58
59 <link type="text/css" rel="stylesheet" href="../../build/error/assets/error-core.css"/>
60</head>54</head>
6155
62<body class="yui-skin-sam">56<body class="yui-skin-sam">
@@ -80,21 +74,8 @@
8074
81<h3>Javascript</h3>75<h3>Javascript</h3>
82<pre>76<pre>
83 &lt;script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"&gt;&lt;/script&gt;77 &lt;script type="text/javascript" src="../../build/yui/yui-min.js"&gt;&lt;/script&gt;
84 &lt;script type="text/javascript" src="../../build/lazr/lazr.js"&gt;&lt;/script&gt;78 &lt;script type="text/javascript" src="../../build/lazr/lazr-meta.js"&gt;&lt;/script&gt;
85 &lt;script type="text/javascript" src="../../build/anim/anim.js"&gt;&lt;/script&gt;
86 &lt;script type="text/javascript" src="../../build/overlay/overlay.js"&gt;&lt;/script&gt;
87 &lt;script type="text/javascript" src="../../build/error/error.js"&gt;&lt;/script&gt;
88</pre>
89
90<h3>CSS</h3>
91<pre>
92 &lt;link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"/&gt;
93 &lt;link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css"/&gt;
94 &lt;link rel="stylesheet" href="../../build/overlay/assets/pretty-overlay-core.css"/&gt;
95 &lt;link rel="stylesheet" href="../../build/overlay/assets/skins/sam/pretty-overlay-skin.css"/&gt;
96
97 &lt;link type="text/css" rel="stylesheet" href="../../build/error/assets/error-core.css"/&gt;
98</pre>79</pre>
9980
100<h2>Widget Setup</h2>81<h2>Widget Setup</h2>
10182
=== modified file 'examples/formoverlay/index.html'
--- examples/formoverlay/index.html 2009-10-22 20:22:12 +0000
+++ examples/formoverlay/index.html 2009-11-19 17:33:11 +0000
@@ -5,24 +5,21 @@
5 <title>LAZR JS Examples: lazr.formoverlay</title>5 <title>LAZR JS Examples: lazr.formoverlay</title>
6 <meta http-equiv="content-type" content="text/html;charset=utf-8" />6 <meta http-equiv="content-type" content="text/html;charset=utf-8" />
77
8 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>8 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
9 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>9 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
10 <script type="text/javascript" src="../../build/overlay/overlay.js"></script>10 <script type="text/javascript">
11 <script type="text/javascript" src="../../build/formoverlay/formoverlay.js"></script>11 var LAZR_YUI_CONFIG = {
1212 filter: "min",
13 <link rel="stylesheet" href="../../build/yui/current/build/cssreset/reset.css"/>13 base: "../../build/",
14 <link rel="stylesheet" href="../../build/yui/current/build/cssfonts/fonts.css"/>14 modules: LAZR_MODULES,
15 <link rel="stylesheet" href="../../build/yui/current/build/cssbase/base.css"/>15 };
16 <link rel="stylesheet" href="../../build/overlay/assets/pretty-overlay-core.css"/>16 </script>
17 <link rel="stylesheet" href="../../build/overlay/assets/skins/sam/pretty-overlay-skin.css"/>17
18 <link rel="stylesheet" href="../../build/formoverlay/assets/formoverlay.css"/>18 <script type="text/javascript">
1919
20 <script type="text/javascript">20YUI(LAZR_YUI_CONFIG).use('cssreset', 'cssfonts', 'cssbase',
2121 'lazr.formoverlay', 'node', 'event',
22YUI({22 'dump', function(Y) {
23 base: "../../build/yui/current/build/",
24 filter: 'raw',
25}).use('lazr.formoverlay', 'node', 'event', 'dump', function(Y) {
2623
27 var big_error = [24 var big_error = [
28 'Traceback (most recent call last):',25 'Traceback (most recent call last):',
@@ -126,16 +123,8 @@
126123
127 <h3>Javascript</h3>124 <h3>Javascript</h3>
128 <pre>125 <pre>
129 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/current/build/yui/yui.js&quot;&gt;&lt;/script&gt;126 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/current/build/yui/yui-min.js&quot;&gt;&lt;/script&gt;
130 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/overlay/overlay.js&quot;&gt;&lt;/script&gt;127 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/lazr/lazr-meta.js&quot;&gt;&lt;/script&gt;
131 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/formoverlay/formoverlay.js&quot;&gt;&lt;/script&gt;
132 </pre>
133
134 <h3>CSS</h3>
135 <pre>
136 &lt;link rel=&quot;stylesheet&quot; href=&quot;../../build/overlay/assets/pretty-overlay-core.css&quot; /&gt;
137 &lt;link rel=&quot;stylesheet&quot; href=&quot;../../build/overlay/assets/skins/sam/pretty-overlay-skin.css&quot; /&gt;
138 &lt;link rel=&quot;stylesheet&quot; href=&quot;../../build/formoverlay/assets/formoverlay.css&quot; /&gt;
139 </pre>128 </pre>
140129
141 <h2>Widget Setup</h2>130 <h2>Widget Setup</h2>
@@ -143,11 +132,18 @@
143 The normal Overlay attributes (such as headerContent) can be used132 The normal Overlay attributes (such as headerContent) can be used
144 as expected.</p>133 as expected.</p>
145 <pre><code>134 <pre><code>
135 var LAZR_YUI_CONFIG = {
136 filter: "min",
137 base: "../../build/",
138 modules: LAZR_MODULES,
139 };
140 YUI(LAZR_YUI_CONFIG).use("lazr.formoverlay", function(Y){
146 var form_content = 'Enter name: &lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;';141 var form_content = 'Enter name: &lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;';
147 var formoverlay = new Y.lazr.FormOverlay({142 var formoverlay = new Y.lazr.FormOverlay({
148 headerContent: '&lt;h2&gt;Your Form Title&lt;/h2&gt;',143 headerContent: '&lt;h2&gt;Your Form Title&lt;/h2&gt;',
149 form_content: form_content});144 form_content: form_content});
150 formoverlay.render();145 formoverlay.render();
146 });
151 </code></pre>147 </code></pre>
152 <p><strong>Note:</strong> The form content can be passed as either a string148 <p><strong>Note:</strong> The form content can be passed as either a string
153 of HTML (as is useful if the form is obtained via an AJAX request) or149 of HTML (as is useful if the form is obtained via an AJAX request) or
154150
=== modified file 'examples/inlineeditor/index.html'
--- examples/inlineeditor/index.html 2009-11-13 23:59:22 +0000
+++ examples/inlineeditor/index.html 2009-11-19 17:33:11 +0000
@@ -3,17 +3,23 @@
3<html>3<html>
4<head>4<head>
5 <title>Lazr-js examples: In-line text editing</title>5 <title>Lazr-js examples: In-line text editing</title>
6 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>6
7 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>7 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset-min.css"></link>
8 <script type="text/javascript" src="../../build/anim/anim.js"></script>8 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts-min.css"></link>
9 <script type="text/javascript" src="../../build/inlineedit/editor.js"></script>9 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base-min.css"></link>
1010
11 <!--11 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
12 We need to include individual css files because some of them have12 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
13 relative paths to images.13 <script type="text/javascript">
14 -->14 var LAZR_YUI_CONFIG = {
15 <link type="text/css" rel="stylesheet" href="../../build/lazr-sam.css"></link>15 filter: "min",
16 <style>16 base: "../../build/",
17 modules: LAZR_MODULES,
18 insertBefore: "style-overrides",
19 };
20 </script>
21
22 <style id="style-overrides" type="text/css">
17 #example {23 #example {
18 margin-left: 20px;24 margin-left: 20px;
19 padding: 50px 200px 50px 200px;25 padding: 50px 200px 50px 200px;
@@ -96,7 +102,12 @@
96</pre>102</pre>
97103
98<pre>104<pre>
99YUI().use('lazr.editor', function(Y) {105var LAZR_YUI_CONFIG = {
106 filter: "min",
107 base: "../../build/",
108 modules: LAZR_MODULES,
109};
110YUI(LAZR_YUI_CONFIG).use('lazr.editor', function(Y) {
100111
101 var editor = new Y.EditableText(...);112 var editor = new Y.EditableText(...);
102113
@@ -352,10 +363,8 @@
352363
353 <script type="text/javascript">364 <script type="text/javascript">
354365
355YUI({366YUI(LAZR_YUI_CONFIG).use('node', 'event', 'plugin',
356 base: '../../build/yui/current/build/',367 'lazr.editor', function(Y) {
357 filter: 'raw'
358 }).use('node', 'event', 'plugin', 'lazr.editor', function(Y) {
359368
360 // Add a delay between the start and end of the inline editor widget's369 // Add a delay between the start and end of the inline editor widget's
361 // "save" event.370 // "save" event.
362371
=== modified file 'examples/lazr/index.html'
--- examples/lazr/index.html 2009-10-22 20:22:12 +0000
+++ examples/lazr/index.html 2009-11-19 17:33:11 +0000
@@ -5,15 +5,24 @@
5 <title>LAZR JS Examples: lazr.base</title>5 <title>LAZR JS Examples: lazr.base</title>
6 <meta http-equiv="content-type" content="text/html;charset=utf-8" />6 <meta http-equiv="content-type" content="text/html;charset=utf-8" />
77
8 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>8 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset-min.css"></link>
9 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>9 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts-min.css"></link>
1010 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base-min.css"></link>
11 <script type="text/javascript">11
1212 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
13YUI({13 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
14 base: "../../build/yui/current/build/",14 <script type="text/javascript">
15 filter: 'raw',15 var LAZR_YUI_CONFIG = {
16}).use('node', 'lazr.base', function(Y) {16 filter: "min",
17 base: "../../build/",
18 modules: LAZR_MODULES,
19 insertBefore: "style-overrides",
20 };
21 </script>
22
23 <script type="text/javascript">
24
25YUI(LAZR_YUI_CONFIG).use('node', 'lazr.base', function(Y) {
1726
18 Y.log(Y.lazr.ui.OK_BUTTON, 'info');27 Y.log(Y.lazr.ui.OK_BUTTON, 'info');
19 Y.log(Y.lazr.ui.CANCEL_BUTTON, 'info');28 Y.log(Y.lazr.ui.CANCEL_BUTTON, 'info');
@@ -39,10 +48,7 @@
3948
40 </script>49 </script>
4150
42 <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css" />51 <style id="style-overrides" type="text/css">
43
44 <style>
45
46 #example {52 #example {
47 margin-left: 5em;53 margin-left: 5em;
48 padding: 3em;54 padding: 3em;
@@ -72,9 +78,8 @@
72<p>The common usage:</p>78<p>The common usage:</p>
7379
74<pre>80<pre>
75 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/current/build/yui/yui.js&quot;&gt;&lt;/script&gt;81 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/yui/yui-min.js&quot;&gt;&lt;/script&gt;
76 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/lazr/lazr.js&quot;&gt;&lt;/script&gt;82 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/lazr/lazr-meta.js&quot;&gt;&lt;/script&gt;
77 &lt;script type=&quot;text/javascript&quot; src=&quot;../../build/lazr/assets/skins/sam/lazr-skin.css&quot;&gt;&lt;/script&gt;
78</pre>83</pre>
7984
80<ul>85<ul>
@@ -107,7 +112,12 @@
107<p>And here's the JavaScript to hook it up:</p>112<p>And here's the JavaScript to hook it up:</p>
108113
109<pre>114<pre>
110YUI().use('node', 'lazr.base', function(Y) {115var LAZR_YUI_CONFIG = {
116 filter: "min",
117 base: "../../build/",
118 modules: LAZR_MODULES,
119};
120YUI(LAZR_YUI_CONFIG).use('node', 'lazr.base', function(Y) {
111121
112 Y.get('#ok').appendChild(122 Y.get('#ok').appendChild(
113 Y.Node.create(Y.lazr.ui.OK_BUTTON));123 Y.Node.create(Y.lazr.ui.OK_BUTTON));
114124
=== modified file 'examples/overlay/index.html'
--- examples/overlay/index.html 2009-10-22 20:22:12 +0000
+++ examples/overlay/index.html 2009-11-19 17:33:11 +0000
@@ -3,17 +3,22 @@
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<head>4<head>
5 <title>LAZR JS Examples: lazr.overlay</title>5 <title>LAZR JS Examples: lazr.overlay</title>
6
7 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset-min.css"></link>
8 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts-min.css"></link>
9 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base-min.css"></link>
10
6 <meta http-equiv="content-type" content="text/html;charset=utf-8" />11 <meta http-equiv="content-type" content="text/html;charset=utf-8" />
712
8 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>13 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
9 <script type="text/javascript" src="../../build/overlay/overlay.js"></script>14 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
1015 <script type="text/javascript">
11 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssreset/reset.css" />16 var LAZR_YUI_CONFIG = {
12 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssfonts/fonts.css" />17 filter: "min",
13 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssbase/base.css" />18 base: "../../build/",
1419 modules: LAZR_MODULES,
15 <link rel="stylesheet" type="text/css" href="../../build/overlay/assets/pretty-overlay-core.css" />20 };
16 <link rel="stylesheet" type="text/css" href="../../build/overlay/assets/skins/sam/pretty-overlay-skin.css" />21 </script>
17</head>22</head>
1823
19<body class="yui-skin-sam">24<body class="yui-skin-sam">
@@ -53,7 +58,12 @@
53<h2>Usage</h2>58<h2>Usage</h2>
54<h3>Subclassing (probably what you want)</h3>59<h3>Subclassing (probably what you want)</h3>
55<pre>60<pre>
56YUI().use('lazr.overlay', function(Y) {61var LAZR_YUI_CONFIG = {
62 filter: "min",
63 base: "../../build/",
64 modules: LAZR_MODULES,
65};
66YUI(LAZR_YUI_CONFIG).use('lazr.overlay', function(Y) {
5767
58 var MyThing = function() {68 var MyThing = function() {
59 MyThing.superclass.constructor.apply(this, arguments);69 MyThing.superclass.constructor.apply(this, arguments);
@@ -82,13 +92,11 @@
8292
83<h3>Instantiating directly (probably not what you want)</h3>93<h3>Instantiating directly (probably not what you want)</h3>
84<pre>94<pre>
85YUI().use('lazr.overlay', function(Y) {95YUI(LAZR_YUI_CONFIG).use('lazr.overlay', function(Y) {
86 var overlay = new Y.lazr.PrettyOverlay({96 var overlay = new Y.lazr.PrettyOverlay({
87 bodyContent: 'hello',97 bodyContent: 'hello',
88 headerContent: 'heading',98 headerContent: 'heading',
89 align: {99 centered: true,
90 points: [Y.WidgetPositionExt.CC, Y.WidgetPositionExt.CC]
91 },
92 progressbar: true,100 progressbar: true,
93 progress: 12101 progress: 12
94 });102 });
@@ -96,11 +104,6 @@
96});104});
97</pre>105</pre>
98106
99<h2>CSS</h2>
100<p>You need to include two CSS files,
101<a href="../../lib/lazr/build/overlay/assets/pretty-overlay-core.css"><code>overlay/assets/pretty-overlay-core.css</code></a> and
102<a href="../../lib/lazr/build/overlay/assets/skins/sam/pretty-overlay-skin.css"><code>overlay/assets/skins/sam/pretty-overlay-skin.css</code></a>.</p>
103
104<h2>Limitations</h2>107<h2>Limitations</h2>
105<p>You can only specify <code>progressbar: {true, false}</code> in the initial108<p>You can only specify <code>progressbar: {true, false}</code> in the initial
106config object; it cannot be altered once <code>renderUI()</code> has been called.</p>109config object; it cannot be altered once <code>renderUI()</code> has been called.</p>
@@ -108,18 +111,12 @@
108111
109112
110<script type="text/javascript">113<script type="text/javascript">
111YUI({114YUI(LAZR_YUI_CONFIG).use('lazr.overlay', function(Y) {
112 base: '../../build/yui/current/build/',
113 filter: "raw",
114 combine: false
115}).use('lazr.overlay', function(Y) {
116 var overlay = new Y.lazr.PrettyOverlay({115 var overlay = new Y.lazr.PrettyOverlay({
117 bodyContent: 'hello',116 bodyContent: 'hello',
118 headerContent: '<h2>heading</h2>',117 headerContent: '<h2>heading</h2>',
119 steptitle: 'First step',118 steptitle: 'First step',
120 align: {119 centered: true,
121 points: [Y.WidgetPositionExt.CC, Y.WidgetPositionExt.CC]
122 },
123 progressbar: true,120 progressbar: true,
124 progress: 12121 progress: 12
125 });122 });
126123
=== modified file 'examples/picker/index.html'
--- examples/picker/index.html 2009-11-13 22:26:40 +0000
+++ examples/picker/index.html 2009-11-19 17:33:11 +0000
@@ -3,17 +3,25 @@
3<html>3<html>
4<head>4<head>
5 <title>Lazr-js examples: Picker widget</title>5 <title>Lazr-js examples: Picker widget</title>
6 <script type="text/javascript" src="../../build/yui/current/build/yui/yui.js"></script>6
7 <script type="text/javascript" src="../../build/lazr/lazr.js"></script>7 <link rel="stylesheet" type="text/css" href="../../build/cssreset/reset-min.css"></link>
8 <script type="text/javascript" src="../../build/overlay/overlay.js"></script>8 <link rel="stylesheet" type="text/css" href="../../build/cssfonts/fonts-min.css"></link>
9 <script type="text/javascript" src="../../build/picker/picker.js"></script>9 <link rel="stylesheet" type="text/css" href="../../build/cssbase/base-min.css"></link>
1010
11 <script type="text/javascript">11 <script type="text/javascript" src="../../build/yui/yui-min.js"></script>
1212 <script type="text/javascript" src="../../build/lazr/lazr-meta.js"></script>
13YUI({13 <script type="text/javascript">
14 base: '../../build/yui/current/build/',14 var LAZR_YUI_CONFIG = {
15 filter: 'raw'15 filter: "min",
16 }).use('lazr.picker', 'dump', function(Y) {16 base: "../../build/",
17 modules: LAZR_MODULES,
18 insertBefore: "style-overrides",
19 };
20 </script>
21
22 <script type="text/javascript">
23
24YUI(LAZR_YUI_CONFIG).use('lazr.picker', 'dump', function(Y) {
17 // Parse the content of the textarea in the data structure25 // Parse the content of the textarea in the data structure
18 // expected by the widget.26 // expected by the widget.
19 function parse_items () {27 function parse_items () {
@@ -156,15 +164,7 @@
156});164});
157 </script>165 </script>
158166
159 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssreset/reset.css" />167 <style id="style-overrides" type="text/css">
160 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssfonts/fonts.css" />
161 <link rel="stylesheet" type="text/css" href="../../build/yui/current/build/cssbase/base.css" />
162
163 <link rel="stylesheet" type="text/css" href="../../build/overlay/assets/skins/sam/pretty-overlay.css" />
164 <link type="text/css" rel="stylesheet" href="../../build/lazr/assets/skins/sam/lazr.css" />
165 <link type="text/css" rel="stylesheet" href="../../build/picker/assets/picker-core.css" />
166 <link type="text/css" rel="stylesheet" href="../../build/picker/assets/skins/sam/picker-skin.css" />
167 <style>
168 #example { width: 500px; }168 #example { width: 500px; }
169 #items { width: 500px; }169 #items { width: 500px; }
170 body {170 body {
171171
=== modified file 'src-js/lazrjs/activator/activator.js'
--- src-js/lazrjs/activator/activator.js 2009-11-12 21:35:17 +0000
+++ src-js/lazrjs/activator/activator.js 2009-11-19 17:33:11 +0000
@@ -274,5 +274,6 @@
274// Nuke the tabindex attribute.274// Nuke the tabindex attribute.
275Y.augment(Activator, Y.lazr.ui.NoTabIndex, true);275Y.augment(Activator, Y.lazr.ui.NoTabIndex, true);
276276
277}, "0.1", {"requires":277}, "0.1", {"skinnable": true,
278 ["oop", "event", "node", "widget", "lazr.anim", "lazr.base"]});278 "requires": ["oop", "event", "node", "widget",
279 "lazr.anim", "lazr.base"]});
279280
=== modified file 'src-js/lazrjs/autocomplete/autocomplete.js'
--- src-js/lazrjs/autocomplete/autocomplete.js 2009-11-12 21:35:17 +0000
+++ src-js/lazrjs/autocomplete/autocomplete.js 2009-11-19 17:33:11 +0000
@@ -789,4 +789,5 @@
789};789};
790790
791791
792}, "0.1", {"requires":["oop", "base", "event", "widget", "widget-stack", "node-menunav"]});792}, "0.1", {"skinnable": true, "requires":["oop", "base", "event", "widget",
793 "widget-stack", "node-menunav"]});
793794
=== modified file 'src-js/lazrjs/choiceedit/assets/choiceedit-core.css'
--- src-js/lazrjs/choiceedit/assets/choiceedit-core.css 2009-07-31 00:06:15 +0000
+++ src-js/lazrjs/choiceedit/assets/choiceedit-core.css 2009-11-19 17:33:11 +0000
@@ -30,7 +30,7 @@
30.yui-ichoicelist li a:hover {30.yui-ichoicelist li a:hover {
31 background-color: #eee;31 background-color: #eee;
32}32}
33.yui-ichoicelist #yui-pretty-overlay-modal h2 {/33.yui-ichoicelist #yui-pretty-overlay-modal h2 {
34 font-weight: bold;34 font-weight: bold;
35 font-size: 1.2em;35 font-size: 1.2em;
36 text-indent: 0;36 text-indent: 0;
3737
=== added directory 'src-js/lazrjs/choiceedit/assets/skins'
=== added directory 'src-js/lazrjs/choiceedit/assets/skins/sam'
=== added file 'src-js/lazrjs/choiceedit/assets/skins/sam/choiceedit-skin.css'
--- src-js/lazrjs/choiceedit/assets/skins/sam/choiceedit-skin.css 1970-01-01 00:00:00 +0000
+++ src-js/lazrjs/choiceedit/assets/skins/sam/choiceedit-skin.css 2009-11-19 17:33:11 +0000
@@ -0,0 +1,3 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
2
3/* Placeholder for skinning of the Choice Edit Widget */
0\ No newline at end of file4\ No newline at end of file
15
=== modified file 'src-js/lazrjs/choiceedit/choiceedit.js'
--- src-js/lazrjs/choiceedit/choiceedit.js 2009-11-13 20:50:08 +0000
+++ src-js/lazrjs/choiceedit/choiceedit.js 2009-11-19 17:33:11 +0000
@@ -661,7 +661,8 @@
661661
662Y.NullChoiceSource = NullChoiceSource;662Y.NullChoiceSource = NullChoiceSource;
663663
664},"0.2", {"requires": ["oop", "event", "event-delegate", "node",664},"0.2", {"skinnable": true,
665 "widget", "widget-stdmod", "overlay",665 "requires": ["oop", "event", "event-delegate", "node",
666 "lazr.overlay", "lazr.anim", "lazr.base"]});666 "widget", "widget-stdmod", "overlay",
667 "lazr.overlay", "lazr.anim", "lazr.base"]});
667668
668669
=== modified file 'src-js/lazrjs/effects/effects.js'
--- src-js/lazrjs/effects/effects.js 2009-11-12 21:35:17 +0000
+++ src-js/lazrjs/effects/effects.js 2009-11-19 17:33:11 +0000
@@ -183,4 +183,5 @@
183}183}
184184
185185
186}, null, { "requires":["anim", "node"] });186}, null, {"skinnable": true,
187 "requires":["anim", "node"]});
187188
=== added directory 'src-js/lazrjs/error/assets/skins'
=== added directory 'src-js/lazrjs/error/assets/skins/sam'
=== added file 'src-js/lazrjs/error/assets/skins/sam/error-skin.css'
--- src-js/lazrjs/error/assets/skins/sam/error-skin.css 1970-01-01 00:00:00 +0000
+++ src-js/lazrjs/error/assets/skins/sam/error-skin.css 2009-11-19 17:33:11 +0000
@@ -0,0 +1,3 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
2
3/* Placeholder for skinning of the Error Widget */
0\ No newline at end of file4\ No newline at end of file
15
=== modified file 'src-js/lazrjs/error/error.js'
--- src-js/lazrjs/error/error.js 2009-11-16 14:39:47 +0000
+++ src-js/lazrjs/error/error.js 2009-11-19 17:33:11 +0000
@@ -165,4 +165,4 @@
165Y.lazr.error.widget = error_widget;165Y.lazr.error.widget = error_widget;
166Y.lazr.error.BasicErrorWidget = BasicErrorWidget;166Y.lazr.error.BasicErrorWidget = BasicErrorWidget;
167167
168}, "0.1", {"requires":["lazr.overlay"]});168}, "0.1", {"skinnable": true, "requires":["lazr.overlay"]});
169169
=== renamed file 'src-js/lazrjs/formoverlay/assets/formoverlay.css' => 'src-js/lazrjs/formoverlay/assets/formoverlay-core.css'
=== added directory 'src-js/lazrjs/formoverlay/assets/skins'
=== added directory 'src-js/lazrjs/formoverlay/assets/skins/sam'
=== added file 'src-js/lazrjs/formoverlay/assets/skins/sam/formoverlay-skin.css'
--- src-js/lazrjs/formoverlay/assets/skins/sam/formoverlay-skin.css 1970-01-01 00:00:00 +0000
+++ src-js/lazrjs/formoverlay/assets/skins/sam/formoverlay-skin.css 2009-11-19 17:33:11 +0000
@@ -0,0 +1,3 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
2
3/* Placeholder for skinning of the Form Overlay Widget */
0\ No newline at end of file4\ No newline at end of file
15
=== modified file 'src-js/lazrjs/formoverlay/formoverlay.js'
--- src-js/lazrjs/formoverlay/formoverlay.js 2009-11-12 21:35:17 +0000
+++ src-js/lazrjs/formoverlay/formoverlay.js 2009-11-19 17:33:11 +0000
@@ -499,4 +499,4 @@
499499
500Y.lazr.FormOverlay = FormOverlay;500Y.lazr.FormOverlay = FormOverlay;
501501
502}, "0.1", { "requires": ["lazr.overlay"] });502}, "0.1", {"skinnable": true, "requires": ["lazr.overlay"]});
503503
=== modified file 'src-js/lazrjs/inlineedit/editor.js'
--- src-js/lazrjs/inlineedit/editor.js 2009-11-13 20:50:08 +0000
+++ src-js/lazrjs/inlineedit/editor.js 2009-11-19 17:33:11 +0000
@@ -1499,5 +1499,6 @@
14991499
1500//~ Y.log("Module loaded", 'info', 'lazr.editor');1500//~ Y.log("Module loaded", 'info', 'lazr.editor');
15011501
1502}, "0.2", {"requires": ["oop", "anim", "event", "node", "widget",1502}, "0.2", {"skinnable": true,
1503 "requires": ["oop", "anim", "event", "node", "widget",
1503 "lazr.anim", "lazr.base"]});1504 "lazr.anim", "lazr.base"]});
15041505
=== modified file 'src-js/lazrjs/lazr/lazr.js'
--- src-js/lazrjs/lazr/lazr.js 2009-11-12 21:35:17 +0000
+++ src-js/lazrjs/lazr/lazr.js 2009-11-19 17:33:11 +0000
@@ -145,4 +145,4 @@
145};145};
146146
147147
148}, "0.1", {"requires": ["classnamemanager"]});148}, "0.1", {"skinnable": true, "requires": ["classnamemanager"]});
149149
=== modified file 'src-js/lazrjs/overlay/assets/pretty-overlay-core.css'
--- src-js/lazrjs/overlay/assets/pretty-overlay-core.css 2009-10-21 21:43:07 +0000
+++ src-js/lazrjs/overlay/assets/pretty-overlay-core.css 2009-11-19 17:33:11 +0000
@@ -3,11 +3,16 @@
3/* blocking-div appears above everything else. */3/* blocking-div appears above everything else. */
4.blocking-div {4.blocking-div {
5 z-index: 999;5 z-index: 999;
6 position: fixed;6 opacity:0;
7 left: 0px;7 filter:alpha(opacity=0);
8 top: 0px;8 position:absolute;
9 right: 0px;9 border:none;
10 bottom: 0px;10 top:0px;
11 left:0px;
12 padding:0;
13 margin:0;
14 width:100%;
15 height:100%;
11}16}
1217
13/* overlay appears above blocking-div. */18/* overlay appears above blocking-div. */
1419
=== modified file 'src-js/lazrjs/overlay/overlay.js'
--- src-js/lazrjs/overlay/overlay.js 2009-11-13 15:20:06 +0000
+++ src-js/lazrjs/overlay/overlay.js 2009-11-19 17:33:11 +0000
@@ -210,7 +210,7 @@
210 if (visible) {210 if (visible) {
211 Y.get('body').appendChild(this._blocking_div);211 Y.get('body').appendChild(this._blocking_div);
212 // Handle Escape (code 27) on keydown.212 // Handle Escape (code 27) on keydown.
213 this._doc_kp_handler = Y.on('key', function() { 213 this._doc_kp_handler = Y.on('key', function() {
214 self.fire(CANCEL);214 self.fire(CANCEL);
215 }, document, 'down:27');215 }, document, 'down:27');
216 } else {216 } else {
@@ -364,4 +364,4 @@
364364
365 Y.lazr.PrettyOverlay = PrettyOverlay;365 Y.lazr.PrettyOverlay = PrettyOverlay;
366366
367}, "0.1", {"requires": ["oop", "overlay", "event", "widget-position"]});367}, "0.1", {"skinnable": true, "requires": ["oop", "overlay", "event", "widget", "widget-stack", "widget-position", "widget-position-ext"]});
368368
=== modified file 'src-js/lazrjs/picker/picker.js'
--- src-js/lazrjs/picker/picker.js 2009-11-13 20:50:08 +0000
+++ src-js/lazrjs/picker/picker.js 2009-11-19 17:33:11 +0000
@@ -825,7 +825,8 @@
825825
826Y.Picker = Picker;826Y.Picker = Picker;
827827
828}, "0.1", {"requires": ["oop", "event", "event-focus", "node",828}, "0.1", {"skinnable": true,
829 "requires": ["oop", "event", "event-focus", "node",
829 "substitute", "widget", "widget-stdmod",830 "substitute", "widget", "widget-stdmod",
830 "lazr.overlay", "lazr.anim", "lazr.base"]831 "lazr.overlay", "lazr.anim", "lazr.base"]
831});832});
832833
=== renamed directory 'src-js/lazrjs/yui/current/build/anim' => 'src-js/lazrjs/yui/anim'
=== renamed directory 'src-js/lazrjs/yui/current/build/assets' => 'src-js/lazrjs/yui/assets'
=== renamed directory 'src-js/lazrjs/yui/current/build/async-queue' => 'src-js/lazrjs/yui/async-queue'
=== renamed directory 'src-js/lazrjs/yui/current/build/attribute' => 'src-js/lazrjs/yui/attribute'
=== renamed directory 'src-js/lazrjs/yui/current/build/base' => 'src-js/lazrjs/yui/base'
=== renamed directory 'src-js/lazrjs/yui/current/build/cache' => 'src-js/lazrjs/yui/cache'
=== renamed directory 'src-js/lazrjs/yui/current/build/classnamemanager' => 'src-js/lazrjs/yui/classnamemanager'
=== renamed directory 'src-js/lazrjs/yui/current/build/collection' => 'src-js/lazrjs/yui/collection'
=== renamed directory 'src-js/lazrjs/yui/current/build/compat' => 'src-js/lazrjs/yui/compat'
=== renamed directory 'src-js/lazrjs/yui/current/build/console' => 'src-js/lazrjs/yui/console'
=== renamed directory 'src-js/lazrjs/yui/current/build/cookie' => 'src-js/lazrjs/yui/cookie'
=== renamed directory 'src-js/lazrjs/yui/current/build/cssbase' => 'src-js/lazrjs/yui/cssbase'
=== renamed directory 'src-js/lazrjs/yui/current/build/cssfonts' => 'src-js/lazrjs/yui/cssfonts'
=== renamed directory 'src-js/lazrjs/yui/current/build/cssgrids' => 'src-js/lazrjs/yui/cssgrids'
=== renamed directory 'src-js/lazrjs/yui/current/build/cssreset' => 'src-js/lazrjs/yui/cssreset'
=== removed directory 'src-js/lazrjs/yui/current'
=== removed directory 'src-js/lazrjs/yui/current/build'
=== renamed directory 'src-js/lazrjs/yui/current/build/dataschema' => 'src-js/lazrjs/yui/dataschema'
=== renamed directory 'src-js/lazrjs/yui/current/build/datasource' => 'src-js/lazrjs/yui/datasource'
=== renamed directory 'src-js/lazrjs/yui/current/build/datatype' => 'src-js/lazrjs/yui/datatype'
=== renamed directory 'src-js/lazrjs/yui/current/build/dd' => 'src-js/lazrjs/yui/dd'
=== renamed directory 'src-js/lazrjs/yui/current/build/dom' => 'src-js/lazrjs/yui/dom'
=== renamed directory 'src-js/lazrjs/yui/current/build/dump' => 'src-js/lazrjs/yui/dump'
=== renamed directory 'src-js/lazrjs/yui/current/build/event' => 'src-js/lazrjs/yui/event'
=== renamed directory 'src-js/lazrjs/yui/current/build/event-custom' => 'src-js/lazrjs/yui/event-custom'
=== renamed directory 'src-js/lazrjs/yui/current/build/event-simulate' => 'src-js/lazrjs/yui/event-simulate'
=== renamed directory 'src-js/lazrjs/yui/current/build/get' => 'src-js/lazrjs/yui/get'
=== renamed directory 'src-js/lazrjs/yui/current/build/history' => 'src-js/lazrjs/yui/history'
=== renamed directory 'src-js/lazrjs/yui/current/build/imageloader' => 'src-js/lazrjs/yui/imageloader'
=== renamed directory 'src-js/lazrjs/yui/current/build/io' => 'src-js/lazrjs/yui/io'
=== renamed directory 'src-js/lazrjs/yui/current/build/json' => 'src-js/lazrjs/yui/json'
=== renamed directory 'src-js/lazrjs/yui/current/build/loader' => 'src-js/lazrjs/yui/loader'
=== renamed directory 'src-js/lazrjs/yui/current/build/node' => 'src-js/lazrjs/yui/node'
=== renamed directory 'src-js/lazrjs/yui/current/build/node-focusmanager' => 'src-js/lazrjs/yui/node-focusmanager'
=== renamed directory 'src-js/lazrjs/yui/current/build/node-menunav' => 'src-js/lazrjs/yui/node-menunav'
=== renamed directory 'src-js/lazrjs/yui/current/build/oop' => 'src-js/lazrjs/yui/oop'
=== renamed directory 'src-js/lazrjs/yui/current/build/overlay' => 'src-js/lazrjs/yui/overlay'
=== renamed directory 'src-js/lazrjs/yui/current/build/plugin' => 'src-js/lazrjs/yui/plugin'
=== renamed directory 'src-js/lazrjs/yui/current/build/pluginhost' => 'src-js/lazrjs/yui/pluginhost'
=== renamed directory 'src-js/lazrjs/yui/current/build/profiler' => 'src-js/lazrjs/yui/profiler'
=== renamed directory 'src-js/lazrjs/yui/current/build/queue-promote' => 'src-js/lazrjs/yui/queue-promote'
=== renamed directory 'src-js/lazrjs/yui/current/build/slider' => 'src-js/lazrjs/yui/slider'
=== renamed directory 'src-js/lazrjs/yui/current/build/stylesheet' => 'src-js/lazrjs/yui/stylesheet'
=== renamed directory 'src-js/lazrjs/yui/current/build/substitute' => 'src-js/lazrjs/yui/substitute'
=== renamed directory 'src-js/lazrjs/yui/current/build/test' => 'src-js/lazrjs/yui/test'
=== renamed directory 'src-js/lazrjs/yui/current/build/widget' => 'src-js/lazrjs/yui/widget'
=== renamed directory 'src-js/lazrjs/yui/current/build/yui' => 'src-js/lazrjs/yui/yui'
=== renamed directory 'src-js/lazrjs/yui/current/build/yui-base' => 'src-js/lazrjs/yui/yui-base'
=== modified file 'src-py/lazr/js/build.py'
--- src-py/lazr/js/build.py 2009-11-13 16:47:45 +0000
+++ src-py/lazr/js/build.py 2009-11-19 17:33:11 +0000
@@ -211,9 +211,6 @@
211 self.extra_files = []211 self.extra_files = []
212 else:212 else:
213 self.extra_files = extra_files213 self.extra_files = extra_files
214 # If we build the lazr-js widgets, make sure that YUI source is
215 # included as well, since we depend on it being available.
216 self.include_yui = (src_dir == SRC_DIR)
217214
218 self.exclusion_regex = exclude_regex215 self.exclusion_regex = exclude_regex
219 self.file_type = file_type216 self.file_type = file_type
@@ -420,14 +417,6 @@
420417
421 self.update_combined_js_file()418 self.update_combined_js_file()
422 self.update_combined_css_skins()419 self.update_combined_css_skins()
423 if self.include_yui:
424 self.link_yui_directory()
425
426 def link_yui_directory(self):
427 """Link to the built yui source directory."""
428 yui_directory = os.path.join(os.path.dirname(lazrjs.__file__), 'yui')
429 link_location = os.path.join(self.build_dir, 'yui')
430 self.ensure_link(yui_directory, link_location)
431420
432421
433def get_options():422def get_options():
434423
=== modified file 'src-py/lazr/js/meta.py'
--- src-py/lazr/js/meta.py 2009-11-13 15:37:35 +0000
+++ src-py/lazr/js/meta.py 2009-11-19 17:33:11 +0000
@@ -77,12 +77,16 @@
77 meta = extract_metadata(data)77 meta = extract_metadata(data)
78 prefix = ""78 prefix = ""
79 if self.prefix and not prefix.endswith("/"):79 if self.prefix and not prefix.endswith("/"):
80 prefix = prefix + "/"80 prefix = self.prefix + "/"
81 for entry in meta:81 for entry in meta:
82 entry["path"] = (82 entry["path"] = (
83 prefix + fname.replace(root + os.path.sep, ""))83 prefix + fname.replace(root + os.path.sep, "")
84 ).replace(os.path.sep, "/")
85
84 entry["type"] = "js"86 entry["type"] = "js"
85 entry["ext"] = self.ext87 entry["ext"] = self.ext
88 if entry.get("skinnable"):
89 self.generate_skin_modules(entry, metadata, root)
86 metadata.extend(meta)90 metadata.extend(meta)
8791
88 modules = {}92 modules = {}
@@ -93,6 +97,94 @@
93 open(out, "w").write("var %s = %s;" %97 open(out, "w").write("var %s = %s;" %
94 (var_name, simplejson.dumps(modules)))98 (var_name, simplejson.dumps(modules)))
9599
100 def generate_skin_modules(self, entry, metadata, root):
101 # Generate a skin module definition, since YUI assumes that
102 # the path starts with the module name, and that breaks with
103 # our structure.
104 #
105 # Follow lazr-js conventions and look for any file in the skin
106 # assets directory.
107 module_names = []
108 by_name = {}
109
110 prefix = ""
111 if self.prefix and not prefix.endswith("/"):
112 prefix = self.prefix + "/"
113
114 # Default 'after' modules from YUI Loader. Might have to
115 # be changed in the future, if YUI itself changes.
116 after = ["cssreset", "cssfonts",
117 "cssgrids", "cssreset-context",
118 "cssfonts-context",
119 "cssgrids-context"]
120
121 if entry.get("requires"):
122 # If the base module requires other modules, extend
123 # the after entry with the (expected) skins for those
124 # modules to force our skin to be loaded after those.
125 after.extend(["skin-sam-%s" % s
126 for s in entry["requires"]])
127
128 assets = os.path.join(
129 os.path.dirname(entry["path"][len(prefix):]), "assets")
130 sam = os.path.join(assets, "skins", "sam")
131 css_assets = glob.glob(os.path.join(root, sam, "*-skin.css"))
132
133 for fname in css_assets:
134 if not os.path.exists(fname):
135 # If the file doesn't exist, don't create a module to
136 # load it.
137 continue
138
139 # Compute a module name for this asset.
140 module_name = os.path.basename(fname)[:-len("-skin.css")]
141 skin_module_name = "skin-sam-%s" % entry["name"]
142 # If the computed module_name does not match the
143 # Javascript module name without the namespace, then use
144 # it as a postfix to disambiguate possibly multiple
145 # modules.
146 package = entry["name"].split(".")[-1]
147 if module_name != package and len(css_assets) > 1:
148 skin_module_name = "%s+%s" % (skin_module_name, module_name)
149
150 css = (fname.replace(root + os.path.sep, "")
151 ).replace(os.path.sep, "/")
152 module = {"name": skin_module_name,
153 "after": after[:],
154 "type": "css",
155 "ext": self.ext,
156 "path": prefix + css}
157 by_name[skin_module_name] = module
158 module_names.append(skin_module_name)
159 metadata.append(module)
160
161 # All assets under the skin have been looked at. Now look for
162 # a "-core.css" asset, following lazr-js conventions and add
163 # it as a requirement for the previously-found assets.
164 for module_name in module_names:
165 name = os.path.basename(
166 by_name[module_name]["path"])[:-len("-skin.css")]
167 fname = os.path.join(root, assets, "%s-core.css" % name)
168 if not os.path.exists(fname):
169 # No core CSS asset exists for this skin, skip
170 # generating a module for it.
171 continue
172
173 skin_module_name = "%s+core" % module_name
174 css = (fname.replace(root + os.path.sep, "")
175 ).replace(os.path.sep, "/")
176 module = {"name": skin_module_name,
177 "after": after[:],
178 "type": "css",
179 "ext": self.ext,
180 "path": prefix + css}
181
182 requires = by_name[module_name].setdefault("requires", [])
183 requires.append(skin_module_name)
184 after = by_name[module_name].setdefault("after", [])
185 after.append(skin_module_name)
186 metadata.append(module)
187
96 def do_build(self):188 def do_build(self):
97 included_files = []189 included_files = []
98190
99191
=== modified file 'src-py/lazr/js/tests/test_meta.py'
--- src-py/lazr/js/tests/test_meta.py 2009-11-13 20:24:46 +0000
+++ src-py/lazr/js/tests/test_meta.py 2009-11-19 17:33:11 +0000
@@ -185,7 +185,7 @@
185 Y.log('goodbye world');185 Y.log('goodbye world');
186 }, Y);186 }, Y);
187 }, '0.1', {"use": ["dom"], "omit": ["nono"],187 }, '0.1', {"use": ["dom"], "omit": ["nono"],
188 "skinnable": true, "optional": ["meh"],188 "optional": ["meh"],
189 "supersedes": ["old-anim"],189 "supersedes": ["old-anim"],
190 "after": ["lazr.base"]});190 "after": ["lazr.base"]});
191 """)191 """)
@@ -194,12 +194,10 @@
194 self.assertEquals(metadata[0]["name"], "lazr.anim")194 self.assertEquals(metadata[0]["name"], "lazr.anim")
195 self.assertEquals(metadata[0]["use"], ["dom"])195 self.assertEquals(metadata[0]["use"], ["dom"])
196 self.assertEquals(metadata[0]["omit"], ["nono"])196 self.assertEquals(metadata[0]["omit"], ["nono"])
197 self.assertEquals(metadata[0]["skinnable"], True)
198 self.assertEquals(metadata[0]["optional"], ["meh"])197 self.assertEquals(metadata[0]["optional"], ["meh"])
199 self.assertEquals(metadata[0]["supersedes"], ["old-anim"])198 self.assertEquals(metadata[0]["supersedes"], ["old-anim"])
200 self.assertEquals(metadata[0]["after"], ["lazr.base"])199 self.assertEquals(metadata[0]["after"], ["lazr.base"])
201200
202
203class GenerateMetadataTest(mocker.MockerTestCase):201class GenerateMetadataTest(mocker.MockerTestCase):
204202
205 def test_generate_metadata_simple(self):203 def test_generate_metadata_simple(self):
@@ -231,6 +229,123 @@
231 open(output, "r").read(),229 open(output, "r").read(),
232 "var LAZR_CONFIG = %s;" % simplejson.dumps(config))230 "var LAZR_CONFIG = %s;" % simplejson.dumps(config))
233231
232 def test_extract_skinnable(self):
233 """
234 If a module is skinnable, we'll generate the module
235 registration for it's skin ourselves, to prevent YUI from
236 auto-generating one, since it assumes the skin path starts
237 with the module name.
238 """
239 root = self.makeDir()
240 anim = self.makeDir(path=os.path.join(root, "anim"))
241 sample = self.makeFile("""\
242 YUI.add('lazr.anim', function(Y){
243 Y.log('Hello World');
244 }, "0.1", {"use": ["dom"], "requires": ["widget"], "skinnable": true});
245 """, basename="anim.js", dirname=anim)
246
247 skin = self.makeDir(path=os.path.join(anim, "assets", "skins", "sam"))
248 css = self.makeFile("""\
249 /* anim-skin.css */
250 """, basename="anim-skin.css", dirname=skin)
251
252 output = self.makeFile("")
253 builder = TestBuilder(name="LAZR_CONFIG", src_dir=root,
254 output=output, exclude_regex="",
255 prefix="lazr")
256 builder.do_build()
257
258 config = {
259 "skin-sam-lazr.anim":
260 {"path": "lazr/anim/assets/skins/sam/anim-skin.css",
261 "type": "css",
262 "ext": True,
263 "after": ["cssreset", "cssfonts", "cssgrids",
264 "cssreset-context", "cssfonts-context",
265 "cssgrids-context", "skin-sam-widget"],
266 },
267 "lazr.anim":
268 {"path": "lazr/anim/anim.js",
269 "use": ["dom"],
270 "requires": ["widget"],
271 "type": "js",
272 "ext": True,
273 "skinnable": True,
274 }
275 }
276
277 got = open(output, "r").read()
278 prefix = got[:18]
279 self.assertEquals(prefix, "var LAZR_CONFIG = ")
280 self.assertEquals(simplejson.loads(got[18:-1]), config)
281
282 def test_extract_skinnable_with_lazr_conventions(self):
283 """
284 LazrJS conventionally uses a "-core.css" file to load core CSS rules,
285 and a "-skin.css" file to store skinnable rules.
286
287 If we find this filesystem structure, let's generate different
288 CSS modules and hook them up accordingly. The filename doesn't
289 need to match the module name.
290 """
291 root = self.makeDir()
292 anim = self.makeDir(path=os.path.join(root, "anim"))
293 sample = self.makeFile("""\
294 YUI.add('lazr.anim', function(Y){
295 Y.log('Hello World');
296 }, "0.1", {"use": ["dom"], "requires": ["widget"], "skinnable": true});
297 """, basename="anim.js", dirname=anim)
298
299 assets = self.makeDir(path=os.path.join(anim, "assets"))
300 css_core = self.makeFile("""\
301 /* purty-anim-core.css */
302 """, basename="purty-anim-core.css", dirname=assets)
303
304 skin = self.makeDir(path=os.path.join(assets, "skins", "sam"))
305 css_skin = self.makeFile("""\
306 /* purty-anim-skin.css */
307 """, basename="purty-anim-skin.css", dirname=skin)
308
309 output = self.makeFile("")
310 builder = TestBuilder(name="LAZR_CONFIG", src_dir=root,
311 output=output, exclude_regex="",
312 prefix="lazr")
313 builder.do_build()
314
315 config = {
316 "skin-sam-lazr.anim+core":
317 {"path": "lazr/anim/assets/purty-anim-core.css",
318 "type": "css",
319 "ext": True,
320 "after": ["cssreset", "cssfonts", "cssgrids",
321 "cssreset-context", "cssfonts-context",
322 "cssgrids-context", "skin-sam-widget"],
323 },
324 "skin-sam-lazr.anim":
325 {"path": "lazr/anim/assets/skins/sam/purty-anim-skin.css",
326 "type": "css",
327 "ext": True,
328 "after": ["cssreset", "cssfonts", "cssgrids",
329 "cssreset-context", "cssfonts-context",
330 "cssgrids-context", "skin-sam-widget",
331 "skin-sam-lazr.anim+core"],
332 "requires": ["skin-sam-lazr.anim+core"],
333 },
334 "lazr.anim":
335 {"path": "lazr/anim/anim.js",
336 "use": ["dom"],
337 "requires": ["widget"],
338 "type": "js",
339 "ext": True,
340 "skinnable": True,
341 }
342 }
343
344 got = open(output, "r").read()
345 prefix = got[:18]
346 self.assertEquals(prefix, "var LAZR_CONFIG = ")
347 self.assertEquals(simplejson.loads(got[18:-1]), config)
348
234349
235def test_suite():350def test_suite():
236 return defaultTestLoader.loadTestsFromName(__name__)351 return defaultTestLoader.loadTestsFromName(__name__)

Subscribers

People subscribed via source and target branches