Skip to content
Permalink
Browse files

Plans updated

* New component: iFrame
* New component: HTML
* New style: Opacity 0%
  • Loading branch information...
sergejey committed Apr 11, 2019
1 parent 6837f4b commit 526e5290ac337771f5f6ac999c637e4741d417bc
@@ -1347,6 +1347,7 @@
'STYLE_FADEOUT50' => 'Opacity 50%',
'STYLE_FADEOUT30' => 'Opacity 30%',
'STYLE_FADEOUT10' => 'Opacity 10%',
'STYLE_FADEOUT0' => 'Opacity 0%',
'SEE_ALSO' => 'See also',
'PLAN_COMPONENTS' => 'Components',
@@ -1349,6 +1349,7 @@
'STYLE_FADEOUT50' => 'Прозрачность 50%',
'STYLE_FADEOUT30' => 'Прозрачность 30%',
'STYLE_FADEOUT10' => 'Прозрачность 10%',
'STYLE_FADEOUT0' => 'Прозрачность 0%',
'SEE_ALSO' => 'Смотрите также',
'PLAN_COMPONENTS' => 'Компоненты',
@@ -57,7 +57,7 @@
}
$seen[$var]=1;
$id = 'var_' . preg_replace('/\W/', '_', $var);
$sub_js.="if (obj[i]['PROPERTY']=='$var') {\$('.$id').html(obj[i]['VALUE']);$.publish('$var.updated', obj[i]['VALUE']);}\n";
$sub_js.="if (obj[i]['PROPERTY'].toLowerCase()=='$var') {\$('.$id').html(obj[i]['VALUE']);$.publish('$var.updated', obj[i]['VALUE']);}\n";
$result = str_replace($m[0][$i], '<span class="'.$id.'">'.getGlobal($var).'</span>', $result);
}
$js="<script language='javascript'>\$.subscribe('wsConnected', function (_) {
@@ -174,7 +174,7 @@ function getJavascript($attributes)
function componentUpdated{$this->component_id}(property_name,property_value) {
if (property_name=='$prop_name') {
if (property_name.toLowerCase()=='$prop_name') {
gauge{$this->component_id}.redraw(property_value);
}
}
@@ -0,0 +1,83 @@
<?php
include_once DIR_MODULES . 'plans/plan_component.class.php';
class html extends plan_component
{
function __construct($id)
{
$this->name = str_replace('.class.php', '', basename(__FILE__));
parent::__construct($id);
}
function getProperties()
{
$properties = parent::getProperties();
$properties[] = array(
'NAME' => 'content',
'TITLE' => 'Content',
'TYPE' => 'text',
'DEFAULT' => ''
);
$properties[] = array(
'NAME' => 'scale',
'TITLE' => LANG_APPEAR_SCALE.' (%)',
'TYPE' => 'int',
'DEFAULT' => '100'
);
$properties[] = array(
'NAME' => 'bgcolor',
'TITLE' => LANG_COLOR.' (background)',
'TYPE' => 'rgb',
'DEFAULT' => 'white'
);
$this->processProperties($properties);
return $properties;
}
function getSVG($attributes)
{
$x = (int)$attributes['x'];
$y = (int)$attributes['y'];
$data = $this->getData();
$bgcolor = $data['bgcolor']['VALUE'];
//$content = processTitle($data['content']['VALUE']);
$content = ($data['content']['VALUE']);
$scaleProc=(int)$data['scale']['VALUE'];
if (!$scaleProc) {
$scaleProc=100;
}
$scale = round($scaleProc/100,2);
$scaleProc=(1/$scale)*100;
$width = (int)$attributes['width'];
if (!$width) $width = 200;
$height = (int)$attributes['height'];
if (!$height) $height = 200;
$svg = "<svg width='$width' height='$height' x='$x' y='$y'>";
$svg .= "<g transform=\"scale($scale)\">";
$svg .= "<foreignObject x=\"0\" y=\"0\" width=\"$scaleProc%\" height=\"$scaleProc%\">";
$svg .= "<div style=\"width: 100%; height: 100%;background-color:$bgcolor;\">";
$svg .= $content;
$svg .= "</div>";
$svg .= "</foreignObject>";
$svg .= "</g>";
$svg .= "</svg>";
return $svg;
}
function getJavascript($attributes)
{
$code = '';
return $code;
}
}
@@ -0,0 +1,81 @@
<?php
include_once DIR_MODULES . 'plans/plan_component.class.php';
class iframe extends plan_component
{
function __construct($id)
{
$this->name = str_replace('.class.php', '', basename(__FILE__));
parent::__construct($id);
}
function getProperties()
{
$properties = parent::getProperties();
$properties[] = array(
'NAME' => 'url',
'TITLE' => 'URL',
'TYPE' => 'text',
'DEFAULT' => '/menu.html'
);
$properties[] = array(
'NAME' => 'scale',
'TITLE' => LANG_APPEAR_SCALE.' (%)',
'TYPE' => 'int',
'DEFAULT' => '100'
);
$properties[] = array(
'NAME' => 'bgcolor',
'TITLE' => LANG_COLOR.' (background)',
'TYPE' => 'rgb',
'DEFAULT' => 'white'
);
$this->processProperties($properties);
return $properties;
}
function getSVG($attributes)
{
$x = (int)$attributes['x'];
$y = (int)$attributes['y'];
$data = $this->getData();
$bgcolor = $data['bgcolor']['VALUE'];
$url = $data['url']['VALUE'];
$scaleProc=(int)$data['scale']['VALUE'];
if (!$scaleProc) {
$scaleProc=100;
}
$scale = round($scaleProc/100,2);
$scaleProc=(1/$scale)*100;
$width = (int)$attributes['width'];
if (!$width) $width = 200;
$height = (int)$attributes['height'];
if (!$height) $height = 200;
$svg = "<svg width='$width' height='$height' x='$x' y='$y'>";
$svg .= "<g transform=\"scale($scale)\">";
$svg .= "<foreignObject x=\"0\" y=\"0\" width=\"$scaleProc%\" height=\"$scaleProc%\">";
$svg .= "<iframe src=\"$url\" style=\"width: 100%; height: 100%;background-color:$bgcolor;\" frameborder='0'>";
$svg .= "</iframe>";
$svg .= "</foreignObject>";
$svg .= "</g>";
$svg .= "</svg>";
return $svg;
}
function getJavascript($attributes)
{
$code = '';
return $code;
}
}
@@ -89,7 +89,7 @@ function getJavascript($attributes)
$prop_name=strtolower($data['value']['LINKED_OBJECT'].'.'.$data['value']['LINKED_PROPERTY']);
$code = <<<EOD
function componentUpdated{$this->component_id}(property_name,property_value) {
if (property_name=='$prop_name') {
if (property_name.toLowerCase()=='$prop_name') {
var elem=$('#procElem{$this->component_id}');
if (property_value=='1') {
elem.attr('widthNum','5');
@@ -524,6 +524,7 @@ function getCSSClasses($plan_id) {
$classes[]=array('CLASS'=>'fadeout50','TITLE'=>LANG_STYLE_FADEOUT50);
$classes[]=array('CLASS'=>'fadeout30','TITLE'=>LANG_STYLE_FADEOUT30);
$classes[]=array('CLASS'=>'fadeout10','TITLE'=>LANG_STYLE_FADEOUT10);
$classes[]=array('CLASS'=>'fadeout0','TITLE'=>LANG_STYLE_FADEOUT0);
if ($plan_rec['CUSTOM_CSS']!='') {
if (preg_match_all('/\.([^\s{\n\.]+)\s+{/is',$plan_rec['CUSTOM_CSS'],$m)) {
@@ -99,7 +99,7 @@
var objCnt = obj.length;
if(objCnt) {
for(var i=0;i<objCnt;i++) {
switch(obj[i]['PROPERTY']) {
switch(obj[i]['PROPERTY'].toLowerCase()) {
case 'thiscomputer.volumelevel':
[#APP_PLAYER_ID#]_volumeLevel = parseInt(obj[i]['VALUE']);
break;
@@ -8,6 +8,11 @@
to { opacity:0; }
}

@keyframes fadeOut0 {
from { opacity:1; }
to { opacity:0; }
}

@keyframes fadeOut10 {
from { opacity:1; }
to { opacity:0.1; }
@@ -58,6 +63,14 @@
animation-duration:0.6s;
}

.svg_content .fadeout0 {
display:block;
opacity:1;
animation:fadeOut0 ease-in 1;
animation-fill-mode:forwards;
animation-duration:0.6s;
}

.svg_content .fadeout10 {
display:block;
opacity:1;

0 comments on commit 526e529

Please sign in to comment.
You can’t perform that action at this time.