knack-rails 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 83f9c6f32a602a22f62a5553517db42692bb799c
4
+ data.tar.gz: f37e317a7dde81b50ff985d270b0709c51858f4c
5
+ SHA512:
6
+ metadata.gz: c5b1d5bfc10daf55410171fb2b79af3c5c9e122fb639b971b802089c1bc4b250e5bf3584f18df754f348de35b7db647e910f5b1ff6bc0cf99e7b64747f17045a
7
+ data.tar.gz: b329e7e36732cab4a47019f352433a3a6bbba50829da5d9fa36bc26f472bf42235cbac35efde372cc24befbfd3e1fa9c52785b383f571b7f0cd5fefa599764f3
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in knack-rails.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 TODO: Write your name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Knack-Rails
2
+
3
+ Jquery Image Gallery
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'knack-rails'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install knack-rails
20
+
21
+ ## Usage
22
+
23
+ Add js library into app/assets/javascripts/application.js
24
+
25
+ ```ruby
26
+ //= require knack-rails
27
+ ```
28
+
29
+ Include sass file into your stylesheets/application.scss
30
+
31
+ ```ruby
32
+ @import 'knack';
33
+ ```
34
+
35
+ How to use see [here](https://github.com/evrybiont/knack)
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
42
+
43
+ If you have questions or found a bug? [Tweet at me](https://twitter.com/StadnikSasha)
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
Binary file
Binary file
@@ -0,0 +1,472 @@
1
+ (function($){
2
+
3
+ var doc = window.document,
4
+ DOM = function(){
5
+ return{
6
+ html: doc.documentElement,
7
+ body: doc.body,
8
+ title: doc.title,
9
+ projector: $('#projector')[0]
10
+ };
11
+ },
12
+ _settings = null,
13
+ _data = null,
14
+ html = DOM().html,
15
+ _htmlImages = null,
16
+ _thumbs = null,
17
+ busyMenuSpace = 145,
18
+ supportFullScreen = (html.requestFullscreen ||
19
+ html.msRequestFullscreen ||
20
+ html.mozRequestFullScreen ||
21
+ html.webkitRequestFullScreen),
22
+ exitFullScreen = (doc.exitFullscreen ||
23
+ doc.msExitFullscreen ||
24
+ doc.mozCancelFullScreen ||
25
+ doc.webkitCancelFullScreen);
26
+
27
+ var fullScreen = {
28
+ active: false,
29
+
30
+ timeout: null,
31
+
32
+ activePanel: null,
33
+
34
+ make: function(){
35
+ supportFullScreen.call(DOM().projector);
36
+ },
37
+
38
+ exit: function(){
39
+ exitFullScreen.call(doc);
40
+ },
41
+
42
+ fadeOut: function(){
43
+ clearTimeout(fullScreen.timeout);
44
+ fullScreen.active = false;
45
+ $('#projector').unbind('mousemove');
46
+ $('.menu-area').unbind();
47
+ $('.menu-area').show();
48
+ $('.stage-area').dblclick(fullScreen.make);
49
+ $('.fullscreen').bind('click', fullScreen.make);
50
+ },
51
+
52
+ mouseOver: function(){
53
+ $('.menu-area').hover(function(){
54
+ clearTimeout(fullScreen.timeout);
55
+ fullScreen.activePanel = true;
56
+ }, function(){
57
+ fullScreen.activePanel = false;
58
+ });
59
+ },
60
+
61
+ fadeIn: function(){
62
+ fullScreen.active = true;
63
+ $('.fullscreen').bind('click', fullScreen.exit);
64
+ $('.stage-area').dblclick(fullScreen.exit);
65
+ $('.menu-area').hide();
66
+ fullScreen.mouseMove();
67
+ fullScreen.mouseOver();
68
+ },
69
+
70
+ mouseMove: function(){
71
+ $('#projector').mousemove(function(){
72
+ clearTimeout(fullScreen.timeout);
73
+ $('.menu-area').show();
74
+
75
+ if (!fullScreen.activePanel){
76
+ fullScreen.timeout = setTimeout(function(){
77
+ $('.menu-area').hide();
78
+ }, _settings.menuArea);
79
+ }
80
+ });
81
+ },
82
+
83
+ handler: function(){
84
+ $(".fullscreen, .stage-area").unbind();
85
+ $('.fullscreen').toggleClass('exit');
86
+ $('.thumbs-area').toggleClass('full-thumbs');
87
+
88
+ if (fullScreen.active){
89
+ fullScreen.fadeOut();
90
+ } else {
91
+ fullScreen.fadeIn();
92
+ }
93
+
94
+ },
95
+
96
+ bind: function(){
97
+ $('.fullscreen').click(fullScreen.make);
98
+ $('.stage-area').dblclick(fullScreen.make);
99
+ doc.addEventListener('fullscreenchange', fullScreen.handler, false);
100
+ doc.addEventListener('MSFullscreenChange', fullScreen.handler, false);
101
+ doc.addEventListener('mozfullscreenchange', fullScreen.handler, false);
102
+ doc.addEventListener('webkitfullscreenchange', fullScreen.handler, false);
103
+ }
104
+ };
105
+
106
+ var loader = {
107
+ show: function(){
108
+ $('.stage-area').toggle();
109
+ $('.loader').show();
110
+ },
111
+
112
+ hide: function(){
113
+ setTimeout(function(){
114
+ $('.stage-area').toggle();
115
+ $('.loader').hide();
116
+ }, 500);
117
+ }
118
+ };
119
+
120
+ var _counter = {
121
+ index: 0,
122
+
123
+ update: function(){
124
+ $('.current').html(_counter.index + 1);
125
+ }
126
+ };
127
+
128
+ var _info = {
129
+ update: function(){
130
+ $('.info').html(_data[_counter.index][1] || '');
131
+ }
132
+ };
133
+
134
+ var arrowsEvents = {
135
+ right: function(){
136
+ var activeImage = $('.on');
137
+ _counter.index +=1;
138
+
139
+ if (!_htmlImages.eq(_counter.index).length){
140
+ _counter.index = 0;
141
+ }
142
+
143
+ _htmlImages.eq(_counter.index).toggleClass('off on');
144
+ activeImage.toggleClass('on off');
145
+
146
+ _counter.update();
147
+ _info.update();
148
+ },
149
+
150
+ left: function(){
151
+ var activeImage = $('.on');
152
+
153
+ if (_counter.index) {
154
+ _counter.index -=1
155
+ }else{
156
+ _counter.index = _htmlImages.length -1
157
+ }
158
+
159
+ _htmlImages.eq(_counter.index).toggleClass('off on');
160
+ activeImage.toggleClass('on off');
161
+
162
+ _counter.update();
163
+ _info.update();
164
+ },
165
+
166
+ toggle: function(){
167
+ $('.left-arrow, .right-arrow').toggle();
168
+ },
169
+
170
+ bind: function(){
171
+ $('.right-arrow').bind('click', arrowsEvents.right);
172
+ $('.left-arrow').bind('click', arrowsEvents.left);
173
+ $('.arrows-area').mouseenter(arrowsEvents.toggle).mouseleave(arrowsEvents.toggle);
174
+ }
175
+ };
176
+
177
+ var keyboard = {
178
+ bind: function(){
179
+ $('#projector').keydown(function(e){
180
+ if (!autoPlay.active){
181
+ switch (e.keyCode){
182
+ case 39:
183
+ arrowsEvents.right();
184
+ break;
185
+ case 37:
186
+ arrowsEvents.left();
187
+ break;
188
+ }
189
+ }
190
+ });
191
+ }
192
+ };
193
+
194
+ var autoPlay = {
195
+ images: null,
196
+
197
+ activeImage: null,
198
+
199
+ active: false,
200
+
201
+ startPoint: null,
202
+
203
+ toggle: function(){
204
+ $('.play').unbind();
205
+ $('.play').toggleClass('stop');
206
+ $('.arrows-area').toggle();
207
+ $('.thumbs-area').hide();
208
+
209
+ if($('.stop').length){
210
+ $('.stop').click(autoPlay.stop);
211
+ }else{
212
+ autoPlay.bind();
213
+ }
214
+ },
215
+
216
+ timer: null,
217
+
218
+ update: function(){
219
+ autoPlay.activeImage = $('.on');
220
+
221
+ if (_counter.index < _data.length-1){_counter.index += 1}
222
+ else{_counter.index = 0}
223
+
224
+ autoPlay.images.eq(_counter.index).toggleClass('off on');
225
+ autoPlay.activeImage.toggleClass('on off');
226
+ _counter.update();
227
+ _info.update();
228
+
229
+ if (_counter.index == autoPlay.startPoint){autoPlay.active = false}
230
+ if(!autoPlay.active){autoPlay.toggle()}
231
+ },
232
+
233
+ delay: function(){
234
+ autoPlay.update();
235
+
236
+ if (autoPlay.active){
237
+ autoPlay.timer = setTimeout(function(){
238
+ autoPlay.delay();
239
+ }, _settings.autoPlay);
240
+ }
241
+ },
242
+
243
+ play: function(){
244
+ autoPlay.toggle();
245
+ autoPlay.images = $('.stage-area').children();
246
+ autoPlay.active = true;
247
+ autoPlay.startPoint = _counter.index;
248
+ autoPlay.delay();
249
+ },
250
+
251
+ stop: function(){
252
+ autoPlay.active = false;
253
+ autoPlay.toggle();
254
+ clearTimeout(autoPlay.timer);
255
+ },
256
+
257
+ bind: function(){
258
+ $('.play').click(autoPlay.play);
259
+ }
260
+ };
261
+
262
+ var thumblink = {
263
+ toggle: function(){
264
+ $('.thumbs-area').toggle();
265
+ },
266
+
267
+ update: function(){
268
+ $('.active-thumb').toggleClass('active-thumb');
269
+ _thumbs.eq(_counter.index).addClass('active-thumb');
270
+ },
271
+
272
+ setImage: function(){
273
+ var activeImage = $('.on');
274
+
275
+ _counter.index = $(this).index();
276
+ _htmlImages.eq(_counter.index).toggleClass('off on');
277
+ activeImage.toggleClass('on off');
278
+
279
+ _counter.update();
280
+ _info.update();
281
+ thumblink.toggle();
282
+ },
283
+
284
+ bind: function(){
285
+ $('.thumb').click(function(){
286
+ if (autoPlay.active){autoPlay.stop()}
287
+ thumblink.update();
288
+ thumblink.toggle();
289
+ });
290
+ $('.thumb-image').click(thumblink.setImage);
291
+ }
292
+ }
293
+
294
+ var draggable = {
295
+ curDown: false,
296
+
297
+ curYPos: 0,
298
+
299
+ mouseDown: function(e){
300
+ draggable.curDown = true;
301
+ draggable.curYPos = e.pageY;
302
+ },
303
+
304
+ mouseUp: function(){
305
+ draggable.curDown = false;
306
+ },
307
+
308
+ mouseMove: function(e){
309
+ if(draggable.curDown === true){
310
+ $('.thumbs-box').scrollTop($('.thumbs-box').scrollTop() + (draggable.curYPos - e.pageY));
311
+ }
312
+ },
313
+
314
+ bind: function(){
315
+ $('img, div').disableSelection();
316
+ $('.thumbs-box').mousedown(draggable.mouseDown)
317
+ .mouseup(draggable.mouseUp)
318
+ .mousemove(draggable.mouseMove);
319
+ }
320
+ };
321
+
322
+ var projector = {
323
+ change: function(){
324
+ $('.info-box').width($('#projector').width() - busyMenuSpace);
325
+ },
326
+
327
+ bind: function(){
328
+ $(window).resize(projector.change);
329
+ }
330
+ };
331
+
332
+ var events = {
333
+ bind: function(){
334
+ fullScreen.bind();
335
+ arrowsEvents.bind();
336
+ autoPlay.bind();
337
+ keyboard.bind();
338
+ thumblink.bind();
339
+ draggable.bind();
340
+ projector.bind();
341
+ }
342
+ };
343
+
344
+ var mainScope = {
345
+ init: function(options){
346
+ graphicScope.init.apply(this, options);
347
+ _htmlImages = $('.stage-area').children();
348
+ _thumbs = $('.thumbs-box').children();
349
+ events.bind();
350
+ loader.hide();
351
+
352
+ return this;
353
+ }
354
+ };
355
+
356
+ var graphicScope = {
357
+ init: function(options){
358
+ graphicScope.prepareProjector();
359
+ graphicScope.prepareThumbsArea();
360
+ graphicScope.prepareStageArea();
361
+ graphicScope.prepareArrows();
362
+ graphicScope.prepareMenuArea();
363
+ },
364
+
365
+ prepareProjector: function(){
366
+ attrScope.init();
367
+
368
+ $('#'+ _settings.id).append('<div class="thumbs-area"><div class="thumbs-box">');
369
+ $('#'+ _settings.id).append('<div class="stage-area">');
370
+ $('#'+ _settings.id).append('<div class="arrows-area">');
371
+ $('#'+ _settings.id).append('<div class="loader">');
372
+ $('#'+ _settings.id).append('<div class="menu-area">');
373
+
374
+ loader.show();
375
+ },
376
+
377
+ prepareThumbsArea: function(){
378
+ var className = 'active-thumb';
379
+
380
+ $.each(_settings.data, function(_,v){
381
+ $('.thumbs-box').append("<div class='" + className + "'><img src='" + v[0] + "' class='image'>");
382
+ className = 'thumb-image';
383
+ });
384
+
385
+ $('.active-thumb').addClass('thumb-image');
386
+ },
387
+
388
+ prepareStageArea: function(){
389
+ var className = 'on';
390
+
391
+ $.each(_settings.data, function(_,v){
392
+ $('.stage-area').append("<img src='" + v[0] + "' class=" + className + ">");
393
+ className = 'off';
394
+ });
395
+ },
396
+
397
+ prepareArrows: function(){
398
+ $('.arrows-area').append('<span class="left-arrow hidden">');
399
+ $('.arrows-area').append('<span class="right-arrow hidden">');
400
+ },
401
+
402
+ addFullScreen: function(){
403
+ $('.menu-area').append('<div class="fullscreen">');
404
+ },
405
+
406
+ addThumbs: function(){
407
+ $('.menu-area').append('<div class="thumb-box">');
408
+ $('.thumb-box').append('<span class="thumb">');
409
+ },
410
+
411
+ addCounter: function(){
412
+ $('.menu-area').append('<div class="counter">');
413
+ $('.counter').append('<span class="current">' + 1);
414
+ $('.counter').append('<span class="total"> / ' + _data.length);
415
+ },
416
+
417
+ addInfo: function(){
418
+ $('.menu-area').append('<div class="info-box">');
419
+ $('.info-box').append('<div class="info">' + (_data[0][1] || ''));
420
+ $('.info-box').width($('#projector').width() - busyMenuSpace);
421
+ },
422
+
423
+ addPlayer: function(){
424
+ $('.menu-area').append('<div class="play-box">');
425
+ $('.play-box').append('<span class="play">');
426
+ },
427
+
428
+ prepareMenuArea: function(){
429
+ graphicScope.addFullScreen();
430
+ graphicScope.addThumbs();
431
+ graphicScope.addInfo();
432
+ graphicScope.addCounter();
433
+ graphicScope.addPlayer();
434
+ }
435
+ };
436
+
437
+ var attrScope = {
438
+ init: function(){
439
+ $('#' + _settings.id).attr('tabindex', '0');
440
+ }
441
+ };
442
+
443
+ $.fn.disableSelection = function(){
444
+ this.attr('unselectable','on')
445
+ .css({'-moz-user-select':'-moz-none',
446
+ '-moz-user-select':'none',
447
+ '-o-user-select':'none',
448
+ '-khtml-user-select':'none',
449
+ '-webkit-user-select':'none',
450
+ '-ms-user-select':'none',
451
+ 'user-select':'none'})
452
+ .bind('selectstart', function(){return false;});
453
+ };
454
+
455
+ $.fn.knack = function(options, method){
456
+ _settings = $.extend({
457
+ 'autoPlay': 5000,
458
+ 'menuArea': 3000,
459
+ 'id': 'projector',
460
+ }, options);
461
+
462
+ _data = _settings.data;
463
+
464
+ if (_data){
465
+ if (mainScope[method]){}
466
+ else if (!method){return mainScope.init.apply(this, [])}
467
+ else{$.error('Undefined method ' + method + 'for Knack')}
468
+ }
469
+ else{$.error('Please give me your images.')}
470
+ };
471
+
472
+ })(jQuery);
@@ -0,0 +1,211 @@
1
+ .hidden
2
+ display: none
3
+
4
+ #projector
5
+ background: black
6
+ position: relative
7
+ overflow: hidden
8
+ outline: none
9
+ min-width: 200px
10
+ &:-webkit-full-screen
11
+ width: 100% !important
12
+ height: 100% !important
13
+
14
+ .loader
15
+ background-image: url("loading.gif-c200")
16
+ background-color: black
17
+ background-position: 51% 0
18
+ background-repeat: no-repeat
19
+ display: none
20
+ height: 100%
21
+ position: absolute
22
+ width: 100%
23
+ z-index: 5
24
+
25
+ .thumbs-area
26
+ background: black
27
+ bottom: 25px
28
+ display: none
29
+ overflow: hidden
30
+ position: absolute
31
+ top: 0
32
+ width: 100%
33
+ z-index: 10
34
+
35
+ .full-thumbs
36
+ bottom: 0
37
+
38
+ .thumb-image
39
+ border: thin solid #222
40
+ display: inline-flex
41
+ height: 65px
42
+ margin-bottom: 5px
43
+ margin-right: 5px
44
+ position: relative
45
+ width: 100px
46
+
47
+ .thumbs-box
48
+ cursor: move
49
+ height: 99%
50
+ left: 2%
51
+ overflow: hidden
52
+ position: relative
53
+ top: 1%
54
+ width: 96%
55
+
56
+ .image
57
+ cursor: pointer
58
+ height: 100%
59
+ width: 100%
60
+
61
+ .stage-area
62
+ bottom: 0
63
+ left: 0
64
+ overflow: hidden
65
+ position: absolute
66
+ right: 0
67
+ top: 0
68
+ z-index: 1
69
+
70
+ .arrows-area
71
+ color: white
72
+ display: flex
73
+ height: 100px
74
+ left: 0
75
+ position: absolute
76
+ top: 35%
77
+ width: 100%
78
+ z-index: 2
79
+
80
+ .right-arrow
81
+ background-image: url("spritesheet.png")
82
+ background-position: -42px -42px
83
+ background-repeat: no-repeat
84
+ cursor: pointer
85
+ height: 34px
86
+ margin-right: 25px
87
+ margin-top: 35px
88
+ position: absolute
89
+ right: 0
90
+ width: 34px
91
+
92
+ .left-arrow
93
+ background-image: url("spritesheet.png")
94
+ background-position: -6px -42px
95
+ background-repeat: no-repeat
96
+ cursor: pointer
97
+ height: 34px
98
+ margin-left: 25px
99
+ margin-top: 35px
100
+ width: 34px
101
+
102
+ .menu-area
103
+ background: black
104
+ bottom: 0
105
+ height: 25px
106
+ position: absolute
107
+ width: 100%
108
+ -webkit-box-shadow: inset 1px 45px 9px -49px rgba(255, 200, 200, 1)
109
+ -moz-box-shadow: inset 1px 45px 9px -49px rgba(255, 200, 200, 1)
110
+ box-shadow: inset 1px 45px 9px -49px rgba(255, 200, 200, 1)
111
+ z-index: 11
112
+
113
+ .fullscreen
114
+ background-image: url("spritesheet.png")
115
+ background-position: -82px 2px
116
+ background-repeat: no-repeat
117
+ cursor: pointer
118
+ height: 25px
119
+ left: auto
120
+ position: absolute
121
+ right: 0
122
+ width: 25px
123
+
124
+ .exit
125
+ background-position: -82px -98px
126
+
127
+ .on
128
+ height: 100%
129
+ left: 0
130
+ margin-left: auto
131
+ margin-right: auto
132
+ position: absolute
133
+ right: 0
134
+
135
+ .off
136
+ display: none
137
+
138
+ .counter
139
+ color: #aaa
140
+ font-family: Helvetica
141
+ font-size: 13px
142
+ box-shadow: inset -52px 0px 9px -57px rgba(255, 200, 200, 1)
143
+ -webkit-box-shadow: inset -52px 0px 9px -55px rgba(255, 200, 200, 1)
144
+ -moz-box-shadow: inset -52px 0px 9px -58px rgba(255, 200, 200, 1)
145
+ height: 25px
146
+ position: absolute
147
+ left: 22px
148
+ padding-right: 7px
149
+ width: 50px
150
+
151
+ .play-box
152
+ height: 25px
153
+ left: 0
154
+ position: absolute
155
+ width: 25px
156
+
157
+ .play
158
+ background-image: url("spritesheet.png")
159
+ background-position: -110px -4px
160
+ background-repeat: no-repeat
161
+ cursor: pointer
162
+ height: 13px
163
+ left: 5px
164
+ position: absolute
165
+ top: 7px
166
+ width: 8px
167
+
168
+ .info-box
169
+ height: 25px
170
+ left: 84px
171
+ position: absolute
172
+
173
+ .info
174
+ font-family: Helvetica
175
+ font-size: 13px
176
+ color: #aaa
177
+ position: relative
178
+ top: 5px
179
+ white-space: nowrap
180
+ overflow: hidden
181
+ text-overflow: ellipsis
182
+
183
+ .thumb-box
184
+ box-shadow: inset 52px 0px 9px -57px rgba(255, 200, 200, 1)
185
+ -webkit-box-shadow: inset 52px 0px 9px -55px rgba(255, 200, 200, 1)
186
+ -moz-box-shadow: inset 52px 0px 9px -58px rgba(255, 200, 200, 1)
187
+ height: 25px
188
+ right: 25px
189
+ position: absolute
190
+ width: 30px
191
+
192
+ .thumb
193
+ background-image: url("spritesheet.png")
194
+ background-position: -5px -125px
195
+ background-repeat: no-repeat
196
+ cursor: pointer
197
+ height: 13px
198
+ left: 9px
199
+ position: absolute
200
+ top: 7.3px
201
+ width: 12px
202
+
203
+ .stop
204
+ background-position: -110px -104px
205
+
206
+ .current, .total
207
+ position: relative
208
+ top: 4px
209
+
210
+ .active-thumb
211
+ border: thin solid red
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "knack/rails"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'knack-rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "knack-rails"
8
+ spec.version = KnackRails::VERSION
9
+ spec.authors = ["evrybiont"]
10
+ spec.email = ["evrybiont@gmail.com"]
11
+
12
+ spec.summary = %q{Jquery plugin}
13
+ spec.description = %q{Image Gallery}
14
+ spec.homepage = "https://github.com/evrybiont/knack"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ end
@@ -0,0 +1,4 @@
1
+ module KnackRails
2
+ class Engine < Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module KnackRails
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,2 @@
1
+ require "knack-rails/version"
2
+ require "knack-rails/engine"
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: knack-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - evrybiont
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-10-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Image Gallery
42
+ email:
43
+ - evrybiont@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - CODE_OF_CONDUCT.md
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - app/assets/images/loading.gif-c200
55
+ - app/assets/images/spritesheet.png
56
+ - app/assets/javascripts/knack-rails.js
57
+ - app/assets/stylesheets/knack.sass
58
+ - bin/console
59
+ - bin/setup
60
+ - knack-rails.gemspec
61
+ - lib/knack-rails.rb
62
+ - lib/knack-rails/engine.rb
63
+ - lib/knack-rails/version.rb
64
+ homepage: https://github.com/evrybiont/knack
65
+ licenses:
66
+ - MIT
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.4.5.1
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: Jquery plugin
88
+ test_files: []