Title: Generate random image of a dog in your post
Description: You will be able to click an image of a dog and generate a random image of a dog in your post (updates your unpublished post). This is a fun way to play around.
Version: All versions.
Preview:
1. Go to AP > Modules > Javascript codes management > Enable javascript and then create new javascript.
Name script: Random dog image generator
Placement: In the topics.
Add this code:
Save. Check how it works.
Note: In AwesomeBB version, it works only for quick reply.
Description: You will be able to click an image of a dog and generate a random image of a dog in your post (updates your unpublished post). This is a fun way to play around.
Version: All versions.
Preview:
1. Go to AP > Modules > Javascript codes management > Enable javascript and then create new javascript.
Name script: Random dog image generator
Placement: In the topics.
Add this code:
- Code:
function callImage() {
// Random images generated thanks to free API: https://github.com/jigsawpieces/dog-api-images
$.ajax({
url: 'https://dog.ceo/api/breeds/image/random',
type: 'GET',
dataType: 'json',
success: function(data) {
$('#text_editor_textarea').sceditor("instance").insertText('\n[img]' + data.message + '[/img]');
},
error: function(error) {
console.error('Error fetching JSON:', error);
}
});
}
$(document).ready(function() {
$(function() {
$('<img src="https://i.ibb.co/Wv5Jjb8/3316536-animal-cachorro-dog-dogs-icon-1.png" />').insertAfter('.sceditor-group:last').on("click", function() {
callImage();
});
});
});
Save. Check how it works.
Note: In AwesomeBB version, it works only for quick reply.