Merge lp:~rockstar/phazr/a11y into lp:phazr

Proposed by Paul Hummer
Status: Merged
Approved by: Paul Hummer
Approved revision: 26
Merge reported by: Paul Hummer
Merged at revision: not available
Proposed branch: lp:~rockstar/phazr/a11y
Merge into: lp:phazr
Prerequisite: lp:~rockstar/phazr/editor
Diff against target: 130 lines (+34/-22)
3 files modified
examples/formplugin/index.html (+2/-2)
src/js/editableplugin/editableplugin.js (+7/-4)
src/js/formplugin/formplugin.js (+25/-16)
To merge this branch: bzr merge lp:~rockstar/phazr/a11y
Reviewer Review Type Date Requested Status
Stuart Colville (community) Approve
Review via email: mp+63503@code.launchpad.net

Commit message

Add accessibility features to widgets

Description of the change

This branch makes some a11y changes that need to be made anyway, but also start to implement the Design team's goals for what the modal overlay should look like. There are no styles for this currently, which is by design. I'd assume that each project will want the buttons to have their own colors, etc.

While I was there, I fixed some other things as well. I'm more than happy to explain those changes as well.

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

No proposals found for merge of lp:~rockstar/phazr/editor into lp:phazr.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/formplugin/index.html'
2--- examples/formplugin/index.html 2011-03-19 04:57:56 +0000
3+++ examples/formplugin/index.html 2011-06-05 20:39:56 +0000
4@@ -31,12 +31,12 @@
5 footerContent: 'This is a footer.',
6 headerContent: 'This is a header',
7 plugins: [{fn: Y.FormPlugin, cfg: {
8- submitFn: function() { alert('submitted'); }
9+ submitFn: function() { alert('submitted'); this.hide(); }
10 }}],
11 visible: true,
12 zIndex: 10
13 });
14- overlay.loadForm(
15+ overlay.form.loadForm(
16 '<form action=""><label>Name</label><input type="text" name="name" /></form>');
17 overlay.render();
18 });
19
20=== modified file 'src/js/editableplugin/editableplugin.js'
21--- src/js/editableplugin/editableplugin.js 2011-06-05 20:39:56 +0000
22+++ src/js/editableplugin/editableplugin.js 2011-06-05 20:39:56 +0000
23@@ -22,9 +22,10 @@
24 if (editor === null) {
25 var parentNode = host.get('parentNode'),
26 editor = Y.Node.create('<div></div>'),
27- controls = Y.Node.create('<span></span'),
28- save = Y.Node.create('<a class="clickable save"></a>'),
29- cancel = Y.Node.create('<a class="clickable cancel"></a>'),
30+ controlTemplate = multiline ? '<div></div>' : '<span></span>',
31+ controls = Y.Node.create(controlTemplate),
32+ save = Y.Node.create(this.get('saveTemplate')),
33+ cancel = Y.Node.create(this.get('cancelTemplate')),
34 textbox = null;
35
36 if (multiline) {
37@@ -71,9 +72,11 @@
38 }
39 }, {
40 ATTRS: {
41+ cancelTemplate: { value: '<button class="phazr-button phazr-cancel">Cancel</button>' },
42 editor: { value: null },
43 multiline: { value: false },
44- saveFn: { value: null }
45+ saveFn: { value: null },
46+ saveTemplate: { value: '<button class="phazr-button phazr-save">Save</button>' }
47 },
48 NS: 'editable'
49 });
50
51=== modified file 'src/js/formplugin/formplugin.js'
52--- src/js/formplugin/formplugin.js 2011-03-23 02:29:46 +0000
53+++ src/js/formplugin/formplugin.js 2011-06-05 20:39:56 +0000
54@@ -3,8 +3,6 @@
55 var FormPlugin = Y.Base.create('formplugin', Y.Plugin.Base, [], {
56 initializer: function(config) {
57 var host = this.get('host');
58- host.loadForm = Y.bind(this.loadForm, this);
59- host.loadFormFromURL = Y.bind(this.loadFormFromURL, this);
60
61 if (config.submitFn) {
62 this.set('submitFn', config.submitFn);
63@@ -15,26 +13,23 @@
64 },
65 renderUI: function() {
66 var host = this.get('host'),
67- saveButton = Y.Node.create(
68- '<a class="clickable" id="save-control"></a>'),
69- cancelButton = Y.Node.create(
70- '<a class="clickable" id="cancel-control"></a>'),
71+ saveButton = this.get('saveButton'),
72+ cancelButton = this.get('cancelButton'),
73 controls = Y.Node.create('<div></div>');
74 controls.addClass(host.getClassName() + '-controls');
75 controls.appendChild(saveButton);
76 controls.appendChild(cancelButton);
77- this.set('saveButton', saveButton);
78- this.set('cancelButton', cancelButton);
79 host.get('contentBox').appendChild(controls);
80 },
81 bindUI: function() {
82 var host = this.get('host');
83 footer = host.get('boundingBox').one('.yui3-widget-ft');
84- this.get('saveButton').on('click', this.get('submitFn'));
85- this.get('cancelButton').on('click', function(e) {
86- e.preventDefault();
87- host.hide();
88- });
89+ this.get('saveButton').on('click', this.get('submitFn'), this.get('host'));
90+ this.get('cancelButton').on('click', this.close, this);
91+ },
92+ close: function(e) {
93+ e.preventDefault();
94+ this.get('host').hide();
95 },
96 loadForm: function(form) {
97 var host = this.get('host'),
98@@ -54,16 +49,30 @@
99 }
100 }, {
101 ATTRS: {
102- cancelButton: {},
103+ cancelButton: {
104+ valueFn: function() {
105+ return Y.Node.create(this.get('cancelTemplate'));
106+ }
107+ },
108+ cancelTemplate: {
109+ value: '<button class="phazr-button phazr-cancel">Cancel</button>'
110+ },
111 form: {},
112- saveButton: {},
113+ saveButton: {
114+ valueFn: function() {
115+ return Y.Node.create(this.get('saveTemplate'));
116+ }
117+ },
118+ saveTemplate: {
119+ value: '<button class="phazr-button phazr-save">Save</button>'
120+ },
121 submitFn: {
122 defaultFn: function() {
123 return function() {};
124 }
125 }
126 },
127- NS: 'formPlugin'
128+ NS: 'form'
129 });
130 Y.FormPlugin = FormPlugin;
131

Subscribers

People subscribed via source and target branches

to all changes: