From e456de4349851f997c879435e769544669813758 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Oct 2015 18:11:36 +0200 Subject: [PATCH 1/2] v1.0.2 - added fallback for scroll, in case the scrollTo plugin is not present - added support for the new Google Analytics API (analytics.js) --- ajaxify-html5.js | 16 ++++++++++++---- ajaxify.php | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 ajaxify.php diff --git a/ajaxify-html5.js b/ajaxify-html5.js index c232db7..1401919 100755 --- a/ajaxify-html5.js +++ b/ajaxify-html5.js @@ -1,5 +1,5 @@ // Ajaxify -// v1.0.1 - 30 September, 2012 +// v1.0.2, October 2015 // https://github.com/browserstate/ajaxify (function(window,undefined){ @@ -167,12 +167,20 @@ }); // Complete the change - if ( $body.ScrollTo||false ) { $body.ScrollTo(scrollOptions); } /* http://balupton.com/projects/jquery-scrollto */ + if ( $body.ScrollTo ) { + $body.ScrollTo(scrollOptions); + } /* http://balupton.com/projects/jquery-scrollto */ + else{ + // fallback if scrollTo plugin is not loaded: + $body.scrollTop( 0 ); + } $body.removeClass('loading'); $window.trigger(completedEventName); // Inform Google Analytics of the change - if ( typeof window._gaq !== 'undefined' ) { + if ( typeof window.ga !== 'undefined' ){ // the new analytics API + window.ga( 'send', 'pageview', relativeUrl ); + }else if ( typeof window._gaq !== 'undefined' ) { // the old API window._gaq.push(['_trackPageview', relativeUrl]); } @@ -192,4 +200,4 @@ }); // end onDomLoad -})(window); // end closure +})(window); // end closure \ No newline at end of file diff --git a/ajaxify.php b/ajaxify.php new file mode 100644 index 0000000..9e7289f --- /dev/null +++ b/ajaxify.php @@ -0,0 +1,22 @@ + Date: Wed, 28 Oct 2015 18:17:23 +0200 Subject: [PATCH 2/2] Removed WP plugin file --- ajaxify.php | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 ajaxify.php diff --git a/ajaxify.php b/ajaxify.php deleted file mode 100644 index 9e7289f..0000000 --- a/ajaxify.php +++ /dev/null @@ -1,22 +0,0 @@ -