User:Sarvagrawal/common.js

function useraction{ var url_wiki=window.location.href; var list_words=url_wiki.split('/'); // var text1="https://wikihack.onrender.com/summary/"; var text1="http://127.0.0.1:8000/summary/" var result = text1.concat(list_words[list_words.length - 1]); $.ajax({               url : result,                headers:{                	'Access-Control-Allow-Credentials' : true,				    'Access-Control-Allow-Origin':'*',				    'Access-Control-Allow-Methods':'GET',                	},                type : 'GET',                dataType : 'json',                success : function (data)                {                    alert(data.summary);                }            }); }

function useraction_sim_articles{ var url_wiki=window.location.href; var list_words=url_wiki.split('/'); var text1="http://127.0.0.1:8000/summary_similar_content/"; var result = text1.concat(list_words[list_words.length - 1]); $.ajax({               url : result,                headers:{                	'Access-Control-Allow-Credentials' : true,				    'Access-Control-Allow-Origin':'*',				    'Access-Control-Allow-Methods':'GET',                	},                type : 'GET',                dataType : 'json',                success : function (data)                {                    alert( data.relevant_ids[0].url, data.relevant_ids[1].url );               }            }); }

// function UserAction { // var url_wiki=window.location.href; // var list_words=url_wiki.split('\\'); //    var text1="https://wikihack.onrender.com/summary/"; //    let result = text1.concat(list_words[list_words.length - 1]);

//    const response = await fetch(result); //    var data = await response.json; //    show(data); // }

// $('.btn_summary').click(function{ // 	$(".user-links-collapsible-item mw-list-item").append($('.btn_summary')); // }); // $(document).ready(function {	// $('.btn_summary').click(function{ // $(".user-links-collapsible-item mw-list-item").append($('.btn_summary')); // }); $('#p-associated-pages').append($('')); $('#p-associated-pages').append($('')); // }); //$('button'), { //      text: 'Summary', //set text 1 to 10 //     class: 'btn_summary', //    click: function  { alert('hi'); } // }); //$(' ', { //      text: 'Summary', //set text 1 to 10 //      class: 'btn_summary', //      click: function  { alert('hi'); } //  });