-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
133 lines (114 loc) · 4.03 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<html>
<head>
<title>移动杂志</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h1>移动杂志</h1>
<p style="color:#aaa;">v0.31测试版(项目地址:<a id="project" href="https://github.com/pasicopan/PGMAutoSheet4design" target="_blank">https://github.com/pasicopan/PGMAutoSheet4design</a>)</p>
<p>
<span>选择杂志</span>
<span>
<select id="IP" name="IPname" class="IPname">
<option value="http://192.168.11.20:8888">家居</option>
<option value="http://192.168.11.9:8888">汽车</option>
<option value="http://192.168.11.10:8888">时尚</option>
</select>
</span>
</p>
<p>
<span>输入期刊ID</span>
<span>
<input id="issueID" type="text" value="399" width="100" />
</span>
</p>
<p>
<button id="createHTMLBtn">创建进度网页</button>
</p>
<!-- 自定义端口 ,未完善,不开放-->
<!-- <p>
<span>输入端口(默认8099):</span>
<span>
<input id="portNum" type="number" value="8099" width="100" />
</span>
</p> -->
<p id="seccess" style="display:none;">成功创建进度表,请在本软件 的相同目录下找到 __index.html 文件,可以复制到本软件下的任意子目录下使用</p>
<p id="fail" style="display:none;">创建失败,检查杂志ID 是否正确。</p>
<p id="ip4test" style="color:#fff;"></p>
<!-- <select id="issueID" name="issueIDName" class="issueIDName">
<option value="http://192.168.11.9:8888">汽车</option>
<option value="http://192.168.11.20:8888">家居</option>
<option value="http://192.168.11.10:8888">时尚</option>
</select> -->
<script src="pcauto1.1.js"></script>
<script>
var g_IP = "http://192.168.11.20:8888";
var g_issueID = "399";
var g_port = 80;
var urlpathname = "\\__index.html"; // 首次生成html 文件的位置。
var $IP = $("#IP");
var $issueID = $("#issueID");
var $seccess = $("#seccess");
var $fail = $("#fail");
var $portNum = $("#portNum");
var $project = $("#project");
var $ip4test = $("#ip4test");
var $createHTMLBtn = $("#createHTMLBtn");
var isShowWindow = true;
// nodewebkit gui,tray.
var gui = require('nw.gui');
var win = gui.Window.get();
// 更新value 事件
$IP.bind("change", function(e) {
g_IP = this.value;
console.log("IP value change to " + g_IP);
})
$project.bind("click",function(e) {
e.preventDefault();
var t = $(e.target);
gui.Shell.openExternal(t.attr('href'));
});
$issueID.bind("change", function(e) {
g_issueID = this.value;
console.log("issueID value change to " + g_issueID);
})
$portNum.bind("change", function(e) {
var _port = parseInt(this.value);
g_port = _port || 8099;
this.value = g_port;
console.log("portNum value change to " + g_port);
})
$createHTMLBtn.bind("click", function(e) {
urlpathname = "\\__index.html";
getCMSData(g_IP, g_issueID, function(a_data) {
insertHTMLFile(createHTMLString(a_data),[g_IP,g_issueID]);
})
})
var tray = new gui.Tray({
title: 'pasico的软件',
icon: 'tray.png'
});
tray.tooltip = '点此打开';
//添加一个菜单
var menu = new gui.Menu();
menu.append(new gui.MenuItem({
type: 'checkbox',
label: '选择我'
}));
tray.menu = menu;
//click事件
tray.on('click',
function() {
if (isShowWindow) {
win.hide();
isShowWindow = false;
} else {
win.show();
isShowWindow = true;
}
}
);
</script>
<script src="server.js"></script>
</body>
</html>