diff --git a/.gitignore b/.gitignore index bc9103de55..faf3925230 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ npm-debug.log test/unit/coverage test/e2e/reports selenium-debug.log +.idea/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1d3cba051d..296d6839c9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,15 +27,27 @@ before_script: # paths: # - node_modules/ +stages: + - lint + - build + - test + - deploy + +lint: + stage: lint + script: + - yarn + - npm run lint + test: + stage: test script: - - npm install -g yarn - yarn - npm run unit build: + stage: build script: - - npm install -g yarn - yarn - npm run build artifacts: @@ -43,11 +55,11 @@ build: - dist/ deploy: + stage: deploy environment: dev only: - develop script: - - npm install -g yarn - yarn - npm run build - scp -r dist/* pleroma@tenshi.heldscal.la:~/pleroma diff --git a/package.json b/package.json index e7aa724133..74706389af 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "babel-plugin-lodash": "^3.2.11", "diff": "^3.0.1", "karma-mocha-reporter": "^2.2.1", - "lz-string": "^1.4.4", + "localforage": "^1.5.0", "node-sass": "^3.10.1", "object-path": "^0.11.3", "sanitize-html": "^1.13.0", diff --git a/src/App.scss b/src/App.scss index 0945c76b72..8a1942c63a 100644 --- a/src/App.scss +++ b/src/App.scss @@ -109,8 +109,8 @@ main-router { .panel-heading { border-radius: 10px 10px 0 0; background-size: cover; - padding: 0.6em 0; - text-align: center; + padding: 0.6em 1.0em; + text-align: left; font-size: 1.3em; line-height: 24px; } diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index f4f6aebfdc..7715add58a 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -11,7 +11,9 @@ const Attachment = { return { nsfwImage, hideNsfwLocal: this.$store.state.config.hideNsfw, - showHidden: false + showHidden: false, + loading: false, + img: document.createElement('img') } }, computed: { @@ -20,6 +22,13 @@ const Attachment = { }, hidden () { return this.nsfw && this.hideNsfwLocal && !this.showHidden + }, + autoHeight () { + if (this.type === 'image' && this.nsfw) { + return { + 'min-height': '311px' + } + } } }, methods: { @@ -29,7 +38,16 @@ const Attachment = { } }, toggleHidden () { - this.showHidden = !this.showHidden + if (this.img.onload) { + this.img.onload() + } else { + this.loading = true + this.img.src = this.attachment.url + this.img.onload = () => { + this.loading = false + this.showHidden = !this.showHidden + } + } } } } diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index ad60acf9bd..8f51b89143 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -1,15 +1,14 @@