uikit-sass-rails 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +1 -1
  4. data/lib/uikit/sass/rails/version.rb +1 -1
  5. data/uikit-sass-rails.gemspec +2 -2
  6. data/vendor/assets/javascripts/uikit.js +1 -0
  7. data/vendor/assets/javascripts/uikit/addons/autocomplete.js +5 -6
  8. data/vendor/assets/javascripts/uikit/addons/cover.js +90 -0
  9. data/vendor/assets/javascripts/uikit/addons/datepicker.js +19 -5
  10. data/vendor/assets/javascripts/uikit/addons/form-password.js +2 -2
  11. data/vendor/assets/javascripts/uikit/addons/form-select.js +3 -3
  12. data/vendor/assets/javascripts/uikit/addons/htmleditor.js +35 -14
  13. data/vendor/assets/javascripts/uikit/addons/nestable.js +9 -8
  14. data/vendor/assets/javascripts/uikit/addons/notify.js +5 -2
  15. data/vendor/assets/javascripts/uikit/addons/pagination.js +3 -3
  16. data/vendor/assets/javascripts/uikit/addons/search.js +2 -2
  17. data/vendor/assets/javascripts/uikit/addons/sortable.js +48 -28
  18. data/vendor/assets/javascripts/uikit/addons/sticky.js +148 -37
  19. data/vendor/assets/javascripts/uikit/addons/timepicker.js +11 -9
  20. data/vendor/assets/javascripts/uikit/addons/upload.js +20 -6
  21. data/vendor/assets/javascripts/uikit/uikit.js +309 -288
  22. data/vendor/assets/stylesheets/uikit/addons/uikit.addons.scss +175 -62
  23. data/vendor/assets/stylesheets/uikit/addons/uikit.almost-flat.addons.scss +175 -62
  24. data/vendor/assets/stylesheets/uikit/addons/uikit.gradient.addons.scss +175 -62
  25. data/vendor/assets/stylesheets/uikit/uikit.almost-flat.scss +389 -132
  26. data/vendor/assets/stylesheets/uikit/uikit.gradient.scss +389 -132
  27. data/vendor/assets/stylesheets/uikit/uikit.scss +389 -132
  28. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69a0a42e0723cc749a76e11d1985095d0b5a2b35
4
- data.tar.gz: 5c16dfb727b9d563ce4edb9fff905fd66d6a1262
3
+ metadata.gz: 406daf2bfbbdaf2e01be2f3713673cf760f63d5a
4
+ data.tar.gz: ccf9bd06b704d6d97d7c70b87d39de286e49e606
5
5
  SHA512:
6
- metadata.gz: 254a1dd2308bd02d8c2c44d0af39c95c5b6c96976aba19ef0677d5426728784302f34cd6074e483cd77eaca95d56d76ca4d0089c77cda40a2676a14e6112f2b8
7
- data.tar.gz: 2b49b566b88d6a5fff50185646bc94cfe2fbbf6abd600ee91a786fa70f094e6a570754cb2d41f885ead8c716576a335e8c1bfda810f9a7932d9f74fb79483c96
6
+ metadata.gz: 92b6fc279c87b121bcf65c49ff45c3c901d0bb22ddeb191fbe94e6232444b9daf10f1e2ff735384585020c21476a67d3c59adbe844f72a868d8a1c548d1d27e4
7
+ data.tar.gz: e829b1d4d3e7c5c6ff9c50d588fb4bcd544586f7393d66ada01de2d90448337856b50cc785a0b1f7d30290e1c43a01167a11f50ed074e09ec14750fef728531f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.1.0
2
+ - UIkit 2.9.0
3
+ - Support for Rails 3
4
+
1
5
  ## 1.0.0
2
6
  - Working version with UIkit 2.8.0 and Font Awesome 4.1.0
3
7
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Uikit::Sass:Rails
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/uikit-sass-rails.png)](http://badge.fury.io/rb/uikit-sass-rails)
3
+ [![Gem Version](https://badge.fury.io/rb/uikit-sass-rails.svg)](http://badge.fury.io/rb/uikit-sass-rails)
4
4
 
5
5
  Uikit::Sass:Rails is a gem to make it super easy to use UIkit in your Rails project. It is written in Sass and compatible with the asset pipeline in Rails. You can start using Uikit::Sass:Rails in your projects by following the instructions below.
6
6
 
@@ -1,7 +1,7 @@
1
1
  module Uikit
2
2
  module Sass
3
3
  module Rails
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
6
6
  end
7
7
  end
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.summary = 'UIkit on Sass for Rails'
12
12
  gem.description = 'Uikit::Sass:Rails is a gem to make it super easy to use UIkit in your Rails project.'
13
13
 
14
- gem.authors = ['MarSec']
14
+ gem.authors = ['Christian Worreschk']
15
15
  gem.email = ['info@marsec.de']
16
16
  gem.homepage = 'http://github.com/marsec/uikit-sass-rails'
17
17
  gem.licenses = ['EUPL-1.1']
@@ -20,5 +20,5 @@ Gem::Specification.new do |gem|
20
20
  gem.files = `git ls-files`.split($/)
21
21
  gem.extra_rdoc_files = ['README.md', 'LICENSE.md', 'CHANGELOG.md']
22
22
 
23
- gem.add_runtime_dependency 'sass-rails', '~> 3.1'
23
+ gem.add_runtime_dependency 'sass-rails', '>= 3.1'
24
24
  end
@@ -1,5 +1,6 @@
1
1
  //= require uikit/uikit
2
2
 
3
+ //= require uikit/addons/cover
3
4
  //= require uikit/addons/datepicker
4
5
  //= require uikit/addons/form-password
5
6
  //= require uikit/addons/form-select
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
 
3
3
  (function(addon) {
4
4
 
@@ -252,10 +252,9 @@
252
252
  url: this.options.source,
253
253
  data: params,
254
254
  type: this.options.method,
255
- dataType: 'json',
256
- complete: function(xhr) {
257
- release(xhr.responseJSON || []);
258
- }
255
+ dataType: 'json'
256
+ }).done(function(json) {
257
+ release(json || []);
259
258
  });
260
259
 
261
260
  break;
@@ -294,7 +293,7 @@
294
293
  });
295
294
 
296
295
  // init code
297
- $(document).on("focus.autocomplete.uikit", "[data-uk-autocomplete]", function(e) {
296
+ UI.$doc.on("focus.autocomplete.uikit", "[data-uk-autocomplete]", function(e) {
298
297
 
299
298
  var ele = $(this);
300
299
  if (!ele.data("autocomplete")) {
@@ -0,0 +1,90 @@
1
+ /*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+
3
+ (function(addon) {
4
+
5
+ var component;
6
+
7
+ if (jQuery && jQuery.UIkit) {
8
+ component = addon(jQuery, jQuery.UIkit);
9
+ }
10
+
11
+ if (typeof define == "function" && define.amd) {
12
+ define("uikit-cover", ["uikit"], function(){
13
+ return component || addon(jQuery, jQuery.UIkit);
14
+ });
15
+ }
16
+
17
+ })(function($, UI){
18
+
19
+ "use strict";
20
+
21
+ UI.component('cover', {
22
+
23
+ defaults: {
24
+ automute : true
25
+ },
26
+
27
+ init: function() {
28
+
29
+ this.parent = this.element.parent();
30
+ this.dimension = {w: this.element.width(), h: this.element.height()};
31
+ this.ratio = this.dimension.w / this.dimension.h;
32
+
33
+ UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(){
34
+ this.check();
35
+ }.bind(this), 100));
36
+
37
+ this.check();
38
+
39
+ this.element.data("cover", this);
40
+
41
+
42
+ if (this.element.is('iframe') && this.options.automute) {
43
+
44
+ var src = this.element.attr('src');
45
+
46
+ this.element.attr('src', '').on('load', function(){
47
+
48
+ this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*');
49
+
50
+ }).attr('src', [src, (src.indexOf('?') > -1 ? '&':'?'), 'enablejsapi=1&api=1'].join(''));
51
+ }
52
+ },
53
+
54
+ check: function() {
55
+
56
+ var w = this.parent.width(), h = this.parent.height(), width, height;
57
+
58
+ // if element height < parent height (gap underneath)
59
+ if ((w / this.ratio) < h) {
60
+
61
+ width = Math.ceil(h * this.ratio);
62
+ height = h;
63
+
64
+ // element width < parent width (gap to right)
65
+ } else {
66
+
67
+ width = w;
68
+ height = Math.ceil(w / this.ratio);
69
+ }
70
+
71
+ this.element.css({
72
+ 'width' : width,
73
+ 'height' : height
74
+ });
75
+ }
76
+ });
77
+
78
+ // auto init
79
+ UI.ready(function(context) {
80
+
81
+ $("[data-uk-cover]", context).each(function(){
82
+
83
+ var ele = $(this);
84
+
85
+ if(!ele.data("cover")) {
86
+ var plugin = UI.cover(ele, UI.Utils.options(ele.attr("data-uk-cover")));
87
+ }
88
+ });
89
+ });
90
+ });
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
 
3
3
  (function(addon) {
4
4
 
@@ -277,12 +277,27 @@
277
277
  }
278
278
 
279
279
  return data;
280
+ },
281
+
282
+ hide: function() {
283
+
284
+ if (active && active === this) {
285
+ dropdown.hide();
286
+ active = false;
287
+ }
288
+ }
289
+ });
290
+
291
+ UI.$win.on("resize orientationchange", function() {
292
+
293
+ if (active) {
294
+ active.hide();
280
295
  }
281
296
  });
282
297
 
283
298
 
284
299
  // init code
285
- $(document).on("focus.datepicker.uikit", "[data-uk-datepicker]", function(e) {
300
+ UI.$doc.on("focus.datepicker.uikit", "[data-uk-datepicker]", function(e) {
286
301
 
287
302
  var ele = $(this);
288
303
  if (!ele.data("datepicker")) {
@@ -292,13 +307,12 @@
292
307
  }
293
308
  });
294
309
 
295
- $(document).on("click.datepicker.uikit", function(e) {
310
+ UI.$doc.on("click.datepicker.uikit", function(e) {
296
311
 
297
312
  var target = $(e.target);
298
313
 
299
314
  if (active && target[0] != dropdown[0] && !target.data("datepicker") && !target.parents(".uk-datepicker:first").length) {
300
- dropdown.hide();
301
- active = false;
315
+ active.hide();
302
316
  }
303
317
  });
304
318
 
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
 
3
3
  (function(addon) {
4
4
 
@@ -46,7 +46,7 @@
46
46
  });
47
47
 
48
48
  // init code
49
- $(document).on("click.formpassword.uikit", "[data-uk-form-password]", function(e) {
49
+ UI.$doc.on("click.formpassword.uikit", "[data-uk-form-password]", function(e) {
50
50
 
51
51
  var ele = $(this);
52
52
  if (!ele.data("formPassword")) {
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
 
3
3
  (function(addon) {
4
4
 
@@ -47,9 +47,9 @@
47
47
  });
48
48
 
49
49
  // init code
50
- $(document).on("uk-domready", function(e) {
50
+ UI.ready(function(context) {
51
51
 
52
- $("[data-uk-form-select]").each(function(){
52
+ $("[data-uk-form-select]", context).each(function(){
53
53
  var ele = $(this);
54
54
 
55
55
  if (!ele.data("formSelect")) {
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
 
3
3
  (function(addon) {
4
4
 
@@ -21,13 +21,14 @@
21
21
  UI.component('htmleditor', {
22
22
 
23
23
  defaults: {
24
+ iframe : false,
24
25
  mode : 'split',
25
26
  markdown : false,
26
27
  autocomplete : true,
27
28
  height : 500,
28
29
  maxsplitsize : 1000,
29
30
  markedOptions: { gfm: true, tables: true, breaks: true, pedantic: true, sanitize: false, smartLists: true, smartypants: false, langPrefix: 'lang-'},
30
- codemirror : { mode: 'htmlmixed', tabMode: 'indent', tabsize: 4, lineWrapping: true, dragDrop: false, autoCloseTags: true, matchTags: true, autoCloseBrackets: true, matchBrackets: true, indentUnit: 4, hintOptions: {completionSingle:false} },
31
+ codemirror : { mode: 'htmlmixed', lineWrapping: true, dragDrop: false, autoCloseTags: true, matchTags: true, autoCloseBrackets: true, matchBrackets: true, indentUnit: 4, indentWithTabs: false, tabSize: 4, hintOptions: {completionSingle:false} },
31
32
  toolbar : [ 'bold', 'italic', 'strike', 'link', 'image', 'blockquote', 'listUl', 'listOl' ],
32
33
  lblPreview : 'Preview',
33
34
  lblCodeview : 'HTML',
@@ -57,9 +58,30 @@
57
58
  this.editor.on('change', function() { $this.editor.save(); });
58
59
  this.code.find('.CodeMirror').css('height', this.options.height);
59
60
 
60
- $(window).on('resize', UI.Utils.debounce(function() { $this.fit(); }, 200));
61
+ // iframe mode?
62
+ if (this.options.iframe) {
61
63
 
62
- var previewContainer = $this.preview.parent(),
64
+ this.iframe = $('<iframe class="uk-htmleditor-iframe" frameborder="0" scrolling="auto" height="100" width="100%"></iframe>');
65
+ this.preview.append(this.iframe);
66
+
67
+ // must open and close document object to start using it!
68
+ this.iframe[0].contentWindow.document.open();
69
+ this.iframe[0].contentWindow.document.close();
70
+
71
+ this.preview.container = $(this.iframe[0].contentWindow.document).find('body');
72
+
73
+ // append custom stylesheet
74
+ if (typeof(this.options.iframe) === 'string') {
75
+ this.preview.container.parent().append('<link rel="stylesheet" href="'+this.options.iframe+'">');
76
+ }
77
+
78
+ } else {
79
+ this.preview.container = this.preview;
80
+ }
81
+
82
+ UI.$win.on('resize', UI.Utils.debounce(function() { $this.fit(); }, 200));
83
+
84
+ var previewContainer = this.iframe ? this.preview.container:$this.preview.parent(),
63
85
  codeContent = this.code.find('.CodeMirror-sizer'),
64
86
  codeScroll = this.code.find('.CodeMirror-scroll').on('scroll', UI.Utils.debounce(function() {
65
87
 
@@ -67,7 +89,7 @@
67
89
 
68
90
  // calc position
69
91
  var codeHeight = codeContent.height() - codeScroll.height(),
70
- previewHeight = previewContainer[0].scrollHeight - previewContainer.height(),
92
+ previewHeight = previewContainer[0].scrollHeight - ($this.iframe ? $this.iframe.height() : previewContainer.height()),
71
93
  ratio = previewHeight / codeHeight,
72
94
  previewPostition = codeScroll.scrollTop() * ratio;
73
95
 
@@ -123,6 +145,10 @@
123
145
  $this.redraw();
124
146
  });
125
147
 
148
+ this.element.attr('data-uk-check-display', 1).on('uk-check-display', function(e) {
149
+ if(this.htmleditor.is(":visible")) this.fit();
150
+ }.bind(this));
151
+
126
152
  editors.push(this);
127
153
  },
128
154
 
@@ -247,7 +273,7 @@
247
273
  if (!this.currentvalue) {
248
274
 
249
275
  this.element.val('');
250
- this.preview.html('');
276
+ this.preview.container.html('');
251
277
 
252
278
  return;
253
279
  }
@@ -255,7 +281,7 @@
255
281
  this.trigger('render', [this]);
256
282
  this.trigger('renderLate', [this]);
257
283
 
258
- this.preview.html(this.currentvalue);
284
+ this.preview.container.html(this.currentvalue);
259
285
  },
260
286
 
261
287
  addShortcut: function(name, callback) {
@@ -442,7 +468,8 @@
442
468
 
443
469
  setTimeout(function() {
444
470
  editor.fit();
445
- }, 10);
471
+ UI.$win.trigger('resize');
472
+ }, 50);
446
473
  });
447
474
 
448
475
  editor.addShortcut(['Ctrl-S', 'Cmd-S'], function() { editor.element.trigger('htmleditor-save', [editor]); });
@@ -584,11 +611,5 @@
584
611
  });
585
612
  });
586
613
 
587
- $(document).on("uk-check-display", function(e) {
588
- editors.forEach(function(item) {
589
- if(item.htmleditor.is(":visible")) item.fit();
590
- });
591
- });
592
-
593
614
  return UI.htmleditor;
594
615
  });
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
 
3
3
  /*
4
4
  * Based on Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
@@ -22,7 +22,7 @@
22
22
  var hasTouch = 'ontouchstart' in window,
23
23
  html = $("html"),
24
24
  touchedlists = [],
25
- $win = $(window);
25
+ $win = UI.$win;
26
26
 
27
27
  /**
28
28
  * Detect CSS pointer-events property
@@ -558,15 +558,16 @@
558
558
 
559
559
  });
560
560
 
561
- $(document).on("uk-domready", function(e) {
561
+ // init code
562
+ UI.ready(function(context) {
562
563
 
563
- $("[data-uk-nestable]").each(function(){
564
+ $("[data-uk-nestable]", context).each(function(){
564
565
 
565
- var ele = $(this);
566
+ var ele = $(this);
566
567
 
567
- if(!ele.data("nestable")) {
568
- var plugin = UI.nestable(ele, UI.Utils.options(ele.attr("data-uk-nestable")));
569
- }
568
+ if(!ele.data("nestable")) {
569
+ var plugin = UI.nestable(ele, UI.Utils.options(ele.attr("data-uk-nestable")));
570
+ }
570
571
  });
571
572
  });
572
573
 
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
 
3
3
  (function(addon) {
4
4
 
@@ -120,6 +120,8 @@
120
120
  containers[$this.options.pos].hide();
121
121
  }
122
122
 
123
+ $this.options.onClose.apply($this, []);
124
+
123
125
  delete messages[$this.uuid];
124
126
  };
125
127
 
@@ -166,7 +168,8 @@
166
168
  status: "",
167
169
  timeout: 5000,
168
170
  group: null,
169
- pos: 'top-center'
171
+ pos: 'top-center',
172
+ onClose: function() {}
170
173
  };
171
174
 
172
175
  UI.notify = notify;
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
 
3
3
  /*
4
4
  * Based on simplePagination - Copyright (c) 2012 Flavius Matis - http://flaviusmatis.github.com/simplePagination.js/ (MIT)
@@ -131,9 +131,9 @@
131
131
  });
132
132
 
133
133
  // init code
134
- $(document).on("uk-domready", function(e) {
134
+ UI.ready(function(context) {
135
135
 
136
- $("[data-uk-pagination]").each(function(){
136
+ $("[data-uk-pagination]", context).each(function(){
137
137
  var ele = $(this);
138
138
 
139
139
  if (!ele.data("pagination")) {