Created
June 20, 2013 21:04
-
-
Save alatzl/5826631 to your computer and use it in GitHub Desktop.
Adds livereload js file based on theme setting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adds the livereload javascript so we don't need the browser extension. | |
*/ | |
if (theme_get_setting('dtt_enable_livereload')==true) { | |
global $base_url; | |
$output = $base_url . '/'; | |
$output .= drupal_get_path('theme', 'drupal_theme_template') . '/assets/javascripts/vendor/livereload.js?'; | |
// $output .= 'host=' . parse_url($base_url, PHP_URL_HOST); | |
$output .= 'host=' . 'localhost'; | |
$output .= '&port=' . 35777; // Different port than the default livereload. | |
$output .= '&snipver=' . 1; | |
$output .= '&mindelay' . 1000; | |
$output .= '&maxdelay' . 60000; | |
drupal_add_js($output, 'external'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment