Variables renaming
This commit is contained in:
parent
b4fe435b9e
commit
44c76fcefe
5 changed files with 44 additions and 43 deletions
|
@ -293,16 +293,13 @@ button, .button {
|
|||
font-size: 0.9rem;
|
||||
border-radius: 8px;
|
||||
line-height: 1.2rem;
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
||||
button:hover, .button:hover {
|
||||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||
}
|
||||
|
||||
button, .button {
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
||||
button.main, .button.main {
|
||||
background-color: var(--primary-color);
|
||||
color: #ffffff;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import * as htmx from "./htmx/htmx";
|
||||
|
||||
const registerServiceWorker = async () => {
|
||||
if ("serviceWorker" in navigator) {
|
||||
try {
|
||||
|
@ -244,25 +242,31 @@ document.addEventListener("DOMContentLoaded", function(event){
|
|||
|
||||
document.querySelector('body').addEventListener('click', (event) => {
|
||||
if (event.target.classList.contains("close-dialog")) {
|
||||
event.target.closest('#dialog').close();
|
||||
event.target.closest('#dialog').remove();
|
||||
let openDialog = event.target.closest('#dialog');
|
||||
if(openDialog !== null) {
|
||||
openDialog.close();
|
||||
openDialog.remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
document.body.addEventListener("showModalDialog", function(evt){
|
||||
document.querySelector('body').addEventListener("showModalDialog", function(evt){
|
||||
document.getElementById("dialog").showModal();
|
||||
});
|
||||
|
||||
document.body.addEventListener("closeModalDialog", function(evt){
|
||||
document.getElementById('dialog').close();
|
||||
document.getElementById('dialog').remove();
|
||||
document.querySelector('body').addEventListener("closeModalDialog", function(evt){
|
||||
let openDialog = document.getElementById('dialog');
|
||||
if(openDialog !== null) {
|
||||
openDialog.close();
|
||||
openDialog.remove();
|
||||
}
|
||||
});
|
||||
|
||||
document.body.addEventListener("quickboxNoteClear", function(evt){
|
||||
document.querySelector('body').addEventListener("quickboxNoteClear", function(evt){
|
||||
document.getElementById("quickbox-notetext").value = ''
|
||||
});
|
||||
|
||||
document.body.addEventListener("closeQuickboxTransformModal", function(evt){
|
||||
document.querySelector('body').addEventListener("closeQuickboxTransformModal", function(evt){
|
||||
bm_showMessage();
|
||||
document.getElementById('dialog').close();
|
||||
document.getElementById('dialog').remove();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const cacheVersion = "0.283"
|
||||
const cacheVersion = "0.29"
|
||||
const cacheName = "speedtech-brainminder"
|
||||
const cacheFiles = [
|
||||
'/static/bootstrap-icons/font/bootstrap-icons.min.css',
|
||||
|
|
|
@ -11,24 +11,24 @@
|
|||
</thead>
|
||||
<tbody id="relations-items">
|
||||
{{ range .item.Relations}}
|
||||
{{ $relation_name := printf "%s%v-%v" "ItemRelation-" .Item_id .Related_item_id }}
|
||||
{{ $relation_name_remove := printf "%s%v-%v" "ItemRelation-ToRemove-" .Item_id .Related_item_id }}
|
||||
<tr id="{{$relation_name}}-Row">
|
||||
<td class="no-label {{$relation_name}}-Col">
|
||||
{{ $target_id := .Related_item_id}}
|
||||
{{ $relation_type := .Relation_type }}
|
||||
{{ if eq .Related_item_id $.item.Id }}
|
||||
{{ $target_id = .Item_id}}
|
||||
{{ if eq "Parent" .Relation_type}}
|
||||
{{ $relation_type = "Child" }}
|
||||
{{ else if eq "Child" .Relation_type}}
|
||||
{{ $relation_type = "Parent" }}
|
||||
{{ $relationName := printf "%s%v-%v" "ItemRelation-" .ItemId .RelatedItemId }}
|
||||
{{ $relationNameRemove := printf "%s%v-%v" "ItemRelation-ToRemove-" .ItemId .RelatedItemId }}
|
||||
<tr id="{{$relationName}}-Row">
|
||||
<td class="no-label {{$relationName}}-Col">
|
||||
{{ $targetId := .RelatedItemId}}
|
||||
{{ $relationType := .RelationType }}
|
||||
{{ if eq .RelatedItemId $.item.Id }}
|
||||
{{ $targetId = .ItemId}}
|
||||
{{ if eq "Parent" .RelationType}}
|
||||
{{ $relationType = "Child" }}
|
||||
{{ else if eq "Child" .RelationType}}
|
||||
{{ $relationType = "Parent" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<a href="/item/view/{{$target_id}}" hx-get="/item/view/{{$target_id}}" hx-target="body" hx-swap="beforeend"><i class="{{.Type_icon}}" title="{{.Type_title}}"></i> {{.Title}}</a>
|
||||
<input type="hidden" id="{{$relation_name_remove}}" name="{{$relation_name_remove}}" value=""/>
|
||||
<a href="/item/view/{{$targetId}}" hx-get="/item/view/{{$targetId}}" hx-target="body" hx-swap="beforeend"><i class="{{.TypeIcon}}" title="{{.TypeTitle}}"></i> {{.Title}}</a>
|
||||
<input type="hidden" id="{{$relationNameRemove}}" name="{{$relationNameRemove}}" value=""/>
|
||||
</td>
|
||||
<td class="no-label {{$relation_name}}-Col">
|
||||
<td class="no-label {{$relationName}}-Col">
|
||||
{{ if gt (len .Categories) 0 }}
|
||||
<i class="hide-medium hide-large bi bi-tags-fill"></i>
|
||||
{{ range (stringToArray .Categories "|")}}
|
||||
|
@ -39,7 +39,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
</td>
|
||||
<td class="no-label {{$relation_name}}-Col">
|
||||
<td class="no-label {{$relationName}}-Col">
|
||||
{{ if gt (len .Tags) 0 }}
|
||||
<i class="hide-medium hide-large bi bi-tags"></i>
|
||||
{{ range (stringToArray .Tags ",")}}
|
||||
|
@ -49,10 +49,10 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
</td>
|
||||
<td class="no-label {{$relation_name}}-Col">{{ widget_relation_type $relation_name $relation_type `id="$relation_name"` }}</td>
|
||||
<td class="no-label {{$relationName}}-Col">{{ widget_relation_type $relationName $relationType `id="$relation_name"` }}</td>
|
||||
<td class="no-label">
|
||||
<button id="Delete-{{$relation_name}}" class="delete" type="button" onclick="bm_element_list_delete(this, {{$relation_name}}, {{$relation_name_remove}})"><i class="bi bi-x-square" title="Remove"></i><span>Remove</span></button>
|
||||
<button id="Undelete-{{$relation_name}}" style="margin-right: 5px;" class="delete" type="button" onclick="bm_element_list_undelete(this, {{$relation_name}}, {{$relation_name_remove}})" hidden><i class="bi bi-arrow-counterclockwise" title="Undo"></i><span>Undo</span></button>
|
||||
<button id="Delete-{{$relationName}}" class="delete" type="button" onclick="bm_element_list_delete(this, {{$relationName}}, {{$relationNameRemove}})"><i class="bi bi-x-square" title="Remove"></i><span>Remove</span></button>
|
||||
<button id="Undelete-{{$relationName}}" style="margin-right: 5px;" class="delete" type="button" onclick="bm_element_list_undelete(this, {{$relationName}}, {{$relationNameRemove}})" hidden><i class="bi bi-arrow-counterclockwise" title="Undo"></i><span>Undo</span></button>
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
{{
|
||||
range.relations
|
||||
}}
|
||||
{{ $target_id := .Related_item_id}}
|
||||
{{ $relation_type := .Relation_type }}
|
||||
{{ if eq .Related_item_id $.item.Id }}
|
||||
{{ $target_id = .Item_id}}
|
||||
{{ if eq "Parent" .Relation_type}}
|
||||
{{ $relation_type = "Child" }}
|
||||
{{ else if eq "Child" .Relation_type}}
|
||||
{{ $relation_type = "Parent" }}
|
||||
{{ $targetId := .RelatedItemId}}
|
||||
{{ $relationType := .RelationType }}
|
||||
{{ if eq .RelatedItemId $.item.Id }}
|
||||
{{ $targetId = .ItemId}}
|
||||
{{ if eq "Parent" .RelationType}}
|
||||
{{ $relationType = "Child" }}
|
||||
{{ else if eq "Child" .RelationType}}
|
||||
{{ $relationType = "Parent" }}
|
||||
{{
|
||||
end
|
||||
}}
|
||||
|
@ -21,7 +21,7 @@
|
|||
end
|
||||
}}
|
||||
<li>
|
||||
<a href="/item/view/{{ $target_id }}" hx-get="/item/view/{{ $target_id }}" hx-target="#modal-container"><i class="{{.Type_icon}}" title="{{.Type_title}}"></i> {{.Title}}</a>
|
||||
<a href="/item/view/{{ $targetId }}" hx-get="/item/view/{{ $targetId }}" hx-target="#modal-container"><i class="{{.TypeIcon}}" title="{{.TypeTitle}}"></i> {{.Title}}</a>
|
||||
</li>
|
||||
{{
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue