sbd-npm 1.4.35 → 1.4.36
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/util.js +4 -4
package/package.json
CHANGED
package/util.js
CHANGED
@@ -62,7 +62,7 @@ const Util = {
|
|
62
62
|
$("#search-stock").click(function () {
|
63
63
|
let code = $("#stock").val();
|
64
64
|
if (code) {
|
65
|
-
if (window.location.pathname === "/status" && $("#word").hasClass('active') && (Util.
|
65
|
+
if (window.location.pathname === "/status" && $("#word").hasClass('active') && (Util.is_alphabet(code) || Util.is_chinese(code))) {
|
66
66
|
Util.fetch_word_data(0, "", code);
|
67
67
|
} else {
|
68
68
|
window.open("/stock/" + code, "_blank");
|
@@ -102,7 +102,7 @@ const Util = {
|
|
102
102
|
$("#stock").on("focus keyup", function () {
|
103
103
|
let key_word = $(this).val();
|
104
104
|
if (key_word) {
|
105
|
-
if (Util.is_has_chinese(key_word) || (Util.
|
105
|
+
if (Util.is_has_chinese(key_word) || (Util.is_alphabet(key_word) && key_word.length >= 2) || ($.isNumeric(key_word) && key_word.length >= 3)) {
|
106
106
|
if (window.location.pathname === "/status" && $("#word").hasClass('active')) {
|
107
107
|
return false;
|
108
108
|
}
|
@@ -366,7 +366,7 @@ const Util = {
|
|
366
366
|
* @returns {*}
|
367
367
|
*/
|
368
368
|
stock_basics_html: function (html, item) {
|
369
|
-
let symbol = Util.
|
369
|
+
let symbol = Util.is_alphabet(item["code"]) ? item["code"].toUpperCase() : item["code"];
|
370
370
|
let name = symbol;
|
371
371
|
if (item["cname"]) {
|
372
372
|
if (Util.is_us(item["code"])) {
|
@@ -2546,7 +2546,7 @@ const Util = {
|
|
2546
2546
|
* @param str
|
2547
2547
|
* @returns {boolean}
|
2548
2548
|
*/
|
2549
|
-
|
2549
|
+
is_alphabet: function (str) {
|
2550
2550
|
return /^[A-Za-z]+$/.test(str);
|
2551
2551
|
},
|
2552
2552
|
|