WF scientists overview easy export button

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

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 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)
	})
})