Image preview fixes

This commit is contained in:
Mr. Stallion 2020-05-24 17:07:58 -05:00
parent b602f81940
commit adacce1e7a
4 changed files with 19 additions and 5 deletions

View File

@ -133,7 +133,8 @@ export class ImageDomMutator {
this.add('default', this.getBaseJsMutatorScript(['.content video', '.content img', '#video, video', '#image, img']));
this.add('e621.net', this.getBaseJsMutatorScript(['video', '#image']));
this.add('e-hentai.org', this.getBaseJsMutatorScript(['video', '#img']));
this.add('gelbooru.com', this.getBaseJsMutatorScript(['video', '#image']));
this.add('gelbooru.com', this.getBaseJsMutatorScript(['.post-view video', '#image']));
this.add('gyazo.com', this.getBaseJsMutatorScript(['.image-view video', '.image-view img']));
this.add('chan.sankakucomplex.com', this.getBaseJsMutatorScript(['video', '#image']));
this.add('danbooru.donmai.us', this.getBaseJsMutatorScript(['video', '#image']));
this.add('gfycat.com', this.getBaseJsMutatorScript(['video']) /*, undefined, 'dom-ready' */);
@ -156,6 +157,7 @@ export class ImageDomMutator {
this.add('sexbot.gallery', this.getBaseJsMutatorScript(['video.hero', 'video']));
this.add('imagefap.com', this.getBaseJsMutatorScript(['.image-wrapper img', 'video', 'img']));
this.add('myhentaicomics.com', this.getBaseJsMutatorScript(['#entire_image img', 'video', 'img']));
this.add('gifmixxx.com', this.getBaseJsMutatorScript(['.gif.fit', '.gif', 'video', 'img']));
this.add(
'pornhub.com',
@ -226,7 +228,7 @@ export class ImageDomMutator {
}
getBaseJsMutatorScript(elSelector: string[], skipElementRemove: boolean = false, safeTags: string[] = []): string {
protected getBaseJsMutatorScript(elSelector: string[], skipElementRemove: boolean = false, safeTags: string[] = []): string {
const js = this.scripts.processor; // ./assets/browser.processor.raw.js
const settings = {
@ -238,7 +240,7 @@ export class ImageDomMutator {
const settingsJson = JSON.stringify(settings, null, 0);
return js.replace(/\/\* ## SETTINGS_START[^]*SETTINGS_END ## \*\//m, `this.settings = ${settingsJson}`);
return js.replace(/\/\* ## SETTINGS_START[^]*SETTINGS_END ## \*\//m, `this.settings = ${settingsJson};`);
}

View File

@ -71,6 +71,15 @@
[url=https://xbooru.com/index.php?page=post&s=view&id=775278]XBooru[/url]
[url=https://gifmixxx.com/QYwf]Gifmixxx[/url]
[url=https://vimeo.com/265884960]Vimeo[/url]
[url=https://gyazo.com/095a0160cccb1e2020e9a7dfb59586a7]Gyazo[/url]
[url=https://gelbooru.com/index.php?page=post&s=view&id=4570202]Gelbooru[/url]
Broken

View File

@ -194,6 +194,7 @@ export default class Connection implements Interfaces.Connection {
//tslint:enable
private async getTicket(password: string): Promise<string> {
console.log('GET TICKET GET TICKET GET TICKET GET TICKET');
const data = <{ticket?: string, error: string}>(await Axios.post('https://www.f-list.net/json/getApiTicket.php', qs.stringify(
{account: this.account, password, no_friends: true, no_bookmarks: true, no_characters: true}))).data;
if(data.ticket !== undefined) return data.ticket;
@ -215,4 +216,4 @@ export default class Connection implements Interfaces.Connection {
if(this.pinTimeout) clearTimeout(this.pinTimeout);
this.pinTimeout = setTimeout(() => this.socket!.close(), 90000);
}
}
}

View File

@ -53,6 +53,8 @@ if(process.env.NODE_ENV === 'production')
declare const chatSettings: {account: string, theme: string, characters: ReadonlyArray<SimpleCharacter>, defaultCharacter: number | null};
const ticketProvider = async() => {
// console.log('PROVIDER GET TICKET GET TICKET GET TICKET');
const data = (await Axios.post<{ticket?: string, error: string}>(
'/json/getApiTicket.php?no_friends=true&no_bookmarks=true&no_characters=true')).data;
if(data.ticket !== undefined) return data.ticket;
@ -74,4 +76,4 @@ require(`../scss/themes/chat/${chatSettings.theme}.scss`);
new Chat({ //tslint:disable-line:no-unused-expression
el: '#app',
propsData: {ownCharacters: chatSettings.characters, defaultCharacter: chatSettings.defaultCharacter, version}
});
});