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

Commit

Permalink
Remove favicon from UI and shot model. (#4796)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba committed Sep 11, 2018
1 parent a9a6d02 commit c030dec
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 47 deletions.
1 change: 0 additions & 1 deletion docs/testing-the-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Authenticated. Creates or updates a shot. Takes a JSON body. Looks like:
"url": "https://github.com/mozilla-services/screenshots/issues/1237",
"docTitle": "Screenshots erases everything in my clipboard · Issue #1237 · mozilla-services/pageshot",
"createdDate": 1468983767525,
"favicon": "https://assets-cdn.github.com/favicon.ico",
"images": [
{
"url": "https://cloud.githubusercontent.com/assets/557895/16748439/efdbf0a0-4778-11e6-9a33-d1043238addf.png",
Expand Down
5 changes: 1 addition & 4 deletions server/src/pages/shot/model.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { createProxyUrl, createDownloadUrl } = require("../../proxy-url");
const { createDownloadUrl } = require("../../proxy-url");
const { getGitRevision } = require("../../linker");
const MobileDetect = require("mobile-detect");

Expand All @@ -10,9 +10,6 @@ exports.createModel = function(req) {
if (clip) {
downloadUrl = createDownloadUrl(clip.image.url, req.shot.filename);
}
if (req.shot.favicon) {
req.shot.favicon = createProxyUrl(req, req.shot.favicon);
}
const title = req.getText("shotPageTitle", {originalTitle: req.shot.title});
const enableAnnotations = req.config.enableAnnotations;
const isFxaAuthenticated = req.accountId && req.accountId === req.shot.accountId;
Expand Down
3 changes: 0 additions & 3 deletions server/src/pages/shotindex/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ exports.createModel = function(req) {
serverModel.enableUserSettings = req.config.enableUserSettings;
let shots = req.shots;
for (const shot of shots || []) {
if (shot.favicon) {
shot.favicon = createProxyUrl(req, shot.favicon);
}
const clip = shot.getClip(shot.clipNames()[0]);
if (clip) {
serverModel.downloadUrls[shot.id] = createDownloadUrl(clip.image.url, shot.filename);
Expand Down
7 changes: 0 additions & 7 deletions server/src/pages/shotindex/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,6 @@ class Card extends React.Component {
imageUrl = this.props.staticLink("img/question-mark.svg");
}

let favicon = null;
if (shot.favicon) {
// We use background-image so if the image is broken it just doesn't show:
favicon = <div style={{backgroundImage: `url("${shot.favicon}")`}} className="favicon" />;
}

let neverExpireIndicator = null;
if (!shot.expireTime) {
if (this.props.hasFxa) {
Expand Down Expand Up @@ -356,7 +350,6 @@ class Card extends React.Component {
<h4>{this.displayTitle(shot.title)}</h4>
</div>
<div className="link-container">
{favicon}
<div className="shot-url">
{shot.urlDisplay}
</div>
Expand Down
17 changes: 3 additions & 14 deletions shared/shot.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ class AbstractShot {
this.docTitle = attrs.docTitle || null;
this.userTitle = attrs.userTitle || null;
this.createdDate = attrs.createdDate || Date.now();
this.favicon = attrs.favicon || null;
this.siteName = attrs.siteName || null;
this.images = [];
if (attrs.images) {
Expand Down Expand Up @@ -458,15 +457,6 @@ class AbstractShot {
this._createdDate = val;
}

get favicon() {
return this._favicon;
}
set favicon(val) {
// We set the favicon with tabs.Tab.faviConUrl, which is a full URL.
val = val || null;
this._favicon = val;
}

clipNames() {
const names = Object.getOwnPropertyNames(this._clips);
names.sort(function(a, b) {
Expand Down Expand Up @@ -566,7 +556,7 @@ class AbstractShot {
}

AbstractShot.prototype.REGULAR_ATTRS = (`
origin fullUrl docTitle userTitle createdDate favicon images
origin fullUrl docTitle userTitle createdDate images
siteName openGraph twitterCard documentSize
thumbnail abTests
`).split(/\s+/g);
Expand All @@ -575,12 +565,11 @@ thumbnail abTests
AbstractShot.prototype.DEPRECATED_ATTRS = (`
microdata history ogTitle createdDevice head body htmlAttrs bodyAttrs headAttrs
readable hashtags comments showPage isPublic resources deviceId url
fullScreenThumbnail
fullScreenThumbnail favicon
`).split(/\s+/g);

AbstractShot.prototype.RECALL_ATTRS = (`
url docTitle userTitle createdDate favicon
openGraph twitterCard images thumbnail
url docTitle userTitle createdDate openGraph twitterCard images thumbnail
`).split(/\s+/g);

AbstractShot.prototype._OPENGRAPH_PROPERTIES = (`
Expand Down
9 changes: 0 additions & 9 deletions static/css/frame.scss
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,6 @@
}
}

// TODO: investigate favicons not appearing on dev, stage and prod
.favicon {
background-size: 16px 16px;
display: none;
height: 16px;
margin-right: 6px;
width: 16px;
}

.shot-title-input {
border-radius: $border-radius;
border: 1px solid $active-blue;
Expand Down
9 changes: 0 additions & 9 deletions static/css/shot-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,6 @@ h1 {
.link-container {
@include flex-container(row, flex-start, center);

// TODO: investigate favicons not appearing on dev, stage and prod
.favicon {
background-size: 16px 16px;
display: none;
flex: 0 0 16px;
height: 16px;
margin-right: 6px;
}

.shot-url {
color: $link-medium;
font-size: 12px;
Expand Down

0 comments on commit c030dec

Please sign in to comment.