diff --git a/public_html/deployment/classes/plugins_renderer.class.php b/public_html/deployment/classes/plugins_renderer.class.php index 288452c978d267e8b7c2aa11cbc208f39e0013fc..403e48bab0c64d4c5fa61a935e222a0a85505999 100644 --- a/public_html/deployment/classes/plugins_renderer.class.php +++ b/public_html/deployment/classes/plugins_renderer.class.php @@ -100,6 +100,7 @@ class plugin_renderer extends ciplugins { } public function getHtmlOutwindow(){ $aConfig=$this->getPluginConfig(); + /* return '<div id="'.$this->getHtmlOutIdWrapper().'" class="cmdoutbox draggable draggable-onpage">' // .'<button class="btn-close float-right">X</button>' .'<div class="header"><i class="'.$aConfig['icon'].'"></i> '.$this->_sPluginname.'</div>' @@ -109,6 +110,16 @@ class plugin_renderer extends ciplugins { .(isset($aConfig['window-lines']) && $aConfig['window-lines'] ? ' cmd-lines-'.$aConfig['window-lines'] : '' ) .'"></div>' .'</div>'; + */ + return '<div id="'.$this->getHtmlOutIdWrapper().'" class="cmdoutbox">' + // .'<button class="btn-close float-right">X</button>' + .'<div class="header"><i class="'.$aConfig['icon'].'"></i> '.$this->_sPluginname.'</div>' + .'<div id="'.$this->getHtmlOutId().'" ' + .'class="out' + .(isset($aConfig['window-cols']) && $aConfig['window-cols'] ? ' cmd-cols-'.$aConfig['window-cols'] : '' ) + .(isset($aConfig['window-lines']) && $aConfig['window-lines'] ? ' cmd-lines-'.$aConfig['window-lines'] : '' ) + .'"></div>' + .'</div>'; } // --------------------------------------------------------------- diff --git a/public_html/deployment/index.php b/public_html/deployment/index.php index 1ebe3cd4d4bb9e05af25a4b69713342786d43fb9..bc10f1280056615d4c8a609063a1ef8783751656 100644 --- a/public_html/deployment/index.php +++ b/public_html/deployment/index.php @@ -85,9 +85,12 @@ $CI_plugins->setType('shellcmd'); $aEnabledShellPlugins=$CI_plugins->getEnabledPlugins('shellcmd'); $sHeader.= count($aEnabledShellPlugins) ? '' - ."\n<!-- shellcmd plugins :: js files -->\n" + ."\n<!-- for shellcmd plugins -->\n" .'<script src="/vendor/axelhahn/js/ubd.class.js"></script>'."\n" - .'<script src="/vendor/axelhahn/js/addi.js"></script>'."\n" + // .'<script src="/vendor/axelhahn/js/addi.js"></script>'."\n" + .'<script src="/vendor/winbox/0.2.82/winbox.min.js"></script>'."\n" + .'<link rel="stylesheet" type="text/css" href="/vendor/winbox/0.2.82/winbox.min.css"/>'."\n" + ."<!-- shellcmd scripts -->\n" : '' ; foreach ($aEnabledShellPlugins as $sPlugin){ @@ -99,8 +102,8 @@ foreach ($aEnabledShellPlugins as $sPlugin){ .'<li >' .$oHtml->getLink(array( 'href'=>'#', - // 'onclick'=>'$(\'#'.$CI_plugins->getHtmlOutIdWrapper().'\').slideToggle(100);', - 'onclick'=>'toggleShellWindow(\''.$CI_plugins->getHtmlOutIdWrapper().'\', this);', + // 'onclick'=>'toggleShellWindow(\''.$CI_plugins->getHtmlOutIdWrapper().'\', this);', + 'onclick'=>'toggleShellWindow(\''.$CI_plugins->getHtmlOutId().'\', this);', 'role'=>'button', 'aria-expanded'=>'false', 'icon'=> (isset($aPluginConfig['icon']) ? $aPluginConfig['icon'] : ''), diff --git a/public_html/deployment/js/functions.js b/public_html/deployment/js/functions.js index a653e7bbd7a60d241ade87261e5127a912bb4780..5d0ff311cb7ac3a07fda6e37295c8b5985dcca3c 100644 --- a/public_html/deployment/js/functions.js +++ b/public_html/deployment/js/functions.js @@ -42,14 +42,43 @@ 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 */ function toggleShellWindow(idWrapperDiv, oLink){ - $('#'+idWrapperDiv).slideToggle(100); - $(oLink).parent().toggleClass('active'); + if(aWinBoxes[idWrapperDiv]){ + aWinBoxes[idWrapperDiv].close(); + } else { + var oWrapper=document.getElementById(idWrapperDiv); + aWinBoxes[idWrapperDiv] = WinBox({ + title: oLink.innerText, + id: 'winbox-'+idWrapperDiv, + border: 5, + background: "#628", + class: [ "no-min", "no-max", /* "no-full", "no-resize", "no-move"*/ "ciwinbox" ], + + // position: + x: "center", + y: "center", + + // width: oWrapper.clientWidth+'px', + + mount: oWrapper, + + onclose: function(){ + delete aWinBoxes[idWrapperDiv]; + $(oLink).parent().removeClass('active'); + } + }); + $(oLink).parent().addClass('active'); + window.setTimeout("aWinBoxes['"+idWrapperDiv+"'].resize("+(oWrapper.clientWidth+25)+", "+(oWrapper.clientHeight+150)+").move('center', 'center')", 200); + } + // $('#'+idWrapperDiv).slideToggle(100); + // $(oLink).parent().toggleClass('active'); } // ---------------------------------------------------------------------- @@ -58,7 +87,7 @@ function toggleShellWindow(idWrapperDiv, oLink){ $(document).ready(function() { initSoftscroll(); - addi.init(); + // addi.init(); // $(".optionName").popover({trigger: "hover"}); // $("#content").hide().fadeIn(300); }); diff --git a/public_html/deployment/main.css b/public_html/deployment/main.css index 3a2fb3dc048f4ba7975d10b6962d4dda869113e2..3026f0b145552968a695c751bf09af8e13d181e0 100644 --- a/public_html/deployment/main.css +++ b/public_html/deployment/main.css @@ -283,17 +283,32 @@ input[type="radio"]:checked+label, input[type="checkbox"]:checked+label{ .tab-pane p {margin: 1em 10px;} /* ----- plugins ----- */ + +/* .draggable-onpage{position: absolute;} .draggable-onscreen{position: fixed;} .isdragging{opacity: 0.9;} .cmdoutbox{background: rgba(0,0,0,0.9); color: #f0f0f0; box-shadow: 0.2em 0.2em 0.5em rgba(0,0,0,0.4); display: none;} .cmdoutbox .header{background:#628;padding: 0.1em 0.5em;} + .cmdoutbox .out{color:#ccf; ;padding: 0.5em; font-family: monospace; overflow: scroll; white-space: nowrap; } .cmdoutbox button.btn-close{background:#e55; color: #fff; border: none;} .cmdoutbox .bar{background: rgba(255,255,255,0.1);} .cmdoutbox .progress{background: #85a;} +*/ +.ciwinbox .wb-body{ + background: rgba(0,0,0,0.9) !important; + color: #ccf; + font-family: monospace; + padding: 0.5em; + overflow: scroll; + white-space: nowrap; +} +.cmdoutbox{display: none;} +.ciwinbox .bar{background: rgba(255,255,255,0.1);} +.ciwinbox .progress{background: #85a;} .float-right{float: right;}