diff --git a/.gitattributes b/.gitattributes index 0f491c95..b7c76f43 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -public/locales/* linguist-documentation -docs/* linguist-documentation +public/locales/*/*.ftl linguist-documentation +docs/** linguist-documentation diff --git a/.gitignore b/.gitignore index 00aca6da..893f032d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ node_modules coverage dist +.env .idea .DS_Store .nyc_output diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cf9ce487..6ff72043 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,105 +1,72 @@ -image: "node:15-slim" stages: - test - - artifact - release -before_script: - # Install dependencies - - apt-get update - - apt-get install -y git python3 build-essential libxtst6 - - # Prepare Chrome for puppeteer - - apt-get install -y wget gnupg - - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - - - sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' - - apt-get update - - apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends - # Build Send, run npm tests test: stage: test + image: "node:16-slim" + only: + - api + - branches + - chat + - merge_requests + - pushes + - schedules + - tags + - triggers + - web + before_script: + # Install dependencies + - apt-get update + - apt-get install -y git python3 build-essential libxtst6 + + # Prepare Chrome for puppeteer + - apt-get install -y wget gnupg + - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - + - sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' + - apt-get update + - apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils + - apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends script: - npm ci - npm run lint - npm test -# Build Docker image, export Docker image artifact -artifact-docker: - stage: artifact - image: docker:latest - needs: [] - services: - - docker:dind - variables: - IMG_FILE: "send:git-$CI_COMMIT_SHORT_SHA.tar" - IMG_NAME: "send:git-$CI_COMMIT_SHORT_SHA" - before_script: [] - script: - - docker build -t $IMG_NAME . - - docker image save -o $IMG_FILE $IMG_NAME - artifacts: - name: artifact-docker - paths: - - $IMG_FILE - expire_in: 1 week - -# Release public Docker image for the master branch -release-docker-master: - stage: release - image: docker:latest - dependencies: - - artifact-docker - services: - - docker:dind - only: - - master - variables: - IMG_IMPORT_FILE: "send:git-$CI_COMMIT_SHORT_SHA.tar" - IMG_IMPORT_NAME: "send:git-$CI_COMMIT_SHORT_SHA" - IMG_NAME: "registry.gitlab.com/timvisee/send:master-$CI_COMMIT_SHORT_SHA" - before_script: [] - script: - # Login in to registry - - 'docker login registry.gitlab.com -u $DOCKER_USER -p $DOCKER_PASS' - - # Load existing, retag for new image images - - docker image load -i $IMG_IMPORT_FILE - - docker tag $IMG_IMPORT_NAME $IMG_NAME - - # Publish tagged image - - docker push $IMG_NAME - - - 'echo "Docker image artifact published, available as:" && echo " docker pull $IMG_NAME"' - -# Release public Docker image for a version tag release-docker: stage: release image: docker:latest - dependencies: - - artifact-docker services: - docker:dind only: - - /^v(\d+\.)*\d+$/ - variables: - IMG_IMPORT_FILE: "send:git-$CI_COMMIT_SHORT_SHA.tar" - IMG_IMPORT_NAME: "send:git-$CI_COMMIT_SHORT_SHA" - IMG_NAME: "registry.gitlab.com/timvisee/send:$CI_COMMIT_REF_NAME" - IMG_NAME_LATEST: "registry.gitlab.com/timvisee/send:latest" - before_script: [] + - api + - branches + - chat + - merge_requests + - pushes + - schedules + - tags + - triggers + - web script: - # Login in to registry - - 'docker login registry.gitlab.com -u $DOCKER_USER -p $DOCKER_PASS' - - # Load existing, retag for new image images - - docker image load -i $IMG_IMPORT_FILE - - docker tag $IMG_IMPORT_NAME $IMG_NAME - - docker tag $IMG_IMPORT_NAME $IMG_NAME_LATEST - - # Publish tagged image - - docker push $IMG_NAME - - docker push $IMG_NAME_LATEST - - - 'echo "Docker image artifact published, available as:" && echo " docker pull $IMG_NAME_LATEST" && echo " docker pull $IMG_NAME"' + - docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" + - docker buildx create --name sendBuilder + - docker buildx use sendBuilder + - | + if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]; then + IMAGE_NAMES="$CI_REGISTRY_IMAGE/mr:$CI_MERGE_REQUEST_IID" + elif [ "$CI_COMMIT_TAG" != "" ]; then + IMAGE_NAMES="$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG $CI_REGISTRY_IMAGE:latest" + else + IMAGE_NAMES="$CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:$CI_COMMIT_SHORT_SHA" + fi + - | + for image in $IMAGE_NAMES; do + docker buildx build --platform linux/amd64,linux/arm64 -t $image . --push + done + - | + echo "Container image pushed. You can pull it with"; + for image in $IMAGE_NAMES; do + echo "docker pull $image" + done diff --git a/.stylelintrc b/.stylelintrc index 0af67b03..afc9e08d 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -11,3 +11,5 @@ rules: selector-list-comma-newline-after: null value-list-comma-newline-after: null at-rule-no-unknown: null + # Conflicts with prettier + string-quotes: null diff --git a/CONTRIBUTORS b/CONTRIBUTORS index a3e09bfb..87dd4c15 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -49,6 +49,7 @@ Cynthia Pereira Daniel Thorn Daniela Arcese Danny Coates +David Dumas Davide Derek Tamsen Dhyey Thakore diff --git a/Dockerfile b/Dockerfile index be5e5272..53220098 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,41 +4,57 @@ # License https://gitlab.com/timvisee/send/blob/master/LICENSE ## - # Build project -FROM node:15.5.1-alpine AS builder +FROM node:16.13-alpine3.13 AS builder + +RUN set -x \ + # Change node uid/gid + && apk --no-cache add shadow \ + && groupmod -g 1001 node \ + && usermod -u 1001 -g 1001 node + RUN set -x \ # Add user - && addgroup --gid 10001 app \ + && addgroup --gid 1000 app \ && adduser --disabled-password \ --gecos '' \ --ingroup app \ --home /app \ - --uid 10001 \ + --uid 1000 \ app + COPY --chown=app:app . /app + USER app WORKDIR /app + RUN set -x \ # Build && PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm ci \ && npm run build - # Main image -FROM node:15.5.1-alpine +FROM node:16.13-alpine3.13 + +RUN set -x \ + # Change node uid/gid + && apk --no-cache add shadow \ + && groupmod -g 1001 node \ + && usermod -u 1001 -g 1001 node + RUN set -x \ # Add user - && addgroup --gid 10001 app \ + && addgroup --gid 1000 app \ && adduser --disabled-password \ --gecos '' \ --ingroup app \ --home /app \ - --uid 10001 \ + --uid 1000 \ app USER app WORKDIR /app + COPY --chown=app:app package*.json ./ COPY --chown=app:app app app COPY --chown=app:app common common diff --git a/README.md b/README.md index 1958ffa7..b05f668f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [](https://gitlab.com/timvisee/send/) Send +# [](https://gitlab.com/timvisee/send/) Send [![Build status on GitLab CI][gitlab-ci-master-badge]][gitlab-ci-link] [![Latest release][release-badge]][release-link] @@ -81,7 +81,7 @@ A file sharing experiment which allows you to send encrypted files to other user ## Requirements -- [Node.js 12.x](https://nodejs.org/) +- [Node.js 16.x](https://nodejs.org/) - [Redis server](https://redis.io/) (optional for development) - [AWS S3](https://aws.amazon.com/s3/) or compatible service (optional) @@ -121,7 +121,7 @@ The server is configured with environment variables. See [server/config.js](serv ## Localization -see [docs/localization.md](docs/localization.md) +See: [docs/localization.md](docs/localization.md) --- @@ -139,7 +139,11 @@ Find a list of public instances here: https://github.com/timvisee/send-instances ## Deployment -See also [docs/deployment.md](docs/deployment.md) +See: [docs/deployment.md](docs/deployment.md) + +Docker quickstart: [docs/docker.md](docs/docker.md) + +AWS example using Ubuntu Server `20.04`: [docs/AWS.md](docs/AWS.md) --- @@ -148,6 +152,7 @@ See also [docs/deployment.md](docs/deployment.md) - Web: _this repository_ - Command-line: [`ffsend`](https://github.com/timvisee/ffsend) - Android: _see [Android](#android) section_ +- Thunderbird: [FileLink provider for Send](https://addons.thunderbird.net/thunderbird/addon/filelink-provider-for-send/) #### Android diff --git a/android/android.js b/android/android.js index 0cbdefe5..8e194c9e 100644 --- a/android/android.js +++ b/android/android.js @@ -77,7 +77,11 @@ function body(main) { state.capabilities = { account: true }; //TODO - state.archive = new Archive([], DEFAULTS.EXPIRE_SECONDS); + state.archive = new Archive( + [], + DEFAULTS.EXPIRE_SECONDS, + DEFAULTS.DOWNLOADS + ); state.storage = storage; state.user = new User(storage, LIMITS); state.sentry = Sentry; diff --git a/app/api.js b/app/api.js index f271ea2e..2d1238c2 100644 --- a/app/api.js +++ b/app/api.js @@ -43,7 +43,7 @@ function post(obj, bearerToken) { 'Content-Type': 'application/json' }; if (bearerToken) { - h['Authentication'] = `Bearer ${bearerToken}`; + h['Authorization'] = `Bearer ${bearerToken}`; } return { method: 'POST', diff --git a/app/archive.js b/app/archive.js index 45517754..683cc370 100644 --- a/app/archive.js +++ b/app/archive.js @@ -14,11 +14,12 @@ function isDupe(newFile, array) { } export default class Archive { - constructor(files = [], defaultTimeLimit = 86400) { + constructor(files = [], defaultTimeLimit = 86400, defaultDownloadLimit = 1) { this.files = Array.from(files); this.defaultTimeLimit = defaultTimeLimit; + this.defaultDownloadLimit = defaultDownloadLimit; this.timeLimit = defaultTimeLimit; - this.dlimit = 1; + this.dlimit = defaultDownloadLimit; this.password = null; } @@ -76,7 +77,7 @@ export default class Archive { clear() { this.files = []; - this.dlimit = 1; + this.dlimit = this.defaultDownloadLimit; this.timeLimit = this.defaultTimeLimit; this.password = null; } diff --git a/app/experiments.js b/app/experiments.js index 8b7a19ee..8e432e0a 100644 --- a/app/experiments.js +++ b/app/experiments.js @@ -7,7 +7,7 @@ const experiments = { return true; }, variant: function() { - return ['white-blue', 'blue', 'white-violet', 'violet'][ + return ['white-primary', 'primary', 'white-violet', 'violet'][ Math.floor(Math.random() * 4) ]; }, diff --git a/app/fileReceiver.js b/app/fileReceiver.js index 7c2e368b..85065429 100644 --- a/app/fileReceiver.js +++ b/app/fileReceiver.js @@ -224,24 +224,6 @@ async function saveFile(file) { if (navigator.msSaveBlob) { navigator.msSaveBlob(blob, file.name); return resolve(); - } else if (/iPhone|fxios/i.test(navigator.userAgent)) { - // This method is much slower but createObjectURL - // is buggy on iOS - const reader = new FileReader(); - reader.addEventListener('loadend', function() { - if (reader.error) { - return reject(reader.error); - } - if (reader.result) { - const a = document.createElement('a'); - a.href = reader.result; - a.download = file.name; - document.body.appendChild(a); - a.click(); - } - resolve(); - }); - reader.readAsDataURL(blob); } else { const downloadUrl = URL.createObjectURL(blob); const a = document.createElement('a'); diff --git a/app/locale.js b/app/locale.js index ff8925fb..23dfdb7c 100644 --- a/app/locale.js +++ b/app/locale.js @@ -1,8 +1,8 @@ -import { FluentBundle } from '@fluent/bundle'; +import { FluentBundle, FluentResource } from '@fluent/bundle'; function makeBundle(locale, ftl) { const bundle = new FluentBundle(locale, { useIsolating: false }); - bundle.addMessages(ftl); + bundle.addResource(new FluentResource(ftl)); return bundle; } @@ -19,7 +19,7 @@ export async function getTranslator(locale) { return function(id, data) { for (let bundle of bundles) { if (bundle.hasMessage(id)) { - return bundle.format(bundle.getMessage(id), data); + return bundle.formatPattern(bundle.getMessage(id).value, data); } } }; diff --git a/app/main.css b/app/main.css index 29b37ad4..6a42290e 100644 --- a/app/main.css +++ b/app/main.css @@ -7,17 +7,14 @@ html { @tailwind components; :not(input) { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; user-select: none; } :root { --violet-gradient: linear-gradient( -180deg, - rgba(144, 89, 255, 0.8) 0%, - rgba(144, 89, 255, 0.4) 100% + rgb(144 89 255 / 80%) 0%, + rgb(144 89 255 / 40%) 100% ); } @@ -39,7 +36,7 @@ body { } .btn { - @apply bg-blue-60; + @apply bg-primary; @apply text-white; @apply cursor-pointer; @apply py-4; @@ -48,11 +45,11 @@ body { } .btn:hover { - @apply bg-blue-70; + @apply bg-primary_accent; } .btn:focus { - @apply bg-blue-70; + @apply bg-primary_accent; } .checkbox { @@ -71,7 +68,7 @@ body { .checkbox > label::before { /* @apply bg-grey-10; */ - @apply border; + @apply border-default; @apply rounded-sm; content: ''; @@ -82,16 +79,16 @@ body { } .checkbox > label:hover::before { - @apply border-blue-50; + @apply border-primary; } .checkbox > input:focus + label::before { - @apply border-blue-50; + @apply border-primary; } .checkbox > input:checked + label::before { - @apply bg-blue-50; - @apply border-blue-50; + @apply bg-primary; + @apply border-primary; background-image: url('../assets/lock.svg'); background-position: center; @@ -104,8 +101,8 @@ body { } .checkbox > input:disabled + label::before { - @apply bg-blue-50; - @apply border-blue-50; + @apply bg-primary; + @apply border-primary; background-image: url('../assets/lock.svg'); background-position: center; @@ -118,7 +115,7 @@ details { overflow: hidden; } -details > summary::-webkit-details-marker { +details > summary::marker { display: none; } @@ -153,16 +150,16 @@ footer li a:hover { white-space: nowrap; } -.link-blue { - @apply text-blue-60; +.link-primary { + @apply text-primary; } -.link-blue:hover { - @apply text-blue-70; +.link-primary:hover { + @apply text-primary_accent; } -.link-blue:focus { - @apply text-blue-70; +.link-primary:focus { + @apply text-primary_accent; } .main-header img { @@ -170,12 +167,27 @@ footer li a:hover { width: auto; } +.text-underline { + text-decoration: underline; +} + +.d-block { + display: block; +} + +.d-inline-block { + display: inline-block; +} + +.align-middle { + vertical-align: middle; +} + .main { display: flex; position: relative; max-width: 64rem; width: 100%; - height: 100%; } .main > section { @@ -205,19 +217,18 @@ progress::-webkit-progress-value { background-image: -webkit-linear-gradient( -45deg, transparent 20%, - rgba(255, 255, 255, 0.4) 20%, - rgba(255, 255, 255, 0.4) 40%, + rgb(255 255 255 / 40%) 20%, + rgb(255 255 255 / 40%) 40%, transparent 40%, transparent 60%, - rgba(255, 255, 255, 0.4) 60%, - rgba(255, 255, 255, 0.4) 80%, + rgb(255 255 255 / 40%) 60%, + rgb(255 255 255 / 40%) 80%, transparent 80% ), - -webkit-linear-gradient(left, #0a84ff, #0a84ff); + -webkit-linear-gradient(left, var(--color-primary), var(--color-primary)); /* stylelint-enable */ border-radius: 2px; background-size: 21px 20px, 100% 100%, 100% 100%; - -webkit-animation: animate-stripes 1s linear infinite; } progress::-moz-progress-bar { @@ -225,27 +236,21 @@ progress::-moz-progress-bar { background-image: -moz-linear-gradient( 135deg, transparent 20%, - rgba(255, 255, 255, 0.4) 20%, - rgba(255, 255, 255, 0.4) 40%, + rgb(255 255 255 / 40%) 20%, + rgb(255 255 255 / 40%) 40%, transparent 40%, transparent 60%, - rgba(255, 255, 255, 0.4) 60%, - rgba(255, 255, 255, 0.4) 80%, + rgb(255 255 255 / 40%) 60%, + rgb(255 255 255 / 40%) 80%, transparent 80% ), - -moz-linear-gradient(left, #0a84ff, #0a84ff); + -moz-linear-gradient(left, var(--color-primary), var(--color-primary)); /* stylelint-enable */ border-radius: 2px; background-size: 21px 20px, 100% 100%, 100% 100%; animation: animate-stripes 1s linear infinite; } -@-webkit-keyframes animate-stripes { - 100% { - background-position: -21px 0; - } -} - @keyframes animate-stripes { 100% { background-position: -21px 0; @@ -271,7 +276,6 @@ select { @apply m-auto; @apply py-8; - min-height: 42rem; max-height: 42rem; width: calc(100% - 3rem); } @@ -285,28 +289,28 @@ select { } .btn { - @apply bg-blue-40; + @apply bg-primary; @apply text-white; } .btn:hover { - @apply bg-blue-50; + @apply bg-primary_accent; } .btn:focus { - @apply bg-blue-50; + @apply bg-primary_accent; } - .link-blue { - @apply text-blue-40; + .link-primary { + @apply text-primary; } - .link-blue:hover { - @apply text-blue-50; + .link-primary:hover { + @apply text-primary_accent; } - .link-blue:focus { - @apply text-blue-50; + .link-primary:focus { + @apply text-primary_accent; } .main > section { @@ -315,7 +319,7 @@ select { @screen md { .main > section { - @apply border; + @apply border-default; @apply border-grey-80; } } @@ -325,13 +329,12 @@ select { @responsive { .shadow-light { - box-shadow: 0 0 8px 0 rgba(12, 12, 13, 0.1); + box-shadow: 0 0 8px 0 rgb(12 12 13 / 10%); } .shadow-big { - box-shadow: 0 12px 18px 2px rgba(34, 0, 51, 0.04), - 0 6px 22px 4px rgba(7, 48, 114, 0.12), - 0 6px 10px -4px rgba(14, 13, 26, 0.12); + box-shadow: 0 12px 18px 2px rgb(34 0 51 / 4%), + 0 6px 22px 4px rgb(7 48 114 / 12%), 0 6px 10px -4px rgb(14 13 26 / 12%); } } @@ -365,20 +368,20 @@ select { /* begin signin button color experiment */ -.white-blue { - @apply border-blue-60; +.white-primary { + @apply border-primary; @apply border-2; - @apply text-blue-60; + @apply text-primary; } -.white-blue:hover, -.white-blue:focus { - @apply bg-blue-60; +.white-primary:hover, +.white-primary:focus { + @apply bg-primary; @apply text-white; } -.blue { - @apply bg-blue-60; +.primary { + @apply bg-primary; @apply text-white; } diff --git a/app/main.js b/app/main.js index 469dfccb..c6a89dce 100644 --- a/app/main.js +++ b/app/main.js @@ -52,7 +52,7 @@ if (process.env.NODE_ENV === 'production') { DEFAULTS, WEB_UI, PREFS, - archive: new Archive([], DEFAULTS.EXPIRE_SECONDS), + archive: new Archive([], DEFAULTS.EXPIRE_SECONDS, DEFAULTS.DOWNLOADS), capabilities, translate, storage, diff --git a/app/qrcode.js b/app/qrcode.js index 1b662a13..5d960df3 100644 --- a/app/qrcode.js +++ b/app/qrcode.js @@ -59,7 +59,7 @@ var qrcode = (function() { setupTypeInfo(test, maskPattern); if (_typeNumber >= 7) { - // setupTypeNumber(test); + setupTypeNumber(test); } if (_dataCache == null) { @@ -154,6 +154,20 @@ var qrcode = (function() { } }; + var setupTypeNumber = function(test) { + var bits = QRUtil.getBCHTypeNumber(_typeNumber); + + for (var i = 0; i < 18; i += 1) { + var mod = !test && ((bits >> i) & 1) == 1; + _modules[Math.floor(i / 3)][(i % 3) + _moduleCount - 8 - 3] = mod; + } + + for (var i = 0; i < 18; i += 1) { + var mod = !test && ((bits >> i) & 1) == 1; + _modules[(i % 3) + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod; + } + }; + var setupTypeInfo = function(test, maskPattern) { var data = (_errorCorrectionLevel << 3) | maskPattern; var bits = QRUtil.getBCHTypeInfo(data); @@ -352,8 +366,28 @@ var qrcode = (function() { return createBytes(buffer, rsBlocks); }; - _this.addData = function(data) { - var newData = qr8BitByte(data); + _this.addData = function(data, mode) { + mode = mode || 'Byte'; + + var newData = null; + + switch (mode) { + case 'Numeric': + newData = qrNumber(data); + break; + case 'Alphanumeric': + newData = qrAlphaNum(data); + break; + case 'Byte': + newData = qr8BitByte(data); + break; + case 'Kanji': + newData = qrKanji(data); + break; + default: + throw 'mode:' + mode; + } + _dataList.push(newData); _dataCache = null; }; @@ -370,9 +404,80 @@ var qrcode = (function() { }; _this.make = function() { + if (_typeNumber < 1) { + var typeNumber = 1; + + for (; typeNumber < 40; typeNumber++) { + var rsBlocks = QRRSBlock.getRSBlocks( + typeNumber, + _errorCorrectionLevel + ); + var buffer = qrBitBuffer(); + + for (var i = 0; i < _dataList.length; i++) { + var data = _dataList[i]; + buffer.put(data.getMode(), 4); + buffer.put( + data.getLength(), + QRUtil.getLengthInBits(data.getMode(), typeNumber) + ); + data.write(buffer); + } + + var totalDataCount = 0; + for (var i = 0; i < rsBlocks.length; i++) { + totalDataCount += rsBlocks[i].dataCount; + } + + if (buffer.getLengthInBits() <= totalDataCount * 8) { + break; + } + } + + _typeNumber = typeNumber; + } + makeImpl(false, getBestMaskPattern()); }; + _this.createTableTag = function(cellSize, margin) { + cellSize = cellSize || 2; + margin = typeof margin == 'undefined' ? cellSize * 4 : margin; + + var qrHtml = ''; + + qrHtml += '
'; + } + + qrHtml += ' |