Skip to content
Snippets Groups Projects
Commit c31ca3b1 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

changes to use winbox

parent d5b2020d
Branches
No related tags found
1 merge request!576561 add winbox
......@@ -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>';
}
// ---------------------------------------------------------------
......
......@@ -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'] : ''),
......
......@@ -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);
});
......
......@@ -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;}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment