From 63708df5337e65304d366f0f594d7d35c469a9c2 Mon Sep 17 00:00:00 2001 From: Paiiimannnoitla <121204598+Paiiimannnoitla@users.noreply.github.com> Date: Sat, 25 Mar 2023 10:52:01 +0800 Subject: [PATCH] Add support of floor structure in fslabel Now when users double click the label in previous floor, it would correctly write at next floor and redirect to it --- log.md | 6 ++++++ template/index.js | 16 +++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/log.md b/log.md index 179182c..a242057 100644 --- a/log.md +++ b/log.md @@ -1,6 +1,12 @@ # Stembase File tagging system +--- + ## 2023.03.25 version 0.4.7 + -- Function implementation + # Added + 1. Add fully functional support in fslabel redirecting + -- finished --- ## 2023.03.25 version 0.4.6.1 -- Bug fix diff --git a/template/index.js b/template/index.js index a11930b..2da2f12 100644 --- a/template/index.js +++ b/template/index.js @@ -7,12 +7,18 @@ let floorNum = 'fs-floor-0' let floorCheckIn = floorDist = 0 const maxFloor = 5 -const fsgetPath = (v=0)=>{ +const fsgetPath = (isDetour=false)=>{ const pathset = document.querySelectorAll('.fs-path-part') const pathArr = [] - for(var i=0;i{ target.style.background = '' }) let isExec = false - + //Floor Jump or Rebuild part.addEventListener('mousedown',()=>{ target.style.background = 'rgb(255,221,158)' const currFloor = +floorNum[floorNum.length-1] @@ -174,7 +180,7 @@ const fsfunc = async (v=false,isDrive=false) => { const fslabelset = document.querySelectorAll('#' + floorNum +' .fs-data-label') fslabelset.forEach(e =>{ e.addEventListener('dblclick',async() =>{ - const floortype = await window.fs.type(fsgetPath()+e.firstChild.innerHTML) + const floortype = await window.fs.type(fsgetPath(true)+e.firstChild.innerHTML) const nextFloor = +floorNum.match(/.$/,'')+1 const floorset = document.querySelectorAll('.fs-floor') if(floortype){ @@ -192,7 +198,7 @@ const fsfunc = async (v=false,isDrive=false) => { }else{ floorNum = 'fs-floor-' + nextFloor } - fsfunc(fsgetPath() + e.firstChild.innerHTML) + fsfunc(fsgetPath(true) + e.firstChild.innerHTML) }else{ // Open it when double clicking await window.fs.openfile(fsgetPath() + e.firstChild.innerHTML)