sbd-npm 1.4.45 → 1.4.47
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.
- package/package.json +1 -1
- package/status.js +53 -14
- package/util.js +2 -2
package/package.json
CHANGED
package/status.js
CHANGED
@@ -235,7 +235,7 @@ $(function () {
|
|
235
235
|
}
|
236
236
|
Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
|
237
237
|
let html = [], ip_num = j["num"];
|
238
|
-
$("#ip_num").html("共 <span class='label label-info'>" + j["num"] + "</span> 条");
|
238
|
+
$("#ip_num").html("共 <span class='label label-info'>" + j["num"] + "</span> 条(" + j["total_ip_num"] + ") ");
|
239
239
|
j["data"].forEach(function (item) {
|
240
240
|
html.push("<tr>");
|
241
241
|
html.push("<td>", ip_num, "</td>");
|
@@ -755,14 +755,17 @@ $(function () {
|
|
755
755
|
"head_cols": head_cols
|
756
756
|
});
|
757
757
|
$("#word_recite").click(function() {
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
window.speechSynthesis.onvoiceschanged = () => {
|
763
|
-
let voices = window.speechSynthesis.getVoices();
|
758
|
+
if (!Util.is_load) {
|
759
|
+
Util.is_load = true;
|
760
|
+
let voices = window.speechSynthesis.getVoices();
|
761
|
+
if (voices.length > 0) {
|
764
762
|
Status.show_speech_voices(voices);
|
765
|
-
}
|
763
|
+
} else {
|
764
|
+
window.speechSynthesis.onvoiceschanged = () => {
|
765
|
+
let voices = window.speechSynthesis.getVoices();
|
766
|
+
Status.show_speech_voices(voices);
|
767
|
+
};
|
768
|
+
}
|
766
769
|
}
|
767
770
|
});
|
768
771
|
Status.init_word_modal();
|
@@ -771,11 +774,16 @@ $(function () {
|
|
771
774
|
},
|
772
775
|
|
773
776
|
show_speech_voices: function(voices) {
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
777
|
+
if (voices.length > 0) {
|
778
|
+
let data = [];
|
779
|
+
voices.forEach(voice => {
|
780
|
+
data.push(`Name: ${voice.name}, Lang: ${voice.lang}, Default: ${voice.default}`);
|
781
|
+
});
|
782
|
+
alert(data.join("\n"));
|
783
|
+
} else {
|
784
|
+
alert("空列表: []");
|
785
|
+
}
|
786
|
+
Util.is_load = false;
|
779
787
|
},
|
780
788
|
|
781
789
|
init_machine_action_modal: function () {
|
@@ -998,7 +1006,7 @@ $(function () {
|
|
998
1006
|
if (j["word"]) {
|
999
1007
|
$("#word_value").val(j["word"]);
|
1000
1008
|
$("#word_chinese").val(j["chinese"]);
|
1001
|
-
$("#word_modal_title").html(Util.pack_html_link("https://cn.bing.com/dict/search?q=" + j["word"], "随机单词"));
|
1009
|
+
$("#word_modal_title").html(Util.pack_html_link("https://cn.bing.com/dict/search?q=" + j["word"], "随机单词") + " <span style='color: #BDBDBD;'>(" + Util.seconds_to_format(j["date"]) + ")</span>");
|
1002
1010
|
}
|
1003
1011
|
});
|
1004
1012
|
} else {
|
@@ -1282,6 +1290,37 @@ $(function () {
|
|
1282
1290
|
|
1283
1291
|
};
|
1284
1292
|
|
1293
|
+
Util.init_modal_skeleton("ip_modal");
|
1294
|
+
$("#ip_modal_title").html("IP查询");
|
1295
|
+
let ip_html = [];
|
1296
|
+
ip_html.push('<form data-parsley-validate class="form-horizontal form-label-left">');
|
1297
|
+
ip_html.push('<div class="form-group">');
|
1298
|
+
ip_html.push('<label class="control-label col-md-3 col-sm-3 col-xs-12" for="search_ip">IP地址 </label>');
|
1299
|
+
ip_html.push('<div class="col-md-6 col-sm-6 col-xs-12">');
|
1300
|
+
ip_html.push('<input type="text" id="search_ip" name="search_ip" placeholder="IP地址(支持模糊查询)" class="form-control col-md-7 col-xs-12">');
|
1301
|
+
ip_html.push('</div>');
|
1302
|
+
ip_html.push('</div>');
|
1303
|
+
ip_html.push('<div class="form-group">');
|
1304
|
+
ip_html.push('<label class="control-label col-md-3 col-sm-3 col-xs-12" for="search_location">地址信息 </label>');
|
1305
|
+
ip_html.push('<div class="col-md-6 col-sm-6 col-xs-12">');
|
1306
|
+
ip_html.push('<input type="text" id="search_location" name="search_location" placeholder="地址信息" class="form-control col-md-7 col-xs-12">');
|
1307
|
+
ip_html.push('</div>');
|
1308
|
+
ip_html.push('</div>');
|
1309
|
+
ip_html.push('<div class="form-group">');
|
1310
|
+
ip_html.push('<label class="control-label col-md-3 col-sm-3 col-xs-12" for="search_referer">访问来源 </label>');
|
1311
|
+
ip_html.push('<div class="col-md-6 col-sm-6 col-xs-12">');
|
1312
|
+
ip_html.push('<input type="text" id="search_referer" name="search_referer" placeholder="访问来源" class="form-control col-md-7 col-xs-12">');
|
1313
|
+
ip_html.push('</div>');
|
1314
|
+
ip_html.push('</div>');
|
1315
|
+
ip_html.push('<div class="form-group">');
|
1316
|
+
ip_html.push('<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">');
|
1317
|
+
ip_html.push('<button id="ip_daily_search" type="button" class="btn btn-success">查 询</button>');
|
1318
|
+
ip_html.push('</div>');
|
1319
|
+
ip_html.push('</div>');
|
1320
|
+
ip_html.push('</form>');
|
1321
|
+
let imb_obj = $("#ip_modal_body");
|
1322
|
+
imb_obj.html(ip_html.join(""));
|
1323
|
+
imb_obj.parent().parent().removeClass("modal-xlg");
|
1285
1324
|
let ip_obj = $('#ip_modal');
|
1286
1325
|
// 此事件在模态框已经显示出来触发
|
1287
1326
|
ip_obj.on('show.bs.modal', function (e) {
|
package/util.js
CHANGED
@@ -3287,9 +3287,9 @@ const Util = {
|
|
3287
3287
|
pack_index_data: function (index, change) {
|
3288
3288
|
let index_html = Util.to_float(index, 2);
|
3289
3289
|
if (change > 0) {
|
3290
|
-
|
3290
|
+
return "<b class='text-danger'>" + index_html + "(+" + change + "%)</b>";
|
3291
3291
|
} else if (change < 0) {
|
3292
|
-
|
3292
|
+
return "<b class='text-success'>" + index_html + "(" + change + "%)</b>";
|
3293
3293
|
}
|
3294
3294
|
return index_html;
|
3295
3295
|
},
|