mirror of
https://github.com/hkalexling/Mango.git
synced 2026-01-24 00:03:14 -05:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07100121ef | ||
|
|
a0e550569e | ||
|
|
bbbe2e0588 | ||
|
|
9d31b24e8c | ||
|
|
38ba324fa9 | ||
|
|
c00016fa19 | ||
|
|
4d5a305d1b | ||
|
|
f9ca52ee2f | ||
|
|
f6c393545c |
@@ -50,7 +50,7 @@ The official docker images are available on [Dockerhub](https://hub.docker.com/r
|
||||
### CLI
|
||||
|
||||
```
|
||||
Mango - Manga Server and Web Reader. Version 0.7.2
|
||||
Mango - Manga Server and Web Reader. Version 0.7.3
|
||||
|
||||
Usage:
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ gulp.task('minify-js', () => {
|
||||
});
|
||||
|
||||
gulp.task('less', () => {
|
||||
return gulp.src('src/assets/*.less')
|
||||
return gulp.src('public/css/*.less')
|
||||
.pipe(less())
|
||||
.pipe(gulp.dest('public/css'));
|
||||
});
|
||||
|
||||
@@ -1,74 +1,99 @@
|
||||
.uk-alert-close {
|
||||
color: black !important;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.uk-card-body {
|
||||
padding: 20px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.uk-card-media-top {
|
||||
height: 250px;
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.uk-card-media-top {
|
||||
height: 300px;
|
||||
.uk-card-media-top {
|
||||
height: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
.uk-card-media-top>img {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
.uk-card-media-top > img {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.uk-card-title {
|
||||
height: 3em;
|
||||
max-height: 3em;
|
||||
}
|
||||
|
||||
.acard:hover {
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.uk-list li {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.reader-bg {
|
||||
background-color: black;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
#scan-status {
|
||||
cursor: auto;
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.break-word {
|
||||
word-wrap: break-word;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.uk-logo > img {
|
||||
height: 90px;
|
||||
width: 90px;
|
||||
|
||||
.uk-logo>img {
|
||||
height: 90px;
|
||||
width: 90px;
|
||||
}
|
||||
|
||||
.uk-search {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#selectable .ui-selecting {
|
||||
background: #EEE6B9;
|
||||
background: #EEE6B9;
|
||||
}
|
||||
|
||||
#selectable .ui-selected {
|
||||
background: #F4E487;
|
||||
background: #F4E487;
|
||||
}
|
||||
|
||||
#selectable .ui-selecting.dark {
|
||||
background: #5E5731;
|
||||
background: #5E5731;
|
||||
}
|
||||
|
||||
#selectable .ui-selected.dark {
|
||||
background: #9D9252;
|
||||
background: #9D9252;
|
||||
}
|
||||
td > .uk-dropdown {
|
||||
white-space: pre-line;
|
||||
|
||||
td>.uk-dropdown {
|
||||
white-space: pre-line;
|
||||
}
|
||||
#edit-modal .uk-grid > div {
|
||||
height: 300px;
|
||||
|
||||
#edit-modal .uk-grid>div {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
#edit-modal #cover {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
#edit-modal #cover-upload {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#edit-modal .uk-modal-body .uk-inline {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.item .uk-card-title {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
const truncate = () => {
|
||||
$('.acard .uk-card-title').each((i, e) => {
|
||||
$('.uk-card-title').each((i, e) => {
|
||||
$(e).dotdotdot({
|
||||
truncate: 'letter',
|
||||
watch: true,
|
||||
callback: (truncated) => {
|
||||
if (truncated) {
|
||||
$(e).attr('uk-tooltip', $(e).attr('data-title'));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$(e).removeAttr('uk-tooltip');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
$(() => {
|
||||
const titleID = $('.data').attr('data-title-id') || 'library';
|
||||
|
||||
const sortItems = () => {
|
||||
const sort = $('#sort-select').find(':selected').attr('id');
|
||||
localStorage.setItem(`sort-${titleID}`, sort);
|
||||
|
||||
const ary = sort.split('-');
|
||||
const by = ary[0];
|
||||
const dir = ary[1];
|
||||
@@ -25,20 +29,21 @@ $(() => {
|
||||
|
||||
if (!keyRange[key]) {
|
||||
keyRange[key] = [num, num, 1];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
keyRange[key][2] += 1;
|
||||
if (num < keyRange[key][0]) {
|
||||
keyRange[key][0] = num;
|
||||
}
|
||||
else if (num > keyRange[key][1]) {
|
||||
} else if (num > keyRange[key][1]) {
|
||||
keyRange[key][1] = num;
|
||||
}
|
||||
}
|
||||
|
||||
match = regex.exec(name);
|
||||
}
|
||||
ctxAry.push({index: i, numbers: numbers});
|
||||
ctxAry.push({
|
||||
index: i,
|
||||
numbers: numbers
|
||||
});
|
||||
});
|
||||
|
||||
console.log(keyRange);
|
||||
@@ -84,8 +89,7 @@ $(() => {
|
||||
if (dir === 'down') {
|
||||
items.reverse();
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
items.sort((a, b) => {
|
||||
var res;
|
||||
if (by === 'name')
|
||||
@@ -108,13 +112,17 @@ $(() => {
|
||||
});
|
||||
}
|
||||
$('#item-container').append(items);
|
||||
setupAcard();
|
||||
};
|
||||
|
||||
$('#sort-select').change(() => {
|
||||
sortItems();
|
||||
});
|
||||
|
||||
if ($('option#auto-up').length > 0)
|
||||
const sortID = localStorage.getItem(`sort-${titleID}`);
|
||||
if (sortID)
|
||||
$(`option#${sortID}`).attr('selected', '');
|
||||
else if ($('option#auto-up').length > 0)
|
||||
$('option#auto-up').attr('selected', '');
|
||||
else
|
||||
$('option#name-up').attr('selected', '');
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
$(() => {
|
||||
setupAcard();
|
||||
});
|
||||
|
||||
const setupAcard = () => {
|
||||
$('.acard.is_entry').click((e) => {
|
||||
if ($(e.target).hasClass('no-modal')) return;
|
||||
const card = $(e.target).closest('.acard');
|
||||
|
||||
showModal(
|
||||
$(card).attr('data-encoded-path'),
|
||||
parseInt($(card).attr('data-pages')),
|
||||
parseFloat($(card).attr('data-progress')),
|
||||
$(card).attr('data-encoded-book-title'),
|
||||
$(card).attr('data-encoded-title'),
|
||||
$(card).attr('data-book-id'),
|
||||
$(card).attr('data-id')
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
function showModal(encodedPath, pages, percentage, encodedeTitle, encodedEntryTitle, titleID, entryID) {
|
||||
const zipPath = decodeURIComponent(encodedPath);
|
||||
const title = decodeURIComponent(encodedeTitle);
|
||||
@@ -15,9 +36,6 @@ function showModal(encodedPath, pages, percentage, encodedeTitle, encodedEntryTi
|
||||
$('#continue-btn').text('Continue from ' + percentage + '%');
|
||||
}
|
||||
|
||||
$('#modal-title-link').text(title);
|
||||
$('#modal-title-link').attr('href', `${base_url}book/${titleID}`);
|
||||
|
||||
$('#modal-entry-title').find('span').text(entry);
|
||||
$('#modal-entry-title').next().attr('data-id', titleID);
|
||||
$('#modal-entry-title').next().attr('data-entry-id', entryID);
|
||||
|
||||
@@ -6,7 +6,7 @@ shards:
|
||||
|
||||
archive:
|
||||
github: hkalexling/archive.cr
|
||||
version: 0.2.0
|
||||
version: 0.3.0
|
||||
|
||||
baked_file_system:
|
||||
github: schovi/baked_file_system
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: mango
|
||||
version: 0.7.2
|
||||
version: 0.7.3
|
||||
|
||||
authors:
|
||||
- Alex Ling <hkalexling@gmail.com>
|
||||
|
||||
@@ -457,7 +457,7 @@ class Title
|
||||
last_read_entry = nil
|
||||
|
||||
@entries.reverse_each do |e|
|
||||
if progress.has_key? e.title
|
||||
if progress.has_key?(e.title) && progress[e.title] > 0
|
||||
last_read_entry = e
|
||||
break
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ require "./mangadex/*"
|
||||
require "option_parser"
|
||||
require "clim"
|
||||
|
||||
MANGO_VERSION = "0.7.2"
|
||||
MANGO_VERSION = "0.7.3"
|
||||
|
||||
macro common_option
|
||||
option "-c PATH", "--config=PATH", type: String,
|
||||
|
||||
@@ -14,37 +14,53 @@
|
||||
id="<%= item.id %>"
|
||||
<% end %>>
|
||||
|
||||
<a class="acard"
|
||||
<% unless item.is_a? Entry %>
|
||||
href="<%= base_url %>book/<%= item.id %>"
|
||||
<div class="acard
|
||||
<% if item.is_a? Entry %>
|
||||
<%= "is_entry" %>
|
||||
<% end %>
|
||||
"
|
||||
<% if item.is_a? Entry %>
|
||||
data-encoded-path="<%= item.encoded_path %>"
|
||||
data-pages="<%= item.pages %>"
|
||||
data-progress="<%= (progress * 100).round(1) %>"
|
||||
data-encoded-book-title="<%= item.book.encoded_display_name %>"
|
||||
data-encoded-title="<%= item.encoded_display_name %>"
|
||||
data-book-id="<%= item.book.id %>"
|
||||
data-id="<%= item.id %>"
|
||||
<% else %>
|
||||
onclick="location='<%= base_url %>book/<%= item.id %>'"
|
||||
<% end %>>
|
||||
|
||||
<div class="uk-card uk-card-default"
|
||||
<% if item.is_a? Entry %>
|
||||
onclick="showModal("<%= item.encoded_path %>", '<%= item.pages %>', <%= (progress * 100).round(1) %>, "<%= item.book.encoded_display_name %>", "<%= item.encoded_display_name %>", '<%= item.title_id %>', '<%= item.id %>')"
|
||||
<% end %>>
|
||||
|
||||
<div class="uk-card uk-card-default">
|
||||
<div class="uk-card-media-top">
|
||||
<img data-src="<%= item.cover_url %>" data-width data-height alt="" uk-img>
|
||||
</div>
|
||||
|
||||
<div class="uk-card-body">
|
||||
<% unless progress < 0 || progress > 100 %>
|
||||
<div class="uk-card-badge uk-label"><%= (progress * 100).round(1) %>%</div>
|
||||
<div class="uk-card-badge label"><%= (progress * 100).round(1) %>%</div>
|
||||
<% end %>
|
||||
|
||||
<h3 class="uk-card-title break-word" data-title="<%= item.display_name.gsub("\"", """) %>"><%= item.display_name %></h3>
|
||||
<h3 class="uk-card-title break-word
|
||||
<% if page == "home" && item.is_a? Entry %>
|
||||
<%= "uk-margin-remove-bottom" %>
|
||||
<% end %>
|
||||
" data-title="<%= HTML.escape(item.display_name) %>"><%= item.display_name %>
|
||||
</h3>
|
||||
<% if page == "home" && item.is_a? Entry %>
|
||||
<a class="uk-card-title break-word uk-margin-remove-top uk-text-meta uk-display-inline-block no-modal" data-title="<%= HTML.escape(item.book.display_name) %>" href="<%= base_url %>book/<%= item.book.id %>"><%= HTML.escape(item.book.display_name) %></a>
|
||||
<% end %>
|
||||
<% if item.is_a? Entry %>
|
||||
<p><%= item.pages %> pages</p>
|
||||
<p class="uk-text-meta"><%= item.pages %> pages</p>
|
||||
<% end %>
|
||||
<% if item.is_a? Title %>
|
||||
<% if grouped_count == 1 %>
|
||||
<p><%= item.size %> entries</p>
|
||||
<p class="uk-text-meta"><%= item.size %> entries</p>
|
||||
<% else %>
|
||||
<p><%= grouped_count %> new entries</p>
|
||||
<p class="uk-text-meta"><%= grouped_count %> new entries</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
<button class="uk-modal-close-default" type="button" uk-close></button>
|
||||
<div class="uk-modal-header">
|
||||
<div>
|
||||
<% if page == "home" %>
|
||||
<h4 class="uk-margin-remove-bottom"><a id="modal-title-link"></a></h4>
|
||||
<% end %>
|
||||
<h3 class="uk-modal-title break-word uk-margin-remove-top" id="modal-entry-title"><span></span>
|
||||
|
||||
<% unless page == "home" %>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<div class="data" data-title-id="<%= title.id %>"></div>
|
||||
<div>
|
||||
<h2 class=uk-title><span><%= title.display_name %></span>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user