User:Edgars2007/script.js

var maincats, tennis, cycling,football; var WDid = 'Q123'; var athl_name = mw.config.get( 'wgTitle' );

function generateLink { var arr = []; $('.myclass').each(function {	var fieldValue = $(this).val;	if(fieldValue) {		var fieldName = $(this).attr('name');		arr.push( WDid + '\t' + fieldName + '\t"' + fieldValue + '"' );	} });

console.log('massiivs no inputiem ', arr); var stringForLink = arr.join("\n"); var finalURL = "Atvērt" //console.log(finalURL); $('p#foobarlorem').html(finalURL); }

tennis=[ ["ATP","atpworldtour.com","536"], ["WTA","wtatennis.com","597"], ["ITF","itftennis.com","599"] ];

cycling = [ ["Cycling Archives","cyclingarchives.com","1409"], ["Cycling Quotient (men)","cqranking.com","1541"], ["Cycling Quotient (women)","cqranking.com","2709"], ["ProCyclingStats","procyclingstats.com","1663"] ];

football = [ ["FIFA","fifa.com","1469"], ["UEFA","uefa.com","2276"], ["Soccerbase","soccerbase.com","2193"], ["Soccerway","soccerway.com","2369"], ["NFT","national-football-teams.com","2574"], ["Transfermarkt","transfermarkt.com","2446"] ];

maincats = [ ["Athletics","iaaf.org","1146"], ["Boxing","boxrec.com","1967"], ["Rowing","worldrowing.com","2091"], ["Fencing","fie.org","2423"], ["Table tennis","","1364"], ["Swimming","swimrankings.net","2640"], ["Gymnastics","database.fig-gymnastics.com","2696"], ["Modern pentathlon","uipmworld.org","2726"], ["Wrestling","iat.uni-leipzig.de","2727"], ["Triatlon","iat.uni-leipzig.de","2778"], ["Weightlifting","iat.uni-leipzig.de","2779"], ["Diving","iat.uni-leipzig.de","2780"], ["Badminton","bwfcontent.tournamentsoftware.com","2729"], ["ISSF","issf-sports.org","2730"], ["Sailing","sailing.org","2804"], ["Judo","judoinside.com","2767"], ["Beach Volleyball","bvbinfo.com","2800"], ["FIVB","fivb.org","2801"] ]; /* =========================================== Tennis =========================================== */ var lenTen = tennis.length;

var tennisT = "Tennis '; /* =========================================== Cycling =========================================== */ var lenCyc = cycling.length;

var cyclingT = "Cycling '; /* =========================================== Football =========================================== */ var lenFoot = football.length;

var footballT = "Football '; /* =========================================== Main =========================================== */ var lenMain = maincats.length;

var maincatsT = "Main ';

var text2 = ' Ģenerēt QuickStatements ';

$( function( $ ){ function addAliasesFromRedirects{   mw.util.addCSS(".YRRedirectsToAdd{float: left; white-space: nowrap; border: 1px soslid #AAA; border-radius: 3px; cursor: pointer; background-color: #FFF; padding: 2px 5px; margin: 2px; }.YRRedirectsToAdd:hover{ background-color: #F0F6FF; box-shadow: 0 0 5px #CCC inset; }.YRRedirectsToAdd.selected{ border-color:#0CC; background-color: #DFF; }")

mw.loader.using( ['jquery.ui'], function {    var $dialog = $(" ").text( 'df' ).dialog({ title: 'Add external IDs to athlete', autoOpen: true, width: 450, //height: 500, });        $dialog            //.text( 'messages.dialogintro' )            //.append($(" "))            .append(tennisT)            .append(cyclingT)            .append(footballT)            .append(maincatsT)            .append(text2)

}) }  $( mw.util.addPortletLink( 'p-cactions', '#', 'Rio IDs', null, 'messages.FRTooltip' ) ).on( "click", addAliasesFromRedirects ); })