Ugly progress commit

This commit is contained in:
Timothy Warren 2016-02-01 09:49:18 -05:00
parent f007ad987d
commit 49bd468aa4
30 changed files with 957 additions and 17781 deletions

View File

@ -44,7 +44,7 @@ A self-hosted client that allows custom formatting of data from the hummingbird
* app/cache
* public/images/manga
* public/images/anime
* public/js/cache
* public/cache
#### Anime Collection Additional Installation
* Run `php /vendor/bin/phinx migrate -e development` to create the database tables

View File

@ -56,4 +56,4 @@ $path_to = '';
| The folder where javascript files exist, in relation to the document root
|
*/
$js_root = $config['asset_dir'] . '/js/';
$js_root = $config['asset_dir'] . '/';

View File

@ -13,10 +13,57 @@
// --------------------------------------------------------------------------
$bower_packages = ['jquery', 'datatables', 'mustache.js'];
$bower_file_map = [];
foreach($bower_packages as $package)
{
$bower_file_map[$package] = [];
$json = json_decode(file_get_contents(__DIR__ . "/../../public/bower_components/{$package}/bower.json"));
if ( ! is_array($json->main))
{
$json->main = [$json->main];
}
foreach($json->main as $file)
{
if (stristr($file, '.js') !== FALSE)
{
array_push($bower_file_map[$package], "bower_components/{$package}/{$file}");
}
}
}
/**
* Merge together bower configs and local files
*
* @param string|array $bower - array of bower components to include
* @param string|array $local - array of local js files to include
* @return array - group array
*/
function create_group($bower, $local=[])
{
global $bower_file_map;
$group = [];
foreach((array) $bower as $component)
{
$group = array_merge($group, $bower_file_map[$component]);
}
foreach((array) $local as $file)
{
$group[] = $file;
}
return $group;
}
/**
* This is the config array for javascript files to concatenate and minify
*/
return [
$map = [
/*
For each group create an array like so
@ -25,37 +72,33 @@ return [
'path/to/js/file2.js'
),
*/
'table' => [
'lib/jquery.min.js',
'lib/datatables.js',
'sort_tables.js'
],
'table_edit' => [
'lib/jquery.min.js',
'lib/datatables.js',
'sort_tables.js',
'show_message.js',
'anime_edit.js',
'manga_edit.js'
],
'edit' => [
'lib/jquery.min.js',
'show_message.js',
'anime_edit.js',
'manga_edit.js'
],
'anime_collection' => [
'lib/jquery.min.js',
'lib/jquery.throttle-debounce.js',
'lib/jsrender.js',
'anime_collection.js'
],
'manga_collection' => [
'lib/jquery.min.js',
'lib/jquery.throttle-debounce.js',
'lib/jsrender.js',
'manga_collection.js'
]
'base' => create_group('jquery', [
'js/base.js',
]),
'event' => create_group([], 'js/events.js'),
'table' => create_group([], 'js/sort_tables.js'),
'table_edit' => create_group([], [
'js/sort_tables.js',
'js/anime_edit.js',
'js/manga_edit.js',
]),
'edit' => create_group([],[
'js/anime_edit.js',
'js/manga_edit.js'
]),
'anime_collection' => create_group('mustache.js', [
'bower_components/jquery-throttle-debounce/jquery.ba-throttle-debounce.js',
'js/anime_collection.js'
]),
'manga_collection' => create_group('mustache.js', [
'bower_components/jquery-throttle-debounce/jquery.ba-throttle-debounce.js',
'js/manga_collection.js'
]),
];
//print_r($map);
//die();
return $map;
// End of js_groups.php

View File

@ -3,6 +3,11 @@
<h2>Add Anime to your List</h2>
<form action="<?= $action_url ?>" method="post">
<section>
<div class="cssload-loader" hidden="hidden">
<div class="cssload-inner cssload-one"></div>
<div class="cssload-inner cssload-two"></div>
<div class="cssload-inner cssload-three"></div>
</div>
<label for="search">Search for anime by name:&nbsp;&nbsp;&nbsp;&nbsp;<input type="search" id="search" /></label>
<section id="series_list" class="media-wrap">
</section>
@ -30,11 +35,5 @@
</table>
</form>
</main>
<template id="show_list">
<article class="media">
<div class="name"><label><input type="radio" name="id" value="{{:slug}}" />&nbsp;<span>{{:title}}<br />{{:alternate_title}}</span></label></div>
<img src="{{:cover_image}}" alt="{{:title}}" />
</article>
</template>
<script src="<?= $urlGenerator->asset_url('js.php?g=anime_collection') ?>"></script>
<?php endif ?>

View File

@ -0,0 +1,11 @@
<main>
<h2><a href="<?= $data['url'] ?>"><?= $data['title'] ?></a></h2>
<?php if( ! empty($data['alternate_title'])): ?>
<h3><?= $data['alternate_title'] ?></h3>
<?php endif ?>
<img src="<?= $data['cover_image'] ?>" alt="<?= $data['title'] ?> cover image" />
<p><?= nl2br($data['synopsis']) ?></p>
<pre><?= print_r($data, TRUE) ?></pre>
</main>

View File

@ -11,7 +11,7 @@
<thead>
<tr>
<?php if($auth->is_authenticated()): ?>
<th>&nbsp;</th>
<td class="no_border">&nbsp;</td>
<?php endif ?>
<th>Title</th>
<th>Airing Status</th>
@ -33,7 +33,7 @@
<a class="bracketed" href="<?= $urlGenerator->url("/anime/edit/{$item['id']}/{$item['watching_status']}") ?>">Edit</a>
</td>
<?php endif ?>
<td class="align_left">
<td class="justify">
<a href="<?= $item['anime']['url'] ?>" target="_blank">
<?= $item['anime']['title'] ?>
</a>
@ -42,7 +42,7 @@
<td class="align_left"><?= $item['airing']['status'] ?></td>
<td><?= $item['user_rating'] ?> / 10 </td>
<td><?= $item['anime']['type'] ?></td>
<td id="<?= $item['anime']['slug'] ?>">
<td class="align_left" id="<?= $item['anime']['slug'] ?>">
Episodes: <br />
<span class="completed_number"><?= $item['episodes']['watched'] ?></span>&nbsp;/&nbsp;<span class="total_number"><?= $item['episodes']['total'] ?></span>
</td>

View File

@ -1,2 +1,3 @@
<script src="<?= $urlGenerator->asset_url('js.php?g=event') ?>"></script>
</body>
</html>

View File

@ -5,12 +5,9 @@
<title><?= $title ?></title>
<meta charset="utf-8" />
<meta http-equiv="cache-control" content="no-store" />
<meta http-equiv="Content-Security-Policy" content="script-src self" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self'" />
<link rel="stylesheet" href="<?= $urlGenerator->asset_url('css.php?g=base') ?>" />
<script>
var BASE_URL = "<?= $urlGenerator->base_url($url_type) ?>";
var CONTROLLER = "<?= $url_type ?>";
</script>
<script src="<?= $urlGenerator->asset_url('js.php?g=base') ?>"></script>
</head>
<body class="<?= $escape->attr($url_type) ?> list">
<header>
@ -50,11 +47,8 @@
</ul>
<?php endif ?>
</nav>
</header>
<?php if(isset($message) && is_array($message)): ?>
<div class="message <?= $escape->attr($message['message_type']) ?>">
<span class="icon"></span>
<?= $escape->html($message['message']) ?>
<span class="close" onclick="this.parentElement.style.display='none'">x</span>
</div>
<?php endif ?>
<?php if(isset($message) && is_array($message)):
extract($message);
include 'message.php';
endif ?>
</header>

5
app/views/message.ms Normal file
View File

@ -0,0 +1,5 @@
<div class="message {{message_type}}">
<span class="icon"></span>
{{message}}
<span class="close">x</span>
</div>

View File

@ -1,5 +1,5 @@
<div class="message <?= $escape->attr($message_type) ?>">
<span class="icon"></span>
<?= $escape->html($message) ?>
<span class="close" onclick="this.parentElement.style.display='none'">x</span>
<span class="close"></span>
</div>

20
public/bower.json Normal file
View File

@ -0,0 +1,20 @@
{
"name": "HummingbirdAnimeClient",
"homepage": "https://github.com/timw4mail/HummingBirdAnimeClient",
"authors": [
"Timothy J Warren <tim@timshomepage.net>"
],
"description": "Frontend stuff for php app",
"main": "",
"moduleType": [
"globals"
],
"license": "MIT",
"private": true,
"dependencies": {
"jquery": "^2.2.0",
"datatables": "DataTables#^1.10.10",
"jquery-throttle-debounce": "*",
"mustache.js": "mustache#^2.2.1"
}
}

0
public/cache/.gitkeep vendored Normal file
View File

View File

@ -6,67 +6,46 @@ body {
margin: 0.5em;
}
a:hover,
a:active {
color: #7d12db;
button {
background: rgba(255,255,255,0.65);
margin: 0;
}
table {
width: 85%;
/*width:85%;*/
margin: 0 auto;
}
tbody > tr:nth-child(odd) {
background: #ddd;
td {
padding: 1em;
padding: 1rem;
}
/* Table sorting styles */
th.sorting::after {
content: " ↕ ";
}
th.sorting_asc::after {
content: " ↑ ";
}
th.sorting_desc::after {
content: " ↓ ";
thead td,
thead th {
padding: 0.5em;
padding: 0.5rem;
}
input[type=number] {
width: 4em;
}
.form {
width: 100%;
tbody > tr:nth-child(odd) {
background: #ddd;
}
.form tr > td:nth-child(odd) {
text-align: right;
min-width: 25px;
max-width: 30%;
a:hover,
a:active {
color: #7d12db;
}
.form tr > td:nth-child(even) {
text-align: left;
min-width: 70%;
}
/* -----------------------------------------------------------------------------
Utility classes
------------------------------------------------------------------------------*/
.form thead th,
.form thead tr {
background: inherit;
border: 0;
}
.form.invisible tr:nth-child(odd) {
background: inherit;
}
.form.invisible tr,
.form.invisible td,
.form.invisible th {
border: 0;
.bracketed {
color: #12db18;
}
.bracketed,
@ -82,10 +61,6 @@ h1 a {
content: '\00a0]';
}
.bracketed {
color: #12db18;
}
.bracketed:hover,
.bracketed:active {
color: #db7d12;
@ -146,6 +121,10 @@ h1 a {
font-size: 1.6rem;
}
.justify {
text-align: justify;
}
.align_center {
text-align: center;
}
@ -158,11 +137,257 @@ h1 a {
text-align: right;
}
.no_border {
border: none;
}
.media-wrap {
text-align: center;
margin: 0 auto;
}
/* -----------------------------------------------------------------------------
CSS loading icon
------------------------------------------------------------------------------*/
.cssload-loader {
position: relative;
left: calc(50% - 31px);
width: 62px;
height: 62px;
border-radius: 50%;
-webkit-perspective: 780px;
perspective: 780px;
}
.cssload-inner {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
border-radius: 50%;
}
.cssload-inner.cssload-one {
left: 0%;
top: 0%;
-webkit-animation: cssload-rotate-one 1.15s linear infinite;
animation: cssload-rotate-one 1.15s linear infinite;
border-bottom: 3px solid rgb(0,0,0);
}
.cssload-inner.cssload-two {
right: 0%;
top: 0%;
-webkit-animation: cssload-rotate-two 1.15s linear infinite;
animation: cssload-rotate-two 1.15s linear infinite;
border-right: 3px solid rgb(0,0,0);
}
.cssload-inner.cssload-three {
right: 0%;
bottom: 0%;
-webkit-animation: cssload-rotate-three 1.15s linear infinite;
animation: cssload-rotate-three 1.15s linear infinite;
border-top: 3px solid rgb(0,0,0);
}
@-webkit-keyframes cssload-rotate-one {
0% {
-webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
}
}
@keyframes cssload-rotate-one {
0% {
-webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
}
}
@-webkit-keyframes cssload-rotate-two {
0% {
-webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
}
}
@keyframes cssload-rotate-two {
0% {
-webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
}
}
@-webkit-keyframes cssload-rotate-three {
0% {
-webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
}
}
@keyframes cssload-rotate-three {
0% {
-webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
}
100% {
-webkit-transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
}
}
/* -----------------------------------------------------------------------------
Table sorting and form styles
------------------------------------------------------------------------------*/
.sorting,
.sorting_asc,
.sorting_desc {
vertical-align: text-bottom;
}
.sorting::before {
content: " ↕\00a0";
}
.sorting_asc::before {
content: " ↑\00a0";
}
.sorting_desc::before {
content: " ↓\00a0";
}
.form {
width: 100%;
}
.form thead th,
.form thead tr {
background: inherit;
border: 0;
}
.form tr > td:nth-child(odd) {
text-align: right;
min-width: 25px;
max-width: 30%;
}
.form tr > td:nth-child(even) {
text-align: left;
min-width: 70%;
}
.form.invisible tr:nth-child(odd) {
background: inherit;
}
.form.invisible tr,
.form.invisible td,
.form.invisible th {
border: 0;
}
/* -----------------------------------------------------------------------------
Message boxes
------------------------------------------------------------------------------*/
.message {
position: relative;
margin: 0.5em auto;
padding: 0.5em;
width: 95%;
}
.message .close {
width: 1em;
height: 1em;
position: absolute;
right: 0.5em;
top: 0.5em;
text-align: center;
vertical-align: middle;
line-height: 1em;
}
/*.message .close:after {
content: '☐';
}*/
.message:hover .close:after {
content: '☒';
}
.message:hover {
cursor: pointer;
}
.message .icon {
left: 0.5em;
top: 0.5em;
margin-right: 1em;
}
.message.error {
border: 1px solid #924949;
background: #f3e6e6;
}
.message.error .icon::after {
content: '✘';
}
.message.success {
border: 1px solid #1f8454;
background: #70dda9;
}
.message.success .icon::after {
content: '✔';
}
.message.info {
border: 1px solid #bfbe3a;
background: #FFFFCC;
}
.message.info .icon::after {
content: '⚠';
}
/* -----------------------------------------------------------------------------
Base list styles
------------------------------------------------------------------------------*/
.media {
position: relative;
vertical-align: top;
@ -173,11 +398,6 @@ h1 a {
margin: 0.25em;
}
button {
background: rgba(255,255,255,0.65);
margin: 0;
}
.media .edit_buttons > button {
margin: 0.5em auto;
}
@ -238,53 +458,6 @@ button {
text-shadow: 1px 2px 1px rgba(0, 0, 0, 0.85);
}
/* -----------------------------------------------------------------------------
Message boxes
------------------------------------------------------------------------------*/
.message {
position: relative;
margin: 0.5em auto;
padding: 0.5em;
width: 95%;
}
.message .close {
width: 1em;
height: 1em;
position: absolute;
right: 0.5em;
top: 0.5em;
text-align: center;
vertical-align: middle;
line-height: 1em;
}
.message .close:hover {
cursor: pointer;
}
.message .icon {
left: 0.5em;
top: 0.5em;
margin-right: 1em;
}
.message.error {
border: 1px solid #924949;
background: #f3e6e6;
}
.message.success {
border: 1px solid #1f8454;
background: #70dda9;
}
.message.info {
border: 1px solid #bfbe3a;
background: #FFFFCC;
}
/* -----------------------------------------------------------------------------
Anime-list-specific styles
------------------------------------------------------------------------------*/
@ -384,4 +557,53 @@ button {
top: calc(50% - 58.5px);
left: 5px;
left: calc(50% - 95px);
}
/* -----------------------------------------------------------------------------
Page-specific styles
------------------------------------------------------------------------------*/
.media.search > .name {
background-color: #555;
background-color: rgba(000,000,000,0.35);
background-size: cover;
background-size: contain;
background-repeat: no-repeat;
}
.big-check {
display: none;
}
.big-check:checked + label {
-webkit-transition: .25s ease;
transition: .25s ease;
background: rgba(0,0,0,0.75);
}
.big-check:checked + label:after {
content: '✓';
font-size: 15em;
font-size: 15rem;
text-align: center;
color: greenyellow;
position: absolute;
top: 5px;
left: 0;
height: 100%;
width: 100%;
}
#series_list article.media {
position: relative;
}
#series_list .name,
#series_list .name label {
position: absolute;
display: block;
top: 0;
height: 100%;
width: 100%;
vertical-align: middle;
}

View File

@ -13,65 +13,51 @@ template {display:none}
body {margin: 0.5em;}
a:hover, a:active {
color: var(--link-hover-color)
button {
background:rgba(255,255,255,0.65);
margin: 0;
}
table {
width:85%;
/*width:85%;*/
margin: 0 auto;
}
tbody > tr:nth-child(odd) {
background: #ddd;
td {
padding:1em;
padding:1rem;
}
/* Table sorting styles */
th.sorting::after {
content: " ↕ ";
}
th.sorting_asc::after {
content: " ↑ ";
}
th.sorting_desc::after {
content: " ↓ ";
thead td, thead th {
padding:0.5em;
padding:0.5rem;
}
input[type=number] {
width: 4em;
}
.form { width:100%; }
.form tr > td:nth-child(odd) {
text-align:right;
min-width:25px;
max-width:30%;
}
.form tr > td:nth-child(even) {
text-align:left;
min-width:70%;
tbody > tr:nth-child(odd) {
background: #ddd;
}
.form thead th, .form thead tr {
background: inherit;
border:0;
a:hover, a:active {
color: var(--link-hover-color)
}
.form.invisible tr:nth-child(odd) {
background: inherit;
}
.form.invisible tr, .form.invisible td, .form.invisible th {
border:0;
}
/* -----------------------------------------------------------------------------
Utility classes
------------------------------------------------------------------------------*/
.bracketed {
color: var(--edit-link-color);
}
.bracketed, h1 a {
text-shadow: var(--link-shadow);
}
.bracketed:before {content: '[\00a0'}
.bracketed:after {content: '\00a0]'}
.bracketed {
color: var(--edit-link-color);
}
.bracketed:hover, .bracketed:active {
color: var(--edit-link-hover-color)
}
@ -89,15 +75,202 @@ input[type=number] {
font-size:1.6rem;
}
.justify {text-align:justify}
.align_center {text-align:center}
.align_left {text-align:left;}
.align_right {text-align:right;}
.align_left {text-align:left}
.align_right {text-align:right}
.no_border {border:none}
.media-wrap {
text-align:center;
margin:0 auto;
}
/* -----------------------------------------------------------------------------
CSS loading icon
------------------------------------------------------------------------------*/
.cssload-loader {
position: relative;
left: calc(50% - 31px);
width: 62px;
height: 62px;
border-radius: 50%;
perspective: 780px;
}
.cssload-inner {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
border-radius: 50%;
}
.cssload-inner.cssload-one {
left: 0%;
top: 0%;
animation: cssload-rotate-one 1.15s linear infinite;
border-bottom: 3px solid rgb(0,0,0);
}
.cssload-inner.cssload-two {
right: 0%;
top: 0%;
animation: cssload-rotate-two 1.15s linear infinite;
border-right: 3px solid rgb(0,0,0);
}
.cssload-inner.cssload-three {
right: 0%;
bottom: 0%;
animation: cssload-rotate-three 1.15s linear infinite;
border-top: 3px solid rgb(0,0,0);
}
@keyframes cssload-rotate-one {
0% {
transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
}
100% {
transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
}
}
@keyframes cssload-rotate-two {
0% {
transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
}
100% {
transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
}
}
@keyframes cssload-rotate-three {
0% {
transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
}
100% {
transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
}
}
/* -----------------------------------------------------------------------------
Table sorting and form styles
------------------------------------------------------------------------------*/
.sorting,
/*.sorting::before,*/
.sorting_asc,
/*.sorting_asc::before,*/
.sorting_desc
/*.sorting_desc::before*/ {
vertical-align:text-bottom;
}
.sorting::before {
content: " ↕\00a0";
}
.sorting_asc::before {
content: " ↑\00a0";
}
.sorting_desc::before {
content: " ↓\00a0";
}
.form { width:100%; }
.form thead th, .form thead tr {
background: inherit;
border:0;
}
.form tr > td:nth-child(odd) {
text-align:right;
min-width:25px;
max-width:30%;
}
.form tr > td:nth-child(even) {
text-align:left;
min-width:70%;
}
.form.invisible tr:nth-child(odd) {
background: inherit;
}
.form.invisible tr, .form.invisible td, .form.invisible th {
border:0;
}
/* -----------------------------------------------------------------------------
Message boxes
------------------------------------------------------------------------------*/
.message{
position:relative;
margin:0.5em auto;
padding:0.5em;
width:95%;
}
.message .close{
width:1em;
height:1em;
position:absolute;
right:0.5em;
top:0.5em;
text-align:center;
vertical-align:middle;
line-height:1em;
}
/*.message .close:after {
content: '☐';
}*/
.message:hover .close:after {
content: '☒';
}
.message:hover {
cursor:pointer;
}
.message .icon{
left:0.5em;
top:0.5em;
margin-right:1em;
}
.message.error{
border:1px solid #924949;
background: #f3e6e6;
}
.message.error .icon::after {
content: '✘';
}
.message.success{
border:1px solid #1f8454;
background: #70dda9;
}
.message.success .icon::after {
content: '✔'
}
.message.info{
border:1px solid #bfbe3a;
background: #FFFFCC;
}
.message.info .icon::after {
content: '⚠';
}
/* -----------------------------------------------------------------------------
Base list styles
------------------------------------------------------------------------------*/
.media {
position:relative;
vertical-align:top;
@ -108,11 +281,6 @@ input[type=number] {
margin: var(--normal-padding);
}
button {
background:rgba(255,255,255,0.65);
margin: 0;
}
.media .edit_buttons > button {
margin:0.5em auto;
}
@ -172,52 +340,7 @@ button {
text-shadow: var(--shadow);
}
/* -----------------------------------------------------------------------------
Message boxes
------------------------------------------------------------------------------*/
.message{
position:relative;
margin:0.5em auto;
padding:0.5em;
width:95%;
}
.message .close{
width:1em;
height:1em;
position:absolute;
right:0.5em;
top:0.5em;
text-align:center;
vertical-align:middle;
line-height:1em;
}
.message .close:hover {
cursor:pointer;
}
.message .icon{
left:0.5em;
top:0.5em;
margin-right:1em;
}
.message.error{
border:1px solid #924949;
background: #f3e6e6;
}
.message.success{
border:1px solid #1f8454;
background: #70dda9;
}
.message.info{
border:1px solid #bfbe3a;
background: #FFFFCC;
}
/* -----------------------------------------------------------------------------
Anime-list-specific styles
@ -304,3 +427,52 @@ button {
left: 5px;
left: calc(50% - 95px);
}
/* -----------------------------------------------------------------------------
Page-specific styles
------------------------------------------------------------------------------*/
.media.search > .name {
background-color:#555;
background-color: rgba(000,000,000,0.35);
background-size: cover;
background-size: contain;
background-repeat: no-repeat;
}
.big-check {
display:none;
}
.big-check:checked + label {
transition: .25s ease;
background:rgba(0,0,0,0.75);
}
.big-check:checked + label:after {
content: '✓';
font-size: 15em;
font-size: 15rem;
text-align:center;
color: greenyellow;
position:absolute;
top:5px;
left:0;
height:100%;
width:100%;
}
#series_list article.media {
position:relative;
}
#series_list .name, #series_list .name label {
position:absolute;
display:block;
top:0;
height:100%;
width:100%;
vertical-align:middle;
}

View File

@ -111,7 +111,6 @@ button,
input,
select,
textarea {
/*background-color: transparent;*/
border: .1rem solid #ccc;
color: inherit;
font-family: inherit;
@ -507,7 +506,7 @@ textarea {
input[type=submit],
button {
background-color: transparent;
/*background-color: transparent;*/
border: .2rem solid #444;
border-radius: 0;
color: #444;

View File

@ -78,7 +78,6 @@ audio, canvas, iframe, img, svg, video {
vertical-align: middle; }
button, input, select, textarea {
/*background-color: transparent;*/
border: .1rem solid #ccc;
color: inherit;
font-family: inherit;
@ -342,7 +341,7 @@ textarea {
vertical-align: middle; }
input[type=submit], button {
background-color: transparent;
/*background-color: transparent;*/
border: .2rem solid #444;
border-radius: 0;
color: #444;

View File

@ -19,7 +19,7 @@ use GuzzleHttp\Psr7\Request;
require_once('../app/config/minify_config.php');
//Include the js groups
$groups_file = "../app/config/minify_js_groups.php";
$groups_file = '../app/config/minify_js_groups.php';
$groups = require_once($groups_file);
// Include guzzle
@ -67,8 +67,9 @@ function google_min($new_file)
'output_info' => 'errors',
'output_format' => 'json',
'compilation_level' => 'SIMPLE_OPTIMIZATIONS',
//'compilation_level' => 'ADVANCED_OPTIMIZATIONS',
'js_code' => $new_file,
'language' => 'ECMASCRIPT5',
'language' => 'ECMASCRIPT6_STRICT',
'language_out' => 'ECMASCRIPT5_STRICT'
];
@ -77,17 +78,18 @@ function google_min($new_file)
$error_res = $error_client->post('http://closure-compiler.appspot.com/compile', [
'headers' => [
'Accept-Encoding' => 'gzip',
"Content-type" => "application/x-www-form-urlencoded"
'Content-type' => 'application/x-www-form-urlencoded'
],
'form_params' => $options
]);
$error_json = $error_res->getBody();
$error_obj = json_decode($error_json);
$error_obj = json_decode($error_json) ?: (object)[];
// Show error if exists
if ( ! empty($error_obj->errors))
{
?><pre><?= json_encode($err_obj, JSON_PRETTY_PRINT) ?></pre><?php
echo json_encode($error_obj, JSON_PRETTY_PRINT);
die();
}
@ -97,7 +99,7 @@ function google_min($new_file)
$res = $client->post('http://closure-compiler.appspot.com/compile', [
'headers' => [
'Accept-Encoding' => 'gzip',
"Content-type" => "application/x-www-form-urlencoded"
'Content-type' => 'application/x-www-form-urlencoded'
],
'form_params' => $options
]);
@ -163,7 +165,7 @@ if(isset($groups[$_GET['g']]))
}
else //Nothing to display? Just exit
{
die("You must specify a group that exists");
die('You must specify a group that exists');
}
// --------------------------------------------------------------------------
@ -180,7 +182,7 @@ $requested_time=(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))
// don't resend the file
if($last_modified === $requested_time)
{
header("HTTP/1.1 304 Not Modified");
header('HTTP/1.1 304 Not Modified');
exit();
}
@ -188,7 +190,7 @@ if($last_modified === $requested_time)
//Determine what to do: rebuild cache, send files as is, or send cache.
// If debug is set, just concatenate
if(isset($_GET['debug']))
if(array_key_exists('debug', $_GET))
{
$js = get_files();
}
@ -199,7 +201,7 @@ else if($cache_modified < $last_modified)
//Make sure cache file gets created/updated
if(file_put_contents($cache_file, $js) === FALSE)
{
die("Cache file was not created. Make sure you have the correct folder permissions.");
die('Cache file was not created. Make sure you have the correct folder permissions.');
}
}
// Otherwise, send the cached file
@ -212,13 +214,13 @@ else
//This GZIPs the js for transmission to the user
//making file size smaller and transfer rate quicker
ob_start("ob_gzhandler");
ob_start('ob_gzhandler');
// Set important caching headers
header("Content-Type: application/javascript; charset=utf8");
header("Cache-control: public, max-age=691200, must-revalidate");
header("Last-Modified: ".gmdate('D, d M Y H:i:s', $last_modified)." GMT");
header("Expires: ".gmdate('D, d M Y H:i:s', (filemtime($this_file) + 691200))." GMT");
header('Content-Type: application/javascript; charset=utf8');
header('Cache-control: public, max-age=691200, must-revalidate');
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_modified).' GMT');
header('Expires: '.gmdate('D, d M Y H:i:s', (filemtime($this_file) + 691200)).' GMT');
echo $js;

View File

@ -1,17 +1,46 @@
(function($, undefined) {
(($, AnimeClient) => {
'use strict';
function search(query, callback)
{
$.get(BASE_URL + 'collection/search', {'query':query}, callback);
var endpoint = '//' + document.location.host + '/collection/search';
return $.get(AnimeClient.url('/collection/search'), {'query':query}, callback);
}
$("#search").on('keypress', $.throttle(750, function(e) {
var query = encodeURIComponent($(this).val());
search(query, function(res) {
var template = $.templates("#show_list");
var html = template.render(res);
$('#series_list').html(html);
});
}));
$.get('/public/templates/ajax-search-results.html').done(tempHtml => {
$('#search').on('keypress', $.throttle(750, function(e) {
$('.cssload-loader').removeAttr('hidden');
let query = encodeURIComponent($(this).val());
$.get(AnimeClient.url('/collection/search'), {'query':query}).done((searchResults) => {
$('.cssload-loader').attr('hidden', 'hidden');
}(jQuery));
// Give mustache a key to iterate over
searchResults = {
anime: searchResults
};
Mustache.parse(tempHtml);
$('#series_list').html(Mustache.render(tempHtml, searchResults));
}).fail(() => {
$('.cssload-loader').attr('hidden', 'hidden');
});
}));
});
/*$.get('/public/templates/ajax-search-results.html', tempHtml => {
$('#search').on('keypress', $.throttle(750, function(e) {
var query = encodeURIComponent($(this).val());
search(query, function(searchResults) {
// Give mustache a key to iterate over
searchResults = {
anime: searchResults
};
Mustache.parse(tempHtml);
var rendered = Mustache.render(tempHtml, searchResults);
$('#series_list').html(rendered);
});
}));
});*/
})(jQuery, AnimeClient);

View File

@ -1,42 +1,38 @@
/**
* Javascript for editing anime, if logged in
*/
(function($){
(($, AnimeClient, w) => {
"use strict";
if (CONTROLLER !== "anime") return;
'use strict';
// Action to increment episode count
$(".plus_one").on("click", function(e) {
e.stopPropagation();
$('body.anime.list').on('click', '.plus_one', function(e) {
//e.stopPropagation();
var self = this;
var this_sel = $(this);
var parent_sel = $(this).closest("article, td");
let self = this;
let this_sel = $(this);
let parent_sel = $(this).closest('article, td');
var watched_count = parseInt(parent_sel.find('.completed_number').text(), 10);
var total_count = parseInt(parent_sel.find('.total_number').text(), 10);
var title = parent_sel.find('.name a').text();
let watched_count = parseInt(parent_sel.find('.completed_number').text(), 10);
let total_count = parseInt(parent_sel.find('.total_numb