Skip to content

Instantly share code, notes, and snippets.

@flashvnn
Created February 24, 2014 10:38
Show Gist options
  • Save flashvnn/9185367 to your computer and use it in GitHub Desktop.
Save flashvnn/9185367 to your computer and use it in GitHub Desktop.
cycle2_youtube
$preset = new stdClass();
$preset->disabled = FALSE; /* Edit this to true to make a default preset disabled initially */
$preset->api_version = 1;
$preset->name = 'cycle2_youtube';
$preset->title = 'Cycle2 Youtube';
$preset->html = '<div class="cycle-slideshow"
data-cycle-fx=scrollHorz
data-cycle-timeout=0
data-cycle-prev=#prev
data-cycle-next=#next
data-cycle-auto-height="640:360"
data-cycle-slides=">a"
data-cycle-youtube=true
data-cycle-youtube-autostart=true
>
{{#data}}<a href="{{{link}}}">{{title}}</a>{{/data}}
</div>
<center>
<div class="center clearfix">
<a href=# id=prev>&lt;&lt;Prev </a>
<a href=# id=next> Next&gt;&gt;</a>
</div>
</center>';
$preset->css = '.cycle-slideshow { max-width: 640px; margin: auto }
.cycle-slideshow > div { width: 100%; height: 100% }
.cycle-slideshow > img { width: 100%; height: 100% }
iframe,object,embed { width: 100%; height: 100% }';
$preset->ext_css = '';
$preset->ext_js = 'http://malsup.github.io/jquery.cycle2.js
http://malsup.github.io/jquery.cycle2.video.js';
$preset->html_compiled = '<?php return function ($in) {
$cx = Array(
\'flags\' => Array(
\'jstrue\' => false,
\'jsobj\' => false,
),
\'scopes\' => Array($in),
\'path\' => Array(),
);
ob_start();echo \'<div class="cycle-slideshow"
data-cycle-fx=scrollHorz
data-cycle-timeout=0
data-cycle-prev=#prev
data-cycle-next=#next
data-cycle-auto-height="640:360"
data-cycle-slides=">a"
data-cycle-youtube=true
data-cycle-youtube-autostart=true
>
\',LCRun::sec(\'data\', $cx, $in, false, function($cx, $in) {echo \'<a href="\',$in[\'link\'],\'">\',htmlentities($in[\'title\'], ENT_QUOTES),\'</a>\';}),\'
</div>
<center>
<div class="center clearfix">
<a href=# id=prev>&lt;&lt;Prev </a>
<a href=# id=next> Next&gt;&gt;</a>
</div>
</center>\';return ob_get_clean();
}
?>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment