eorzea.js

    
      
  • /*
     * @title eorzea.js
     * @description welcome to league of eorzea.
     * @include http://*
     * @require http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.js
     * @require http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.1/src/i18n/grid.locale-en.js
     * @require http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.1/src/grid.base.js
     * @require http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.1/src/grid.common.js
     * @require http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.1/src/grid.formedit.js
     * @require http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.1/src/grid.inlinedit.js
     * @require http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.1/src/grid.custom.js
     * @require http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.1/src/jquery.fmatter.js
     * @require http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.1/src/jquery.searchFilter.js
     * @require http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.1/src/grid.jqueryui.js
     * @require https://raw.github.com/igax/eorzea/master/public/javascripts/character.js
     * @license Apache License Version 2.0
     */
    
    
    function loadCss(href) {
      var head = document.getElementsByTagName('head')[0];
      var link = document.createElement('link');
      link.rel = 'stylesheet';
      link.type = 'text/css';
      link.href = href;
    
      head.appendChild(link);
    }
    
    jQuery(document).ready(function() {
      loadCss('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/ui-darkness/jquery-ui.css');
      loadCss('http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.1/src/css/ui.jqgrid.css');
    
      var html = '';
      html += '<table id="characters_table">';
      html += '<div id="pager"></div>';
      jQuery(jQuery('div[class="base_body"]')[1]).prepend(html);
    
      var table = jQuery("#characters_table");
      table.jqGrid({
        datatype: "clientSide",
        colModel: Character.colModel,
        viewrecords: true,
        gridview: true,
        scrollrows: true,
        autowidth: false,
        shrinkToFit: false,
        rowNum: 100,
        width: 640,
        loadui: "disable"
      });
      
      var base_url = 'http://jp.finalfantasyxiv.com';
      jQuery.each(jQuery('div[class="player_name_area"] h4 a'), function(i, v) {
        var url = base_url + jQuery(v).attr('href');
        jQuery.ajax({
          type: "GET",
          url: url,
          dataType: "html",
          success: function(html) {
            doc = jQuery(html);
            table.addRowData(table.getGridParam("reccount"), new Character(doc));
          }
        });
      });
    });
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2013/09/18 10:33:58 - 2013-09-18