Skip to content

Commit

Permalink
Merge pull request #1 from NicolasGraph/dev
Browse files Browse the repository at this point in the history
v1.0.0-BETA3
  • Loading branch information
Nicolas Morand authored Aug 15, 2018
2 parents fd76a7a + 5f4a5da commit 5fac62a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 25 deletions.
18 changes: 11 additions & 7 deletions README.textile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
h1. oui_giphy

* "Introduction":#introduction
* "Plugin management":#plugin-management
* "Tags and parameters":#tags-and-parameters
* "Examples":#examples
* "Credits":#credits

h2. Introduction

"oui_giphy":https://github.com/NicolasGraph/oui_giphy is a "oui_player":https://github.com/NicolasGraph/oui_player v2+ extension to easily embed "Giphy":https://giphy.go.com/ provided videos in "Textpattern":https://textpattern.com/ powered websites.
Expand Down Expand Up @@ -70,8 +76,7 @@ h4. Recognised values for the @play@ attribute

* *ID*;
* http(s)://giphy.com/embed/[*ID*]
* http(s)://giphy.com/gifs/…-[*ID*]
* *Name of a field* containing any of the above value.
* http(s)://giphy.com/gifs/…-[*ID*].

When using the @oui_player@ tag (vs @oui_giphy@), the right provider needs to be set if the @play@ value or its field related one is an ID. It is optional, but can fasten the rendering, if the value is an URL.

Expand All @@ -97,10 +102,9 @@ The ratio used to calculate the missing value for the width or the height. =:
- @responsive@ :=
@true@ or @false@; initially set to @false@.
Adapts the final player size from the provided width and/or height and/or ratio values to fit the container width.
Wraps the player and adds some styles.
The related preference is a generic oui_player preference; it is applied to all providers or none. =:
Wraps the player and adds some styles. =:

h5. Parameters
h5. Parameters (a→z)

There is no player parameter available for this provider.

Expand Down Expand Up @@ -149,11 +153,11 @@ h3. License

This plugin is distributed under "GPL v2.0":https://www.gnu.org/licenses/gpl-2.0.txt.

oui_giphy version 1.0.0-BETA2, Copyright (C) 2018 Nicolas Morand
oui_giphy version 1.0.0-BETA3, Copyright (C) 2018 Nicolas Morand
This Textpattern plugin comes with ABSOLUTELY "NO WARRANTY":https://www.gnu.org/licenses/gpl-2.0.html#section11.
This is free software, and you are welcome to redistribute it "under certain conditions":https://www.gnu.org/licenses/gpl-2.0.html#SEC3.

h3. Changelog

* *oui_giphy v1.0.0-BETA2* (2018-07-05)
* *oui_giphy v1.0.0-BETA3* (2018-08-15)
* *oui_player v1.3.0* (2017-05-24)
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name" : "oui_giphy",
"description" : "Embed Giphy players through oui_player v2+",
"version" : "1.0.0-BETA2",
"type" : 1,
"version" : "1.0.0-BETA3",
"type" : 5,
"author" : "Nicolas Morand",
"author_uri" : "http://github.com/NicolasGraph",
"order" : 4,
Expand Down
35 changes: 19 additions & 16 deletions oui_giphy.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,26 @@
* @package Oui\Player
*/

namespace Oui {
namespace Oui;

if (class_exists('Oui\Provider')) {
if (class_exists('Oui\Provider')) {

class Giphy extends Provider
{
protected static $patterns = array(
'scheme' => '#^(http|https)://giphy\.com/(embed/|gifs/[\S]+[-])([0-9a-zA-Z]+)$#i',
'id' => '3',
);
protected static $src = '//giphy.com/';
protected static $glue = array('embed/', '', '');
protected static $dims = array(
'width' => '480',
'height' => '480',
'ratio' => '',
);
}
class Giphy extends Provider
{
protected static $srcBase = '//giphy.com/';
protected static $srcGlue = array('embed/', '', '');
protected static $iniDims = array(
'width' => '480',
'height' => '480',
'ratio' => '',
'responsive' => array(
'default' => 'false',
'valid' => array('true', 'false'),
),
);
protected static $mediaPatterns = array(
'scheme' => '#^https?://giphy\.com/(embed/|gifs/[\S]+[-])([0-9a-zA-Z]+)$#i',
'id' => '2',
);
}
}
1 change: 1 addition & 0 deletions textpacks/en-gb.textpack
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ oui_player_giphy_prefs => Display the Giphy player preferences
oui_player_giphy_width => Player width
oui_player_giphy_height => Player height
oui_player_giphy_ratio => Player ratio by default
oui_player_giphy_responsive => Render responsive players from the provided dimensions
1 change: 1 addition & 0 deletions textpacks/fr-fr.textpack
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ oui_player_giphy_prefs => Afficher les préférences du lecteur giphy
oui_player_giphy_width => Largeur du lecteur
oui_player_giphy_height => Hauteur du lecteur
oui_player_giphy_ratio => Ratio utilisé en l'absence de l'une des dimensions
oui_player_giphy_responsive => Rendre les lecteurs adaptatifs à partir des dimensions fournies

0 comments on commit 5fac62a

Please sign in to comment.