mirror of
https://gitlab.com/octtspacc/OcttKB
synced 2025-02-03 16:07:37 +01:00
116 lines
3.3 KiB
Plaintext
116 lines
3.3 KiB
Plaintext
.context: 1
|
|
.type: masonry
|
|
.width: 33
|
|
created: 20240129095948486
|
|
creator: Octt
|
|
modified: 20240129234018781
|
|
modifier: Octt
|
|
tags: $:/Apps
|
|
title: $:/Apps/MagicBox
|
|
|
|
\define SearchResults(fields)
|
|
<$list filter="[!is[system]search:$fields${$:/temp/MagicBox!!.input}sort[title]limit[100]]">
|
|
<div class=`MagicBoxApplet result ${[{$:/Apps/MagicBox!!.type}]}$` style=`background-image: url("${[{!!page-cover}]}$");`>
|
|
<$button class="tc-btn-invisible">
|
|
<$action-sendmessage $message="tm-close-tiddler" $param=<<closeOnChoose>>/>
|
|
<$action-navigate $to={{!!title}}/>
|
|
<!--<$link to={{!!title}}>-->
|
|
<h3>
|
|
<$link to={{!!title}} tabindex="-1"/>
|
|
</h3>
|
|
<$if value={{$:/Apps/MagicBox!!.context}}>
|
|
<$context term={{$:/temp/MagicBox!!.input}} tabindex="-1"/>
|
|
</$if>
|
|
<!--</$link>-->
|
|
</$button>
|
|
</div>
|
|
</$list>
|
|
\end
|
|
|
|
<div class="MagicBoxApplet options">
|
|
<$checkbox field=".context" checked="1">Context</$checkbox>
|
|
|
|
<!--<$edit-text field=".type" placeholder="Display Type"/>-->
|
|
<$checkbox field=".type" checked="grid" unchecked="masonry">Fixed Grid</$checkbox>
|
|
|
|
<$range field=".width" min="19" max="49"/>{{!!.width}}
|
|
|
|
<$edit-text tiddler="$:/temp/MagicBox" field=".input" class="_input" placeholder="Search..." tabindex="0"/>
|
|
</div>
|
|
|
|
<$action-sendmessage $message="tm-focus-selector" $param=".MagicBoxApplet.options > ._input"/>
|
|
<<script script='try {
|
|
document.querySelector(".MagicBoxApplet.options > ._input")?.focus();
|
|
document.querySelector("div.tc-tiddler-frame.tc-tiddler-view-frame[data-tiddler-title=\"$:/Apps/MagicBox/Overlay\"] .MagicBoxApplet.options > ._input")?.focus();
|
|
} catch(e) { $OcttKB.ErrAtLine(e) }'>><<script off>>
|
|
|
|
<style>
|
|
@media (max-width: 500px) {
|
|
.MagicBoxApplet.result {
|
|
min-width: calc(({{!!.width}}% * 2) - 16px) !important;
|
|
max-width: calc(({{!!.width}}% * 3) - 16px) !important;
|
|
}
|
|
}
|
|
.MagicBoxApplet.result {
|
|
margin: 8px;
|
|
display: inline-block;
|
|
background-color: lightgray;
|
|
background-size: cover;
|
|
background-position: center;
|
|
}
|
|
.MagicBoxApplet.result.grid {
|
|
width: calc({{!!.width}}% - 16px);
|
|
aspect-ratio: 16/9;
|
|
vertical-align: top;
|
|
}
|
|
.MagicBoxApplet.result.masonry {
|
|
max-width: calc({{!!.width}}% - 16px);
|
|
}
|
|
.MagicBoxApplet.result h3 {
|
|
margin-top: 25%;
|
|
padding: 8px;
|
|
background-color: rgba(255, 255, 255, 0.75);
|
|
text-align: center;
|
|
}
|
|
.MagicBoxApplet.result pre {
|
|
color: initial;
|
|
max-height: 7em;
|
|
overflow-y: auto;
|
|
margin: 0;
|
|
top: 1em;
|
|
position: relative;
|
|
text-align: initial;
|
|
}
|
|
.MagicBoxApplet.result h3 > a {
|
|
pointer-events: none;
|
|
}
|
|
.MagicBoxApplet.result > a,
|
|
.MagicBoxApplet.result > button {
|
|
display: inline-block;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
.MagicBoxApplet.result > a:after {
|
|
content: "" !important;
|
|
}
|
|
</style>
|
|
|
|
<$if value={{{ [{$:/temp/MagicBox!!.input}split[]count[]compare:integer:gteq[3]then[1]] }}}>
|
|
<$if value={{{ [!is[system]search:title{$:/temp/MagicBox!!.input}then[]else[1]] }}}>
|
|
<$button>
|
|
<$action-sendmessage $message="tm-close-tiddler" $param=<<closeOnChoose>>/>
|
|
<$action-sendmessage $message="tm-new-tiddler" title={{$:/temp/MagicBox!!.input}} />
|
|
Create as New Tiddler
|
|
</$button>
|
|
</$if>
|
|
|
|
<div><br/><hr/><br/></div>
|
|
|
|
Title or Caption matches:
|
|
<br/><<SearchResults "title,caption">>
|
|
|
|
<div><br/><hr/><br/></div>
|
|
|
|
Tags or Text matches:
|
|
<br/><<SearchResults "tags,text">>
|
|
</$if> |