obf 0.9.8.23 → 0.9.8.24

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/obf/pdf.rb +12 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bd7e8028db1c87b73a5e2f828dac8b4e7982d71513e397021c7ae499fd0c633
4
- data.tar.gz: ede0d55b1e4069c4e311492b0a72a3e76eaa98427b3d71872b64c89a8757794d
3
+ metadata.gz: e9b0d4ab79e44a904b9a3bc4461a7faa579e57fef811a9186b266dacaf9214e2
4
+ data.tar.gz: 29b7aaa4520e477ac4ba0b56eb10a60504c5219f398f4e84079e575124a02dca
5
5
  SHA512:
6
- metadata.gz: 05337e4a5c9e1b32854b35dd782a1570e877adca12804fec6ef91a8e1e19a5e207cd3e858fff26d02caee1de7e3e2319e0d0b293f1d4c1b72a2b58a781e3ea69
7
- data.tar.gz: 813b1ec4c0cd3c58ffc0594f23b57d79beaf30079eb4b28f04ce6151c36de3a46102d5f331db1047be3cfc2a58700721c9c6b8ad2114b397d4794d0ecc489ef1
6
+ metadata.gz: dcbfab462b4f69098879cc4e7fcf02f519ab49a9004b8f4e7ccb84b5dc3241f0c41bce1f60bddb7386893ea7c60d042e71d9455660ce4e1e17ad0471b92b2399
7
+ data.tar.gz: 2e9f364ebc4415c3e76ae754f98ac8ebb4ee87a48a54b9798105d5d70169807ee96ef06321e47ae53d9be5caff31a8e5fdc7df13a7e695dc25d2344ffeb9632f
@@ -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['boards'].each do |board|
73
- board['buttons'].each do |button|
74
- if button['load_board'] && button['load_board']['id']
75
- obj['backlinks'][button['load_board']['id']] ||= []
76
- obj['backlinks'][button['load_board']['id']] << board['id']
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, 75], [x + 35, 60], [x + 95, 60], [x + 95, 30], [x + 35, 30], [x + 35, 15])
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 = (obj['backlinks'] || []).length > 0 ? obj['backlinks'].join(',') : '1'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8.23
4
+ version: 0.9.8.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer