ultimate-base 0.4.0.1 → 0.4.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ultimate-base (0.4.0.1)
4
+ ultimate-base (0.4.1.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -25,12 +25,12 @@ class Ultimate.Backbone.Views.Slider extends Ultimate.Backbone.View
25
25
  interval: 0
26
26
  durationPerPixel: 2
27
27
  moveItems: 0
28
- prevItems: 0
29
- itemSize: 0
30
28
 
31
29
  totalItems: 0
30
+ itemSize: 0
32
31
  displayItems: 0
33
32
  overItems: 0
33
+ prevItems: 0 # can as setting
34
34
 
35
35
  timeoutId: null # for cycling == true
36
36
  startSide: "left" # set by @vertical
@@ -43,7 +43,7 @@ class Ultimate.Backbone.Views.Slider extends Ultimate.Backbone.View
43
43
  if @totalItems
44
44
  @jItems.each (index) -> $(@).attr "data-slide-index", index
45
45
  jFirstItem = @jItems.first()
46
- @itemSize ||= jFirstItem[_.string.camelize("outer-#{@sizeAttr}")](true)
46
+ @itemSize = jFirstItem[_.string.camelize("outer-#{@sizeAttr}")](true)
47
47
  needSize = @totalItems * @itemSize
48
48
  @jLine[@sizeAttr](needSize) if @jLine[@sizeAttr]() < needSize
49
49
  @displayItems = Math.round(@jDisplay[@sizeAttr]() / @itemSize)
@@ -60,17 +60,8 @@ class Ultimate.Backbone.Views.Slider extends Ultimate.Backbone.View
60
60
  @prevItems = 0
61
61
  #@bus().trigger "slider:slide", 0, @prevItems, jItems.eq(@prevItems)
62
62
 
63
- _getItemByIndex: (index) ->
64
- @jItems.filter -> $(@).data('slideIndex') is index
65
-
66
- _getItemByDomIndex: (index) ->
67
- @jLine.find(".item:eq(#{index})")
68
-
69
- _getIndexOf: (jItem) ->
70
- jItem.data('slideIndex')
71
-
72
63
  currentIndex: ->
73
- @_getIndexOf @_getItemByDomIndex(@prevItems)
64
+ @jLine.find(".item:eq(#{@prevItems})").data("slideIndex")
74
65
 
75
66
  trySlide: (move = 1, moveItems = move * @moveItems) ->
76
67
  if @totalItems and @overItems
@@ -1,8 +1,5 @@
1
1
  ###
2
- * front-end js helpers
3
- * 0.3.3.alpha / 2010-2011
4
- * Karpunin Dmitry / Evrone.com
5
- * koderfunk_at_gmail_dot_com
2
+ * global front-end js helpers
6
3
  ###
7
4
 
8
5
  @DEBUG_MODE ?= false
@@ -31,12 +28,6 @@
31
28
  if @LOG_TODO
32
29
  @cout 'warn', "TODO: #{subject}#{if location then " ### #{location}" else ''}#{if numberOrString then (if _.isNumber(numberOrString) then ":#{numberOrString}" else " > #{numberOrString}") else ''}"
33
30
 
34
- @args = (a) ->
35
- @deprecate 'arg()', '_.toArray()'
36
- r = []
37
- Array::push.apply(r, a) if a.length > 0
38
- r
39
-
40
31
  @logicalXOR = (a, b) ->
41
32
  ( a and not b ) or ( not a and b )
42
33
 
@@ -64,59 +55,3 @@
64
55
  ah[0] = ad.join('.')
65
56
  aq[0] = ah.join('#')
66
57
  aq.join('?')
67
-
68
-
69
-
70
- ########### Deprecated ###########
71
-
72
- # Helper function to get a value from a object as a property or as a function.
73
- @getValue = (object, prop) ->
74
- @deprecate "getValue()", "_.result()"
75
- return null unless object and object[prop]
76
- return if _.isFunction(object[prop]) then object[prop]() else object[prop]
77
-
78
- @isset = (obj) =>
79
- @deprecate 'isset(obj)', '_.isUndefined(obj) OR "obj isnt undefined" OR "obj?'
80
- obj isnt undefined
81
-
82
- @isString = (v) =>
83
- @deprecate 'isString(v)', '_.isString(v)'
84
- _.isString v
85
-
86
- @isNumber = (v) =>
87
- @deprecate 'isNumber(v)', '_.isNumber(v)'
88
- not isNaN(parseInt(v))
89
-
90
- @isJQ = (obj) ->
91
- @deprecate 'isJQ(obj)', 'obj instanceof jQuery'
92
- _.isObject(obj) and _.isString(obj.jquery)
93
-
94
- @uniq = (arrOrString) ->
95
- @deprecate 'uniq(a)', '_.uniq(a)'
96
- isStr = _.isString(arrOrString)
97
- return arrOrString unless isStr or _.isArray(arrOrString)
98
- r = []
99
- r.push(e) for e in arrOrString when not _.include(r, e)
100
- if isStr then r.join('') else r
101
-
102
- @regexpSpace = /^\s*$/
103
- @regexpTrim = /^\s*(.*?)\s*$/
104
-
105
- @strTrim = (s) =>
106
- @deprecate "strTrim(s)", "_.trim(s)"
107
- s.match(@regexpTrim)[1]
108
-
109
-
110
-
111
- @rails_data = {}
112
-
113
- @rails_scope = (controller_name, action_name, scopedCloasure = null, scopedCloasureArguments...) =>
114
- @deprecate 'rails_scope'
115
- return false if _.isString(controller_name) and controller_name isnt @rails_data['controller_name']
116
- return false if _.isString(action_name) and action_name isnt @rails_data['action_name']
117
- if _.isFunction(scopedCloasure)
118
- arguments[2] scopedCloasureArguments...
119
- true
120
-
121
- $ =>
122
- @rails_data = $('body').data()
@@ -62,24 +62,3 @@ do ($ = jQuery) =>
62
62
  matches = content.match($.regexp.HTML)
63
63
  return false unless matches?
64
64
  not strong or matches[1] is matches[2]
65
-
66
- # TODO replace usages to underscore methods and using distribution
67
- unless $.isRegExp
68
- $.isRegExp = (candidate) ->
69
- deprecate '$.isRegExp', '_.isRegExp'
70
- typeof candidate is "object" and typeof candidate.test is "function"
71
-
72
- unless $.isBoolean
73
- $.isBoolean = (v) ->
74
- deprecate '$.isBoolean', '_.isBoolean'
75
- typeof v is "boolean"
76
-
77
- unless $.isString
78
- $.isString = (v) ->
79
- deprecate '$.isString', '_.isString'
80
- typeof v is "string"
81
-
82
- if typeof $.isEmptyString is "undefined"
83
- $.isEmptyString = (v) ->
84
- deprecate '$.isEmptyString', '_.isBlank'
85
- regexpSpace.test v
@@ -22,7 +22,6 @@ $boxsizing-url: asset-url("polyfills/boxsizing.htc", '') !default;
22
22
 
23
23
  @import "ultimate/mixins/vendors";
24
24
  @import "ultimate/mixins/routines";
25
- @import "ultimate/mixins/css3/text-shadow";
26
25
 
27
26
  // Round all corners by a specific amount.
28
27
  // example:
@@ -160,12 +159,19 @@ $boxsizing-url: asset-url("polyfills/boxsizing.htc", '') !default;
160
159
  $p: $p + $percents-by-stop;
161
160
  }
162
161
  $bg-color: nth(nth($stops, 1), 1);
163
- background-color: $bg-color;
162
+ // TODO: need check all color stops
163
+ @if alpha($bg-color) == 1 {
164
+ background-color: $bg-color;
165
+ }
164
166
  background-image: -webkit-gradient(linear, $wk_start, $wk_end, $wk_stops);
165
167
  $linear-gradient: linear-gradient($corner_angle, change-separator($stops));
166
168
  @include vendors-param(webkit moz ms o, background-image, $linear-gradient);
167
169
  @if $support-ie and $pie-url {
168
- -pie-background: $bg-color $linear-gradient;
170
+ @if alpha($bg-color) == 1 {
171
+ -pie-background: $bg-color $linear-gradient;
172
+ } else {
173
+ -pie-background: $linear-gradient;
174
+ }
169
175
  }
170
176
  }
171
177
 
@@ -247,7 +253,7 @@ $boxsizing-url: asset-url("polyfills/boxsizing.htc", '') !default;
247
253
  // For rgba()
248
254
  @mixin pie-bg($bg) {
249
255
  background: $bg;
250
- @if $support-ie and $pie-url and type-of($bg) == "color" and alpha($bg) < 1 {
256
+ @if $support-ie and $pie-url and type-of($bg) == color and alpha($bg) < 1 {
251
257
  -pie-background: $bg;
252
258
  }
253
259
  }
@@ -260,7 +266,7 @@ $boxsizing-url: asset-url("polyfills/boxsizing.htc", '') !default;
260
266
  // -o-text-overflow: ellipsis; // Opera Mini and Opera Mobile
261
267
  // text-overflow: ellipsis; // all
262
268
  @mixin ellipsis($overflow: hidden, $nowrap: true) {
263
- @if $overflow != false {
269
+ @if isset($overflow) {
264
270
  overflow: $overflow;
265
271
  }
266
272
  @if $nowrap {
@@ -346,5 +352,6 @@ $boxsizing-url: asset-url("polyfills/boxsizing.htc", '') !default;
346
352
  @mixin input-placeholder {
347
353
  &::-webkit-input-placeholder { @content; }
348
354
  &:-moz-placeholder { @content; }
355
+ &::-moz-placeholder { @content; }
349
356
  &:-ms-input-placeholder { @content; }
350
357
  }
@@ -4,11 +4,6 @@ $font-family_base: Tahoma, Verdana, sans-serif;
4
4
  $font-size_base: 11px;
5
5
  $font-family_custom: "PFDinTextCondProThin", Tahoma, Arial, Verdana, sans-serif;
6
6
  $font-family_custom_bold: "PFDinTextCondProRegular", Verdana, sans-serif;
7
- // DEPRECATED:
8
- $line-height-addition_base: 3px;
9
- $font-family_accident: "PFDinTextCondProThin", Tahoma, Arial, Verdana, sans-serif;
10
- $font-family_accident_bold: "PFDinTextCondProRegular", Verdana, sans-serif;
11
-
12
7
 
13
8
  @mixin font-face($family, $url-without-ext, $font-weight: normal, $font-style: normal) {
14
9
  @font-face {
@@ -33,68 +28,14 @@ $font-family_accident_bold: "PFDinTextCondProRegular", Verdana, sans-serif;
33
28
  }
34
29
  }
35
30
 
36
- @mixin g-font_base($font-size: $font-size_base, $line-height: false) {
37
- @include deprecate("g-font_base", "font_base");
38
- font-family: $font-family_base;
39
- @if $font-size {
40
- font-size: $font-size;
41
- }
42
- @if $line-height {
43
- line-height: $line-height;
44
- } @else {
45
- @if $font-size {
46
- line-height: $font-size + $line-height-addition_base;
47
- }
48
- }
49
- }
50
-
51
31
  @mixin font_base($font-size: $font-size_base, $line-height: false) {
52
32
  @include font($font-family_base, $font-size, $line-height);
53
33
  }
54
34
 
55
- @mixin font_custom($font-size: false, $line-height: false, $font-family: $font-family_custom) {
56
- font-weight: normal;
57
- font-style: normal;
58
- @include font($font-family, $font-size, $line-height);
59
- }
60
-
61
35
  // TODO http://paulirish.com/2010/font-face-gotchas/
62
36
  // TODO -webkit-font-smoothing: antialiased; /* This needs to be set or some font faced fonts look bold on Mac. */
63
- @mixin g-font_accident_bold($font-size: false, $line-height: false) {
64
- @include deprecate("g-font_accident_bold", "font_custom");
65
- font-family: $font-family_accident_bold;
66
- font-weight: normal;
67
- font-style: normal;
68
- @if $font-size {
69
- font-size: $font-size;
70
- }
71
- @if $line-height {
72
- line-height: $line-height;
73
- } @else {
74
- @if $font-size {
75
- line-height: $font-size + $line-height-addition_base;
76
- }
77
- }
78
- }
79
-
80
- @mixin g-font_accident($font-size: false, $line-height: false) {
81
- @include deprecate("g-font_accident", "font_custom");
82
- font-family: $font-family_accident;
37
+ @mixin font_custom($font-size: false, $line-height: false, $font-family: $font-family_custom) {
83
38
  font-weight: normal;
84
39
  font-style: normal;
85
- @if $font-size {
86
- font-size: $font-size;
87
- }
88
- @if $line-height {
89
- line-height: $line-height;
90
- } @else {
91
- @if $font-size {
92
- line-height: $font-size + $line-height-addition_base;
93
- }
94
- }
95
- @if $font-family_accident_bold {
96
- .bold {
97
- @include g-font_accident_bold;
98
- }
99
- }
40
+ @include font($font-family, $font-size, $line-height);
100
41
  }
@@ -114,16 +114,6 @@ $support-ie: true !default;
114
114
  }
115
115
  }
116
116
 
117
- // Set to container includes float blocks.
118
- @mixin g-line($clear: both) {
119
- @include deprecate("@include g-line;", "overflow: hidden;");
120
- @if $support-ie {
121
- *zoom: 1;
122
- _height: 0;
123
- }
124
- @include clearfix($clear);
125
- }
126
-
127
117
  // Adapted from: [A new micro clearfix hack](http://nicolasgallagher.com/micro-clearfix-hack/)
128
118
  @mixin clearfix($clear: both) {
129
119
  @include both(table) {
@@ -131,13 +121,6 @@ $support-ie: true !default;
131
121
  }
132
122
  }
133
123
 
134
- // Set to element which disappear after animation in IE6-7.
135
- @mixin fix-disapp {
136
- @include deprecate("@include fix-disapp;");
137
- *overflow: hidden;
138
- _zoom: 1;
139
- }
140
-
141
124
  // Provides a cross-browser method to implement `display: inline-block;`
142
125
  // example:
143
126
  // @include inline-block(80px, 20px);
@@ -154,18 +137,19 @@ $support-ie: true !default;
154
137
  *display: inline;
155
138
  *zoom: 1;
156
139
  }
157
- @if $width != none and $width != false {
140
+ @if isset($width) {
158
141
  width: $width;
159
142
  }
160
- @if $height != none and $height != false {
143
+ @if isset($height) {
161
144
  height: $height;
162
145
  }
163
- @if $vertical-align != none and $vertical-align != false {
146
+ @if isset($vertical-align) {
164
147
  vertical-align: $vertical-align;
165
148
  }
166
149
  }
167
150
 
168
- @mixin g-justify($item: unquote(".item")) {
151
+ // TODO: rename to "justify"
152
+ @mixin g-justify($item: ".item") {
169
153
  text-align: justify;
170
154
  @if $support-ie {
171
155
  text-justify: newspaper;
@@ -195,7 +179,7 @@ $support-ie: true !default;
195
179
  }
196
180
 
197
181
  @mixin block-list($item: "li") {
198
- overflow: hidden; // @include g-line;
182
+ overflow: hidden;
199
183
  position: relative;
200
184
  list-style: none;
201
185
  margin: 0;
@@ -1,5 +1,5 @@
1
1
  module Ultimate
2
2
  module Base
3
- VERSION = '0.4.0.1'
3
+ VERSION = '0.4.1.0'
4
4
  end
5
5
  end
@@ -9,7 +9,6 @@ test "EmptyPlugin", ->
9
9
  $('#qunit-fixture').html '<div class="test-plugin"><div class="test-plugin__inner"></div></div>'
10
10
  plugin = new EmptyPlugin(el: '.test-plugin')
11
11
 
12
- throws (-> new EmptyPlugin), "plugin can't build without `el` as option"
13
12
  ok /^ultimatePlugin_\d+$/.test(plugin.cid)
14
13
  ok plugin.$el.length is 1
15
14
  jDiv = plugin.$('div')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultimate-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.1
4
+ version: 0.4.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-23 00:00:00.000000000 Z
12
+ date: 2013-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -110,7 +110,6 @@ files:
110
110
  - app/assets/stylesheets/ultimate/mixins/_vendors.scss
111
111
  - app/assets/stylesheets/ultimate/mixins/css3.scss
112
112
  - app/assets/stylesheets/ultimate/mixins/css3/_text-shadow.scss
113
- - app/assets/stylesheets/ultimate/mixins/decor.scss
114
113
  - app/assets/stylesheets/ultimate/mixins/fonts.scss
115
114
  - app/assets/stylesheets/ultimate/mixins/microstructures.scss
116
115
  - app/assets/stylesheets/ultimate/structures/slider.scss
@@ -202,8 +201,68 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
201
  version: '0'
203
202
  requirements: []
204
203
  rubyforge_project: ultimate-base
205
- rubygems_version: 1.8.24
204
+ rubygems_version: 1.8.25
206
205
  signing_key:
207
206
  specification_version: 3
208
207
  summary: Ultimate UI core, base helpers and improves for Ruby on Rails Front-end
209
- test_files: []
208
+ test_files:
209
+ - test/dummy/Rakefile
210
+ - test/dummy/_emfile
211
+ - test/dummy/app/assets/images/.gitkeep
212
+ - test/dummy/app/assets/javascripts/application.js
213
+ - test/dummy/app/assets/stylesheets/application.css
214
+ - test/dummy/app/assets/stylesheets/global/forms.css.scss
215
+ - test/dummy/app/assets/stylesheets/global/layout.css.scss
216
+ - test/dummy/app/assets/stylesheets/global/layout/footer.scss
217
+ - test/dummy/app/assets/stylesheets/global/layout/header.scss
218
+ - test/dummy/app/assets/stylesheets/global/layout/main-menu.scss
219
+ - test/dummy/app/assets/stylesheets/global/reserved.css.scss
220
+ - test/dummy/app/assets/stylesheets/global/reset.css.scss
221
+ - test/dummy/app/assets/stylesheets/global/structures.css.scss
222
+ - test/dummy/app/assets/stylesheets/import/base.scss
223
+ - test/dummy/app/assets/stylesheets/plugins/qunit.css.scss
224
+ - test/dummy/app/controllers/application_controller.rb
225
+ - test/dummy/app/controllers/main_controller.rb
226
+ - test/dummy/app/helpers/application_helper.rb
227
+ - test/dummy/app/mailers/.gitkeep
228
+ - test/dummy/app/models/.gitkeep
229
+ - test/dummy/app/views/application/_footer.html.haml
230
+ - test/dummy/app/views/application/_header.html.haml
231
+ - test/dummy/app/views/application/_main_menu.html.haml
232
+ - test/dummy/app/views/layouts/application.html.haml
233
+ - test/dummy/app/views/main/index.html.haml
234
+ - test/dummy/app/views/main/qunit.html.haml
235
+ - test/dummy/app/views/main/styles.html.haml
236
+ - test/dummy/config.ru
237
+ - test/dummy/config/application.rb
238
+ - test/dummy/config/boot.rb
239
+ - test/dummy/config/database.yml
240
+ - test/dummy/config/environment.rb
241
+ - test/dummy/config/environments/development.rb
242
+ - test/dummy/config/environments/production.rb
243
+ - test/dummy/config/environments/test.rb
244
+ - test/dummy/config/initializers/backtrace_silencers.rb
245
+ - test/dummy/config/initializers/inflections.rb
246
+ - test/dummy/config/initializers/mime_types.rb
247
+ - test/dummy/config/initializers/qunit-rails.rb
248
+ - test/dummy/config/initializers/secret_token.rb
249
+ - test/dummy/config/initializers/session_store.rb
250
+ - test/dummy/config/initializers/wrap_parameters.rb
251
+ - test/dummy/config/locales/en.yml
252
+ - test/dummy/config/routes.rb
253
+ - test/dummy/log/.gitkeep
254
+ - test/dummy/public/404.html
255
+ - test/dummy/public/422.html
256
+ - test/dummy/public/500.html
257
+ - test/dummy/public/favicon.ico
258
+ - test/dummy/script/rails
259
+ - test/javascripts/all_tests.js.coffee
260
+ - test/javascripts/test_helper.js.coffee
261
+ - test/javascripts/tests/base_test.js.coffee
262
+ - test/javascripts/tests/helpers_test.js.coffee
263
+ - test/javascripts/tests/improves/i18n-lite_test.js.coffee
264
+ - test/javascripts/tests/jquery-plugin-adapter_test.js.coffee
265
+ - test/javascripts/tests/jquery-plugin-class_test.js.coffee
266
+ - test/javascripts/tests/underscore/underscore.outcasts.test.js.coffee
267
+ - test/stylesheets/styles_test.css.scss
268
+ - test/stylesheets/test_helper.css
@@ -1,86 +0,0 @@
1
- @mixin g-decor_state($offset, $sprite-offset, $state-index: 1) {
2
- $state-offset: $offset + $sprite-offset * 3 * $state-index;
3
- > .fill {
4
- background-position: center (0 - $state-offset) !important;
5
- }
6
- > .left {
7
- background-position: left (0 - $state-offset - $sprite-offset) !important;
8
- }
9
- > .right {
10
- background-position: right (0 - $state-offset - $sprite-offset * 2) !important;
11
- }
12
- }
13
-
14
- @mixin g-decor_type($texture, $offset, $sprite-offset, $decor_width: false) {
15
- @if $decor_width {
16
- padding: 0 $decor_width;
17
- > .left, > .right {
18
- width: $decor_width + 1 !important;
19
- }
20
- }
21
- > .fill, > .left, > .right {
22
- background-image: image-url("#{$texture}") !important;
23
- }
24
- @include g_decor_state($offset, $sprite-offset, 0);
25
- }
26
-
27
- @mixin g-decor($decor_width, $texture: false, $offset: 0, $sprite-offset: 0, $height: false) {
28
- position: relative;
29
- white-space: nowrap;
30
- @if $height {
31
- height: $height;
32
- }
33
- > .fill {
34
- display: block;
35
- position: relative;
36
- height: 100%;
37
- }
38
- > .left, > .right {
39
- display: block;
40
- height: 100%;
41
- position: absolute;
42
- top: 0;
43
- }
44
- @if $texture {
45
- @include g_decor_type($texture, $offset, $sprite-offset, $decor_width);
46
- }
47
- > .left {
48
- left: 0;
49
- }
50
- > .right {
51
- right: 0;
52
- }
53
- }
54
-
55
-
56
-
57
- @mixin g-star-decor_state($sprite-offset, $state) {
58
- $offset_top: 0 - ($state * $sprite-offset * 2);
59
- $offset_bottom: $offset_top - $sprite-offset;
60
- > .corner {
61
- &.left.top { background-position: right $offset_bottom; }
62
- &.right.top { background-position: left $offset_bottom; }
63
- &.left.bottom { background-position: right $offset_top; }
64
- &.right.bottom { background-position: left $offset_top; }
65
- }
66
- }
67
-
68
- @mixin g-star-decor($texture, $size, $sprite-offset, $state: 0) {
69
- > .corner {
70
- width: $size;
71
- height: $size;
72
- position: absolute;
73
- background: image-url("#{$texture}") no-repeat;
74
- &.left { left: 0; }
75
- &.right { right: 0; }
76
- &.top {
77
- top: 0;
78
- *top: 1px;
79
- }
80
- &.bottom {
81
- bottom: 0;
82
- *bottom: 1px;
83
- }
84
- }
85
- @include g-star-decor_state($sprite-offset, $state);
86
- }