From 059454e08799e23c0379d8aafebd0e2ca8669c8a Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch> Date: Wed, 26 Jul 2023 09:36:15 +0200 Subject: [PATCH] update toggleShellWindow() --- public_html/deployment/js/functions.js | 34 ++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/public_html/deployment/js/functions.js b/public_html/deployment/js/functions.js index 5d0ff311..6fed99e9 100644 --- a/public_html/deployment/js/functions.js +++ b/public_html/deployment/js/functions.js @@ -42,43 +42,47 @@ function hideModalMessage(){ return false; } - var aWinBoxes={}; /** * shellcmd plugin ... toggle output window - * @param {string} idWrapperDiv id of the wrapper - * @param {object} oLink a tag in the navbar with link for toggling window + * @param {string} isPluginOutputDiv id of the wrapper + * @param {object} oLink a tag in the navbar with link for toggling window */ -function toggleShellWindow(idWrapperDiv, oLink){ - if(aWinBoxes[idWrapperDiv]){ - aWinBoxes[idWrapperDiv].close(); +function toggleShellWindow(isPluginOutputDiv, oLink){ + if(aWinBoxes[isPluginOutputDiv]){ + aWinBoxes[isPluginOutputDiv].close(); } else { - var oWrapper=document.getElementById(idWrapperDiv); - aWinBoxes[idWrapperDiv] = WinBox({ + var oWrapper=document.getElementById(isPluginOutputDiv); + aWinBoxes[isPluginOutputDiv] = WinBox({ title: oLink.innerText, - id: 'winbox-'+idWrapperDiv, + id: 'winbox-'+isPluginOutputDiv, border: 5, background: "#628", class: [ "no-min", "no-max", /* "no-full", "no-resize", "no-move"*/ "ciwinbox" ], - // position: + // position + size x: "center", y: "center", + width: 10, + height: 10, - // width: oWrapper.clientWidth+'px', + // viewport + top: 70, + right: 20, + bottom: 20, + left: 20, + // take content from existing div mount: oWrapper, onclose: function(){ - delete aWinBoxes[idWrapperDiv]; + delete aWinBoxes[isPluginOutputDiv]; $(oLink).parent().removeClass('active'); } }); $(oLink).parent().addClass('active'); - window.setTimeout("aWinBoxes['"+idWrapperDiv+"'].resize("+(oWrapper.clientWidth+25)+", "+(oWrapper.clientHeight+150)+").move('center', 'center')", 200); + window.setTimeout("aWinBoxes['"+isPluginOutputDiv+"'].resize("+(oWrapper.clientWidth+25)+", "+(oWrapper.clientHeight+150)+").move('center', 'center')", 10); } - // $('#'+idWrapperDiv).slideToggle(100); - // $(oLink).parent().toggleClass('active'); } // ---------------------------------------------------------------------- -- GitLab