This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Usage: | |
* add model.name property that will be used as a namespace in the json request | |
* put this code before your Backbone app code | |
* use toJSON() as usual (so there is no namespacing in your templates) | |
* your model's data will be sent under model.name key when calling save() | |
### | |
# save reference to Backbone.sync | |
Backbone.oldSync = Backbone.sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendTrackEvent (eventData) { | |
window.ga('send', Object.assign({hitType: 'event'}, eventData); | |
} | |
function trackVideoEvents (videoElement) { | |
var $videoElement = $(videoElement); | |
var markers = [.1, .2, .3, .4, .5, .6, .7, .8, .9, 1]; | |
var gaLoggingName = this.dataset.gaLoggingName; | |
var isTrackingProgress = false | |