WF scientists overview easy export button

Adds a button onto the scientists overview to easily allow scientists export to sheets, excel, etc

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name        WF scientists overview easy export button
// @namespace   http://www.war-facts.com/
// @include		http://www.war-facts.com/overview.php?view=13
// @description Adds a button onto the scientists overview to easily allow scientists export to sheets, excel, etc
// @version     1
// @grant       none
// ==/UserScript==
$(document).ready(function () {
	console.log('Adding export button to scientists overview')
	$('#hiredTable').before('<button id="export-btn">Export</button>')
	
	$('#export-btn').on('click', function () {
		var table = document.getElementById("hiredTable");
		scienceString = "<div><pre>"
		for (var i = 1, row; row = table.rows[i]; i++) {   
		  if (i == table.rows.length -1)
			break;
		  
		  for (var j = 0, col; col = row.cells[j]; j++) {
			scienceString += col.innerText
			scienceString += "\t"
		  }
		  scienceString += "</pre><pre>"
		}
		scienceString += "</p></div>"
		window.open().document.write(scienceString)
	})
})