pbw 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/controllers/pbw/application_controller.rb +3 -16
- data/app/controllers/pbw/base_models_controller.rb +10 -32
- data/app/controllers/pbw/passwords_controller.rb +14 -0
- data/app/controllers/pbw/registrations_controller.rb +9 -6
- data/app/controllers/pbw/sessions_controller.rb +9 -4
- data/app/mailers/pbw/user_mailer.rb +16 -0
- data/app/models/pbw/area.rb +5 -5
- data/app/models/pbw/attached_process.rb +3 -3
- data/app/models/pbw/capability.rb +1 -1
- data/app/models/pbw/command.rb +2 -2
- data/app/models/pbw/constraint.rb +2 -2
- data/app/models/pbw/item.rb +2 -2
- data/app/models/pbw/item_container.rb +4 -4
- data/app/models/pbw/item_conversion.rb +1 -1
- data/app/models/pbw/process.rb +2 -2
- data/app/models/pbw/token.rb +7 -7
- data/app/models/pbw/trigger.rb +3 -3
- data/app/models/pbw/user.rb +30 -8
- data/config/initializers/devise.rb +1 -66
- data/config/locales/pbw.en.yml +7 -0
- data/config/routes.rb +2 -4
- data/lib/generators/pbw/install/install_generator.rb +22 -3
- data/lib/generators/pbw/model_generator.rb +6 -0
- data/lib/generators/pbw/resource_helpers.rb +16 -0
- data/lib/generators/pbw/rules/capability/capability_generator.rb +4 -2
- data/lib/generators/pbw/rules/constraint/constraint_generator.rb +4 -2
- data/lib/generators/pbw/rules/process/process_generator.rb +4 -2
- data/lib/generators/pbw/rules/trigger/trigger_generator.rb +4 -2
- data/lib/generators/pbw/scaffold_generator.rb +0 -12
- data/lib/generators/pbw/templates/app.coffee +5 -3
- data/lib/generators/pbw/templates/application.erb +24 -0
- data/lib/generators/pbw/templates/lifecycle.rb +1 -0
- data/lib/generators/pbw/templates/pbw.coffee +21 -0
- data/lib/generators/pbw/templates/router.coffee +15 -0
- data/lib/generators/pbw/templates/templates/home.jst +10 -1
- data/lib/generators/pbw/templates/templates/login.jst +25 -0
- data/lib/generators/pbw/templates/templates/recover_password.jst +17 -0
- data/lib/generators/pbw/templates/templates/signup.jst +29 -0
- data/lib/generators/pbw/templates/user_recovery.coffee +6 -0
- data/lib/generators/pbw/templates/user_registration.coffee +9 -0
- data/lib/generators/pbw/templates/user_session.coffee +8 -0
- data/lib/generators/pbw/templates/views/edit_view.coffee +15 -8
- data/lib/generators/pbw/templates/views/login_view.coffee +39 -0
- data/lib/generators/pbw/templates/views/new_view.coffee +5 -9
- data/lib/generators/pbw/templates/views/recovery_view.coffee +38 -0
- data/lib/generators/pbw/templates/views/signup_view.coffee +39 -0
- data/lib/pbw/engine.rb +5 -9
- data/lib/pbw/version.rb +1 -1
- data/lib/pbw.rb +15 -2
- data/vendor/assets/javascripts/backbone_datalink.js +21 -0
- metadata +16 -44
- data/app/controllers/pbw/capabilities_controller.rb +0 -7
- data/app/controllers/pbw/constraints_controller.rb +0 -7
- data/app/controllers/pbw/processes_controller.rb +0 -7
- data/app/controllers/pbw/triggers_controller.rb +0 -7
- data/public/Foundation-MIT-LICENSE.txt +0 -20
- data/public/config.rb +0 -26
- data/public/javascripts/foundation/foundation.alerts.js +0 -52
- data/public/javascripts/foundation/foundation.clearing.js +0 -516
- data/public/javascripts/foundation/foundation.cookie.js +0 -74
- data/public/javascripts/foundation/foundation.dropdown.js +0 -178
- data/public/javascripts/foundation/foundation.forms.js +0 -525
- data/public/javascripts/foundation/foundation.interchange.js +0 -271
- data/public/javascripts/foundation/foundation.joyride.js +0 -844
- data/public/javascripts/foundation/foundation.js +0 -447
- data/public/javascripts/foundation/foundation.magellan.js +0 -134
- data/public/javascripts/foundation/foundation.orbit.js +0 -390
- data/public/javascripts/foundation/foundation.placeholder.js +0 -179
- data/public/javascripts/foundation/foundation.reveal.js +0 -330
- data/public/javascripts/foundation/foundation.section.js +0 -422
- data/public/javascripts/foundation/foundation.tooltips.js +0 -208
- data/public/javascripts/foundation/foundation.topbar.js +0 -303
- data/public/javascripts/vendor/custom.modernizr.js +0 -4
- data/public/javascripts/vendor/jquery.js +0 -9807
- data/public/javascripts/vendor/zepto.js +0 -2000
- data/public/sass/_normalize.scss +0 -402
- data/public/sass/_settings.scss +0 -1271
- data/public/sass/app.scss +0 -48
- data/public/stylesheets/app.css +0 -6686
@@ -1,271 +0,0 @@
|
|
1
|
-
/*jslint unparam: true, browser: true, indent: 2 */
|
2
|
-
|
3
|
-
;(function ($, window, document, undefined) {
|
4
|
-
'use strict';
|
5
|
-
|
6
|
-
Foundation.libs.interchange = {
|
7
|
-
name : 'interchange',
|
8
|
-
|
9
|
-
version : '4.2.2',
|
10
|
-
|
11
|
-
cache : {},
|
12
|
-
|
13
|
-
settings : {
|
14
|
-
load_attr : 'interchange',
|
15
|
-
|
16
|
-
named_queries : {
|
17
|
-
'default' : 'only screen and (min-width: 1px)',
|
18
|
-
small : 'only screen and (min-width: 768px)',
|
19
|
-
medium : 'only screen and (min-width: 1280px)',
|
20
|
-
large : 'only screen and (min-width: 1440px)',
|
21
|
-
landscape : 'only screen and (orientation: landscape)',
|
22
|
-
portrait : 'only screen and (orientation: portrait)',
|
23
|
-
retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
|
24
|
-
'only screen and (min--moz-device-pixel-ratio: 2),' +
|
25
|
-
'only screen and (-o-min-device-pixel-ratio: 2/1),' +
|
26
|
-
'only screen and (min-device-pixel-ratio: 2),' +
|
27
|
-
'only screen and (min-resolution: 192dpi),' +
|
28
|
-
'only screen and (min-resolution: 2dppx)'
|
29
|
-
},
|
30
|
-
|
31
|
-
directives : {
|
32
|
-
replace : function (el, path) {
|
33
|
-
if (/IMG/.test(el[0].nodeName)) {
|
34
|
-
var path_parts = path.split('/'),
|
35
|
-
path_file = path_parts[path_parts.length - 1],
|
36
|
-
orig_path = el[0].src;
|
37
|
-
|
38
|
-
if (new RegExp(path_file, 'i').test(el[0].src)) return;
|
39
|
-
|
40
|
-
el[0].src = path;
|
41
|
-
|
42
|
-
return el.trigger('replace', [el[0].src, orig_path]);
|
43
|
-
}
|
44
|
-
}
|
45
|
-
}
|
46
|
-
},
|
47
|
-
|
48
|
-
init : function (scope, method, options) {
|
49
|
-
Foundation.inherit(this, 'throttle');
|
50
|
-
|
51
|
-
if (typeof method === 'object') {
|
52
|
-
$.extend(true, this.settings, method);
|
53
|
-
}
|
54
|
-
|
55
|
-
this.events();
|
56
|
-
this.images();
|
57
|
-
|
58
|
-
if (typeof method !== 'string') {
|
59
|
-
return this.settings.init;
|
60
|
-
} else {
|
61
|
-
return this[method].call(this, options);
|
62
|
-
}
|
63
|
-
},
|
64
|
-
|
65
|
-
events : function () {
|
66
|
-
var self = this;
|
67
|
-
|
68
|
-
$(window).on('resize.fndtn.interchange', self.throttle(function () {
|
69
|
-
self.resize.call(self);
|
70
|
-
}, 50));
|
71
|
-
},
|
72
|
-
|
73
|
-
resize : function () {
|
74
|
-
var cache = this.cache;
|
75
|
-
|
76
|
-
for (var uuid in cache) {
|
77
|
-
if (cache.hasOwnProperty(uuid)) {
|
78
|
-
var passed = this.results(uuid, cache[uuid]);
|
79
|
-
|
80
|
-
if (passed) {
|
81
|
-
this.settings.directives[passed
|
82
|
-
.scenario[1]](passed.el, passed.scenario[0]);
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
86
|
-
|
87
|
-
},
|
88
|
-
|
89
|
-
results : function (uuid, scenarios) {
|
90
|
-
var count = scenarios.length,
|
91
|
-
results_arr = [];
|
92
|
-
|
93
|
-
if (count > 0) {
|
94
|
-
var el = $('[data-uuid="' + uuid + '"]');
|
95
|
-
|
96
|
-
for (var i = count - 1; i >= 0; i--) {
|
97
|
-
var rule = scenarios[i][2];
|
98
|
-
if (this.settings.named_queries.hasOwnProperty(rule)) {
|
99
|
-
var mq = matchMedia(this.settings.named_queries[rule]);
|
100
|
-
} else {
|
101
|
-
var mq = matchMedia(scenarios[i][2]);
|
102
|
-
}
|
103
|
-
if (mq.matches) {
|
104
|
-
return {el: el, scenario: scenarios[i]};
|
105
|
-
}
|
106
|
-
}
|
107
|
-
}
|
108
|
-
|
109
|
-
return false;
|
110
|
-
},
|
111
|
-
|
112
|
-
images : function (force_update) {
|
113
|
-
if (typeof this.cached_images === 'undefined' || force_update) {
|
114
|
-
return this.update_images();
|
115
|
-
}
|
116
|
-
|
117
|
-
return this.cached_images;
|
118
|
-
},
|
119
|
-
|
120
|
-
update_images : function () {
|
121
|
-
var images = document.getElementsByTagName('img'),
|
122
|
-
count = images.length,
|
123
|
-
data_attr = 'data-' + this.settings.load_attr;
|
124
|
-
|
125
|
-
this.cached_images = [];
|
126
|
-
|
127
|
-
for (var i = count - 1; i >= 0; i--) {
|
128
|
-
this.loaded($(images[i]), (i === 0), function (image, last) {
|
129
|
-
if (image) {
|
130
|
-
var str = image.getAttribute(data_attr) || '';
|
131
|
-
|
132
|
-
if (str.length > 0) {
|
133
|
-
this.cached_images.push(image);
|
134
|
-
}
|
135
|
-
}
|
136
|
-
|
137
|
-
if (last) this.enhance();
|
138
|
-
|
139
|
-
}.bind(this));
|
140
|
-
}
|
141
|
-
|
142
|
-
return 'deferred';
|
143
|
-
},
|
144
|
-
|
145
|
-
// based on jquery.imageready.js
|
146
|
-
// @weblinc, @jsantell, (c) 2012
|
147
|
-
|
148
|
-
loaded : function (image, last, callback) {
|
149
|
-
function loaded () {
|
150
|
-
callback(image[0], last);
|
151
|
-
}
|
152
|
-
|
153
|
-
function bindLoad () {
|
154
|
-
this.one('load', loaded);
|
155
|
-
|
156
|
-
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
|
157
|
-
var src = this.attr( 'src' ),
|
158
|
-
param = src.match( /\?/ ) ? '&' : '?';
|
159
|
-
|
160
|
-
param += 'random=' + (new Date()).getTime();
|
161
|
-
this.attr('src', src + param);
|
162
|
-
}
|
163
|
-
}
|
164
|
-
|
165
|
-
if (!image.attr('src')) {
|
166
|
-
loaded();
|
167
|
-
return;
|
168
|
-
}
|
169
|
-
|
170
|
-
if (image[0].complete || image[0].readyState === 4) {
|
171
|
-
loaded();
|
172
|
-
} else {
|
173
|
-
bindLoad.call(image);
|
174
|
-
}
|
175
|
-
},
|
176
|
-
|
177
|
-
enhance : function () {
|
178
|
-
var count = this.images().length;
|
179
|
-
|
180
|
-
for (var i = count - 1; i >= 0; i--) {
|
181
|
-
this._object($(this.images()[i]));
|
182
|
-
}
|
183
|
-
|
184
|
-
return $(window).trigger('resize');
|
185
|
-
},
|
186
|
-
|
187
|
-
parse_params : function (path, directive, mq) {
|
188
|
-
return [this.trim(path), this.convert_directive(directive), this.trim(mq)];
|
189
|
-
},
|
190
|
-
|
191
|
-
convert_directive : function (directive) {
|
192
|
-
var trimmed = this.trim(directive);
|
193
|
-
|
194
|
-
if (trimmed.length > 0) {
|
195
|
-
return trimmed;
|
196
|
-
}
|
197
|
-
|
198
|
-
return 'replace';
|
199
|
-
},
|
200
|
-
|
201
|
-
_object : function(el) {
|
202
|
-
var raw_arr = this.parse_data_attr(el),
|
203
|
-
scenarios = [], count = raw_arr.length;
|
204
|
-
|
205
|
-
if (count > 0) {
|
206
|
-
for (var i = count - 1; i >= 0; i--) {
|
207
|
-
var split = raw_arr[i].split(/\((.*?)(\))$/);
|
208
|
-
|
209
|
-
if (split.length > 1) {
|
210
|
-
var cached_split = split[0].split(','),
|
211
|
-
params = this.parse_params(cached_split[0],
|
212
|
-
cached_split[1], split[1]);
|
213
|
-
|
214
|
-
scenarios.push(params);
|
215
|
-
}
|
216
|
-
}
|
217
|
-
}
|
218
|
-
|
219
|
-
return this.store(el, scenarios);
|
220
|
-
},
|
221
|
-
|
222
|
-
uuid : function (separator) {
|
223
|
-
var delim = separator || "-";
|
224
|
-
|
225
|
-
function S4() {
|
226
|
-
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
227
|
-
}
|
228
|
-
|
229
|
-
return (S4() + S4() + delim + S4() + delim + S4()
|
230
|
-
+ delim + S4() + delim + S4() + S4() + S4());
|
231
|
-
},
|
232
|
-
|
233
|
-
store : function (el, scenarios) {
|
234
|
-
var uuid = this.uuid(),
|
235
|
-
current_uuid = el.data('uuid');
|
236
|
-
|
237
|
-
if (current_uuid) return this.cache[current_uuid];
|
238
|
-
|
239
|
-
el.attr('data-uuid', uuid);
|
240
|
-
|
241
|
-
return this.cache[uuid] = scenarios;
|
242
|
-
},
|
243
|
-
|
244
|
-
trim : function(str) {
|
245
|
-
if (typeof str === 'string') {
|
246
|
-
return $.trim(str);
|
247
|
-
}
|
248
|
-
|
249
|
-
return str;
|
250
|
-
},
|
251
|
-
|
252
|
-
parse_data_attr : function (el) {
|
253
|
-
var raw = el.data(this.settings.load_attr).split(/\[(.*?)\]/),
|
254
|
-
count = raw.length, output = [];
|
255
|
-
|
256
|
-
for (var i = count - 1; i >= 0; i--) {
|
257
|
-
if (raw[i].replace(/[\W\d]+/, '').length > 4) {
|
258
|
-
output.push(raw[i]);
|
259
|
-
}
|
260
|
-
}
|
261
|
-
|
262
|
-
return output;
|
263
|
-
},
|
264
|
-
|
265
|
-
reflow : function () {
|
266
|
-
this.images(true);
|
267
|
-
}
|
268
|
-
|
269
|
-
};
|
270
|
-
|
271
|
-
}(Foundation.zj, this, this.document));
|