diff --git a/functions-full-screen-morphing-search.php b/functions-full-screen-morphing-search.php
index 088d18c..9bc419c 100644
--- a/functions-full-screen-morphing-search.php
+++ b/functions-full-screen-morphing-search.php
@@ -13,6 +13,34 @@ function full_screen_morphing_search_thumb() {
}
add_action( 'init', 'full_screen_morphing_search_thumb' );
+/**
+ * This outputs the javascript needed to automate the live settings preview.
+ * Also keep in mind that this function isn't necessary unless your settings
+ * are using 'transport'=>'postMessage' instead of the default 'transport'
+ * => 'refresh'.
+ *
+ * Used by hook: 'customize_preview_init'
+ */
+function fsmsp_customize_preview_js() {
+ $handle = 'fsmsp-customize-preview';
+ $src = plugins_url( 'assets/js/customize-preview.js', __FILE__ );
+ $deps = array( 'customize-preview' );
+ $ver = '0.1';
+ $in_footer = true;
+ wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
+ wp_localize_script(
+ 'fsmsp-customize-preview',
+ 'fsmsp_cp',
+ array(
+ 'fsmsp_article_icon' => '
',
+ 'fsmsp_category_icon' => '
',
+ 'fsmsp_tag_icon' => '
',
+ 'fsmsp_placeholder_text' => esc_attr( 'Search …' ),
+ )
+ );
+}
+add_action( 'customize_preview_init', 'fsmsp_customize_preview_js' );
+
/**
* Require Kirki.
*/