mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Merge pull request #1259 from talon/feat/double-tap-to-like
add doubletap to like
This commit is contained in:
commit
8dbe44d9fc
6 changed files with 196 additions and 35 deletions
174
package-lock.json
generated
174
package-lock.json
generated
|
@ -1709,6 +1709,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": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
|
||||
|
@ -3305,6 +3320,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",
|
||||
|
@ -3902,7 +3922,8 @@
|
|||
},
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.2.0",
|
||||
|
@ -3920,11 +3941,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"
|
||||
|
@ -3937,15 +3960,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",
|
||||
|
@ -4048,7 +4074,8 @@
|
|||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
|
@ -4058,6 +4085,7 @@
|
|||
"is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
|
@ -4070,17 +4098,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"
|
||||
|
@ -4097,6 +4128,7 @@
|
|||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
|
@ -4169,7 +4201,8 @@
|
|||
},
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
|
@ -4179,6 +4212,7 @@
|
|||
"once": {
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
|
@ -4254,7 +4288,8 @@
|
|||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"bundled": true
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
|
@ -4284,6 +4319,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",
|
||||
|
@ -4301,6 +4337,7 @@
|
|||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
|
@ -4339,11 +4376,13 @@
|
|||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.3",
|
||||
"bundled": true
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -4543,6 +4582,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",
|
||||
|
@ -5718,6 +5762,14 @@
|
|||
"yallist": "^3.0.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": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
|
||||
|
@ -7956,6 +8008,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",
|
||||
|
@ -9466,6 +9602,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": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
|
||||
|
@ -9552,6 +9693,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",
|
||||
|
|
|
@ -45,7 +45,8 @@
|
|||
"vue-content-loader": "^0.2.1",
|
||||
"vue-infinite-loading": "^2.4.4",
|
||||
"vue-loading-overlay": "^3.2.0",
|
||||
"vue-timeago": "^5.1.2"
|
||||
"vue-timeago": "^5.1.2",
|
||||
"vue-touch": "^2.0.0-beta.4"
|
||||
},
|
||||
"collective": {
|
||||
"type": "opencollective",
|
||||
|
|
12
resources/assets/js/components.js
vendored
12
resources/assets/js/components.js
vendored
|
@ -3,6 +3,7 @@ import BootstrapVue from 'bootstrap-vue'
|
|||
import InfiniteLoading from 'vue-infinite-loading';
|
||||
import Loading from 'vue-loading-overlay';
|
||||
import VueTimeago from 'vue-timeago';
|
||||
import VueTouch from 'vue-touch';
|
||||
//import {Howl, Howler} from 'howler';
|
||||
|
||||
Vue.use(BootstrapVue);
|
||||
|
@ -11,9 +12,16 @@ Vue.use(Loading);
|
|||
Vue.use(VueTimeago, {
|
||||
name: 'Timeago',
|
||||
locale: 'en'
|
||||
});
|
||||
);
|
||||
|
||||
pixelfed.readmore = function() {
|
||||
Vue.use(VueTouch, { name: 'v-touch' })
|
||||
VueTouch.registerCustomEvent('doubletap', {
|
||||
type: 'tap',
|
||||
taps: 2
|
||||
})
|
||||
|
||||
|
||||
pixelfed.readmore = () => {
|
||||
$('.read-more').each(function(k,v) {
|
||||
let el = $(this);
|
||||
let attr = el.attr('data-readmore');
|
||||
|
|
|
@ -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">
|
||||
<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) {
|
||||
|
|
|
@ -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();
|
||||
},
|
||||
|
||||
|
|
|
@ -87,7 +87,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>
|
||||
|
@ -377,8 +377,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</b-modal> -->
|
||||
<b-modal
|
||||
id="lightbox"
|
||||
<b-modal
|
||||
id="lightbox"
|
||||
ref="lightboxModal"
|
||||
hide-header
|
||||
hide-footer
|
||||
|
@ -750,7 +750,7 @@
|
|||
if(window.confirm('Are you sure you want to delete this post?') == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
axios.post('/i/delete', {
|
||||
type: 'status',
|
||||
item: status.id
|
||||
|
|
Loading…
Reference in a new issue