Merge lp:~rockstar/phazr/combo-loader-friendly into lp:phazr

Proposed by Paul Hummer
Status: Merged
Approved by: Paul Hummer
Approved revision: 31
Merge reported by: Paul Hummer
Merged at revision: not available
Proposed branch: lp:~rockstar/phazr/combo-loader-friendly
Merge into: lp:phazr
Prerequisite: lp:~rockstar/phazr/a11y
Diff against target: 284 lines (+64/-104)
10 files modified
examples/editableplugin/index.html (+5/-5)
examples/formplugin/index.html (+1/-1)
examples/modaloverlay/index.html (+0/-37)
examples/overlay/index.html (+1/-3)
src/js/editableplugin/editableplugin.js (+1/-1)
src/js/formplugin/formplugin.js (+1/-1)
src/js/modaloverlay/modaloverlay.js (+0/-48)
src/js/phazroverlay/phazroverlay.js (+53/-6)
tests/formplugin.js (+1/-1)
tests/phazroverlay.js (+1/-1)
To merge this branch: bzr merge lp:~rockstar/phazr/combo-loader-friendly
Reviewer Review Type Date Requested Status
Stuart Colville (community) Approve
Review via email: mp+63507@code.launchpad.net

Commit message

Namespace the modules to be combo-loader friendly

Description of the change

This branch makes the phazr modules easily identifiable as the phazr modules. This is done by prefixing with 'phazr-'. This makes it less likely to have conflicts with other modules, and thus more friendly to the combo loader.

This branch also merges the modaloverlay code into the phazr-overlay module. It made no sense where it was before.

To post a comment you must log in.
Revision history for this message
Stuart Colville (muffinresearch) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/editableplugin/index.html'
2--- examples/editableplugin/index.html 2011-06-05 21:41:08 +0000
3+++ examples/editableplugin/index.html 2011-06-05 21:41:08 +0000
4@@ -10,7 +10,7 @@
5 <link rel="stylesheet" href="../../src/css/phazr.css" />
6 </head>
7 <body>
8- <div id="editableplugin-demo">
9+ <div id="editable-example">
10 <h1>Editable Plugin</h1>
11 <p>EditablePlugin allows any text Node to be editable. Select the Node
12 and plug Editable into it.</p>
13@@ -20,7 +20,7 @@
14 </span>
15 </p>
16 <script type="text/javascript">
17- YUI().use('editableplugin', 'node', function(Y) {
18+ YUI().use('phazr-editable', 'node', function(Y) {
19 var demo = Y.one('#editable-demo');
20 demo.plug(Y.Editable, {
21 saveFn: function(value) { alert(value); }
22@@ -28,7 +28,7 @@
23 });
24 </script>
25 <pre><code>
26-YUI().use('editableplugin', 'node', function(Y) {
27+YUI().use('phazr-editable', 'node', function(Y) {
28 var demo = Y.one('#editable-demo');
29 demo.plug(Y.Editable, {
30 saveFn: function(value) { alert(value); }
31@@ -47,7 +47,7 @@
32 </p>
33 </p>
34 <script type="text/javascript">
35- YUI().use('editableplugin', 'node', function(Y) {
36+ YUI().use('phazr-editable', 'node', function(Y) {
37 var demo = Y.one('#multiline-editable-demo');
38 demo.plug(Y.Editable, {
39 multiline: true,
40@@ -56,7 +56,7 @@
41 });
42 </script>
43 <pre><code>
44-YUI().use('editableplugin', 'node', function(Y) {
45+YUI().use('phazr-editable', 'node', function(Y) {
46 var demo = Y.one('#multiline-editable-demo');
47 demo.plug(Y.Editable, {
48 multiline: true,
49
50=== modified file 'examples/formplugin/index.html'
51--- examples/formplugin/index.html 2011-06-05 21:41:08 +0000
52+++ examples/formplugin/index.html 2011-06-05 21:41:08 +0000
53@@ -24,7 +24,7 @@
54 whereas <code>loadFormFromURL</code> will load a form from a specified
55 URL.</p>
56 <script type="text/javascript">
57- YUI().use('formplugin', 'overlay', function(Y) {
58+ YUI().use('phazr-formplugin', 'overlay', function(Y) {
59 var overlay = new Y.Overlay({
60 bodyContent: 'This is where the body content goes',
61 centered: true,
62
63=== removed directory 'examples/modaloverlay'
64=== removed file 'examples/modaloverlay/index.html'
65--- examples/modaloverlay/index.html 2011-05-02 02:18:55 +0000
66+++ examples/modaloverlay/index.html 1970-01-01 00:00:00 +0000
67@@ -1,37 +0,0 @@
68-<!DOCTYPE html>
69-<meta charset="utf-8" />
70-<html>
71- <head>
72- <title>Modal Overlay</title>
73- <script type="text/javascript"
74- src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
75- <script type="text/javascript"
76- src="../../src/js/modaloverlay/modaloverlay.js"></script>
77- <link rel="stylesheet" href="../../src/css/phazr.css" />
78- </head>
79- <body>
80- <div id="modaloverlay-demo">
81- <h1>Modal Extension for Overlays</h1>
82- <p>Modal Extension allows on overlay to operate more like a modal dialog.
83- It has a "close" button at the top right and will also close when hitting
84- "Esc" on the keyboard or clicking outside the overlay.</p>
85- <script type="text/javascript">
86- YUI().use('modaloverlay', 'overlay', function(Y) {
87- var Overlay = Y.Base.create('overlay', Y.Overlay, [
88- Y.ModalOverlay]);
89- var overlay = new Overlay({
90- bodyContent: 'This is where the body content goes',
91- centered: true,
92- footerContent: 'This is a footer.',
93- headerContent: 'This is a header',
94- visible: true,
95- zIndex: 10
96- });
97- overlay.render();
98- });
99- </script>
100- <pre><code>
101- </code></pre>
102- </div>
103- </body>
104-</html>
105
106=== modified file 'examples/overlay/index.html'
107--- examples/overlay/index.html 2011-04-07 05:53:46 +0000
108+++ examples/overlay/index.html 2011-06-05 21:41:08 +0000
109@@ -6,8 +6,6 @@
110 <script type="text/javascript"
111 src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
112 <script type="text/javascript"
113- src="../../src/js/modaloverlay/modaloverlay.js"></script>
114- <script type="text/javascript"
115 src="../../src/js/phazroverlay/phazroverlay.js"></script>
116 <link rel="stylesheet" href="../../src/css/phazr.css" />
117 </head>
118@@ -18,7 +16,7 @@
119 overlay. We skin it with CSS, so that it looks consistent with the
120 previous lazr-js PrettyOverlay.</p>
121 <script type="text/javascript">
122- YUI().use('phazroverlay', function(Y) {
123+ YUI().use('phazr-overlay', function(Y) {
124 var overlay = new Y.PhazrOverlay({
125 centered: true,
126 zIndex: 10,
127
128=== modified file 'src/js/editableplugin/editableplugin.js'
129--- src/js/editableplugin/editableplugin.js 2011-06-05 21:41:08 +0000
130+++ src/js/editableplugin/editableplugin.js 2011-06-05 21:41:08 +0000
131@@ -1,4 +1,4 @@
132-YUI.add('editableplugin', function(Y) {
133+YUI.add('phazr-editable', function(Y) {
134
135 Y.Editable = Y.Base.create('editable', Y.Plugin.Base, [], {
136 initializer: function(config) {
137
138=== modified file 'src/js/formplugin/formplugin.js'
139--- src/js/formplugin/formplugin.js 2011-06-05 21:41:08 +0000
140+++ src/js/formplugin/formplugin.js 2011-06-05 21:41:08 +0000
141@@ -1,4 +1,4 @@
142-YUI.add('formplugin', function(Y) {
143+YUI.add('phazr-formplugin', function(Y) {
144
145 var FormPlugin = Y.Base.create('formplugin', Y.Plugin.Base, [], {
146 initializer: function(config) {
147
148=== removed directory 'src/js/modaloverlay'
149=== removed file 'src/js/modaloverlay/modaloverlay.js'
150--- src/js/modaloverlay/modaloverlay.js 2011-04-07 05:53:46 +0000
151+++ src/js/modaloverlay/modaloverlay.js 1970-01-01 00:00:00 +0000
152@@ -1,48 +0,0 @@
153-YUI.add('modaloverlay', function(Y) {
154-
155- var ModalOverlay = function(config) {
156- Y.Do.after(this.afterRenderUI, this, 'renderUI');
157- Y.Do.after(this.afterBindUI, this, 'bindUI');
158- };
159- ModalOverlay.ATTRS = {
160- closeButton: { value: null },
161- dragDelegate: { value: null }
162- };
163- ModalOverlay.prototype = {
164- afterRenderUI: function() {
165- var template = '<div class="{containerClassName}"><a class="{linkClassName}"></a></div>',
166- className = this.getClassName(),
167- context = {
168- containerClassName: className + '-close',
169- linkClassName: className + '-close-button'
170- },
171- closeContainer = Y.Node.create(
172- Y.substitute(template, context));
173- this.get('contentBox').prepend(closeContainer);
174- this.set('closeButton',
175- closeContainer.one('.' + className + '-close-button'));
176- },
177- afterBindUI: function() {
178- this.get('closeButton').on('click', this.hide, this);
179- Y.on('keyup', function(e) {
180- if (e.keyCode == 27) {
181- this.hide();
182- }
183- }, window, this);
184-
185- var box = this.get('boundingBox'),
186- header = box.one('.' + className + '-hd'),
187- className = this.getClassName(),
188- dd = new Y.DD.Drag({
189- node: box,
190- handle: header
191- });
192- this.set('dragDelegate', dd);
193-
194- }
195- };
196- Y.ModalOverlay = ModalOverlay;
197-
198-}, '0.1', {requires: [
199- 'base', 'dd-delegate', 'node', 'plugin', 'substitute'
200-]});
201
202=== modified file 'src/js/phazroverlay/phazroverlay.js'
203--- src/js/phazroverlay/phazroverlay.js 2011-04-07 05:02:25 +0000
204+++ src/js/phazroverlay/phazroverlay.js 2011-06-05 21:41:08 +0000
205@@ -1,6 +1,53 @@
206-YUI.add('phazroverlay', function(Y) {
207-
208- Y.PhazrOverlay = Y.Base.create('overlay', Y.Overlay, [
209- Y.ModalOverlay]);
210-
211-}, '1.0', { requires: ['base', 'modaloverlay', 'overlay']})
212+YUI.add('phazr-overlay', function(Y) {
213+
214+ var ModalOverlay = function(config) {
215+ Y.Do.after(this.afterRenderUI, this, 'renderUI');
216+ Y.Do.after(this.afterBindUI, this, 'bindUI');
217+ };
218+ ModalOverlay.ATTRS = {
219+ closeButton: { value: null },
220+ dragDelegate: { value: null }
221+ };
222+ ModalOverlay.prototype = {
223+ afterRenderUI: function() {
224+ var template = '<div class="{containerClassName}"><a class="{linkClassName}"></a></div>',
225+ className = this.getClassName(),
226+ context = {
227+ containerClassName: className + '-close',
228+ linkClassName: className + '-close-button'
229+ },
230+ closeContainer = Y.Node.create(
231+ Y.substitute(template, context));
232+ this.get('contentBox').prepend(closeContainer);
233+ this.set('closeButton',
234+ closeContainer.one('.' + className + '-close-button'));
235+ },
236+ afterBindUI: function() {
237+ this.get('closeButton').on('click', this.hide, this);
238+ Y.on('keyup', function(e) {
239+ if (e.keyCode == 27) {
240+ this.hide();
241+ }
242+ }, window, this);
243+
244+ var box = this.get('boundingBox'),
245+ header = box.one('.' + className + '-hd'),
246+ className = this.getClassName(),
247+ dd = new Y.DD.Drag({
248+ node: box,
249+ handle: header
250+ });
251+ this.set('dragDelegate', dd);
252+ }
253+ };
254+
255+ Y.PhazrOverlay = Y.Base.create('overlay', Y.Overlay, [ModalOverlay]);
256+
257+}, '1.0', { requires: [
258+ 'base',
259+ 'dd-delegate',
260+ 'node',
261+ 'overlay',
262+ 'plugin',
263+ 'substitute'
264+]})
265
266=== modified file 'tests/formplugin.js'
267--- tests/formplugin.js 2011-03-19 22:09:56 +0000
268+++ tests/formplugin.js 2011-06-05 21:41:08 +0000
269@@ -1,4 +1,4 @@
270-YUI().use('formplugin', 'overlay', 'test', function(Y) {
271+YUI().use('phazr-formplugin', 'overlay', 'test', function(Y) {
272
273 var suite = new Y.Test.Suite('FormPlugin tests');
274 suite.add(new Y.Test.Case({
275
276=== modified file 'tests/phazroverlay.js'
277--- tests/phazroverlay.js 2011-04-07 05:02:25 +0000
278+++ tests/phazroverlay.js 2011-06-05 21:41:08 +0000
279@@ -1,4 +1,4 @@
280-YUI().use('phazroverlay', 'node-event-simulate', 'test', function(Y) {
281+YUI().use('phazr-overlay', 'node-event-simulate', 'test', function(Y) {
282
283 var suite = new Y.Test.Suite('PhazrOverlay tests');
284 suite.add(new Y.Test.Case({

Subscribers

People subscribed via source and target branches

to all changes: