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

Commit

Permalink
Merge pull request #2436 from mozilla-services/pageshot-classname-rem…
Browse files Browse the repository at this point in the history
…oval

Pageshot classname removal
  • Loading branch information
jaredhirsch committed Mar 21, 2017
2 parents e220088 + 017e9d7 commit 81212c5
Show file tree
Hide file tree
Showing 99 changed files with 320 additions and 1,211 deletions.
14 changes: 7 additions & 7 deletions CHANGELOG.md
Expand Up @@ -6,7 +6,7 @@
* Create A/B test for auto-opening the share panel. Fixes [#2079](https://github.com/mozilla-services/pageshot/issues/2079) [0187d31](https://github.com/mozilla-services/pageshot/commit/0187d31)
* create FORCE_AB_TESTS to force-turn-on an A/B test
in development. Fixes [#2108](https://github.com/mozilla-services/pageshot/issues/2108) [32df868](https://github.com/mozilla-services/pageshot/commit/32df868)
* Start [#2081](https://github.com/mozilla-services/pageshot/issues/2081), implement an A/B test of badging the Page Shot button until it is first clicked [c4c916b](https://github.com/mozilla-services/pageshot/commit/c4c916b), [319c312](https://github.com/mozilla-services/pageshot/commit/319c312)
* Start [#2081](https://github.com/mozilla-services/pageshot/issues/2081), implement an A/B test of badging the toolbar button until it is first clicked [c4c916b](https://github.com/mozilla-services/pageshot/commit/c4c916b), [319c312](https://github.com/mozilla-services/pageshot/commit/319c312)
* Design and implement an A/B testing system. People are put into tests by the server at login time Tests may stick to the shots created when the test is in place, then viewers will be associated with that test. Tests each map to a GA field (cdX for some value of X). Fixes [#2077](https://github.com/mozilla-services/pageshot/issues/2077) [86c8663](https://github.com/mozilla-services/pageshot/commit/86c8663)
* Add new database version (13) to save ab_tests in devices
table [0a0a095](https://github.com/mozilla-services/pageshot/commit/0a0a095)
Expand Down Expand Up @@ -68,7 +68,7 @@
* Add pixel dimensions when starting and dragging
the selection. Fixes [#1848](https://github.com/mozilla-services/pageshot/issues/1848) [4915115](https://github.com/mozilla-services/pageshot/commit/4915115)
* Change to `cursor: move` on the selection box. Fixes [#1768](https://github.com/mozilla-services/pageshot/issues/1768) [c5aa6ae](https://github.com/mozilla-services/pageshot/commit/c5aa6ae)
* Add *Create Page Shot* item in the context menu. Fixes [#1922](https://github.com/mozilla-services/pageshot/issues/1922) [c220524](https://github.com/mozilla-services/pageshot/commit/c220524)
* Add *Create ...* item in the context menu. Fixes [#1922](https://github.com/mozilla-services/pageshot/issues/1922) [c220524](https://github.com/mozilla-services/pageshot/commit/c220524)
* Add paste instructions to notification popups. Fixes [#1776](https://github.com/mozilla-services/pageshot/issues/1776) [5659166](https://github.com/mozilla-services/pageshot/commit/5659166)
* Render the selection interface in an iframe, so that it doesn't conflict or get affected by any styles in the document itself. Multiple commits:
* Iframe sizing, [23dc2b4](https://github.com/mozilla-services/pageshot/commit/23dc2b4)
Expand Down Expand Up @@ -163,7 +163,7 @@

* change email share graphic. Fixes [#1650](https://github.com/mozilla-services/pageshot/issues/1650) [34f1ca8](https://github.com/mozilla-services/pageshot/commit/34f1ca8)
* redirect /favicon.ico to
/static/img/pageshot-icon-32.png. Fixes [#1840](https://github.com/mozilla-services/pageshot/issues/1840) [34056c0](https://github.com/mozilla-services/pageshot/commit/34056c0)
/static/img/icon-32.png. Fixes [#1840](https://github.com/mozilla-services/pageshot/issues/1840) [34056c0](https://github.com/mozilla-services/pageshot/commit/34056c0)
* (v2.4) restore the share notification message. Fixes [#1918](https://github.com/mozilla-services/pageshot/issues/1918) [fdda2ec](https://github.com/mozilla-services/pageshot/commit/fdda2ec)
* (v2.4) revert to 'page' when the title isn't found. Fixes [#1836](https://github.com/mozilla-services/pageshot/issues/1836) [295e5b6](https://github.com/mozilla-services/pageshot/commit/295e5b6)
* (v2.4) add specific images for no search results and no
Expand Down Expand Up @@ -227,8 +227,8 @@ A version released to improve some operational issues.
* You can drag the selection
* You can invert the selection when resizing
* You can drag out a new selection over the old selection
* In some error conditions Page Shot would become unresponsive on a tab.
* Page Shot authentication could be lost (for instance with a cookie destroying add-on). We now attempt to re-login if we detect the cookies are gone.
* In some error conditions the tool would become unresponsive on a tab.
* Server authentication could be lost (for instance with a cookie destroying add-on). We now attempt to re-login if we detect the cookies are gone.

### Detailed product/UI changes

Expand Down Expand Up @@ -266,7 +266,7 @@ A version released to improve some operational issues.
* dragging in the background when there's already a
selection will now create a new selection. Fixes [#1138](https://github.com/mozilla-services/pageshot/issues/1138) [45de849](https://github.com/mozilla-services/pageshot/commit/45de849)
* allow moving the selection around. Fixes [#1628](https://github.com/mozilla-services/pageshot/issues/1628) [5faddf5](https://github.com/mozilla-services/pageshot/commit/5faddf5)
* Cleanup Shooter and the worker when the worker gets detached for some unknown reason; may avoid some problems where Page Shot hangs after an error [7793134](https://github.com/mozilla-services/pageshot/commit/7793134)
* Cleanup Shooter and the worker when the worker gets detached for some unknown reason; may avoid some problems where the tool hangs after an error [7793134](https://github.com/mozilla-services/pageshot/commit/7793134)
* copy link on save, and put up a popup to notify
the user about the copy action. Fixes [#1734](https://github.com/mozilla-services/pageshot/issues/1734) [accfe28](https://github.com/mozilla-services/pageshot/commit/accfe28)
* allow view-source URLs. Fixes [#1720](https://github.com/mozilla-services/pageshot/issues/1720) [29efea9](https://github.com/mozilla-services/pageshot/commit/29efea9)
Expand Down Expand Up @@ -297,7 +297,7 @@ A version released to improve some operational issues.
* Get rid of unused controller on legal pages [0565da7](https://github.com/mozilla-services/pageshot/commit/0565da7)
* Use template literals [d82dc4d](https://github.com/mozilla-services/pageshot/commit/d82dc4d)
* put Raven activation into reactrender pages. Fixes [#1072](https://github.com/mozilla-services/pageshot/issues/1072) [895ca67](https://github.com/mozilla-services/pageshot/commit/895ca67)
* remove 'Leave page shot' link from pages when the
* remove 'Leave ...' link from pages when the
user is not authenticated. Fixes [#1578](https://github.com/mozilla-services/pageshot/issues/1578) [62e68ed](https://github.com/mozilla-services/pageshot/commit/62e68ed)
* Update all deps to latest. Fixes [#1703](https://github.com/mozilla-services/pageshot/issues/1703) [6a1b6cd](https://github.com/mozilla-services/pageshot/commit/6a1b6cd)
* Put something in the logs when someone tries to upload a shot
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Expand Up @@ -4,8 +4,8 @@ BABEL := babel --retain-lines
RSYNC := rsync --archive
VENV := .venv
.DEFAULT_GOAL := help
# Sets $(PAGESHOT_BACKEND) to http://localhost:10080 only if it isn't set
PAGESHOT_BACKEND ?= http://localhost:10080
# Sets $(SCREENSHOTS_BACKEND) to http://localhost:10080 only if it isn't set
SCREENSHOTS_BACKEND ?= http://localhost:10080

# This forces bin/build-scripts/write_ga_id to be run before anything else, which
# writes the configured Google Analytics ID to build/ga-id.txt
Expand Down Expand Up @@ -126,7 +126,7 @@ export_addon: addon
zip: addon
# FIXME: should remove web-ext-artifacts/*.zip first
./node_modules/.bin/web-ext build --source-dir addon/webextension/
mv web-ext-artifacts/page_shot*.zip build/pageshot.zip
mv web-ext-artifacts/firefox_screenshots*.zip build/pageshot.zip
# We'll try to remove this directory, but it's no big deal if we can't:
@rmdir web-ext-artifacts || true

Expand Down Expand Up @@ -191,7 +191,7 @@ build/server/static/js/shotindex-bundle.js: $(shotindex_dependencies)

leave_dependencies := $(shell ./bin/build-scripts/bundle_dependencies leave getdeps "$(server_dest)")
build/server/static/js/leave-bundle.js: $(leave_dependencies)
./bin/build-scripts/bundle_dependencies leave build ./build/server/pages/leave-page-shot/controller.js
./bin/build-scripts/bundle_dependencies leave build ./build/server/pages/leave-screenshots/controller.js

creating_dependencies := $(shell ./bin/build-scripts/bundle_dependencies creating getdeps "$(server_dest)")
build/server/static/js/creating-bundle.js: $(creating_dependencies)
Expand Down Expand Up @@ -225,16 +225,16 @@ build/.backend.txt: set_backend

.PHONY: set_backend
set_backend:
@echo "Setting backend to ${PAGESHOT_BACKEND}"
./bin/build-scripts/set_file build/.backend.txt $(PAGESHOT_BACKEND)
@echo "Setting backend to ${SCREENSHOTS_BACKEND}"
./bin/build-scripts/set_file build/.backend.txt $(SCREENSHOTS_BACKEND)

addon/webextension/build/defaultSentryDsn.js: set_sentry

.PHONY: set_sentry
set_sentry:
@if [[ -z "$(PAGESHOT_SENTRY)" ]] ; then echo "No default Sentry" ; fi
@if [[ -n "$(PAGESHOT_SENTRY)" ]] ; then echo "Setting default Sentry ${PAGESHOT_SENTRY}" ; fi
./bin/build-scripts/set_file addon/webextension/build/defaultSentryDsn.js "window.defaultSentryDsn = '${PAGESHOT_SENTRY}';null;"
@if [[ -z "$(SCREENSHOTS_SENTRY)" ]] ; then echo "No default Sentry" ; fi
@if [[ -n "$(SCREENSHOTS_SENTRY)" ]] ; then echo "Setting default Sentry ${SCREENSHOTS_SENTRY}" ; fi
./bin/build-scripts/set_file addon/webextension/build/defaultSentryDsn.js "window.defaultSentryDsn = '${SCREENSHOTS_SENTRY}';null;"


build/.npm-install.log: package.json
Expand Down
8 changes: 4 additions & 4 deletions README.md
@@ -1,4 +1,4 @@
## Page Shot
## Firefox Screenshots

[![CircleCI Build Status](https://circleci.com/gh/mozilla-services/pageshot.svg?style=shield)](https://circleci.com/gh/mozilla-services/pageshot)
[![Build Status](https://travis-ci.org/mozilla-services/pageshot.svg)](https://travis-ci.org/mozilla-services/pageshot)
Expand All @@ -12,7 +12,7 @@ It is made up of both an add-on (using [WebExtensions](https://developer.mozilla

Ian has been blogging about the [design, definition, and development process](http://www.ianbicking.org/tag/product-journal.html).

You can find more information about Page Shot at the Mozilla Wiki page: https://wiki.mozilla.org/Firefox/Page_Shot
You can find more information about Firefox Screenshots at the Mozilla Wiki page: https://wiki.mozilla.org/Firefox/Screenshots

### Installation and Setup

Expand All @@ -27,11 +27,11 @@ There are two scripts to run the server locally and develop the add-on:
- `./bin/run-server` will run the server on `http://localhost:10080` and automatically restart if there are changes.
- `./bin/run-addon` will build a few parts of the addon (into `addon/webextension/build/`) and start Firefox with the add-on installed. The add-on will be refreshed automatically as you change files. We recommend you open `about:debugging` to help debug the extension.
- - `./bin/run-addon --bootstrap` will run the add-on using the [bootstrap](https://github.com/mozilla-services/pageshot/blob/master/addon/bootstrap.js) wrapper. This is how the add-on is run in Firefox, and provides some additional services, like Telemetry and migration. This does not support reloading, so if you aren't developing things involving the wrapper then you can run without `--bootstrap`.
- `./bin/run-addon --setup-profile` will setup a Firefox profile for your development; this way you can make persistent changes to the profile that you will use just for Page Shot development. (note: this will only look for the `firefox` commmand or Nightly, Developer Edition, Aurora editions on OSX)
- `./bin/run-addon --setup-profile` will setup a Firefox profile for your development; this way you can make persistent changes to the profile that you will use just for Screenshots development. (note: this will only look for the `firefox` commmand or Nightly, Developer Edition, Aurora editions on OSX)

**If you want to develop the add-on but not the server** you can run `./bin/run-addon -s https://pageshot.dev.mozaws.net`

By default, Page Shot will connect to a Postgres database on localhost:5432. To change which database and user it connects to set/export the environmental variables: `RDS_USERNAME`, `RDS_PASSWORD`, and `RDS_HOSTNAME`
By default, Screenshots will connect to a Postgres database on localhost:5432. To change which database and user it connects to set/export the environmental variables: `RDS_USERNAME`, `RDS_PASSWORD`, and `RDS_HOSTNAME`

The server will automatically setup the tables in your database, and keep them up to date over time (using [pg-patcher](https://github.com/chilts/pg-patcher/)).

Expand Down
2 changes: 1 addition & 1 deletion addon/install.rdf.template
Expand Up @@ -3,7 +3,7 @@
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>pageshot@mozilla.org</em:id>
<em:name>Page Shot</em:name>
<em:name>Firefox Screenshots</em:name>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!--Firefox-->
Expand Down
2 changes: 1 addition & 1 deletion addon/webextension/README.md
Expand Up @@ -6,7 +6,7 @@ This contains all the files for the WebExtension. Most files are not "built", b
- There are three workers/processes:
1. The background page, in `background/`
2. The selector content worker, in `selector/`
3. The site helper that communicates with the Page Shot website, in `site-helper.js`
3. The site helper that communicates with the Firefox Screenshots website, in `site-helper.js`
- The background process is loaded according to a list in `manifest.json.template` – if there are load order dependencies, they must be manually managed with that list
- The selector content worker is loaded with a list in `background/selectorLoader.js`. Again this must be manually maintained.
- The site helper worker is loaded via a separate list in `manifest.json.template`
Expand Down
4 changes: 2 additions & 2 deletions addon/webextension/background/auth.js
Expand Up @@ -85,7 +85,7 @@ window.auth = (function () {
} else {
initialized = true;
let jsonResponse = JSON.parse(req.responseText);
console.info("Page Shot logged in");
console.info("Screenshots logged in");
analytics.sendEvent("login");
saveAuthInfo(jsonResponse);
if (ownershipCheck) {
Expand Down Expand Up @@ -149,7 +149,7 @@ window.auth = (function () {
}
return initPromise.then(() => {
if (authHeader) {
return {"x-pageshot-auth": authHeader};
return {"x-screenshots-auth": authHeader};
} else {
console.warn("No auth header available");
return {};
Expand Down
6 changes: 3 additions & 3 deletions addon/webextension/background/main.js
Expand Up @@ -27,7 +27,7 @@ window.main = (function () {
}

function setIconActive(active, tabId) {
const path = active ? "icons/pageshot-icon-green-38.png" : "icons/pageshot-icon-38.png";
const path = active ? "icons/icon-green-38.png" : "icons/icon-38.png";
browser.browserAction.setIcon({path, tabId});
}

Expand All @@ -51,13 +51,13 @@ window.main = (function () {
toggleSelector(tab)
.then(active => {
const event = active ? "start-shot" : "cancel-shot";
sendEvent(event, "toolbar-pageshot-button");
sendEvent(event, "toolbar-button");
}));
}
}));

browser.contextMenus.create({
id: "create-pageshot",
id: "create-screenshot",
title: browser.i18n.getMessage("contextMenuLabel"),
contexts: ["page"]
}, () => {
Expand Down
18 changes: 9 additions & 9 deletions addon/webextension/manifest.json.template
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"name": "Page Shot",
"name": "Firefox Screenshots",
"version": "__VERSION__",
"description": "__MSG_addonDescription__",
"author": "__MSG_addonAuthorsList__",
Expand All @@ -12,17 +12,17 @@
},
"default_locale": "en_US",
"icons": {
"16": "icons/pageshot-icon-16.png",
"32": "icons/pageshot-icon-32.png",
"48": "icons/pageshot-icon-48.png",
"64": "icons/pageshot-mac-64px.png",
"128": "icons/pageshot-icon-128.png",
"256": "icons/pageshot-icon-256.png"
"16": "icons/icon-16.png",
"32": "icons/icon-32.png",
"48": "icons/icon-48.png",
"64": "icons/icon-64.png",
"128": "icons/icon-128.png",
"256": "icons/icon-256.png"
},
"browser_action": {
"default_icon": {
"19": "icons/pageshot-icon-19.png",
"38": "icons/pageshot-icon-38.png"
"19": "icons/icon-19.png",
"38": "icons/icon-38.png"
},
"default_title": "__MSG_toolbarButtonLabel__",
"browser_style": false
Expand Down

0 comments on commit 81212c5

Please sign in to comment.