Initial commit.
6
.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
.DS_Store
|
||||
*.pyc
|
||||
.svn
|
||||
nbproject
|
||||
Thumbs.db
|
||||
Desktop.ini
|
4
.htaccess
Normal file
|
@ -0,0 +1,4 @@
|
|||
Options -Indexes
|
||||
|
||||
Order Allow,Deny
|
||||
Allow from all
|
48
README.md
Normal file
|
@ -0,0 +1,48 @@
|
|||
AniTV Schedule
|
||||
==============
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
||||
This is a clone of the original AniTV Schedule listing found at http://anitv.is-ingenio.us/. It will
|
||||
allow users to host their own listings or implement it within their own projects.
|
||||
|
||||
|
||||
MAIN FEATURES
|
||||
-------------
|
||||
|
||||
- HTML5 and CSS3
|
||||
|
||||
- Schedule Streaming (Auto-Update)
|
||||
|
||||
- API System
|
||||
|
||||
|
||||
DISCLAIMER
|
||||
----------
|
||||
|
||||
The entire code is currently being rewritten for public release. Currently, it is not fully functional
|
||||
in its current state. A finalized release will be made when possible.
|
||||
|
||||
|
||||
LICENSE
|
||||
-------
|
||||
|
||||
Major Components:
|
||||
|
||||
- bootstrap: Apache License 2.0
|
||||
|
||||
- DataTables: GPL v2/BSD 3-Point Licenses
|
||||
|
||||
- Jeditable: MIT License
|
||||
|
||||
- jQuery: MIT/GPL Licenses
|
||||
|
||||
- jQuery.localize: Public Domain
|
||||
|
||||
- jQuery TableSorter: MIT/GPL Licenses
|
||||
|
||||
Everything Else:
|
||||
|
||||
- The Unlicense (Public Domain)
|
93
api.html
Normal file
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>AniTV Schedule - API</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/bootstrap.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/bootstrap-app.css" />
|
||||
|
||||
<!-- JS -->
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/clock.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<div class="fill">
|
||||
<div class="container">
|
||||
<a class="brand" href="#">AniTV Schedule</a>
|
||||
<ul class="nav">
|
||||
<li><a href="index.html">Home</a></li>
|
||||
<li class="active"><a href="api.html" data-view="api">API</a></li>
|
||||
<li><a href="manage.html" data-view="manage">Manage</a></li>
|
||||
<li><a href="history.html" data-view="history">History</a></li>
|
||||
</ul>
|
||||
<p class="pull-right" id="clock"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="content" id="view">
|
||||
<div class="page-header">
|
||||
<h1>API <small>create and innovate ideas</small></h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="text">
|
||||
<h3>Documentation</h3>
|
||||
<div class="text">
|
||||
<h4>List N Shows via JSON</h4>
|
||||
<dl>
|
||||
<dt>Syntax</dt>
|
||||
<dd>
|
||||
GET <a href="json.php?controller=schedule">/json.php?controller=schedule</a><br/>
|
||||
GET <a href="json.php?controller=schedule&total=500">/json.php?controller=schedule&total=<number></a><br/>
|
||||
GET <a href="json.php?controller=schedule&total=500&nowplaying=false">/json.php?controller=schedule&total=<number>&nowplaying=<boolean></a>
|
||||
</dd>
|
||||
|
||||
<dt>Description</dt>
|
||||
<dd>
|
||||
This call will output the same schedule displayed on the index. The variable <number> in the second call is the total amount of items returned.<br/>
|
||||
The variable <boolean> when used must be either TRUE or FALSE. This determines whether or not to display programs that are currently on the air.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4>Query/Search via JSON</h4>
|
||||
<dl>
|
||||
<dt>Syntax</dt>
|
||||
<dd>
|
||||
GET <a href="json.php?controller=search&query=bakuman">/json.php?controller=search&query=<string></a>
|
||||
</dd>
|
||||
|
||||
<dt>Description</dt>
|
||||
<dd>
|
||||
The variable <string> must be replaced with the string that will be queried for results. All characters are allowed and the wildcard character is an asterik (*).
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<h3>Libraries</h3>
|
||||
<div class="text">
|
||||
<dl>
|
||||
<dt>mIRC</dt>
|
||||
<dd><a href="scripts/anitv.mrc">AniTV mIRC Script</a> by prinny</dd>
|
||||
|
||||
<dt>TCL</dt>
|
||||
<dd><a href="scripts/anitv.tcl">AniTV Eggdrop/TCL Script</a> by prinny</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p>AniTV Schedule 0.2.0 © TEAM SEPTiCORE 2011</p>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
69
assets/css/bootstrap-app.css
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
/* Override some defaults */
|
||||
html, body {
|
||||
background-color: #eee;
|
||||
}
|
||||
body {
|
||||
padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */
|
||||
}
|
||||
.container > footer p {
|
||||
text-align: center; /* center align it with the container */
|
||||
}
|
||||
.container {
|
||||
width: 1000px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
|
||||
}
|
||||
|
||||
/* The white background content wrapper */
|
||||
.container > .content {
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
|
||||
-webkit-border-radius: 0 0 6px 6px;
|
||||
-moz-border-radius: 0 0 6px 6px;
|
||||
border-radius: 0 0 6px 6px;
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
||||
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-right: -20px;
|
||||
}
|
||||
|
||||
th.header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table#schedule > tbody > tr > td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table#schedule > tbody > tr > td:nth-child(2) {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.text {
|
||||
padding: 0 20px 0;
|
||||
}
|
||||
|
||||
.anidb {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Page header tweaks */
|
||||
.page-header {
|
||||
background-color: #f5f5f5;
|
||||
padding: 20px 20px 10px;
|
||||
margin: -20px -20px 20px;
|
||||
}
|
||||
|
||||
.topbar .btn {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.key-12 { background-color: #FFDD99 !important; }
|
||||
.key-06 { background-color: #FFCE6B !important; }
|
||||
.key-03 { background-color: #FFC040 !important; }
|
||||
.key-01 { background-color: #FFAA00 !important; }
|
||||
.key-00 { background-color: #6BCF51 !important; }
|
||||
|
||||
#clock { color: #FFF; }
|
2467
assets/css/bootstrap.css
vendored
Normal file
521
assets/css/datatables-table-jui.css
Normal file
|
@ -0,0 +1,521 @@
|
|||
/*
|
||||
* File: demo_table_jui.css
|
||||
* CVS: $Id$
|
||||
* Description: CSS descriptions for DataTables demo pages
|
||||
* Author: Allan Jardine
|
||||
* Created: Tue May 12 06:47:22 BST 2009
|
||||
* Modified: $Date$ by $Author$
|
||||
* Language: CSS
|
||||
* Project: DataTables
|
||||
*
|
||||
* Copyright 2009 Allan Jardine. All Rights Reserved.
|
||||
*
|
||||
* ***************************************************************************
|
||||
* DESCRIPTION
|
||||
*
|
||||
* The styles given here are suitable for the demos that are used with the standard DataTables
|
||||
* distribution (see www.datatables.net). You will most likely wish to modify these styles to
|
||||
* meet the layout requirements of your site.
|
||||
*
|
||||
* Common issues:
|
||||
* 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is
|
||||
* no conflict between the two pagination types. If you want to use full_numbers pagination
|
||||
* ensure that you either have "example_alt_pagination" as a body class name, or better yet,
|
||||
* modify that selector.
|
||||
* Note that the path used for Images is relative. All images are by default located in
|
||||
* ../img/ - relative to this CSS file.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* jQuery UI specific styling
|
||||
*/
|
||||
|
||||
.paging_two_button .ui-button {
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
* cursor: hand;
|
||||
}
|
||||
|
||||
.paging_full_numbers .ui-button {
|
||||
padding: 2px 6px;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
* cursor: hand;
|
||||
}
|
||||
|
||||
.dataTables_paginate .ui-button {
|
||||
margin-right: -0.1em !important;
|
||||
}
|
||||
|
||||
.paging_full_numbers {
|
||||
width: 350px !important;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .ui-toolbar {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.dataTables_paginate {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.dataTables_info {
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
table.display thead th {
|
||||
padding: 3px 0px 3px 10px;
|
||||
cursor: pointer;
|
||||
* cursor: hand;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper .ui-widget-header {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sort arrow icon positioning
|
||||
*/
|
||||
table.display thead th div.DataTables_sort_wrapper {
|
||||
position: relative;
|
||||
padding-right: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
table.display thead th div.DataTables_sort_wrapper span {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* Everything below this line is the same as demo_table.css. This file is
|
||||
* required for 'cleanliness' of the markup
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* DataTables features
|
||||
*/
|
||||
|
||||
.dataTables_wrapper {
|
||||
position: relative;
|
||||
min-height: 302px;
|
||||
_height: 302px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.dataTables_processing {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 50%;
|
||||
width: 250px;
|
||||
margin-left: -125px;
|
||||
border: 1px solid #ddd;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 11px;
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
.dataTables_length {
|
||||
width: 40%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.dataTables_info {
|
||||
width: 50%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.dataTables_paginate {
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Pagination nested */
|
||||
.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next {
|
||||
height: 19px;
|
||||
width: 19px;
|
||||
margin-left: 3px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.paginate_disabled_previous {
|
||||
background-image: url('../img/back_disabled.jpg');
|
||||
}
|
||||
|
||||
.paginate_enabled_previous {
|
||||
background-image: url('../img/back_enabled.jpg');
|
||||
}
|
||||
|
||||
.paginate_disabled_next {
|
||||
background-image: url('../img/forward_disabled.jpg');
|
||||
}
|
||||
|
||||
.paginate_enabled_next {
|
||||
background-image: url('../img/forward_enabled.jpg');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* DataTables display
|
||||
*/
|
||||
table.display {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table.display tfoot th {
|
||||
padding: 3px 0px 3px 10px;
|
||||
font-weight: bold;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
table.display tr.heading2 td {
|
||||
border-bottom: 1px solid #aaa;
|
||||
}
|
||||
|
||||
table.display td {
|
||||
padding: 3px 10px;
|
||||
}
|
||||
|
||||
table.display td.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* DataTables sorting
|
||||
*/
|
||||
|
||||
.sorting_asc {
|
||||
background: url('../img/sort_asc.png') no-repeat center right;
|
||||
}
|
||||
|
||||
.sorting_desc {
|
||||
background: url('../img/sort_desc.png') no-repeat center right;
|
||||
}
|
||||
|
||||
.sorting {
|
||||
background: url('../img/sort_both.png') no-repeat center right;
|
||||
}
|
||||
|
||||
.sorting_asc_disabled {
|
||||
background: url('../img/sort_asc_disabled.png') no-repeat center right;
|
||||
}
|
||||
|
||||
.sorting_desc_disabled {
|
||||
background: url('../img/sort_desc_disabled.png') no-repeat center right;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* DataTables row classes
|
||||
*/
|
||||
table.display tr.odd.gradeA {
|
||||
background-color: #ddffdd;
|
||||
}
|
||||
|
||||
table.display tr.even.gradeA {
|
||||
background-color: #eeffee;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
table.display tr.odd.gradeA {
|
||||
background-color: #ddffdd;
|
||||
}
|
||||
|
||||
table.display tr.even.gradeA {
|
||||
background-color: #eeffee;
|
||||
}
|
||||
|
||||
table.display tr.odd.gradeC {
|
||||
background-color: #ddddff;
|
||||
}
|
||||
|
||||
table.display tr.even.gradeC {
|
||||
background-color: #eeeeff;
|
||||
}
|
||||
|
||||
table.display tr.odd.gradeX {
|
||||
background-color: #ffdddd;
|
||||
}
|
||||
|
||||
table.display tr.even.gradeX {
|
||||
background-color: #ffeeee;
|
||||
}
|
||||
|
||||
table.display tr.odd.gradeU {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
table.display tr.even.gradeU {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
|
||||
tr.odd {
|
||||
background-color: #E2E4FF;
|
||||
}
|
||||
|
||||
tr.even {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Misc
|
||||
*/
|
||||
.dataTables_scroll {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.top, .bottom {
|
||||
padding: 15px;
|
||||
background-color: #F5F5F5;
|
||||
border: 1px solid #CCCCCC;
|
||||
}
|
||||
|
||||
.top .dataTables_info {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.dataTables_empty {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
tfoot input {
|
||||
margin: 0.5em 0;
|
||||
width: 100%;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
tfoot input.search_init {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
td.group {
|
||||
background-color: #d1cfd0;
|
||||
border-bottom: 2px solid #A19B9E;
|
||||
border-top: 2px solid #A19B9E;
|
||||
}
|
||||
|
||||
td.details {
|
||||
background-color: #d1cfd0;
|
||||
border: 2px solid #A19B9E;
|
||||
}
|
||||
|
||||
|
||||
.example_alt_pagination div.dataTables_info {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.paging_full_numbers span.paginate_button,
|
||||
.paging_full_numbers span.paginate_active {
|
||||
border: 1px solid #aaa;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
padding: 2px 5px;
|
||||
margin: 0 3px;
|
||||
cursor: pointer;
|
||||
*cursor: hand;
|
||||
}
|
||||
|
||||
.paging_full_numbers span.paginate_button {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
.paging_full_numbers span.paginate_button:hover {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.paging_full_numbers span.paginate_active {
|
||||
background-color: #99B3FF;
|
||||
}
|
||||
|
||||
table.display tr.even.row_selected td {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
table.display tr.odd.row_selected td {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sorting classes for columns
|
||||
*/
|
||||
/* For the standard odd/even */
|
||||
tr.odd td.sorting_1 {
|
||||
background-color: #D3D6FF;
|
||||
}
|
||||
|
||||
tr.odd td.sorting_2 {
|
||||
background-color: #DADCFF;
|
||||
}
|
||||
|
||||
tr.odd td.sorting_3 {
|
||||
background-color: #E0E2FF;
|
||||
}
|
||||
|
||||
tr.even td.sorting_1 {
|
||||
background-color: #EAEBFF;
|
||||
}
|
||||
|
||||
tr.even td.sorting_2 {
|
||||
background-color: #F2F3FF;
|
||||
}
|
||||
|
||||
tr.even td.sorting_3 {
|
||||
background-color: #F9F9FF;
|
||||
}
|
||||
|
||||
|
||||
/* For the Conditional-CSS grading rows */
|
||||
/*
|
||||
Colour calculations (based off the main row colours)
|
||||
Level 1:
|
||||
dd > c4
|
||||
ee > d5
|
||||
Level 2:
|
||||
dd > d1
|
||||
ee > e2
|
||||
*/
|
||||
tr.odd.gradeA td.sorting_1 {
|
||||
background-color: #c4ffc4;
|
||||
}
|
||||
|
||||
tr.odd.gradeA td.sorting_2 {
|
||||
background-color: #d1ffd1;
|
||||
}
|
||||
|
||||
tr.odd.gradeA td.sorting_3 {
|
||||
background-color: #d1ffd1;
|
||||
}
|
||||
|
||||
tr.even.gradeA td.sorting_1 {
|
||||
background-color: #d5ffd5;
|
||||
}
|
||||
|
||||
tr.even.gradeA td.sorting_2 {
|
||||
background-color: #e2ffe2;
|
||||
}
|
||||
|
||||
tr.even.gradeA td.sorting_3 {
|
||||
background-color: #e2ffe2;
|
||||
}
|
||||
|
||||
tr.odd.gradeC td.sorting_1 {
|
||||
background-color: #c4c4ff;
|
||||
}
|
||||
|
||||
tr.odd.gradeC td.sorting_2 {
|
||||
background-color: #d1d1ff;
|
||||
}
|
||||
|
||||
tr.odd.gradeC td.sorting_3 {
|
||||
background-color: #d1d1ff;
|
||||
}
|
||||
|
||||
tr.even.gradeC td.sorting_1 {
|
||||
background-color: #d5d5ff;
|
||||
}
|
||||
|
||||
tr.even.gradeC td.sorting_2 {
|
||||
background-color: #e2e2ff;
|
||||
}
|
||||
|
||||
tr.even.gradeC td.sorting_3 {
|
||||
background-color: #e2e2ff;
|
||||
}
|
||||
|
||||
tr.odd.gradeX td.sorting_1 {
|
||||
background-color: #ffc4c4;
|
||||
}
|
||||
|
||||
tr.odd.gradeX td.sorting_2 {
|
||||
background-color: #ffd1d1;
|
||||
}
|
||||
|
||||
tr.odd.gradeX td.sorting_3 {
|
||||
background-color: #ffd1d1;
|
||||
}
|
||||
|
||||
tr.even.gradeX td.sorting_1 {
|
||||
background-color: #ffd5d5;
|
||||
}
|
||||
|
||||
tr.even.gradeX td.sorting_2 {
|
||||
background-color: #ffe2e2;
|
||||
}
|
||||
|
||||
tr.even.gradeX td.sorting_3 {
|
||||
background-color: #ffe2e2;
|
||||
}
|
||||
|
||||
tr.odd.gradeU td.sorting_1 {
|
||||
background-color: #c4c4c4;
|
||||
}
|
||||
|
||||
tr.odd.gradeU td.sorting_2 {
|
||||
background-color: #d1d1d1;
|
||||
}
|
||||
|
||||
tr.odd.gradeU td.sorting_3 {
|
||||
background-color: #d1d1d1;
|
||||
}
|
||||
|
||||
tr.even.gradeU td.sorting_1 {
|
||||
background-color: #d5d5d5;
|
||||
}
|
||||
|
||||
tr.even.gradeU td.sorting_2 {
|
||||
background-color: #e2e2e2;
|
||||
}
|
||||
|
||||
tr.even.gradeU td.sorting_3 {
|
||||
background-color: #e2e2e2;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Row highlighting example
|
||||
*/
|
||||
.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted {
|
||||
background-color: #ECFFB3;
|
||||
}
|
||||
|
||||
.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted {
|
||||
background-color: #E6FF99;
|
||||
}
|
538
assets/css/datatables-table.css
Normal file
|
@ -0,0 +1,538 @@
|
|||
/*
|
||||
* File: demo_table.css
|
||||
* CVS: $Id$
|
||||
* Description: CSS descriptions for DataTables demo pages
|
||||
* Author: Allan Jardine
|
||||
* Created: Tue May 12 06:47:22 BST 2009
|
||||
* Modified: $Date$ by $Author$
|
||||
* Language: CSS
|
||||
* Project: DataTables
|
||||
*
|
||||
* Copyright 2009 Allan Jardine. All Rights Reserved.
|
||||
*
|
||||
* ***************************************************************************
|
||||
* DESCRIPTION
|
||||
*
|
||||
* The styles given here are suitable for the demos that are used with the standard DataTables
|
||||
* distribution (see www.datatables.net). You will most likely wish to modify these styles to
|
||||
* meet the layout requirements of your site.
|
||||
*
|
||||
* Common issues:
|
||||
* 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is
|
||||
* no conflict between the two pagination types. If you want to use full_numbers pagination
|
||||
* ensure that you either have "example_alt_pagination" as a body class name, or better yet,
|
||||
* modify that selector.
|
||||
* Note that the path used for Images is relative. All images are by default located in
|
||||
* ../img/ - relative to this CSS file.
|
||||
*/
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* DataTables features
|
||||
*/
|
||||
|
||||
.dataTables_wrapper {
|
||||
position: relative;
|
||||
min-height: 302px;
|
||||
clear: both;
|
||||
_height: 302px;
|
||||
zoom: 1; /* Feeling sorry for IE */
|
||||
}
|
||||
|
||||
.dataTables_processing {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 250px;
|
||||
height: 30px;
|
||||
margin-left: -125px;
|
||||
margin-top: -15px;
|
||||
padding: 14px 0 2px 0;
|
||||
border: 1px solid #ddd;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.dataTables_length {
|
||||
padding-left: 10px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
padding-right: 100px;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.dataTables_info {
|
||||
width: 60%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.dataTables_paginate {
|
||||
width: 44px;
|
||||
* width: 50px;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Pagination nested */
|
||||
.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next {
|
||||
height: 19px;
|
||||
width: 19px;
|
||||
margin-left: 3px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.paginate_disabled_previous {
|
||||
background-image: url('../img/back_disabled.jpg');
|
||||
}
|
||||
|
||||
.paginate_enabled_previous {
|
||||
background-image: url('../img/back_enabled.jpg');
|
||||
}
|
||||
|
||||
.paginate_disabled_next {
|
||||
background-image: url('../img/forward_disabled.jpg');
|
||||
}
|
||||
|
||||
.paginate_enabled_next {
|
||||
background-image: url('../img/forward_enabled.jpg');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* DataTables display
|
||||
*/
|
||||
table.display {
|
||||
margin: 0 auto;
|
||||
clear: both;
|
||||
width: 100%;
|
||||
|
||||
/* Note Firefox 3.5 and before have a bug with border-collapse
|
||||
* ( https://bugzilla.mozilla.org/show%5Fbug.cgi?id=155955 )
|
||||
* border-spacing: 0; is one possible option. Conditional-css.com is
|
||||
* useful for this kind of thing
|
||||
*
|
||||
* Further note IE 6/7 has problems when calculating widths with border width.
|
||||
* It subtracts one px relative to the other browsers from the first column, and
|
||||
* adds one to the end...
|
||||
*
|
||||
* If you want that effect I'd suggest setting a border-top/left on th/td's and
|
||||
* then filling in the gaps with other borders.
|
||||
*/
|
||||
}
|
||||
|
||||
table.display thead th {
|
||||
padding: 3px 18px 3px 10px;
|
||||
border-bottom: 1px solid black;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
* cursor: hand;
|
||||
}
|
||||
|
||||
table.display tfoot th {
|
||||
padding: 3px 18px 3px 10px;
|
||||
border-top: 1px solid black;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.display tr.heading2 td {
|
||||
border-bottom: 1px solid #aaa;
|
||||
}
|
||||
|
||||
table.display td {
|
||||
padding: 3px 10px;
|
||||
}
|
||||
|
||||
table.display td.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* DataTables sorting
|
||||
*/
|
||||
|
||||
.sorting_asc {
|
||||
background: url('../img/sort_asc.png') no-repeat center right;
|
||||
}
|
||||
|
||||
.sorting_desc {
|
||||
background: url('../img/sort_desc.png') no-repeat center right;
|
||||
}
|
||||
|
||||
.sorting {
|
||||
background: url('../img/sort_both.png') no-repeat center right;
|
||||
}
|
||||
|
||||
.sorting_asc_disabled {
|
||||
background: url('../img/sort_asc_disabled.png') no-repeat center right;
|
||||
}
|
||||
|
||||
.sorting_desc_disabled {
|
||||
background: url('../img/sort_desc_disabled.png') no-repeat center right;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* DataTables row classes
|
||||
*/
|
||||
table.display tr.odd.gradeA {
|
||||
background-color: #ddffdd;
|
||||
}
|
||||
|
||||
table.display tr.even.gradeA {
|
||||
background-color: #eeffee;
|
||||
}
|
||||
|
||||
table.display tr.odd.gradeC {
|
||||
background-color: #ddddff;
|
||||
}
|
||||
|
||||
table.display tr.even.gradeC {
|
||||
background-color: #eeeeff;
|
||||
}
|
||||
|
||||
table.display tr.odd.gradeX {
|
||||
background-color: #ffdddd;
|
||||
}
|
||||
|
||||
table.display tr.even.gradeX {
|
||||
background-color: #ffeeee;
|
||||
}
|
||||
|
||||
table.display tr.odd.gradeU {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
table.display tr.even.gradeU {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
|
||||
tr.odd {
|
||||
background-color: #E2E4FF;
|
||||
}
|
||||
|
||||
tr.even {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Misc
|
||||
*/
|
||||
.dataTables_scroll {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.dataTables_scrollBody {
|
||||
*margin-top: -1px;
|
||||
}
|
||||
|
||||
.top, .bottom {
|
||||
padding: 15px;
|
||||
background-color: #F5F5F5;
|
||||
border: 1px solid #CCCCCC;
|
||||
}
|
||||
|
||||
.top .dataTables_info {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.dataTables_empty {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
tfoot input {
|
||||
margin: 0.5em 0;
|
||||
width: 100%;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
tfoot input.search_init {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
td.group {
|
||||
background-color: #d1cfd0;
|
||||
border-bottom: 2px solid #A19B9E;
|
||||
border-top: 2px solid #A19B9E;
|
||||
}
|
||||
|
||||
td.details {
|
||||
background-color: #d1cfd0;
|
||||
border: 2px solid #A19B9E;
|
||||
}
|
||||
|
||||
|
||||
.example_alt_pagination div.dataTables_info {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.paging_full_numbers {
|
||||
width: 400px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.paging_full_numbers span.paginate_button,
|
||||
.paging_full_numbers span.paginate_active {
|
||||
border: 1px solid #aaa;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
padding: 2px 5px;
|
||||
margin: 0 3px;
|
||||
cursor: pointer;
|
||||
*cursor: hand;
|
||||
}
|
||||
|
||||
.paging_full_numbers span.paginate_button {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
.paging_full_numbers span.paginate_button:hover {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.paging_full_numbers span.paginate_active {
|
||||
background-color: #99B3FF;
|
||||
}
|
||||
|
||||
table.display tr.even.row_selected td {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
table.display tr.odd.row_selected td {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sorting classes for columns
|
||||
*/
|
||||
/* For the standard odd/even */
|
||||
tr.odd td.sorting_1 {
|
||||
background-color: #D3D6FF;
|
||||
}
|
||||
|
||||
tr.odd td.sorting_2 {
|
||||
background-color: #DADCFF;
|
||||
}
|
||||
|
||||
tr.odd td.sorting_3 {
|
||||
background-color: #E0E2FF;
|
||||
}
|
||||
|
||||
tr.even td.sorting_1 {
|
||||
background-color: #EAEBFF;
|
||||
}
|
||||
|
||||
tr.even td.sorting_2 {
|
||||
background-color: #F2F3FF;
|
||||
}
|
||||
|
||||
tr.even td.sorting_3 {
|
||||
background-color: #F9F9FF;
|
||||
}
|
||||
|
||||
|
||||
/* For the Conditional-CSS grading rows */
|
||||
/*
|
||||
Colour calculations (based off the main row colours)
|
||||
Level 1:
|
||||
dd > c4
|
||||
ee > d5
|
||||
Level 2:
|
||||
dd > d1
|
||||
ee > e2
|
||||
*/
|
||||
tr.odd.gradeA td.sorting_1 {
|
||||
background-color: #c4ffc4;
|
||||
}
|
||||
|
||||
tr.odd.gradeA td.sorting_2 {
|
||||
background-color: #d1ffd1;
|
||||
}
|
||||
|
||||
tr.odd.gradeA td.sorting_3 {
|
||||
background-color: #d1ffd1;
|
||||
}
|
||||
|
||||
tr.even.gradeA td.sorting_1 {
|
||||
background-color: #d5ffd5;
|
||||
}
|
||||
|
||||
tr.even.gradeA td.sorting_2 {
|
||||
background-color: #e2ffe2;
|
||||
}
|
||||
|
||||
tr.even.gradeA td.sorting_3 {
|
||||
background-color: #e2ffe2;
|
||||
}
|
||||
|
||||
tr.odd.gradeC td.sorting_1 {
|
||||
background-color: #c4c4ff;
|
||||
}
|
||||
|
||||
tr.odd.gradeC td.sorting_2 {
|
||||
background-color: #d1d1ff;
|
||||
}
|
||||
|
||||
tr.odd.gradeC td.sorting_3 {
|
||||
background-color: #d1d1ff;
|
||||
}
|
||||
|
||||
tr.even.gradeC td.sorting_1 {
|
||||
background-color: #d5d5ff;
|
||||
}
|
||||
|
||||
tr.even.gradeC td.sorting_2 {
|
||||
background-color: #e2e2ff;
|
||||
}
|
||||
|
||||
tr.even.gradeC td.sorting_3 {
|
||||
background-color: #e2e2ff;
|
||||
}
|
||||
|
||||
tr.odd.gradeX td.sorting_1 {
|
||||
background-color: #ffc4c4;
|
||||
}
|
||||
|
||||
tr.odd.gradeX td.sorting_2 {
|
||||
background-color: #ffd1d1;
|
||||
}
|
||||
|
||||
tr.odd.gradeX td.sorting_3 {
|
||||
background-color: #ffd1d1;
|
||||
}
|
||||
|
||||
tr.even.gradeX td.sorting_1 {
|
||||
background-color: #ffd5d5;
|
||||
}
|
||||
|
||||
tr.even.gradeX td.sorting_2 {
|
||||
background-color: #ffe2e2;
|
||||
}
|
||||
|
||||
tr.even.gradeX td.sorting_3 {
|
||||
background-color: #ffe2e2;
|
||||
}
|
||||
|
||||
tr.odd.gradeU td.sorting_1 {
|
||||
background-color: #c4c4c4;
|
||||
}
|
||||
|
||||
tr.odd.gradeU td.sorting_2 {
|
||||
background-color: #d1d1d1;
|
||||
}
|
||||
|
||||
tr.odd.gradeU td.sorting_3 {
|
||||
background-color: #d1d1d1;
|
||||
}
|
||||
|
||||
tr.even.gradeU td.sorting_1 {
|
||||
background-color: #d5d5d5;
|
||||
}
|
||||
|
||||
tr.even.gradeU td.sorting_2 {
|
||||
background-color: #e2e2e2;
|
||||
}
|
||||
|
||||
tr.even.gradeU td.sorting_3 {
|
||||
background-color: #e2e2e2;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Row highlighting example
|
||||
*/
|
||||
.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted {
|
||||
background-color: #ECFFB3;
|
||||
}
|
||||
|
||||
.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted {
|
||||
background-color: #E6FF99;
|
||||
}
|
||||
|
||||
.ex_highlight_row #example tr.even:hover {
|
||||
background-color: #ECFFB3;
|
||||
}
|
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_1 {
|
||||
background-color: #DDFF75;
|
||||
}
|
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_2 {
|
||||
background-color: #E7FF9E;
|
||||
}
|
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_3 {
|
||||
background-color: #E2FF89;
|
||||
}
|
||||
|
||||
.ex_highlight_row #example tr.odd:hover {
|
||||
background-color: #E6FF99;
|
||||
}
|
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_1 {
|
||||
background-color: #D6FF5C;
|
||||
}
|
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_2 {
|
||||
background-color: #E0FF84;
|
||||
}
|
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_3 {
|
||||
background-color: #DBFF70;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* KeyTable
|
||||
*/
|
||||
table.KeyTable td {
|
||||
border: 3px solid transparent;
|
||||
}
|
||||
|
||||
table.KeyTable td.focus {
|
||||
border: 3px solid #3366FF;
|
||||
}
|
||||
|
||||
table.display tr.gradeA {
|
||||
background-color: #eeffee;
|
||||
}
|
||||
|
||||
table.display tr.gradeC {
|
||||
background-color: #ddddff;
|
||||
}
|
||||
|
||||
table.display tr.gradeX {
|
||||
background-color: #ffdddd;
|
||||
}
|
||||
|
||||
table.display tr.gradeU {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
div.box {
|
||||
height: 100px;
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
border: 1px solid #8080FF;
|
||||
background-color: #E5E5FF;
|
||||
}
|
BIN
assets/img/back_disabled.jpg
Normal file
After Width: | Height: | Size: 612 B |
BIN
assets/img/back_enabled.jpg
Normal file
After Width: | Height: | Size: 807 B |
BIN
assets/img/forward_disabled.jpg
Normal file
After Width: | Height: | Size: 635 B |
BIN
assets/img/forward_enabled.jpg
Normal file
After Width: | Height: | Size: 852 B |
BIN
assets/img/sort_asc.png
Normal file
After Width: | Height: | Size: 263 B |
BIN
assets/img/sort_asc_disabled.png
Normal file
After Width: | Height: | Size: 252 B |
BIN
assets/img/sort_both.png
Normal file
After Width: | Height: | Size: 282 B |
BIN
assets/img/sort_desc.png
Normal file
After Width: | Height: | Size: 260 B |
BIN
assets/img/sort_desc_disabled.png
Normal file
After Width: | Height: | Size: 251 B |
47
assets/js/anitv-history.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
jQuery(document).ready(function() {
|
||||
loadHistory();
|
||||
});
|
||||
|
||||
// Load Schedule
|
||||
var loadHistory = function() {
|
||||
var table = jQuery("#history");
|
||||
jQuery.ajax({
|
||||
url: 'json.php',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
controller: 'history'
|
||||
},
|
||||
jsonpCallback: 'history',
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
if (data.records != undefined) {
|
||||
jQuery.each(data.records, function(i, value) {
|
||||
table.append(format(value));
|
||||
});
|
||||
|
||||
jQuery("time").localize('yyyy-mm-dd HH:MM:ss');
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
},
|
||||
complete: function(jqXHR, textStatus) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function format(data) {
|
||||
var changelog = "";
|
||||
|
||||
if (data.orig_romaji != data.romaji)
|
||||
changelog = "Modified Romaji Title from " + data.orig_romaji + " to " + data.romaji + " by " + data.user + ".";
|
||||
if (data.orig_title != data.title)
|
||||
changelog = "Modified English Title from " + data.orig_title + " to " + data.title + " by " + data.user + ".";
|
||||
if (data.orig_anidb != data.anidb)
|
||||
changelog = "Modified AniDB ID from " + data.orig_anidb + " to " + data.anidb + " by " + data.user + ".";
|
||||
|
||||
return '<tr>\n\
|
||||
<td><time datetime="' + data.last_updated +'">' + data.last_updated + '</time></td>\n\
|
||||
<td>' + data.program + '</td>\n\
|
||||
<td>' + changelog + '</td>\n\
|
||||
</tr>';
|
||||
}
|
21
assets/js/anitv-manage.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
jQuery(document).ready(function() {
|
||||
var oManager = jQuery("#manage").dataTable({
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": 'system/manage.php',
|
||||
"fnDrawCallback": function() {
|
||||
jQuery("#manage tbody td").editable('system/editor.php', {
|
||||
"callback": function(sValue, y) {
|
||||
oManager.fnDraw();
|
||||
},
|
||||
"submitdata": function(value, settings) {
|
||||
return {
|
||||
"id": this.parentNode.getAttribute('id'),
|
||||
"field": oManager.fnGetPosition(this)[2]
|
||||
}
|
||||
},
|
||||
"height": '14px'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
124
assets/js/anitv-schedule.js
Normal file
|
@ -0,0 +1,124 @@
|
|||
jQuery(document).ready(function() {
|
||||
loadSchedule();
|
||||
});
|
||||
|
||||
// Load Schedule
|
||||
var loadSchedule = function() {
|
||||
var table = jQuery("#schedule");
|
||||
jQuery.ajax({
|
||||
url: 'json.php',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
controller: 'schedule'
|
||||
},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
if (data.programs != undefined) {
|
||||
jQuery.each(data.programs, function(i, value) {
|
||||
table.append(format(value));
|
||||
});
|
||||
|
||||
jQuery("time").localize('yyyy-mm-dd HH:MM:ss');
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
},
|
||||
complete: function(jqXHR, textStatus) {
|
||||
schedule();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Stream
|
||||
var streamSchedule = function(total) {
|
||||
var table = jQuery("#schedule");
|
||||
jQuery.ajax({
|
||||
url: 'json.php',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
controller: 'stream',
|
||||
total: total
|
||||
},
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
if (data.programs != undefined) {
|
||||
jQuery.each(data.programs, function(i, value) {
|
||||
table.append(format(value));
|
||||
});
|
||||
|
||||
jQuery("time").localize('yyyy-mm-dd HH:MM:ss');
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
},
|
||||
complete: function(jqXHR, textStatus) {
|
||||
}
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// Update Counter
|
||||
var schedule = function() {
|
||||
var current = Math.round((new Date()).getTime() / 1000);
|
||||
var data = jQuery("#schedule td:last-child");
|
||||
var kill = 0;
|
||||
jQuery.each(data, function(i, value) {
|
||||
var that = jQuery(this);
|
||||
var countdown = that.data("airtime");
|
||||
|
||||
var key = jQuery("#p" + that.data("id") + " td:first-child");
|
||||
key.attr("class", colorize(countdown - current));
|
||||
|
||||
if (key.hasClass('key-00')) {
|
||||
if ((countdown - current + that.data("duration")) <= 0) {
|
||||
jQuery("#p" + that.data("id")).remove();
|
||||
kill++;
|
||||
}
|
||||
}
|
||||
jQuery(this).html(getETA(countdown - current));
|
||||
});
|
||||
|
||||
if (kill > 0) {
|
||||
streamSchedule(kill);
|
||||
}
|
||||
setTimeout(schedule, 1000);
|
||||
}
|
||||
|
||||
function colorize(time) {
|
||||
if (time <= 0) return 'key-00';
|
||||
if (time <= 3600) return 'key-01';
|
||||
if (time <= 10800) return 'key-03';
|
||||
if (time <= 21600) return 'key-06';
|
||||
if (time <= 43200) return 'key-12';
|
||||
return 'key-XX';
|
||||
}
|
||||
|
||||
function format(data) {
|
||||
var current = Math.round((new Date()).getTime() / 1000);
|
||||
return '<tr id="p' + data.id + '">\n\
|
||||
<td class=""> </td>\n\
|
||||
<td class="' + ((data.anidb) ? 'anidb' : '') + '">' + ((data.anidb) ? '<a href="http://anidb.info/a' + data.anidb + '" target="_blank" class="anidb-link">' + data.title + '</a>' : data.title) + '</td>\n\
|
||||
<td data-subtitle="' + data.subtitle + '">' + data.episode + '</td>\n\
|
||||
<td>' + data.station + '</td>\n\
|
||||
<td><time datetime="' + data.gmtime + '">' + data.airtime + '</time></td>\n\
|
||||
<td class="eta-countdown" data-id="' + data.id + '" data-airtime="' + data.unixtime + '" data-duration="' + data.duration + '">' + (data.unixtime - current) + '</td>\n\
|
||||
</tr>';
|
||||
}
|
||||
|
||||
function getETA(time) {
|
||||
if (time < 0)
|
||||
return 'Now Playing...';
|
||||
|
||||
var h = Math.floor(time / 3600);
|
||||
var m = Math.floor(time / 60) - (h * 60);
|
||||
var s = time - (h * 3600) - (m * 60);
|
||||
|
||||
return pad(h, 2) + 'h ' + pad(m, 2) + 'm ' + pad(s, 2) + 's';
|
||||
}
|
||||
|
||||
function pad(num, len) {
|
||||
var output = '' + num;
|
||||
while (output.length < len) output = "0" + output;
|
||||
return output;
|
||||
}
|
11
assets/js/clock.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
function clockLocal() { return new Date(); }
|
||||
function clock() { document.getElementById("clock").innerHTML = eval(timeLocal); setTimeout("clock()", 1000); }
|
||||
function tN() { return new Date(); }
|
||||
function tZ(x) { return (x > 9) ? x : '0' + x; }
|
||||
function tE(x) { if (x == 1 || x == 21 || x == 31) { return 'st'; } if (x == 2 || x == 22) { return 'nd'; } if (x == 3 || x == 23) { return 'rd'; } return 'th'; }
|
||||
function tY(x) { return (x < 500) ? x + 1900 : x; }
|
||||
var dName = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
|
||||
var mName = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
|
||||
var timeLocal = 'dName[clockLocal().getDay()] + " " + mName[clockLocal().getMonth()] + " " + clockLocal().getDate() + tE(clockLocal().getDate()) + ", " + tY(clockLocal().getYear()) + " " + tZ(clockLocal().getHours()) + ":" + tZ(clockLocal().getMinutes()) + ":" + tZ(clockLocal().getSeconds())';
|
||||
|
||||
if (!document.all) { window.onload = clock; } else { clock(); }
|
151
assets/js/jquery.datatables.min.js
vendored
Normal file
|
@ -0,0 +1,151 @@
|
|||
/*
|
||||
* File: jquery.dataTables.min.js
|
||||
* Version: 1.8.2
|
||||
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||
* Info: www.datatables.net
|
||||
*
|
||||
* Copyright 2008-2011 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
* BSD style license, as supplied with this software.
|
||||
*
|
||||
* This source file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
||||
*/
|
||||
(function(i,za,p){i.fn.dataTableSettings=[];var D=i.fn.dataTableSettings;i.fn.dataTableExt={};var n=i.fn.dataTableExt;n.sVersion="1.8.2";n.sErrMode="alert";n.iApiIndex=0;n.oApi={};n.afnFiltering=[];n.aoFeatures=[];n.ofnSearch={};n.afnSortData=[];n.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",
|
||||
sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",
|
||||
sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:""};n.oJUIClasses={sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",
|
||||
sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",
|
||||
sPageFirst:"first ui-corner-tl ui-corner-bl",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last ui-corner-tr ui-corner-br",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",
|
||||
sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortColumn:"sorting_",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollWrapper:"dataTables_scroll",
|
||||
sScrollHead:"dataTables_scrollHead ui-state-default",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot ui-state-default",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"ui-state-default"};n.oPagination={two_button:{fnInit:function(g,l,s){var t,w,y;if(g.bJUI){t=p.createElement("a");w=p.createElement("a");y=p.createElement("span");y.className=g.oClasses.sPageJUINext;w.appendChild(y);y=p.createElement("span");y.className=g.oClasses.sPageJUIPrev;
|
||||
t.appendChild(y)}else{t=p.createElement("div");w=p.createElement("div")}t.className=g.oClasses.sPagePrevDisabled;w.className=g.oClasses.sPageNextDisabled;t.title=g.oLanguage.oPaginate.sPrevious;w.title=g.oLanguage.oPaginate.sNext;l.appendChild(t);l.appendChild(w);i(t).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&s(g)});i(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&s(g)});i(t).bind("selectstart.DT",function(){return false});i(w).bind("selectstart.DT",function(){return false});
|
||||
if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){l.setAttribute("id",g.sTableId+"_paginate");t.setAttribute("id",g.sTableId+"_previous");w.setAttribute("id",g.sTableId+"_next")}},fnUpdate:function(g){if(g.aanFeatures.p)for(var l=g.aanFeatures.p,s=0,t=l.length;s<t;s++)if(l[s].childNodes.length!==0){l[s].childNodes[0].className=g._iDisplayStart===0?g.oClasses.sPagePrevDisabled:g.oClasses.sPagePrevEnabled;l[s].childNodes[1].className=g.fnDisplayEnd()==g.fnRecordsDisplay()?g.oClasses.sPageNextDisabled:
|
||||
g.oClasses.sPageNextEnabled}}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(g,l,s){var t=p.createElement("span"),w=p.createElement("span"),y=p.createElement("span"),F=p.createElement("span"),x=p.createElement("span");t.innerHTML=g.oLanguage.oPaginate.sFirst;w.innerHTML=g.oLanguage.oPaginate.sPrevious;F.innerHTML=g.oLanguage.oPaginate.sNext;x.innerHTML=g.oLanguage.oPaginate.sLast;var v=g.oClasses;t.className=v.sPageButton+" "+v.sPageFirst;w.className=v.sPageButton+" "+v.sPagePrevious;F.className=
|
||||
v.sPageButton+" "+v.sPageNext;x.className=v.sPageButton+" "+v.sPageLast;l.appendChild(t);l.appendChild(w);l.appendChild(y);l.appendChild(F);l.appendChild(x);i(t).bind("click.DT",function(){g.oApi._fnPageChange(g,"first")&&s(g)});i(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&s(g)});i(F).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&s(g)});i(x).bind("click.DT",function(){g.oApi._fnPageChange(g,"last")&&s(g)});i("span",l).bind("mousedown.DT",function(){return false}).bind("selectstart.DT",
|
||||
function(){return false});if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){l.setAttribute("id",g.sTableId+"_paginate");t.setAttribute("id",g.sTableId+"_first");w.setAttribute("id",g.sTableId+"_previous");F.setAttribute("id",g.sTableId+"_next");x.setAttribute("id",g.sTableId+"_last")}},fnUpdate:function(g,l){if(g.aanFeatures.p){var s=n.oPagination.iFullNumbersShowPages,t=Math.floor(s/2),w=Math.ceil(g.fnRecordsDisplay()/g._iDisplayLength),y=Math.ceil(g._iDisplayStart/g._iDisplayLength)+1,F=
|
||||
"",x,v=g.oClasses;if(w<s){t=1;x=w}else if(y<=t){t=1;x=s}else if(y>=w-t){t=w-s+1;x=w}else{t=y-Math.ceil(s/2)+1;x=t+s-1}for(s=t;s<=x;s++)F+=y!=s?'<span class="'+v.sPageButton+'">'+s+"</span>":'<span class="'+v.sPageButtonActive+'">'+s+"</span>";x=g.aanFeatures.p;var z,$=function(M){g._iDisplayStart=(this.innerHTML*1-1)*g._iDisplayLength;l(g);M.preventDefault()},X=function(){return false};s=0;for(t=x.length;s<t;s++)if(x[s].childNodes.length!==0){z=i("span:eq(2)",x[s]);z.html(F);i("span",z).bind("click.DT",
|
||||
$).bind("mousedown.DT",X).bind("selectstart.DT",X);z=x[s].getElementsByTagName("span");z=[z[0],z[1],z[z.length-2],z[z.length-1]];i(z).removeClass(v.sPageButton+" "+v.sPageButtonActive+" "+v.sPageButtonStaticDisabled);if(y==1){z[0].className+=" "+v.sPageButtonStaticDisabled;z[1].className+=" "+v.sPageButtonStaticDisabled}else{z[0].className+=" "+v.sPageButton;z[1].className+=" "+v.sPageButton}if(w===0||y==w||g._iDisplayLength==-1){z[2].className+=" "+v.sPageButtonStaticDisabled;z[3].className+=" "+
|
||||
v.sPageButtonStaticDisabled}else{z[2].className+=" "+v.sPageButton;z[3].className+=" "+v.sPageButton}}}}}};n.oSort={"string-asc":function(g,l){if(typeof g!="string")g="";if(typeof l!="string")l="";g=g.toLowerCase();l=l.toLowerCase();return g<l?-1:g>l?1:0},"string-desc":function(g,l){if(typeof g!="string")g="";if(typeof l!="string")l="";g=g.toLowerCase();l=l.toLowerCase();return g<l?1:g>l?-1:0},"html-asc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g<
|
||||
l?-1:g>l?1:0},"html-desc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g<l?1:g>l?-1:0},"date-asc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(l)||l==="")l=Date.parse("01/01/1970 00:00:00");return g-l},"date-desc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(l)||l==="")l=Date.parse("01/01/1970 00:00:00");return l-
|
||||
g},"numeric-asc":function(g,l){return(g=="-"||g===""?0:g*1)-(l=="-"||l===""?0:l*1)},"numeric-desc":function(g,l){return(l=="-"||l===""?0:l*1)-(g=="-"||g===""?0:g*1)}};n.aTypes=[function(g){if(typeof g=="number")return"numeric";else if(typeof g!="string")return null;var l,s=false;l=g.charAt(0);if("0123456789-".indexOf(l)==-1)return null;for(var t=1;t<g.length;t++){l=g.charAt(t);if("0123456789.".indexOf(l)==-1)return null;if(l=="."){if(s)return null;s=true}}return"numeric"},function(g){var l=Date.parse(g);
|
||||
if(l!==null&&!isNaN(l)||typeof g=="string"&&g.length===0)return"date";return null},function(g){if(typeof g=="string"&&g.indexOf("<")!=-1&&g.indexOf(">")!=-1)return"html";return null}];n.fnVersionCheck=function(g){var l=function(x,v){for(;x.length<v;)x+="0";return x},s=n.sVersion.split(".");g=g.split(".");for(var t="",w="",y=0,F=g.length;y<F;y++){t+=l(s[y],3);w+=l(g[y],3)}return parseInt(t,10)>=parseInt(w,10)};n._oExternConfig={iNextUnique:0};i.fn.dataTable=function(g){function l(){this.fnRecordsTotal=
|
||||
function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length};this.fnRecordsDisplay=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length};this.fnDisplayEnd=function(){return this.oFeatures.bServerSide?this.oFeatures.bPaginate===false||this._iDisplayLength==-1?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd};this.sInstance=
|
||||
this.oInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false,bDeferRender:false};this.oScroll={sX:"",sXInner:"",sY:"",bCollapse:false,bInfinite:false,iLoadGap:100,iBarWidth:0,bAutoCss:true};this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...",sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sEmptyTable:"No data available in table",
|
||||
sLoadingRecords:"Loading...",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"},fnInfoCallback:null};this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.aoHeader=[];this.aoFooter=[];this.iNextId=0;this.asDataSearch=[];this.oPreviousSearch={sSearch:"",
|
||||
bRegex:false,bSmart:true};this.aoPreSearchCols=[];this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripeClasses=[];this.asDestroyStripes=[];this.sDestroyWidth=0;this.fnFooterCallback=this.fnHeaderCallback=this.fnRowCallback=null;this.aoDrawCallback=[];this.fnInitComplete=this.fnPreDrawCallback=null;this.sTableId="";this.nTableWrapper=this.nTBody=this.nTFoot=this.nTHead=this.nTable=null;this.bInitialised=this.bDeferLoading=false;this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType=
|
||||
"two_button";this.iCookieDuration=7200;this.sCookiePrefix="SpryMedia_DataTables_";this.fnCookieCallback=null;this.aoStateSave=[];this.aoStateLoad=[];this.sAjaxSource=this.oLoadedState=null;this.sAjaxDataProp="aaData";this.bAjaxDataGet=true;this.jqXHR=null;this.fnServerData=function(a,b,c,d){d.jqXHR=i.ajax({url:a,data:b,success:function(f){i(d.oInstance).trigger("xhr",d);c(f)},dataType:"json",cache:false,error:function(f,e){e=="parsererror"&&alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})};
|
||||
this.aoServerParams=[];this.fnFormatNumber=function(a){if(a<1E3)return a;else{var b=a+"";a=b.split("");var c="";b=b.length;for(var d=0;d<b;d++){if(d%3===0&&d!==0)c=this.oLanguage.sInfoThousands+c;c=a[b-d-1]+c}}return c};this.aLengthMenu=[10,25,50,100];this.bDrawing=this.iDraw=0;this.iDrawError=-1;this._iDisplayLength=25;this._iDisplayStart=0;this._iDisplayEnd=25;this._iRecordsDisplay=this._iRecordsTotal=0;this.bJUI=false;this.oClasses=n.oStdClasses;this.bSortCellsTop=this.bSorted=this.bFiltered=false;
|
||||
this.oInit=null;this.aoDestroyCallback=[]}function s(a){return function(){var b=[A(this[n.iApiIndex])].concat(Array.prototype.slice.call(arguments));return n.oApi[a].apply(this,b)}}function t(a){var b,c,d=a.iInitDisplayStart;if(a.bInitialised===false)setTimeout(function(){t(a)},200);else{Aa(a);X(a);M(a,a.aoHeader);a.nTFoot&&M(a,a.aoFooter);K(a,true);a.oFeatures.bAutoWidth&&ga(a);b=0;for(c=a.aoColumns.length;b<c;b++)if(a.aoColumns[b].sWidth!==null)a.aoColumns[b].nTh.style.width=q(a.aoColumns[b].sWidth);
|
||||
if(a.oFeatures.bSort)R(a);else if(a.oFeatures.bFilter)N(a,a.oPreviousSearch);else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}if(a.sAjaxSource!==null&&!a.oFeatures.bServerSide){c=[];ha(a,c);a.fnServerData.call(a.oInstance,a.sAjaxSource,c,function(f){var e=f;if(a.sAjaxDataProp!=="")e=aa(a.sAjaxDataProp)(f);for(b=0;b<e.length;b++)v(a,e[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)R(a);else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}K(a,false);w(a,f)},a)}else if(!a.oFeatures.bServerSide){K(a,
|
||||
false);w(a)}}}function w(a,b){a._bInitComplete=true;if(typeof a.fnInitComplete=="function")typeof b!="undefined"?a.fnInitComplete.call(a.oInstance,a,b):a.fnInitComplete.call(a.oInstance,a)}function y(a,b,c){a.oLanguage=i.extend(true,a.oLanguage,b);typeof b.sEmptyTable=="undefined"&&typeof b.sZeroRecords!="undefined"&&o(a.oLanguage,b,"sZeroRecords","sEmptyTable");typeof b.sLoadingRecords=="undefined"&&typeof b.sZeroRecords!="undefined"&&o(a.oLanguage,b,"sZeroRecords","sLoadingRecords");c&&t(a)}function F(a,
|
||||
b){var c=a.aoColumns.length;b={sType:null,_bAutoType:true,bVisible:true,bSearchable:true,bSortable:true,asSorting:["asc","desc"],sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,sTitle:b?b.innerHTML:"",sName:"",sWidth:null,sWidthOrig:null,sClass:null,fnRender:null,bUseRendered:true,iDataSort:c,mDataProp:c,fnGetData:null,fnSetData:null,sSortDataType:"std",sDefaultContent:null,sContentPadding:"",nTh:b?b:p.createElement("th"),nTf:null};a.aoColumns.push(b);if(typeof a.aoPreSearchCols[c]==
|
||||
"undefined"||a.aoPreSearchCols[c]===null)a.aoPreSearchCols[c]={sSearch:"",bRegex:false,bSmart:true};else{if(typeof a.aoPreSearchCols[c].bRegex=="undefined")a.aoPreSearchCols[c].bRegex=true;if(typeof a.aoPreSearchCols[c].bSmart=="undefined")a.aoPreSearchCols[c].bSmart=true}x(a,c,null)}function x(a,b,c){b=a.aoColumns[b];if(typeof c!="undefined"&&c!==null){if(typeof c.sType!="undefined"){b.sType=c.sType;b._bAutoType=false}o(b,c,"bVisible");o(b,c,"bSearchable");o(b,c,"bSortable");o(b,c,"sTitle");o(b,
|
||||
c,"sName");o(b,c,"sWidth");o(b,c,"sWidth","sWidthOrig");o(b,c,"sClass");o(b,c,"fnRender");o(b,c,"bUseRendered");o(b,c,"iDataSort");o(b,c,"mDataProp");o(b,c,"asSorting");o(b,c,"sSortDataType");o(b,c,"sDefaultContent");o(b,c,"sContentPadding")}b.fnGetData=aa(b.mDataProp);b.fnSetData=Ba(b.mDataProp);if(!a.oFeatures.bSort)b.bSortable=false;if(!b.bSortable||i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortableNone;b.sSortingClassJUI=""}else if(b.bSortable||
|
||||
i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortable;b.sSortingClassJUI=a.oClasses.sSortJUI}else if(i.inArray("asc",b.asSorting)!=-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortableAsc;b.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed}else if(i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)!=-1){b.sSortingClass=a.oClasses.sSortableDesc;b.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed}}function v(a,b){var c;
|
||||
c=i.isArray(b)?b.slice():i.extend(true,{},b);b=a.aoData.length;var d={nTr:null,_iId:a.iNextId++,_aData:c,_anHidden:[],_sRowStripe:""};a.aoData.push(d);for(var f,e=0,h=a.aoColumns.length;e<h;e++){c=a.aoColumns[e];typeof c.fnRender=="function"&&c.bUseRendered&&c.mDataProp!==null&&O(a,b,e,c.fnRender({iDataRow:b,iDataColumn:e,aData:d._aData,oSettings:a}));if(c._bAutoType&&c.sType!="string"){f=G(a,b,e,"type");if(f!==null&&f!==""){f=ia(f);if(c.sType===null)c.sType=f;else if(c.sType!=f&&c.sType!="html")c.sType=
|
||||
"string"}}}a.aiDisplayMaster.push(b);a.oFeatures.bDeferRender||z(a,b);return b}function z(a,b){var c=a.aoData[b],d;if(c.nTr===null){c.nTr=p.createElement("tr");typeof c._aData.DT_RowId!="undefined"&&c.nTr.setAttribute("id",c._aData.DT_RowId);typeof c._aData.DT_RowClass!="undefined"&&i(c.nTr).addClass(c._aData.DT_RowClass);for(var f=0,e=a.aoColumns.length;f<e;f++){var h=a.aoColumns[f];d=p.createElement("td");d.innerHTML=typeof h.fnRender=="function"&&(!h.bUseRendered||h.mDataProp===null)?h.fnRender({iDataRow:b,
|
||||
iDataColumn:f,aData:c._aData,oSettings:a}):G(a,b,f,"display");if(h.sClass!==null)d.className=h.sClass;if(h.bVisible){c.nTr.appendChild(d);c._anHidden[f]=null}else c._anHidden[f]=d}}}function $(a){var b,c,d,f,e,h,j,k,m;if(a.bDeferLoading||a.sAjaxSource===null){j=a.nTBody.childNodes;b=0;for(c=j.length;b<c;b++)if(j[b].nodeName.toUpperCase()=="TR"){k=a.aoData.length;a.aoData.push({nTr:j[b],_iId:a.iNextId++,_aData:[],_anHidden:[],_sRowStripe:""});a.aiDisplayMaster.push(k);h=j[b].childNodes;d=e=0;for(f=
|
||||
h.length;d<f;d++){m=h[d].nodeName.toUpperCase();if(m=="TD"||m=="TH"){O(a,k,e,i.trim(h[d].innerHTML));e++}}}}j=ba(a);h=[];b=0;for(c=j.length;b<c;b++){d=0;for(f=j[b].childNodes.length;d<f;d++){e=j[b].childNodes[d];m=e.nodeName.toUpperCase();if(m=="TD"||m=="TH")h.push(e)}}h.length!=j.length*a.aoColumns.length&&J(a,1,"Unexpected number of TD elements. Expected "+j.length*a.aoColumns.length+" and got "+h.length+". DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.");
|
||||
d=0;for(f=a.aoColumns.length;d<f;d++){if(a.aoColumns[d].sTitle===null)a.aoColumns[d].sTitle=a.aoColumns[d].nTh.innerHTML;j=a.aoColumns[d]._bAutoType;m=typeof a.aoColumns[d].fnRender=="function";e=a.aoColumns[d].sClass!==null;k=a.aoColumns[d].bVisible;var u,r;if(j||m||e||!k){b=0;for(c=a.aoData.length;b<c;b++){u=h[b*f+d];if(j&&a.aoColumns[d].sType!="string"){r=G(a,b,d,"type");if(r!==""){r=ia(r);if(a.aoColumns[d].sType===null)a.aoColumns[d].sType=r;else if(a.aoColumns[d].sType!=r&&a.aoColumns[d].sType!=
|
||||
"html")a.aoColumns[d].sType="string"}}if(m){r=a.aoColumns[d].fnRender({iDataRow:b,iDataColumn:d,aData:a.aoData[b]._aData,oSettings:a});u.innerHTML=r;a.aoColumns[d].bUseRendered&&O(a,b,d,r)}if(e)u.className+=" "+a.aoColumns[d].sClass;if(k)a.aoData[b]._anHidden[d]=null;else{a.aoData[b]._anHidden[d]=u;u.parentNode.removeChild(u)}}}}}function X(a){var b,c,d;a.nTHead.getElementsByTagName("tr");if(a.nTHead.getElementsByTagName("th").length!==0){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;
|
||||
a.aoColumns[b].sClass!==null&&i(c).addClass(a.aoColumns[b].sClass);if(a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}}else{var f=p.createElement("tr");b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;c.innerHTML=a.aoColumns[b].sTitle;a.aoColumns[b].sClass!==null&&i(c).addClass(a.aoColumns[b].sClass);f.appendChild(c)}i(a.nTHead).html("")[0].appendChild(f);Y(a.aoHeader,a.nTHead)}if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;f=p.createElement("div");
|
||||
f.className=a.oClasses.sSortJUIWrapper;i(c).contents().appendTo(f);var e=p.createElement("span");e.className=a.oClasses.sSortIcon;f.appendChild(e);c.appendChild(f)}}d=function(){this.onselectstart=function(){return false};return false};if(a.oFeatures.bSort)for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable!==false){ja(a,a.aoColumns[b].nTh,b);i(a.aoColumns[b].nTh).bind("mousedown.DT",d)}else i(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);a.oClasses.sFooterTH!==""&&i(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);
|
||||
if(a.nTFoot!==null){c=S(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)if(typeof c[b]!="undefined")a.aoColumns[b].nTf=c[b]}}function M(a,b,c){var d,f,e,h=[],j=[],k=a.aoColumns.length;if(typeof c=="undefined")c=false;d=0;for(f=b.length;d<f;d++){h[d]=b[d].slice();h[d].nTr=b[d].nTr;for(e=k-1;e>=0;e--)!a.aoColumns[e].bVisible&&!c&&h[d].splice(e,1);j.push([])}d=0;for(f=h.length;d<f;d++){if(h[d].nTr){a=0;for(e=h[d].nTr.childNodes.length;a<e;a++)h[d].nTr.removeChild(h[d].nTr.childNodes[0])}e=0;
|
||||
for(b=h[d].length;e<b;e++){k=c=1;if(typeof j[d][e]=="undefined"){h[d].nTr.appendChild(h[d][e].cell);for(j[d][e]=1;typeof h[d+c]!="undefined"&&h[d][e].cell==h[d+c][e].cell;){j[d+c][e]=1;c++}for(;typeof h[d][e+k]!="undefined"&&h[d][e].cell==h[d][e+k].cell;){for(a=0;a<c;a++)j[d+a][e+k]=1;k++}h[d][e].cell.rowSpan=c;h[d][e].cell.colSpan=k}}}}function C(a){var b,c,d=[],f=0,e=false;b=a.asStripeClasses.length;c=a.aoOpenRows.length;if(!(a.fnPreDrawCallback!==null&&a.fnPreDrawCallback.call(a.oInstance,a)===
|
||||
false)){a.bDrawing=true;if(typeof a.iInitDisplayStart!="undefined"&&a.iInitDisplayStart!=-1){a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart;a.iInitDisplayStart=-1;E(a)}if(a.bDeferLoading){a.bDeferLoading=false;a.iDraw++}else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!Ca(a))return}else a.iDraw++;if(a.aiDisplay.length!==0){var h=a._iDisplayStart,j=a._iDisplayEnd;if(a.oFeatures.bServerSide){h=0;j=a.aoData.length}for(h=
|
||||
h;h<j;h++){var k=a.aoData[a.aiDisplay[h]];k.nTr===null&&z(a,a.aiDisplay[h]);var m=k.nTr;if(b!==0){var u=a.asStripeClasses[f%b];if(k._sRowStripe!=u){i(m).removeClass(k._sRowStripe).addClass(u);k._sRowStripe=u}}if(typeof a.fnRowCallback=="function"){m=a.fnRowCallback.call(a.oInstance,m,a.aoData[a.aiDisplay[h]]._aData,f,h);if(!m&&!e){J(a,0,"A node was not returned by fnRowCallback");e=true}}d.push(m);f++;if(c!==0)for(k=0;k<c;k++)m==a.aoOpenRows[k].nParent&&d.push(a.aoOpenRows[k].nTr)}}else{d[0]=p.createElement("tr");
|
||||
if(typeof a.asStripeClasses[0]!="undefined")d[0].className=a.asStripeClasses[0];e=a.oLanguage.sZeroRecords.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()));if(a.iDraw==1&&a.sAjaxSource!==null&&!a.oFeatures.bServerSide)e=a.oLanguage.sLoadingRecords;else if(typeof a.oLanguage.sEmptyTable!="undefined"&&a.fnRecordsTotal()===0)e=a.oLanguage.sEmptyTable;b=p.createElement("td");b.setAttribute("valign","top");b.colSpan=Z(a);b.className=a.oClasses.sRowEmpty;b.innerHTML=e;d[f].appendChild(b)}typeof a.fnHeaderCallback==
|
||||
"function"&&a.fnHeaderCallback.call(a.oInstance,i(a.nTHead).children("tr")[0],ca(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);typeof a.fnFooterCallback=="function"&&a.fnFooterCallback.call(a.oInstance,i(a.nTFoot).children("tr")[0],ca(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);f=p.createDocumentFragment();b=p.createDocumentFragment();if(a.nTBody){e=a.nTBody.parentNode;b.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered){c=a.nTBody.childNodes;for(b=
|
||||
c.length-1;b>=0;b--)c[b].parentNode.removeChild(c[b])}b=0;for(c=d.length;b<c;b++)f.appendChild(d[b]);a.nTBody.appendChild(f);e!==null&&e.appendChild(a.nTBody)}for(b=a.aoDrawCallback.length-1;b>=0;b--)a.aoDrawCallback[b].fn.call(a.oInstance,a);i(a.oInstance).trigger("draw",a);a.bSorted=false;a.bFiltered=false;a.bDrawing=false;if(a.oFeatures.bServerSide){K(a,false);typeof a._bInitComplete=="undefined"&&w(a)}}}function da(a){if(a.oFeatures.bSort)R(a,a.oPreviousSearch);else if(a.oFeatures.bFilter)N(a,
|
||||
a.oPreviousSearch);else{E(a);C(a)}}function Ca(a){if(a.bAjaxDataGet){a.iDraw++;K(a,true);var b=Da(a);ha(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(c){Ea(a,c)},a);return false}else return true}function Da(a){var b=a.aoColumns.length,c=[],d,f;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:ka(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:a.oFeatures.bPaginate!==false?a._iDisplayLength:
|
||||
-1});for(f=0;f<b;f++){d=a.aoColumns[f].mDataProp;c.push({name:"mDataProp_"+f,value:typeof d=="function"?"function":d})}if(a.oFeatures.bFilter!==false){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++){c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch});c.push({name:"bRegex_"+f,value:a.aoPreSearchCols[f].bRegex});c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}}if(a.oFeatures.bSort!==false){d=
|
||||
a.aaSortingFixed!==null?a.aaSortingFixed.length:0;var e=a.aaSorting.length;c.push({name:"iSortingCols",value:d+e});for(f=0;f<d;f++){c.push({name:"iSortCol_"+f,value:a.aaSortingFixed[f][0]});c.push({name:"sSortDir_"+f,value:a.aaSortingFixed[f][1]})}for(f=0;f<e;f++){c.push({name:"iSortCol_"+(f+d),value:a.aaSorting[f][0]});c.push({name:"sSortDir_"+(f+d),value:a.aaSorting[f][1]})}for(f=0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}return c}function ha(a,b){for(var c=0,d=a.aoServerParams.length;c<
|
||||
d;c++)a.aoServerParams[c].fn.call(a.oInstance,b)}function Ea(a,b){if(typeof b.sEcho!="undefined")if(b.sEcho*1<a.iDraw)return;else a.iDraw=b.sEcho*1;if(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))la(a);a._iRecordsTotal=b.iTotalRecords;a._iRecordsDisplay=b.iTotalDisplayRecords;var c=ka(a);if(c=typeof b.sColumns!="undefined"&&c!==""&&b.sColumns!=c)var d=Fa(a,b.sColumns);b=aa(a.sAjaxDataProp)(b);for(var f=0,e=b.length;f<e;f++)if(c){for(var h=[],j=0,k=a.aoColumns.length;j<k;j++)h.push(b[f][d[j]]);
|
||||
v(a,h)}else v(a,b[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=false;C(a);a.bAjaxDataGet=true;K(a,false)}function Aa(a){var b=p.createElement("div");a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=p.createElement("div");a.nTableWrapper.className=a.oClasses.sWrapper;a.sTableId!==""&&a.nTableWrapper.setAttribute("id",a.sTableId+"_wrapper");a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),f,e,h,j,k,m,u,r=0;r<d.length;r++){e=0;h=d[r];if(h==
|
||||
"<"){j=p.createElement("div");k=d[r+1];if(k=="'"||k=='"'){m="";for(u=2;d[r+u]!=k;){m+=d[r+u];u++}if(m=="H")m="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix";else if(m=="F")m="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix";if(m.indexOf(".")!=-1){k=m.split(".");j.setAttribute("id",k[0].substr(1,k[0].length-1));j.className=k[1]}else if(m.charAt(0)=="#")j.setAttribute("id",m.substr(1,m.length-1));else j.className=m;r+=u}c.appendChild(j);
|
||||
c=j}else if(h==">")c=c.parentNode;else if(h=="l"&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange){f=Ga(a);e=1}else if(h=="f"&&a.oFeatures.bFilter){f=Ha(a);e=1}else if(h=="r"&&a.oFeatures.bProcessing){f=Ia(a);e=1}else if(h=="t"){f=Ja(a);e=1}else if(h=="i"&&a.oFeatures.bInfo){f=Ka(a);e=1}else if(h=="p"&&a.oFeatures.bPaginate){f=La(a);e=1}else if(n.aoFeatures.length!==0){j=n.aoFeatures;u=0;for(k=j.length;u<k;u++)if(h==j[u].cFeature){if(f=j[u].fnInit(a))e=1;break}}if(e==1&&f!==null){if(typeof a.aanFeatures[h]!=
|
||||
"object")a.aanFeatures[h]=[];a.aanFeatures[h].push(f);c.appendChild(f)}}b.parentNode.replaceChild(a.nTableWrapper,b)}function Ja(a){if(a.oScroll.sX===""&&a.oScroll.sY==="")return a.nTable;var b=p.createElement("div"),c=p.createElement("div"),d=p.createElement("div"),f=p.createElement("div"),e=p.createElement("div"),h=p.createElement("div"),j=a.nTable.cloneNode(false),k=a.nTable.cloneNode(false),m=a.nTable.getElementsByTagName("thead")[0],u=a.nTable.getElementsByTagName("tfoot").length===0?null:a.nTable.getElementsByTagName("tfoot")[0],
|
||||
r=typeof g.bJQueryUI!="undefined"&&g.bJQueryUI?n.oJUIClasses:n.oStdClasses;c.appendChild(d);e.appendChild(h);f.appendChild(a.nTable);b.appendChild(c);b.appendChild(f);d.appendChild(j);j.appendChild(m);if(u!==null){b.appendChild(e);h.appendChild(k);k.appendChild(u)}b.className=r.sScrollWrapper;c.className=r.sScrollHead;d.className=r.sScrollHeadInner;f.className=r.sScrollBody;e.className=r.sScrollFoot;h.className=r.sScrollFootInner;if(a.oScroll.bAutoCss){c.style.overflow="hidden";c.style.position="relative";
|
||||
e.style.overflow="hidden";f.style.overflow="auto"}c.style.border="0";c.style.width="100%";e.style.border="0";d.style.width="150%";j.removeAttribute("id");j.style.marginLeft="0";a.nTable.style.marginLeft="0";if(u!==null){k.removeAttribute("id");k.style.marginLeft="0"}d=i(a.nTable).children("caption");h=0;for(k=d.length;h<k;h++)j.appendChild(d[h]);if(a.oScroll.sX!==""){c.style.width=q(a.oScroll.sX);f.style.width=q(a.oScroll.sX);if(u!==null)e.style.width=q(a.oScroll.sX);i(f).scroll(function(){c.scrollLeft=
|
||||
this.scrollLeft;if(u!==null)e.scrollLeft=this.scrollLeft})}if(a.oScroll.sY!=="")f.style.height=q(a.oScroll.sY);a.aoDrawCallback.push({fn:Ma,sName:"scrolling"});a.oScroll.bInfinite&&i(f).scroll(function(){if(!a.bDrawing)if(i(this).scrollTop()+i(this).height()>i(a.nTable).height()-a.oScroll.iLoadGap)if(a.fnDisplayEnd()<a.fnRecordsDisplay()){ma(a,"next");E(a);C(a)}});a.nScrollHead=c;a.nScrollFoot=e;return b}function Ma(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],
|
||||
d=a.nTable.parentNode,f,e,h,j,k,m,u,r,H=[],L=a.nTFoot!==null?a.nScrollFoot.getElementsByTagName("div")[0]:null,T=a.nTFoot!==null?L.getElementsByTagName("table")[0]:null,B=i.browser.msie&&i.browser.version<=7;h=a.nTable.getElementsByTagName("thead");h.length>0&&a.nTable.removeChild(h[0]);if(a.nTFoot!==null){k=a.nTable.getElementsByTagName("tfoot");k.length>0&&a.nTable.removeChild(k[0])}h=a.nTHead.cloneNode(true);a.nTable.insertBefore(h,a.nTable.childNodes[0]);if(a.nTFoot!==null){k=a.nTFoot.cloneNode(true);
|
||||
a.nTable.insertBefore(k,a.nTable.childNodes[1])}if(a.oScroll.sX===""){d.style.width="100%";b.parentNode.style.width="100%"}var U=S(a,h);f=0;for(e=U.length;f<e;f++){u=Na(a,f);U[f].style.width=a.aoColumns[u].sWidth}a.nTFoot!==null&&P(function(I){I.style.width=""},k.getElementsByTagName("tr"));f=i(a.nTable).outerWidth();if(a.oScroll.sX===""){a.nTable.style.width="100%";if(B&&(d.scrollHeight>d.offsetHeight||i(d).css("overflow-y")=="scroll"))a.nTable.style.width=q(i(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sXInner!==
|
||||
"")a.nTable.style.width=q(a.oScroll.sXInner);else if(f==i(d).width()&&i(d).height()<i(a.nTable).height()){a.nTable.style.width=q(f-a.oScroll.iBarWidth);if(i(a.nTable).outerWidth()>f-a.oScroll.iBarWidth)a.nTable.style.width=q(f)}else a.nTable.style.width=q(f);f=i(a.nTable).outerWidth();e=a.nTHead.getElementsByTagName("tr");h=h.getElementsByTagName("tr");P(function(I,na){m=I.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;r=i(I).width();na.style.width=
|
||||
q(r);H.push(r)},h,e);i(h).height(0);if(a.nTFoot!==null){j=k.getElementsByTagName("tr");k=a.nTFoot.getElementsByTagName("tr");P(function(I,na){m=I.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;r=i(I).width();na.style.width=q(r);H.push(r)},j,k);i(j).height(0)}P(function(I){I.innerHTML="";I.style.width=q(H.shift())},h);a.nTFoot!==null&&P(function(I){I.innerHTML="";I.style.width=q(H.shift())},j);if(i(a.nTable).outerWidth()<f){j=d.scrollHeight>d.offsetHeight||
|
||||
i(d).css("overflow-y")=="scroll"?f+a.oScroll.iBarWidth:f;if(B&&(d.scrollHeight>d.offsetHeight||i(d).css("overflow-y")=="scroll"))a.nTable.style.width=q(j-a.oScroll.iBarWidth);d.style.width=q(j);b.parentNode.style.width=q(j);if(a.nTFoot!==null)L.parentNode.style.width=q(j);if(a.oScroll.sX==="")J(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width.");else a.oScroll.sXInner!==""&&J(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}else{d.style.width=
|
||||
q("100%");b.parentNode.style.width=q("100%");if(a.nTFoot!==null)L.parentNode.style.width=q("100%")}if(a.oScroll.sY==="")if(B)d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth);if(a.oScroll.sY!==""&&a.oScroll.bCollapse){d.style.height=q(a.oScroll.sY);B=a.oScroll.sX!==""&&a.nTable.offsetWidth>d.offsetWidth?a.oScroll.iBarWidth:0;if(a.nTable.offsetHeight<d.offsetHeight)d.style.height=q(i(a.nTable).height()+B)}B=i(a.nTable).outerWidth();c.style.width=q(B);b.style.width=q(B+a.oScroll.iBarWidth);
|
||||
if(a.nTFoot!==null){L.style.width=q(a.nTable.offsetWidth+a.oScroll.iBarWidth);T.style.width=q(a.nTable.offsetWidth)}if(a.bSorted||a.bFiltered)d.scrollTop=0}function ea(a){if(a.oFeatures.bAutoWidth===false)return false;ga(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function Ha(a){var b=a.oLanguage.sSearch;b=b.indexOf("_INPUT_")!==-1?b.replace("_INPUT_",'<input type="text" />'):b===""?'<input type="text" />':b+' <input type="text" />';var c=p.createElement("div");
|
||||
c.className=a.oClasses.sFilter;c.innerHTML="<label>"+b+"</label>";a.sTableId!==""&&typeof a.aanFeatures.f=="undefined"&&c.setAttribute("id",a.sTableId+"_filter");b=i("input",c);b.val(a.oPreviousSearch.sSearch.replace('"',"""));b.bind("keyup.DT",function(){for(var d=a.aanFeatures.f,f=0,e=d.length;f<e;f++)d[f]!=i(this).parents("div.dataTables_filter")[0]&&i("input",d[f]).val(this.value);this.value!=a.oPreviousSearch.sSearch&&N(a,{sSearch:this.value,bRegex:a.oPreviousSearch.bRegex,bSmart:a.oPreviousSearch.bSmart})});
|
||||
b.bind("keypress.DT",function(d){if(d.keyCode==13)return false});return c}function N(a,b,c){Oa(a,b.sSearch,c,b.bRegex,b.bSmart);for(b=0;b<a.aoPreSearchCols.length;b++)Pa(a,a.aoPreSearchCols[b].sSearch,b,a.aoPreSearchCols[b].bRegex,a.aoPreSearchCols[b].bSmart);n.afnFiltering.length!==0&&Qa(a);a.bFiltered=true;i(a.oInstance).trigger("filter",a);a._iDisplayStart=0;E(a);C(a);oa(a,0)}function Qa(a){for(var b=n.afnFiltering,c=0,d=b.length;c<d;c++)for(var f=0,e=0,h=a.aiDisplay.length;e<h;e++){var j=a.aiDisplay[e-
|
||||
f];if(!b[c](a,fa(a,j,"filter"),j)){a.aiDisplay.splice(e-f,1);f++}}}function Pa(a,b,c,d,f){if(b!==""){var e=0;b=pa(b,d,f);for(d=a.aiDisplay.length-1;d>=0;d--){f=qa(G(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType);if(!b.test(f)){a.aiDisplay.splice(d,1);e++}}}}function Oa(a,b,c,d,f){var e=pa(b,d,f);if(typeof c=="undefined"||c===null)c=0;if(n.afnFiltering.length!==0)c=1;if(b.length<=0){a.aiDisplay.splice(0,a.aiDisplay.length);a.aiDisplay=a.aiDisplayMaster.slice()}else if(a.aiDisplay.length==a.aiDisplayMaster.length||
|
||||
a.oPreviousSearch.sSearch.length>b.length||c==1||b.indexOf(a.oPreviousSearch.sSearch)!==0){a.aiDisplay.splice(0,a.aiDisplay.length);oa(a,1);for(c=0;c<a.aiDisplayMaster.length;c++)e.test(a.asDataSearch[c])&&a.aiDisplay.push(a.aiDisplayMaster[c])}else{var h=0;for(c=0;c<a.asDataSearch.length;c++)if(!e.test(a.asDataSearch[c])){a.aiDisplay.splice(c-h,1);h++}}a.oPreviousSearch.sSearch=b;a.oPreviousSearch.bRegex=d;a.oPreviousSearch.bSmart=f}function oa(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch.splice(0,
|
||||
a.asDataSearch.length);b=typeof b!="undefined"&&b==1?a.aiDisplayMaster:a.aiDisplay;for(var c=0,d=b.length;c<d;c++)a.asDataSearch[c]=ra(a,fa(a,b[c],"filter"))}}function ra(a,b){var c="";if(typeof a.__nTmpFilter=="undefined")a.__nTmpFilter=p.createElement("div");for(var d=a.__nTmpFilter,f=0,e=a.aoColumns.length;f<e;f++)if(a.aoColumns[f].bSearchable)c+=qa(b[f],a.aoColumns[f].sType)+" ";if(c.indexOf("&")!==-1){d.innerHTML=c;c=d.textContent?d.textContent:d.innerText;c=c.replace(/\n/g," ").replace(/\r/g,
|
||||
"")}return c}function pa(a,b,c){if(c){a=b?a.split(" "):sa(a).split(" ");a="^(?=.*?"+a.join(")(?=.*?")+").*$";return new RegExp(a,"i")}else{a=b?a:sa(a);return new RegExp(a,"i")}}function qa(a,b){if(typeof n.ofnSearch[b]=="function")return n.ofnSearch[b](a);else if(b=="html")return a.replace(/\n/g," ").replace(/<.*?>/g,"");else if(typeof a=="string")return a.replace(/\n/g," ");else if(a===null)return"";return a}function R(a,b){var c,d,f,e,h=[],j=[],k=n.oSort;d=a.aoData;var m=a.aoColumns;if(!a.oFeatures.bServerSide&&
|
||||
(a.aaSorting.length!==0||a.aaSortingFixed!==null)){h=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<h.length;c++){var u=h[c][0];f=ta(a,u);e=a.aoColumns[u].sSortDataType;if(typeof n.afnSortData[e]!="undefined"){var r=n.afnSortData[e](a,u,f);f=0;for(e=d.length;f<e;f++)O(a,f,u,r[f])}}c=0;for(d=a.aiDisplayMaster.length;c<d;c++)j[a.aiDisplayMaster[c]]=c;var H=h.length;a.aiDisplayMaster.sort(function(L,T){var B,U;for(c=0;c<H;c++){B=m[h[c][0]].iDataSort;U=m[B].sType;
|
||||
B=k[(U?U:"string")+"-"+h[c][1]](G(a,L,B,"sort"),G(a,T,B,"sort"));if(B!==0)return B}return k["numeric-asc"](j[L],j[T])})}if((typeof b=="undefined"||b)&&!a.oFeatures.bDeferRender)V(a);a.bSorted=true;i(a.oInstance).trigger("sort",a);if(a.oFeatures.bFilter)N(a,a.oPreviousSearch,1);else{a.aiDisplay=a.aiDisplayMaster.slice();a._iDisplayStart=0;E(a);C(a)}}function ja(a,b,c,d){i(b).bind("click.DT",function(f){if(a.aoColumns[c].bSortable!==false){var e=function(){var h,j;if(f.shiftKey){for(var k=false,m=0;m<
|
||||
a.aaSorting.length;m++)if(a.aaSorting[m][0]==c){k=true;h=a.aaSorting[m][0];j=a.aaSorting[m][2]+1;if(typeof a.aoColumns[h].asSorting[j]=="undefined")a.aaSorting.splice(m,1);else{a.aaSorting[m][1]=a.aoColumns[h].asSorting[j];a.aaSorting[m][2]=j}break}k===false&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else if(a.aaSorting.length==1&&a.aaSorting[0][0]==c){h=a.aaSorting[0][0];j=a.aaSorting[0][2]+1;if(typeof a.aoColumns[h].asSorting[j]=="undefined")j=0;a.aaSorting[0][1]=a.aoColumns[h].asSorting[j];
|
||||
a.aaSorting[0][2]=j}else{a.aaSorting.splice(0,a.aaSorting.length);a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}R(a)};if(a.oFeatures.bProcessing){K(a,true);setTimeout(function(){e();a.oFeatures.bServerSide||K(a,false)},0)}else e();typeof d=="function"&&d(a)}})}function V(a){var b,c,d,f,e,h=a.aoColumns.length,j=a.oClasses;for(b=0;b<h;b++)a.aoColumns[b].bSortable&&i(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass);f=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):
|
||||
a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){e=a.aoColumns[b].sSortingClass;d=-1;for(c=0;c<f.length;c++)if(f[c][0]==b){e=f[c][1]=="asc"?j.sSortAsc:j.sSortDesc;d=c;break}i(a.aoColumns[b].nTh).addClass(e);if(a.bJUI){c=i("span",a.aoColumns[b].nTh);c.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed);c.addClass(d==-1?a.aoColumns[b].sSortingClassJUI:f[d][1]=="asc"?j.sSortJUIAsc:j.sSortJUIDesc)}}else i(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);
|
||||
e=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){d=Q(a);if(a.oFeatures.bDeferRender)i(d).removeClass(e+"1 "+e+"2 "+e+"3");else if(d.length>=h)for(b=0;b<h;b++)if(d[b].className.indexOf(e+"1")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(e+"1",""))}else if(d[b].className.indexOf(e+"2")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(e+"2",""))}else if(d[b].className.indexOf(e+"3")!=-1){c=0;for(a=d.length/
|
||||
h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(" "+e+"3",""))}j=1;var k;for(b=0;b<f.length;b++){k=parseInt(f[b][0],10);c=0;for(a=d.length/h;c<a;c++)d[h*c+k].className+=" "+e+j;j<3&&j++}}}function La(a){if(a.oScroll.bInfinite)return null;var b=p.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;n.oPagination[a.sPaginationType].fnInit(a,b,function(c){E(c);C(c)});typeof a.aanFeatures.p=="undefined"&&a.aoDrawCallback.push({fn:function(c){n.oPagination[c.sPaginationType].fnUpdate(c,
|
||||
function(d){E(d);C(d)})},sName:"pagination"});return b}function ma(a,b){var c=a._iDisplayStart;if(b=="first")a._iDisplayStart=0;else if(b=="previous"){a._iDisplayStart=a._iDisplayLength>=0?a._iDisplayStart-a._iDisplayLength:0;if(a._iDisplayStart<0)a._iDisplayStart=0}else if(b=="next")if(a._iDisplayLength>=0){if(a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay())a._iDisplayStart+=a._iDisplayLength}else a._iDisplayStart=0;else if(b=="last")if(a._iDisplayLength>=0){b=parseInt((a.fnRecordsDisplay()-
|
||||
1)/a._iDisplayLength,10)+1;a._iDisplayStart=(b-1)*a._iDisplayLength}else a._iDisplayStart=0;else J(a,0,"Unknown paging action: "+b);i(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Ka(a){var b=p.createElement("div");b.className=a.oClasses.sInfo;if(typeof a.aanFeatures.i=="undefined"){a.aoDrawCallback.push({fn:Ra,sName:"information"});a.sTableId!==""&&b.setAttribute("id",a.sTableId+"_info")}return b}function Ra(a){if(!(!a.oFeatures.bInfo||a.aanFeatures.i.length===0)){var b=a._iDisplayStart+
|
||||
1,c=a.fnDisplayEnd(),d=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),e=a.fnFormatNumber(b),h=a.fnFormatNumber(c),j=a.fnFormatNumber(d),k=a.fnFormatNumber(f);if(a.oScroll.bInfinite)e=a.fnFormatNumber(1);e=a.fnRecordsDisplay()===0&&a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfoEmpty+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()===0?a.oLanguage.sInfoEmpty+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",j)+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfo.replace("_START_",
|
||||
e).replace("_END_",h).replace("_TOTAL_",k)+a.oLanguage.sInfoPostFix:a.oLanguage.sInfo.replace("_START_",e).replace("_END_",h).replace("_TOTAL_",k)+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+a.oLanguage.sInfoPostFix;if(a.oLanguage.fnInfoCallback!==null)e=a.oLanguage.fnInfoCallback(a,b,c,d,f,e);a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)i(a[b]).html(e)}}function Ga(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+(a.sTableId===""?"":'name="'+
|
||||
a.sTableId+'_length"')+">",c,d;if(a.aLengthMenu.length==2&&typeof a.aLengthMenu[0]=="object"&&typeof a.aLengthMenu[1]=="object"){c=0;for(d=a.aLengthMenu[0].length;c<d;c++)b+='<option value="'+a.aLengthMenu[0][c]+'">'+a.aLengthMenu[1][c]+"</option>"}else{c=0;for(d=a.aLengthMenu.length;c<d;c++)b+='<option value="'+a.aLengthMenu[c]+'">'+a.aLengthMenu[c]+"</option>"}b+="</select>";var f=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.l=="undefined"&&f.setAttribute("id",a.sTableId+"_length");
|
||||
f.className=a.oClasses.sLength;f.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";i('select option[value="'+a._iDisplayLength+'"]',f).attr("selected",true);i("select",f).bind("change.DT",function(){var e=i(this).val(),h=a.aanFeatures.l;c=0;for(d=h.length;c<d;c++)h[c]!=this.parentNode&&i("select",h[c]).val(e);a._iDisplayLength=parseInt(e,10);E(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<0)a._iDisplayStart=
|
||||
0}if(a._iDisplayLength==-1)a._iDisplayStart=0;C(a)});return f}function Ia(a){var b=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.r=="undefined"&&b.setAttribute("id",a.sTableId+"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function K(a,b){if(a.oFeatures.bProcessing){a=a.aanFeatures.r;for(var c=0,d=a.length;c<d;c++)a[c].style.visibility=b?"visible":"hidden"}}function Na(a,b){for(var c=-1,d=0;d<
|
||||
a.aoColumns.length;d++){a.aoColumns[d].bVisible===true&&c++;if(c==b)return d}return null}function ta(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++){a.aoColumns[d].bVisible===true&&c++;if(d==b)return a.aoColumns[d].bVisible===true?c:null}return null}function W(a,b){var c,d;c=a._iDisplayStart;for(d=a._iDisplayEnd;c<d;c++)if(a.aoData[a.aiDisplay[c]].nTr==b)return a.aiDisplay[c];c=0;for(d=a.aoData.length;c<d;c++)if(a.aoData[c].nTr==b)return c;return null}function Z(a){for(var b=0,c=0;c<a.aoColumns.length;c++)a.aoColumns[c].bVisible===
|
||||
true&&b++;return b}function E(a){a._iDisplayEnd=a.oFeatures.bPaginate===false?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||a._iDisplayLength==-1?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Sa(a,b){if(!a||a===null||a==="")return 0;if(typeof b=="undefined")b=p.getElementsByTagName("body")[0];var c=p.createElement("div");c.style.width=q(a);b.appendChild(c);a=c.offsetWidth;b.removeChild(c);return a}function ga(a){var b=0,c,d=0,f=a.aoColumns.length,e,h=i("th",
|
||||
a.nTHead);for(e=0;e<f;e++)if(a.aoColumns[e].bVisible){d++;if(a.aoColumns[e].sWidth!==null){c=Sa(a.aoColumns[e].sWidthOrig,a.nTable.parentNode);if(c!==null)a.aoColumns[e].sWidth=q(c);b++}}if(f==h.length&&b===0&&d==f&&a.oScroll.sX===""&&a.oScroll.sY==="")for(e=0;e<a.aoColumns.length;e++){c=i(h[e]).width();if(c!==null)a.aoColumns[e].sWidth=q(c)}else{b=a.nTable.cloneNode(false);e=a.nTHead.cloneNode(true);d=p.createElement("tbody");c=p.createElement("tr");b.removeAttribute("id");b.appendChild(e);if(a.nTFoot!==
|
||||
null){b.appendChild(a.nTFoot.cloneNode(true));P(function(k){k.style.width=""},b.getElementsByTagName("tr"))}b.appendChild(d);d.appendChild(c);d=i("thead th",b);if(d.length===0)d=i("tbody tr:eq(0)>td",b);h=S(a,e);for(e=d=0;e<f;e++){var j=a.aoColumns[e];if(j.bVisible&&j.sWidthOrig!==null&&j.sWidthOrig!=="")h[e-d].style.width=q(j.sWidthOrig);else if(j.bVisible)h[e-d].style.width="";else d++}for(e=0;e<f;e++)if(a.aoColumns[e].bVisible){d=Ta(a,e);if(d!==null){d=d.cloneNode(true);if(a.aoColumns[e].sContentPadding!==
|
||||
"")d.innerHTML+=a.aoColumns[e].sContentPadding;c.appendChild(d)}}f=a.nTable.parentNode;f.appendChild(b);if(a.oScroll.sX!==""&&a.oScroll.sXInner!=="")b.style.width=q(a.oScroll.sXInner);else if(a.oScroll.sX!==""){b.style.width="";if(i(b).width()<f.offsetWidth)b.style.width=q(f.offsetWidth)}else if(a.oScroll.sY!=="")b.style.width=q(f.offsetWidth);b.style.visibility="hidden";Ua(a,b);f=i("tbody tr:eq(0)",b).children();if(f.length===0)f=S(a,i("thead",b)[0]);if(a.oScroll.sX!==""){for(e=d=c=0;e<a.aoColumns.length;e++)if(a.aoColumns[e].bVisible){c+=
|
||||
a.aoColumns[e].sWidthOrig===null?i(f[d]).outerWidth():parseInt(a.aoColumns[e].sWidth.replace("px",""),10)+(i(f[d]).outerWidth()-i(f[d]).width());d++}b.style.width=q(c);a.nTable.style.width=q(c)}for(e=d=0;e<a.aoColumns.length;e++)if(a.aoColumns[e].bVisible){c=i(f[d]).width();if(c!==null&&c>0)a.aoColumns[e].sWidth=q(c);d++}a.nTable.style.width=q(i(b).outerWidth());b.parentNode.removeChild(b)}}function Ua(a,b){if(a.oScroll.sX===""&&a.oScroll.sY!==""){i(b).width();b.style.width=q(i(b).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sX!==
|
||||
"")b.style.width=q(i(b).outerWidth())}function Ta(a,b){var c=Va(a,b);if(c<0)return null;if(a.aoData[c].nTr===null){var d=p.createElement("td");d.innerHTML=G(a,c,b,"");return d}return Q(a,c)[b]}function Va(a,b){for(var c=-1,d=-1,f=0;f<a.aoData.length;f++){var e=G(a,f,b,"display")+"";e=e.replace(/<.*?>/g,"");if(e.length>c){c=e.length;d=f}}return d}function q(a){if(a===null)return"0px";if(typeof a=="number"){if(a<0)return"0px";return a+"px"}var b=a.charCodeAt(a.length-1);if(b<48||b>57)return a;return a+
|
||||
"px"}function Za(a,b){if(a.length!=b.length)return 1;for(var c=0;c<a.length;c++)if(a[c]!=b[c])return 2;return 0}function ia(a){for(var b=n.aTypes,c=b.length,d=0;d<c;d++){var f=b[d](a);if(f!==null)return f}return"string"}function A(a){for(var b=0;b<D.length;b++)if(D[b].nTable==a)return D[b];return null}function ca(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function ba(a){for(var b=[],c=0,d=a.aoData.length;c<d;c++)a.aoData[c].nTr!==null&&b.push(a.aoData[c].nTr);
|
||||
return b}function Q(a,b){var c=[],d,f,e,h,j;f=0;var k=a.aoData.length;if(typeof b!="undefined"){f=b;k=b+1}for(f=f;f<k;f++){j=a.aoData[f];if(j.nTr!==null){b=[];e=0;for(h=j.nTr.childNodes.length;e<h;e++){d=j.nTr.childNodes[e].nodeName.toLowerCase();if(d=="td"||d=="th")b.push(j.nTr.childNodes[e])}e=d=0;for(h=a.aoColumns.length;e<h;e++)if(a.aoColumns[e].bVisible)c.push(b[e-d]);else{c.push(j._anHidden[e]);d++}}}return c}function sa(a){return a.replace(new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^)",
|
||||
"g"),"\\$1")}function ua(a,b){for(var c=-1,d=0,f=a.length;d<f;d++)if(a[d]==b)c=d;else a[d]>b&&a[d]--;c!=-1&&a.splice(c,1)}function Fa(a,b){b=b.split(",");for(var c=[],d=0,f=a.aoColumns.length;d<f;d++)for(var e=0;e<f;e++)if(a.aoColumns[d].sName==b[e]){c.push(e);break}return c}function ka(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";if(b.length==d)return"";return b.slice(0,-1)}function J(a,b,c){a=a.sTableId===""?"DataTables warning: "+c:"DataTables warning (table id = '"+
|
||||
a.sTableId+"'): "+c;if(b===0)if(n.sErrMode=="alert")alert(a);else throw a;else typeof console!="undefined"&&typeof console.log!="undefined"&&console.log(a)}function la(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);E(a)}function va(a){if(!(!a.oFeatures.bStateSave||typeof a.bDestroying!="undefined")){var b,c,d,f="{";f+='"iCreate":'+(new Date).getTime()+",";f+='"iStart":'+(a.oScroll.bInfinite?0:a._iDisplayStart)+",";
|
||||
f+='"iEnd":'+(a.oScroll.bInfinite?a._iDisplayLength:a._iDisplayEnd)+",";f+='"iLength":'+a._iDisplayLength+",";f+='"sFilter":"'+encodeURIComponent(a.oPreviousSearch.sSearch)+'",';f+='"sFilterEsc":'+!a.oPreviousSearch.bRegex+",";f+='"aaSorting":[ ';for(b=0;b<a.aaSorting.length;b++)f+="["+a.aaSorting[b][0]+',"'+a.aaSorting[b][1]+'"],';f=f.substring(0,f.length-1);f+="],";f+='"aaSearchCols":[ ';for(b=0;b<a.aoPreSearchCols.length;b++)f+='["'+encodeURIComponent(a.aoPreSearchCols[b].sSearch)+'",'+!a.aoPreSearchCols[b].bRegex+
|
||||
"],";f=f.substring(0,f.length-1);f+="],";f+='"abVisCols":[ ';for(b=0;b<a.aoColumns.length;b++)f+=a.aoColumns[b].bVisible+",";f=f.substring(0,f.length-1);f+="]";b=0;for(c=a.aoStateSave.length;b<c;b++){d=a.aoStateSave[b].fn(a,f);if(d!=="")f=d}f+="}";Wa(a.sCookiePrefix+a.sInstance,f,a.iCookieDuration,a.sCookiePrefix,a.fnCookieCallback)}}function Xa(a,b){if(a.oFeatures.bStateSave){var c,d,f;d=wa(a.sCookiePrefix+a.sInstance);if(d!==null&&d!==""){try{c=typeof i.parseJSON=="function"?i.parseJSON(d.replace(/'/g,
|
||||
'"')):eval("("+d+")")}catch(e){return}d=0;for(f=a.aoStateLoad.length;d<f;d++)if(!a.aoStateLoad[d].fn(a,c))return;a.oLoadedState=i.extend(true,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.oPreviousSearch.sSearch=decodeURIComponent(c.sFilter);a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();if(typeof c.sFilterEsc!="undefined")a.oPreviousSearch.bRegex=!c.sFilterEsc;if(typeof c.aaSearchCols!="undefined")for(d=0;d<
|
||||
c.aaSearchCols.length;d++)a.aoPreSearchCols[d]={sSearch:decodeURIComponent(c.aaSearchCols[d][0]),bRegex:!c.aaSearchCols[d][1]};if(typeof c.abVisCols!="undefined"){b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++){b.saved_aoColumns[d]={};b.saved_aoColumns[d].bVisible=c.abVisCols[d]}}}}}function Wa(a,b,c,d,f){var e=new Date;e.setTime(e.getTime()+c*1E3);c=za.location.pathname.split("/");a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase();var h;if(f!==null){h=typeof i.parseJSON=="function"?i.parseJSON(b):
|
||||
eval("("+b+")");b=f(a,h,e.toGMTString(),c.join("/")+"/")}else b=a+"="+encodeURIComponent(b)+"; expires="+e.toGMTString()+"; path="+c.join("/")+"/";f="";e=9999999999999;if((wa(a)!==null?p.cookie.length:b.length+p.cookie.length)+10>4096){a=p.cookie.split(";");for(var j=0,k=a.length;j<k;j++)if(a[j].indexOf(d)!=-1){var m=a[j].split("=");try{h=eval("("+decodeURIComponent(m[1])+")")}catch(u){continue}if(typeof h.iCreate!="undefined"&&h.iCreate<e){f=m[0];e=h.iCreate}}if(f!=="")p.cookie=f+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+
|
||||
c.join("/")+"/"}p.cookie=b}function wa(a){var b=za.location.pathname.split("/");a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=";b=p.cookie.split(";");for(var c=0;c<b.length;c++){for(var d=b[c];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(a)===0)return decodeURIComponent(d.substring(a.length,d.length))}return null}function Y(a,b){b=i(b).children("tr");var c,d,f,e,h,j,k,m,u=function(L,T,B){for(;typeof L[T][B]!="undefined";)B++;return B};a.splice(0,a.length);d=0;for(j=b.length;d<
|
||||
j;d++)a.push([]);d=0;for(j=b.length;d<j;d++){f=0;for(k=b[d].childNodes.length;f<k;f++){c=b[d].childNodes[f];if(c.nodeName.toUpperCase()=="TD"||c.nodeName.toUpperCase()=="TH"){var r=c.getAttribute("colspan")*1,H=c.getAttribute("rowspan")*1;r=!r||r===0||r===1?1:r;H=!H||H===0||H===1?1:H;m=u(a,d,0);for(h=0;h<r;h++)for(e=0;e<H;e++){a[d+e][m+h]={cell:c,unique:r==1?true:false};a[d+e].nTr=b[d]}}}}}function S(a,b,c){var d=[];if(typeof c=="undefined"){c=a.aoHeader;if(typeof b!="undefined"){c=[];Y(c,b)}}b=0;
|
||||
for(var f=c.length;b<f;b++)for(var e=0,h=c[b].length;e<h;e++)if(c[b][e].unique&&(typeof d[e]=="undefined"||!a.bSortCellsTop))d[e]=c[b][e].cell;return d}function Ya(){var a=p.createElement("p"),b=a.style;b.width="100%";b.height="200px";b.padding="0px";var c=p.createElement("div");b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.padding="0px";b.overflow="hidden";c.appendChild(a);p.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";
|
||||
a=a.offsetWidth;if(b==a)a=c.clientWidth;p.body.removeChild(c);return b-a}function P(a,b,c){for(var d=0,f=b.length;d<f;d++)for(var e=0,h=b[d].childNodes.length;e<h;e++)if(b[d].childNodes[e].nodeType==1)typeof c!="undefined"?a(b[d].childNodes[e],c[d].childNodes[e]):a(b[d].childNodes[e])}function o(a,b,c,d){if(typeof d=="undefined")d=c;if(typeof b[c]!="undefined")a[d]=b[c]}function fa(a,b,c){for(var d=[],f=0,e=a.aoColumns.length;f<e;f++)d.push(G(a,b,f,c));return d}function G(a,b,c,d){var f=a.aoColumns[c];
|
||||
if((c=f.fnGetData(a.aoData[b]._aData))===undefined){if(a.iDrawError!=a.iDraw&&f.sDefaultContent===null){J(a,0,"Requested unknown parameter '"+f.mDataProp+"' from the data source for row "+b);a.iDrawError=a.iDraw}return f.sDefaultContent}if(c===null&&f.sDefaultContent!==null)c=f.sDefaultContent;else if(typeof c=="function")return c();if(d=="display"&&c===null)return"";return c}function O(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function aa(a){if(a===null)return function(){return null};
|
||||
else if(typeof a=="function")return function(c){return a(c)};else if(typeof a=="string"&&a.indexOf(".")!=-1){var b=a.split(".");return b.length==2?function(c){return c[b[0]][b[1]]}:b.length==3?function(c){return c[b[0]][b[1]][b[2]]}:function(c){for(var d=0,f=b.length;d<f;d++)c=c[b[d]];return c}}else return function(c){return c[a]}}function Ba(a){if(a===null)return function(){};else if(typeof a=="function")return function(c,d){return a(c,d)};else if(typeof a=="string"&&a.indexOf(".")!=-1){var b=a.split(".");
|
||||
return b.length==2?function(c,d){c[b[0]][b[1]]=d}:b.length==3?function(c,d){c[b[0]][b[1]][b[2]]=d}:function(c,d){for(var f=0,e=b.length-1;f<e;f++)c=c[b[f]];c[b[b.length-1]]=d}}else return function(c,d){c[a]=d}}this.oApi={};this.fnDraw=function(a){var b=A(this[n.iApiIndex]);if(typeof a!="undefined"&&a===false){E(b);C(b)}else da(b)};this.fnFilter=function(a,b,c,d,f){var e=A(this[n.iApiIndex]);if(e.oFeatures.bFilter){if(typeof c=="undefined")c=false;if(typeof d=="undefined")d=true;if(typeof f=="undefined")f=
|
||||
true;if(typeof b=="undefined"||b===null){N(e,{sSearch:a,bRegex:c,bSmart:d},1);if(f&&typeof e.aanFeatures.f!="undefined"){b=e.aanFeatures.f;c=0;for(d=b.length;c<d;c++)i("input",b[c]).val(a)}}else{e.aoPreSearchCols[b].sSearch=a;e.aoPreSearchCols[b].bRegex=c;e.aoPreSearchCols[b].bSmart=d;N(e,e.oPreviousSearch,1)}}};this.fnSettings=function(){return A(this[n.iApiIndex])};this.fnVersionCheck=n.fnVersionCheck;this.fnSort=function(a){var b=A(this[n.iApiIndex]);b.aaSorting=a;R(b)};this.fnSortListener=function(a,
|
||||
b,c){ja(A(this[n.iApiIndex]),a,b,c)};this.fnAddData=function(a,b){if(a.length===0)return[];var c=[],d,f=A(this[n.iApiIndex]);if(typeof a[0]=="object")for(var e=0;e<a.length;e++){d=v(f,a[e]);if(d==-1)return c;c.push(d)}else{d=v(f,a);if(d==-1)return c;c.push(d)}f.aiDisplay=f.aiDisplayMaster.slice();if(typeof b=="undefined"||b)da(f);return c};this.fnDeleteRow=function(a,b,c){var d=A(this[n.iApiIndex]);a=typeof a=="object"?W(d,a):a;var f=d.aoData.splice(a,1),e=i.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,
|
||||
1);ua(d.aiDisplayMaster,a);ua(d.aiDisplay,a);typeof b=="function"&&b.call(this,d,f);if(d._iDisplayStart>=d.aiDisplay.length){d._iDisplayStart-=d._iDisplayLength;if(d._iDisplayStart<0)d._iDisplayStart=0}if(typeof c=="undefined"||c){E(d);C(d)}return f};this.fnClearTable=function(a){var b=A(this[n.iApiIndex]);la(b);if(typeof a=="undefined"||a)C(b)};this.fnOpen=function(a,b,c){var d=A(this[n.iApiIndex]);this.fnClose(a);var f=p.createElement("tr"),e=p.createElement("td");f.appendChild(e);e.className=c;
|
||||
e.colSpan=Z(d);if(typeof b.jquery!="undefined"||typeof b=="object")e.appendChild(b);else e.innerHTML=b;b=i("tr",d.nTBody);i.inArray(a,b)!=-1&&i(f).insertAfter(a);d.aoOpenRows.push({nTr:f,nParent:a});return f};this.fnClose=function(a){for(var b=A(this[n.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a){(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr);b.aoOpenRows.splice(c,1);return 0}return 1};this.fnGetData=function(a,b){var c=A(this[n.iApiIndex]);if(typeof a!=
|
||||
"undefined"){a=typeof a=="object"?W(c,a):a;if(typeof b!="undefined")return G(c,a,b,"");return typeof c.aoData[a]!="undefined"?c.aoData[a]._aData:null}return ca(c)};this.fnGetNodes=function(a){var b=A(this[n.iApiIndex]);if(typeof a!="undefined")return typeof b.aoData[a]!="undefined"?b.aoData[a].nTr:null;return ba(b)};this.fnGetPosition=function(a){var b=A(this[n.iApiIndex]),c=a.nodeName.toUpperCase();if(c=="TR")return W(b,a);else if(c=="TD"||c=="TH"){c=W(b,a.parentNode);for(var d=Q(b,c),f=0;f<b.aoColumns.length;f++)if(d[f]==
|
||||
a)return[c,ta(b,f),f]}return null};this.fnUpdate=function(a,b,c,d,f){var e=A(this[n.iApiIndex]);b=typeof b=="object"?W(e,b):b;if(i.isArray(a)&&typeof a=="object"){e.aoData[b]._aData=a.slice();for(c=0;c<e.aoColumns.length;c++)this.fnUpdate(G(e,b,c),b,c,false,false)}else if(a!==null&&typeof a=="object"){e.aoData[b]._aData=i.extend(true,{},a);for(c=0;c<e.aoColumns.length;c++)this.fnUpdate(G(e,b,c),b,c,false,false)}else{a=a;O(e,b,c,a);if(e.aoColumns[c].fnRender!==null){a=e.aoColumns[c].fnRender({iDataRow:b,
|
||||
iDataColumn:c,aData:e.aoData[b]._aData,oSettings:e});e.aoColumns[c].bUseRendered&&O(e,b,c,a)}if(e.aoData[b].nTr!==null)Q(e,b)[c].innerHTML=a}c=i.inArray(b,e.aiDisplay);e.asDataSearch[c]=ra(e,fa(e,b,"filter"));if(typeof f=="undefined"||f)ea(e);if(typeof d=="undefined"||d)da(e);return 0};this.fnSetColumnVis=function(a,b,c){var d=A(this[n.iApiIndex]),f,e;e=d.aoColumns.length;var h,j;if(d.aoColumns[a].bVisible!=b){if(b){for(f=j=0;f<a;f++)d.aoColumns[f].bVisible&&j++;j=j>=Z(d);if(!j)for(f=a;f<e;f++)if(d.aoColumns[f].bVisible){h=
|
||||
f;break}f=0;for(e=d.aoData.length;f<e;f++)if(d.aoData[f].nTr!==null)j?d.aoData[f].nTr.appendChild(d.aoData[f]._anHidden[a]):d.aoData[f].nTr.insertBefore(d.aoData[f]._anHidden[a],Q(d,f)[h])}else{f=0;for(e=d.aoData.length;f<e;f++)if(d.aoData[f].nTr!==null){h=Q(d,f)[a];d.aoData[f]._anHidden[a]=h;h.parentNode.removeChild(h)}}d.aoColumns[a].bVisible=b;M(d,d.aoHeader);d.nTFoot&&M(d,d.aoFooter);f=0;for(e=d.aoOpenRows.length;f<e;f++)d.aoOpenRows[f].nTr.colSpan=Z(d);if(typeof c=="undefined"||c){ea(d);C(d)}va(d)}};
|
||||
this.fnPageChange=function(a,b){var c=A(this[n.iApiIndex]);ma(c,a);E(c);if(typeof b=="undefined"||b)C(c)};this.fnDestroy=function(){var a=A(this[n.iApiIndex]),b=a.nTableWrapper.parentNode,c=a.nTBody,d,f;a.bDestroying=true;d=0;for(f=a.aoDestroyCallback.length;d<f;d++)a.aoDestroyCallback[d].fn();d=0;for(f=a.aoColumns.length;d<f;d++)a.aoColumns[d].bVisible===false&&this.fnSetColumnVis(d,true);i(a.nTableWrapper).find("*").andSelf().unbind(".DT");i("tbody>tr>td."+a.oClasses.sRowEmpty,a.nTable).parent().remove();
|
||||
if(a.nTable!=a.nTHead.parentNode){i(a.nTable).children("thead").remove();a.nTable.appendChild(a.nTHead)}if(a.nTFoot&&a.nTable!=a.nTFoot.parentNode){i(a.nTable).children("tfoot").remove();a.nTable.appendChild(a.nTFoot)}a.nTable.parentNode.removeChild(a.nTable);i(a.nTableWrapper).remove();a.aaSorting=[];a.aaSortingFixed=[];V(a);i(ba(a)).removeClass(a.asStripeClasses.join(" "));if(a.bJUI){i("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oJUIClasses.sSortableAsc,n.oJUIClasses.sSortableDesc,n.oJUIClasses.sSortableNone].join(" "));
|
||||
i("th span."+n.oJUIClasses.sSortIcon,a.nTHead).remove();i("th",a.nTHead).each(function(){var e=i("div."+n.oJUIClasses.sSortJUIWrapper,this),h=e.contents();i(this).append(h);e.remove()})}else i("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oStdClasses.sSortableAsc,n.oStdClasses.sSortableDesc,n.oStdClasses.sSortableNone].join(" "));a.nTableReinsertBefore?b.insertBefore(a.nTable,a.nTableReinsertBefore):b.appendChild(a.nTable);d=0;for(f=a.aoData.length;d<f;d++)a.aoData[d].nTr!==null&&c.appendChild(a.aoData[d].nTr);
|
||||
if(a.oFeatures.bAutoWidth===true)a.nTable.style.width=q(a.sDestroyWidth);i(c).children("tr:even").addClass(a.asDestroyStripes[0]);i(c).children("tr:odd").addClass(a.asDestroyStripes[1]);d=0;for(f=D.length;d<f;d++)D[d]==a&&D.splice(d,1);a=null};this.fnAdjustColumnSizing=function(a){var b=A(this[n.iApiIndex]);ea(b);if(typeof a=="undefined"||a)this.fnDraw(false);else if(b.oScroll.sX!==""||b.oScroll.sY!=="")this.oApi._fnScrollDraw(b)};for(var xa in n.oApi)if(xa)this[xa]=s(xa);this.oApi._fnExternApiFunc=
|
||||
s;this.oApi._fnInitialise=t;this.oApi._fnInitComplete=w;this.oApi._fnLanguageProcess=y;this.oApi._fnAddColumn=F;this.oApi._fnColumnOptions=x;this.oApi._fnAddData=v;this.oApi._fnCreateTr=z;this.oApi._fnGatherData=$;this.oApi._fnBuildHead=X;this.oApi._fnDrawHead=M;this.oApi._fnDraw=C;this.oApi._fnReDraw=da;this.oApi._fnAjaxUpdate=Ca;this.oApi._fnAjaxParameters=Da;this.oApi._fnAjaxUpdateDraw=Ea;this.oApi._fnServerParams=ha;this.oApi._fnAddOptionsHtml=Aa;this.oApi._fnFeatureHtmlTable=Ja;this.oApi._fnScrollDraw=
|
||||
Ma;this.oApi._fnAdjustColumnSizing=ea;this.oApi._fnFeatureHtmlFilter=Ha;this.oApi._fnFilterComplete=N;this.oApi._fnFilterCustom=Qa;this.oApi._fnFilterColumn=Pa;this.oApi._fnFilter=Oa;this.oApi._fnBuildSearchArray=oa;this.oApi._fnBuildSearchRow=ra;this.oApi._fnFilterCreateSearch=pa;this.oApi._fnDataToSearch=qa;this.oApi._fnSort=R;this.oApi._fnSortAttachListener=ja;this.oApi._fnSortingClasses=V;this.oApi._fnFeatureHtmlPaginate=La;this.oApi._fnPageChange=ma;this.oApi._fnFeatureHtmlInfo=Ka;this.oApi._fnUpdateInfo=
|
||||
Ra;this.oApi._fnFeatureHtmlLength=Ga;this.oApi._fnFeatureHtmlProcessing=Ia;this.oApi._fnProcessingDisplay=K;this.oApi._fnVisibleToColumnIndex=Na;this.oApi._fnColumnIndexToVisible=ta;this.oApi._fnNodeToDataIndex=W;this.oApi._fnVisbleColumns=Z;this.oApi._fnCalculateEnd=E;this.oApi._fnConvertToWidth=Sa;this.oApi._fnCalculateColumnWidths=ga;this.oApi._fnScrollingWidthAdjust=Ua;this.oApi._fnGetWidestNode=Ta;this.oApi._fnGetMaxLenString=Va;this.oApi._fnStringToCss=q;this.oApi._fnArrayCmp=Za;this.oApi._fnDetectType=
|
||||
ia;this.oApi._fnSettingsFromNode=A;this.oApi._fnGetDataMaster=ca;this.oApi._fnGetTrNodes=ba;this.oApi._fnGetTdNodes=Q;this.oApi._fnEscapeRegex=sa;this.oApi._fnDeleteIndex=ua;this.oApi._fnReOrderIndex=Fa;this.oApi._fnColumnOrdering=ka;this.oApi._fnLog=J;this.oApi._fnClearTable=la;this.oApi._fnSaveState=va;this.oApi._fnLoadState=Xa;this.oApi._fnCreateCookie=Wa;this.oApi._fnReadCookie=wa;this.oApi._fnDetectHeader=Y;this.oApi._fnGetUniqueThs=S;this.oApi._fnScrollBarWidth=Ya;this.oApi._fnApplyToChildren=
|
||||
P;this.oApi._fnMap=o;this.oApi._fnGetRowData=fa;this.oApi._fnGetCellData=G;this.oApi._fnSetCellData=O;this.oApi._fnGetObjectDataFn=aa;this.oApi._fnSetObjectDataFn=Ba;var ya=this;return this.each(function(){var a=0,b,c,d,f;a=0;for(b=D.length;a<b;a++){if(D[a].nTable==this)if(typeof g=="undefined"||typeof g.bRetrieve!="undefined"&&g.bRetrieve===true)return D[a].oInstance;else if(typeof g.bDestroy!="undefined"&&g.bDestroy===true){D[a].oInstance.fnDestroy();break}else{J(D[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrieve to true. Alternatively, to destory the old table and create a new one, set bDestroy to true (note that a lot of changes to the configuration can be made through the API which is usually much faster).");
|
||||
return}if(D[a].sTableId!==""&&D[a].sTableId==this.getAttribute("id")){D.splice(a,1);break}}var e=new l;D.push(e);var h=false,j=false;a=this.getAttribute("id");if(a!==null){e.sTableId=a;e.sInstance=a}else e.sInstance=n._oExternConfig.iNextUnique++;if(this.nodeName.toLowerCase()!="table")J(e,0,"Attempted to initialise DataTables on a node which is not a table: "+this.nodeName);else{e.nTable=this;e.oInstance=ya.length==1?ya:i(this).dataTable();e.oApi=ya.oApi;e.sDestroyWidth=i(this).width();if(typeof g!=
|
||||
"undefined"&&g!==null){e.oInit=g;o(e.oFeatures,g,"bPaginate");o(e.oFeatures,g,"bLengthChange");o(e.oFeatures,g,"bFilter");o(e.oFeatures,g,"bSort");o(e.oFeatures,g,"bInfo");o(e.oFeatures,g,"bProcessing");o(e.oFeatures,g,"bAutoWidth");o(e.oFeatures,g,"bSortClasses");o(e.oFeatures,g,"bServerSide");o(e.oFeatures,g,"bDeferRender");o(e.oScroll,g,"sScrollX","sX");o(e.oScroll,g,"sScrollXInner","sXInner");o(e.oScroll,g,"sScrollY","sY");o(e.oScroll,g,"bScrollCollapse","bCollapse");o(e.oScroll,g,"bScrollInfinite",
|
||||
"bInfinite");o(e.oScroll,g,"iScrollLoadGap","iLoadGap");o(e.oScroll,g,"bScrollAutoCss","bAutoCss");o(e,g,"asStripClasses","asStripeClasses");o(e,g,"asStripeClasses");o(e,g,"fnPreDrawCallback");o(e,g,"fnRowCallback");o(e,g,"fnHeaderCallback");o(e,g,"fnFooterCallback");o(e,g,"fnCookieCallback");o(e,g,"fnInitComplete");o(e,g,"fnServerData");o(e,g,"fnFormatNumber");o(e,g,"aaSorting");o(e,g,"aaSortingFixed");o(e,g,"aLengthMenu");o(e,g,"sPaginationType");o(e,g,"sAjaxSource");o(e,g,"sAjaxDataProp");o(e,
|
||||
g,"iCookieDuration");o(e,g,"sCookiePrefix");o(e,g,"sDom");o(e,g,"bSortCellsTop");o(e,g,"oSearch","oPreviousSearch");o(e,g,"aoSearchCols","aoPreSearchCols");o(e,g,"iDisplayLength","_iDisplayLength");o(e,g,"bJQueryUI","bJUI");o(e.oLanguage,g,"fnInfoCallback");typeof g.fnDrawCallback=="function"&&e.aoDrawCallback.push({fn:g.fnDrawCallback,sName:"user"});typeof g.fnServerParams=="function"&&e.aoServerParams.push({fn:g.fnServerParams,sName:"user"});typeof g.fnStateSaveCallback=="function"&&e.aoStateSave.push({fn:g.fnStateSaveCallback,
|
||||
sName:"user"});typeof g.fnStateLoadCallback=="function"&&e.aoStateLoad.push({fn:g.fnStateLoadCallback,sName:"user"});if(e.oFeatures.bServerSide&&e.oFeatures.bSort&&e.oFeatures.bSortClasses)e.aoDrawCallback.push({fn:V,sName:"server_side_sort_classes"});else e.oFeatures.bDeferRender&&e.aoDrawCallback.push({fn:V,sName:"defer_sort_classes"});if(typeof g.bJQueryUI!="undefined"&&g.bJQueryUI){e.oClasses=n.oJUIClasses;if(typeof g.sDom=="undefined")e.sDom='<"H"lfr>t<"F"ip>'}if(e.oScroll.sX!==""||e.oScroll.sY!==
|
||||
"")e.oScroll.iBarWidth=Ya();if(typeof g.iDisplayStart!="undefined"&&typeof e.iInitDisplayStart=="undefined"){e.iInitDisplayStart=g.iDisplayStart;e._iDisplayStart=g.iDisplayStart}if(typeof g.bStateSave!="undefined"){e.oFeatures.bStateSave=g.bStateSave;Xa(e,g);e.aoDrawCallback.push({fn:va,sName:"state_save"})}if(typeof g.iDeferLoading!="undefined"){e.bDeferLoading=true;e._iRecordsTotal=g.iDeferLoading;e._iRecordsDisplay=g.iDeferLoading}if(typeof g.aaData!="undefined")j=true;if(typeof g!="undefined"&&
|
||||
typeof g.aoData!="undefined")g.aoColumns=g.aoData;if(typeof g.oLanguage!="undefined")if(typeof g.oLanguage.sUrl!="undefined"&&g.oLanguage.sUrl!==""){e.oLanguage.sUrl=g.oLanguage.sUrl;i.getJSON(e.oLanguage.sUrl,null,function(u){y(e,u,true)});h=true}else y(e,g.oLanguage,false)}else g={};if(typeof g.asStripClasses=="undefined"&&typeof g.asStripeClasses=="undefined"){e.asStripeClasses.push(e.oClasses.sStripeOdd);e.asStripeClasses.push(e.oClasses.sStripeEven)}c=false;d=i(this).children("tbody").children("tr");
|
||||
a=0;for(b=e.asStripeClasses.length;a<b;a++)if(d.filter(":lt(2)").hasClass(e.asStripeClasses[a])){c=true;break}if(c){e.asDestroyStripes=["",""];if(i(d[0]).hasClass(e.oClasses.sStripeOdd))e.asDestroyStripes[0]+=e.oClasses.sStripeOdd+" ";if(i(d[0]).hasClass(e.oClasses.sStripeEven))e.asDestroyStripes[0]+=e.oClasses.sStripeEven;if(i(d[1]).hasClass(e.oClasses.sStripeOdd))e.asDestroyStripes[1]+=e.oClasses.sStripeOdd+" ";if(i(d[1]).hasClass(e.oClasses.sStripeEven))e.asDestroyStripes[1]+=e.oClasses.sStripeEven;
|
||||
d.removeClass(e.asStripeClasses.join(" "))}c=[];var k;a=this.getElementsByTagName("thead");if(a.length!==0){Y(e.aoHeader,a[0]);c=S(e)}if(typeof g.aoColumns=="undefined"){k=[];a=0;for(b=c.length;a<b;a++)k.push(null)}else k=g.aoColumns;a=0;for(b=k.length;a<b;a++){if(typeof g.saved_aoColumns!="undefined"&&g.saved_aoColumns.length==b){if(k[a]===null)k[a]={};k[a].bVisible=g.saved_aoColumns[a].bVisible}F(e,c?c[a]:null)}if(typeof g.aoColumnDefs!="undefined")for(a=g.aoColumnDefs.length-1;a>=0;a--){var m=
|
||||
g.aoColumnDefs[a].aTargets;i.isArray(m)||J(e,1,"aTargets must be an array of targets, not a "+typeof m);c=0;for(d=m.length;c<d;c++)if(typeof m[c]=="number"&&m[c]>=0){for(;e.aoColumns.length<=m[c];)F(e);x(e,m[c],g.aoColumnDefs[a])}else if(typeof m[c]=="number"&&m[c]<0)x(e,e.aoColumns.length+m[c],g.aoColumnDefs[a]);else if(typeof m[c]=="string"){b=0;for(f=e.aoColumns.length;b<f;b++)if(m[c]=="_all"||i(e.aoColumns[b].nTh).hasClass(m[c]))x(e,b,g.aoColumnDefs[a])}}if(typeof k!="undefined"){a=0;for(b=k.length;a<
|
||||
b;a++)x(e,a,k[a])}a=0;for(b=e.aaSorting.length;a<b;a++){if(e.aaSorting[a][0]>=e.aoColumns.length)e.aaSorting[a][0]=0;k=e.aoColumns[e.aaSorting[a][0]];if(typeof e.aaSorting[a][2]=="undefined")e.aaSorting[a][2]=0;if(typeof g.aaSorting=="undefined"&&typeof e.saved_aaSorting=="undefined")e.aaSorting[a][1]=k.asSorting[0];c=0;for(d=k.asSorting.length;c<d;c++)if(e.aaSorting[a][1]==k.asSorting[c]){e.aaSorting[a][2]=c;break}}V(e);a=i(this).children("thead");if(a.length===0){a=[p.createElement("thead")];this.appendChild(a[0])}e.nTHead=
|
||||
a[0];a=i(this).children("tbody");if(a.length===0){a=[p.createElement("tbody")];this.appendChild(a[0])}e.nTBody=a[0];a=i(this).children("tfoot");if(a.length>0){e.nTFoot=a[0];Y(e.aoFooter,e.nTFoot)}if(j)for(a=0;a<g.aaData.length;a++)v(e,g.aaData[a]);else $(e);e.aiDisplay=e.aiDisplayMaster.slice();e.bInitialised=true;h===false&&t(e)}})}})(jQuery,window,document);
|
543
assets/js/jquery.jeditable.js
Normal file
|
@ -0,0 +1,543 @@
|
|||
/*
|
||||
* Jeditable - jQuery in place edit plugin
|
||||
*
|
||||
* Copyright (c) 2006-2009 Mika Tuupola, Dylan Verheul
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Project home:
|
||||
* http://www.appelsiini.net/projects/jeditable
|
||||
*
|
||||
* Based on editable by Dylan Verheul <dylan_at_dyve.net>:
|
||||
* http://www.dyve.net/jquery/?editable
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Version 1.7.1
|
||||
*
|
||||
* ** means there is basic unit tests for this parameter.
|
||||
*
|
||||
* @name Jeditable
|
||||
* @type jQuery
|
||||
* @param String target (POST) URL or function to send edited content to **
|
||||
* @param Hash options additional options
|
||||
* @param String options[method] method to use to send edited content (POST or PUT) **
|
||||
* @param Function options[callback] Function to run after submitting edited content **
|
||||
* @param String options[name] POST parameter name of edited content
|
||||
* @param String options[id] POST parameter name of edited div id
|
||||
* @param Hash options[submitdata] Extra parameters to send when submitting edited content.
|
||||
* @param String options[type] text, textarea or select (or any 3rd party input type) **
|
||||
* @param Integer options[rows] number of rows if using textarea **
|
||||
* @param Integer options[cols] number of columns if using textarea **
|
||||
* @param Mixed options[height] 'auto', 'none' or height in pixels **
|
||||
* @param Mixed options[width] 'auto', 'none' or width in pixels **
|
||||
* @param String options[loadurl] URL to fetch input content before editing **
|
||||
* @param String options[loadtype] Request type for load url. Should be GET or POST.
|
||||
* @param String options[loadtext] Text to display while loading external content.
|
||||
* @param Mixed options[loaddata] Extra parameters to pass when fetching content before editing.
|
||||
* @param Mixed options[data] Or content given as paramameter. String or function.**
|
||||
* @param String options[indicator] indicator html to show when saving
|
||||
* @param String options[tooltip] optional tooltip text via title attribute **
|
||||
* @param String options[event] jQuery event such as 'click' of 'dblclick' **
|
||||
* @param String options[submit] submit button value, empty means no button **
|
||||
* @param String options[cancel] cancel button value, empty means no button **
|
||||
* @param String options[cssclass] CSS class to apply to input form. 'inherit' to copy from parent. **
|
||||
* @param String options[style] Style to apply to input form 'inherit' to copy from parent. **
|
||||
* @param String options[select] true or false, when true text is highlighted ??
|
||||
* @param String options[placeholder] Placeholder text or html to insert when element is empty. **
|
||||
* @param String options[onblur] 'cancel', 'submit', 'ignore' or function ??
|
||||
*
|
||||
* @param Function options[onsubmit] function(settings, original) { ... } called before submit
|
||||
* @param Function options[onreset] function(settings, original) { ... } called before reset
|
||||
* @param Function options[onerror] function(settings, original, xhr) { ... } called on error
|
||||
*
|
||||
* @param Hash options[ajaxoptions] jQuery Ajax options. See docs.jquery.com.
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.fn.editable = function(target, options) {
|
||||
|
||||
if ('disable' == target) {
|
||||
$(this).data('disabled.editable', true);
|
||||
return;
|
||||
}
|
||||
if ('enable' == target) {
|
||||
$(this).data('disabled.editable', false);
|
||||
return;
|
||||
}
|
||||
if ('destroy' == target) {
|
||||
$(this)
|
||||
.unbind($(this).data('event.editable'))
|
||||
.removeData('disabled.editable')
|
||||
.removeData('event.editable');
|
||||
return;
|
||||
}
|
||||
|
||||
var settings = $.extend({}, $.fn.editable.defaults, {target:target}, options);
|
||||
|
||||
/* setup some functions */
|
||||
var plugin = $.editable.types[settings.type].plugin || function() { };
|
||||
var submit = $.editable.types[settings.type].submit || function() { };
|
||||
var buttons = $.editable.types[settings.type].buttons
|
||||
|| $.editable.types['defaults'].buttons;
|
||||
var content = $.editable.types[settings.type].content
|
||||
|| $.editable.types['defaults'].content;
|
||||
var element = $.editable.types[settings.type].element
|
||||
|| $.editable.types['defaults'].element;
|
||||
var reset = $.editable.types[settings.type].reset
|
||||
|| $.editable.types['defaults'].reset;
|
||||
var callback = settings.callback || function() { };
|
||||
var onedit = settings.onedit || function() { };
|
||||
var onsubmit = settings.onsubmit || function() { };
|
||||
var onreset = settings.onreset || function() { };
|
||||
var onerror = settings.onerror || reset;
|
||||
|
||||
/* show tooltip */
|
||||
if (settings.tooltip) {
|
||||
$(this).attr('title', settings.tooltip);
|
||||
}
|
||||
|
||||
settings.autowidth = 'auto' == settings.width;
|
||||
settings.autoheight = 'auto' == settings.height;
|
||||
|
||||
return this.each(function() {
|
||||
|
||||
/* save this to self because this changes when scope changes */
|
||||
var self = this;
|
||||
|
||||
/* inlined block elements lose their width and height after first edit */
|
||||
/* save them for later use as workaround */
|
||||
var savedwidth = $(self).width();
|
||||
var savedheight = $(self).height();
|
||||
|
||||
/* save so it can be later used by $.editable('destroy') */
|
||||
$(this).data('event.editable', settings.event);
|
||||
|
||||
/* if element is empty add something clickable (if requested) */
|
||||
if (!$.trim($(this).html())) {
|
||||
$(this).html(settings.placeholder);
|
||||
}
|
||||
|
||||
$(this).bind(settings.event, function(e) {
|
||||
|
||||
/* abort if disabled for this element */
|
||||
if (true === $(this).data('disabled.editable')) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* prevent throwing an exeption if edit field is clicked again */
|
||||
if (self.editing) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* abort if onedit hook returns false */
|
||||
if (false === onedit.apply(this, [settings, self])) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* prevent default action and bubbling */
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
/* remove tooltip */
|
||||
if (settings.tooltip) {
|
||||
$(self).removeAttr('title');
|
||||
}
|
||||
|
||||
/* figure out how wide and tall we are, saved width and height */
|
||||
/* are workaround for http://dev.jquery.com/ticket/2190 */
|
||||
if (0 == $(self).width()) {
|
||||
//$(self).css('visibility', 'hidden');
|
||||
settings.width = savedwidth;
|
||||
settings.height = savedheight;
|
||||
} else {
|
||||
if (settings.width != 'none') {
|
||||
settings.width =
|
||||
settings.autowidth ? $(self).width() : settings.width;
|
||||
}
|
||||
if (settings.height != 'none') {
|
||||
settings.height =
|
||||
settings.autoheight ? $(self).height() : settings.height;
|
||||
}
|
||||
}
|
||||
//$(this).css('visibility', '');
|
||||
|
||||
/* remove placeholder text, replace is here because of IE */
|
||||
if ($(this).html().toLowerCase().replace(/(;|")/g, '') ==
|
||||
settings.placeholder.toLowerCase().replace(/(;|")/g, '')) {
|
||||
$(this).html('');
|
||||
}
|
||||
|
||||
self.editing = true;
|
||||
self.revert = $(self).html();
|
||||
$(self).html('');
|
||||
|
||||
/* create the form object */
|
||||
var form = $('<form />');
|
||||
|
||||
/* apply css or style or both */
|
||||
if (settings.cssclass) {
|
||||
if ('inherit' == settings.cssclass) {
|
||||
form.attr('class', $(self).attr('class'));
|
||||
} else {
|
||||
form.attr('class', settings.cssclass);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.style) {
|
||||
if ('inherit' == settings.style) {
|
||||
form.attr('style', $(self).attr('style'));
|
||||
/* IE needs the second line or display wont be inherited */
|
||||
form.css('display', $(self).css('display'));
|
||||
} else {
|
||||
form.attr('style', settings.style);
|
||||
}
|
||||
}
|
||||
|
||||
/* add main input element to form and store it in input */
|
||||
var input = element.apply(form, [settings, self]);
|
||||
|
||||
/* set input content via POST, GET, given data or existing value */
|
||||
var input_content;
|
||||
|
||||
if (settings.loadurl) {
|
||||
var t = setTimeout(function() {
|
||||
input.disabled = true;
|
||||
content.apply(form, [settings.loadtext, settings, self]);
|
||||
}, 100);
|
||||
|
||||
var loaddata = {};
|
||||
loaddata[settings.id] = self.id;
|
||||
if ($.isFunction(settings.loaddata)) {
|
||||
$.extend(loaddata, settings.loaddata.apply(self, [self.revert, settings]));
|
||||
} else {
|
||||
$.extend(loaddata, settings.loaddata);
|
||||
}
|
||||
$.ajax({
|
||||
type : settings.loadtype,
|
||||
url : settings.loadurl,
|
||||
data : loaddata,
|
||||
async : false,
|
||||
success: function(result) {
|
||||
window.clearTimeout(t);
|
||||
input_content = result;
|
||||
input.disabled = false;
|
||||
}
|
||||
});
|
||||
} else if (settings.data) {
|
||||
input_content = settings.data;
|
||||
if ($.isFunction(settings.data)) {
|
||||
input_content = settings.data.apply(self, [self.revert, settings]);
|
||||
}
|
||||
} else {
|
||||
input_content = self.revert;
|
||||
}
|
||||
content.apply(form, [input_content, settings, self]);
|
||||
|
||||
input.attr('name', settings.name);
|
||||
|
||||
/* add buttons to the form */
|
||||
buttons.apply(form, [settings, self]);
|
||||
|
||||
/* add created form to self */
|
||||
$(self).append(form);
|
||||
|
||||
/* attach 3rd party plugin if requested */
|
||||
plugin.apply(form, [settings, self]);
|
||||
|
||||
/* focus to first visible form element */
|
||||
$(':input:visible:enabled:first', form).focus();
|
||||
|
||||
/* highlight input contents when requested */
|
||||
if (settings.select) {
|
||||
input.select();
|
||||
}
|
||||
|
||||
/* discard changes if pressing esc */
|
||||
input.keydown(function(e) {
|
||||
if (e.keyCode == 27) {
|
||||
e.preventDefault();
|
||||
//self.reset();
|
||||
reset.apply(form, [settings, self]);
|
||||
}
|
||||
});
|
||||
|
||||
/* discard, submit or nothing with changes when clicking outside */
|
||||
/* do nothing is usable when navigating with tab */
|
||||
var t;
|
||||
if ('cancel' == settings.onblur) {
|
||||
input.blur(function(e) {
|
||||
/* prevent canceling if submit was clicked */
|
||||
t = setTimeout(function() {
|
||||
reset.apply(form, [settings, self]);
|
||||
}, 500);
|
||||
});
|
||||
} else if ('submit' == settings.onblur) {
|
||||
input.blur(function(e) {
|
||||
/* prevent double submit if submit was clicked */
|
||||
t = setTimeout(function() {
|
||||
form.submit();
|
||||
}, 200);
|
||||
});
|
||||
} else if ($.isFunction(settings.onblur)) {
|
||||
input.blur(function(e) {
|
||||
settings.onblur.apply(self, [input.val(), settings]);
|
||||
});
|
||||
} else {
|
||||
input.blur(function(e) {
|
||||
/* TODO: maybe something here */
|
||||
});
|
||||
}
|
||||
|
||||
form.submit(function(e) {
|
||||
|
||||
if (t) {
|
||||
clearTimeout(t);
|
||||
}
|
||||
|
||||
/* do no submit */
|
||||
e.preventDefault();
|
||||
|
||||
/* call before submit hook. */
|
||||
/* if it returns false abort submitting */
|
||||
if (false !== onsubmit.apply(form, [settings, self])) {
|
||||
/* custom inputs call before submit hook. */
|
||||
/* if it returns false abort submitting */
|
||||
if (false !== submit.apply(form, [settings, self])) {
|
||||
|
||||
/* check if given target is function */
|
||||
if ($.isFunction(settings.target)) {
|
||||
var str = settings.target.apply(self, [input.val(), settings]);
|
||||
$(self).html(str);
|
||||
self.editing = false;
|
||||
callback.apply(self, [self.innerHTML, settings]);
|
||||
/* TODO: this is not dry */
|
||||
if (!$.trim($(self).html())) {
|
||||
$(self).html(settings.placeholder);
|
||||
}
|
||||
} else {
|
||||
/* add edited content and id of edited element to POST */
|
||||
var submitdata = {};
|
||||
submitdata[settings.name] = input.val();
|
||||
submitdata[settings.id] = self.id;
|
||||
/* add extra data to be POST:ed */
|
||||
if ($.isFunction(settings.submitdata)) {
|
||||
$.extend(submitdata, settings.submitdata.apply(self, [self.revert, settings]));
|
||||
} else {
|
||||
$.extend(submitdata, settings.submitdata);
|
||||
}
|
||||
|
||||
/* quick and dirty PUT support */
|
||||
if ('PUT' == settings.method) {
|
||||
submitdata['_method'] = 'put';
|
||||
}
|
||||
|
||||
/* show the saving indicator */
|
||||
$(self).html(settings.indicator);
|
||||
|
||||
/* defaults for ajaxoptions */
|
||||
var ajaxoptions = {
|
||||
type : 'POST',
|
||||
data : submitdata,
|
||||
dataType: 'html',
|
||||
url : settings.target,
|
||||
success : function(result, status) {
|
||||
if (ajaxoptions.dataType == 'html') {
|
||||
$(self).html(result);
|
||||
}
|
||||
self.editing = false;
|
||||
callback.apply(self, [result, settings]);
|
||||
if (!$.trim($(self).html())) {
|
||||
$(self).html(settings.placeholder);
|
||||
}
|
||||
},
|
||||
error : function(xhr, status, error) {
|
||||
onerror.apply(form, [settings, self, xhr]);
|
||||
}
|
||||
};
|
||||
|
||||
/* override with what is given in settings.ajaxoptions */
|
||||
$.extend(ajaxoptions, settings.ajaxoptions);
|
||||
$.ajax(ajaxoptions);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* show tooltip again */
|
||||
$(self).attr('title', settings.tooltip);
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
/* privileged methods */
|
||||
this.reset = function(form) {
|
||||
/* prevent calling reset twice when blurring */
|
||||
if (this.editing) {
|
||||
/* before reset hook, if it returns false abort reseting */
|
||||
if (false !== onreset.apply(form, [settings, self])) {
|
||||
$(self).html(self.revert);
|
||||
self.editing = false;
|
||||
if (!$.trim($(self).html())) {
|
||||
$(self).html(settings.placeholder);
|
||||
}
|
||||
/* show tooltip again */
|
||||
if (settings.tooltip) {
|
||||
$(self).attr('title', settings.tooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
$.editable = {
|
||||
types: {
|
||||
defaults: {
|
||||
element : function(settings, original) {
|
||||
var input = $('<input type="hidden"></input>');
|
||||
$(this).append(input);
|
||||
return(input);
|
||||
},
|
||||
content : function(string, settings, original) {
|
||||
$(':input:first', this).val(string);
|
||||
},
|
||||
reset : function(settings, original) {
|
||||
original.reset(this);
|
||||
},
|
||||
buttons : function(settings, original) {
|
||||
var form = this;
|
||||
if (settings.submit) {
|
||||
/* if given html string use that */
|
||||
if (settings.submit.match(/>$/)) {
|
||||
var submit = $(settings.submit).click(function() {
|
||||
if (submit.attr("type") != "submit") {
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
/* otherwise use button with given string as text */
|
||||
} else {
|
||||
var submit = $('<button type="submit" />');
|
||||
submit.html(settings.submit);
|
||||
}
|
||||
$(this).append(submit);
|
||||
}
|
||||
if (settings.cancel) {
|
||||
/* if given html string use that */
|
||||
if (settings.cancel.match(/>$/)) {
|
||||
var cancel = $(settings.cancel);
|
||||
/* otherwise use button with given string as text */
|
||||
} else {
|
||||
var cancel = $('<button type="cancel" />');
|
||||
cancel.html(settings.cancel);
|
||||
}
|
||||
$(this).append(cancel);
|
||||
|
||||
$(cancel).click(function(event) {
|
||||
//original.reset();
|
||||
if ($.isFunction($.editable.types[settings.type].reset)) {
|
||||
var reset = $.editable.types[settings.type].reset;
|
||||
} else {
|
||||
var reset = $.editable.types['defaults'].reset;
|
||||
}
|
||||
reset.apply(form, [settings, original]);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
text: {
|
||||
element : function(settings, original) {
|
||||
var input = $('<input />');
|
||||
if (settings.width != 'none') { input.width(settings.width); }
|
||||
if (settings.height != 'none') { input.height(settings.height); }
|
||||
/* https://bugzilla.mozilla.org/show_bug.cgi?id=236791 */
|
||||
//input[0].setAttribute('autocomplete','off');
|
||||
input.attr('autocomplete','off');
|
||||
$(this).append(input);
|
||||
return(input);
|
||||
}
|
||||
},
|
||||
textarea: {
|
||||
element : function(settings, original) {
|
||||
var textarea = $('<textarea />');
|
||||
if (settings.rows) {
|
||||
textarea.attr('rows', settings.rows);
|
||||
} else if (settings.height != "none") {
|
||||
textarea.height(settings.height);
|
||||
}
|
||||
if (settings.cols) {
|
||||
textarea.attr('cols', settings.cols);
|
||||
} else if (settings.width != "none") {
|
||||
textarea.width(settings.width);
|
||||
}
|
||||
$(this).append(textarea);
|
||||
return(textarea);
|
||||
}
|
||||
},
|
||||
select: {
|
||||
element : function(settings, original) {
|
||||
var select = $('<select />');
|
||||
$(this).append(select);
|
||||
return(select);
|
||||
},
|
||||
content : function(data, settings, original) {
|
||||
/* If it is string assume it is json. */
|
||||
if (String == data.constructor) {
|
||||
eval ('var json = ' + data);
|
||||
} else {
|
||||
/* Otherwise assume it is a hash already. */
|
||||
var json = data;
|
||||
}
|
||||
for (var key in json) {
|
||||
if (!json.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
if ('selected' == key) {
|
||||
continue;
|
||||
}
|
||||
var option = $('<option />').val(key).append(json[key]);
|
||||
$('select', this).append(option);
|
||||
}
|
||||
/* Loop option again to set selected. IE needed this... */
|
||||
$('select', this).children().each(function() {
|
||||
if ($(this).val() == json['selected'] ||
|
||||
$(this).text() == $.trim(original.revert)) {
|
||||
$(this).attr('selected', 'selected');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/* Add new input type */
|
||||
addInputType: function(name, input) {
|
||||
$.editable.types[name] = input;
|
||||
}
|
||||
};
|
||||
|
||||
// publicly accessible defaults
|
||||
$.fn.editable.defaults = {
|
||||
name : 'value',
|
||||
id : 'id',
|
||||
type : 'text',
|
||||
width : 'auto',
|
||||
height : 'auto',
|
||||
event : 'click.editable',
|
||||
onblur : 'cancel',
|
||||
loadtype : 'GET',
|
||||
loadtext : 'Loading...',
|
||||
placeholder: '',
|
||||
loaddata : {},
|
||||
submitdata : {},
|
||||
ajaxoptions: {}
|
||||
};
|
||||
|
||||
})(jQuery);
|
7
assets/js/jquery.localize.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* jQuery plugin for localizing dates and times via
|
||||
* the datetime attribute of the HTML5 <time> element.
|
||||
*
|
||||
* https://bitbucket.org/davidchambers/jquery.localize
|
||||
*/
|
||||
(function(e){var a="0.7.2",h=e.extend,d=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(?:[.](\d+))?)?(?:([-+]\d\d):(\d\d)|Z)$/,b=function(j,i,k){if(k){j.setHours(c.H(j)-i,c.M(j)+(i>0?-k:+k))}return j},f=function(i,j){return(i+1000+"").substr(4-(j||2))},c={yy:function(i){return f(c.yyyy(i)%100)},yyyy:function(i){return i.getFullYear()},m:function(i){return i.getMonth()+1},mm:function(i){return f(c.m(i))},mmm:function(i){return g.abbrMonths[c.m(i)-1]},mmmm:function(i){return g.fullMonths[c.m(i)-1]},d:function(i){return i.getDate()},dd:function(i){return f(c.d(i))},ddd:function(i){return g.abbrDays[i.getDay()]},dddd:function(i){return g.fullDays[i.getDay()]},o:function(i){return g.ordinals(c.d(i))},h:function(i){return c.H(i)%12||12},hh:function(i){return f(c.h(i))},H:function(i){return i.getHours()},HH:function(i){return f(c.H(i))},M:function(i){return i.getMinutes()},MM:function(i){return f(c.M(i))},s:function(i){return i.getSeconds()},ss:function(i){return f(c.s(i))},S:function(i){return c.s(i)+"."+f(i%1000,3)},SS:function(i){return c.ss(i)+"."+f(i%1000,3)},a:function(i){return g.periods[+(c.H(i)>11)]},Z:function(i){var k=-i.getTimezoneOffset(),j=Math.abs(k);return(k<0?"-":"+")+f(j/60>>0)+":"+f(j%60)}},g=function(j,p){if(!(j instanceof Date)){p=j;j=new Date}p=p||g.format;if(typeof p==="function"){return p(j)}var o=p.replace("~","~T").replace("%%","~P")+"%",m,k="",q=0,n=o.length,i="",l;while(q<n){m=o.charAt(q++);if(k){if(m===l||k==="%"){k+=m}else{k=k.substr(1);i+=c.hasOwnProperty(k)?g.escaped?e("<b>").text(c[k](j)).html():c[k](j):k}}if(!/%/.test(k)){if(/%/.test(p)){if(m==="%"){k="%"}else{k="";i+=m}}else{k="%"+m}}l=m}return i.replace("~P","%").replace("~T","~")};h(g,{abbrDays:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),abbrMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),format:"d mmmm yyyy",fullDays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),fullMonths:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),ordinals:function(i){return i+["th","st","nd","rd"][i>10&&i<14||(i%=10)>3?0:i]},periods:["AM","PM"]});e.localize=g;e.localize.version=a;e.fn.localize=function(k){var i=h({},g),j,l;if(typeof k==="object"){h(i,k);k=i.format}k=k||g.format;j=typeof k==="function";l=i.escaped?"html":"text";return this.each(function(){var p=e(this),o,n;if(/^time$/i.test(this.nodeName)){n=d.exec(p.attr("datetime")||g(new Date,"yyyy-mm-ddTHH:MM:ssZ"))}if(!n){return}o=b(new Date(Date.UTC(+n[1],n[2]-1,+n[3],+n[4],+n[5],+n[6]||0,+((n[7]||0)+"00").substr(0,3))),+n[8],n[9]);p.attr("datetime",g(o,"yyyy-mm-ddTHH:MM"+(n[7]?":SS":n[6]?":ss":"")+"Z"))[l](j?k.call(p,o):g(o,k))})}}(jQuery));
|
3
assets/js/jquery.tablesorter.min.js
vendored
Normal file
61
history.html
Normal file
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>AniTV Schedule - History</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/bootstrap.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/bootstrap-app.css" />
|
||||
|
||||
<!-- JS -->
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/jquery.localize.js"></script>
|
||||
<script type="text/javascript" src="assets/js/anitv-history.js"></script>
|
||||
<script type="text/javascript" src="assets/js/clock.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<div class="fill">
|
||||
<div class="container">
|
||||
<a class="brand" href="#">AniTV Schedule</a>
|
||||
<ul class="nav">
|
||||
<li><a href="index.html">Home</a></li>
|
||||
<li><a href="api.html" data-view="api">API</a></li>
|
||||
<li><a href="manage.html" data-view="manage">Manage</a></li>
|
||||
<li class="active"><a href="history.html" data-view="history">History</a></li>
|
||||
</ul>
|
||||
<p class="pull-right" id="clock"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="content" id="view">
|
||||
<div class="page-header">
|
||||
<h1>History <small>logs of changes and modifications</small></h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<table class="zebra-striped" id="history">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Show</th>
|
||||
<th>Modification</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p>AniTV Schedule 0.2.0 © TEAM SEPTiCORE 2011</p>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
64
index.html
Normal file
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>AniTV Schedule</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/bootstrap.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/bootstrap-app.css" />
|
||||
|
||||
<!-- JS -->
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/jquery.localize.js"></script>
|
||||
<script type="text/javascript" src="assets/js/anitv-schedule.js"></script>
|
||||
<script type="text/javascript" src="assets/js/clock.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<div class="fill">
|
||||
<div class="container">
|
||||
<a class="brand" href="#">AniTV Schedule</a>
|
||||
<ul class="nav">
|
||||
<li class="active"><a href="index.html">Home</a></li>
|
||||
<li><a href="api.html" data-view="api">API</a></li>
|
||||
<li><a href="manage.html" data-view="manage">Manage</a></li>
|
||||
<li><a href="history.html" data-view="history">History</a></li>
|
||||
</ul>
|
||||
<p class="pull-right" id="clock"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="content" id="view">
|
||||
<div class="page-header">
|
||||
<h1>Schedule <small>watch and view shows</small></h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<table class="zebra-striped" id="schedule">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="header"></th>
|
||||
<th class="header text-align-left">Program</th>
|
||||
<th class="header">Episode #</th>
|
||||
<th class="header">Station</th>
|
||||
<th class="header">Broadcast Time</th>
|
||||
<th class="header">ETA</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p>AniTV Schedule 0.2.0 © TEAM SEPTiCORE 2011</p>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
18
install/README.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
INSTALLATION
|
||||
============
|
||||
|
||||
|
||||
INSTRUCTIONS
|
||||
------------
|
||||
|
||||
- Login to phpMyAdmin.
|
||||
|
||||
- Create a database.
|
||||
|
||||
- Import the database structure from `database-schema.sql`.
|
||||
|
||||
- Modify the config located at `/system/config.php` with your database information.
|
||||
|
||||
- Access the following links: `http://hostname/system/database.php?action=sync&data=anidb`, `http://hostname/system/database.php?action=sync&data=title`, `http://hostname/system/database.php?action=sync&data=program`
|
||||
|
||||
- Setup a cron to run those commands/links to update information automatically.
|
348
install/database-schema.sql
Normal file
|
@ -0,0 +1,348 @@
|
|||
-- phpMyAdmin SQL Dump
|
||||
-- version 3.4.3.2
|
||||
-- http://www.phpmyadmin.net
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
|
||||
--
|
||||
-- Database: `anitv`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anidb`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anidb` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`aid` int(11) NOT NULL,
|
||||
`type` int(11) NOT NULL,
|
||||
`language` varchar(32) NOT NULL,
|
||||
`title` tinytext NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
FULLTEXT KEY `title` (`title`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `channel`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `channel` (
|
||||
`ChID` int(11) NOT NULL,
|
||||
`ChGID` int(11) NOT NULL,
|
||||
`ChName` varchar(128) NOT NULL,
|
||||
`ChNameEN` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`ChID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `channel`
|
||||
--
|
||||
|
||||
INSERT INTO `channel` (`ChID`, `ChGID`, `ChName`, `ChNameEN`) VALUES
|
||||
(1, 11, 'NHK総合', 'NHK General'),
|
||||
(2, 11, 'NHK教育', 'NHK Educational'),
|
||||
(3, 1, 'フジテレビ', 'Fuji TV'),
|
||||
(4, 1, '日本テレビ', 'NTV'),
|
||||
(5, 1, 'TBS', ''),
|
||||
(6, 1, 'テレビ朝日', 'TV Asahi'),
|
||||
(7, 1, 'テレビ東京', 'TV Tokyo'),
|
||||
(8, 1, 'tvk', ''),
|
||||
(9, 9, 'NHK-BS1', ''),
|
||||
(10, 9, 'NHK-BS2', ''),
|
||||
(11, 2, 'NHK-BShi', ''),
|
||||
(12, 9, 'WOWOW', ''),
|
||||
(13, 1, 'チバテレビ', 'Chiba TV'),
|
||||
(14, 1, 'テレ玉', 'Teletama'),
|
||||
(15, 2, 'BS Japan', ''),
|
||||
(16, 2, 'BS-TBS', ''),
|
||||
(17, 2, 'BSフジ', 'BS Fuji'),
|
||||
(18, 2, 'BS朝日', ''),
|
||||
(19, 1, 'TOKYO MX', ''),
|
||||
(20, 6, 'AT-X', ''),
|
||||
(21, 6, 'アニマックス', 'Animax'),
|
||||
(22, 6, 'キッズステーション', 'Kid''s Station'),
|
||||
(23, 6, 'カートゥーンネットワーク', 'Cartoon Network'),
|
||||
(24, 6, 'CS GyaO', ''),
|
||||
(25, 6, 'テレ朝チャンネル', 'TV Asahi Channel'),
|
||||
(26, 6, 'チャンネルNECO', 'Channel NECO'),
|
||||
(27, 7, 'animate.tv', ''),
|
||||
(28, 8, 'テレビ大阪', 'TV Osaka'),
|
||||
(29, 7, 'ラジ@', 'Raji@'),
|
||||
(30, 12, 'ニッポン放送(1242)', 'Nippon Broadcasting (1242)'),
|
||||
(31, 6, 'スカパー181ch', 'SkyPerfect 181'),
|
||||
(32, 6, 'スカパー180ch', 'SkyPerfect 180'),
|
||||
(33, 6, 'スカパー160ch', 'SkyPerfect 160'),
|
||||
(34, 6, 'スカパー242ch', 'SkyPerfect 242'),
|
||||
(35, 15, 'ラジオ大阪(1314)', 'Radio Osaka (1314)'),
|
||||
(36, 15, 'KBS京都(1143)', 'KBS Kyoto (1143)'),
|
||||
(37, 16, 'RCC中国放送(1350)', 'RCC Chuugoku Broadcasting (1350)'),
|
||||
(38, 15, 'ABCラジオ(1008)', ''),
|
||||
(39, 6, '東映チャンネル', 'Toei Channel'),
|
||||
(40, 6, '日本映画専門チャンネル', 'Japan Movie Channel'),
|
||||
(41, 12, '文化放送(1134)', 'Culture Broadcasting (1134)'),
|
||||
(42, 6, 'ファミリー劇場', 'Family Theatre'),
|
||||
(43, 6, 'フジテレビTWO', 'Fuji TV TWO'),
|
||||
(44, 6, 'スカパー182ch', 'SkyPerfect 182'),
|
||||
(45, 6, 'スカパー183ch', 'SkyPerfect 183'),
|
||||
(46, 7, 'mugimugi.com', ''),
|
||||
(47, 6, 'MONDOTV', ''),
|
||||
(48, 8, 'MBS毎日放送', 'MBS Mainichi Broadcasting'),
|
||||
(49, 10, 'NHKラジオ第一', 'NHK #1 Radio'),
|
||||
(50, 2, 'BSQR 489', ''),
|
||||
(51, 2, 'LFX488', ''),
|
||||
(52, 6, 'TBSチャンネル', ''),
|
||||
(53, 12, 'TBSラジオ(954)', ''),
|
||||
(54, 8, '読売テレビ', 'Yomiuri TV'),
|
||||
(55, 6, 'YFTV', ''),
|
||||
(56, 6, 'アニマルプラネット', 'Animal Planet'),
|
||||
(57, 7, 'その他のインターネット', 'Other Internet Channels'),
|
||||
(58, 8, 'サンテレビジョン', 'Sun TV'),
|
||||
(59, 13, 'テレビ愛知', 'TV Aichi'),
|
||||
(60, 14, 'テレビ新広島', 'TV Shin-Hiroshima'),
|
||||
(61, 6, 'ディスカバリーチャンネル', 'Discovery Channel'),
|
||||
(62, 6, 'スカパー101ch', 'Sky Perfect 101'),
|
||||
(63, 6, 'スカパー', 'Sky Perfect 101'),
|
||||
(64, 11, 'NHK教育2', 'NHK Educational 2'),
|
||||
(65, 11, 'NHK教育3', 'NHK Educational 3'),
|
||||
(66, 8, 'KBS京都', 'KBS (Kyoto)'),
|
||||
(67, 8, 'ABCテレビ', 'ABC TV (Asahi Broadcasting)'),
|
||||
(68, 6, 'ch.280 ActOnTV(by recruit)', ''),
|
||||
(69, 17, 'なし', ''),
|
||||
(70, 8, '関西テレビ', 'Kansai TV'),
|
||||
(71, 2, 'BS日テレ', 'BS-Nippon TV'),
|
||||
(72, 1, '群馬テレビ', 'Gunma TV'),
|
||||
(73, 7, 'LFX BB', 'Nippon TV Broadband Version'),
|
||||
(74, 8, '奈良テレビ', 'Nara TV'),
|
||||
(75, 7, 'GyaO!', ''),
|
||||
(76, 2, 'WOWOWシネマ', 'WOWOW Cinema'),
|
||||
(77, 13, '東海テレビ', 'Tokai TV'),
|
||||
(78, 7, 'ShowTime', ''),
|
||||
(79, 13, 'CBCテレビ', 'Chuubu Nippon Broadcasting'),
|
||||
(80, 13, '中京テレビ', 'Chuu-Kyou TV'),
|
||||
(81, 13, 'メ~テレ', 'Nagoya Broadcasting Network'),
|
||||
(82, 13, '三重テレビ', 'Mie TV'),
|
||||
(83, 13, 'ぎふチャン', 'Gifu Channel'),
|
||||
(84, 6, 'sky・A', ''),
|
||||
(85, 7, 'Yahoo!動画', 'Yahoo! Douga'),
|
||||
(86, 8, 'テレビ和歌山', 'TV Wakayama'),
|
||||
(87, 8, 'BBCびわ湖放送', 'BBC Biwako Broadcasting'),
|
||||
(88, 18, '北海道テレビ放送', 'Hokkaido TV Broadcasting'),
|
||||
(89, 18, '北海道放送', 'Hokkaido Broadcasting'),
|
||||
(90, 18, 'テレビ北海道', 'TV Hokkaido'),
|
||||
(91, 18, '北海道文化放送', 'Hokkaido Culture Broadcasting'),
|
||||
(92, 18, '札幌テレビ放送', 'Sapporo TV Broadcasting'),
|
||||
(93, 19, 'TVQ九州放送', 'TVQ Kyushu Broadcasting'),
|
||||
(94, 19, 'RKB毎日放送', 'RKB Mainichi Broadcasting'),
|
||||
(95, 14, 'テレビせとうち', 'TV Setouchi'),
|
||||
(96, 19, '福岡放送', 'Fukuoka Broadcasting'),
|
||||
(97, 2, 'WOWOWライブ', 'WOWOW Live'),
|
||||
(98, 20, '東北放送', 'Touhoku Broadcasting'),
|
||||
(99, 14, '広島ホームテレビ', 'Hiroshima Home TV'),
|
||||
(100, 1, 'とちぎテレビ', 'Tochigi TV'),
|
||||
(101, 7, 'BIGLOBEストリーム', 'BIGLOBE Stream'),
|
||||
(102, 14, '中国放送', 'Chugoku Broadcasting'),
|
||||
(103, 14, '広島テレビ', 'Hiroshima TV'),
|
||||
(104, 14, '岡山放送', 'Okayama Broadcasting'),
|
||||
(105, 14, '山陽放送', 'Sanyou Braodcasting'),
|
||||
(106, 10, 'NHK-FM', ''),
|
||||
(107, 7, 'バンダイチャンネル', 'Bandai Channel'),
|
||||
(108, 7, 'フレッツ・スクウェア(NTT東日本)', 'Flet''s Square (NTT Eastern Japan)'),
|
||||
(109, 6, 'フジテレビONE', 'Fuji TV ONE'),
|
||||
(110, 7, 'バンダイチャンネルキッズ', 'Bandai Channel Kids'),
|
||||
(111, 21, 'テレビ信州', 'TV Shinshu'),
|
||||
(112, 6, '330ch WOWOW', 'Nagano'),
|
||||
(113, 13, 'SBSテレビ', 'Shizuoka Broadcasting'),
|
||||
(114, 22, '南海放送', 'Nankai Broadcasting'),
|
||||
(115, 22, 'テレビ愛媛', 'TV Ehime'),
|
||||
(116, 22, 'あいテレビ', 'i-TELEVISION'),
|
||||
(117, 22, '愛媛朝日テレビ', 'Ehime-Asashi TV'),
|
||||
(118, 7, 'i-revo', ''),
|
||||
(119, 6, '日テレプラス', 'Nihon TV Plus'),
|
||||
(120, 7, '@nifty', ''),
|
||||
(121, 6, 'ビクトリーチャンネル', 'Victory Channel'),
|
||||
(122, 7, 'gooアニメ', 'goo Anime'),
|
||||
(123, 22, '瀬戸内海放送', 'Seto-Naikai Broadcasting'),
|
||||
(124, 22, '西日本放送', 'Western Japan Broadcasting'),
|
||||
(125, 14, 'テレビ山口', 'TV Yamaguchi'),
|
||||
(126, 14, '山口放送', 'Yamaguchi Broadcasting'),
|
||||
(127, 14, '山口朝日放送', 'Yamaguchi-Asashi Broadcasting'),
|
||||
(128, 2, 'BS11デジタル', 'BS11 Digital'),
|
||||
(129, 2, 'TwellV', ''),
|
||||
(130, 7, '角川アニメチャンネル', 'Kadokawa Anime Channel'),
|
||||
(131, 6, 'フジテレビNEXT', 'Fuji TV NEXT'),
|
||||
(132, 7, 'ニコニコアニメチャンネル', 'NicoNico Anime Channel'),
|
||||
(133, 15, 'ラジオ関西(558)', 'Radio Kansai'),
|
||||
(134, 15, 'MBSラジオ(1179)', 'MBS Radio'),
|
||||
(135, 17, 'PLAYSTATION Store', ''),
|
||||
(136, 7, 'ニコニコ生放送', 'NicoNico Live Broadcasting'),
|
||||
(137, 6, 'スカパー162ch', 'SkyPerfect 162'),
|
||||
(138, 19, '九州朝日放送', 'Kyushu-Asashi Broadcasting'),
|
||||
(139, 24, '東海ラジオ(1332)', 'Tokaido Radio (1332)'),
|
||||
(140, 16, '南海放送(1116)', 'Nankai Broadcasting (1116)'),
|
||||
(141, 13, 'テレビ静岡', 'TV Shizuoka'),
|
||||
(142, 19, '熊本放送', 'Kumamoto Broadcasting'),
|
||||
(143, 7, 'アニメワン', 'Anime One'),
|
||||
(144, 19, 'テレビ西日本', 'TV Western Japan'),
|
||||
(145, 19, 'サガテレビ', 'Saga TV'),
|
||||
(146, 25, '北陸朝日放送', 'Hokuriku-Asahi Broadcasting'),
|
||||
(147, 25, '北陸放送', 'Hokuriku Broadcasting'),
|
||||
(148, 25, '福井放送', 'Fukui Broadcasting'),
|
||||
(149, 25, '福井テレビ', 'Fukui TV'),
|
||||
(150, 6, 'スカチャンHD800', 'SkyChan HD800'),
|
||||
(151, 6, 'MUSIC ON! TV', ''),
|
||||
(152, 6, 'ムービープラス', 'Movie Plus'),
|
||||
(153, 6, 'ホームドラマチャンネル', 'Home Drama Channel'),
|
||||
(154, 13, 'だいいちテレビ', '1st TV'),
|
||||
(155, 13, '静岡朝日テレビ', 'Shizuoka-Asahi TV'),
|
||||
(156, 12, '超!A&G+', 'I think something messed up when you tried to copy that'),
|
||||
(157, 7, 'アニメNewtypeチャンネル', 'Anime Newtype Channel'),
|
||||
(158, 6, '放送大学CSテレビ', 'University of Broadcasting CS TV'),
|
||||
(159, 6, '放送大学CSラジオ', 'University of Broadcasting CS Radio'),
|
||||
(160, 6, 'スカチャン', 'Sky Channel'),
|
||||
(161, 6, 'ディズニーXD', 'Disney XD'),
|
||||
(162, 12, 'TOKYO FM(80.0)', ''),
|
||||
(163, 6, 'ディズニー・チャンネル', 'Disney Channel'),
|
||||
(164, 6, 'Music Japan TV', ''),
|
||||
(165, 7, 'ニコニコチャンネル', 'NicoNico Channel'),
|
||||
(166, 12, 'bayfm(78.0)', ''),
|
||||
(167, 6, 'TAKARAZUKA SKY STAGE', ''),
|
||||
(168, 19, '長崎放送', 'Nagasaki Broadcasting'),
|
||||
(169, 19, '長崎文化放送', 'Nagasaki Culture Broadcasting'),
|
||||
(170, 19, 'テレビ長崎', 'TV Nagasaki'),
|
||||
(171, 19, '長崎国際テレビ', 'Nagasaki International TV'),
|
||||
(172, 25, 'テレビ金沢', 'TV Kanazawa'),
|
||||
(173, 6, 'スカチャンHD801', 'Sky Channel HD801'),
|
||||
(174, 6, 'スカチャン802', 'Sky Channel 802'),
|
||||
(175, 6, 'スカチャンHD192', 'Sky Channel HD192'),
|
||||
(176, 6, '旅チャンネル', 'Travel Channel'),
|
||||
(177, 7, 'テレビドガッチ', 'TV Gacchi'),
|
||||
(178, 7, 'YouTube', ''),
|
||||
(179, 2, 'NHK BSプレミアム', 'NHK BS Premium'),
|
||||
(180, 12, 'InterFM(76.1)', ''),
|
||||
(181, 25, '福井さかいケーブルテレビ', 'Fukui-Sakai Cable TV'),
|
||||
(182, 7, 'USTREAM', ''),
|
||||
(183, 24, '中部日本放送(1053)', 'Chuubu-Nihon Broadcasting'),
|
||||
(184, 24, 'ZIP-FM(77.8)', ''),
|
||||
(185, 24, 'レディオキューブFM三重(78.9)', 'Radio Cube FM Mie'),
|
||||
(186, 24, 'FM AICHI(80.7)', ''),
|
||||
(187, 1, 'TOKYO MX2', ''),
|
||||
(188, 12, 'NACK5(79.5)', ''),
|
||||
(189, 12, 'bayfm78(78.0)', ''),
|
||||
(190, 12, 'FMヨコハマ(84.7)', 'FM Yokohama'),
|
||||
(191, 12, 'ラジオ日本(1422)', 'Radio Japan'),
|
||||
(192, 11, 'NHKワンセグ2', 'NHK One-Seg 2'),
|
||||
(193, 7, 'バンダイチャンネルライブ!', 'Bandai Channel Live'),
|
||||
(194, 6, 'スペースシャワーTV', 'Space Shower TV'),
|
||||
(195, 10, 'NHKラジオ第二', 'NHK #2 Radio'),
|
||||
(196, 2, 'BSスカパー!', 'BS SkyPerfect!'),
|
||||
(197, 2, 'BSアニマックス', 'BS Animax'),
|
||||
(198, 20, '青森放送', 'Aomori Broadcasting'),
|
||||
(199, 20, '青森朝日放送', 'Aomori-Asahi Broadcasting'),
|
||||
(200, 20, '青森テレビ', 'Aomori TV'),
|
||||
(201, 26, '琉球放送', 'Ryuukyuu Broadcasting'),
|
||||
(202, 26, '琉球朝日放送', 'Ryuukyuu-Asahi Broadcasting'),
|
||||
(203, 26, '沖縄テレビ', 'Okinawa TV'),
|
||||
(204, 2, 'WOWOWプライム', 'WOWOW Prime'),
|
||||
(205, 7, '東映特撮 YouTube Official', 'Toei Tokusatsu YouTube Official'),
|
||||
(206, 21, 'BSNテレビ', 'BSN TV'),
|
||||
(207, 21, 'TeNY', ''),
|
||||
(208, 21, '新潟テレビ21', 'Niigata TV 21'),
|
||||
(209, 21, '新潟総合テレビ', 'Niigata General TV');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `history`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `history` (
|
||||
`ID` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`TID` int(11) NOT NULL,
|
||||
`IP` varchar(24) NOT NULL,
|
||||
`OriginalRomaji` varchar(128) NOT NULL DEFAULT '',
|
||||
`NewRomaji` varchar(128) NOT NULL DEFAULT '',
|
||||
`OriginalTitle` varchar(128) NOT NULL DEFAULT '',
|
||||
`NewTitle` varchar(128) NOT NULL DEFAULT '',
|
||||
`OriginalAniDB` int(11) NOT NULL DEFAULT '0',
|
||||
`NewAniDB` int(11) NOT NULL DEFAULT '0',
|
||||
`Updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `program`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `program` (
|
||||
`LastUpdate` datetime NOT NULL,
|
||||
`PID` int(11) NOT NULL,
|
||||
`TID` int(11) NOT NULL,
|
||||
`StTime` datetime NOT NULL,
|
||||
`StOffset` int(11) NOT NULL,
|
||||
`EdTime` datetime NOT NULL,
|
||||
`Count` int(11) NOT NULL,
|
||||
`SubTitle` text NOT NULL,
|
||||
`ProgComment` text NOT NULL,
|
||||
`Flag` int(11) NOT NULL,
|
||||
`Deleted` int(11) NOT NULL,
|
||||
`Warn` int(11) NOT NULL,
|
||||
`ChID` int(11) NOT NULL,
|
||||
`Revision` int(11) NOT NULL,
|
||||
`STSubTitle` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`PID`),
|
||||
KEY `TID` (`TID`),
|
||||
KEY `LastUpdate` (`LastUpdate`),
|
||||
KEY `StTime` (`StTime`),
|
||||
KEY `EdTime` (`EdTime`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `title`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `title` (
|
||||
`TID` int(11) NOT NULL,
|
||||
`AID` int(11) NOT NULL DEFAULT '0',
|
||||
`LastUpdate` datetime NOT NULL,
|
||||
`Title` text NOT NULL,
|
||||
`ShortTitle` text NOT NULL,
|
||||
`TitleYomi` text NOT NULL,
|
||||
`TitleRomaji` text NOT NULL,
|
||||
`TitleEN` text NOT NULL,
|
||||
`TitleManual` text NOT NULL,
|
||||
`Comment` text NOT NULL,
|
||||
`Cat` int(11) NOT NULL,
|
||||
`TitleFlag` int(11) NOT NULL,
|
||||
`FirstYear` int(11) NOT NULL,
|
||||
`FirstMonth` int(11) NOT NULL,
|
||||
`FirstEndYear` int(11) NOT NULL,
|
||||
`FirstEndMonth` int(11) NOT NULL,
|
||||
`FirstCh` varchar(128) NOT NULL,
|
||||
`DefaultCh` int(11) NOT NULL DEFAULT '0',
|
||||
`Keywords` varchar(128) NOT NULL,
|
||||
`UserPoint` int(11) NOT NULL,
|
||||
`UserPointRank` int(11) NOT NULL,
|
||||
`SubTitles` text NOT NULL,
|
||||
PRIMARY KEY (`TID`),
|
||||
FULLTEXT KEY `Title` (`Title`,`ShortTitle`,`TitleYomi`,`TitleRomaji`,`TitleEN`,`TitleManual`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
34
json.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
include('system/class/anitv.php');
|
||||
require('system/config.php');
|
||||
|
||||
$AniTV = new AniTV();
|
||||
$AniTV->connect();
|
||||
|
||||
if (empty($_GET) || (!isset($_GET['controller'])))
|
||||
die('error: incorrect calls');
|
||||
|
||||
switch ($_GET['controller'])
|
||||
{
|
||||
case 'history':
|
||||
echo (isset($_GET['callback'])) ? $_GET['callback'] . '(' . $AniTV->history() . ')' : $AniTV->history();
|
||||
break;
|
||||
|
||||
case 'search':
|
||||
if (isset($_GET['total']))
|
||||
echo (isset($_GET['callback'])) ? $_GET['callback'] . '(' . $AniTV->search($_GET['query'], $_GET['total']) . ')' : $AniTV->search($_GET['query'], $_GET['total']);
|
||||
else
|
||||
echo (isset($_GET['callback'])) ? $_GET['callback'] . '(' . $AniTV->search($_GET['query']) . ')' : $AniTV->search($_GET['query']);
|
||||
break;
|
||||
|
||||
case 'stream':
|
||||
echo (isset($_GET['callback'])) ? $_GET['callback'] . '(' . $AniTV->stream($_GET['total']) . ')' : $AniTV->stream($_GET['total']);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (isset($_GET['total']))
|
||||
echo (isset($_GET['callback'])) ? $_GET['callback'] . '(' . $AniTV->schedule($_GET['total'], ((isset($_GET['nowplaying'])) ? $_GET['nowplaying'] : TRUE)) . ')' : $AniTV->schedule($_GET['total'], ((isset($_GET['nowplaying'])) ? $_GET['nowplaying'] : TRUE));
|
||||
else
|
||||
echo (isset($_GET['callback'])) ? $_GET['callback'] . '(' . $AniTV->schedule(50, ((isset($_GET['nowplaying'])) ? $_GET['nowplaying'] : TRUE)) . ')' : $AniTV->schedule();
|
||||
}
|
70
manage.html
Normal file
|
@ -0,0 +1,70 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>AniTV Schedule - Manage</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/bootstrap.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/bootstrap-app.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/datatables-table.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/datatables-table-jui.css" />
|
||||
|
||||
<!-- JS -->
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/jquery.jeditable.js"></script>
|
||||
<script type="text/javascript" src="assets/js/jquery.datatables.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/anitv-manage.js"></script>
|
||||
<script type="text/javascript" src="assets/js/clock.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<div class="fill">
|
||||
<div class="container">
|
||||
<a class="brand" href="#">AniTV Schedule</a>
|
||||
<ul class="nav">
|
||||
<li><a href="index.html">Home</a></li>
|
||||
<li><a href="api.html" data-view="api">API</a></li>
|
||||
<li class="active"><a href="manage.html" data-view="manage">Manage</a></li>
|
||||
<li><a href="history.html" data-view="history">History</a></li>
|
||||
</ul>
|
||||
<p class="pull-right" id="clock"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="content" id="view">
|
||||
<div class="page-header">
|
||||
<h1>Manage <small>modify and update information</small></h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<table id="manage" style="clear: both;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 315px">Original</th>
|
||||
<th style="width: 315px">Romaji</th>
|
||||
<th style="width: 315px">English</th>
|
||||
<th style="width: 50px">AniDB</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="4" class="dataTables_empty">Loading data...</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p>AniTV Schedule 0.2.0 © TEAM SEPTiCORE 2011</p>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
94
scripts/anitv.mrc
Normal file
|
@ -0,0 +1,94 @@
|
|||
;-- AniTV mIRC Script by prinny
|
||||
;-- Last Modified: 2012-01-11
|
||||
ON *:TEXT:.anitv*:#: {
|
||||
if ($2) {
|
||||
var %url = http://anitv.foolz.us/json.php?controller=search&query= $+ $json.enccomponent($1-) $+ &_timestamp= $+ $ctime
|
||||
var %idx = results
|
||||
}
|
||||
else {
|
||||
var %url = http://anitv.foolz.us/json.php?controller=schedule&total=5&nowplaying=false&_timestamp= $+ $ctime
|
||||
var %idx = programs
|
||||
}
|
||||
|
||||
var %count = $json(%url, %idx).count
|
||||
|
||||
if (%count == 0 && $json(%url, %idx, 0, error) != NULL) {
|
||||
msg $chan Error: $json(%url, %idx, 0, error)
|
||||
}
|
||||
|
||||
if (%count > 10) {
|
||||
var %count = 10
|
||||
}
|
||||
|
||||
var %row = 0
|
||||
while (%row < %count) {
|
||||
var %output = 7 $+ $json(%url,%idx,%row,title) episode 7 $chr(35) $+ $json(%url,%idx,%row,episode) airs on7 $json(%url,%idx,%row,station) at7 $asctime($ctime($json(%url,%idx,%row,airtime)),ddd HH:nn:ss) JST. $chr(91) $+ $+ $replace($duration($calc($json(%url,%idx,%row,unixtime) - $ctime)),secs,s,mins,m,hrs,h,days,d) $+ $+ $chr(93)
|
||||
|
||||
if ($json(%url,%idx,%row,anidb) > 0) {
|
||||
var %output = %output 0- 12 $+ http://anidb.net/a $+ $json(%url,%idx,%row,anidb)
|
||||
}
|
||||
|
||||
msg $chan %output
|
||||
|
||||
inc %row
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;-- DO NOT EDIT BELOW, THE $json ADDON IS REQUIRED FOR JSON OUTPUT
|
||||
;-- $json by Timi
|
||||
alias json {
|
||||
if ($isid) {
|
||||
var %c = jsonidentifier,%x = 2,%str,%p,%v,%addr
|
||||
|
||||
if ($isfile($1)) { %addr = $qt($replace($1,\,\\,;,\u003b,",\u0022)) }
|
||||
else { %addr = $qt($replace($1,;,\u003b,",\u0022)) }
|
||||
|
||||
json.comcheck
|
||||
if (!$timer(jsonclearcache)) { .timerjsonclearcache -o 0 300 jsonclearcache }
|
||||
|
||||
while (%x <= $0) {
|
||||
%p = $($+($,%x),2)
|
||||
if (%p == $null) { noop }
|
||||
elseif (%p isnum || $qt($noqt(%p)) == %p) { %str = $+(%str,[,%p,]) }
|
||||
else { %str = $+(%str,[",%p,"]) }
|
||||
inc %x
|
||||
}
|
||||
if ($prop == count) { %str = %str $+ .length }
|
||||
|
||||
if ($isfile($1)) {
|
||||
if ($com(%c,eval,1,bstr,$+(str2json,$chr(40),filejson,$chr(40),%addr,$chr(41),$chr(41),%str))) { return $com(%c).result }
|
||||
}
|
||||
elseif (http://* iswm $1 || https://* iswm $1) {
|
||||
if ($com(%c,eval,1,bstr,$+(str2json,$chr(40),urlcache[,%addr,],$chr(41),%str))) { return $com(%c).result }
|
||||
elseif ($com(%c,eval,1,bstr,$+(urlcache[,%addr,]) = $+(httpjson,$chr(40),$qt($1),$chr(41)))) {
|
||||
if ($com(%c,eval,1,bstr,$+(str2json,$chr(40),urlcache[,%addr,],$chr(41),%str))) { return $com(%c).result }
|
||||
}
|
||||
}
|
||||
elseif ($com(%c,eval,1,bstr,$+(x=,%addr,;,x,%str,;))) { return $com(%c).result }
|
||||
}
|
||||
}
|
||||
alias jsonclearcache {
|
||||
if ($com(jsonidentifier)) {
|
||||
if (!$1) { noop $com(jsonidentifier,executestatement,1,bstr,urlcache = {}) }
|
||||
else { echo -a $com(jsonidentifier,executestatement,1,bstr,urlcache[" $+ $1 $+ "] = "") }
|
||||
}
|
||||
}
|
||||
alias json.enc {
|
||||
json.comcheck
|
||||
if ($com(jsonidentifier,eval,1,bstr,encodeURI(" $+ $1- $+ "))) { return $com(jsonidentifier).result }
|
||||
}
|
||||
alias json.enccomponent {
|
||||
json.comcheck
|
||||
if ($com(jsonidentifier,eval,1,bstr,encodeURIComponent(" $+ $1- $+ "))) { return $com(jsonidentifier).result }
|
||||
}
|
||||
alias -l json.comcheck {
|
||||
var %c = jsonidentifier
|
||||
if (!$com(%c)) {
|
||||
.comopen %c MSScriptControl.ScriptControl
|
||||
noop $com(%c,language,4,bstr,jscript) $com(%c,addcode,1,bstr,function httpjson(url) $({,0) y=new ActiveXObject("Microsoft.XMLHTTP");y.open("GET",url,false);y.send();return y.responseText; $(},0))
|
||||
noop $com(%c,addcode,1,bstr,function filejson (file) $({,0) x = new ActiveXObject("Scripting.FileSystemObject"); txt1 = x.OpenTextFile(file,1); txt2 = txt1.ReadAll(); txt1.Close(); return txt2; $(},0))
|
||||
noop $com(%c,addcode,1,bstr,function str2json (json) $({,0) return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(json.replace(/"(\\.|[^"\\])*"/g, ''))) && eval('(' + json + ')'); $(},0))
|
||||
noop $com(%c,addcode,1,bstr,urlcache = {})
|
||||
}
|
||||
}
|
146
scripts/anitv.tcl
Normal file
|
@ -0,0 +1,146 @@
|
|||
# -----------------------------------------------------------
|
||||
# AniTV Eggdrop/TCL Script
|
||||
# Version : 0.2.0
|
||||
# Updated : 2011.01.11
|
||||
# -- Description --------------------------------------------
|
||||
# Utilizes the AniTV API to display program listings on IRC.
|
||||
# -- Usage --------------------------------------------------
|
||||
# .anitv
|
||||
# .anitv <query>
|
||||
# -- Dependancies -------------------------------------------
|
||||
# + DICT - http://www.tcl.tk/man/tcl/TclCmd/dict.htm
|
||||
# + HTTP - http://tmml.sourceforge.net/doc/tcl/http.html
|
||||
# + JSON - http://tcllib.sourceforge.net/doc/json.html
|
||||
# -- Change Log ---------------------------------------------
|
||||
# @rev 0.2.0 [2012.01.11]
|
||||
# Updated API Calls for AniTV Schedule 0.2.0
|
||||
# @rev 0.1.0 [2011.12.03]
|
||||
# Initial Release
|
||||
# -----------------------------------------------------------
|
||||
|
||||
# Required Packages
|
||||
package require dict;
|
||||
package require http;
|
||||
package require json;
|
||||
|
||||
# Channel Flag
|
||||
setudef flag anitv;
|
||||
|
||||
namespace eval septicore {
|
||||
namespace eval anitv {
|
||||
variable version "septicore-anitv-v0.1";
|
||||
|
||||
bind pub -|- ".anitv" septicore::anitv::display;
|
||||
bind msg -|- ".anitv" septicore::anitv::private;
|
||||
|
||||
proc display { nick host hand chan text } {
|
||||
if { [lsearch -exact [channel info $chan] +anitv] == 1 } { return }
|
||||
|
||||
foreach result [api [join [lrange [split $text] 0 end]]] {
|
||||
output $chan $result;
|
||||
}
|
||||
}
|
||||
|
||||
proc private { nick host hand text } {
|
||||
foreach result [api [join [lrange [split $text] 0 end]]] {
|
||||
output $nick $result;
|
||||
}
|
||||
}
|
||||
|
||||
proc api { search } {
|
||||
set data [list];
|
||||
if { $search == "" } {
|
||||
set url "http://anitv.foolz.us/json.php?controller=schedule&total=5&nowplaying=false";
|
||||
} else {
|
||||
set urlEncodeArg [http::formatQuery query $search];
|
||||
set url "http://anitv.foolz.us/json.php?controller=search&$urlEncodeArg&total=5";
|
||||
}
|
||||
|
||||
set data [http::data [http::geturl $url]];
|
||||
set json_data [::json::json2dict $data];
|
||||
|
||||
if { $json_data == "null" } { return $data; }
|
||||
|
||||
if { $search != "" } {
|
||||
dict with json_data {
|
||||
foreach result $results {
|
||||
if { [dict keys $result "error"] != "" } {
|
||||
dict with result {
|
||||
return [list "Error: $error"];
|
||||
}
|
||||
}
|
||||
|
||||
dict with result {
|
||||
set display "\002\00307$title\003\002 episode \00307#<episode>\003 airs on \00307<station>\003 at \00307<airtime> JST\003. \[\002<eta>\002\]";
|
||||
|
||||
if { $anidb > 0 } {
|
||||
append display " - \037\00312http://anidb.info/a<anidb>\003\037";
|
||||
}
|
||||
|
||||
regsub -- {<episode>} $display $episode display;
|
||||
regsub -- {<subtitle>} $display $subtitle display;
|
||||
regsub -- {<station>} $display $station display;
|
||||
regsub -- {<airtime>} $display $airtime display;
|
||||
regsub -- {<eta>} $display [duration [expr { $unixtime - [unixtime] }]] display;
|
||||
regsub -- {<duration>} $display $duration display;
|
||||
regsub -- {<anidb>} $display $anidb display;
|
||||
|
||||
lappend data $display;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dict with json_data {
|
||||
foreach result $programs {
|
||||
dict with result {
|
||||
set display "\002\00307$title\003\002 episode \00307#<episode>\003 airs on \00307<station>\003 at \00307<airtime> JST\003. \[\002<eta>\002\]";
|
||||
|
||||
if { $anidb > 0 } {
|
||||
append display " - \037\00312http://anidb.info/a<anidb>\003\037";
|
||||
}
|
||||
|
||||
regsub -- {<episode>} $display $episode display;
|
||||
regsub -- {<subtitle>} $display $subtitle display;
|
||||
regsub -- {<station>} $display $station display;
|
||||
regsub -- {<airtime>} $display $airtime display;
|
||||
regsub -- {<eta>} $display [duration [expr { $unixtime - [unixtime] }]] display;
|
||||
regsub -- {<duration>} $display $duration display;
|
||||
regsub -- {<anidb>} $display $anidb display;
|
||||
|
||||
lappend data $display;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
# Default Procs
|
||||
proc notice { dest text } { putquick "NOTICE $dest :$text"; }
|
||||
proc output { dest text } {
|
||||
if { [validchan $dest] && [string first c [lindex [split [getchanmode $dest]] 0]] != -1 } { set text [stripcodes bcruag $text]; }
|
||||
putquick "PRIVMSG $dest :$text";
|
||||
}
|
||||
proc duration { unixtime } {
|
||||
set yrs 0; set wks 0; set days 0; set hrs 0; set min 0; set sec 0; set time "";
|
||||
if { $unixtime < 60 } { return "$unixtime seconds ago" }
|
||||
while { $unixtime >= 31449600 } { incr yrs 1; incr unixtime -31449600 }
|
||||
while { $unixtime >= 604800 } { incr wks 1; incr unixtime -604800 }
|
||||
while { $unixtime >= 86400 } { incr days 1; incr unixtime -86400 }
|
||||
while { $unixtime >= 3600 } { incr hrs 1; incr unixtime -3600 }
|
||||
while { $unixtime >= 60 } { incr min 1; incr unixtime -60 }
|
||||
while { $unixtime > 0 } { incr sec 1; incr unixtime -1 }
|
||||
if { $yrs > 0 } { append time "$yrs\y "; }
|
||||
if { $wks > 0 } { append time "$wks\w "; }
|
||||
if { $days > 0 } { append time "$days\d "; }
|
||||
if { $hrs > 0 } { append time "$hrs\h "; }
|
||||
if { $min > 0 } { append time "$min\m "; }
|
||||
if { $sec > 0 } { append time "$sec\s"; }
|
||||
return $time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
putlog "> Script Loaded: $septicore::anitv::version by TEAM SEPTiCORE";
|
||||
# EOF
|
499
system/class/anitv.php
Normal file
|
@ -0,0 +1,499 @@
|
|||
<?php
|
||||
|
||||
// Set Appropriate Headers & Environment
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
date_default_timezone_set("Asia/Tokyo");
|
||||
setlocale(LC_ALL, 'en_US.UTF8');
|
||||
|
||||
class AniTV {
|
||||
var $hostname = MYSQL_HOST;
|
||||
var $username = MYSQL_USER;
|
||||
var $password = MYSQL_PASS;
|
||||
var $database = MYSQL_NAME;
|
||||
var $link;
|
||||
|
||||
function __construct() {
|
||||
|
||||
}
|
||||
|
||||
function connect() {
|
||||
$this->link = new mysqli($this->hostname, $this->username, $this->password, $this->database);
|
||||
if ($this->link->connect_error)
|
||||
{
|
||||
return $this->link->connect_error;
|
||||
}
|
||||
$this->link->set_charset('UTF8');
|
||||
$this->link->query("SET time_zone = '+9:00'");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
function download($source) {
|
||||
switch ($source) {
|
||||
case 'anidb.info':
|
||||
$contents = file_get_contents('http://anidb.net/api/anime-titles.dat.gz');
|
||||
file_put_contents('data/animetitles.dat', $contents);
|
||||
|
||||
$execute = 'gunzip -f ' . dirname(__FILE__) . '/data/animetitles.dat.gz'; `$execute`; //This isn't gonna work :^)
|
||||
|
||||
$contents = file_get_contents('data/animetitles.dat');
|
||||
$data = preg_replace('/([0-9]+)\|([0-9])\|(.*?)\|(.*)/', 'INSERT INTO `anidb` (`aid`, `type`, `language`, `title`) VALUES (\'\1\', \'\2\', \'\3\', \'\4\');', $contents);
|
||||
|
||||
if (file_exists('data/animetitles.sql')) unlink('data/animetitles.sql');
|
||||
$file = fopen('data/animetitles.sql', 'wb');
|
||||
fwrite($file, "\xEF\xBB\xBF");
|
||||
fwrite($file, $data);
|
||||
fclose($file);
|
||||
break;
|
||||
|
||||
case 'cal.syoboi.jp/title':
|
||||
// Titles
|
||||
$contents = file_get_contents('http://cal.syoboi.jp/db.php?Command=TitleLookup&TID=*');
|
||||
file_put_contents('data/titles.xml', $contents);
|
||||
break;
|
||||
|
||||
case 'cal.syoboi.jp/program':
|
||||
// Programs
|
||||
$contents = file_get_contents('http://cal.syoboi.jp/db.php?Command=ProgLookup&Range=' . date('Ymd', mktime(0, 0, 0, date('m'), date('d') - 5, date('Y'))) . '_000000-' . date('Ymd', mktime(0, 0, 0, date('m') + 1, date('d'), date('Y'))) . '_000000&JOIN=SubTitles');
|
||||
file_put_contents('data/programs.xml', $contents);
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function get_channel_name($id) {
|
||||
$id = $this->link->real_escape_string($id);
|
||||
$query = $this->link->query("SELECT `ChName`, `ChNameEN` FROM `channel` WHERE `ChID` = '{$id}'");
|
||||
$result = $query->fetch_assoc();
|
||||
if ($result["ChNameEN"] != "") return $result["ChNameEN"];
|
||||
return $result["ChName"];
|
||||
}
|
||||
|
||||
|
||||
function get_channel_id($name) {
|
||||
$name = $this->link->real_escape_string($name);
|
||||
$query = $this->link->query("SELECT `ChID` FROM `channel` WHERE `ChName` = '{$name}' LIMIT 1");
|
||||
$result = $query->fetch_assoc();
|
||||
return $result["ChID"];
|
||||
}
|
||||
|
||||
|
||||
function processXML($table) {
|
||||
switch ($table) {
|
||||
case 'title':
|
||||
$xml = 'data/titles.xml';
|
||||
$col = 'TID';
|
||||
$tbl = 'Title';
|
||||
break;
|
||||
|
||||
case 'program':
|
||||
$xml = 'data/programs.xml';
|
||||
$col = 'PID';
|
||||
$tbl = 'Prog';
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
$data = $this->XMLtoArray(simplexml_load_string(file_get_contents($xml)));
|
||||
|
||||
foreach ($data["{$tbl}Items"]["{$tbl}Item"] as $record) {
|
||||
unset($record["@attributes"]);
|
||||
|
||||
$field = array();
|
||||
foreach ($record as $key => $value) {
|
||||
$field[$key] = $key;
|
||||
|
||||
if (is_array($value)) {
|
||||
$record[$key] = $this->link->real_escape_string(implode(' ', $value));
|
||||
} else {
|
||||
$record[$key] = $this->link->real_escape_string($value);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->link->query("SELECT `{$col}` FROM `{$table}` WHERE `{$col}` = '{$record[$col]}' LIMIT 1");
|
||||
if ($result->num_rows != 0) {
|
||||
$local = $result->fetch_assoc();
|
||||
|
||||
if ($local['LastUpdate'] > $record['LastUpdate']) {
|
||||
$update = array();
|
||||
foreach ($record as $key => $value) {
|
||||
$update[] = "`{$key}` = '{$value}'";
|
||||
}
|
||||
|
||||
$this->link->query("UPDATE `{$table}` SET " . implode(", ", $update) . " WHERE `{$col}` = '{$entry[$col]}'");
|
||||
}
|
||||
} else {
|
||||
$this->link->query("INSERT INTO `{$table}` (`" . implode("`, `", $field) . "`) VALUES ('" . implode("', '", $record) . "');");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function sync($table) {
|
||||
switch ($table) {
|
||||
case 'anidb':
|
||||
$this->download('anidb.info');
|
||||
$this->link->query("TRUNCATE TABLE `anidb`");
|
||||
$data = file_get_contents('data/animetitles.sql');
|
||||
$data = explode("\n", $data);
|
||||
|
||||
foreach ($data as $line) {
|
||||
if (($line != NULL) && ($line != "") && !preg_match("/\# (.*?)/", $line)) {
|
||||
$this->link->query(str_replace("\xEF\xBB\xBF", '', $line));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'title':
|
||||
$this->download('cal.syoboi.jp/title');
|
||||
$this->processXML('title');
|
||||
|
||||
$titles = $this->link->query("
|
||||
SELECT *
|
||||
FROM `title`
|
||||
WHERE `AID` = 0
|
||||
");
|
||||
|
||||
if ($titles->num_rows)
|
||||
{
|
||||
while ($row = $titles->fetch_object())
|
||||
{
|
||||
$anidb = $this->link->query("
|
||||
SELECT `Q`.`aid`, `title`
|
||||
FROM
|
||||
(
|
||||
SELECT `aid`
|
||||
FROM `anidb` WHERE `title` = '" . $this->link->real_escape_string($row->Title) . "'
|
||||
) AS Q
|
||||
JOIN `anidb` AS P
|
||||
ON `Q`.`aid` = `P`.`aid`
|
||||
ORDER BY `P`.`type` ASC
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
if ($anidb->num_rows)
|
||||
{
|
||||
$data = $anidb->fetch_object();
|
||||
$this->link->query("UPDATE `title` SET `AID` = '" . $this->link->real_escape_string($data->aid) . "', `TitleManual` = '" . $this->link->real_escape_string($data->title) . "' WHERE `TID` = '" . $this->link->real_escape_string($row->TID) . "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'program':
|
||||
$this->download('cal.syoboi.jp/program');
|
||||
$this->processXML('program');
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function XMLtoArray($data) {
|
||||
$array = array();
|
||||
|
||||
if (is_object($data)) {
|
||||
$data = get_object_vars($data);
|
||||
}
|
||||
|
||||
if (is_array($data)) {
|
||||
foreach ($data as $index => $value) {
|
||||
if (is_object($value) || is_array($value)) {
|
||||
$value = $this->XMLtoArray($value);
|
||||
}
|
||||
|
||||
$array[$index] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
function schedule($limit = 50, $nowplaying = TRUE)
|
||||
{
|
||||
$limit = (int)$this->link->real_escape_string($limit);
|
||||
|
||||
if ($nowplaying === TRUE)
|
||||
{
|
||||
$airtime = "`program`.`EdTime`";
|
||||
}
|
||||
else
|
||||
{
|
||||
$airtime = "`program`.`StTime`";
|
||||
}
|
||||
|
||||
$schedule = $this->link->query("
|
||||
SELECT `title`.*, `program`.*, UNIX_TIMESTAMP(`program`.`StTime`) AS `StTimeUnix`, UNIX_TIMESTAMP(`program`.`EdTime`) AS `EdTimeUnix`
|
||||
FROM `title`, `program`
|
||||
WHERE
|
||||
`title`.`TID` = `program`.`TID`
|
||||
AND
|
||||
LENGTH(`Count`) < 10
|
||||
AND
|
||||
`Count` != ''
|
||||
AND
|
||||
UNIX_TIMESTAMP(" . $airtime . ") > " . time() . "
|
||||
ORDER BY `program`.`StTime`, `program`.`EdTime` ASC
|
||||
LIMIT " . $limit . "
|
||||
");
|
||||
|
||||
if ($schedule->num_rows)
|
||||
{
|
||||
while ($row = $schedule->fetch_object())
|
||||
{
|
||||
// Set Title
|
||||
$program = $row->Title;
|
||||
if (!empty($row->ShortTitle))
|
||||
$program = $row->ShortTitle;
|
||||
if (!empty($row->TitleRomaji))
|
||||
$program = $row->TitleRomaji;
|
||||
if (!empty($row->TitleEN))
|
||||
$program = $row->TitleEN;
|
||||
if (!empty($row->TitleManual))
|
||||
$program = $row->TitleManual;
|
||||
|
||||
// Set Episode Number
|
||||
$episode = $row->Count;
|
||||
if ($row->Count == 0)
|
||||
$episode = $row->SubTitle;
|
||||
|
||||
$schedule_json['programs'][] = array(
|
||||
'id' => (int)$row->PID,
|
||||
'title' => $program,
|
||||
'episode' => $episode,
|
||||
'subtitle' => $row->STSubTitle,
|
||||
'station' => $this->get_channel_name($row->ChID),
|
||||
'gmtime' => date(DATE_W3C, $row->StTimeUnix),
|
||||
'airtime' => $row->StTime,
|
||||
'duration' => (int)($row->EdTimeUnix - $row->StTimeUnix),
|
||||
'unixtime' => (int)$row->StTimeUnix,
|
||||
'anidb' => (int)$row->AID
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode($schedule_json);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
function stream($limit = 5)
|
||||
{
|
||||
$limit = (int)$this->link->real_escape_string($limit);
|
||||
|
||||
$stream = $this->link->query("
|
||||
SELECT `title`.*, `program`.*, UNIX_TIMESTAMP(`program`.`StTime`) AS `StTimeUnix`, UNIX_TIMESTAMP(`program`.`EdTime`) AS `EdTimeUnix`
|
||||
FROM `title`, `program`
|
||||
WHERE
|
||||
`title`.`TID` = `program`.`TID`
|
||||
AND
|
||||
LENGTH(`Count`) < 10
|
||||
AND
|
||||
`Count` != ''
|
||||
AND
|
||||
UNIX_TIMESTAMP(`program`.`EdTime`) > " . time() . "
|
||||
ORDER BY `program`.`StTime`, `program`.`EdTime` ASC
|
||||
LIMIT 50, " . $limit . "
|
||||
");
|
||||
|
||||
if ($stream->num_rows)
|
||||
{
|
||||
while ($row = $stream->fetch_object())
|
||||
{
|
||||
// Set Title
|
||||
$program = $row->Title;
|
||||
if (!empty($row->ShortTitle))
|
||||
$program = $row->ShortTitle;
|
||||
if (!empty($row->TitleRomaji))
|
||||
$program = $row->TitleRomaji;
|
||||
if (!empty($row->TitleEN))
|
||||
$program = $row->TitleEN;
|
||||
if (!empty($row->TitleManual))
|
||||
$program = $row->TitleManual;
|
||||
|
||||
// Set Episode Number
|
||||
$episode = $row->Count;
|
||||
if ($row->Count == 0)
|
||||
$episode = $row->SubTitle;
|
||||
|
||||
$stream_json['programs'][] = array(
|
||||
'id' => (int)$row->PID,
|
||||
'title' => $program,
|
||||
'episode' => $episode,
|
||||
'subtitle' => $row->STSubTitle,
|
||||
'station' => $this->get_channel_name($row->ChID),
|
||||
'gmtime' => date(DATE_W3C, $row->StTimeUnix),
|
||||
'airtime' => $row->StTime,
|
||||
'duration' => (int)($row->EdTimeUnix - $row->StTimeUnix),
|
||||
'unixtime' => (int)$row->StTimeUnix,
|
||||
'anidb' => (int)$row->AID
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode($stream_json);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
function search($query, $limit = 5)
|
||||
{
|
||||
$query = $this->link->real_escape_string(str_replace('*', '%', $query));
|
||||
$limit = (int)$this->link->real_escape_string($limit);
|
||||
|
||||
$search = $this->link->query("
|
||||
SELECT `title`.*, `program`.*, UNIX_TIMESTAMP(`program`.`StTime`) AS `StTimeUnix`, UNIX_TIMESTAMP(`program`.`EdTime`) AS `EdTimeUnix`
|
||||
FROM `title`, `program`
|
||||
WHERE
|
||||
`title`.`TID` = `program`.`TID`
|
||||
AND
|
||||
UNIX_TIMESTAMP(`program`.`StTime`) > " . time() . "
|
||||
AND
|
||||
(
|
||||
MATCH(`title`.`Title`, `title`.`ShortTitle`, `title`.`TitleYomi`, `title`.`TitleRomaji`, `title`.`TitleEN`, `title`.`TitleManual`) AGAINST ('" . $query . "')
|
||||
OR
|
||||
`title`.`Title` LIKE '%" . $query . "%'
|
||||
OR
|
||||
`title`.`ShortTitle` LIKE '%" . $query . "%'
|
||||
OR
|
||||
`title`.`TitleYomi` LIKE '%" . $query . "%'
|
||||
OR
|
||||
`title`.`TitleRomaji` LIKE '%" . $query . "%'
|
||||
OR
|
||||
`title`.`TitleEN` LIKE '%" . $query . "%'
|
||||
OR
|
||||
`title`.`TitleManual` LIKE '%" . $query . "%'
|
||||
)
|
||||
ORDER BY `program`.`StTime` ASC
|
||||
LIMIT " . $limit . "
|
||||
");
|
||||
|
||||
if ($search->num_rows)
|
||||
{
|
||||
while ($row = $search->fetch_object())
|
||||
{
|
||||
// Set Title
|
||||
$program = $row->Title;
|
||||
if (!empty($row->ShortTitle))
|
||||
$program = $row->ShortTitle;
|
||||
if (!empty($row->TitleRomaji))
|
||||
$program = $row->TitleRomaji;
|
||||
if (!empty($row->TitleEN))
|
||||
$program = $row->TitleEN;
|
||||
if (!empty($row->TitleManual))
|
||||
$program = $row->TitleManual;
|
||||
|
||||
// Set Episode Number
|
||||
$episode = $row->Count;
|
||||
if ($row->Count == 0)
|
||||
$episode = $row->SubTitle;
|
||||
|
||||
$search_json['results'][] = array(
|
||||
'id' => (int)$row->PID,
|
||||
'title' => $program,
|
||||
'episode' => $episode,
|
||||
'subtitle' => $row->STSubTitle,
|
||||
'station' => $this->get_channel_name($row->ChID),
|
||||
'gmtime' => date(DATE_W3C, $row->StTimeUnix),
|
||||
'airtime' => $row->StTime,
|
||||
'duration' => (int)($row->EdTimeUnix - $row->StTimeUnix),
|
||||
'unixtime' => (int)$row->StTimeUnix,
|
||||
'anidb' => (int)$row->AID
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode($search_json);
|
||||
}
|
||||
|
||||
$search_json['results'][] = array('error' => 'No results found.');
|
||||
return json_encode($search_json);
|
||||
}
|
||||
|
||||
|
||||
function modify($id, $column, $value)
|
||||
{
|
||||
$id = $this->link->real_escape_string($id);
|
||||
$value = $this->link->real_escape_string($value);
|
||||
|
||||
$entry = $this->link->query("SELECT * FROM `title` WHERE `TID` = '{$id}'");
|
||||
|
||||
if ($entry->num_rows)
|
||||
{
|
||||
$row = $entry->fetch_object();
|
||||
|
||||
switch ($column)
|
||||
{
|
||||
case 0:
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$this->link->query("INSERT INTO `history` (`TID`, `IP`, `OriginalRomaji`, `NewRomaji`) VALUES ('{$row->TID}', '{$_SERVER['REMOTE_ADDR']}', '{$row->TitleRomaji}', '{$value}');");
|
||||
$this->link->query("UPDATE `title` SET `TitleRomaji` = '{$value}' WHERE `TID` = '{$id}'");
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$this->link->query("INSERT INTO `history` (`TID`, `IP`, `OriginalTitle`, `NewTitle`) VALUES ('{$row->TID}', '{$_SERVER['REMOTE_ADDR']}', '{$row->TitleManual}', '{$value}');");
|
||||
$this->link->query("UPDATE `title` SET `TitleManual` = '{$value}' WHERE `TID` = '{$id}'");
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$this->link->query("INSERT INTO `history` (`TID`, `IP`, `OriginalAniDB`, `NewAniDB`) VALUES ('{$row->TID}', '{$_SERVER['REMOTE_ADDR']}', '{$row->AID}', '{$value}');");
|
||||
$this->link->query("UPDATE `title` SET `AID` = '{$value}' WHERE `TID` = '{$id}'");
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
function history()
|
||||
{
|
||||
$history = $this->link->query("SELECT `title`.`TID`, `title`.`Title`, `history`.* FROM `title`, `history` WHERE `title`.`TID` = `history`.`TID` ORDER BY `Updated` DESC LIMIT 50");
|
||||
|
||||
if ($history->num_rows)
|
||||
{
|
||||
while ($row = $history->fetch_object())
|
||||
{
|
||||
$user = explode(".", $row->IP); $user[2] = "xxx"; $user[3] = "xxx";
|
||||
$user = implode(".", $user);
|
||||
|
||||
$history_json['records'][] = array(
|
||||
'user' => $user,
|
||||
'program' => $row->Title,
|
||||
'orig_romaji' => $row->OriginalRomaji,
|
||||
'romaji' => $row->NewRomaji,
|
||||
'orig_title' => $row->OriginalTitle,
|
||||
'title' => $row->NewTitle,
|
||||
'orig_anidb' => $row->OriginalAniDB,
|
||||
'anidb' => $row->NewAniDB,
|
||||
'last_updated' => date(DATE_W3C, strtotime($row->Updated))
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode($history_json);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
7
system/config.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
// MySQL Database Information
|
||||
define("MYSQL_HOST", "localhost");
|
||||
define("MYSQL_USER", "anitv");
|
||||
define("MYSQL_PASS", "anitv");
|
||||
define("MYSQL_NAME", "anitv");
|
20
system/database.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
if ((empty($_GET)) || (!isset($_GET['action']) && !isset($_GET['data'])))
|
||||
die('invalid operation');
|
||||
|
||||
include('class/anitv.php');
|
||||
require('config.php');
|
||||
|
||||
$AniTV = new AniTV();
|
||||
$AniTV->connect();
|
||||
|
||||
switch ($_GET['action'])
|
||||
{
|
||||
case 'sync':
|
||||
$AniTV->sync($_GET['data']);
|
||||
break;
|
||||
|
||||
default:
|
||||
die('invalid operation');
|
||||
}
|
26
system/editor.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
|
||||
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'XMLHttpRequest')
|
||||
{
|
||||
die('Invalid Request');
|
||||
}
|
||||
|
||||
include('class/anitv.php');
|
||||
require('config.php');
|
||||
|
||||
$_POST = array_map('trim', $_POST);
|
||||
$_POST = array_map('stripslashes', $_POST);
|
||||
|
||||
|
||||
if (!empty($_POST))
|
||||
{
|
||||
$AniTV = new AniTV();
|
||||
$AniTV->connect();
|
||||
|
||||
if ($AniTV->modify($_POST['id'], $_POST['field'], $_POST['value']))
|
||||
echo $_POST['value'] . '(Updating...)';
|
||||
else
|
||||
echo '';
|
||||
}
|
180
system/manage.php
Normal file
|
@ -0,0 +1,180 @@
|
|||
<?php
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Easy set variables
|
||||
*/
|
||||
|
||||
/* Array of database columns which should be read and sent back to DataTables. Use a space where
|
||||
* you want to insert a non-database field (for example a counter or static image)
|
||||
*/
|
||||
$aColumns = array( 'Title', 'TitleRomaji', 'TitleManual', 'AID' );
|
||||
|
||||
/* Indexed column (used for fast and accurate table cardinality) */
|
||||
$sIndexColumn = "TID";
|
||||
|
||||
/* DB table to use */
|
||||
$sTable = "title";
|
||||
|
||||
/* Database connection infomation file */
|
||||
include('config.php');
|
||||
|
||||
/* Database connection information */
|
||||
$gaSql['user'] = MYSQL_USER;
|
||||
$gaSql['password'] = MYSQL_PASS;
|
||||
$gaSql['db'] = MYSQL_NAME;
|
||||
$gaSql['server'] = MYSQL_HOST;
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) or
|
||||
die( 'Could not open connection to server' );
|
||||
|
||||
mysql_select_db( $gaSql['db'], $gaSql['link'] ) or
|
||||
die( 'Could not select database '. $gaSql['db'] );
|
||||
|
||||
mysql_query("SET NAMES 'UTF8';");
|
||||
|
||||
/*
|
||||
* Paging
|
||||
*/
|
||||
$sLimit = "";
|
||||
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
|
||||
{
|
||||
$sLimit = "LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ".
|
||||
mysql_real_escape_string( $_GET['iDisplayLength'] );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Ordering
|
||||
*/
|
||||
$sOrder = "";
|
||||
if ( isset( $_GET['iSortCol_0'] ) )
|
||||
{
|
||||
$sOrder = "ORDER BY ";
|
||||
for ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )
|
||||
{
|
||||
if ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == "true" )
|
||||
{
|
||||
$sOrder .= $aColumns[ intval( $_GET['iSortCol_'.$i] ) ]."
|
||||
".mysql_real_escape_string( $_GET['sSortDir_'.$i] ) .", ";
|
||||
}
|
||||
}
|
||||
|
||||
$sOrder = substr_replace( $sOrder, "", -2 );
|
||||
if ( $sOrder == "ORDER BY" )
|
||||
{
|
||||
$sOrder = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Filtering
|
||||
* NOTE this does not match the built-in DataTables filtering which does it
|
||||
* word by word on any field. It's possible to do here, but concerned about efficiency
|
||||
* on very large tables, and MySQL's regex functionality is very limited
|
||||
*/
|
||||
$sWhere = "";
|
||||
if ( isset($_GET['sSearch']) && $_GET['sSearch'] != "" )
|
||||
{
|
||||
$sWhere = "WHERE (";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ')';
|
||||
}
|
||||
|
||||
/* Individual column filtering */
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == "true" && $_GET['sSearch_'.$i] != '' )
|
||||
{
|
||||
if ( $sWhere == "" )
|
||||
{
|
||||
$sWhere = "WHERE ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sWhere .= " AND ";
|
||||
}
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string($_GET['sSearch_'.$i])."%' ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SQL queries
|
||||
* Get data to display
|
||||
*/
|
||||
$sQuery = "
|
||||
SELECT SQL_CALC_FOUND_ROWS TID, ".str_replace(" , ", " ", implode(", ", $aColumns))."
|
||||
FROM $sTable
|
||||
$sWhere
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
/* Total data set length */
|
||||
$sQuery = "
|
||||
SELECT COUNT(".$sIndexColumn.")
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
/*
|
||||
* Output
|
||||
*/
|
||||
$output = array(
|
||||
"sEcho" => intval($_GET['sEcho']),
|
||||
"iTotalRecords" => $iTotal,
|
||||
"iTotalDisplayRecords" => $iFilteredTotal,
|
||||
"aaData" => array()
|
||||
);
|
||||
|
||||
while ( $aRow = mysql_fetch_array( $rResult ) )
|
||||
{
|
||||
$row = array();
|
||||
|
||||
// Add the row ID and class to the object
|
||||
$row['DT_RowId'] = $aRow['TID'];
|
||||
$row['DT_RowClass'] = 'grade'.$aRow['grade'];
|
||||
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
if ( $aColumns[$i] == "version" )
|
||||
{
|
||||
/* Special output formatting for 'version' column */
|
||||
$row[] = ($aRow[ $aColumns[$i] ]=="0") ? '-' : $aRow[ $aColumns[$i] ];
|
||||
}
|
||||
else if ( $aColumns[$i] != ' ' )
|
||||
{
|
||||
/* General output */
|
||||
$row[] = $aRow[ $aColumns[$i] ];
|
||||
}
|
||||
}
|
||||
$output['aaData'][] = $row;
|
||||
}
|
||||
|
||||
echo json_encode( $output );
|
||||
?>
|