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,330 +0,0 @@
|
|
1
|
-
/*jslint unparam: true, browser: true, indent: 2 */
|
2
|
-
|
3
|
-
;(function ($, window, document, undefined) {
|
4
|
-
'use strict';
|
5
|
-
|
6
|
-
Foundation.libs.reveal = {
|
7
|
-
name: 'reveal',
|
8
|
-
|
9
|
-
version : '4.2.2',
|
10
|
-
|
11
|
-
locked : false,
|
12
|
-
|
13
|
-
settings : {
|
14
|
-
animation: 'fadeAndPop',
|
15
|
-
animationSpeed: 250,
|
16
|
-
closeOnBackgroundClick: true,
|
17
|
-
closeOnEsc: true,
|
18
|
-
dismissModalClass: 'close-reveal-modal',
|
19
|
-
bgClass: 'reveal-modal-bg',
|
20
|
-
open: function(){},
|
21
|
-
opened: function(){},
|
22
|
-
close: function(){},
|
23
|
-
closed: function(){},
|
24
|
-
bg : $('.reveal-modal-bg'),
|
25
|
-
css : {
|
26
|
-
open : {
|
27
|
-
'opacity': 0,
|
28
|
-
'visibility': 'visible',
|
29
|
-
'display' : 'block'
|
30
|
-
},
|
31
|
-
close : {
|
32
|
-
'opacity': 1,
|
33
|
-
'visibility': 'hidden',
|
34
|
-
'display': 'none'
|
35
|
-
}
|
36
|
-
}
|
37
|
-
},
|
38
|
-
|
39
|
-
init : function (scope, method, options) {
|
40
|
-
Foundation.inherit(this, 'data_options delay');
|
41
|
-
|
42
|
-
if (typeof method === 'object') {
|
43
|
-
$.extend(true, this.settings, method);
|
44
|
-
} else if (typeof options !== 'undefined') {
|
45
|
-
$.extend(true, this.settings, options);
|
46
|
-
}
|
47
|
-
|
48
|
-
if (typeof method !== 'string') {
|
49
|
-
this.events();
|
50
|
-
|
51
|
-
return this.settings.init;
|
52
|
-
} else {
|
53
|
-
return this[method].call(this, options);
|
54
|
-
}
|
55
|
-
},
|
56
|
-
|
57
|
-
events : function () {
|
58
|
-
var self = this;
|
59
|
-
|
60
|
-
$(this.scope)
|
61
|
-
.off('.fndtn.reveal')
|
62
|
-
.on('click.fndtn.reveal', '[data-reveal-id]', function (e) {
|
63
|
-
e.preventDefault();
|
64
|
-
|
65
|
-
if (!self.locked) {
|
66
|
-
var element = $(this),
|
67
|
-
ajax = element.data('reveal-ajax');
|
68
|
-
|
69
|
-
self.locked = true;
|
70
|
-
|
71
|
-
if (typeof ajax === 'undefined') {
|
72
|
-
self.open.call(self, element);
|
73
|
-
} else {
|
74
|
-
var url = ajax === true ? element.attr('href') : ajax;
|
75
|
-
|
76
|
-
self.open.call(self, element, {url: url});
|
77
|
-
}
|
78
|
-
}
|
79
|
-
})
|
80
|
-
.on('click.fndtn.reveal', this.close_targets(), function (e) {
|
81
|
-
e.preventDefault();
|
82
|
-
if (!self.locked) {
|
83
|
-
var settings = $.extend({}, self.settings, self.data_options($('.reveal-modal.open')));
|
84
|
-
if ($(e.target)[0] === $('.' + settings.bgClass)[0] && !settings.closeOnBackgroundClick) {
|
85
|
-
return;
|
86
|
-
}
|
87
|
-
|
88
|
-
self.locked = true;
|
89
|
-
self.close.call(self, $(this).closest('.reveal-modal'));
|
90
|
-
}
|
91
|
-
})
|
92
|
-
.on('open.fndtn.reveal', '.reveal-modal', this.settings.open)
|
93
|
-
.on('opened.fndtn.reveal', '.reveal-modal', this.settings.opened)
|
94
|
-
.on('opened.fndtn.reveal', '.reveal-modal', this.open_video)
|
95
|
-
.on('close.fndtn.reveal', '.reveal-modal', this.settings.close)
|
96
|
-
.on('closed.fndtn.reveal', '.reveal-modal', this.settings.closed)
|
97
|
-
.on('closed.fndtn.reveal', '.reveal-modal', this.close_video);
|
98
|
-
|
99
|
-
$( 'body' ).bind( 'keyup.reveal', function ( event ) {
|
100
|
-
var open_modal = $('.reveal-modal.open'),
|
101
|
-
settings = $.extend({}, self.settings, self.data_options(open_modal));
|
102
|
-
if ( event.which === 27 && settings.closeOnEsc) { // 27 is the keycode for the Escape key
|
103
|
-
open_modal.foundation('reveal', 'close');
|
104
|
-
}
|
105
|
-
});
|
106
|
-
|
107
|
-
return true;
|
108
|
-
},
|
109
|
-
|
110
|
-
open : function (target, ajax_settings) {
|
111
|
-
if (target) {
|
112
|
-
if (typeof target.selector !== 'undefined') {
|
113
|
-
var modal = $('#' + target.data('reveal-id'));
|
114
|
-
} else {
|
115
|
-
var modal = $(this.scope);
|
116
|
-
|
117
|
-
ajax_settings = target;
|
118
|
-
}
|
119
|
-
} else {
|
120
|
-
var modal = $(this.scope);
|
121
|
-
}
|
122
|
-
|
123
|
-
if (!modal.hasClass('open')) {
|
124
|
-
var open_modal = $('.reveal-modal.open');
|
125
|
-
|
126
|
-
if (typeof modal.data('css-top') === 'undefined') {
|
127
|
-
modal.data('css-top', parseInt(modal.css('top'), 10))
|
128
|
-
.data('offset', this.cache_offset(modal));
|
129
|
-
}
|
130
|
-
|
131
|
-
modal.trigger('open');
|
132
|
-
|
133
|
-
if (open_modal.length < 1) {
|
134
|
-
this.toggle_bg(modal);
|
135
|
-
}
|
136
|
-
|
137
|
-
if (typeof ajax_settings === 'undefined' || !ajax_settings.url) {
|
138
|
-
this.hide(open_modal, this.settings.css.close);
|
139
|
-
this.show(modal, this.settings.css.open);
|
140
|
-
} else {
|
141
|
-
var self = this,
|
142
|
-
old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null;
|
143
|
-
|
144
|
-
$.extend(ajax_settings, {
|
145
|
-
success: function (data, textStatus, jqXHR) {
|
146
|
-
if ( $.isFunction(old_success) ) {
|
147
|
-
old_success(data, textStatus, jqXHR);
|
148
|
-
}
|
149
|
-
|
150
|
-
modal.html(data);
|
151
|
-
$(modal).foundation('section', 'reflow');
|
152
|
-
|
153
|
-
self.hide(open_modal, self.settings.css.close);
|
154
|
-
self.show(modal, self.settings.css.open);
|
155
|
-
}
|
156
|
-
});
|
157
|
-
|
158
|
-
$.ajax(ajax_settings);
|
159
|
-
}
|
160
|
-
}
|
161
|
-
},
|
162
|
-
|
163
|
-
close : function (modal) {
|
164
|
-
|
165
|
-
var modal = modal && modal.length ? modal : $(this.scope),
|
166
|
-
open_modals = $('.reveal-modal.open');
|
167
|
-
|
168
|
-
if (open_modals.length > 0) {
|
169
|
-
this.locked = true;
|
170
|
-
modal.trigger('close');
|
171
|
-
this.toggle_bg(modal);
|
172
|
-
this.hide(open_modals, this.settings.css.close);
|
173
|
-
}
|
174
|
-
},
|
175
|
-
|
176
|
-
close_targets : function () {
|
177
|
-
var base = '.' + this.settings.dismissModalClass;
|
178
|
-
|
179
|
-
if (this.settings.closeOnBackgroundClick) {
|
180
|
-
return base + ', .' + this.settings.bgClass;
|
181
|
-
}
|
182
|
-
|
183
|
-
return base;
|
184
|
-
},
|
185
|
-
|
186
|
-
toggle_bg : function (modal) {
|
187
|
-
if ($('.reveal-modal-bg').length === 0) {
|
188
|
-
this.settings.bg = $('<div />', {'class': this.settings.bgClass})
|
189
|
-
.appendTo('body');
|
190
|
-
}
|
191
|
-
|
192
|
-
if (this.settings.bg.filter(':visible').length > 0) {
|
193
|
-
this.hide(this.settings.bg);
|
194
|
-
} else {
|
195
|
-
this.show(this.settings.bg);
|
196
|
-
}
|
197
|
-
},
|
198
|
-
|
199
|
-
show : function (el, css) {
|
200
|
-
// is modal
|
201
|
-
if (css) {
|
202
|
-
if (/pop/i.test(this.settings.animation)) {
|
203
|
-
css.top = $(window).scrollTop() - el.data('offset') + 'px';
|
204
|
-
var end_css = {
|
205
|
-
top: $(window).scrollTop() + el.data('css-top') + 'px',
|
206
|
-
opacity: 1
|
207
|
-
};
|
208
|
-
|
209
|
-
return this.delay(function () {
|
210
|
-
return el
|
211
|
-
.css(css)
|
212
|
-
.animate(end_css, this.settings.animationSpeed, 'linear', function () {
|
213
|
-
this.locked = false;
|
214
|
-
el.trigger('opened');
|
215
|
-
}.bind(this))
|
216
|
-
.addClass('open');
|
217
|
-
}.bind(this), this.settings.animationSpeed / 2);
|
218
|
-
}
|
219
|
-
|
220
|
-
if (/fade/i.test(this.settings.animation)) {
|
221
|
-
var end_css = {opacity: 1};
|
222
|
-
|
223
|
-
return this.delay(function () {
|
224
|
-
return el
|
225
|
-
.css(css)
|
226
|
-
.animate(end_css, this.settings.animationSpeed, 'linear', function () {
|
227
|
-
this.locked = false;
|
228
|
-
el.trigger('opened');
|
229
|
-
}.bind(this))
|
230
|
-
.addClass('open');
|
231
|
-
}.bind(this), this.settings.animationSpeed / 2);
|
232
|
-
}
|
233
|
-
|
234
|
-
return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened');
|
235
|
-
}
|
236
|
-
|
237
|
-
// should we animate the background?
|
238
|
-
if (/fade/i.test(this.settings.animation)) {
|
239
|
-
return el.fadeIn(this.settings.animationSpeed / 2);
|
240
|
-
}
|
241
|
-
|
242
|
-
return el.show();
|
243
|
-
},
|
244
|
-
|
245
|
-
hide : function (el, css) {
|
246
|
-
// is modal
|
247
|
-
if (css) {
|
248
|
-
if (/pop/i.test(this.settings.animation)) {
|
249
|
-
var end_css = {
|
250
|
-
top: - $(window).scrollTop() - el.data('offset') + 'px',
|
251
|
-
opacity: 0
|
252
|
-
};
|
253
|
-
|
254
|
-
return this.delay(function () {
|
255
|
-
return el
|
256
|
-
.animate(end_css, this.settings.animationSpeed, 'linear', function () {
|
257
|
-
this.locked = false;
|
258
|
-
el.css(css).trigger('closed');
|
259
|
-
}.bind(this))
|
260
|
-
.removeClass('open');
|
261
|
-
}.bind(this), this.settings.animationSpeed / 2);
|
262
|
-
}
|
263
|
-
|
264
|
-
if (/fade/i.test(this.settings.animation)) {
|
265
|
-
var end_css = {opacity: 0};
|
266
|
-
|
267
|
-
return this.delay(function () {
|
268
|
-
return el
|
269
|
-
.animate(end_css, this.settings.animationSpeed, 'linear', function () {
|
270
|
-
this.locked = false;
|
271
|
-
el.css(css).trigger('closed');
|
272
|
-
}.bind(this))
|
273
|
-
.removeClass('open');
|
274
|
-
}.bind(this), this.settings.animationSpeed / 2);
|
275
|
-
}
|
276
|
-
|
277
|
-
return el.hide().css(css).removeClass('open').trigger('closed');
|
278
|
-
}
|
279
|
-
|
280
|
-
// should we animate the background?
|
281
|
-
if (/fade/i.test(this.settings.animation)) {
|
282
|
-
return el.fadeOut(this.settings.animationSpeed / 2);
|
283
|
-
}
|
284
|
-
|
285
|
-
return el.hide();
|
286
|
-
},
|
287
|
-
|
288
|
-
close_video : function (e) {
|
289
|
-
var video = $(this).find('.flex-video'),
|
290
|
-
iframe = video.find('iframe');
|
291
|
-
|
292
|
-
if (iframe.length > 0) {
|
293
|
-
iframe.attr('data-src', iframe[0].src);
|
294
|
-
iframe.attr('src', 'about:blank');
|
295
|
-
video.hide();
|
296
|
-
}
|
297
|
-
},
|
298
|
-
|
299
|
-
open_video : function (e) {
|
300
|
-
var video = $(this).find('.flex-video'),
|
301
|
-
iframe = video.find('iframe');
|
302
|
-
|
303
|
-
if (iframe.length > 0) {
|
304
|
-
var data_src = iframe.attr('data-src');
|
305
|
-
if (typeof data_src === 'string') {
|
306
|
-
iframe[0].src = iframe.attr('data-src');
|
307
|
-
} else {
|
308
|
-
var src = iframe[0].src;
|
309
|
-
iframe[0].src = undefined;
|
310
|
-
iframe[0].src = src;
|
311
|
-
}
|
312
|
-
video.show();
|
313
|
-
}
|
314
|
-
},
|
315
|
-
|
316
|
-
cache_offset : function (modal) {
|
317
|
-
var offset = modal.show().height() + parseInt(modal.css('top'), 10);
|
318
|
-
|
319
|
-
modal.hide();
|
320
|
-
|
321
|
-
return offset;
|
322
|
-
},
|
323
|
-
|
324
|
-
off : function () {
|
325
|
-
$(this.scope).off('.fndtn.reveal');
|
326
|
-
},
|
327
|
-
|
328
|
-
reflow : function () {}
|
329
|
-
};
|
330
|
-
}(Foundation.zj, this, this.document));
|