Esempio n. 1
0
 function nebula_calling_card()
 {
     $console_log = "<script>";
     if (nebula_is_desktop() && !nebula_is_browser('ie') && !nebula_is_browser('edge')) {
         $console_log .= "console.log('%c', 'padding: 28px 119px; line-height: 35px; background: url(" . get_template_directory_uri() . "/images/phg/phg-logo.png) no-repeat; background-size: auto 60px;');";
         $console_log .= "console.log('%c Created using Nebula ', 'padding: 2px 10px; background: #0098d7; color: #fff;');";
     }
     $console_log .= "</script>";
     echo $console_log;
 }
		<?php 
if (nebula_is_bot()) {
    ?>
			<p style="font-size: 42px;"><strong>You are a robot!</strong></p>
		<?php 
}
?>

		<p>You are on a <?php 
echo nebula_get_device('type');
?>
 which is a <?php 
echo nebula_get_device('formfactor');
?>
 device. That means it <strong><?php 
echo nebula_is_desktop() ? 'is' : 'is not';
?>
</strong> a desktop device, it <strong><?php 
echo nebula_is_tablet() ? 'is' : 'is not';
?>
</strong> a tablet device, and it <strong><?php 
echo nebula_is_mobile() ? 'is' : 'is not';
?>
</strong> a mobile device.</p>

		<?php 
if (nebula_get_device('model') != '') {
    ?>
			<p>The device itself is a <strong><?php 
    echo nebula_get_device('full');
    ?>
Esempio n. 3
0
function enqueue_nebula_frontend()
{
    global $upload_dir, $localize_bloginfo, $localize_postinfo, $localize_clientinfo, $localize_nebula_options;
    //Stylesheets
    wp_enqueue_style('nebula-normalize');
    wp_enqueue_style('nebula-gumby');
    wp_enqueue_style('nebula-mmenu');
    //wp_enqueue_style('nebula-animate_css');
    wp_enqueue_style('nebula-jquery_ui');
    wp_enqueue_style('nebula-font_awesome');
    wp_enqueue_style('nebula-google_font');
    wp_enqueue_style('nebula-main');
    if (!nebula_option('nebula_wireframing', 'disabled')) {
        wp_enqueue_style('nebula-wireframing');
        wp_enqueue_script('nebula-wireframing');
    }
    //Scripts
    wp_enqueue_script('jquery');
    wp_enqueue_script('nebula-jquery_ui');
    //wp_enqueue_script('swfobject');
    //wp_enqueue_script('hoverIntent');
    //wp_enqueue_script('nebula-modernizr_dev');
    wp_enqueue_script('nebula-modernizr');
    wp_enqueue_script('nebula-mmenu');
    //wp_enqueue_script('nebula-doubletaptogo');
    wp_enqueue_script('nebula-headroom');
    wp_enqueue_script('nebula-gumby');
    wp_enqueue_script('nebula-main');
    wp_localize_script('nebula-main', 'bloginfo', $localize_bloginfo);
    wp_localize_script('nebula-main', 'postinfo', $localize_postinfo);
    wp_localize_script('nebula-main', 'clientinfo', $localize_clientinfo);
    wp_localize_script('nebula-main', 'nebula_options', $localize_nebula_options);
    //Conditionals
    if (is_debug()) {
        //When ?debug query string is used
        wp_enqueue_script('nebula-performance_timing');
        //wp_enqueue_script('nebula-mmenu_debugger');
    }
    if (nebula_is_browser('ie', '9', '<=')) {
        //Old IE
        wp_enqueue_script('nebula-respond');
        wp_enqueue_script('nebula-html5shiv');
        //wp_deregister_script('jquery'); //Uncomment the next jQuery lines if WordPress bundles jQuery 2.0+ (currently bundles jQuery 1.11.2)
        //wp_enqueue_script('nebula-jquery_old'); //Uncomment the next jQuery lines if WordPress bundles jQuery 2.0+ (currently bundles jQuery 1.11.2)
    }
    if (!empty($GLOBALS['ga']) && nebula_option('nebula_cd_adblocker')) {
        wp_enqueue_script('nebula-adblockcheck');
        //Detect if user is blocking ads. If the custom dimension is active- removing this line will cause false positives.
    }
    if (is_page_template('tpl-search.php') || is_page(9999)) {
        //Form pages (that use selects) or Advanced Search Template. The Chosen library is also dynamically loaded in main.js.
        wp_enqueue_style('nebula-chosen');
        wp_enqueue_script('nebula-chosen');
    }
    if (is_page(9999)) {
        //Datatables pages. The Datatables library is also dynamically loaded in main.js
        wp_enqueue_style('nebula-datatables');
        wp_enqueue_script('nebula-datatables');
    }
    if (is_page(9999)) {
        //Twitter pages (conditional may need to change depending on type of page it's used on)
        wp_enqueue_script('nebula-twitter');
        //wp_enqueue_script('nebula-moment'); //Uncomment if using moment.js instead of Date.parse() for times.
    }
    if (nebula_is_desktop()) {
        //Desktop traffic only
        //wp_enqueue_script('nebula-skrollr');
    }
}
?>
<br />
			Hostname: <?php 
echo gethostname();
?>
<br />
			HTTP Host: <?php 
echo $_SERVER["HTTP_HOST"];
?>
<br />
		</p>

		<h3>Device</h3>
		<p>
			<?php 
if (!nebula_is_desktop()) {
    ?>
				<span><?php 
    echo ucwords(nebula_get_device('formfactor'));
    ?>
: <?php 
    echo ucwords(nebula_get_device('type'));
    ?>
</span><br />
				<span><?php 
    echo nebula_get_device('full');
    ?>
</span>
				<span class="mobilebatt"><br />Battery: </span><span class="thebattery">(Info unavailable)</span>
				<br /><span class="devicevibration"></span>
			<?php