diff --git a/src/content/mytinytodo.js b/src/content/mytinytodo.js index 78cb13a..0e3f588 100644 --- a/src/content/mytinytodo.js +++ b/src/content/mytinytodo.js @@ -1031,7 +1031,7 @@ function enableFeedKeyInCurList() if (curList.feedKey) { $('#btnFeedKey').addClass('mtt-item-checked'); $('#btnShowFeedKey').removeClass('mtt-item-disabled'); - alert(curList.feedKey); + mttAlert(curList.feedKey); } else { $('#btnFeedKey').removeClass('mtt-item-checked'); @@ -1044,7 +1044,7 @@ function showFeedKeyInCurList() { if (!curList) return false; if (curList.feedKey === undefined || curList.feedKey === '') return false; - alert(curList.feedKey); + mttAlert(curList.feedKey); }; @@ -2652,6 +2652,26 @@ function mttPrompt(msg, defaultValue, callbackOk, callbackCancel) } } +function mttAlert(msg, callbackOk) +{ + $("#btnModalOk").click(function() { + $("#modal_overlay, #modal").hide(); + $("body").css("overflow", ""); + if (typeof callbackOk === 'function') + callbackOk(); + }); + var modalOverlay = document.getElementById("modal_overlay"); + if (!modalOverlay) { + modalOverlay = document.createElement("div"); + modalOverlay.id = "modal_overlay"; + modalOverlay.style.cssText = "position: absolute; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; background-color: black; opacity: 0.8; display:none;"; + document.getElementsByTagName('body')[0].appendChild(modalOverlay); + } + $("#modal .modal-content").text(msg); + $("body").css("overflow", "hidden"); + $("#modal_overlay, #modal").show(); +} + /* * History and Hash change diff --git a/src/content/theme/dark.css b/src/content/theme/dark.css index cd0da48..cf556f8 100644 --- a/src/content/theme/dark.css +++ b/src/content/theme/dark.css @@ -21,6 +21,7 @@ --color-btn-default: #fff; --color-btn-hover: #444; --color-submit: #444; + --color-submit-hover: #555; --color-row-underlinig: #303030; --color-border-default: #555; --color-border-focus: #5a8df0; diff --git a/src/content/theme/style.css b/src/content/theme/style.css index b5e40c8..5d39def 100644 --- a/src/content/theme/style.css +++ b/src/content/theme/style.css @@ -24,6 +24,7 @@ --color-btn-default: #000; --color-btn-hover: #efefef; --color-submit: #eee; + --color-submit-hover: #ddd; --color-row-underlinig: #dedede; --color-border-default: #ccc; --color-border-focus: #5a8df0; @@ -109,7 +110,7 @@ body { flex-direction:column; align-items:center; } -body, td, th, input, textarea, select { +body, td, th, input, textarea, select, button { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", /*Roboto,*/ Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 1rem; } @@ -921,6 +922,41 @@ li.mtt-item-hidden { display:none; } } +#modal { + position: absolute; + z-index: 1000; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + min-width: 200px; + max-width: 1000px; /* same as #mtt */ + border: 1px solid var(--color-menu-border); + background: var(--color-bg); + box-shadow: var(--color-popup-shadow); + border-radius: 5px; + opacity: 1; +} +#modal .modal-content { + padding: 1.5rem; +} +#modal .modal-bottom { + border-top: 1px solid var(--color-border-default); + text-align: center; + padding: 0.8rem; +} +#modal .modal-bottom button { + min-width: 4rem; + padding: 4px 6px; + margin: 0 4px; + background-color: var(--color-submit); + border: 1px solid var(--color-border-default); + border-radius: 3px; + transition: background-color 0.1s ease-out; +} +#modal .modal-bottom button:hover { + background-color: var(--color-submit-hover); +} + /* font for small screens */ @media only screen and (max-width: 600px), only screen and (max-height: 600px) { html { @@ -1021,4 +1057,12 @@ li.mtt-item-hidden { display:none; } border-radius:14px; } + #modal { + width: 90%; + } + #modal .modal-bottom button { + padding: 7px; + border-radius:14px; + } + } /* end of @media min 600px */ diff --git a/src/includes/lang/en.json b/src/includes/lang/en.json index 10d9728..a9c24c9 100644 --- a/src/includes/lang/en.json +++ b/src/includes/lang/en.json @@ -117,6 +117,7 @@ "action_delete": "Delete", "action_priority": "Priority", "action_move": "Move to", + "action_ok": "OK", "notes": "Notes:", "notes_show": "Show", "notes_hide": "Hide", diff --git a/src/includes/lang/ru.json b/src/includes/lang/ru.json index 26db51b..7ff765d 100644 --- a/src/includes/lang/ru.json +++ b/src/includes/lang/ru.json @@ -117,6 +117,7 @@ "action_delete": "Удалить", "action_priority": "Приоритет", "action_move": "Переместить в", + "action_ok": "ОК", "notes": "Заметки:", "notes_show": "Показать", "notes_hide": "Скрыть", diff --git a/src/includes/theme.php b/src/includes/theme.php index e12bc36..2e88854 100644 --- a/src/includes/theme.php +++ b/src/includes/theme.php @@ -278,6 +278,13 @@ $().ready(function(){ + +