-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of bookmarks display on browser page.
- Loading branch information
Showing
10 changed files
with
165 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{% comment %} | ||
// | ||
// Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu> | ||
// Creation Date: Wed Oct 6 12:27:04 PDT 2021 | ||
// Last Modified: Wed Oct 6 12:27:07 PDT 2021 | ||
// Filename: _includes/browse/highlightSortedTableColumn.js | ||
// Used by: _includes/browse/displayBrowsePage.js | ||
// Included in: _includes/browse/main.html | ||
// Syntax: ECMAScript 6 | ||
// vim: ts=3:nowrap | ||
// | ||
// Description: Generate contents for all fields in browwe search form. | ||
// | ||
{% endcomment %} | ||
|
||
POPC2.prototype.highlightSortedTableColumn = function (index) { | ||
this.DebugMessageFunction(); | ||
|
||
}; | ||
|
||
Object.defineProperty(POPC2.prototype.highlightSortedTableColumn, "name", { value: "highlightSortedTableColumn" }); | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{% comment %} | ||
// | ||
// Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu> | ||
// Creation Date: Sat Oct 30 20:51:13 PDT 2021 | ||
// Last Modified: Sat Oct 30 20:51:17 PDT 2021 | ||
// Filename: _includes/browse/toggleBookmarkDisplay.js | ||
// Used by: _includes/handlebars/template-browse.html | ||
// Included in: _includes/browse/main.html | ||
// Syntax: ECMAScript 6 | ||
// vim: ts=3:nowrap | ||
// | ||
// Description: Toggle between bookmark and browse search results. | ||
// | ||
{% endcomment %} | ||
|
||
POPC2.prototype.toggleBookmarkDisplay = function () { | ||
this.DebugMessageFunction(); | ||
|
||
let belement = document.querySelector("#bookmark-browse-button"); | ||
if (!belement) { | ||
console.log("CANNOT FIND B ELEMENT"); | ||
return; | ||
} | ||
|
||
let state = 0; | ||
if (belement.classList.contains("selected")) { | ||
state = 1; | ||
} | ||
|
||
let felement = document.querySelector("#filters"); | ||
let h1element = document.querySelector("h1"); | ||
|
||
state = !state; | ||
if (state) { | ||
belement.classList.add("selected"); | ||
if (felement) { | ||
felement.classList.add("hidden"); | ||
} | ||
this.VARS.SEARCH_RESULTS = this.VARS.WORK_BOOKMARKS; | ||
if (h1element) { | ||
h1element.innerHTML = this.getTranslation("bookmarks"); | ||
} | ||
} else { | ||
belement.classList.remove("selected"); | ||
if (felement) { | ||
felement.classList.remove("hidden"); | ||
} | ||
if (h1element) { | ||
h1element.innerHTML = this.getTranslation("title"); | ||
} | ||
} | ||
|
||
this.displayBrowseTable(); | ||
}; | ||
|
||
Object.defineProperty(POPC2.prototype.toggleBookmarkDisplay, "name", { value: "toggleBookmarkDisplay" }); | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% comment %} | ||
// | ||
// Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu> | ||
// Creation Date: Sat Oct 30 22:36:48 PDT 2021 | ||
// Last Modified: Sat Oct 30 22:36:51 PDT 2021 | ||
// Filename: _includes/handlebars/helper-bookmarkHide.js | ||
// Used by: | ||
// Included in: _includes/handlebars/main.html | ||
// Syntax: ECMAScript 6 | ||
// vim: ts=3:nowrap | ||
// | ||
// Description: Hide something (filter menu) if bookmarks are active. | ||
// | ||
{% endcomment %} | ||
|
||
Handlebars.registerHelper("bookmarkHide", function() { | ||
let belement = document.querySelector("#bookmark-browse-button"); | ||
let bookmarks = false; | ||
if (belement && belement.classList.contains("selected")) { | ||
bookmarks = true; | ||
} | ||
|
||
if (bookmarks) { | ||
return new Handlebars.SafeString("hidden"); | ||
} | ||
|
||
return new Handlebars.SafeString(""); | ||
}); | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% comment %} | ||
// | ||
// Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu> | ||
// Creation Date: Sat Oct 30 22:22:19 PDT 2021 | ||
// Last Modified: Sat Oct 30 22:22:22 PDT 2021 | ||
// Filename: _includes/handlebars/helper-showTitle.js | ||
// Used by: | ||
// Included in: _includes/handlebars/main.html | ||
// Syntax: ECMAScript 6 | ||
// vim: ts=3:nowrap | ||
// | ||
// Description: Display the page title (on the browse page). This is | ||
// usually the website title, but could be "Bookmarks" or | ||
// "History" view. | ||
// | ||
{% endcomment %} | ||
|
||
Handlebars.registerHelper("showTitle", function() { | ||
let belement = document.querySelector("#bookmark-browse-button"); | ||
let bookmarks = false; | ||
if (belement && belement.classList.contains("selected")) { | ||
bookmarks = true; | ||
} | ||
|
||
if (bookmarks) { | ||
return new Handlebars.SafeString(popc2.getTranslation("bookmarks")); | ||
} | ||
|
||
return new Handlebars.SafeString(popc2.getTranslation("title")); | ||
}); | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters