.
* For any other query please contact us at contact[at]eleopard[dot]in
*/
if (!class_exists('EDS_Mobile_Detect')):
include_once 'assets/helper/Mobile_Detect.php';
endif;
include_once 'eds_tinymce.php';
function detectDevice()
{
static $deviceType = null;
if(!$deviceType)
{
$detect = new EDS_Mobile_Detect();
$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
}
return $deviceType;
}
function set_edsanimate_options(){
add_option('scroll_offset'
,'75'
,'Percentage height of the element '.
'after which animation should get applied' );
add_option('enable_on_phone'
,'0'
,'Animation should work on smartphones or not.');
add_option('enable_on_tab'
,'1'
,'Animation should work on tablets or not.');
}
function unset_edsanimate_options(){
delete_option('scroll_offset');
delete_option('enable_on_phone');
delete_option('enable_on_tab');
}
function admin_edsanimate_options(){
?>
Animate It! Options
'',
'delay' => '',
'duration' => '',
'infinite_animation' =>'',
'on_scroll' => ''
), $attributes ) );
$classString = "animated";
if($animation == '')
{
return $content;
}
$classString .= " " . $animation;
if(strcasecmp($infinite_animation, 'yes')==0)
$classString .= " infinite";
if($delay!= '' && is_int((int)$delay) && $delay>=0 && $delay <=12)
$classString .= " delay" . $delay;
if($duration!= '' && is_int((int)$duration) && $duration>=0 && $duration <=12)
$classString .= " duration" . $duration;
if(strcasecmp($on_scroll, 'yes')==0)
$classString .= " eds-on-scroll";
return ''.$content.'
';
else:
return $content;
endif;
}
//Admin Menu Options Filters
add_filter('widget_text', 'do_shortcode');
register_activation_hook(__FILE__, 'set_edsanimate_options');
register_deactivation_hook(__FILE__, 'unset_edsanimate_options');
add_action('admin_menu', 'modify_menu');
add_shortcode('edsanimate', 'edsanimate_handler');
add_action('wp_enqueue_scripts', 'add_eds_script_and_css');