Skip to content

Commit

Permalink
Modify dialog.js to work as module
Browse files Browse the repository at this point in the history
  • Loading branch information
HashidaTKS committed Sep 24, 2024
1 parent 16d88b6 commit e320591
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/web/dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
<title>Confirmation</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!-- <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous"> -->
<script type="module" src="https://unpkg.com/@fluentui/web-components"></script>
<script src="https://unpkg.com/@fluentui/web-components" type="module"></script>
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" type="application/javascript" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script type="module" src="recipient-parser.mjs"></script>
<script type="module" src="recipient-classifier.mjs"></script>
<script src="dialog.js" type="application/javascript"></script>
<script src="dialog.css" type="stylesheet"></script>
<script src="recipient-parser.mjs" type="module"></script>
<script src="recipient-classifier.mjs" type="module"></script>
<script src="dialog.js" type="module"></script>
<link rel="stylesheet" href="dialog.css">
</head>
<body>
Expand Down
8 changes: 4 additions & 4 deletions src/web/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function sendStatusToParent(status) {
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function onCheckAllTrusted() {
window.onCheckAllTrusted = () => {
const checkTargetLength = $("fluent-checkbox.check-target").length;
const checkedTargetLength = $("fluent-checkbox.check-target.checked").length;
const toBeCheckedNumber = $("#trusted-domains fluent-checkbox.check-target").not(".checked").length;
Expand All @@ -30,17 +30,17 @@ function onCheckAllTrusted() {
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function onOk() {
window.onOk = () => {
sendStatusToParent("ok");
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function onCancel() {
window.onCancel = () => {
sendStatusToParent("cancel");
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function checkboxChanged(target_element) {
window.checkboxChanged = (target_element) => {
const checkTargetLength = $("fluent-checkbox.check-target").length;
const checkedTargetLength = $("fluent-checkbox.check-target.checked").length;
// If the target is currently checked, the target is unchecked after this function and vice versa.
Expand Down

0 comments on commit e320591

Please sign in to comment.