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

Commit

Permalink
Merge branch 'master' into shot-creation-response-times
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Nov 8, 2017
2 parents fc1853f + d01d442 commit ecb9877
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 15 deletions.
4 changes: 2 additions & 2 deletions addon/webextension/buildSettings.js.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ window.buildSettings = {
captureText: (process.env.SCREENSHOTS_CAPTURE_TEXT === "true"),
uploadBinary: (process.env.SCREENSHOTS_UPLOAD_BINARY === "true"),
pngToJpegCutoff: parseInt(process.env.SCREENSHOTS_PNG_TO_JPEG_CUTOFF || 2500000, 10),
maxImageHeight: parseInt(process.env.SCREENSHOTS_MAX_IMAGE_HEIGHT || 5000, 10),
maxImageWidth: parseInt(process.env.SCREENSHOTS_MAX_IMAGE_WIDTH || 5000, 10)
maxImageHeight: parseInt(process.env.SCREENSHOTS_MAX_IMAGE_HEIGHT || 10000, 10),
maxImageWidth: parseInt(process.env.SCREENSHOTS_MAX_IMAGE_WIDTH || 10000, 10)
};
null;
12 changes: 10 additions & 2 deletions addon/webextension/selector/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ this.ui = (function() { // eslint-disable-line no-unused-vars
return result;
}

function isDownloadOnly() {
let isDownloadOnly = exports.isDownloadOnly = function() {
return window.downloadOnly;
}

Expand Down Expand Up @@ -219,6 +219,15 @@ this.ui = (function() { // eslint-disable-line no-unused-vars
if (width !== this.sizeTracking.lastWidth) {
this.sizeTracking.lastWidth = width;
this.element.style.width = width + "px";
// Since this frame has an absolute position relative to the parent
// document, if the parent document has a max-width that is narrower
// than the viewport, then the x of the parent document is not at 0 of
// the viewport. That makes the frame shifted to the right. This left
// margin negates that.
let boundingRect = document.body.getBoundingClientRect();
if (boundingRect.x) {
this.element.style.marginLeft = `-${boundingRect.x}px`;
}
}
if (force && visible) {
this.element.style.display = "";
Expand Down Expand Up @@ -323,7 +332,6 @@ this.ui = (function() { // eslint-disable-line no-unused-vars
resolve();
}), {once: true});
document.body.appendChild(this.element);
this.unhide();
} else {
resolve();
}
Expand Down
7 changes: 5 additions & 2 deletions addon/webextension/selector/uicontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -967,8 +967,11 @@ this.uicontrol = (function() {
sendEvent("cancel-shot", "keyboard-escape");
exports.deactivate();
}
if ((event.key || event.code) === "Enter") {
if (getState.state === "selected") {
if ((event.key || event.code) === "Enter" && getState.state === "selected") {
if (ui.isDownloadOnly()) {
sendEvent("download-shot", "keyboard-enter");
shooter.downloadShot(selectedPos);
} else {
sendEvent("save-shot", "keyboard-enter");
shooter.takeShot("selection", selectedPos);
}
Expand Down
7 changes: 7 additions & 0 deletions locales/ach/server.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ homePageHowScreenshotsWorks = Kit ma Firefox Screenshots Tiyo Kede
homePageGetStartedTitle = Caki
// Note: Screenshots is an abbreviation for Firefox Screenshots, and should not be translated.
homePageGetStartedDescription = Nong cal Screenshots manyen i gitic mamegi. Yer, ka jami ayera me Screenshots bi nyute i wii dirica me layeny mamegi.
homePageCapturePage = mak potbuk
homePageSaveShare = Gwokki ki Nywaki
homePageLegalLink = Cik
homePagePrivacyLink = Mung
Expand Down Expand Up @@ -137,6 +138,10 @@ shotIndexPageNoSearchResultsIntro = Hmm
shotIndexPageNoSearchResults = Pe watwero nongo cal ma rwate ki yeny mamegi.
shotIndexPageClearSearchButton
.title = Jwa yeny
shotIndexPagePreviousPage
.title = potbuk mukato
shotIndexPageNextPage
.title = potbuk malubu


// all metrics strings are optional for translation
Expand All @@ -151,4 +156,6 @@ metricsPageUsersQueryTitle = Lutic kudiceng
metricsPageUsersQueryCount = Wel Lutic
metricsPageUsersQueryDay = Diceng
metricsPageUserShotsQueryCount = Wel lutic
metricsPageRetentionQueryUsers = Wel lutic
metricsPageTotalRetentionQueryUsers = Wel lutic
metricsPageVersionQueryLastSeen = Nino
5 changes: 5 additions & 0 deletions locales/ia/server.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ timeDiffFutureDays = { $num ->
[[ Shotindex page ]]

// { $status } is a placeholder for an HTTP status code, like '500'.
// { $statusText } is a text description of the status code, like 'Internal server error'.
shotIndexPageErrorDeletingShot = Error delente le instantaneo: { $status } { $statusText }
// { $error } is a placeholder for a non-translated error message that could be shared
// with developers when debugging an error.
shotIndexPageErrorRendering = Error a generar un pagina: { $error }
Expand Down Expand Up @@ -198,11 +201,13 @@ metricsPageTotalsQueryExpiredDeletedShots = Expirate (e delite)
metricsPageShotsQueryTitle = Instantaneos per die
metricsPageShotsQueryCount = Numero de instantaneos
metricsPageShotsQueryDay = Die
metricsPageUsersQueryTitle = Usatores pro die
metricsPageUsersQueryCount = Numero de usatores
metricsPageUsersQueryDay = Die
metricsPageUserShotsQueryTitle = Numero de instantaneos per usator
metricsPageUserShotsQueryCount = Numero de usatores
metricsPageRetentionQueryUsers = Numero de usatores
metricsPageTotalRetentionQueryTitle = Retention total
metricsPageTotalRetentionQueryUsers = Numero de usatores
metricsPageVersionQueryTitle = Version del additivo
metricsPageVersionQueryUsers = Numero de usatores connexe
Expand Down
2 changes: 2 additions & 0 deletions locales/ia/webextension.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ saveScreenshotVisibleArea = Salvar le area visibile
saveScreenshotFullPage = Salvar le pagina
cancelScreenshot = Cancellar
downloadScreenshot = Discargar
downloadOnlyNotice = Tu es actualmente in modo solo-discargamento.
# The downloadOnlyDetails string introduces a list of items. The keys
# downloadOnlyDetailsPrivate, downloadOnlyDetailsThirdParty, and
# downloadOnlyDetailsNeverRemember are list items in that list.
Expand Down Expand Up @@ -47,6 +48,7 @@ tourDone = Facite
# Do not translate {termsAndPrivacyNoticeTermsLink} and
# {termsAndPrivacyNoticyPrivacyLink}. They're placeholders replaced by links
# using the corresponding translated strings as text.
termsAndPrivacyNotice2 = Usante Firefox Screenshots, tu concorda con nostre {termsAndPrivacyNoticeTermsLink} e {termsAndPrivacyNoticePrivacyLink}.
# This string is used as the text for a link in termsAndPrivacyNoticeCloudServices
termsAndPrivacyNoticeTermsLink = Terminos
# This string is used as the text for a link in termsAndPrivacyNoticeCloudServices
Expand Down
2 changes: 2 additions & 0 deletions server/db-patches/patch-21-22.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE data ALTER COLUMN id TYPE character varying(270);
ALTER TABLE images ALTER COLUMN shotid TYPE character varying(270);
4 changes: 2 additions & 2 deletions server/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CREATE TABLE accounts (
email text
);
CREATE TABLE data (
id character varying(120) NOT NULL,
id character varying(270) NOT NULL,
deviceid character varying(200),
created timestamp without time zone DEFAULT now(),
value text NOT NULL,
Expand All @@ -35,7 +35,7 @@ CREATE TABLE devices (
);
CREATE TABLE images (
id character varying(200) NOT NULL,
shotid character varying(200) NOT NULL,
shotid character varying(270) NOT NULL,
clipid character varying(200) NOT NULL,
contenttype text NOT NULL,
url text,
Expand Down
2 changes: 1 addition & 1 deletion server/src/dbschema.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const mozlog = require("./logging").mozlog("dbschema");

// When updating the database, please also run ./bin/dumpschema --record
// This updates schema.sql with the latest full database schema
const MAX_DB_LEVEL = exports.MAX_DB_LEVEL = 21;
const MAX_DB_LEVEL = exports.MAX_DB_LEVEL = 22;

exports.forceDbVersion = function(version) {
mozlog.info("forcing-db-version", {db: db.constr, version});
Expand Down
2 changes: 1 addition & 1 deletion server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ app.param("id", function(req, res, next, id) {
});

app.param("domain", function(req, res, next, domain) {
if (/^[^\s/]{1,100}$/.test(domain)) {
if (/^[^\s/]{1,252}$/.test(domain)) {
next();
return;
}
Expand Down
7 changes: 2 additions & 5 deletions static/css/shot-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,11 @@ h1 {
#shots-page-number {
margin-left: 40px;
margin-right: 40px;
padding: 0;
}

span {
vertical-align: middle;
padding: 10px;
width: 40px;

&.shots-page-nav {
Expand All @@ -272,10 +273,8 @@ h1 {
}

a {
display: block;
border-radius: 3px;
height: 40px;
padding: 10px;

&:hover {
background-color: #d7d7db;
Expand All @@ -288,8 +287,6 @@ h1 {
}

img {
display: inline-block;
height: 20px;
width: 20px;
vertical-align: middle;
}
Expand Down
1 change: 1 addition & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function getDriver() {
options.setProfile(profile);

const builder = new webdriver.Builder()
.withCapabilities({'moz:webdriverClick': false})
.forBrowser("firefox")
.setFirefoxOptions(options);

Expand Down

0 comments on commit ecb9877

Please sign in to comment.