dadablog 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/.gitignore +6 -0
  2. data/COPYING +18 -0
  3. data/Gemfile +2 -0
  4. data/README.md +20 -0
  5. data/Rakefile +1 -0
  6. data/bin/dadablog +4 -0
  7. data/dadablog.gemspec +31 -0
  8. data/lib/dadablog/blog.rb +79 -0
  9. data/lib/dadablog/cli.rb +11 -0
  10. data/lib/dadablog/generators/create/.gitignore +11 -0
  11. data/lib/dadablog/generators/create/Gemfile +1 -0
  12. data/lib/dadablog/generators/create/config.ru +15 -0
  13. data/lib/dadablog/generators/create/hello-world.md +4 -0
  14. data/lib/dadablog/generators/create/public/css/blog.css +104 -0
  15. data/lib/dadablog/generators/create/public/img/house.png +0 -0
  16. data/lib/dadablog/generators/create/public/js/blog.js +3 -0
  17. data/lib/dadablog/generators/create/public/js/fancyBox/CHANGELOG.md +34 -0
  18. data/lib/dadablog/generators/create/public/js/fancyBox/README.md +133 -0
  19. data/lib/dadablog/generators/create/public/js/fancyBox/demo/1_b.jpg +0 -0
  20. data/lib/dadablog/generators/create/public/js/fancyBox/demo/1_s.jpg +0 -0
  21. data/lib/dadablog/generators/create/public/js/fancyBox/demo/2_b.jpg +0 -0
  22. data/lib/dadablog/generators/create/public/js/fancyBox/demo/2_s.jpg +0 -0
  23. data/lib/dadablog/generators/create/public/js/fancyBox/demo/3_b.jpg +0 -0
  24. data/lib/dadablog/generators/create/public/js/fancyBox/demo/3_s.jpg +0 -0
  25. data/lib/dadablog/generators/create/public/js/fancyBox/demo/4_b.jpg +0 -0
  26. data/lib/dadablog/generators/create/public/js/fancyBox/demo/4_s.jpg +0 -0
  27. data/lib/dadablog/generators/create/public/js/fancyBox/demo/5_b.jpg +0 -0
  28. data/lib/dadablog/generators/create/public/js/fancyBox/demo/5_s.jpg +0 -0
  29. data/lib/dadablog/generators/create/public/js/fancyBox/demo/ajax.txt +15 -0
  30. data/lib/dadablog/generators/create/public/js/fancyBox/demo/index.html +227 -0
  31. data/lib/dadablog/generators/create/public/js/fancyBox/lib/jquery-1.7.1.min.js +4 -0
  32. data/lib/dadablog/generators/create/public/js/fancyBox/lib/jquery.mousewheel-3.0.6.pack.js +13 -0
  33. data/lib/dadablog/generators/create/public/js/fancyBox/source/blank.gif +0 -0
  34. data/lib/dadablog/generators/create/public/js/fancyBox/source/fancybox_loading.gif +0 -0
  35. data/lib/dadablog/generators/create/public/js/fancyBox/source/fancybox_sprite.png +0 -0
  36. data/lib/dadablog/generators/create/public/js/fancyBox/source/helpers/fancybox_buttons.png +0 -0
  37. data/lib/dadablog/generators/create/public/js/fancyBox/source/helpers/jquery.fancybox-buttons.css +85 -0
  38. data/lib/dadablog/generators/create/public/js/fancyBox/source/helpers/jquery.fancybox-buttons.js +115 -0
  39. data/lib/dadablog/generators/create/public/js/fancyBox/source/helpers/jquery.fancybox-thumbs.css +54 -0
  40. data/lib/dadablog/generators/create/public/js/fancyBox/source/helpers/jquery.fancybox-thumbs.js +151 -0
  41. data/lib/dadablog/generators/create/public/js/fancyBox/source/jquery.fancybox.css +224 -0
  42. data/lib/dadablog/generators/create/public/js/fancyBox/source/jquery.fancybox.js +1310 -0
  43. data/lib/dadablog/generators/create/public/js/fancyBox/source/jquery.fancybox.pack.js +32 -0
  44. data/lib/dadablog/generators/create/public/js/jquery-1.7.1.min.js +4 -0
  45. data/lib/dadablog/generators/create/public/js/jquery.timeago.js +146 -0
  46. data/lib/dadablog/generators/create/public/js/post.js +3 -0
  47. data/lib/dadablog/generators/create/server.sh +35 -0
  48. data/lib/dadablog/generators/create/views/index.erb +3 -0
  49. data/lib/dadablog/generators/create/views/layout.erb +23 -0
  50. data/lib/dadablog/generators/create/views/post.erb +34 -0
  51. data/lib/dadablog/generators/create/views/summary.erb +13 -0
  52. data/lib/dadablog/generators/create.rb +43 -0
  53. data/lib/dadablog/github_hook.rb +36 -0
  54. data/lib/dadablog/version.rb +3 -0
  55. data/lib/dadablog.rb +5 -0
  56. metadata +168 -0
@@ -0,0 +1,115 @@
1
+ /*!
2
+ * Buttons helper for fancyBox
3
+ * version: 1.0.2
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * buttons: {
9
+ * position : 'top'
10
+ * }
11
+ * });
12
+ *
13
+ * Options:
14
+ * tpl - HTML template
15
+ * position - 'top' or 'bottom'
16
+ *
17
+ */
18
+ (function ($) {
19
+ //Shortcut for fancyBox object
20
+ var F = $.fancybox;
21
+
22
+ //Add helper object
23
+ F.helpers.buttons = {
24
+ tpl: '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:jQuery.fancybox.close();"></a></li></ul></div>',
25
+ list: null,
26
+ buttons: {},
27
+
28
+ update: function () {
29
+ var toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
30
+
31
+ //Size toggle button
32
+ if (F.current.canShrink) {
33
+ toggle.addClass('btnToggleOn');
34
+
35
+ } else if (!F.current.canExpand) {
36
+ toggle.addClass('btnDisabled');
37
+ }
38
+ },
39
+
40
+ beforeLoad: function (opts) {
41
+ //Remove self if gallery do not have at least two items
42
+ if (F.group.length < 2) {
43
+ F.coming.helpers.buttons = false;
44
+ F.coming.closeBtn = true;
45
+
46
+ return;
47
+ }
48
+
49
+ //Increase top margin to give space for buttons
50
+ F.coming.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
51
+ },
52
+
53
+ onPlayStart: function () {
54
+ if (this.list) {
55
+ this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
56
+ }
57
+ },
58
+
59
+ onPlayEnd: function () {
60
+ if (this.list) {
61
+ this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
62
+ }
63
+ },
64
+
65
+ afterShow: function (opts) {
66
+ var buttons;
67
+
68
+ if (!this.list) {
69
+ this.list = $(opts.tpl || this.tpl).addClass(opts.position || 'top').appendTo('body');
70
+
71
+ this.buttons = {
72
+ prev : this.list.find('.btnPrev').click( F.prev ),
73
+ next : this.list.find('.btnNext').click( F.next ),
74
+ play : this.list.find('.btnPlay').click( F.play ),
75
+ toggle : this.list.find('.btnToggle').click( F.toggle )
76
+ }
77
+ }
78
+
79
+ buttons = this.buttons;
80
+
81
+ //Prev
82
+ if (F.current.index > 0 || F.current.loop) {
83
+ buttons.prev.removeClass('btnDisabled');
84
+ } else {
85
+ buttons.prev.addClass('btnDisabled');
86
+ }
87
+
88
+ //Next / Play
89
+ if (F.current.loop || F.current.index < F.group.length - 1) {
90
+ buttons.next.removeClass('btnDisabled');
91
+ buttons.play.removeClass('btnDisabled');
92
+
93
+ } else {
94
+ buttons.next.addClass('btnDisabled');
95
+ buttons.play.addClass('btnDisabled');
96
+ }
97
+
98
+ this.update();
99
+ },
100
+
101
+ onUpdate: function () {
102
+ this.update();
103
+ },
104
+
105
+ beforeClose: function () {
106
+ if (this.list) {
107
+ this.list.remove();
108
+ }
109
+
110
+ this.list = null;
111
+ this.buttons = {};
112
+ }
113
+ };
114
+
115
+ }(jQuery));
@@ -0,0 +1,54 @@
1
+ #fancybox-thumbs {
2
+ position: fixed;
3
+ left: 0px;
4
+ width: 100%;
5
+ overflow: hidden;
6
+ z-index: 1005;
7
+ }
8
+
9
+ #fancybox-thumbs.bottom {
10
+ bottom: 2px;
11
+ }
12
+
13
+ #fancybox-thumbs.top {
14
+ top: 2px;
15
+ }
16
+
17
+ #fancybox-thumbs ul {
18
+ position: relative;
19
+ list-style: none;
20
+ margin: 0;
21
+ padding: 0;
22
+ }
23
+
24
+ #fancybox-thumbs ul li {
25
+ float: left;
26
+ padding: 1px;
27
+ opacity: 0.5;
28
+ }
29
+
30
+ #fancybox-thumbs ul li.active {
31
+ opacity: 0.75;
32
+ padding: 0;
33
+ border: 1px solid #fff;
34
+ }
35
+
36
+ #fancybox-thumbs ul li:hover {
37
+ opacity: 1;
38
+ }
39
+
40
+ #fancybox-thumbs ul li a {
41
+ display: block;
42
+ position: relative;
43
+ overflow: hidden;
44
+ border: 1px solid #222;
45
+ background: #111;
46
+ outline: none;
47
+ }
48
+
49
+ #fancybox-thumbs ul li img {
50
+ display: block;
51
+ position: relative;
52
+ border: 0;
53
+ padding: 0;
54
+ }
@@ -0,0 +1,151 @@
1
+ /*!
2
+ * Thumbnail helper for fancyBox
3
+ * version: 1.0.2
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * thumbs: {
9
+ * width : 50,
10
+ * height : 50
11
+ * }
12
+ * });
13
+ *
14
+ * Options:
15
+ * width - thumbnail width
16
+ * height - thumbnail height
17
+ * source - function to obtain the URL of the thumbnail image
18
+ * position - 'top' or 'bottom'
19
+ *
20
+ */
21
+ (function ($) {
22
+ //Shortcut for fancyBox object
23
+ var F = $.fancybox;
24
+
25
+ //Add helper object
26
+ F.helpers.thumbs = {
27
+ wrap: null,
28
+ list: null,
29
+ width: 0,
30
+
31
+ //Default function to obtain the URL of the thumbnail image
32
+ source: function (el) {
33
+ var img = $(el).find('img');
34
+
35
+ return img.length ? img.attr('src') : el.href;
36
+ },
37
+
38
+ init: function (opts) {
39
+ var that = this,
40
+ list,
41
+ thumbWidth = opts.width || 50,
42
+ thumbHeight = opts.height || 50,
43
+ thumbSource = opts.source || this.source;
44
+
45
+ //Build list structure
46
+ list = '';
47
+
48
+ for (var n = 0; n < F.group.length; n++) {
49
+ list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
50
+ }
51
+
52
+ this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position || 'bottom').appendTo('body');
53
+ this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
54
+
55
+ //Load each thumbnail
56
+ $.each(F.group, function (i) {
57
+ $("<img />").load(function () {
58
+ var width = this.width,
59
+ height = this.height,
60
+ widthRatio, heightRatio, parent;
61
+
62
+ if (!that.list || !width || !height) {
63
+ return;
64
+ }
65
+
66
+ //Calculate thumbnail width/height and center it
67
+ widthRatio = width / thumbWidth;
68
+ heightRatio = height / thumbHeight;
69
+ parent = that.list.children().eq(i).find('a');
70
+
71
+ if (widthRatio >= 1 && heightRatio >= 1) {
72
+ if (widthRatio > heightRatio) {
73
+ width = Math.floor(width / heightRatio);
74
+ height = thumbHeight;
75
+
76
+ } else {
77
+ width = thumbWidth;
78
+ height = Math.floor(height / widthRatio);
79
+ }
80
+ }
81
+
82
+ $(this).css({
83
+ width: width,
84
+ height: height,
85
+ top: Math.floor(thumbHeight / 2 - height / 2),
86
+ left: Math.floor(thumbWidth / 2 - width / 2)
87
+ });
88
+
89
+ parent.width(thumbWidth).height(thumbHeight);
90
+
91
+ $(this).hide().appendTo(parent).fadeIn(300);
92
+
93
+ }).attr('src', thumbSource(this));
94
+ });
95
+
96
+ //Set initial width
97
+ this.width = this.list.children().eq(0).outerWidth();
98
+
99
+ this.list.width(this.width * (F.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (F.current.index * this.width + this.width * 0.5)));
100
+ },
101
+
102
+ //Center list
103
+ update: function (opts) {
104
+ if (this.list) {
105
+ this.list.stop(true).animate({
106
+ 'left': Math.floor($(window).width() * 0.5 - (F.current.index * this.width + this.width * 0.5))
107
+ }, 150);
108
+ }
109
+ },
110
+
111
+ beforeLoad: function (opts) {
112
+ //Remove self if gallery do not have at least two items
113
+ if (F.group.length < 2) {
114
+ F.coming.helpers.thumbs = false;
115
+
116
+ return;
117
+ }
118
+
119
+ //Increase bottom margin to give space for thumbs
120
+ F.coming.margin[ opts.position === 'top' ? 0 : 2 ] = opts.height + 30;
121
+ },
122
+
123
+ afterShow: function (opts) {
124
+ //Check if exists and create or update list
125
+ if (this.list) {
126
+ this.update(opts);
127
+
128
+ } else {
129
+ this.init(opts);
130
+ }
131
+
132
+ //Set active element
133
+ this.list.children().removeClass('active').eq(F.current.index).addClass('active');
134
+ },
135
+
136
+ onUpdate: function () {
137
+ this.update();
138
+ },
139
+
140
+ beforeClose: function () {
141
+ if (this.wrap) {
142
+ this.wrap.remove();
143
+ }
144
+
145
+ this.wrap = null;
146
+ this.list = null;
147
+ this.width = 0;
148
+ }
149
+ }
150
+
151
+ }(jQuery));
@@ -0,0 +1,224 @@
1
+ /*! fancyBox v2.0.4 fancyapps.com | fancyapps.com/fancybox/#license */
2
+ .fancybox-tmp iframe, .fancybox-tmp object {
3
+ vertical-align: top;
4
+ padding: 0;
5
+ margin: 0;
6
+ }
7
+
8
+ .fancybox-wrap {
9
+ position: absolute;
10
+ top: 0;
11
+ left: 0;
12
+ z-index: 1002;
13
+ }
14
+
15
+ .fancybox-outer {
16
+ padding: 0;
17
+ margin: 0;
18
+ background: #f9f9f9;
19
+ color: #444;
20
+ text-shadow: none;
21
+ -webkit-border-radius: 4px;
22
+ -moz-border-radius: 4px;
23
+ border-radius: 4px;
24
+ }
25
+
26
+ .fancybox-opened {
27
+ z-index: 1003;
28
+ }
29
+
30
+ .fancybox-opened .fancybox-outer {
31
+ -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
32
+ -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
33
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
34
+ }
35
+
36
+ .fancybox-inner {
37
+ width: 100%;
38
+ height: 100%;
39
+ padding: 0;
40
+ margin: 0;
41
+ position: relative;
42
+ outline: none;
43
+ overflow: hidden;
44
+ }
45
+
46
+ .fancybox-error {
47
+ color: #444;
48
+ font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
49
+ margin: 0;
50
+ padding: 10px;
51
+ }
52
+
53
+ .fancybox-image, .fancybox-iframe {
54
+ display: block;
55
+ width: 100%;
56
+ height: 100%;
57
+ border: 0;
58
+ padding: 0;
59
+ margin: 0;
60
+ vertical-align: top;
61
+ }
62
+
63
+ .fancybox-image {
64
+ max-width: 100%;
65
+ max-height: 100%;
66
+ }
67
+
68
+ #fancybox-loading {
69
+ position: fixed;
70
+ top: 50%;
71
+ left: 50%;
72
+ margin-top: -21px;
73
+ margin-left: -21px;
74
+ width: 42px;
75
+ height: 42px;
76
+ background: url('fancybox_loading.gif');
77
+ opacity: 0.8;
78
+ cursor: pointer;
79
+ z-index: 1010;
80
+ }
81
+
82
+ .fancybox-close, .fancybox-prev span, .fancybox-next span {
83
+ background-image: url('fancybox_sprite.png');
84
+ }
85
+
86
+ .fancybox-close {
87
+ position: absolute;
88
+ top: -18px;
89
+ right: -18px;
90
+ width: 36px;
91
+ height: 36px;
92
+ cursor: pointer;
93
+ z-index: 1004;
94
+ }
95
+
96
+ .fancybox-prev, .fancybox-next {
97
+ position: absolute;
98
+ top: 0;
99
+ width: 40%;
100
+ height: 100%;
101
+ cursor: pointer;
102
+ background: transparent url('blank.gif'); /* helps IE */
103
+ z-index: 1003;
104
+ }
105
+
106
+ .fancybox-prev {
107
+ left: 0;
108
+ }
109
+
110
+ .fancybox-next {
111
+ right: 0;
112
+ }
113
+
114
+ .fancybox-prev span, .fancybox-next span {
115
+ position: absolute;
116
+ top: 50%;
117
+ left: -9999px;
118
+ width: 36px;
119
+ height: 36px;
120
+ margin-top: -18px;
121
+ cursor: pointer;
122
+ z-index: 1003;
123
+ }
124
+
125
+ .fancybox-prev span {
126
+ background-position: 0 -36px;
127
+ }
128
+
129
+ .fancybox-next span {
130
+ background-position: 0 -72px;
131
+ }
132
+
133
+ .fancybox-prev:hover, .fancybox-next:hover {
134
+ visibility: visible;
135
+ }
136
+
137
+ .fancybox-prev:hover span {
138
+ left: 20px;
139
+ }
140
+
141
+ .fancybox-next:hover span {
142
+ left: auto;
143
+ right: 20px;
144
+ }
145
+
146
+ .fancybox-tmp {
147
+ position: absolute;
148
+ top: -9999px;
149
+ left: -9999px;
150
+ padding: 0;
151
+ overflow: visible;
152
+ visibility: hidden;
153
+ }
154
+
155
+ /* Overlay helper */
156
+
157
+ #fancybox-overlay {
158
+ position: absolute;
159
+ top: 0;
160
+ left: 0;
161
+ overflow: hidden;
162
+ display: none;
163
+ z-index: 1001;
164
+ background: #000;
165
+ }
166
+
167
+ /* Title helper */
168
+
169
+ .fancybox-title {
170
+ visibility: hidden;
171
+ font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
172
+ position: relative;
173
+ text-shadow: none;
174
+ z-index: 1005;
175
+ }
176
+
177
+ .fancybox-opened .fancybox-title {
178
+ visibility: visible;
179
+ }
180
+
181
+ .fancybox-title-float-wrap {
182
+ position: absolute;
183
+ bottom: 0;
184
+ right: 50%;
185
+ margin-bottom: -35px;
186
+ z-index: 1003;
187
+ text-align: center;
188
+ }
189
+
190
+ .fancybox-title-float-wrap .child {
191
+ display: inline-block;
192
+ margin-right: -100%;
193
+ padding: 2px 20px;
194
+ background: transparent; /* Fallback for web browsers that doesn't support RGBa */
195
+ background: rgba(0, 0, 0, 0.8);
196
+ -webkit-border-radius: 15px;
197
+ -moz-border-radius: 15px;
198
+ border-radius: 15px;
199
+ text-shadow: 0 1px 2px #222;
200
+ color: #FFF;
201
+ font-weight: bold;
202
+ line-height: 24px;
203
+ white-space: nowrap;
204
+ }
205
+
206
+ .fancybox-title-outside-wrap {
207
+ position: relative;
208
+ margin-top: 10px;
209
+ color: #fff;
210
+ }
211
+
212
+ .fancybox-title-inside-wrap {
213
+ margin-top: 10px;
214
+ }
215
+
216
+ .fancybox-title-over-wrap {
217
+ position: absolute;
218
+ bottom: 0;
219
+ left: 0;
220
+ color: #fff;
221
+ padding: 10px;
222
+ background: #000;
223
+ background: rgba(0, 0, 0, .8);
224
+ }