第1期叡王戦本選/電王戦 棋譜ビューア

by mizarjp

HTML

<script src="https://cdn.rawgit.com/zenorocha/clipboard.js/v1.5.8/dist/clipboard.min.js"></script>
<script src="https://cdn.rawgit.com/na2hiro/Kifu-for-JS/master/out/kifuforjs.js"></script>
<link rel="stylesheet" href="https://cdn.rawgit.com/na2hiro/Kifu-for-JS/master/css/kifuforjs.css">
<p><select id="kifsel"></select> <button type="button" id="reload">Reload</button> <span><input type="checkbox" id="autotail" checked="checked">AutoTail</span> <button type="button" id="copybtn">Copy to Clipboard (KIF)</button></p>
<div id="kifuplay"></div>
<pre id="export"></pre>
<footer><p><a href="http://www.eiou.jp/">www.eiou.jp</a> | <a href="http://denou.jp/2016/">denou.jp/2016</a></p></footer>

JavaScript

(function(){
var Kifu = require("Kifu");
Kifu.settings = {ImageDirectoryPath: "https://cdn.rawgit.com/na2hiro/Kifu-for-JS/master/images"};
var reqprefix = 'https://s3-ap-northeast-1.amazonaws.com/prod-kifu-cache-strage-tokyo/caches/', reqsuffix = '.json';
var reqid = 'denou1-2';
var kplay = 'kifuplay', kpj = '#' + kplay;
var kiflist = [
  {ref:'20151017-1', id:'5613502102da7603009e657b'},
  {ref:'20151017-2', id:'5613502202da7603009e657c'},
  {ref:'20151024-1', id:'561dc4bb6abcd703001318dc'},
  {ref:'20151024-2', id:'561dc4bc6abcd703001318dd'},
  {ref:'20151027-1', id:'5624590dc725f803006863d5'},
  {ref:'20151027-2', id:'5624590ec725f803006863d6'},
  {ref:'20151031-1', id:'5624591dc725f80300686412'},
  {ref:'20151031-2', id:'5624591ec725f80300686474'},
  {ref:'20151104-1', id:'563309ff8eada903007c5c55'},
  {ref:'20151107-1', id:'5634bc81a7c2c303000e99b9'},
  {ref:'20151111-1', id:'5639a554887ea703009a6126'},
  {ref:'20151111-2', id:'5639a553887ea703009a6125'},
  {ref:'20151117-1', id:'563ffcdc2deef0030057863f'},
  {ref:'20151118-1', id:'5643e39d17faa20300532ad6'},
  {ref:'20151206-1', id:'565b9ec97eda97030006ca13'},
  {ref:'20151213-1', id:'5660f5994676c60300270738'},
  {ref:'denou1-1', id:'56f9e9f6813cd7030042378d'},
  {ref:'denou1-2', id:'571ebfce6db2bd03003c457c'}];
  
function countLength(str){
  var r = 0, i, c;
  str = "" + str;
  for(i = 0; i < str.length; i++){
    c = str.charCodeAt(i);
    r += ((c >= 0x0 && c < 0x81) || (c == 0xf8f0) || (c >= 0xff61 && c < 0xffa0) || (c >= 0xf8f1 && c < 0xf8f4)) ? 1 : 2;
  }
  return r;
}
function alignLeft(str, len){
  str = "" + str;
  while(countLength(str) < len){
    str += " ";
  }
  return str;
}
function alignRight(str, len){
  str = "" + str;
  while(countLength(str) < len){
    str = " " + str;
  }
  return str;
}
function zeroPad(str, len){
  str = "" + str;
  while(countLength(str) < len){
    str = "0" + str;
  }
  return str;
}
function localetime(epoch){
  var date = new Date(epoch);
  return [
   ...