Créer un compteSe connecter
Je pense m'y remettre, ça me dégourdira.
:pote_de_ADlaurent:

Peut-être pas tout aujourd'hui, mais le topic me servira d'inspiration.

Déjà, le plus simple:
Ctrl+Entrer pour poster un message
// ==UserScript==
// @name onche.org Ctrl+Enter Submit
// @namespace http://onche.org/
// @version 1.0
// @description Permet de soumettre un message sur un topic en appuyant sur CTRL+Entrer
// @author EvoIa
// @match onche.org https://onche.org/topic/*
// @match onche.org https://onche.org/forum/*
// @icon www.google.com https://www.google.com/s2[...]ns?sz=64&domain=onche.org
// @grant none
// ==/UserScript==

(function() {
'use strict';

// Dans la partie formulaire:
const postForm = document.querySelector('#post > form');
if (postForm) {
// Event binding: CTRL+Entrer
postForm.addEventListener('keydown', function(event) {
if (event.ctrlKey && event.key === 'Enter') {
event.preventDefault();
const submitButton = postForm.querySelector('input.button[type="submit"]');
if (submitButton) {
submitbutton.click(); // Simuler le clic sur le bouton "Envoyer"
}
}
});
}
})();
:jmlp-onche:
Cum My Fanatics
:pascal_nrv:
il y a 2 ans
EvoIa
EvoIa
2 ans
Je pense m'y remettre, ça me dégourdira.
:pote_de_ADlaurent:

Peut-être pas tout aujourd'hui, mais le topic me servira d'inspiration.

Déjà, le plus simple:
Ctrl+Entrer pour poster un message
// ==UserScript==
// @name onche.org Ctrl+Enter Submit
// @namespace http://onche.org/
// @version 1.0
// @description Permet de soumettre un message sur un topic en appuyant sur CTRL+Entrer
// @author EvoIa
// @match onche.org https://onche.org/topic/*
// @match onche.org https://onche.org/forum/*
// @icon www.google.com https://www.google.com/s2[...]ns?sz=64&domain=onche.org
// @grant none
// ==/UserScript==

(function() {
'use strict';

// Dans la partie formulaire:
const postForm = document.querySelector('#post > form');
if (postForm) {
// Event binding: CTRL+Entrer
postForm.addEventListener('keydown', function(event) {
if (event.ctrlKey && event.key === 'Enter') {
event.preventDefault();
const submitButton = postForm.querySelector('input.button[type="submit"]');
if (submitButton) {
submitbutton.click(); // Simuler le clic sur le bouton "Envoyer"
}
}
});
}
})();
Je sais pas, mais j'aime bien ta PP.
il y a 2 ans
Je sais pas, mais j'aime bien ta PP.
Ahh merci!

C'est d'Electric Wizard je crois bien!
:jmlp-onche:
Cum My Fanatics
:pascal_nrv:
il y a 2 ans
Pour les spammers qui se lâchent sur la création de topics: supprimer le topic en fonction du nom du forumer.
Il a peu servi
:OSS_funny4:

blacklist topics

// ==UserScript==
// @name BlackList topic
// @namespace http://tampermonkey.net/
// @version 2024-10-28
// @description try to take over the world!
// @author You
// @match onche.org https://onche.org/forum/*
// @icon www.google.com https://www.google.com/s2[...]ns?sz=64&domain=onche.org
// @grant none
// @run-at document-idle
// ==/UserScript==

(function() {
'use strict';

// Liste des login à blacklister
const usernames = [
'paa'
]

document.querySelectorAll('#forum .topic').forEach(e => {usernames.includes(e.querySelector('.topic-username')) && e.remove()})
})();


Voilà... Pour le prochain, je pensais à un système de glisser-déposer / coller d'images dans le message sans avoir à passer par un fichier à envoyer.

Ca prendra plus de temps
:SoralLunettes:
:jmlp-onche:
Cum My Fanatics
:pascal_nrv:
il y a 2 ans
Go TAB + espace pour envoyer c'est plus pratique
:obama:
il y a 2 ans
Go TAB + espace pour envoyer c'est plus pratique
:obama:
Bordelent t'as raison
:AAYYAAAA:
:jmlp-onche:
Cum My Fanatics
:pascal_nrv:
il y a 2 ans
EvoIa
EvoIa
2 ans
Bordelent t'as raison
:AAYYAAAA:
Après c'est bien quand même ce que t'as fait, les gens ont le choix comme ça
:obama:
il y a 2 ans
Voilà, finalement
avec un peu d'AIde
:bras:
c'était bien plus rapide que prévu.

Si vous copiez une image (le contenu, pas un fichier image hein
:OSS_funny4:
) dans le presse-papier.
Il suffit de faire Ctrl+V pour coller une balise [img:...] au bon endroit (au niveau du curseur)
userscript

// ==UserScript==
// @name onche.org Image Upload on Paste
// @namespace onche.org https://onche.org/
// @version 0.1
// @description Permet de coller ou de glisser-déposer une image dans la zone de saisie de texte
// @author EvoIa
// @match onche.org https://onche.org/topic/*
// @match onche.org https://onche.org/forum/*
// @icon www.google.com https://www.google.com/s2[...]ns?sz=64&domain=onche.org
// @grant none
// ==/UserScript==

(function() {
'use strict';

// Ajoute un event listener à la zone de saisie de texte
const textArea = document.querySelector('.textarea[name="message"]');
if (!textArea) return;

textArea.addEventListener('paste', handleImagePaste);

function handleImagePaste(event) {
const items = (event.clipboardData || event.originalEvent.clipboardData).items;
for (let i = 0; i < items.length; i++) {
if (items[i].kind === 'file') {
const file = items[i].getAsFile();
uploadImage(file);
}
}
}

function uploadImage(file) {
if (!file || !file.type.startsWith('image/')) return;

const formData = new FormData();
const token = document.querySelector('#topic').dataset.token;
formData.append('file', file);
formData.append('token', token);

fetch('onche.org https://onche.org/upload', {
method: 'POST',
body: formData,
headers: {
'accept': '*/*',
'origin': 'onche.org https://onche.org',
'referer': window.location.href
}
})
.then(response => response.json())
.then(data => {
if (data.status === 'done' && data.image) {
const imageCode = `[img:${data.image}]`;
insertTextAtCursor(textArea, imageCode);
}
})
.catch(error => console.error('Erreur lors du téléchargement de l\'image :', error));
}

function insertTextAtCursor(textArea, text) {
const start = textArea.selectionStart;
const end = textArea.selectionEnd;
textArea.value = textArea.value.substring(0, start) + text + textArea.value.substring(end);
textArea.selectionStart = textArea.selectionEnd = start + text.length;
}
})();

:jmlp-onche:
Cum My Fanatics
:pascal_nrv:
il y a 2 ans