Doodletoo

Image search as a reference for doodletoo

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Advertisement:

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

Advertisement:

// ==UserScript==
// @name     Doodletoo
// @version  1
// @grant    none
// @match    http://www.doodletoo.com/*
// @author   TheOriginalBob
// @description Image search as a reference for doodletoo
// @namespace https://greasyfork.org/users/169540
// ==/UserScript==

var inputText = document.createElement('input');
inputText.id = 'searchInput';
inputText.setAttribute('type','text');
inputText.style.position = 'fixed';
inputText.style.zIndex = 1000;
inputText.style.top = '650px';
inputText.style.left = '10px';

document.getElementById('shadow').appendChild(inputText);

var imageResult = document.createElement('img');
imageResult.id = 'imageResult';
imageResult.style.position = 'fixed';
imageResult.style.zIndex = 1000;
imageResult.style.top = '400px';
imageResult.style.left = '10px';
imageResult.style.width = '400px';
imageResult.style.height = '250px';

document.getElementById('shadow').appendChild(imageResult);

imageResult.addEventListener('click',function(ele){
	imageResult.style.display = 'none';
});

inputText.addEventListener('keyup', function(ele){
	if (ele.keyCode == 13) {
    var xmlHttp = new XMLHttpRequest();
 	 	xmlHttp.open('GET', "https://api.qwant.com/api/search/images?count=1&offset=0&q=" + inputText.value,false);
  	xmlHttp.send();
  	var result = JSON.parse(xmlHttp.responseText);
    if (result.status == 'error') {
  		return alert('An Error Occured While Getting Image');
  	} else {
  		result = result.data.result.items[0].media;
  	}
    imageResult.setAttribute('src',result);
    imageResult.style.display = ''
  	inputText.value = null;
  }
});