marcfragstein
Forum Replies Created
-
I do something like :
console.log(“ANFRAGE SENDEN”);
var field_selector = “anfrage_closed”;
$(‘.tablesome__tbody tr td.tablesome__cell–text’).trigger(‘blur’);
$(‘.tablesome__tbody input’).trigger(‘blur’);
$(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().trigger(‘focus’); $(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().trigger(‘click’);
$(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().find(“input”).trigger(‘focus’); $(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().find(“input”).trigger(‘click’);
await sleep_anfrage(1);
var focused_field = $(“.tablesome__tbody tr td.tablesome__cell–text.tablesome__cell–edit”);
console.log(“focused_field” + focused_field.html())var focused_input = focused_field.find("input"); console.log("focused_input.html()" + focused_input.html()) if(focused_input.length) { console.log("FOUND A TEXT FIELD"); const textField = focused_input.get(0); textField.value = "yes";
// Fire a change event on the text field
textField.dispatchEvent(new Event(‘change’));
const simulatedInputEvent = new InputEvent(‘input’, {
data: ‘This is simulated user input’, // Text to be inserted
inputType: ‘insertText’ // Simulates typing new characters
});// Dispatch the simulated input event on the text field
textField.dispatchEvent(simulatedInputEvent);
}
So i have to blur fields, focus fields, simulate user inputs. Just putting in the .val() doesnt work. Is there a way to change that?Hey my friend, any news on this?
Hey Guys, found the solution myself. Somehow I had to change the regex in the function “print_video_thumb_first_post_image”. Below the code that works for me, in case somebody has a similar problem.
function print_video_thumb_first_post_image($post,&$thumb_url) {
$content = $post->post_content;
if (preg_match(‘#<\s*img [^\>]*src\s*=\s*([“\’])(.*?)\1#im’,$content, $match)) {
$thumb_url = $match[2];
return 1;
}
}