Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Start #2082, add an A/B test for the My Shots button
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Jan 18, 2017
1 parent ce60bdd commit 57f6695
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
3 changes: 3 additions & 0 deletions addon/data/shooter-interactive-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,9 @@ function getScreenPosition() {
function activate() {
ui.Box.remove();
addHandlers();
if (self.options.styleMyShotsButton) {
ui.iframe.addClassName = `styleMyShotsButton-${self.options.styleMyShotsButton.value}`;
}
watchPromise(ui.iframe.display(installHandlersOnDocument).then(() => {
setState("crosshairs");
}));
Expand Down
3 changes: 2 additions & 1 deletion addon/lib/shooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ const ShotContext = Class({
contentScriptOptions: {
"inline-selection.css": self.data.url("inline-selection.css"),
showMyShotsReminder: ! prefs.hasUsedMyShots,
annotateForPage: this.annotateForPage
annotateForPage: this.annotateForPage,
styleMyShotsButton: getAbTests().styleMyShotsButton
}
}));
this.interactiveWorker.on("detach", () => {
Expand Down
11 changes: 10 additions & 1 deletion server/src/ab-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ let allTests = {
description: "Highlight the Page Shot button when Page Shot is installed",
gaField: "cd3",
version: 1,
exclude: [],
exclude: ["styleMyShotsButton"],
options: [
{name: "badge", probability: 0.1}
]
},
styleMyShotsButton: {
description: "Style the My Shots button in some different way",
gaField: "cd4",
version: 1,
exclude: ["highlightButtonOnInstall"],
options: [
{name: "bright", probability: 0.1}
]
}
};

Expand Down
13 changes: 11 additions & 2 deletions static/css/inline-selection.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $overlay-z-index: 9999999999;
.pageshot-highlight-button-download {
opacity: 0.9;
transition: opacity 250ms;

&:hover,
&:focus,
&:active {
Expand Down Expand Up @@ -330,7 +330,7 @@ $overlay-z-index: 9999999999;
-1px -1px 0 #fff,
1px -1px 0 #fff,
-1px 1px 0 #fff,
1px 1px 0 #fff;
1px 1px 0 #fff;
}

// FIXME: some of the styles in .pageshot-moving-element were copied from
Expand Down Expand Up @@ -378,6 +378,15 @@ $overlay-z-index: 9999999999;
width: 135px;
}

/* styleMyShotsButton test: */
.styleMyShotsButton-control .pageshot-myshots {
}

.styleMyShotsButton-bright .pageshot-myshots {
font-size: 200%;
}
/* end styleMyShotsButton test */

.pageshot-visible {
@extend .pageshot-myshots;
pointer-events: all;
Expand Down

0 comments on commit 57f6695

Please sign in to comment.