narou 1.7.2 → 2.0.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.
- checksums.yaml +5 -13
- data/.gitignore +1 -0
- data/ChangeLog.md +35 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +100 -0
- data/README.md +28 -39
- data/lib/color.rb +0 -2
- data/lib/command.rb +1 -0
- data/lib/command/convert.rb +33 -4
- data/lib/command/diff.rb +5 -4
- data/lib/command/download.rb +9 -1
- data/lib/command/flag.rb +2 -2
- data/lib/command/list.rb +1 -1
- data/lib/command/mail.rb +3 -3
- data/lib/command/remove.rb +2 -1
- data/lib/command/send.rb +7 -6
- data/lib/command/setting.rb +39 -95
- data/lib/command/tag.rb +25 -13
- data/lib/command/update.rb +6 -1
- data/lib/command/version.rb +5 -1
- data/lib/command/web.rb +111 -0
- data/lib/commandbase.rb +5 -2
- data/lib/commandline.rb +16 -0
- data/lib/converterbase.rb +20 -14
- data/lib/device.rb +5 -4
- data/lib/downloader.rb +68 -39
- data/lib/eventable.rb +72 -0
- data/lib/helper.rb +105 -37
- data/lib/ini.rb +2 -1
- data/lib/input.rb +68 -0
- data/lib/inventory.rb +4 -0
- data/lib/kindlestrip.rb +2 -2
- data/lib/logger.rb +41 -19
- data/lib/narou.rb +10 -0
- data/lib/narou/api.rb +1 -1
- data/lib/novelconverter.rb +8 -21
- data/lib/novelsetting.rb +79 -4
- data/lib/version.rb +1 -1
- data/lib/web/all.rb +12 -0
- data/lib/web/appserver.rb +612 -0
- data/lib/web/helper4web.rb +15 -0
- data/lib/web/progressbar4web.rb +32 -0
- data/lib/web/public/favicon.ico +0 -0
- data/lib/web/public/resources/bootbox.min.js +6 -0
- data/lib/web/public/resources/common.ui.js +143 -0
- data/lib/web/public/resources/dataTables.colVis.js +1113 -0
- data/lib/web/public/resources/help/rect_select.png +0 -0
- data/lib/web/public/resources/help/ssmain.png +0 -0
- data/lib/web/public/resources/help/tag.png +0 -0
- data/lib/web/public/resources/jquery.moveto.js +44 -0
- data/lib/web/public/resources/jquery.outerclick.js +60 -0
- data/lib/web/public/resources/jquery.slidenavbar.js +89 -0
- data/lib/web/public/resources/narou.library.js +815 -0
- data/lib/web/public/resources/narou.ui.js +993 -0
- data/lib/web/public/resources/perfect-scrollbar.min.css +5 -0
- data/lib/web/public/resources/perfect-scrollbar.min.js +4 -0
- data/lib/web/public/resources/shortcut.js +223 -0
- data/lib/web/public/resources/sort_asc.png +0 -0
- data/lib/web/public/resources/sort_desc.png +0 -0
- data/lib/web/public/resources/toggle-switch.css +322 -0
- data/lib/web/public/robots.txt +3 -0
- data/lib/web/public/test/jquery.outerclick.html +72 -0
- data/lib/web/pushserver.rb +110 -0
- data/lib/web/settingmessages.rb +14 -0
- data/lib/web/streaminginput.rb +103 -0
- data/lib/web/streaminglogger.rb +52 -0
- data/lib/web/views/about.haml +11 -0
- data/lib/web/views/help.haml +105 -0
- data/lib/web/views/index.haml +245 -0
- data/lib/web/views/js/widget.erb +74 -0
- data/lib/web/views/layout.haml +49 -0
- data/lib/web/views/novels/setting.haml +177 -0
- data/lib/web/views/settings.haml +115 -0
- data/lib/web/views/style.scss +737 -0
- data/lib/web/views/widget.haml +39 -0
- data/lib/web/web-socket-ruby/.gitignore +1 -0
- data/lib/web/web-socket-ruby/README.txt +75 -0
- data/lib/web/web-socket-ruby/lib/web_socket.rb +601 -0
- data/lib/web/web-socket-ruby/samples/chat_server.rb +58 -0
- data/lib/web/web-socket-ruby/samples/echo_server.rb +33 -0
- data/lib/web/web-socket-ruby/samples/stdio_client.rb +25 -0
- data/lib/web/worker.rb +87 -0
- data/narou.gemspec +36 -3
- data/narou.rb +8 -6
- data/preset/ncode.syosetu.com/n8725k/converter.rb +2 -1
- data/spec/data/convert_test/replace/correct_test_replace.txt +1 -1
- data/spec/data/convert_test/replace/test_replace.txt +1 -1
- data/spec/data/convert_test/ruby/correct_test_ruby.txt +18 -1
- data/spec/data/convert_test/ruby/test_ruby.txt +18 -0
- data/spec/downloader_spec.rb +37 -0
- data/spec/eventable_spec.rb +172 -0
- data/spec/exit_code_spec.rb +67 -0
- data/spec/helper_spec.rb +72 -0
- data/spec/input_spec.rb +76 -0
- data/spec/logger_spec.rb +53 -0
- data/spec/novelsetting_spec.rb +35 -0
- data/spec/worker_spec.rb +56 -0
- data/template/ibunko_novel.txt.erb +2 -2
- data/template/novel.txt.erb +2 -2
- metadata +213 -29
@@ -0,0 +1,245 @@
|
|
1
|
+
.navbar.navbar-default.navbar-fixed-top(role="navigation")
|
2
|
+
.container
|
3
|
+
.navbar-header
|
4
|
+
%button.navbar-toggle(type="button")
|
5
|
+
%span.sr-only Toggle navigation
|
6
|
+
%span.icon-bar
|
7
|
+
%span.icon-bar
|
8
|
+
%span.icon-bar
|
9
|
+
%a.navbar-brand(href="#" data-move-to="top") Narou.rb WEB UI
|
10
|
+
.navbar-collapse.collapse
|
11
|
+
%ul.nav.navbar-nav
|
12
|
+
%li.dropdown
|
13
|
+
%a.dropdown-toggle(data-toggle="dropdown" href="#")
|
14
|
+
表示
|
15
|
+
%span.caret
|
16
|
+
%ul.dropdown-menu(role="menu")
|
17
|
+
%li#action-view-all
|
18
|
+
%a(href="#") 全ての項目を表示
|
19
|
+
%li#action-view-setting
|
20
|
+
%a(href="#") 表示する項目を設定
|
21
|
+
%li.divider
|
22
|
+
%li#action-view-without-frozen.active
|
23
|
+
%a(href="#")
|
24
|
+
%span
|
25
|
+
%span.active-ok.glyphicon.glyphicon-ok
|
26
|
+
凍結中以外を表示
|
27
|
+
%li#action-view-frozen.active
|
28
|
+
%a(href="#")
|
29
|
+
%span
|
30
|
+
%span.active-ok.glyphicon.glyphicon-ok
|
31
|
+
凍結中を表示
|
32
|
+
%li.divider
|
33
|
+
%li#action-view-reset
|
34
|
+
%a(href="/") 表示設定を全てリセット
|
35
|
+
%li.dropdown
|
36
|
+
%a.dropdown-toggle(data-toggle="dropdown" href="#")
|
37
|
+
選択
|
38
|
+
%span#badge-number-of-selecting.badge 0
|
39
|
+
%span.caret
|
40
|
+
%ul#dropdown-menu-select.dropdown-menu(role="menu")
|
41
|
+
%li#action-select-view
|
42
|
+
%a(href="#")
|
43
|
+
%span 表示されている小説を選択
|
44
|
+
%span.shortcut Ctrl+A
|
45
|
+
%li#action-select-all
|
46
|
+
%a(href="#")
|
47
|
+
%span 全ての小説を選択
|
48
|
+
%span.shortcut Shift+A
|
49
|
+
%li#action-select-clear
|
50
|
+
%a(href="#")
|
51
|
+
%span 選択を全て解除
|
52
|
+
%span.shortcut ESC
|
53
|
+
%li.divider
|
54
|
+
%li#action-select-mode-single
|
55
|
+
%a(href="#")
|
56
|
+
%span
|
57
|
+
%span.active-ok.glyphicon.glyphicon-ok
|
58
|
+
シングル選択モード
|
59
|
+
%span.shortcut S
|
60
|
+
%li#action-select-mode-rect
|
61
|
+
%a(href="#")
|
62
|
+
%span
|
63
|
+
%span.active-ok.glyphicon.glyphicon-ok
|
64
|
+
範囲選択モード
|
65
|
+
%span.shortcut R
|
66
|
+
%li
|
67
|
+
%a.dropdown-toggle(data-toggle="dropdown" href="#")
|
68
|
+
タグ
|
69
|
+
%span.caret
|
70
|
+
%ul.dropdown-menu(role="menu")
|
71
|
+
%li
|
72
|
+
#tag-list-canvas
|
73
|
+
%li.divider
|
74
|
+
%li#action-tag-edit.enable-selected
|
75
|
+
%a(href="#")
|
76
|
+
%span
|
77
|
+
選択した小説のタグを編集
|
78
|
+
%ul.nav.navbar-nav.navbar-right
|
79
|
+
%li.dropdown
|
80
|
+
%a.dropdown-toggle(data-toggle="dropdown" href="#")
|
81
|
+
%span.glyphicon.glyphicon-cog.hidden-xs
|
82
|
+
%span.visible-xs-inline
|
83
|
+
オプション
|
84
|
+
%span.caret
|
85
|
+
%ul.dropdown-menu(role="menu")
|
86
|
+
%li#action-option-settings
|
87
|
+
%a(href="/settings")
|
88
|
+
%span
|
89
|
+
%span.glyphicon.glyphicon-wrench
|
90
|
+
環境設定
|
91
|
+
%li.divider
|
92
|
+
%li#action-option-help
|
93
|
+
%a(href="/help")
|
94
|
+
%span
|
95
|
+
%span.glyphicon.glyphicon-question-sign
|
96
|
+
ヘルプ
|
97
|
+
%li#action-option-about
|
98
|
+
%a(href="#")
|
99
|
+
%span
|
100
|
+
%span.glyphicon.glyphicon-info-sign
|
101
|
+
Narou.rb について
|
102
|
+
%li.divider
|
103
|
+
%li#action-option-server-shutdown
|
104
|
+
%a(href="#")
|
105
|
+
%span
|
106
|
+
%span.glyphicon.glyphicon-off
|
107
|
+
サーバをシャットダウン
|
108
|
+
%p#queue-text.navbar-text.navbar-right(data-toggle="tooltip" title="キューに積まれた処理の数")
|
109
|
+
%span.glyphicon.glyphicon-inbox
|
110
|
+
%span#queue 0
|
111
|
+
.navbar-form.navbar-right(role="search")
|
112
|
+
.form-group
|
113
|
+
.input-group
|
114
|
+
%span#myFilter-search-icon.glyphicon.glyphicon-search
|
115
|
+
%input#myFilter.form-control(placeholder="Filter" type="text")/
|
116
|
+
%span#myFilter-clear.glyphicon.glyphicon-remove-circle
|
117
|
+
|
118
|
+
.container.container-main.theme-showcase(role="main")
|
119
|
+
-# 初めて表示した時のメッセージ
|
120
|
+
- if @is_first_access
|
121
|
+
.alert.alert-info.fade.in(role="alert")
|
122
|
+
%button.close(type="button" data-dismiss="alert")
|
123
|
+
%span(aria-hidden="true") ×
|
124
|
+
%span.sr-only Close
|
125
|
+
%h2 Welcome
|
126
|
+
%p 最初に簡単な操作説明があるヘルプをご覧下さい。なお、このメッセージは今回のみ表示されます。
|
127
|
+
%p(style="margin-top:20px")
|
128
|
+
%a.btn.btn-primary(href="/help" role="button") ヘルプを見る »
|
129
|
+
|
130
|
+
-# コンソール
|
131
|
+
#console-container
|
132
|
+
#console.console
|
133
|
+
#console-buttons.console-buttons
|
134
|
+
%span.console-trash.glyphicon.glyphicon-trash(data-toggle="tooltip" title="ログと履歴を削除")
|
135
|
+
%span.console-expand
|
136
|
+
%span.glyphicon.glyphicon-resize-full(data-toggle="tooltip" title="拡大")
|
137
|
+
%span.glyphicon.glyphicon-resize-small.hide(data-toggle="tooltip" title="縮小")
|
138
|
+
|
139
|
+
-# 操作パネル
|
140
|
+
#control-panel
|
141
|
+
.btn-group
|
142
|
+
%button#button-download.btn.btn-primary(type="button" data-toggle="tooltip" |
|
143
|
+
title="新規ダウンロード") Download |
|
144
|
+
%button.btn.btn-primary.dropdown-toggle(type="button" data-toggle="dropdown")
|
145
|
+
%span.caret
|
146
|
+
%span.sr-only Toggle Dropdown
|
147
|
+
%ul.dropdown-menu(role="menu")
|
148
|
+
%li
|
149
|
+
%a#button-download-force(href="#") 選択した小説を強制再ダウンロード
|
150
|
+
.btn-group
|
151
|
+
%button#button-update.btn.btn-success(type="button") Update
|
152
|
+
.btn-group
|
153
|
+
%button#button-send.btn.btn-warning(type="button") Send
|
154
|
+
.btn-group
|
155
|
+
%button.btn.btn-info.dropdown-toggle.enable-selected(type="button" data-toggle="dropdown")
|
156
|
+
Freeze
|
157
|
+
%span.caret
|
158
|
+
%span.sr-only Toggle Dropdown
|
159
|
+
%ul.dropdown-menu(role="menu")
|
160
|
+
%li
|
161
|
+
%a#button-freeze-on(href="#") 選択した小説を凍結
|
162
|
+
%li
|
163
|
+
%a#button-freeze-off(href="#") 選択した小説の凍結を解除
|
164
|
+
.btn-group
|
165
|
+
%button.btn.btn-danger.dropdown-toggle.enable-selected(type="button" data-toggle="dropdown")
|
166
|
+
Remove
|
167
|
+
%span.caret
|
168
|
+
%span.sr-only Toggle Dropdown
|
169
|
+
%ul.dropdown-menu(role="menu")
|
170
|
+
%li
|
171
|
+
%a#button-remove(href="#") 選択した小説を削除
|
172
|
+
%li
|
173
|
+
%a#button-remove-with-file(href="#") 選択した小説をファイルも含めて削除
|
174
|
+
%button#button-convert.btn.btn-default.enable-selected(type="button" data-toggle="tooltip" |
|
175
|
+
title="選択した小説を変換") Convert |
|
176
|
+
.btn-group
|
177
|
+
%button.btn.btn-default.dropdown-toggle.enable-selected(type="button" data-toggle="dropdown")
|
178
|
+
Other
|
179
|
+
%span.caret
|
180
|
+
%span.sr-only Toggle Dropdown
|
181
|
+
%ul.dropdown-menu(role="menu")
|
182
|
+
%li
|
183
|
+
%a#button-diff(href="#") 選択した小説の最新の差分を表示(diff)
|
184
|
+
%li
|
185
|
+
%a#button-inspect(href="#") 選択した小説の調査状況ログを表示(inspect)
|
186
|
+
%li
|
187
|
+
%a#button-folder(href="#") 選択した小説の保存フォルダを開く(folder)
|
188
|
+
%li
|
189
|
+
%a#button-backup(href="#") 選択した小説のバックアップを作成(backup)
|
190
|
+
|
191
|
+
-# 小説の一覧テーブル
|
192
|
+
%div
|
193
|
+
%table#novel-list.dataTable.table.table-bordered(cellspacing="0" width="100%")
|
194
|
+
%thead
|
195
|
+
|
196
|
+
-# 範囲選択後に表示するメニュー
|
197
|
+
%ul#rect-select-menu.dropdown-menu(role="menu")
|
198
|
+
%li#rect-select-menu-select
|
199
|
+
%a(href="#") 選択
|
200
|
+
%li#rect-select-menu-clear
|
201
|
+
%a(href="#") 解除
|
202
|
+
%li#rect-select-menu-reverse
|
203
|
+
%a(href="#") 反転
|
204
|
+
%li#rect-select-menu-cancel
|
205
|
+
%a(href="#") キャンセル
|
206
|
+
|
207
|
+
-# 個別メニュー
|
208
|
+
%ul#context-menu.dropdown-menu(role="menu")
|
209
|
+
%li#context-menu-setting
|
210
|
+
%a(href="#") 小説の変換設定
|
211
|
+
%li#context-menu-update
|
212
|
+
%a(href="#") 更新
|
213
|
+
%li#context-menu-send
|
214
|
+
%a(href="#") 送信
|
215
|
+
%li#context-menu-freeze-toggle
|
216
|
+
%a(href="#") 凍結 or 解凍
|
217
|
+
%li#context-menu-remove
|
218
|
+
%a(href="#") 削除
|
219
|
+
%li#context-menu-remove-with-file
|
220
|
+
%a(href="#") 完全に削除
|
221
|
+
%li#context-menu-convert
|
222
|
+
%a(href="#") 変換
|
223
|
+
%li#context-menu-diff
|
224
|
+
%a(href="#" data-move-to="top") 差分表示
|
225
|
+
%li#context-menu-inspect
|
226
|
+
%a(href="#") 調査状況ログを表示
|
227
|
+
%li#context-menu-folder
|
228
|
+
%a(href="#") 保存フォルダを開く
|
229
|
+
%li#context-menu-backup
|
230
|
+
%a(href="#") バックアップを作成
|
231
|
+
|
232
|
+
-# 個別表示用コンソール
|
233
|
+
#console-dialog.modal.fade(tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true")
|
234
|
+
.modal-dialog
|
235
|
+
.modal-content
|
236
|
+
.modal-header
|
237
|
+
%button(type="button" class="close" data-dismiss="modal")
|
238
|
+
%span(aria-hidden="true") ×
|
239
|
+
%span.sr-only Close
|
240
|
+
%h4.modal-title サブコンソール
|
241
|
+
.modal-body
|
242
|
+
#each-console.console
|
243
|
+
.modal-footer
|
244
|
+
%button.btn.btn-primary(type="button" data-dismiss="modal") 閉じる
|
245
|
+
|
@@ -0,0 +1,74 @@
|
|
1
|
+
<%# vim: set ft=javascript : -%>
|
2
|
+
(function() {
|
3
|
+
function merge(target, object) {
|
4
|
+
for (var key in object) {
|
5
|
+
target[key] = object[key];
|
6
|
+
}
|
7
|
+
}
|
8
|
+
|
9
|
+
var ALLOW_HOSTS = <%= ALLOW_HOSTS.to_s %>;
|
10
|
+
var guard = true;
|
11
|
+
if (typeof ALLOW_HOSTS.typeOf === "function") {
|
12
|
+
guard = ALLOW_HOSTS.indexOf(location.hostname) === -1;
|
13
|
+
}
|
14
|
+
else {
|
15
|
+
for (var i in ALLOW_HOSTS) {
|
16
|
+
if (ALLOW_HOSTS[i] === location.hostname) {
|
17
|
+
guard = false;
|
18
|
+
break;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
if (guard) {
|
23
|
+
alert("対応サイトではありません");
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
if (document.getElementById("narourb-console")) return;
|
27
|
+
|
28
|
+
var url, div, iframe, btn_close;
|
29
|
+
|
30
|
+
url = '<%= "#{request.scheme}://#{env["SERVER_NAME"]}:#{env["SERVER_PORT"]}" %>' +
|
31
|
+
"/widget/<%= params['mode'] %>?from=" + location.hostname + "&target=" +
|
32
|
+
encodeURIComponent(location.href) + "&t=" + Date.now();
|
33
|
+
|
34
|
+
// IE の場合、iframe は親のドキュメントモードが汚染して動かない可能性があるので対処
|
35
|
+
var docmode = document.documentMode || 10;
|
36
|
+
if (docmode < 10) {
|
37
|
+
window.open(url, "widget_window", "width=400,height=250,menubar=no,toolbar=no,scrollbars=no,resizable=yes");
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
|
41
|
+
div = document.createElement("div");
|
42
|
+
merge(div.style, {
|
43
|
+
position: "fixed",
|
44
|
+
top: 0, left: 0,
|
45
|
+
opacity: 0.85,
|
46
|
+
zIndex: 9999
|
47
|
+
});
|
48
|
+
|
49
|
+
iframe = document.createElement("iframe");
|
50
|
+
iframe.src = url;
|
51
|
+
iframe.id = "narourb-console";
|
52
|
+
iframe.width = 400;
|
53
|
+
iframe.height = 250;
|
54
|
+
|
55
|
+
btn_close = document.createElement("span");
|
56
|
+
btn_close.textContent = "×";
|
57
|
+
merge(btn_close.style, {
|
58
|
+
position: "absolute",
|
59
|
+
fontSize: "20px",
|
60
|
+
fontWeight: "bold",
|
61
|
+
background: "black",
|
62
|
+
top: 0,
|
63
|
+
color: "white",
|
64
|
+
cursor: "pointer",
|
65
|
+
opacity: 0.85
|
66
|
+
});
|
67
|
+
btn_close.onclick = function() {
|
68
|
+
div.parentNode.removeChild(div);
|
69
|
+
};
|
70
|
+
|
71
|
+
div.appendChild(iframe);
|
72
|
+
div.appendChild(btn_close);
|
73
|
+
document.body.appendChild(div);
|
74
|
+
})();
|
@@ -0,0 +1,49 @@
|
|
1
|
+
!!! 5
|
2
|
+
%html{:lang => "ja"}
|
3
|
+
%head
|
4
|
+
%meta{:charset => "utf-8"}/
|
5
|
+
%meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}/
|
6
|
+
%meta{:content => "width=device-width, initial-scale=1", :name => "viewport"}/
|
7
|
+
%meta{:content => "whiteleaf", :name => "author"}/
|
8
|
+
%meta{:content => "none", :name => "robots"}/
|
9
|
+
%title Narou.rb WEB UI #{@title ? "- #{@title}" : ""}
|
10
|
+
%link{:href => "/favicon.ico", :rel => "shortcut icon"}/
|
11
|
+
%link{:href => "//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css", :rel => "stylesheet"}/
|
12
|
+
%link{:href => "//cdn.datatables.net/plug-ins/725b2a2115b/integration/bootstrap/3/dataTables.bootstrap.css", :rel => "stylesheet"}/
|
13
|
+
%link{:href => "//cdn.datatables.net/colreorder/1.1.2/css/dataTables.colReorder.css", :rel => "stylesheet"}/
|
14
|
+
%link{:href => "//cdn.datatables.net/colvis/1.1.1/css/dataTables.colVis.css", :rel => "stylesheet"}/
|
15
|
+
%link{:href => "/resources/perfect-scrollbar.min.css", :rel => "stylesheet"}/
|
16
|
+
%link{:href => "/resources/toggle-switch.css", :rel => "stylesheet"}/
|
17
|
+
%link{:href => "/style.css", :rel => "stylesheet"}/
|
18
|
+
/ HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries
|
19
|
+
/[if lt IE 9]
|
20
|
+
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
21
|
+
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
22
|
+
%body
|
23
|
+
- if session[:alert]
|
24
|
+
- message, type = session[:alert]
|
25
|
+
- session[:alert] = nil
|
26
|
+
.container
|
27
|
+
#fadeout-alert.alert(class="alert-#{type}")
|
28
|
+
&= message
|
29
|
+
!= yield
|
30
|
+
%script{:src => "//code.jquery.com/jquery-1.11.1.min.js"}
|
31
|
+
%script{:src => "//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"}
|
32
|
+
%script{:src => "//cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"}
|
33
|
+
%script{:src => "//cdn.datatables.net/plug-ins/725b2a2115b/integration/bootstrap/3/dataTables.bootstrap.js"}
|
34
|
+
%script{:src => "//cdn.datatables.net/colreorder/1.1.2/js/dataTables.colReorder.min.js"}
|
35
|
+
%script{:src => "/resources/dataTables.colVis.js"}
|
36
|
+
%script{:src => "/resources/bootbox.min.js"}
|
37
|
+
%script{:src => "/resources/shortcut.js"}
|
38
|
+
%script{:src => "/resources/perfect-scrollbar.min.js"}
|
39
|
+
%script{:src => "/resources/jquery.outerclick.js"}
|
40
|
+
%script{:src => "/resources/jquery.slidenavbar.js"}
|
41
|
+
%script{:src => "/resources/jquery.moveto.js"}
|
42
|
+
%script{:src => "/resources/narou.library.js"}
|
43
|
+
%script{:src => "/resources/common.ui.js"}
|
44
|
+
:javascript
|
45
|
+
var slideNavbar = $(".navbar-collapse").slideNavbar();
|
46
|
+
if (typeof local_initialize_function !== "undefined") local_initialize_function($);
|
47
|
+
- if env["PATH_INFO"] == "/"
|
48
|
+
%script{:src => "/resources/narou.ui.js"}
|
49
|
+
|
@@ -0,0 +1,177 @@
|
|
1
|
+
-# このページ内専用のjavascriptでjQueryオブジェクトを参照したい場合この関数に記述
|
2
|
+
:javascript
|
3
|
+
var local_initialize_function = function($) {
|
4
|
+
var notification = new Narou.Notification();
|
5
|
+
var stream_console = new Narou.Console(notification, {
|
6
|
+
restore: false, buttons: false
|
7
|
+
});
|
8
|
+
var action = new Narou.Action(null);
|
9
|
+
|
10
|
+
// 小説変換ボタン
|
11
|
+
$("#console-dialog").on("shown.bs.modal", function() {
|
12
|
+
action.convert("#{h @id}");
|
13
|
+
});
|
14
|
+
$("#btn-convert").on("click", function(e) {
|
15
|
+
e.preventDefault();
|
16
|
+
stream_console.clear();
|
17
|
+
$("#console-dialog").modal();
|
18
|
+
});
|
19
|
+
|
20
|
+
// フォルダを開くボタン
|
21
|
+
$("#btn-folder").on("click", function(e) {
|
22
|
+
e.preventDefault();
|
23
|
+
action.folder("#{h @id}");
|
24
|
+
});
|
25
|
+
|
26
|
+
var tooltip_opt = {
|
27
|
+
animation: false,
|
28
|
+
container: "body",
|
29
|
+
};
|
30
|
+
|
31
|
+
// replace.txt 設定パネル
|
32
|
+
$(".btn-replace-remove").on("click", function(e) {
|
33
|
+
e.preventDefault();
|
34
|
+
if ($(".replace-pattern-tr").size() === 1) {
|
35
|
+
// 入力欄のtrが全部なくなると追加出来なくなるので、消す前に1個追加しておく
|
36
|
+
$("#btn-replace-add").trigger("click");
|
37
|
+
}
|
38
|
+
$(this).tooltip("destroy").closest("tr").remove();
|
39
|
+
});
|
40
|
+
$blank_tr = $(".replace-pattern-tr:last").clone(true); // 読み込み直後の末尾は空なので流用
|
41
|
+
$("#btn-replace-add").on("click", function(e) {
|
42
|
+
e.preventDefault();
|
43
|
+
var $clone = $blank_tr.clone(true);
|
44
|
+
$clone.find("button").tooltip(tooltip_opt);
|
45
|
+
$(".replace-pattern-tr:last").after($clone);
|
46
|
+
$(this).tooltip("hide");
|
47
|
+
});
|
48
|
+
|
49
|
+
$("[data-toggle=tooltip]").tooltip(tooltip_opt); // tooltip要素がコピーされないようにclone後に
|
50
|
+
};
|
51
|
+
|
52
|
+
%form(action="/novels/#{@id}/setting" method="POST")
|
53
|
+
.navbar.navbar-default.navbar-fixed-top(role="navigation")
|
54
|
+
.container
|
55
|
+
.navbar-header
|
56
|
+
%button.navbar-toggle(type="button")
|
57
|
+
%span.sr-only Toggle navigation
|
58
|
+
%span.icon-bar
|
59
|
+
%span.icon-bar
|
60
|
+
%span.icon-bar
|
61
|
+
%a.navbar-brand(href="#" data-move-to="top") Narou.rb WEB UI
|
62
|
+
.collapse.navbar-collapse
|
63
|
+
%ul.nav.navbar-nav
|
64
|
+
%li.active
|
65
|
+
%a(href="/novels/#{@id}/setting") 小説設定
|
66
|
+
%li
|
67
|
+
%a(href="/") 戻る
|
68
|
+
.navbar-form.navbar-left
|
69
|
+
%input.btn.btn-info(type="submit" value="設定を保存" style="margin-left: 50px")
|
70
|
+
%button#btn-convert.btn.btn-default この小説を変換
|
71
|
+
%button#btn-folder.btn.btn-default フォルダを開く
|
72
|
+
%p#queue-text.navbar-text.navbar-right(data-toggle="tooltip" title="キューに積まれた処理の数" data-placement="bottom")
|
73
|
+
%span.glyphicon.glyphicon-inbox
|
74
|
+
%span#queue 0
|
75
|
+
|
76
|
+
.container.container-main.theme-showcase(role="main")
|
77
|
+
%p.visible-xs-inline
|
78
|
+
%input(type="submit" value="設定を保存" class="btn btn-info" style="float:none")
|
79
|
+
|
80
|
+
%p.panel-settings-link
|
81
|
+
goto <a href="#replace-panel" data-move-to="#replace-panel">置換設定</a>
|
82
|
+
|
83
|
+
#setting-panel.panel.panel-info.panel-settings
|
84
|
+
.panel-heading <b>#{h @novel_title}</b> の変換設定
|
85
|
+
.panel-body
|
86
|
+
・この小説専用の変換時の設定を変更出来ます(setting.ini を書き換えます)<br>
|
87
|
+
・変更を反映させるには再度変換を実行する必要があります<br>
|
88
|
+
・環境設定で force.* 系設定が有効になっている場合、ここでの該当項目は無視されます<br>
|
89
|
+
・保存するとこの小説の setting.ini に書かれているコメントは削除されます
|
90
|
+
.list-group
|
91
|
+
- @default_settings.each do |info|
|
92
|
+
- name = info[:name]
|
93
|
+
- value = @novel_setting[name]
|
94
|
+
- help = info[:help].strip.gsub("\n", "<br>")
|
95
|
+
- list_group_item_style = {}
|
96
|
+
- force_value = @force_settings["force.#{name}"]
|
97
|
+
- if @error_list[name]
|
98
|
+
- list_group_item_style = {class: "has-error", style: "background-color:#f2dede"}
|
99
|
+
- elsif force_value.nil?.!
|
100
|
+
- list_group_item_style = {style: "background-color: #fcf8e3"}
|
101
|
+
.list-group-item.form-group{list_group_item_style}
|
102
|
+
%h4.list-group-item-heading #{name}
|
103
|
+
.list-group-item-text
|
104
|
+
- case info[:type]
|
105
|
+
- when :boolean
|
106
|
+
%label(class="switch-light well")
|
107
|
+
<input type="checkbox" name="#{name}" #{value ? "checked" : ""}>
|
108
|
+
%span
|
109
|
+
%span しない
|
110
|
+
%span する
|
111
|
+
%a(class="btn btn-primary")
|
112
|
+
- else
|
113
|
+
%input{type:"text", name:name, value:value, class:"form-control",
|
114
|
+
placeholder:Helper.variable_type_to_description(info[:type]).strip }
|
115
|
+
%p #{help}
|
116
|
+
.help-extra-messages
|
117
|
+
%p デフォルト:#{h value_to_msg(info[:value])}
|
118
|
+
- unless force_value.nil?
|
119
|
+
%p
|
120
|
+
%b force.#{name} が有効になっています(設定値:#{h value_to_msg(force_value)})
|
121
|
+
- if @error_list[name]
|
122
|
+
%p.alert-danger
|
123
|
+
&= @error_list[name]
|
124
|
+
.clear
|
125
|
+
|
126
|
+
%p.panel-settings-link
|
127
|
+
goto <a href="#setting-panel" data-move-to="#setting-panel">変換設定</a>
|
128
|
+
|
129
|
+
#replace-panel.panel.panel-info.panel-settings
|
130
|
+
.panel-heading <b>#{h @novel_title}</b> の置換設定
|
131
|
+
.panel-body
|
132
|
+
・小説の文章を置換する設定を行うことが出来ます(replace.txt を書き換えます)<br>
|
133
|
+
・変更を反映させるには再度変換を実行する必要があります<br>
|
134
|
+
・保存するとこの小説の replace.txt に書かれているコメントは削除されます<br>
|
135
|
+
・replace.txt による置換が行われるタイミングは、全てのテキスト処理が行われた後の、整形済みテキスト全文です。つまり見出しやストーリー等も置換対象です。
|
136
|
+
.list-group
|
137
|
+
.list-group-item.form-group
|
138
|
+
.list-group-item-text
|
139
|
+
%table#replace-txt-table
|
140
|
+
%thead
|
141
|
+
%tr
|
142
|
+
%td 対象文字列
|
143
|
+
%td
|
144
|
+
%td 置き換える文字列
|
145
|
+
%td
|
146
|
+
%tbody
|
147
|
+
-# 末尾に新規入力用の空要素を追加
|
148
|
+
- (@replace_pattern + [["",""]]).each do |pattern|
|
149
|
+
%tr.replace-pattern-tr
|
150
|
+
%td
|
151
|
+
%input{type:"text", name:"replace_pattern[][left]", value:pattern[0], class:"form-control"}
|
152
|
+
%td
|
153
|
+
%span.glyphicon.glyphicon-chevron-right
|
154
|
+
%td
|
155
|
+
%input{type:"text", name:"replace_pattern[][right]", value:pattern[1], class:"form-control"}
|
156
|
+
%td
|
157
|
+
%button.btn-replace-remove.btn.btn-default(data-toggle="tooltip" title="削除" data-placement="right")
|
158
|
+
%span.glyphicon.glyphicon-remove
|
159
|
+
%tr
|
160
|
+
%td(colspan=4)
|
161
|
+
%button#btn-replace-add.btn.btn-default(data-toggle="tooltip" title="1行追加" data-placement="right")
|
162
|
+
%span.glyphicon.glyphicon-plus
|
163
|
+
|
164
|
+
%input(type="submit" value="設定を保存" class="btn btn-info" style="float:none")
|
165
|
+
|
166
|
+
#console-dialog.modal.fade(tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true")
|
167
|
+
.modal-dialog
|
168
|
+
.modal-content
|
169
|
+
.modal-header
|
170
|
+
%button(type="button" class="close" data-dismiss="modal")
|
171
|
+
%span(aria-hidden="true") ×
|
172
|
+
%span.sr-only Close
|
173
|
+
%h4.modal-title サブコンソール
|
174
|
+
.modal-body
|
175
|
+
#console.console
|
176
|
+
.modal-footer
|
177
|
+
%button.btn.btn-primary(type="button" data-dismiss="modal") 閉じる
|