Skip to content

Commit

Permalink
Copy on promo experiment, remove query arg requirement, fix events
Browse files Browse the repository at this point in the history
  • Loading branch information
agjohnson committed Feb 16, 2015
1 parent 6853a02 commit 07c7a90
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 60 deletions.
16 changes: 6 additions & 10 deletions readthedocs/core/static-src/core/js/readthedocs-doc-embed.js
@@ -1,6 +1,5 @@
var sponsorship = require('./sponsorship'),
doc = require('./doc'),
util = require('./util');
doc = require('./doc');

$(document).ready(function () {

Expand Down Expand Up @@ -171,17 +170,14 @@ $(document).ready(function () {
// Promos
// TODO don't hardcode this promo and remove the util function to hide the
// ad
var show_promo = util.get_param('promo'),
promo = null;
if (build.is_rtd_theme() && show_promo) {
var promo = null;
if (build.is_rtd_theme()) {
var promo = sponsorship.Promo.from_experiment({
experiment_id: '1PV0r2DbQrespD6x6Paxzw',
experiment_id: 'Q8yssnbeR3O8qRwS2-9cSA',
variants: [
'Enjoy reading the docs? Join other developers and tech writers at Write the Docs!',
'<3 documentation? Join fellow developers and tech writers at Write the Docs!',
'Enjoy reading the docs? Join fellow developers and tech writers at Write the Docs!',
'Love docs as much as we do? Come join the community at the Write The Docs conference',
'Doing amazing things with docs? Submit a talk to Write the Docs, a conference about docs.',
'Tickets for Write the Docs, a community conference about docs, are now on sale!',
'Tickets are now on sale for Write the Docs, a community conference about documentation!',
'Come join us at Write the Docs, a community conference about documentation.'
],
link: 'http://writethedocs.org/conf/na/2015/',
Expand Down
3 changes: 1 addition & 2 deletions readthedocs/core/static-src/core/js/sponsorship.js
Expand Up @@ -35,8 +35,7 @@ Promo.prototype.create = function () {
'_trackEvent',
'Promo',
'Click',
'wtdna2015',
self.variant
'wtdna2015-' + self.variant
]);
}
})
Expand Down
16 changes: 0 additions & 16 deletions readthedocs/core/static-src/core/js/util.js

This file was deleted.

43 changes: 11 additions & 32 deletions readthedocs/core/static/core/js/readthedocs-doc-embed.js
Expand Up @@ -31,8 +31,7 @@ Build.prototype.is_rtd_theme = function () {

},{}],3:[function(require,module,exports){
var sponsorship = require('./sponsorship'),
doc = require('./doc'),
util = require('./util');
doc = require('./doc');

$(document).ready(function () {

Expand Down Expand Up @@ -203,16 +202,15 @@ $(document).ready(function () {
// Promos
// TODO don't hardcode this promo and remove the util function to hide the
// ad
var show_promo = util.get_param('promo'),
promo = null;
if (build.is_rtd_theme() && show_promo) {
var promo = null;
if (build.is_rtd_theme()) {
var promo = sponsorship.Promo.from_experiment({
experiment_id: '1PV0r2DbQrespD6x6Paxzw',
experiment_id: 'Q8yssnbeR3O8qRwS2-9cSA',
variants: [
'Enjoy reading the docs? Join developers and tech writers at Write the Docs NA 2015!',
'<3 documentation? Join fellow developers and tech writers at Write the Docs NA 2015!',
'Tickets for Write the Docs NA 2015 are now on sale!',
'Write the Docs NA 2015 CFP is open and tickets are on sale'
'Enjoy reading the docs? Join fellow developers and tech writers at Write the Docs!',
'Love docs as much as we do? Come join the community at the Write The Docs conference',
'Tickets are now on sale for Write the Docs, a community conference about documentation!',
'Come join us at Write the Docs, a community conference about documentation.'
],
link: 'http://writethedocs.org/conf/na/2015/',
callback: function (p) {
Expand Down Expand Up @@ -504,7 +502,7 @@ $(document).ready(function () {
}
});

},{"./doc":2,"./sponsorship":4,"./util":5}],4:[function(require,module,exports){
},{"./doc":2,"./sponsorship":4}],4:[function(require,module,exports){
/* Read the Docs - Documentation promotions */

var $ = window.$,
Expand Down Expand Up @@ -542,8 +540,7 @@ Promo.prototype.create = function () {
'_trackEvent',
'Promo',
'Click',
'wtdna2015',
self.variant
'wtdna2015-' + self.variant
]);
}
})
Expand Down Expand Up @@ -632,22 +629,4 @@ Promo.from_experiment = function (experiment_id, variants, link, callback) {
return promo;
};

},{"./../../../../../bower_components/waypoints/lib/noframework.waypoints.min.js":1}],5:[function(require,module,exports){
/* UGGGGH at javascript */

exports.get_param = function (name) {
var url = window.location.search.substring(1),
vars = url.split('&');

for (n in vars) {
var param = vars[n].split('='),
param_name = param[0],
param_val = param[1];
if (name == param_name) {
return param_val;
}
}
return false
}

},{}]},{},[3])
},{"./../../../../../bower_components/waypoints/lib/noframework.waypoints.min.js":1}]},{},[3])

0 comments on commit 07c7a90

Please sign in to comment.