From 7d66d27b1fa511fea9e88088a7d4e0609a2d0e55 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 14 Sep 2016 14:30:36 -0400 Subject: [PATCH] Version 5.0.4 --- README.md | 18 ++++-- build/libraries/videobox/videobox.xml | 2 +- build/plugins/html5/html5.xml | 2 +- build/plugins/soundcloud/soundcloud.xml | 2 +- build/plugins/twitch/twitch.xml | 2 +- .../en-GB/en-GB.plg_system_videobox.ini | 2 +- .../en-GB/en-GB.plg_system_videobox.sys.ini | 3 +- build/plugins/videobox/scripts.php | 25 ++++++-- build/plugins/videobox/videobox.xml | 2 +- build/plugins/vimeo/vimeo.xml | 2 +- build/plugins/youtube/youtube.xml | 2 +- gulpfile.js | 3 + package.json | 2 +- src/pkg_videobox.xml | 2 + .../en-GB/en-GB.plg_system_videobox.ini | 2 +- .../en-GB/en-GB.plg_system_videobox.sys.ini | 3 +- src/plugins/videobox/scripts.php | 25 ++++++-- src/scripts.php | 63 +++++++++++++++++++ 18 files changed, 132 insertions(+), 30 deletions(-) create mode 100644 src/scripts.php diff --git a/README.md b/README.md index cbe4ce5..e703260 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,20 @@ [![GitHub release](https://img.shields.io/github/release/HitkoDev/Videobox-Joomla.svg)](https://github.com/HitkoDev/Videobox-Joomla/releases/latest) [![GitHub total downloads](https://img.shields.io/github/downloads/HitkoDev/Videobox-Joomla/total.svg)](https://github.com/HitkoDev/Videobox-Joomla/releases) -#[Videobox - a lightweight and versitile video player](http://hitko.eu/videobox) -Videobox is a Joomla! extension for adding video (and audio) to your site. It supports videos from YouTube and Vimeo, as well as music from SoundCloud, Twithc videos and streams, and HTML5 supported video and audio formats. It offers several ways to insert a video, including direct player, pop-up player, and a video gallery. Just put the video link in the Videobox tag and you'll be up & running! +# [Videobox - a lightweight and versitile video player](https://hitko.eu/videobox) +Videobox is a Joomla! 3.6 extension for adding video (and audio) to your site. It supports videos from YouTube and Vimeo, as well as music from SoundCloud, Twithc videos and streams, and HTML5 supported video and audio formats. It offers several ways to insert a video, including direct player, pop-up player, and a video gallery. Just put the video link in the Videobox tag and you'll be up & running! -###Box display -Box display is a great way to insert videos without sacrificing a lot of space for the player. That way it makes your articles straight to the point without unnecessary distractions while keeping the videos right where they belong to. Rather than the huge full-size video player taking up space and distracting the reader, the box display only shows a small video thumbnail with an optional title. When user clicks the thumbnail, the video opens in a lightbox player, or in an inline player. The box element itself behaves just like the photos in your article - you can set it to float to the left or to the right, centre it with margin: 0 auto; or apply any other CSS styling to it. + * [Getting started](https://hitko.eu/videobox/getting-started/#htk-videobox-for-joomla) + * [Documentation](https://hitko.eu/videobox/documentation/) + * [Display methods](https://hitko.eu/videobox/display-methods/) + * [Player effects](https://hitko.eu/videobox/player-effects/) + * [Video providers](https://hitko.eu/videobox/adapters/) -###Link display +### [Box display](https://hitko.eu/videobox/display-methods/#htk-box) +Box display is a great way to insert videos without sacrificing a lot of space for the player. That way it makes your articles straight to the point without unnecessary distractions while keeping the videos right where they belong to. Rather than the huge full-size video player taking up space and distracting the reader, the box display only shows a small video thumbnail with an optional title. When user clicks the thumbnail, the video opens in a lightbox player, or in an inline player. The box element itself behaves just like the photos in your article - you can set it to float to the left or to the right, centre it with ```margin: 0 auto;``` or apply any other CSS styling to it. + +### [Link display](https://hitko.eu/videobox/display-methods/#htk-links) Box display is great, however it's not ideal when the video is just an irrelevant reference or a note, or when the video itself isn't directly related to the topic. In this case even a small box thumbnail would be irrelevant and distracting for the reader. An ordinary link to the video seems good enough, but when users click it they leave your website. Videobox link display solves that problem - you can still keep the reference, but instead of redirecting users to an external page the link will open a lightbox player directly on your website. -###Gallery display +### [Gallery display](https://hitko.eu/videobox/display-methods/#htk-gallery) In a way, the gallery display is the exact opposite of the box and the link display. It's designed to display a lot of videos in an organised manner, featuring a responsive grid and a built-in pagination. That way you can insert all of your videos at once and let users browse through them quickly. Alternatively a gallery can be displayed as a slider, showing only a few thumbnails at a time. \ No newline at end of file diff --git a/build/libraries/videobox/videobox.xml b/build/libraries/videobox/videobox.xml index 8dee62f..4b547cb 100644 --- a/build/libraries/videobox/videobox.xml +++ b/build/libraries/videobox/videobox.xml @@ -10,7 +10,7 @@ Copyright (C) 2016 HtikoDev development@hitko.si https://hitko.eu/videobox/ - 5.0.2 + 5.0.4 adapter.php diff --git a/build/plugins/html5/html5.xml b/build/plugins/html5/html5.xml index 3543a9a..da164e1 100644 --- a/build/plugins/html5/html5.xml +++ b/build/plugins/html5/html5.xml @@ -9,7 +9,7 @@ Copyright (C) 2016 HtikoDev development@hitko.si https://hitko.eu/videobox/ - 5.0.2 + 5.0.4 html5.php diff --git a/build/plugins/soundcloud/soundcloud.xml b/build/plugins/soundcloud/soundcloud.xml index 9acb288..5526359 100644 --- a/build/plugins/soundcloud/soundcloud.xml +++ b/build/plugins/soundcloud/soundcloud.xml @@ -9,7 +9,7 @@ Copyright (C) 2016 HtikoDev development@hitko.si https://hitko.eu/videobox/ - 5.0.2 + 5.0.4 soundcloud.php diff --git a/build/plugins/twitch/twitch.xml b/build/plugins/twitch/twitch.xml index 9190ab4..058a7e6 100644 --- a/build/plugins/twitch/twitch.xml +++ b/build/plugins/twitch/twitch.xml @@ -9,7 +9,7 @@ Copyright (C) 2016 HtikoDev development@hitko.si https://hitko.eu/videobox/ - 5.0.2 + 5.0.4 twitch.php diff --git a/build/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.ini b/build/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.ini index f7370eb..2e9df7c 100644 --- a/build/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.ini +++ b/build/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.ini @@ -6,7 +6,7 @@ ; Projectsite: https://hitko.eu/videobox PLG_SYSTEM_VIDEOBOX="System - Videobox" -PLG_SYSTEM_VIDEOBOX_XML_DESCRIPTION="

Videobox - Video and audio player, and gallery for Joomla

Basic usage

{videobox}video ID{/videobox}

Video ID can be either a link to the video or the ID from the link - see adapters documentation for all supported formats
Multiple videos can be inserted at a time, in this case separate video IDs by |, (a vertical line and a comma)

See the getting started guide and Videobox documentation for more informations and examples

Property sets

Previous versions of Videobox had different settings for different display methods, but since that was pretty messy it's been replaced by property sets. Property sets aren't limited to one display method, since each property set contains complete Videobox configuration. By using {videobox@property-set-key}video ID{/videobox} you can apply that configuration to a specific set of videos.

" +PLG_SYSTEM_VIDEOBOX_XML_DESCRIPTION="

Videobox - Video and audio player, and gallery for Joomla

Basic usage

{videobox}video ID{/videobox}

Video ID can be either a link to the video or the ID from the link - see adapters documentation for all supported formats
Multiple videos can be inserted at a time, in this case separate video IDs by |, (a vertical line and a comma)

See the getting started guide and Videobox documentation for more informations and examples

Property sets

Previous versions of Videobox had different settings for different display methods, but since that was pretty messy it's been replaced by property sets. Property sets aren't limited to one display method, since each property set contains complete Videobox configuration. By using {videobox@property-set-key}video ID{/videobox} you can apply that configuration to a specific set of videos.

Useful links


" PLG_SYSTEM_VIDEOBOX_PROPERTY_SETS="Property sets" PLG_SYSTEM_VIDEOBOX_PROPERTY_SETS_DESC="Property sets let you create different configurations for Videobox. To use a specific configuration, use {videobox@property-set-key}" diff --git a/build/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.sys.ini b/build/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.sys.ini index 1a5cfaa..3c93b2e 100644 --- a/build/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.sys.ini +++ b/build/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.sys.ini @@ -6,4 +6,5 @@ ; Projectsite: https://hitko.eu/videobox PLG_SYSTEM_VIDEOBOX="System - Videobox" -PLG_SYSTEM_VIDEOBOX_XML_DESCRIPTION="

Videobox - Video and audio player, and gallery for Joomla

" \ No newline at end of file +PLG_SYSTEM_VIDEOBOX_XML_DESCRIPTION="

Videobox - Video and audio player, and gallery for Joomla

" +PLG_SYSTEM_VIDEOBOX_INSTALL_DESCRIPTION="

Basic usage

{videobox}video ID{/videobox}

Video ID can be either a link to the video or the ID from the link - see adapters documentation for all supported formats
Multiple videos can be inserted at a time, in this case separate video IDs by |, (a vertical line and a comma)

See the getting started guide and Videobox documentation for more informations and examples

Property sets

Previous versions of Videobox had different settings for different display methods, but since that was pretty messy it's been replaced by property sets. Property sets aren't limited to one display method, since each property set contains complete Videobox configuration. By using {videobox@property-set-key}video ID{/videobox} you can apply that configuration to a specific set of videos.

Useful links


" \ No newline at end of file diff --git a/build/plugins/videobox/scripts.php b/build/plugins/videobox/scripts.php index 47baa2e..59fa222 100644 --- a/build/plugins/videobox/scripts.php +++ b/build/plugins/videobox/scripts.php @@ -25,18 +25,19 @@ jimport('joomla.form.form'); jimport('joomla.plugin.helper'); jimport('joomla.registry.registry'); +jimport('joomla.version'); class plgsystemvideoboxInstallerScript { function install($parent) { - $this->in_up($parent); + $this->in_up($parent, 'install'); } function update($parent) { - $this->in_up($parent); + $this->in_up($parent, 'update'); } - function in_up($parent) { + function in_up($parent, $type) { $db = JFactory::getDbo(); $query = $db->getQuery(true); @@ -55,7 +56,11 @@ function in_up($parent) { $data = $form->renderFieldset('basic'); $html = new DOMDocument('1.0', 'UTF-8'); - $html->loadHTML(''.$data); + try { + $html->loadHTML(''.$data); + } catch (Exception $e) { + $html = false; + } if($html){ $xpath = new DOMXpath($html); $fields = $xpath->query("//*[starts-with(@name,'params')]"); @@ -123,6 +128,8 @@ function in_up($parent) { $result = $db->execute(); } } + + echo JText::_('PLG_SYSTEM_VIDEOBOX_INSTALL_DESCRIPTION'); } function innerHTML($element) { @@ -170,12 +177,10 @@ function splitName($name){ } $n = count($parts); for($i = 1; $i < $n; $i++){ - var_dump($parts[$i], $parts[$i-1].'X'); if($parts[$i] == $parts[$i-1].'X'){ return false; } } - var_dump($parts); return $parts; } @@ -185,6 +190,14 @@ function uninstall($parent) { function preflight($type, $parent) { + $jv = new JVersion(); + if(!$jv->isCompatible('3.6')) { + $typing = 'installing'; + if($type == 'update') $typing = 'updating'; + Jerror::raiseWarning(null, 'Please update Joomla! to version 3.6 or later before ' . $typing . ' Videobox'); + return false; + } + } function postflight($type, $parent) { diff --git a/build/plugins/videobox/videobox.xml b/build/plugins/videobox/videobox.xml index a23ad8e..ed44fed 100644 --- a/build/plugins/videobox/videobox.xml +++ b/build/plugins/videobox/videobox.xml @@ -9,7 +9,7 @@ Copyright (C) 2016 HtikoDev development@hitko.si https://hitko.eu/videobox/ - 5.0.2 + 5.0.4 scripts.php diff --git a/build/plugins/vimeo/vimeo.xml b/build/plugins/vimeo/vimeo.xml index c8e43ab..63e1f42 100644 --- a/build/plugins/vimeo/vimeo.xml +++ b/build/plugins/vimeo/vimeo.xml @@ -9,7 +9,7 @@ Copyright (C) 2016 HtikoDev development@hitko.si https://hitko.eu/videobox/ - 5.0.2 + 5.0.4 vimeo.php diff --git a/build/plugins/youtube/youtube.xml b/build/plugins/youtube/youtube.xml index 729cdc2..e61c51f 100644 --- a/build/plugins/youtube/youtube.xml +++ b/build/plugins/youtube/youtube.xml @@ -9,7 +9,7 @@ Copyright (C) 2016 HtikoDev development@hitko.si https://hitko.eu/videobox/ - 5.0.2 + 5.0.4 youtube.php diff --git a/gulpfile.js b/gulpfile.js index 7409024..4f7f08f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -184,6 +184,9 @@ gulp.task('pack-parts', [ .pipe(template(manifestData)) .pipe(gulp.dest('./dist/packages')), + gulp.src('./src/scripts.php') + .pipe(gulp.dest('./dist/packages')), + ]); }); diff --git a/package.json b/package.json index da018ad..443b217 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "license": "GPL-3.0", "readme": "README.md", - "version": "5.0.3", + "version": "5.0.4", "name": "Videobox-Joomla", "copyright": "Hitko", "homepage": "https://hitko.eu/videobox/", diff --git a/src/pkg_videobox.xml b/src/pkg_videobox.xml index 85e02f9..8111297 100644 --- a/src/pkg_videobox.xml +++ b/src/pkg_videobox.xml @@ -12,6 +12,8 @@ <%= url %> <%= version %> + scripts.php + lib_videobox.zip plg_system_videobox.zip diff --git a/src/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.ini b/src/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.ini index f7370eb..2e9df7c 100644 --- a/src/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.ini +++ b/src/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.ini @@ -6,7 +6,7 @@ ; Projectsite: https://hitko.eu/videobox PLG_SYSTEM_VIDEOBOX="System - Videobox" -PLG_SYSTEM_VIDEOBOX_XML_DESCRIPTION="

Videobox - Video and audio player, and gallery for Joomla

Basic usage

{videobox}video ID{/videobox}

Video ID can be either a link to the video or the ID from the link - see adapters documentation for all supported formats
Multiple videos can be inserted at a time, in this case separate video IDs by |, (a vertical line and a comma)

See the getting started guide and Videobox documentation for more informations and examples

Property sets

Previous versions of Videobox had different settings for different display methods, but since that was pretty messy it's been replaced by property sets. Property sets aren't limited to one display method, since each property set contains complete Videobox configuration. By using {videobox@property-set-key}video ID{/videobox} you can apply that configuration to a specific set of videos.

" +PLG_SYSTEM_VIDEOBOX_XML_DESCRIPTION="

Videobox - Video and audio player, and gallery for Joomla

Basic usage

{videobox}video ID{/videobox}

Video ID can be either a link to the video or the ID from the link - see adapters documentation for all supported formats
Multiple videos can be inserted at a time, in this case separate video IDs by |, (a vertical line and a comma)

See the getting started guide and Videobox documentation for more informations and examples

Property sets

Previous versions of Videobox had different settings for different display methods, but since that was pretty messy it's been replaced by property sets. Property sets aren't limited to one display method, since each property set contains complete Videobox configuration. By using {videobox@property-set-key}video ID{/videobox} you can apply that configuration to a specific set of videos.

Useful links


" PLG_SYSTEM_VIDEOBOX_PROPERTY_SETS="Property sets" PLG_SYSTEM_VIDEOBOX_PROPERTY_SETS_DESC="Property sets let you create different configurations for Videobox. To use a specific configuration, use {videobox@property-set-key}" diff --git a/src/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.sys.ini b/src/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.sys.ini index 1a5cfaa..3c93b2e 100644 --- a/src/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.sys.ini +++ b/src/plugins/videobox/language/en-GB/en-GB.plg_system_videobox.sys.ini @@ -6,4 +6,5 @@ ; Projectsite: https://hitko.eu/videobox PLG_SYSTEM_VIDEOBOX="System - Videobox" -PLG_SYSTEM_VIDEOBOX_XML_DESCRIPTION="

Videobox - Video and audio player, and gallery for Joomla

" \ No newline at end of file +PLG_SYSTEM_VIDEOBOX_XML_DESCRIPTION="

Videobox - Video and audio player, and gallery for Joomla

" +PLG_SYSTEM_VIDEOBOX_INSTALL_DESCRIPTION="

Basic usage

{videobox}video ID{/videobox}

Video ID can be either a link to the video or the ID from the link - see adapters documentation for all supported formats
Multiple videos can be inserted at a time, in this case separate video IDs by |, (a vertical line and a comma)

See the getting started guide and Videobox documentation for more informations and examples

Property sets

Previous versions of Videobox had different settings for different display methods, but since that was pretty messy it's been replaced by property sets. Property sets aren't limited to one display method, since each property set contains complete Videobox configuration. By using {videobox@property-set-key}video ID{/videobox} you can apply that configuration to a specific set of videos.

Useful links


" \ No newline at end of file diff --git a/src/plugins/videobox/scripts.php b/src/plugins/videobox/scripts.php index 47baa2e..59fa222 100644 --- a/src/plugins/videobox/scripts.php +++ b/src/plugins/videobox/scripts.php @@ -25,18 +25,19 @@ jimport('joomla.form.form'); jimport('joomla.plugin.helper'); jimport('joomla.registry.registry'); +jimport('joomla.version'); class plgsystemvideoboxInstallerScript { function install($parent) { - $this->in_up($parent); + $this->in_up($parent, 'install'); } function update($parent) { - $this->in_up($parent); + $this->in_up($parent, 'update'); } - function in_up($parent) { + function in_up($parent, $type) { $db = JFactory::getDbo(); $query = $db->getQuery(true); @@ -55,7 +56,11 @@ function in_up($parent) { $data = $form->renderFieldset('basic'); $html = new DOMDocument('1.0', 'UTF-8'); - $html->loadHTML(''.$data); + try { + $html->loadHTML(''.$data); + } catch (Exception $e) { + $html = false; + } if($html){ $xpath = new DOMXpath($html); $fields = $xpath->query("//*[starts-with(@name,'params')]"); @@ -123,6 +128,8 @@ function in_up($parent) { $result = $db->execute(); } } + + echo JText::_('PLG_SYSTEM_VIDEOBOX_INSTALL_DESCRIPTION'); } function innerHTML($element) { @@ -170,12 +177,10 @@ function splitName($name){ } $n = count($parts); for($i = 1; $i < $n; $i++){ - var_dump($parts[$i], $parts[$i-1].'X'); if($parts[$i] == $parts[$i-1].'X'){ return false; } } - var_dump($parts); return $parts; } @@ -185,6 +190,14 @@ function uninstall($parent) { function preflight($type, $parent) { + $jv = new JVersion(); + if(!$jv->isCompatible('3.6')) { + $typing = 'installing'; + if($type == 'update') $typing = 'updating'; + Jerror::raiseWarning(null, 'Please update Joomla! to version 3.6 or later before ' . $typing . ' Videobox'); + return false; + } + } function postflight($type, $parent) { diff --git a/src/scripts.php b/src/scripts.php new file mode 100644 index 0000000..562e28a --- /dev/null +++ b/src/scripts.php @@ -0,0 +1,63 @@ + + */ + +// no direct access +defined( '_JEXEC' ) or die( 'Restricted Access' ); + +jimport('joomla.form.form'); +jimport('joomla.plugin.helper'); +jimport('joomla.registry.registry'); +jimport('joomla.version'); + +class pkg_videoboxInstallerScript { + + function install($parent) { + $this->in_up($parent, 'install'); + } + + function update($parent) { + $this->in_up($parent, 'update'); + } + + function in_up($parent, $type) { + echo JText::_('PLG_SYSTEM_VIDEOBOX_INSTALL_DESCRIPTION'); + } + + function uninstall($parent) { + + } + + function preflight($type, $parent) { + + $jv = new JVersion(); + if(!$jv->isCompatible('3.6')) { + $typing = 'installing'; + if($type == 'update') $typing = 'updating'; + Jerror::raiseWarning(null, 'Please update Joomla! to version 3.6 or later before ' . $typing . ' Videobox'); + return false; + } + + } + + function postflight($type, $parent) { + + } +} \ No newline at end of file