plugin-jm-server 0.1.16__tar.gz → 0.1.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/PKG-INFO +28 -1
  2. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/README.md +27 -0
  3. plugin_jm_server-0.1.18/src/plugin_jm_server/__init__.py +3 -0
  4. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/files.py +4 -2
  5. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/index.css +2 -3
  6. plugin_jm_server-0.1.18/src/plugin_jm_server/static/js/common.js +50 -0
  7. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/templates/index.html +15 -13
  8. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/templates/jm_view.html +17 -2
  9. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server.egg-info/PKG-INFO +28 -1
  10. plugin_jm_server-0.1.16/src/plugin_jm_server/__init__.py +0 -3
  11. plugin_jm_server-0.1.16/src/plugin_jm_server/static/js/common.js +0 -16
  12. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/setup.cfg +0 -0
  13. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/setup.py +0 -0
  14. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/app.py +0 -0
  15. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/driver.py +0 -0
  16. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/all.min.css +0 -0
  17. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/bootstrap.css +0 -0
  18. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/download_error.css +0 -0
  19. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/h5/m_download_error.css +0 -0
  20. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/h5/m_index.css +0 -0
  21. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/h5/m_login.css +0 -0
  22. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/h5/m_upload.css +0 -0
  23. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/h5/normalize.css +0 -0
  24. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/login.css +0 -0
  25. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/style_photo.css +0 -0
  26. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/css/upload.css +0 -0
  27. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/img/bg.jpg +0 -0
  28. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/img/m_bg.jpeg +0 -0
  29. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/js/h5/m_index.js +0 -0
  30. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/js/h5/m_upload.js +0 -0
  31. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/js/index.js +0 -0
  32. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/js/jquery-3.7.1.min.js +0 -0
  33. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/js/jquery.album-0.2.js +0 -0
  34. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/js/upload.js +0 -0
  35. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/webfonts/fa-regular-400.woff2 +0 -0
  36. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/static/webfonts/fa-solid-900.woff2 +0 -0
  37. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/templates/download_error.html +0 -0
  38. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/templates/login.html +0 -0
  39. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/templates/m_download_error.html +0 -0
  40. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/templates/m_index.html +0 -0
  41. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/templates/m_jm_view.html +0 -0
  42. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/templates/m_login.html +0 -0
  43. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/templates/m_upload.html +0 -0
  44. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server/templates/upload.html +0 -0
  45. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server.egg-info/SOURCES.txt +0 -0
  46. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server.egg-info/dependency_links.txt +0 -0
  47. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server.egg-info/requires.txt +0 -0
  48. {plugin_jm_server-0.1.16 → plugin_jm_server-0.1.18}/src/plugin_jm_server.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugin_jm_server
3
- Version: 0.1.16
3
+ Version: 0.1.18
4
4
  Summary: plugin_jm_server, a plugin for jmcomic that can be used to view comics in a web browser.
5
5
  Home-page: https://github.com/hect0x7/plugin-jm-server
6
6
  Author: hect0x7
@@ -81,6 +81,33 @@ server.run(
81
81
  )
82
82
  ```
83
83
 
84
+ * 作为jmcomic的插件
85
+
86
+ ```yml
87
+ # 配置文件
88
+ plugins:
89
+ after_init:
90
+ # after_album:
91
+ - plugin: jm_server
92
+ kwargs:
93
+ password: ''
94
+
95
+ ```
96
+
97
+ ```python
98
+ # 代码
99
+ from jmcomic import *
100
+
101
+ op = create_option('op.yml')
102
+ op.download_album(123)
103
+ # 运行到这里,虽然主线程代码执行完毕,但程序不会退出,因为服务器线程还没有结束。
104
+ # 控制台会输出提示信息如下(atexit时输出的):
105
+ # “主线程执行完毕,但插件jm_server的服务器线程仍运行中,可按下ctrl+c结束程序”
106
+ # 此时需要你主动按下ctrl+c终止程序。
107
+
108
+ # python 3.12 特别注意:需要插入下面这行代码,服务器才能继续处理请求
109
+ op.wait_all_plugins_finish()
110
+ ```
84
111
 
85
112
 
86
113
  # 效果图(文件浏览、整章看图)
@@ -55,6 +55,33 @@ server.run(
55
55
  )
56
56
  ```
57
57
 
58
+ * 作为jmcomic的插件
59
+
60
+ ```yml
61
+ # 配置文件
62
+ plugins:
63
+ after_init:
64
+ # after_album:
65
+ - plugin: jm_server
66
+ kwargs:
67
+ password: ''
68
+
69
+ ```
70
+
71
+ ```python
72
+ # 代码
73
+ from jmcomic import *
74
+
75
+ op = create_option('op.yml')
76
+ op.download_album(123)
77
+ # 运行到这里,虽然主线程代码执行完毕,但程序不会退出,因为服务器线程还没有结束。
78
+ # 控制台会输出提示信息如下(atexit时输出的):
79
+ # “主线程执行完毕,但插件jm_server的服务器线程仍运行中,可按下ctrl+c结束程序”
80
+ # 此时需要你主动按下ctrl+c终止程序。
81
+
82
+ # python 3.12 特别注意:需要插入下面这行代码,服务器才能继续处理请求
83
+ op.wait_all_plugins_finish()
84
+ ```
58
85
 
59
86
 
60
87
  # 效果图(文件浏览、整章看图)
@@ -0,0 +1,3 @@
1
+ __version__ = '0.1.18'
2
+
3
+ from .app import *
@@ -81,10 +81,11 @@ class FileManager:
81
81
  continue
82
82
 
83
83
  size = self.file_size_format(size, the_type)
84
- getctime = os.path.getctime(file_path)
84
+
85
85
  try:
86
+ getctime = os.path.getctime(file_path)
86
87
  ctime = time.localtime(getctime)
87
- time_str = "{}/{}/{}".format(ctime.tm_year, ctime.tm_mon, ctime.tm_mday)
88
+ time_str = time.strftime("%Y-%m-%d %H:%M:%S", ctime)
88
89
  except OSError:
89
90
  continue
90
91
 
@@ -97,6 +98,7 @@ class FileManager:
97
98
  })
98
99
  self.current_path = path
99
100
 
101
+ files.sort(key=lambda it: it['ctime'], reverse=True)
100
102
  return files
101
103
 
102
104
  @staticmethod
@@ -41,7 +41,7 @@ h3 {
41
41
  }
42
42
 
43
43
  .files-table {
44
- width: 820px;
44
+ width: 1050px;
45
45
  border-collapse: collapse;
46
46
  border: 2px solid #fff;
47
47
  border-radius: 10px;
@@ -140,7 +140,7 @@ a:visited {
140
140
  .float-tablet {
141
141
  position: fixed;
142
142
  bottom: 40px;
143
- right: 400px;
143
+ right: 100px;
144
144
  width: 200px;
145
145
  height: 150px;
146
146
  border-radius: 15px;
@@ -186,7 +186,6 @@ a:visited {
186
186
  box-sizing: border-box;
187
187
  bottom: 250px;
188
188
  right: 40px;
189
- width: 560px;
190
189
  max-height: 226px;
191
190
  padding: 20px;
192
191
  border-radius: 15px;
@@ -0,0 +1,50 @@
1
+ document.addEventListener('DOMContentLoaded', () => {
2
+ // 右侧菜单采用双击显示/隐藏
3
+ const element = document.querySelector('.menu-bolock');
4
+ document.addEventListener('dblclick', () => {
5
+ if (element.style.display === 'none') {
6
+ element.style.display = 'block';
7
+ } else {
8
+ element.style.display = 'none';
9
+ }
10
+ });
11
+
12
+ // 跳转到底部
13
+ document.getElementById('gobottom')
14
+ .addEventListener('click', () => {
15
+ window.scrollTo(0, document.body.scrollHeight);
16
+ });
17
+
18
+ // 选择页码跳转图片
19
+ document.getElementById('pageselect').addEventListener('change', function () {
20
+ let selectedValue = this.value;
21
+ if (selectedValue !== null) {
22
+ const divid = "page_" + selectedValue;
23
+ let element = document.getElementById(divid);
24
+ if (element) {
25
+ let settop = element.offsetTop - 28 - document.getElementById('Comic_Top_Nav').offsetHeight;
26
+ window.scrollTo(0, settop);
27
+ }
28
+ document.getElementById('pageselect').value = selectedValue;
29
+ }
30
+ });
31
+
32
+ window.addEventListener('scroll', function () {
33
+ let wsTop = window.scrollY
34
+ let pageDivs = document.querySelectorAll('div[id*="page_"]');
35
+ let toPage = pageDivs.length - 1;
36
+
37
+ for (let div of pageDivs) {
38
+ let divTop = div.offsetTop;
39
+ if (divTop > wsTop) {
40
+ toPage = parseInt(div.getAttribute("data-page"));
41
+ break
42
+ }
43
+ }
44
+
45
+ console.log('toPage:', toPage)
46
+ document.getElementById('pageselect').value = toPage;
47
+ });
48
+
49
+
50
+ });
@@ -71,6 +71,21 @@
71
71
  <input type="submit">
72
72
  </form>
73
73
 
74
+
75
+ <section class="flash-tablet" style="">
76
+ <div class="inner-container">
77
+ {# <div class="drivers-container">#}
78
+ {# 根目录:#}
79
+ {# {% for driver in data.drivers %}#}
80
+ {# <a href="javascript:" location="{{ driver }}" style="color:black">{{ driver }}</a>#}
81
+ {# {% endfor %}#}
82
+ {# <h3 class="currentPath">当前路径:<span>{{ data.currentPath }}</span></h3>#}
83
+ {# </div>#}
84
+ <button class="to-lastPath" onclick="goBack()">&nbsp;←&nbsp;&nbsp;上级目录</button>
85
+ <button id="to-top">返回顶部</button>
86
+ </div>
87
+ </section>
88
+
74
89
  <section class="float-tablet">
75
90
  <button>
76
91
  <h4><a href="/upload_file">上 传 文 件</a></h4>
@@ -79,19 +94,6 @@
79
94
  <h4><a href="/logout">注&nbsp;&nbsp;&nbsp;&nbsp;销</a></h4>
80
95
  </button>
81
96
  </section>
82
- <section class="flash-tablet" style="">
83
- <div class="inner-container">
84
- <div class="drivers-container">
85
- 根目录:
86
- {% for driver in data.drivers %}
87
- <a href="javascript:" location="{{ driver }}" style="color:black">{{ driver }}</a>
88
- {% endfor %}
89
- <h3 class="currentPath">当前路径:<span>{{ data.currentPath }}</span></h3>
90
- </div>
91
- <button class="to-lastPath" onclick="goBack()">&nbsp;←&nbsp;&nbsp;上级目录</button>
92
- <button id="to-top">返回顶部</button>
93
- </div>
94
- </section>
95
97
  </div>
96
98
  </body>
97
99
 
@@ -9,10 +9,10 @@
9
9
  <link href="../static/css/bootstrap.css" rel="stylesheet">
10
10
  <script src="../static/js/jquery-3.7.1.min.js"></script>
11
11
  <script src="../static/js/jquery.album-0.2.js"></script>
12
+ <script src="../static/js/common.js"></script>
12
13
  <link rel="stylesheet" href="../static/css/index.css">
13
14
  <link rel="stylesheet" href="../static/css/all.min.css">
14
15
  <link rel="stylesheet" href="../static/css/style_photo.css">
15
- <script src="../static/js/common.js"></script>
16
16
  <style>
17
17
  img {
18
18
  width: 100%;
@@ -25,6 +25,8 @@
25
25
  <body>
26
26
 
27
27
  <div class="container">
28
+ <div id="Comic_Top_Nav">
29
+ </div>
28
30
  <div class="row">
29
31
  <div style="padding:0">
30
32
  <div class="panel panel-default">
@@ -44,7 +46,10 @@
44
46
  </div>
45
47
  #}
46
48
  {% for image in data.images %}
47
- <div class="center scramble-page" id="{{ image.filename }}" >
49
+ <div class="center scramble-page"
50
+ id="page_{{ loop.index0 }}"
51
+ data-page="{{ loop.index0 }}"
52
+ >
48
53
  <img src="{{ image.data_original }}"
49
54
  data-original="{{ image.data_original }}"
50
55
  class="lazy_img img-responsive-mw lazy-loaded"
@@ -104,6 +109,16 @@
104
109
  <li>
105
110
  <a id="gobottom" href="javascript:void(0)"><i class="far fa-caret-square-up"></i><span>跳到最后</span></a>
106
111
  </li>
112
+ <div>
113
+ <!--suppress HtmlFormInputWithoutLabel -->
114
+ <select id="pageselect">
115
+ {% for image in data.images %}
116
+ <option value="{{ loop.index0 }}">
117
+ {{ loop.index }}/{{ loop.length }}
118
+ </option>
119
+ {% endfor %}
120
+ </select>
121
+ </div>
107
122
  </ul>
108
123
  </div>
109
124
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugin_jm_server
3
- Version: 0.1.16
3
+ Version: 0.1.18
4
4
  Summary: plugin_jm_server, a plugin for jmcomic that can be used to view comics in a web browser.
5
5
  Home-page: https://github.com/hect0x7/plugin-jm-server
6
6
  Author: hect0x7
@@ -81,6 +81,33 @@ server.run(
81
81
  )
82
82
  ```
83
83
 
84
+ * 作为jmcomic的插件
85
+
86
+ ```yml
87
+ # 配置文件
88
+ plugins:
89
+ after_init:
90
+ # after_album:
91
+ - plugin: jm_server
92
+ kwargs:
93
+ password: ''
94
+
95
+ ```
96
+
97
+ ```python
98
+ # 代码
99
+ from jmcomic import *
100
+
101
+ op = create_option('op.yml')
102
+ op.download_album(123)
103
+ # 运行到这里,虽然主线程代码执行完毕,但程序不会退出,因为服务器线程还没有结束。
104
+ # 控制台会输出提示信息如下(atexit时输出的):
105
+ # “主线程执行完毕,但插件jm_server的服务器线程仍运行中,可按下ctrl+c结束程序”
106
+ # 此时需要你主动按下ctrl+c终止程序。
107
+
108
+ # python 3.12 特别注意:需要插入下面这行代码,服务器才能继续处理请求
109
+ op.wait_all_plugins_finish()
110
+ ```
84
111
 
85
112
 
86
113
  # 效果图(文件浏览、整章看图)
@@ -1,3 +0,0 @@
1
- __version__ = '0.1.16'
2
-
3
- from .app import *
@@ -1,16 +0,0 @@
1
- document.addEventListener('DOMContentLoaded', () => {
2
- const element = document.querySelector('.menu-bolock');
3
- document.addEventListener('dblclick', () => {
4
- if (element.style.display === 'none') {
5
- element.style.display = 'block';
6
- } else {
7
- element.style.display = 'none';
8
- }
9
- });
10
-
11
- // id=gobottom,对这个元素实现跳转到页面最底部
12
- const bottom = document.getElementById('gobottom');
13
- bottom.addEventListener('click', () => {
14
- window.scrollTo(0, document.body.scrollHeight);
15
- });
16
- });