furatto 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +102 -17
  3. data/furatto.gemspec +1 -0
  4. data/lib/furatto/version.rb +1 -1
  5. data/vendor/assets/javascripts/furatto.js +5978 -15
  6. data/vendor/assets/javascripts/furatto.min.js +3 -0
  7. data/vendor/assets/stylesheets/font-awesome.scss +2495 -0
  8. data/vendor/assets/stylesheets/furatto.scss +15 -30
  9. data/vendor/assets/stylesheets/furatto/_alerts.scss +5 -6
  10. data/vendor/assets/stylesheets/furatto/_base.scss +33 -121
  11. data/vendor/assets/stylesheets/furatto/_buttons.scss +36 -11
  12. data/vendor/assets/stylesheets/furatto/_code.scss +7 -6
  13. data/vendor/assets/stylesheets/furatto/_dashboard.scss +36 -0
  14. data/vendor/assets/stylesheets/furatto/_dropdown.scss +29 -31
  15. data/vendor/assets/stylesheets/furatto/_fonts.scss +0 -588
  16. data/vendor/assets/stylesheets/furatto/_footer.scss +8 -25
  17. data/vendor/assets/stylesheets/furatto/_forms.scss +80 -63
  18. data/vendor/assets/stylesheets/furatto/_grid.scss +34 -30
  19. data/vendor/assets/stylesheets/furatto/_images.scss +28 -8
  20. data/vendor/assets/stylesheets/furatto/_labels.scss +3 -2
  21. data/vendor/assets/stylesheets/furatto/_mixins.scss +81 -164
  22. data/vendor/assets/stylesheets/furatto/_modal.scss +339 -77
  23. data/vendor/assets/stylesheets/furatto/_nav.scss +43 -45
  24. data/vendor/assets/stylesheets/furatto/_navbar.scss +60 -31
  25. data/vendor/assets/stylesheets/furatto/_panel.scss +277 -0
  26. data/vendor/assets/stylesheets/furatto/_responsive_navbar.scss +37 -26
  27. data/vendor/assets/stylesheets/furatto/_responsive_tables.scss +1 -1
  28. data/vendor/assets/stylesheets/furatto/_responsive_utilities.scss +182 -0
  29. data/vendor/assets/stylesheets/furatto/_responsiveslides.scss +157 -174
  30. data/vendor/assets/stylesheets/furatto/_tooltips.scss +2 -14
  31. data/vendor/assets/stylesheets/furatto/_typography.scss +41 -83
  32. data/vendor/assets/stylesheets/furatto/_variables.scss +241 -244
  33. metadata +14 -81
  34. data/vendor/assets/images/icheck/aero.png +0 -0
  35. data/vendor/assets/images/icheck/aero@2x.png +0 -0
  36. data/vendor/assets/images/icheck/blue.png +0 -0
  37. data/vendor/assets/images/icheck/blue@2x.png +0 -0
  38. data/vendor/assets/images/icheck/flat.png +0 -0
  39. data/vendor/assets/images/icheck/flat@2x.png +0 -0
  40. data/vendor/assets/images/icheck/green.png +0 -0
  41. data/vendor/assets/images/icheck/green@2x.png +0 -0
  42. data/vendor/assets/images/icheck/grey.png +0 -0
  43. data/vendor/assets/images/icheck/grey@2x.png +0 -0
  44. data/vendor/assets/images/icheck/orange.png +0 -0
  45. data/vendor/assets/images/icheck/orange@2x.png +0 -0
  46. data/vendor/assets/images/icheck/pink.png +0 -0
  47. data/vendor/assets/images/icheck/pink@2x.png +0 -0
  48. data/vendor/assets/images/icheck/purple.png +0 -0
  49. data/vendor/assets/images/icheck/purple@2x.png +0 -0
  50. data/vendor/assets/images/icheck/red.png +0 -0
  51. data/vendor/assets/images/icheck/red@2x.png +0 -0
  52. data/vendor/assets/images/icheck/yellow.png +0 -0
  53. data/vendor/assets/images/icheck/yellow@2x.png +0 -0
  54. data/vendor/assets/images/icons/customize-icon150.png +0 -0
  55. data/vendor/assets/images/icons/flexible-icon.png +0 -0
  56. data/vendor/assets/images/icons/github-128-black.png +0 -0
  57. data/vendor/assets/images/icons/iphone-icon150.png +0 -0
  58. data/vendor/assets/images/icons/lock-icon128.png +0 -0
  59. data/vendor/assets/images/icons/rocket-icon128.png +0 -0
  60. data/vendor/assets/images/icons/rocket-icon150.png +0 -0
  61. data/vendor/assets/images/icons/screen-icon.png +0 -0
  62. data/vendor/assets/images/icons/screens-icon.png +0 -0
  63. data/vendor/assets/images/icons/screens2-icon.png +0 -0
  64. data/vendor/assets/images/next.png +0 -0
  65. data/vendor/assets/images/previous.png +0 -0
  66. data/vendor/assets/images/themes.gif +0 -0
  67. data/vendor/assets/images/toggle.png +0 -0
  68. data/vendor/assets/javascripts/dropdown.js +0 -169
  69. data/vendor/assets/javascripts/jpanel.js +0 -547
  70. data/vendor/assets/javascripts/jquery.avgrund.js +0 -127
  71. data/vendor/assets/javascripts/jquery.dropkick-1.0.0.js +0 -400
  72. data/vendor/assets/javascripts/jquery.icheck.js +0 -462
  73. data/vendor/assets/javascripts/jquery.tagsinput.js +0 -354
  74. data/vendor/assets/javascripts/jquery.toolbar.js +0 -242
  75. data/vendor/assets/javascripts/legacy.js +0 -140
  76. data/vendor/assets/javascripts/picker.date.js +0 -957
  77. data/vendor/assets/javascripts/picker.js +0 -785
  78. data/vendor/assets/javascripts/picker.time.js +0 -651
  79. data/vendor/assets/javascripts/rainbow-custom.min.js +0 -13
  80. data/vendor/assets/javascripts/responsive-tables.js +0 -67
  81. data/vendor/assets/javascripts/responsiveslides.js +0 -391
  82. data/vendor/assets/javascripts/tooltip.js +0 -353
  83. data/vendor/assets/stylesheets/furatto/_date_picker.time.scss +0 -122
  84. data/vendor/assets/stylesheets/furatto/_font-awesome-ie7.scss +0 -1953
  85. data/vendor/assets/stylesheets/furatto/_layout.scss +0 -0
  86. data/vendor/assets/stylesheets/furatto/_left_navbar.scss +0 -100
  87. data/vendor/assets/stylesheets/furatto/_pagination.scss +0 -158
  88. data/vendor/assets/stylesheets/furatto/_responsive-1200px-min.scss +0 -21
  89. data/vendor/assets/stylesheets/furatto/_responsive-767px-max.scss +0 -82
  90. data/vendor/assets/stylesheets/furatto/_responsive-768px-979px.scss +0 -23
  91. data/vendor/assets/stylesheets/furatto/_select.scss +0 -191
  92. data/vendor/assets/stylesheets/furatto/_tags.scss +0 -107
  93. data/vendor/assets/stylesheets/furatto/_vrt_navbar.scss +0 -61
  94. data/vendor/assets/stylesheets/furatto/icheck/_aero.scss +0 -64
  95. data/vendor/assets/stylesheets/furatto/icheck/_all.scss +0 -20
  96. data/vendor/assets/stylesheets/furatto/icheck/_blue.scss +0 -64
  97. data/vendor/assets/stylesheets/furatto/icheck/_flat.scss +0 -64
  98. data/vendor/assets/stylesheets/furatto/icheck/_green.scss +0 -64
  99. data/vendor/assets/stylesheets/furatto/icheck/_grey.scss +0 -64
  100. data/vendor/assets/stylesheets/furatto/icheck/_orange.scss +0 -64
  101. data/vendor/assets/stylesheets/furatto/icheck/_pink.scss +0 -64
  102. data/vendor/assets/stylesheets/furatto/icheck/_purple.scss +0 -64
  103. data/vendor/assets/stylesheets/furatto/icheck/_red.scss +0 -64
  104. data/vendor/assets/stylesheets/furatto/icheck/_yellow.scss +0 -64
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: furatto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Abraham Kuri Vargas
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-07-16 00:00:00.000000000 Z
11
+ date: 2013-09-27 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Integrates the Furatto CSS Framework to the Rails assets Pipeline
15
14
  email:
@@ -36,127 +35,61 @@ files:
36
35
  - vendor/assets/fonts/meteocons-webfont.svg
37
36
  - vendor/assets/fonts/meteocons-webfont.ttf
38
37
  - vendor/assets/fonts/meteocons-webfont.woff
39
- - vendor/assets/images/icheck/aero.png
40
- - vendor/assets/images/icheck/aero@2x.png
41
- - vendor/assets/images/icheck/blue.png
42
- - vendor/assets/images/icheck/blue@2x.png
43
- - vendor/assets/images/icheck/flat.png
44
- - vendor/assets/images/icheck/flat@2x.png
45
- - vendor/assets/images/icheck/green.png
46
- - vendor/assets/images/icheck/green@2x.png
47
- - vendor/assets/images/icheck/grey.png
48
- - vendor/assets/images/icheck/grey@2x.png
49
- - vendor/assets/images/icheck/orange.png
50
- - vendor/assets/images/icheck/orange@2x.png
51
- - vendor/assets/images/icheck/pink.png
52
- - vendor/assets/images/icheck/pink@2x.png
53
- - vendor/assets/images/icheck/purple.png
54
- - vendor/assets/images/icheck/purple@2x.png
55
- - vendor/assets/images/icheck/red.png
56
- - vendor/assets/images/icheck/red@2x.png
57
- - vendor/assets/images/icheck/yellow.png
58
- - vendor/assets/images/icheck/yellow@2x.png
59
- - vendor/assets/images/icons/customize-icon150.png
60
- - vendor/assets/images/icons/flexible-icon.png
61
- - vendor/assets/images/icons/github-128-black.png
62
- - vendor/assets/images/icons/iphone-icon150.png
63
- - vendor/assets/images/icons/lock-icon128.png
64
- - vendor/assets/images/icons/rocket-icon128.png
65
- - vendor/assets/images/icons/rocket-icon150.png
66
- - vendor/assets/images/icons/screen-icon.png
67
- - vendor/assets/images/icons/screens-icon.png
68
- - vendor/assets/images/icons/screens2-icon.png
69
- - vendor/assets/images/next.png
70
- - vendor/assets/images/previous.png
71
- - vendor/assets/images/themes.gif
72
- - vendor/assets/images/toggle.png
73
- - vendor/assets/javascripts/dropdown.js
74
38
  - vendor/assets/javascripts/furatto.js
75
- - vendor/assets/javascripts/jpanel.js
76
- - vendor/assets/javascripts/jquery.avgrund.js
77
- - vendor/assets/javascripts/jquery.dropkick-1.0.0.js
78
- - vendor/assets/javascripts/jquery.icheck.js
79
- - vendor/assets/javascripts/jquery.tagsinput.js
80
- - vendor/assets/javascripts/jquery.toolbar.js
81
- - vendor/assets/javascripts/legacy.js
82
- - vendor/assets/javascripts/picker.date.js
83
- - vendor/assets/javascripts/picker.js
84
- - vendor/assets/javascripts/picker.time.js
85
- - vendor/assets/javascripts/rainbow-custom.min.js
86
- - vendor/assets/javascripts/responsive-tables.js
87
- - vendor/assets/javascripts/responsiveslides.js
88
- - vendor/assets/javascripts/tooltip.js
39
+ - vendor/assets/javascripts/furatto.min.js
40
+ - vendor/assets/stylesheets/font-awesome.scss
89
41
  - vendor/assets/stylesheets/furatto.scss
90
42
  - vendor/assets/stylesheets/furatto/_alerts.scss
91
43
  - vendor/assets/stylesheets/furatto/_base.scss
92
44
  - vendor/assets/stylesheets/furatto/_buttons.scss
93
45
  - vendor/assets/stylesheets/furatto/_code.scss
46
+ - vendor/assets/stylesheets/furatto/_dashboard.scss
94
47
  - vendor/assets/stylesheets/furatto/_date_picker.date.scss
95
48
  - vendor/assets/stylesheets/furatto/_date_picker.scss
96
- - vendor/assets/stylesheets/furatto/_date_picker.time.scss
97
49
  - vendor/assets/stylesheets/furatto/_dropdown.scss
98
- - vendor/assets/stylesheets/furatto/_font-awesome-ie7.scss
99
50
  - vendor/assets/stylesheets/furatto/_fonts.scss
100
51
  - vendor/assets/stylesheets/furatto/_footer.scss
101
52
  - vendor/assets/stylesheets/furatto/_forms.scss
102
53
  - vendor/assets/stylesheets/furatto/_grid.scss
103
54
  - vendor/assets/stylesheets/furatto/_images.scss
104
55
  - vendor/assets/stylesheets/furatto/_labels.scss
105
- - vendor/assets/stylesheets/furatto/_layout.scss
106
- - vendor/assets/stylesheets/furatto/_left_navbar.scss
107
56
  - vendor/assets/stylesheets/furatto/_mixins.scss
108
57
  - vendor/assets/stylesheets/furatto/_modal.scss
109
58
  - vendor/assets/stylesheets/furatto/_nav.scss
110
59
  - vendor/assets/stylesheets/furatto/_navbar.scss
111
- - vendor/assets/stylesheets/furatto/_pagination.scss
112
- - vendor/assets/stylesheets/furatto/_responsive-1200px-min.scss
113
- - vendor/assets/stylesheets/furatto/_responsive-767px-max.scss
114
- - vendor/assets/stylesheets/furatto/_responsive-768px-979px.scss
60
+ - vendor/assets/stylesheets/furatto/_panel.scss
115
61
  - vendor/assets/stylesheets/furatto/_responsive_navbar.scss
116
62
  - vendor/assets/stylesheets/furatto/_responsive_tables.scss
63
+ - vendor/assets/stylesheets/furatto/_responsive_utilities.scss
117
64
  - vendor/assets/stylesheets/furatto/_responsiveslides.scss
118
- - vendor/assets/stylesheets/furatto/_select.scss
119
65
  - vendor/assets/stylesheets/furatto/_tables.scss
120
- - vendor/assets/stylesheets/furatto/_tags.scss
121
66
  - vendor/assets/stylesheets/furatto/_toolbars.scss
122
67
  - vendor/assets/stylesheets/furatto/_tooltips.scss
123
68
  - vendor/assets/stylesheets/furatto/_typography.scss
124
69
  - vendor/assets/stylesheets/furatto/_variables.scss
125
- - vendor/assets/stylesheets/furatto/_vrt_navbar.scss
126
- - vendor/assets/stylesheets/furatto/icheck/_aero.scss
127
- - vendor/assets/stylesheets/furatto/icheck/_all.scss
128
- - vendor/assets/stylesheets/furatto/icheck/_blue.scss
129
- - vendor/assets/stylesheets/furatto/icheck/_flat.scss
130
- - vendor/assets/stylesheets/furatto/icheck/_green.scss
131
- - vendor/assets/stylesheets/furatto/icheck/_grey.scss
132
- - vendor/assets/stylesheets/furatto/icheck/_orange.scss
133
- - vendor/assets/stylesheets/furatto/icheck/_pink.scss
134
- - vendor/assets/stylesheets/furatto/icheck/_purple.scss
135
- - vendor/assets/stylesheets/furatto/icheck/_red.scss
136
- - vendor/assets/stylesheets/furatto/icheck/_yellow.scss
137
70
  - vendor/assets/stylesheets/normalize.scss
138
71
  homepage: https://github.com/IcaliaLabs/furatto-rails
139
- licenses: []
72
+ licenses:
73
+ - GPL
74
+ metadata: {}
140
75
  post_install_message:
141
76
  rdoc_options: []
142
77
  require_paths:
143
78
  - lib
144
79
  required_ruby_version: !ruby/object:Gem::Requirement
145
- none: false
146
80
  requirements:
147
- - - ! '>='
81
+ - - '>='
148
82
  - !ruby/object:Gem::Version
149
83
  version: '0'
150
84
  required_rubygems_version: !ruby/object:Gem::Requirement
151
- none: false
152
85
  requirements:
153
- - - ! '>='
86
+ - - '>='
154
87
  - !ruby/object:Gem::Version
155
88
  version: '0'
156
89
  requirements: []
157
90
  rubyforge_project: furatto-rails
158
- rubygems_version: 1.8.25
91
+ rubygems_version: 2.0.6
159
92
  signing_key:
160
- specification_version: 3
93
+ specification_version: 4
161
94
  summary: Furatto CSS Framework for Rails 3.1 Asset Pipeline
162
95
  test_files: []
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,169 +0,0 @@
1
- /* ============================================================
2
- * bootstrap-dropdown.js v2.3.2
3
- * http://twitter.github.com/bootstrap/javascript.html#dropdowns
4
- * ============================================================
5
- * Copyright 2012 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- * ============================================================ */
19
-
20
-
21
- !function ($) {
22
-
23
- "use strict"; // jshint ;_;
24
-
25
-
26
- /* DROPDOWN CLASS DEFINITION
27
- * ========================= */
28
-
29
- var toggle = '[data-toggle=dropdown]'
30
- , Dropdown = function (element) {
31
- var $el = $(element).on('click.dropdown.data-api', this.toggle)
32
- $('html').on('click.dropdown.data-api', function () {
33
- $el.parent().removeClass('open')
34
- })
35
- }
36
-
37
- Dropdown.prototype = {
38
-
39
- constructor: Dropdown
40
-
41
- , toggle: function (e) {
42
- var $this = $(this)
43
- , $parent
44
- , isActive
45
-
46
- if ($this.is('.disabled, :disabled')) return
47
-
48
- $parent = getParent($this)
49
-
50
- isActive = $parent.hasClass('open')
51
-
52
- clearMenus()
53
-
54
- if (!isActive) {
55
- if ('ontouchstart' in document.documentElement) {
56
- // if mobile we we use a backdrop because click events don't delegate
57
- $('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
58
- }
59
- $parent.toggleClass('open')
60
- }
61
-
62
- $this.focus()
63
-
64
- return false
65
- }
66
-
67
- , keydown: function (e) {
68
- var $this
69
- , $items
70
- , $active
71
- , $parent
72
- , isActive
73
- , index
74
-
75
- if (!/(38|40|27)/.test(e.keyCode)) return
76
-
77
- $this = $(this)
78
-
79
- e.preventDefault()
80
- e.stopPropagation()
81
-
82
- if ($this.is('.disabled, :disabled')) return
83
-
84
- $parent = getParent($this)
85
-
86
- isActive = $parent.hasClass('open')
87
-
88
- if (!isActive || (isActive && e.keyCode == 27)) {
89
- if (e.which == 27) $parent.find(toggle).focus()
90
- return $this.click()
91
- }
92
-
93
- $items = $('[role=menu] li:not(.divider):visible a', $parent)
94
-
95
- if (!$items.length) return
96
-
97
- index = $items.index($items.filter(':focus'))
98
-
99
- if (e.keyCode == 38 && index > 0) index-- // up
100
- if (e.keyCode == 40 && index < $items.length - 1) index++ // down
101
- if (!~index) index = 0
102
-
103
- $items
104
- .eq(index)
105
- .focus()
106
- }
107
-
108
- }
109
-
110
- function clearMenus() {
111
- $('.dropdown-backdrop').remove()
112
- $(toggle).each(function () {
113
- getParent($(this)).removeClass('open')
114
- })
115
- }
116
-
117
- function getParent($this) {
118
- var selector = $this.attr('data-target')
119
- , $parent
120
-
121
- if (!selector) {
122
- selector = $this.attr('href')
123
- selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
124
- }
125
-
126
- $parent = selector && $(selector)
127
-
128
- if (!$parent || !$parent.length) $parent = $this.parent()
129
-
130
- return $parent
131
- }
132
-
133
-
134
- /* DROPDOWN PLUGIN DEFINITION
135
- * ========================== */
136
-
137
- var old = $.fn.dropdown
138
-
139
- $.fn.dropdown = function (option) {
140
- return this.each(function () {
141
- var $this = $(this)
142
- , data = $this.data('dropdown')
143
- if (!data) $this.data('dropdown', (data = new Dropdown(this)))
144
- if (typeof option == 'string') data[option].call($this)
145
- })
146
- }
147
-
148
- $.fn.dropdown.Constructor = Dropdown
149
-
150
-
151
- /* DROPDOWN NO CONFLICT
152
- * ==================== */
153
-
154
- $.fn.dropdown.noConflict = function () {
155
- $.fn.dropdown = old
156
- return this
157
- }
158
-
159
-
160
- /* APPLY TO STANDARD DROPDOWN ELEMENTS
161
- * =================================== */
162
-
163
- $(document)
164
- .on('click.dropdown.data-api', clearMenus)
165
- .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
166
- .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
167
- .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
168
-
169
- }(window.jQuery);
@@ -1,547 +0,0 @@
1
- /**
2
- *
3
- * jPanelMenu 1.3.0 (http://jpanelmenu.com)
4
- * By Anthony Colangelo (http://acolangelo.com)
5
- *
6
- * */
7
-
8
- (function($){
9
- $.jPanelMenu = function(options) {
10
- if ( typeof(options) == "undefined" || options == null ) { options = {}; };
11
-
12
- var jP = {
13
- options: $.extend({
14
- menu: '#menu',
15
- trigger: '.menu-trigger',
16
- excludedPanelContent: 'style, script',
17
-
18
- direction: 'left',
19
- openPosition: '250px',
20
- animated: true,
21
- closeOnContentClick: true,
22
-
23
- keyboardShortcuts: [
24
- {
25
- code: 27,
26
- open: false,
27
- close: true
28
- },
29
- {
30
- code: 37,
31
- open: false,
32
- close: true
33
- },
34
- {
35
- code: 39,
36
- open: true,
37
- close: true
38
- },
39
- {
40
- code: 77,
41
- open: true,
42
- close: true
43
- }
44
- ],
45
-
46
- duration: 150,
47
- openDuration: options.duration || 150,
48
- closeDuration: options.duration || 150,
49
-
50
- easing: 'ease-in-out',
51
- openEasing: options.easing || 'ease-in-out',
52
- closeEasing: options.easing || 'ease-in-out',
53
-
54
- before: function(){ },
55
- beforeOpen: function(){ },
56
- beforeClose: function(){ },
57
-
58
- after: function(){ },
59
- afterOpen: function(){ },
60
- afterClose: function(){ },
61
-
62
- beforeOn: function(){ },
63
- afterOn: function(){ },
64
-
65
- beforeOff: function(){ },
66
- afterOff: function(){ }
67
- },options),
68
-
69
- settings: {
70
- transitionsSupported: 'WebkitTransition' in document.body.style ||
71
- 'MozTransition' in document.body.style ||
72
- 'msTransition' in document.body.style ||
73
- 'OTransition' in document.body.style ||
74
- 'Transition' in document.body.style
75
- ,
76
- shiftFixedChildren: false,
77
- panelPosition: 'relative',
78
- positionUnits: 'px'
79
- },
80
-
81
- menu: '#jPanelMenu-menu',
82
-
83
- panel: '.jPanelMenu-panel',
84
-
85
- fixedChildren: [],
86
-
87
- timeouts: {},
88
-
89
- clearTimeouts: function() {
90
- clearTimeout(jP.timeouts.open);
91
- clearTimeout(jP.timeouts.afterOpen);
92
- clearTimeout(jP.timeouts.afterClose);
93
- },
94
-
95
- setPositionUnits: function() {
96
- var foundUnit = false,
97
- allowedUnits = ['%','px','em']
98
- ;
99
-
100
- for ( unitID in allowedUnits ) {
101
- var unit = allowedUnits[unitID];
102
- if ( jP.options.openPosition.toString().substr(-unit.length) == unit )
103
- {
104
- foundUnit = true;
105
- jP.settings.positionUnits = unit;
106
- }
107
- }
108
-
109
- if ( !foundUnit ) { jP.options.openPosition = parseInt(jP.options.openPosition) + jP.settings.positionUnits }
110
- },
111
-
112
- checkFixedChildren: function() {
113
- jP.disableTransitions();
114
-
115
- var defaultPanelStyle = { position: $(jP.panel).css('position') };
116
-
117
- defaultPanelStyle[jP.options.direction] = ($(jP.panel).css(jP.options.direction) == 'auto')?0:$(jP.panel).css(jP.options.direction);
118
-
119
- $(jP.panel).find('> *').each(function(){
120
- if ( $(this).css('position') == 'fixed' && $(this).css(jP.options.direction) == 'auto' ) { jP.fixedChildren.push(this); }
121
- });
122
-
123
- if ( jP.fixedChildren.length > 0 )
124
- {
125
- var newPanelStyle = { position: 'relative' };
126
- newPanelStyle[jP.options.direction] = '1px';
127
- jP.setPanelStyle(newPanelStyle);
128
-
129
- if ( parseInt($(jP.fixedChildren[0]).offset().left) == 0 ) { jP.settings.shiftFixedChildren = true; }
130
- }
131
-
132
- jP.setPanelStyle(defaultPanelStyle);
133
- },
134
-
135
- setjPanelMenuStyles: function() {
136
- var bgColor = '#fff';
137
- var htmlBG = $('html').css('background-color');
138
- var bodyBG = $('body').css('background-color');
139
-
140
- if ( bodyBG != 'transparent' && bodyBG != "rgba(0, 0, 0, 0)") { bgColor = bodyBG; }
141
- else if ( htmlBG != 'transparent' && htmlBG != "rgba(0, 0, 0, 0)") { bgColor = htmlBG; }
142
- else { bgColor = '#fff'; }
143
-
144
- if ( $('#jPanelMenu-style-master').length == 0 )
145
- {
146
- $('body').append('<style id="jPanelMenu-style-master">body{width:100%}.jPanelMenu,body{overflow-x:hidden}#jPanelMenu-menu{display:block;position:fixed;top:0;'+jP.options.direction+':0;height:100%;z-index:-1;overflow-x:hidden;overflow-y:scroll;-webkit-overflow-scrolling:touch}.jPanelMenu-panel{position:static;'+jP.options.direction+':0;top:0;z-index:2;width:100%;min-height:100%;background:' + bgColor + '}</style>');
147
- }
148
- },
149
-
150
- setMenuState: function(open) {
151
- var position = (open)?'open':'closed';
152
- $('body').attr('data-menu-position', position);
153
- },
154
-
155
- getMenuState: function() {
156
- return $('body').attr('data-menu-position');
157
- },
158
-
159
- menuIsOpen: function() {
160
- if ( jP.getMenuState() == 'open' ) return true;
161
- else return false;
162
- },
163
-
164
- setMenuStyle: function(styles) {
165
- $(jP.menu).css(styles);
166
- },
167
-
168
- setPanelStyle: function(styles) {
169
- $(jP.panel).css(styles);
170
- },
171
-
172
- showMenu: function() {
173
- jP.setMenuStyle({
174
- display: 'block'
175
- });
176
- jP.setMenuStyle({
177
- 'z-index': '1'
178
- });
179
- },
180
-
181
- hideMenu: function() {
182
- jP.setMenuStyle({
183
- 'z-index': '-1'
184
- });
185
- jP.setMenuStyle({
186
- display: 'none'
187
- });
188
- },
189
-
190
- enableTransitions: function(duration, easing) {
191
- var formattedDuration = duration/1000;
192
- var formattedEasing = jP.getCSSEasingFunction(easing);
193
- jP.disableTransitions();
194
- $('body').append('<style id="jPanelMenu-style-transitions">.jPanelMenu-panel{-webkit-transition: all ' + formattedDuration + 's ' + formattedEasing + '; -moz-transition: all ' + formattedDuration + 's ' + formattedEasing + '; -o-transition: all ' + formattedDuration + 's ' + formattedEasing + '; transition: all ' + formattedDuration + 's ' + formattedEasing + ';}</style>');
195
- },
196
-
197
- disableTransitions: function() {
198
- $('#jPanelMenu-style-transitions').remove();
199
- },
200
-
201
- enableFixedTransitions: function(selector, id, duration, easing) {
202
- var formattedDuration = duration/1000;
203
- var formattedEasing = jP.getCSSEasingFunction(easing);
204
- jP.disableFixedTransitions(id);
205
- $('body').append('<style id="jPanelMenu-style-fixed-' + id + '">' + selector + '{-webkit-transition: all ' + formattedDuration + 's ' + formattedEasing + '; -moz-transition: all ' + formattedDuration + 's ' + formattedEasing + '; -o-transition: all ' + formattedDuration + 's ' + formattedEasing + '; transition: all ' + formattedDuration + 's ' + formattedEasing + ';}</style>');
206
- },
207
-
208
- disableFixedTransitions: function(id) {
209
- $('#jPanelMenu-style-fixed-' + id).remove();
210
- },
211
-
212
- getCSSEasingFunction: function(name) {
213
- switch ( name )
214
- {
215
- case 'linear':
216
- return name;
217
- break;
218
-
219
- case 'ease':
220
- return name;
221
- break;
222
-
223
- case 'ease-in':
224
- return name;
225
- break;
226
-
227
- case 'ease-out':
228
- return name;
229
- break;
230
-
231
- case 'ease-in-out':
232
- return name;
233
- break;
234
-
235
- default:
236
- return 'ease-in-out';
237
- break;
238
- }
239
- },
240
-
241
- getJSEasingFunction: function(name) {
242
- switch ( name )
243
- {
244
- case 'linear':
245
- return name;
246
- break;
247
-
248
- default:
249
- return 'swing';
250
- break;
251
- }
252
- },
253
-
254
- openMenu: function(animated) {
255
- if ( typeof(animated) == "undefined" || animated == null ) { animated = jP.options.animated };
256
-
257
- jP.clearTimeouts();
258
-
259
- jP.options.before();
260
- jP.options.beforeOpen();
261
-
262
- jP.setMenuState(true);
263
-
264
- jP.setPanelStyle({ position: 'relative' });
265
-
266
- jP.showMenu();
267
-
268
- var animationChecks = {
269
- none: (!animated)?true:false,
270
- transitions: (animated && jP.settings.transitionsSupported)?true:false
271
- };
272
-
273
- if ( animationChecks.transitions || animationChecks.none ) {
274
- if ( animationChecks.none ) jP.disableTransitions();
275
- if ( animationChecks.transitions ) jP.enableTransitions(jP.options.openDuration, jP.options.openEasing);
276
-
277
- var newPanelStyle = {};
278
- newPanelStyle[jP.options.direction] = jP.options.openPosition;
279
- jP.setPanelStyle(newPanelStyle);
280
-
281
- if ( jP.settings.shiftFixedChildren )
282
- {
283
- $(jP.fixedChildren).each(function(){
284
- var id = $(this).prop("tagName").toLowerCase() + ' ' + $(this).attr('class'),
285
- selector = id.replace(' ','.'),
286
- id = id.replace(' ','-')
287
- ;
288
-
289
- if ( animationChecks.none ) jP.disableFixedTransitions(id);
290
- if ( animationChecks.transitions ) jP.enableFixedTransitions(selector, id, jP.options.openDuration, jP.options.openEasing);
291
-
292
- var newChildrenStyle = {};
293
- newChildrenStyle[jP.options.direction] = jP.options.openPosition;
294
- $(this).css(newChildrenStyle);
295
- });
296
- }
297
-
298
- jP.timeouts.afterOpen = setTimeout(function(){
299
- jP.disableTransitions();
300
- if ( jP.settings.shiftFixedChildren )
301
- {
302
- $(jP.fixedChildren).each(function(){
303
- var id = $(this).prop("tagName").toLowerCase() + ' ' + $(this).attr('class'),
304
- id = id.replace(' ','-')
305
- ;
306
-
307
- jP.disableFixedTransitions(id);
308
- });
309
- }
310
-
311
- jP.options.after();
312
- jP.options.afterOpen();
313
- jP.initiateContentClickListeners();
314
- }, jP.options.openDuration);
315
- }
316
- else {
317
- var formattedEasing = jP.getJSEasingFunction(jP.options.openEasing);
318
-
319
- var animationOptions = {};
320
- animationOptions[jP.options.direction] = jP.options.openPosition;
321
- $(jP.panel).stop().animate(animationOptions, jP.options.openDuration, formattedEasing, function(){
322
- jP.options.after();
323
- jP.options.afterOpen();
324
- jP.initiateContentClickListeners();
325
- });
326
-
327
- if ( jP.settings.shiftFixedChildren )
328
- {
329
- $(jP.fixedChildren).each(function(){
330
- var childrenAnimationOptions = {};
331
- childrenAnimationOptions[jP.options.direction] = jP.options.openPosition;
332
- $(this).stop().animate(childrenAnimationOptions, jP.options.openDuration, formattedEasing);
333
- });
334
- }
335
- }
336
- },
337
-
338
- closeMenu: function(animated) {
339
- if ( typeof(animated) == "undefined" || animated == null ) { animated = jP.options.animated };
340
-
341
- jP.clearTimeouts();
342
-
343
- jP.options.before();
344
- jP.options.beforeClose();
345
-
346
- jP.setMenuState(false);
347
-
348
- var animationChecks = {
349
- none: (!animated)?true:false,
350
- transitions: (animated && jP.settings.transitionsSupported)?true:false
351
- };
352
-
353
- if ( animationChecks.transitions || animationChecks.none ) {
354
- if ( animationChecks.none ) jP.disableTransitions();
355
- if ( animationChecks.transitions ) jP.enableTransitions(jP.options.closeDuration, jP.options.closeEasing);
356
-
357
- var newPanelStyle = {};
358
- newPanelStyle[jP.options.direction] = 0 + jP.settings.positionUnits;
359
- jP.setPanelStyle(newPanelStyle);
360
-
361
- if ( jP.settings.shiftFixedChildren )
362
- {
363
- $(jP.fixedChildren).each(function(){
364
- var id = $(this).prop("tagName").toLowerCase() + ' ' + $(this).attr('class'),
365
- selector = id.replace(' ','.'),
366
- id = id.replace(' ','-')
367
- ;
368
-
369
- if ( animationChecks.none ) jP.disableFixedTransitions(id);
370
- if ( animationChecks.transitions ) jP.enableFixedTransitions(selector, id, jP.options.closeDuration, jP.options.closeEasing);
371
-
372
- var newChildrenStyle = {};
373
- newChildrenStyle[jP.options.direction] = 0 + jP.settings.positionUnits;
374
- $(this).css(newChildrenStyle);
375
- });
376
- }
377
-
378
- jP.timeouts.afterClose = setTimeout(function(){
379
- jP.setPanelStyle({ position: jP.settings.panelPosition });
380
-
381
- jP.disableTransitions();
382
- if ( jP.settings.shiftFixedChildren )
383
- {
384
- $(jP.fixedChildren).each(function(){
385
- var id = $(this).prop("tagName").toLowerCase() + ' ' + $(this).attr('class'),
386
- id = id.replace(' ','-')
387
- ;
388
-
389
- jP.disableFixedTransitions(id);
390
- });
391
- }
392
-
393
- jP.hideMenu();
394
- jP.options.after();
395
- jP.options.afterClose();
396
- jP.destroyContentClickListeners();
397
- }, jP.options.closeDuration);
398
- }
399
- else {
400
- var formattedEasing = jP.getJSEasingFunction(jP.options.closeEasing);
401
-
402
- var animationOptions = {};
403
- animationOptions[jP.options.direction] = 0 + jP.settings.positionUnits;
404
- $(jP.panel).stop().animate(animationOptions, jP.options.closeDuration, formattedEasing, function(){
405
- jP.setPanelStyle({ position: jP.settings.panelPosition });
406
-
407
- jP.hideMenu();
408
- jP.options.after();
409
- jP.options.afterClose();
410
- jP.destroyContentClickListeners();
411
- });
412
-
413
- if ( jP.settings.shiftFixedChildren )
414
- {
415
- $(jP.fixedChildren).each(function(){
416
- var childrenAnimationOptions = {};
417
- childrenAnimationOptions[jP.options.direction] = 0 + jP.settings.positionUnits;
418
- $(this).stop().animate(childrenAnimationOptions, jP.options.closeDuration, formattedEasing);
419
- });
420
- }
421
- }
422
- },
423
-
424
- triggerMenu: function(animated) {
425
- if ( jP.menuIsOpen() ) jP.closeMenu(animated);
426
- else jP.openMenu(animated);
427
- },
428
-
429
- initiateClickListeners: function() {
430
- $(document).on('click',jP.options.trigger,function(){ jP.triggerMenu(jP.options.animated); return false; });
431
- },
432
-
433
- destroyClickListeners: function() {
434
- $(document).off('click',jP.options.trigger,null);
435
- },
436
-
437
- initiateContentClickListeners: function() {
438
- if ( !jP.options.closeOnContentClick ) return false;
439
-
440
- $(document).on('click',jP.panel,function(e){
441
- if ( jP.menuIsOpen() ) jP.closeMenu(jP.options.animated);
442
- });
443
-
444
- $(document).on('touchend',jP.panel,function(e){
445
- if ( jP.menuIsOpen() ) jP.closeMenu(jP.options.animated);
446
- });
447
- },
448
-
449
- destroyContentClickListeners: function() {
450
- if ( !jP.options.closeOnContentClick ) return false;
451
-
452
- $(document).off('click',jP.panel,null);
453
- $(document).off('touchend',jP.panel,null);
454
- },
455
-
456
- initiateKeyboardListeners: function() {
457
- var preventKeyListeners = ['input', 'textarea'];
458
- $(document).on('keydown',function(e){
459
- var target = $(e.target),
460
- prevent = false;
461
- $.each(preventKeyListeners, function(){
462
- if (target.is(this.toString())) { prevent = true; }
463
- });
464
- if ( prevent ) { return true; }
465
-
466
- for ( mapping in jP.options.keyboardShortcuts ) {
467
- if ( e.which == jP.options.keyboardShortcuts[mapping].code )
468
- {
469
- var key = jP.options.keyboardShortcuts[mapping];
470
-
471
- if ( key.open && key.close ) { jP.triggerMenu(jP.options.animated); }
472
- else if ( (key.open && !key.close) && !jP.menuIsOpen() ) { jP.openMenu(jP.options.animated); }
473
- else if ( (!key.open && key.close) && jP.menuIsOpen() ) { jP.closeMenu(jP.options.animated); }
474
-
475
- return false;
476
- }
477
- }
478
- });
479
- },
480
-
481
- destroyKeyboardListeners: function() {
482
- $(document).off('keydown',null);
483
- },
484
-
485
- setupMarkup: function() {
486
- $('html').addClass('jPanelMenu');
487
- $('body > *').not(jP.menu + ', ' + jP.options.excludedPanelContent).wrapAll('<div class="' + jP.panel.replace('.','') + '"/>');
488
- $(jP.options.menu).clone().attr('id', jP.menu.replace('#','')).insertAfter('body > ' + jP.panel);
489
- },
490
-
491
- resetMarkup: function() {
492
- $('html').removeClass('jPanelMenu');
493
- $('body > ' + jP.panel + ' > *').unwrap();
494
- $(jP.menu).remove();
495
- },
496
-
497
- init: function() {
498
- jP.options.beforeOn();
499
-
500
- jP.initiateClickListeners();
501
- if ( Object.prototype.toString.call(jP.options.keyboardShortcuts) === '[object Array]' ) { jP.initiateKeyboardListeners(); }
502
-
503
- jP.setjPanelMenuStyles();
504
- jP.setMenuState(false);
505
- jP.setupMarkup();
506
-
507
- jP.setMenuStyle({ width: jP.options.openPosition });
508
-
509
- jP.checkFixedChildren();
510
- jP.setPositionUnits();
511
-
512
- jP.closeMenu(false);
513
-
514
- jP.options.afterOn();
515
- },
516
-
517
- destroy: function() {
518
- jP.options.beforeOff();
519
-
520
- jP.closeMenu();
521
- jP.destroyClickListeners();
522
- if ( Object.prototype.toString.call(jP.options.keyboardShortcuts) === '[object Array]' ) { jP.destroyKeyboardListeners(); }
523
-
524
- jP.resetMarkup();
525
- var childrenStyles = {};
526
- childrenStyles[jP.options.direction] = 'auto';
527
- $(jP.fixedChildren).each(function(){ $(this).css(childrenStyles); });
528
- jP.fixedChildren = [];
529
-
530
- jP.options.afterOff();
531
- }
532
- };
533
-
534
- return {
535
- on: jP.init,
536
- off: jP.destroy,
537
- trigger: jP.triggerMenu,
538
- open: jP.openMenu,
539
- close: jP.closeMenu,
540
- isOpen: jP.menuIsOpen,
541
- menu: jP.menu,
542
- getMenu: function() { return $(jP.menu); },
543
- panel: jP.panel,
544
- getPanel: function() { return $(jP.panel); }
545
- };
546
- };
547
- })(jQuery);