dsh-bash-terminal-ts 0.9.3 → 0.9.4
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/dist/client.core.js +72 -85
- package/dist/client.js +72 -85
- package/dsh.plugin.json +1 -1
- package/lib/client.js +72 -85
- package/package.json +1 -1
- package/src/webterminals/browser/star-row-copy.ts +99 -97
package/dist/client.core.js
CHANGED
|
@@ -7772,46 +7772,28 @@ function pickLang() {
|
|
|
7772
7772
|
}
|
|
7773
7773
|
return STAR_COPY.en;
|
|
7774
7774
|
}
|
|
7775
|
-
var
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7775
|
+
var STAR_VERSION = "0.9.3";
|
|
7776
|
+
var STAR_FOOT_COPY = {
|
|
7777
|
+
zh: { ask: "\u89C9\u5F97\u597D\u7528\uFF1F", star: "\u53BB GitHub \u70B9\u4E2A Star", issue: "\u53CD\u9988\u5EFA\u8BAE / \u63D0 issue" },
|
|
7778
|
+
en: { ask: "Finding it useful?", star: "Star on GitHub", issue: "Feedback / open an issue" },
|
|
7779
|
+
ja: { ask: "\u304A\u5F79\u306B\u7ACB\u3063\u3066\u3044\u307E\u3059\u304B\uFF1F", star: "GitHub \u3067\u30B9\u30BF\u30FC", issue: "\u3054\u610F\u898B\u30FB\u4E0D\u5177\u5408\u5831\u544A" },
|
|
7780
|
+
ko: { ask: "\uC720\uC6A9\uD55C\uAC00\uC694?", star: "GitHub \uC5D0\uC11C \uC2A4\uD0C0", issue: "\uD53C\uB4DC\uBC31 / \uC774\uC288 \uC5F4\uAE30" },
|
|
7781
|
+
fr: { ask: "Utile ?", star: "Une \xE9toile sur GitHub", issue: "Retour / ouvrir un ticket" },
|
|
7782
|
+
de: { ask: "Hilfreich?", star: "Stern auf GitHub", issue: "Feedback / Issue \xF6ffnen" },
|
|
7783
|
+
it: { ask: "Ti \xE8 utile?", star: "Stella su GitHub", issue: "Feedback / apri una issue" },
|
|
7784
|
+
ru: { ask: "\u041F\u043E\u043B\u0435\u0437\u043D\u043E?", star: "\u0417\u0432\u0435\u0437\u0434\u0430 \u043D\u0430 GitHub", issue: "\u041E\u0442\u0437\u044B\u0432 / \u043E\u0442\u043A\u0440\u044B\u0442\u044C issue" },
|
|
7785
|
+
es: { ask: "\xBFTe resulta \xFAtil?", star: "Danos una estrella", issue: "Sugerencias / abrir issue" },
|
|
7786
|
+
pt: { ask: "Achou \xFAtil?", star: "D\xEA uma estrela no GitHub", issue: "Feedback / abrir uma issue" }
|
|
7786
7787
|
};
|
|
7787
|
-
var
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
es: "Ocultar",
|
|
7797
|
-
pt: "Ocultar"
|
|
7798
|
-
};
|
|
7799
|
-
var STAR_S_STYLE_ID = "dsh-star-row-s-style";
|
|
7800
|
-
var STAR_S_STYLE = [
|
|
7801
|
-
".dsh-star-row-s{display:flex;align-items:center;gap:8px;flex-wrap:wrap;",
|
|
7802
|
-
"font-size:12px;line-height:1.5;color:inherit;opacity:.75;margin-top:10px;",
|
|
7803
|
-
"padding-top:8px;border-top:1px solid var(--dsw-alias-border-l2,currentColor)}",
|
|
7804
|
-
".dsh-star-row-s:hover{opacity:1}",
|
|
7805
|
-
".dsh-star-link{display:inline-flex;align-items:center;gap:6px;",
|
|
7806
|
-
"color:inherit;text-decoration:none}",
|
|
7807
|
-
".dsh-star-link:hover{text-decoration:underline}",
|
|
7808
|
-
".dsh-star-link svg{width:14px;height:14px;flex:none;display:block}",
|
|
7809
|
-
".dsh-star-row-s .dsh-star-ask{opacity:.85;font-weight:400}",
|
|
7810
|
-
".dsh-star-cta,.dsh-star-hide{font:inherit;font-size:11px;line-height:1;",
|
|
7811
|
-
"padding:4px 9px;border-radius:999px;border:1px solid currentColor;",
|
|
7812
|
-
"background:transparent;color:inherit;cursor:pointer;flex:none;opacity:.7}",
|
|
7813
|
-
".dsh-star-hide{padding:4px 7px}",
|
|
7814
|
-
".dsh-star-cta:hover,.dsh-star-hide:hover{opacity:1}"
|
|
7788
|
+
var STAR_FOOT_STYLE_ID = "dsh-star-foot-style";
|
|
7789
|
+
var STAR_FOOT_STYLE = [
|
|
7790
|
+
".dsh-star-foot{display:flex;align-items:center;gap:6px;flex-wrap:wrap;",
|
|
7791
|
+
"font-size:12px;line-height:1.6;color:inherit;opacity:.72;margin-top:10px}",
|
|
7792
|
+
".dsh-star-foot:hover{opacity:1}",
|
|
7793
|
+
".dsh-star-foot .dsh-star-ver{opacity:.6;font-variant-numeric:tabular-nums}",
|
|
7794
|
+
".dsh-star-foot .dsh-star-dot{opacity:.4}",
|
|
7795
|
+
".dsh-star-foot a{color:inherit;text-decoration:none}",
|
|
7796
|
+
".dsh-star-foot a:hover{text-decoration:underline}"
|
|
7815
7797
|
].join("");
|
|
7816
7798
|
function starLang() {
|
|
7817
7799
|
const tag = typeof document !== "undefined" && document.documentElement.lang || "";
|
|
@@ -7819,72 +7801,77 @@ function starLang() {
|
|
|
7819
7801
|
for (const cand of STAR_LANGS) if (low.startsWith(cand)) return cand;
|
|
7820
7802
|
return "en";
|
|
7821
7803
|
}
|
|
7804
|
+
var STAR_DISMISS_KEY = "dsh.star." + STAR_NS + ".v2.dismissed";
|
|
7805
|
+
var STAR_DISMISS_KEY_V1 = "dsh.star." + STAR_NS + ".dismissed";
|
|
7822
7806
|
function starDismissed() {
|
|
7823
7807
|
try {
|
|
7824
|
-
|
|
7808
|
+
if (localStorage.getItem(STAR_DISMISS_KEY_V1) !== null) {
|
|
7809
|
+
localStorage.removeItem(STAR_DISMISS_KEY_V1);
|
|
7810
|
+
}
|
|
7811
|
+
return localStorage.getItem(STAR_DISMISS_KEY) === "1";
|
|
7825
7812
|
} catch {
|
|
7826
7813
|
return false;
|
|
7827
7814
|
}
|
|
7828
7815
|
}
|
|
7829
7816
|
function starDismiss() {
|
|
7830
7817
|
try {
|
|
7831
|
-
localStorage.setItem(
|
|
7818
|
+
localStorage.setItem(STAR_DISMISS_KEY, "1");
|
|
7832
7819
|
} catch {
|
|
7833
7820
|
}
|
|
7834
7821
|
}
|
|
7835
|
-
function
|
|
7836
|
-
if (d.getElementById(
|
|
7822
|
+
function injectFootStyle(d) {
|
|
7823
|
+
if (d.getElementById(STAR_FOOT_STYLE_ID)) return;
|
|
7837
7824
|
const style = d.createElement("style");
|
|
7838
|
-
style.id =
|
|
7839
|
-
style.textContent =
|
|
7825
|
+
style.id = STAR_FOOT_STYLE_ID;
|
|
7826
|
+
style.textContent = STAR_FOOT_STYLE;
|
|
7840
7827
|
d.head.appendChild(style);
|
|
7841
7828
|
}
|
|
7842
|
-
function
|
|
7843
|
-
const
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7829
|
+
function footItem(d, tag, text, href) {
|
|
7830
|
+
const el = d.createElement(tag);
|
|
7831
|
+
el.className = "dsh-star-ask";
|
|
7832
|
+
if (tag === "a" && href) {
|
|
7833
|
+
const a = el;
|
|
7834
|
+
a.href = href;
|
|
7835
|
+
a.target = "_blank";
|
|
7836
|
+
a.rel = "noopener noreferrer";
|
|
7837
|
+
}
|
|
7838
|
+
el.textContent = text;
|
|
7839
|
+
return el;
|
|
7840
|
+
}
|
|
7841
|
+
function footDot(d) {
|
|
7842
|
+
const dot = d.createElement("span");
|
|
7843
|
+
dot.className = "dsh-star-dot";
|
|
7844
|
+
dot.textContent = "\xB7";
|
|
7845
|
+
return dot;
|
|
7848
7846
|
}
|
|
7849
|
-
function extendedStarRow(
|
|
7847
|
+
function extendedStarRow(neutral, d) {
|
|
7850
7848
|
if (STAR_VARIANT !== "S") return null;
|
|
7851
|
-
if (starDismissed()) return
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
const
|
|
7849
|
+
if (starDismissed()) return null;
|
|
7850
|
+
injectFootStyle(d);
|
|
7851
|
+
const copy = STAR_FOOT_COPY[starLang()] ?? STAR_FOOT_COPY.en;
|
|
7852
|
+
const issuesUrl = REPO_URL.replace(/\/+$/, "") + "/issues/new";
|
|
7855
7853
|
const row = d.createElement("div");
|
|
7856
|
-
row.className = "dsh-star-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
row.appendChild(
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
openRepo(d);
|
|
7870
|
-
});
|
|
7871
|
-
row.appendChild(cta);
|
|
7872
|
-
const hide = d.createElement("button");
|
|
7873
|
-
hide.type = "button";
|
|
7874
|
-
hide.className = "dsh-star-hide";
|
|
7875
|
-
hide.textContent = "\xD7";
|
|
7876
|
-
hide.title = STAR_HIDE[lang];
|
|
7877
|
-
hide.setAttribute("aria-label", STAR_HIDE[lang]);
|
|
7878
|
-
hide.addEventListener("click", (event) => {
|
|
7879
|
-
event.preventDefault();
|
|
7880
|
-
event.stopPropagation();
|
|
7854
|
+
row.className = "dsh-star-foot";
|
|
7855
|
+
const ver = d.createElement("span");
|
|
7856
|
+
ver.className = "dsh-star-ver";
|
|
7857
|
+
ver.textContent = "v" + STAR_VERSION;
|
|
7858
|
+
row.appendChild(ver);
|
|
7859
|
+
row.appendChild(footDot(d));
|
|
7860
|
+
row.appendChild(footItem(d, "span", copy.ask));
|
|
7861
|
+
const star = footItem(d, "a", "\u2B50 " + copy.star, REPO_URL);
|
|
7862
|
+
const issue = footItem(d, "a", "\u{1F4AC} " + copy.issue, issuesUrl);
|
|
7863
|
+
row.appendChild(star);
|
|
7864
|
+
row.appendChild(footDot(d));
|
|
7865
|
+
row.appendChild(issue);
|
|
7866
|
+
const collapse = () => {
|
|
7881
7867
|
starDismiss();
|
|
7882
7868
|
if (row.parentNode) {
|
|
7883
|
-
|
|
7884
|
-
|
|
7869
|
+
neutral.className = "dsh-star-row";
|
|
7870
|
+
row.parentNode.replaceChild(neutral, row);
|
|
7885
7871
|
}
|
|
7886
|
-
}
|
|
7887
|
-
|
|
7872
|
+
};
|
|
7873
|
+
star.addEventListener("click", collapse);
|
|
7874
|
+
issue.addEventListener("click", collapse);
|
|
7888
7875
|
return row;
|
|
7889
7876
|
}
|
|
7890
7877
|
function mountStarRow(doc) {
|
package/dist/client.js
CHANGED
|
@@ -7777,46 +7777,28 @@ function pickLang() {
|
|
|
7777
7777
|
}
|
|
7778
7778
|
return STAR_COPY.en;
|
|
7779
7779
|
}
|
|
7780
|
-
var
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7780
|
+
var STAR_VERSION = "0.9.3";
|
|
7781
|
+
var STAR_FOOT_COPY = {
|
|
7782
|
+
zh: { ask: "\u89C9\u5F97\u597D\u7528\uFF1F", star: "\u53BB GitHub \u70B9\u4E2A Star", issue: "\u53CD\u9988\u5EFA\u8BAE / \u63D0 issue" },
|
|
7783
|
+
en: { ask: "Finding it useful?", star: "Star on GitHub", issue: "Feedback / open an issue" },
|
|
7784
|
+
ja: { ask: "\u304A\u5F79\u306B\u7ACB\u3063\u3066\u3044\u307E\u3059\u304B\uFF1F", star: "GitHub \u3067\u30B9\u30BF\u30FC", issue: "\u3054\u610F\u898B\u30FB\u4E0D\u5177\u5408\u5831\u544A" },
|
|
7785
|
+
ko: { ask: "\uC720\uC6A9\uD55C\uAC00\uC694?", star: "GitHub \uC5D0\uC11C \uC2A4\uD0C0", issue: "\uD53C\uB4DC\uBC31 / \uC774\uC288 \uC5F4\uAE30" },
|
|
7786
|
+
fr: { ask: "Utile ?", star: "Une \xE9toile sur GitHub", issue: "Retour / ouvrir un ticket" },
|
|
7787
|
+
de: { ask: "Hilfreich?", star: "Stern auf GitHub", issue: "Feedback / Issue \xF6ffnen" },
|
|
7788
|
+
it: { ask: "Ti \xE8 utile?", star: "Stella su GitHub", issue: "Feedback / apri una issue" },
|
|
7789
|
+
ru: { ask: "\u041F\u043E\u043B\u0435\u0437\u043D\u043E?", star: "\u0417\u0432\u0435\u0437\u0434\u0430 \u043D\u0430 GitHub", issue: "\u041E\u0442\u0437\u044B\u0432 / \u043E\u0442\u043A\u0440\u044B\u0442\u044C issue" },
|
|
7790
|
+
es: { ask: "\xBFTe resulta \xFAtil?", star: "Danos una estrella", issue: "Sugerencias / abrir issue" },
|
|
7791
|
+
pt: { ask: "Achou \xFAtil?", star: "D\xEA uma estrela no GitHub", issue: "Feedback / abrir uma issue" }
|
|
7791
7792
|
};
|
|
7792
|
-
var
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
es: "Ocultar",
|
|
7802
|
-
pt: "Ocultar"
|
|
7803
|
-
};
|
|
7804
|
-
var STAR_S_STYLE_ID = "dsh-star-row-s-style";
|
|
7805
|
-
var STAR_S_STYLE = [
|
|
7806
|
-
".dsh-star-row-s{display:flex;align-items:center;gap:8px;flex-wrap:wrap;",
|
|
7807
|
-
"font-size:12px;line-height:1.5;color:inherit;opacity:.75;margin-top:10px;",
|
|
7808
|
-
"padding-top:8px;border-top:1px solid var(--dsw-alias-border-l2,currentColor)}",
|
|
7809
|
-
".dsh-star-row-s:hover{opacity:1}",
|
|
7810
|
-
".dsh-star-link{display:inline-flex;align-items:center;gap:6px;",
|
|
7811
|
-
"color:inherit;text-decoration:none}",
|
|
7812
|
-
".dsh-star-link:hover{text-decoration:underline}",
|
|
7813
|
-
".dsh-star-link svg{width:14px;height:14px;flex:none;display:block}",
|
|
7814
|
-
".dsh-star-row-s .dsh-star-ask{opacity:.85;font-weight:400}",
|
|
7815
|
-
".dsh-star-cta,.dsh-star-hide{font:inherit;font-size:11px;line-height:1;",
|
|
7816
|
-
"padding:4px 9px;border-radius:999px;border:1px solid currentColor;",
|
|
7817
|
-
"background:transparent;color:inherit;cursor:pointer;flex:none;opacity:.7}",
|
|
7818
|
-
".dsh-star-hide{padding:4px 7px}",
|
|
7819
|
-
".dsh-star-cta:hover,.dsh-star-hide:hover{opacity:1}"
|
|
7793
|
+
var STAR_FOOT_STYLE_ID = "dsh-star-foot-style";
|
|
7794
|
+
var STAR_FOOT_STYLE = [
|
|
7795
|
+
".dsh-star-foot{display:flex;align-items:center;gap:6px;flex-wrap:wrap;",
|
|
7796
|
+
"font-size:12px;line-height:1.6;color:inherit;opacity:.72;margin-top:10px}",
|
|
7797
|
+
".dsh-star-foot:hover{opacity:1}",
|
|
7798
|
+
".dsh-star-foot .dsh-star-ver{opacity:.6;font-variant-numeric:tabular-nums}",
|
|
7799
|
+
".dsh-star-foot .dsh-star-dot{opacity:.4}",
|
|
7800
|
+
".dsh-star-foot a{color:inherit;text-decoration:none}",
|
|
7801
|
+
".dsh-star-foot a:hover{text-decoration:underline}"
|
|
7820
7802
|
].join("");
|
|
7821
7803
|
function starLang() {
|
|
7822
7804
|
const tag = typeof document !== "undefined" && document.documentElement.lang || "";
|
|
@@ -7824,72 +7806,77 @@ function starLang() {
|
|
|
7824
7806
|
for (const cand of STAR_LANGS) if (low.startsWith(cand)) return cand;
|
|
7825
7807
|
return "en";
|
|
7826
7808
|
}
|
|
7809
|
+
var STAR_DISMISS_KEY = "dsh.star." + STAR_NS + ".v2.dismissed";
|
|
7810
|
+
var STAR_DISMISS_KEY_V1 = "dsh.star." + STAR_NS + ".dismissed";
|
|
7827
7811
|
function starDismissed() {
|
|
7828
7812
|
try {
|
|
7829
|
-
|
|
7813
|
+
if (localStorage.getItem(STAR_DISMISS_KEY_V1) !== null) {
|
|
7814
|
+
localStorage.removeItem(STAR_DISMISS_KEY_V1);
|
|
7815
|
+
}
|
|
7816
|
+
return localStorage.getItem(STAR_DISMISS_KEY) === "1";
|
|
7830
7817
|
} catch {
|
|
7831
7818
|
return false;
|
|
7832
7819
|
}
|
|
7833
7820
|
}
|
|
7834
7821
|
function starDismiss() {
|
|
7835
7822
|
try {
|
|
7836
|
-
localStorage.setItem(
|
|
7823
|
+
localStorage.setItem(STAR_DISMISS_KEY, "1");
|
|
7837
7824
|
} catch {
|
|
7838
7825
|
}
|
|
7839
7826
|
}
|
|
7840
|
-
function
|
|
7841
|
-
if (d.getElementById(
|
|
7827
|
+
function injectFootStyle(d) {
|
|
7828
|
+
if (d.getElementById(STAR_FOOT_STYLE_ID)) return;
|
|
7842
7829
|
const style = d.createElement("style");
|
|
7843
|
-
style.id =
|
|
7844
|
-
style.textContent =
|
|
7830
|
+
style.id = STAR_FOOT_STYLE_ID;
|
|
7831
|
+
style.textContent = STAR_FOOT_STYLE;
|
|
7845
7832
|
d.head.appendChild(style);
|
|
7846
7833
|
}
|
|
7847
|
-
function
|
|
7848
|
-
const
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7834
|
+
function footItem(d, tag, text, href) {
|
|
7835
|
+
const el = d.createElement(tag);
|
|
7836
|
+
el.className = "dsh-star-ask";
|
|
7837
|
+
if (tag === "a" && href) {
|
|
7838
|
+
const a = el;
|
|
7839
|
+
a.href = href;
|
|
7840
|
+
a.target = "_blank";
|
|
7841
|
+
a.rel = "noopener noreferrer";
|
|
7842
|
+
}
|
|
7843
|
+
el.textContent = text;
|
|
7844
|
+
return el;
|
|
7845
|
+
}
|
|
7846
|
+
function footDot(d) {
|
|
7847
|
+
const dot = d.createElement("span");
|
|
7848
|
+
dot.className = "dsh-star-dot";
|
|
7849
|
+
dot.textContent = "\xB7";
|
|
7850
|
+
return dot;
|
|
7853
7851
|
}
|
|
7854
|
-
function extendedStarRow(
|
|
7852
|
+
function extendedStarRow(neutral, d) {
|
|
7855
7853
|
if (STAR_VARIANT !== "S") return null;
|
|
7856
|
-
if (starDismissed()) return
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
const
|
|
7854
|
+
if (starDismissed()) return null;
|
|
7855
|
+
injectFootStyle(d);
|
|
7856
|
+
const copy = STAR_FOOT_COPY[starLang()] ?? STAR_FOOT_COPY.en;
|
|
7857
|
+
const issuesUrl = REPO_URL.replace(/\/+$/, "") + "/issues/new";
|
|
7860
7858
|
const row = d.createElement("div");
|
|
7861
|
-
row.className = "dsh-star-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
row.appendChild(
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
openRepo(d);
|
|
7875
|
-
});
|
|
7876
|
-
row.appendChild(cta);
|
|
7877
|
-
const hide = d.createElement("button");
|
|
7878
|
-
hide.type = "button";
|
|
7879
|
-
hide.className = "dsh-star-hide";
|
|
7880
|
-
hide.textContent = "\xD7";
|
|
7881
|
-
hide.title = STAR_HIDE[lang];
|
|
7882
|
-
hide.setAttribute("aria-label", STAR_HIDE[lang]);
|
|
7883
|
-
hide.addEventListener("click", (event) => {
|
|
7884
|
-
event.preventDefault();
|
|
7885
|
-
event.stopPropagation();
|
|
7859
|
+
row.className = "dsh-star-foot";
|
|
7860
|
+
const ver = d.createElement("span");
|
|
7861
|
+
ver.className = "dsh-star-ver";
|
|
7862
|
+
ver.textContent = "v" + STAR_VERSION;
|
|
7863
|
+
row.appendChild(ver);
|
|
7864
|
+
row.appendChild(footDot(d));
|
|
7865
|
+
row.appendChild(footItem(d, "span", copy.ask));
|
|
7866
|
+
const star = footItem(d, "a", "\u2B50 " + copy.star, REPO_URL);
|
|
7867
|
+
const issue = footItem(d, "a", "\u{1F4AC} " + copy.issue, issuesUrl);
|
|
7868
|
+
row.appendChild(star);
|
|
7869
|
+
row.appendChild(footDot(d));
|
|
7870
|
+
row.appendChild(issue);
|
|
7871
|
+
const collapse = () => {
|
|
7886
7872
|
starDismiss();
|
|
7887
7873
|
if (row.parentNode) {
|
|
7888
|
-
|
|
7889
|
-
|
|
7874
|
+
neutral.className = "dsh-star-row";
|
|
7875
|
+
row.parentNode.replaceChild(neutral, row);
|
|
7890
7876
|
}
|
|
7891
|
-
}
|
|
7892
|
-
|
|
7877
|
+
};
|
|
7878
|
+
star.addEventListener("click", collapse);
|
|
7879
|
+
issue.addEventListener("click", collapse);
|
|
7893
7880
|
return row;
|
|
7894
7881
|
}
|
|
7895
7882
|
function mountStarRow(doc) {
|
package/dsh.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-bash-terminal-ts",
|
|
3
3
|
"name": "dsh-bash-terminal-ts",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.4",
|
|
5
5
|
"description": {
|
|
6
6
|
"en": "One shell tool that runs commands through PowerShell, Git Bash, MSYS2, WSL or Niubash on Windows, plus an embedded terminal for the bottom dock with per-shell activation switches and a default-shell fallback chain.",
|
|
7
7
|
"zh": "一个 shell 工具,可在 Windows 上通过 PowerShell / Git Bash / MSYS2 / WSL / Niubash 执行命令;另提供底部工作台的内嵌终端,支持按 shell 激活开关与默认 shell 回落链。",
|
package/lib/client.js
CHANGED
|
@@ -7777,46 +7777,28 @@ function pickLang() {
|
|
|
7777
7777
|
}
|
|
7778
7778
|
return STAR_COPY.en;
|
|
7779
7779
|
}
|
|
7780
|
-
var
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7780
|
+
var STAR_VERSION = "0.9.3";
|
|
7781
|
+
var STAR_FOOT_COPY = {
|
|
7782
|
+
zh: { ask: "\u89C9\u5F97\u597D\u7528\uFF1F", star: "\u53BB GitHub \u70B9\u4E2A Star", issue: "\u53CD\u9988\u5EFA\u8BAE / \u63D0 issue" },
|
|
7783
|
+
en: { ask: "Finding it useful?", star: "Star on GitHub", issue: "Feedback / open an issue" },
|
|
7784
|
+
ja: { ask: "\u304A\u5F79\u306B\u7ACB\u3063\u3066\u3044\u307E\u3059\u304B\uFF1F", star: "GitHub \u3067\u30B9\u30BF\u30FC", issue: "\u3054\u610F\u898B\u30FB\u4E0D\u5177\u5408\u5831\u544A" },
|
|
7785
|
+
ko: { ask: "\uC720\uC6A9\uD55C\uAC00\uC694?", star: "GitHub \uC5D0\uC11C \uC2A4\uD0C0", issue: "\uD53C\uB4DC\uBC31 / \uC774\uC288 \uC5F4\uAE30" },
|
|
7786
|
+
fr: { ask: "Utile ?", star: "Une \xE9toile sur GitHub", issue: "Retour / ouvrir un ticket" },
|
|
7787
|
+
de: { ask: "Hilfreich?", star: "Stern auf GitHub", issue: "Feedback / Issue \xF6ffnen" },
|
|
7788
|
+
it: { ask: "Ti \xE8 utile?", star: "Stella su GitHub", issue: "Feedback / apri una issue" },
|
|
7789
|
+
ru: { ask: "\u041F\u043E\u043B\u0435\u0437\u043D\u043E?", star: "\u0417\u0432\u0435\u0437\u0434\u0430 \u043D\u0430 GitHub", issue: "\u041E\u0442\u0437\u044B\u0432 / \u043E\u0442\u043A\u0440\u044B\u0442\u044C issue" },
|
|
7790
|
+
es: { ask: "\xBFTe resulta \xFAtil?", star: "Danos una estrella", issue: "Sugerencias / abrir issue" },
|
|
7791
|
+
pt: { ask: "Achou \xFAtil?", star: "D\xEA uma estrela no GitHub", issue: "Feedback / abrir uma issue" }
|
|
7791
7792
|
};
|
|
7792
|
-
var
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
es: "Ocultar",
|
|
7802
|
-
pt: "Ocultar"
|
|
7803
|
-
};
|
|
7804
|
-
var STAR_S_STYLE_ID = "dsh-star-row-s-style";
|
|
7805
|
-
var STAR_S_STYLE = [
|
|
7806
|
-
".dsh-star-row-s{display:flex;align-items:center;gap:8px;flex-wrap:wrap;",
|
|
7807
|
-
"font-size:12px;line-height:1.5;color:inherit;opacity:.75;margin-top:10px;",
|
|
7808
|
-
"padding-top:8px;border-top:1px solid var(--dsw-alias-border-l2,currentColor)}",
|
|
7809
|
-
".dsh-star-row-s:hover{opacity:1}",
|
|
7810
|
-
".dsh-star-link{display:inline-flex;align-items:center;gap:6px;",
|
|
7811
|
-
"color:inherit;text-decoration:none}",
|
|
7812
|
-
".dsh-star-link:hover{text-decoration:underline}",
|
|
7813
|
-
".dsh-star-link svg{width:14px;height:14px;flex:none;display:block}",
|
|
7814
|
-
".dsh-star-row-s .dsh-star-ask{opacity:.85;font-weight:400}",
|
|
7815
|
-
".dsh-star-cta,.dsh-star-hide{font:inherit;font-size:11px;line-height:1;",
|
|
7816
|
-
"padding:4px 9px;border-radius:999px;border:1px solid currentColor;",
|
|
7817
|
-
"background:transparent;color:inherit;cursor:pointer;flex:none;opacity:.7}",
|
|
7818
|
-
".dsh-star-hide{padding:4px 7px}",
|
|
7819
|
-
".dsh-star-cta:hover,.dsh-star-hide:hover{opacity:1}"
|
|
7793
|
+
var STAR_FOOT_STYLE_ID = "dsh-star-foot-style";
|
|
7794
|
+
var STAR_FOOT_STYLE = [
|
|
7795
|
+
".dsh-star-foot{display:flex;align-items:center;gap:6px;flex-wrap:wrap;",
|
|
7796
|
+
"font-size:12px;line-height:1.6;color:inherit;opacity:.72;margin-top:10px}",
|
|
7797
|
+
".dsh-star-foot:hover{opacity:1}",
|
|
7798
|
+
".dsh-star-foot .dsh-star-ver{opacity:.6;font-variant-numeric:tabular-nums}",
|
|
7799
|
+
".dsh-star-foot .dsh-star-dot{opacity:.4}",
|
|
7800
|
+
".dsh-star-foot a{color:inherit;text-decoration:none}",
|
|
7801
|
+
".dsh-star-foot a:hover{text-decoration:underline}"
|
|
7820
7802
|
].join("");
|
|
7821
7803
|
function starLang() {
|
|
7822
7804
|
const tag = typeof document !== "undefined" && document.documentElement.lang || "";
|
|
@@ -7824,72 +7806,77 @@ function starLang() {
|
|
|
7824
7806
|
for (const cand of STAR_LANGS) if (low.startsWith(cand)) return cand;
|
|
7825
7807
|
return "en";
|
|
7826
7808
|
}
|
|
7809
|
+
var STAR_DISMISS_KEY = "dsh.star." + STAR_NS + ".v2.dismissed";
|
|
7810
|
+
var STAR_DISMISS_KEY_V1 = "dsh.star." + STAR_NS + ".dismissed";
|
|
7827
7811
|
function starDismissed() {
|
|
7828
7812
|
try {
|
|
7829
|
-
|
|
7813
|
+
if (localStorage.getItem(STAR_DISMISS_KEY_V1) !== null) {
|
|
7814
|
+
localStorage.removeItem(STAR_DISMISS_KEY_V1);
|
|
7815
|
+
}
|
|
7816
|
+
return localStorage.getItem(STAR_DISMISS_KEY) === "1";
|
|
7830
7817
|
} catch {
|
|
7831
7818
|
return false;
|
|
7832
7819
|
}
|
|
7833
7820
|
}
|
|
7834
7821
|
function starDismiss() {
|
|
7835
7822
|
try {
|
|
7836
|
-
localStorage.setItem(
|
|
7823
|
+
localStorage.setItem(STAR_DISMISS_KEY, "1");
|
|
7837
7824
|
} catch {
|
|
7838
7825
|
}
|
|
7839
7826
|
}
|
|
7840
|
-
function
|
|
7841
|
-
if (d.getElementById(
|
|
7827
|
+
function injectFootStyle(d) {
|
|
7828
|
+
if (d.getElementById(STAR_FOOT_STYLE_ID)) return;
|
|
7842
7829
|
const style = d.createElement("style");
|
|
7843
|
-
style.id =
|
|
7844
|
-
style.textContent =
|
|
7830
|
+
style.id = STAR_FOOT_STYLE_ID;
|
|
7831
|
+
style.textContent = STAR_FOOT_STYLE;
|
|
7845
7832
|
d.head.appendChild(style);
|
|
7846
7833
|
}
|
|
7847
|
-
function
|
|
7848
|
-
const
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7834
|
+
function footItem(d, tag, text, href) {
|
|
7835
|
+
const el = d.createElement(tag);
|
|
7836
|
+
el.className = "dsh-star-ask";
|
|
7837
|
+
if (tag === "a" && href) {
|
|
7838
|
+
const a = el;
|
|
7839
|
+
a.href = href;
|
|
7840
|
+
a.target = "_blank";
|
|
7841
|
+
a.rel = "noopener noreferrer";
|
|
7842
|
+
}
|
|
7843
|
+
el.textContent = text;
|
|
7844
|
+
return el;
|
|
7845
|
+
}
|
|
7846
|
+
function footDot(d) {
|
|
7847
|
+
const dot = d.createElement("span");
|
|
7848
|
+
dot.className = "dsh-star-dot";
|
|
7849
|
+
dot.textContent = "\xB7";
|
|
7850
|
+
return dot;
|
|
7853
7851
|
}
|
|
7854
|
-
function extendedStarRow(
|
|
7852
|
+
function extendedStarRow(neutral, d) {
|
|
7855
7853
|
if (STAR_VARIANT !== "S") return null;
|
|
7856
|
-
if (starDismissed()) return
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
const
|
|
7854
|
+
if (starDismissed()) return null;
|
|
7855
|
+
injectFootStyle(d);
|
|
7856
|
+
const copy = STAR_FOOT_COPY[starLang()] ?? STAR_FOOT_COPY.en;
|
|
7857
|
+
const issuesUrl = REPO_URL.replace(/\/+$/, "") + "/issues/new";
|
|
7860
7858
|
const row = d.createElement("div");
|
|
7861
|
-
row.className = "dsh-star-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
row.appendChild(
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
openRepo(d);
|
|
7875
|
-
});
|
|
7876
|
-
row.appendChild(cta);
|
|
7877
|
-
const hide = d.createElement("button");
|
|
7878
|
-
hide.type = "button";
|
|
7879
|
-
hide.className = "dsh-star-hide";
|
|
7880
|
-
hide.textContent = "\xD7";
|
|
7881
|
-
hide.title = STAR_HIDE[lang];
|
|
7882
|
-
hide.setAttribute("aria-label", STAR_HIDE[lang]);
|
|
7883
|
-
hide.addEventListener("click", (event) => {
|
|
7884
|
-
event.preventDefault();
|
|
7885
|
-
event.stopPropagation();
|
|
7859
|
+
row.className = "dsh-star-foot";
|
|
7860
|
+
const ver = d.createElement("span");
|
|
7861
|
+
ver.className = "dsh-star-ver";
|
|
7862
|
+
ver.textContent = "v" + STAR_VERSION;
|
|
7863
|
+
row.appendChild(ver);
|
|
7864
|
+
row.appendChild(footDot(d));
|
|
7865
|
+
row.appendChild(footItem(d, "span", copy.ask));
|
|
7866
|
+
const star = footItem(d, "a", "\u2B50 " + copy.star, REPO_URL);
|
|
7867
|
+
const issue = footItem(d, "a", "\u{1F4AC} " + copy.issue, issuesUrl);
|
|
7868
|
+
row.appendChild(star);
|
|
7869
|
+
row.appendChild(footDot(d));
|
|
7870
|
+
row.appendChild(issue);
|
|
7871
|
+
const collapse = () => {
|
|
7886
7872
|
starDismiss();
|
|
7887
7873
|
if (row.parentNode) {
|
|
7888
|
-
|
|
7889
|
-
|
|
7874
|
+
neutral.className = "dsh-star-row";
|
|
7875
|
+
row.parentNode.replaceChild(neutral, row);
|
|
7890
7876
|
}
|
|
7891
|
-
}
|
|
7892
|
-
|
|
7877
|
+
};
|
|
7878
|
+
star.addEventListener("click", collapse);
|
|
7879
|
+
issue.addEventListener("click", collapse);
|
|
7893
7880
|
return row;
|
|
7894
7881
|
}
|
|
7895
7882
|
function mountStarRow(doc) {
|
package/package.json
CHANGED
|
@@ -70,55 +70,42 @@ function pickLang(): { ask: string } {
|
|
|
70
70
|
return STAR_COPY.en!;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
// STAR:EXTENDED:BEGIN — S
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
it: "Stella",
|
|
87
|
-
ru: "Звезда",
|
|
88
|
-
es: "Estrella",
|
|
89
|
-
pt: "Estrela",
|
|
90
|
-
};
|
|
73
|
+
// STAR:EXTENDED:BEGIN — S 档专用段(v2:一行页脚 = 版本 · 问句 · ⭐ star · 💬 issue)。
|
|
74
|
+
// 学产品页脚的写法:**不建按钮、不画边框、不留关闭钮**,整行只有两个 <a>。
|
|
75
|
+
// 旧 S 档(≤2.0.25)把 GitHub 链接 + 长话术 + ★ 胶囊 + × 胶囊四个元素挤在一行并压一条
|
|
76
|
+
// 顶部分割线:★ 与整行链接同义(都开仓库页)、× 是负向首因,用户先想关掉而不是点星。
|
|
77
|
+
// v2 收成截图那种一段式:版本打头(sync 从各仓 package.json 烘进来,--check 即版本哨兵),
|
|
78
|
+
// 短问句「觉得好用?」只问不讲道理,两个动作(star / 开 issue)都是纯文字链接。
|
|
79
|
+
// 关闭态:点过任一链接即自动收成中性一行(localStorage `dsh.star.<ns>.v2.dismissed=1`),
|
|
80
|
+
// 不再提供可见的 ×;旧键(≤2.0.25 把点星误写成关闭)读到即清、**不迁值**。
|
|
81
|
+
// 文案 10 语随 documentElement.lang;本段由 sync 对 A/L 副本整段剥除。
|
|
82
|
+
|
|
83
|
+
// STAR-VER:BEGIN — generated by sync.mjs from <repo>/package.json; edit the real source instead
|
|
84
|
+
const STAR_VERSION = "0.9.3";
|
|
85
|
+
// STAR-VER:END
|
|
91
86
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
pt: "Ocultar",
|
|
87
|
+
const STAR_FOOT_COPY: Record<string, { ask: string; star: string; issue: string }> = {
|
|
88
|
+
zh: { ask: "觉得好用?", star: "去 GitHub 点个 Star", issue: "反馈建议 / 提 issue" },
|
|
89
|
+
en: { ask: "Finding it useful?", star: "Star on GitHub", issue: "Feedback / open an issue" },
|
|
90
|
+
ja: { ask: "お役に立っていますか?", star: "GitHub でスター", issue: "ご意見・不具合報告" },
|
|
91
|
+
ko: { ask: "유용한가요?", star: "GitHub 에서 스타", issue: "피드백 / 이슈 열기" },
|
|
92
|
+
fr: { ask: "Utile ?", star: "Une étoile sur GitHub", issue: "Retour / ouvrir un ticket" },
|
|
93
|
+
de: { ask: "Hilfreich?", star: "Stern auf GitHub", issue: "Feedback / Issue öffnen" },
|
|
94
|
+
it: { ask: "Ti è utile?", star: "Stella su GitHub", issue: "Feedback / apri una issue" },
|
|
95
|
+
ru: { ask: "Полезно?", star: "Звезда на GitHub", issue: "Отзыв / открыть issue" },
|
|
96
|
+
es: { ask: "¿Te resulta útil?", star: "Danos una estrella", issue: "Sugerencias / abrir issue" },
|
|
97
|
+
pt: { ask: "Achou útil?", star: "Dê uma estrela no GitHub", issue: "Feedback / abrir uma issue" },
|
|
104
98
|
};
|
|
105
99
|
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
".dsh-star-
|
|
109
|
-
"font-size:12px;line-height:1.
|
|
110
|
-
"
|
|
111
|
-
".dsh-star-
|
|
112
|
-
".dsh-star-
|
|
113
|
-
"color:inherit;text-decoration:none}",
|
|
114
|
-
".dsh-star-
|
|
115
|
-
".dsh-star-link svg{width:14px;height:14px;flex:none;display:block}",
|
|
116
|
-
".dsh-star-row-s .dsh-star-ask{opacity:.85;font-weight:400}",
|
|
117
|
-
".dsh-star-cta,.dsh-star-hide{font:inherit;font-size:11px;line-height:1;",
|
|
118
|
-
"padding:4px 9px;border-radius:999px;border:1px solid currentColor;",
|
|
119
|
-
"background:transparent;color:inherit;cursor:pointer;flex:none;opacity:.7}",
|
|
120
|
-
".dsh-star-hide{padding:4px 7px}",
|
|
121
|
-
".dsh-star-cta:hover,.dsh-star-hide:hover{opacity:1}",
|
|
100
|
+
const STAR_FOOT_STYLE_ID = "dsh-star-foot-style";
|
|
101
|
+
const STAR_FOOT_STYLE = [
|
|
102
|
+
".dsh-star-foot{display:flex;align-items:center;gap:6px;flex-wrap:wrap;",
|
|
103
|
+
"font-size:12px;line-height:1.6;color:inherit;opacity:.72;margin-top:10px}",
|
|
104
|
+
".dsh-star-foot:hover{opacity:1}",
|
|
105
|
+
".dsh-star-foot .dsh-star-ver{opacity:.6;font-variant-numeric:tabular-nums}",
|
|
106
|
+
".dsh-star-foot .dsh-star-dot{opacity:.4}",
|
|
107
|
+
".dsh-star-foot a{color:inherit;text-decoration:none}",
|
|
108
|
+
".dsh-star-foot a:hover{text-decoration:underline}",
|
|
122
109
|
].join("");
|
|
123
110
|
|
|
124
111
|
/** 宿主语言标签归一:取 `documentElement.lang` 的前缀,命中 STAR_LANGS 即用。 */
|
|
@@ -129,10 +116,19 @@ function starLang(): string {
|
|
|
129
116
|
return "en";
|
|
130
117
|
}
|
|
131
118
|
|
|
119
|
+
/** 关闭态新键(v2)。**必须换键**:≤2.0.25 把「点 ★」误写成了关闭,旧键里的 1 是误判产物。 */
|
|
120
|
+
const STAR_DISMISS_KEY = "dsh.star." + STAR_NS + ".v2.dismissed";
|
|
121
|
+
/** 旧键(脏数据源):读到即清掉,**不迁值**——迁过来等于把旧 bug 固化。 */
|
|
122
|
+
const STAR_DISMISS_KEY_V1 = "dsh.star." + STAR_NS + ".dismissed";
|
|
123
|
+
|
|
132
124
|
/** 是否已被用户点掉话术(隐私模式下读失败按未关闭处理,只影响本次会话)。 */
|
|
133
125
|
function starDismissed(): boolean {
|
|
134
126
|
try {
|
|
135
|
-
|
|
127
|
+
// 一次性清旧键:旧版点 ★ 就写 1,凡中招的用户会被它永久按成裸链接。
|
|
128
|
+
if (localStorage.getItem(STAR_DISMISS_KEY_V1) !== null) {
|
|
129
|
+
localStorage.removeItem(STAR_DISMISS_KEY_V1);
|
|
130
|
+
}
|
|
131
|
+
return localStorage.getItem(STAR_DISMISS_KEY) === "1";
|
|
136
132
|
} catch {
|
|
137
133
|
return false;
|
|
138
134
|
}
|
|
@@ -141,72 +137,78 @@ function starDismissed(): boolean {
|
|
|
141
137
|
/** 记住关闭态(隐私模式写失败不报错,话术本次隐藏、刷新复活)。 */
|
|
142
138
|
function starDismiss(): void {
|
|
143
139
|
try {
|
|
144
|
-
localStorage.setItem(
|
|
140
|
+
localStorage.setItem(STAR_DISMISS_KEY, "1");
|
|
145
141
|
} catch {
|
|
146
142
|
/* noop */
|
|
147
143
|
}
|
|
148
144
|
}
|
|
149
145
|
|
|
150
|
-
/**
|
|
151
|
-
function
|
|
152
|
-
if (d.getElementById(
|
|
146
|
+
/** 一次性注入页脚样式。 */
|
|
147
|
+
function injectFootStyle(d: Document): void {
|
|
148
|
+
if (d.getElementById(STAR_FOOT_STYLE_ID)) return;
|
|
153
149
|
const style = d.createElement("style");
|
|
154
|
-
style.id =
|
|
155
|
-
style.textContent =
|
|
150
|
+
style.id = STAR_FOOT_STYLE_ID;
|
|
151
|
+
style.textContent = STAR_FOOT_STYLE;
|
|
156
152
|
d.head.appendChild(style);
|
|
157
153
|
}
|
|
158
154
|
|
|
159
|
-
/**
|
|
160
|
-
function
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
155
|
+
/** 页脚里的一段:可点即 <a>,纯文字即 <span>。 */
|
|
156
|
+
function footItem(d: Document, tag: "a" | "span", text: string, href?: string): HTMLElement {
|
|
157
|
+
const el = d.createElement(tag);
|
|
158
|
+
el.className = "dsh-star-ask";
|
|
159
|
+
if (tag === "a" && href) {
|
|
160
|
+
const a = el as HTMLAnchorElement;
|
|
161
|
+
a.href = href;
|
|
162
|
+
a.target = "_blank";
|
|
163
|
+
a.rel = "noopener noreferrer";
|
|
164
|
+
}
|
|
165
|
+
el.textContent = text;
|
|
166
|
+
return el;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** 分隔点。 */
|
|
170
|
+
function footDot(d: Document): HTMLElement {
|
|
171
|
+
const dot = d.createElement("span");
|
|
172
|
+
dot.className = "dsh-star-dot";
|
|
173
|
+
dot.textContent = "·";
|
|
174
|
+
return dot;
|
|
166
175
|
}
|
|
167
176
|
|
|
168
|
-
/**
|
|
169
|
-
|
|
177
|
+
/**
|
|
178
|
+
* S 档:一行页脚;非 S 档或已关掉过话术时返回 null(走裸链接原路径)。
|
|
179
|
+
* 点过任一链接 → 记关闭 + 换回中性一行,链接本身照常跳转(不 preventDefault)。
|
|
180
|
+
*/
|
|
181
|
+
function extendedStarRow(neutral: HTMLAnchorElement, d: Document): HTMLElement | null {
|
|
170
182
|
if (STAR_VARIANT !== "S") return null;
|
|
171
|
-
if (starDismissed()) return
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const
|
|
183
|
+
if (starDismissed()) return null;
|
|
184
|
+
injectFootStyle(d);
|
|
185
|
+
const copy = STAR_FOOT_COPY[starLang()] ?? STAR_FOOT_COPY.en!;
|
|
186
|
+
const issuesUrl = REPO_URL.replace(/\/+$/, "") + "/issues/new";
|
|
175
187
|
const row = d.createElement("div");
|
|
176
|
-
row.className = "dsh-star-
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
row.appendChild(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
row.appendChild(cta);
|
|
193
|
-
const hide = d.createElement("button");
|
|
194
|
-
hide.type = "button";
|
|
195
|
-
hide.className = "dsh-star-hide";
|
|
196
|
-
hide.textContent = "×";
|
|
197
|
-
hide.title = STAR_HIDE[lang]!;
|
|
198
|
-
hide.setAttribute("aria-label", STAR_HIDE[lang]!);
|
|
199
|
-
hide.addEventListener("click", (event: Event) => {
|
|
200
|
-
// 隐藏才是「别打扰我」:收话术与两钮,链接段永留。
|
|
201
|
-
event.preventDefault();
|
|
202
|
-
event.stopPropagation();
|
|
188
|
+
row.className = "dsh-star-foot";
|
|
189
|
+
|
|
190
|
+
const ver = d.createElement("span");
|
|
191
|
+
ver.className = "dsh-star-ver";
|
|
192
|
+
ver.textContent = "v" + STAR_VERSION;
|
|
193
|
+
row.appendChild(ver);
|
|
194
|
+
row.appendChild(footDot(d));
|
|
195
|
+
row.appendChild(footItem(d, "span", copy.ask));
|
|
196
|
+
const star = footItem(d, "a", "⭐ " + copy.star, REPO_URL);
|
|
197
|
+
const issue = footItem(d, "a", "💬 " + copy.issue, issuesUrl);
|
|
198
|
+
row.appendChild(star);
|
|
199
|
+
row.appendChild(footDot(d));
|
|
200
|
+
row.appendChild(issue);
|
|
201
|
+
|
|
202
|
+
// 点过就收敛:话术只打扰一次,链接段以后一直留着(和 v1 的 dismissed 语义一致)。
|
|
203
|
+
const collapse = (): void => {
|
|
203
204
|
starDismiss();
|
|
204
205
|
if (row.parentNode) {
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
neutral.className = "dsh-star-row";
|
|
207
|
+
row.parentNode.replaceChild(neutral, row);
|
|
207
208
|
}
|
|
208
|
-
}
|
|
209
|
-
|
|
209
|
+
};
|
|
210
|
+
star.addEventListener("click", collapse);
|
|
211
|
+
issue.addEventListener("click", collapse);
|
|
210
212
|
return row;
|
|
211
213
|
}
|
|
212
214
|
// STAR:EXTENDED:END
|