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.

@@ -9,6 +9,8 @@ $(document).ready(function() {
9
9
  var touchable_device = "ontouchstart" in window;
10
10
  var click_event_name = (touchable_device ? "touchstart" : "click");
11
11
 
12
+ var datatables_init_completed = false;
13
+
12
14
  // MEMO: table 全てに対して操作
13
15
  // table.$("tr.selected").removeClass("selected");
14
16
  // MEMO: .selected が付いている行を全て取得
@@ -20,13 +22,13 @@ $(document).ready(function() {
20
22
  {
21
23
  id: false, last_update: false, title: true, author: false, sitename: false,
22
24
  toc_url: false, novel_type: false, tags: false, status: false, menu: true,
23
- download: true, folder: false, general_lastup: false,
25
+ download: true, folder: false, update_button: false, general_lastup: false,
24
26
  }
25
27
  // PC
26
28
  : {
27
29
  id: true, last_update: true, title: true, author: true, sitename: true,
28
30
  toc_url: true, novel_type: true, tags: true, status: true, menu: true,
29
- download: true, folder: true, general_lastup: true,
31
+ download: true, folder: true, update_button: true, general_lastup: true,
30
32
  });
31
33
 
32
34
  $.fn.dataTable.Api.register("fireChangeSelect()", function() {
@@ -73,10 +75,7 @@ $(document).ready(function() {
73
75
 
74
76
  // initComplete や ajax.reload した時に再設定するために呼ばれる
75
77
  function resettingTableState() {
76
- table.$("[data-toggle=tooltip]").tooltip({
77
- animation: false,
78
- container: "body",
79
- });
78
+ refreshTooltop(table.$("[data-toggle=tooltip]"), null, "top");
80
79
  // バッジを更新しておく(.selectedの復元が終わってから呼ぶ)
81
80
  table.fireChangeSelect();
82
81
  // タグのイベントを反映
@@ -85,6 +84,23 @@ $(document).ready(function() {
85
84
  table.draw(false);
86
85
  }
87
86
 
87
+ function openContextMenuWithTr(tr, event) {
88
+ var $tr = $(tr);
89
+ var target_id = table.row(tr).data().id;
90
+ var $cover = $("<div class=context-menu-target-cover>");
91
+ // MEMO: IEだと要素を追加してから座標を指定しないと反映されない
92
+ $("body").append($cover);
93
+ $cover.offset($tr.offset()).width($tr.width()).height($tr.height());
94
+ $cover.one("contextmenu", function(e) {
95
+ e.preventDefault();
96
+ $cover.remove();
97
+ context_menu.close();
98
+ });
99
+ context_menu.open(target_id, get_event_position(event), function() {
100
+ $cover.remove();
101
+ });
102
+ }
103
+
88
104
  var table = t = $("#novel-list").DataTable({
89
105
  ajax: "/api/list",
90
106
  dom: (touchable_device ? 'lprtpi' : 'Rlprtpi'),
@@ -121,7 +137,7 @@ $(document).ready(function() {
121
137
  display = "<span class=" + klass + ">" + display + "</span>";
122
138
  }
123
139
  }
124
- return display;
140
+ return "<div>" + display + "</div>";
125
141
  }
126
142
  return data;
127
143
  }
@@ -145,7 +161,7 @@ $(document).ready(function() {
145
161
  klass = value[1];
146
162
  if (value[0] === -1 || diff_time <= value[0]) break;
147
163
  }
148
- return '<span class="general-lastup ' + klass + '">' + display + '</span>';
164
+ return '<div><span class="general-lastup ' + klass + '">' + display + '</span></div>';
149
165
  }
150
166
  else if (type === "sort") {
151
167
  return data * 10000 + (row.id | 0);
@@ -201,27 +217,36 @@ $(document).ready(function() {
201
217
  },
202
218
  render: function() {}
203
219
  },
220
+ {
221
+ title: "更新",
222
+ data: "update_button", className: "text-center", orderable: false,
223
+ searchable: false, visible: cell_visible.update_button,
224
+ defaultContent: '<button class="btn btn-default btn-xs">' +
225
+ '<span class="glyphicon glyphicon-refresh"></span></button>',
226
+ createdCell: function(td, cellData, rowData, rowIndex, colIndex) {
227
+ $(td).children("button")
228
+ .data("targetId", rowData.id)
229
+ .on("click", function(e) {
230
+ e.stopPropagation();
231
+ var $this = $(this);
232
+ var target_id = $this.data("targetId");
233
+ action.updateForce(target_id);
234
+ });
235
+ },
236
+ render: function() {}
237
+ },
204
238
  {
205
239
  title: "個別",
206
240
  data: "menu", className: "text-center",
207
241
  defaultContent: '<button class="btn btn-default btn-xs">' +
208
- '<span class="glyphicon glyphicon-cog"></span></button>',
242
+ '<span class="glyphicon glyphicon-option-horizontal"></span></button>',
209
243
  visible: cell_visible.menu,
210
244
  createdCell: function(td, cellData, rowData, rowIndex, colIndex) {
211
245
  $(td).children("button")
212
246
  .data("targetId", rowData.id)
213
247
  .on("click", function(e) {
214
248
  e.stopPropagation();
215
- var $this = $(this);
216
- var $tr = $(e.target).closest("tr");
217
- var target_id = $this.data("targetId");
218
- var $cover = $("<div class=context-menu-target-cover>");
219
- // MEMO: IEだと要素を追加してから座標を指定しないと反映されない
220
- $("body").append($cover);
221
- $cover.offset($tr.offset()).width($tr.width()).height($tr.height());
222
- context_menu.open(target_id, get_event_position(e), function() {
223
- $cover.remove();
224
- });
249
+ openContextMenuWithTr($(e.target).closest("tr"), e);
225
250
  });
226
251
  },
227
252
  render: function() {},
@@ -275,6 +300,8 @@ $(document).ready(function() {
275
300
  resettingTableState();
276
301
 
277
302
  table.draw(false);
303
+
304
+ datatables_init_completed = true;
278
305
  },
279
306
  language: {
280
307
  //lengthMenu: "_MENU_ 件分表示 <span id='icon-refresh-table' class='glyphicon glyphicon-repeat'></span>",
@@ -298,7 +325,23 @@ $(document).ready(function() {
298
325
  * Extensions section
299
326
  */
300
327
  colReorder: {
301
- "realtime": false
328
+ realtime: false,
329
+
330
+ // colReorder でカラムの順番が入れ替えられた場合、createdCell 内で
331
+ // 設定している内容が全てリセットされてしまいイベント等が消えてしまうので、
332
+ // ここで一旦リロードしてイベントが再設定されるようにする。
333
+ // これは createdCell が初期化時に一度しか呼ばれないためで、dataTables の
334
+ // 今後のバージョンアップで予定されている updatedCell が実装されるまでの
335
+ // 暫定処置として reorderCallback で代用する。
336
+ // https://github.com/DataTables/ColReorder/issues/49
337
+ reorderCallback: function() {
338
+ // stateSave が有効な状態でカラムが入れ替えられていた場合、
339
+ // initComplete イベントが発火する前に一度この reorderCallback が発火されるので、
340
+ // 無駄なリロードをしないように初期化後のみ有効にする
341
+ if (datatables_init_completed) {
342
+ notification.trigger("table.reload");
343
+ }
344
+ },
302
345
  },
303
346
  });
304
347
 
@@ -325,20 +368,24 @@ $(document).ready(function() {
325
368
  }
326
369
  });
327
370
 
328
- function restoreVisibilityForFrozen() {
371
+ function restoreVisibilityForViewMenu() {
329
372
  visibility_frozen_novel = storage.get("visibility_frozen_novel");
330
373
  visibility_nonfrozen_novel = storage.get("visibility_nonfrozen_novel");
374
+ var visibility_open_new_tab = storage.get("open_new_tab_setting_pages");
331
375
  if (typeof visibility_frozen_novel === "undefined")
332
376
  visibility_frozen_novel = true;
333
377
  if (typeof visibility_nonfrozen_novel === "undefined")
334
378
  visibility_nonfrozen_novel = true;
379
+ if (typeof visibility_open_new_tab === "undefined")
380
+ visibility_open_new_tab = false;
335
381
  // メニューのチェック状態も復元
336
382
  var method = ["removeClass", "addClass"];
337
383
  $("#action-view-frozen")[method[visibility_frozen_novel | 0]]("active");
338
384
  $("#action-view-nonfrozen")[method[visibility_nonfrozen_novel | 0]]("active");
385
+ $("#action-view-toggle-setting-page-open-new-tab")[method[visibility_open_new_tab | 0]]("active");
339
386
  }
340
387
 
341
- restoreVisibilityForFrozen();
388
+ restoreVisibilityForViewMenu();
342
389
 
343
390
  function saveVisibilityFrozen() {
344
391
  storage.set("visibility_frozen_novel", visibility_frozen_novel);
@@ -347,11 +394,11 @@ $(document).ready(function() {
347
394
  }
348
395
 
349
396
  function toggleVisibilityFrozen() {
350
- visibility_frozen_novel = visibility_frozen_novel ? false : true;
397
+ visibility_frozen_novel = !visibility_frozen_novel;
351
398
  }
352
399
 
353
400
  function toggleVisibilityNonFrozen() {
354
- visibility_nonfrozen_novel = visibility_nonfrozen_novel ? false : true;
401
+ visibility_nonfrozen_novel = !visibility_nonfrozen_novel;
355
402
  }
356
403
 
357
404
  /*
@@ -377,6 +424,13 @@ $(document).ready(function() {
377
424
  }, false);
378
425
  });
379
426
 
427
+ /*
428
+ * サーバ再起動イベント定義
429
+ */
430
+ notification.on("server.rebooted", function() {
431
+ location.href = "/";
432
+ });
433
+
380
434
  notification.on("tag.updateCanvas", function() {
381
435
  tag.updateCanvas();
382
436
  });
@@ -489,6 +543,21 @@ $(document).ready(function() {
489
543
  $("#action-select-mode-rect").addClass("disabled");
490
544
  }
491
545
  else {
546
+ // 小説一覧テーブル内で右クリックしたら個別メニューを表示
547
+ $("#novel-list tbody").on("contextmenu", function(e) {
548
+ var target_tag_name = e.target.tagName.toLowerCase();
549
+ // ボタンとかリンクはブラウザの右クリックメニューをそのまま使いたい
550
+ if (target_tag_name === "button" || target_tag_name === "a" ||
551
+ $(e.target).parent("button, a")[0])
552
+ return;
553
+
554
+ e.preventDefault(); // ブラウザの右クリックメニューを抑制
555
+ e.stopPropagation();
556
+ var mousedowned_element = $.elementFromPoint(get_event_position(e));
557
+ var tr = mousedowned_element.parents("tr");
558
+ openContextMenuWithTr(tr, e);
559
+ });
560
+
492
561
  var initMode = function(mode) {
493
562
  if (select_mode != mode) {
494
563
  $("#action-select-mode-" + mode).addClass("active");
@@ -625,6 +694,11 @@ $(document).ready(function() {
625
694
  var mousedowned_element = $.elementFromPoint(_pos);
626
695
  if (!mousedowned_element || mousedowned_element.closest("#novel-list tbody").length === 0)
627
696
  return;
697
+
698
+ // 右クリックは無視(contextmenu イベント内で個別メニューを表示する)
699
+ if (e.which == 3)
700
+ return;
701
+
628
702
  e.preventDefault();
629
703
  e.stopPropagation();
630
704
  var self = this;
@@ -648,6 +722,7 @@ $(document).ready(function() {
648
722
  if (not_clicked_yet) {
649
723
  // 範囲選択開始
650
724
  $("#rect-select-menu").hide();
725
+ context_menu.close();
651
726
  unregister_close_handler();
652
727
  not_clicked_yet = false;
653
728
  start_position = _pos;
@@ -780,6 +855,19 @@ $(document).ready(function() {
780
855
  table.draw();
781
856
  });
782
857
 
858
+ /*
859
+ * メニュー
860
+ * 表示>変換設定ページは新規タブで開く
861
+ */
862
+ $("#action-view-toggle-setting-page-open-new-tab").on(click_event_name, function(e) {
863
+ e.preventDefault();
864
+ slideNavbar.slide();
865
+ $(this).toggleClass("active");
866
+ var open_new_tab = storage.get("open_new_tab_setting_pages");
867
+ storage.set("open_new_tab_setting_pages", !open_new_tab);
868
+ storage.save();
869
+ });
870
+
783
871
  /*
784
872
  * メニュー
785
873
  * 表示>表示設定を全てリセット
@@ -892,6 +980,16 @@ $(document).ready(function() {
892
980
  });
893
981
  });
894
982
 
983
+ /*
984
+ * メニュー
985
+ * オプション>サーバを再起動
986
+ */
987
+ $("#action-option-server-reboot").on(click_event_name, function(e) {
988
+ e.preventDefault();
989
+ slideNavbar.slide();
990
+ action.rebootDialog();
991
+ });
992
+
895
993
  /*
896
994
  * メニュー
897
995
  * オプション>サーバをシャットダウン
@@ -901,10 +999,11 @@ $(document).ready(function() {
901
999
  slideNavbar.slide();
902
1000
  bootbox.dialog({
903
1001
  title: '<span class="glyphicon glyphicon-off"></span> シャットダウン',
904
- message: "Narou.rb WEB UI サーバをシャットダウンします。<br>" +
905
- "シャットダウンすると再起動するまでアクセスは出来なくなります。<br>" +
906
- "再起動するにはコンソールでもう一度 <kbd>narou web</kbd> を実行" +
907
- "して下さい。",
1002
+ message: "<p>Narou.rb WEB UI サーバをシャットダウンします。<br>" +
1003
+ "シャットダウンすると再度立ち上げるまではアクセスは出来なくなります。<br>" +
1004
+ "再度立ち上げるにはコンソールでもう一度 <kbd>narou web</kbd> を実行して下さい。</p>" +
1005
+ "<p class=text-danger>アップデート中や変換中の小説がある場合は中断されます。<br>" +
1006
+ "終わったかどうか確認しましょう。</p>",
908
1007
  backdrop: true,
909
1008
  buttons: {
910
1009
  danger: {
@@ -924,6 +1023,23 @@ $(document).ready(function() {
924
1023
  });
925
1024
  });
926
1025
 
1026
+ var tooltip_opt = {
1027
+ animation: false,
1028
+ container: "body",
1029
+ placement: "bottom"
1030
+ }
1031
+
1032
+ var refreshTooltop = function(id, title, placement) {
1033
+ $(id)
1034
+ .tooltip("destroy")
1035
+ .tooltip(_.merge({}, tooltip_opt, { title: title, placement: placement }))
1036
+ .on("shown.bs.tooltip", function(e) {
1037
+ setTimeout(function() {
1038
+ $(e.target).tooltip("hide");
1039
+ }, 3500);
1040
+ });
1041
+ };
1042
+
927
1043
  /*
928
1044
  * 「選択」メニューの横に現在選択中の小説数をバッジで表示
929
1045
  */
@@ -931,23 +1047,14 @@ $(document).ready(function() {
931
1047
  table.on("changeselect", function() {
932
1048
  var selected_count = table.rows(".selected").data().length;
933
1049
  $("#badge-number-of-selecting").text(selected_count);
934
- var tooltip_opt = {
935
- animation: false,
936
- container: "body",
937
- placement: "bottom"
938
- }
939
1050
  if (selected_count > 0) {
940
- tooltip_opt.title = "選択した小説を更新";
941
- $("#button-update").tooltip("destroy").tooltip(tooltip_opt);
942
- tooltip_opt.title = "選択した小説を送信";
943
- $("#button-send").tooltip("destroy").tooltip(tooltip_opt);
1051
+ refreshTooltop("#button-update", "選択した小説を更新");
1052
+ refreshTooltop("#button-send", "選択した小説を送信");
944
1053
  enable_menu_item(".enable-selected");
945
1054
  }
946
1055
  else {
947
- tooltip_opt.title = "すべての小説を更新";
948
- $("#button-update").tooltip("destroy").tooltip(tooltip_opt);
949
- tooltip_opt.title = "更新された小説を送信";
950
- $("#button-send").tooltip("destroy").tooltip(tooltip_opt);
1056
+ refreshTooltop("#button-update", "すべての小説を更新");
1057
+ refreshTooltop("#button-send", "更新された小説を送信");
951
1058
  disable_menu_item(".enable-selected");
952
1059
  }
953
1060
  });
@@ -957,17 +1064,7 @@ $(document).ready(function() {
957
1064
  /*
958
1065
  * Tooltip 化
959
1066
  */
960
- $("[data-toggle=tooltip]").tooltip({
961
- animation: false,
962
- container: "body",
963
- placement: "bottom",
964
- });
965
-
966
- $("#icon-refresh-table").tooltip({
967
- title: "リストを再読み込み",
968
- animation: false,
969
- container: "body",
970
- });
1067
+ refreshTooltop("[data-toggle=tooltip]");
971
1068
 
972
1069
  $("button").on("mouseleave", function() {
973
1070
  $(this).tooltip("hide");
@@ -1187,6 +1284,9 @@ $(document).ready(function() {
1187
1284
  if ($("#rect-select-menu").is(":visible")) {
1188
1285
  close_rect_select_menu_handler();
1189
1286
  }
1287
+ if (!context_menu.closed) {
1288
+ context_menu.close();
1289
+ }
1190
1290
  else {
1191
1291
  action.selectClear();
1192
1292
  }
@@ -19,7 +19,7 @@ module Narou
19
19
  attr_reader :accepted_domains, :connections
20
20
 
21
21
  def accepted_domains=(domains)
22
- @accepted_domains = domains.kind_of?(Array) ? domains : [domains]
22
+ @accepted_domains = Array(domains)
23
23
  end
24
24
 
25
25
  def initialize
@@ -100,12 +100,23 @@ module Narou
100
100
  # echo 以外のイベントは履歴に保存しない
101
101
  message = data[:echo]
102
102
  if message
103
- @history.push(message)
104
- @history.shift
103
+ stack_to_history(message)
105
104
  end
106
105
  rescue JSON::GeneratorError => e
107
106
  STDERR.puts $@.shift + ": #{e.message} (#{e.class})"
108
107
  end
108
+
109
+ def stack_to_history(message)
110
+ if message == "." && @history[-1] =~ /\A\.+\z/
111
+ # 進行中を表す .... の出力でヒストリーが消費されるのを防ぐため、
112
+ # 連続した . は一つにまとめる
113
+ @history[-1] << "."
114
+ else
115
+ @history.push(message)
116
+ @history.shift
117
+ end
118
+ end
119
+
109
120
  end
110
121
  end
111
122
 
@@ -0,0 +1,188 @@
1
+ :javascript
2
+ +function() {
3
+ var action = new Narou.Action;
4
+
5
+ function getCurrentVersion() {
6
+ var dfd = jQuery.Deferred();
7
+ $.ajax({
8
+ type: "GET",
9
+ url: "/api/version/current.json",
10
+ dataType: "json",
11
+ success: function(json) {
12
+ $("#current-version").text(json.version);
13
+ dfd.resolve(json.version);
14
+ },
15
+ error: function() {
16
+ dfd.reject();
17
+ }
18
+ });
19
+ return dfd;
20
+ }
21
+
22
+ function getLatestVersion() {
23
+ var dfd = jQuery.Deferred();
24
+ $.ajax({
25
+ type: "GET",
26
+ url: "/api/version/latest.json",
27
+ dataType: "json",
28
+ success: function(json) {
29
+ $("#latest-version").text(json.version);
30
+ dfd.resolve(json.version);
31
+ },
32
+ error: function() {
33
+ dfd.reject();
34
+ }
35
+ });
36
+ return dfd;
37
+ }
38
+
39
+ function updateButtonHandler() {
40
+ var dfd = jQuery.Deferred();
41
+ $("#version-update-button").one("click", function(e) {
42
+ e.preventDefault();
43
+ $(this).hide();
44
+ $("#fail-update-system").hide();
45
+ dfd.resolve();
46
+ });
47
+ return dfd;
48
+ }
49
+
50
+ function callUpdateSystem() {
51
+ var dfd = jQuery.Deferred();
52
+ $("#version-updating").show();
53
+ $("#gem-result-log").hide();
54
+ action.updateSystem(function(result, log) {
55
+ $("#version-updating").hide();
56
+ $("#gem-result-log").text(log);
57
+ if (result == "success")
58
+ dfd.resolve();
59
+ else
60
+ dfd.reject(result);
61
+ });
62
+ return dfd;
63
+ }
64
+
65
+ function rebootButtonHandler() {
66
+ $("#gem-result-log").addClass("large").show();
67
+ $("#reboot-button")
68
+ .show()
69
+ .on("click", function(e) {
70
+ action.rebootDialog();
71
+ });
72
+ }
73
+
74
+ function failUpdateSystem(result) {
75
+ if (result == "failure") {
76
+ $("#fail-update-system").show();
77
+ $("#gem-result-log").show();
78
+ updateSysmteProcess();
79
+ }
80
+ else if (result == "nothing") {
81
+ $("#nothing-to-update").show();
82
+ }
83
+ }
84
+
85
+ function updateSysmteProcess() {
86
+ $("#version-update-button").show();
87
+ updateButtonHandler()
88
+ .then(callUpdateSystem)
89
+ .then(rebootButtonHandler)
90
+ .fail(failUpdateSystem);
91
+ }
92
+
93
+ $result = $("#result-of-version-checking");
94
+ $result.children("div").hide();
95
+
96
+ $("#version-update-button").hide();
97
+ $("#reboot-button").hide();
98
+ $("#version-updating").hide();
99
+ $("#fail-update-system").hide();
100
+ $("#nothing-to-update").hide();
101
+ $("#gem-result-log").hide();
102
+
103
+ action.checkUpdatedSystem({
104
+ // まだgemのアップデートは行われていないので、バージョンチェックからはじめる
105
+ not_updated: function() {
106
+ $result.children(".checking").show();
107
+
108
+ $.when(
109
+ getCurrentVersion(),
110
+ getLatestVersion()
111
+ )
112
+ .done(function(current_version, latest_version) {
113
+ $result.children(".checking").hide();
114
+ if (latest_version > current_version) {
115
+ $("#latest-version").text(latest_version);
116
+ $result.children(".need-an-update").show();
117
+ }
118
+ else {
119
+ $result.children(".version-is-latest").show();
120
+ }
121
+ })
122
+ .fail(function() {
123
+ $result.children(".checking").hide();
124
+ $result.children(".error").show();
125
+ });
126
+
127
+ updateSysmteProcess();
128
+ },
129
+
130
+ // すでにgemをアップデート済みなので、再起動ボタンを最初から表示する
131
+ already_updated: function(log) {
132
+ $result.children(".need-an-update").show();
133
+ $("#latest-version-found").hide();
134
+ $("#reboot-button").show();
135
+ $("#gem-result-log").text(log);
136
+ rebootButtonHandler();
137
+ }
138
+ });
139
+
140
+ }();
141
+
142
+ %div.link-to-changelog-in-about
143
+ %a.btn.btn-default.btn-sm(href="https://github.com/whiteleaf7/narou/blob/master/ChangeLog.md" target="_blank")
144
+ 更新履歴
145
+ %span.glyphicon.glyphicon-new-window
146
+
147
+ %div(style="text-align:center")
148
+ %h1
149
+ %strong Narou.rb
150
+ %div
151
+ Version #{@narourb_version}
152
+ %div
153
+ Copyright 2013 whiteleaf. All rights reserved.
154
+ #result-of-version-checking(style="margin-top:10px")
155
+ .checking
156
+ %span.rotate-progress
157
+ %span.icon
158
+ %span.text アップデートを確認しています...
159
+ .version-is-latest
160
+ %p
161
+ %span.glyphicon.glyphicon-thumbs-up.text-primary
162
+ Narou.rb は最新版です。
163
+ .need-an-update
164
+ %p
165
+ %span#latest-version-found
166
+ %span.glyphicon.glyphicon-exclamation-sign.text-primary
167
+ 新しいバージョン(<span id="latest-version"></span>)が見つかりました。<br>
168
+ %a#version-update-button.btn.btn-primary.btn-sm
169
+ %b Narou.rb を更新する
170
+ %span#version-updating
171
+ %span.rotate-progress
172
+ %span.icon
173
+ %span.text 更新しています。
174
+ %a#reboot-button.btn.btn-success.btn-sm
175
+ %b 再起動して更新を反映する
176
+ %span#nothing-to-update.text-success
177
+ Narou.rb はすでに最新版です。
178
+ %p#fail-update-system.text-danger
179
+ Narou.rb の更新に失敗しました。
180
+ .error
181
+ %span.text-danger
182
+ 最新バージョンの取得に失敗しました。
183
+
184
+ %pre#gem-result-log.log-box
185
+
186
+ .well.well-sm(style="font-size:80%; margin-top: 10px")
187
+ #{@ruby_version}<br>
188
+ #{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
@@ -0,0 +1,18 @@
1
+ :javascript
2
+ var busy = $("#rebooting-busy");
3
+ busy.text(".");
4
+ setInterval(function() {
5
+ busy.text(busy.text() + ".");
6
+ if (busy.text().length == 6) {
7
+ busy.text(".");
8
+ }
9
+ }, 500);
10
+
11
+ %p
12
+ サーバを再起動しています<span id="rebooting-busy"></span>
13
+ %p
14
+ 再起動が完了したら自動的にページがリロードされます。
15
+ %p
16
+ しばらく待ってもリロードされない場合は
17
+ %a(href="/") こちら
18
+ をクリックするかブラウザのリロードボタンを押してみてください。
@@ -6,6 +6,8 @@
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();
9
11
  o=d.createElement("div");
10
12
  o.innerHTML="WEB UI Server: OFFLINE";
11
13
  o.id="narourb-offline";
@@ -21,8 +23,6 @@
21
23
  s.top=0
22
24
  },1000);
23
25
 
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;