narou 2.8.2 → 2.8.3

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.

@@ -30,6 +30,12 @@
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
33
39
  %li#action-view-reset
34
40
  %a(href="/") 表示設定を全てリセット
35
41
  %li.dropdown
@@ -124,6 +130,11 @@
124
130
  %span.glyphicon.glyphicon-info-sign
125
131
  Narou.rb について
126
132
  %li.divider
133
+ %li#action-option-server-reboot
134
+ %a(href="#")
135
+ %span
136
+ %span.glyphicon.glyphicon-refresh
137
+ サーバを再起動
127
138
  %li#action-option-server-shutdown
128
139
  %a(href="#")
129
140
  %span
@@ -180,10 +191,10 @@
180
191
  %ul.dropdown-menu(role="menu")
181
192
  %li
182
193
  %a#button-update-view(href="#") 表示されている小説を更新
183
- %li
184
- %a#button-update-general-lastup(href="#") 最新話掲載日を更新
185
194
  %li
186
195
  %a#button-update-force(href="#") 凍結済みでも更新
196
+ %li
197
+ %a#button-update-general-lastup(href="#") 最新話掲載日を更新
187
198
  .btn-group
188
199
  %button#button-send.btn.btn-warning(type="button") Send
189
200
  - if Inventory.load("local_setting")["hotentry"]
@@ -38,10 +38,11 @@
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.2/js/jquery.dataTables.min.js"}
41
+ %script{:src => "//cdn.datatables.net/1.10.10/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.1.2/js/dataTables.colReorder.min.js"}
43
+ %script{:src => "//cdn.datatables.net/colreorder/1.3.0/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"}
45
46
  %script{:src => "/resources/dataTables.colVis.js"}
46
47
  %script{:src => "/resources/bootbox.min.js"}
47
48
  %script{:src => "/resources/shortcut.js"}
@@ -6,6 +6,7 @@
6
6
  restore: false, buttons: false
7
7
  });
8
8
  var action = new Narou.Action(null);
9
+ var storage = new Narou.Storage;
9
10
 
10
11
  // 小説変換ボタン
11
12
  $("#console-dialog").on("shown.bs.modal", function() {
@@ -34,6 +35,16 @@
34
35
  container: "body",
35
36
  width: "100%"
36
37
  });
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
+ }
37
48
  });
38
49
 
39
50
  %form(action="/novels/#{@id}/setting" method="POST")
@@ -50,7 +61,7 @@
50
61
  %ul.nav.navbar-nav
51
62
  %li.active
52
63
  %a(href="/novels/#{@id}/setting") 小説設定
53
- %li
64
+ %li#back-to
54
65
  %a(href="/") 戻る
55
66
  .navbar-form.navbar-left
56
67
  %input.btn.btn-info(type="submit" value="設定を保存" style="margin-left: 50px")
@@ -138,13 +149,13 @@
138
149
  %p.panel-settings-link
139
150
  goto <a href="#setting-panel" data-move-to="#setting-panel">変換設定</a>
140
151
 
141
- - @replace_panel_var = { title: "<b>#{h @novel_title}</b> の置換設定",
152
+ - replace_panel_var = { title: "<b>#{h @novel_title}</b> の置換設定",
142
153
  panel_class: "panel-info",
143
154
  body_class: "",
144
155
  body: ["・この小説の文章を置換する設定を行うことが出来ます(replace.txt を書き換えます)",
145
156
  "・変更を反映させるには再度変換を実行する必要があります",
146
157
  "・保存するとこの小説の replace.txt に書かれているコメントは削除されます"] }
147
- = haml :edit_replace_txt
158
+ = haml :_edit_replace_txt, locals: { replace_panel_var: replace_panel_var }
148
159
 
149
160
  %input(type="submit" value="設定を保存" class="btn btn-info" style="float:none")
150
161
 
@@ -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 :edit_replace_txt
159
+ = haml :_edit_replace_txt, locals: { replace_panel_var: replace_panel_var }
160
160
 
161
161
  %input(type="submit" value="設定を保存" class="btn btn-info" style="float:none")
@@ -606,6 +606,7 @@ $console-color: white;
606
606
  margin-bottom: 20px !important;
607
607
  }
608
608
  .console {
609
+ text-align: left;
609
610
  position: relative;
610
611
  overflow: hidden;
611
612
  padding: 5px 15px 5px 15px;
@@ -1040,17 +1041,23 @@ $console-color: white;
1040
1041
  }
1041
1042
 
1042
1043
  /* くるくるまわるアイコン */
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;
1044
+ .rotate-progress {
1045
+ .icon {
1046
+ display: inline-block;
1047
+ position: absolute;
1048
+ width: 18px;
1049
+ height: 18px;
1050
+ border-radius: 50%;
1051
+ border: 4px solid #17cddd;
1052
+ border-right-color: transparent;
1053
+ -webkit-animation: spin 1s linear infinite;
1054
+ -moz-animation: spin 1s linear infinite;
1055
+ animation: spin 1s linear infinite;
1056
+ }
1057
+
1058
+ .text {
1059
+ padding-left: 23px;
1060
+ }
1054
1061
  }
1055
1062
  @-webkit-keyframes spin {
1056
1063
  0% { -webkit-transform: rotate(0deg); opacity: 0.4; }
@@ -1067,3 +1074,29 @@ $console-color: white;
1067
1074
  50% { transform: rotate(180deg); opacity: 1; }
1068
1075
  100% { transform: rotate(360deg); opacity: 0.4; }
1069
1076
  }
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.rb CHANGED
@@ -26,6 +26,13 @@ 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
+
29
36
  global = Inventory.load("global_setting", :global)
30
37
  $display_backtrace = ARGV.delete("--backtrace")
31
38
  $display_backtrace ||= $debug
@@ -38,14 +45,6 @@ require_relative "lib/commandline"
38
45
 
39
46
  rescue_level = $debug ? Exception : StandardError
40
47
 
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
-
49
48
  begin
50
49
  CommandLine.run(ARGV.map { |v| v.dup })
51
50
  rescue SystemExit => e
@@ -0,0 +1,30 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ #
4
+ # 対象小説情報
5
+ # タイトル: 最果てのパラディン
6
+ # 作者: 柳野かなた
7
+ # URL: http://ncode.syosetu.com/n5115cq/
8
+ #
9
+ # 詳細については http://bit.ly/1vTEH04 を参照して下さい
10
+ #
11
+ converter "n5115cq 最果てのパラディン" do
12
+ # 各種変換処理がされる「前」の生データに対しての変換処理を記述
13
+ def before(io, text_type)
14
+ super
15
+ if text_type == "body"
16
+ io.string.gsub!("|《命ず》、《ネー・》", "|《命ず》《ネー・》、")
17
+ io.string.gsub!(/[||]《([^《》]+)》《((?:\p{Hiragana}|\p{Katakana}|[・ー])+)》/) do |match|
18
+ @inspector.info("ルビを調整\n" + match)
19
+ "|≪#{$1}≫《#{$2}》"
20
+ end
21
+ end
22
+ io
23
+ end
24
+
25
+ # 各種変換処理がされた「後」のデータに対しての変換処理を記述
26
+ def after(io, text_type)
27
+ super
28
+ io
29
+ end
30
+ end
@@ -9,7 +9,7 @@
9
9
  converter "n8725k ログ・ホライズン" do
10
10
  def before(io, element_type)
11
11
  super
12
- io.string.gsub!("ルビ:", "")
12
+ io.string.gsub!(/ルビ[::]/, "")
13
13
  io
14
14
  end
15
15
 
@@ -57,6 +57,8 @@ describe "convert" do
57
57
  test_text_dir = File.join(File.dirname(__FILE__), "data/convert_test")
58
58
  @pwd = Dir.pwd
59
59
  Dir.chdir(test_text_dir)
60
+
61
+ Inventory.load("local_setting")["convert.filename-to-ncode"] = false
60
62
  end
61
63
 
62
64
  after :all do
@@ -9,6 +9,7 @@ encoding: UTF-8
9
9
  confirm_over18: yes
10
10
  append_title_to_folder_name: yes
11
11
  title_strip_pattern: null
12
+ cookie: over18=yes
12
13
 
13
14
  # ------------------------------------------------------------
14
15
  # 目次取得設定
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: narou
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.2
4
+ version: 2.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - whiteleaf7
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-05 00:00:00.000000000 Z
11
+ date: 2016-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: termcolorlight
@@ -398,11 +398,12 @@ files:
398
398
  - lib/web/settingmessages.rb
399
399
  - lib/web/streaminginput.rb
400
400
  - lib/web/streaminglogger.rb
401
- - lib/web/views/about.haml
401
+ - lib/web/views/_about.haml
402
+ - lib/web/views/_diff_list.haml
403
+ - lib/web/views/_edit_replace_txt.haml
404
+ - lib/web/views/_rebooting.haml
402
405
  - lib/web/views/bookmarklet/download.js.erb
403
406
  - lib/web/views/bookmarklet/insert_button.js.erb
404
- - lib/web/views/diff_list.haml
405
- - lib/web/views/edit_replace_txt.haml
406
407
  - lib/web/views/help.haml
407
408
  - lib/web/views/index.haml
408
409
  - lib/web/views/layout.haml
@@ -437,6 +438,7 @@ files:
437
438
  - preset/ncode.syosetu.com/n3730bn/converter.rb
438
439
  - preset/ncode.syosetu.com/n4259s/converter.rb
439
440
  - preset/ncode.syosetu.com/n4259s/setting.ini
441
+ - preset/ncode.syosetu.com/n5115cq/converter.rb
440
442
  - preset/ncode.syosetu.com/n7975cr/setting.ini
441
443
  - preset/ncode.syosetu.com/n8725k/converter.rb
442
444
  - preset/ncode.syosetu.com/n9078bd/converter.rb
@@ -1,85 +0,0 @@
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"]}