vault backup: 2024-09-05 17:56:43
This commit is contained in:
1 parent
73d081e6b1
commit
f92e45c2bf
100 files changed
+15691
-15981
No files matched your search
Vendored
+952
-334
File diff suppressed because it is too large.
Load diff
+2
-1
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"id": "dataview",
|
"id": "dataview",
|
||||||
"name": "Dataview",
|
"name": "Dataview",
|
||||||
"version": "0.5.59",
|
"version": "0.5.67",
|
||||||
"minAppVersion": "0.13.11",
|
"minAppVersion": "0.13.11",
|
||||||
"description": "Complex data views for the data-obsessed.",
|
"description": "Complex data views for the data-obsessed.",
|
||||||
"author": "Michael Brenan <blacksmithgu@gmail.com>",
|
"author": "Michael Brenan <blacksmithgu@gmail.com>",
|
||||||
"authorUrl": "https://github.com/blacksmithgu",
|
"authorUrl": "https://github.com/blacksmithgu",
|
||||||
|
"helpUrl": "https://blacksmithgu.github.io/obsidian-dataview/",
|
||||||
"isDesktopOnly": false
|
"isDesktopOnly": false
|
||||||
}
|
}
|
||||||
+1004
-536
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "local-backup",
|
"id": "local-backup",
|
||||||
"name": "Local Backup",
|
"name": "Local Backup",
|
||||||
"version": "0.0.5",
|
"version": "0.1.7",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "Automatically creates a local backup of the vault.",
|
"description": "Automatically creates a local backup of the vault.",
|
||||||
"author": "GC Chen",
|
"author": "GC Chen",
|
||||||
|
|||||||
+3371
-2662
File diff suppressed because it is too large.
Load diff
+5
-4
@@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
|
"author": "Vinzent",
|
||||||
|
"authorUrl": "https://github.com/Vinzent03",
|
||||||
"id": "obsidian-git",
|
"id": "obsidian-git",
|
||||||
"name": "Obsidian Git",
|
"name": "Git",
|
||||||
"description": "Backup your vault with Git.",
|
"description": "Integrate Git version control with automatic backup and other advanced features.",
|
||||||
"isDesktopOnly": false,
|
"isDesktopOnly": false,
|
||||||
"fundingUrl": "https://ko-fi.com/vinzent",
|
"fundingUrl": "https://ko-fi.com/vinzent",
|
||||||
"js": "main.js",
|
"version": "2.26.0"
|
||||||
"version": "2.22.0"
|
|
||||||
}
|
}
|
||||||
+63
-13
@@ -8,16 +8,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace-leaf-content[data-type='git-view'] .button-border {
|
.workspace-leaf-content[data-type="git-view"] .button-border {
|
||||||
border: 2px solid var(--interactive-accent);
|
border: 2px solid var(--interactive-accent);
|
||||||
border-radius: var(--radius-s);
|
border-radius: var(--radius-s);
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace-leaf-content[data-type='git-view'] .view-content {
|
.workspace-leaf-content[data-type="git-view"] .view-content {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace-leaf-content[data-type='git-history-view'] .view-content {
|
.workspace-leaf-content[data-type="git-history-view"] .view-content {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,6 +77,22 @@
|
|||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.is-active .git-tools .buttons > * {
|
||||||
|
color: var(--nav-item-color-active);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-author {
|
||||||
|
color: var(--text-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-date {
|
||||||
|
color: var(--text-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-ref {
|
||||||
|
color: var(--text-accent);
|
||||||
|
}
|
||||||
|
|
||||||
.workspace-leaf-content[data-type="diff-view"] .d2h-d-none {
|
.workspace-leaf-content[data-type="diff-view"] .d2h-d-none {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -228,12 +244,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
|
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
|
||||||
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del {
|
.theme-light
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-code-side-line
|
||||||
|
del {
|
||||||
background-color: #ffb6ba;
|
background-color: #ffb6ba;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
|
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
|
||||||
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del {
|
.theme-dark
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-code-side-line
|
||||||
|
del {
|
||||||
background-color: #8d232881;
|
background-color: #8d232881;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,13 +271,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
|
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
|
||||||
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins {
|
.theme-light
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-code-side-line
|
||||||
|
ins {
|
||||||
background-color: #97f295;
|
background-color: #97f295;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
|
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
|
||||||
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins {
|
.theme-dark
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-code-side-line
|
||||||
|
ins {
|
||||||
background-color: #1d921996;
|
background-color: #1d921996;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
@@ -376,19 +404,31 @@
|
|||||||
color: var(--text-normal);
|
color: var(--text-normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change {
|
.theme-light
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-file-diff
|
||||||
|
.d2h-del.d2h-change {
|
||||||
background-color: #fdf2d0;
|
background-color: #fdf2d0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change {
|
.theme-dark
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-file-diff
|
||||||
|
.d2h-del.d2h-change {
|
||||||
background-color: #55492480;
|
background-color: #55492480;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change {
|
.theme-light
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-file-diff
|
||||||
|
.d2h-ins.d2h-change {
|
||||||
background-color: #ded;
|
background-color: #ded;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change {
|
.theme-dark
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-file-diff
|
||||||
|
.d2h-ins.d2h-change {
|
||||||
background-color: rgba(37, 78, 37, 0.418);
|
background-color: rgba(37, 78, 37, 0.418);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,7 +441,9 @@
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a:visited {
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-file-list-wrapper
|
||||||
|
a:visited {
|
||||||
color: #3572b0;
|
color: #3572b0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,7 +543,8 @@
|
|||||||
background-color: var(--background-secondary);
|
background-color: var(--background-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cm-gutterElement.obs-git-blame-gutter > div, .line-author-settings-preview {
|
.cm-gutterElement.obs-git-blame-gutter > div,
|
||||||
|
.line-author-settings-preview {
|
||||||
/* delegate text color to settings */
|
/* delegate text color to settings */
|
||||||
color: var(--obs-git-gutter-text);
|
color: var(--obs-git-gutter-text);
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
@@ -510,3 +553,10 @@
|
|||||||
padding: 0px 6px 0px 6px;
|
padding: 0px 6px 0px 6px;
|
||||||
white-space: pre; /* Keep spaces and do not collapse them. */
|
white-space: pre; /* Keep spaces and do not collapse them. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 800px) {
|
||||||
|
/* hide git blame gutter not to superpose text */
|
||||||
|
.cm-gutterElement.obs-git-blame-gutter {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
+244
-2548
File diff suppressed because it is too large.
Load diff
+3
-2
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"id": "obsidian-linter",
|
"id": "obsidian-linter",
|
||||||
"name": "Linter",
|
"name": "Linter",
|
||||||
"version": "1.20.0",
|
"version": "1.26.0",
|
||||||
"minAppVersion": "0.15.6",
|
"minAppVersion": "1.5.7",
|
||||||
"description": "Formats and styles your notes. It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.",
|
"description": "Formats and styles your notes. It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.",
|
||||||
"author": "Victor Tao",
|
"author": "Victor Tao",
|
||||||
"authorUrl": "https://github.com/platers",
|
"authorUrl": "https://github.com/platers",
|
||||||
|
"helpUrl": "https://platers.github.io/obsidian-linter/",
|
||||||
"isDesktopOnly": false
|
"isDesktopOnly": false
|
||||||
}
|
}
|
||||||
+19
@@ -210,6 +210,25 @@ textarea.full-width {
|
|||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Files to ignore
|
||||||
|
*/
|
||||||
|
.linter-files-to-ignore-container div:last-child {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.linter-files-to-ignore {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border: none;
|
||||||
|
border-bottom: var(--hr-thickness) solid;
|
||||||
|
border-color: var(--hr-color);
|
||||||
|
}
|
||||||
|
.linter-files-to-ignore-normal-input {
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
.linter-files-to-ignore-flags {
|
||||||
|
width: 15%;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setting item no border
|
* Setting item no border
|
||||||
*/
|
*/
|
||||||
|
|||||||
+93
-9788
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "obsidian-style-settings",
|
"id": "obsidian-style-settings",
|
||||||
"name": "Style Settings",
|
"name": "Style Settings",
|
||||||
"version": "1.0.8",
|
"version": "1.0.9",
|
||||||
"minAppVersion": "0.11.5",
|
"minAppVersion": "0.11.5",
|
||||||
"description": "Offers controls for adjusting theme, plugin, and snippet CSS variables.",
|
"description": "Offers controls for adjusting theme, plugin, and snippet CSS variables.",
|
||||||
"author": "mgmeyers",
|
"author": "mgmeyers",
|
||||||
|
|||||||
+42
-42
@@ -1,44 +1,3 @@
|
|||||||
.style-settings-container .pcr-app {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.style-settings-container .pcr-app.visible {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pcr-app .pcr-swatches > button {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pickr .pcr-button {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.themed-color-wrapper > div {
|
|
||||||
background: var(--background-primary);
|
|
||||||
padding: 10px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.themed-color-wrapper > div + div {
|
|
||||||
margin-top: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.themed-color-wrapper button {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.themed-color-wrapper .pickr-reset > button {
|
|
||||||
margin: 0 0 0 10px;
|
|
||||||
padding: 9px;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.themed-color-wrapper .pickr-reset > button > svg {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.style-settings-heading {
|
.style-settings-heading {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
@@ -238,6 +197,47 @@
|
|||||||
|
|
||||||
.style-settings-info-text .style-settings-markdown :last-child {
|
.style-settings-info-text .style-settings-markdown :last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}/*! Pickr 1.8.4 MIT | https://github.com/Simonwep/pickr */
|
}.style-settings-container .pcr-app {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.style-settings-container .pcr-app.visible {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pcr-app .pcr-swatches > button {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pickr .pcr-button {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.themed-color-wrapper > div {
|
||||||
|
background: var(--background-primary);
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.themed-color-wrapper > div + div {
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.themed-color-wrapper button {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.themed-color-wrapper .pickr-reset > button {
|
||||||
|
margin: 0 0 0 10px;
|
||||||
|
padding: 9px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.themed-color-wrapper .pickr-reset > button > svg {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
/*! Pickr 1.8.4 MIT | https://github.com/Simonwep/pickr */
|
||||||
.pickr{position:relative;overflow:visible;transform:translateY(0)}.pickr *{box-sizing:border-box;outline:none;border:none;-webkit-appearance:none}.pickr .pcr-button{position:relative;height:2em;width:2em;padding:0.5em;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;border-radius:.15em;background:url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" stroke="%2342445A" stroke-width="5px" stroke-linecap="round"><path d="M45,45L5,5"></path><path d="M45,5L5,45"></path></svg>') no-repeat center;background-size:0;transition:all 0.3s}.pickr .pcr-button::before{position:absolute;content:'';top:0;left:0;width:100%;height:100%;background:url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2"><path fill="white" d="M1,0H2V1H1V0ZM0,1H1V2H0V1Z"/><path fill="gray" d="M0,0H1V1H0V0ZM1,1H2V2H1V1Z"/></svg>');background-size:.5em;border-radius:.15em;z-index:-1}.pickr .pcr-button::before{z-index:initial}.pickr .pcr-button::after{position:absolute;content:'';top:0;left:0;height:100%;width:100%;transition:background 0.3s;background:var(--pcr-color);border-radius:.15em}.pickr .pcr-button.clear{background-size:70%}.pickr .pcr-button.clear::before{opacity:0}.pickr .pcr-button.clear:focus{box-shadow:0 0 0 1px rgba(255,255,255,0.85),0 0 0 3px var(--pcr-color)}.pickr .pcr-button.disabled{cursor:not-allowed}.pickr *,.pcr-app *{box-sizing:border-box;outline:none;border:none;-webkit-appearance:none}.pickr input:focus,.pickr input.pcr-active,.pickr button:focus,.pickr button.pcr-active,.pcr-app input:focus,.pcr-app input.pcr-active,.pcr-app button:focus,.pcr-app button.pcr-active{box-shadow:0 0 0 1px rgba(255,255,255,0.85),0 0 0 3px var(--pcr-color)}.pickr .pcr-palette,.pickr .pcr-slider,.pcr-app .pcr-palette,.pcr-app .pcr-slider{transition:box-shadow 0.3s}.pickr .pcr-palette:focus,.pickr .pcr-slider:focus,.pcr-app .pcr-palette:focus,.pcr-app .pcr-slider:focus{box-shadow:0 0 0 1px rgba(255,255,255,0.85),0 0 0 3px rgba(0,0,0,0.25)}.pcr-app{position:fixed;display:flex;flex-direction:column;z-index:10000;border-radius:0.1em;background:#fff;opacity:0;visibility:hidden;transition:opacity 0.3s, visibility 0s 0.3s;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;box-shadow:0 0.15em 1.5em 0 rgba(0,0,0,0.1),0 0 1em 0 rgba(0,0,0,0.03);left:0;top:0}.pcr-app.visible{transition:opacity 0.3s;visibility:visible;opacity:1}.pcr-app .pcr-swatches{display:flex;flex-wrap:wrap;margin-top:0.75em}.pcr-app .pcr-swatches.pcr-last{margin:0}@supports (display: grid){.pcr-app .pcr-swatches{display:grid;align-items:center;grid-template-columns:repeat(auto-fit, 1.75em)}}.pcr-app .pcr-swatches>button{font-size:1em;position:relative;width:calc(1.75em - 5px);height:calc(1.75em - 5px);border-radius:0.15em;cursor:pointer;margin:2.5px;flex-shrink:0;justify-self:center;transition:all 0.15s;overflow:hidden;background:transparent;z-index:1}.pcr-app .pcr-swatches>button::before{position:absolute;content:'';top:0;left:0;width:100%;height:100%;background:url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2"><path fill="white" d="M1,0H2V1H1V0ZM0,1H1V2H0V1Z"/><path fill="gray" d="M0,0H1V1H0V0ZM1,1H2V2H1V1Z"/></svg>');background-size:6px;border-radius:.15em;z-index:-1}.pcr-app .pcr-swatches>button::after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background:var(--pcr-color);border:1px solid rgba(0,0,0,0.05);border-radius:0.15em;box-sizing:border-box}.pcr-app .pcr-swatches>button:hover{filter:brightness(1.05)}.pcr-app .pcr-swatches>button:not(.pcr-active){box-shadow:none}.pcr-app .pcr-interaction{display:flex;flex-wrap:wrap;align-items:center;margin:0 -0.2em 0 -0.2em}.pcr-app .pcr-interaction>*{margin:0 0.2em}.pcr-app .pcr-interaction input{letter-spacing:0.07em;font-size:0.75em;text-align:center;cursor:pointer;color:#75797e;background:#f1f3f4;border-radius:.15em;transition:all 0.15s;padding:0.45em 0.5em;margin-top:0.75em}.pcr-app .pcr-interaction input:hover{filter:brightness(0.975)}.pcr-app .pcr-interaction input:focus{box-shadow:0 0 0 1px rgba(255,255,255,0.85),0 0 0 3px rgba(66,133,244,0.75)}.pcr-app .pcr-interaction .pcr-result{color:#75797e;text-align:left;flex:1 1 8em;min-width:8em;transition:all 0.2s;border-radius:.15em;background:#f1f3f4;cursor:text}.pcr-app .pcr-interaction .pcr-result::-moz-selection{background:#4285f4;color:#fff}.pcr-app .pcr-interaction .pcr-result::selection{background:#4285f4;color:#fff}.pcr-app .pcr-interaction .pcr-type.active{color:#fff;background:#4285f4}.pcr-app .pcr-interaction .pcr-save,.pcr-app .pcr-interaction .pcr-cancel,.pcr-app .pcr-interaction .pcr-clear{color:#fff;width:auto}.pcr-app .pcr-interaction .pcr-save,.pcr-app .pcr-interaction .pcr-cancel,.pcr-app .pcr-interaction .pcr-clear{color:#fff}.pcr-app .pcr-interaction .pcr-save:hover,.pcr-app .pcr-interaction .pcr-cancel:hover,.pcr-app .pcr-interactioLine truncated
|
.pickr{position:relative;overflow:visible;transform:translateY(0)}.pickr *{box-sizing:border-box;outline:none;border:none;-webkit-appearance:none}.pickr .pcr-button{position:relative;height:2em;width:2em;padding:0.5em;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;border-radius:.15em;background:url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" stroke="%2342445A" stroke-width="5px" stroke-linecap="round"><path d="M45,45L5,5"></path><path d="M45,5L5,45"></path></svg>') no-repeat center;background-size:0;transition:all 0.3s}.pickr .pcr-button::before{position:absolute;content:'';top:0;left:0;width:100%;height:100%;background:url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2"><path fill="white" d="M1,0H2V1H1V0ZM0,1H1V2H0V1Z"/><path fill="gray" d="M0,0H1V1H0V0ZM1,1H2V2H1V1Z"/></svg>');background-size:.5em;border-radius:.15em;z-index:-1}.pickr .pcr-button::before{z-index:initial}.pickr .pcr-button::after{position:absolute;content:'';top:0;left:0;height:100%;width:100%;transition:background 0.3s;background:var(--pcr-color);border-radius:.15em}.pickr .pcr-button.clear{background-size:70%}.pickr .pcr-button.clear::before{opacity:0}.pickr .pcr-button.clear:focus{box-shadow:0 0 0 1px rgba(255,255,255,0.85),0 0 0 3px var(--pcr-color)}.pickr .pcr-button.disabled{cursor:not-allowed}.pickr *,.pcr-app *{box-sizing:border-box;outline:none;border:none;-webkit-appearance:none}.pickr input:focus,.pickr input.pcr-active,.pickr button:focus,.pickr button.pcr-active,.pcr-app input:focus,.pcr-app input.pcr-active,.pcr-app button:focus,.pcr-app button.pcr-active{box-shadow:0 0 0 1px rgba(255,255,255,0.85),0 0 0 3px var(--pcr-color)}.pickr .pcr-palette,.pickr .pcr-slider,.pcr-app .pcr-palette,.pcr-app .pcr-slider{transition:box-shadow 0.3s}.pickr .pcr-palette:focus,.pickr .pcr-slider:focus,.pcr-app .pcr-palette:focus,.pcr-app .pcr-slider:focus{box-shadow:0 0 0 1px rgba(255,255,255,0.85),0 0 0 3px rgba(0,0,0,0.25)}.pcr-app{position:fixed;display:flex;flex-direction:column;z-index:10000;border-radius:0.1em;background:#fff;opacity:0;visibility:hidden;transition:opacity 0.3s, visibility 0s 0.3s;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;box-shadow:0 0.15em 1.5em 0 rgba(0,0,0,0.1),0 0 1em 0 rgba(0,0,0,0.03);left:0;top:0}.pcr-app.visible{transition:opacity 0.3s;visibility:visible;opacity:1}.pcr-app .pcr-swatches{display:flex;flex-wrap:wrap;margin-top:0.75em}.pcr-app .pcr-swatches.pcr-last{margin:0}@supports (display: grid){.pcr-app .pcr-swatches{display:grid;align-items:center;grid-template-columns:repeat(auto-fit, 1.75em)}}.pcr-app .pcr-swatches>button{font-size:1em;position:relative;width:calc(1.75em - 5px);height:calc(1.75em - 5px);border-radius:0.15em;cursor:pointer;margin:2.5px;flex-shrink:0;justify-self:center;transition:all 0.15s;overflow:hidden;background:transparent;z-index:1}.pcr-app .pcr-swatches>button::before{position:absolute;content:'';top:0;left:0;width:100%;height:100%;background:url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2"><path fill="white" d="M1,0H2V1H1V0ZM0,1H1V2H0V1Z"/><path fill="gray" d="M0,0H1V1H0V0ZM1,1H2V2H1V1Z"/></svg>');background-size:6px;border-radius:.15em;z-index:-1}.pcr-app .pcr-swatches>button::after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background:var(--pcr-color);border:1px solid rgba(0,0,0,0.05);border-radius:0.15em;box-sizing:border-box}.pcr-app .pcr-swatches>button:hover{filter:brightness(1.05)}.pcr-app .pcr-swatches>button:not(.pcr-active){box-shadow:none}.pcr-app .pcr-interaction{display:flex;flex-wrap:wrap;align-items:center;margin:0 -0.2em 0 -0.2em}.pcr-app .pcr-interaction>*{margin:0 0.2em}.pcr-app .pcr-interaction input{letter-spacing:0.07em;font-size:0.75em;text-align:center;cursor:pointer;color:#75797e;background:#f1f3f4;border-radius:.15em;transition:all 0.15s;padding:0.45em 0.5em;margin-top:0.75em}.pcr-app .pcr-interaction input:hover{filter:brightness(0.975)}.pcr-app .pcr-interaction input:focus{box-shadow:0 0 0 1px rgba(255,255,255,0.85),0 0 0 3px rgba(66,133,244,0.75)}.pcr-app .pcr-interaction .pcr-result{color:#75797e;text-align:left;flex:1 1 8em;min-width:8em;transition:all 0.2s;border-radius:.15em;background:#f1f3f4;cursor:text}.pcr-app .pcr-interaction .pcr-result::-moz-selection{background:#4285f4;color:#fff}.pcr-app .pcr-interaction .pcr-result::selection{background:#4285f4;color:#fff}.pcr-app .pcr-interaction .pcr-type.active{color:#fff;background:#4285f4}.pcr-app .pcr-interaction .pcr-save,.pcr-app .pcr-interaction .pcr-cancel,.pcr-app .pcr-interaction .pcr-clear{color:#fff;width:auto}.pcr-app .pcr-interaction .pcr-save,.pcr-app .pcr-interaction .pcr-cancel,.pcr-app .pcr-interaction .pcr-clear{color:#fff}.pcr-app .pcr-interaction .pcr-save:hover,.pcr-app .pcr-interaction .pcr-cancel:hover,.pcr-app .pcr-interactioLine truncated
|
||||||
|
|
||||||
+14
-2
@@ -1,10 +1,15 @@
|
|||||||
{
|
{
|
||||||
"useCache": true,
|
"useCache": true,
|
||||||
"hideExcluded": false,
|
"hideExcluded": false,
|
||||||
|
"downrankedFoldersFilters": [],
|
||||||
"ignoreDiacritics": true,
|
"ignoreDiacritics": true,
|
||||||
|
"ignoreArabicDiacritics": false,
|
||||||
"indexedFileTypes": [],
|
"indexedFileTypes": [],
|
||||||
|
"displayTitle": "",
|
||||||
"PDFIndexing": false,
|
"PDFIndexing": false,
|
||||||
|
"officeIndexing": false,
|
||||||
"imagesIndexing": false,
|
"imagesIndexing": false,
|
||||||
|
"aiImageIndexing": false,
|
||||||
"unsupportedFilesIndexing": "no",
|
"unsupportedFilesIndexing": "no",
|
||||||
"splitCamelCase": true,
|
"splitCamelCase": true,
|
||||||
"openInNewPane": false,
|
"openInNewPane": false,
|
||||||
@@ -16,6 +21,7 @@
|
|||||||
"highlight": true,
|
"highlight": true,
|
||||||
"showPreviousQueryResults": true,
|
"showPreviousQueryResults": true,
|
||||||
"simpleSearch": false,
|
"simpleSearch": false,
|
||||||
|
"tokenizeUrls": false,
|
||||||
"fuzziness": "1",
|
"fuzziness": "1",
|
||||||
"weightBasename": 3,
|
"weightBasename": 3,
|
||||||
"weightDirectory": 2,
|
"weightDirectory": 2,
|
||||||
@@ -23,6 +29,12 @@
|
|||||||
"weightH2": 1.3,
|
"weightH2": 1.3,
|
||||||
"weightH3": 1.1,
|
"weightH3": 1.1,
|
||||||
"weightUnmarkedTags": 1.1,
|
"weightUnmarkedTags": 1.1,
|
||||||
"welcomeMessage": "1.10.1",
|
"weightCustomProperties": [],
|
||||||
"verboseLogging": false
|
"httpApiEnabled": false,
|
||||||
|
"httpApiPort": "51361",
|
||||||
|
"httpApiNotice": true,
|
||||||
|
"welcomeMessage": "1.21.0",
|
||||||
|
"verboseLogging": false,
|
||||||
|
"DANGER_httpHost": null,
|
||||||
|
"DANGER_forceSaveCache": false
|
||||||
}
|
}
|
||||||
Vendored
+93
-38
@@ -3,48 +3,103 @@ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|||||||
if you want to view the source, please visit the github repository of this plugin
|
if you want to view the source, please visit the github repository of this plugin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Gf=Object.create;var Zr=Object.defineProperty,Qf=Object.defineProperties,qf=Object.getOwnPropertyDescriptor,Yf=Object.getOwnPropertyDescriptors,Jf=Object.getOwnPropertyNames,Hs=Object.getOwnPropertySymbols,Xf=Object.getPrototypeOf,$s=Object.prototype.hasOwnProperty,Zf=Object.prototype.propertyIsEnumerable;var Ws=(t,e,r)=>e in t?Zr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pe=(t,e)=>{for(var r in e||(e={}))$s.call(e,r)&&Ws(t,r,e[r]);if(Hs)for(var r of Hs(e))Zf.call(e,r)&&Ws(t,r,e[r]);return t},Me=(t,e)=>Qf(t,Yf(e)),Us=t=>Zr(t,"__esModule",{value:!0});var Mn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ed=(t,e)=>{Us(t);for(var r in e)Zr(t,r,{get:e[r],enumerable:!0})},td=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Jf(e))!$s.call(t,n)&&n!=="default"&&Zr(t,n,{get:()=>e[n],enumerable:!(r=qf(e,n))||r.enumerable});return t},je=t=>td(Us(Zr(t!=null?Gf(Xf(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var ol=Mn((Fn,ds)=>{(function(t,e){if(typeof Fn=="object"&&typeof ds=="object")ds.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var r=e();for(var n in r)(typeof Fn=="object"?Fn:t)[n]=r[n]}})(typeof self!="undefined"?self:Fn,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(n,i,o){r.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:o})},r.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,i){if(1&i&&(n=r(n)),8&i||4&i&&typeof n=="object"&&n&&n.__esModule)return n;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),2&i&&typeof n!="string")for(var s in n)r.d(o,s,function(a){return n[a]}.bind(null,s));return o},r.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";r.r(e),r.d(e,"md5",function(){return x});var n="0123456789abcdef".split(""),i=function(v){for(var d="",b=0;b<4;b++)d+=n[v>>8*b+4&15]+n[v>>8*b&15];return d},o=function(v){for(var d=v.length,b=0;b<d;b++)v[b]=i(v[b]);return v.join("")},s=function(v,d){return v+d&4294967295},a=function(v,d,b,m,g,y,_){return function(j,A,F){return s(j<<A|j>>>32-A,F)}(d=function(j,A,F,E){return A=s(s(A,j),s(F,E))}(v,d,m,y),g,b)},u=function(v,d,b,m,g,y,_,j){return a(b&m|~b&g,d,b,y,_,j,v)},l=function(v,d,b,m,g,y,_,j){return a(b&g|m&~g,d,b,y,_,j,v)},f=function(v,d,b,m,g,y,_,j){return a(b^m^g,d,b,y,_,j,v)},p=function(v,d,b,m,g,y,_,j){return a(m^(b|~g),d,b,y,_,j,v)},c=function(v,d,b){b===void 0&&(b=s);var m=v[0],g=v[1],y=v[2],_=v[3],j=u.bind(null,b);m=j(m,g,y,_,d[0],7,-680876936),_=j(_,m,g,y,d[1],12,-389564586),y=j(y,_,m,g,d[2],17,606105819),g=j(g,y,_,m,d[3],22,-1044525330),m=j(m,g,y,_,d[4],7,-176418897),_=j(_,m,g,y,d[5],12,1200080426),y=j(y,_,m,g,d[6],17,-1473231341),g=j(g,y,_,m,d[7],22,-45705983),m=j(m,g,y,_,d[8],7,1770035416),_=j(_,m,g,y,d[9],12,-1958414417),y=j(y,_,m,g,d[10],17,-42063),g=j(g,y,_,m,d[11],22,-1990404162),m=j(m,g,y,_,d[12],7,1804603682),_=j(_,m,g,y,d[13],12,-40341101),y=j(y,_,m,g,d[14],17,-1502002290),g=j(g,y,_,m,d[15],22,1236535329);var A=l.bind(null,b);m=A(m,g,y,_,d[1],5,-165796510),_=A(_,m,g,y,d[6],9,-1069501632),y=A(y,_,m,g,d[11],14,643717713),g=A(g,y,_,m,d[0],20,-373897302),m=A(m,g,y,_,d[5],5,-701558691),_=A(_,m,g,y,d[10],9,38016083),y=A(y,_,m,g,d[15],14,-660478335),g=A(g,y,_,m,d[4],20,-405537848),m=A(m,g,y,_,d[9],5,568446438),_=A(_,m,g,y,d[14],9,-1019803690),y=A(y,_,m,g,d[3],14,-187363961),g=A(g,y,_,m,d[8],20,1163531501),m=A(m,g,y,_,d[13],5,-1444681467),_=A(_,m,g,y,d[2],9,-51403784),y=A(y,_,m,g,d[7],14,1735328473),g=A(g,y,_,m,d[12],20,-1926607734);var F=f.bind(null,b);m=F(m,g,y,_,d[5],4,-378558),_=F(_,m,g,y,d[8],11,-2022574463),y=F(y,_,m,g,d[11],16,1839030562),g=F(g,y,_,m,d[14],23,-35309556),m=F(m,g,y,_,d[1],4,-1530992060),_=F(_,m,g,y,d[4],11,1272893353),y=F(y,_,m,g,d[7],16,-155497632),g=F(g,y,_,m,d[10],23,-1094730640),m=F(m,g,y,_,d[13],4,681279174),_=F(_,m,g,y,d[0],11,-358537222),y=F(y,_,m,g,d[3],16,-722521979),g=F(g,y,_,m,d[6],23,76029189),m=F(m,g,y,_,d[9],4,-640364487),_=F(_,m,g,y,d[12],11,-421815835),y=F(y,_,m,g,d[15],16,530742520),g=F(g,y,_,m,d[2],23,-995338651);var E=p.bind(null,b);m=E(m,g,y,_,d[0],6,-198630844),_=E(_,m,g,y,d[7],10,1126891415),y=E(y,_,m,g,d[14],15,-1416354905),g=E(g,y,_,m,d[5],21,-57434055),m=E(m,g,y,_,d[12],6,1700485571),_=E(_,m,g,y,d[3],10,-1894986606),y=E(y,_,m,g,d[10],15,-1051523),g=E(g,y,_,m,d[1],21,-2054922799),m=E(m,g,y,_,d[8],6,1873313359),_=E(_,m,g,y,d[15],10,-30611744),y=E(y,_,m,g,d[6],15,-1560198380),g=E(g,y,_,m,d[13],21,1309151649),m=E(m,g,y,_,d[4],6,-145523070),_=E(_,m,g,y,d[11],Line truncated
|
var By=Object.create;var Xs=Object.defineProperty,jy=Object.defineProperties,Hy=Object.getOwnPropertyDescriptor,Uy=Object.getOwnPropertyDescriptors,Gy=Object.getOwnPropertyNames,qh=Object.getOwnPropertySymbols,qy=Object.getPrototypeOf,zh=Object.prototype.hasOwnProperty,zy=Object.prototype.propertyIsEnumerable;var $c=(e,t,r)=>t in e?Xs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,J=(e,t)=>{for(var r in t||(t={}))zh.call(t,r)&&$c(e,r,t[r]);if(qh)for(var r of qh(t))zy.call(t,r)&&$c(e,r,t[r]);return e},Fe=(e,t)=>jy(e,Uy(t)),Vh=e=>Xs(e,"__esModule",{value:!0});var x=(e,t)=>()=>(e&&(t=e(e=0)),t);var U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Kh=(e,t)=>{Vh(e);for(var r in t)Xs(e,r,{get:t[r],enumerable:!0})},Vy=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Gy(t))!zh.call(e,n)&&n!=="default"&&Xs(e,n,{get:()=>t[n],enumerable:!(r=Hy(t,n))||r.enumerable});return e},Xe=e=>Vy(Vh(Xs(e!=null?By(qy(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var Wh=(e,t,r)=>($c(e,typeof t!="symbol"?t+"":t,r),r);function qe(){}function Ky(e,t){for(let r in t)e[r]=t[r];return e}function Xc(e){return e()}function Yh(){return Object.create(null)}function lr(e){e.forEach(Xc)}function Li(e){return typeof e=="function"}function ot(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Zc(e,t){return Su||(Su=document.createElement("a")),Su.href=t,e===Su.href}function Qh(e){return Object.keys(e).length===0}function $h(e,...t){if(e==null)return qe;let r=e.subscribe(...t);return r.unsubscribe?()=>r.unsubscribe():r}function xu(e,t,r){e.$$.on_destroy.push($h(t,r))}function Mi(e,t,r,n){if(e){let i=Xh(e,t,r,n);return e[0](i)}}function Xh(e,t,r,n){return e[1]&&n?Ky(r.ctx.slice(),e[1](n(t))):r.ctx}function ki(e,t,r,n){if(e[2]&&n){let i=e[2](n(r));if(t.dirty===void 0)return i;if(typeof i=="object"){let s=[],a=Math.max(t.dirty.length,i.length);for(let u=0;u<a;u+=1)s[u]=t.dirty[u]|i[u];return s}return t.dirty|i}return t.dirty}function Fi(e,t,r,n,i,s){if(i){let a=Xh(t,r,n,s);e.p(a,i)}}function Bi(e){if(e.ctx.length>32){let t=[],r=e.ctx.length/32;for(let n=0;n<r;n++)t[n]=-1;return t}return-1}function Zh(e){return e&&Li(e.destroy)?e.destroy:qe}function Wy(){e0=!0}function Yy(){e0=!1}function j(e,t){e.appendChild(t)}function ae(e,t,r){e.insertBefore(t,r||null)}function se(e){e.parentNode&&e.parentNode.removeChild(e)}function Nu(e,t){for(let r=0;r<e.length;r+=1)e[r]&&e[r].d(t)}function V(e){return document.createElement(e)}function dt(e){return document.createTextNode(e)}function ue(){return dt(" ")}function Zs(){return dt("")}function ht(e,t,r,n){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}function Z(e,t,r){r==null?e.removeAttribute(t):e.getAttribute(t)!==r&&e.setAttribute(t,r)}function Qy(e){return Array.from(e.childNodes)}function xr(e,t){t=""+t,e.data!==t&&(e.data=t)}function Jc(e,t){e.value=t??""}function zt(e,t,r,n){r==null?e.style.removeProperty(t):e.style.setProperty(t,r,n?"important":"")}function el(e,t,r){e.classList[r?"add":"remove"](t)}function $y(e,t,{bubbles:r=!1,cancelable:n=!1}={}){let i=document.createEvent("CustomEvent");return i.initCustomEvent(e,r,n,t),i}function ea(e){Js=e}function tl(){if(!Js)throw new Error("Function called outside component initialization");return Js}function ta(e){tl().$$.on_mount.push(e)}function ra(e){tl().$$.on_destroy.push(e)}function rl(){let e=tl();return(t,r,{cancelable:n=!1}={})=>{let i=e.$$.callbacks[t];if(i){let s=$y(t,r,{cancelable:n});return i.slice().forEach(a=>{a.call(e,s)}),!s.defaultPrevented}return!0}}function Vt(e,t){let r=e.$$.callbacks[t.type];r&&r.slice().forEach(n=>n.call(this,t))}function n0(){nl||(nl=!0,r0.then(i0))}function mn(){return n0(),r0}function il(e){Hi.push(e)}function i0(){if(Ui!==0)return;let e=Js;do{try{for(;Ui<ji.length;){let t=ji[Ui];Ui++,ea(t),Xy(t.$$)}}catch(t){throw ji.length=0,Ui=0,t}for(ea(null),ji.length=0,Ui=0;Yr.length;)Yr.pop()();for(let t=0;t<Hi.length;t+=1){let r=Hi[t];sl.has(r)||(sl.add(r),r())}Hi.length=0}while(ji.length);for(;t0.length;)t0.pop()();nl=!1,sl.clear(),ea(e)}function Xy(e){if(e.fragment!==null){e.update(),lr(e.before_update);let t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(il)}}function Zy(e){let t=[],r=[];Hi.forEach(n=>e.indexOf(n)===-1?t.push(n):r.push(n)),r.forEach(n=>n()),Hi=t}function ei(){Jn={r:0,c:[],p:Jn}}function ti(){Jn.r||lr(Jn.c),Jn=Jn.p}function Ee(e,t){e&&e.i&&(wu.delete(e),e.i(t))}function Oe(e,t,r,n){if(e&&e.o){if(wu.has(e))return;wu.add(e),Jn.c.push(()=>{wu.delete(e),n&&(r&&e.d(1),n())}),e.o(t)}else n&&n()}function Lt(e){e&&e.c()}function Dt(e,t,r,n){let{fragment:i,after_update:s}=e.$$;i&&i.m(t,r),n||il(()=>{let a=e.$$.on_mount.map(Xc).filter(Li);e.$$.on_destroy?e.$$.on_destroy.push(...a):lr(a),e.$$.on_mount=[]}),s.forEach(il)}function Tt(e,t){let r=e.$$;r.fragment!==null&&(Zy(r.after_update),lr(r.on_destroy),r.fragment&&r.fragment.d(t),Line truncated
|
||||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var P=!0,re=!1,Ke;return{s:function(){I=I.call(C)},n:function(){var me=I.next();return P=me.done,me},e:function(me){re=!0,Ke=me},f:function(){try{!P&&I.return!=null&&I.return()}finally{if(re)throw Ke}}}}function l(C,S){if(!!C){if(typeof C=="string")return f(C,S);var I=Object.prototype.toString.call(C).slice(8,-1);if(I==="Object"&&C.constructor&&(I=C.constructor.name),I==="Map"||I==="Set")return Array.from(C);if(I==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I))return f(C,S)}}function f(C,S){(S==null||S>C.length)&&(S=C.length);for(var I=0,N=new Array(S);I<S;I++)N[I]=C[I];return N}function p(C,S){if(!(C instanceof S))throw new TypeError("Cannot call a class as a function")}function c(C,S){for(var I=0;I<S.length;I++){var N=S[I];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(C,N.key,N)}}function h(C,S,I){return S&&c(C.prototype,S),I&&c(C,I),Object.defineProperty(C,"prototype",{writable:!1}),C}function w(C,S,I){return S in C?Object.defineProperty(C,S,{value:I,enumerable:!0,configurable:!0,writable:!0}):C[S]=I,C}function x(C,S,I){v(C,S),S.set(C,I)}function v(C,S){if(S.has(C))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d(C,S){var I=g(C,S,"get");return b(C,I)}function b(C,S){return S.get?S.get.call(C):S.value}function m(C,S,I){var N=g(C,S,"set");return y(C,N,I),I}function g(C,S,I){if(!S.has(C))throw new TypeError("attempted to "+I+" private field on non-instance");return S.get(C)}function y(C,S,I){if(S.set)S.set.call(C,I);else{if(!S.writable)throw new TypeError("attempted to set read only private field");S.value=I}}var _=typeof Symbol!="undefined"?Symbol.toStringTag:"@@toStringTag",j=new WeakMap,A=new WeakMap,F=function(){function C(S){var I=S.executor,N=I===void 0?function(){}:I,X=S.internals,P=X===void 0?q():X,re=S.promise,Ke=re===void 0?new Promise(function(we,me){return N(we,me,function(ze){P.onCancelList.push(ze)})}):re;p(this,C),x(this,j,{writable:!0,value:void 0}),x(this,A,{writable:!0,value:void 0}),w(this,_,"CancelablePromise"),this.cancel=this.cancel.bind(this),m(this,j,P),m(this,A,Ke||new Promise(function(we,me){return N(we,me,function(ze){P.onCancelList.push(ze)})}))}return h(C,[{key:"then",value:function(I,N){return J(d(this,A).then(z(I,d(this,j)),z(N,d(this,j))),d(this,j))}},{key:"catch",value:function(I){return J(d(this,A).catch(z(I,d(this,j))),d(this,j))}},{key:"finally",value:function(I,N){var X=this;return N&&d(this,j).onCancelList.push(I),J(d(this,A).finally(z(function(){if(I)return N&&(d(X,j).onCancelList=d(X,j).onCancelList.filter(function(P){return P!==I})),I()},d(this,j))),d(this,j))}},{key:"cancel",value:function(){d(this,j).isCanceled=!0;var I=d(this,j).onCancelList;d(this,j).onCancelList=[];var N=u(I),X;try{for(N.s();!(X=N.n()).done;){var P=X.value;if(typeof P=="function")try{P()}catch(re){console.error(re)}}}catch(re){N.e(re)}finally{N.f()}}},{key:"isCanceled",value:function(){return d(this,j).isCanceled===!0}}]),C}(),E=function(C){e(I,C);var S=n(I);function I(N){return p(this,I),S.call(this,{executor:N})}return h(I)}(F);t.CancelablePromise=E,w(E,"all",function(S){return Y(S,Promise.all(S))}),w(E,"allSettled",function(S){return Y(S,Promise.allSettled(S))}),w(E,"any",function(S){return Y(S,Promise.any(S))}),w(E,"race",function(S){return Y(S,Promise.race(S))}),w(E,"resolve",function(S){return L(Promise.resolve(S))}),w(E,"reject",function(S){return L(Promise.reject(S))}),w(E,"isCancelable",k);var O=E;t.default=O;function L(C){return J(C,q())}function k(C){return C instanceof E||C instanceof F}function z(C,S){if(C)return function(I){if(!S.isCanceled){var N=C(I);return k(N)&&S.onCancelList.push(N.cancel),N}return I}}function J(C,S){return new F({internals:S,promise:C})}function Y(C,S){var I=q();return I.onCancelList.push(function(){var N=u(C),X;try{for(N.s();!(X=N.n()).done;){var P=X.value;k(P)&&P.cancel()}}catch(re){N.e(re)}finally{N.f()}}),new F({internals:I,promise:S})}function q(){return{isCanceled:!1,onCancelList:[]}}})});ed(exports,{default:()=>zs});var fr=je(require("obsidian"));var ro=je(require("obsidian"));function he(){}function rd(t,e){for(let r in e)t[r]=e[r];return t}function oo(t){return t()}function Gs(){return Object.create(null)}function Xe(t){t.forEach(oo)}function dr(t){return typeof t=="function"}function Ae(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}var Rn;function so(t,e){return Rn||(Rn=document.createElement("a")),Rn.href=e,t===Rn.href}function Qs(t){return Object.keys(t).length===0}function qs(t,...e){if(t==null)return he;let r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function Ln(t,e,r){t.$$.on_destroy.push(qs(e,r))}function pr(t,e,r,n){if(t){let i=Ys(t,e,r,n);return t[0](i)}}function Ys(t,e,r,n){return t[1]&&n?rd(r.ctx.slice(),t[1](n(e))):r.ctx}function hr(t,e,r,n){if(t[2]&&n){let i=t[2](n(r));if(e.dirty===void 0)re
Line truncated
|
<iframe sandbox="allow-top-navigation-by-user-activation" src="https://github.com/sponsors/scambier/button" title="Sponsor scambier" height="35" width="116" style="border: 0;"></iframe>
|
||||||
`).length),r.split(`
|
|
||||||
`).slice(e).filter(fa).map(n=>`
|
|
||||||
`+n).join("")):""}var bd=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"],da=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],wo=bd.concat(da),xd={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function wr(t,e){this._e=Qt(),this.name=t,this.message=e}br(wr).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+xo(this._e,2))}},toString:function(){return this.name+": "+this.message}});function pa(t,e){return t+". Errors: "+Object.keys(e).map(r=>e[r].toString()).filter((r,n,i)=>i.indexOf(r)===n).join(`
|
|
||||||
`)}function $n(t,e,r,n){this._e=Qt(),this.failures=e,this.failedKeys=n,this.successCount=r,this.message=pa(t,e)}br($n).from(wr);function un(t,e){this._e=Qt(),this.name="BulkError",this.failures=Object.keys(e).map(r=>e[r]),this.failuresByPos=e,this.message=pa(t,e)}br(un).from(wr);var jo=wo.reduce((t,e)=>(t[e]=e+"Error",t),{}),wd=wr,V=wo.reduce((t,e)=>{var r=e+"Error";function n(i,o){this._e=Qt(),this.name=r,i?typeof i=="string"?(this.message=`${i}${o?`
|
|
||||||
`+o:""}`,this.inner=o||null):typeof i=="object"&&(this.message=`${i.name} ${i.message}`,this.inner=i):(this.message=xd[e]||r,this.inner=null)}return br(n).from(wd),t[e]=n,t},{});V.Syntax=SyntaxError;V.Type=TypeError;V.Range=RangeError;var ha=da.reduce((t,e)=>(t[e+"Error"]=V[e],t),{});function jd(t,e){if(!t||t instanceof wr||t instanceof TypeError||t instanceof SyntaxError||!t.name||!ha[t.name])return t;var r=new ha[t.name](e||t.message,t);return"stack"in t&&ut(r,"stack",{get:function(){return this.inner.stack}}),r}var Wn=wo.reduce((t,e)=>(["Syntax","Type","Range"].indexOf(e)===-1&&(t[e+"Error"]=V[e]),t),{});Wn.ModifyError=$n;Wn.DexieError=wr;Wn.BulkError=un;function ie(){}function cn(t){return t}function Ad(t,e){return t==null||t===cn?e:function(r){return e(t(r))}}function qt(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function Cd(t,e){return t===ie?e:function(){var r=t.apply(this,arguments);r!==void 0&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=e.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?qt(n,this.onsuccess):n),i&&(this.onerror=this.onerror?qt(i,this.onerror):i),o!==void 0?o:r}}function Sd(t,e){return t===ie?e:function(){t.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,e.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?qt(r,this.onsuccess):r),n&&(this.onerror=this.onerror?qt(n,this.onerror):n)}}function Fd(t,e){return t===ie?e:function(r){var n=t.apply(this,arguments);Le(r,n);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var s=e.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?qt(i,this.onsuccess):i),o&&(this.onerror=this.onerror?qt(o,this.onerror):o),n===void 0?s===void 0?void 0:s:Le(n,s)}}function Ed(t,e){return t===ie?e:function(){return e.apply(this,arguments)===!1?!1:t.apply(this,arguments)}}function Ao(t,e){return t===ie?e:function(){var r=t.apply(this,arguments);if(r&&typeof r.then=="function"){for(var n=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return r.then(function(){return e.apply(n,o)})}return e.apply(this,arguments)}}var fn={},Td=100,Dd=20,ma=100,[Co,Un,So]=typeof Promise=="undefined"?[]:(()=>{let t=Promise.resolve();if(typeof crypto=="undefined"||!crypto.subtle)return[t,sn(t),t];let e=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[e,sn(e),t]})(),ga=Un&&Un.then,Gn=Co&&Co.constructor,Fo=!!So,Eo=!1,Id=So?()=>{So.then(Jn)}:se.setImmediate?setImmediate.bind(null,Jn):se.MutationObserver?()=>{var t=document.createElement("div");new MutationObserver(()=>{Jn(),t=null}).observe(t,{attributes:!0}),t.setAttribute("i","1")}:()=>{setTimeout(Jn,0)},dn=function(t,e){pn.push([t,e]),Qn&&(Id(),Qn=!1)},To=!0,Qn=!0,Yt=[],qn=[],Do=null,Io=cn,jr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Sa,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(t=>{try{Sa(t[0],t[1])}catch{}})}},K=jr,pn=[],Jt=0,Yn=[];function R(t){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=ie,this._lib=!1;var e=this._PSD=K;if(rt&&(this._stackHolder=Qt(),this._prev=null,this._numPrev=0),typeof t!="function"){if(t!==fn)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&ko(this,this._value);return}this._state=null,this._value=null,++e.ref,_a(this,t)}var Oo={get:function(){var t=K,e=ei;function r(n,i){var o=!t.global&&(t!==K||e!==ei);let s=o&&!dt();var a=new R((u,l)=>{Po(this,new ya(ri(n,t,o,s),ri(i,t,o,s),u,l,t))});return rt&&xa(a,this),a}return r.prototype=fn,r},set:function(t){ut(this,"then",t&&t.prototype===fn?Oo:{get:function(){return t},set:Oo.set})}};vr(R.prototype,{then:Oo,_then:function(t,e){Po(this,new ya(null,null,t,e,K))},catch:function(t){if(arguments.length===1)return this.then(null,t);var e=arguments[0],r=arguments[1];return typeof e=="function"?this.then(null,n=>n instanceof e?r(n):Xn(n)):this.then(null,n=>n&&n.name===e?r(n):Xn(n))},finally:function(t){return this.then(e=>(t(),e),e=>(t(),Xn(e)))},stack:{get:function(){if(this._stack)return this._stack;try{Eo=!0;var t=ba(this,[],Dd),e=t.join(`
|
|
||||||
From previous: `);return this._state!==null&&(this._stack=e),e}finally{Eo=!1}}},timeout:function(t,e){return t<1/0?new R((r,n)=>{var i=setTimeout(()=>n(new V.Timeout(e)),t);this.then(r,n).finally(clearTimeout.bind(null,i))}):this}});typeof Symbol!="undefined"&&Symbol.toStringTag&&ut(R.prototype,Symbol.toStringTag,"Dexie.Promise");jr.env=wa();function ya(t,e,r,n,i){this.onFulfilled=typeof t=="function"?t:null,this.onRejected=typeof e=="function"?e:null,this.resolve=r,this.reject=n,this.psd=i}vr(R,{all:function(){var t=ft.apply(null,arguments).map(ti);return new R(function(e,r){t.length===0&&e([]);var n=t.length;t.forEach((i,o)=>R.resolve(i).then(s=>{t[o]=s,--n||e(t)},r))})},resolve:t=>{if(t instanceof R)return t;if(t&&typeof t.then=="function")return new R((r,n)=>{t.then(r,n)});var e=new R(fn,!0,t);return xa(e,Do),e},reject:Xn,race:function(){var t=ft.apply(null,arguments).map(ti);return new R((e,r)=>{t.map(n=>R.resolve(n).then(e,r))})},PSD:{get:()=>K,set:t=>K=t},totalEchoes:{get:()=>ei},newPSD:Ct,usePSD:Cr,scheduler:{get:()=>dn,set:t=>{dn=t}},rejectionMapper:{get:()=>Io,set:t=>{Io=t}},follow:(t,e)=>new R((r,n)=>Ct((i,o)=>{var s=K;s.unhandleds=[],s.onunhandled=o,s.finalize=qt(function(){kd(()=>{this.unhandleds.length===0?i():o(this.unhandleds[0])})},s.finalize),t()},e,r,n))});Gn&&(Gn.allSettled&&ut(R,"allSettled",function(){let t=ft.apply(null,arguments).map(ti);return new R(e=>{t.length===0&&e([]);let r=t.length,n=new Array(r);t.forEach((i,o)=>R.resolve(i).then(s=>n[o]={status:"fulfilled",value:s},s=>n[o]={status:"rejected",reason:s}).then(()=>--r||e(n)))})}),Gn.any&&typeof AggregateError!="undefined"&&ut(R,"any",function(){let t=ft.apply(null,arguments).map(ti);return new R((e,r)=>{t.length===0&&r(new AggregateError([]));let n=t.length,i=new Array(n);t.forEach((o,s)=>R.resolve(o).then(a=>e(a),a=>{i[s]=a,--n||r(new AggregateError(i))}))})}));function _a(t,e){try{e(r=>{if(t._state===null){if(r===t)throw new TypeError("A promise cannot be resolved with itself.");var n=t._lib&&hn();r&&typeof r.then=="function"?_a(t,(i,o)=>{r instanceof R?r._then(i,o):r.then(i,o)}):(t._state=!0,t._value=r,va(t)),n&&mn()}},ko.bind(null,t))}catch(r){ko(t,r)}}function ko(t,e){if(qn.push(e),t._state===null){var r=t._lib&&hn();e=Io(e),t._state=!1,t._value=e,rt&&e!==null&&typeof e=="object"&&!e._promise&&pd(()=>{var n=go(e,"stack");e._promise=t,ut(e,"stack",{get:()=>Eo?n&&(n.get?n.get.apply(e):n.value):t.stack})}),Pd(t),va(t),r&&mn()}}function va(t){var e=t._listeners;t._listeners=[];for(var r=0,n=e.length;r<n;++r)Po(t,e[r]);var i=t._PSD;--i.ref||i.finalize(),Jt===0&&(++Jt,dn(()=>{--Jt==0&&Mo()},[]))}function Po(t,e){if(t._state===null){t._listeners.push(e);return}var r=t._state?e.onFulfilled:e.onRejected;if(r===null)return(t._state?e.resolve:e.reject)(t._value);++e.psd.ref,++Jt,dn(Od,[r,t,e])}function Od(t,e,r){try{Do=e;var n,i=e._value;e._state?n=t(i):(qn.length&&(qn=[]),n=t(i),qn.indexOf(i)===-1&&Md(e)),r.resolve(n)}catch(o){r.reject(o)}finally{Do=null,--Jt==0&&Mo(),--r.psd.ref||r.psd.finalize()}}function ba(t,e,r){if(e.length===r)return e;var n="";if(t._state===!1){var i=t._value,o,s;i!=null?(o=i.name||"Error",s=i.message||i,n=xo(i,0)):(o=i,s=""),e.push(o+(s?": "+s:"")+n)}return rt&&(n=xo(t._stackHolder,2),n&&e.indexOf(n)===-1&&e.push(n),t._prev&&ba(t._prev,e,r)),e}function xa(t,e){var r=e?e._numPrev+1:0;r<Td&&(t._prev=e,t._numPrev=r)}function Jn(){hn()&&mn()}function hn(){var t=To;return To=!1,Qn=!1,t}function mn(){var t,e,r;do for(;pn.length>0;)for(t=pn,pn=[],r=t.length,e=0;e<r;++e){var n=t[e];n[0].apply(null,n[1])}while(pn.length>0);To=!0,Qn=!0}function Mo(){var t=Yt;Yt=[],t.forEach(n=>{n._PSD.onunhandled.call(null,n._value,n)});for(var e=Yn.slice(0),r=e.length;r;)e[--r]()}function kd(t){function e(){t(),Yn.splice(Yn.indexOf(e),1)}Yn.push(e),++Jt,dn(()=>{--Jt==0&&Mo()},[])}function Pd(t){Yt.some(e=>e._value===t._value)||Yt.push(t)}function Md(t){for(var e=Yt.length;e;)if(Yt[--e]._value===t._value){Yt.splice(e,1);return}}function Xn(t){return new R(fn,!1,t)}function le(t,e){var r=K;return function(){var n=hn(),i=K;try{return St(r,!0),t.apply(this,arguments)}catch(o){e&&e(o)}finally{St(i,!1),n&&mn()}}}var Pe={awaits:0,echoes:0,id:0},Rd=0,Zn=[],Ro=0,ei=0,Ld=0;function Ct(t,e,r,n){var i=K,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++Ld;var s=jr.env;o.env=Fo?{Promise:R,PromiseProp:{value:R,configurable:!0,writable:!0},all:R.all,race:R.race,allSettled:R.allSettled,any:R.any,resolve:R.resolve,reject:R.reject,nthen:Aa(s.nthen,o),gthen:Aa(s.gthen,o)}:{},e&&Le(o,e),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=Cr(o,t,r,n);return o.ref===0&&o.finalize(),a}function Ar(){return Pe.id||(Pe.id=++Rd),++Pe.awaits,Pe.echoes+=ma,Pe.id}function dt(){return Pe.awaits?(--Pe.awaits==0&&(Pe.id=0),Pe.echoes=Pe.awaits*ma,!0):!1}(""+ga).indexOf("[native code]")===-1&&(Ar=dt=ie);function ti(t){return Pe.echoes&&t&&t.constructor===Gn?(Ar(),t.then(e=>(dt(),e),e=>(dt(),be(e)))):t}function Bd(t){++ei,(!Pe.echoes|
Line truncated
|
|
||||||
<iframe src="https://github.com/sponsors/scambier/button" title="Sponsor scambier" height="35" width="116" style="border: 0;"></iframe>
|
|
||||||
<a href='https://ko-fi.com/B0B6LQ2C' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi2.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
|
<a href='https://ko-fi.com/B0B6LQ2C' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi2.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
|
||||||
`;let n=new DocumentFragment;n.createSpan({},c=>{c.innerHTML='\u26A0\uFE0F <span style="color: var(--text-accent)">Changing indexing settings will clear the cache, and requires a restart of Obsidian.</span><br/><br/>',ot()?c.innerHTML+=`
|
`,new ee.Setting(t).setName("Indexing").setHeading().setDesc(sr(`\u26A0\uFE0F <span style="color: var(--text-accent)">Changing indexing settings will clear the cache, and requires a restart of Obsidian.</span><br/><br/>
|
||||||
\u{1F44D} You have installed <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a>, Omnisearch can use it to index PDFs and images contents.
|
${n?`\u{1F44D} You have installed <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a>, Omnisearch can use it to index PDFs and images contents.
|
||||||
<br />Text extraction only works on desktop, but the cache can be synchronized with your mobile device.`:c.innerHTML+='\u26A0\uFE0F Omnisearch requires <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a> to index PDFs and images.'}),new G.Setting(e).setName("Indexing").setHeading().setDesc(n);let i=new DocumentFragment;i.createSpan({},c=>{c.innerHTML="Omnisearch will use Text Extractor to index the content of your PDFs"}),new G.Setting(e).setName(`PDFs content indexing ${ot()?"":"\u26A0\uFE0F Disabled"}`).setDesc(i).addToggle(c=>c.setValue(T.PDFIndexing).onChange(async h=>{await Se.clearCache(),T.PDFIndexing=h,await ce(this.plugin)})).setDisabled(!ot());let o=new DocumentFragment;o.createSpan({},c=>{c.innerHTML="Omnisearch will use Text Extractor to OCR your images and index their content"}),new G.Setting(e).setName(`Images OCR indexing ${ot()?"":"\u26A0\uFE0F Disabled"}`).setDesc(o).addToggle(c=>c.setValue(T.imagesIndexing).onChange(async h=>{await Se.clearCache(),T.imagesIndexing=h,await ce(this.plugin)})).setDisabled(!ot());let s=new DocumentFragment;s.createSpan({},c=>{c.innerHTML=`
|
<br />Text extraction only works on desktop, but the cache can be synchronized with your mobile device.`:'\u26A0\uFE0F Omnisearch requires <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a> to index PDFs and images.'}
|
||||||
Omnisearch can index file<strong>names</strong> of "unsupported" files, such as e.g. <pre style="display:inline">.mp4</pre>, <pre style="display:inline">.xlsx</pre>,
|
${s?'<br/>\u{1F44D} You have installed <a href="https://github.com/Swaggeroo/obsidian-ai-image-analyzer">AI Image Analyzer</a>, Omnisearch can use it to index images contents with ai.':'<br/>\u26A0\uFE0F Omnisearch requires <a href="https://github.com/Swaggeroo/obsidian-ai-image-analyzer">AI Image Analyzer</a> to index images with ai.'}`)),new ee.Setting(t).setName(`PDFs content indexing ${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(sr("Omnisearch will use Text Extractor to index the content of your PDFs.")).addToggle(d=>d.setValue(z.PDFIndexing).onChange(async f=>{await r.clearCache(),z.PDFIndexing=f,await pe(this.plugin)})).setDisabled(!n),new ee.Setting(t).setName(`Images OCR indexing ${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(sr("Omnisearch will use Text Extractor to OCR your images and index their content.")).addToggle(d=>d.setValue(z.imagesIndexing).onChange(async f=>{await r.clearCache(),z.imagesIndexing=f,await pe(this.plugin)})).setDisabled(!n);let u=new DocumentFragment;u.createSpan({},d=>{d.innerHTML='Omnisearch will use Text Extractor to index the content of your office documents (currently <pre style="display:inline">.docx</pre> and <pre style="display:inline">.xlsx</pre>).'}),new ee.Setting(t).setName(`Documents content indexing ${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(u).addToggle(d=>d.setValue(z.officeIndexing).onChange(async f=>{await r.clearCache(),z.officeIndexing=f,await pe(this.plugin)})).setDisabled(!n);let o=new DocumentFragment;o.createSpan({},d=>{d.innerHTML="Omnisearch will use AI Image Analyzer to index the content of your images with ai."}),new ee.Setting(t).setName(`Images AI indexing ${s?"":"\u26A0\uFE0F Disabled"}`).setDesc(o).addToggle(d=>d.setValue(z.aiImageIndexing).onChange(async f=>{await r.clearCache(),z.aiImageIndexing=f,await pe(this.plugin)})).setDisabled(!s),new ee.Setting(t).setName("Index paths of unsupported files").setDesc(sr(`
|
||||||
|
Omnisearch can index file<strong>names</strong> of "unsupported" files, such as e.g. <pre style="display:inline">.mp4</pre>
|
||||||
or non-extracted PDFs & images.<br/>
|
or non-extracted PDFs & images.<br/>
|
||||||
"Obsidian setting" will respect the value of "Files & Links > Detect all file extensions"`}),new G.Setting(e).setName("Index paths of unsupported files").setDesc(s).addDropdown(c=>{c.addOptions({yes:"Yes",no:"No",default:"Obsidian setting"}).setValue(T.unsupportedFilesIndexing).onChange(async h=>{await Se.clearCache(),T.unsupportedFilesIndexing=h,await ce(this.plugin)})});let a=new DocumentFragment;a.createSpan({},c=>{c.innerHTML=`In addition to standard <code>md</code> files, Omnisearch can also index other <strong style="color: var(--text-accent)">PLAINTEXT</strong> files.<br/>
|
"Obsidian setting" will respect the value of "Files & Links > Detect all file extensions".`)).addDropdown(d=>{d.addOptions({yes:"Yes",no:"No",default:"Obsidian setting"}).setValue(z.unsupportedFilesIndexing).onChange(async f=>{await i(),z.unsupportedFilesIndexing=f,await pe(this.plugin)})}),new ee.Setting(t).setName("Set frontmatter property key as title").setDesc(sr(`If you have a custom property in your notes that you want to use as the title in search results.<br>
|
||||||
|
Leave empty to disable.`)).addText(d=>{d.setValue(z.displayTitle).onChange(async f=>{await i(),z.displayTitle=f,await pe(this.plugin)})}),new ee.Setting(t).setName("Additional TEXT files to index").setDesc(sr(`In addition to standard <code>md</code> files, Omnisearch can also index other <strong style="color: var(--text-accent)">PLAINTEXT</strong> files.<br/>
|
||||||
Add extensions separated by a space, without the dot. Example: "<code>txt org csv</code>".<br />
|
Add extensions separated by a space, without the dot. Example: "<code>txt org csv</code>".<br />
|
||||||
\u26A0\uFE0F <span style="color: var(--text-accent)">Using extensions of non-plaintext files (like .docx or .pptx) WILL cause crashes,
|
\u26A0\uFE0F <span style="color: var(--text-accent)">Using extensions of non-plaintext files (like .pptx) WILL cause crashes,
|
||||||
because Omnisearch will try to index their content.</span>`}),new G.Setting(e).setName("Additional TEXT files to index").setDesc(a).addText(c=>{c.setValue(T.indexedFileTypes.join(" ")).setPlaceholder("Example: txt org csv").onChange(async h=>{await Se.clearCache(),T.indexedFileTypes=h.split(" "),await ce(this.plugin)})}),new G.Setting(e).setName("Behavior").setHeading(),new G.Setting(e).setName("Save index to cache").setDesc("Enable caching to speed up indexing time. In rare cases, the cache write may cause a crash in Obsidian. This option will disable itself if it happens.").addToggle(c=>c.setValue(T.useCache).onChange(async h=>{T.useCache=h,await ce(this.plugin)})),new G.Setting(e).setName(`Respect Obsidian's "Excluded Files"`).setDesc(`By default, files that are in Obsidian's "Options > Files & Links > Excluded Files" list are downranked in results.
|
because Omnisearch will try to index their content.</span>`)).addText(d=>{d.setValue(z.indexedFileTypes.join(" ")).setPlaceholder("Example: txt org csv").onChange(async f=>{await r.clearCache(),z.indexedFileTypes=f.split(" "),await pe(this.plugin)})}),new ee.Setting(t).setName("Behavior").setHeading(),new ee.Setting(t).setName("Save index to cache").setDesc("Enable caching to speed up indexing time. In rare cases, the cache write may cause a crash in Obsidian. This option will disable itself if it happens.").addToggle(d=>d.setValue(z.useCache).onChange(async f=>{z.useCache=f,await pe(this.plugin)})),new ee.Setting(t).setName("Show previous query results").setDesc("Re-executes the previous query when opening Omnisearch.").addToggle(d=>d.setValue(z.showPreviousQueryResults).onChange(async f=>{z.showPreviousQueryResults=f,await pe(this.plugin)})),new ee.Setting(t).setName(`Respect Obsidian's "Excluded Files"`).setDesc(`By default, files that are in Obsidian's "Options > Files & Links > Excluded Files" list are downranked in results.
|
||||||
Enable this option to completely hide them`).addToggle(c=>c.setValue(T.hideExcluded).onChange(async h=>{T.hideExcluded=h,await ce(this.plugin)}));let u=new DocumentFragment;u.createSpan({},c=>{c.innerHTML=`Enable this if you want to be able to search for CamelCaseWords as separate words.<br/>
|
Enable this option to completely hide them.`).addToggle(d=>d.setValue(z.hideExcluded).onChange(async f=>{z.hideExcluded=f,await pe(this.plugin)})),new ee.Setting(t).setName("Folders to downrank in search results").setDesc("Folders to downrank in search results. Files in these folders will be downranked in results. They will still be indexed for tags, unlike excluded files. Folders should be comma delimited.").addText(d=>{d.setValue(z.downrankedFoldersFilters.join(",")).setPlaceholder("Example: src,p2/dir").onChange(async f=>{let g=f.split(",");g=g.map(y=>y.trim()),z.downrankedFoldersFilters=g,await pe(this.plugin)})}),new ee.Setting(t).setName("Split CamelCaseWords").setDesc(sr(`Enable this if you want to be able to search for CamelCaseWords as separate words.<br/>
|
||||||
\u26A0\uFE0F <span style="color: var(--text-accent)">Changing this setting will clear the cache.</span><br>
|
\u26A0\uFE0F <span style="color: var(--text-accent)">Changing this setting will clear the cache.</span><br>
|
||||||
${pi}
|
${mo}`)).addToggle(d=>d.setValue(z.splitCamelCase).onChange(async f=>{await r.clearCache(),z.splitCamelCase=f,await pe(this.plugin)})),new ee.Setting(t).setName("Simpler search").setDesc(`Enable this if Obsidian often freezes while making searches.
|
||||||
`}),new G.Setting(e).setName("Split CamelCaseWords").setDesc(u).addToggle(c=>c.setValue(T.splitCamelCase).onChange(async h=>{await Se.clearCache(),T.splitCamelCase=h,await ce(this.plugin)})),new G.Setting(e).setName("Simpler search").setDesc(`Enable this if Obsidian often freezes while making searches.
|
Words shorter than 3 characters won't be used as prefixes; this can reduce search delay but will return fewer results.`).addToggle(d=>d.setValue(z.simpleSearch).onChange(async f=>{z.simpleSearch=f,await pe(this.plugin)})),ee.Platform.isIosApp||new ee.Setting(t).setName("Tokenize URLs").setDesc(`Enable this if you want to be able to search for URLs as separate words.
|
||||||
Words shorter than 3 characters won't be used as prefixes; this can reduce search delay but will return fewer results.`).addToggle(c=>c.setValue(T.simpleSearch).onChange(async h=>{T.simpleSearch=h,await ce(this.plugin)})),new G.Setting(e).setName("Open in new pane").setDesc("Open and create files in a new pane instead of the current pane.").addToggle(c=>c.setValue(T.openInNewPane).onChange(async h=>{T.openInNewPane=h,await ce(this.plugin)})),new G.Setting(e).setName("Set Vim like navigation keys").setDesc("Navigate down the results with Ctrl/\u2318 + J/N, or navigate up with Ctrl/\u2318 + K/P").addToggle(c=>c.setValue(T.vimLikeNavigationShortcut).onChange(async h=>{T.vimLikeNavigationShortcut=h,await ce(this.plugin)})),new G.Setting(e).setName("Fuzziness").setDesc("Define the level of fuzziness for the search. The higher the fuzziness, the more results you'll get.").addDropdown(c=>c.addOptions({0:"Exact match",1:"Not too fuzzy",2:"Fuzzy enough"}).setValue(T.fuzziness).onChange(async h=>{["0","1","2"].includes(h)||(h="2"),T.fuzziness=h,await ce(this.plugin)})),new G.Setting(e).setName("User Interface").setHeading(),new G.Setting(e).setName("Show ribbon button").setDesc("Add a button on the sidebar to open the Vault search modal.").addToggle(c=>c.setValue(T.ribbonIcon).onChange(async h=>{T.ribbonIcon=h,await ce(this.plugin),h?this.plugin.addRibbonButton():this.plugin.removeRibbonButton()})),new G.Setting(e).setName("Show excerpts").setDesc("Shows the contextual part of the note that matches the search. Disable this to only show filenames in results.").addToggle(c=>c.setValue(T.showExcerpt).onChange(async h=>{tr.set(h)})),new G.Setting(e).setName("Render line return in excerpts").setDesc("Activate this option to render line returns in result excerpts.").addToggle(c=>c.setValue(T.renderLineReturnInExcerpts).onChange(async h=>{T.renderLineReturnInExcerpts=h,await ce(this.plugin)})),new G.Setting(e).setName("Show previous query results").setDesc("Re-executes the previous query when opening Omnisearch.").addToggle(c=>c.setValue(T.showPreviousQueryResults).onChange(async h=>{T.showPreviousQueryResults=h,await ce(this.plugin)}));let l=new DocumentFragment;l.createSpan({},c=>{c.innerHTML=`Shows a button next to the search input, to create a note.
|
This setting has a strong impact on indexing performance, and can crash Obsidian under certain conditions.`).addToggle(d=>d.setValue(z.tokenizeUrls).onChange(async f=>{z.tokenizeUrls=f,await pe(this.plugin)})),new ee.Setting(t).setName("Open in new pane").setDesc("Open and create files in a new pane instead of the current pane.").addToggle(d=>d.setValue(z.openInNewPane).onChange(async f=>{z.openInNewPane=f,await pe(this.plugin)})),new ee.Setting(t).setName("Set Vim like navigation keys").setDesc("Navigate down the results with Ctrl/\u2318 + J/N, or navigate up with Ctrl/\u2318 + K/P").addToggle(d=>d.setValue(z.vimLikeNavigationShortcut).onChange(async f=>{z.vimLikeNavigationShortcut=f,await pe(this.plugin)})),new ee.Setting(t).setName("Fuzziness").setDesc("Define the level of fuzziness for the search. The higher the fuzziness, the more results you'll get.").addDropdown(d=>d.addOptions({0:"Exact match",1:"Not too fuzzy",2:"Fuzzy enough"}).setValue(z.fuzziness).onChange(async f=>{["0","1","2"].includes(f)||(f="2"),z.fuzziness=f,await pe(this.plugin)})),new ee.Setting(t).setName("User Interface").setHeading(),new ee.Setting(t).setName("Show ribbon button").setDesc("Add a button on the sidebar to open the Vault search modal.").addToggle(d=>d.setValue(z.ribbonIcon).onChange(async f=>{z.ribbonIcon=f,await pe(this.plugin),f?this.plugin.addRibbonButton():this.plugin.removeRibbonButton()})),new ee.Setting(t).setName("Show excerpts").setDesc("Shows the contextual part of the note that matches the search. Disable this to only show filenames in results.").addToggle(d=>d.setValue(z.showExcerpt).onChange(async f=>{ai.set(f)})),new ee.Setting(t).setName("Render line return in excerpts").setDesc("Activate this option to render line returns in result excerpts.").addToggle(d=>d.setValue(z.renderLineReturnInExcerpts).onChange(async f=>{z.renderLineReturnInExcerpts=f,await pe(this.plugin)})),new ee.Setting(t).setName('Show "Create note" button').setDesc(sr(`Shows a button next to the search input, to create a note.
|
||||||
Acts the same as the <code>shift \u21B5</code> shortcut, can be useful for mobile device users.`}),new G.Setting(e).setName('Show "Create note" button').setDesc(l).addToggle(c=>c.setValue(T.showCreateButton).onChange(async h=>{T.showCreateButton=h,await ce(this.plugin)})),new G.Setting(e).setName("Highlight matching words in results").setDesc("Will highlight matching results when enabled. See README for more customization options.").addToggle(c=>c.setValue(T.highlight).onChange(async h=>{T.highlight=h,await ce(this.plugin)})),new G.Setting(e).setName("Results weighting").setHeading(),new G.Setting(e).setName(`File name & declared aliases (default: ${Dt.weightBasename})`).addSlider(c=>this.weightSlider(c,"weightBasename")),new G.Setting(e).setName(`File directory (default: ${Dt.weightDirectory})`).addSlider(c=>this.weightSlider(c,"weightDirectory")),new G.Setting(e).setName(`Headings level 1 (default: ${Dt.weightH1})`).addSlider(c=>this.weightSlider(c,"weightH1")),new G.Setting(e).setName(`Headings level 2 (default: ${Dt.weightH2})`).addSlider(c=>this.weightSlider(c,"weightH2")),new G.Setting(e).setName(`Headings level 3 (default: ${Dt.weightH3})`).addSlider(c=>this.weightSlider(c,"weightH3")),new G.Setting(e).setName(`Tags without the # (default: ${Dt.weightUnmarkedTags})`).addSlider(c=>this.weightSlider(c,"weightUnmarkedTags")),new G.Setting(e).setName("Debugging").setHeading(),new G.Setting(e).setName("Enable verbose logging").setDesc("Adds a LOT of logs for debugging purposes. Don't forget to disable it.").addToggle(c=>c.setValue(T.verboseLogging).onChange(async h=>{T.verboseLogging=h,await ce(this.plugin)})),new G.Setting(e).setName("Danger Zone").setHeading();let f=new DocumentFragment;f.createSpan({},c=>{c.innerHTML=`Normalize diacritics in search terms. Words like "br\xFBl\xE9e" or "\u017Elu\u0165ou\u010Dk\xFD" will be indexed as "brulee" and "zlutoucky".<br/>
|
Acts the same as the <code>shift \u21B5</code> shortcut, can be useful for mobile device users.`)).addToggle(d=>d.setValue(z.showCreateButton).onChange(async f=>{z.showCreateButton=f,await pe(this.plugin)})),new ee.Setting(t).setName("Highlight matching words in results").setDesc("Will highlight matching results when enabled. See README for more customization options.").addToggle(d=>d.setValue(z.highlight).onChange(async f=>{z.highlight=f,await pe(this.plugin)}));let c=go(this.app);new ee.Setting(t).setName("Results weighting").setHeading(),new ee.Setting(t).setName(`File name & declared aliases (default: ${c.weightBasename})`).addSlider(d=>this.weightSlider(d,"weightBasename")),new ee.Setting(t).setName(`File directory (default: ${c.weightDirectory})`).addSlider(d=>this.weightSlider(d,"weightDirectory")),new ee.Setting(t).setName(`Headings level 1 (default: ${c.weightH1})`).addSlider(d=>this.weightSlider(d,"weightH1")),new ee.Setting(t).setName(`Headings level 2 (default: ${c.weightH2})`).addSlider(d=>this.weightSlider(d,"weightH2")),new ee.Setting(t).setName(`Headings level 3 (default: ${c.weightH3})`).addSlider(d=>this.weightSlider(d,"weightH3")),new ee.Setting(t).setName(`Tags (default: ${c.weightUnmarkedTags})`).addSlider(d=>this.weightSlider(d,"weightUnmarkedTags")),new ee.Setting(t).setName("Header properties fields").setDesc('You can set custom weights for values of header properties (e.g. "keywords"). Weights under 1.0 will downrank the results.');for(let d=0;d<z.weightCustomProperties.length;d++){let f=z.weightCustomProperties[d];new ee.Setting(t).setName((d+1).toString()+".").addText(g=>{g.setPlaceholder("Property name").setValue(f.name).onChange(async y=>{f.name=y,await pe(this.plugin)})}).addSlider(g=>{g.setLimits(.1,5,.1).setValue(f.weight).setDynamicTooltip().onChange(async y=>{f.weight=y,await pe(this.plugin)})}).addButton(g=>{g.setButtonText("Remove"),g.onClick(async()=>{z.weightCustomProperties.splice(d,1),await pe(this.plugin),this.display()})})}new ee.Setting(t).addButton(d=>{d.setButtonText("Add a new property"),d.onClick(f=>{z.weightCustomProperties.push({name:"",weight:1}),this.display()})}),ee.Platform.isMobile||(new ee.Setting(t).setName("API Access Through HTTP").setHeading().setDesc(sr('Omnisearch can be used through a simple HTTP server (<a href="https://publish.obsidian.md/omnisearch/Public+API+%26+URL+Scheme#HTTP+Server">more information</a>).')),new ee.Setting(t).setName("Enable the HTTP server").addToggle(d=>d.setValue(z.httpApiEnabled).onChange(async f=>{z.httpApiEnabled=f,f?this.plugin.apiHttpServer.listen(z.httpApiPort):this.plugin.apiHttpServer.close(),await pe(this.plugin)})),new ee.Setting(t).setName("HTTP Port").addText(d=>{d.setValue(z.httpApiPort).setPlaceholder("51361").onChange(async f=>{parseInt(f)>65535&&(f=z.httpApiPort,d.setValue(z.httpApiPort)),z.httpApiPort=f,z.httpApiEnabled&&(this.plugin.apiHttpServer.close(),this.plugin.apiHttpServer.listen(z.httpApiPort)),await pe(this.plugin)})}),new ee.Setting(t).setName("Show a notification when the server starts").setDesc("Will display a notification if the server is enabled, at Obsidian startup.").addToggle(d=>d.setValue(z.httpApiNotice).onChange(async f=>{z.httpApiNotice=f,await pe(this.plugin)}))),new ee.Setting(t).setName("Debugging").setHeading(),new ee.Setting(t).setName("Enable verbose logging").setDesc("Adds a LOT of logs for debugging purposes. Don't forget to disable it.").addToggle(d=>d.setValue(z.verboseLogging).onChange(async f=>{z.verboseLogging=f,pl(f),await pe(this.plugin)})),new ee.Setting(t).setName("Danger Zone").setHeading(),new ee.Setting(t).setName("Ignore diacritics").setDesc(sr(`Normalize diacritics in search terms. Words like "br\xFBl\xE9e" or "\u017Elu\u0165ou\u010Dk\xFD" will be indexed as "brulee" and "zlutoucky".<br/>
|
||||||
\u26A0\uFE0F <span style="color: var(--text-accent)">You probably should <strong>NOT</strong> disable this.</span><br>
|
\u26A0\uFE0F <span style="color: var(--text-accent)">You probably should <strong>NOT</strong> disable this.</span><br>
|
||||||
\u26A0\uFE0F <span style="color: var(--text-accent)">Changing this setting will clear the cache.</span><br>
|
\u26A0\uFE0F <span style="color: var(--text-accent)">Changing this setting will clear the cache.</span><br>
|
||||||
${pi}
|
${mo}`)).addToggle(d=>d.setValue(z.ignoreDiacritics).onChange(async f=>{await r.clearCache(),z.ignoreDiacritics=f,await pe(this.plugin)})),new ee.Setting(t).setName("Ignore Arabic diacritics (beta)").addToggle(d=>d.setValue(z.ignoreArabicDiacritics).onChange(async f=>{await r.clearCache(),z.ignoreArabicDiacritics=f,await pe(this.plugin)}));let h=new DocumentFragment;h.createSpan({},d=>{d.innerHTML=`Disable Omnisearch on this device only.<br>
|
||||||
`}),new G.Setting(e).setName("Ignore diacritics").setDesc(f).addToggle(c=>c.setValue(T.ignoreDiacritics).onChange(async h=>{await Se.clearCache(),T.ignoreDiacritics=h,await ce(this.plugin)}));let p=new DocumentFragment;if(p.createSpan({},c=>{c.innerHTML=`Disable Omnisearch on this device only.<br>
|
${mo}`}),new ee.Setting(t).setName("Disable on this device").setDesc(h).addToggle(d=>d.setValue(Yl(this.app)).onChange(async f=>{f?(this.app.saveLocalStorage(ia,"1"),new ee.Notice("Omnisearch - Disabled. Please restart Obsidian.")):(this.app.saveLocalStorage(ia),new ee.Notice("Omnisearch - Enabled. Please restart Obsidian."))})),new ee.Setting(t).setName("Force save the cache").setDesc(sr(`Omnisearch has a security feature that automatically disables cache writing if it cannot fully perform the operation.<br>
|
||||||
${pi}`}),new G.Setting(e).setName("Disable on this device").setDesc(p).addToggle(c=>c.setValue(ls()).onChange(async h=>{h?app.saveLocalStorage(An,"1"):app.saveLocalStorage(An),new G.Notice("Omnisearch - Disabled. Please restart Obsidian.")})),It()){let c=new DocumentFragment;c.createSpan({},h=>{h.innerHTML=`Erase all Omnisearch cache data.
|
Use this option to force the cache to be saved, even if it causes a crash.<br>
|
||||||
|
\u26A0\uFE0F <span style="color: var(--text-accent)">Enabling this setting could lead to crash loops</span>`)).addToggle(d=>d.setValue(z.DANGER_forceSaveCache).onChange(async f=>{z.DANGER_forceSaveCache=f,await pe(this.plugin)})),Nn()&&new ee.Setting(t).setName("Clear cache data").setDesc(sr(`Erase all Omnisearch cache data.
|
||||||
Use this if Omnisearch results are inconsistent, missing, or appear outdated.<br>
|
Use this if Omnisearch results are inconsistent, missing, or appear outdated.<br>
|
||||||
${pi}`}),new G.Setting(e).setName("Clear cache data").setDesc(c).addButton(h=>{h.setButtonText("Clear cache"),h.onClick(async()=>{await Se.clearCache()})})}}weightSlider(e,r){e.setLimits(1,5,.1).setValue(T[r]).setDynamicTooltip().onChange(async n=>{T[r]=n,await ce(this.plugin)})}},Dt={useCache:!0,hideExcluded:!1,ignoreDiacritics:!0,indexedFileTypes:[],PDFIndexing:!1,imagesIndexing:!1,unsupportedFilesIndexing:"no",splitCamelCase:!1,openInNewPane:!1,vimLikeNavigationShortcut:app.vault.getConfig("vimMode"),ribbonIcon:!0,showExcerpt:!0,renderLineReturnInExcerpts:!0,showCreateButton:!1,highlight:!0,showPreviousQueryResults:!0,simpleSearch:!1,fuzziness:"1",weightBasename:3,weightDirectory:2,weightH1:1.5,weightH2:1.3,weightH3:1.1,weightUnmarkedTags:1.1,welcomeMessage:"",verboseLogging:!1},T=Object.assign({},Dt);async function Ja(t){T=Object.assign({},Dt,await t.loadData()),tr.set(T.showExcerpt)}async function ce(t){await t.saveData(T)}function ls(){return app.loadLocalStorage(An)==="1"}function Xa(){return T.unsupportedFilesIndexing==="yes"||T.unsupportedFilesIndexing==="default"&&!!app.vault.getConfig("showUnsupportedFiles")}var Za=je(require("obsidian"));var el=/[\u4e00-\u9fa5]/;var tl=100,Cn=300,rl=`suggestion-highlight omnisearch-highlight ${T.highlight?"omnisearch-default-highlight":""}`,An="omnisearch-disabled",U=new mo,hi={ToggleExcerpts:"toggle-excerpts"},Je=(o=>(o[o.Done=0]="Done",o[o.LoadingCache=1]="LoadingCache",o[o.ReadingFiles=2]="ReadingFiles",o[o.IndexingFiles=3]="IndexingFiles",o[o.WritingCache=4]="WritingCache",o))(Je||{}),te=(f=>(f.Enter="enter",f.OpenInBackground="open-in-background",f.CreateNote="create-note",f.OpenInNewPane="open-in-new-pane",f.InsertLink="insert-link",f.Tab="tab",f.ArrowUp="arrow-up",f.ArrowDown="arrow-down",f.PrevSearchHistory="prev-search-history",f.NextSearchHistory="next-search-history",f))(te||{});var Ot=Vn(0),nl=!1;function us(t){nl=t}function cs(){return nl}function mi(){return app.plugins.plugins["cm-chs-patch"]}function ot(){return app.plugins?.plugins?.["text-extractor"]?.api}function It(){return!Za.Platform.isIosApp&&T.useCache}var il=/[|\t\n\r= -#%-*,.`\/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/.toString().slice(1,-1),fs=new RegExp(`${il}`,"u"),Sn=new RegExp(`${il}+`,"u");var yl=je(require("obsidian"));var rr=je(require("obsidian"));var sl=je(require("crypto")),al=je(ol());function ll(t){let e=t.split("/");return e.pop(),e.join("/")}function gi(t,e){return t.headings?.filter(r=>r.level===e).map(r=>r.heading)??[]}function yi(t,e){return(t+e)%e}function ps(t){return t.replace(/(\*|_)+(.+?)(\*|_)+/g,(e,r,n)=>n)}function ul(t){return t?.frontmatter?(0,rr.parseFrontMatterAliases)(t.frontmatter)??[]:[]}function cl(t){let e=t?(0,rr.getAllTags)(t)??[]:[];return e=[...new Set(e.reduce((r,n)=>[...r,...n.split("/").filter(i=>i).map(i=>i.startsWith("#")?i:`#${i}`),n],[]))],e}function yt(t){return t==null?"":(t=t.replaceAll("`","[__omnisearch__backtick__]"),t=t.normalize("NFD").replace(/\p{Diacritic}/gu,""),t=t.replaceAll("[__omnisearch__backtick__]","`"),t)}function nr(){return rr.Platform.isMacOS?"\u2318":"ctrl"}function kp(t){let e=!!ot(),r=e&&T.PDFIndexing,n=e&&T.imagesIndexing;return _i(t)||Dr(t)||vi(t)||r&&ir(t)||n&&Tr(t)}function hs(t){return Xa()||_i(t)||Dr(t)||vi(t)}function En(t){return hs(t)||kp(t)}function Tr(t){let e=or(t);return e==="png"||e==="jpg"||e==="jpeg"||e==="webp"}function ir(t){return or(t)==="pdf"}function _i(t){return[...T.indexedFileTypes,"md"].some(e=>t.endsWith(`.${e}`))}function Dr(t){return t.endsWith(".canvas")}function vi(t){return t.endsWith(".loom")||t.endsWith(".dashboard")}function or(t){let e=t.split(".");return e[e.length-1]??""}function fl(t){return rr.Platform.isMobileApp?(0,al.md5)(t.toString()):Line truncated
|
${mo}`)).addButton(d=>{d.setButtonText("Clear cache"),d.onClick(async()=>{await r.clearCache()})})}weightSlider(t,r){t.setLimits(1,5,.1).setValue(z[r]).setDynamicTooltip().onChange(async n=>{z[r]=n,await pe(this.plugin)})}}});function YS(e){let t;return{c(){t=V("span"),t.innerHTML='<svg viewBox="0 0 100 100" class="add-note-glyph" width="16" height="16"><path fill="currentColor" stroke="currentColor" d="M23.3,6.7c-3.7,0-6.7,3-6.7,6.7v73.3c0,3.7,3,6.7,6.7,6.7h28.4c-3.2-4.8-5.1-10.5-5.1-16.7c0-16.6,13.4-30,30-30 c2.3,0,4.5,0.3,6.7,0.8V31.7c0-0.9-0.3-1.7-1-2.4L60.7,7.6c-0.6-0.6-1.5-1-2.4-1L23.3,6.7z M56.7,13L77,33.3H60 c-1.8,0-3.3-1.5-3.3-3.3L56.7,13z M76.7,53.3c-12.9,0-23.3,10.4-23.3,23.3S63.8,100,76.7,100S100,89.6,100,76.7 S89.6,53.3,76.7,53.3z M76.7,63.3c1.8,0,3.3,1.5,3.3,3.3v6.7h6.7c1.8,0,3.3,1.5,3.3,3.3c0,1.8-1.5,3.3-3.3,3.3H80v6.7 c0,1.8-1.5,3.3-3.3,3.3c-1.8,0-3.3-1.5-3.3-3.3V80h-6.7c-1.8,0-3.3-1.5-3.3-3.3s1.5-3.3,3.3-3.3h6.7v-6.7 C73.3,64.8,74.8,63.3,76.7,63.3L76.7,63.3z"></path></svg>',Z(t,"class","suggestion-flair"),Z(t,"aria-label","Not created yet, select to create")},m(r,n){ae(r,t,n)},p:qe,i:qe,o:qe,d(r){r&&se(t)}}}function QS(e){"use strict";return[]}var D_,S_,x_=x(()=>{nr();D_=class extends pt{constructor(t){super();bt(this,t,QS,YS,ot,{})}},S_=D_});function O_(e){let t,r;return t=new S_({}),{c(){Lt(t.$$.fragment)},m(n,i){Dt(t,n,i),r=!0},i(n){r||(Ee(t.$$.fragment,n),r=!0)},o(n){Oe(t.$$.fragment,n),r=!1},d(n){Tt(t,n)}}}function $S(e){let t,r,n,i,s,a=e[2]&&O_(e),u=e[4].default,o=Mi(u,e,e[3],null);return{c(){t=V("div"),a&&a.c(),r=ue(),o&&o.c(),Z(t,"data-result-id",e[0]),Z(t,"class","suggestion-item omnisearch-result"),el(t,"is-selected",e[1])},m(c,h){ae(c,t,h),a&&a.m(t,null),j(t,r),o&&o.m(t,null),n=!0,i||(s=[ht(t,"mousemove",e[5]),ht(t,"click",e[6]),ht(t,"keypress",e[7]),ht(t,"auxclick",e[8])],i=!0)},p(c,[h]){c[2]?a?h&4&&Ee(a,1):(a=O_(c),a.c(),Ee(a,1),a.m(t,r)):a&&(ei(),Oe(a,1,1,()=>{a=null}),ti()),o&&o.p&&(!n||h&8)&&Fi(o,u,c,c[3],n?ki(u,c[3],h,null):Bi(c[3]),null),(!n||h&1)&&Z(t,"data-result-id",c[0]),(!n||h&2)&&el(t,"is-selected",c[1])},i(c){n||(Ee(a),Ee(o,c),n=!0)},o(c){Oe(a),Oe(o,c),n=!1},d(c){c&&se(t),a&&a.d(),o&&o.d(c),i=!1,lr(s)}}}function XS(e,t,r){let{$$slots:n={},$$scope:i}=t,{id:s}=t,{selected:a=!1}=t,{glyph:u=!1}=t;function o(f){Vt.call(this,e,f)}function c(f){Vt.call(this,e,f)}function h(f){Vt.call(this,e,f)}function d(f){Vt.call(this,e,f)}return e.$$set=f=>{"id"in f&&r(0,s=f.id),"selected"in f&&r(1,a=f.selected),"glyph"in f&&r(2,u=f.glyph),"$$scope"in f&&r(3,i=f.$$scope)},[s,a,u,i,n,o,c,h,d]}var N_,_o,$l=x(()=>{nr();x_();N_=class extends pt{constructor(t){super();bt(this,t,XS,$S,ot,{id:0,selected:1,glyph:2})}},_o=N_});function w_(e){let t,r=e[1].matches.length+"",n,i,s=(e[1].matches.length>1?"matches":"match")+"",a;return{c(){t=V("span"),n=dt(r),i=dt("\xA0"),a=dt(s),Z(t,"class","omnisearch-result__counter")},m(u,o){ae(u,t,o),j(t,n),j(t,i),j(t,a)},p(u,o){o&2&&r!==(r=u[1].matches.length+"")&&xr(n,r),o&2&&s!==(s=(u[1].matches.length>1?"matches":"match")+"")&&xr(a,s)},d(u){u&&se(t)}}}function R_(e){let t,r,n,i,s=e[2].textProcessor.highlightText(e[4],e[10])+"";return{c(){t=V("div"),r=V("span"),n=ue(),i=V("span"),Z(t,"class","omnisearch-result__folder-path")},m(a,u){ae(a,t,u),j(t,r),e[14](r),j(t,n),j(t,i),i.innerHTML=s},p(a,u){u&1044&&s!==(s=a[2].textProcessor.highlightText(a[4],a[10])+"")&&(i.innerHTML=s)},d(a){a&&se(t),e[14](null)}}}function P_(e){let t,r=e[2].textProcessor.highlightText(e[9],e[1].matches)+"";return{c(){t=V("div"),Z(t,"class","omnisearch-result__body")},m(n,i){ae(n,t,i),t.innerHTML=r},p(n,i){i&518&&r!==(r=n[2].textProcessor.highlightText(n[9],n[1].matches)+"")&&(t.innerHTML=r)},d(n){n&&se(t)}}}function L_(e){let t,r,n;return{c(){t=V("div"),r=V("img"),zt(r,"width","100px"),Zc(r.src,n=e[7])||Z(r,"src",n),Z(r,"alt",""),Z(t,"class","omnisearch-result__image-container")},m(i,s){ae(i,t,s),j(t,r)},p(i,s){s&128&&!Zc(r.src,n=i[7])&&Z(r,"src",n)},d(i){i&&se(t)}}}function ZS(e){let t,r,n,i,s,a,u=e[2].textProcessor.highlightText(e[3],e[11])+"",o,c,h,d=En(e[1].path)+"",f,g,y,b,D,m,v=e[1].matches.length>0&&w_(e),I=e[4]&&R_(e),T=e[12]&&P_(e),E=e[7]&&L_(e);return{c(){t=V("div"),r=V("div"),n=V("span"),i=V("span"),s=ue(),a=V("span"),o=ue(),c=V("span"),h=dt("."),f=dt(d),g=ue(),v&&v.c(),y=ue(),I&&I.c(),b=ue(),D=V("div"),T&&T.c(),m=ue(),E&&E.c(),Z(c,"class","omnisearch-result__extension"),Z(n,"class","omnisearch-result__title"),Z(r,"class","omnisearch-result__title-container"),zt(D,"display","flex"),zt(D,"flex-direction","row")},m(C,S){ae(C,t,S),j(t,r),j(r,n),j(n,i),e[13](i),j(n,s),j(n,a),a.innerHTML=u,j(n,o),j(n,c),j(c,h),j(c,f),j(n,g),v&&v.m(n,null),j(t,y),I&&I.m(t,null),j(t,b),j(t,D),T&&T.m(D,null),j(D,m),E&&E.m(D,null)},p(C,S){S&2060&&u!==(u=C[2].textProcessor.highlightText(C[3],C[11])+"")&&(a.innerHTML=u),S&2&&d!==(d=En(C[1].path)+"")&&xr(f,d),C[1].matches.length>0?v?v.p(C,S):(v=w_(C),v.c(),v.m(n,null)):v&&(v.d(1),v=null),C[4]?I?I.p(C,S):(I=R_(C),I.c(),I.m(t,b)):I&&(I.d(1),I=nul
Line truncated
|
||||||
`)}else if(vi(t))try{let s=JSON.parse(await app.vault.cachedRead(e)),a=[],u=l=>{for(let f in l)typeof l[f]=="object"?u(l[f]):f==="markdown"&&a.push(l[f])};u(s),r=a.join(`\r
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var we=!0,tt=!1,Kr;return{s:function(){H=H.call(R)},n:function(){var X=H.next();return we=X.done,X},e:function(X){tt=!0,Kr=X},f:function(){try{!we&&H.return!=null&&H.return()}finally{if(tt)throw Kr}}}}function c(R,F){if(!!R){if(typeof R=="string")return h(R,F);var H=Object.prototype.toString.call(R).slice(8,-1);if(H==="Object"&&R.constructor&&(H=R.constructor.name),H==="Map"||H==="Set")return Array.from(R);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return h(R,F)}}function h(R,F){(F==null||F>R.length)&&(F=R.length);for(var H=0,te=new Array(F);H<F;H++)te[H]=R[H];return te}function d(R,F){if(!(R instanceof F))throw new TypeError("Cannot call a class as a function")}function f(R,F){for(var H=0;H<F.length;H++){var te=F[H];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(R,te.key,te)}}function g(R,F,H){return F&&f(R.prototype,F),H&&f(R,H),Object.defineProperty(R,"prototype",{writable:!1}),R}function y(R,F,H){return F in R?Object.defineProperty(R,F,{value:H,enumerable:!0,configurable:!0,writable:!0}):R[F]=H,R}function b(R,F,H){D(R,F),F.set(R,H)}function D(R,F){if(F.has(R))throw new TypeError("Cannot initialize the same private elements twice on an object")}function m(R,F){var H=T(R,F,"get");return v(R,H)}function v(R,F){return F.get?F.get.call(R):F.value}function I(R,F,H){var te=T(R,F,"set");return E(R,te,H),H}function T(R,F,H){if(!F.has(R))throw new TypeError("attempted to "+H+" private field on non-instance");return F.get(R)}function E(R,F,H){if(F.set)F.set.call(R,H);else{if(!F.writable)throw new TypeError("attempted to set read only private field");F.value=H}}var C=typeof Symbol!="undefined"?Symbol.toStringTag:"@@toStringTag",S=new WeakMap,N=new WeakMap,P=function(){function R(F){var H=F.executor,te=H===void 0?function(){}:H,de=F.internals,we=de===void 0?Ke():de,tt=F.promise,Kr=tt===void 0?new Promise(function(_t,X){return te(_t,X,function($e){we.onCancelList.push($e)})}):tt;d(this,R),b(this,S,{writable:!0,value:void 0}),b(this,N,{writable:!0,value:void 0}),y(this,C,"CancelablePromise"),this.cancel=this.cancel.bind(this),I(this,S,we),I(this,N,Kr||new Promise(function(_t,X){return te(_t,X,function($e){we.onCancelList.push($e)})}))}return g(R,[{key:"then",value:function(H,te){return ke(m(this,N).then(he(H,m(this,S)),he(te,m(this,S))),m(this,S))}},{key:"catch",value:function(H){return ke(m(this,N).catch(he(H,m(this,S))),m(this,S))}},{key:"finally",value:function(H,te){var de=this;return te&&m(this,S).onCancelList.push(H),ke(m(this,N).finally(he(function(){if(H)return te&&(m(de,S).onCancelList=m(de,S).onCancelList.filter(function(we){return we!==H})),H()},m(this,S))),m(this,S))}},{key:"cancel",value:function(){m(this,S).isCanceled=!0;var H=m(this,S).onCancelList;m(this,S).onCancelList=[];var te=o(H),de;try{for(te.s();!(de=te.n()).done;){var we=de.value;if(typeof we=="function")try{we()}catch(tt){console.error(tt)}}}catch(tt){te.e(tt)}finally{te.f()}}},{key:"isCanceled",value:function(){return m(this,S).isCanceled===!0}}]),R}(),q=function(R){t(H,R);var F=n(H);function H(te){return d(this,H),F.call(this,{executor:te})}return g(H)}(P);e.CancelablePromise=q,y(q,"all",function(F){return Ie(F,Promise.all(F))}),y(q,"allSettled",function(F){return Ie(F,Promise.allSettled(F))}),y(q,"any",function(F){return Ie(F,Promise.any(F))}),y(q,"race",function(F){return Ie(F,Promise.race(F))}),y(q,"resolve",function(F){return ge(Promise.resolve(F))}),y(q,"reject",function(F){return ge(Promise.reject(F))}),y(q,"isCancelable",W);var $=q;e.default=$;function ge(R){return ke(R,Ke())}function W(R){return R instanceof q||R instanceof P}function he(R,F){if(R)return function(H){if(!F.isCanceled){var te=R(H);return W(te)&&F.onCancelList.push(te.cancel),te}return H}}function ke(R,F){return new P({internals:F,promise:R})}function Ie(R,F){var H=Ke();return H.onCancelList.push(function(){var te=o(R),de;try{for(te.s();!(de=te.n()).done;){var we=de.value;W(we)&&we.cancel()}}catch(tt){te.e(tt)}finally{te.f()}}),new P({internals:H,promise:F})}function Ke(){return{isCanceled:!1,onCancelList:[]}}})});function z_(e,t,r){let n=e.slice();return n[40]=t[r],n[42]=r,n}function V_(e){let t,r,n;return{c(){t=V("button"),t.textContent="Create note"},m(i,s){ae(i,t,s),r||(n=ht(t,"click",e[14]),r=!0)},p:qe,d(i){i&&se(t),r=!1,n()}}}function tx(e){let t,r,n;return{c(){t=V("button"),t.textContent="In-File search"},m(i,s){ae(i,t,s),r||(n=ht(t,"click",e[15]),r=!0)},p:qe,d(i){i&&se(t),r=!1,n()}}}function rx(e){let t,r,n=e[0].settings.showCreateButton&&V_(e),i=gr.Platform.isMobile&&tx(e);return{c(){t=V("div"),n&&n.c(),r=ue(),i&&i.c(),Z(t,"class","omnisearch-input-container__buttons")},m(s,a){ae(s,t,a),n&&n.m(t,null),j(t,r),i&&i.m(t,null)},p(s,a){s[0].settings.showCreateButton?n?n.p(s,a):(n=V_(s),n.c(),n.m(t,r)):n&&(n.d(1),n=null),gr.Platform.isMobile&&i.p(s,a)},d(s){s&&se(t),n&&n.d(),i&&i.d()}}}function K_(e
Line truncated
|
||||||
`)}catch(s){console.error("Omnisearch: Error while parsing Dataloom file",t),console.error(s)}else Tr(t)&&T.imagesIndexing&&n?.canFileBeExtracted(t)?r=await n.extractText(e):ir(t)&&T.PDFIndexing&&n?.canFileBeExtracted(t)?r=await n.extractText(e):hs(t)&&(r=e.path);r==null&&(console.warn(`Omnisearch: ${r} content for file`,e.path),r=""),r=yt(r);let i=app.metadataCache.getFileCache(e);if(i&&i.frontmatter?.["excalidraw-plugin"]){let s=i.sections?.filter(a=>a.type==="comment")??[];for(let{start:a,end:u}of s.map(l=>l.position))r=r.substring(0,a.offset-1)+r.substring(u.offset)}let o=cl(i);return{basename:yt(e.basename),content:r,path:e.path,mtime:e.stat.mtime,tags:o,unmarkedTags:o.map(s=>s.replace("#","")),aliases:ul(i).join(""),headings1:i?gi(i,1).join(" "):"",headings2:i?gi(i,2).join(" "):"",headings3:i?gi(i,3).join(" "):""}}var _l=class{constructor(){this.nextQueryIsEmpty=!1;this.documents=new Map}async addToLiveCache(e){try{let r=await Pp(e);if(!r.path){console.error(`Missing .path field in IndexedDocument "${r.basename}", skipping`);return}this.documents.set(e,r)}catch(r){console.warn(`Omnisearch: Error while adding "${e}" to live cache`,r),this.removeFromLiveCache(e)}}removeFromLiveCache(e){this.documents.delete(e)}async getDocument(e){return this.documents.has(e)?this.documents.get(e):(fe("Generating IndexedDocument from",e),await this.addToLiveCache(e),this.documents.get(e))}async addToSearchHistory(e){if(!e){this.nextQueryIsEmpty=!0;return}this.nextQueryIsEmpty=!1;let r=await Se.searchHistory.toArray();r=r.filter(n=>n.query!==e).reverse(),r.unshift({query:e}),r=r.slice(0,10),await Se.searchHistory.clear(),await Se.searchHistory.bulkAdd(r)}async getSearchHistory(){let e=(await Se.searchHistory.toArray()).reverse().map(r=>r.query);return this.nextQueryIsEmpty&&e.unshift(""),e}getDocumentsChecksum(e){return fl(JSON.stringify(e.sort((r,n)=>r.path<n.path?-1:r.path>n.path?1:0)))}async getMinisearchCache(){try{return(await Se.minisearch.toArray())[0]}catch(e){return new yl.Notice("Omnisearch - Cache missing or invalid. Some freezes may occur while Omnisearch indexes your vault."),console.error("Omnisearch - Error while loading Minisearch cache"),console.error(e),null}}async writeMinisearchCache(e,r){let n=Array.from(r).map(([i,o])=>({path:i,mtime:o}));await Se.minisearch.clear(),await Se.minisearch.add({date:new Date().toISOString(),paths:n,data:e.toJSON()}),console.log("Omnisearch - Search cache written")}},Fe=new _l;function Mp(t){let e,r,n,i,o,s,a,u,l=t[8].default,f=pr(l,t,t[7],null);return{c(){e=M("div"),r=M("div"),n=M("input"),o=W(),f&&f.c(),B(n,"class","prompt-input"),B(n,"placeholder",t[0]),B(n,"spellcheck","false"),B(n,"type","text"),B(r,"class","omnisearch-input-field"),B(e,"class","omnisearch-input-container")},m(p,c){$(p,e,c),D(e,r),D(r,n),t[9](n),ao(n,t[1]),D(e,o),f&&f.m(e,null),s=!0,a||(u=[He(n,"input",t[10]),Js(i=t[3].call(null,n)),He(n,"compositionend",t[11]),He(n,"compositionstart",t[12]),He(n,"input",t[4])],a=!0)},p(p,[c]){(!s||c&1)&&B(n,"placeholder",p[0]),c&2&&n.value!==p[1]&&ao(n,p[1]),f&&f.p&&(!s||c&128)&&mr(f,l,p,p[7],s?hr(l,p[7],c,null):gr(p[7]),null)},i(p){s||(ee(f,p),s=!0)},o(p){ne(f,p),s=!1},d(p){p&&H(e),t[9](null),f&&f.d(p),a=!1,Xe(u)}}}function Rp(t,e,r){let{$$slots:n={},$$scope:i}=e,{initialValue:o=""}=e,{placeholder:s=""}=e,a=!1,u="",l,f=co();function p(m){r(1,u=m)}function c(m){m&&!a&&!u&&(a=!0,r(1,u=m),h())}function h(m){jt().then(()=>(l.focus(),jt())).then(()=>{l.select()})}let w=(0,vl.debounce)(()=>{Fe.addToSearchHistory(""),f("input",u)},300);function x(m){lt[m?"unshift":"push"](()=>{l=m,r(2,l)})}function v(){u=this.value,r(1,u)}let d=m=>us(!1),b=m=>us(!0);return t.$$set=m=>{"initialValue"in m&&r(5,o=m.initialValue),"placeholder"in m&&r(0,s=m.placeholder),"$$scope"in m&&r(7,i=m.$$scope)},t.$$.update=()=>{if(t.$$.dirty&32){e:c(o)}},[s,u,l,h,w,o,p,i,n,x,v,d,b]}var bl=class extends Te{constructor(e){super();Oe(this,e,Rp,Mp,Ae,{initialValue:5,placeholder:0,setInputValue:6})}get setInputValue(){return this.$$.ctx[6]}},bi=bl;function Lp(t){let e,r,n,i,o=t[1].default,s=pr(o,t,t[0],null);return{c(){e=M("div"),s&&s.c(),B(e,"class","prompt-results")},m(a,u){$(a,e,u),s&&s.m(e,null),r=!0,n||(i=He(e,"mousedown",Bp),n=!0)},p(a,[u]){s&&s.p&&(!r||u&1)&&mr(s,o,a,a[0],r?hr(o,a[0],u,null):gr(a[0]),null)},i(a){r||(ee(s,a),r=!0)},o(a){ne(s,a),r=!1},d(a){a&&H(e),s&&s.d(a),n=!1,i()}}}var Bp=t=>t.preventDefault();function Np(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&r(0,i=o.$$scope)},[i,n]}var xl=class extends Te{constructor(e){super();Oe(this,e,Np,Lp,Ae,{})}},xi=xl;var ws=je(require("obsidian"));var Zc=je(require("obsidian"));var Kp=typeof global=="object"&&global&&global.Object===Object&&global,wi=Kp;var zp=typeof self=="object"&&self&&self.Object===Object&&self,Vp=wi||zp||Function("return this")(),ye=Vp;var Hp=ye.Symbol,Ee=Hp;var wl=Object.prototype,$p=wl.hasOwnProperty,Wp=wl.toString,Tn=Ee?Ee.toStringTag:void 0;function Up(t){var e=$p.call(t,Tn),r=t[Tn];try{t[Tn]=void
Line truncated
|
`),i&&i.c(),n=Zs()},m(s,a){ae(s,t,a),i&&i.m(s,a),ae(s,n,a)},p(s,a){a[0]&5&&(r=s[0].settings.simpleSearch&&s[2].split(sa).some(Q_)),r?i||(i=Y_(s),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},d(s){s&&se(t),i&&i.d(s),s&&se(n)}}}function Y_(e){let t,r,n;return{c(){t=V("br"),r=ue(),n=V("span"),n.textContent=`You have enabled "Simpler Search" in the settings, try to type more
|
||||||
`);let s=t.lastIndexOf(`
|
characters.`,zt(n,"color","var(--text-accent)"),zt(n,"font-size","small")},m(i,s){ae(i,t,s),ae(i,r,s),ae(i,n,s)},d(i){i&&se(t),i&&se(r),i&&se(n)}}}function sx(e){let t,r,n,i=e[3],s=[];for(let h=0;h<i.length;h+=1)s[h]=W_(z_(e,i,h));let a=h=>Oe(s[h],1,1,()=>{s[h]=null});function u(h,d){if(!h[3].length&&h[2]&&!h[5])return ix;if(h[5])return nx}let o=u(e,[-1,-1]),c=o&&o(e);return{c(){for(let h=0;h<s.length;h+=1)s[h].c();t=ue(),r=V("div"),c&&c.c(),zt(r,"text-align","center")},m(h,d){for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(h,d);ae(h,t,d),ae(h,r,d),c&&c.m(r,null),n=!0},p(h,d){if(d[0]&12299){i=h[3];let f;for(f=0;f<i.length;f+=1){let g=z_(h,i,f);s[f]?(s[f].p(g,d),Ee(s[f],1)):(s[f]=W_(g),s[f].c(),Ee(s[f],1),s[f].m(t.parentNode,t))}for(ei(),f=i.length;f<s.length;f+=1)a(f);ti()}o===(o=u(h,d))&&c?c.p(h,d):(c&&c.d(1),c=o&&o(h),c&&(c.c(),c.m(r,null)))},i(h){if(!n){for(let d=0;d<i.length;d+=1)Ee(s[d]);n=!0}},o(h){s=s.filter(Boolean);for(let d=0;d<s.length;d+=1)Oe(s[d]);n=!1},d(h){Nu(s,h),h&&se(t),h&&se(r),c&&c.d()}}}function ax(e){let t,r,n,i,s,a,u,o,c,h,d,f,g,y,b,D,m,v,I,T,E,C,S,N,P,q,$,ge,W,he,ke,Ie,Ke,R,F,H,te,de,we,tt,Kr,_t,X,$e,Wr,cr,Zn,Pi,pn,Fy={plugin:e[0],initialValue:e[2],placeholder:"Omnisearch - Vault",$$slots:{default:[rx]},$$scope:{ctx:e}};t=new Fu({props:Fy}),e[19](t),t.$on("input",e[20]);let Pt=e[4]&&K_(e);return i=new Bu({props:{$$slots:{default:[sx]},$$scope:{ctx:e}}}),{c(){Lt(t.$$.fragment),r=ue(),Pt&&Pt.c(),n=ue(),Lt(i.$$.fragment),s=ue(),a=V("div"),u=V("div"),u.innerHTML='<span class="prompt-instruction-command">\u2191\u2193</span><span>to navigate</span>',o=ue(),c=V("div"),c.innerHTML=`<span class="prompt-instruction-command">alt \u2191\u2193</span>
|
||||||
`,r-n);s>0&&(t=t.slice(s))}return t=$v(t),T.renderLineReturnInExcerpts&&(t=t.trim().replaceAll(`
|
<span>to cycle history</span>`,h=ue(),d=V("div"),f=V("span"),g=dt(e[8]),y=ue(),b=V("span"),b.textContent="to open",D=ue(),m=V("div"),m.innerHTML=`<span class="prompt-instruction-command">tab</span>
|
||||||
`,"<br>")),{content:t,offset:r}}catch(r){return new Zc.Notice("Omnisearch - Error while creating excerpt, see developer console"),console.error("Omnisearch - Error while creating excerpt"),console.error(r),{content:"",offset:-1}}}async function Qi(t,e=!1){let r=Qr(t.foundWords);r.exec(t.content);let n=r.lastIndex,i=!1;app.workspace.iterateAllLeaves(a=>{a.view instanceof ws.MarkdownView&&!e&&a.getViewState().state?.file===t.path&&a.getViewState()?.pinned&&(app.workspace.setActiveLeaf(a,{focus:!0}),i=!0)}),i||await app.workspace.openLinkText(t.path,"",e);let o=app.workspace.getActiveViewOfType(ws.MarkdownView);if(!o)return;let s=o.editor.offsetToPos(n);s.ch=0,o.editor.setCursor(s),o.editor.scrollIntoView({from:{line:s.line-10,ch:0},to:{line:s.line+10,ch:0}})}async function ef(t,e=!1){try{let r;switch(app.vault.getConfig("newFileLocation")){case"current":r=(app.workspace.getActiveFile()?.parent?.path??"")+"/";break;case"folder":r=app.vault.getConfig("newFileFolderPath")+"/";break;default:r="";break}await app.workspace.openLinkText(`${r}${t}.md`,"",e)}catch(r){throw r.message="OmniSearch - Could not create note: "+r.message,console.error(r),r}}function Wv(t){let e;return{c(){e=M("span"),e.innerHTML='<svg viewBox="0 0 100 100" class="add-note-glyph" width="16" height="16"><path fill="currentColor" stroke="currentColor" d="M23.3,6.7c-3.7,0-6.7,3-6.7,6.7v73.3c0,3.7,3,6.7,6.7,6.7h28.4c-3.2-4.8-5.1-10.5-5.1-16.7c0-16.6,13.4-30,30-30 c2.3,0,4.5,0.3,6.7,0.8V31.7c0-0.9-0.3-1.7-1-2.4L60.7,7.6c-0.6-0.6-1.5-1-2.4-1L23.3,6.7z M56.7,13L77,33.3H60 c-1.8,0-3.3-1.5-3.3-3.3L56.7,13z M76.7,53.3c-12.9,0-23.3,10.4-23.3,23.3S63.8,100,76.7,100S100,89.6,100,76.7 S89.6,53.3,76.7,53.3z M76.7,63.3c1.8,0,3.3,1.5,3.3,3.3v6.7h6.7c1.8,0,3.3,1.5,3.3,3.3c0,1.8-1.5,3.3-3.3,3.3H80v6.7 c0,1.8-1.5,3.3-3.3,3.3c-1.8,0-3.3-1.5-3.3-3.3V80h-6.7c-1.8,0-3.3-1.5-3.3-3.3s1.5-3.3,3.3-3.3h6.7v-6.7 C73.3,64.8,74.8,63.3,76.7,63.3L76.7,63.3z"></path></svg>',B(e,"class","suggestion-flair"),B(e,"aria-label","Not created yet, select to create")},m(r,n){$(r,e,n)},p:he,i:he,o:he,d(r){r&&H(e)}}}function Uv(t){"use strict";return[]}var tf=class extends Te{constructor(e){super();Oe(this,e,Uv,Wv,Ae,{})}},rf=tf;function nf(t){let e,r;return e=new rf({}),{c(){$e(e.$$.fragment)},m(n,i){Re(e,n,i),r=!0},i(n){r||(ee(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){Ie(e,n)}}}function Gv(t){let e,r,n,i,o,s=t[2]&&nf(t),a=t[4].default,u=pr(a,t,t[3],null);return{c(){e=M("div"),s&&s.c(),r=W(),u&&u.c(),B(e,"data-result-id",t[0]),B(e,"class","suggestion-item omnisearch-result"),lo(e,"is-selected",t[1])},m(l,f){$(l,e,f),s&&s.m(e,null),D(e,r),u&&u.m(e,null),n=!0,i||(o=[He(e,"mousemove",t[5]),He(e,"click",t[6]),He(e,"keypress",t[7]),He(e,"auxclick",t[8])],i=!0)},p(l,[f]){l[2]?s?f&4&&ee(s,1):(s=nf(l),s.c(),ee(s,1),s.m(e,r)):s&&(Ut(),ne(s,1,1,()=>{s=null}),Gt()),u&&u.p&&(!n||f&8)&&mr(u,a,l,l[3],n?hr(a,l[3],f,null):gr(l[3]),null),(!n||f&1)&&B(e,"data-result-id",l[0]),(!n||f&2)&&lo(e,"is-selected",l[1])},i(l){n||(ee(s),ee(u,l),n=!0)},o(l){ne(s),ne(u,l),n=!1},d(l){l&&H(e),s&&s.d(),u&&u.d(l),i=!1,Xe(o)}}}function Qv(t,e,r){let{$$slots:n={},$$scope:i}=e,{id:o}=e,{selected:s=!1}=e,{glyph:a=!1}=e;function u(c){Qe.call(this,t,c)}function l(c){Qe.call(this,t,c)}function f(c){Qe.call(this,t,c)}function p(c){Qe.call(this,t,c)}return t.$$set=c=>{"id"in c&&r(0,o=c.id),"selected"in c&&r(1,s=c.selected),"glyph"in c&&r(2,a=c.glyph),"$$scope"in c&&r(3,i=c.$$scope)},[o,s,a,i,n,u,l,f,p]}var of=class extends Te{constructor(e){super();Oe(this,e,Qv,Gv,Ae,{id:0,selected:1,glyph:2})}},qi=of;var Yr=je(require("obsidian"));function sf(t){let e,r=t[1].matches.length+"",n,i,o=(t[1].matches.length>1?"matches":"match")+"",s;return{c(){e=M("span"),n=Ce(r),i=Ce("\xA0"),s=Ce(o),B(e,"class","omnisearch-result__counter")},m(a,u){$(a,e,u),D(e,n),D(e,i),D(e,s)},p(a,u){u&2&&r!==(r=a[1].matches.length+"")&&Ze(n,r),u&2&&o!==(o=(a[1].matches.length>1?"matches":"match")+"")&&Ze(s,o)},d(a){a&&H(e)}}}function af(t){let e,r,n,i,o;return{c(){e=M("div"),r=M("span"),n=W(),i=M("span"),o=Ce(t[7]),B(e,"class","omnisearch-result__folder-path")},m(s,a){$(s,e,a),D(e,r),t[14](r),D(e,n),D(e,i),D(i,o)},p(s,a){a&128&&Ze(o,s[7])},d(s){s&&H(e),t[14](null)}}}function lf(t){let e,r=Ht(t[5].content,t[9])+"";return{c(){e=M("div"),B(e,"class","omnisearch-result__body")},m(n,i){$(n,e,i),e.innerHTML=r},p(n,i){i&544&&r!==(r=Ht(n[5].content,n[9])+"")&&(e.innerHTML=r)},d(n){n&&H(e)}}}function uf(t){let e,r,n;return{c(){e=M("div"),r=M("img"),Ge(r,"width","100px"),so(r.src,n=t[6])||B(r,"src",n),B(r,"alt",""),B(e,"class","omnisearch-result__image-container")},m(i,o){$(i,e,o),D(e,r)},p(i,o){o&64&&!so(r.src,n=i[6])&&B(r,"src",n)},d(i){i&&H(e)}}}function qv(t){let e,r,n,i,o,s,a=Ht(t[2],t[10])+"",u,l,f,p=or(t[1].path)+"",c,h,w,x,v,d,b=t[1].matches.length>0&&sf(t),m=t[7]&&af(t),g=t[11]&&lf(t),y=t[6]&&uf(t);return{c(){e=M("div"),r=M("div"),n=M("span"),i=M("span"),o=W(),s=M("span"),u=W(),l=M("span"),f=Ce("."),c=Ce(p),h=W(),b&&b.c(),w=W(),m&&m.c(),x=W(),v
Line truncated
|
<span>to switch to In-File Search</span>`,v=ue(),I=V("div"),T=V("span"),E=dt(e[7]),C=ue(),S=V("span"),S.textContent="to open in a new pane",N=ue(),P=V("div"),q=V("span"),q.textContent=`${e[11]}`,$=ue(),ge=V("span"),ge.textContent="to open in a new split",W=ue(),he=V("div"),he.innerHTML=`<span class="prompt-instruction-command">alt o</span>
|
||||||
`),i&&i.c(),n=yr()},m(o,s){$(o,e,s),i&&i.m(o,s),$(o,n,s)},p(o,s){s[0]&2&&(r=T.simpleSearch&&o[1].split(Sn).some(Pf)),r?i||(i=kf(o),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},d(o){o&&H(e),i&&i.d(o),o&&H(n)}}}function kf(t){let e,r,n;return{c(){e=M("br"),r=W(),n=M("span"),n.textContent=`You have enabled "Simpler Search" in the settings, try to type more
|
<span>to open in the background</span>`,ke=ue(),Ie=V("div"),Ke=V("span"),R=dt(e[10]),F=ue(),H=V("span"),H.textContent="to create",te=ue(),de=V("div"),we=V("span"),tt=dt(e[9]),Kr=ue(),_t=V("span"),_t.textContent="to create in a new pane",X=ue(),$e=V("div"),$e.innerHTML=`<span class="prompt-instruction-command">alt \u21B5</span>
|
||||||
characters.`,Ge(n,"color","var(--text-accent)"),Ge(n,"font-size","small")},m(i,o){$(i,e,o),$(i,r,o),$(i,n,o)},d(i){i&&H(e),i&&H(r),i&&H(n)}}}function gb(t){let e,r,n,i=t[2],o=[];for(let f=0;f<i.length;f+=1)o[f]=Of(Df(t,i,f));let s=f=>ne(o[f],1,1,()=>{o[f]=null});function a(f,p){if(!f[2].length&&f[1]&&!f[4])return mb;if(f[4])return hb}let u=a(t,[-1,-1]),l=u&&u(t);return{c(){for(let f=0;f<o.length;f+=1)o[f].c();e=W(),r=M("div"),l&&l.c(),Ge(r,"text-align","center")},m(f,p){for(let c=0;c<o.length;c+=1)o[c].m(f,p);$(f,e,p),$(f,r,p),l&&l.m(r,null),n=!0},p(f,p){if(p[0]&3077){i=f[2];let c;for(c=0;c<i.length;c+=1){let h=Df(f,i,c);o[c]?(o[c].p(h,p),ee(o[c],1)):(o[c]=Of(h),o[c].c(),ee(o[c],1),o[c].m(e.parentNode,e))}for(Ut(),c=i.length;c<o.length;c+=1)s(c);Gt()}u===(u=a(f,p))&&l?l.p(f,p):(l&&l.d(1),l=u&&u(f),l&&(l.c(),l.m(r,null)))},i(f){if(!n){for(let p=0;p<i.length;p+=1)ee(o[p]);n=!0}},o(f){o=o.filter(Boolean);for(let p=0;p<o.length;p+=1)ne(o[p]);n=!1},d(f){Bn(o,f),f&&H(e),f&&H(r),l&&l.d()}}}function yb(t){let e,r,n,i,o,s,a,u,l,f,p,c,h,w,x,v,d,b,m,g,y,_,j,A,F,E,O,L,k,z,J,Y,q,C,S,I,N,X,P,re,Ke,we,me,ze,Uf={initialValue:t[1],placeholder:"Omnisearch - Vault",$$slots:{default:[pb]},$$scope:{ctx:t}};e=new bi({props:Uf}),t[16](e),e.$on("input",t[17]);let Ve=t[3]&&If(t);return i=new xi({props:{$$slots:{default:[gb]},$$scope:{ctx:t}}}),{c(){$e(e.$$.fragment),r=W(),Ve&&Ve.c(),n=W(),$e(i.$$.fragment),o=W(),s=M("div"),a=M("div"),a.innerHTML='<span class="prompt-instruction-command">\u2191\u2193</span><span>to navigate</span>',u=W(),l=M("div"),l.innerHTML=`<span class="prompt-instruction-command">alt \u2191\u2193</span>
|
<span>to insert a link</span>`,Wr=ue(),cr=V("div"),cr.innerHTML=`<span class="prompt-instruction-command">ctrl g</span>
|
||||||
<span>to cycle history</span>`,f=W(),p=M("div"),c=M("span"),h=Ce(t[7]),w=W(),x=M("span"),x.textContent="to open",v=W(),d=M("div"),d.innerHTML=`<span class="prompt-instruction-command">tab</span>
|
<span>to toggle excerpts</span>`,Zn=ue(),Pi=V("div"),Pi.innerHTML='<span class="prompt-instruction-command">esc</span><span>to close</span>',Z(u,"class","prompt-instruction"),Z(c,"class","prompt-instruction"),Z(f,"class","prompt-instruction-command"),Z(d,"class","prompt-instruction"),Z(m,"class","prompt-instruction"),Z(T,"class","prompt-instruction-command"),Z(I,"class","prompt-instruction"),Z(q,"class","prompt-instruction-command"),Z(P,"class","prompt-instruction"),Z(he,"class","prompt-instruction"),Z(Ke,"class","prompt-instruction-command"),Z(Ie,"class","prompt-instruction"),Z(we,"class","prompt-instruction-command"),Z(de,"class","prompt-instruction"),Z($e,"class","prompt-instruction"),Z(cr,"class","prompt-instruction"),Z(Pi,"class","prompt-instruction"),Z(a,"class","prompt-instructions")},m(me,Ye){Dt(t,me,Ye),ae(me,r,Ye),Pt&&Pt.m(me,Ye),ae(me,n,Ye),Dt(i,me,Ye),ae(me,s,Ye),ae(me,a,Ye),j(a,u),j(a,o),j(a,c),j(a,h),j(a,d),j(d,f),j(f,g),j(d,y),j(d,b),j(a,D),j(a,m),j(a,v),j(a,I),j(I,T),j(T,E),j(I,C),j(I,S),j(a,N),j(a,P),j(P,q),j(P,$),j(P,ge),j(a,W),j(a,he),j(a,ke),j(a,Ie),j(Ie,Ke),j(Ke,R),j(Ie,F),j(Ie,H),j(a,te),j(a,de),j(de,we),j(we,tt),j(de,Kr),j(de,_t),j(a,X),j(a,$e),j(a,Wr),j(a,cr),j(a,Zn),j(a,Pi),pn=!0},p(me,Ye){let Du={};Ye[0]&1&&(Du.plugin=me[0]),Ye[0]&4&&(Du.initialValue=me[2]),Ye[0]&1|Ye[1]&4096&&(Du.$$scope={dirty:Ye,ctx:me}),t.$set(Du),me[4]?Pt?Pt.p(me,Ye):(Pt=K_(me),Pt.c(),Pt.m(n.parentNode,n)):Pt&&(Pt.d(1),Pt=null);let Gh={};Ye[0]&47|Ye[1]&4096&&(Gh.$$scope={dirty:Ye,ctx:me}),i.$set(Gh),(!pn||Ye[0]&256)&&xr(g,me[8]),(!pn||Ye[0]&128)&&xr(E,me[7]),(!pn||Ye[0]&1024)&&xr(R,me[10]),(!pn||Ye[0]&512)&&xr(tt,me[9])},i(me){pn||(Ee(t.$$.fragment,me),Ee(i.$$.fragment,me),pn=!0)},o(me){Oe(t.$$.fragment,me),Oe(i.$$.fragment,me),pn=!1},d(me){e[19](null),Tt(t,me),me&&se(r),Pt&&Pt.d(me),me&&se(n),Tt(i,me),me&&se(s),me&&se(a)}}}function ux(e,t,r){let n,i;xu(e,gn,X=>r(18,i=X));let{modal:s}=t,{previousQuery:a}=t,{plugin:u}=t,o=0,c=0,h,d=[],f,g="",y=!0,b,D,m,v,I,T=_n()+" alt \u21B5";ta(async()=>{ce.enable("vault"),ce.on("vault",_e.Enter,$),ce.on("vault",_e.OpenInBackground,ge),ce.on("vault",_e.CreateNote,R),ce.on("vault",_e.OpenInNewPane,W),ce.on("vault",_e.InsertLink,F),ce.on("vault",_e.Tab,H),ce.on("vault",_e.ArrowUp,()=>te(-1)),ce.on("vault",_e.ArrowDown,()=>te(1)),ce.on("vault",_e.PrevSearchHistory,E),ce.on("vault",_e.NextSearchHistory,C),ce.on("vault",_e.OpenInNewLeaf,he),await u.notesIndexer.refreshIndex(),await P()}),ra(()=>{ce.disable("vault")});async function E(){let X=(await u.cacheManager.getSearchHistory()).filter($e=>$e);++c>=X.length&&(c=0),r(2,h=X[c]),b?.setInputValue(h??"")}async function C(){let X=(await u.cacheManager.getSearchHistory()).filter($e=>$e);--c<0&&(c=X.length?X.length-1:0),r(2,h=X[c]),b?.setInputValue(h??"")}let S=null;async function N(){r(5,y=!0),S&&(S.cancel(),S=null),f=new ui(h,{ignoreDiacritics:u.settings.ignoreDiacritics,ignoreArabicDiacritics:u.settings.ignoreArabicDiacritics}),S=(0,q_.cancelable)(new Promise(X=>{X(u.searchEngine.getSuggestions(f))})),r(3,d=await S),r(1,o=0),await de(),r(5,y=!1)}let P=Ea(N,0);function q(X){!n||(X?.ctrlKey?W():$(),s.close())}function $(){!n||(Ie(n),s.close())}function ge(){!n||Ie(n,!0)}function W(){!n||(Ie(n,!0),s.close())}function he(){!n||(Ie(n,!0,!0),s.close())}function ke(){h&&u.cacheManager.addToSearchHistory(h)}function Ie(X,$e=!1,Wr=!1){ke();let cr=X.matches?.[0]?.offset??0;ju(u.app,X,cr,$e,Wr)}async function Ke(X){await R()}async function R(X){if(h){try{await I0(u.app,h,X?.newLeaf)}catch($e){new gr.Notice($e.message);return}s.close()}}function F(){if(!n)return;let X=u.app.vault.getMarkdownFiles().find(Pi=>Pi.path===n.path),$e=u.app.workspace.getActiveFile(),Wr=u.app.workspace.getActiveViewOfType(gr.MarkdownView);if(!Wr?.editor){new gr.Notice("Omnisearch - Error - No active editor",3e3);return}let cr;X&&$e?cr=u.app.fileManager.generateMarkdownLink(X,$e.path):cr=`[[${n.basename}.${En(n.path)}]]`;let Zn=Wr.editor.getCursor();Wr.editor.replaceRange(cr,Zn,Zn),Zn.ch+=cr.length,Wr.editor.setCursor(Zn),s.close()}function H(){if(!(n&&(bn(n?.path)||!n?.matches.length)))if(ke(),s.close(),n){let X=u.app.vault.getAbstractFileByPath(n.path);X&&X instanceof gr.TFile&&new us(u,X,h).open()}else{let X=u.app.workspace.getActiveViewOfType(gr.MarkdownView);X?.file&&new us(u,X.file,h).open()}}function te(X){r(1,o=ku(o+X,d.length)),de()}async function de(){await mn(),n&&activeWindow.document.querySelector(`[data-result-id="${n.path}"]`)?.scrollIntoView({behavior:"auto",block:"nearest"})}function we(X){Yr[X?"unshift":"push"](()=>{b=X,r(6,b)})}let tt=X=>r(2,h=X.detail),Kr=(X,$e)=>r(1,o=X),_t=X=>{X.button==1&&W()};return e.$$set=X=>{"modal"in X&&r(16,s=X.modal),"previousQuery"in X&&r(17,a=X.previousQuery),"plugin"in X&&r(0,u=X.plugin)},e.$$.update=()=>{if(e.$$.dirty[0]&131076){e:r(2,h=h??a)}if(e.$$.dirty[0]&4){e:h?P():(r(5,y=!1),r(3,d=[]))}if(e.$$.dirty[0]&10){e:n=d[o]}if(e.$$.dirty[0]&1){e:u.settings.openInNewPane?(r(7,D="\u21B5"),r(8,m=_n()+" \u21B5"),r(9,v="sLine truncated
|
||||||
<span>to switch to In-File Search</span>`,b=W(),m=M("div"),g=M("span"),y=Ce(t[6]),_=W(),j=M("span"),j.textContent="to open in a new pane",A=W(),F=M("div"),F.innerHTML=`<span class="prompt-instruction-command">alt o</span>
|
<span>to switch to Vault Search</span>`,d=ue(),f=V("div"),g=V("span"),g.textContent="esc",y=ue(),S.c(),b=ue(),D=V("div"),m=V("span"),m.textContent=`${_n()} \u21B5`,v=ue(),I=V("span"),I.textContent="to open in a new pane",Z(a,"class","prompt-instruction"),Z(o,"class","prompt-instruction"),Z(h,"class","prompt-instruction"),Z(g,"class","prompt-instruction-command"),Z(f,"class","prompt-instruction"),Z(m,"class","prompt-instruction-command"),Z(D,"class","prompt-instruction"),Z(s,"class","prompt-instructions")},m(N,P){Dt(t,N,P),ae(N,r,P),Dt(n,N,P),ae(N,i,P),ae(N,s,P),j(s,a),j(s,u),j(s,o),j(s,c),j(s,h),j(s,d),j(s,f),j(f,g),j(f,y),S.m(f,null),j(s,b),j(s,D),j(D,m),j(D,v),j(D,I),T=!0},p(N,[P]){let q={};P&1&&(q.plugin=N[0]),P&4&&(q.initialValue=N[2]),P&8388608&&(q.$$scope={dirty:P,ctx:N}),t.$set(q);let $={};P&8388721&&($.$$scope={dirty:P,ctx:N}),n.$set($),C!==(C=E(N,P))&&(S.d(1),S=C(N),S&&(S.c(),S.m(f,null)))},i(N){T||(Ee(t.$$.fragment,N),Ee(n.$$.fragment,N),T=!0)},o(N){Oe(t.$$.fragment,N),Oe(n.$$.fragment,N),T=!1},d(N){Tt(t,N),N&&se(r),Tt(n,N),N&&se(i),N&&se(s),S.d()}}}function bx(e,t,r){let n=e.find(i=>i.offset>t);return n?e.filter(i=>i.offset>t&&i.offset<=n.offset+r):[]}function Ex(e,t,r){let{plugin:n}=t,{modal:i}=t,{parent:s=null}=t,{singleFilePath:a=""}=t,{previousQuery:u}=t,o,c=[],h=0,d,f;ta(()=>{ce.enable("infile"),ce.on("infile",_e.Enter,m),ce.on("infile",_e.OpenInNewPane,D),ce.on("infile",_e.ArrowUp,()=>y(-1)),ce.on("infile",_e.ArrowDown,()=>y(1)),ce.on("infile",_e.Tab,v)}),ra(()=>{ce.disable("infile")});function g(S){let N=[],P=-1,q=0;for(;++q<100;){let $=bx(S,P,na);if(!$.length)break;P=$.last().offset,N.push($)}return N}function y(S){r(6,h=ku(h+S,c.length)),b()}async function b(){await mn(),document.querySelector(`[data-result-id="${h}"]`)?.scrollIntoView({behavior:"auto",block:"nearest"})}async function D(){return m(!0)}async function m(S=!1){if(d){i.close(),s&&s.close();let N=n.textProcessor.stringsToRegex(d.foundWords);N.exec(d.content),await ju(n.app,d,N.lastIndex,S);let P=n.app.workspace.getActiveViewOfType(Ia.MarkdownView);if(!P)return;let q=c[h]??0,$=P.editor.offsetToPos(q);$.ch=0,P.editor.setCursor($),P.editor.scrollIntoView({from:{line:$.line-10,ch:0},to:{line:$.line+10,ch:0}})}}function v(){new Rn(n,o??u).open(),i.close()}let I=S=>r(3,o=S.detail),T=(S,N)=>r(6,h=S),E=S=>m(S.ctrlKey),C=S=>{S.button==1&&m(!0)};return e.$$set=S=>{"plugin"in S&&r(0,n=S.plugin),"modal"in S&&r(9,i=S.modal),"parent"in S&&r(1,s=S.parent),"singleFilePath"in S&&r(10,a=S.singleFilePath),"previousQuery"in S&&r(2,u=S.previousQuery)},e.$$.update=()=>{if(e.$$.dirty&4){e:r(3,o=u??"")}if(e.$$.dirty&3081){e:(async()=>{o&&(r(11,f=new ui(o,{ignoreDiacritics:n.settings.ignoreDiacritics})),r(4,d=(await n.searchEngine.getSuggestions(f,{singleFilePath:a}))[0]??null)),r(6,h=0),await b()})()}if(e.$$.dirty&2064){e:if(d){let S=g(d.matches),N=f.getExactTerms();N.length&&(S=S.filter(P=>N.every(q=>P.some($=>$.match.includes(q))))),r(5,c=S.map(P=>Math.round(P.first().offset)))}}},[n,s,u,o,d,c,h,m,v,i,a,f,I,T,E,C]}var Ia,iT,sT,aT=x(()=>{nr();ml();Or();Kt();Ru();Ia=Xe(require("obsidian"));gl();ya();tT();bo();ca();iT=class extends pt{constructor(t){super();bt(this,t,Ex,Tx,ot,{plugin:0,modal:9,parent:1,singleFilePath:10,previousQuery:2})}},sT=iT});var Ao,Jl,Rn,us,ya=x(()=>{Ao=Xe(require("obsidian"));Z_();aT();Or();Jl=class extends Ao.Modal{constructor(t){super(t.app);let r=t.settings;this.modalEl.replaceChildren(),this.modalEl.addClass("omnisearch-modal","prompt"),this.modalEl.removeClass("modal"),this.modalEl.tabIndex=-1,this.scope.register([],"ArrowDown",o=>{o.preventDefault(),ce.emit(_e.ArrowDown)}),this.scope.register([],"ArrowUp",o=>{o.preventDefault(),ce.emit(_e.ArrowUp)});for(let o of[{k:"J",dir:"down"},{k:"K",dir:"up"}])for(let c of["Ctrl","Mod"])this.scope.register([c],o.k,h=>{r.vimLikeNavigationShortcut&&ce.emit("arrow-"+o.dir)});for(let o of[{k:"N",dir:"down"},{k:"P",dir:"up"}])for(let c of["Ctrl","Mod"])this.scope.register([c],o.k,h=>{r.vimLikeNavigationShortcut&&ce.emit("arrow-"+o.dir)});let n,i,s,a,u=["Mod","Alt"];r.openInNewPane?(n=["Mod"],i=[],s=["Mod","Shift"],a=["Shift"]):(n=[],i=["Mod"],s=["Shift"],a=["Mod","Shift"]),this.scope.register(i,"Enter",o=>{o.preventDefault(),ce.emit(_e.OpenInNewPane)}),this.scope.register(u,"Enter",o=>{o.preventDefault(),ce.emit(_e.OpenInNewLeaf)}),this.scope.register(["Alt"],"Enter",o=>{o.preventDefault(),ce.emit(_e.InsertLink)}),this.scope.register(s,"Enter",o=>{o.preventDefault(),ce.emit(_e.CreateNote)}),this.scope.register(a,"Enter",o=>{o.preventDefault(),ce.emit(_e.CreateNote,{newLeaf:!0})}),this.scope.register(n,"Enter",o=>{cl()||(o.preventDefault(),ce.emit(_e.Enter))}),this.scope.register(["Ctrl"],"O",o=>{cl()||(o.preventDefault(),ce.emit(_e.OpenInBackground))}),this.scope.register([],"Tab",o=>{o.preventDefault(),ce.emit(_e.Tab)}),this.scope.register(["Alt"],"ArrowDown",o=>{o.preventDefault(),ce.emit(_e.NextSearchHistory)}),this.scope.register(["Alt"],"ArrowUp",o=>{o.preventDefault(),ce.emit(Line truncated
|
||||||
<span>to open in the background</span>`,E=W(),O=M("div"),L=M("span"),k=Ce(t[9]),z=W(),J=M("span"),J.textContent="to create",Y=W(),q=M("div"),C=M("span"),S=Ce(t[8]),I=W(),N=M("span"),N.textContent="to create in a new pane",X=W(),P=M("div"),P.innerHTML=`<span class="prompt-instruction-command">alt \u21B5</span>
|
`).map(i=>{let s=i.match(/^\s+/);if(s===null)return i;let[a]=s;return a.length>=n.length?i.slice(n.length):i}).join(`
|
||||||
<span>to insert a link</span>`,re=W(),Ke=M("div"),Ke.innerHTML=`<span class="prompt-instruction-command">ctrl h</span>
|
`)}var Es=class{options;rules;lexer;constructor(t){this.options=t||Re.defaults}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Zo(n,`
|
||||||
<span>to toggle excerpts</span>`,we=W(),me=M("div"),me.innerHTML='<span class="prompt-instruction-command">esc</span><span>to close</span>',B(a,"class","prompt-instruction"),B(l,"class","prompt-instruction"),B(c,"class","prompt-instruction-command"),B(p,"class","prompt-instruction"),B(d,"class","prompt-instruction"),B(g,"class","prompt-instruction-command"),B(m,"class","prompt-instruction"),B(F,"class","prompt-instruction"),B(L,"class","prompt-instruction-command"),B(O,"class","prompt-instruction"),B(C,"class","prompt-instruction-command"),B(q,"class","prompt-instruction"),B(P,"class","prompt-instruction"),B(Ke,"class","prompt-instruction"),B(me,"class","prompt-instruction"),B(s,"class","prompt-instructions")},m(Z,ve){Re(e,Z,ve),$(Z,r,ve),Ve&&Ve.m(Z,ve),$(Z,n,ve),Re(i,Z,ve),$(Z,o,ve),$(Z,s,ve),D(s,a),D(s,u),D(s,l),D(s,f),D(s,p),D(p,c),D(c,h),D(p,w),D(p,x),D(s,v),D(s,d),D(s,b),D(s,m),D(m,g),D(g,y),D(m,_),D(m,j),D(s,A),D(s,F),D(s,E),D(s,O),D(O,L),D(L,k),D(O,z),D(O,J),D(s,Y),D(s,q),D(q,C),D(C,S),D(q,I),D(q,N),D(s,X),D(s,P),D(s,re),D(s,Ke),D(s,we),D(s,me),ze=!0},p(Z,ve){let io={};ve[0]&2&&(io.initialValue=Z[1]),ve[1]&256&&(io.$$scope={dirty:ve,ctx:Z}),e.$set(io),Z[3]?Ve?Ve.p(Z,ve):(Ve=If(Z),Ve.c(),Ve.m(n.parentNode,n)):Ve&&(Ve.d(1),Ve=null);let Vs={};ve[0]&23|ve[1]&256&&(Vs.$$scope={dirty:ve,ctx:Z}),i.$set(Vs),(!ze||ve[0]&128)&&Ze(h,Z[7]),(!ze||ve[0]&64)&&Ze(y,Z[6]),(!ze||ve[0]&512)&&Ze(k,Z[9]),(!ze||ve[0]&256)&&Ze(S,Z[8])},i(Z){ze||(ee(e.$$.fragment,Z),ee(i.$$.fragment,Z),ze=!0)},o(Z){ne(e.$$.fragment,Z),ne(i.$$.fragment,Z),ze=!1},d(Z){t[16](null),Ie(e,Z),Z&&H(r),Ve&&Ve.d(Z),Z&&H(n),Ie(i,Z),Z&&H(o),Z&&H(s)}}}var Pf=t=>t.length<3;function _b(t,e,r){let n,i;Ln(t,Ot,P=>r(15,i=P));let{modal:o}=e,{previousQuery:s}=e,a=0,u=0,l,f=[],p,c="",h=!0,w,x,v,d,b;rn(async()=>{U.enable("vault"),U.on("vault",te.Enter,A),U.on("vault",te.OpenInBackground,F),U.on("vault",te.CreateNote,z),U.on("vault",te.OpenInNewPane,E),U.on("vault",te.InsertLink,J),U.on("vault",te.Tab,Y),U.on("vault",te.ArrowUp,()=>q(-1)),U.on("vault",te.ArrowDown,()=>q(1)),U.on("vault",te.PrevSearchHistory,m),U.on("vault",te.NextSearchHistory,g),await eo(),T.showPreviousQueryResults&&r(13,s=(await Fe.getSearchHistory())[0])}),nn(()=>{U.disable("vault")});async function m(){let P=(await Fe.getSearchHistory()).filter(re=>re);++u>=P.length&&(u=0),r(1,l=P[u]),w?.setInputValue(l)}async function g(){let P=(await Fe.getSearchHistory()).filter(re=>re);--u<0&&(u=P.length?P.length-1:0),r(1,l=P[u]),w?.setInputValue(l)}let y=null;async function _(){y&&(y.cancel(),y=null),p=new ur(l),y=(0,Tf.cancelable)(new Promise(P=>{P(xe.getSuggestions(p))})),r(2,f=await y),r(0,a=0),await C()}function j(P){!n||(P?.ctrlKey?E():A(),o.close())}function A(){!n||(L(n),o.close())}function F(){!n||L(n,!0)}function E(){!n||(L(n,!0),o.close())}function O(){l&&Fe.addToSearchHistory(l)}function L(P,re=!1){O(),Qi(P,re)}async function k(P){await z()}async function z(P){if(l){try{await ef(l,P?.newLeaf)}catch(re){new $t.Notice(re.message);return}o.close()}}function J(){if(!n)return;let P=app.vault.getMarkdownFiles().find(ze=>ze.path===n.path),re=app.workspace.getActiveFile(),Ke=app.workspace.getActiveViewOfType($t.MarkdownView);if(!Ke?.editor){new $t.Notice("Omnisearch - Error - No active editor",3e3);return}let we;P&&re?we=app.fileManager.generateMarkdownLink(P,re.path):we=`[[${n.basename}.${or(n.path)}]]`;let me=Ke.editor.getCursor();Ke.editor.replaceRange(we,me,me),me.ch+=we.length,Ke.editor.setCursor(me),o.close()}function Y(){if(!(n&&(ir(n?.path)||!n?.matches.length)))if(O(),o.close(),n){let P=app.vault.getAbstractFileByPath(n.path);P&&P instanceof $t.TFile&&new Xr(app,P,l).open()}else{let P=app.workspace.getActiveViewOfType($t.MarkdownView);P&&new Xr(app,P.file,l).open()}}function q(P){r(0,a=yi(a+P,f.length)),C()}async function C(){await jt(),n&&activeWindow.document.querySelector(`[data-result-id="${n.path}"]`)?.scrollIntoView({behavior:"auto",block:"nearest"})}function S(P){lt[P?"unshift":"push"](()=>{w=P,r(5,w)})}let I=P=>r(1,l=P.detail),N=(P,re)=>r(0,a=P),X=P=>{P.button==1&&E()};t.$$set=P=>{"modal"in P&&r(14,o=P.modal),"previousQuery"in P&&r(13,s=P.previousQuery)},t.$$.update=()=>{if(t.$$.dirty[0]&8194){e:r(1,l=l??s)}if(t.$$.dirty[0]&2){e:l?(r(4,h=!0),_().then(()=>{r(4,h=!1)})):(r(4,h=!1),r(2,f=[]))}if(t.$$.dirty[0]&5){e:n=f[a]}if(t.$$.dirty[0]&32768){e:switch(i){case Je.LoadingCache:r(3,c="Loading cache...");break;case Je.ReadingFiles:r(3,c="Reading files...");break;case Je.IndexingFiles:r(3,c="Indexing files...");break;case Je.WritingCache:_(),r(3,c="Updating cache...");break;default:_(),r(3,c="");break}}};e:T.openInNewPane?(r(6,x="\u21B5"),r(7,v=nr()+" \u21B5"),r(8,d="shift \u21B5"),r(9,b=nr()+" shift \u21B5")):(r(6,x=nr()+" \u21B5"),r(7,v="\u21B5"),r(8,d=nr()+" shift \u21B5"),r(9,b="shift \u21B5"));return[a,l,f,c,h,w,x,v,d,b,j,E,k,s,o,i,S,I,N,X]}var Mf=class extends Te{constructor(e){super();Oe(this,e,_b,yb,Ae,{modal:14,previousQuery:13},null,[-1,-1])}},Rf=Mf;var Nf=je(require("obsidiLine truncated
|
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let n=r[0],i=o2(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){let i=Zo(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let n=r[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
||||||
<span>to switch to Vault Search</span>`,p=W(),c=M("div"),h=M("span"),h.textContent="esc",w=W(),j.c(),x=W(),v=M("div"),d=M("span"),d.textContent=`${nr()} \u21B5`,b=W(),m=M("span"),m.textContent="to open in a new pane",B(s,"class","prompt-instruction"),B(u,"class","prompt-instruction"),B(f,"class","prompt-instruction"),B(h,"class","prompt-instruction-command"),B(c,"class","prompt-instruction"),B(d,"class","prompt-instruction-command"),B(v,"class","prompt-instruction"),B(o,"class","prompt-instructions")},m(A,F){Re(e,A,F),$(A,r,F),Re(n,A,F),$(A,i,F),$(A,o,F),D(o,s),D(o,a),D(o,u),D(o,l),D(o,f),D(o,p),D(o,c),D(c,h),D(c,w),j.m(c,null),D(o,x),D(o,v),D(v,d),D(v,b),D(v,m),g=!0},p(A,[F]){let E={};F&2&&(E.initialValue=A[1]),e.$set(E);let O={};F&4194360&&(O.$$scope={dirty:F,ctx:A}),n.$set(O),_!==(_=y(A,F))&&(j.d(1),j=_(A),j&&(j.c(),j.m(c,null)))},i(A){g||(ee(e.$$.fragment,A),ee(n.$$.fragment,A),g=!0)},o(A){ne(e.$$.fragment,A),ne(n.$$.fragment,A),g=!1},d(A){Ie(e,A),A&&H(r),Ie(n,A),A&&H(i),A&&H(o),j.d()}}}function Eb(t,e,r){let n=t.find(i=>i.offset>e);return n?t.filter(i=>i.offset>e&&i.offset<=n.offset+r):[]}function Tb(t,e,r){let{modal:n}=e,{parent:i=null}=e,{singleFilePath:o=""}=e,{previousQuery:s}=e,a,u=[],l=0,f,p;rn(()=>{U.enable("infile"),U.on("infile",te.Enter,v),U.on("infile",te.OpenInNewPane,x),U.on("infile",te.ArrowUp,()=>h(-1)),U.on("infile",te.ArrowDown,()=>h(1)),U.on("infile",te.Tab,d)}),nn(()=>{U.disable("infile")});function c(_){let j=[],A=-1,F=0;for(;;){let E=Eb(_,A,Cn);if(!E.length||(A=E.last().offset,j.push(E),++F>100))break}return j}function h(_){r(5,l=yi(l+_,u.length)),w()}async function w(){await jt(),document.querySelector(`[data-result-id="${l}"]`)?.scrollIntoView({behavior:"auto",block:"nearest"})}async function x(){return v(!0)}async function v(_=!1){if(f){n.close(),i&&i.close(),await Qi(f,_);let j=app.workspace.getActiveViewOfType(Nf.MarkdownView);if(!j)return;let A=u[l]??0,F=j.editor.offsetToPos(A);F.ch=0,j.editor.setCursor(F),j.editor.scrollIntoView({from:{line:F.line-10,ch:0},to:{line:F.line+10,ch:0}})}}function d(){new cr(app,a??s).open(),n.close()}let b=_=>r(2,a=_.detail),m=(_,j)=>r(5,l=_),g=_=>v(_.ctrlKey),y=_=>{_.button==1&&v(!0)};return t.$$set=_=>{"modal"in _&&r(7,n=_.modal),"parent"in _&&r(0,i=_.parent),"singleFilePath"in _&&r(8,o=_.singleFilePath),"previousQuery"in _&&r(1,s=_.previousQuery)},t.$$.update=()=>{if(t.$$.dirty&2){e:r(2,a=s??"")}if(t.$$.dirty&772){e:(async()=>{a&&(r(9,p=new ur(a)),r(3,f=(await xe.getSuggestions(p,{singleFilePath:o}))[0]??null)),r(5,l=0),await w()})()}if(t.$$.dirty&8){e:if(f){let _=c(f.matches);r(4,u=_.map(j=>Math.round((j.first().offset+j.last().offset)/2)))}}},[i,s,a,f,u,l,v,n,o,p,b,m,g,y]}var Vf=class extends Te{constructor(e){super();Oe(this,e,Tb,Fb,Ae,{modal:7,parent:0,singleFilePath:8,previousQuery:1})}},Hf=Vf;var Ns=class extends ro.Modal{constructor(e){super(e);this.modalEl.replaceChildren(),this.modalEl.addClass("omnisearch-modal","prompt"),this.modalEl.removeClass("modal"),this.modalEl.tabIndex=-1,this.scope.register([],"ArrowDown",s=>{s.preventDefault(),U.emit(te.ArrowDown)}),this.scope.register([],"ArrowUp",s=>{s.preventDefault(),U.emit(te.ArrowUp)});for(let s of[{k:"J",dir:"down"},{k:"K",dir:"up"}])for(let a of["Ctrl","Mod"])this.scope.register([a],s.k,u=>{T.vimLikeNavigationShortcut&&U.emit("arrow-"+s.dir)});for(let s of[{k:"N",dir:"down"},{k:"P",dir:"up"}])for(let a of["Ctrl","Mod"])this.scope.register([a],s.k,u=>{T.vimLikeNavigationShortcut&&U.emit("arrow-"+s.dir)});let r,n,i,o;T.openInNewPane?(r=["Mod"],n=[],i=["Mod","Shift"],o=["Shift"]):(r=[],n=["Mod"],i=["Shift"],o=["Mod","Shift"]),this.scope.register(n,"Enter",s=>{s.preventDefault(),U.emit(te.OpenInNewPane)}),this.scope.register(["Alt"],"Enter",s=>{s.preventDefault(),U.emit(te.InsertLink)}),this.scope.register(i,"Enter",s=>{s.preventDefault(),U.emit(te.CreateNote)}),this.scope.register(o,"Enter",s=>{s.preventDefault(),U.emit(te.CreateNote,{newLeaf:!0})}),this.scope.register(r,"Enter",s=>{cs()||(s.preventDefault(),U.emit(te.Enter))}),this.scope.register(["Alt"],"O",s=>{cs()||(s.preventDefault(),U.emit(te.OpenInBackground))}),this.scope.register([],"Tab",s=>{s.preventDefault(),U.emit(te.Tab)}),this.scope.register(["Alt"],"ArrowDown",s=>{s.preventDefault(),U.emit(te.NextSearchHistory)}),this.scope.register(["Alt"],"ArrowUp",s=>{s.preventDefault(),U.emit(te.PrevSearchHistory)}),this.scope.register(["Ctrl"],"H",s=>{U.emit(hi.ToggleExcerpts)})}},cr=class extends Ns{constructor(e,r){super(e);let n=e.workspace.getActiveViewOfType(ro.MarkdownView)?.editor.getSelection(),i=new Rf({target:this.modalEl,props:{modal:this,previousQuery:n??r}});this.onClose=()=>{i.$destroy()}}},Xr=class extends Ns{constructor(e,r,n="",i){super(e);let o=new Hf({target:this.modalEl,props:{modal:this,singleFilePath:r.path,parent:i,previousQuery:n}});i&&i.containerEl.toggleVisibility(!1),this.onClose=()=>{i&&i.containerEl.toggleVisibility(!0),o.$destroy()}}};var $f=!1,no=[];function Db(t){return t.map(e=>{let{score:r,paLine truncated
|
$1`);n=Zo(n.replace(/^ *>[ \t]?/gm,""),`
|
||||||
|
`);let i=this.lexer.state.top;this.lexer.state.top=!0;let s=this.lexer.blockTokens(n);return this.lexer.state.top=i,{type:"blockquote",raw:r[0],tokens:s,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n=r[1].trim(),i=n.length>1,s={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let a=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),u="",o="",c=!1;for(;t;){let h=!1;if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;u=r[0],t=t.substring(u.length);let d=r[2].split(`
|
||||||
|
`,1)[0].replace(/^\t+/,m=>" ".repeat(3*m.length)),f=t.split(`
|
||||||
|
`,1)[0],g=0;this.options.pedantic?(g=2,o=d.trimStart()):(g=r[2].search(/[^ ]/),g=g>4?1:g,o=d.slice(g),g+=r[1].length);let y=!1;if(!d&&/^ *$/.test(f)&&(u+=f+`
|
||||||
|
`,t=t.substring(f.length+1),h=!0),!h){let m=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),v=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),I=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),T=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;t;){let E=t.split(`
|
||||||
|
`,1)[0];if(f=E,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),I.test(f)||T.test(f)||m.test(f)||v.test(t))break;if(f.search(/[^ ]/)>=g||!f.trim())o+=`
|
||||||
|
`+f.slice(g);else{if(y||d.search(/[^ ]/)>=4||I.test(d)||T.test(d)||v.test(d))break;o+=`
|
||||||
|
`+f}!y&&!f.trim()&&(y=!0),u+=E+`
|
||||||
|
`,t=t.substring(E.length+1),d=f.slice(g)}}s.loose||(c?s.loose=!0:/\n *\n *$/.test(u)&&(c=!0));let b=null,D;this.options.gfm&&(b=/^\[[ xX]\] /.exec(o),b&&(D=b[0]!=="[ ] ",o=o.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:u,task:!!b,checked:D,loose:!1,text:o,tokens:[]}),s.raw+=u}s.items[s.items.length-1].raw=u.trimEnd(),s.items[s.items.length-1].text=o.trimEnd(),s.raw=s.raw.trimEnd();for(let h=0;h<s.items.length;h++)if(this.lexer.state.top=!1,s.items[h].tokens=this.lexer.blockTokens(s.items[h].text,[]),!s.loose){let d=s.items[h].tokens.filter(g=>g.type==="space"),f=d.length>0&&d.some(g=>/\n.*\n/.test(g.raw));s.loose=f}if(s.loose)for(let h=0;h<s.items.length;h++)s.items[h].loose=!0;return s}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let n=r[1].toLowerCase().replace(/\s+/g," "),i=r[2]?r[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:s}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!/[:|]/.test(r[2]))return;let n=Eb(r[1]),i=r[2].replace(/^\||\| *$/g,"").split("|"),s=r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(`
|
||||||
|
`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)/^ *-+: *$/.test(u)?a.align.push("right"):/^ *:-+: *$/.test(u)?a.align.push("center"):/^ *:-+ *$/.test(u)?a.align.push("left"):a.align.push(null);for(let u of n)a.header.push({text:u,tokens:this.lexer.inline(u)});for(let u of s)a.rows.push(Eb(u,a.header.length).map(o=>({text:o,tokens:this.lexer.inline(o)})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let n=r[1].charAt(r[1].length-1)===`
|
||||||
|
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:$t(r[1])}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&/^<a /i.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let n=r[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let a=Zo(n.slice(0,-1),"\\");if((n.length-a.length)%2==0)return}else{let a=u2(r[2],"()");if(a>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],s="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a&&(i=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),Ab(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(/\s+/g," "),s=r[i.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Ab(n,s,n[0],this.lexer)}}emStrong(t,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let a=[...i[0]].length-1,u,o,c=a,h=0,d=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+a);(i=d.exec(r))!=null;){if(u=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!u)continue;if(o=[...u].length,i[3]||i[4]){c+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){h+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+h);let f=[...i[0]][0].length,g=t.slice(0,a+i.index+f+o);if(Math.min(a,o)%2){let b=g.slice(1,-1);return{type:"em",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," "),i=/[^ ]/.test(n),s=/^ /.test(n)&&/ $/.test(n);return i&&s&&(n=n.substring(1,n.length-1)),n=$t(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let n,i;return r[2]==="@"?(n=$t(r[1]),i="mailto:"+n):(n=$t(r[1]),i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let n,i;if(r[2]==="@")n=$t(r[0]),i="mailto:"+n;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);n=$t(r[0]),r[1]==="www."?i="http://"+r[0]:i=r[0]}return{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let n;return this.lexer.state.inRawBlock?n=r[0]:n=$t(r[0]),{type:"text",raw:r[0],text:n}}}},c2=/^(?: *(?:\n|$))+/,l2=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,f2=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Va=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,d2=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yb=/(?:[*+-]|\d{1,9}[.)])/,Ib=Se(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,yb).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ad=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,h2=/^[^\n]+/,ud=/(?!\s*\])(?:\\.|[^\[\]\\])+/,p2=Se(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",ud).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),m2=Se(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yb).getRegex(),Jo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|headLine truncated
|
||||||
|
]`).replace("lheading",Ib).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),Db=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,E2=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Sb=/^( {2,}|\\)\n(?!\s*$)/,A2=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ka="\\p{P}\\p{S}",y2=Se(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Ka).getRegex(),I2=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,v2=Se(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Ka).getRegex(),C2=Se("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Ka).getRegex(),D2=Se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Ka).getRegex(),S2=Se(/\\([punct])/,"gu").replace(/punct/g,Ka).getRegex(),x2=Se(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),O2=Se(od).replace("(?:-->|$)","-->").getRegex(),N2=Se("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",O2).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ec=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,w2=Se(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ec).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xb=Se(/^!?\[(label)\]\[(ref)\]/).replace("label",ec).replace("ref",ud).getRegex(),Ob=Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",ud).getRegex(),R2=Se("reflink|nolink(?!\\()","g").replace("reflink",xb).replace("nolink",Ob).getRegex(),ld={_backpedal:za,anyPunctuation:S2,autolink:x2,blockSkip:I2,br:Sb,code:E2,del:za,emStrongLDelim:v2,emStrongRDelimAst:C2,emStrongRDelimUnd:D2,escape:Db,link:w2,nolink:Ob,punctuation:y2,reflink:xb,reflinkSearch:R2,tag:N2,text:A2,url:za},P2=Fe(J({},ld),{link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",ec).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ec).getRegex()}),fd=Fe(J({},ld),{escape:Se(Db).replace("])","~|])").getRegex(),url:Se(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),L2=Fe(J({},fd),{br:Se(Sb).replace("{2,}","*").getRegex(),text:Se(fd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),tc={normal:cd,gfm:T2,pedantic:b2},Wa={normal:ld,gfm:fd,breaks:L2,pedantic:P2},ar=class{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Re.defaults,this.options.tokenizer=this.options.tokenizer||new Es,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={block:tc.normal,inline:Wa.normal};this.options.pedantic?(r.block=tc.pedantic,r.inline=Wa.pedantic):this.options.gfm&&(r.block=tc.gfm,this.options.breaks?r.inline=Wa.breaks:r.inline=Wa.gfm),this.tokenizer.rules=r}static get rules(){return{block:tc,inline:Wa}}static lex(t,r){return new ar(r).lex(t)}static lexInline(t,r){return new ar(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
||||||
|
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(u,o,c)=>o+" ".repeat(c.length));let n,i,s,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=`
|
||||||
|
`:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
||||||
|
`+n.raw,i.text+=`
|
||||||
|
`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
||||||
|
`+n.raw,i.text+=`
|
||||||
|
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(s=t,this.options.extensions&&this.options.extensions.startBlock){let u=1/0,o=t.slice(1),c;this.options.extensions.startBlock.forEach(h=>{c=h.call({lexer:this},o),typeof c=="number"&&c>=0&&(u=Math.min(u,c))}),u<1/0&&u>=0&&(s=t.substring(0,u+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){i=r[r.length-1],a&&i.type==="paragraph"?(i.raw+=`
|
||||||
|
`+n.raw,i.text+=`
|
||||||
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):r.push(n),a=s.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&i.type==="text"?(i.raw+=`
|
||||||
|
`+n.raw,i.text+=`
|
||||||
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):r.push(n);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,i,s,a=t,u,o,c;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(u=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)h.includes(u[0].slice(u[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,u.index)+"["+"a".repeat(u[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(u=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,u.index)+"["+"a".repeat(u[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(u=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,u.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(o||(c=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(n=h.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),i=r[r.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),i=r[r.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,a,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),r.push(n);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let h=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(g=>{f=g.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(s=t.substring(0,h+1))}if(n=this.tokenizer.inlineText(s)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),o=!0,i=r[r.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):r.push(n);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},As=class{options;constructor(t){this.options=t||Re.defaults}code(t,r,n){let i=(r||"").match(/^\S*/)?.[0];return t=t.replace(/\n$/,"")+`
|
||||||
|
`,i?'<pre><code class="language-'+$t(i)+'">'+(n?t:$t(t,!0))+`</code></pre>
|
||||||
|
`:"<pre><code>"+(n?t:$t(t,!0))+`</code></pre>
|
||||||
|
`}blockquote(t){return`<blockquote>
|
||||||
|
${t}</blockquote>
|
||||||
|
`}html(t,r){return t}heading(t,r,n){return`<h${r}>${t}</h${r}>
|
||||||
|
`}hr(){return`<hr>
|
||||||
|
`}list(t,r,n){let i=r?"ol":"ul",s=r&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
|
||||||
|
`+t+"</"+i+`>
|
||||||
|
`}listitem(t,r,n){return`<li>${t}</li>
|
||||||
|
`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>
|
||||||
|
`}table(t,r){return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
||||||
|
<thead>
|
||||||
|
`+t+`</thead>
|
||||||
|
`+r+`</table>
|
||||||
|
`}tablerow(t){return`<tr>
|
||||||
|
${t}</tr>
|
||||||
|
`}tablecell(t,r){let n=r.header?"th":"td";return(r.align?`<${n} align="${r.align}">`:`<${n}>`)+t+`</${n}>
|
||||||
|
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,r,n){let i=bb(t);if(i===null)return n;t=i;let s='<a href="'+t+'"';return r&&(s+=' title="'+r+'"'),s+=">"+n+"</a>",s}image(t,r,n){let i=bb(t);if(i===null)return n;t=i;let s=`<img src="${t}" alt="${n}"`;return r&&(s+=` title="${r}"`),s+=">",s}text(t){return t}},Ya=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}},ur=class{options;renderer;textRenderer;constructor(t){this.options=t||Re.defaults,this.options.renderer=this.options.renderer||new As,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ya}static parse(t,r){return new ur(r).parse(t)}static parseInline(t,r){return new ur(r).parseInline(t)}parse(t,r=!0){let n="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let a=s,u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=u||"";continue}}switch(s.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{let a=s;n+=this.renderer.heading(this.parseInline(a.tokens),a.depth,s2(this.parseInline(a.tokens,this.textRenderer)));continue}case"code":{let a=s;n+=this.renderer.code(a.text,a.lang,!!a.escaped);continue}case"table":{let a=s,u="",o="";for(let h=0;h<a.header.length;h++)o+=this.renderer.tablecell(this.parseInline(a.header[h].tokens),{header:!0,align:a.align[h]});u+=this.renderer.tablerow(o);let c="";for(let h=0;h<a.rows.length;h++){let d=a.rows[h];o="";for(let f=0;f<d.length;f++)o+=this.renderer.tablecell(this.parseInline(d[f].tokens),{header:!1,align:a.align[f]});c+=this.renderer.tablerow(o)}n+=this.renderer.table(u,c);continue}case"blockquote":{let a=s,u=this.parse(a.tokens);n+=this.renderer.blockquote(u);continue}case"list":{let a=s,u=a.ordered,o=a.start,c=a.loose,h="";for(let d=0;d<a.items.length;d++){let f=a.items[d],g=f.checked,y=f.task,b="";if(f.task){let D=this.renderer.checkbox(!!g);c?f.tokens.length>0&&f.tokens[0].type==="paragraph"?(f.tokens[0].text=D+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&f.tokens[0].tokens[0].type==="text"&&(f.tokens[0].tokens[0].text=D+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:D+" "}):b+=D+" "}b+=this.parse(f.tokens,c),h+=this.renderer.listitem(b,y,!!g)}n+=this.renderer.list(h,u,o);continue}case"html":{let a=s;n+=this.renderer.html(a.text,a.block);continue}case"paragraph":{let a=s;n+=this.renderer.paragraph(this.parseInline(a.tokens));continue}case"text":{let a=s,u=a.tokens?this.parseInline(a.tokens):a.text;for(;i+1<t.length&&t[i+1].type==="text";)a=t[++i],u+=`
|
||||||
|
`+(a.tokens?this.parseInline(a.tokens):a.text);n+=r?this.renderer.paragraph(u):u;continue}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(t,r){r=r||this.renderer;let n="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=a||"";continue}}switch(s.type){case"escape":{let a=s;n+=r.text(a.text);break}case"html":{let a=s;n+=r.html(a.text);break}case"link":{let a=s;n+=r.link(a.href,a.title,this.parseInline(a.tokens,r));break}case"image":{let a=s;n+=r.image(a.href,a.title,a.text);break}case"strong":{let a=s;n+=r.strong(this.parseInline(a.tokens,r));break}case"em":{let a=s;n+=r.em(this.parseInline(a.tokens,r));break}case"codespan":{let a=s;n+=r.codespan(a.text);break}case"br":{n+=r.br();break}case"del":{let a=s;n+=r.del(this.parseInline(a.tokens,r));break}case"text":{let a=s;n+=r.text(a.text);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},mi=class{options;constructor(t){this.options=t||Re.defaults}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}};Wh(mi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var dd=class{defaults=Xo();options=this.setOptions;parse=this.#e(ar.lex,ur.parse);parseInline=this.#e(ar.lexInline,ur.parseInline);Parser=ur;Renderer=As;TextRenderer=Ya;Lexer=ar;Tokenizer=Es;Hooks=mi;constructor(...t){this.use(...t)}walkTokens(t,r){let n=[];for(let i of t)switch(n=n.concat(r.call(this,i)),i.type){case"table":{let s=i;for(let a of s.header)n=n.concat(this.walkTokens(a.tokens,r));for(let a of s.rows)for(let u of a)n=n.concat(this.walkTokens(u.tokens,r));break}case"list":{let s=i;n=n.concat(this.walkTokens(s.items,r));break}default:{let s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let u=s[a].flat(1/0);n=n.concat(this.walkTokens(u,r))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,r)))}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i=J({},n);if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...u){let o=s.renderer.apply(this,u);return o===!1&&(o=a.apply(this,u)),o}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),i.extensions=r),n.renderer){let s=this.defaults.renderer||new As(this.defaults);for(let a in n.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(a==="options")continue;let u=a,o=n.renderer[u],c=s[u];s[u]=(...h)=>{let d=o.apply(s,h);return d===!1&&(d=c.apply(s,h)),d||""}}i.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new Es(this.defaults);for(let a in n.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let u=a,o=n.tokenizer[u],c=s[u];s[u]=(...h)=>{let d=o.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}i.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new mi;for(let a in n.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(a==="options")continue;let u=a,o=n.hooks[u],c=s[u];mi.passThroughHooks.has(a)?s[u]=h=>{if(this.defaults.async)return Promise.resolve(o.call(s,h)).then(f=>c.call(s,f));let d=o.call(s,h);return c.call(s,d)}:s[u]=(...h)=>{let d=o.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}i.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(u){let o=[];return o.push(a.call(this,u)),s&&(o=o.concat(s.call(this,u))),o}}this.defaults=J(J({},this.defaults),i)}),this}setOptions(t){return this.defaults=J(J({},this.defaults),t),this}lexer(t,r){return ar.lex(t,r??this.defaults)}parser(t,r){return ur.parse(t,r??this.defaults)}#e(t,r){return(n,i)=>{let s=J({},i),a=J(J({},this.defaults),s);this.defaults.async===!0&&s.async===!1&&(a.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),a.async=!0);let u=this.#t(!!a.silent,!!a.async);if(typeof n=="undefined"||n===null)return u(new Error("marked(): input parameter
Line truncated
|
||||||
|
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+$t(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},gi=new dd;function Ce(e,t){return gi.parse(e,t)}Ce.options=Ce.setOptions=function(e){return gi.setOptions(e),Ce.defaults=gi.defaults,mb(Ce.defaults),Ce};Ce.getDefaults=Xo;Ce.defaults=Re.defaults;Ce.use=function(...e){return gi.use(...e),Ce.defaults=gi.defaults,mb(Ce.defaults),Ce};Ce.walkTokens=function(e,t){return gi.walkTokens(e,t)};Ce.parseInline=gi.parseInline;Ce.Parser=ur;Ce.parser=ur.parse;Ce.Renderer=As;Ce.TextRenderer=Ya;Ce.Lexer=ar;Ce.lexer=ar.lex;Ce.Tokenizer=Es;Ce.Hooks=mi;Ce.parse=Ce;var M2=Ce.options,k2=Ce.setOptions,F2=Ce.use,B2=Ce.walkTokens,j2=Ce.parseInline,H2=Ce,U2=ur.parse,G2=ar.lex;Re.Hooks=mi;Re.Lexer=ar;Re.Marked=dd;Re.Parser=ur;Re.Renderer=As;Re.TextRenderer=Ya;Re.Tokenizer=Es;Re.getDefaults=Xo;Re.lexer=G2;Re.marked=Ce;Re.options=M2;Re.parse=H2;Re.parseInline=j2;Re.parser=U2;Re.setOptions=k2;Re.use=F2;Re.walkTokens=B2});var Rb=U(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0})});var hd=U(_i=>{"use strict";var rc=_i&&_i.__assign||function(){return rc=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},rc.apply(this,arguments)};Object.defineProperty(_i,"__esModule",{value:!0});_i.flatten=void 0;var q2={xml:!1,decodeEntities:!0};_i.default=q2;var Pb={_useHtmlParser2:!0,xmlMode:!0};function z2(e){return(e==null?void 0:e.xml)?typeof e.xml=="boolean"?Pb:rc(rc({},Pb),e.xml):e??void 0}_i.flatten=z2});var ys=U(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.Doctype=He.CDATA=He.Tag=He.Style=He.Script=He.Comment=He.Directive=He.Text=He.Root=He.isTag=He.ElementType=void 0;var Xt;(function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"})(Xt=He.ElementType||(He.ElementType={}));function V2(e){return e.type===Xt.Tag||e.type===Xt.Script||e.type===Xt.Style}He.isTag=V2;He.Root=Xt.Root;He.Text=Xt.Text;He.Directive=Xt.Directive;He.Comment=Xt.Comment;He.Script=Xt.Script;He.Style=Xt.Style;He.Tag=Xt.Tag;He.CDATA=Xt.CDATA;He.Doctype=Xt.Doctype});var _d=U(le=>{"use strict";var jn=le&&le.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qa=le&&le.__assign||function(){return Qa=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Qa.apply(this,arguments)};Object.defineProperty(le,"__esModule",{value:!0});le.cloneNode=le.hasChildren=le.isDocument=le.isDirective=le.isComment=le.isText=le.isCDATA=le.isTag=le.Element=le.Document=le.CDATA=le.NodeWithChildren=le.ProcessingInstruction=le.Comment=le.Text=le.DataNode=le.Node=void 0;var kt=ys(),pd=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(t){this.parent=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(t){this.prev=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(t){this.next=t},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){return t===void 0&&(t=!1),md(this,t)},e}();le.Node=pd;var nc=function(e){jn(t,e);function t(r){var n=e.call(this)||this;return n.data=r,n}return Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!1,configurable:!0}),t}(pd);le.DataNode=nc;var Lb=function(e){jn(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=kt.ElementType.Text,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(nc);le.Text=Lb;var Mb=function(e){jn(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=kt.ElementType.Comment,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(nc);le.Comment=Mb;var kb=function(e){jn(t,e);function t(r,n){var i=e.call(this,n)||this;return i.name=r,i.type=kt.ElementType.Directive,i}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,c
Line truncated
|
||||||
|
`:lc(e.children):(0,Lr.isCDATA)(e)?lc(e.children):(0,Lr.isText)(e)?e.data:""}Ft.getText=lc;function wd(e){return Array.isArray(e)?e.map(wd).join(""):(0,Lr.hasChildren)(e)&&!(0,Lr.isComment)(e)?wd(e.children):(0,Lr.isText)(e)?e.data:""}Ft.textContent=wd;function Rd(e){return Array.isArray(e)?e.map(Rd).join(""):(0,Lr.hasChildren)(e)&&(e.type===RN.ElementType.Tag||(0,Lr.isCDATA)(e))?Rd(e.children):(0,Lr.isText)(e)?e.data:""}Ft.innerText=Rd});var TE=U(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.prevElementSibling=ft.nextElementSibling=ft.getName=ft.hasAttrib=ft.getAttributeValue=ft.getSiblings=ft.getParent=ft.getChildren=void 0;var Ld=yt();function gE(e){return(0,Ld.hasChildren)(e)?e.children:[]}ft.getChildren=gE;function _E(e){return e.parent||null}ft.getParent=_E;function LN(e){var t,r,n=_E(e);if(n!=null)return gE(n);for(var i=[e],s=e.prev,a=e.next;s!=null;)i.unshift(s),t=s,s=t.prev;for(;a!=null;)i.push(a),r=a,a=r.next;return i}ft.getSiblings=LN;function MN(e,t){var r;return(r=e.attribs)===null||r===void 0?void 0:r[t]}ft.getAttributeValue=MN;function kN(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}ft.hasAttrib=kN;function FN(e){return e.name}ft.getName=FN;function BN(e){for(var t,r=e.next;r!==null&&!(0,Ld.isTag)(r);)t=r,r=t.next;return r}ft.nextElementSibling=BN;function jN(e){for(var t,r=e.prev;r!==null&&!(0,Ld.isTag)(r);)t=r,r=t.prev;return r}ft.prevElementSibling=jN});var bE=U(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.prepend=Bt.prependChild=Bt.append=Bt.appendChild=Bt.replaceElement=Bt.removeElement=void 0;function Ja(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children,r=t.lastIndexOf(e);r>=0&&t.splice(r,1)}e.next=null,e.prev=null,e.parent=null}Bt.removeElement=Ja;function HN(e,t){var r=t.prev=e.prev;r&&(r.next=t);var n=t.next=e.next;n&&(n.prev=t);var i=t.parent=e.parent;if(i){var s=i.children;s[s.lastIndexOf(e)]=t,e.parent=null}}Bt.replaceElement=HN;function UN(e,t){if(Ja(t),t.next=null,t.parent=e,e.children.push(t)>1){var r=e.children[e.children.length-2];r.next=t,t.prev=r}else t.prev=null}Bt.appendChild=UN;function GN(e,t){Ja(t);var r=e.parent,n=e.next;if(t.next=n,t.prev=e,e.next=t,t.parent=r,n){if(n.prev=t,r){var i=r.children;i.splice(i.lastIndexOf(n),0,t)}}else r&&r.children.push(t)}Bt.append=GN;function qN(e,t){if(Ja(t),t.parent=e,t.prev=null,e.children.unshift(t)!==1){var r=e.children[1];r.prev=t,t.next=r}else t.next=null}Bt.prependChild=qN;function zN(e,t){Ja(t);var r=e.parent;if(r){var n=r.children;n.splice(n.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=r,t.prev=e.prev,t.next=e,e.prev=t}Bt.prepend=zN});var Md=U(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.findAll=jt.existsOne=jt.findOne=jt.findOneChild=jt.find=jt.filter=void 0;var fc=yt();function VN(e,t,r,n){return r===void 0&&(r=!0),n===void 0&&(n=1/0),EE(e,Array.isArray(t)?t:[t],r,n)}jt.filter=VN;function EE(e,t,r,n){for(var i=[],s=[t],a=[0];;){if(a[0]>=s[0].length){if(a.length===1)return i;s.shift(),a.shift();continue}var u=s[0][a[0]++];if(e(u)&&(i.push(u),--n<=0))return i;r&&(0,fc.hasChildren)(u)&&u.children.length>0&&(a.unshift(0),s.unshift(u.children))}}jt.find=EE;function KN(e,t){return t.find(e)}jt.findOneChild=KN;function AE(e,t,r){r===void 0&&(r=!0);for(var n=null,i=0;i<t.length&&!n;i++){var s=t[i];if((0,fc.isTag)(s))e(s)?n=s:r&&s.children.length>0&&(n=AE(e,s.children,!0));else continue}return n}jt.findOne=AE;function yE(e,t){return t.some(function(r){return(0,fc.isTag)(r)&&(e(r)||yE(e,r.children))})}jt.existsOne=yE;function WN(e,t){for(var r=[],n=[t],i=[0];;){if(i[0]>=n[0].length){if(n.length===1)return r;n.shift(),i.shift();continue}var s=n[0][i[0]++];!(0,fc.isTag)(s)||(e(s)&&r.push(s),s.children.length>0&&(i.unshift(0),n.unshift(s.children)))}}jt.findAll=WN});var kd=U(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.getElementsByTagType=or.getElementsByTagName=or.getElementById=or.getElements=or.testElement=void 0;var bi=yt(),dc=Md(),hc={tag_name:function(e){return typeof e=="function"?function(t){return(0,bi.isTag)(t)&&e(t.name)}:e==="*"?bi.isTag:function(t){return(0,bi.isTag)(t)&&t.name===e}},tag_type:function(e){return typeof e=="function"?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return typeof e=="function"?function(t){return(0,bi.isText)(t)&&e(t.data)}:function(t){return(0,bi.isText)(t)&&t.data===e}}};function IE(e,t){return typeof t=="function"?function(r){return(0,bi.isTag)(r)&&t(r.attribs[e])}:function(r){return(0,bi.isTag)(r)&&r.attribs[e]===t}}function YN(e,t){return function(r){return e(r)||t(r)}}function vE(e){var t=Object.keys(e).map(function(r){var n=e[r];return Object.prototype.hasOwnProperty.call(hc,r)?hc[r](n):IE(r,n)});return t.length===0?null:t.reduce(YN)}function QN(e,t){var r=vE(e);return r?r(t):!0}or.testElement=QN;function $N(e,t,r,n){n===void 0&&(n=1/0);var i=
Line truncated
|
||||||
|
:is(button, input, select, textarea, optgroup, option)[disabled],
|
||||||
|
optgroup[disabled] > option,
|
||||||
|
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
|
||||||
|
)`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}});var Dc=U(Nt=>{"use strict";var g1=Nt&&Nt.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},fw=Nt&&Nt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.subselects=Nt.getNextSiblings=Nt.ensureIsTag=Nt.PLACEHOLDER_ELEMENT=void 0;var Ir=fw(zn()),dw=qd();Nt.PLACEHOLDER_ELEMENT={};function _1(e,t){return e===Ir.default.falseFunc?Ir.default.falseFunc:function(r){return t.isTag(r)&&e(r)}}Nt.ensureIsTag=_1;function T1(e,t){var r=t.getSiblings(e);if(r.length<=1)return[];var n=r.indexOf(e);return n<0||n===r.length-1?[]:r.slice(n+1).filter(t.isTag)}Nt.getNextSiblings=T1;function Kd(e){return{xmlMode:!!e.xmlMode,lowerCaseAttributeNames:!!e.lowerCaseAttributeNames,lowerCaseTags:!!e.lowerCaseTags,quirksMode:!!e.quirksMode,cacheResults:!!e.cacheResults,pseudos:e.pseudos,adapter:e.adapter,equals:e.equals}}var Wd=function(e,t,r,n,i){var s=i(t,Kd(r),n);return s===Ir.default.trueFunc?e:s===Ir.default.falseFunc?Ir.default.falseFunc:function(a){return s(a)&&e(a)}};Nt.subselects={is:Wd,matches:Wd,where:Wd,not:function(e,t,r,n,i){var s=i(t,Kd(r),n);return s===Ir.default.falseFunc?e:s===Ir.default.trueFunc?Ir.default.falseFunc:function(a){return!s(a)&&e(a)}},has:function(e,t,r,n,i){var s=r.adapter,a=Kd(r);a.relativeSelector=!0;var u=t.some(function(f){return f.some(dw.isTraversal)})?[Nt.PLACEHOLDER_ELEMENT]:void 0,o=i(t,a,u);if(o===Ir.default.falseFunc)return Ir.default.falseFunc;var c=_1(o,s);if(u&&o!==Ir.default.trueFunc){var h=o.shouldTestNextSiblings,d=h===void 0?!1:h;return function(f){if(!e(f))return!1;u[0]=f;var g=s.getChildren(f),y=d?g1(g1([],g,!0),T1(f,s),!0):g;return s.existsOne(c,y)}}return function(f){return e(f)&&s.existsOne(c,s.getChildren(f))}}}});var $d=U(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.compilePseudoSelector=Fr.aliases=Fr.pseudos=Fr.filters=void 0;var hw=Ps(),Yd=h1();Object.defineProperty(Fr,"filters",{enumerable:!0,get:function(){return Yd.filters}});var iu=p1();Object.defineProperty(Fr,"pseudos",{enumerable:!0,get:function(){return iu.pseudos}});var b1=m1();Object.defineProperty(Fr,"aliases",{enumerable:!0,get:function(){return b1.aliases}});var Qd=Dc();function pw(e,t,r,n,i){var s,a=t.name,u=t.data;if(Array.isArray(u)){if(!(a in Qd.subselects))throw new Error("Unknown pseudo-class :".concat(a,"(").concat(u,")"));return Qd.subselects[a](e,u,r,n,i)}var o=(s=r.pseudos)===null||s===void 0?void 0:s[a],c=typeof o=="string"?o:b1.aliases[a];if(typeof c=="string"){if(u!=null)throw new Error("Pseudo ".concat(a," doesn't have any arguments"));var h=(0,hw.parse)(c);return Qd.subselects.is(e,h,r,n,i)}if(typeof o=="function")return(0,iu.verifyPseudoArgs)(o,a,u,1),function(f){return o(f,u)&&e(f)};if(a in Yd.filters)return Yd.filters[a](e,u,r,n);if(a in iu.pseudos){var d=iu.pseudos[a];return(0,iu.verifyPseudoArgs)(d,a,u,2),function(f){return d(f,r,u)&&e(f)}}throw new Error("Unknown pseudo-class :".concat(a))}Fr.compilePseudoSelector=pw});var E1=U(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.compileGeneralSelector=void 0;var mw=a1(),gw=$d(),vr=Ps();function Xd(e,t){var r=t.getParent(e);return r&&t.isTag(r)?r:null}function _w(e,t,r,n,i){var s=r.adapter,a=r.equals;switch(t.type){case vr.SelectorType.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case vr.SelectorType.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case vr.SelectorType.Attribute:{if(t.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return(!r.xmlMode||r.lowerCaseAttributeNames)&&(t.name=t.name.toLowerCase()),mw.attributeRules[t.action](e,t,r)}case vr.SelectorType.Pseudo:return(0,gw.compilePseudoSelector)(e,t,r,n,i);case vr.SelectorType.Tag:{if(t.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");var u=t.name;return(!r.xmlMode||r.lowerCaseTags)&&(u=u.toLowerCase()),function(h){return s.getName(h)===u&&e(h)}}case vr.SelectorType.Descendant:{if(r.cacheResults===!1||typeof WeakSet=="undefined")return function(h){for(var d=h;d=Xd(d,s);)if(e(d))return!0
Line truncated
|
||||||
|
`)}}):{name:s,value:a.replace($1,`\r
|
||||||
|
`)}}).toArray()}Us.serializeArray=KR});var Z1=U(Ur=>{"use strict";var WR=Ur&&Ur.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),YR=Ur&&Ur.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),cu=Ur&&Ur.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&WR(t,e,r);return YR(t,e),t};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.Cheerio=void 0;var QR=cu(GE()),$R=cu(j1()),XR=cu(V1()),ZR=cu(Y1()),JR=cu(X1()),lu=function(){function e(t,r,n){if(this.length=0,this.options=n,this._root=r,t){for(var i=0;i<t.length;i++)this[i]=t[i];this.length=t.length}}return e}();Ur.Cheerio=lu;lu.prototype.cheerio="[cheerio object]";lu.prototype.splice=Array.prototype.splice;lu.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator];Object.assign(lu.prototype,QR,$R,XR,ZR,JR)});var eA=U(Ut=>{"use strict";var eP=Ut&&Ut.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gs=Ut&&Ut.__assign||function(){return Gs=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Gs.apply(this,arguments)},tP=Ut&&Ut.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),rP=Ut&&Ut.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),J1=Ut&&Ut.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&tP(t,e,r);return rP(t,e),t};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.getLoad=void 0;var _h=J1(hd()),nP=J1(yi()),iP=Z1(),fu=vi();function sP(e,t){return function r(n,i,s){if(s===void 0&&(s=!0),n==null)throw new Error("cheerio.load() expects a string");var a=Gs(Gs({},_h.default),(0,_h.flatten)(i)),u=e(n,a,s,null),o=function(h){eP(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.prototype._make=function(f,g){var y=c(f,g);return y.prevObject=this,y},d.prototype._parse=function(f,g,y,b){return e(f,g,y,b)},d.prototype._render=function(f){return t(f,this.options)},d}(iP.Cheerio);function c(h,d,f,g){if(f===void 0&&(f=u),h&&(0,fu.isCheerio)(h))return h;var y=Gs(Gs({},a),(0,_h.flatten)(g)),b=typeof f=="string"?[e(f,y,!1,null)]:"length"in f?f:[f],D=(0,fu.isCheerio)(b)?b:new o(b,null,y);if(D._root=D,!h)return new o(void 0,D,y);var m=typeof h=="string"&&(0,fu.isHtml)(h)?e(h,y,!1,null).children:aP(h)?[h]:Array.isArray(h)?h:void 0,v=new o(m,D,y);if(m)return v;if(typeof h!="string")throw new Error("Unexpected type of selector");var I=h,T=d?typeof d=="string"?(0,fu.isHtml)(d)?new o([e(d,y,!1,null)],D,y):(I="".concat(d," ").concat(I),D):(0,fu.isCheerio)(d)?d:new o(Array.isArray(d)?d:[d],D,y):D;return T?T.find(I):v}return Object.assign(c,nP,{load:r,_root:u,_options:a,fn:o.prototype,prototype:o.prototype}),c}}Ut.getLoad=sP;function aP(e){return!!e.name||e.type==="root"||e.type==="text"||e.type==="comment"}});var Rc=U(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.isUndefinedCodePoint=at.isControlCodePoint=at.getSurrogatePairCodePoint=at.isSurrogatePair=at.isSurrogate=at.SEQUENCES=at.CODE_POINTS=at.REPLACEMENT_CHARACTER=void 0;var uP=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]);at.REPLACEMENT_CHARACTER="\uFFFD";var oP;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.NUMBER_SIGN=35]="NUMBER_SIGN",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="S
Line truncated
|
||||||
|
`).length),r.split(`
|
||||||
|
`).slice(t).filter(bT).map(n=>`
|
||||||
|
`+n).join("")):""}var Rx=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"],ET=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],cf=Rx.concat(ET),Px={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function fs(e,t){this._e=oi(),this.name=e,this.message=t}cs(fs).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+of(this._e,2))}},toString:function(){return this.name+": "+this.message}});function AT(e,t){return e+". Errors: "+Object.keys(t).map(r=>t[r].toString()).filter((r,n,i)=>i.indexOf(r)===n).join(`
|
||||||
|
`)}function vo(e,t,r,n){this._e=oi(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=AT(e,t)}cs(vo).from(fs);function Sa(e,t){this._e=oi(),this.name="BulkError",this.failures=Object.keys(t).map(r=>t[r]),this.failuresByPos=t,this.message=AT(e,t)}cs(Sa).from(fs);var lf=cf.reduce((e,t)=>(e[t]=t+"Error",e),{}),Lx=fs,ie=cf.reduce((e,t)=>{var r=t+"Error";function n(i,s){this._e=oi(),this.name=r,i?typeof i=="string"?(this.message=`${i}${s?`
|
||||||
|
`+s:""}`,this.inner=s||null):typeof i=="object"&&(this.message=`${i.name} ${i.message}`,this.inner=i):(this.message=Px[t]||r,this.inner=null)}return cs(n).from(Lx),e[t]=n,e},{});ie.Syntax=SyntaxError;ie.Type=TypeError;ie.Range=RangeError;var yT=ET.reduce((e,t)=>(e[t+"Error"]=ie[t],e),{});function Mx(e,t){if(!e||e instanceof fs||e instanceof TypeError||e instanceof SyntaxError||!e.name||!yT[e.name])return e;var r=new yT[e.name](t||e.message,e);return"stack"in e&&Zr(r,"stack",{get:function(){return this.inner.stack}}),r}var Co=cf.reduce((e,t)=>(["Syntax","Type","Range"].indexOf(t)===-1&&(e[t+"Error"]=ie[t]),e),{});Co.ModifyError=vo;Co.DexieError=fs;Co.BulkError=Sa;function Ne(){}function xa(e){return e}function kx(e,t){return e==null||e===xa?t:function(r){return t(e(r))}}function ci(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Fx(e,t){return e===Ne?t:function(){var r=e.apply(this,arguments);r!==void 0&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?ci(n,this.onsuccess):n),i&&(this.onerror=this.onerror?ci(i,this.onerror):i),s!==void 0?s:r}}function Bx(e,t){return e===Ne?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?ci(r,this.onsuccess):r),n&&(this.onerror=this.onerror?ci(n,this.onerror):n)}}function jx(e,t){return e===Ne?t:function(r){var n=e.apply(this,arguments);xt(r,n);var i=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?ci(i,this.onsuccess):i),s&&(this.onerror=this.onerror?ci(s,this.onerror):s),n===void 0?a===void 0?void 0:a:xt(n,a)}}function Hx(e,t){return e===Ne?t:function(){return t.apply(this,arguments)===!1?!1:e.apply(this,arguments)}}function ff(e,t){return e===Ne?t:function(){var r=e.apply(this,arguments);if(r&&typeof r.then=="function"){for(var n=this,i=arguments.length,s=new Array(i);i--;)s[i]=arguments[i];return r.then(function(){return t.apply(n,s)})}return t.apply(this,arguments)}}var Oa={},Ux=100,Gx=20,IT=100,[df,Do,hf]=typeof Promise=="undefined"?[]:(()=>{let e=Promise.resolve();if(typeof crypto=="undefined"||!crypto.subtle)return[e,va(e),e];let t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,va(t),e]})(),vT=Do&&Do.then,So=df&&df.constructor,pf=!!hf,mf=!1,qx=hf?()=>{hf.then(wo)}:je.setImmediate?setImmediate.bind(null,wo):je.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{wo(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(wo,0)},Na=function(e,t){wa.push([e,t]),xo&&(qx(),xo=!1)},gf=!0,xo=!0,li=[],Oo=[],_f=null,Tf=xa,ds={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:LT,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{LT(e[0],e[1])}catch{}})}},ne=ds,wa=[],fi=0,No=[];function Y(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Ne,this._lib=!1;var t=this._PSD=ne;if(Nr&&(this._stackHolder=oi(),this._prev=null,this._numPrev=0),typeof e!="function"){if(e!==Oa)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Ef(this,this._value);return}this._state=null,this._value=null,++t.ref,DT(this,e)}var bf={get:function(){var e=ne,t=Lo;function r(n,i){var s=!e.global&&(e!==ne||t!==Lo);let a=s&&!tn();var u=new Y((o,c)=>{Af(this,new CT(ko(n,e,s,a),ko(i,e,s,a),o,c,e))});return Nr&&OT(u,this),u}return r.prototype=Oa,r},set:function(e){Zr(this,"then",e&&e.prototype===Oa?bf:{get:function(){return e},set:bf.set})}};os(Y.prototype,{then:bf,_then:function(e,t){Af(this,new CT(null,null,e,t,ne))},catch:function(e){if(arguments.length===1)return this.then(null,e);var t=arguments[0],r=arguments[1];return typeof t=="function"?this.then(null,n=>n instanceof t?r(n):Ro(n)):this.then(null,n=>n&&n.name===t?r(n):Ro(n))},finally:function(e){return this.then(t=>(e(),t),t=>(e(),Ro(t)))},stack:{get:function(){if(this._stack)return this._stack;try{mf=!0;var e=xT(this,[],Gx),t=e.join(`
|
||||||
|
From previous: `);return this._state!==null&&(this._stack=t),t}finally{mf=!1}}},timeout:function(e,t){return e<1/0?new Y((r,n)=>{var i=setTimeout(()=>n(new ie.Timeout(t)),e);this.then(r,n).finally(clearTimeout.bind(null,i))}):this}});typeof Symbol!="undefined"&&Symbol.toStringTag&&Zr(Y.prototype,Symbol.toStringTag,"Dexie.Promise");ds.env=NT();function CT(e,t,r,n,i){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.resolve=r,this.reject=n,this.psd=i}os(Y,{all:function(){var e=en.apply(null,arguments).map(Mo);return new Y(function(t,r){e.length===0&&t([]);var n=e.length;e.forEach((i,s)=>Y.resolve(i).then(a=>{e[s]=a,--n||t(e)},r))})},resolve:e=>{if(e instanceof Y)return e;if(e&&typeof e.then=="function")return new Y((r,n)=>{e.then(r,n)});var t=new Y(Oa,!0,e);return OT(t,_f),t},reject:Ro,race:function(){var e=en.apply(null,arguments).map(Mo);return new Y((t,r)=>{e.map(n=>Y.resolve(n).then(t,r))})},PSD:{get:()=>ne,set:e=>ne=e},totalEchoes:{get:()=>Lo},newPSD:Ln,usePSD:ps,scheduler:{get:()=>Na,set:e=>{Na=e}},rejectionMapper:{get:()=>Tf,set:e=>{Tf=e}},follow:(e,t)=>new Y((r,n)=>Ln((i,s)=>{var a=ne;a.unhandleds=[],a.onunhandled=s,a.finalize=ci(function(){Vx(()=>{this.unhandleds.length===0?i():s(this.unhandleds[0])})},a.finalize),e()},t,r,n))});So&&(So.allSettled&&Zr(Y,"allSettled",function(){let e=en.apply(null,arguments).map(Mo);return new Y(t=>{e.length===0&&t([]);let r=e.length,n=new Array(r);e.forEach((i,s)=>Y.resolve(i).then(a=>n[s]={status:"fulfilled",value:a},a=>n[s]={status:"rejected",reason:a}).then(()=>--r||t(n)))})}),So.any&&typeof AggregateError!="undefined"&&Zr(Y,"any",function(){let e=en.apply(null,arguments).map(Mo);return new Y((t,r)=>{e.length===0&&r(new AggregateError([]));let n=e.length,i=new Array(n);e.forEach((s,a)=>Y.resolve(s).then(u=>t(u),u=>{i[a]=u,--n||r(new AggregateError(i))}))})}));function DT(e,t){try{t(r=>{if(e._state===null){if(r===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&Ra();r&&typeof r.then=="function"?DT(e,(i,s)=>{r instanceof Y?r._then(i,s):r.then(i,s)}):(e._state=!0,e._value=r,ST(e)),n&&Pa()}},Ef.bind(null,e))}catch(r){Ef(e,r)}}function Ef(e,t){if(Oo.push(t),e._state===null){var r=e._lib&&Ra();t=Tf(t),e._state=!1,e._value=t,Nr&&t!==null&&typeof t=="object"&&!t._promise&&Cx(()=>{var n=rf(t,"stack");t._promise=e,Zr(t,"stack",{get:()=>mf?n&&(n.get?n.get.apply(t):n.value):e.stack})}),Kx(e),ST(e),r&&Pa()}}function ST(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)Af(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),fi===0&&(++fi,Na(()=>{--fi==0&&yf()},[]))}function Af(e,t){if(e._state===null){e._listeners.push(t);return}var r=e._state?t.onFulfilled:t.onRejected;if(r===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++fi,Na(zx,[r,e,t])}function zx(e,t,r){try{_f=t;var n,i=t._value;t._state?n=e(i):(Oo.length&&(Oo=[]),n=e(i),Oo.indexOf(i)===-1&&Wx(t)),r.resolve(n)}catch(s){r.reject(s)}finally{_f=null,--fi==0&&yf(),--r.psd.ref||r.psd.finalize()}}function xT(e,t,r){if(t.length===r)return t;var n="";if(e._state===!1){var i=e._value,s,a;i!=null?(s=i.name||"Error",a=i.message||i,n=of(i,0)):(s=i,a=""),t.push(s+(a?": "+a:"")+n)}return Nr&&(n=of(e._stackHolder,2),n&&t.indexOf(n)===-1&&t.push(n),e._prev&&xT(e._prev,t,r)),t}function OT(e,t){var r=t?t._numPrev+1:0;r<Ux&&(e._prev=t,e._numPrev=r)}function wo(){Ra()&&Pa()}function Ra(){var e=gf;return gf=!1,xo=!1,e}function Pa(){var e,t,r;do for(;wa.length>0;)for(e=wa,wa=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}while(wa.length>0);gf=!0,xo=!0}function yf(){var e=li;li=[],e.forEach(n=>{n._PSD.onunhandled.call(null,n._value,n)});for(var t=No.slice(0),r=t.length;r;)t[--r]()}function Vx(e){function t(){e(),No.splice(No.indexOf(t),1)}No.push(t),++fi,Na(()=>{--fi==0&&yf()},[])}function Kx(e){li.some(t=>t._value===e._value)||li.push(e)}function Wx(e){for(var t=li.length;t;)if(li[--t]._value===e._value){li.splice(t,1);return}}function Ro(e){return new Y(Oa,!1,e)}function ze(e,t){var r=ne;return function(){var n=Ra(),i=ne;try{return Mn(r,!0),e.apply(this,arguments)}catch(s){t&&t(s)}finally{Mn(i,!1),n&&Pa()}}}var At={awaits:0,echoes:0,id:0},Yx=0,Po=[],If=0,Lo=0,Qx=0;function Ln(e,t,r,n){var i=ne,s=Object.create(i);s.parent=i,s.ref=0,s.global=!1,s.id=++Qx;var a=ds.env;s.env=pf?{Promise:Y,PromiseProp:{value:Y,configurable:!0,writable:!0},all:Y.all,race:Y.race,allSettled:Y.allSettled,any:Y.any,resolve:Y.resolve,reject:Y.reject,nthen:RT(a.nthen,s),gthen:RT(a.gthen,s)}:{},t&&xt(s,t),++i.ref,s.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=ps(s,e,r,n);return s.ref===0&&s.finalize(),u}function hs(){return At.id||(At.id=++Yx),++At.awaits,At.echoes+=IT,At.id}function tn(){return At.awaits?(--At.awaits==0&&(At.id=0),At.echoes=At.awaits*IT,!0):!1}(""+vT).indexOf("[native code]")===-1&&(hs=tn=Ne);function Mo(e){return At.echoes&&e&&e.constructor===So?(hs(),e.then(t=>(tn(),t),t=>(tn(),rt(t)))):e}function $x(e){++Lo,(!At.
Line truncated
|
||||||
|
`)}else if(ua(t))try{let h=JSON.parse(await r.vault.cachedRead(n)),d=[],f=g=>{for(let y in g)typeof g[y]=="object"?f(g[y]):y==="content"&&d.push(g[y])};f(h),i=d.join(`\r
|
||||||
|
`)}catch(h){console.error("Omnisearch: Error while parsing Dataloom file",t),console.error(h)}else Tn(t)&&(this.plugin.settings.imagesIndexing&&s?.canFileBeExtracted(t)||this.plugin.settings.aiImageIndexing&&a?.canBeAnalyzed(n))?(this.plugin.settings.imagesIndexing&&s?.canFileBeExtracted(t)&&(i=await s.extractText(n)),this.plugin.settings.aiImageIndexing&&a?.canBeAnalyzed(n)&&(i=await a.analyzeImage(n)+(i??""))):bn(t)&&this.plugin.settings.PDFIndexing&&s?.canFileBeExtracted(t)?i=await s.extractText(n):m0(t)&&this.plugin.settings.officeIndexing&&s?.canFileBeExtracted(t)?i=await s.extractText(n):this.plugin.notesIndexer.isFilenameIndexable(t)&&(i=n.path);i==null&&(console.warn(`Omnisearch: ${i} content for file`,n.path),i="");let u=r.metadataCache.getFileCache(n);if(u){let h=v0(this.plugin.app,n,u);for(let d of h.filter(f=>!this.documents.has(f))){let f=this.plugin.notesIndexer.generateIndexableNonexistingDocument(d,n.path)}if(u.frontmatter?.["excalidraw-plugin"]){let d=u.sections?.filter(f=>f.type==="comment")??[];for(let{start:f,end:g}of d.map(y=>y.position))i=i.substring(0,f.offset-1)+i.substring(g.offset)}}let o=u?.frontmatter?.[this.plugin.settings.displayTitle]??"",c=p0(u);return{basename:n.basename,displayTitle:o,content:i,cleanedContent:d0(Qr(i)),path:n.path,mtime:n.stat.mtime,tags:c,unmarkedTags:c.map(h=>h.replace("#","")),aliases:h0(u).join(""),headings1:u?Mu(u,1).join(" "):"",headings2:u?Mu(u,2).join(" "):"",headings3:u?Mu(u,3).join(" "):""}}};Kt();ca();Kt();var jh=class{constructor(t){this.plugin=t;this.notesToReindex=new Set}flagNoteForReindex(t){this.notesToReindex.add(t)}async refreshIndex(){for(let r of this.notesToReindex)ve("Updating file",r.path),await this.plugin.cacheManager.addToLiveCache(r.path);let t=[...this.notesToReindex].map(r=>r.path);t.length&&(this.plugin.searchEngine.removeFromPaths(t),await this.plugin.searchEngine.addFromPaths(t),this.notesToReindex.clear())}isFileIndexable(t){return this.isFilenameIndexable(t)||this.isContentIndexable(t)}isContentIndexable(t){let r=this.plugin.settings,n=!!this.plugin.getTextExtractor(),i=!!this.plugin.getAIImageAnalyzer(),s=n&&r.PDFIndexing,a=n&&r.imagesIndexing,u=i&&r.aiImageIndexing;return this.isFilePlaintext(t)||ri(t)||ua(t)||s&&bn(t)||a&&Tn(t)||u&&Tn(t)}isFilenameIndexable(t){return this.canIndexUnsupportedFiles()||this.isFilePlaintext(t)||ri(t)||ua(t)}canIndexUnsupportedFiles(){return this.plugin.settings.unsupportedFilesIndexing==="yes"||this.plugin.settings.unsupportedFilesIndexing==="default"&&!!this.plugin.app.vault.getConfig("showUnsupportedFiles")}generateIndexableNonexistingDocument(t,r){return t=Tl(t),{path:t+(t.endsWith(".md")?"":".md"),basename:t,displayTitle:"",mtime:0,content:"",cleanedContent:"",tags:[],unmarkedTags:[],aliases:"",headings1:"",headings2:"",headings3:"",doesNotExist:!0,parent:r}}isFilePlaintext(t){return[...this.plugin.settings.indexedFileTypes,"md"].some(r=>t.endsWith(`.${r}`))}};Or();Kt();var wy=Xe(require("obsidian"));Aa();var Hh=class{constructor(t){this.plugin=t}highlightText(t,r){let n=`suggestion-highlight omnisearch-highlight ${this.plugin.settings.highlight?"omnisearch-default-highlight":""}`;if(!r.length)return t;try{let i=new RegExp(r.map(u=>{let o=On(u.match);return`\\b${o}\\b${/[a-zA-Z]/.test(u.match)?"":`|${o}`}`}).join("|"),"giu"),s=u=>r.find(c=>u.match(new RegExp(`\\b${On(c.match)}\\b${/[a-zA-Z]/.test(c.match)?"":`|${On(c.match)}`}`,"giu")))?`<span class="${n}">${u}</span>`:u,a=t.replace(i,s);if(a===t){let u=new RegExp(r.map(o=>On(o.match)).join("|"),"giu");a=t.replace(u,s)}return a}catch(i){return console.error("Omnisearch - Error in highlightText()",i),t}}escapeHTML(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}stringsToRegex(t){if(!t.length)return/^$/g;t.sort((n,i)=>i.length-n.length);let r=`(${t.map(n=>`\\b${On(n)}\\b|${On(n)}`).join("|")})`;return new RegExp(`${r}`,"gui")}getMatches(t,r,n){let i=this.stringsToRegex(r),s=t;this.plugin.settings.ignoreDiacritics&&(t=Qr(t,this.plugin.settings.ignoreArabicDiacritics));let a=new Date().getTime(),u=null,o=[],c=0;for(;(u=i.exec(t))!==null;){if(++c>=100||new Date().getTime()-a>50){T0("Stopped getMatches at",c,"results");break}let h=u.index,d=h+u[0].length,f=s.substring(h,d).trim();f&&u.index>=0&&o.push({match:f,offset:u.index})}if(n&&(n.query.text.length>1||n.getExactTerms().length>0)){let h=t.indexOf(n.getBestStringForExcerpt());h>-1&&o.find(d=>d.offset===h)&&o.unshift({offset:h,match:n.getBestStringForExcerpt()})}return o}makeExcerpt(t,r){let n=this.plugin.settings;try{let i=r??-1,s=Math.max(0,i-u0),a=Math.min(t.length,i+na);if(i>-1?t=(s>0?"\u2026":"")+t.slice(s,a).trim()+(a<t.length-1?"\u2026":""):t=t.slice(0,na),n.renderLineReturnInExcerpts){let u=new RegExp(/(?:\r\n|\r|\n)/g);t=t.split(u).filter(c=>c).join(`
|
||||||
|
`);let o=t.lastIndexOf(`
|
||||||
|
`,i-s);o>0&&(t=t.slice(o))}return t=BM(t),n.renderLineReturnInExcerpts&&(t=t.trim().replaceAll(`
|
||||||
|
`,"<br>")),t}catch(i){return new wy.Notice("Omnisearch - Error while creating excerpt, see developer console"),console.error("Omnisearch - Error while creating excerpt"),console.error(i),""}}};function BM(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}var Uh=class extends Ri.Plugin{constructor(t,r){super(t,r);this.apiHttpServer=null;this.settings=go(this.app);this.database=new Wo(this);this.notesIndexer=new jh(this);this.textProcessor=new Hh(this);this.searchEngine=new Fh(this);this.cacheManager=new Bh(this)}async onload(){if(this.settings=await C_(this),this.addSettingTab(new Wl(this)),Ri.Platform.isMobile||Promise.resolve().then(()=>(ky(),My)).then(n=>this.apiHttpServer=n.getServer(this)),Yl(this.app)){console.log("Omnisearch - Plugin disabled");return}await HM(this.app),await this.database.clearOldDatabases(),lT(this);let t=this.settings;t.ribbonIcon&&this.addRibbonButton(),ce.disable("vault"),ce.disable("infile"),ce.on("global",Lu.ToggleExcerpts,()=>{ai.set(!t.showExcerpt)}),this.addCommand({id:"show-modal",name:"Vault search",callback:()=>{new Rn(this).open()}}),this.addCommand({id:"show-modal-infile",name:"In-file search",editorCallback:(n,i)=>{i.file&&new us(this,i.file).open()}});let r=this.searchEngine;this.app.workspace.onLayoutReady(async()=>{this.registerEvent(this.app.vault.on("create",n=>{this.notesIndexer.isFileIndexable(n.path)&&(ve("Indexing new file",n.path),r.addFromPaths([n.path]))})),this.registerEvent(this.app.vault.on("delete",n=>{ve("Removing file",n.path),this.cacheManager.removeFromLiveCache(n.path),r.removeFromPaths([n.path])})),this.registerEvent(this.app.vault.on("modify",async n=>{this.notesIndexer.isFileIndexable(n.path)&&this.notesIndexer.flagNoteForReindex(n)})),this.registerEvent(this.app.vault.on("rename",async(n,i)=>{this.notesIndexer.isFileIndexable(n.path)&&(ve("Renaming file",n.path),this.cacheManager.removeFromLiveCache(i),await this.cacheManager.addToLiveCache(n.path),r.removeFromPaths([i]),await r.addFromPaths([n.path]))})),this.refreshIndexCallback=this.notesIndexer.refreshIndex.bind(this.notesIndexer),addEventListener("blur",this.refreshIndexCallback),removeEventListener,await this.executeFirstLaunchTasks(),await this.populateIndex(),this.apiHttpServer&&t.httpApiEnabled&&this.apiHttpServer.listen(t.httpApiPort)})}async executeFirstLaunchTasks(){let t="1.21.0";this.settings.welcomeMessage=t,await this.saveData(this.settings)}async onunload(){delete globalThis.omnisearch,this.refreshIndexCallback&&removeEventListener("blur",this.refreshIndexCallback),await this.database.clearCache(),this.apiHttpServer.close()}addRibbonButton(){this.ribbonButton=this.addRibbonIcon("search","Omnisearch",t=>{new Rn(this).open()})}removeRibbonButton(){this.ribbonButton&&this.ribbonButton.parentNode?.removeChild(this.ribbonButton)}getChsSegmenter(){return this.app.plugins.plugins["cm-chs-patch"]}getTextExtractor(){return this.app.plugins?.plugins?.["text-extractor"]?.api}getAIImageAnalyzer(){return this.app.plugins?.plugins?.["ai-image-analyzer"]?.api}async populateIndex(){console.time("Omnisearch - Indexing total time"),gn.set(ir.ReadingFiles);let t=this.app.vault.getFiles().filter(i=>this.notesIndexer.isFileIndexable(i.path));console.log(`Omnisearch - ${t.length} files total`),console.log(`Omnisearch - Cache is ${Nn()?"enabled":"disabled"}`);let r=this.searchEngine;Nn()&&(console.time("Omnisearch - Loading index from cache"),gn.set(ir.LoadingCache),await r.loadCache()&&console.timeEnd("Omnisearch - Loading index from cache"));let n=r.getDiff(t.map(i=>({path:i.path,mtime:i.stat.mtime})));if(Nn()&&(n.toAdd.length&&console.log("Omnisearch - Total number of files to add/update: "+n.toAdd.length),n.toRemove.length&&console.log("Omnisearch - Total number of files to remove: "+n.toRemove.length)),n.toAdd.length>=1e3&&Nn()&&new Ri.Notice(`Omnisearch - ${n.toAdd.length} files need to be indexed. Obsidian may experience stutters and freezes during the process`,1e4),gn.set(ir.IndexingFiles),r.removeFromPaths(n.toRemove.map(i=>i.path)),await r.addFromPaths(n.toAdd.map(i=>i.path)),(n.toRemove.length||n.toAdd.length)&&Nn()){gn.set(ir.WritingCache);let i=this.settings.useCache;i&&!this.settings.DANGER_forceSaveCache&&(this.settings.useCache=!1,await pe(this)),await r.writeToCache(),i&&(this.settings.useCache=!0,await pe(this))}console.timeEnd("Omnisearch - Indexing total time"),n.toAdd.length>=1e3&&Nn()&&new Ri.Notice("Omnisearch - Your files have been indexed."),gn.set(ir.Done),oT()}};async function HM(e){let t=[`${e.vault.configDir}/plugins/omnisearch/searchIndex.json`,`${e.vault.configDir}/plugins/omnisearch/notesCache.json`,`${e.vault.configDir}/plugins/omnisearch/notesCache.data`,`${e.vault.configDir}/plugins/omnisearch/searchIndex.data`,`${e.vault.configDir}/plugins/omnisearch/historyCache.json`,`${e.vault.configDir}/plugins/omnisearch/pdfCache.data`];for(let r of t)if(await e.vault.adapter.exists(r))try{await
Line truncated
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "omnisearch",
|
"id": "omnisearch",
|
||||||
"name": "Omnisearch",
|
"name": "Omnisearch",
|
||||||
"version": "1.17.1",
|
"version": "1.24.1",
|
||||||
"minAppVersion": "1.3.0",
|
"minAppVersion": "1.3.0",
|
||||||
"description": "A search engine that just works",
|
"description": "A search engine that just works",
|
||||||
"author": "Simon Cambier",
|
"author": "Simon Cambier",
|
||||||
|
|||||||
+20
-3
@@ -25,7 +25,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.omnisearch-result__title > span {
|
.omnisearch-result__title > span {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.omnisearch-result__folder-path {
|
.omnisearch-result__folder-path {
|
||||||
@@ -57,12 +56,12 @@
|
|||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
|
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
margin-left: 0.5em;
|
margin-inline-start: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.omnisearch-result__image-container {
|
.omnisearch-result__image-container {
|
||||||
flex-basis: 20%;
|
flex-basis: 20%;
|
||||||
text-align: right
|
text-align: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.omnisearch-highlight {
|
.omnisearch-highlight {
|
||||||
@@ -78,6 +77,7 @@
|
|||||||
|
|
||||||
.omnisearch-input-container {
|
.omnisearch-input-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
}
|
}
|
||||||
@@ -86,6 +86,23 @@
|
|||||||
.omnisearch-input-container {
|
.omnisearch-input-container {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.omnisearch-input-container__buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 1em 0 1em;
|
||||||
|
gap: 1em;
|
||||||
|
}
|
||||||
|
.omnisearch-input-container__buttons > button {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width: 600px) {
|
||||||
|
.omnisearch-input-container__buttons {
|
||||||
|
margin-inline-end: 1em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.omnisearch-input-field {
|
.omnisearch-input-field {
|
||||||
|
|||||||
Vendored
+6
-5
@@ -93,7 +93,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "horizontal",
|
"direction": "horizontal",
|
||||||
"width": 200
|
"width": 262.5
|
||||||
},
|
},
|
||||||
"right": {
|
"right": {
|
||||||
"id": "ee8f6df41634f71e",
|
"id": "ee8f6df41634f71e",
|
||||||
@@ -178,15 +178,16 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "horizontal",
|
"direction": "horizontal",
|
||||||
"width": 211.5
|
"width": 371.5
|
||||||
},
|
},
|
||||||
"left-ribbon": {
|
"left-ribbon": {
|
||||||
"hiddenItems": {
|
"hiddenItems": {
|
||||||
"obsidian-full-calendar:Open Full Calendar": false,
|
|
||||||
"omnisearch:Omnisearch": false,
|
|
||||||
"graph:Open graph view": false,
|
"graph:Open graph view": false,
|
||||||
"command-palette:Open command palette": false,
|
"command-palette:Open command palette": false,
|
||||||
"switcher:Open quick switcher": false
|
"switcher:Open quick switcher": false,
|
||||||
|
"obsidian-full-calendar:Open Full Calendar": false,
|
||||||
|
"omnisearch:Omnisearch": false,
|
||||||
|
"obsidian-git:Open Git source control": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"active": "3ed058b7ba32ddc0",
|
"active": "3ed058b7ba32ddc0",
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,14 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=
|
||||||
|
comment0.target=int\ getPlayingTime()
|
||||||
|
comment0.text=\n\ Field\ Accessor\ Start\n
|
||||||
|
comment1.params=playingTime
|
||||||
|
comment1.target=void\ setPlayingTime(int)
|
||||||
|
comment1.text=\n\ Field\ Accessor\ End\n\ \n\ Field\ Mutator\ Start\n
|
||||||
|
comment2.params=
|
||||||
|
comment2.target=void\ printDetails()
|
||||||
|
comment2.text=\n\ Field\ Mutator\ End\n
|
||||||
|
comment3.params=detailScanner
|
||||||
|
comment3.target=void\ readItemData(java.util.Scanner)
|
||||||
|
comment3.text=\n\ Populate\ the\ fields\ with\ details\ from\ the\ scanner\n\ Takes\ Parameters\n\ \ Scanner\ @detailScanner\n
|
||||||
|
numComments=4
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* Subclass of LibraryItem to create objects of audio and visual items in a library.
|
||||||
|
*
|
||||||
|
* @George Wilkinson
|
||||||
|
* @1.2
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public abstract class AudioVisual extends LibraryItem
|
||||||
|
{
|
||||||
|
private int playingTime;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Field Accessor Start
|
||||||
|
*/
|
||||||
|
public int getPlayingTime()
|
||||||
|
{
|
||||||
|
return playingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Field Accessor End
|
||||||
|
*
|
||||||
|
* Field Mutator Start
|
||||||
|
*/
|
||||||
|
|
||||||
|
public void setPlayingTime( int playingTime )
|
||||||
|
{
|
||||||
|
this.playingTime = playingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Field Mutator End
|
||||||
|
*/
|
||||||
|
|
||||||
|
public void printDetails()
|
||||||
|
{
|
||||||
|
System.out.println( "Playing Time: " + playingTime );
|
||||||
|
super.printDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the fields with details from the scanner
|
||||||
|
* Takes Parameters
|
||||||
|
* Scanner @detailScanner
|
||||||
|
*/
|
||||||
|
public void readItemData( Scanner detailScanner ){
|
||||||
|
if ( detailScanner != null ) {
|
||||||
|
this.playingTime = Integer.parseInt( detailScanner.next().trim() );
|
||||||
|
super.readItemData( detailScanner );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=
|
||||||
|
comment0.target=Book()
|
||||||
|
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ Book\n\ Since\ all\ field\ variables\ initialise\ as\ null,\ nothing\ should\ happen\ here.\n
|
||||||
|
comment1.params=
|
||||||
|
comment1.target=java.lang.String\ getAuthor()
|
||||||
|
comment1.text=\n\ Return\ value\ of\ @author\n
|
||||||
|
comment2.params=
|
||||||
|
comment2.target=java.lang.String\ getIsbn()
|
||||||
|
comment2.text=\n\ Return\ value\ of\ @isbn.\n
|
||||||
|
comment3.params=author
|
||||||
|
comment3.target=void\ setAuthor(java.lang.String)
|
||||||
|
comment3.text=\n\ Set\ value\ of\ @author.\n
|
||||||
|
comment4.params=isbn
|
||||||
|
comment4.target=void\ setIsbn(java.lang.String)
|
||||||
|
comment4.text=\n\ Set\ value\ of\ @isbn\n
|
||||||
|
comment5.params=
|
||||||
|
comment5.target=void\ printDetails()
|
||||||
|
comment5.text=\n\ Print\ to\ terminal,\ relevant\ details\ of\ current\ object.\n
|
||||||
|
comment6.params=detailScanner
|
||||||
|
comment6.target=void\ readItemData(java.util.Scanner)
|
||||||
|
comment6.text=\n\ Populate\ the\ fields\ with\ details\ from\ the\ scanner\n\ Takes\ Parameters\n\ \ Scanner\ @detailScanner\n
|
||||||
|
numComments=7
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* Subclass of LibraryItem that emulates a Book item.
|
||||||
|
*
|
||||||
|
* @George Wilkinson
|
||||||
|
* @2.5
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
|
public class Book extends PrintedItem
|
||||||
|
{
|
||||||
|
private String author;
|
||||||
|
private String isbn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for objects of class Book
|
||||||
|
* Since all field variables initialise as null, nothing should happen here.
|
||||||
|
*/
|
||||||
|
public Book(){}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return value of @author
|
||||||
|
*/
|
||||||
|
public String getAuthor()
|
||||||
|
{
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return value of @isbn.
|
||||||
|
*/
|
||||||
|
public String getIsbn()
|
||||||
|
{
|
||||||
|
return isbn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set value of @author.
|
||||||
|
*/
|
||||||
|
public void setAuthor( String author )
|
||||||
|
{
|
||||||
|
this.author = author;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set value of @isbn
|
||||||
|
*/
|
||||||
|
public void setIsbn( String isbn )
|
||||||
|
{
|
||||||
|
this.isbn = isbn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print to terminal, relevant details of current object.
|
||||||
|
*/
|
||||||
|
public void printDetails() {
|
||||||
|
System.out.println( "ISBN: " + isbn +
|
||||||
|
"\nAuthor: " + author );
|
||||||
|
super.printDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the fields with details from the scanner
|
||||||
|
* Takes Parameters
|
||||||
|
* Scanner @detailScanner
|
||||||
|
*/
|
||||||
|
public void readItemData( Scanner detailScanner ){
|
||||||
|
if ( detailScanner != null ) {
|
||||||
|
this.author = detailScanner.next().trim();
|
||||||
|
this.isbn = detailScanner.next().trim();
|
||||||
|
super.readItemData( detailScanner );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=
|
||||||
|
comment0.target=CD()
|
||||||
|
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ CD\n\ Since\ all\ field\ variables\ initialise\ as\ null,\ nothing\ should\ happen\ here.\n
|
||||||
|
comment1.params=
|
||||||
|
comment1.target=java.lang.String\ getArtist()
|
||||||
|
comment1.text=\n\ Return\ value\ of\ @artist.\n
|
||||||
|
comment2.params=
|
||||||
|
comment2.target=int\ noOfTracks()
|
||||||
|
comment2.text=\n\ Return\ value\ of\ @noOfTracks\n
|
||||||
|
comment3.params=artist
|
||||||
|
comment3.target=void\ setArtist(java.lang.String)
|
||||||
|
comment3.text=\n\ Set\ value\ of\ @artist.\n
|
||||||
|
comment4.params=noOfTracks
|
||||||
|
comment4.target=void\ setNoOfTracks(int)
|
||||||
|
comment4.text=\n\ Set\ value\ of\ @noOfTracks.\n
|
||||||
|
comment5.params=
|
||||||
|
comment5.target=void\ printDetails()
|
||||||
|
comment5.text=\n\ Print\ to\ terminal,\ relevant\ details\ of\ current\ object.\n
|
||||||
|
comment6.params=detailScanner
|
||||||
|
comment6.target=void\ readItemData(java.util.Scanner)
|
||||||
|
comment6.text=\n\ Populate\ the\ fields\ with\ details\ from\ the\ scanner\n\ Takes\ Parameters\n\ \ Scanner\ @detailScanner\n
|
||||||
|
numComments=7
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* Subclass of AudioVisual, to create objects of a CD.
|
||||||
|
*
|
||||||
|
* @George Wilkinson
|
||||||
|
* @1.2
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class CD extends AudioVisual
|
||||||
|
{
|
||||||
|
private String artist;
|
||||||
|
private int noOfTracks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for objects of class CD
|
||||||
|
* Since all field variables initialise as null, nothing should happen here.
|
||||||
|
*/
|
||||||
|
public CD(){}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return value of @artist.
|
||||||
|
*/
|
||||||
|
public String getArtist()
|
||||||
|
{
|
||||||
|
return artist;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return value of @noOfTracks
|
||||||
|
*/
|
||||||
|
public int noOfTracks()
|
||||||
|
{
|
||||||
|
return noOfTracks;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set value of @artist.
|
||||||
|
*/
|
||||||
|
public void setArtist( String artist )
|
||||||
|
{
|
||||||
|
this.artist = artist;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set value of @noOfTracks.
|
||||||
|
*/
|
||||||
|
public void setNoOfTracks( int noOfTracks )
|
||||||
|
{
|
||||||
|
this.noOfTracks = noOfTracks;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print to terminal, relevant details of current object.
|
||||||
|
*/
|
||||||
|
public void printDetails() {
|
||||||
|
System.out.println( "Artist: " + artist +
|
||||||
|
"\nTrack Count: " + noOfTracks );
|
||||||
|
super.printDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the fields with details from the scanner
|
||||||
|
* Takes Parameters
|
||||||
|
* Scanner @detailScanner
|
||||||
|
*/
|
||||||
|
public void readItemData( Scanner detailScanner ){
|
||||||
|
if ( detailScanner != null ) {
|
||||||
|
this.artist = detailScanner.next().trim();
|
||||||
|
this.noOfTracks = Integer.parseInt( detailScanner.next().trim() );
|
||||||
|
super.readItemData( detailScanner );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,17 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=
|
||||||
|
comment0.target=DVD()
|
||||||
|
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ DVD\n\ Since\ all\ field\ variables\ initialise\ as\ null,\ nothing\ should\ happen\ here.\n
|
||||||
|
comment1.params=
|
||||||
|
comment1.target=java.lang.String\ getDirector()
|
||||||
|
comment1.text=\n\ Return\ value\ of\ @director.\n
|
||||||
|
comment2.params=director
|
||||||
|
comment2.target=void\ setDirector(java.lang.String)
|
||||||
|
comment2.text=\n\ Set\ value\ of\ @director.\n
|
||||||
|
comment3.params=
|
||||||
|
comment3.target=void\ printDetails()
|
||||||
|
comment3.text=\n\ Print\ relevant\ details\ of\ the\ current\ object.\n
|
||||||
|
comment4.params=detailScanner
|
||||||
|
comment4.target=void\ readItemData(java.util.Scanner)
|
||||||
|
comment4.text=\n\ Populate\ the\ fields\ with\ details\ from\ the\ scanner\n\ Takes\ Parameters\n\ \ Scanner\ @detailScanner\n
|
||||||
|
numComments=5
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* Subclass of AudioVisual to create objects of DVD items.
|
||||||
|
*
|
||||||
|
* @George Wilkinson
|
||||||
|
* @1.2
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class DVD extends AudioVisual
|
||||||
|
{
|
||||||
|
private String director;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for objects of class DVD
|
||||||
|
* Since all field variables initialise as null, nothing should happen here.
|
||||||
|
*/
|
||||||
|
public DVD(){}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return value of @director.
|
||||||
|
*/
|
||||||
|
public String getDirector()
|
||||||
|
{
|
||||||
|
return director;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set value of @director.
|
||||||
|
*/
|
||||||
|
public void setDirector( String director )
|
||||||
|
{
|
||||||
|
this.director = director;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print relevant details of the current object.
|
||||||
|
*/
|
||||||
|
public void printDetails() {
|
||||||
|
System.out.println( "Director: " + director );
|
||||||
|
super.printDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the fields with details from the scanner
|
||||||
|
* Takes Parameters
|
||||||
|
* Scanner @detailScanner
|
||||||
|
*/
|
||||||
|
public void readItemData( Scanner detailScanner ){
|
||||||
|
if ( detailScanner != null ) {
|
||||||
|
this.director = detailScanner.next().trim();
|
||||||
|
super.readItemData( detailScanner );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,26 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=date
|
||||||
|
comment0.target=java.lang.String\ convertDateToLongString(java.util.Date)
|
||||||
|
comment0.text=\n\ Converts\ a\ Date\ object\ to\ a\ corresponding\ String\ in\n\ the\ long\ date\ pattern\ style\ "Saturday,\ 25\ March\ 2023".\n\n\ @param\ \ \ \ \ date\ \ a\ Date\ object\n\n\ @return\ \ \ \ a\ String,\ containing\ a\ long\ date\ pattern\n
|
||||||
|
comment1.params=date
|
||||||
|
comment1.target=java.lang.String\ convertDateToShortString(java.util.Date)
|
||||||
|
comment1.text=\n\ Converts\ a\ Date\ object\ to\ a\ corresponding\ String\ in\n\ the\ short\ date\ pattern\ style\ "25-03-2023".\n\n\ @param\ \ \ \ \ date\ \ a\ Date\ object\n\n\ @return\ \ \ \ a\ String,\ containing\ a\ short\ date\ pattern\n
|
||||||
|
comment2.params=dateString
|
||||||
|
comment2.target=java.util.Date\ convertStringToDate(java.lang.String)
|
||||||
|
comment2.text=\n\ Converts\ a\ string\ in\ the\ short\ date\ pattern\ style\ "25-03-2023"\n\ to\ a\ corresponding\ Date\ object.\n\n\ Any\ leading\ or\ trailing\ spaces\ are\ first\ removed\ from\ the\ date\ string.\n\ The\ String\ parameter\ that\ represent\ a\ date\ as\ a\ string\ must\ be\ in\ the\n\ format\ dd-mm-yyy\ (e.g.\ 25-03-2023\ or\ 25-3-2023)\ where\ dd\ represents\n\ one\ or\ two\ digits\ representing\ the\ day\ in\ the\ month,\ similarly\ for\n\ mm\ representing\ the\ month\ in\ the\ year\ and\ yyyy\ represents\ the\ four\n\ digits\ for\ the\ year.\n\n\ A\ RuntimeException\ is\ thrown\ if\ the\ date\ string\ is\ not\ recognised\ as\n\ a\ valid\ date.\ Such\ exceptions\ do\ not\ need\ to\ be\ caught\ or\ thrown\ as\ \n\ they\ are\ unchecked\ exceptions,\ but\ can\ be\ caught\ if\ necessary.\n\n\ @param\ \ \ \ \ dateString\ \ a\ Date\ object\n\n\ @return\ \ \ \ the\ Date\ object\n
|
||||||
|
comment3.params=startDate\ endDate
|
||||||
|
comment3.target=int\ daysBetween(java.util.Date,\ java.util.Date)
|
||||||
|
comment3.text=\n\ Calculates\ the\ number\ of\ days\ between\ two\ given\ dates,\ startDate\ and\ endDate.\n\n\ If\ startDate\ is\ after\ endDate\ then\ the\ number\ of\ days\ returned\ will\ be\ negative.\n\n\ @param\ \ \ \ \ startDate\ \ \ a\ Date\ object\n\ @param\ \ \ \ \ endDate\ \ \ \ \ a\ Date\ object\n\n\ @return\ \ \ \ an\ int,\ number\ of\ days\ between\ the\ dates\n
|
||||||
|
comment4.params=date\ noOfDays
|
||||||
|
comment4.target=java.util.Date\ incrementDate(java.util.Date,\ int)
|
||||||
|
comment4.text=\n\ Given\ date,\ a\ Date\ object,\ and\ noOfDays,\ an\ int,\ the\ method\ returns\n\ a\ Date\ object\ corresponding\ to\ noOfDays\ later\ than\ date.\n\n\ If\ noOfDays\ is\ negative,\ the\ resulting\ Date\ object\ will\ be\ before\ date.\n\n\ @param\ \ \ \ \ date\ \ \ \ \ \ a\ Date\ object\n\ @param\ \ \ \ \ noOfDays\ \ an\ int\n\n\ @return\ \ \ \ a\ Date\n
|
||||||
|
comment5.params=year
|
||||||
|
comment5.target=boolean\ isLeapYear(int)
|
||||||
|
comment5.text=\n\ Given\ year,\ an\ int,\ the\ method\ checks\ to\ see\ if\ the\ year\n\ is\ a\ leap\ year.\n\n\ @param\ \ \ \ \ year,\ \ an\ int\n\n\ @return\ \ \ \ a\ boolean,\ true\ only\ if\ the\ year\ is\ a\ leap\ year.\n
|
||||||
|
comment6.params=dateString
|
||||||
|
comment6.target=boolean\ isValidDateString(java.lang.String)
|
||||||
|
comment6.text=\n\ Given\ dateString,\ a\ String,\ the\ method\ checks\ to\ see\ if\ string\n\ corresponds\ to\ a\ valid\ shortDatePattern.\ \n\n\ @param\ \ \ \ \ dateString,\ a\ String\n\n\ @return\ \ \ \ a\ boolean,\ true\ only\ if\ the\ dateString\ is\ a\ valid\ pattern\n
|
||||||
|
comment7.params=date
|
||||||
|
comment7.target=java.util.Date\ nextDate(java.util.Date)
|
||||||
|
comment7.text=\n\ Given\ date,\ a\ Date\ object,\ the\ method\ returns\n\ a\ Date\ object\ corresponding\ to\ the\ next\ day.\n\n\ @param\ \ \ \ \ noOfDays\ \ an\ int\n\n\ @return\ \ \ \ a\ Date\n
|
||||||
|
numComments=8
|
||||||
@@ -0,0 +1,263 @@
|
|||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.ParsePosition;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* A class DateUtil with the following methods for dealing with dates.
|
||||||
|
*
|
||||||
|
* public static String convertDateToLongString(Date date)
|
||||||
|
* public static String convertDateToShortString(Date date)
|
||||||
|
* public static Date convertStringToDate(String dateString)
|
||||||
|
* public static int daysBetween(Date startDate, Date endDate)
|
||||||
|
* public static Date incrementDate(Date date, int noOfDays)
|
||||||
|
* public static boolean isLeapYear(int year)
|
||||||
|
* public static boolean isValidDateString(String dateString)
|
||||||
|
* public static Date nextDate(Date date)
|
||||||
|
*
|
||||||
|
* @author D E Newton
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class DateUtil
|
||||||
|
{
|
||||||
|
public static SimpleDateFormat dateFormatter;
|
||||||
|
private static String longDatePattern;
|
||||||
|
private static String shortDatePattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* initializer block -- useful for
|
||||||
|
* initializing static fields
|
||||||
|
*/
|
||||||
|
static
|
||||||
|
{
|
||||||
|
shortDatePattern = "dd-MM-yyyy"; // dd = day, MM = month, yyyy = year (as 2, 2 and 4 digits respectively)
|
||||||
|
longDatePattern = "EEEE, d MMMM yyyy"; // e.g. Saturday, 25 March 2023
|
||||||
|
// EEEE (4 or more) = day in week, in full e.g.Saturday
|
||||||
|
// MMMMM (4 or more) = month name as text in full e.g. March
|
||||||
|
// d = day as 1 or 2 digits e.g. 25th of month -> 25, 23rd -> 23
|
||||||
|
//
|
||||||
|
// some alternatives below to help understanding (see documentation for SimpleDateFormat class)
|
||||||
|
// EE (3 or less) -> Tue
|
||||||
|
// MMMM = month name as text in short e.g. Oct
|
||||||
|
// M (or MM) = month as digits e.g. 1 (or 01) would correspond to January
|
||||||
|
dateFormatter = new SimpleDateFormat(shortDatePattern); // default pattern set
|
||||||
|
dateFormatter.setLenient(false); // default is true and impossible dates such
|
||||||
|
// as 31-09-2023 would be accepted but interpreted as 01-10-2023
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a Date object to a corresponding String in
|
||||||
|
* the long date pattern style "Saturday, 25 March 2023".
|
||||||
|
*
|
||||||
|
* @param date a Date object
|
||||||
|
*
|
||||||
|
* @return a String, containing a long date pattern
|
||||||
|
*/
|
||||||
|
public static String convertDateToLongString(Date date)
|
||||||
|
{
|
||||||
|
dateFormatter.applyPattern(longDatePattern);
|
||||||
|
String dateString = dateFormatter.format(date);
|
||||||
|
dateFormatter.applyPattern(shortDatePattern); // reset pattern
|
||||||
|
return dateString;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a Date object to a corresponding String in
|
||||||
|
* the short date pattern style "25-03-2023".
|
||||||
|
*
|
||||||
|
* @param date a Date object
|
||||||
|
*
|
||||||
|
* @return a String, containing a short date pattern
|
||||||
|
*/
|
||||||
|
public static String convertDateToShortString(Date date)
|
||||||
|
{
|
||||||
|
return dateFormatter.format(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a string in the short date pattern style "25-03-2023"
|
||||||
|
* to a corresponding Date object.
|
||||||
|
*
|
||||||
|
* Any leading or trailing spaces are first removed from the date string.
|
||||||
|
* The String parameter that represent a date as a string must be in the
|
||||||
|
* format dd-mm-yyy (e.g. 25-03-2023 or 25-3-2023) where dd represents
|
||||||
|
* one or two digits representing the day in the month, similarly for
|
||||||
|
* mm representing the month in the year and yyyy represents the four
|
||||||
|
* digits for the year.
|
||||||
|
*
|
||||||
|
* A RuntimeException is thrown if the date string is not recognised as
|
||||||
|
* a valid date. Such exceptions do not need to be caught or thrown as
|
||||||
|
* they are unchecked exceptions, but can be caught if necessary.
|
||||||
|
*
|
||||||
|
* @param dateString a Date object
|
||||||
|
*
|
||||||
|
* @return the Date object
|
||||||
|
*/
|
||||||
|
public static Date convertStringToDate(String dateString)
|
||||||
|
{
|
||||||
|
dateString = dateString.trim();
|
||||||
|
|
||||||
|
ParsePosition posn = new ParsePosition(0); // initialise posn to the beginning of the string to be parsed
|
||||||
|
|
||||||
|
Date date = dateFormatter.parse(dateString, posn);
|
||||||
|
int endIndex = posn.getIndex(); // posn after parsing
|
||||||
|
|
||||||
|
String message = "Date string <" + dateString + "> not recognised";
|
||||||
|
if( date==null )
|
||||||
|
{
|
||||||
|
// parsing failed because string not recognised
|
||||||
|
message += ".";
|
||||||
|
throw new RuntimeException(message);
|
||||||
|
}
|
||||||
|
else if( endIndex!=dateString.length() )
|
||||||
|
{
|
||||||
|
// parsing failed because parsing did not "consume" all the characters
|
||||||
|
// in the string, indicating the complete string was not recognised
|
||||||
|
message += " because it contains extra characters after a date.";
|
||||||
|
throw new RuntimeException(message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the number of days between two given dates, startDate and endDate.
|
||||||
|
*
|
||||||
|
* If startDate is after endDate then the number of days returned will be negative.
|
||||||
|
*
|
||||||
|
* @param startDate a Date object
|
||||||
|
* @param endDate a Date object
|
||||||
|
*
|
||||||
|
* @return an int, number of days between the dates
|
||||||
|
*/
|
||||||
|
public static int daysBetween(Date startDate, Date endDate)
|
||||||
|
{
|
||||||
|
// first check that startDate is not after endDate
|
||||||
|
boolean outOfOrder;
|
||||||
|
Date temp;
|
||||||
|
|
||||||
|
if( startDate.compareTo(endDate)<=0 )
|
||||||
|
{
|
||||||
|
outOfOrder = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outOfOrder = true;
|
||||||
|
temp = startDate;
|
||||||
|
startDate = endDate;
|
||||||
|
endDate = temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
int daysBetween = 0;
|
||||||
|
|
||||||
|
Calendar calendar = new GregorianCalendar();
|
||||||
|
calendar.setTime(startDate); // initialised at start date
|
||||||
|
|
||||||
|
Calendar calendarEndDate = new GregorianCalendar();
|
||||||
|
calendarEndDate.setTime(endDate);
|
||||||
|
|
||||||
|
// First advance calendar a year at a time without advancing past the end date.
|
||||||
|
// This is much quicker, for dates that are years apart, than simply relying on the
|
||||||
|
// later "day at a time" loop. Advancing "a month at a time" before the "day at a
|
||||||
|
// time" loop would be even better but complex because of the varying month lengths.
|
||||||
|
|
||||||
|
Calendar prevYearCalendar = (Calendar) calendar.clone();
|
||||||
|
calendar.add(Calendar.YEAR, 1);
|
||||||
|
// advance calendar a year at a time until end date reached
|
||||||
|
while( !calendar.getTime().after(endDate) )
|
||||||
|
{
|
||||||
|
if( isLeapYear(prevYearCalendar.get(Calendar.YEAR)) &&
|
||||||
|
prevYearCalendar.get(Calendar.MONTH)<Calendar.MARCH )
|
||||||
|
// advancing past a leap year day
|
||||||
|
daysBetween += 366;
|
||||||
|
else
|
||||||
|
daysBetween += 365;
|
||||||
|
|
||||||
|
prevYearCalendar = (Calendar) calendar.clone();
|
||||||
|
calendar.add(Calendar.YEAR, 1);
|
||||||
|
}
|
||||||
|
calendar = prevYearCalendar; // calendar always advances too far, so need to correct
|
||||||
|
|
||||||
|
// now advance calendar a day at a time until end date reached
|
||||||
|
while( calendar.getTime().before(endDate) )
|
||||||
|
{
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
daysBetween++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( outOfOrder )
|
||||||
|
daysBetween = -daysBetween;
|
||||||
|
|
||||||
|
return daysBetween;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Given date, a Date object, and noOfDays, an int, the method returns
|
||||||
|
* a Date object corresponding to noOfDays later than date.
|
||||||
|
*
|
||||||
|
* If noOfDays is negative, the resulting Date object will be before date.
|
||||||
|
*
|
||||||
|
* @param date a Date object
|
||||||
|
* @param noOfDays an int
|
||||||
|
*
|
||||||
|
* @return a Date
|
||||||
|
*/
|
||||||
|
public static Date incrementDate(Date date, int noOfDays)
|
||||||
|
{
|
||||||
|
Calendar calendar = new GregorianCalendar();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, noOfDays);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Given year, an int, the method checks to see if the year
|
||||||
|
* is a leap year.
|
||||||
|
*
|
||||||
|
* @param year, an int
|
||||||
|
*
|
||||||
|
* @return a boolean, true only if the year is a leap year.
|
||||||
|
*/
|
||||||
|
public static boolean isLeapYear(int year)
|
||||||
|
{
|
||||||
|
GregorianCalendar calendar = new GregorianCalendar();
|
||||||
|
return calendar.isLeapYear(year);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Given dateString, a String, the method checks to see if string
|
||||||
|
* corresponds to a valid shortDatePattern.
|
||||||
|
*
|
||||||
|
* @param dateString, a String
|
||||||
|
*
|
||||||
|
* @return a boolean, true only if the dateString is a valid pattern
|
||||||
|
*/
|
||||||
|
public static boolean isValidDateString(String dateString)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Date d = DateUtil.convertStringToDate(dateString);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch(RuntimeException ex)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Given date, a Date object, the method returns
|
||||||
|
* a Date object corresponding to the next day.
|
||||||
|
*
|
||||||
|
* @param noOfDays an int
|
||||||
|
*
|
||||||
|
* @return a Date
|
||||||
|
*/
|
||||||
|
public static Date nextDate(Date date)
|
||||||
|
{
|
||||||
|
return incrementDate(date, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,17 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=
|
||||||
|
comment0.target=Diary()
|
||||||
|
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ Diary\n
|
||||||
|
comment1.params=itemReservation
|
||||||
|
comment1.target=void\ addReservation(LibraryReservation)
|
||||||
|
comment1.text=\n\ Method\ for\ adding\ a\ reservation\ to\ the\ diary.\ \n\ @parameter\ itemReservation,\ of\ type\ ItemReservation\ \n
|
||||||
|
comment2.params=startDate\ endDate
|
||||||
|
comment2.target=void\ printEntries(java.util.Date,\ java.util.Date)
|
||||||
|
comment2.text=\n\ Method\ for\ displaying\ the\ reservations\ between\ specified\ dates.\ \n\n\ @parameter\ \ \ \ \ startDate,\ of\ type\ Date\n\ @parameter\ \ \ \ \ endDate,\ of\ type\ Date\n
|
||||||
|
comment3.params=itemReservation
|
||||||
|
comment3.target=void\ deleteReservation(LibraryReservation)
|
||||||
|
comment3.text=\n\ Method\ for\ deleting\ a\ reservation\ from\ the\ diary.\ \n\ @parameter\ itemReservation,\ of\ type\ ItemReservation\ \n
|
||||||
|
comment4.params=date
|
||||||
|
comment4.target=LibraryReservation[]\ getReservations(java.util.Date)
|
||||||
|
comment4.text=\n\ Accessor\ method\ for\ returning\ all\ reservations\ that\ have\ entries\ \n\ in\ the\ diary\ for\ a\ particular\ date.\ \n\n\ @parameter\ \ \ \ \ date,\ of\ type\ Date\ \n\ @return\ \ \ \ \ \ \ \ an\ array\ of\ reservations,\ or\ null\ if\ no\ entry\ for\ that\ date\n
|
||||||
|
numComments=5
|
||||||
@@ -0,0 +1,205 @@
|
|||||||
|
import java.util.Date;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
/**
|
||||||
|
* A class Diary that represents a "diary" of library item reservations.
|
||||||
|
*
|
||||||
|
* The diary is structured as a Map of entries in which each entry corresponds
|
||||||
|
* to a specific day. As the map is not accessed in a sequential fashion, it
|
||||||
|
* doesn't matter whether the actual map class is a TreeMap or a HashMap.
|
||||||
|
*
|
||||||
|
* @author D E Newton
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class Diary
|
||||||
|
{
|
||||||
|
private Map<Date, DayInDiary> dayInDiaryMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for objects of class Diary
|
||||||
|
*/
|
||||||
|
public Diary()
|
||||||
|
{
|
||||||
|
// create diary as a map
|
||||||
|
dayInDiaryMap = new HashMap<Date, DayInDiary>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method for adding a reservation to the diary.
|
||||||
|
* @parameter itemReservation, of type ItemReservation
|
||||||
|
*/
|
||||||
|
public void addReservation(LibraryReservation itemReservation)
|
||||||
|
{
|
||||||
|
Date date = itemReservation.getStartDate();
|
||||||
|
for(int day=1; day<=itemReservation.getNoOfDays(); day++)
|
||||||
|
{
|
||||||
|
if( !dayInDiaryMap.containsKey(date) )
|
||||||
|
{
|
||||||
|
// add new day to diary if no previous entries for this day
|
||||||
|
dayInDiaryMap.put(date, new DayInDiary(date));
|
||||||
|
}
|
||||||
|
|
||||||
|
dayInDiaryMap.get(date).addEntry(itemReservation, day);
|
||||||
|
date = DateUtil.nextDate(date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method for displaying the reservations between specified dates.
|
||||||
|
*
|
||||||
|
* @parameter startDate, of type Date
|
||||||
|
* @parameter endDate, of type Date
|
||||||
|
*/
|
||||||
|
public void printEntries(Date startDate, Date endDate)
|
||||||
|
{
|
||||||
|
if( DateUtil.daysBetween(startDate, endDate)<0 )
|
||||||
|
{
|
||||||
|
// startDate after endDate
|
||||||
|
System.out.println("*** Error in method displayEntries(): The specified end date is before the start date ***");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
System.out.println("\n\nDiary: Reservations for period " + DateUtil.convertDateToShortString(startDate)
|
||||||
|
+ " to " + DateUtil.convertDateToShortString(endDate) + " inclusive");
|
||||||
|
System.out.println("=================================================================");
|
||||||
|
for(Date date=startDate; date.compareTo(endDate)<=0; date = DateUtil.nextDate(date))
|
||||||
|
{
|
||||||
|
String longDate = DateUtil.convertDateToLongString(date);
|
||||||
|
System.out.print(longDate + ":");
|
||||||
|
if( dayInDiaryMap.containsKey(date) )
|
||||||
|
{
|
||||||
|
DayInDiary dayInDiary = dayInDiaryMap.get(date);
|
||||||
|
dayInDiary.printEntries();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
System.out.println(" No reservations\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method for deleting a reservation from the diary.
|
||||||
|
* @parameter itemReservation, of type ItemReservation
|
||||||
|
*/
|
||||||
|
public void deleteReservation(LibraryReservation itemReservation)
|
||||||
|
{
|
||||||
|
Date date = itemReservation.getStartDate();
|
||||||
|
for(int day=1; day<=itemReservation.getNoOfDays(); day++)
|
||||||
|
{
|
||||||
|
DayInDiary dayInDiary = dayInDiaryMap.get(date);
|
||||||
|
dayInDiary.deleteEntry(itemReservation);
|
||||||
|
|
||||||
|
if( dayInDiary.getDaysEntries().size()==0 )
|
||||||
|
dayInDiaryMap.remove(date);
|
||||||
|
|
||||||
|
date = DateUtil.nextDate(date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accessor method for returning all reservations that have entries
|
||||||
|
* in the diary for a particular date.
|
||||||
|
*
|
||||||
|
* @parameter date, of type Date
|
||||||
|
* @return an array of reservations, or null if no entry for that date
|
||||||
|
*/
|
||||||
|
public LibraryReservation[] getReservations(Date date)
|
||||||
|
{
|
||||||
|
DayInDiary dayinDiary = dayInDiaryMap.get(date);
|
||||||
|
if( dayinDiary==null )
|
||||||
|
return null;
|
||||||
|
else
|
||||||
|
return dayinDiary.getReservations();
|
||||||
|
}
|
||||||
|
|
||||||
|
// inner class, only needed in the Diary class
|
||||||
|
private class DayInDiary
|
||||||
|
{
|
||||||
|
// reservations for the day
|
||||||
|
private ArrayList<Entry> daysEntries;
|
||||||
|
private Date date;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructor for objects of class DayInDiary
|
||||||
|
*/
|
||||||
|
private DayInDiary(Date date)
|
||||||
|
{
|
||||||
|
this.date = date;
|
||||||
|
daysEntries = new ArrayList<Entry>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArrayList<Entry> getDaysEntries()
|
||||||
|
{
|
||||||
|
return daysEntries;
|
||||||
|
}
|
||||||
|
|
||||||
|
private LibraryReservation[] getReservations()
|
||||||
|
{
|
||||||
|
int noOfEntries = daysEntries.size();
|
||||||
|
LibraryReservation[] itemReservations = new LibraryReservation[noOfEntries];
|
||||||
|
for(int i=0; i<noOfEntries; i++)
|
||||||
|
itemReservations[i] = daysEntries.get(i).getReservation();
|
||||||
|
return itemReservations;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addEntry(LibraryReservation itemReservation, int dayNo)
|
||||||
|
{
|
||||||
|
daysEntries.add(new Entry(itemReservation, dayNo));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteEntry(LibraryReservation itemReservation)
|
||||||
|
{
|
||||||
|
// find the entry for this reservation and delete it
|
||||||
|
Entry toBeDeletedEntry = null;
|
||||||
|
for(Entry entry : daysEntries)
|
||||||
|
{
|
||||||
|
if( entry.getReservation()==itemReservation ) // in this situation, this is better than using "equals()"
|
||||||
|
{
|
||||||
|
toBeDeletedEntry = entry;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
daysEntries.remove(toBeDeletedEntry);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printEntries()
|
||||||
|
{
|
||||||
|
int size = daysEntries.size();
|
||||||
|
if( size>0 )
|
||||||
|
{
|
||||||
|
System.out.println(" " + size + " reservation(s)");
|
||||||
|
for( Entry entry: daysEntries )
|
||||||
|
{
|
||||||
|
LibraryReservation itemReservation = entry.getReservation();
|
||||||
|
int reservationDay = DateUtil.daysBetween(itemReservation.getStartDate(), date) + 1;;
|
||||||
|
System.out.println(" " + itemReservation + ", day " + reservationDay + " of " + itemReservation.getNoOfDays());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
System.out.println("*** Unexpected error in displayEntries() ***");
|
||||||
|
System.out.println("*** No entries for this date so it should not be in the diary ***");
|
||||||
|
}
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
|
||||||
|
// an inner class of the DaysDiary class
|
||||||
|
private class Entry
|
||||||
|
{
|
||||||
|
private LibraryReservation itemReservation;
|
||||||
|
private int reservationDay; // e.g. second day is day 2 of 4 for a reservation spanning 4 days
|
||||||
|
|
||||||
|
private Entry(LibraryReservation itemReservation, int reservationDay)
|
||||||
|
{
|
||||||
|
this.itemReservation = itemReservation;
|
||||||
|
this.reservationDay = reservationDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
private LibraryReservation getReservation()
|
||||||
|
{
|
||||||
|
return itemReservation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,65 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=
|
||||||
|
comment0.target=Library()
|
||||||
|
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ Library\n
|
||||||
|
comment1.params=
|
||||||
|
comment1.target=java.util.ArrayList\ getUserIDs()
|
||||||
|
comment1.text=\n\ Return\ the\ keys\ of\ @customerMap\ as\ a\ list.\n
|
||||||
|
comment10.params=
|
||||||
|
comment10.target=java.lang.String\ generateReservationNo()
|
||||||
|
comment10.text=\n\ Generate\ a\ sequential\ reservation\ number\ padded\ with\ 0s\ to\ a\ length\ of\ 6.\n\ \n\ Since\ we\ are\ not\ storing\ in\ a\ file\ at\ this\ point,\ we\ obtain\ the\ size\ of\ the\ Map,\ and\ add\ 1\ to\ determine\ the\ current\ number.\n\ This\ is\ due\ to\ the\ event\ of\ program\ restart,\ if\ a\ field\ variable\ is\ used,\ the\ first\ reservation\ generated\ will\ be\ of\ ID\ "000001"\n\ no\ matter\ what.\ This\ causes\ an\ issue\ if\ a\ file\ is\ read\ to\ load\ the\ reservations\ into\ the\ Library,\ since\ IDs\ will\ conflict\ and\ \n\ the\ value\ will\ be\ overwritten,\ causing\ data\ integrity\ loss.\n\ Unlike\ @generateUserID,\ this\ has\ a\ maximum\ value\ hardcoded\ to\ the\ spec.\ \n\ This\ likely\ will\ not\ be\ an\ issue\ since\ we\ can\ still\ have\ 1,000,000\ reservations.\n\ \n\ Returns\n\ \ String\ @candidateNo\ -\ a\ proposed\ lowest\ number\ that\ is\ checked\ and\ interated\ if\ conflicting.\n
|
||||||
|
comment11.params=prefix\ length
|
||||||
|
comment11.target=java.lang.String\ generateUserID(java.lang.String,\ int)
|
||||||
|
comment11.text=\n\ Generate\ a\ unique\ user\ identifier\ to\ apply\ to\ users\ when\ the\ UUID\ is\ unknown.\n\ This\ generates\ a\ number\ of\ @length\ length\ using\ the\ Random\ class,\ and\ prefixes\ @prefix.\n\ \n\ Takes\ Parameters\n\ \ String\ @prefix\ -\ arbitrary\ alphanumeric\ prefix\n\ \ String\ @length\ -\ length\ of\ numeric\ ID\n\ Returns\n\ \ String\ @uuid\ -\ a\ unique\ string\ starting\ with\ @prefix,\ and\ concat.\ with\ a\ random\ number\n\ \n\ Example\:\ length\ \=\ 6,\ expected\ result\ should\ be\ under\ 999,999\ and\ above\ 99,999.\n\ If\ we\ just\ use\ 10^(length),\ this\ would\ generate\ any\ number\ under\ 1,000,000.\n\ This\ is\ an\ issue\ since\ any\ integers\ below\ 100,000\ can\ be\ used,\ which\ would\ be\ incorrect.\n\ By\ using\ the\ offset\ of\ a\ factor\ of\ 10\ below\ the\ desired\ length\ we\ can\ generate\ between\ 0\ and\ 899,999.\n\ After\ this,\ we\ can\ add\ 100,000\ back\ to\ the\ number\ to\ ensure\ a\ baseline\ length\ is\ maintained.\n\ \n\ Note\:\ I\ am\ aware\ that\ this\ is\ overengineered,\ and\ that\ several\ random\ integers\ of\ amount\ @length\ could\ be\ used,\ \n\ but\ this\ is\ considerably\ more\ efficient\ since\ there\ is\ no\ iteration\ involved\ in\ the\ creation\ of\ the\ ID.\ O(1)\n
|
||||||
|
comment12.params=
|
||||||
|
comment12.target=void\ printLibraryReservations()
|
||||||
|
comment12.text=\n\ Prints\ to\ the\ terminal,\ in\ a\ human-readable\ format,\ all\ LibraryReservation(s)\n\ \n\ Contains\ a\ marker\ at\ the\ start\ and\ end\ to\ visualise\ in\ terminal\ output.\n
|
||||||
|
comment13.params=
|
||||||
|
comment13.target=void\ printAll()
|
||||||
|
comment13.text=\n\ Prints\ to\ the\ terminal,\ in\ a\ human-readable\ format,\ all\:\n\ \ LibraryItem(s)\n\ \ LibraryUser(s)\n\ \ LibraryReservation(s)\n\ \n\ Contains\ a\ marker\ at\ the\ start\ and\ end\ of\ each\ type\ to\ visualise\ in\ terminal\ output.\n\ For\ printing\ the\ LibraryReservation(s),\ the\ corresponding\ method\ is\ called\ to\ reduce\n\ code\ duplication.\n
|
||||||
|
comment14.params=start\ end
|
||||||
|
comment14.target=void\ printDiaryEntries(java.lang.String,\ java.lang.String)
|
||||||
|
comment14.text=\n\ Print,\ to\ the\ terminal\ all\ reservation\ entries\ in\ the\ diary.\n\ Takes\ Parameters\n\ \ String\ @start\n\ \ String\ @end\n\ \n\ This\ converts\ both\ string\ inputs\ to\ Date\ formats,\ and\ calls\ the\ printEntries\n\ method\ in\ the\ diary\ class.\n
|
||||||
|
comment15.params=
|
||||||
|
comment15.target=void\ writeLibraryReservationData()
|
||||||
|
comment15.text=\n\ Write\ all\ current\ library\ reservations\ to\ a\ file\ specified\ by\ the\ user.\n\ For\ each\ user,\ this\ passes\ a\ printWriter\ object\ to\ the\ writeData\ method\ of\ LibraryReservation.\n
|
||||||
|
comment16.params=
|
||||||
|
comment16.target=void\ writeUserData()
|
||||||
|
comment16.text=\n\ A\ method\ to\ output\ all\ user\ data\ to\ a\ file\ using\ a\ fileDialog\ to\ specify\ file\ location.\n\ For\ each\ user,\ this\ passes\ a\ printWriter\ object\ to\ the\ writeData\ method\ of\ LibraryUser.\n
|
||||||
|
comment17.params=
|
||||||
|
comment17.target=void\ readLibraryReservationData()
|
||||||
|
comment17.text=\n\ Read\ Library\ Reservation\ Data\ from\ a\ file\ specified\ by\ the\ user.\n\ This\ passes\ a\ scanner\ to\ the\ readData\ method\ in\ LibraryReservation\ for\ each\n\ line\ of\ the\ file.\n
|
||||||
|
comment18.params=
|
||||||
|
comment18.target=void\ readData()
|
||||||
|
comment18.text=\n\ A\ method\ to\ read\ all\ data\ from\ files\ using\ a\ fileDialog\ to\ specify\ file\ location.\n\ This\ will\ create\ the\ corresponding\ objects\ depending\ on\ flags\ contained\ in\ the\ file\n\ and\ populate\ it's\ fields.\n\ \n\ Default\ flag\ value\:\ "book",\ to\ support\ legacy\ files.\ This\ will\ not\ interfere\ with\ \n\ files\ of\ different\ flag\ orders.\n
|
||||||
|
comment19.params=userID\ itemCode\ startDate\ noOfDays
|
||||||
|
comment19.target=boolean\ makeLibraryReservation(java.lang.String,\ java.lang.String,\ java.lang.String,\ int)
|
||||||
|
comment19.text=\n\ Create\ a\ reservation\ to\ allow\ a\ user\ to\ reserve\ an\ item\ from\ the\ library.\ Ensures\ a\ reservation\ is\ not\ already\n\ in\ place\ for\ a\ conflicting\ itemCode.\n\ Takes\ parameters\n\ \ String\ @userID\ \n\ \ String\ @itemCode\n\ \ String\ @startDate\n\ \ int\ @noOfDays\n\ \ \n\ Returns\n\ \ boolean\n
|
||||||
|
comment2.params=
|
||||||
|
comment2.target=java.util.ArrayList\ getItemCodes()
|
||||||
|
comment2.text=\n\ Return\ the\ keys\ of\ @itemsMap\ as\ a\ list.\n
|
||||||
|
comment20.params=reservationNo
|
||||||
|
comment20.target=void\ deleteLibraryReservation(java.lang.String)
|
||||||
|
comment20.text=\n\ Allows\ the\ deletion\ of\ a\ library\ reservation.\ \n\ \n\ Takes\ Parameter\n\ \ String\ @reservationNo\n\ \ \n\ Removes\ the\ corresponding\ value\ from\ the\ hashMap\ and\ diary.\n
|
||||||
|
comment3.params=
|
||||||
|
comment3.target=java.util.ArrayList\ getReservationNos()
|
||||||
|
comment3.text=\n\ Return\ the\ keys\ of\ @libraryReservationMap\ as\ a\ list.\n
|
||||||
|
comment4.params=
|
||||||
|
comment4.target=java.util.ArrayList\ getUsers()
|
||||||
|
comment4.text=\n\ Return\ the\ values\ of\ @customerMap\ as\ a\ list.\n
|
||||||
|
comment5.params=
|
||||||
|
comment5.target=java.util.ArrayList\ getItems()
|
||||||
|
comment5.text=\n\ Return\ the\ values\ of\ @itemsMap\ as\ a\ list.\n
|
||||||
|
comment6.params=
|
||||||
|
comment6.target=java.util.ArrayList\ getLibraryReservations()
|
||||||
|
comment6.text=\n\ Return\ the\ values\ of\ @libraryReservationMap\ as\ a\ list.\n
|
||||||
|
comment7.params=item
|
||||||
|
comment7.target=void\ storeItem(LibraryItem)
|
||||||
|
comment7.text=\n\ Inserts\ object\ value\ item\ alongside\ key\ of\ @itemCode\ into\ @itemsMap.\n
|
||||||
|
comment8.params=user
|
||||||
|
comment8.target=void\ storeUser(LibraryUser)
|
||||||
|
comment8.text=\n\ Inserts\ object\ value\ user\ alongside\ key\ of\ @userID\ into\ @customerMap.\n\ If\ the\ userID\ is\ set\ to\ unknown,\ it\ will\ call\ @generateUserID.\n
|
||||||
|
comment9.params=reservation
|
||||||
|
comment9.target=void\ storeLibraryReservation(LibraryReservation)
|
||||||
|
comment9.text=\n\ Inserts\ object\ value\ reservation\ alongside\ key\ of\ @reservationNo\ into\ @libraryReservationMap.\n
|
||||||
|
numComments=21
|
||||||
@@ -0,0 +1,573 @@
|
|||||||
|
// Import all required libraries. Not using .* as it is not good practice due to potential conflicts.
|
||||||
|
import java.util.Scanner;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.awt.FileDialog;
|
||||||
|
import java.awt.Frame;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to create objects of a Library, which can hold and report on assets held within
|
||||||
|
*
|
||||||
|
* @author George Wilkinson
|
||||||
|
* @version 3.0
|
||||||
|
*/
|
||||||
|
public class Library
|
||||||
|
{
|
||||||
|
// private List<LibraryItem> itemList; // Initialise an ArrayList of name itemList to store Library Items
|
||||||
|
// private List<LibraryUser> userList; // Initialise an ArrayList of name userList to store Library Users
|
||||||
|
|
||||||
|
/* No longer needed, as we can use the keys of customerMap.
|
||||||
|
private HashSet<String> uuidSet; // Initialise a Hash Set of name uuidSet ( unique user identifier ) to store unique user IDs for efficient O(1) searching
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Map<String, LibraryUser> customerMap;
|
||||||
|
private Map<String, LibraryItem> itemsMap;
|
||||||
|
private Map<String, LibraryReservation> libraryReservationMap;
|
||||||
|
|
||||||
|
private Diary diary;
|
||||||
|
/*
|
||||||
|
* Constructor for objects of class Library
|
||||||
|
*/
|
||||||
|
public Library()
|
||||||
|
{
|
||||||
|
// itemList = new ArrayList<LibraryItem>();
|
||||||
|
// userList = new ArrayList<LibraryUser>();
|
||||||
|
|
||||||
|
/* No longer needed, can use keys of customerMap.
|
||||||
|
uuidSet = new HashSet<String>();
|
||||||
|
*/
|
||||||
|
|
||||||
|
customerMap = new HashMap<String, LibraryUser>();
|
||||||
|
itemsMap = new HashMap<String, LibraryItem>();
|
||||||
|
libraryReservationMap = new HashMap<String, LibraryReservation>();
|
||||||
|
diary = new Diary();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accessor Start
|
||||||
|
*
|
||||||
|
* Possible scope creep, but thought it would be useful or even required for top marks to have accessors here.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the keys of @customerMap as a list.
|
||||||
|
*/
|
||||||
|
public ArrayList getUserIDs()
|
||||||
|
{
|
||||||
|
return new ArrayList<String>( customerMap.keySet() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the keys of @itemsMap as a list.
|
||||||
|
*/
|
||||||
|
public ArrayList getItemCodes()
|
||||||
|
{
|
||||||
|
return new ArrayList<String>( itemsMap.keySet() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the keys of @libraryReservationMap as a list.
|
||||||
|
*/
|
||||||
|
public ArrayList getReservationNos()
|
||||||
|
{
|
||||||
|
return new ArrayList<String>( libraryReservationMap.keySet() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the values of @customerMap as a list.
|
||||||
|
*/
|
||||||
|
public ArrayList getUsers()
|
||||||
|
{
|
||||||
|
return new ArrayList<LibraryUser>( customerMap.values() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the values of @itemsMap as a list.
|
||||||
|
*/
|
||||||
|
public ArrayList getItems()
|
||||||
|
{
|
||||||
|
return new ArrayList<LibraryItem>( itemsMap.values() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the values of @libraryReservationMap as a list.
|
||||||
|
*/
|
||||||
|
public ArrayList getLibraryReservations()
|
||||||
|
{
|
||||||
|
return new ArrayList<LibraryReservation>( libraryReservationMap.values() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accessor End
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Storing Objects Start
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Inserts object value item alongside key of @itemCode into @itemsMap.
|
||||||
|
*/
|
||||||
|
private void storeItem( LibraryItem item )
|
||||||
|
{
|
||||||
|
// itemList.add( item );
|
||||||
|
itemsMap.put( item.getItemCode(), item );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Inserts object value user alongside key of @userID into @customerMap.
|
||||||
|
* If the userID is set to unknown, it will call @generateUserID.
|
||||||
|
*/
|
||||||
|
private void storeUser( LibraryUser user )
|
||||||
|
{
|
||||||
|
// userList.add( user );
|
||||||
|
if ( user.getUserID().equals( "unknown" ) )
|
||||||
|
{
|
||||||
|
user.setUserID( generateUserID( "AB-", 6 ) );
|
||||||
|
}
|
||||||
|
customerMap.put( user.getUserID(), user ); // Store the user along with the userID.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts object value reservation alongside key of @reservationNo into @libraryReservationMap.
|
||||||
|
**/
|
||||||
|
private void storeLibraryReservation( LibraryReservation reservation )
|
||||||
|
{
|
||||||
|
libraryReservationMap.put( reservation.getReservationNo(), reservation );
|
||||||
|
diary.addReservation( reservation );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Storing Objects End
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate IDs Start
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a sequential reservation number padded with 0s to a length of 6.
|
||||||
|
*
|
||||||
|
* Since we are not storing in a file at this point, we obtain the size of the Map, and add 1 to determine the current number.
|
||||||
|
* This is due to the event of program restart, if a field variable is used, the first reservation generated will be of ID "000001"
|
||||||
|
* no matter what. This causes an issue if a file is read to load the reservations into the Library, since IDs will conflict and
|
||||||
|
* the value will be overwritten, causing data integrity loss.
|
||||||
|
* Unlike @generateUserID, this has a maximum value hardcoded to the spec.
|
||||||
|
* This likely will not be an issue since we can still have 1,000,000 reservations.
|
||||||
|
*
|
||||||
|
* Returns
|
||||||
|
* String @candidateNo - a proposed lowest number that is checked and interated if conflicting.
|
||||||
|
**/
|
||||||
|
private String generateReservationNo()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Originally, I did not check if the number was already taken, however the last part of step 4 introduced deletion.
|
||||||
|
* When a reservation is deleted that does not have the highest reservation number, conflicting reservation numbers are generated.
|
||||||
|
* e.g. 5 reservations, reservation 3 ID: 000003 is deleted. The next reservation number would be 000004, as the size + 1 = 4
|
||||||
|
*/
|
||||||
|
String candidateNo = String.format("%06d", libraryReservationMap.size() + 1);
|
||||||
|
for ( int i = 1; libraryReservationMap.containsKey( candidateNo ); i++ )
|
||||||
|
{
|
||||||
|
candidateNo = String.format( "%06d", libraryReservationMap.size() + i );
|
||||||
|
}
|
||||||
|
return candidateNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a unique user identifier to apply to users when the UUID is unknown.
|
||||||
|
* This generates a number of @length length using the Random class, and prefixes @prefix.
|
||||||
|
*
|
||||||
|
* Takes Parameters
|
||||||
|
* String @prefix - arbitrary alphanumeric prefix
|
||||||
|
* String @length - length of numeric ID
|
||||||
|
* Returns
|
||||||
|
* String @uuid - a unique string starting with @prefix, and concat. with a random number
|
||||||
|
*
|
||||||
|
* Example: length = 6, expected result should be under 999,999 and above 99,999.
|
||||||
|
* If we just use 10^(length), this would generate any number under 1,000,000.
|
||||||
|
* This is an issue since any integers below 100,000 can be used, which would be incorrect.
|
||||||
|
* By using the offset of a factor of 10 below the desired length we can generate between 0 and 899,999.
|
||||||
|
* After this, we can add 100,000 back to the number to ensure a baseline length is maintained.
|
||||||
|
*
|
||||||
|
* Note: I am aware that this is overengineered, and that several random integers of amount @length could be used,
|
||||||
|
* but this is considerably more efficient since there is no iteration involved in the creation of the ID. O(1)
|
||||||
|
**/
|
||||||
|
private String generateUserID( String prefix, int length )
|
||||||
|
{
|
||||||
|
Random random = new Random();
|
||||||
|
final int offset = (int) Math.pow( 10, (length-1) ); // Static integer equal to 10^(length-1) lower than length. This will allow for the factor to be consistent.
|
||||||
|
int intLength = (int) ( Math.pow( 10, length ) ) - offset ; // Integer equal to 10^(length) minus the offset. This creates a ceiling for the ID range.
|
||||||
|
|
||||||
|
if ( customerMap.size() == intLength ) {
|
||||||
|
System.out.println("Too many user IDs delegated for current range, increasing ID range by a factor of 10");
|
||||||
|
return generateUserID( prefix, length+1 );
|
||||||
|
/*
|
||||||
|
* This is essential for eliminating a stack overflow error when the specified range is full. This would be incorrect to catch.
|
||||||
|
* By incrementing the length value when the ID range is full, roughly 2.1 billion users can be created without running into an overflow error.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
String uuid = prefix + ( random.nextInt( intLength ) + offset );
|
||||||
|
/*
|
||||||
|
* Sets the uid to the prefix, concat. with a random integer of specified length
|
||||||
|
* Add the offset to a random number, to create a floor to the ID range.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( customerMap.containsKey( uuid ) ) // Previously uuidSet.contains, replaced to de-dupe held data.
|
||||||
|
{
|
||||||
|
generateUserID( prefix, length ); // If the ID generated is already contained in the hashset, the method should be called again.
|
||||||
|
}
|
||||||
|
|
||||||
|
/* No longer needed, as we add the user and the ID to the customerMap when storing.
|
||||||
|
* uuidSet.add( uuid )
|
||||||
|
*/
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate IDs End
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print Object Details Start
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prints to the terminal, in a human-readable format, all LibraryReservation(s)
|
||||||
|
*
|
||||||
|
* Contains a marker at the start and end to visualise in terminal output.
|
||||||
|
**/
|
||||||
|
public void printLibraryReservations() {
|
||||||
|
System.out.println( "Reservation Details Start" );
|
||||||
|
for ( LibraryReservation reservation : libraryReservationMap.values() ){
|
||||||
|
System.out.println("---------------");
|
||||||
|
reservation.printDetails();
|
||||||
|
}
|
||||||
|
System.out.println( "---------------\nReservation Details End\n" );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prints to the terminal, in a human-readable format, all:
|
||||||
|
* LibraryItem(s)
|
||||||
|
* LibraryUser(s)
|
||||||
|
* LibraryReservation(s)
|
||||||
|
*
|
||||||
|
* Contains a marker at the start and end of each type to visualise in terminal output.
|
||||||
|
* For printing the LibraryReservation(s), the corresponding method is called to reduce
|
||||||
|
* code duplication.
|
||||||
|
**/
|
||||||
|
public void printAll()
|
||||||
|
{
|
||||||
|
System.out.println("\n\nItem Details Start");
|
||||||
|
for( LibraryItem item : itemsMap.values() )
|
||||||
|
{
|
||||||
|
System.out.println("---------------");
|
||||||
|
item.printDetails();
|
||||||
|
}
|
||||||
|
System.out.println("---------------");
|
||||||
|
System.out.println("Items Details End\n\n---------------\n\nUser Details Start\n");
|
||||||
|
for ( LibraryUser user : customerMap.values() )
|
||||||
|
{
|
||||||
|
System.out.println("---------------");
|
||||||
|
user.printDetails();
|
||||||
|
}
|
||||||
|
System.out.println("---------------\nUser Details End\n");
|
||||||
|
printLibraryReservations();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print, to the terminal all reservation entries in the diary.
|
||||||
|
* Takes Parameters
|
||||||
|
* String @start
|
||||||
|
* String @end
|
||||||
|
*
|
||||||
|
* This converts both string inputs to Date formats, and calls the printEntries
|
||||||
|
* method in the diary class.
|
||||||
|
*/
|
||||||
|
public void printDiaryEntries( String start, String end )
|
||||||
|
{
|
||||||
|
diary.printEntries( DateUtil.convertStringToDate( start ), DateUtil.convertStringToDate( end ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print Object Details End
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write Files Start
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write all current library reservations to a file specified by the user.
|
||||||
|
* For each user, this passes a printWriter object to the writeData method of LibraryReservation.
|
||||||
|
**/
|
||||||
|
public void writeLibraryReservationData()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
Frame frame = null; // Initialise null frame
|
||||||
|
FileDialog fileBox = new FileDialog( frame, "Save", FileDialog.SAVE ); // Initialise file dialog box to save written data.
|
||||||
|
fileBox.setVisible( true );
|
||||||
|
PrintWriter writer = new PrintWriter( new File( fileBox.getDirectory() + fileBox.getFile() ) );
|
||||||
|
|
||||||
|
for ( LibraryReservation reservation : libraryReservationMap.values() ) {
|
||||||
|
reservation.writeData( writer );
|
||||||
|
}
|
||||||
|
writer.close();
|
||||||
|
}
|
||||||
|
catch( IOException e ) { // Catch any IO Exceptions that may occur from improper file selection.
|
||||||
|
System.err.println( "Caught IOException: " + e.getMessage() + "\nAn I/O Exception has occurred, please check file is readable and correct format." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A method to output all user data to a file using a fileDialog to specify file location.
|
||||||
|
* For each user, this passes a printWriter object to the writeData method of LibraryUser.
|
||||||
|
**/
|
||||||
|
public void writeUserData()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
Frame frame = null; // Initialise null frame
|
||||||
|
FileDialog fileBox = new FileDialog( frame, "Save", FileDialog.SAVE ); // Initialise file dialog box to save written data.
|
||||||
|
fileBox.setVisible( true );
|
||||||
|
PrintWriter writer = new PrintWriter( new File( fileBox.getDirectory() + fileBox.getFile() ) ); // Create PrintWriter to write user data to.
|
||||||
|
// for ( LibraryUser user : userList ){
|
||||||
|
writer.println("[Library User data]"); // Write the type header into the file.
|
||||||
|
for ( LibraryUser user : customerMap.values() ) {
|
||||||
|
user.writeData( writer );
|
||||||
|
}
|
||||||
|
writer.close();
|
||||||
|
}
|
||||||
|
catch( IOException e ) { // Catch any IO Exceptions that may occur from improper file selection.
|
||||||
|
System.err.println( "Caught IOException: " + e.getMessage() + "\nAn I/O Exception has occurred, please check file is readable and correct format." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write Files End
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read Files Start
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read Library Reservation Data from a file specified by the user.
|
||||||
|
* This passes a scanner to the readData method in LibraryReservation for each
|
||||||
|
* line of the file.
|
||||||
|
**/
|
||||||
|
public void readLibraryReservationData()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
Frame frame = null; // Initialise null frame
|
||||||
|
FileDialog fileBox = new FileDialog( frame, "Load", FileDialog.LOAD ); // Initialise file dialog box to save written data.
|
||||||
|
fileBox.setVisible( true );
|
||||||
|
Scanner reservationScanner = new Scanner ( new File( fileBox.getDirectory() + fileBox.getFile() ) );
|
||||||
|
while ( reservationScanner.hasNextLine() )
|
||||||
|
{
|
||||||
|
Scanner detailScanner = new Scanner( reservationScanner.nextLine() ).useDelimiter(",");
|
||||||
|
LibraryReservation reservation = new LibraryReservation();
|
||||||
|
reservation.readData( detailScanner );
|
||||||
|
storeLibraryReservation( reservation );
|
||||||
|
detailScanner.close();
|
||||||
|
}
|
||||||
|
reservationScanner.close(); // Close Scanner
|
||||||
|
}
|
||||||
|
catch( IOException e ) { // Catch any IO Exceptions that may occur from improper file selection.
|
||||||
|
System.err.println( "Caught IOException: " + e.getMessage() + "\nAn I/O Exception has occurred, please check file is readable and correct format." );
|
||||||
|
}
|
||||||
|
catch ( NoSuchElementException e ) { // In the event of incorrect formats from a readable file, this prevents a program crash.
|
||||||
|
System.err.println( "Caught Exception: " + e.getMessage() + "\nEnsure File contains the correct information." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A method to read all data from files using a fileDialog to specify file location.
|
||||||
|
* This will create the corresponding objects depending on flags contained in the file
|
||||||
|
* and populate it's fields.
|
||||||
|
*
|
||||||
|
* Default flag value: "book", to support legacy files. This will not interfere with
|
||||||
|
* files of different flag orders.
|
||||||
|
**/
|
||||||
|
public void readData()
|
||||||
|
{
|
||||||
|
Frame frame = null; // Initialise a null frame
|
||||||
|
FileDialog fileBox = new FileDialog( frame, "Open", FileDialog.LOAD ); // Initialise filebox with the null frame pointer
|
||||||
|
fileBox.setVisible( true ); // Open a file selection dialog to the user.
|
||||||
|
|
||||||
|
try {
|
||||||
|
Scanner fileScanner = new Scanner( new File( fileBox.getDirectory() + fileBox.getFile() ) );
|
||||||
|
String itemType = "book"; // Set a default flag to support legacy files.
|
||||||
|
|
||||||
|
while( fileScanner.hasNextLine() ) {
|
||||||
|
|
||||||
|
String lineItem = fileScanner.nextLine();
|
||||||
|
|
||||||
|
// Ensure no comments or empty lines are included
|
||||||
|
if ( lineItem.contains( "//" ) || lineItem.trim().isEmpty() ){}
|
||||||
|
|
||||||
|
// Check current line is a candidate flag
|
||||||
|
else if ( lineItem.startsWith("[" ) ) {
|
||||||
|
|
||||||
|
if ( lineItem.toLowerCase().contains("book") )
|
||||||
|
itemType = "book";
|
||||||
|
else if ( lineItem.toLowerCase().contains("periodical") )
|
||||||
|
itemType = "periodical";
|
||||||
|
else if ( lineItem.toLowerCase().contains("cd") )
|
||||||
|
itemType = "cd";
|
||||||
|
else if ( lineItem.toLowerCase().contains("dvd") )
|
||||||
|
itemType = "dvd";
|
||||||
|
else if ( lineItem.toLowerCase().contains("user") )
|
||||||
|
itemType = "user";
|
||||||
|
else {
|
||||||
|
System.out.println( "Flag detected, but no accepted format...\n Cannot store item in Library. Changing Flag to generic and skipping the following: ");
|
||||||
|
itemType = "generic";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unfortunately cannot use switch case with string comparisons in Java 8.
|
||||||
|
// Check current flag for data processing.
|
||||||
|
else {
|
||||||
|
Scanner detailScanner = new Scanner ( lineItem ).useDelimiter(","); // Create a new scanner to grab the values in a comma separated list
|
||||||
|
LibraryItem item = null; // Initialise LibraryItem object. Java compiler was being cautious here, so I have to assign the value null.
|
||||||
|
if ( itemType.equals( "book" ) ) {
|
||||||
|
// Process Book Data
|
||||||
|
item = new Book();
|
||||||
|
}
|
||||||
|
else if ( itemType.equals( "periodical" ) ) {
|
||||||
|
// Process Periodic Data
|
||||||
|
item = new Periodical();
|
||||||
|
}
|
||||||
|
else if ( itemType.equals( "cd" ) ) {
|
||||||
|
//Process CD Data
|
||||||
|
item = new CD();
|
||||||
|
}
|
||||||
|
else if ( itemType.equals( "dvd" ) ) {
|
||||||
|
//Process DVD Data
|
||||||
|
item = new DVD();
|
||||||
|
}
|
||||||
|
else if ( itemType.equals( "user" ) ) {
|
||||||
|
//Process User Data
|
||||||
|
LibraryUser user = new LibraryUser();
|
||||||
|
user.readData( detailScanner );
|
||||||
|
storeUser( user );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if ( itemType.equals( "generic" ) ) {
|
||||||
|
// Output unaccepted lines to terminal
|
||||||
|
System.out.println( lineItem );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
item.readItemData( detailScanner ); // Deduped from if statements
|
||||||
|
storeItem( item );
|
||||||
|
detailScanner.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fileScanner.close();
|
||||||
|
}
|
||||||
|
catch( IOException e ) { // Catch any IO Exceptions that may occur from improper file selection.
|
||||||
|
System.err.println( "Caught IOException: " + e.getMessage() + "\nAn I/O Exception has occurred, please check file is readable and correct format." );
|
||||||
|
}
|
||||||
|
catch ( NoSuchElementException e ) { // In the event of incorrect formats from a readable file, this prevents a program crash.
|
||||||
|
System.err.println( "Caught Exception: " + e.getMessage() + "\nEnsure File contains the correct information." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read Files End
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Other Methods
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a reservation to allow a user to reserve an item from the library. Ensures a reservation is not already
|
||||||
|
* in place for a conflicting itemCode.
|
||||||
|
* Takes parameters
|
||||||
|
* String @userID
|
||||||
|
* String @itemCode
|
||||||
|
* String @startDate
|
||||||
|
* int @noOfDays
|
||||||
|
*
|
||||||
|
* Returns
|
||||||
|
* boolean
|
||||||
|
**/
|
||||||
|
public boolean makeLibraryReservation( String userID, String itemCode, String startDate, int noOfDays )
|
||||||
|
{
|
||||||
|
if ( !customerMap.containsKey( userID ) )
|
||||||
|
{
|
||||||
|
System.out.println( "User does not exist" );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ( !itemsMap.containsKey( itemCode ) )
|
||||||
|
{
|
||||||
|
System.out.println( "Item does not exist in library" );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ( !DateUtil.isValidDateString( startDate ) )
|
||||||
|
{
|
||||||
|
System.out.println( "Date is not valid" );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ( !(noOfDays > 0) )
|
||||||
|
{
|
||||||
|
System.out.println( "Reservation must be more than 0 days" );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Date start = DateUtil.convertStringToDate( startDate );
|
||||||
|
/*
|
||||||
|
* Unneeded, since addReservations returns any item currently on loan. Dates do not need to be checked for every day in loan.
|
||||||
|
* Date end = DateUtil.incrementDate( start, noOfDays-1 );
|
||||||
|
*/
|
||||||
|
String rID = generateReservationNo(); // Generate a sequential ID for the reservation.
|
||||||
|
LibraryReservation reservation = new LibraryReservation( rID, itemCode, userID, startDate, noOfDays ); // Create new reservation, passing parameters to the constructor.
|
||||||
|
/** Instead of the following For loop, I could've implemented
|
||||||
|
* Arrays.asList( diary.getReservation( start, end ).contains( reservation )
|
||||||
|
* Although this would've been easier, this implementation is more in the scope of what we have learned.
|
||||||
|
**/
|
||||||
|
for ( LibraryReservation diaryReservation : diary.getReservations( start ) )
|
||||||
|
{
|
||||||
|
if ( diaryReservation.toString().equals( reservation.toString() ) )
|
||||||
|
{
|
||||||
|
System.err.println( "This item is already reserved" );
|
||||||
|
return false; // Reservation unsuccessful
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
storeLibraryReservation( reservation );
|
||||||
|
itemsMap.get( itemCode ).setOnLoan( true ); // Set the loan status for the item when the reservation is made
|
||||||
|
return true; // Reservation successful
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows the deletion of a library reservation.
|
||||||
|
*
|
||||||
|
* Takes Parameter
|
||||||
|
* String @reservationNo
|
||||||
|
*
|
||||||
|
* Removes the corresponding value from the hashMap and diary.
|
||||||
|
*/
|
||||||
|
public void deleteLibraryReservation( String reservationNo )
|
||||||
|
{
|
||||||
|
if ( libraryReservationMap.containsKey( reservationNo ) )
|
||||||
|
{
|
||||||
|
// Since the application does not know the time, or use timers, this is the best I can do to remove the loan status.
|
||||||
|
itemsMap.get ( libraryReservationMap.get( reservationNo ).getItemCode() ).setOnLoan( false );
|
||||||
|
diary.deleteReservation( libraryReservationMap.get( reservationNo ) ); // Remove the reservation from the diary
|
||||||
|
libraryReservationMap.remove( reservationNo ); // Remove the reservation from the Map.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,30 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=
|
||||||
|
comment0.target=java.lang.String\ getTitle()
|
||||||
|
comment0.text=\n\ Field\ Accessor\ Start\n
|
||||||
|
comment1.params=
|
||||||
|
comment1.target=java.lang.String\ getItemCode()
|
||||||
|
comment10.params=
|
||||||
|
comment10.target=void\ printDetails()
|
||||||
|
comment10.text=\n\ Forms\ field\ variables\ in\ a\ desired\ format,\ prints\n\ to\ the\ PrintWriter,\ and\ flush\ to\ the\ file.\n\ Takes\ Parameter\n\ \ PrintWriter\ @writer\n
|
||||||
|
comment11.params=detailScanner
|
||||||
|
comment11.target=void\ readItemData(java.util.Scanner)
|
||||||
|
comment11.text=\n\ Populate\ the\ fields\ with\ details\ from\ the\ scanner\n\ Takes\ Parameters\n\ \ Scanner\ @detailScanner\n
|
||||||
|
comment2.params=
|
||||||
|
comment2.target=int\ getCost()
|
||||||
|
comment3.params=
|
||||||
|
comment3.target=int\ getTimesBorrowed()
|
||||||
|
comment4.params=
|
||||||
|
comment4.target=boolean\ getOnLoan()
|
||||||
|
comment5.params=title
|
||||||
|
comment5.target=void\ setTitle(java.lang.String)
|
||||||
|
comment5.text=\n\ Field\ Accessor\ End\n\ \n\ Field\ Mutator\ Start\n
|
||||||
|
comment6.params=itemCode
|
||||||
|
comment6.target=void\ setItemCode(java.lang.String)
|
||||||
|
comment7.params=cost
|
||||||
|
comment7.target=void\ setCost(int)
|
||||||
|
comment8.params=timesBorrowed
|
||||||
|
comment8.target=void\ setTimesBorrowed(int)
|
||||||
|
comment9.params=onLoan
|
||||||
|
comment9.target=void\ setOnLoan(boolean)
|
||||||
|
numComments=12
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
import java.util.Scanner;
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Superclass of items / assets stored in a Library.
|
||||||
|
*
|
||||||
|
* @author George Wilkinson
|
||||||
|
* @version 4.1
|
||||||
|
*/
|
||||||
|
public abstract class LibraryItem
|
||||||
|
{
|
||||||
|
// instance variables
|
||||||
|
private String title;
|
||||||
|
private String itemCode;
|
||||||
|
private int cost;
|
||||||
|
private int timesBorrowed;
|
||||||
|
private boolean onLoan;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Field Accessor Start
|
||||||
|
*/
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getItemCode()
|
||||||
|
{
|
||||||
|
return itemCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCost()
|
||||||
|
{
|
||||||
|
return cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTimesBorrowed()
|
||||||
|
{
|
||||||
|
return timesBorrowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getOnLoan()
|
||||||
|
{
|
||||||
|
return onLoan;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Field Accessor End
|
||||||
|
*
|
||||||
|
* Field Mutator Start
|
||||||
|
*/
|
||||||
|
|
||||||
|
public void setTitle( String title )
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemCode( String itemCode )
|
||||||
|
{
|
||||||
|
this.itemCode = itemCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCost( int cost )
|
||||||
|
{
|
||||||
|
this.cost = cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimesBorrowed( int timesBorrowed )
|
||||||
|
{
|
||||||
|
this.timesBorrowed = timesBorrowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnLoan( boolean onLoan )
|
||||||
|
{
|
||||||
|
this.onLoan = onLoan;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Field Mutator End
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forms field variables in a desired format, prints
|
||||||
|
* to the PrintWriter, and flush to the file.
|
||||||
|
* Takes Parameter
|
||||||
|
* PrintWriter @writer
|
||||||
|
*/
|
||||||
|
public void printDetails()
|
||||||
|
{
|
||||||
|
System.out.println("Item Code: " + itemCode +
|
||||||
|
"\nTitle: " + title +
|
||||||
|
"\nCost: £" + ( ( float )( cost ) )/100 + // Convert cost in pence to £pounds.pence to be more readable.
|
||||||
|
"\nBorrowed " + getTimesBorrowed() + " times." );
|
||||||
|
if( getOnLoan() )
|
||||||
|
System.out.println( "On Loan");
|
||||||
|
else
|
||||||
|
System.out.println( "Available to Loan");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the fields with details from the scanner
|
||||||
|
* Takes Parameters
|
||||||
|
* Scanner @detailScanner
|
||||||
|
*/
|
||||||
|
public void readItemData( Scanner detailScanner ) {
|
||||||
|
|
||||||
|
if ( detailScanner != null ) {
|
||||||
|
this.title = detailScanner.next().trim();
|
||||||
|
this.itemCode = detailScanner.next().trim();
|
||||||
|
this.cost = Integer.parseInt( detailScanner.next().trim() );
|
||||||
|
this.timesBorrowed = Integer.parseInt( detailScanner.next().trim() );
|
||||||
|
this.onLoan = Boolean.parseBoolean( detailScanner.next().trim() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,42 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=reservationNo\ itemCode\ userID\ startDate\ noOfDays
|
||||||
|
comment0.target=LibraryReservation(java.lang.String,\ java.lang.String,\ java.lang.String,\ java.lang.String,\ int)
|
||||||
|
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ LibraryReservation\n
|
||||||
|
comment1.params=
|
||||||
|
comment1.target=LibraryReservation()
|
||||||
|
comment1.text=\n\ Default\ Constructor\ for\ objects\ of\ class\ LibraryReservation\n
|
||||||
|
comment10.params=startDate
|
||||||
|
comment10.target=void\ setStartDate(java.lang.String)
|
||||||
|
comment11.params=noOfDays
|
||||||
|
comment11.target=void\ setNoOfDays(int)
|
||||||
|
comment12.params=
|
||||||
|
comment12.target=java.lang.String\ toString()
|
||||||
|
comment12.text=\n\ Concatenates\ values\ to\ output\ a\ formatted\ string.\n
|
||||||
|
comment13.params=
|
||||||
|
comment13.target=void\ printDetails()
|
||||||
|
comment13.text=\n\ Prints\ to\ terminal,\ the\ details\ of\ the\ reservation.\n
|
||||||
|
comment14.params=writer
|
||||||
|
comment14.target=void\ writeData(java.io.PrintWriter)
|
||||||
|
comment14.text=\n\ Forms\ field\ variables\ in\ a\ desired\ format,\ prints\n\ to\ the\ PrintWriter,\ and\ flush\ to\ the\ file.\n\ Takes\ Parameter\n\ \ PrintWriter\ @writer\n
|
||||||
|
comment15.params=detailScanner
|
||||||
|
comment15.target=void\ readData(java.util.Scanner)
|
||||||
|
comment15.text=\n\ Populate\ the\ fields\ with\ details\ from\ the\ scanner\n\ Takes\ Parameters\n\ \ Scanner\ @detailScanner\n
|
||||||
|
comment2.params=
|
||||||
|
comment2.target=java.lang.String\ getReservationNo()
|
||||||
|
comment2.text=\n\ Accessor\ Start\n
|
||||||
|
comment3.params=
|
||||||
|
comment3.target=java.lang.String\ getItemCode()
|
||||||
|
comment4.params=
|
||||||
|
comment4.target=java.lang.String\ userID()
|
||||||
|
comment5.params=
|
||||||
|
comment5.target=java.util.Date\ getStartDate()
|
||||||
|
comment6.params=
|
||||||
|
comment6.target=int\ getNoOfDays()
|
||||||
|
comment7.params=reservationNo
|
||||||
|
comment7.target=void\ setReservationNo(java.lang.String)
|
||||||
|
comment7.text=\n\ Mutator\ Start\n
|
||||||
|
comment8.params=itemCode
|
||||||
|
comment8.target=void\ setItemCode(java.lang.String)
|
||||||
|
comment9.params=userID
|
||||||
|
comment9.target=void\ setUserID(java.lang.String)
|
||||||
|
numComments=16
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* A class to track and allow for reservations in a Library
|
||||||
|
*
|
||||||
|
* @George Wilkinson
|
||||||
|
* @1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class LibraryReservation
|
||||||
|
{
|
||||||
|
// instance variables
|
||||||
|
private String reservationNo;
|
||||||
|
private String itemCode;
|
||||||
|
private String userID;
|
||||||
|
private Date startDate;
|
||||||
|
private int noOfDays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for objects of class LibraryReservation
|
||||||
|
*/
|
||||||
|
public LibraryReservation( String reservationNo, String itemCode, String userID, String startDate, int noOfDays )
|
||||||
|
{
|
||||||
|
this.reservationNo = reservationNo;
|
||||||
|
this.itemCode = itemCode;
|
||||||
|
this.userID = userID;
|
||||||
|
this.startDate = DateUtil.convertStringToDate( startDate );
|
||||||
|
this.noOfDays = noOfDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default Constructor for objects of class LibraryReservation
|
||||||
|
*/
|
||||||
|
public LibraryReservation(){}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accessor Start
|
||||||
|
*/
|
||||||
|
|
||||||
|
public String getReservationNo()
|
||||||
|
{
|
||||||
|
return reservationNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getItemCode()
|
||||||
|
{
|
||||||
|
return itemCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String userID()
|
||||||
|
{
|
||||||
|
return userID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getStartDate()
|
||||||
|
{
|
||||||
|
return startDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNoOfDays()
|
||||||
|
{
|
||||||
|
return noOfDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accessor End
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mutator Start
|
||||||
|
*/
|
||||||
|
|
||||||
|
public void setReservationNo( String reservationNo )
|
||||||
|
{
|
||||||
|
this.reservationNo = reservationNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemCode( String itemCode )
|
||||||
|
{
|
||||||
|
this.itemCode = itemCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserID( String userID )
|
||||||
|
{
|
||||||
|
this.userID = userID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartDate( String startDate )
|
||||||
|
{
|
||||||
|
this.startDate = DateUtil.convertStringToDate( startDate );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoOfDays( int noOfDays )
|
||||||
|
{
|
||||||
|
this.noOfDays = noOfDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mutator End
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Concatenates values to output a formatted string.
|
||||||
|
*/
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return reservationNo + " " + userID + " " + itemCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prints to terminal, the details of the reservation.
|
||||||
|
*/
|
||||||
|
public void printDetails()
|
||||||
|
{
|
||||||
|
System.out.println( "Reservation Number: " + reservationNo +
|
||||||
|
"\nItem Code: " + itemCode +
|
||||||
|
"\nUser ID: " + userID +
|
||||||
|
"\nDate Commencing: " + DateUtil.convertDateToShortString( startDate ) +
|
||||||
|
"\nDuration: " + noOfDays + " days" );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forms field variables in a desired format, prints
|
||||||
|
* to the PrintWriter, and flush to the file.
|
||||||
|
* Takes Parameter
|
||||||
|
* PrintWriter @writer
|
||||||
|
*/
|
||||||
|
public void writeData( PrintWriter writer )
|
||||||
|
{
|
||||||
|
writer.print( reservationNo + "," + itemCode + "," + userID + "," + DateUtil.convertDateToShortString( startDate ) + "," + noOfDays );
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the fields with details from the scanner
|
||||||
|
* Takes Parameters
|
||||||
|
* Scanner @detailScanner
|
||||||
|
*/
|
||||||
|
public void readData( Scanner detailScanner )
|
||||||
|
{
|
||||||
|
if ( detailScanner != null ) {
|
||||||
|
this.reservationNo = detailScanner.next().trim();
|
||||||
|
this.itemCode = detailScanner.next().trim();
|
||||||
|
this.userID = detailScanner.next().trim();
|
||||||
|
this.startDate = DateUtil.convertStringToDate( detailScanner.next().trim() );
|
||||||
|
this.noOfDays = Integer.parseInt( detailScanner.next().trim() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,36 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=
|
||||||
|
comment0.target=LibraryUser()
|
||||||
|
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ LibraryUser.\n
|
||||||
|
comment1.params=
|
||||||
|
comment1.target=java.lang.String\ getUserID()
|
||||||
|
comment1.text=\n\ Accessor\ start\ -\ return\ values\ of\ corresponding\ variables.\n
|
||||||
|
comment10.params=title
|
||||||
|
comment10.target=void\ setTitle(java.lang.String)
|
||||||
|
comment11.params=writer
|
||||||
|
comment11.target=void\ writeData(java.io.PrintWriter)
|
||||||
|
comment11.text=\n\ Forms\ field\ variables\ in\ a\ desired\ format,\ prints\n\ to\ the\ PrintWriter,\ and\ flush\ to\ the\ file.\n\ Takes\ Parameter\n\ \ PrintWriter\ @writer\n
|
||||||
|
comment12.params=
|
||||||
|
comment12.target=void\ printDetails()
|
||||||
|
comment12.text=\n\ Print\ to\ terminal\ all\ relevant\ fields.\n
|
||||||
|
comment13.params=detailScanner
|
||||||
|
comment13.target=void\ readData(java.util.Scanner)
|
||||||
|
comment13.text=\n\ Populate\ the\ fields\ with\ details\ from\ the\ scanner\n\ Takes\ Parameters\n\ \ Scanner\ @detailScanner\n
|
||||||
|
comment2.params=
|
||||||
|
comment2.target=java.lang.String\ getSurname()
|
||||||
|
comment3.params=
|
||||||
|
comment3.target=java.lang.String\ getFirstName()
|
||||||
|
comment4.params=
|
||||||
|
comment4.target=java.lang.String\ getOtherInitials()
|
||||||
|
comment5.params=
|
||||||
|
comment5.target=java.lang.String\ getTitle()
|
||||||
|
comment6.params=userID
|
||||||
|
comment6.target=void\ setUserID(java.lang.String)
|
||||||
|
comment6.text=\n\ Accessor\ End\n\ Mutator\ Start\ -\ Set\ value\ of\ corresponding\ variables\n
|
||||||
|
comment7.params=surname
|
||||||
|
comment7.target=void\ setSurname(java.lang.String)
|
||||||
|
comment8.params=firstName
|
||||||
|
comment8.target=void\ setFirstName(java.lang.String)
|
||||||
|
comment9.params=otherInitials
|
||||||
|
comment9.target=void\ setOtherInitials(java.lang.String)
|
||||||
|
numComments=14
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* Class LibraryUser to create a user of a library.
|
||||||
|
*
|
||||||
|
* @George Wilkinson
|
||||||
|
* @2.3
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
public class LibraryUser
|
||||||
|
{
|
||||||
|
// instance variables
|
||||||
|
private String userID, surname, firstName, otherInitials, title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for objects of class LibraryUser.
|
||||||
|
*/
|
||||||
|
public LibraryUser(){}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Accessor start - return values of corresponding variables.
|
||||||
|
*/
|
||||||
|
public String getUserID()
|
||||||
|
{
|
||||||
|
return userID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSurname()
|
||||||
|
{
|
||||||
|
return surname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstName()
|
||||||
|
{
|
||||||
|
return firstName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOtherInitials()
|
||||||
|
{
|
||||||
|
return otherInitials;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Accessor End
|
||||||
|
* Mutator Start - Set value of corresponding variables
|
||||||
|
*/
|
||||||
|
|
||||||
|
public void setUserID( String userID )
|
||||||
|
{
|
||||||
|
this.userID = userID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSurname( String surname )
|
||||||
|
{
|
||||||
|
this.surname = surname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstName( String firstName )
|
||||||
|
{
|
||||||
|
this.firstName = firstName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOtherInitials( String otherInitials )
|
||||||
|
{
|
||||||
|
this.otherInitials = otherInitials;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle( String title )
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Mutator End
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forms field variables in a desired format, prints
|
||||||
|
* to the PrintWriter, and flush to the file.
|
||||||
|
* Takes Parameter
|
||||||
|
* PrintWriter @writer
|
||||||
|
*/
|
||||||
|
public void writeData( PrintWriter writer )
|
||||||
|
{
|
||||||
|
writer.print(userID + ", " + surname + ", " + firstName + ", " + otherInitials + ", " + title + "\n");
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print to terminal all relevant fields.
|
||||||
|
*/
|
||||||
|
public void printDetails()
|
||||||
|
{
|
||||||
|
System.out.println( "ID: " + userID +
|
||||||
|
"\nName: " + title + " " + firstName + " " + otherInitials + " " + surname );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the fields with details from the scanner
|
||||||
|
* Takes Parameters
|
||||||
|
* Scanner @detailScanner
|
||||||
|
*/
|
||||||
|
public void readData( Scanner detailScanner )
|
||||||
|
{
|
||||||
|
if ( detailScanner != null ) {
|
||||||
|
this.userID = detailScanner.next().trim();
|
||||||
|
this.surname = detailScanner.next().trim();
|
||||||
|
this.firstName = detailScanner.next().trim();
|
||||||
|
this.otherInitials = detailScanner.next().trim();
|
||||||
|
this.title = detailScanner.next().trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,17 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=
|
||||||
|
comment0.target=Periodical()
|
||||||
|
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ Periodical\n\ Since\ all\ field\ variables\ initialise\ as\ null,\ nothing\ should\ happen\ here.\n
|
||||||
|
comment1.params=
|
||||||
|
comment1.target=java.lang.String\ getPublicationDate()
|
||||||
|
comment1.text=\n\ Return\ value\ of\ @publicationDate\n
|
||||||
|
comment2.params=publicationDate
|
||||||
|
comment2.target=void\ setPublicationDate(java.lang.String)
|
||||||
|
comment2.text=\n\ Set\ value\ of\ @publicationDate\n
|
||||||
|
comment3.params=
|
||||||
|
comment3.target=void\ printDetails()
|
||||||
|
comment3.text=\n\ Print\ to\ terminal,\ relevant\ field\ variable's\ values.\n
|
||||||
|
comment4.params=detailScanner
|
||||||
|
comment4.target=void\ readItemData(java.util.Scanner)
|
||||||
|
comment4.text=\n\ Populate\ the\ fields\ with\ details\ from\ the\ scanner\n\ Takes\ Parameters\n\ \ Scanner\ @detailScanner\n
|
||||||
|
numComments=5
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* Subclass of LibraryItem to create a periodical ( e.g. newspaper, tabloid ).
|
||||||
|
*
|
||||||
|
* @George Wilkinson
|
||||||
|
* @2.5
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class Periodical extends PrintedItem
|
||||||
|
{
|
||||||
|
private String publicationDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for objects of class Periodical
|
||||||
|
* Since all field variables initialise as null, nothing should happen here.
|
||||||
|
*/
|
||||||
|
public Periodical(){}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return value of @publicationDate
|
||||||
|
*/
|
||||||
|
public String getPublicationDate()
|
||||||
|
{
|
||||||
|
return publicationDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set value of @publicationDate
|
||||||
|
*/
|
||||||
|
public void setPublicationDate( String publicationDate )
|
||||||
|
{
|
||||||
|
this.publicationDate = publicationDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print to terminal, relevant field variable's values.
|
||||||
|
*/
|
||||||
|
public void printDetails() {
|
||||||
|
System.out.println( "Publication Date: " + publicationDate );
|
||||||
|
super.printDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the fields with details from the scanner
|
||||||
|
* Takes Parameters
|
||||||
|
* Scanner @detailScanner
|
||||||
|
*/
|
||||||
|
public void readItemData( Scanner detailScanner ){
|
||||||
|
if ( detailScanner != null ) {
|
||||||
|
this.publicationDate = detailScanner.next().trim();
|
||||||
|
super.readItemData( detailScanner );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,18 @@
|
|||||||
|
#BlueJ class context
|
||||||
|
comment0.params=
|
||||||
|
comment0.target=int\ getNoOfPages()
|
||||||
|
comment0.text=\n\ Field\ Accessor\ Start\n
|
||||||
|
comment1.params=
|
||||||
|
comment1.target=java.lang.String\ getPublisher()
|
||||||
|
comment2.params=noOfPages
|
||||||
|
comment2.target=void\ setNoOfPages(int)
|
||||||
|
comment2.text=\n\ Field\ Accessor\ End\n\ \n\ Field\ Mutator\ Start\n
|
||||||
|
comment3.params=publisher
|
||||||
|
comment3.target=void\ setPublisher(java.lang.String)
|
||||||
|
comment4.params=
|
||||||
|
comment4.target=void\ printDetails()
|
||||||
|
comment4.text=\n\ Field\ Mutator\ End\n
|
||||||
|
comment5.params=detailScanner
|
||||||
|
comment5.target=void\ readItemData(java.util.Scanner)
|
||||||
|
comment5.text=\n\ Populate\ the\ fields\ with\ details\ from\ the\ scanner\n\ Takes\ Parameters\n\ \ Scanner\ @detailScanner\n
|
||||||
|
numComments=6
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
|
||||||
|
/**
|
||||||
|
* Subclass of LibraryItem to create objects of printed items in a library.
|
||||||
|
*
|
||||||
|
* @George Wilkinson
|
||||||
|
* @1.1
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public abstract class PrintedItem extends LibraryItem
|
||||||
|
{
|
||||||
|
private int noOfPages;
|
||||||
|
private String publisher;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Field Accessor Start
|
||||||
|
*/
|
||||||
|
public int getNoOfPages()
|
||||||
|
{
|
||||||
|
return noOfPages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPublisher()
|
||||||
|
{
|
||||||
|
return publisher;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Field Accessor End
|
||||||
|
*
|
||||||
|
* Field Mutator Start
|
||||||
|
*/
|
||||||
|
|
||||||
|
public void setNoOfPages( int noOfPages )
|
||||||
|
{
|
||||||
|
this.noOfPages = noOfPages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPublisher( String publisher )
|
||||||
|
{
|
||||||
|
this.publisher = publisher;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Field Mutator End
|
||||||
|
*/
|
||||||
|
public void printDetails()
|
||||||
|
{
|
||||||
|
System.out.println("Page Count: " + noOfPages +
|
||||||
|
"\nPublisher: " + publisher);
|
||||||
|
super.printDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the fields with details from the scanner
|
||||||
|
* Takes Parameters
|
||||||
|
* Scanner @detailScanner
|
||||||
|
*/
|
||||||
|
public void readItemData( Scanner detailScanner ){
|
||||||
|
if ( detailScanner != null ) {
|
||||||
|
this.noOfPages = Integer.parseInt( detailScanner.next().trim() );
|
||||||
|
this.publisher = detailScanner.next().trim();
|
||||||
|
super.readItemData( detailScanner );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
------------------------------------------------------------------------
|
||||||
|
This is the project README file. Here, you should describe your project.
|
||||||
|
Tell the reader (someone who does not know anything about this project)
|
||||||
|
all he/she needs to know. The comments should usually include at least:
|
||||||
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
PROJECT TITLE:
|
||||||
|
PURPOSE OF PROJECT:
|
||||||
|
VERSION or DATE:
|
||||||
|
HOW TO START THIS PROJECT:
|
||||||
|
AUTHORS:
|
||||||
|
USER INSTRUCTIONS:
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// this is a comment, any lines that start with //
|
||||||
|
// (and blank lines) should be ignored
|
||||||
|
|
||||||
|
|
||||||
|
// data is title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
Objects First with Java, LM002411,3989,781,true
|
||||||
|
Compilers: Principles Techniques and Tools, LM002711,599,0,FALSE
|
||||||
|
C# How to Program, LM002876,4599,45,TRUE
|
||||||
|
Unix Made Easy: The Basics and Beyond (Made Easy), LM002468,6395,0,TRUE
|
||||||
|
Galerkin Finite Element Methods for Parabolic Problems, LM002153,4554,0,FALSE
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// this is a comment, any lines that start with //
|
||||||
|
// (and blank lines) should be ignored
|
||||||
|
|
||||||
|
|
||||||
|
// data is author, isbn, noOfPages, publisher, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
Barnes and Kolling, 9780131976290,480, Pearson, Objects First with Java, LM002411,3989,781,true
|
||||||
|
Aho Sethi and Ullman, 9780201101942,795, Addison-Wesley, Compilers: Principles Techniques and Tools, LM002711,599,0,FALSE
|
||||||
|
Harvey Paul and Jeffrey, 9780130622211,1568, Prentice Hall, C# How to Program, LM002876,4599,45,TRUE
|
||||||
|
Muster, 9780072193145,1011, McGraw-Hill, Unix Made Easy: The Basics and Beyond (Made Easy), LM002468,6395,0,TRUE
|
||||||
|
Thomee, 9783540331216,370, Springer Verlag, Galerkin Finite Element Methods for Parabolic Problems, LM002153,4554,0,FALSE
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// this is a comment, any lines that start with //
|
||||||
|
// (and blank lines) should be ignored
|
||||||
|
|
||||||
|
|
||||||
|
[Book data]
|
||||||
|
// data is author, isbn, noOfPages, publisher, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
Barnes and Kolling, 9780131976290,480, Pearson, Objects First with Java, LM002411,3989,781,true
|
||||||
|
Aho Sethi and Ullman, 9780201101942,795, Addison-Wesley, Compilers: Principles Techniques and Tools, LM002711,599,0,FALSE
|
||||||
|
Harvey Paul and Jeffrey, 9780130622211,1568, Prentice Hall, C# How to Program, LM002876,4599,45,TRUE
|
||||||
|
Muster, 9780072193145,1011, McGraw-Hill, Unix Made Easy: The Basics and Beyond (Made Easy), LM002468,6395,0,TRUE
|
||||||
|
Thomee, 9783540331216,370, Springer Verlag, Galerkin Finite Element Methods for Parabolic Problems, LM002153,4554,0,FALSE
|
||||||
|
|
||||||
|
[periodical data]
|
||||||
|
// data is publicationDate, noOfPages, publisher, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
25-03-20,70, News International, The Times, LM005447,80,250000,FALSE
|
||||||
|
26-03-20,70, News International, The Times, LM005002,80,560562,false
|
||||||
|
26-04-20, 70, Associated Newspapers, Daily Mail, LM005177,75,478908,false
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// this is a comment, any lines that start with //
|
||||||
|
// (and blank lines) should be ignored
|
||||||
|
|
||||||
|
|
||||||
|
[Book data]
|
||||||
|
// data is author, isbn, noOfPages, publisher, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
Barnes and Kolling, 9780131976290,480, Pearson, Objects First with Java, LM002411,3989,781,true
|
||||||
|
Aho Sethi and Ullman, 9780201101942,795, Addison-Wesley, Compilers: Principles Techniques and Tools, LM002711,599,0,FALSE
|
||||||
|
Harvey Paul and Jeffrey, 9780130622211,1568, Prentice Hall, C# How to Program, LM002876,4599,45,TRUE
|
||||||
|
Muster, 9780072193145,1011, McGraw-Hill, Unix Made Easy: The Basics and Beyond (Made Easy), LM002468,6395,0,TRUE
|
||||||
|
Thomee, 9783540331216,370, Springer Verlag, Galerkin Finite Element Methods for Parabolic Problems, LM002153,4554,0,FALSE
|
||||||
|
|
||||||
|
[periodical data]
|
||||||
|
// data is publicationDate, noOfPages, publisher, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
25-03-20,70, News International, The Times, LM005447,80,250000,FALSE
|
||||||
|
26-03-20,70, News International, The Times, LM005002,80,560562,false
|
||||||
|
26-04-20, 70, Associated Newspapers, Daily Mail, LM005177,75,478908,false
|
||||||
|
|
||||||
|
[misc data]
|
||||||
|
25-03-20,70, News International, The Times, LM005447,80,250000,FALSE
|
||||||
|
26-03-20,70, News International, The Times, LM005002,80,560562,false
|
||||||
|
26-04-20, 70, Associated Newspapers, Daily Mail, LM005177,75,478908,false
|
||||||
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
// this is a comment, any lines that start with //
|
||||||
|
// (and blank lines) should be ignored
|
||||||
|
|
||||||
|
[Book data]
|
||||||
|
// data is author, isbn, noOfPages, publisher, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
Barnes and Kolling, 9780131976290,480, Pearson, Objects First with Java, LM002411,3989,781,true
|
||||||
|
Aho Sethi and Ullman, 9780201101942,795, Addison-Wesley, Compilers: Principles Techniques and Tools, LM002711,599,500,FALSE
|
||||||
|
Harvey Paul and Jeffrey, 9780130622211,1568, Prentice Hall, C# How to Program, LM002876,4599,45,TRUE
|
||||||
|
Muster, 9780072193145,1011, McGraw-Hill, Unix Made Easy: The Basics and Beyond (Made Easy), LM002468,6395,678,TRUE
|
||||||
|
Thomee, 9783540331216,370, Springer Verlag, Galerkin Finite Element Methods for Parabolic Problems, LM002153,4554,543,FALSE
|
||||||
|
|
||||||
|
[periodical data]
|
||||||
|
// data is publicationDate, noOfPages, publisher, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
25-03-20,70, News International, The Times, LM005447,80,250000,FALSE
|
||||||
|
26-03-20,70, News International, The Times, LM005002,80,560562,false
|
||||||
|
26-04-20, 70, Associated Newspapers, Daily Mail, LM005177,75,478908,false
|
||||||
|
|
||||||
|
[CD data]
|
||||||
|
|
||||||
|
// data is artist, noOfTracks, playingTime, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
|
||||||
|
James Blunt,15,68, Back to Bedlam, LM003604,498,234,true
|
||||||
|
Duffy,10,73, Rockferry, LM003553,898,90,false
|
||||||
|
Adele,12,19,75, LM003580,798,87,FALSE
|
||||||
|
Robert Plant and Alison Krauss,13,72, Raising Sand, LM003750,898,89,tRUE
|
||||||
|
Goldfrapp,10,72, Seventh Tree, LM003873,1299,9876,true
|
||||||
|
Amy Winehouse,11,70, Back To Black, LM003698,698,8765,false
|
||||||
|
Jack Johnson,15,67, Sleep Through The Static, LM003773,898,54,True
|
||||||
|
Mark Ronson,14,74, Version, LM003365,698,56,true
|
||||||
|
Radiohead,10,75, In Rainbows , LM003771,798,6543,FALSE
|
||||||
|
Nick Cave,11,68, Dig!!! Lazarus Dig!!!, LM003751,1199,90,False
|
||||||
|
Nickelback,11,72, All the Right Reasons, LM003915,598,32,true
|
||||||
|
|
||||||
|
[DVD data]
|
||||||
|
|
||||||
|
// data is director, playingTime, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
Chris Miller,92, Shrek The Third, LM004314,1026,900,TRUE
|
||||||
|
Robert Zemeckis,114, Beowulf , LM004079,900,87,FALSE
|
||||||
|
Phyllida Lloyd,118, Mamma Mia, LM004984,798,566,true
|
||||||
|
Joe Wright,130, Atonement, LM004720,1293,66,true
|
||||||
|
Andrew Adamson,125, The Chronicles of Narnia: Prince Caspian, LM004178,345,45,FALSE
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
// this is a comment, any lines that start with //
|
||||||
|
// (and blank lines) should be ignored
|
||||||
|
|
||||||
|
[Book data]
|
||||||
|
// data is author, isbn, noOfPages, publisher, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
Barnes and Kolling, 9780131976290,480, Pearson, Objects First with Java, LM002411,3989,781,true
|
||||||
|
Aho Sethi and Ullman, 9780201101942,795, Addison-Wesley, Compilers: Principles Techniques and Tools, LM002711,599,890,FALSE
|
||||||
|
Harvey Paul and Jeffrey, 9780130622211,1568, Prentice Hall, C# How to Program, LM002876,4599,45,TRUE
|
||||||
|
Muster, 9780072193145,1011, McGraw-Hill, Unix Made Easy: The Basics and Beyond (Made Easy), LM002468,6395,8765,TRUE
|
||||||
|
Thomee, 9783540331216,370, Springer Verlag, Galerkin Finite Element Methods for Parabolic Problems, LM002153,4554,780,FALSE
|
||||||
|
|
||||||
|
[CD data]
|
||||||
|
|
||||||
|
// data is artist, noOfTracks, playingTime, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
|
||||||
|
James Blunt,15,68, Back to Bedlam, LM003604,498,234,true
|
||||||
|
Duffy,10,73, Rockferry, LM003553,898,90,false
|
||||||
|
Adele,12,19,75, LM003580,798,87,FALSE
|
||||||
|
Robert Plant and Alison Krauss,13,72, Raising Sand, LM003750,898,89,tRUE
|
||||||
|
Goldfrapp,10,72, Seventh Tree, LM003873,1299,9876,true
|
||||||
|
Amy Winehouse,11,70, Back To Black, LM003698,698,8765,false
|
||||||
|
Jack Johnson,15,67, Sleep Through The Static, LM003773,898,54,True
|
||||||
|
Mark Ronson,14,74, Version, LM003365,698,56,true
|
||||||
|
Radiohead,10,75, In Rainbows , LM003771,798,6543,FALSE
|
||||||
|
Nick Cave,11,68, Dig!!! Lazarus Dig!!!, LM003751,1199,90,False
|
||||||
|
Nickelback,11,72, All the Right Reasons, LM003915,598,32,true
|
||||||
|
|
||||||
|
[DVD data]
|
||||||
|
|
||||||
|
// data is director, playingTime, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
Chris Miller,92, Shrek The Third, LM004314,1026,900,TRUE
|
||||||
|
Robert Zemeckis,114, Beowulf , LM004079,900,87,FALSE
|
||||||
|
Phyllida Lloyd,118, Mamma Mia, LM004984,798,566,true
|
||||||
|
Joe Wright,130, Atonement, LM004720,1293,66,true
|
||||||
|
Andrew Adamson,125, The Chronicles of Narnia: Prince Caspian, LM004178,345,45,FALSE
|
||||||
|
|
||||||
|
[periodical data]
|
||||||
|
// data is publicationDate, noOfPages, publisher, title, itemCode, cost, timesBorrowed, onLoan
|
||||||
|
25-03-08,70, News International, The Times, LM005447,80,0,FALSE
|
||||||
|
26-03-08,70, News International, The Times, LM005002,80,0,false
|
||||||
|
26-03-08,60, Associated Newspapers, Daily Mail, LM005177,40,0,false
|
||||||
|
|
||||||
|
[Library User Data]
|
||||||
|
// data is userID, surname, firstName, otherInitials, title
|
||||||
|
unknown, Newton, David, E, Dr
|
||||||
|
unknown, Gregson, Brian, R T, Mr
|
||||||
|
unknown, Evans, David, , Dr
|
||||||
|
unknown, Smith, Sara, C, Ms
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// this is a comment, any lines that start with //
|
||||||
|
// (and blank lines) should be ignored
|
||||||
|
|
||||||
|
// New user data
|
||||||
|
// data is userID, surname, firstName, otherInitials, title
|
||||||
|
|
||||||
|
[Library User Data]
|
||||||
|
|
||||||
|
unknown, Newton, David, E, Dr
|
||||||
|
unknown, Gregson, Brian, R T, Mr
|
||||||
|
unknown, Evans, David, , Dr
|
||||||
|
unknown, Smith, Sara, C, Ms
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
0,LM005002,AB-217000,24-03-2024,3
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[Library User data]
|
||||||
|
AB-217000, Gregson, Brian, R T, Mr
|
||||||
|
AB-711612, Smith, Sara, C, Ms
|
||||||
|
AB-861906, Evans, David, , Dr
|
||||||
|
AB-573164, Newton, David, E, Dr
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc (build 1.8.0_392) on Thu Feb 29 11:54:14 GMT 2024 -->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
Book
|
||||||
|
</TITLE>
|
||||||
|
|
||||||
|
<META NAME="date" CONTENT="2024-02-29">
|
||||||
|
|
||||||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||||
|
|
||||||
|
<SCRIPT type="text/javascript">
|
||||||
|
function windowTitle()
|
||||||
|
{
|
||||||
|
if (location.href.indexOf('is-external=true') == -1) {
|
||||||
|
parent.document.title="Book";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</SCRIPT>
|
||||||
|
<NOSCRIPT>
|
||||||
|
</NOSCRIPT>
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
|
||||||
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<H2>
|
||||||
|
Class Book</H2>
|
||||||
|
<PRE>
|
||||||
|
java.lang.Object
|
||||||
|
<IMG SRC="./resources/inherit.gif" ALT="extended by ">LibraryItem
|
||||||
|
<IMG SRC="./resources/inherit.gif" ALT="extended by ">PrintedItem
|
||||||
|
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Book</B>
|
||||||
|
</PRE>
|
||||||
|
<HR>
|
||||||
|
<DL>
|
||||||
|
<DT><PRE>public class <B>Book</B><DT>extends PrintedItem</DL>
|
||||||
|
</PRE>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
|
||||||
|
<A NAME="constructor_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Constructor Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE><B><A HREF="Book.html#Book()">Book</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Constructor for objects of class Book</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
|
||||||
|
<A NAME="method_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Method Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="Book.html#printDetails()">printDetails</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="Book.html#readItemData(java.util.Scanner)">readItemData</A></B>(java.util.Scanner detailScanner)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
<A NAME="methods_inherited_from_class_PrintedItem"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||||
|
<TH ALIGN="left"><B>Methods inherited from class PrintedItem</B></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE>getNoOfPages, getPublisher, setNoOfPages, setPublisher</CODE></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
<A NAME="methods_inherited_from_class_LibraryItem"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||||
|
<TH ALIGN="left"><B>Methods inherited from class LibraryItem</B></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE>getCost, getItemCode, getOnLoan, getTimesBorrowed, getTitle, setCost, setItemCode, setOnLoan, setTimesBorrowed, setTitle</CODE></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||||
|
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
|
||||||
|
<A NAME="constructor_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Constructor Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="Book()"><!-- --></A><H3>
|
||||||
|
Book</H3>
|
||||||
|
<PRE>
|
||||||
|
public <B>Book</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Constructor for objects of class Book
|
||||||
|
<P>
|
||||||
|
</DL>
|
||||||
|
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
|
||||||
|
<A NAME="method_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Method Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="printDetails()"><!-- --></A><H3>
|
||||||
|
printDetails</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>printDetails</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
<DT><B>Overrides:</B><DD><CODE>printDetails</CODE> in class <CODE>LibraryItem</CODE></DL>
|
||||||
|
</DD>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="readItemData(java.util.Scanner)"><!-- --></A><H3>
|
||||||
|
readItemData</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>readItemData</B>(java.util.Scanner detailScanner)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
<DT><B>Overrides:</B><DD><CODE>readItemData</CODE> in class <CODE>PrintedItem</CODE></DL>
|
||||||
|
</DD>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,379 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc (build 1.8.0_402) on Thu Mar 21 22:06:18 GMT 2024 -->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
DateUtil
|
||||||
|
</TITLE>
|
||||||
|
|
||||||
|
<META NAME="date" CONTENT="2024-03-21">
|
||||||
|
|
||||||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||||
|
|
||||||
|
<SCRIPT type="text/javascript">
|
||||||
|
function windowTitle()
|
||||||
|
{
|
||||||
|
if (location.href.indexOf('is-external=true') == -1) {
|
||||||
|
parent.document.title="DateUtil";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</SCRIPT>
|
||||||
|
<NOSCRIPT>
|
||||||
|
</NOSCRIPT>
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
|
||||||
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<H2>
|
||||||
|
Class DateUtil</H2>
|
||||||
|
<PRE>
|
||||||
|
java.lang.Object
|
||||||
|
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>DateUtil</B>
|
||||||
|
</PRE>
|
||||||
|
<HR>
|
||||||
|
<DL>
|
||||||
|
<DT><PRE>public class <B>DateUtil</B><DT>extends java.lang.Object</DL>
|
||||||
|
</PRE>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
A class DateUtil with the following methods for dealing with dates.
|
||||||
|
|
||||||
|
public static String convertDateToLongString(Date date)
|
||||||
|
public static String convertDateToShortString(Date date)
|
||||||
|
public static Date convertStringToDate(String dateString)
|
||||||
|
public static int daysBetween(Date startDate, Date endDate)
|
||||||
|
public static Date incrementDate(Date date, int noOfDays)
|
||||||
|
public static boolean isLeapYear(int year)
|
||||||
|
public static boolean isValidDateString(String dateString)
|
||||||
|
public static Date nextDate(Date date)
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
<DL>
|
||||||
|
<DT><B>Author:</B></DT>
|
||||||
|
<DD>D E Newton</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
<!-- =========== FIELD SUMMARY =========== -->
|
||||||
|
|
||||||
|
<A NAME="field_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Field Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE>static java.text.SimpleDateFormat</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="DateUtil.html#dateFormatter">dateFormatter</A></B></CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
|
||||||
|
<A NAME="constructor_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Constructor Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE><B><A HREF="DateUtil.html#DateUtil()">DateUtil</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
|
||||||
|
<A NAME="method_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Method Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE>static java.lang.String</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="DateUtil.html#convertDateToLongString(java.util.Date)">convertDateToLongString</A></B>(java.util.Date date)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Converts a Date object to a corresponding String in
|
||||||
|
the long date pattern style "Saturday, 25 March 2023".</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE>static java.lang.String</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="DateUtil.html#convertDateToShortString(java.util.Date)">convertDateToShortString</A></B>(java.util.Date date)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Converts a Date object to a corresponding String in
|
||||||
|
the short date pattern style "25-03-2023".</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE>static java.util.Date</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="DateUtil.html#convertStringToDate(java.lang.String)">convertStringToDate</A></B>(java.lang.String dateString)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Converts a string in the short date pattern style "25-03-2023"
|
||||||
|
to a corresponding Date object.</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE>static int</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="DateUtil.html#daysBetween(java.util.Date, java.util.Date)">daysBetween</A></B>(java.util.Date startDate,
|
||||||
|
java.util.Date endDate)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Calculates the number of days between two given dates, startDate and endDate.</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE>static java.util.Date</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="DateUtil.html#incrementDate(java.util.Date, int)">incrementDate</A></B>(java.util.Date date,
|
||||||
|
int noOfDays)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Given date, a Date object, and noOfDays, an int, the method returns
|
||||||
|
a Date object corresponding to noOfDays later than date.</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE>static boolean</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="DateUtil.html#isLeapYear(int)">isLeapYear</A></B>(int year)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Given year, an int, the method checks to see if the year
|
||||||
|
is a leap year.</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE>static boolean</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="DateUtil.html#isValidDateString(java.lang.String)">isValidDateString</A></B>(java.lang.String dateString)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Given dateString, a String, the method checks to see if string
|
||||||
|
corresponds to a valid shortDatePattern.</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE>static java.util.Date</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="DateUtil.html#nextDate(java.util.Date)">nextDate</A></B>(java.util.Date date)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Given date, a Date object, the method returns
|
||||||
|
a Date object corresponding to the next day.</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||||
|
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<!-- ============ FIELD DETAIL =========== -->
|
||||||
|
|
||||||
|
<A NAME="field_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Field Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="dateFormatter"><!-- --></A><H3>
|
||||||
|
dateFormatter</H3>
|
||||||
|
<PRE>
|
||||||
|
public static java.text.SimpleDateFormat <B>dateFormatter</B></PRE>
|
||||||
|
<DL>
|
||||||
|
<DL>
|
||||||
|
</DL>
|
||||||
|
</DL>
|
||||||
|
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
|
||||||
|
<A NAME="constructor_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Constructor Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="DateUtil()"><!-- --></A><H3>
|
||||||
|
DateUtil</H3>
|
||||||
|
<PRE>
|
||||||
|
public <B>DateUtil</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
</DL>
|
||||||
|
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
|
||||||
|
<A NAME="method_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Method Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="convertDateToLongString(java.util.Date)"><!-- --></A><H3>
|
||||||
|
convertDateToLongString</H3>
|
||||||
|
<PRE>
|
||||||
|
public static java.lang.String <B>convertDateToLongString</B>(java.util.Date date)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Converts a Date object to a corresponding String in
|
||||||
|
the long date pattern style "Saturday, 25 March 2023".
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
<DT><B>Parameters:</B><DD><CODE>date</CODE> - a Date object
|
||||||
|
<DT><B>Returns:</B><DD>a String, containing a long date pattern</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="convertDateToShortString(java.util.Date)"><!-- --></A><H3>
|
||||||
|
convertDateToShortString</H3>
|
||||||
|
<PRE>
|
||||||
|
public static java.lang.String <B>convertDateToShortString</B>(java.util.Date date)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Converts a Date object to a corresponding String in
|
||||||
|
the short date pattern style "25-03-2023".
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
<DT><B>Parameters:</B><DD><CODE>date</CODE> - a Date object
|
||||||
|
<DT><B>Returns:</B><DD>a String, containing a short date pattern</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="convertStringToDate(java.lang.String)"><!-- --></A><H3>
|
||||||
|
convertStringToDate</H3>
|
||||||
|
<PRE>
|
||||||
|
public static java.util.Date <B>convertStringToDate</B>(java.lang.String dateString)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Converts a string in the short date pattern style "25-03-2023"
|
||||||
|
to a corresponding Date object.
|
||||||
|
|
||||||
|
Any leading or trailing spaces are first removed from the date string.
|
||||||
|
The String parameter that represent a date as a string must be in the
|
||||||
|
format dd-mm-yyy (e.g. 25-03-2023 or 25-3-2023) where dd represents
|
||||||
|
one or two digits representing the day in the month, similarly for
|
||||||
|
mm representing the month in the year and yyyy represents the four
|
||||||
|
digits for the year.
|
||||||
|
|
||||||
|
A RuntimeException is thrown if the date string is not recognised as
|
||||||
|
a valid date. Such exceptions do not need to be caught or thrown as
|
||||||
|
they are unchecked exceptions, but can be caught if necessary.
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
<DT><B>Parameters:</B><DD><CODE>dateString</CODE> - a Date object
|
||||||
|
<DT><B>Returns:</B><DD>the Date object</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="daysBetween(java.util.Date, java.util.Date)"><!-- --></A><H3>
|
||||||
|
daysBetween</H3>
|
||||||
|
<PRE>
|
||||||
|
public static int <B>daysBetween</B>(java.util.Date startDate,
|
||||||
|
java.util.Date endDate)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Calculates the number of days between two given dates, startDate and endDate.
|
||||||
|
|
||||||
|
If startDate is after endDate then the number of days returned will be negative.
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
<DT><B>Parameters:</B><DD><CODE>startDate</CODE> - a Date object<DD><CODE>endDate</CODE> - a Date object
|
||||||
|
<DT><B>Returns:</B><DD>an int, number of days between the dates</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="incrementDate(java.util.Date, int)"><!-- --></A><H3>
|
||||||
|
incrementDate</H3>
|
||||||
|
<PRE>
|
||||||
|
public static java.util.Date <B>incrementDate</B>(java.util.Date date,
|
||||||
|
int noOfDays)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Given date, a Date object, and noOfDays, an int, the method returns
|
||||||
|
a Date object corresponding to noOfDays later than date.
|
||||||
|
|
||||||
|
If noOfDays is negative, the resulting Date object will be before date.
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
<DT><B>Parameters:</B><DD><CODE>date</CODE> - a Date object<DD><CODE>noOfDays</CODE> - an int
|
||||||
|
<DT><B>Returns:</B><DD>a Date</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="isLeapYear(int)"><!-- --></A><H3>
|
||||||
|
isLeapYear</H3>
|
||||||
|
<PRE>
|
||||||
|
public static boolean <B>isLeapYear</B>(int year)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Given year, an int, the method checks to see if the year
|
||||||
|
is a leap year.
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
<DT><B>Parameters:</B><DD><CODE>year,</CODE> - an int
|
||||||
|
<DT><B>Returns:</B><DD>a boolean, true only if the year is a leap year.</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="isValidDateString(java.lang.String)"><!-- --></A><H3>
|
||||||
|
isValidDateString</H3>
|
||||||
|
<PRE>
|
||||||
|
public static boolean <B>isValidDateString</B>(java.lang.String dateString)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Given dateString, a String, the method checks to see if string
|
||||||
|
corresponds to a valid shortDatePattern.
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
<DT><B>Parameters:</B><DD><CODE>dateString,</CODE> - a String
|
||||||
|
<DT><B>Returns:</B><DD>a boolean, true only if the dateString is a valid pattern</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="nextDate(java.util.Date)"><!-- --></A><H3>
|
||||||
|
nextDate</H3>
|
||||||
|
<PRE>
|
||||||
|
public static java.util.Date <B>nextDate</B>(java.util.Date date)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Given date, a Date object, the method returns
|
||||||
|
a Date object corresponding to the next day.
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
<DT><B>Parameters:</B><DD><CODE>noOfDays</CODE> - an int
|
||||||
|
<DT><B>Returns:</B><DD>a Date</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,220 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc (build 1.8.0_402) on Thu Mar 21 21:31:47 GMT 2024 -->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
Diary
|
||||||
|
</TITLE>
|
||||||
|
|
||||||
|
<META NAME="date" CONTENT="2024-03-21">
|
||||||
|
|
||||||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||||
|
|
||||||
|
<SCRIPT type="text/javascript">
|
||||||
|
function windowTitle()
|
||||||
|
{
|
||||||
|
if (location.href.indexOf('is-external=true') == -1) {
|
||||||
|
parent.document.title="Diary";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</SCRIPT>
|
||||||
|
<NOSCRIPT>
|
||||||
|
</NOSCRIPT>
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
|
||||||
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<H2>
|
||||||
|
Class Diary</H2>
|
||||||
|
<PRE>
|
||||||
|
java.lang.Object
|
||||||
|
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Diary</B>
|
||||||
|
</PRE>
|
||||||
|
<HR>
|
||||||
|
<DL>
|
||||||
|
<DT><PRE>public class <B>Diary</B><DT>extends java.lang.Object</DL>
|
||||||
|
</PRE>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
A class Diary that represents a "diary" of library item reservations.
|
||||||
|
|
||||||
|
The diary is structured as a Map of entries in which each entry corresponds
|
||||||
|
to a specific day. As the map is not accessed in a sequential fashion, it
|
||||||
|
doesn't matter whether the actual map class is a TreeMap or a HashMap.
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
<DL>
|
||||||
|
<DT><B>Author:</B></DT>
|
||||||
|
<DD>D E Newton</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
|
||||||
|
<A NAME="constructor_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Constructor Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE><B><A HREF="Diary.html#Diary()">Diary</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Constructor for objects of class Diary</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
|
||||||
|
<A NAME="method_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Method Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="Diary.html#addReservation(LibraryReservation)">addReservation</A></B>(LibraryReservation itemReservation)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Method for adding a reservation to the diary.</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="Diary.html#deleteReservation(LibraryReservation)">deleteReservation</A></B>(LibraryReservation itemReservation)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Method for deleting a reservation from the diary.</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> LibraryReservation[]</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="Diary.html#getReservations(java.util.Date)">getReservations</A></B>(java.util.Date date)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Accessor method for returning all reservations that have entries
|
||||||
|
in the diary for a particular date.</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="Diary.html#printEntries(java.util.Date, java.util.Date)">printEntries</A></B>(java.util.Date startDate,
|
||||||
|
java.util.Date endDate)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
Method for displaying the reservations between specified dates.</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||||
|
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
|
||||||
|
<A NAME="constructor_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Constructor Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="Diary()"><!-- --></A><H3>
|
||||||
|
Diary</H3>
|
||||||
|
<PRE>
|
||||||
|
public <B>Diary</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Constructor for objects of class Diary
|
||||||
|
<P>
|
||||||
|
</DL>
|
||||||
|
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
|
||||||
|
<A NAME="method_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Method Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="addReservation(LibraryReservation)"><!-- --></A><H3>
|
||||||
|
addReservation</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>addReservation</B>(LibraryReservation itemReservation)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Method for adding a reservation to the diary.
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="deleteReservation(LibraryReservation)"><!-- --></A><H3>
|
||||||
|
deleteReservation</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>deleteReservation</B>(LibraryReservation itemReservation)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Method for deleting a reservation from the diary.
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="getReservations(java.util.Date)"><!-- --></A><H3>
|
||||||
|
getReservations</H3>
|
||||||
|
<PRE>
|
||||||
|
public LibraryReservation[] <B>getReservations</B>(java.util.Date date)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Accessor method for returning all reservations that have entries
|
||||||
|
in the diary for a particular date.
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
|
||||||
|
<DT><B>Returns:</B><DD>an array of reservations, or null if no entry for that date</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="printEntries(java.util.Date, java.util.Date)"><!-- --></A><H3>
|
||||||
|
printEntries</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>printEntries</B>(java.util.Date startDate,
|
||||||
|
java.util.Date endDate)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD>Method for displaying the reservations between specified dates.
|
||||||
|
<P>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc (build 1.8.0_402) on Thu Mar 21 11:36:09 GMT 2024 -->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
Library
|
||||||
|
</TITLE>
|
||||||
|
|
||||||
|
<META NAME="date" CONTENT="2024-03-21">
|
||||||
|
|
||||||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||||
|
|
||||||
|
<SCRIPT type="text/javascript">
|
||||||
|
function windowTitle()
|
||||||
|
{
|
||||||
|
if (location.href.indexOf('is-external=true') == -1) {
|
||||||
|
parent.document.title="Library";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</SCRIPT>
|
||||||
|
<NOSCRIPT>
|
||||||
|
</NOSCRIPT>
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
|
||||||
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<H2>
|
||||||
|
Class Library</H2>
|
||||||
|
<PRE>
|
||||||
|
java.lang.Object
|
||||||
|
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Library</B>
|
||||||
|
</PRE>
|
||||||
|
<HR>
|
||||||
|
<DL>
|
||||||
|
<DT><PRE>public class <B>Library</B><DT>extends java.lang.Object</DL>
|
||||||
|
</PRE>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
|
||||||
|
<A NAME="constructor_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Constructor Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE><B><A HREF="Library.html#Library()">Library</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
|
||||||
|
<A NAME="method_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Method Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="Library.html#printAll()">printAll</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="Library.html#readData()">readData</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="Library.html#writeUserData()">writeUserData</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||||
|
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
|
||||||
|
<A NAME="constructor_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Constructor Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="Library()"><!-- --></A><H3>
|
||||||
|
Library</H3>
|
||||||
|
<PRE>
|
||||||
|
public <B>Library</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
</DL>
|
||||||
|
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
|
||||||
|
<A NAME="method_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Method Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="printAll()"><!-- --></A><H3>
|
||||||
|
printAll</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>printAll</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="readData()"><!-- --></A><H3>
|
||||||
|
readData</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>readData</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="writeUserData()"><!-- --></A><H3>
|
||||||
|
writeUserData</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>writeUserData</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,421 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc (build 1.8.0_392) on Fri Feb 16 14:05:03 GMT 2024 -->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
LibraryItem
|
||||||
|
</TITLE>
|
||||||
|
|
||||||
|
<META NAME="date" CONTENT="2024-02-16">
|
||||||
|
|
||||||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||||
|
|
||||||
|
<SCRIPT type="text/javascript">
|
||||||
|
function windowTitle()
|
||||||
|
{
|
||||||
|
if (location.href.indexOf('is-external=true') == -1) {
|
||||||
|
parent.document.title="LibraryItem";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</SCRIPT>
|
||||||
|
<NOSCRIPT>
|
||||||
|
</NOSCRIPT>
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
|
||||||
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<H2>
|
||||||
|
Class LibraryItem</H2>
|
||||||
|
<PRE>
|
||||||
|
java.lang.Object
|
||||||
|
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>LibraryItem</B>
|
||||||
|
</PRE>
|
||||||
|
<HR>
|
||||||
|
<DL>
|
||||||
|
<DT><PRE>public class <B>LibraryItem</B><DT>extends java.lang.Object</DL>
|
||||||
|
</PRE>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
|
||||||
|
<A NAME="constructor_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Constructor Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#LibraryItem()">LibraryItem</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
|
||||||
|
<A NAME="method_summary"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Method Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> int</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#getCost()">getCost</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> java.lang.String</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#getItemCode()">getItemCode</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> int</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#getNoOfPages()">getNoOfPages</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> boolean</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#getOnLoan()">getOnLoan</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> java.lang.String</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#getPublisher()">getPublisher</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> int</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#getTimesBorrowed()">getTimesBorrowed</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> java.lang.String</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#getTitle()">getTitle</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#printDetails()">printDetails</A></B>()</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#readItemData(java.util.Scanner)">readItemData</A></B>(java.util.Scanner detailScanner)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#setCost(int)">setCost</A></B>(int cost)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#setItemCode(java.lang.String)">setItemCode</A></B>(java.lang.String itemCode)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#setNoOfPages(int)">setNoOfPages</A></B>(int noOfPages)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#setOnLoan(boolean)">setOnLoan</A></B>(boolean onLoan)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#setPublisher(java.lang.String)">setPublisher</A></B>(java.lang.String publisher)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#setTimesBorrowed(int)">setTimesBorrowed</A></B>(int timesBorrowed)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||||
|
<CODE> void</CODE></FONT></TD>
|
||||||
|
<TD><CODE><B><A HREF="LibraryItem.html#setTitle(java.lang.String)">setTitle</A></B>(java.lang.String title)</CODE>
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||||
|
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
|
||||||
|
<A NAME="constructor_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Constructor Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="LibraryItem()"><!-- --></A><H3>
|
||||||
|
LibraryItem</H3>
|
||||||
|
<PRE>
|
||||||
|
public <B>LibraryItem</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
</DL>
|
||||||
|
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
|
||||||
|
<A NAME="method_detail"><!-- --></A>
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||||
|
<B>Method Detail</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
<A NAME="getCost()"><!-- --></A><H3>
|
||||||
|
getCost</H3>
|
||||||
|
<PRE>
|
||||||
|
public int <B>getCost</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="getItemCode()"><!-- --></A><H3>
|
||||||
|
getItemCode</H3>
|
||||||
|
<PRE>
|
||||||
|
public java.lang.String <B>getItemCode</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="getNoOfPages()"><!-- --></A><H3>
|
||||||
|
getNoOfPages</H3>
|
||||||
|
<PRE>
|
||||||
|
public int <B>getNoOfPages</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="getOnLoan()"><!-- --></A><H3>
|
||||||
|
getOnLoan</H3>
|
||||||
|
<PRE>
|
||||||
|
public boolean <B>getOnLoan</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="getPublisher()"><!-- --></A><H3>
|
||||||
|
getPublisher</H3>
|
||||||
|
<PRE>
|
||||||
|
public java.lang.String <B>getPublisher</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="getTimesBorrowed()"><!-- --></A><H3>
|
||||||
|
getTimesBorrowed</H3>
|
||||||
|
<PRE>
|
||||||
|
public int <B>getTimesBorrowed</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="getTitle()"><!-- --></A><H3>
|
||||||
|
getTitle</H3>
|
||||||
|
<PRE>
|
||||||
|
public java.lang.String <B>getTitle</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="printDetails()"><!-- --></A><H3>
|
||||||
|
printDetails</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>printDetails</B>()</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="readItemData(java.util.Scanner)"><!-- --></A><H3>
|
||||||
|
readItemData</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>readItemData</B>(java.util.Scanner detailScanner)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="setCost(int)"><!-- --></A><H3>
|
||||||
|
setCost</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>setCost</B>(int cost)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="setItemCode(java.lang.String)"><!-- --></A><H3>
|
||||||
|
setItemCode</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>setItemCode</B>(java.lang.String itemCode)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="setNoOfPages(int)"><!-- --></A><H3>
|
||||||
|
setNoOfPages</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>setNoOfPages</B>(int noOfPages)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="setOnLoan(boolean)"><!-- --></A><H3>
|
||||||
|
setOnLoan</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>setOnLoan</B>(boolean onLoan)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="setPublisher(java.lang.String)"><!-- --></A><H3>
|
||||||
|
setPublisher</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>setPublisher</B>(java.lang.String publisher)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="setTimesBorrowed(int)"><!-- --></A><H3>
|
||||||
|
setTimesBorrowed</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>setTimesBorrowed</B>(int timesBorrowed)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<A NAME="setTitle(java.lang.String)"><!-- --></A><H3>
|
||||||
|
setTitle</H3>
|
||||||
|
<PRE>
|
||||||
|
public void <B>setTitle</B>(java.lang.String title)</PRE>
|
||||||
|
<DL>
|
||||||
|
<DD><DL>
|
||||||
|
</DL>
|
||||||
|
</DD>
|
||||||
|
</DL>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc (build 1.8.0_402) on Thu Mar 21 22:06:18 GMT 2024 -->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
All Classes
|
||||||
|
</TITLE>
|
||||||
|
|
||||||
|
<META NAME="date" CONTENT="2024-03-21">
|
||||||
|
|
||||||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||||
|
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
|
||||||
|
<BODY BGCOLOR="white">
|
||||||
|
<FONT size="+1" CLASS="FrameHeadingFont">
|
||||||
|
<B>All Classes</B></FONT>
|
||||||
|
<BR>
|
||||||
|
|
||||||
|
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||||
|
<TR>
|
||||||
|
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="DateUtil.html" title="class in <Unnamed>" target="classFrame">DateUtil</A>
|
||||||
|
<BR>
|
||||||
|
</FONT></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc (build 1.8.0_402) on Thu Mar 21 22:06:18 GMT 2024 -->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
All Classes
|
||||||
|
</TITLE>
|
||||||
|
|
||||||
|
<META NAME="date" CONTENT="2024-03-21">
|
||||||
|
|
||||||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||||
|
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
|
||||||
|
<BODY BGCOLOR="white">
|
||||||
|
<FONT size="+1" CLASS="FrameHeadingFont">
|
||||||
|
<B>All Classes</B></FONT>
|
||||||
|
<BR>
|
||||||
|
|
||||||
|
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||||
|
<TR>
|
||||||
|
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="DateUtil.html" title="class in <Unnamed>">DateUtil</A>
|
||||||
|
<BR>
|
||||||
|
</FONT></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc (build 1.8.0_402) on Thu Mar 21 22:06:18 GMT 2024 -->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
Constant Field Values
|
||||||
|
</TITLE>
|
||||||
|
|
||||||
|
<META NAME="date" CONTENT="2024-03-21">
|
||||||
|
|
||||||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||||
|
|
||||||
|
<SCRIPT type="text/javascript">
|
||||||
|
function windowTitle()
|
||||||
|
{
|
||||||
|
if (location.href.indexOf('is-external=true') == -1) {
|
||||||
|
parent.document.title="Constant Field Values";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</SCRIPT>
|
||||||
|
<NOSCRIPT>
|
||||||
|
</NOSCRIPT>
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
|
||||||
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
<CENTER>
|
||||||
|
<H1>
|
||||||
|
Constant Field Values</H1>
|
||||||
|
</CENTER>
|
||||||
|
<HR SIZE="4" NOSHADE>
|
||||||
|
<B>Contents</B><UL>
|
||||||
|
</UL>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc on Thu Mar 21 22:06:18 GMT 2024-->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
Generated Documentation (Untitled)
|
||||||
|
</TITLE>
|
||||||
|
<SCRIPT type="text/javascript">
|
||||||
|
targetPage = "" + window.location.search;
|
||||||
|
if (targetPage != "" && targetPage != "undefined")
|
||||||
|
targetPage = targetPage.substring(1);
|
||||||
|
if (targetPage.indexOf(":") != -1)
|
||||||
|
targetPage = "undefined";
|
||||||
|
function loadFrames() {
|
||||||
|
if (targetPage != "" && targetPage != "undefined")
|
||||||
|
top.classFrame.location = top.targetPage;
|
||||||
|
}
|
||||||
|
</SCRIPT>
|
||||||
|
<NOSCRIPT>
|
||||||
|
</NOSCRIPT>
|
||||||
|
</HEAD>
|
||||||
|
<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()">
|
||||||
|
<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
|
||||||
|
<FRAME src="DateUtil.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes">
|
||||||
|
<NOFRAMES>
|
||||||
|
<H2>
|
||||||
|
Frame Alert</H2>
|
||||||
|
|
||||||
|
<P>
|
||||||
|
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
|
||||||
|
<BR>
|
||||||
|
Link to<A HREF="DateUtil.html">Non-frame version.</A>
|
||||||
|
</NOFRAMES>
|
||||||
|
</FRAMESET>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
Class documentation
|
||||||
|
<---- javadoc command: ---->
|
||||||
|
/usr/lib/jvm/java-8-openjdk-amd64/bin/javadoc
|
||||||
|
-author
|
||||||
|
-version
|
||||||
|
-nodeprecated
|
||||||
|
-package
|
||||||
|
-noindex
|
||||||
|
-notree
|
||||||
|
-nohelp
|
||||||
|
-nonavbar
|
||||||
|
-source
|
||||||
|
1.8
|
||||||
|
-classpath
|
||||||
|
/usr/share/bluej/bluejcore.jar:/usr/share/bluej/junit-4.8.2.jar:/usr/share/bluej/userlib/pi4j-gpio-extension.jar:/usr/share/bluej/userlib/pi4j-device.jar:/usr/share/bluej/userlib/pi4j-core.jar:/usr/share/bluej/userlib/pi4j-service.jar:/home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2
|
||||||
|
-d
|
||||||
|
/home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/doc
|
||||||
|
-encoding
|
||||||
|
UTF-8
|
||||||
|
-charset
|
||||||
|
UTF-8
|
||||||
|
-docletpath
|
||||||
|
/usr/share/bluej/bjdoclet.jar
|
||||||
|
-doclet
|
||||||
|
bluej.doclet.doclets.formats.html.HtmlDoclet
|
||||||
|
/home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/DateUtil.java
|
||||||
|
<---- end of javadoc command ---->
|
||||||
|
Loading source file /home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/DateUtil.java...
|
||||||
|
Constructing Javadoc information...
|
||||||
|
Standard Doclet version 1.8.0_402
|
||||||
|
Building tree for all the packages and classes...
|
||||||
|
Generating /home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/doc/DateUtil.html...
|
||||||
|
/home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/DateUtil.java:224: warning - @param argument "year," is not a parameter name.
|
||||||
|
/home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/DateUtil.java:238: warning - @param argument "dateString," is not a parameter name.
|
||||||
|
/home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/DateUtil.java:259: warning - @param argument "noOfDays" is not a parameter name.
|
||||||
|
Generating /home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/doc/package-frame.html...
|
||||||
|
Generating /home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/doc/package-summary.html...
|
||||||
|
Generating /home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/doc/constant-values.html...
|
||||||
|
Building index for all the packages and classes...
|
||||||
|
Building index for all classes...
|
||||||
|
Generating /home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/doc/allclasses-frame.html...
|
||||||
|
Generating /home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/doc/allclasses-noframe.html...
|
||||||
|
Generating /home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/doc/index.html...
|
||||||
|
Generating /home/boris/OneDrive/Computer Science Year 1/Semester 2/Programming 2/Project/Part 2/doc/stylesheet.css...
|
||||||
|
3 warnings
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc (build 1.8.0_402) on Thu Mar 21 22:06:18 GMT 2024 -->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
<Unnamed>
|
||||||
|
</TITLE>
|
||||||
|
|
||||||
|
<META NAME="date" CONTENT="2024-03-21">
|
||||||
|
|
||||||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||||
|
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
|
||||||
|
<BODY BGCOLOR="white">
|
||||||
|
<FONT size="+1" CLASS="FrameTitleFont">
|
||||||
|
<A HREF="package-summary.html" target="classFrame"><Unnamed></A></FONT>
|
||||||
|
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||||
|
<TR>
|
||||||
|
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
|
||||||
|
Classes</FONT>
|
||||||
|
<FONT CLASS="FrameItemFont">
|
||||||
|
<BR>
|
||||||
|
<A HREF="DateUtil.html" title="class in <Unnamed>" target="classFrame">DateUtil</A></FONT></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<!--NewPage-->
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<!-- Generated by javadoc (build 1.8.0_402) on Thu Mar 21 22:06:18 GMT 2024 -->
|
||||||
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<TITLE>
|
||||||
|
|
||||||
|
</TITLE>
|
||||||
|
|
||||||
|
<META NAME="date" CONTENT="2024-03-21">
|
||||||
|
|
||||||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||||
|
|
||||||
|
|
||||||
|
</HEAD>
|
||||||
|
|
||||||
|
<BODY BGCOLOR="white">
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
<H2>
|
||||||
|
Package <Unnamed>
|
||||||
|
</H2>
|
||||||
|
|
||||||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||||
|
<B>Class Summary</B></FONT></TH>
|
||||||
|
</TR>
|
||||||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
|
<TD WIDTH="15%"><B><A HREF="DateUtil.html" title="class in <Unnamed>">DateUtil</A></B></TD>
|
||||||
|
<TD>A class DateUtil with the following methods for dealing with dates.</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
|
||||||
|
|
||||||
|
<P>
|
||||||
|
<DL>
|
||||||
|
</DL>
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 57 B |
@@ -0,0 +1,29 @@
|
|||||||
|
/* Javadoc style sheet */
|
||||||
|
|
||||||
|
/* Define colors, fonts and other style attributes here to override the defaults */
|
||||||
|
|
||||||
|
/* Page background color */
|
||||||
|
body { background-color: #FFFFFF; color:#000000 }
|
||||||
|
|
||||||
|
/* Headings */
|
||||||
|
h1 { font-size: 145% }
|
||||||
|
|
||||||
|
/* Table colors */
|
||||||
|
.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */
|
||||||
|
.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */
|
||||||
|
.TableRowColor { background: #FFFFFF; color:#000000 } /* White */
|
||||||
|
|
||||||
|
/* Font used in left-hand frame lists */
|
||||||
|
.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
|
||||||
|
.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
|
||||||
|
.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
|
||||||
|
|
||||||
|
/* Navigation bar fonts and colors */
|
||||||
|
.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */
|
||||||
|
.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */
|
||||||
|
.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;}
|
||||||
|
.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;}
|
||||||
|
|
||||||
|
.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
|
||||||
|
.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[Library User data]
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
#BlueJ package file
|
||||||
|
dependency1.from=Library
|
||||||
|
dependency1.to=Book
|
||||||
|
dependency1.type=UsesDependency
|
||||||
|
dependency2.from=Library
|
||||||
|
dependency2.to=Periodical
|
||||||
|
dependency2.type=UsesDependency
|
||||||
|
dependency3.from=Library
|
||||||
|
dependency3.to=LibraryItem
|
||||||
|
dependency3.type=UsesDependency
|
||||||
|
dependency4.from=Library
|
||||||
|
dependency4.to=CD
|
||||||
|
dependency4.type=UsesDependency
|
||||||
|
dependency5.from=Library
|
||||||
|
dependency5.to=DVD
|
||||||
|
dependency5.type=UsesDependency
|
||||||
|
dependency6.from=Library
|
||||||
|
dependency6.to=LibraryUser
|
||||||
|
dependency6.type=UsesDependency
|
||||||
|
dependency7.from=LibraryReservation
|
||||||
|
dependency7.to=DateUtil
|
||||||
|
dependency7.type=UsesDependency
|
||||||
|
dependency8.from=Library
|
||||||
|
dependency8.to=LibraryReservation
|
||||||
|
dependency8.type=UsesDependency
|
||||||
|
objectbench.height=76
|
||||||
|
objectbench.width=940
|
||||||
|
package.editor.height=874
|
||||||
|
package.editor.width=814
|
||||||
|
package.editor.x=881
|
||||||
|
package.editor.y=86
|
||||||
|
package.numDependencies=8
|
||||||
|
package.numTargets=12
|
||||||
|
package.showExtends=true
|
||||||
|
package.showUses=true
|
||||||
|
project.charset=UTF-8
|
||||||
|
target1.editor.height=786
|
||||||
|
target1.editor.width=960
|
||||||
|
target1.editor.x=34
|
||||||
|
target1.editor.y=174
|
||||||
|
target1.height=50
|
||||||
|
target1.name=CD
|
||||||
|
target1.naviview.expanded=true
|
||||||
|
target1.showInterface=false
|
||||||
|
target1.type=ClassTarget
|
||||||
|
target1.typeParameters=
|
||||||
|
target1.width=80
|
||||||
|
target1.x=360
|
||||||
|
target1.y=340
|
||||||
|
target10.editor.height=1049
|
||||||
|
target10.editor.width=1920
|
||||||
|
target10.editor.x=0
|
||||||
|
target10.editor.y=31
|
||||||
|
target10.height=50
|
||||||
|
target10.name=Book
|
||||||
|
target10.naviview.expanded=true
|
||||||
|
target10.showInterface=false
|
||||||
|
target10.type=ClassTarget
|
||||||
|
target10.typeParameters=
|
||||||
|
target10.width=80
|
||||||
|
target10.x=180
|
||||||
|
target10.y=340
|
||||||
|
target11.editor.height=1049
|
||||||
|
target11.editor.width=1920
|
||||||
|
target11.editor.x=0
|
||||||
|
target11.editor.y=31
|
||||||
|
target11.height=50
|
||||||
|
target11.name=Library
|
||||||
|
target11.naviview.expanded=true
|
||||||
|
target11.showInterface=false
|
||||||
|
target11.type=ClassTarget
|
||||||
|
target11.typeParameters=
|
||||||
|
target11.width=100
|
||||||
|
target11.x=260
|
||||||
|
target11.y=240
|
||||||
|
target12.editor.height=700
|
||||||
|
target12.editor.width=900
|
||||||
|
target12.editor.x=960
|
||||||
|
target12.editor.y=146
|
||||||
|
target12.height=50
|
||||||
|
target12.name=AudioVisual
|
||||||
|
target12.naviview.expanded=true
|
||||||
|
target12.showInterface=false
|
||||||
|
target12.type=AbstractTarget
|
||||||
|
target12.typeParameters=
|
||||||
|
target12.width=110
|
||||||
|
target12.x=380
|
||||||
|
target12.y=240
|
||||||
|
target2.editor.height=700
|
||||||
|
target2.editor.width=900
|
||||||
|
target2.editor.x=557
|
||||||
|
target2.editor.y=177
|
||||||
|
target2.height=60
|
||||||
|
target2.name=LibraryItem
|
||||||
|
target2.naviview.expanded=true
|
||||||
|
target2.showInterface=false
|
||||||
|
target2.type=AbstractTarget
|
||||||
|
target2.typeParameters=
|
||||||
|
target2.width=120
|
||||||
|
target2.x=250
|
||||||
|
target2.y=110
|
||||||
|
target3.editor.height=700
|
||||||
|
target3.editor.width=1619
|
||||||
|
target3.editor.x=192
|
||||||
|
target3.editor.y=267
|
||||||
|
target3.height=50
|
||||||
|
target3.name=Periodical
|
||||||
|
target3.naviview.expanded=true
|
||||||
|
target3.showInterface=false
|
||||||
|
target3.type=ClassTarget
|
||||||
|
target3.typeParameters=
|
||||||
|
target3.width=90
|
||||||
|
target3.x=60
|
||||||
|
target3.y=380
|
||||||
|
target4.editor.height=700
|
||||||
|
target4.editor.width=900
|
||||||
|
target4.editor.x=40
|
||||||
|
target4.editor.y=51
|
||||||
|
target4.height=50
|
||||||
|
target4.name=DateUtil
|
||||||
|
target4.naviview.expanded=true
|
||||||
|
target4.showInterface=false
|
||||||
|
target4.type=ClassTarget
|
||||||
|
target4.typeParameters=
|
||||||
|
target4.width=80
|
||||||
|
target4.x=70
|
||||||
|
target4.y=10
|
||||||
|
target5.height=50
|
||||||
|
target5.name=Diary
|
||||||
|
target5.showInterface=false
|
||||||
|
target5.type=ClassTarget
|
||||||
|
target5.typeParameters=
|
||||||
|
target5.width=80
|
||||||
|
target5.x=580
|
||||||
|
target5.y=190
|
||||||
|
target6.editor.height=700
|
||||||
|
target6.editor.width=900
|
||||||
|
target6.editor.x=40
|
||||||
|
target6.editor.y=51
|
||||||
|
target6.height=50
|
||||||
|
target6.name=LibraryReservation
|
||||||
|
target6.naviview.expanded=true
|
||||||
|
target6.showInterface=false
|
||||||
|
target6.type=ClassTarget
|
||||||
|
target6.typeParameters=
|
||||||
|
target6.width=160
|
||||||
|
target6.x=230
|
||||||
|
target6.y=440
|
||||||
|
target7.editor.height=700
|
||||||
|
target7.editor.width=900
|
||||||
|
target7.editor.x=1017
|
||||||
|
target7.editor.y=76
|
||||||
|
target7.height=50
|
||||||
|
target7.name=PrintedItem
|
||||||
|
target7.naviview.expanded=true
|
||||||
|
target7.showInterface=false
|
||||||
|
target7.type=AbstractTarget
|
||||||
|
target7.typeParameters=
|
||||||
|
target7.width=110
|
||||||
|
target7.x=130
|
||||||
|
target7.y=240
|
||||||
|
target8.editor.height=1049
|
||||||
|
target8.editor.width=1920
|
||||||
|
target8.editor.x=0
|
||||||
|
target8.editor.y=31
|
||||||
|
target8.height=50
|
||||||
|
target8.name=DVD
|
||||||
|
target8.naviview.expanded=true
|
||||||
|
target8.showInterface=false
|
||||||
|
target8.type=ClassTarget
|
||||||
|
target8.typeParameters=
|
||||||
|
target8.width=80
|
||||||
|
target8.x=470
|
||||||
|
target8.y=380
|
||||||
|
target9.editor.height=700
|
||||||
|
target9.editor.width=900
|
||||||
|
target9.editor.x=55
|
||||||
|
target9.editor.y=274
|
||||||
|
target9.height=50
|
||||||
|
target9.name=LibraryUser
|
||||||
|
target9.naviview.expanded=true
|
||||||
|
target9.showInterface=false
|
||||||
|
target9.type=ClassTarget
|
||||||
|
target9.typeParameters=
|
||||||
|
target9.width=110
|
||||||
|
target9.x=100
|
||||||
|
target9.y=170
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 573 KiB |
Submodule
+1
Submodule Unsorted/VisualStudio/repos/VS_HCI added at ca7c68898e.
Submodule
+1
Submodule Unsorted/VisualStudio/repos/Week 1 added at 0353013680.
Submodule
+1
Submodule Unsorted/VisualStudio/repos/test added at 085c9a4e57.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user