rich_cms 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,10 @@
1
1
  = Rich-CMS CHANGELOG
2
2
 
3
+ == Version 2.0.4 (October 1, 2010)
4
+
5
+ * Using RaccoonTip v1.0.6
6
+ * Added CSS reset
7
+
3
8
  == Version 2.0.3 (September 30, 2010)
4
9
 
5
10
  * Added rails generators 'rich_authlogic_user' and 'rich_cms_content'
data/README.textile CHANGED
@@ -35,8 +35,8 @@ h2. Use the provided Rails generators
35
35
 
36
36
  Rich-CMS requires two entities:
37
37
 
38
- * An (Authlogic authenticated) user model
39
- * An ActiveRecord model used for CMS content storage
38
+ * An @Authlogic@ authenticated user model
39
+ * An @ActiveRecord@ model used for CMS content storage
40
40
 
41
41
  Fortunately, Rich-CMS is provided with two Rails generators with which you can generate both entities.
42
42
 
@@ -48,12 +48,14 @@ Run the following in your console:
48
48
  script/generate rich_authlogic_user
49
49
  </pre>
50
50
 
51
- *Note*: At default, it will create both the User and UserSesson classes and CreateUsers migration. You can alter the class names with the following:
51
+ *Note*: At default, it will create both the @User@ and @UserSesson@ classes and @CreateUsers@ migration. You can alter the class names with the following:
52
52
 
53
53
  <pre>
54
- script/generate rich_authlogic_user CodeHeroes::User
54
+ script/generate rich_authlogic_user CodeHeroes::User --migrate
55
55
  </pre>
56
56
 
57
+ *Note*: Both generators have the @-m@ or @--migrate@ option which runs @rake db:migrate@ after creating the files.
58
+
57
59
  h3. CMS content
58
60
 
59
61
  Run the following in your console:
@@ -62,13 +64,13 @@ Run the following in your console:
62
64
  script/generate rich_cms_content
63
65
  </pre>
64
66
 
65
- *Note*: At default, it will create the CmsContent model and CreateCmsContents migration. You can alter the class name with the following:
67
+ *Note*: At default, it will create the @CmsContent@ model and @CreateCmsContents@ migration. You can alter the class name with the following:
66
68
 
67
69
  <pre>
68
70
  script/generate rich_cms_content CmsItem
69
71
  </pre>
70
72
 
71
- In case you have used the Rails generators, you can skip the *Create required entities manually* section and go straight to *Render Rich-CMS in your layout*.
73
+ In case you have used the Rails generators, you can skip the *Create required entities manually* section and go straight to *Render Rich-CMS in your views*.
72
74
 
73
75
  h2. Create required entities manually
74
76
 
@@ -102,7 +104,9 @@ The following specifications are optional as Rich-Cms uses defaults:
102
104
  Rich::Cms::Engine.register(".i18n" , {:class_name => "Translation", :key => [:key, :locale], :before_edit => "Rich.I18n.beforeEdit", :after_update => "Rich.I18n.afterUpdate"})
103
105
  </pre>
104
106
 
105
- h3. Render Rich-CMS in your layout
107
+ h2. Render Rich-CMS in your views
108
+
109
+ h3. Alter your layout
106
110
 
107
111
  Add the following line at the beginning of the @<body>@ tag:
108
112
 
@@ -113,7 +117,7 @@ Add the following line at the beginning of the @<body>@ tag:
113
117
  </body>
114
118
  </pre>
115
119
 
116
- h3. Render CMS content in your views
120
+ h3. Use the Rich-CMS helper method
117
121
 
118
122
  Rich-CMS requires a rendered DOM element provided with meta data of the content instance. Fortunately, you can call a method provided by Rich-CMS. Just specify the identifier of the content type and the key of the CMS content instance in question:
119
123
 
@@ -185,6 +189,9 @@ This Rails gem / plugin depends on:
185
189
  jQuery<br>
186
190
  "http://jquery.com":http://jquery.com
187
191
 
192
+ AuthLogic<br>
193
+ "http://github.com/binarylogic/authlogic":http://github.com/binarylogic/authlogic
194
+
188
195
  Jzip<br>
189
196
  "http://github.com/archan937/jzip":http://github.com/archan937/jzip
190
197
 
data/Rakefile CHANGED
@@ -13,8 +13,8 @@ begin
13
13
  gemspec.author = "Paul Engel"
14
14
 
15
15
  gemspec.add_dependency "authlogic"
16
- gemspec.add_dependency "jzip", ">= 1.0.10"
17
- gemspec.add_dependency "haml", ">= 3"
16
+ gemspec.add_dependency "jzip" , ">= 1.0.10"
17
+ gemspec.add_dependency "haml" , ">= 3"
18
18
  gemspec.add_dependency "formtastic", "0.9.7"
19
19
  end
20
20
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.3
1
+ 2.0.4
@@ -1,7 +1,7 @@
1
1
  if (typeof(RaccoonTip) == "undefined") {
2
2
 
3
3
  // *
4
- // * RaccoonTip 1.0.3 (Uncompressed)
4
+ // * RaccoonTip 1.0.6 (Uncompressed)
5
5
  // * A lightweight jQuery based balloon tip library
6
6
  // *
7
7
  // * This library requires jQuery (http://jquery.com)
@@ -10,7 +10,7 @@ if (typeof(RaccoonTip) == "undefined") {
10
10
  // * Except otherwise noted, RaccoonTip is licensed under
11
11
  // * http://creativecommons.org/licenses/by-sa/3.0
12
12
  // *
13
- // * $Date: 2010-09-01 23:21:13 +0100 (Wed, 01 September 2010) $
13
+ // * $Date: 2010-09-21 18:08:36 +0100 (Tue, 21 September 2010) $
14
14
  // *
15
15
 
16
16
  RaccoonTip = (function() {
@@ -91,52 +91,66 @@ RaccoonTip = (function() {
91
91
  };
92
92
 
93
93
  var position = function() {
94
- var raccoon_tip = $("#raccoon_tip"), position = null, correction = null;
94
+ var raccoon_tip = $("#raccoon_tip"),
95
+ positions = ["bottom_right", "bottom_middle", "bottom_left", "middle_left", "top_left", "top_middle", "top_right", "middle_right"],
96
+ pos_index = positions.indexOf(opts.position),
97
+ variants = [];
95
98
 
96
- var calculate = function() {
97
- raccoon_tip.attr("class", "rt_" + opts.position);
99
+ for (var i = 0; i < pos_index; i++) {
100
+ positions.push(positions.shift());
101
+ }
102
+
103
+ for (var direction = 0; direction < 2; direction++) {
98
104
 
99
- position = opts.position.split("_");
100
- correction = [null, null];
101
-
102
- switch(position[0]) {
103
- case "top":
104
- raccoon_tip.css({top: opts.target.offset().top - raccoon_tip.outerHeight() - 7}); break;
105
- case "middle":
106
- raccoon_tip.css({top: opts.target.offset().top + (opts.target.outerHeight() / 2) - (raccoon_tip.outerHeight() / 2)}); break;
107
- case "bottom":
108
- raccoon_tip.css({top: opts.target.offset().top + opts.target.outerHeight() + 7}); break;
105
+ if (direction == 1) {
106
+ positions.reverse();
107
+ positions.unshift(positions.pop());
109
108
  }
109
+
110
+ for (var i = 0; i < positions.length; i++) {
111
+ if (direction == 1 && variants[0].index <= i) {
112
+ variants[direction] = {index: 9};
113
+ break;
114
+ }
115
+
116
+ raccoon_tip.attr("class", "rt_" + positions[i]);
110
117
 
111
- if (parseInt(raccoon_tip.css("top"), 10) < $(window).scrollTop()) {
112
- correction[0] = "bottom";
113
- }
114
- if (parseInt(raccoon_tip.css("top"), 10) + raccoon_tip.outerHeight() > $(window).scrollTop() + $(window).height()) {
115
- correction[0] = "top";
116
- }
117
-
118
- switch(position[1]) {
119
- case "left":
120
- raccoon_tip.css({left: opts.target.offset().left - raccoon_tip.outerWidth()}); break;
121
- case "middle":
122
- raccoon_tip.css({left: opts.target.offset().left + (opts.target.outerWidth() / 2) - (raccoon_tip.outerWidth() / 2)}); break;
123
- case "right":
124
- raccoon_tip.css({left: opts.target.offset().left + opts.target.outerWidth()}); break;
125
- }
118
+ for (var axis_index = 0; axis_index < 2; axis_index++) {
119
+ switch(positions[i].split("_")[axis_index]) {
120
+ case "top":
121
+ raccoon_tip.css({top: opts.target.offset().top - raccoon_tip.outerHeight() - 7}); break;
122
+ case "bottom":
123
+ raccoon_tip.css({top: opts.target.offset().top + opts.target.outerHeight() + 7}); break;
124
+ case "left":
125
+ raccoon_tip.css({left: opts.target.offset().left - raccoon_tip.outerWidth() }); break;
126
+ case "right":
127
+ raccoon_tip.css({left: opts.target.offset().left + opts.target.outerWidth() }); break;
128
+ case "middle":
129
+ if (axis_index == 0) {
130
+ raccoon_tip.css({top: opts.target.offset().top + (opts.target.outerHeight() / 2) - (raccoon_tip.outerHeight() / 2)});
131
+ } else {
132
+ raccoon_tip.css({left: opts.target.offset().left + (opts.target.outerWidth() / 2) - (raccoon_tip.outerWidth() / 2)});
133
+ }
134
+ break;
135
+ }
136
+ }
126
137
 
127
- if (parseInt(raccoon_tip.css("left"), 10) < $(window).scrollLeft()) {
128
- correction[1] = "right";
129
- }
130
- if (parseInt(raccoon_tip.css("left"), 10) + raccoon_tip.outerWidth() > $(window).scrollLeft() + $(window).width()) {
131
- correction[1] = "left";
138
+ variants[direction] = {index: i, position: positions[i], top: raccoon_tip.css("top"), left: raccoon_tip.css("left")};
139
+
140
+ if (!((parseInt(raccoon_tip.css("top" ), 10) < $(window).scrollTop() ) ||
141
+ (parseInt(raccoon_tip.css("left"), 10) < $(window).scrollLeft()) ||
142
+ (parseInt(raccoon_tip.css("top" ), 10) + raccoon_tip.outerHeight() > $(window).scrollTop() + $(window).height()) ||
143
+ (parseInt(raccoon_tip.css("left"), 10) + raccoon_tip.outerWidth() > $(window).scrollLeft() + $(window).width()))) {
144
+ break;
145
+ }
132
146
  }
133
- };
134
-
135
- calculate();
136
- if (correction[0] || correction[1]) {
137
- opts.position = [correction[0] || position[0], correction[1] || position[1]].join("_");
138
- calculate();
139
147
  }
148
+
149
+ var pos = variants[variants[0].index < variants[1].index ? 0 : 1];
150
+
151
+ raccoon_tip.attr("class", "rt_" + pos.position);
152
+ raccoon_tip.css({top: pos.top, left: pos.left});
153
+ opts.position = pos.position;
140
154
  };
141
155
 
142
156
  var hide = function() {
@@ -149,7 +163,7 @@ RaccoonTip = (function() {
149
163
  };
150
164
 
151
165
  return {
152
- version: "1.0.3",
166
+ version: "1.0.6",
153
167
  init: function() {
154
168
  if (typeof(onRaccoonTipReady) == "function") {
155
169
  onRaccoonTipReady();
@@ -188,4 +202,4 @@ RaccoonTip = (function() {
188
202
  }
189
203
  }());
190
204
 
191
- }
205
+ }
@@ -8,7 +8,6 @@
8
8
  +border_radius(2px)
9
9
  +box_shadow(rgba(0, 0, 0, 0.5), 0, 1px, 3px)
10
10
  +text-shadow(transparent, 0, 0)
11
- +inline_block
12
11
 
13
12
  &.block
14
13
  display: block
@@ -20,6 +20,8 @@
20
20
  padding-left: 2px
21
21
  border: 0
22
22
  li
23
+ &.password
24
+ padding-top: 4px
23
25
  &.string, &.password
24
26
  input
25
27
  width: 100%
@@ -0,0 +1,10 @@
1
+
2
+ #rich_cms_dock, #rich_cms_menu, #rich_cms_panel
3
+ *
4
+ font-family: "Helvetica Neue", "Helvetica", "Arial", "sans-serif"
5
+ line-height: 1.5
6
+ letter-spacing: 0
7
+
8
+ #rich_cms_dock, #rich_cms_menu
9
+ *
10
+ letter-spacing: -0.35px
@@ -1,6 +1,7 @@
1
1
 
2
2
  @import tools/mixins
3
3
  @import tools/css3
4
+ @import rich_cms/reset
4
5
  @import rich_cms/dock
5
6
  @import rich_cms/menu
6
7
  @import rich_cms/panel
data/rich_cms.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rich_cms}
8
- s.version = "2.0.3"
8
+ s.version = "2.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Engel"]
12
- s.date = %q{2010-09-30}
12
+ s.date = %q{2010-10-01}
13
13
  s.description = %q{Rich-CMS is a module of E9s (http://github.com/archan937/e9s) which provides a frontend for your CMS content. You can use this gem to manage CMS content or translations (in an internationalized application). The installation and setup process is very easily done. You will have to register content at the Rich-CMS engine and also you will have to specify the authentication mechanism. Both are one-liners.}
14
14
  s.email = %q{paul.engel@holder.nl}
15
15
  s.extra_rdoc_files = [
@@ -61,6 +61,7 @@ Gem::Specification.new do |s|
61
61
  "lib/assets/sass/rich_cms/_dock.sass",
62
62
  "lib/assets/sass/rich_cms/_menu.sass",
63
63
  "lib/assets/sass/rich_cms/_panel.sass",
64
+ "lib/assets/sass/rich_cms/_reset.sass",
64
65
  "lib/assets/sass/tools/_css3.sass",
65
66
  "lib/assets/sass/tools/_mixins.sass",
66
67
  "lib/config/routes.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rich_cms
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 3
10
- version: 2.0.3
9
+ - 4
10
+ version: 2.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paul Engel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-30 00:00:00 +02:00
18
+ date: 2010-10-01 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -132,6 +132,7 @@ files:
132
132
  - lib/assets/sass/rich_cms/_dock.sass
133
133
  - lib/assets/sass/rich_cms/_menu.sass
134
134
  - lib/assets/sass/rich_cms/_panel.sass
135
+ - lib/assets/sass/rich_cms/_reset.sass
135
136
  - lib/assets/sass/tools/_css3.sass
136
137
  - lib/assets/sass/tools/_mixins.sass
137
138
  - lib/config/routes.rb