narou 2.8.3 → 2.8.3.1
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 +4 -4
- data/ChangeLog.md +0 -38
- data/Gemfile +1 -2
- data/README.md +7 -0
- data/lib/command/setting.rb +5 -20
- data/lib/command/version.rb +2 -1
- data/lib/command/web.rb +7 -64
- data/lib/downloader.rb +1 -4
- data/lib/narou.rb +0 -20
- data/lib/novelconverter.rb +1 -1
- data/lib/version.rb +1 -1
- data/lib/web/appserver.rb +15 -67
- data/lib/web/public/resources/narou.library.js +12 -93
- data/lib/web/public/resources/narou.ui.js +52 -152
- data/lib/web/pushserver.rb +3 -14
- data/lib/web/views/about.haml +85 -0
- data/lib/web/views/{_diff_list.haml → diff_list.haml} +0 -0
- data/lib/web/views/{_edit_replace_txt.haml → edit_replace_txt.haml} +4 -4
- data/lib/web/views/help.haml +2 -2
- data/lib/web/views/index.haml +2 -13
- data/lib/web/views/layout.haml +2 -3
- data/lib/web/views/novels/setting.haml +3 -14
- data/lib/web/views/settings.haml +2 -2
- data/lib/web/views/style.scss +11 -44
- data/narou.gemspec +3 -4
- data/narou.rb +8 -7
- data/preset/ncode.syosetu.com/n8725k/converter.rb +1 -1
- data/spec/generator/convert_spec_gen.rb +0 -2
- metadata +7 -10
- data/lib/web/views/_about.haml +0 -188
- data/lib/web/views/_rebooting.haml +0 -18
- data/preset/ncode.syosetu.com/n5115cq/converter.rb +0 -30
data/lib/web/pushserver.rb
CHANGED
@@ -19,7 +19,7 @@ module Narou
|
|
19
19
|
attr_reader :accepted_domains, :connections
|
20
20
|
|
21
21
|
def accepted_domains=(domains)
|
22
|
-
@accepted_domains = Array
|
22
|
+
@accepted_domains = domains.kind_of?(Array) ? domains : [domains]
|
23
23
|
end
|
24
24
|
|
25
25
|
def initialize
|
@@ -100,23 +100,12 @@ module Narou
|
|
100
100
|
# echo 以外のイベントは履歴に保存しない
|
101
101
|
message = data[:echo]
|
102
102
|
if message
|
103
|
-
stack_to_history(message)
|
104
|
-
end
|
105
|
-
rescue JSON::GeneratorError => e
|
106
|
-
STDERR.puts $@.shift + ": #{e.message} (#{e.class})"
|
107
|
-
end
|
108
|
-
|
109
|
-
def stack_to_history(message)
|
110
|
-
if message == "." && @history[-1] =~ /\A\.+\z/
|
111
|
-
# 進行中を表す .... の出力でヒストリーが消費されるのを防ぐため、
|
112
|
-
# 連続した . は一つにまとめる
|
113
|
-
@history[-1] << "."
|
114
|
-
else
|
115
103
|
@history.push(message)
|
116
104
|
@history.shift
|
117
105
|
end
|
106
|
+
rescue JSON::GeneratorError => e
|
107
|
+
STDERR.puts $@.shift + ": #{e.message} (#{e.class})"
|
118
108
|
end
|
119
|
-
|
120
109
|
end
|
121
110
|
end
|
122
111
|
|
@@ -0,0 +1,85 @@
|
|
1
|
+
:javascript
|
2
|
+
$result = $("#result-of-version-checking");
|
3
|
+
$result.children("div").hide();
|
4
|
+
$result.children(".checking").show();
|
5
|
+
|
6
|
+
function getCurrentVersion() {
|
7
|
+
var dfd = jQuery.Deferred();
|
8
|
+
$.ajax({
|
9
|
+
type: "GET",
|
10
|
+
url: "/api/version/current.json",
|
11
|
+
dataType: "json",
|
12
|
+
success: function(json) {
|
13
|
+
$("#current-version").text(json.version);
|
14
|
+
dfd.resolve(json.version);
|
15
|
+
},
|
16
|
+
error: function() {
|
17
|
+
dfd.reject();
|
18
|
+
}
|
19
|
+
});
|
20
|
+
return dfd;
|
21
|
+
}
|
22
|
+
|
23
|
+
function getLatestVersion() {
|
24
|
+
var dfd = jQuery.Deferred();
|
25
|
+
$.ajax({
|
26
|
+
type: "GET",
|
27
|
+
url: "/api/version/latest.json",
|
28
|
+
dataType: "json",
|
29
|
+
success: function(json) {
|
30
|
+
$("#latest-version").text(json.version);
|
31
|
+
dfd.resolve(json.version);
|
32
|
+
},
|
33
|
+
error: function() {
|
34
|
+
dfd.reject();
|
35
|
+
}
|
36
|
+
});
|
37
|
+
return dfd;
|
38
|
+
}
|
39
|
+
|
40
|
+
$.when(
|
41
|
+
getCurrentVersion(),
|
42
|
+
getLatestVersion()
|
43
|
+
)
|
44
|
+
.done(function(current_version, latest_version) {
|
45
|
+
$result.children(".checking").hide();
|
46
|
+
if (latest_version > current_version) {
|
47
|
+
$("#latest-version").text(latest_version);
|
48
|
+
$result.children(".need-an-update").show();
|
49
|
+
}
|
50
|
+
else {
|
51
|
+
$result.children(".version-is-latest").show();
|
52
|
+
}
|
53
|
+
})
|
54
|
+
.fail(function() {
|
55
|
+
$result.children(".checking").hide();
|
56
|
+
$result.children(".error").show();
|
57
|
+
});
|
58
|
+
|
59
|
+
%div(style="text-align:center")
|
60
|
+
%h1
|
61
|
+
%strong Narou.rb
|
62
|
+
%div
|
63
|
+
Version #{@narourb_version}
|
64
|
+
%div
|
65
|
+
Copyright 2013 whiteleaf. All rights reserved.
|
66
|
+
#result-of-version-checking(style="margin-top:10px")
|
67
|
+
.checking
|
68
|
+
%span#version-checking-icon
|
69
|
+
%span(style="padding-left:23px")
|
70
|
+
アップデートを確認しています...
|
71
|
+
.version-is-latest
|
72
|
+
%span.glyphicon.glyphicon-thumbs-up.text-primary
|
73
|
+
Narou.rb は最新版です。
|
74
|
+
.need-an-update
|
75
|
+
%span.glyphicon.glyphicon-exclamation-sign.text-danger
|
76
|
+
新しいバージョン(<span id="latest-version"></span>)が見つかりました。<br>
|
77
|
+
<kbd>gem update narou</kbd> で更新出来ます。<br>
|
78
|
+
%a(href="https://github.com/whiteleaf7/narou#%E6%9B%B4%E6%96%B0%E5%B1%A5%E6%AD%B4---changelog" target="_blank")
|
79
|
+
更新履歴を確認する。
|
80
|
+
.error
|
81
|
+
%span.text-danger
|
82
|
+
最新バージョンの取得に失敗しました。
|
83
|
+
.well.well-sm(style="font-size:80%; margin-top: 10px")
|
84
|
+
#{@ruby_version}<br>
|
85
|
+
#{env["HTTP_USER_AGENT"]}
|
File without changes
|
@@ -24,11 +24,11 @@
|
|
24
24
|
$("[data-toggle=remove-tooltip]").tooltip(tooltip_opt);
|
25
25
|
});
|
26
26
|
|
27
|
-
#replace-panel.panel.panel-settings{ class: replace_panel_var[:panel_class] }
|
27
|
+
#replace-panel.panel.panel-settings{ class: @replace_panel_var[:panel_class] }
|
28
28
|
.panel-heading
|
29
|
-
= replace_panel_var[:title]
|
30
|
-
.panel-body{ class: replace_panel_var[:body_class] }
|
31
|
-
= replace_panel_var[:body].join("<br>")
|
29
|
+
= @replace_panel_var[:title]
|
30
|
+
.panel-body{ class: @replace_panel_var[:body_class] }
|
31
|
+
= @replace_panel_var[:body].join("<br>")
|
32
32
|
.list-group
|
33
33
|
.list-group-item.form-group
|
34
34
|
.list-group-item-text
|
data/lib/web/views/help.haml
CHANGED
@@ -6,8 +6,6 @@
|
|
6
6
|
});
|
7
7
|
|
8
8
|
var bookmarklet = function(d,e,u,o,s) {
|
9
|
-
u='#{request.scheme}://#{env["SERVER_NAME"]}:#{env["SERVER_PORT"]}'+
|
10
|
-
'/js/widget.js?mode=%MODE%&_='+Date.now();
|
11
9
|
o=d.createElement("div");
|
12
10
|
o.innerHTML="WEB UI Server: OFFLINE";
|
13
11
|
o.id="narourb-offline";
|
@@ -23,6 +21,8 @@
|
|
23
21
|
s.top=0
|
24
22
|
},1000);
|
25
23
|
|
24
|
+
u='#{request.scheme}://#{env["SERVER_NAME"]}:#{env["SERVER_PORT"]}'+
|
25
|
+
'/js/widget.js?mode=%MODE%&t='+Date.now();
|
26
26
|
e=d.createElement('script');
|
27
27
|
e.charset='utf-8';
|
28
28
|
e.src=u;
|
data/lib/web/views/index.haml
CHANGED
@@ -30,12 +30,6 @@
|
|
30
30
|
%span.active-ok.glyphicon.glyphicon-ok
|
31
31
|
凍結中を表示
|
32
32
|
%li.divider
|
33
|
-
%li#action-view-toggle-setting-page-open-new-tab
|
34
|
-
%a(href="#")
|
35
|
-
%span
|
36
|
-
%span.active-ok.glyphicon.glyphicon-ok
|
37
|
-
変換設定ページは新規タブで開く
|
38
|
-
%li.divider
|
39
33
|
%li#action-view-reset
|
40
34
|
%a(href="/") 表示設定を全てリセット
|
41
35
|
%li.dropdown
|
@@ -130,11 +124,6 @@
|
|
130
124
|
%span.glyphicon.glyphicon-info-sign
|
131
125
|
Narou.rb について
|
132
126
|
%li.divider
|
133
|
-
%li#action-option-server-reboot
|
134
|
-
%a(href="#")
|
135
|
-
%span
|
136
|
-
%span.glyphicon.glyphicon-refresh
|
137
|
-
サーバを再起動
|
138
127
|
%li#action-option-server-shutdown
|
139
128
|
%a(href="#")
|
140
129
|
%span
|
@@ -191,10 +180,10 @@
|
|
191
180
|
%ul.dropdown-menu(role="menu")
|
192
181
|
%li
|
193
182
|
%a#button-update-view(href="#") 表示されている小説を更新
|
194
|
-
%li
|
195
|
-
%a#button-update-force(href="#") 凍結済みでも更新
|
196
183
|
%li
|
197
184
|
%a#button-update-general-lastup(href="#") 最新話掲載日を更新
|
185
|
+
%li
|
186
|
+
%a#button-update-force(href="#") 凍結済みでも更新
|
198
187
|
.btn-group
|
199
188
|
%button#button-send.btn.btn-warning(type="button") Send
|
200
189
|
- if Inventory.load("local_setting")["hotentry"]
|
data/lib/web/views/layout.haml
CHANGED
@@ -38,11 +38,10 @@
|
|
38
38
|
!= yield
|
39
39
|
%script{:src => "//code.jquery.com/jquery-1.11.1.min.js"}
|
40
40
|
%script{:src => "//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"}
|
41
|
-
%script{:src => "//cdn.datatables.net/1.10.
|
41
|
+
%script{:src => "//cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"}
|
42
42
|
%script{:src => "//cdn.datatables.net/plug-ins/725b2a2115b/integration/bootstrap/3/dataTables.bootstrap.js"}
|
43
|
-
%script{:src => "//cdn.datatables.net/colreorder/1.
|
43
|
+
%script{:src => "//cdn.datatables.net/colreorder/1.1.2/js/dataTables.colReorder.min.js"}
|
44
44
|
%script{:src => "//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.5/js/bootstrap-select.min.js"}
|
45
|
-
%script{:src => "//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"}
|
46
45
|
%script{:src => "/resources/dataTables.colVis.js"}
|
47
46
|
%script{:src => "/resources/bootbox.min.js"}
|
48
47
|
%script{:src => "/resources/shortcut.js"}
|
@@ -6,7 +6,6 @@
|
|
6
6
|
restore: false, buttons: false
|
7
7
|
});
|
8
8
|
var action = new Narou.Action(null);
|
9
|
-
var storage = new Narou.Storage;
|
10
9
|
|
11
10
|
// 小説変換ボタン
|
12
11
|
$("#console-dialog").on("shown.bs.modal", function() {
|
@@ -35,16 +34,6 @@
|
|
35
34
|
container: "body",
|
36
35
|
width: "100%"
|
37
36
|
});
|
38
|
-
|
39
|
-
// 変換設定ページを新規タブで開く様に設定している場合、
|
40
|
-
// 「戻る」リンクを「閉じる」に書き換える
|
41
|
-
if (storage.get("open_new_tab_setting_pages")) {
|
42
|
-
$("#back-to")
|
43
|
-
.html('<a href="#">閉じる</a>')
|
44
|
-
.on("click", function() {
|
45
|
-
window.close();
|
46
|
-
});
|
47
|
-
}
|
48
37
|
});
|
49
38
|
|
50
39
|
%form(action="/novels/#{@id}/setting" method="POST")
|
@@ -61,7 +50,7 @@
|
|
61
50
|
%ul.nav.navbar-nav
|
62
51
|
%li.active
|
63
52
|
%a(href="/novels/#{@id}/setting") 小説設定
|
64
|
-
%li
|
53
|
+
%li
|
65
54
|
%a(href="/") 戻る
|
66
55
|
.navbar-form.navbar-left
|
67
56
|
%input.btn.btn-info(type="submit" value="設定を保存" style="margin-left: 50px")
|
@@ -149,13 +138,13 @@
|
|
149
138
|
%p.panel-settings-link
|
150
139
|
goto <a href="#setting-panel" data-move-to="#setting-panel">変換設定</a>
|
151
140
|
|
152
|
-
- replace_panel_var = { title: "<b>#{h @novel_title}</b> の置換設定",
|
141
|
+
- @replace_panel_var = { title: "<b>#{h @novel_title}</b> の置換設定",
|
153
142
|
panel_class: "panel-info",
|
154
143
|
body_class: "",
|
155
144
|
body: ["・この小説の文章を置換する設定を行うことが出来ます(replace.txt を書き換えます)",
|
156
145
|
"・変更を反映させるには再度変換を実行する必要があります",
|
157
146
|
"・保存するとこの小説の replace.txt に書かれているコメントは削除されます"] }
|
158
|
-
= haml :
|
147
|
+
= haml :edit_replace_txt
|
159
148
|
|
160
149
|
%input(type="submit" value="設定を保存" class="btn btn-info" style="float:none")
|
161
150
|
|
data/lib/web/views/settings.haml
CHANGED
@@ -151,11 +151,11 @@
|
|
151
151
|
.clearfix
|
152
152
|
|
153
153
|
.tab-pane(role="tabpanel" id="replace")
|
154
|
-
- replace_panel_var = { title: "全小説対象の置換設定",
|
154
|
+
- @replace_panel_var = { title: "全小説対象の置換設定",
|
155
155
|
panel_class: "panel-info",
|
156
156
|
body_class: "list-group-item-default",
|
157
157
|
body: ["・全ての小説に対する置換設定を行うことが出来ます",
|
158
158
|
"・変更を反映させるには再度変換を実行する必要があります"] }
|
159
|
-
= haml :
|
159
|
+
= haml :edit_replace_txt
|
160
160
|
|
161
161
|
%input(type="submit" value="設定を保存" class="btn btn-info" style="float:none")
|
data/lib/web/views/style.scss
CHANGED
@@ -606,7 +606,6 @@ $console-color: white;
|
|
606
606
|
margin-bottom: 20px !important;
|
607
607
|
}
|
608
608
|
.console {
|
609
|
-
text-align: left;
|
610
609
|
position: relative;
|
611
610
|
overflow: hidden;
|
612
611
|
padding: 5px 15px 5px 15px;
|
@@ -1041,23 +1040,17 @@ $console-color: white;
|
|
1041
1040
|
}
|
1042
1041
|
|
1043
1042
|
/* くるくるまわるアイコン */
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
animation: spin 1s linear infinite;
|
1056
|
-
}
|
1057
|
-
|
1058
|
-
.text {
|
1059
|
-
padding-left: 23px;
|
1060
|
-
}
|
1043
|
+
#version-checking-icon {
|
1044
|
+
display: inline-block;
|
1045
|
+
position: absolute;
|
1046
|
+
width: 18px;
|
1047
|
+
height: 18px;
|
1048
|
+
border-radius: 50%;
|
1049
|
+
border: 4px solid #17cddd;
|
1050
|
+
border-right-color: transparent;
|
1051
|
+
-webkit-animation: spin 1s linear infinite;
|
1052
|
+
-moz-animation: spin 1s linear infinite;
|
1053
|
+
animation: spin 1s linear infinite;
|
1061
1054
|
}
|
1062
1055
|
@-webkit-keyframes spin {
|
1063
1056
|
0% { -webkit-transform: rotate(0deg); opacity: 0.4; }
|
@@ -1074,29 +1067,3 @@ $console-color: white;
|
|
1074
1067
|
50% { transform: rotate(180deg); opacity: 1; }
|
1075
1068
|
100% { transform: rotate(360deg); opacity: 0.4; }
|
1076
1069
|
}
|
1077
|
-
|
1078
|
-
.link-to-changelog-in-about {
|
1079
|
-
position: absolute;
|
1080
|
-
top: 5px;
|
1081
|
-
right: 15px;
|
1082
|
-
}
|
1083
|
-
|
1084
|
-
.log-box {
|
1085
|
-
position: relative;
|
1086
|
-
text-align: left;
|
1087
|
-
width: 100%;
|
1088
|
-
width: 100%;
|
1089
|
-
max-width: 100%;
|
1090
|
-
min-width: 100%;
|
1091
|
-
height: 100px;
|
1092
|
-
overflow-x: hidden;
|
1093
|
-
overflow-y: scroll;
|
1094
|
-
border-radius: 4px;
|
1095
|
-
border: 1px solid lightgray;
|
1096
|
-
font-size: 85%;
|
1097
|
-
padding: 5px;
|
1098
|
-
|
1099
|
-
&.large {
|
1100
|
-
height: 270px;
|
1101
|
-
}
|
1102
|
-
}
|
data/narou.gemspec
CHANGED
@@ -32,12 +32,11 @@ Gem::Specification.new do |gem|
|
|
32
32
|
install_message = <<-EOS
|
33
33
|
#{"*" * 79}
|
34
34
|
|
35
|
-
2.8.
|
35
|
+
2.8.3 : 2016/03/01
|
36
36
|
------------------
|
37
37
|
#### HotFix
|
38
|
-
-
|
39
|
-
+
|
40
|
-
エラーが出るので、https なURLでダウンロードをして下さい
|
38
|
+
- ノクターン・ムーンライト・ミッドナイトノベルズの認証方法変更に対応しました
|
39
|
+
+ 404エラーがでて凍結されてしまった場合、凍結を解除したあと再度更新して下さい
|
41
40
|
|
42
41
|
#{"*" * 79}
|
43
42
|
EOS
|
data/narou.rb
CHANGED
@@ -26,13 +26,6 @@ if ARGV.delete("--time")
|
|
26
26
|
end
|
27
27
|
|
28
28
|
require_relative "lib/inventory"
|
29
|
-
|
30
|
-
$development = Narou.commit_version.!
|
31
|
-
begin
|
32
|
-
require "pry" if $development
|
33
|
-
rescue LoadError
|
34
|
-
end
|
35
|
-
|
36
29
|
global = Inventory.load("global_setting", :global)
|
37
30
|
$display_backtrace = ARGV.delete("--backtrace")
|
38
31
|
$display_backtrace ||= $debug
|
@@ -45,6 +38,14 @@ require_relative "lib/commandline"
|
|
45
38
|
|
46
39
|
rescue_level = $debug ? Exception : StandardError
|
47
40
|
|
41
|
+
if !global["dismiss-notice"] && RUBY_VERSION < "2.1.0"
|
42
|
+
puts <<-EOS.termcolor
|
43
|
+
<cyan><bold>[Notice]
|
44
|
+
ご使用のRubyのバージョンが#{RUBY_VERSION}と古いままです。近い将来Ruby2.1.0以上を必須とする予定なので準備をお願いします
|
45
|
+
このお知らせを消すには narou s dismiss-notice=true を実行して下さい</bold></cyan>
|
46
|
+
EOS
|
47
|
+
end
|
48
|
+
|
48
49
|
begin
|
49
50
|
CommandLine.run(ARGV.map { |v| v.dup })
|
50
51
|
rescue SystemExit => e
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: narou
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.3
|
4
|
+
version: 2.8.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- whiteleaf7
|
@@ -398,12 +398,11 @@ files:
|
|
398
398
|
- lib/web/settingmessages.rb
|
399
399
|
- lib/web/streaminginput.rb
|
400
400
|
- lib/web/streaminglogger.rb
|
401
|
-
- lib/web/views/
|
402
|
-
- lib/web/views/_diff_list.haml
|
403
|
-
- lib/web/views/_edit_replace_txt.haml
|
404
|
-
- lib/web/views/_rebooting.haml
|
401
|
+
- lib/web/views/about.haml
|
405
402
|
- lib/web/views/bookmarklet/download.js.erb
|
406
403
|
- lib/web/views/bookmarklet/insert_button.js.erb
|
404
|
+
- lib/web/views/diff_list.haml
|
405
|
+
- lib/web/views/edit_replace_txt.haml
|
407
406
|
- lib/web/views/help.haml
|
408
407
|
- lib/web/views/index.haml
|
409
408
|
- lib/web/views/layout.haml
|
@@ -438,7 +437,6 @@ files:
|
|
438
437
|
- preset/ncode.syosetu.com/n3730bn/converter.rb
|
439
438
|
- preset/ncode.syosetu.com/n4259s/converter.rb
|
440
439
|
- preset/ncode.syosetu.com/n4259s/setting.ini
|
441
|
-
- preset/ncode.syosetu.com/n5115cq/converter.rb
|
442
440
|
- preset/ncode.syosetu.com/n7975cr/setting.ini
|
443
441
|
- preset/ncode.syosetu.com/n8725k/converter.rb
|
444
442
|
- preset/ncode.syosetu.com/n9078bd/converter.rb
|
@@ -532,12 +530,11 @@ metadata: {}
|
|
532
530
|
post_install_message: |
|
533
531
|
*******************************************************************************
|
534
532
|
|
535
|
-
2.8.
|
533
|
+
2.8.3 : 2016/03/01
|
536
534
|
------------------
|
537
535
|
#### HotFix
|
538
|
-
-
|
539
|
-
+
|
540
|
-
エラーが出るので、https なURLでダウンロードをして下さい
|
536
|
+
- ノクターン・ムーンライト・ミッドナイトノベルズの認証方法変更に対応しました
|
537
|
+
+ 404エラーがでて凍結されてしまった場合、凍結を解除したあと再度更新して下さい
|
541
538
|
|
542
539
|
*******************************************************************************
|
543
540
|
rdoc_options: []
|