nail_polish 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +29 -0
- data/Rakefile +23 -0
- data/app/assets/javascripts/nail_polish/app.js +58 -0
- data/app/assets/javascripts/nail_polish/events/flasher.js +17 -0
- data/app/assets/javascripts/nail_polish/events/redirector.js +3 -0
- data/app/assets/javascripts/nail_polish/events.js +28 -0
- data/app/assets/javascripts/nail_polish/nail_polish.js +25 -0
- data/app/assets/javascripts/nail_polish/overrides/auth_token_adder.js +44 -0
- data/app/assets/javascripts/nail_polish/overrides/for_backbone.js +14 -0
- data/app/assets/javascripts/nail_polish/overrides/function_bind.js +6 -0
- data/app/assets/javascripts/nail_polish/overrides/global_publisher_adder.js +28 -0
- data/app/assets/javascripts/nail_polish/presenter.js +43 -0
- data/app/assets/javascripts/nail_polish/presenters/collection.js +11 -0
- data/app/assets/javascripts/nail_polish/router.js +78 -0
- data/app/assets/javascripts/nail_polish/utils/text.js +36 -0
- data/app/assets/javascripts/nail_polish/view/parent_finder.js +46 -0
- data/app/assets/javascripts/nail_polish/view.js +80 -0
- data/app/assets/javascripts/nail_polish/widget/flash.js +36 -0
- data/app/assets/javascripts/nail_polish/widget/modal.js +40 -0
- data/app/assets/javascripts/nail_polish.js +21 -0
- data/app/assets/javascripts/nail_polish_legacy_base.js +2 -0
- data/app/assets/javascripts/nail_polish_modern_base.js +2 -0
- data/app/assets/javascripts/nail_polish_widgets.js +2 -0
- data/app/assets/javascripts/vendor/backbone.js +1571 -0
- data/app/assets/javascripts/vendor/jquery-1.8.3.js +9472 -0
- data/app/assets/javascripts/vendor/jquery.cookie.js +94 -0
- data/app/assets/javascripts/vendor/underscore.js +1200 -0
- data/app/assets/javascripts/vendor/zepto.cookie.js +22 -0
- data/app/assets/javascripts/vendor/zepto.js +1355 -0
- data/config/initializers/nail_polish.rb +1 -0
- data/config/routes.rb +2 -0
- data/lib/nail_polish/engine.rb +4 -0
- data/lib/nail_polish/version.rb +3 -0
- data/lib/nail_polish.rb +7 -0
- data/lib/tasks/nail_polish_tasks.rake +4 -0
- metadata +207 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
NailPolish.Widget.Modal = NailPolish.View.extend({
|
2
|
+
parentSelector: '#overlay-container',
|
3
|
+
attachmentMethod: 'html',
|
4
|
+
|
5
|
+
events: function () {
|
6
|
+
_.extend(this.addListeners, {
|
7
|
+
'click .close-modal': 'close'
|
8
|
+
});
|
9
|
+
|
10
|
+
return NailPolish.View.prototype.events.apply(this);
|
11
|
+
},
|
12
|
+
|
13
|
+
renderTemplate: function () {
|
14
|
+
// switch declared template into a partial for consistent usage
|
15
|
+
var template = HoganTemplates['modal'];
|
16
|
+
var partials = _.extend(this.partials(), {
|
17
|
+
modal_content: HoganTemplates[this.templateName]
|
18
|
+
});
|
19
|
+
var rendered = template.render(this.presenter(), partials);
|
20
|
+
this.$el.html(rendered);
|
21
|
+
},
|
22
|
+
|
23
|
+
render: function() {
|
24
|
+
NailPolish.View.prototype.render.apply(this);
|
25
|
+
this.addListenerForClose();
|
26
|
+
},
|
27
|
+
|
28
|
+
addListenerForClose: function() {
|
29
|
+
NailPolish.Events.subscribe('page:new', this.close, this);
|
30
|
+
},
|
31
|
+
|
32
|
+
close: function (e) {
|
33
|
+
NailPolish.Events.unsubscribe('page:new', this.close, this);
|
34
|
+
this.remove();
|
35
|
+
this.onClose()
|
36
|
+
},
|
37
|
+
|
38
|
+
onClose: function() {} // to be implemented by subclasses
|
39
|
+
});
|
40
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
//= require vendor/underscore
|
2
|
+
//= require vendor/backbone
|
3
|
+
//= require hogan
|
4
|
+
//
|
5
|
+
//= require nail_polish/nail_polish
|
6
|
+
//= require_tree ./nail_polish/utils
|
7
|
+
//= require nail_polish/overrides/function_bind
|
8
|
+
//= require nail_polish/overrides/auth_token_adder
|
9
|
+
//= require nail_polish/overrides/global_publisher_adder
|
10
|
+
//= require nail_polish/overrides/for_backbone
|
11
|
+
//
|
12
|
+
//= require nail_polish/events
|
13
|
+
//= require nail_polish/events/redirector
|
14
|
+
//= require nail_polish/events/flasher
|
15
|
+
//= require nail_polish/view
|
16
|
+
//= require nail_polish/view/parent_finder
|
17
|
+
//= require nail_polish/presenter
|
18
|
+
//= require_tree ./nail_polish/presenters
|
19
|
+
//= require nail_polish/router
|
20
|
+
//= require nail_polish/app
|
21
|
+
|