Add readmore.js

pull/547/head
Daniel Supernault 2018-11-13 12:43:46 -07:00
rodzic 965fd12e22
commit 06a931c1cb
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
3 zmienionych plików z 26 dodań i 2 usunięć

11
package-lock.json wygenerowano
Wyświetl plik

@ -5482,8 +5482,7 @@
"jquery": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz",
"integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==",
"dev": true
"integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg=="
},
"js-base64": {
"version": "2.4.9",
@ -9431,6 +9430,14 @@
"readable-stream": "^2.0.2"
}
},
"readmore-js": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/readmore-js/-/readmore-js-2.2.1.tgz",
"integrity": "sha512-hbPP0nQpYYkAywCEZ8ozHivvhWyHic37KJ2IXrHES4qzjp0+nmw8R33MeyMAtXBZfXX4Es8cpd5JBVf9qj47+Q==",
"requires": {
"jquery": ">2.1.4"
}
},
"recast": {
"version": "0.11.23",
"resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz",

Wyświetl plik

@ -25,6 +25,7 @@
"infinite-scroll": "^3.0.4",
"laravel-echo": "^1.4.0",
"pusher-js": "^4.2.2",
"readmore-js": "^2.2.1",
"socket.io-client": "^2.1.1",
"sweetalert": "^2.1.0",
"twitter-text": "^2.0.5",

Wyświetl plik

@ -2,6 +2,22 @@ window.Vue = require('vue');
import BootstrapVue from 'bootstrap-vue'
Vue.use(BootstrapVue);
pixelfed.readmore = () => {
$(document).find('.read-more').each(function(k,v) {
let el = $(this);
let attr = el.attr('data-readmore');
if(typeof attr !== typeof undefined && attr !== false) {
return;
}
el.readmore({
collapsedHeight: 44,
heightMargin: 20,
moreLink: '<a href="#" class="font-weight-bold small">Read more</a>',
lessLink: '<a href="#" class="font-weight-bold small">Hide</a>',
});
});
};
window.InfiniteScroll = require('infinite-scroll');
window.filesize = require('filesize');
import swal from 'sweetalert';