diff --git a/functions.php b/functions.php index 6330262..a4cb382 100644 --- a/functions.php +++ b/functions.php @@ -6,6 +6,11 @@ function theme_enqueue_styles() { wp_enqueue_script( 'sis-js', get_stylesheet_directory_uri() . '/sistertalk.js', array( 'cs' )); } +function enqueue_mobile_js(){ + wp_enqueue_script( 'sis-mobile-js', get_stylesheet_directory_uri() . '/sistertalk-mobile.js'); +} +add_action( 'init', 'enqueue_mobile_js', 0 ); + function show_people(){ if ( !is_plugin_active('uc-people/uc-people.php') ) { activate_plugin('uc-people/uc-people.php'); @@ -54,6 +59,7 @@ function addToHead() { '; -} +} + ?> \ No newline at end of file diff --git a/img/loading.jpg b/img/loading.jpg new file mode 100644 index 0000000..854e2c8 Binary files /dev/null and b/img/loading.jpg differ diff --git a/sistertalk-mobile.js b/sistertalk-mobile.js new file mode 100644 index 0000000..96a5ecf --- /dev/null +++ b/sistertalk-mobile.js @@ -0,0 +1,21 @@ +(function(document,navigator,standalone) { + // prevents links from apps from oppening in mobile safari + // this javascript must be the first script in your + if ((standalone in navigator) && navigator[standalone]) { + var curnode, location=document.location, stop=/^(a|html)$/i; + document.addEventListener('click', function(e) { + curnode=e.target; + while (!(stop).test(curnode.nodeName)) { + curnode=curnode.parentNode; + } + // Conditions to do this only on links to your own app + // if you want all links, use if('href' in curnode) instead. + if('href' in curnode && ( curnode.href.indexOf('http') || ~curnode.href.indexOf(location.host) ) ) { + e.preventDefault(); + location.href = curnode.href; + } + },false); + } + })(document,window.navigator,'standalone'); + + \ No newline at end of file diff --git a/sistertalk.js b/sistertalk.js index 2250725..0574726 100644 --- a/sistertalk.js +++ b/sistertalk.js @@ -30,7 +30,8 @@ jQuery(document).ready(function($) { var id = $(this).attr('id'); writeToLocal(id, this.value); }); - $('.gform_button').after(''); + $('.gform_button').after(''); + setTimeout(function(){$('.save-msg').fadeOut(200, function() { $(this).remove(); });}, 5000); } function loadAnswersFromLocal(){ $('.gform_wrapper input').each(function(index, element) { @@ -63,9 +64,8 @@ jQuery(document).ready(function($) { - - + // on submit... // for each input... @@ -80,8 +80,6 @@ jQuery(document).ready(function($) { - - /* * * debugging only