Skip to content

Commit

Permalink
Clipboard Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
claytoncarney committed Dec 2, 2022
1 parent da6834e commit 6e4875b
Show file tree
Hide file tree
Showing 33 changed files with 856 additions and 501 deletions.
654 changes: 406 additions & 248 deletions bundle.js

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions css/kjs.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,35 @@ textarea {
margin: 0.25rem;
}

.btn-banner {
align-self: center;
background-color: transparent;
flex: 1 1 auto;
height: 100%;
overflow: hidden;
padding: 0 0.5rem;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
}

.btn-banner--active {
background-color: var(--ui-hint-bg);
color: var(--ui-hint-fg);
}

.btn-banner--bookmark-list {
width: 100%;
}

.btn-banner--search-result {
width: 100%;
}

.btn-banner--strong-result {
width: 100%;
}

.btn-book {
flex: 0 0 20%;
height: var(--target-size);
Expand Down
2 changes: 1 addition & 1 deletion help/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h1>KJS</h1>
<blockquote><strong>Heaven and earth shall pass away, but my words shall not pass away.</strong></blockquote>
<hr>
<h1>Version</h1>
<p>2022.11.20</p>
<p>2022.12.01</p>
<h1>Contact</h1>
<p>github.1john419@gmail.com</p>
<h1>Source Code</h1>
Expand Down
2 changes: 1 addition & 1 deletion help/bookmark.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h3>Expand Mode</h3>
</div>
</div>
<br>
<p>When Expand Mode is on, verse text for each bookmark is displayed</p>
<p>When Expand Mode is active, verse text for each bookmark is displayed</p>
<h3>Strong Mode</h3>
<p>This toggle button in the lower toolbar sets the Strong Mode:</p>
<div class="entry entry--icon">
Expand Down
9 changes: 9 additions & 0 deletions help/clipboard-mode.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="topic--clipboard-mode">
<h1>Clipboard Mode</h1>
<p>The Clipboard Mode can be activated in the Read, Bookmark List, and Search Result, and Strong Result panes.</p>
<p>When Clipboard Mode is active, tapping a verse in the associated pane will copy the verse text to the system clipboard.</p>
<p>To activate Clipboard Mode, tap the pane banner in the upper toolbar. The banner is highlighted, indicating Clipboard Mode is active.</p>
<p>To deactivate Clipboard Mode, tap the banner in the upper toolbar again. The banner is dehighlighted, indicating Clipboard Mode is inactive.</p>
<p>Note: In the Bookmark List pane, Clipboard Mode is available only when the Expand Mode is active (see Bookmark help topic).</p>
</div>

4 changes: 2 additions & 2 deletions js/Model/HelpModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const validTasks = [
'help-read', 'help-topic',
];
const validTopics = [
'about', 'bookmark', 'help', 'name-mode', 'navigator', 'overview', 'read',
'search', 'setting', 'strong', 'thats-my-king',
'about', 'bookmark', 'clipboard-mode', 'help', 'name-mode', 'navigator',
'overview', 'read', 'search', 'setting', 'strong', 'thats-my-king',
];

class HelpModel {
Expand Down
2 changes: 1 addition & 1 deletion js/Model/SearchModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class SearchModel {
tomeFilter() {
return {
bookIdx: -1,
chapterIdx: -1
chapterIdx: -1,
};
}

Expand Down
6 changes: 3 additions & 3 deletions js/View/BookmarkExportView.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ class BookmarkExportview {

toolbarLowerClick(event) {
event.preventDefault();
let target = event.target.closest('button');
if (target) {
if (target === this.btnBookmarkFolder) {
let btn = event.target.closest('button');
if (btn) {
if (btn === this.btnBookmarkFolder) {
queue.publish('bookmark-folder', null);
}
}
Expand Down
10 changes: 5 additions & 5 deletions js/View/BookmarkFolderAddView.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class BookmarkFolderAddView {

dialogClick(event) {
event.preventDefault();
let target = event.target;
if (target === this.btnSave) {
let btn = event.target.closest('button');
if (btn === this.btnSave) {
this.saveClick();
}
}
Expand Down Expand Up @@ -136,9 +136,9 @@ class BookmarkFolderAddView {

toolbarLowerClick(event) {
event.preventDefault();
let target = event.target.closest('button');
if (target) {
if (target === this.btnBookmarkFolder) {
let btn = event.target.closest('button');
if (btn) {
if (btn === this.btnBookmarkFolder) {
queue.publish('bookmark-folder', null);
}
}
Expand Down
10 changes: 5 additions & 5 deletions js/View/BookmarkFolderDeleteView.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class BookmarkFolderDeleteView {

dialogClick(event) {
event.preventDefault();
let target = event.target;
if (target === this.btnDelete) {
let btn = event.target.closest('button');
if (btn === this.btnDelete) {
this.deleteClick();
}
}
Expand Down Expand Up @@ -116,9 +116,9 @@ class BookmarkFolderDeleteView {

toolbarLowerClick(event) {
event.preventDefault();
let target = event.target.closest('button');
if (target) {
if (target === this.btnBookmarkFolder) {
let btn = event.target.closest('button');
if (btn) {
if (btn === this.btnBookmarkFolder) {
queue.publish('bookmark-folder', null);
}
}
Expand Down
10 changes: 5 additions & 5 deletions js/View/BookmarkFolderRenameView.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class BookmarkFolderRenameView {

dialogClick(event) {
event.preventDefault();
let target = event.target;
if (target === this.btnSave) {
let btn = event.target.closest('button');
if (btn === this.btnSave) {
this.saveClick();
}
}
Expand Down Expand Up @@ -149,9 +149,9 @@ class BookmarkFolderRenameView {

toolbarLowerClick(event) {
event.preventDefault();
let target = event.target.closest('button');
if (target) {
if (target === this.btnBookmarkFolder) {
let btn = event.target.closest('button');
if (btn) {
if (btn === this.btnBookmarkFolder) {
queue.publish('bookmark-folder', null);
}
}
Expand Down
26 changes: 13 additions & 13 deletions js/View/BookmarkFolderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ class BookmarkFolderView {

listClick(event) {
event.preventDefault();
let target = event.target.closest('button');
if (target) {
if (target.classList.contains('btn-entry')) {
let folderName = target.textContent;
let btn = event.target.closest('button');
if (btn) {
if (btn.classList.contains('btn-entry')) {
let folderName = btn.textContent;
queue.publish('bookmark-folder.select', folderName);
} else if (target.classList.contains('btn-icon--h-menu')) {
let entry = target.previousSibling;
} else if (btn.classList.contains('btn-icon--h-menu')) {
let entry = btn.previousSibling;
this.menuClick(entry);
}
}
Expand Down Expand Up @@ -200,17 +200,17 @@ class BookmarkFolderView {

toolbarLowerClick(event) {
event.preventDefault();
let target = event.target.closest('button');
if (target) {
if (target === this.btnBack) {
let btn = event.target.closest('button');
if (btn) {
if (btn === this.btnBack) {
queue.publish('bookmark.back', null);
} else if (target === this.btnBookmarkList) {
} else if (btn === this.btnBookmarkList) {
queue.publish('bookmark-list', null);
} else if (target === this.btnBookmarkFolderAdd) {
} else if (btn === this.btnBookmarkFolderAdd) {
queue.publish('bookmark-folder-add', null);
} else if (target === this.btnExport) {
} else if (btn === this.btnExport) {
queue.publish('bookmark-export', null);
} else if (target === this.btnImport) {
} else if (btn === this.btnImport) {
queue.publish('bookmark-import', null);
}
}
Expand Down
10 changes: 5 additions & 5 deletions js/View/BookmarkImportView.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class BookmarkImportView {

dialogClick(event) {
event.preventDefault();
let target = event.target;
if (target === this.btnImport) {
let btn = event.target.closest('button');
if (btn === this.btnImport) {
this.importClick();
}
}
Expand Down Expand Up @@ -128,9 +128,9 @@ class BookmarkImportView {

toolbarLowerClick(event) {
event.preventDefault();
let target = event.target.closest('button');
if (target) {
if (target === this.btnBookmarkFolder) {
let btn = event.target.closest('button');
if (btn) {
if (btn === this.btnBookmarkFolder) {
queue.publish('bookmark-folder', null);
}
}
Expand Down
Loading

0 comments on commit 6e4875b

Please sign in to comment.