Browse Source

added GA counter to demo

pull/14/head
Vitaly Puzrin 10 years ago
parent
commit
32afdaf9aa
  1. 18
      demo/index.html
  2. 12
      demo/index.jade

18
demo/index.html

@ -13,6 +13,18 @@
<script src="../dist/remarkable.js"></script>
<link rel="stylesheet" href="./assets/index.css">
<script src="./assets/index.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-26895916-3', 'auto');
ga('require', 'displayfeatures');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
</script>
</head>
<body>
<div class="container">
@ -22,14 +34,14 @@
var hljs = require('highlight.js') // https://highlightjs.org/
var md = new Remarkable('full', {
html: false, // Enable html tags in source
html: false, // Enable HTML tags in source
xhtmlOut: false, // Use '/' to close single tags (&lt;br /&gt;)
breaks: false, // Convert '\n' in paragraphs into &lt;br&gt;
langPrefix: 'language-', // CSS language prefix for fenced blocks
linkify: true, // autoconvert url-like texts to links
linkify: true, // autoconvert URL-like texts to links
typographer: true, // Enable smartypants and other sweet transforms
// Highlighter function. Should return escaped html,
// Highlighter function. Should return escaped HTML,
// or '' if input not changed
highlight: function (str, lang) {
if (lang &amp;&amp; hljs.getLanguage(lang)) {

12
demo/index.jade

@ -20,6 +20,18 @@ html
link(rel='stylesheet' href='./assets/index.css')
script(src='./assets/index.js')
//- GA counter
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-26895916-3', 'auto');
ga('require', 'displayfeatures');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
body
.container
- var s = self.self.demo;

Loading…
Cancel
Save