]> git.ipfire.org Git - thirdparty/foundation/foundation-emails.git/commitdiff
Move JS to app.js and Google Analytics to header
authorEric Morris <eric@zurb.com>
Thu, 7 Nov 2013 04:27:48 +0000 (20:27 -0800)
committerEric Morris <eric@zurb.com>
Thu, 7 Nov 2013 04:27:48 +0000 (20:27 -0800)
coming-soon.php
includes/_footer.php
includes/_header.php
javascripts/app.js

index e656219f4bd24ec8bdc4badc87fcf0f8e2441278..ed49ab68ed90fecb1abce955dca151b1b637c358 100644 (file)
   <title>Ink, a Responsive HTML Email Framework from ZURB</title>
   <link rel="stylesheet" href="stylesheets/app.css">
   <script src="javascripts/vendor/custom.modernizr.js"></script>
+  <script>
+    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+    ga('create', 'UA-2195009-47', 'zurb.com');
+    ga('send', 'pageview');
+  </script>
 </head>
 
 <body class="off-canvas hide-extras"> 
index 365410f737bd9e6852d6b8ed87f7b82d0c254fc3..40e2e5ee16732b18272a88d05f8912513f6fd7af 100644 (file)
     </div>          
   </div>
 </div>
-
-  <script>
-    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-    ga('create', 'UA-2195009-47', 'zurb.com');
-    ga('send', 'pageview');
-
-  </script>
   <script src="javascripts/vendor/jquery.js"></script>
   <script src="javascripts/foundation/foundation.js"></script>
        <script src="javascripts/foundation/foundation.abide.js"></script>
        <script src="javascripts/foundation/foundation.topbar.js"></script>
   <script src="javascripts/foundation/jquery.offcanvas.js"></script>
   <script src="javascripts/app.js"></script>   
-  
-  <script>
-    $(document).foundation();
-    $('.doc-nav a').click(function(e){
-      e.preventDefault();
-      var target = $(this).attr('href');
-      var offset = $(target).offset().top;
-      $('html, body').animate({
-        scrollTop : offset
-      }, Math.sqrt(offset)*15);
-    });
-    $('.inky').addClass('loaded');
-    $('.process-4-2').addClass('load');
-    $('.process-5-2').addClass('load');
-    $('.process-2').addClass('load');
-    $('.process-3').addClass('load');
-    $('.inky-small').addClass('load');
-    $('.inky-fish').addClass('load');
-    /* $('.bubble').addClass('float'); */
-    function shuffle(array) {
-      var m = array.length, t, i;
-
-      // While there remain elements to shuffle…
-      while (m) {
-
-        // Pick a remaining element…
-        i = Math.floor(Math.random() * m--);
-
-        // And swap it with the current element.
-        t = array[m];
-        array[m] = array[i];
-        array[i] = t;
-      }
-
-      return array;
-    }
-
-    var bubbles = $('.bubble'),
-        ranges = shuffle([0, 100, 200, 300, 400, 500, 600, 700, 800, 900]);
-
-    bubbles.each(function(){
-      var offset = ranges.pop();
-        setTimeout(function() {
-          $(this)
-            .css({
-              'left': offset + Math.floor((Math.random()*100)+1),
-              'top': Math.floor((Math.random()*500)+1)
-            })
-            .addClass('float');
-        }.bind(this), Math.floor((Math.random()*10)+1)*500);
-    });
-
-    var original = '';
-
-    $('#appendQuery').on('click', function(){
-      $('#linkAppend').toggleClass('inactive', !$(this).is(':checked'));
-    });
-
-    $(document).on('click', '#previewModal .close-btn', function(e) {
-      e.preventDefault();
-      $('#previewModal').delay(100).removeClass('active');
-      $('html, body').css('max-height', 'none').css('overflow', 'scroll');
-    });
-
-    $(document).on('click', '#showPreview', function(e) {
-      e.preventDefault();
-      $('html, body').animate({
-        scrollTop : 0
-      }, 700);
-      $('#previewModal').delay(100).addClass('active');
-      $('html, body').css('max-height', $(window).height()).css('overflow', 'hidden');
-      $('iframe').height($(window).height() - 40)
-    });
-
-    $(document).on('click', '#inlinerReset', function(e) {
-      e.preventDefault();
-      $('.show-on-submit').fadeOut(700);
-      $('.hide-on-submit').fadeIn(700);
-      $('#emailSource').removeClass('result').val(original);
-    });
-
-    $('#skateForm').on('submit', function(e){
-      e.preventDefault();
-      original = $('#emailSource').val()
-      var data = {
-        source: original,
-      };
-
-      $('#emailSource').val('Loading...')
-      $('html, body').animate({
-        scrollTop : $('.top-headlines').offset().top
-      }, 700);
-      $('#emailSource').addClass('result');
-      $('.hide-on-submit').fadeOut(700);
-      
-      if ($('#linkAppend').val() && $('#appendQuery').is(':checked')) {
-        data.linkAppend = $('#linkAppend').val()
-      }  
-
-      $.post("skate-proxy.php", data, function(resp){
-        $('.show-on-submit').fadeIn(700);
-        $(document).foundation('reveal');
-        $('#emailSource').val(resp.html);
-        $('#previewModal iframe').contents().find('html').html(resp.html);
-      }, "json");
-    });
-
-  </script>
 <?php include 'includes/_offcanvas-menu.php' ?>
 
index 67a128e439e5c6811763d41be894e54cb607e9a8..e35ede886c7538bcf6952b7f57a4443554ae1e8d 100644 (file)
   <title>Ink</title>
   <link rel="stylesheet" href="stylesheets/app.css">
   <script src="javascripts/vendor/custom.modernizr.js"></script>
+  <script>
+    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+    ga('create', 'UA-2195009-47', 'zurb.com');
+    ga('send', 'pageview');
+  </script>
 </head>
 
 <body class="off-canvas hide-extras"> 
index 7fd95e6df5f2cf17b85914c4fd24ae9970a762b8..fd5381b93ee8d6ff6352d2e9038dc3583181fea6 100644 (file)
@@ -1,3 +1,108 @@
+$(document).foundation();
+$('.doc-nav a').click(function(e){
+  e.preventDefault();
+  var target = $(this).attr('href');
+  var offset = $(target).offset().top;
+  $('html, body').animate({
+    scrollTop : offset
+  }, Math.sqrt(offset)*15);
+});
+$('.inky').addClass('loaded');
+$('.process-4-2').addClass('load');
+$('.process-5-2').addClass('load');
+$('.process-2').addClass('load');
+$('.process-3').addClass('load');
+$('.inky-small').addClass('load');
+$('.inky-fish').addClass('load');
+/* $('.bubble').addClass('float'); */
+function shuffle(array) {
+  var m = array.length, t, i;
+
+  // While there remain elements to shuffle…
+  while (m) {
+
+    // Pick a remaining element…
+    i = Math.floor(Math.random() * m--);
+
+    // And swap it with the current element.
+    t = array[m];
+    array[m] = array[i];
+    array[i] = t;
+  }
+
+  return array;
+}
+
+var bubbles = $('.bubble'),
+    ranges = shuffle([0, 100, 200, 300, 400, 500, 600, 700, 800, 900]);
+
+bubbles.each(function(){
+  var offset = ranges.pop();
+    setTimeout(function() {
+      $(this)
+        .css({
+          'left': offset + Math.floor((Math.random()*100)+1),
+          'top': Math.floor((Math.random()*500)+1)
+        })
+        .addClass('float');
+    }.bind(this), Math.floor((Math.random()*10)+1)*500);
+});
+
+var original = '';
+
+$('#appendQuery').on('click', function(){
+  $('#linkAppend').toggleClass('inactive', !$(this).is(':checked'));
+});
+
+$(document).on('click', '#previewModal .close-btn', function(e) {
+  e.preventDefault();
+  $('#previewModal').delay(100).removeClass('active');
+  $('html, body').css('max-height', 'none').css('overflow', 'scroll');
+});
+
+$(document).on('click', '#showPreview', function(e) {
+  e.preventDefault();
+  $('html, body').animate({
+    scrollTop : 0
+  }, 700);
+  $('#previewModal').delay(100).addClass('active');
+  $('html, body').css('max-height', $(window).height()).css('overflow', 'hidden');
+  $('iframe').height($(window).height() - 40)
+});
+
+$(document).on('click', '#inlinerReset', function(e) {
+  e.preventDefault();
+  $('.show-on-submit').fadeOut(700);
+  $('.hide-on-submit').fadeIn(700);
+  $('#emailSource').removeClass('result').val(original);
+});
+
+$('#skateForm').on('submit', function(e){
+  e.preventDefault();
+  original = $('#emailSource').val()
+  var data = {
+    source: original,
+  };
+
+  $('#emailSource').val('Loading...')
+  $('html, body').animate({
+    scrollTop : $('.top-headlines').offset().top
+  }, 700);
+  $('#emailSource').addClass('result');
+  $('.hide-on-submit').fadeOut(700);
+  
+  if ($('#linkAppend').val() && $('#appendQuery').is(':checked')) {
+    data.linkAppend = $('#linkAppend').val()
+  }  
+
+  $.post("skate-proxy.php", data, function(resp){
+    $('.show-on-submit').fadeIn(700);
+    $(document).foundation('reveal');
+    $('#emailSource').val(resp.html);
+    $('#previewModal iframe').contents().find('html').html(resp.html);
+  }, "json");
+});
+
 $(document).ready(function(){
   $('a.reveal-table').click(function(e){
     e.preventDefault();