add doubletap to like

This commit is contained in:
talon 2019-05-03 15:11:29 -04:00
parent da683569ae
commit 8645387657
6 changed files with 192 additions and 33 deletions

174
package-lock.json generated
View file

@ -1625,6 +1625,21 @@
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
"integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8="
},
"browser-resolve": {
"version": "1.11.3",
"resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz",
"integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==",
"requires": {
"resolve": "1.1.7"
},
"dependencies": {
"resolve": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
"integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs="
}
}
},
"browserify-aes": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
@ -3317,6 +3332,11 @@
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
"integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM="
},
"estree-walker": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.2.1.tgz",
"integrity": "sha1-va/oCVOD2EFNXcLs9MkXO225QS4="
},
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
@ -3914,7 +3934,8 @@
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true
"bundled": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -3932,11 +3953,13 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true
"bundled": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -3949,15 +3972,18 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true
"bundled": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true
"bundled": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true
"bundled": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -4060,7 +4086,8 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true
"bundled": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -4070,6 +4097,7 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -4082,17 +4110,20 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true
"bundled": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -4109,6 +4140,7 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -4181,7 +4213,8 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true
"bundled": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -4191,6 +4224,7 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -4266,7 +4300,8 @@
},
"safe-buffer": {
"version": "5.1.2",
"bundled": true
"bundled": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -4296,6 +4331,7 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -4313,6 +4349,7 @@
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -4351,11 +4388,13 @@
},
"wrappy": {
"version": "1.0.2",
"bundled": true
"bundled": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true
"bundled": true,
"optional": true
}
}
},
@ -4557,6 +4596,11 @@
"resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz",
"integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE="
},
"hammerjs": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz",
"integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE="
},
"handle-thing": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.0.tgz",
@ -5745,6 +5789,14 @@
"yallist": "^2.1.2"
}
},
"magic-string": {
"version": "0.16.0",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.16.0.tgz",
"integrity": "sha1-lw67DacZMwEoX7GqZQ85vdgetFo=",
"requires": {
"vlq": "^0.2.1"
}
},
"make-dir": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
@ -8021,6 +8073,90 @@
"inherits": "^2.0.1"
}
},
"rollup-plugin-cleanup": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/rollup-plugin-cleanup/-/rollup-plugin-cleanup-0.1.4.tgz",
"integrity": "sha1-n+06tDAJiKiC1j3jMh5BDNr8YzE=",
"requires": {
"acorn": "^3.3.0",
"magic-string": "^0.16.0",
"rollup-pluginutils": "^1.5.2"
},
"dependencies": {
"acorn": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz",
"integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo="
}
}
},
"rollup-plugin-commonjs": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-7.1.0.tgz",
"integrity": "sha1-w6dywuSl+hNQf1xXi2bME7DLink=",
"requires": {
"acorn": "^4.0.1",
"estree-walker": "^0.3.0",
"magic-string": "^0.19.0",
"resolve": "^1.1.7",
"rollup-pluginutils": "^2.0.1"
},
"dependencies": {
"acorn": {
"version": "4.0.13",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz",
"integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c="
},
"estree-walker": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz",
"integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao="
},
"magic-string": {
"version": "0.19.1",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.19.1.tgz",
"integrity": "sha1-FNdoATyvLsj96hakmvgvw3fnUgE=",
"requires": {
"vlq": "^0.2.1"
}
},
"rollup-pluginutils": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.6.0.tgz",
"integrity": "sha512-aGQwspEF8oPKvg37u3p7h0cYNwmJR1sCBMZGZ5b9qy8HGtETknqjzcxrDRrcAnJNXN18lBH4Q9vZYth/p4n8jQ==",
"requires": {
"estree-walker": "^0.6.0",
"micromatch": "^3.1.10"
},
"dependencies": {
"estree-walker": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz",
"integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw=="
}
}
}
}
},
"rollup-plugin-node-resolve": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz",
"integrity": "sha1-y7eDsNFbAnlNWJFTULLw2QK43cg=",
"requires": {
"browser-resolve": "^1.11.0",
"builtin-modules": "^1.1.0",
"resolve": "^1.1.6"
}
},
"rollup-pluginutils": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz",
"integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=",
"requires": {
"estree-walker": "^0.2.1",
"minimatch": "^3.0.2"
}
},
"run-async": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
@ -9532,6 +9668,11 @@
"extsprintf": "^1.2.0"
}
},
"vlq": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz",
"integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow=="
},
"vm-browserify": {
"version": "0.0.4",
"resolved": "http://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
@ -9618,6 +9759,17 @@
"date-fns": "^1.29.0"
}
},
"vue-touch": {
"version": "2.0.0-beta.4",
"resolved": "https://registry.npmjs.org/vue-touch/-/vue-touch-2.0.0-beta.4.tgz",
"integrity": "sha1-Alml+/if7RLV5deJ//uZuHSuBQE=",
"requires": {
"hammerjs": "^2.0.8",
"rollup-plugin-cleanup": "^0.1.4",
"rollup-plugin-commonjs": "^7.0.0",
"rollup-plugin-node-resolve": "^2.0.0"
}
},
"watchpack": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz",

View file

@ -45,7 +45,8 @@
"vue-content-loader": "^0.2.1",
"vue-infinite-loading": "^2.4.3",
"vue-loading-overlay": "^3.1.1",
"vue-timeago": "^5.0.0"
"vue-timeago": "^5.0.0",
"vue-touch": "^2.0.0-beta.4"
},
"collective": {
"type": "opencollective",

View file

@ -7,6 +7,12 @@ window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
require('readmore-js');
Vue.use(require("vue-touch"), {name: "v-touch"})
VueTouch.registerCustomEvent('doubletap', {
type: 'tap',
taps: 2
})
let token = document.head.querySelector('meta[name="csrf-token"]');
if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;

View file

@ -212,7 +212,7 @@
<div v-if="profileLayout == 'moment'" class="momentui">
<div class="bg-dark mt-md-n4">
<div class="container">
<div class="container", v-on:doubletap="likeStatus(status, $event)">
<div class="postPresenterContainer d-none d-flex justify-content-center align-items-center bg-dark">
<div v-if="status.pf_type === 'photo'" class="w-100">
<photo-presenter :status="status" v-on:lightbox="lightbox"></photo-presenter>
@ -345,8 +345,8 @@
</infinite-loading>
</div>
</b-modal>
<b-modal
id="lightbox"
<b-modal
id="lightbox"
ref="lightboxModal"
:hide-header="true"
:hide-footer="true"
@ -437,11 +437,11 @@ pixelfed.postComponent = {};
export default {
props: [
'status-id',
'status-username',
'status-template',
'status-url',
'status-profile-url',
'status-id',
'status-username',
'status-template',
'status-url',
'status-profile-url',
'status-avatar',
'status-profile-id',
'profile-layout'
@ -732,7 +732,7 @@ export default {
postReply() {
let self = this;
if(this.replyText.length == 0 ||
if(this.replyText.length == 0 ||
this.replyText.trim() == '@'+this.status.account.acct) {
self.replyText = null;
$('textarea[name="comment"]').blur();
@ -769,7 +769,7 @@ export default {
l(e) {
let len = e.length;
if(len < 10) { return e; }
if(len < 10) { return e; }
return e.substr(0, 10)+'...';
},
@ -842,7 +842,7 @@ export default {
if($('body').hasClass('loggedIn') == false) {
return;
}
axios.post('/i/like', {
item: status.id
}).then(res => {
@ -900,7 +900,7 @@ export default {
this.replyText += em;
$('textarea[name="comment"]').focus();
}
},
},
toggleCommentVisibility() {
if(this.ownerOrAdmin() == false) {

View file

@ -23,7 +23,7 @@
</div>
<div class="col-7 pl-2">
<p class="align-middle">
<span class="font-weight-ultralight h3 mb-0">{{profile.username}}</span>
<span class="float-right mb-0" v-if="!loading && profile.id != user.id && user.hasOwnProperty('id')">
<a class="fas fa-cog fa-lg text-muted text-decoration-none" href="#" @click.prevent="visitorMenu"></a>
@ -57,7 +57,7 @@
</span>
<span class="pl-4">
<a :href="'/users/'+profile.username+'.atom'" class="fas fa-rss fa-lg text-muted text-decoration-none"></a>
</span>
</span>
<span class="pl-4" v-if="owner && user.hasOwnProperty('id')">
<a class="fas fa-cog fa-lg text-muted text-decoration-none" href="/settings/home"></a>
</span>
@ -212,7 +212,7 @@
</div>
</div>
<div class="postPresenterContainer">
<div class="postPresenterContainer" v-on:doubletap="likeStatus(status, $event)">
<div v-if="status.pf_type === 'photo'" class="w-100">
<photo-presenter :status="status"></photo-presenter>
</div>
@ -312,7 +312,7 @@
<div class="col-4 text-right mt-2">
<span class="d-none d-md-inline-block pl-4">
<a :href="'/users/'+profile.username+'.atom'" class="fas fa-rss fa-lg text-muted text-decoration-none"></a>
</span>
</span>
<span class="pl-md-4 pl-sm-2" v-if="owner">
<a class="fas fa-cog fa-lg text-muted text-decoration-none" href="/settings/home"></a>
</span>
@ -983,7 +983,7 @@ export default {
if(res.data.length < 10) {
this.followerMore = false;
}
})
})
this.$refs.followerModal.show();
},

View file

@ -57,7 +57,7 @@
</div>
</div>
<div class="postPresenterContainer">
<div class="postPresenterContainer" v-on:doubletap="likeStatus(status, $event)">
<div v-if="status.pf_type === 'photo'" class="w-100">
<photo-presenter :status="status" v-on:lightbox="lightbox"></photo-presenter>
</div>
@ -327,8 +327,8 @@
</div>
</div>
</b-modal> -->
<b-modal
id="lightbox"
<b-modal
id="lightbox"
ref="lightboxModal"
hide-header
hide-footer
@ -660,7 +660,7 @@
if(window.confirm('Are you sure you want to delete this post?') == false) {
return;
}
axios.post('/i/delete', {
type: 'status',
item: status.id