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.
- data/lib/cortex_reaver.rb +9 -8
- data/lib/cortex_reaver/config.rb +2 -3
- data/lib/cortex_reaver/helper/navigation.rb +1 -1
- data/lib/cortex_reaver/helper/sidebar.rb +2 -2
- data/lib/cortex_reaver/model/photograph.rb +12 -6
- data/lib/cortex_reaver/public/css/actions.css +6 -13
- data/lib/cortex_reaver/public/css/fonts.css +5 -1
- data/lib/cortex_reaver/public/css/generics.css +2 -1
- data/lib/cortex_reaver/public/css/main.css +31 -18
- data/lib/cortex_reaver/public/css/pagination.css +3 -3
- data/lib/cortex_reaver/public/css/photo-show.css +4 -0
- data/lib/cortex_reaver/public/css/photo.css +4 -10
- data/lib/cortex_reaver/public/css/sidebar.css +4 -5
- data/lib/cortex_reaver/public/css/text.css +5 -1
- data/lib/cortex_reaver/public/images/background.png +0 -0
- data/lib/cortex_reaver/public/js/admin.js +23 -19
- data/lib/cortex_reaver/public/js/autotags.js +5 -5
- data/lib/cortex_reaver/public/js/cookie.js +1 -1
- data/lib/cortex_reaver/public/js/jquery.hotkeys.js +99 -0
- data/lib/cortex_reaver/public/js/jquery.js +149 -4371
- data/lib/cortex_reaver/version.rb +2 -2
- data/lib/cortex_reaver/view/adminbox.rhtml +0 -1
- metadata +5 -4
- data/lib/cortex_reaver/public/js/jquery.hotkeys-0.7.9.js +0 -244
data/lib/cortex_reaver.rb
CHANGED
@@ -34,7 +34,7 @@ module CortexReaver
|
|
34
34
|
require File.join(LIB_DIR, 'config')
|
35
35
|
|
36
36
|
# Reload on sighup
|
37
|
-
trap '
|
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('
|
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
|
-
|
423
|
-
|
424
|
-
Sequel::Migrator.
|
425
|
-
|
426
|
-
|
427
|
-
|
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
|
data/lib/cortex_reaver/config.rb
CHANGED
@@ -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
|
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 => '
|
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 =
|
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.
|
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.
|
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
|
-
|
135
|
-
|
136
|
-
|
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:
|
30
|
-
|
22
|
+
padding: 4px 8px;
|
23
|
+
border-radius: 4px;
|
31
24
|
}
|
32
25
|
|
33
|
-
#top .sections.actions
|
34
|
-
|
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
|
-
|
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,41 +1,49 @@
|
|
1
1
|
body {
|
2
|
-
background: #
|
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:
|
11
|
+
width: 860px;
|
9
12
|
position: relative;
|
10
13
|
margin: auto;
|
11
14
|
}
|
12
15
|
|
13
16
|
#top {
|
14
17
|
position: absolute;
|
15
|
-
|
16
|
-
|
18
|
+
top: 0px;
|
19
|
+
height: 280px;
|
20
|
+
width: 860px;
|
17
21
|
left: 0px;
|
18
|
-
|
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:
|
25
|
-
font-weight: 700;
|
30
|
+
font-size: 40px;
|
26
31
|
position: absolute;
|
27
|
-
left:
|
28
|
-
bottom:
|
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:
|
34
|
-
bottom:
|
39
|
+
right: 8px;
|
40
|
+
bottom: 14px;
|
41
|
+
text-transform: lowercase;
|
35
42
|
}
|
36
43
|
|
37
44
|
#top a {
|
38
|
-
color: #
|
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:
|
47
|
-
top:
|
48
|
-
right:
|
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
|
-
|
55
|
-
|
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: #
|
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: #
|
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: #
|
54
|
+
background-color: #98A2B5;
|
55
55
|
}
|
56
56
|
|
57
57
|
|
@@ -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:
|
16
|
+
margin: 10px;
|
16
17
|
}
|
17
18
|
|
18
19
|
.photographs.grid .thumb > a {
|
19
|
-
width:
|
20
|
-
height:
|
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
|
-
|
42
|
-
|
43
|
-
-
|
44
|
-
|
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
|
}
|
Binary file
|
@@ -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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
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();
|