Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updates ignores; declines to load analytics outside of production.

  • Loading branch information...
commit 59117b3811d05d7f024e4a7a825b4a18091cb721 1 parent ba4b377
@dsc authored
Showing with 62 additions and 25 deletions.
  1. +2 −1  .gitignore
  2. +21 −24 static/index.html
  3. +39 −0 static/js/models/sectionscrape.js
View
3  .gitignore
@@ -1,4 +1,5 @@
node_modules
*~
.DS_Store
-\#*\#
+\#*\#
+static-build
View
45 static/index.html
@@ -142,7 +142,7 @@
<script type="text/javascript">
-
+if ( /dochub.io|herokuapp.com/.test(document.domain) ){
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1657701-3']);
_gaq.push(['_trackPageview']);
@@ -152,29 +152,26 @@
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
-
-</script>
-
-
-<script type="text/javascript">
- var _usrp = {
- type: "button",
- company: "instacss",
- host: "instacss.userrules.com",
- mode: "advanced",
- sso: {},
- getVisitorId: function() {return "";},
- getAdditionalParams: function() {return "";},
- placement: "right",
- color: ["#32312E", "#62615E"]
- };
-
- (function(D) {
- var _usr = D.createElement("script"), s = D.getElementsByTagName("script")[0];
- _usr.type = "text/javascript"; _usr.async = true;
- _usr.src = ("https:" == D.location.protocol ? "https" : "http" ) + "://dtkm4pd19nw6z.cloudfront.net/js/userrules/9a41a826e957127b4e5bfc7d140e45c4/feedback.canary.js";
- s.parentNode.insertBefore(_usr, s);
- })(document);
+
+ var _usrp = {
+ type: "button",
+ company: "instacss",
+ host: "instacss.userrules.com",
+ mode: "advanced",
+ sso: {},
+ getVisitorId: function() {return "";},
+ getAdditionalParams: function() {return "";},
+ placement: "right",
+ color: ["#32312E", "#62615E"]
+ };
+
+ (function(D) {
+ var _usr = D.createElement("script"), s = D.getElementsByTagName("script")[0];
+ _usr.type = "text/javascript"; _usr.async = true;
+ _usr.src = ("https:" == D.location.protocol ? "https" : "http" ) + "://dtkm4pd19nw6z.cloudfront.net/js/userrules/9a41a826e957127b4e5bfc7d140e45c4/feedback.canary.js";
+ s.parentNode.insertBefore(_usr, s);
+ })(document);
+}
</script>
</body>
View
39 static/js/models/sectionscrape.js
@@ -0,0 +1,39 @@
+define([
+ 'jQuery',
+ 'Underscore',
+ 'Backbone'
+], function($, _, Backbone) {
+
+ var SectionScrape = Backbone.Model.extend({
+ idAttribute: '_id',
+ defaults: {
+ 'title' : '',
+ 'fullTitle' : '',
+ 'htmlEscapedTitle' : '', // Set in initialize
+ 'lowerCaseTitle' : '', // Set in initialize
+ 'sectionNames' : [],
+ 'sectionHTMLs' : [],
+
+ // display properties
+ 'tocVisible' : false,
+ 'mainVisible' : false,
+ },
+
+ initialize: function() {
+ var htmlEscapedTitle = $('<div/>').html(this.get('title')).text();
+ this.set({
+ htmlEscapedTitle: htmlEscapedTitle,
+ lowerCaseTitle: htmlEscapedTitle.toLowerCase()
+ }, {
+ silent: true
+ });
+ },
+
+ url: function() {
+ return this.urlRoot + '/' + this.get('name');
+ },
+
+ });
+
+ return SectionScrape;
+});
Please sign in to comment.
Something went wrong with that request. Please try again.