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
updateTimestamps = _.debounce (model) -> | |
attrs = | |
updatedAt: Firebase.ServerValue.TIMESTAMP | |
updatedBy: "SOME_USER" | |
model.set attrs, {silent: true} | |
model._updateModel? model | |
, 400 | |
# It's a good idea to keep this in a mixin: |
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
$.event.special.textchange = | |
setup: -> | |
$el = $ @ | |
timer = null | |
$el.data 'lastValue', getElValue(@) | |
handler = (event) => | |
current = getElValue(@) | |
lastValue = $el.data 'lastValue' |
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
JSONPEnabled = true | |
ajax = (options) -> | |
if typeof options.url is "undefined" | |
return | |
options = $.extend({}, options, defaultAjaxOptions) | |
# Default to XHR. | |
type = "XHR" |
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
requirejs.config({ | |
paths: { | |
appcues: '//d2dubfq97s02eu.cloudfront.net/appcues.min', | |
jquery: '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min' | |
}, | |
shims: { | |
appcues: { | |
deps: ['jquery'] // You can explicitly define jQuery as a dependency. | |
} | |
} |
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
<!-- Create an empty, invisible element to pass to ouibounce. --> | |
<div id='ouibounce-modal' style='visibility: hidden'></div> | |
<script> | |
ouiBounce(document.getElementById('ouibounce-modal'), { | |
callback: function() { | |
// Force an Appcues flow to be shown. | |
Appcues.show('YOUR_FLOW_ID'); | |
} | |
}); |
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
// Copyright 2012 Google Inc. All Rights Reserved. | |
/* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
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
var handleResponse = function(resp) { | |
// This is the response that target.html ferries back to us. | |
} | |
// Pretty simple. Basically, in this script we create an iframe of target.html. | |
var iframe = document.createElement('iframe'); | |
iframe.src = 'http://somedomain.com/target.html'; | |
iframe.onload = function() { | |
iframe.addEventListener("message", handleResponse); | |
} |
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
// Create a special global variable that the Appcues script will look for upon load. | |
// Admittedly, this should probably be called "AppcuesConfig". | |
window.AppcuesIdentity = window.AppcuesIdentity || { | |
appcuesId: 'foo', | |
userId: 1234, | |
userEmail: 'peep@example.com' | |
}; | |
// Asynchronously load Appcues embed script. | |
asyncLoadAppcues().then(function() { |
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
var _vis_opt_queue = window._vis_opt_queue || [], _vis_counter = 0; | |
_vis_opt_queue.push(function() { | |
try { | |
if(!_vis_counter) { | |
var _vis_data = {},_vis_combination,_vis_id,_vis_l=0; | |
for(;_vis_l<_vwo_exp_ids.length;_vis_l++) { | |
_vis_id = _vwo_exp_ids[_vis_l]; | |
if(_vwo_exp[_vis_id].ready) { | |
_vis_combination = _vis_opt_readCookie('_vis_opt_exp_'+_vis_id+'_combi'); | |
if(typeof(_vwo_exp[_vis_id].combination_chosen) != "undefined") |
OlderNewer