"source": {
"type": "git",
"url": "git://git.cubedesigners.com/cubist_util.git",
- "reference": "ca9f1c2f7c8e729a1b6ff64ece1e1c1ab1ef4228"
+ "reference": "3d0d8337bd9e4b3ccf3d99ab7070ede27b1475bb"
},
"dist": {
"type": "tar",
- "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-e2358f.tar",
- "reference": "ca9f1c2f7c8e729a1b6ff64ece1e1c1ab1ef4228",
- "shasum": "c0c32959b037843d1d053b60223a3e13e0693278"
+ "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-b28a8b.tar",
+ "reference": "3d0d8337bd9e4b3ccf3d99ab7070ede27b1475bb",
+ "shasum": "b60f0a943faf5ff520e7bab322d71b124705e744"
},
"require": {
"cubist/net": "dev-master",
}
],
"description": "Utilities class",
- "time": "2021-09-15T15:24:17+00:00"
+ "time": "2021-09-22T07:22:01+00:00"
},
{
"name": "dflydev/dot-access-data",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "f267d7cb9b159805d3e6ca805210d85f40c27209"
+ "reference": "3d1ead403e05ee0b9aa93a6ff720704970aec9c8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/f267d7cb9b159805d3e6ca805210d85f40c27209",
- "reference": "f267d7cb9b159805d3e6ca805210d85f40c27209",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/3d1ead403e05ee0b9aa93a6ff720704970aec9c8",
+ "reference": "3d1ead403e05ee0b9aa93a6ff720704970aec9c8",
"shasum": ""
},
"require": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2021-09-21T13:41:09+00:00"
+ "time": "2021-09-21T18:36:59+00:00"
},
{
"name": "laravel/serializable-closure",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
- "reference": "d0d9bff8b7a496961c28877346be2e348fe5e6d6"
+ "reference": "25d75271d2d88f211d4684638cbc938a75868b12"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nette/utils/zipball/d0d9bff8b7a496961c28877346be2e348fe5e6d6",
- "reference": "d0d9bff8b7a496961c28877346be2e348fe5e6d6",
+ "url": "https://api.github.com/repos/nette/utils/zipball/25d75271d2d88f211d4684638cbc938a75868b12",
+ "reference": "25d75271d2d88f211d4684638cbc938a75868b12",
"shasum": ""
},
"require": {
"issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/master"
},
- "time": "2021-09-20T10:52:29+00:00"
+ "time": "2021-09-22T00:14:13+00:00"
},
{
"name": "opis/closure",
namespace Fluidbook\Tools\Links;
+use Cubist\Util\Graphics\Color;
+
class ColorLink extends ContentLink
{
protected $role = '';
public function getCSS()
{
$res = parent::getCSS();
- $res .= 'background-color:' . wsHTML5::colorToCSS($this->to, 1) . ';';
+ $res .= 'background-color:' . Color::colorToCSS($this->to, 1) . ';';
return $res;
}
public function getAdditionnalContent()
{
$res = parent::getAdditionnalContent();
- $res .= ' data-color="' . wsHTML5::colorToCSS($this->to, 1) . '"';
+ $res .= ' data-color="' . Color::colorToCSS($this->to, 1) . '"';
return $res;
}
}
namespace Fluidbook\Tools\Links;
+use Cubist\Util\Url;
+
class FileLink extends NormalLink
{
protected $role = 'link';
{
$this->copyExternalFile($this->to);
- if ($this->compiler->book->parametres->linkFilePrefix && !CubeIT_Util_Url::isDistant($this->to)) {
+ if ($this->compiler->book->parametres->linkFilePrefix && !Url::isDistant($this->to)) {
return $this->compiler->book->parametres->linkFilePrefix . $this->to;
}
namespace Fluidbook\Tools\Links;
+use Cubist\Util\Files\Files;
+
class HTMLMultimediaLink extends Link
{
protected function _correctFiles($dir)
{
- $files = CubeIT_Files::getRecursiveDirectoryIterator($dir);
+ $files = Files::getRecursiveDirectoryIterator($dir);
foreach ($files as $f) {
/* @var $f SplFileInfo */
- if ($f->getExtension() == 'js') {
+ if ($f->getExtension() === 'js') {
$this->_correctFile($f);
}
}
namespace Fluidbook\Tools\Links;
+use Cubist\Util\Url;
+
class IFrameLink extends Link
{
protected $_defaultTooltip;
public static function _handleFile($link)
{
$to = preg_replace('/^data\/links\//', '', $link->to);
- if (!CubeIT_Util_Url::isDistant($to)) {
+ if (!Url::isDistant($to)) {
$e = explode('.', $to);
$ext = array_pop($e);
if ($ext === 'oam' || $ext === 'zip') {
namespace Fluidbook\Tools\Links;
-class inlineSlideshowLink extends slideshowLink
+class InlineSlideshowLink extends SlideshowLink
{
public function getDepth()
{
namespace Fluidbook\Tools\Links;
+use Cubist\Util\Graphics\Color;
+
class TextLink extends ContentLink
{
public function getCSS()
$fz = $this->height * $this->getCssScale();
$fz = round($fz / $font['capHeight'], 2);
$res = parent::getCSS();
- $res .= 'line-height:' . $font['capHeight'] . ';font-size:' . $fz . 'px;font-family:' . $font['family'] . ';color:' . wsHTML5::colorToCSS($this->extra, 1) . ';';
+ $res .= 'line-height:' . $font['capHeight'] . ';font-size:' . $fz . 'px;font-family:' . $font['family'] . ';color:' . Color::colorToCSS($this->extra, 1) . ';';
return $res;
}
return parent::getHTMLContainerClass() . ' textLink';
}
-
- public function getAdditionnalContent()
- {
- $res = parent::getAdditionnalContent();
-
- return $res;
- }
-
public function getHTMLContent()
{
return $this->to;
namespace Fluidbook\Tools\Links;
+use Cubist\Util\Url;
+
class VideoLink extends Link
{
public $defaultZIndex = 50;
public function getHTMLContent()
{
- if (!CubeIT_Util_Url::isDistant($this->to)) {
+ if (!Url::isDistant($this->to)) {
$this->copyExternalFile($this->to, true);
}
{
$attr['name'] = videoPopupLink::getBasename($data->to);
- if (CubeIT_Util_Url::isDistant($data->to)) {
+ if (Url::isDistant($data->to)) {
$attr['url'] = $data->to;
}
$attr['id'] = 'video_' . $data->id;
if (!is_null($w) && !is_null($h)) {
$attr['width'] = $w;
$attr['height'] = $h;
- } else if (!is_null($compiler) && CubeIT_Util_Url::isLocal($data->to)) {
+ } else if (!is_null($compiler) && Url::isLocal($data->to)) {
// Get video dimensions from thumbnail if possible (locally uploaded files)
$path = $compiler->wdir . '/' . $data->to;
$e = explode(',', `ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 $path`);
namespace Fluidbook\Tools\Links;
+use Cubist\Util\Url;
+
class VideoPopupLink extends NormalLink
{
public static function getBasename($f)
{
$prefix = '';
- if (CubeIT_Util_Url::isDistant($f)) {
+ if (Url::isDistant($f)) {
$prefix = mb_substr(sha1($f), 0, 10) . '-';
$e = explode('/', $f);
$f = array_pop($e);
public function getURL()
{
- if (!CubeIT_Util_Url::isDistant($this->to)) {
+ if (!Url::isDistant($this->to)) {
$this->copyExternalFile($this->to, true);
}
return '#/video/' . self::getBasename($this->to);
$this->video_auto_start = true; // Videos should always autoplay
$this->video_sound_on = true;
$this->video_controls = true;
- return ' data-video="' . rawurlencode(videoLink::makeVideoTag($this, null, null, $this->compiler)) . '" ';
+ return ' data-video="' . rawurlencode(VideoLink::makeVideoTag($this, null, null, $this->compiler)) . '" ';
}
public function keep()
public function getURL()
{
- $res = str_replace('"', '\'', Link::getUniversalLocation($this->to));
- return $res;
+ return str_replace('"', '\'', Link::getUniversalLocation($this->to));
}
public function getTarget()
{
- if (strpos($this->getURL(), 'javascript:') === 0) {
+ if (str_starts_with($this->getURL(), 'javascript:')) {
return '_self';
}
return $this->target;
return $attributes;
}
+ /**
+ * @throws \JsonException
+ */
public static function getVideoSetup($data, $compiler)
{
static::addVideoJS($compiler); // Ensure videoJS core is included first
$setup = [];
}
- return json_encode($setup, JSON_UNESCAPED_SLASHES);
+ return json_encode($setup, JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES);
}
}
}
- public static function makeVideoTag($link, $width, $height, $compiler = null)
+ public static function makeVideoTag($link, $width=null, $height=null, $compiler = null)
{
if ($link->video_service == 0) {
return parent::makeVideoTag($link, $width, $height, $compiler);
namespace Fluidbook\Tools\Links;
+use Cubist\Util\Files\Files;
+use Cubist\Util\Text;
+
class ZoomLink extends NormalLink
{
protected $maxzoom_default = 2;
}
if (isset($attributes['border']) && $attributes['border'] > 0) {
- $tmp = CubeIT_Files::tempnam() . '.jpg';
+ $tmp = Files::tempnam() . '.jpg';
CubeIT_CommandLine_Imagemagick::addBorder($both, $tmp, $attributes['border'], $attributes['borderColor']);
$compiler->vdir->addTemp($both);
$both = $tmp;
foreach ($groups as $group) {
if (empty($group)) continue;
- $group_classes[] = 'zoom-group-' . trim(CubeIT_Text::str2URL($group));
+ $group_classes[] = 'zoom-group-' . trim(Text::str2URL($group));
}
return array_merge($group_classes, ['zoomPopup'], parent::getClasses());