cortex-reaver 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,7 +34,7 @@ module CortexReaver
34
34
  require File.join(LIB_DIR, 'config')
35
35
 
36
36
  # Reload on sighup
37
- trap 'HUP' do
37
+ trap 'USR1' do
38
38
  reload_app
39
39
  end
40
40
 
@@ -333,7 +333,7 @@ module CortexReaver
333
333
 
334
334
  begin
335
335
  # Try to shut down Ramaze nicely.
336
- Process.kill('HUP', pid)
336
+ Process.kill('USR1', pid)
337
337
  puts "Done."
338
338
  rescue Errno::ESRCH
339
339
  # The process doesn't exist.
@@ -419,12 +419,13 @@ module CortexReaver
419
419
  end
420
420
 
421
421
  # Check schema
422
- if check_schema and
423
- Sequel::Migrator.get_current_migration_version(@db) !=
424
- Sequel::Migrator.latest_migration_version(File.join(LIB_DIR, 'migrations'))
425
-
426
- raise RuntimeError.new("database schema missing or out of date. Please run `cortex_reaver --migrate`.")
427
- end
422
+ #TODO: Disabled due to migrator API changes.
423
+ # if check_schema and
424
+ # Sequel::Migrator.get_current_migration_version(@db) !=
425
+ # Sequel::Migrator.latest_migration_version(File.join(LIB_DIR, 'migrations'))
426
+ #
427
+ # raise RuntimeError.new("database schema missing or out of date. Please run `cortex_reaver --migrate`.")
428
+ # end
428
429
  end
429
430
 
430
431
  def self.setup_cache
@@ -170,21 +170,20 @@ You can also just provide a regex for the path, in which case it is matched dire
170
170
  'jquery.js',
171
171
  'jquery.color.js',
172
172
  'jquery.dimensions.js',
173
- 'jquery.hotkeys-0.7.9.js',
173
+ 'jquery.hotkeys.js',
174
174
  'cookie.js'
175
175
  ]
176
176
  js.define :last,
177
177
  :desc => "An Array of Javascript files to load last, in order.",
178
178
  :default => []
179
179
 
180
-
181
180
  define :photographs,
182
181
  :desc => "Photograph configuration options.",
183
182
  :default => Construct.new
184
183
  photographs.define :sizes,
185
184
  :desc => "What sizes of each photograph to maintain.",
186
185
  :default => {
187
- :thumbnail => '160x',
186
+ :thumbnail => '168x',
188
187
  :grid => '140x140',
189
188
  :small => 'x512',
190
189
  :medium => 'x768',
@@ -72,7 +72,7 @@ module Ramaze
72
72
  # of the class (in which case the page which would contain that instance
73
73
  # is highlighted, or a page number. Limit determines how many numeric links
74
74
  # to include--use :all to include all pages.
75
- def page_nav(klass, index = nil, limit = 17)
75
+ def page_nav(klass, index = nil, limit = 15)
76
76
  # Translate :first, :last into corresponding windows.
77
77
  case index
78
78
  when :first
@@ -26,13 +26,13 @@ module Ramaze
26
26
  end
27
27
  end
28
28
 
29
- if Regexp.new("^#{pattern}$").match request.path_info
29
+ if Regexp.new("^#{pattern}$").match request.path
30
30
  true
31
31
  else
32
32
  false
33
33
  end
34
34
  when Regexp
35
- if path.match request.path_info
35
+ if path.match request.path
36
36
  true
37
37
  else
38
38
  false
@@ -131,16 +131,22 @@ module CortexReaver
131
131
 
132
132
  # Write appropriate sizes to disk
133
133
  sizes.each do |size, geometry|
134
- image.change_geometry(geometry) do |width, height|
135
- attachment = attachment(size.to_s + '.jpg')
136
- image.scale(width, height).write(attachment.local_path)
134
+ attachment = attachment(size.to_s + '.jpg')
135
+
136
+ if size == :grid
137
+ resized = image.resize_to_fill(*geometry.split('x').map(&:to_i))
138
+ else
139
+ image.change_geometry(geometry) do |width, height|
140
+ resized = image.scale(width, height)
141
+ end
137
142
  end
143
+
144
+ resized.write attachment.local_path
138
145
  end
139
146
 
140
- # Yep, GC time. Gotta clear out those imagemagick stubs.
141
- GC.start
142
-
143
147
  # Free IM stubs
148
+ image = nil
149
+ resized = nil
144
150
  GC.start
145
151
 
146
152
  true
@@ -18,24 +18,17 @@ ul.actions {
18
18
  display: inline-block;
19
19
  }
20
20
 
21
- #top .sections.actions li {
22
- padding-bottom: 3px;
23
- border-bottom: 3px solid transparent;
24
- position: relative;
25
- top: 3px;
26
- }
27
-
28
21
  #top .sections.actions a {
29
- padding: 6px;
30
- color: #000;
22
+ padding: 4px 8px;
23
+ border-radius: 4px;
31
24
  }
32
25
 
33
- #top .sections.actions li:hover {
34
- border-bottom-color: #444 !important;
26
+ #top .sections.actions a:hover {
27
+ background: rgba(0,0,0,0.5);
35
28
  }
36
29
 
37
- #top .sections.actions li.current {
38
- border-bottom-color: #888;
30
+ #top .sections.actions li.current a {
31
+ background: rgba(0,0,0,0.5);
39
32
  }
40
33
 
41
34
  /* Footer actions on journals, pages, etc */
@@ -1,6 +1,10 @@
1
1
  body {
2
2
  font-size: 13px;
3
- font-family: sans-serif;
3
+ font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
4
+ }
5
+
6
+ h1, h2, h3 {
7
+ font-weight: normal;
4
8
  }
5
9
 
6
10
  h1 {
@@ -3,7 +3,8 @@ img {
3
3
  margin: 0;
4
4
  }
5
5
 
6
- a {
6
+ a[href] {
7
+ color: #213EAD;
7
8
  text-decoration: none;
8
9
  }
9
10
 
@@ -1,41 +1,49 @@
1
1
  body {
2
- background: #fff;
2
+ background-color: #171A1F;
3
+ background-position: top center;
3
4
  color: #000;
4
5
  margin: 0;
6
+ width: 100%;
7
+ height: 100%;
5
8
  }
6
9
 
7
10
  #content {
8
- width: 900px;
11
+ width: 860px;
9
12
  position: relative;
10
13
  margin: auto;
11
14
  }
12
15
 
13
16
  #top {
14
17
  position: absolute;
15
- height: 80px;
16
- width: 900px;
18
+ top: 0px;
19
+ height: 280px;
20
+ width: 860px;
17
21
  left: 0px;
18
- border-bottom: 1px solid #aaa;
22
+ background: url('/images/header.jpg');
23
+ -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.7);
24
+ -moz-box-shadow: 0 0 10px rgba(0,0,0,0.7);
19
25
  }
20
26
 
21
27
  #top h1 {
22
28
  padding: 0;
23
29
  margin: 0;
24
- font-size: 48px;
25
- font-weight: 700;
30
+ font-size: 40px;
26
31
  position: absolute;
27
- left: 0;
28
- bottom: 0;
32
+ left: 14px;
33
+ bottom: 10px;
34
+ text-shadow: rgba(0,0,0,1) 0 0 10px !important;
29
35
  }
30
36
 
31
37
  #top .actions {
32
38
  position: absolute;
33
- right: 0;
34
- bottom: 0;
39
+ right: 8px;
40
+ bottom: 14px;
41
+ text-transform: lowercase;
35
42
  }
36
43
 
37
44
  #top a {
38
- color: #000;
45
+ color: #fff !important;
46
+ text-shadow: rgba(0,0,0,1) 0 0 4px;
39
47
  }
40
48
  #top a:hover {
41
49
  text-decoration: none;
@@ -43,19 +51,24 @@ body {
43
51
 
44
52
  #boxes {
45
53
  position: absolute;
46
- width: 170px;
47
- top: 100px;
48
- right: 0;
54
+ width: 168px;
55
+ top: 290px;
56
+ right: 12px;
57
+ z-index: 2;
49
58
  }
50
59
 
51
60
  #main-container {
52
61
  position: absolute;
53
62
  left: 0px;
54
- top: 100px;
55
- right: 196px;
63
+ right: 0px;
64
+ top: 280px;
65
+ -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.7);
66
+ -moz-box-shadow: 0 0 10px rgba(0,0,0,0.7);
67
+ background: #fff;
56
68
  }
57
69
 
58
70
  #main {
59
- background: #fff;
60
71
  min-height: 260px;
72
+ margin: 12px 196px 12px 12px;
73
+ color: #171A1F;
61
74
  }
@@ -8,7 +8,7 @@
8
8
  margin: 1px;
9
9
  padding: 0;
10
10
  width: 35px;
11
- background: #ddd;
11
+ background: #CCD3DE;
12
12
  display: inline-block;
13
13
  color: #000;
14
14
  }
@@ -43,7 +43,7 @@
43
43
  }
44
44
 
45
45
  .pagination.actions li:hover, .pagination.actions li.current > *:hover {
46
- background: #444;
46
+ background: #171A1F;
47
47
  }
48
48
 
49
49
  .pagination.actions li > *:hover {
@@ -51,7 +51,7 @@
51
51
  }
52
52
 
53
53
  .pagination.actions li.current {
54
- background-color: #888;
54
+ background-color: #98A2B5;
55
55
  }
56
56
 
57
57
 
@@ -5,6 +5,10 @@
5
5
  margin-left: auto;
6
6
  margin-right: auto;
7
7
  border: none;
8
+ background: transparent;
9
+ -moz-box-shadow: none;
10
+ -webkit-box-shadow: none;
11
+ box-shadow: none;
8
12
  }
9
13
 
10
14
  #top.photograph a {
@@ -7,26 +7,20 @@ body.blank {
7
7
  .photographs.grid {
8
8
  margin: 10px -5px;
9
9
  padding: 0;
10
+ list-style-type: none;
10
11
  }
11
12
 
12
13
  .photographs.grid .thumb {
13
14
  display: block;
14
15
  float: left;
15
- margin: 5px;
16
+ margin: 10px;
16
17
  }
17
18
 
18
19
  .photographs.grid .thumb > a {
19
- width: 166px;
20
- height: 166px;
20
+ width: 140px;
21
+ height: 140px;
21
22
  display: table-cell;
22
23
  vertical-align: middle;
23
- background-color: #f0f0f0;
24
- border-width: 1px;
25
- border-style: solid;
26
- border-color: #fff #ccc #aaa #ccc;
27
- -moz-border-radius: 4px;
28
- -webkit-border-radius: 4px;
29
- border-radius: 4px;
30
24
  -webkit-box-shadow: 0px 1px 8px rgba(0,0,0,0.3);
31
25
  -moz-box-shadow: 0px 1px 8px rgba(0,0,0,0.3);
32
26
  box-shadow: 0px 1px 8px rgba(0,0,0,0.3);
@@ -38,9 +38,8 @@
38
38
 
39
39
  .box .photo {
40
40
  background: #fff;
41
- padding: 3px;
42
- margin: 0px 2px 10px 2px;
43
- -webkit-box-shadow: 0px 0px 3px #000;
44
- -moz-box-shadow: 0px 0px 3px #000;
45
- box-shadow: 0px 0px 3px #000;
41
+ margin: 0 0 14px 0;
42
+ -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.7);
43
+ -moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.7);
44
+ box-shadow: 0px 0px 3px rgba(0,0,0,0.7);
46
45
  }
@@ -1,5 +1,5 @@
1
1
  h1 a, h2 a, h3 a {
2
- color: #202020;
2
+ color: inherit !important;
3
3
  }
4
4
 
5
5
  #main {
@@ -42,3 +42,7 @@ h1 a, h2 a, h3 a {
42
42
  .text-entry .byline {
43
43
  margin-bottom: 2em;
44
44
  }
45
+
46
+ img.attachment {
47
+ width: 100%;
48
+ }
@@ -3,27 +3,31 @@ $(document).ready(function() {
3
3
  if(Cookie.get('adminboxopen') == 'true') {
4
4
  $('.admin.bar').show();
5
5
  }
6
- });
7
6
 
8
- $(document).bind('keydown', {combi:'Alt+Ctrl+a',}, function() {
9
- // Toggle admin tools
10
- var a = $('.admin.bar');
11
- a.slideToggle('fast', function() {
12
- if ($('.admin.bar:visible')) {
13
- // Focus tools
14
- if ($('#admin_login')) $('#admin_login').focus();
7
+ function toggle() {
8
+ // Toggle admin tools
9
+ var a = $('.admin.bar');
10
+ a.slideToggle('fast', function() {
11
+ if ($('.admin.bar:visible')) {
12
+ // Focus tools
13
+ if ($('#admin_login')) { $('#admin_login').focus(); }
14
+ } else {
15
+ // Unfocus tools
16
+ if ($('#admin_login')) { $('#admin_login').blur(); }
17
+ }
18
+ });
19
+ return true;
20
+ }
21
+
22
+ $(document).bind('keydown', 'alt+ctrl+a', toggle);
23
+ $('.admin.bar input').bind('keydown', 'alt+ctrl+a', toggle);
24
+
25
+ // On leaving the page, remember the admin tool state.
26
+ $(window).unload(function() {
27
+ if($('.admin.bar').is(':visible')) {
28
+ Cookie.set('adminboxopen', 'true', 14);
15
29
  } else {
16
- // Unfocus tools
17
- if ($('#admin_login')) $('#admin_login').blur();
30
+ Cookie.erase('adminboxopen');
18
31
  }
19
32
  });
20
33
  });
21
-
22
- // On leaving the page, remember the admin tool state.
23
- $(window).unload(function() {
24
- if($('.admin.bar').is(':visible')) {
25
- Cookie.set('adminboxopen', 'true', 14);
26
- } else {
27
- Cookie.erase('adminboxopen');
28
- }
29
- });
@@ -22,7 +22,7 @@
22
22
  comma: 188
23
23
  };
24
24
 
25
- if (settings) $.extend(config, settings);
25
+ if (settings) { $.extend(config, settings); }
26
26
 
27
27
  return this.each(function () {
28
28
  // MEAT AND POTATOES AND FUNCTIONS (MINUS THE COMESTIBLES)
@@ -36,7 +36,7 @@
36
36
  $(node).find('a').click(function() {
37
37
  $(node).remove();
38
38
  saveTags();
39
- })
39
+ });
40
40
 
41
41
  // Add to the list.
42
42
  $list.append(node);
@@ -74,7 +74,7 @@
74
74
  $container.after('<div style="clear: both"></div>');
75
75
 
76
76
  // Add tags from the original field's contents.
77
- if ($.trim($field.val()) != '') {
77
+ if ($.trim($field.val()) !== '') {
78
78
  $.each($field.val().split(','), function(i, tag) {
79
79
  addTag($.trim(tag));
80
80
  });
@@ -97,7 +97,7 @@
97
97
  $input.keydown(function(e, code) {
98
98
  code = code || e.keyCode;
99
99
  if (code == keys['return'] || code == 188 || code == keys.tab) {
100
- if ($input.val() != '') {
100
+ if ($input.val() !== '') {
101
101
  // Accept new tag
102
102
  var newTag = $input.val();
103
103
  $input.val('');
@@ -107,7 +107,7 @@
107
107
  // Don't submit/leave/add a comma!
108
108
  return false;
109
109
  }
110
- } else if (code == keys.backspace && $input.val() == '') {
110
+ } else if (code == keys.backspace && $input.val() === '') {
111
111
  // Remove the previous tag
112
112
  $list.find("li:last").remove();
113
113
  saveTags();