• forked:The Condensed Historical Calender by LOD Chronology
Import an externally hosted application
Check style

  • JavaScript
  • CSS
  • HTML
  • Images
  • Input Data
  • ReadMe
  • forked:The Condensed Historical Calender by LOD Chronology
  • jquery-1.7.1.min.js  
  • jquery-ui-1.8.18.min.js  
  • http://hp.vector.co.jp/authors/VA013210/fullcalendar/fullcalendar.min.js  
  •  
  • history

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
 
if( typeof( Application ) === 'undefined' || !Application )
{
    var Application = {};
}
 
Application.chronology = function() {
    this._init.apply( this, arguments );
};
 
// アプリ全体を1つのオブジェクトして扱う。
Application.chronology.prototype = {
    _workId : null,
    _fileName : null,
    _uriBase : 'http://linkdata.org/',
    _prpDescription: 'http://purl.org/dc/elements/1.1/description',
    _prpBase : null,
    _longAgoFlg : null,
    _calEvents : [],
    _realEvents : {},
    _intervalId : null,
    _colorPalette : [
        'midnightblue', 'seagreen', 'sandybrown', 'indianred', 'indianred', 'dimgray', 'royalblue', 'darkgreen', 'chocolate', 'darkred', 'crimson'
    ],
    
    // アプリ起動時にのみ起動する
    _init : function() {
        this._showTblSelecter();
        this._update();
    },
    
    // 年表のセレクタの初期処理
    _showTblSelecter : function() {
        var self = this;
        var selected = 'selected';
        
        $.each( LinkData.getWorks(), function( i, workId ) {
            $.each( LinkData.getFiles( workId ), function( j, fileName ) {
                var sbjBase = self._uriBase + 'resource/' + workId + '#';
                var prpBase = self._uriBase + 'property/' + workId + '#';
                var sbjHead = sbjBase + encodeURIComponent( '[header]' );
                var prpName = prpBase + encodeURIComponent(  'event_name' );
                var titleArr = LinkData.getObjects( workId, fileName, sbjHead, prpName );
                
                if( titleArr.length === 0 )
                {
                    //ヘッダー行が見つからない場合は、年表ファイルではないとみなす。
                    return true;
                }
 
                var title = titleArr[ 0 ];
                var tableKey = workId + '|' + fileName;
                $( '#tableSelect' ).append( '<option value="' + tableKey + '" ' + selected + ' >' + title + '</option>' );
                if( selected === 'selected' )
                {
                    self._workId = workId;
                    self._fileName = fileName;
                    selected = '';
                }
            } );
        } );
 
        $( '#tableSelect' ).change( function() {
            var selected =$( 'option:selected', $( this ) ).val();
            var splitedKey = selected.split( '|' );
            
            self._workId = splitedKey[ 0 ];
            self._fileName = splitedKey[ 1 ];
            self._update();
        });
    },
    
    // 新しい年表が選択される度に呼び出される処理
    _update : function() {
        var self = this;
        
        /* まずはタイマー停止 */
        if( this.intervalId !== undefined )
        {
            clearInterval( this.intervalId );
        }
        
        // URIの生成
        var prpBase = this._uriBase + 'property/' + this._workId + '#';
        this._prpBase = prpBase;
        var sbjBase = this._uriBase + 'resource/' + this._workId + '#';
        this._sbjHead =sbjBase + encodeURIComponent( '[header]' );
        this._prpStart = prpBase + encodeURIComponent( 'start' );
        this._prpEnd = prpBase + encodeURIComponent( 'end' );
        this._prpName = prpBase + encodeURIComponent( 'event_name' );
        
        var now = new Date();
        // 今年の始まりと終わりの時刻を取得
        this._calHead = new Date( now.getFullYear(), 0,1);
        this._calTail = new Date( now.getFullYear() + 1, 0,1 );
        
        // 今年の日数を取得
        this._yearDay = ( this._calTail - this._calHead ) / 1000/60/60/24;
        // LinkData.org上の年表を取得し、配列に格納
        this._createEventTbl();
        // 現在を示すイベントを追加
jquery-1.7.1.min.js
jquery-ui-1.8.18.min.js
http://hp.vector.co.jp/authors/VA013210/fullcalendar/fullcalendar.min.js
Playing...

jquery-1.7.1.min.js
jquery-ui-1.8.18.min.js
http://hp.vector.co.jp/authors/VA013210/fullcalendar/fullcalendar.min.js