empresaula-assets 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ // = require jquery
2
+ // = require jquery.placeholder
3
+ // = require_tree ./empresaula
@@ -0,0 +1,3 @@
1
+ $(function(){
2
+ $('input[placeholder], textarea[placeholder]').placeholder();
3
+ });
@@ -1,3 +1,9 @@
1
1
  @import empresaula/base
2
2
  @import empresaula/typography
3
3
  @import empresaula/buttons
4
+ @import empresaula/forms
5
+
6
+ +empresaula-typography
7
+
8
+ form
9
+ +empresaula-form
@@ -1,3 +1,7 @@
1
+ @import "compass/css3/border-radius"
2
+ @import "compass/css3/box-shadow"
3
+ @import "compass/css3/text-shadow"
4
+
1
5
  @mixin big-button($color: $dark-gray)
2
6
 
3
7
  display: inline-block
@@ -6,6 +10,8 @@
6
10
  background: $color
7
11
  cursor: pointer
8
12
 
13
+ font-weight: bold
14
+
9
15
  @if lightness($color) > 50
10
16
  +single-text-shadow(lighten($color, 20%), 0px, 1px, 0px)
11
17
  color: $font-color
@@ -13,6 +19,8 @@
13
19
  +single-text-shadow(darken($color, 30%), 0px, -1px, 0px)
14
20
  color: #fff
15
21
 
22
+ text-transform: uppercase
23
+
16
24
  +border-radius(3px)
17
25
 
18
26
  border: 1px solid transparent
@@ -0,0 +1,97 @@
1
+ @import "compass/utilities/general/clearfix"
2
+ @import "compass/css3/box-sizing"
3
+
4
+ $form-label-width: 40%
5
+ $form-input-width: 100% - $form-label-width
6
+
7
+ @mixin empresaula-fieldset
8
+ display: block
9
+ margin-top: 35px
10
+ legend
11
+ text-align: left
12
+ width: 500px
13
+ padding-bottom: 25px
14
+ line-height: 36px
15
+ font-family: "Museo"
16
+ letter-spacing: -1px
17
+ font-size: 1.8em
18
+ font-weight: bold
19
+ color: $light-red
20
+ &.full
21
+ width: 100%
22
+
23
+ @mixin empresaula-form
24
+ text-align: right
25
+
26
+ label
27
+ display: block
28
+ float: left
29
+ width: $form-label-width
30
+ color: $dark-gray
31
+ padding-top: 5px
32
+ font-weight: bold
33
+
34
+ input, textarea
35
+ +box-sizing(border-box)
36
+ margin: 0px
37
+ padding: 6px
38
+ border: 2px solid darken($light-gray, 7%)
39
+ font-size: 1.1em
40
+ outline: none
41
+ &:focus
42
+ border-color: $light-blue
43
+ +border-radius(3px)
44
+ color: $dark-gray
45
+
46
+ .input
47
+ text-align: left
48
+ +pie-clearfix
49
+ margin: 15px 0px
50
+ input, textarea
51
+ width: $form-input-width
52
+ &.radio_buttons
53
+ input
54
+ width: auto
55
+ display: inline
56
+ .radio
57
+ margin-right: 20px
58
+ input
59
+ margin-right: 3px
60
+ label
61
+ float: none
62
+ display: inline
63
+
64
+ &.boolean
65
+ margin-left: $form-label-width
66
+ label, input
67
+ display: inline
68
+ float: none
69
+ width: auto
70
+
71
+ .field_with_errors
72
+ input, textarea
73
+ &, &:focus
74
+ border-color: $light-red
75
+ span.error
76
+ display: block
77
+ clear: both
78
+ color: $light-red
79
+ font-style: italic
80
+ margin-left: $form-label-width
81
+
82
+ fieldset
83
+ +empresaula-fieldset
84
+
85
+ .hint
86
+ margin-left: $form-label-width
87
+ +pie-clearfix
88
+ color: lighten($font-color, 20%)
89
+ float: left
90
+ padding-top: 3px
91
+
92
+ input[type=checkbox]
93
+ width: auto
94
+
95
+ *[type=submit]
96
+ +big-button($light-green)
97
+ font-size: 1em
@@ -1,26 +1,37 @@
1
+ $header-color: $light-red !default
2
+ $blueprint-font-size: 14px
3
+
4
+ $link-color: $dark-blue
5
+ $link-visited-color: $link-color
6
+ $link-hover-color: $link-color
7
+ $link-active-color: $link-color
8
+
1
9
  @import blueprint/typography
2
10
 
3
- +blueprint-typography
11
+ @mixin empresaula-typography
12
+
13
+ +blueprint-typography
4
14
 
5
- body
6
- h1, h2, h3
7
- font-family: "Museo"
15
+ body
16
+ h1, h2, h3
17
+ font-family: "Museo"
18
+ letter-spacing: -1px
8
19
 
9
- h1, h2
10
- font-weight: bold
20
+ h1, h2
21
+ font-weight: bold
11
22
 
12
- h1
13
- margin-top: 0px
14
- padding-bottom: 0.1em
23
+ h1
24
+ margin-top: 0px
25
+ padding-bottom: 0.1em
15
26
 
16
- h2
17
- margin-top: 1em
18
- margin-bottom: 0.3em
27
+ h2
28
+ margin-top: 1em
29
+ margin-bottom: 0.3em
19
30
 
20
- h3
21
- margin-top: 1em
22
- margin-bottom: 0.8em
31
+ h3
32
+ margin-top: 1em
33
+ margin-bottom: 0.8em
23
34
 
24
- p
25
- margin-top: 1em
26
- margin-bottom: 1em
35
+ p
36
+ margin-top: 1em
37
+ margin-bottom: 1em
@@ -4,5 +4,3 @@ $light-red: #ea534a
4
4
  $dark-gray: #373737
5
5
  $light-green: #c2c85d
6
6
  $light-gray: #ebe4de
7
-
8
- $blueprint-font-size: 14px !default
@@ -2,6 +2,6 @@ module EmpresaulaHelper
2
2
  # Use it in your views to automatically add the favicon header tag
3
3
  #
4
4
  def favicon
5
- tag :link, rel: 'shortcut icon', href: asset_path('favicon.png')
5
+ tag :link, rel: 'shortcut icon', href: asset_path('empresaula/favicon.png')
6
6
  end
7
7
  end
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  # s.add_development_dependency "rspec"
22
22
  s.add_runtime_dependency "railties"
23
23
  s.add_runtime_dependency "compass-rails"
24
+ s.add_runtime_dependency "jquery-rails"
24
25
 
25
26
  s.add_development_dependency 'rails'
26
27
  end
@@ -1,5 +1,6 @@
1
1
  require 'rails'
2
2
  require 'compass-rails'
3
+ require 'jquery-rails'
3
4
 
4
5
  module Empresaula::Assets
5
6
  class Railtie < Rails::Engine
@@ -1,5 +1,5 @@
1
1
  module Empresaula
2
2
  module Assets
3
- VERSION = "0.1.4"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -0,0 +1,106 @@
1
+ /*
2
+ * Placeholder plugin for jQuery
3
+ * ---
4
+ * Copyright 2010, Daniel Stocks (http://webcloud.se)
5
+ * Released under the MIT, BSD, and GPL Licenses.
6
+ */
7
+ (function($) {
8
+ function Placeholder(input) {
9
+ this.input = input;
10
+ if (input.attr('type') == 'password') {
11
+ this.handlePassword();
12
+ }
13
+ // Prevent placeholder values from submitting
14
+ $(input[0].form).submit(function() {
15
+ if (input.hasClass('placeholder') && input[0].value == input.attr('placeholder')) {
16
+ input[0].value = '';
17
+ }
18
+ });
19
+ }
20
+ Placeholder.prototype = {
21
+ show : function(loading) {
22
+ // FF and IE saves values when you refresh the page. If the user refreshes the page with
23
+ // the placeholders showing they will be the default values and the input fields won't be empty.
24
+ if (this.input[0].value === '' || (loading && this.valueIsPlaceholder())) {
25
+ if (this.isPassword) {
26
+ try {
27
+ this.input[0].setAttribute('type', 'text');
28
+ } catch (e) {
29
+ this.input.before(this.fakePassword.show()).hide();
30
+ }
31
+ }
32
+ this.input.addClass('placeholder');
33
+ this.input[0].value = this.input.attr('placeholder');
34
+ }
35
+ },
36
+ hide : function() {
37
+ if (this.valueIsPlaceholder() && this.input.hasClass('placeholder')) {
38
+ this.input.removeClass('placeholder');
39
+ this.input[0].value = '';
40
+ if (this.isPassword) {
41
+ try {
42
+ this.input[0].setAttribute('type', 'password');
43
+ } catch (e) { }
44
+ // Restore focus for Opera and IE
45
+ this.input.show();
46
+ this.input[0].focus();
47
+ }
48
+ }
49
+ },
50
+ valueIsPlaceholder : function() {
51
+ return this.input[0].value == this.input.attr('placeholder');
52
+ },
53
+ handlePassword: function() {
54
+ var input = this.input;
55
+ input.attr('realType', 'password');
56
+ this.isPassword = true;
57
+ // IE < 9 doesn't allow changing the type of password inputs
58
+ if ($.browser.msie && input[0].outerHTML) {
59
+ var fakeHTML = $(input[0].outerHTML.replace(/type=(['"])?password\1/gi, 'type=$1text$1'));
60
+ this.fakePassword = fakeHTML.val(input.attr('placeholder')).addClass('placeholder').focus(function() {
61
+ input.trigger('focus');
62
+ $(this).hide();
63
+ });
64
+ $(input[0].form).submit(function() {
65
+ fakeHTML.remove();
66
+ input.show()
67
+ });
68
+ }
69
+ }
70
+ };
71
+ var NATIVE_SUPPORT = !!("placeholder" in document.createElement( "input" ));
72
+ $.fn.placeholder = function() {
73
+ return NATIVE_SUPPORT ? this : this.each(function() {
74
+ var input = $(this);
75
+ var placeholder = new Placeholder(input);
76
+ placeholder.show(true);
77
+ input.focus(function() {
78
+ placeholder.hide();
79
+ });
80
+ input.blur(function() {
81
+ placeholder.show(false);
82
+ });
83
+
84
+ // On page refresh, IE doesn't re-populate user input
85
+ // until the window.onload event is fired.
86
+ if ($.browser.msie) {
87
+ $(window).load(function() {
88
+ if(input.val()) {
89
+ input.removeClass("placeholder");
90
+ }
91
+ placeholder.show(true);
92
+ });
93
+ // What's even worse, the text cursor disappears
94
+ // when tabbing between text inputs, here's a fix
95
+ input.focus(function() {
96
+ if(this.value == "") {
97
+ var range = this.createTextRange();
98
+ range.collapse(true);
99
+ range.moveStart('character', 0);
100
+ range.select();
101
+ }
102
+ });
103
+ }
104
+ });
105
+ }
106
+ })(jQuery);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: empresaula-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &2156580020 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,31 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156580020
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: compass-rails
27
- requirement: &2156577880 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: jquery-rails
48
+ requirement: !ruby/object:Gem::Requirement
28
49
  none: false
29
50
  requirements:
30
51
  - - ! '>='
@@ -32,10 +53,15 @@ dependencies:
32
53
  version: '0'
33
54
  type: :runtime
34
55
  prerelease: false
35
- version_requirements: *2156577880
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
36
62
  - !ruby/object:Gem::Dependency
37
63
  name: rails
38
- requirement: &2156576440 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
39
65
  none: false
40
66
  requirements:
41
67
  - - ! '>='
@@ -43,7 +69,12 @@ dependencies:
43
69
  version: '0'
44
70
  type: :development
45
71
  prerelease: false
46
- version_requirements: *2156576440
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
47
78
  description: Assets needed to build empresaula third-party apps
48
79
  email:
49
80
  - josepjaume@gmail.com
@@ -62,10 +93,13 @@ files:
62
93
  - app/assets/images/empresaula/icon.png
63
94
  - app/assets/images/empresaula/logo-color.png
64
95
  - app/assets/images/empresaula/logo.png
96
+ - app/assets/javascripts/empresaula.js
97
+ - app/assets/javascripts/empresaula/placeholder.js
65
98
  - app/assets/stylesheets/_empresaula.sass
66
99
  - app/assets/stylesheets/empresaula/_base.sass
67
100
  - app/assets/stylesheets/empresaula/_buttons.sass
68
101
  - app/assets/stylesheets/empresaula/_fonts.sass
102
+ - app/assets/stylesheets/empresaula/_forms.sass
69
103
  - app/assets/stylesheets/empresaula/_typography.sass
70
104
  - app/assets/stylesheets/empresaula/_variables.sass
71
105
  - app/helpers/empresaula_helper.rb
@@ -73,6 +107,7 @@ files:
73
107
  - lib/empresaula-assets.rb
74
108
  - lib/empresaula-assets/railtie.rb
75
109
  - lib/empresaula-assets/version.rb
110
+ - vendor/assets/jquery.placeholder/jquery.placeholder.js
76
111
  homepage: ''
77
112
  licenses: []
78
113
  post_install_message:
@@ -85,21 +120,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
85
120
  - - ! '>='
86
121
  - !ruby/object:Gem::Version
87
122
  version: '0'
88
- segments:
89
- - 0
90
- hash: -18416298093414579
91
123
  required_rubygems_version: !ruby/object:Gem::Requirement
92
124
  none: false
93
125
  requirements:
94
126
  - - ! '>='
95
127
  - !ruby/object:Gem::Version
96
128
  version: '0'
97
- segments:
98
- - 0
99
- hash: -18416298093414579
100
129
  requirements: []
101
130
  rubyforge_project: empresaula-assets
102
- rubygems_version: 1.8.15
131
+ rubygems_version: 1.8.21
103
132
  signing_key:
104
133
  specification_version: 3
105
134
  summary: Assets needed to build empresaula third-party apps