upjs-rails 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/dist/up.js +71 -23
  3. data/dist/up.min.js +1 -1
  4. data/lib/assets/javascripts/up/form.js.coffee +50 -16
  5. data/lib/assets/javascripts/up/modal.js.coffee +22 -8
  6. data/lib/assets/javascripts/up/proxy.js.coffee +1 -1
  7. data/lib/upjs/rails/version.rb +1 -1
  8. metadata +3 -40
  9. data/doc/theme/Gruntfile.js +0 -25
  10. data/doc/theme/README.md +0 -29
  11. data/doc/theme/assets/css/external-small.png +0 -0
  12. data/doc/theme/assets/css/logo.png +0 -0
  13. data/doc/theme/assets/css/main.css +0 -859
  14. data/doc/theme/assets/css/main.less +0 -897
  15. data/doc/theme/assets/favicon.png +0 -0
  16. data/doc/theme/assets/img/bgscreen.png +0 -0
  17. data/doc/theme/assets/img/spinner.gif +0 -0
  18. data/doc/theme/assets/index.html +0 -10
  19. data/doc/theme/assets/js/api-filter.js +0 -52
  20. data/doc/theme/assets/js/api-list.js +0 -251
  21. data/doc/theme/assets/js/api-search.js +0 -98
  22. data/doc/theme/assets/js/apidocs.js +0 -369
  23. data/doc/theme/assets/js/yui-prettify.js +0 -17
  24. data/doc/theme/assets/vendor/prettify/CHANGES.html +0 -130
  25. data/doc/theme/assets/vendor/prettify/COPYING +0 -202
  26. data/doc/theme/assets/vendor/prettify/README.html +0 -203
  27. data/doc/theme/assets/vendor/prettify/prettify-min.css +0 -1
  28. data/doc/theme/assets/vendor/prettify/prettify-min.js +0 -1
  29. data/doc/theme/layouts/main.handlebars +0 -54
  30. data/doc/theme/layouts/xhr.handlebars +0 -7
  31. data/doc/theme/package.json +0 -53
  32. data/doc/theme/partials/attrs.handlebars +0 -141
  33. data/doc/theme/partials/classes.handlebars +0 -210
  34. data/doc/theme/partials/events.handlebars +0 -145
  35. data/doc/theme/partials/exampleurl.handlebars +0 -8
  36. data/doc/theme/partials/files.handlebars +0 -7
  37. data/doc/theme/partials/index.handlebars +0 -18
  38. data/doc/theme/partials/method.handlebars +0 -201
  39. data/doc/theme/partials/module.handlebars +0 -92
  40. data/doc/theme/partials/options.handlebars +0 -23
  41. data/doc/theme/partials/props.handlebars +0 -128
  42. data/doc/theme/partials/sidebar.handlebars +0 -27
  43. data/doc/theme/theme.json +0 -4
  44. data/doc/yuidoc-helpers.js +0 -0
  45. data/doc/yuidoc.json +0 -15
  46. /data/{doc/theme/api/.keep → design/rename.txt} +0 -0
Binary file
Binary file
Binary file
@@ -1,10 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <title>Redirector</title>
5
- <meta http-equiv="refresh" content="0;url=../">
6
- </head>
7
- <body>
8
- <a href="../">Click here to redirect</a>
9
- </body>
10
- </html>
@@ -1,52 +0,0 @@
1
- YUI.add('api-filter', function (Y) {
2
-
3
- Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
4
- // -- Initializer ----------------------------------------------------------
5
- initializer: function () {
6
- this._bindUIACBase();
7
- this._syncUIACBase();
8
- },
9
- getDisplayName: function(name) {
10
-
11
- Y.each(Y.YUIDoc.meta.allModules, function(i) {
12
- if (i.name === name && i.displayName) {
13
- name = i.displayName;
14
- }
15
- });
16
-
17
- return name;
18
- }
19
-
20
- }, {
21
- // -- Attributes -----------------------------------------------------------
22
- ATTRS: {
23
- resultHighlighter: {
24
- value: 'phraseMatch'
25
- },
26
-
27
- // May be set to "classes" or "modules".
28
- queryType: {
29
- value: 'classes'
30
- },
31
-
32
- source: {
33
- valueFn: function() {
34
- var self = this;
35
- return function(q) {
36
- var data = Y.YUIDoc.meta[self.get('queryType')],
37
- out = [];
38
- Y.each(data, function(v) {
39
- if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
40
- out.push(v);
41
- }
42
- });
43
- return out;
44
- };
45
- }
46
- }
47
- }
48
- });
49
-
50
- }, '3.4.0', {requires: [
51
- 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
52
- ]});
@@ -1,251 +0,0 @@
1
- YUI.add('api-list', function (Y) {
2
-
3
- var Lang = Y.Lang,
4
- YArray = Y.Array,
5
-
6
- APIList = Y.namespace('APIList'),
7
-
8
- classesNode = Y.one('#api-classes'),
9
- inputNode = Y.one('#api-filter'),
10
- modulesNode = Y.one('#api-modules'),
11
- tabviewNode = Y.one('#api-tabview'),
12
-
13
- tabs = APIList.tabs = {},
14
-
15
- filter = APIList.filter = new Y.APIFilter({
16
- inputNode : inputNode,
17
- maxResults: 1000,
18
-
19
- on: {
20
- results: onFilterResults
21
- }
22
- }),
23
-
24
- search = APIList.search = new Y.APISearch({
25
- inputNode : inputNode,
26
- maxResults: 100,
27
-
28
- on: {
29
- clear : onSearchClear,
30
- results: onSearchResults
31
- }
32
- }),
33
-
34
- tabview = APIList.tabview = new Y.TabView({
35
- srcNode : tabviewNode,
36
- panelNode: '#api-tabview-panel',
37
- render : true,
38
-
39
- on: {
40
- selectionChange: onTabSelectionChange
41
- }
42
- }),
43
-
44
- focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
45
- circular : true,
46
- descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
47
- keys : {next: 'down:40', previous: 'down:38'}
48
- }).focusManager,
49
-
50
- LIST_ITEM_TEMPLATE =
51
- '<li class="api-list-item {typeSingular}">' +
52
- '<a href="{rootPath}{typePlural}/{name}.html">{displayName}</a>' +
53
- '</li>';
54
-
55
- // -- Init ---------------------------------------------------------------------
56
-
57
- // Duckpunch FocusManager's key event handling to prevent it from handling key
58
- // events when a modifier is pressed.
59
- Y.before(function (e, activeDescendant) {
60
- if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) {
61
- return new Y.Do.Prevent();
62
- }
63
- }, focusManager, '_focusPrevious', focusManager);
64
-
65
- Y.before(function (e, activeDescendant) {
66
- if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) {
67
- return new Y.Do.Prevent();
68
- }
69
- }, focusManager, '_focusNext', focusManager);
70
-
71
- // Create a mapping of tabs in the tabview so we can refer to them easily later.
72
- tabview.each(function (tab, index) {
73
- var name = tab.get('label').toLowerCase();
74
-
75
- tabs[name] = {
76
- index: index,
77
- name : name,
78
- tab : tab
79
- };
80
- });
81
-
82
- // Switch tabs on Ctrl/Cmd-Left/Right arrows.
83
- tabviewNode.on('key', onTabSwitchKey, 'down:37,39');
84
-
85
- // Focus the filter input when the `/` key is pressed.
86
- Y.one(Y.config.doc).on('key', onSearchKey, 'down:83');
87
-
88
- // Keep the Focus Manager up to date.
89
- inputNode.on('focus', function () {
90
- focusManager.set('activeDescendant', inputNode);
91
- });
92
-
93
- // Update all tabview links to resolved URLs.
94
- tabview.get('panelNode').all('a').each(function (link) {
95
- link.setAttribute('href', link.get('href'));
96
- });
97
-
98
- // -- Private Functions --------------------------------------------------------
99
- function getFilterResultNode() {
100
- return filter.get('queryType') === 'classes' ? classesNode : modulesNode;
101
- }
102
-
103
- // -- Event Handlers -----------------------------------------------------------
104
- function onFilterResults(e) {
105
- var frag = Y.one(Y.config.doc.createDocumentFragment()),
106
- resultNode = getFilterResultNode(),
107
- typePlural = filter.get('queryType'),
108
- typeSingular = typePlural === 'classes' ? 'class' : 'module';
109
-
110
- if (e.results.length) {
111
- YArray.each(e.results, function (result) {
112
- frag.append(Lang.sub(LIST_ITEM_TEMPLATE, {
113
- rootPath : APIList.rootPath,
114
- displayName : filter.getDisplayName(result.highlighted),
115
- name : result.text,
116
- typePlural : typePlural,
117
- typeSingular: typeSingular
118
- }));
119
- });
120
- } else {
121
- frag.append(
122
- '<li class="message">' +
123
- 'No ' + typePlural + ' found.' +
124
- '</li>'
125
- );
126
- }
127
-
128
- resultNode.empty(true);
129
- resultNode.append(frag);
130
-
131
- focusManager.refresh();
132
- }
133
-
134
- function onSearchClear(e) {
135
-
136
- focusManager.refresh();
137
- }
138
-
139
- function onSearchKey(e) {
140
- var target = e.target;
141
-
142
- if (target.test('input,select,textarea')
143
- || target.get('isContentEditable')) {
144
- return;
145
- }
146
-
147
- e.preventDefault();
148
-
149
- inputNode.focus();
150
- focusManager.refresh();
151
- }
152
-
153
- function onSearchResults(e) {
154
- var frag = Y.one(Y.config.doc.createDocumentFragment());
155
-
156
- if (e.results.length) {
157
- YArray.each(e.results, function (result) {
158
- frag.append(result.display);
159
- });
160
- } else {
161
- frag.append(
162
- '<li class="message">' +
163
- 'No results found. Maybe you\'ll have better luck with a ' +
164
- 'different query?' +
165
- '</li>'
166
- );
167
- }
168
-
169
-
170
- focusManager.refresh();
171
- }
172
-
173
- function onTabSelectionChange(e) {
174
- var tab = e.newVal,
175
- name = tab.get('label').toLowerCase();
176
-
177
- tabs.selected = {
178
- index: tab.get('index'),
179
- name : name,
180
- tab : tab
181
- };
182
-
183
- switch (name) {
184
- case 'classes': // fallthru
185
- case 'modules':
186
- filter.setAttrs({
187
- minQueryLength: 0,
188
- queryType : name
189
- });
190
-
191
- search.set('minQueryLength', -1);
192
-
193
- // Only send a request if this isn't the initially-selected tab.
194
- if (e.prevVal) {
195
- filter.sendRequest(filter.get('value'));
196
- }
197
- break;
198
-
199
- case 'everything':
200
- filter.set('minQueryLength', -1);
201
- search.set('minQueryLength', 1);
202
-
203
- if (search.get('value')) {
204
- search.sendRequest(search.get('value'));
205
- } else {
206
- inputNode.focus();
207
- }
208
- break;
209
-
210
- default:
211
- // WTF? We shouldn't be here!
212
- filter.set('minQueryLength', -1);
213
- search.set('minQueryLength', -1);
214
- }
215
-
216
- if (focusManager) {
217
- setTimeout(function () {
218
- focusManager.refresh();
219
- }, 1);
220
- }
221
- }
222
-
223
- function onTabSwitchKey(e) {
224
- var currentTabIndex = tabs.selected.index;
225
-
226
- if (!(e.ctrlKey || e.metaKey)) {
227
- return;
228
- }
229
-
230
- e.preventDefault();
231
-
232
- switch (e.keyCode) {
233
- case 37: // left arrow
234
- if (currentTabIndex > 0) {
235
- tabview.selectChild(currentTabIndex - 1);
236
- inputNode.focus();
237
- }
238
- break;
239
-
240
- case 39: // right arrow
241
- if (currentTabIndex < (Y.Object.size(tabs) - 2)) {
242
- tabview.selectChild(currentTabIndex + 1);
243
- inputNode.focus();
244
- }
245
- break;
246
- }
247
- }
248
-
249
- }, '3.4.0', {requires: [
250
- 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview'
251
- ]});
@@ -1,98 +0,0 @@
1
- YUI.add('api-search', function (Y) {
2
-
3
- var Lang = Y.Lang,
4
- Node = Y.Node,
5
- YArray = Y.Array;
6
-
7
- Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], {
8
- // -- Public Properties ----------------------------------------------------
9
- RESULT_TEMPLATE:
10
- '<li class="result {resultType}">' +
11
- '<a href="{url}">' +
12
- '<h3 class="title">{name}</h3>' +
13
- '<span class="type">{resultType}</span>' +
14
- '<div class="description">{description}</div>' +
15
- '<span class="className">{class}</span>' +
16
- '</a>' +
17
- '</li>',
18
-
19
- // -- Initializer ----------------------------------------------------------
20
- initializer: function () {
21
- this._bindUIACBase();
22
- this._syncUIACBase();
23
- },
24
-
25
- // -- Protected Methods ----------------------------------------------------
26
- _apiResultFilter: function (query, results) {
27
- // Filter components out of the results.
28
- return YArray.filter(results, function (result) {
29
- return result.raw.resultType === 'component' ? false : result;
30
- });
31
- },
32
-
33
- _apiResultFormatter: function (query, results) {
34
- return YArray.map(results, function (result) {
35
- var raw = Y.merge(result.raw), // create a copy
36
- desc = raw.description || '';
37
-
38
- // Convert description to text and truncate it if necessary.
39
- desc = Node.create('<div>' + desc + '</div>').get('text');
40
-
41
- if (desc.length > 65) {
42
- desc = Y.Escape.html(desc.substr(0, 65)) + ' &hellip;';
43
- } else {
44
- desc = Y.Escape.html(desc);
45
- }
46
-
47
- raw['class'] || (raw['class'] = '');
48
- raw.description = desc;
49
-
50
- // Use the highlighted result name.
51
- raw.name = result.highlighted;
52
-
53
- return Lang.sub(this.RESULT_TEMPLATE, raw);
54
- }, this);
55
- },
56
-
57
- _apiTextLocator: function (result) {
58
- return result.displayName || result.name;
59
- }
60
- }, {
61
- // -- Attributes -----------------------------------------------------------
62
- ATTRS: {
63
- resultFormatter: {
64
- valueFn: function () {
65
- return this._apiResultFormatter;
66
- }
67
- },
68
-
69
- resultFilters: {
70
- valueFn: function () {
71
- return this._apiResultFilter;
72
- }
73
- },
74
-
75
- resultHighlighter: {
76
- value: 'phraseMatch'
77
- },
78
-
79
- resultListLocator: {
80
- value: 'data.results'
81
- },
82
-
83
- resultTextLocator: {
84
- valueFn: function () {
85
- return this._apiTextLocator;
86
- }
87
- },
88
-
89
- source: {
90
- value: '/api/v1/search?q={query}&count={maxResults}'
91
- }
92
- }
93
- });
94
-
95
- }, '3.4.0', {requires: [
96
- 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources',
97
- 'escape'
98
- ]});