narou 3.2.5.1 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of narou might be problematic. Click here for more details.

Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -5
  3. data/.haml-lint.yml +7 -0
  4. data/.rubocop.yml +23 -5
  5. data/.scss-lint.yml +9 -0
  6. data/ChangeLog.md +86 -0
  7. data/Gemfile.lock +35 -35
  8. data/README.md +80 -64
  9. data/lib/backtracer.rb +2 -2
  10. data/lib/color.rb +5 -1
  11. data/lib/command.rb +7 -2
  12. data/lib/command/alias.rb +3 -5
  13. data/lib/command/backup.rb +3 -5
  14. data/lib/command/browser.rb +3 -5
  15. data/lib/command/clean.rb +5 -1
  16. data/lib/command/console.rb +33 -0
  17. data/lib/command/convert.rb +143 -117
  18. data/lib/command/csv.rb +2 -1
  19. data/lib/command/diff.rb +20 -18
  20. data/lib/command/download.rb +25 -14
  21. data/lib/command/folder.rb +3 -5
  22. data/lib/command/freeze.rb +3 -5
  23. data/lib/command/help.rb +20 -18
  24. data/lib/command/init.rb +4 -3
  25. data/lib/command/inspect.rb +2 -1
  26. data/lib/command/list.rb +10 -8
  27. data/lib/command/list/novel_decorator.rb +2 -1
  28. data/lib/command/log.rb +100 -0
  29. data/lib/command/log/tail.rb +76 -0
  30. data/lib/command/mail.rb +20 -17
  31. data/lib/command/remove.rb +7 -6
  32. data/lib/command/send.rb +23 -20
  33. data/lib/command/setting.rb +74 -40
  34. data/lib/command/tag.rb +16 -15
  35. data/lib/command/trace.rb +2 -2
  36. data/lib/command/update.rb +78 -128
  37. data/lib/command/update/general_lastup_updater.rb +3 -2
  38. data/lib/command/update/hotentry_manager.rb +2 -1
  39. data/lib/command/update/interval.rb +2 -1
  40. data/lib/command/version.rb +2 -1
  41. data/lib/command/web.rb +17 -3
  42. data/lib/commandbase.rb +34 -7
  43. data/lib/commandline.rb +54 -35
  44. data/lib/converterbase.rb +21 -15
  45. data/lib/database.rb +3 -2
  46. data/lib/device.rb +5 -4
  47. data/lib/device/epub.rb +2 -1
  48. data/lib/device/ibooks.rb +2 -1
  49. data/lib/device/ibunko.rb +2 -1
  50. data/lib/device/kindle.rb +2 -1
  51. data/lib/device/kobo.rb +2 -1
  52. data/lib/device/library/cygwin.rb +2 -1
  53. data/lib/device/library/linux.rb +2 -1
  54. data/lib/device/library/mac.rb +2 -1
  55. data/lib/device/library/windows.rb +2 -1
  56. data/lib/device/library/windows/eject.rb +2 -1
  57. data/lib/device/reader.rb +2 -1
  58. data/lib/diffviewer.rb +8 -11
  59. data/lib/downloader.rb +159 -151
  60. data/lib/eventable.rb +2 -1
  61. data/lib/extension.rb +16 -14
  62. data/lib/extensions/jruby.rb +2 -1
  63. data/lib/extensions/monkey_patches.rb +7 -0
  64. data/lib/extensions/monkey_patches/pathname.rb +22 -0
  65. data/lib/extensions/windows.rb +2 -1
  66. data/lib/extensions/windows_write_color.rb +2 -1
  67. data/lib/helper.rb +35 -20
  68. data/lib/html.rb +2 -1
  69. data/lib/illustration.rb +2 -1
  70. data/lib/ini.rb +2 -1
  71. data/lib/input.rb +2 -1
  72. data/lib/inspector.rb +3 -2
  73. data/lib/inventory.rb +3 -3
  74. data/lib/mailer.rb +3 -2
  75. data/lib/mixin/all.rb +8 -0
  76. data/lib/mixin/locker.rb +40 -0
  77. data/lib/mixin/output_error.rb +28 -0
  78. data/lib/narou.rb +69 -51
  79. data/lib/narou/api.rb +2 -4
  80. data/lib/narou_logger.rb +236 -108
  81. data/lib/novelconverter.rb +77 -69
  82. data/lib/novelinfo.rb +4 -2
  83. data/lib/novelsetting.rb +15 -12
  84. data/lib/progressbar.rb +13 -9
  85. data/lib/sitesetting.rb +39 -18
  86. data/lib/template.rb +5 -4
  87. data/lib/version.rb +3 -2
  88. data/lib/web/all.rb +2 -1
  89. data/lib/web/appserver.rb +83 -65
  90. data/lib/web/helper4web.rb +10 -5
  91. data/lib/web/progressbar4web.rb +8 -4
  92. data/lib/web/public/resources/default-style.css +2 -3
  93. data/lib/web/public/resources/narou.library.js +86 -60
  94. data/lib/web/public/resources/narou.queue.js +24 -30
  95. data/lib/web/public/resources/narou.ui.js +22 -3
  96. data/lib/web/public/theme/Cerulean/style.css +5 -5
  97. data/lib/web/public/theme/Darkly/style.css +5 -5
  98. data/lib/web/public/theme/Readable/style.css +5 -5
  99. data/lib/web/public/theme/Slate/style.css +2 -3
  100. data/lib/web/public/theme/Superhero/style.css +2 -3
  101. data/lib/web/public/theme/United/style.css +5 -5
  102. data/lib/web/pushserver.rb +10 -7
  103. data/lib/web/server_helpers.rb +16 -1
  104. data/lib/web/settingmessages.rb +10 -7
  105. data/lib/web/streaminginput.rb +2 -1
  106. data/lib/web/streaminglogger.rb +45 -32
  107. data/lib/web/views/_about.haml +6 -3
  108. data/lib/web/views/_header.haml +2 -3
  109. data/lib/web/views/_move_to_top.haml +2 -0
  110. data/lib/web/views/_queue.haml +7 -0
  111. data/lib/web/views/bookmarklet/insert_button.js.erb +1 -1
  112. data/lib/web/views/index.haml +30 -27
  113. data/lib/web/views/layout.haml +2 -0
  114. data/lib/web/views/novels/setting.haml +3 -4
  115. data/lib/web/views/settings.haml +22 -8
  116. data/lib/web/views/style.scss +54 -3
  117. data/lib/web/views/widget/download.haml +9 -3
  118. data/lib/web/views/widget/drag_and_drop.haml +10 -4
  119. data/lib/web/web_worker.rb +132 -0
  120. data/lib/worker.rb +142 -0
  121. data/narou.gemspec +80 -45
  122. data/narou.rb +6 -4
  123. data/template/novel.txt.erb +1 -0
  124. data/webnovel/kakuyomu.jp.yaml +9 -13
  125. data/webnovel/ncode.syosetu.com.yaml +3 -1
  126. data/webnovel/novel18.syosetu.com.yaml +8 -1
  127. data/webnovel/syosetu.org.yaml +3 -1
  128. data/webnovel/www.akatsuki-novels.com.yaml +4 -2
  129. data/webnovel/www.mai-net.net.yaml +3 -1
  130. metadata +109 -48
  131. data/lib/web/worker.rb +0 -126
@@ -25,10 +25,11 @@
25
25
  }
26
26
  }
27
27
 
28
- #queue-text {
28
+ .queue {
29
29
  color: #fff !important;
30
30
  }
31
- #queue {
31
+
32
+ .queue__sizes {
32
33
  color: #2FA4E7 !important;
33
34
  background-color: #fff !important;
34
35
  }
@@ -38,12 +39,11 @@
38
39
  font-weight: bold;
39
40
  }
40
41
 
41
- #queue-text.active {
42
+ .queue.active {
42
43
  color: #d9534f !important;
43
44
  }
44
45
 
45
- #queue-text.active #queue {
46
+ .queue.active .queue__sizes {
46
47
  color: white !important;
47
48
  background-color: #d9534f !important;
48
49
  }
49
-
@@ -29,10 +29,11 @@ body {
29
29
  }
30
30
  }
31
31
 
32
- #queue-text {
32
+ .queue {
33
33
  color: #fff !important;
34
34
  }
35
- #queue {
35
+
36
+ .queue__sizes {
36
37
  color: #375a7f !important;
37
38
  background-color: #fff !important;
38
39
  }
@@ -42,12 +43,11 @@ body {
42
43
  font-weight: bold;
43
44
  }
44
45
 
45
- #queue-text.active {
46
+ .queue.active {
46
47
  color: #d9534f !important;
47
48
  }
48
49
 
49
- #queue-text.active #queue {
50
+ .queue.active .queue__sizes {
50
51
  color: white !important;
51
52
  background-color: #d9534f !important;
52
53
  }
53
-
@@ -29,10 +29,11 @@ body {
29
29
  }
30
30
  }
31
31
 
32
- #queue-text {
32
+ .queue {
33
33
  color: #4582ec !important;
34
34
  }
35
- #queue {
35
+
36
+ .queue__sizes {
36
37
  color: #fff !important;
37
38
  background-color: #4582ec !important;
38
39
  }
@@ -42,12 +43,11 @@ body {
42
43
  font-weight: bold;
43
44
  }
44
45
 
45
- #queue-text.active {
46
+ .queue.active {
46
47
  color: #d9534f !important;
47
48
  }
48
49
 
49
- #queue-text.active #queue {
50
+ .queue.active .queue__sizes {
50
51
  color: white !important;
51
52
  background-color: #d9534f !important;
52
53
  }
53
-
@@ -30,11 +30,10 @@
30
30
  font-weight: bold;
31
31
  }
32
32
 
33
- #queue-text.active {
33
+ .queue.active {
34
34
  color: #d9534f !important;
35
35
  }
36
36
 
37
- #queue-text.active #queue {
37
+ .queue.active .queue__sizes {
38
38
  background-color: #d9534f !important;
39
39
  }
40
-
@@ -30,11 +30,10 @@
30
30
  font-weight: bold;
31
31
  }
32
32
 
33
- #queue-text.active {
33
+ .queue.active {
34
34
  color: #d9534f !important;
35
35
  }
36
36
 
37
- #queue-text.active #queue {
37
+ .queue.active .queue__sizes {
38
38
  background-color: #d9534f !important;
39
39
  }
40
-
@@ -24,10 +24,11 @@
24
24
  }
25
25
  }
26
26
 
27
- #queue-text {
27
+ .queue {
28
28
  color: #fff !important;
29
29
  }
30
- #queue {
30
+
31
+ .queue__sizes {
31
32
  color: #DD4814 !important;
32
33
  background-color: #fff !important;
33
34
  }
@@ -37,11 +38,10 @@
37
38
  font-weight: bold;
38
39
  }
39
40
 
40
- #queue-text.active {
41
+ .queue.active {
41
42
  color: yellow !important;
42
43
  }
43
44
 
44
- #queue-text.active #queue {
45
+ .queue.active .queue__sizes {
45
46
  background-color: yellow !important;
46
47
  }
47
-
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Copyright 2013 whiteleaf. All rights reserved.
4
5
  #
@@ -13,7 +14,7 @@ module Narou
13
14
  include Singleton
14
15
  include Eventable
15
16
 
16
- HISTORY_SAVED_COUNT = 30 # 保存する履歴の数
17
+ HISTORY_SAVED_COUNT = 60 # 保存する履歴の数
17
18
 
18
19
  attr_accessor :port, :host
19
20
  attr_reader :accepted_domains, :connections
@@ -59,7 +60,10 @@ module Narou
59
60
  trigger(name, value, ws)
60
61
  end
61
62
  rescue JSON::ParserError => e
62
- ws.send(JSON.generate(echo: e.message))
63
+ ws.send(JSON.generate(echo: {
64
+ target_console: "#console",
65
+ body: e.message
66
+ }))
63
67
  end
64
68
  end
65
69
  rescue Errno::ECONNRESET => e
@@ -107,16 +111,15 @@ module Narou
107
111
  end
108
112
 
109
113
  def stack_to_history(message)
110
- if message == "." && @history[-1] =~ /\A\.+\z/
114
+ return if message[:no_history]
115
+ if message[:body] == "." && (last = @history[-1])[:body] =~ /\A\.+\z/
111
116
  # 進行中を表す .... の出力でヒストリーが消費されるのを防ぐため、
112
117
  # 連続した . は一つにまとめる
113
- @history[-1] << "."
118
+ last[:body] = "#{last[:body]}."
114
119
  else
115
120
  @history.push(message)
116
121
  @history.shift
117
122
  end
118
123
  end
119
-
120
124
  end
121
125
  end
122
-
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Copyright 2013 whiteleaf. All rights reserved.
4
5
  #
@@ -132,4 +133,18 @@ module Narou::ServerHelpers
132
133
  haml(template_file_name, options)
133
134
  end
134
135
  end
136
+
137
+ def embed_concurrency_enabled
138
+ <<~HTML
139
+ <input type="hidden" id="concurrency-enabled" value="#{Narou.concurrency_enabled?}">
140
+ HTML
141
+ end
142
+
143
+ def concurrency_push(&block)
144
+ if Narou.concurrency_enabled?
145
+ yield
146
+ else
147
+ Narou::WebWorker.push(&block)
148
+ end
149
+ end
135
150
  end
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Copyright 2013 whiteleaf. All rights reserved.
4
5
  #
@@ -9,7 +10,7 @@ module Narou
9
10
  SETTING_VARIABLES_WEBUI_MESSAGES = {
10
11
  "convert.multi-device" => "複数の端末用に同時に変換する。deviceよりも優先される。\nただのEPUBを出力したい場合はepubを指定",
11
12
  "device" => "変換、送信対象の端末",
12
- "difftool" => "Diffで使うツールのパスを指定する\n※WEB UIでは使われません",
13
+ "difftool" => "%%ORIG%%。※WEB UIでは使われません",
13
14
  "update.sort-by" => "アップデートを指定した項目順で行う",
14
15
  "default.title_date_align" => "enable_add_date_to_title で付与する日付の位置",
15
16
  "force.title_date_align" => "enable_add_date_to_title で付与する日付の位置",
@@ -17,13 +18,15 @@ module Narou
17
18
  "特殊な変数\n" \
18
19
  "<b>%NEW</b> : 最新データの差分用ファイルパス\n" \
19
20
  "<b>%OLD</b> : 古い方の差分用ファイルパス",
20
- "no-color" => "コンソールのカラー表示を無効にする\n※要WEB UIサーバ再起動",
21
+ "no-color" => "コンソールのカラー表示を無効にする\n※要サーバ再起動",
21
22
  "economy" => "容量節約に関する設定",
22
23
  "send.without-freeze" => "一括送信時に凍結された小説は対象外にする。(個別送信時は凍結済みでも送信可能)",
23
- "server-digest-auth.enable" => "WEBサーバでDigest認証を使用するかどうか\n" \
24
- "digest-auth関連の設定を変更した場合WEB UIサーバの再起動が必要",
25
- "server-digest-auth.hashed-password" => "WEBサーバのDigest認証のパスワードを、Realmを\"narou.rb\"としてハッシュにしたもの。\n" \
24
+ "server-digest-auth.enable" => "%%ORIG%%\n※digest-auth関連の設定を変更した場合サーバの再起動が必要",
25
+ "server-digest-auth.hashed-password" => "サーバのDigest認証のパスワードを、Realmを\"narou.rb\"としてハッシュにしたもの。\n" \
26
26
  "https://tgws.plus/app/digest/ などで生成できる",
27
+ "concurrency" => "%%ORIG%% ※要サーバ再起動",
28
+ "logging" => "%%ORIG%%\n※要サーバ再起動",
29
+ "logging.format-filename" => "%%ORIG%%\n※要サーバ再起動",
30
+ "logging.format-timestamp" => "%%ORIG%%\n※要サーバ再起動",
27
31
  }
28
32
  end
29
-
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Copyright 2013 whiteleaf. All rights reserved.
4
5
  #
@@ -1,4 +1,5 @@
1
- # -*- coding: utf-8 -*-
1
+ # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Copyright 2013 whiteleaf. All rights reserved.
4
5
  #
@@ -22,47 +23,59 @@ end
22
23
  #
23
24
  # $stdout を介した出力は echo イベントとして全てのクライアントへ送信される
24
25
  #
25
- class Narou::StreamingLogger < StringIO
26
- include Narou::LoggerModule
26
+ module Narou
27
+ class StreamingLogger < StringIO
28
+ include Narou::LoggerModule
27
29
 
28
- attr_reader :push_server
30
+ attr_reader :push_server, :target_console
29
31
 
30
- def initialize(push_server = nil)
31
- super()
32
- @push_server = push_server
33
- end
32
+ def initialize(push_server, original_stream = $stdout, target_console: "stdout")
33
+ super()
34
+ @push_server = push_server
35
+ @target_console = target_console
36
+ self.log_postfix = original_stream.log_postfix
37
+ original_stream.string.clear
38
+ end
34
39
 
35
- def tty?
36
- false
37
- end
40
+ def tty?
41
+ false
42
+ end
38
43
 
39
- def copy_instance
40
- self.class.new(@push_server).tap do |obj|
41
- obj.silent = silent
44
+ def copy_instance
45
+ self.class.new(@push_server).tap do |obj|
46
+ obj.silent = silent?
47
+ end
42
48
  end
43
- end
44
49
 
45
- def strip_color(str)
46
- if $disable_color
47
- str
48
- else
49
- str.gsub(%r!</?span.*?>!, "")
50
+ def strip_color(str)
51
+ if $disable_color
52
+ str
53
+ else
54
+ str.gsub(%r!</?span.*?>!, "")
55
+ end
50
56
  end
51
- end
52
57
 
53
- def push_streaming(str)
54
- unless @is_silent
55
- @push_server.send_all(echo: str) if @push_server
58
+ def push_streaming(str, no_history: false)
59
+ return if silent?
60
+ @push_server&.send_all(echo: build_echo(str, no_history))
56
61
  end
57
- end
58
62
 
59
- def write(str)
60
- str = str.to_s
61
- if str.encoding == Encoding::ASCII_8BIT
62
- str.force_encoding(Encoding::UTF_8)
63
+ def build_echo(str, no_history)
64
+ {
65
+ target_console: target_console,
66
+ body: str,
67
+ no_history: no_history
68
+ }
69
+ end
70
+
71
+ def write(str)
72
+ str = str.to_s
73
+ if str.encoding == Encoding::ASCII_8BIT
74
+ str.force_encoding(Encoding::UTF_8)
75
+ end
76
+ super(str)
77
+ push_streaming(str)
78
+ append_log(str)
63
79
  end
64
- super(str)
65
- push_streaming(str)
66
80
  end
67
81
  end
68
-
@@ -153,12 +153,15 @@
153
153
 
154
154
  }();
155
155
 
156
- %div.link-to-changelog-in-about
156
+ .link-to-changelog-in-about
157
+ %a.btn.btn-default.btn-sm{ href: "https://jbbs.shitaraba.net/computer/44668/", target: "_blank" }
158
+ 掲示板
159
+ %span.glyphicon.glyphicon-new-window
157
160
  %a.btn.btn-default.btn-sm(href="https://github.com/whiteleaf7/narou/blob/master/ChangeLog.md" target="_blank")
158
161
  更新履歴
159
162
  %span.glyphicon.glyphicon-new-window
160
163
 
161
- %div(style="text-align:center")
164
+ .text-center
162
165
  %h1
163
166
  %strong Narou.rb
164
167
  %div
@@ -167,7 +170,7 @@
167
170
  Copyright © 2013-#{Narou.last_commit_year} whiteleaf. All rights reserved.
168
171
  #result-of-version-checking(style="margin-top:10px")
169
172
  .checking
170
- %span.rotate-progress
173
+ %p.rotate-progress
171
174
  %span.icon
172
175
  %span.text アップデートを確認しています...
173
176
  .version-is-latest
@@ -22,6 +22,5 @@
22
22
  - if enable_save_settings
23
23
  .navbar-form.navbar-left
24
24
  %input.btn.btn-info(type="submit" value="設定を保存" style="margin-left: 50px")
25
- %p#queue-text.navbar-text.navbar-right(data-toggle="tooltip" title="キューに積まれた処理の数" data-placement="bottom")
26
- %span.glyphicon.glyphicon-inbox
27
- %span#queue 0
25
+ %button#btn-reboot.btn.btn-default サーバを再起動
26
+ = partial :queue
@@ -0,0 +1,2 @@
1
+ .move-to-top{ "data-move-to": "top" }
2
+ %i.glyphicon.glyphicon-arrow-up.icon
@@ -0,0 +1,7 @@
1
+ %p.queue.navbar-text.navbar-right(data-toggle="tooltip" title="キューに積まれた処理の数" data-placement="bottom")
2
+ %span.glyphicon.glyphicon-inbox
3
+ %span.queue__sizes
4
+ %span.queue__size.queue__size--default> 0
5
+ - if Narou.concurrency_enabled?
6
+ %span.queue__size.queue__size--divider
7
+ %span.queue__size.queue__size--convert> 0
@@ -2,7 +2,7 @@
2
2
  var insertButtonBookmarklet = (function() {
3
3
  "DLボタン設置ブックマークレット v2.0";
4
4
  var site_settings = [
5
- <%- SiteSetting.settings.each.with_index do |s, i| -%>
5
+ <%- SiteSetting.settings.each_value.with_index do |s, i| -%>
6
6
  <% setting = s.clone %>
7
7
  {
8
8
  <%- case setting["domain"] -%>
@@ -180,9 +180,7 @@
180
180
  %span
181
181
  %span.glyphicon.glyphicon-off
182
182
  サーバをシャットダウン
183
- %p#queue-text.navbar-text.navbar-right(data-toggle="tooltip" title="キューに積まれた処理の数")
184
- %span.glyphicon.glyphicon-inbox
185
- %span#queue 0
183
+ = partial :queue
186
184
  .navbar-form.navbar-right(role="search")
187
185
  .form-group
188
186
  .input-group
@@ -207,13 +205,23 @@
207
205
 
208
206
  -# コンソール
209
207
  #console-container
210
- #console.console
211
- #console-buttons.console-buttons
212
- %span.queue-cancel.glyphicon.glyphicon-remove-circle(data-toggle="tooltip" title="処理を中断")
213
- %span.console-trash.glyphicon.glyphicon-trash(data-toggle="tooltip" title="ログと履歴を削除")
214
- %span.console-expand
215
- %span.glyphicon.glyphicon-resize-full(data-toggle="tooltip" title="拡大")
216
- %span.glyphicon.glyphicon-resize-small.hide(data-toggle="tooltip" title="縮小")
208
+ - console_stdout = capture_haml do
209
+ #console.console
210
+ #console-buttons.console-buttons
211
+ %span.queue-cancel.glyphicon.glyphicon-remove-circle(data-toggle="tooltip" title="処理を中断")
212
+ %span.console-history.glyphicon.glyphicon-cloud-download(data-toggle="tooltip" title="全ての履歴を取得")
213
+ %span.console-trash.glyphicon.glyphicon-trash(data-toggle="tooltip" title="表示と履歴を削除")
214
+ %span.console-expand
215
+ %span.glyphicon.glyphicon-resize-full(data-toggle="tooltip" title="拡大")
216
+ %span.glyphicon.glyphicon-resize-small.hide(data-toggle="tooltip" title="縮小")
217
+ - if Narou.concurrency_enabled?
218
+ .row
219
+ .col-xs-7.console-col-left
220
+ = console_stdout
221
+ .col-xs-5.console-col-right
222
+ #console-stdout2.console
223
+ - else
224
+ = console_stdout
217
225
 
218
226
  -# 操作パネル
219
227
  #control-panel
@@ -250,13 +258,22 @@
250
258
  %span.glyphicon.glyphicon-refresh
251
259
  .btn-group
252
260
  %button.button-send.btn.btn-warning(type="button" data-toggle="tooltip") Send
253
- - if Inventory.load("local_setting")["hotentry"]
261
+ :ruby
262
+ menus = []
263
+ if Inventory.load["hotentry"]
264
+ menus << ["button-send-hotentry", "hotentry を送信"]
265
+ end
266
+ if Inventory.load["device"] == "kindle"
267
+ menus << ["button-send-backup-bookmark", "端末の栞データをバックアップ"]
268
+ end
269
+ - unless menus.empty?
254
270
  %button.btn.btn-warning.dropdown-toggle(type="button" data-toggle="dropdown")
255
271
  %span.caret
256
272
  %span.sr-only Toggle Dropdown
257
273
  %ul.dropdown-menu(role="menu")
258
- %li
259
- %a.button-send-hotentry(href="#") hotentry を送信
274
+ - menus.each do |klass, label|
275
+ %li
276
+ %a{ href: "#", class: klass }= label
260
277
  .btn-group
261
278
  %button.btn.btn-info.dropdown-toggle.enable-selected(type="button" data-toggle="dropdown")
262
279
  Freeze
@@ -318,20 +335,6 @@
318
335
  %li#rect-select-menu-cancel
319
336
  %a(href="#") キャンセル
320
337
 
321
- -# 個別表示用コンソール
322
- #console-dialog.modal.fade(tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true")
323
- .modal-dialog
324
- .modal-content
325
- .modal-header
326
- %button(type="button" class="close" data-dismiss="modal")
327
- %span(aria-hidden="true") &times;
328
- %span.sr-only Close
329
- %h4.modal-title サブコンソール
330
- .modal-body
331
- #each-console.console
332
- .modal-footer
333
- %button.btn.btn-primary(type="button" data-dismiss="modal") 閉じる
334
-
335
338
  %ul#select-color-menu.dropdown-menu(role="menu")
336
339
  %li
337
340
  %a#select-color-menu-green(href="#")