ODTDropbox

ODT++: transform xml outputs on Linked Data.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name           ODTDropbox 
// @author         Iker Azpeitia
// @version        1.3.1
// @namespace      odt++
// @description	   ODT++: transform xml outputs on Linked Data.
// @include        http://developer.yahoo.com/yql/console/*
// @include        https://developer.yahoo.com/yql/console/*
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_xmlhttpRequest
// ==/UserScript==  


window.addEventListener("load",mod,true);

function mod(){
 if(document.body.parentNode.className){
   if(window==window.top){
 	   start();
	 }
  }     
}


function start2(){
 var but=document.getElementById("submitMeButton");
 but.addEventListener("click",onClickButton,true);
 var textarea=document.getElementById("qid");
 textarea.addEventListener("keydown",function(ev){if(ev.keyCode==13){onClickButton(ev);}},true);
}

function start(){
 var but=document.getElementById("submitMeButton");
 but.addEventListener("click",onClickButton,true);
 var textarea=document.getElementById("qid");
 textarea.addEventListener("keydown",function(ev){if(ev.keyCode==13){onClickButton(ev);}},true);
}

function onClickButton(ev){
var textarea2=document.getElementById("qid").value;
var textarea=textarea2.toLowerCase();
    alert (textarea2);
textarea=textarea.replace(/(\ )*\n+(\ )*/g," ");
textarea=textarea.replace(/\s+/g, ' ');
    if(textarea.indexOf('http')==0){
    ev.stopImmediatePropagation();
    ev.preventDefault();
    ev.stopPropagation();  
    call(textarea);
 }
}

function call(uri){
  GM_xmlhttpRequest({
  method: "GET",
  url: uri,
  onload: function(response) {
      var parser=new DOMParser();
      parser=parser;
      var txt= response.responseText; 
      txt=txt.replace(/</g, "\n<span class=\'re1\'><<span>");
        document.getElementById("viewContent").innerHTML=txt;
  }
 });
 return 0;
}


function urlify(text) {
    var urlRegex = /(https?:\/\/[^\s]+)/g;
     return text.replace(urlRegex, '<a href="$1">$1</a>')
}