chr 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/CONTRIBUTING.md +24 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE.md +21 -0
  6. data/README.md +18 -0
  7. data/Rakefile +3 -0
  8. data/app/assets/javascripts/chr.coffee +41 -0
  9. data/app/assets/javascripts/chr/core/_chr.coffee +89 -0
  10. data/app/assets/javascripts/chr/core/_item.coffee +85 -0
  11. data/app/assets/javascripts/chr/core/_list.coffee +154 -0
  12. data/app/assets/javascripts/chr/core/_listReorder.coffee +70 -0
  13. data/app/assets/javascripts/chr/core/_listScroll.coffee +23 -0
  14. data/app/assets/javascripts/chr/core/_listSearch.coffee +28 -0
  15. data/app/assets/javascripts/chr/core/_module.coffee +98 -0
  16. data/app/assets/javascripts/chr/core/_utils.coffee +50 -0
  17. data/app/assets/javascripts/chr/core/_view.coffee +121 -0
  18. data/app/assets/javascripts/chr/form/_form.coffee +205 -0
  19. data/app/assets/javascripts/chr/form/_inputCheckbox.coffee +70 -0
  20. data/app/assets/javascripts/chr/form/_inputColor.coffee +35 -0
  21. data/app/assets/javascripts/chr/form/_inputFile.coffee +82 -0
  22. data/app/assets/javascripts/chr/form/_inputHidden.coffee +41 -0
  23. data/app/assets/javascripts/chr/form/_inputList.coffee +142 -0
  24. data/app/assets/javascripts/chr/form/_inputSelect.coffee +59 -0
  25. data/app/assets/javascripts/chr/form/_inputString.coffee +87 -0
  26. data/app/assets/javascripts/chr/form/_inputText.coffee +23 -0
  27. data/app/assets/javascripts/chr/form/_nestedForm.coffee +164 -0
  28. data/app/assets/javascripts/chr/store/_store.coffee +104 -0
  29. data/app/assets/javascripts/chr/store/_storeRails.coffee +167 -0
  30. data/app/assets/javascripts/chr/vendor/jquery.scrollparent.js +14 -0
  31. data/app/assets/javascripts/chr/vendor/jquery.textarea_autosize.js +55 -0
  32. data/app/assets/javascripts/chr/vendor/jquery.typeahead.js +1782 -0
  33. data/app/assets/javascripts/chr/vendor/slip.js +804 -0
  34. data/app/assets/stylesheets/_chr.scss +7 -0
  35. data/app/assets/stylesheets/core/_icons.scss +124 -0
  36. data/app/assets/stylesheets/core/_list.scss +44 -0
  37. data/app/assets/stylesheets/core/_main.scss +89 -0
  38. data/app/assets/stylesheets/core/_responsive.scss +41 -0
  39. data/app/assets/stylesheets/form/_form.scss +50 -0
  40. data/app/assets/stylesheets/form/_input_checkbox.scss +87 -0
  41. data/app/assets/stylesheets/form/_input_color.scss +10 -0
  42. data/app/assets/stylesheets/form/_input_file.scss +28 -0
  43. data/app/assets/stylesheets/form/_input_list.scss +36 -0
  44. data/app/assets/stylesheets/form/_input_string.scss +8 -0
  45. data/app/assets/stylesheets/form/_input_text.scss +48 -0
  46. data/app/assets/stylesheets/form/_nested_form.scss +26 -0
  47. data/chr.gemspec +34 -0
  48. data/lib/chr.rb +15 -0
  49. data/lib/chr/engine.rb +5 -0
  50. data/lib/chr/version.rb +3 -0
  51. metadata +152 -0
@@ -0,0 +1,10 @@
1
+ /* Color ------------------------------------------------------------------- */
2
+ .input-color {
3
+ position: relative;
4
+ padding-left: 4.75em;
5
+
6
+ .preview {
7
+ @include position(absolute, .65em null null 1em);
8
+ width: 50px; height: 50px; border-radius: 4px; background-color: #eee;
9
+ }
10
+ }
@@ -0,0 +1,28 @@
1
+ /* File & Image ------------------------------------------------------------ */
2
+ .input-file,
3
+ .input-image {
4
+ min-height: 102px; // NOTE: calculated based on image thumbnail size
5
+
6
+ a { color: $positiveColor; @include truncate; }
7
+ a:hover { text-decoration: underline; }
8
+
9
+ input[type=file] { margin-top: .5em; }
10
+ input[type=checkbox] { display: inline; width: auto; margin-right: .5em; margin-left: 1em; }
11
+ label { display: inline; font-size: .8em; }
12
+
13
+ &.empty {
14
+ input[type=file] { margin-top: .2em; }
15
+ }
16
+ }
17
+
18
+ .input-image:not(.empty) {
19
+ padding-left: 6.5em;
20
+ position: relative;
21
+ img {
22
+ position: absolute;
23
+ border-radius: 4px;
24
+ left: 1em;
25
+ top: .8em;
26
+ width: 4.7em;
27
+ }
28
+ }
@@ -0,0 +1,36 @@
1
+ /* List -------------------------------------------------------------------- */
2
+ .input-list {
3
+ input { padding-left: 2em; margin-top: .1em; }
4
+ ul { line-height: 1.5; margin: 0 0 0 2em; list-style: none; padding: 0; }
5
+ ul li { @include user-select-none; position: relative; }
6
+ ul li a { color: $assertiveColor; font-size: .75em; }
7
+
8
+ .slip-reordering { color: $positiveColor; }
9
+
10
+ .icon-reorder {
11
+ width: 25px;
12
+ height: 25px;
13
+ left: -1.75em;
14
+ &:before { left: 0; top: 9px; }
15
+ &:after { left: 0; top: 14px; }
16
+ }
17
+ }
18
+
19
+ .input-list {
20
+ .twitter-typeahead { width: 100%; }
21
+ .twitter-typeahead:after {
22
+ content: '+';
23
+ display: block;
24
+ width: 40px;
25
+ height: 24px;
26
+ position: absolute; left: 12px; top: -3px;
27
+ font-size: 22px;
28
+ color: $contrastColor;
29
+ }
30
+
31
+ .tt-suggestions { padding: .1em .5em; margin: 0 0 0 1.55em; background: rgba(255,255,255, .95); }
32
+ .tt-suggestion { cursor: pointer; opacity: .5;
33
+ p { line-height: 1.5; margin: 0; }
34
+ &.tt-cursor { opacity: 1; }
35
+ }
36
+ }
@@ -0,0 +1,8 @@
1
+ .input-string {
2
+ .twitter-typeahead { width: 100%; }
3
+ .tt-suggestions { padding: .1em .5em; margin: 0 0 0 -.5em; background: rgba(255,255,255, .95); }
4
+ .tt-suggestion { cursor: pointer; opacity: .5;
5
+ p { line-height: 1.5; margin: 0; }
6
+ &.tt-cursor { opacity: 1; }
7
+ }
8
+ }
@@ -0,0 +1,48 @@
1
+ /* CodeMirror --------------------------------------------------------------- */
2
+ .input-html .CodeMirror {
3
+ border: 1px solid $contrastColor;
4
+ height: auto;
5
+ }
6
+
7
+ /* Redactor ---------------------------------------------------------------- */
8
+ .input-redactor {
9
+ .redactor-box { margin-bottom: 0; }
10
+ .redactor-toolbar { box-shadow: none; border-bottom: 2px solid $contrastColor; }
11
+ .redactor-editor { border: 1px solid $contrastColor; border-top: 0; }
12
+ }
13
+
14
+ .redactor-box textarea { background: $white; color: $black; }
15
+
16
+ .redactor-box-fullscreen {
17
+ .redactor-toolbar { box-shadow: none; border-bottom: 2px solid $contrastColor; }
18
+ .redactor-placeholder:after { content: ''; }
19
+ .redactor-editor { padding-bottom: 5em; border: none; }
20
+ }
21
+
22
+ .redactor-placeholder:after { color: $lightColor!important; }
23
+
24
+ /* Modals: Files & Images -------------------------------------------------- */
25
+
26
+ #redactor-modal-close { text-align: center; top: 5px; right: 5px; color: $stableColor; }
27
+ #redactor-modal-close:hover { color: $black; }
28
+
29
+ #redactor-modal header { padding: 1.25em 2em 1.25em; font-size: 14px; }
30
+ #redactor-modal section { padding: .5em 2em 2em; }
31
+
32
+ #redactor-modal-tabber a { border-color: $contrastColor; color: $black; }
33
+ #redactor-modal-tabber a:hover { background-color: $positiveColor; border-color: $positiveColor; color: $white; }
34
+ #redactor-modal-tabber a.active { cursor: default; background-color: $contrastColor; border-color: $contrastColor; color: $black; }
35
+
36
+ #redactor-modal label { margin: 20px 0 5px 0 !important; color: $stableColor; }
37
+ #redactor-modal input[type="text"] { box-shadow: none; border-color: $contrastColor; }
38
+ #redactor-modal input[type="text"]:focus { border-color: $positiveColor; box-shadow: none; }
39
+
40
+ #redactor-modal #redactor-modal-list { overflow: auto; margin: 0; max-height: 374px; }
41
+ #redactor-modal #redactor-modal-list li { border-bottom-color: $contrastColor; }
42
+ #redactor-modal #redactor-modal-list a:hover { background-color: $neutralColor; }
43
+
44
+ #redactor-modal-images-list { overflow: auto; height: 368px; margin: 1.5em 0 0; padding: 0; list-style: none; }
45
+ #redactor-modal-images-list li { float: left; margin: 0 1px 1px 0; width: 75px; height: 75px; display: inline-block; }
46
+
47
+ #redactor-modal-tabber + #redactor-modal-image-droparea { margin-top: 1.5em; }
48
+ #redactor-modal-image-droparea #redactor-droparea { padding: 172px 20px; }
@@ -0,0 +1,26 @@
1
+ /* Nested Form ------------------------------------------------------------- */
2
+ .nested-forms {
3
+ & > .label { margin-bottom: .25em; }
4
+ & > ul { margin: 0; padding: 0; }
5
+ & > ul > li { list-style-type: none; margin-top: 1em; @include position(relative); border: 1px solid $neutralColor; }
6
+ & > ul > li:first-child { margin-top: 0; }
7
+ & > ul > li > .icon-reorder { left: 0; top: 1em; }
8
+ & > ul li.reorderable { background-color: $white; }
9
+ & > ul li.reorderable > .input-stacked:first-child { padding-left: 2.4em; }
10
+ }
11
+
12
+ .nested-form-new {
13
+ color: $positiveColor; margin-top: .75em; display: inline-block; font-size: .9em;
14
+ &:hover { opacity: .5; }
15
+ }
16
+
17
+ .nested-form-delete {
18
+ @include position(absolute, .35em .3em null null); border-radius: 1em;
19
+ @include hide-text; width: 1.5em; height: 1.5em; background-color: rgba(0,0,0,.05);
20
+ &:before { content: '\00d7'; color: $stableColor; line-height: 1.35em; width: 1.5em; text-align: center; }
21
+ &:hover { background-color: $positiveColor; &:before { color: $white; } }
22
+ }
23
+
24
+
25
+
26
+
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'chr/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'chr'
7
+ s.version = Chr::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ['Alexander Kravets']
10
+ s.email = 'alex@slatestudio.com'
11
+ s.license = 'MIT'
12
+ s.homepage = 'http://slatestudio.com'
13
+ s.summary = 'A simple and lightweight library for building data management web apps'
14
+ s.description = <<-DESC
15
+ Character is a library written in CoffeeScript with a help of jQuery that allows to
16
+ build data management web applications like CMS, news reader, email client etc. in a
17
+ very fast and flexible way. It's responsive by default and supports a few data stores
18
+ out of the box: Rails, Firebase and localStorage.
19
+ DESC
20
+
21
+ s.rubyforge_project = 'chr'
22
+
23
+ s.files = `git ls-files`.split("\n")
24
+ s.require_paths = ['lib']
25
+
26
+ s.add_dependency('bourbon', '~> 4.1')
27
+ s.add_dependency('jquery-rails', '~> 4.0')
28
+ s.add_dependency('coffee-rails', '~> 4.1')
29
+ s.add_dependency('normalize-rails', '~> 3.0')
30
+ end
31
+
32
+
33
+
34
+
@@ -0,0 +1,15 @@
1
+ # CodeKit needs relative paths
2
+ dir = File.dirname(__FILE__)
3
+ $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
4
+
5
+ module Chr
6
+ if defined?(Rails) && defined?(Rails::Engine)
7
+ class Engine < ::Rails::Engine
8
+ require 'chr/engine'
9
+ end
10
+ else
11
+ # not a rails project, need to include sass and javascript folders
12
+ #bourbon_path = File.expand_path("../../app/assets/stylesheets", __FILE__)
13
+ #ENV["SASS_PATH"] = [ENV["SASS_PATH"], bourbon_path].compact.join(File::PATH_SEPARATOR)
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ module Chr
2
+ class Engine < Rails::Engine
3
+ # auto wire
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module Chr
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,152 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: chr
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Kravets
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bourbon
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jquery-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '4.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '4.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: coffee-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '4.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '4.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: normalize-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ description: |
70
+ Character is a library written in CoffeeScript with a help of jQuery that allows to
71
+ build data management web applications like CMS, news reader, email client etc. in a
72
+ very fast and flexible way. It's responsive by default and supports a few data stores
73
+ out of the box: Rails, Firebase and localStorage.
74
+ email: alex@slatestudio.com
75
+ executables: []
76
+ extensions: []
77
+ extra_rdoc_files: []
78
+ files:
79
+ - ".gitignore"
80
+ - CONTRIBUTING.md
81
+ - Gemfile
82
+ - LICENSE.md
83
+ - README.md
84
+ - Rakefile
85
+ - app/assets/javascripts/chr.coffee
86
+ - app/assets/javascripts/chr/core/_chr.coffee
87
+ - app/assets/javascripts/chr/core/_item.coffee
88
+ - app/assets/javascripts/chr/core/_list.coffee
89
+ - app/assets/javascripts/chr/core/_listReorder.coffee
90
+ - app/assets/javascripts/chr/core/_listScroll.coffee
91
+ - app/assets/javascripts/chr/core/_listSearch.coffee
92
+ - app/assets/javascripts/chr/core/_module.coffee
93
+ - app/assets/javascripts/chr/core/_utils.coffee
94
+ - app/assets/javascripts/chr/core/_view.coffee
95
+ - app/assets/javascripts/chr/form/_form.coffee
96
+ - app/assets/javascripts/chr/form/_inputCheckbox.coffee
97
+ - app/assets/javascripts/chr/form/_inputColor.coffee
98
+ - app/assets/javascripts/chr/form/_inputFile.coffee
99
+ - app/assets/javascripts/chr/form/_inputHidden.coffee
100
+ - app/assets/javascripts/chr/form/_inputList.coffee
101
+ - app/assets/javascripts/chr/form/_inputSelect.coffee
102
+ - app/assets/javascripts/chr/form/_inputString.coffee
103
+ - app/assets/javascripts/chr/form/_inputText.coffee
104
+ - app/assets/javascripts/chr/form/_nestedForm.coffee
105
+ - app/assets/javascripts/chr/store/_store.coffee
106
+ - app/assets/javascripts/chr/store/_storeRails.coffee
107
+ - app/assets/javascripts/chr/vendor/jquery.scrollparent.js
108
+ - app/assets/javascripts/chr/vendor/jquery.textarea_autosize.js
109
+ - app/assets/javascripts/chr/vendor/jquery.typeahead.js
110
+ - app/assets/javascripts/chr/vendor/slip.js
111
+ - app/assets/stylesheets/_chr.scss
112
+ - app/assets/stylesheets/core/_icons.scss
113
+ - app/assets/stylesheets/core/_list.scss
114
+ - app/assets/stylesheets/core/_main.scss
115
+ - app/assets/stylesheets/core/_responsive.scss
116
+ - app/assets/stylesheets/form/_form.scss
117
+ - app/assets/stylesheets/form/_input_checkbox.scss
118
+ - app/assets/stylesheets/form/_input_color.scss
119
+ - app/assets/stylesheets/form/_input_file.scss
120
+ - app/assets/stylesheets/form/_input_list.scss
121
+ - app/assets/stylesheets/form/_input_string.scss
122
+ - app/assets/stylesheets/form/_input_text.scss
123
+ - app/assets/stylesheets/form/_nested_form.scss
124
+ - chr.gemspec
125
+ - lib/chr.rb
126
+ - lib/chr/engine.rb
127
+ - lib/chr/version.rb
128
+ homepage: http://slatestudio.com
129
+ licenses:
130
+ - MIT
131
+ metadata: {}
132
+ post_install_message:
133
+ rdoc_options: []
134
+ require_paths:
135
+ - lib
136
+ required_ruby_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
141
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ requirements: []
147
+ rubyforge_project: chr
148
+ rubygems_version: 2.4.5
149
+ signing_key:
150
+ specification_version: 4
151
+ summary: A simple and lightweight library for building data management web apps
152
+ test_files: []