Skip to content

Commit

Permalink
chore: Rename data-tooltip to tooltip-content
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhua committed Nov 10, 2023
1 parent 92660a2 commit 587a706
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions css/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ a:hover>.fa-lightbulb,

.tool-tip::before {
visibility: hidden;
content: attr(data-tooltip);
content: attr(tooltip-content);
position: absolute;
z-index: 5;
bottom: 120%;
Expand Down Expand Up @@ -165,7 +165,7 @@ a:hover>.fa-lightbulb,
.rpcGroup>.input-group::before {
visibility: hidden;
opacity: 0;
content: attr(data-tooltip);
content: attr(tooltip-content);
transition: opacity .2s ease-in .3s;
}

Expand Down
6 changes: 3 additions & 3 deletions js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var Configs =
const input = event.target;
input.classList.remove("is-invalid", "is-valid", "is-warning");
input.parentElement.classList.remove('tool-tip');
input.parentElement.removeAttribute("data-tooltip");
input.parentElement.removeAttribute("tooltip-content");
let result = validator[input.type](input.value);
if (result == "VALID") {
input.classList.add("is-valid");
Expand All @@ -80,7 +80,7 @@ var Configs =
input.classList.add("is-valid", "is-warning");
input.parentElement.classList.add("tool-tip");
let tooltip = chrome.i18n.getMessage("RpcUrlTooltipWarnDes");
input.parentElement.setAttribute("data-tooltip", tooltip);
input.parentElement.setAttribute("tooltip-content", tooltip);
}
};

Expand All @@ -98,7 +98,7 @@ var Configs =
if (Utils.validateRpcUrl(rpcList[i].url) == "WARNING") {
let tooltip = chrome.i18n.getMessage("RpcUrlTooltipWarnDes");
$("#rpcItem-" + i).addClass('tool-tip');
$("#rpcItem-" + i).attr("data-tooltip", tooltip);
$("#rpcItem-" + i).attr("tooltip-content", tooltip);
$("#rpcUrl-" + i).addClass('is-warning');
}
}
Expand Down
12 changes: 6 additions & 6 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<label class="col-sm-2 text-info"><i class="fa-solid fa-download"></i>
__MSG_downloadCaptureStr__</label>
<div class="col-sm-10">
<div class="input-group custom-control-inline custom-switch tool-tip tool-tip-icon" data-tooltip="⌨: Alt + A">
<div class="input-group custom-control-inline custom-switch tool-tip tool-tip-icon" tooltip-content="⌨: Alt + A">
<input class="custom-control-input" type="checkbox" id="integration">
<label class="custom-control-label" for="integration">
__MSG_downloadCaptureDes__
Expand Down Expand Up @@ -86,7 +86,7 @@
__MSG_monitorAria2Des__
</label>
</div>
<div id="monitor-all" class="custom-control custom-switch tool-tip tool-tip-icon" data-tooltip="__MSG_monitorAllTips__">
<div id="monitor-all" class="custom-control custom-switch tool-tip tool-tip-icon" tooltip-content="__MSG_monitorAllTips__">
<input class="custom-control-input" type="checkbox" id="monitorAll">
<label class="custom-control-label" for="monitorAll">
__MSG_monitorAllDes__
Expand Down Expand Up @@ -175,9 +175,9 @@
<label class="col-sm-2 text-info"><i class="fa-solid fa-rotate"></i>
__MSG_configCloudSync__</label>
<div class="col-sm-auto">
<button type="button" class="btn btn-primary mx-1 tool-tip" id="upload" data-tooltip="⌨: Alt + U"><i class="fa-solid fa-cloud-arrow-up"></i>
<button type="button" class="btn btn-primary mx-1 tool-tip" id="upload" tooltip-content="⌨: Alt + U"><i class="fa-solid fa-cloud-arrow-up"></i>
__MSG_upload__</button>
<button type="button" class="btn btn-primary mx-1 tool-tip" id="download" data-tooltip="⌨: Alt + J"><i class="fa-solid fa-cloud-arrow-down"></i>
<button type="button" class="btn btn-primary mx-1 tool-tip" id="download" tooltip-content="⌨: Alt + J"><i class="fa-solid fa-cloud-arrow-down"></i>
__MSG_download__</button>
<em>(__MSG_configCloudSyncDes__)</em>
<span class="alert" id="sync-result"></span>
Expand All @@ -196,9 +196,9 @@
</span>

<span class="text-center">
<button type="submit" class="btn btn-success mr-5 tool-tip" id="save" data-tooltip="⌨: Alt + S"><i class="fa-regular fa-circle-check"></i>
<button type="submit" class="btn btn-success mr-5 tool-tip" id="save" tooltip-content="⌨: Alt + S"><i class="fa-regular fa-circle-check"></i>
__MSG_Save__</button>
<button type="reset" class="btn btn-warning mx-5 tool-tip" id="reset" data-tooltip="⌨: Alt + R"><i class="fa-regular fa-circle-xmark"></i>
<button type="reset" class="btn btn-warning mx-5 tool-tip" id="reset" tooltip-content="⌨: Alt + R"><i class="fa-regular fa-circle-xmark"></i>
__MSG_Reset__</button>
</span>

Expand Down

0 comments on commit 587a706

Please sign in to comment.