obf 0.9.8.23 → 0.9.8.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/obf/pdf.rb +12 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9b0d4ab79e44a904b9a3bc4461a7faa579e57fef811a9186b266dacaf9214e2
|
4
|
+
data.tar.gz: 29b7aaa4520e477ac4ba0b56eb10a60504c5219f398f4e84079e575124a02dca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcbfab462b4f69098879cc4e7fcf02f519ab49a9004b8f4e7ccb84b5dc3241f0c41bce1f60bddb7386893ea7c60d042e71d9455660ce4e1e17ad0471b92b2399
|
7
|
+
data.tar.gz: 2e9f364ebc4415c3e76ae754f98ac8ebb4ee87a48a54b9798105d5d70169807ee96ef06321e47ae53d9be5caff31a8e5fdc7df13a7e695dc25d2344ffeb9632f
|
data/lib/obf/pdf.rb
CHANGED
@@ -69,11 +69,13 @@ module OBF::PDF
|
|
69
69
|
if obj['boards']
|
70
70
|
multi_render = obj['boards'].length > 20
|
71
71
|
obj['backlinks'] = {}
|
72
|
-
obj['
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
72
|
+
if obj['pages']
|
73
|
+
obj['boards'].each do |board|
|
74
|
+
board['buttons'].each do |button|
|
75
|
+
if button['load_board'] && button['load_board']['id']
|
76
|
+
obj['backlinks'][button['load_board']['id']] ||= []
|
77
|
+
obj['backlinks'][button['load_board']['id']] << obj['pages'][board['id']] if obj['pages'][board['id']]
|
78
|
+
end
|
77
79
|
end
|
78
80
|
end
|
79
81
|
end
|
@@ -107,6 +109,7 @@ module OBF::PDF
|
|
107
109
|
build_page(pdf, board, {
|
108
110
|
'zipper' => zipper,
|
109
111
|
'pages' => obj['pages'],
|
112
|
+
'backlinks' => obj['backlinks'][board['id']] || [],
|
110
113
|
'headerless' => !!opts['headerless'],
|
111
114
|
'font' => font,
|
112
115
|
'links' => true,
|
@@ -154,7 +157,7 @@ module OBF::PDF
|
|
154
157
|
page_num = 0
|
155
158
|
|
156
159
|
if options['pages']
|
157
|
-
page_num = options['pages'][obj['id']]
|
160
|
+
page_num = options['pages'][obj['id']].to_i
|
158
161
|
pdf.add_dest("page#{page_num}", pdf.dest_fit) if options['links']
|
159
162
|
end
|
160
163
|
# header
|
@@ -177,12 +180,12 @@ module OBF::PDF
|
|
177
180
|
x = 110
|
178
181
|
pdf.fill_and_stroke_rounded_rectangle [x, header_height], 100, header_height, default_radius
|
179
182
|
pdf.fill_color "6D81D1"
|
180
|
-
pdf.fill_and_stroke_polygon([x + 5, 45], [x + 35,
|
183
|
+
pdf.fill_and_stroke_polygon([x + 5, 45], [x + 35, 70], [x + 35, 60], [x + 95, 60], [x + 95, 30], [x + 35, 30], [x + 35, 20])
|
181
184
|
pdf.fill_color "666666"
|
182
185
|
text_options = {:text => "Go Back"}
|
183
186
|
text_options[:anchor] = "page1" if options['links']
|
184
187
|
pdf.formatted_text_box [text_options], :at => [x + 10, header_height], :width => 80, :height => 80, :align => :center, :valign => :bottom, :overflow => :shrink_to_fit
|
185
|
-
backlinks = (
|
188
|
+
backlinks = (options['backlinks'] || []).length > 0 ? options['backlinks'].join(',') : '1'
|
186
189
|
pdf.fill_color "ffffff"
|
187
190
|
pdf.formatted_text_box [{:text => backlinks}], :at => [x + 10, header_height + 5], :width => 80, :height => 80, :align => :center, :valign => :center, :overflow => :shrink_to_fit
|
188
191
|
end
|
@@ -423,6 +426,7 @@ module OBF::PDF
|
|
423
426
|
|
424
427
|
# footer
|
425
428
|
pdf.fill_color "bbbbbb"
|
429
|
+
obj['name'] = nil if obj['name'] == 'Unnamed Board'
|
426
430
|
if OBF::PDF.footer_text || obj['name']
|
427
431
|
text = [obj['name'], OBF::PDF.footer_text].compact.join(', ')
|
428
432
|
offset = options['pages'] ? 400 : 300
|