Merge branch 'new-site'
This commit is contained in:
commit
66945db7de
29 changed files with 6437 additions and 8 deletions
38
.github/deploy.sh
vendored
Executable file
38
.github/deploy.sh
vendored
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
P="$(mktemp -d)"
|
||||
|
||||
if [ "$encrypted_1671ba5f199a_key" ]
|
||||
then
|
||||
eval "$(ssh-agent -s)"
|
||||
openssl aes-256-cbc -K $encrypted_1671ba5f199a_key -iv $encrypted_1671ba5f199a_iv \
|
||||
-in .github/deploy_key.enc -out .github/deploy_key -d
|
||||
chmod 600 .github/deploy_key
|
||||
ssh-add .github/deploy_key
|
||||
|
||||
pip install git+https://github.com/spanezz/staticsite.git
|
||||
fi
|
||||
|
||||
[ -d $P ] && rm -Rfv $P
|
||||
git clone --depth=10 --branch=gh-pages git@github.com:${TRAVIS_REPO_SLUG}.git $P
|
||||
|
||||
ssite build
|
||||
|
||||
rsync -r --del --verbose --exclude tests \
|
||||
--exclude dosagelib --exclude dist --exclude build --exclude scripts \
|
||||
../*.site.out/* $P/
|
||||
|
||||
cd $P
|
||||
|
||||
git config user.email 'nobody@23.gs'
|
||||
git config user.name 'Travis-CI Website Bot'
|
||||
git config push.default simple
|
||||
|
||||
git add -A .
|
||||
if [ "$TRAVIS_COMMIT" ]
|
||||
then
|
||||
git commit -a -m "Update website from commit $TRAVIS_COMMIT"
|
||||
git push origin HEAD:gh-pages
|
||||
fi
|
||||
|
BIN
.github/deploy_key.enc
vendored
Normal file
BIN
.github/deploy_key.enc
vendored
Normal file
Binary file not shown.
1
.github/deploy_key.pub
vendored
Normal file
1
.github/deploy_key.pub
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG/I1J2fVYFzxQP7cZK32kI28cv94NH0xdq08OoIfwpz website-autodeploy
|
12
.staticsite.py
Normal file
12
.staticsite.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
SITE_NAME = "dosage"
|
||||
SITE_SUB = "a comic downloader and archiver"
|
||||
SITE_AUTHOR = "Tobias Gruetzmacher"
|
||||
SITE_LINKS = (
|
||||
{'name': 'Downloads', 'icon': 'download', 'url': 'https://github.com/webcomics/dosage/releases/latest'},
|
||||
{'name': 'Report Issue', 'icon': 'bug', 'url': 'https://github.com/webcomics/dosage/issues/new'},
|
||||
)
|
||||
SITE_ICONS = (
|
||||
{'name': 'GitHub', 'icon': 'github', 'url': 'https://github.com/webcomics/dosage/releases/latest'},
|
||||
)
|
||||
|
||||
THEME = "doc/.theme"
|
|
@ -25,3 +25,10 @@ notifications:
|
|||
- "chat.freenode.net#dosage"
|
||||
use_notice: true
|
||||
skip_join: true
|
||||
# Push site to gh-pages branch
|
||||
deploy:
|
||||
- provider: script
|
||||
skip_cleanup: true
|
||||
script: .github/deploy.sh
|
||||
on:
|
||||
branch: master
|
||||
|
|
108
README.md
108
README.md
|
@ -1,15 +1,12 @@
|
|||
Dosage
|
||||
======
|
||||
# Dosage
|
||||
|
||||
[![Build Status](https://travis-ci.org/webcomics/dosage.svg?branch=master)](https://travis-ci.org/webcomics/dosage)
|
||||
[![Code Climate](https://codeclimate.com/github/webcomics/dosage/badges/gpa.svg)](https://codeclimate.com/github/webcomics/dosage)
|
||||
[![codecov](https://codecov.io/gh/webcomics/dosage/branch/master/graph/badge.svg)](https://codecov.io/gh/webcomics/dosage)
|
||||
[![Maintenance](https://img.shields.io/maintenance/yes/2018.svg)]()
|
||||
|
||||
Dosage is a comic strip downloader and archiver.
|
||||
|
||||
Dosage is designed to keep a local copy of specific webcomics and other
|
||||
picture-based content such as Picture of the Day sites. With the dosage
|
||||
picture-based content such as Picture of the Day sites. With the dosage
|
||||
commandline script you can get the latest strip of a webcomic, or catch-up to
|
||||
the last strip downloaded, or download a strip for a particular date/index (if
|
||||
the webcomic's site layout allows this).
|
||||
|
@ -17,4 +14,103 @@ the webcomic's site layout allows this).
|
|||
Multiple webcomics can be downloaded in parallel, making the update of comic
|
||||
strips faster.
|
||||
|
||||
See http://dosage.rocks/ for more info.
|
||||
## Notice
|
||||
|
||||
This software is in no way intended to publically "broadcast" comic strips, it
|
||||
is purely for personal use. Please be aware that by making downloaded strips
|
||||
publically available (without the explicit permission of the author) you may be
|
||||
infringing upon various copyrights.
|
||||
|
||||
Additionally, Dosage respects the robots.txt exclusion protocol. This makes
|
||||
sure no content is accessed in an automatic way without consent by the
|
||||
publishers.
|
||||
|
||||
In any case you should support the authors of the comics you are downloading,
|
||||
either by buying some of their products or even donating them some money since
|
||||
they provide the comics you like and read.
|
||||
|
||||
If you are a publisher of comics and want Dosage to access your files,
|
||||
add the following entry to your robots.txt file:
|
||||
|
||||
User-agent: Dosage
|
||||
Allow: *
|
||||
|
||||
## Adult content
|
||||
|
||||
Some comics contain adult content and require age confirmation. These comics
|
||||
can only be downloaded by using the `--adult` option, which confirms that you
|
||||
are old enough to view them.
|
||||
|
||||
## Usage
|
||||
|
||||
List available comics (ca. 3000 at the moment):
|
||||
|
||||
$ dosage --list
|
||||
|
||||
Get the latest comic of for example CalvinAndHobbes and save it in the "Comics"
|
||||
directory:
|
||||
|
||||
$ dosage CalvinAndHobbes
|
||||
|
||||
If you already have downloaded several comics and want to get the latest strip
|
||||
of all of them:
|
||||
|
||||
$ dosage @
|
||||
|
||||
|
||||
To help others find good comics, you can vote for your favourite ones:
|
||||
|
||||
$ dosage --vote @
|
||||
|
||||
For advanced options and features execute `dosage --help`.
|
||||
|
||||
## Dependencies
|
||||
|
||||
[Python](http://www.python.org/): for Python 2.x at least 2.7.0, for Python 3.x
|
||||
at least Python 3.3. Dosage requires the following Python modules:
|
||||
|
||||
- colorama
|
||||
- lxml
|
||||
- pbr
|
||||
- requests
|
||||
- six
|
||||
|
||||
For certain modules you need th `cssselect` module, for bash argument
|
||||
completion you need the `argcomplete` module.
|
||||
|
||||
## Installation
|
||||
|
||||
The easy way with pip:
|
||||
|
||||
pip install --user dosage
|
||||
|
||||
You can invoke Dosage directly from the source code as `./dosage`.
|
||||
Alternatively, you can install Dosage using setuptools by invoking `setup.py`
|
||||
in the root of the distribution. For example:
|
||||
|
||||
python setup.py install
|
||||
|
||||
or if you do not have root permissions:
|
||||
|
||||
python setup.py install --home=$HOME
|
||||
|
||||
## Reporting Bugs
|
||||
|
||||
You can report bugs, patches or requests at the [GitHub issue
|
||||
tracker](https://github.com/webcomics/dosage/issues) - Dosage currently
|
||||
supports a large number of comics and that number grows on a regular basis. If
|
||||
you feel that there are comics that Dosage does not currently support, but
|
||||
should support, please feel free to request them.
|
||||
|
||||
## Extending Dosage
|
||||
|
||||
In order to add a new webcomic, a new module class has to be created in one of
|
||||
the *.py files in the `dosagelib/plugins` subdirectory. Look at the
|
||||
[documentation for adding modules](doc/adding_new_comics.md) and at
|
||||
existing module classes for examples.
|
||||
|
||||
### Test suite status
|
||||
|
||||
Dosage has extensive unit tests to ensure the code quality.
|
||||
[Travis-CI](https://travis-ci.org/) is used for continuous build and test
|
||||
integration. See the badges at the top of this page for the current status.
|
||||
|
|
63
doc/.theme/LICENSE.txt
Normal file
63
doc/.theme/LICENSE.txt
Normal file
|
@ -0,0 +1,63 @@
|
|||
Creative Commons Attribution 3.0 Unported
|
||||
http://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
License
|
||||
|
||||
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
|
||||
|
||||
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
|
||||
|
||||
1. Definitions
|
||||
|
||||
1. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
|
||||
2. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
|
||||
3. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
|
||||
4. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
|
||||
5. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
|
||||
6. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
|
||||
7. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
|
||||
8. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
|
||||
9. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
|
||||
|
||||
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
|
||||
|
||||
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
|
||||
|
||||
1. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
|
||||
2. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
|
||||
3. to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
|
||||
4. to Distribute and Publicly Perform Adaptations.
|
||||
5.
|
||||
|
||||
For the avoidance of doubt:
|
||||
1. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
|
||||
2. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
|
||||
3. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
|
||||
|
||||
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
|
||||
|
||||
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
|
||||
|
||||
1. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested.
|
||||
2. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
|
||||
3. Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
|
||||
|
||||
5. Representations, Warranties and Disclaimer
|
||||
|
||||
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
|
||||
|
||||
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. Termination
|
||||
|
||||
1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
|
||||
2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
|
||||
|
||||
8. Miscellaneous
|
||||
|
||||
1. Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
|
||||
2. Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
|
||||
3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
|
||||
4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
|
||||
5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
|
||||
6. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
|
26
doc/.theme/README.txt
Normal file
26
doc/.theme/README.txt
Normal file
|
@ -0,0 +1,26 @@
|
|||
Prologue by HTML5 UP
|
||||
html5up.net | @ajlkn
|
||||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
||||
|
||||
|
||||
This is Prologue, a simple, single page responsive site template. It features a
|
||||
clean, minimalistic design and a sticky sidebar with navigation-linked scrolling.
|
||||
|
||||
AJ
|
||||
aj@lkn.io | @ajlkn
|
||||
|
||||
PS: Not sure how to get that contact form working? Give formspree.io a try (it's awesome).
|
||||
|
||||
|
||||
Credits:
|
||||
|
||||
Icons:
|
||||
Font Awesome (fortawesome.github.com/Font-Awesome)
|
||||
|
||||
Other
|
||||
jQuery (jquery.com)
|
||||
CSS3 Pie (css3pie.com)
|
||||
Respond.js (j.mp/respondjs)
|
||||
jquery.scrolly (@ajlkn)
|
||||
jquery.scrollzer (@ajlkn)
|
||||
Skel (skel.io)
|
35
doc/.theme/dir.html
Normal file
35
doc/.theme/dir.html
Normal file
|
@ -0,0 +1,35 @@
|
|||
{% extends "page.html" %}
|
||||
{% block title %}{{page.meta.title}}{% endblock %}
|
||||
{% block content %}
|
||||
<h2>{{page.meta.title}}</h2>
|
||||
|
||||
<div class="table-wrapper">
|
||||
<table class="alt">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Page</th>
|
||||
<th>Title</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if parent_page %}
|
||||
<tr>
|
||||
<td class="col-md-2"><a href="{{url_for(parent_page)}}">{{parent_page.meta.date.strftime("%Y-%m-%d")}}</a></td>
|
||||
<td class="col-md-3"><a href="{{url_for(parent_page)}}">.. {% if parent_page.dst_link|basename %}({{parent_page.dst_link|basename}}){% endif %}</a></td>
|
||||
<td class="col-md-6"><a href="{{url_for(parent_page)}}">{{parent_page.meta.title}}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% for page in pages %}
|
||||
<tr>
|
||||
<td class="col-md-2"><a href="{{url_for(page)}}">{{page.meta.date.strftime("%Y-%m-%d")}}</a></td>
|
||||
<td class="col-md-3"><a href="{{url_for(page)}}">{{page.dst_link|basename}}</a></td>
|
||||
<td class="col-md-6"><a href="{{url_for(page)}}">{{page.meta.title}}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
106
doc/.theme/page.html
Normal file
106
doc/.theme/page.html
Normal file
|
@ -0,0 +1,106 @@
|
|||
<!DOCTYPE HTML>
|
||||
<!--
|
||||
Design based on "Prologue" by HTML5 UP
|
||||
html5up.net | @ajlkn
|
||||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
||||
Botched and adapted to StaticSite by @TobiX
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>{% block title %}{{SITE_NAME}}{{ " - " + title if page.src_relpath != "README.md"}}{% endblock %}</title>
|
||||
{% block favicon %}<link rel="shortcut icon" href="{{ url_for('/images/favicon.ico') }}">{% endblock %}
|
||||
{% block head %}
|
||||
{% endblock %}
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="{{ url_for('/css/main.css') }}" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Header -->
|
||||
<div id="header">
|
||||
<div class="top">
|
||||
|
||||
<!-- Logo -->
|
||||
<div id="logo">
|
||||
{% if page.src_relpath == "README.md" %}
|
||||
<h1 id="title">{{SITE_NAME}}</h1>
|
||||
{% else %}
|
||||
<h1 id="title"><a href="{{SITE_ROOT}}">{{SITE_NAME}}</a></h1>
|
||||
{% endif %}
|
||||
<p>{{SITE_SUB}}</p>
|
||||
</div>
|
||||
|
||||
<!-- Nav -->
|
||||
<nav id="nav">
|
||||
<ul>
|
||||
{% for link in SITE_LINKS %}
|
||||
<li><a href="{{link.url}}"><span class="icon fa-{{link.icon}}">{{link.name}}</span></a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="bottom">
|
||||
<!-- Social Icons -->
|
||||
<ul class="icons">
|
||||
{% for link in SITE_ICONS %}
|
||||
<li><a href="{{link.url}}" class="icon fa-{{link.icon}}"><span class="label">{{link.name}}</span></a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main -->
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Intro -->
|
||||
<section class="one cover">
|
||||
<div class="container">
|
||||
<header>
|
||||
{% if page.src_relpath == "README.md" %}
|
||||
<h2>{{SITE_NAME}}</h2>
|
||||
<h3>{{SITE_SUB}}</h3>
|
||||
{% else %}
|
||||
<h3>{{title}}</h3>
|
||||
{% endif %}
|
||||
</header>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section id="content" class="two dark">
|
||||
<div class="container">
|
||||
{% block content %}
|
||||
{{content|safe}}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
{% block footer %}
|
||||
<!-- Footer -->
|
||||
<div id="footer">
|
||||
<ul class="copyright">
|
||||
<li>Generated with <a
|
||||
href="https://github.com/spanezz/staticsite">staticsite</a>,
|
||||
last change: {{page.meta.date|datetime_format}}</li>
|
||||
<li>© Tobias Gruetzmacher. Some rights reserved.</li>
|
||||
<li>Design: <a href="http://html5up.net">HTML5 UP</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<script src="{{ url_for('/js/jquery.min.js') }}"></script>
|
||||
<script src="{{ url_for('/js/jquery.scrolly.min.js') }}"></script>
|
||||
<script src="{{ url_for('/js/jquery.scrollzer.min.js') }}"></script>
|
||||
<script src="{{ url_for('/js/skel.min.js') }}"></script>
|
||||
<script src="{{ url_for('/js/util.js') }}"></script>
|
||||
<script src="{{ url_for('/js/main.js') }}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
11
doc/.theme/redirect.html
Normal file
11
doc/.theme/redirect.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>{{page.meta.title}}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta http-equiv="refresh" content="0; URL={{url_for(page)}}" />
|
||||
</head>
|
||||
<body>
|
||||
<a href="{{url_for(page)}}">The page has moved, you should be redirected automatically.</a>
|
||||
</body>
|
||||
</html>
|
4
doc/.theme/static/css/font-awesome.min.css
vendored
Normal file
4
doc/.theme/static/css/font-awesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2564
doc/.theme/static/css/main.css
Normal file
2564
doc/.theme/static/css/main.css
Normal file
File diff suppressed because it is too large
Load diff
79
doc/.theme/static/css/pygments.css
Normal file
79
doc/.theme/static/css/pygments.css
Normal file
|
@ -0,0 +1,79 @@
|
|||
.codehilite .hll { background-color: #222222 }
|
||||
.codehilite { background: #000000; color: #cccccc }
|
||||
.codehilite .c { color: #000080 } /* Comment */
|
||||
.codehilite .err { color: #cccccc; border: 1px solid #FF0000 } /* Error */
|
||||
.codehilite .esc { color: #cccccc } /* Escape */
|
||||
.codehilite .g { color: #cccccc } /* Generic */
|
||||
.codehilite .k { color: #cdcd00 } /* Keyword */
|
||||
.codehilite .l { color: #cccccc } /* Literal */
|
||||
.codehilite .n { color: #cccccc } /* Name */
|
||||
.codehilite .o { color: #3399cc } /* Operator */
|
||||
.codehilite .x { color: #cccccc } /* Other */
|
||||
.codehilite .p { color: #cccccc } /* Punctuation */
|
||||
.codehilite .ch { color: #000080 } /* Comment.Hashbang */
|
||||
.codehilite .cm { color: #000080 } /* Comment.Multiline */
|
||||
.codehilite .cp { color: #000080 } /* Comment.Preproc */
|
||||
.codehilite .cpf { color: #000080 } /* Comment.PreprocFile */
|
||||
.codehilite .c1 { color: #000080 } /* Comment.Single */
|
||||
.codehilite .cs { color: #cd0000; font-weight: bold } /* Comment.Special */
|
||||
.codehilite .gd { color: #cd0000 } /* Generic.Deleted */
|
||||
.codehilite .ge { color: #cccccc; font-style: italic } /* Generic.Emph */
|
||||
.codehilite .gr { color: #FF0000 } /* Generic.Error */
|
||||
.codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
||||
.codehilite .gi { color: #00cd00 } /* Generic.Inserted */
|
||||
.codehilite .go { color: #888888 } /* Generic.Output */
|
||||
.codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
|
||||
.codehilite .gs { color: #cccccc; font-weight: bold } /* Generic.Strong */
|
||||
.codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
||||
.codehilite .gt { color: #0044DD } /* Generic.Traceback */
|
||||
.codehilite .kc { color: #cdcd00 } /* Keyword.Constant */
|
||||
.codehilite .kd { color: #00cd00 } /* Keyword.Declaration */
|
||||
.codehilite .kn { color: #cd00cd } /* Keyword.Namespace */
|
||||
.codehilite .kp { color: #cdcd00 } /* Keyword.Pseudo */
|
||||
.codehilite .kr { color: #cdcd00 } /* Keyword.Reserved */
|
||||
.codehilite .kt { color: #00cd00 } /* Keyword.Type */
|
||||
.codehilite .ld { color: #cccccc } /* Literal.Date */
|
||||
.codehilite .m { color: #cd00cd } /* Literal.Number */
|
||||
.codehilite .s { color: #cd0000 } /* Literal.String */
|
||||
.codehilite .na { color: #cccccc } /* Name.Attribute */
|
||||
.codehilite .nb { color: #cd00cd } /* Name.Builtin */
|
||||
.codehilite .nc { color: #00cdcd } /* Name.Class */
|
||||
.codehilite .no { color: #cccccc } /* Name.Constant */
|
||||
.codehilite .nd { color: #cccccc } /* Name.Decorator */
|
||||
.codehilite .ni { color: #cccccc } /* Name.Entity */
|
||||
.codehilite .ne { color: #666699; font-weight: bold } /* Name.Exception */
|
||||
.codehilite .nf { color: #cccccc } /* Name.Function */
|
||||
.codehilite .nl { color: #cccccc } /* Name.Label */
|
||||
.codehilite .nn { color: #cccccc } /* Name.Namespace */
|
||||
.codehilite .nx { color: #cccccc } /* Name.Other */
|
||||
.codehilite .py { color: #cccccc } /* Name.Property */
|
||||
.codehilite .nt { color: #cccccc } /* Name.Tag */
|
||||
.codehilite .nv { color: #00cdcd } /* Name.Variable */
|
||||
.codehilite .ow { color: #cdcd00 } /* Operator.Word */
|
||||
.codehilite .w { color: #cccccc } /* Text.Whitespace */
|
||||
.codehilite .mb { color: #cd00cd } /* Literal.Number.Bin */
|
||||
.codehilite .mf { color: #cd00cd } /* Literal.Number.Float */
|
||||
.codehilite .mh { color: #cd00cd } /* Literal.Number.Hex */
|
||||
.codehilite .mi { color: #cd00cd } /* Literal.Number.Integer */
|
||||
.codehilite .mo { color: #cd00cd } /* Literal.Number.Oct */
|
||||
.codehilite .sa { color: #cd0000 } /* Literal.String.Affix */
|
||||
.codehilite .sb { color: #cd0000 } /* Literal.String.Backtick */
|
||||
.codehilite .sc { color: #cd0000 } /* Literal.String.Char */
|
||||
.codehilite .dl { color: #cd0000 } /* Literal.String.Delimiter */
|
||||
.codehilite .sd { color: #cd0000 } /* Literal.String.Doc */
|
||||
.codehilite .s2 { color: #cd0000 } /* Literal.String.Double */
|
||||
.codehilite .se { color: #cd0000 } /* Literal.String.Escape */
|
||||
.codehilite .sh { color: #cd0000 } /* Literal.String.Heredoc */
|
||||
.codehilite .si { color: #cd0000 } /* Literal.String.Interpol */
|
||||
.codehilite .sx { color: #cd0000 } /* Literal.String.Other */
|
||||
.codehilite .sr { color: #cd0000 } /* Literal.String.Regex */
|
||||
.codehilite .s1 { color: #cd0000 } /* Literal.String.Single */
|
||||
.codehilite .ss { color: #cd0000 } /* Literal.String.Symbol */
|
||||
.codehilite .bp { color: #cd00cd } /* Name.Builtin.Pseudo */
|
||||
.codehilite .fm { color: #cccccc } /* Name.Function.Magic */
|
||||
.codehilite .vc { color: #00cdcd } /* Name.Variable.Class */
|
||||
.codehilite .vg { color: #00cdcd } /* Name.Variable.Global */
|
||||
.codehilite .vi { color: #00cdcd } /* Name.Variable.Instance */
|
||||
.codehilite .vm { color: #00cdcd } /* Name.Variable.Magic */
|
||||
.codehilite .il { color: #cd00cd } /* Literal.Number.Integer.Long */
|
||||
|
BIN
doc/.theme/static/fonts/FontAwesome.otf
Normal file
BIN
doc/.theme/static/fonts/FontAwesome.otf
Normal file
Binary file not shown.
BIN
doc/.theme/static/fonts/fontawesome-webfont.eot
Normal file
BIN
doc/.theme/static/fonts/fontawesome-webfont.eot
Normal file
Binary file not shown.
2671
doc/.theme/static/fonts/fontawesome-webfont.svg
Normal file
2671
doc/.theme/static/fonts/fontawesome-webfont.svg
Normal file
File diff suppressed because it is too large
Load diff
After Width: | Height: | Size: 434 KiB |
BIN
doc/.theme/static/fonts/fontawesome-webfont.ttf
Normal file
BIN
doc/.theme/static/fonts/fontawesome-webfont.ttf
Normal file
Binary file not shown.
BIN
doc/.theme/static/fonts/fontawesome-webfont.woff
Normal file
BIN
doc/.theme/static/fonts/fontawesome-webfont.woff
Normal file
Binary file not shown.
BIN
doc/.theme/static/fonts/fontawesome-webfont.woff2
Normal file
BIN
doc/.theme/static/fonts/fontawesome-webfont.woff2
Normal file
Binary file not shown.
BIN
doc/.theme/static/images/favicon.ico
Normal file
BIN
doc/.theme/static/images/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
BIN
doc/.theme/static/images/overlay.png
Normal file
BIN
doc/.theme/static/images/overlay.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
5
doc/.theme/static/js/jquery.min.js
vendored
Normal file
5
doc/.theme/static/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
doc/.theme/static/js/jquery.scrolly.min.js
vendored
Normal file
2
doc/.theme/static/js/jquery.scrolly.min.js
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/* jquery.scrolly v1.0.0-dev | (c) @ajlkn | MIT licensed */
|
||||
(function(e){function u(s,o){var u,a,f;if((u=e(s))[t]==0)return n;a=u[i]()[r];switch(o.anchor){case"middle":f=a-(e(window).height()-u.outerHeight())/2;break;default:case r:f=Math.max(a,0)}return typeof o[i]=="function"?f-=o[i]():f-=o[i],f}var t="length",n=null,r="top",i="offset",s="click.scrolly",o=e(window);e.fn.scrolly=function(i){var o,a,f,l,c=e(this);if(this[t]==0)return c;if(this[t]>1){for(o=0;o<this[t];o++)e(this[o]).scrolly(i);return c}l=n,f=c.attr("href");if(f.charAt(0)!="#"||f[t]<2)return c;a=jQuery.extend({anchor:r,easing:"swing",offset:0,parent:e("body,html"),pollOnce:!1,speed:1e3},i),a.pollOnce&&(l=u(f,a)),c.off(s).on(s,function(e){var t=l!==n?l:u(f,a);t!==n&&(e.preventDefault(),a.parent.stop().animate({scrollTop:t},a.speed,a.easing))})}})(jQuery);
|
2
doc/.theme/static/js/jquery.scrollzer.min.js
vendored
Normal file
2
doc/.theme/static/js/jquery.scrollzer.min.js
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/* jquery.scrollzer v0.2 | (c) @ajlkn | MIT licensed */
|
||||
jQuery.scrollzer=function(e,t){var r=jQuery(window),a=jQuery(document);r.load(function(){var i,o,s,l,n,c,u=jQuery.extend({activeClassName:"active",suffix:"-link",pad:50,firstHack:!1,lastHack:!1},t),d=[],f=jQuery();for(i in e)s=jQuery("#"+e[i]),l=jQuery("#"+e[i]+u.suffix),s.length<1||l.length<1||(o={},o.link=l,o.object=s,d[e[i]]=o,f=f.add(l));var v,h=function(){var e;for(i in d)e=d[i],e.start=Math.ceil(e.object.offset().top)-u.pad,e.end=e.start+Math.ceil(e.object.innerHeight());r.trigger("scroll")};r.resize(function(){window.clearTimeout(v),v=window.setTimeout(h,250)});var j,m=function(){f.removeClass("scrollzer-locked")};r.scroll(function(e){var t=0,o=!1;n=r.scrollTop(),window.clearTimeout(j),j=window.setTimeout(m,250);for(i in d)i!=c&&n>=d[i].start&&n<=d[i].end&&(c=i,o=!0),t++;u.lastHack&&n+r.height()>=a.height()&&(c=i,o=!0),o&&!f.hasClass("scrollzer-locked")&&(f.removeClass(u.activeClassName),d[c].link.addClass(u.activeClassName))}),r.trigger("resize")})};
|
119
doc/.theme/static/js/main.js
Normal file
119
doc/.theme/static/js/main.js
Normal file
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
Prologue by HTML5 UP
|
||||
html5up.net | @ajlkn
|
||||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
skel.breakpoints({
|
||||
wide: '(min-width: 961px) and (max-width: 1880px)',
|
||||
normal: '(min-width: 961px) and (max-width: 1620px)',
|
||||
narrow: '(min-width: 961px) and (max-width: 1320px)',
|
||||
narrower: '(max-width: 960px)',
|
||||
mobile: '(max-width: 736px)'
|
||||
});
|
||||
|
||||
$(function() {
|
||||
|
||||
var $window = $(window),
|
||||
$body = $('body');
|
||||
|
||||
// Disable animations/transitions until the page has loaded.
|
||||
$body.addClass('is-loading');
|
||||
|
||||
$window.on('load', function() {
|
||||
$body.removeClass('is-loading');
|
||||
});
|
||||
|
||||
// CSS polyfills (IE<9).
|
||||
if (skel.vars.IEVersion < 9)
|
||||
$(':last-child').addClass('last-child');
|
||||
|
||||
// Fix: Placeholder polyfill.
|
||||
$('form').placeholder();
|
||||
|
||||
// Prioritize "important" elements on mobile.
|
||||
skel.on('+mobile -mobile', function() {
|
||||
$.prioritize(
|
||||
'.important\\28 mobile\\29',
|
||||
skel.breakpoint('mobile').active
|
||||
);
|
||||
});
|
||||
|
||||
// Scrolly links.
|
||||
$('.scrolly').scrolly();
|
||||
|
||||
// Nav.
|
||||
var $nav_a = $('#nav a');
|
||||
|
||||
// Scrolly-fy links.
|
||||
$nav_a
|
||||
.scrolly()
|
||||
.on('click', function(e) {
|
||||
|
||||
var t = $(this),
|
||||
href = t.attr('href');
|
||||
|
||||
if (href[0] != '#')
|
||||
return;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
// Clear active and lock scrollzer until scrolling has stopped
|
||||
$nav_a
|
||||
.removeClass('active')
|
||||
.addClass('scrollzer-locked');
|
||||
|
||||
// Set this link to active
|
||||
t.addClass('active');
|
||||
|
||||
});
|
||||
|
||||
// Initialize scrollzer.
|
||||
var ids = [];
|
||||
|
||||
$nav_a.each(function() {
|
||||
|
||||
var href = $(this).attr('href');
|
||||
|
||||
if (href[0] != '#')
|
||||
return;
|
||||
|
||||
ids.push(href.substring(1));
|
||||
|
||||
});
|
||||
|
||||
$.scrollzer(ids, { pad: 200, lastHack: true });
|
||||
|
||||
// Header (narrower + mobile).
|
||||
|
||||
// Toggle.
|
||||
$(
|
||||
'<div id="headerToggle">' +
|
||||
'<a href="#header" class="toggle"></a>' +
|
||||
'</div>'
|
||||
)
|
||||
.appendTo($body);
|
||||
|
||||
// Header.
|
||||
$('#header')
|
||||
.panel({
|
||||
delay: 500,
|
||||
hideOnClick: true,
|
||||
hideOnSwipe: true,
|
||||
resetScroll: true,
|
||||
resetForms: true,
|
||||
side: 'left',
|
||||
target: $body,
|
||||
visibleClass: 'header-visible'
|
||||
});
|
||||
|
||||
// Fix: Remove transitions on WP<10 (poor/buggy performance).
|
||||
if (skel.vars.os == 'wp' && skel.vars.osVersion < 10)
|
||||
$('#headerToggle, #header, #main')
|
||||
.css('transition', 'none');
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
2
doc/.theme/static/js/skel.min.js
vendored
Normal file
2
doc/.theme/static/js/skel.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
587
doc/.theme/static/js/util.js
Normal file
587
doc/.theme/static/js/util.js
Normal file
|
@ -0,0 +1,587 @@
|
|||
(function($) {
|
||||
|
||||
/**
|
||||
* Generate an indented list of links from a nav. Meant for use with panel().
|
||||
* @return {jQuery} jQuery object.
|
||||
*/
|
||||
$.fn.navList = function() {
|
||||
|
||||
var $this = $(this);
|
||||
$a = $this.find('a'),
|
||||
b = [];
|
||||
|
||||
$a.each(function() {
|
||||
|
||||
var $this = $(this),
|
||||
indent = Math.max(0, $this.parents('li').length - 1),
|
||||
href = $this.attr('href'),
|
||||
target = $this.attr('target');
|
||||
|
||||
b.push(
|
||||
'<a ' +
|
||||
'class="link depth-' + indent + '"' +
|
||||
( (typeof target !== 'undefined' && target != '') ? ' target="' + target + '"' : '') +
|
||||
( (typeof href !== 'undefined' && href != '') ? ' href="' + href + '"' : '') +
|
||||
'>' +
|
||||
'<span class="indent-' + indent + '"></span>' +
|
||||
$this.text() +
|
||||
'</a>'
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
return b.join('');
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Panel-ify an element.
|
||||
* @param {object} userConfig User config.
|
||||
* @return {jQuery} jQuery object.
|
||||
*/
|
||||
$.fn.panel = function(userConfig) {
|
||||
|
||||
// No elements?
|
||||
if (this.length == 0)
|
||||
return $this;
|
||||
|
||||
// Multiple elements?
|
||||
if (this.length > 1) {
|
||||
|
||||
for (var i=0; i < this.length; i++)
|
||||
$(this[i]).panel(userConfig);
|
||||
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
// Vars.
|
||||
var $this = $(this),
|
||||
$body = $('body'),
|
||||
$window = $(window),
|
||||
id = $this.attr('id'),
|
||||
config;
|
||||
|
||||
// Config.
|
||||
config = $.extend({
|
||||
|
||||
// Delay.
|
||||
delay: 0,
|
||||
|
||||
// Hide panel on link click.
|
||||
hideOnClick: false,
|
||||
|
||||
// Hide panel on escape keypress.
|
||||
hideOnEscape: false,
|
||||
|
||||
// Hide panel on swipe.
|
||||
hideOnSwipe: false,
|
||||
|
||||
// Reset scroll position on hide.
|
||||
resetScroll: false,
|
||||
|
||||
// Reset forms on hide.
|
||||
resetForms: false,
|
||||
|
||||
// Side of viewport the panel will appear.
|
||||
side: null,
|
||||
|
||||
// Target element for "class".
|
||||
target: $this,
|
||||
|
||||
// Class to toggle.
|
||||
visibleClass: 'visible'
|
||||
|
||||
}, userConfig);
|
||||
|
||||
// Expand "target" if it's not a jQuery object already.
|
||||
if (typeof config.target != 'jQuery')
|
||||
config.target = $(config.target);
|
||||
|
||||
// Panel.
|
||||
|
||||
// Methods.
|
||||
$this._hide = function(event) {
|
||||
|
||||
// Already hidden? Bail.
|
||||
if (!config.target.hasClass(config.visibleClass))
|
||||
return;
|
||||
|
||||
// If an event was provided, cancel it.
|
||||
if (event) {
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
}
|
||||
|
||||
// Hide.
|
||||
config.target.removeClass(config.visibleClass);
|
||||
|
||||
// Post-hide stuff.
|
||||
window.setTimeout(function() {
|
||||
|
||||
// Reset scroll position.
|
||||
if (config.resetScroll)
|
||||
$this.scrollTop(0);
|
||||
|
||||
// Reset forms.
|
||||
if (config.resetForms)
|
||||
$this.find('form').each(function() {
|
||||
this.reset();
|
||||
});
|
||||
|
||||
}, config.delay);
|
||||
|
||||
};
|
||||
|
||||
// Vendor fixes.
|
||||
$this
|
||||
.css('-ms-overflow-style', '-ms-autohiding-scrollbar')
|
||||
.css('-webkit-overflow-scrolling', 'touch');
|
||||
|
||||
// Hide on click.
|
||||
if (config.hideOnClick) {
|
||||
|
||||
$this.find('a')
|
||||
.css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)');
|
||||
|
||||
$this
|
||||
.on('click', 'a', function(event) {
|
||||
|
||||
var $a = $(this),
|
||||
href = $a.attr('href'),
|
||||
target = $a.attr('target');
|
||||
|
||||
if (!href || href == '#' || href == '' || href == '#' + id)
|
||||
return;
|
||||
|
||||
// Cancel original event.
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
// Hide panel.
|
||||
$this._hide();
|
||||
|
||||
// Redirect to href.
|
||||
window.setTimeout(function() {
|
||||
|
||||
if (target == '_blank')
|
||||
window.open(href);
|
||||
else
|
||||
window.location.href = href;
|
||||
|
||||
}, config.delay + 10);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Event: Touch stuff.
|
||||
$this.on('touchstart', function(event) {
|
||||
|
||||
$this.touchPosX = event.originalEvent.touches[0].pageX;
|
||||
$this.touchPosY = event.originalEvent.touches[0].pageY;
|
||||
|
||||
})
|
||||
|
||||
$this.on('touchmove', function(event) {
|
||||
|
||||
if ($this.touchPosX === null
|
||||
|| $this.touchPosY === null)
|
||||
return;
|
||||
|
||||
var diffX = $this.touchPosX - event.originalEvent.touches[0].pageX,
|
||||
diffY = $this.touchPosY - event.originalEvent.touches[0].pageY,
|
||||
th = $this.outerHeight(),
|
||||
ts = ($this.get(0).scrollHeight - $this.scrollTop());
|
||||
|
||||
// Hide on swipe?
|
||||
if (config.hideOnSwipe) {
|
||||
|
||||
var result = false,
|
||||
boundary = 20,
|
||||
delta = 50;
|
||||
|
||||
switch (config.side) {
|
||||
|
||||
case 'left':
|
||||
result = (diffY < boundary && diffY > (-1 * boundary)) && (diffX > delta);
|
||||
break;
|
||||
|
||||
case 'right':
|
||||
result = (diffY < boundary && diffY > (-1 * boundary)) && (diffX < (-1 * delta));
|
||||
break;
|
||||
|
||||
case 'top':
|
||||
result = (diffX < boundary && diffX > (-1 * boundary)) && (diffY > delta);
|
||||
break;
|
||||
|
||||
case 'bottom':
|
||||
result = (diffX < boundary && diffX > (-1 * boundary)) && (diffY < (-1 * delta));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (result) {
|
||||
|
||||
$this.touchPosX = null;
|
||||
$this.touchPosY = null;
|
||||
$this._hide();
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Prevent vertical scrolling past the top or bottom.
|
||||
if (($this.scrollTop() < 0 && diffY < 0)
|
||||
|| (ts > (th - 2) && ts < (th + 2) && diffY > 0)) {
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Event: Prevent certain events inside the panel from bubbling.
|
||||
$this.on('click touchend touchstart touchmove', function(event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Event: Hide panel if a child anchor tag pointing to its ID is clicked.
|
||||
$this.on('click', 'a[href="#' + id + '"]', function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
config.target.removeClass(config.visibleClass);
|
||||
|
||||
});
|
||||
|
||||
// Body.
|
||||
|
||||
// Event: Hide panel on body click/tap.
|
||||
$body.on('click touchend', function(event) {
|
||||
$this._hide(event);
|
||||
});
|
||||
|
||||
// Event: Toggle.
|
||||
$body.on('click', 'a[href="#' + id + '"]', function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
config.target.toggleClass(config.visibleClass);
|
||||
|
||||
});
|
||||
|
||||
// Window.
|
||||
|
||||
// Event: Hide on ESC.
|
||||
if (config.hideOnEscape)
|
||||
$window.on('keydown', function(event) {
|
||||
|
||||
if (event.keyCode == 27)
|
||||
$this._hide(event);
|
||||
|
||||
});
|
||||
|
||||
return $this;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Apply "placeholder" attribute polyfill to one or more forms.
|
||||
* @return {jQuery} jQuery object.
|
||||
*/
|
||||
$.fn.placeholder = function() {
|
||||
|
||||
// Browser natively supports placeholders? Bail.
|
||||
if (typeof (document.createElement('input')).placeholder != 'undefined')
|
||||
return $(this);
|
||||
|
||||
// No elements?
|
||||
if (this.length == 0)
|
||||
return $this;
|
||||
|
||||
// Multiple elements?
|
||||
if (this.length > 1) {
|
||||
|
||||
for (var i=0; i < this.length; i++)
|
||||
$(this[i]).placeholder();
|
||||
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
// Vars.
|
||||
var $this = $(this);
|
||||
|
||||
// Text, TextArea.
|
||||
$this.find('input[type=text],textarea')
|
||||
.each(function() {
|
||||
|
||||
var i = $(this);
|
||||
|
||||
if (i.val() == ''
|
||||
|| i.val() == i.attr('placeholder'))
|
||||
i
|
||||
.addClass('polyfill-placeholder')
|
||||
.val(i.attr('placeholder'));
|
||||
|
||||
})
|
||||
.on('blur', function() {
|
||||
|
||||
var i = $(this);
|
||||
|
||||
if (i.attr('name').match(/-polyfill-field$/))
|
||||
return;
|
||||
|
||||
if (i.val() == '')
|
||||
i
|
||||
.addClass('polyfill-placeholder')
|
||||
.val(i.attr('placeholder'));
|
||||
|
||||
})
|
||||
.on('focus', function() {
|
||||
|
||||
var i = $(this);
|
||||
|
||||
if (i.attr('name').match(/-polyfill-field$/))
|
||||
return;
|
||||
|
||||
if (i.val() == i.attr('placeholder'))
|
||||
i
|
||||
.removeClass('polyfill-placeholder')
|
||||
.val('');
|
||||
|
||||
});
|
||||
|
||||
// Password.
|
||||
$this.find('input[type=password]')
|
||||
.each(function() {
|
||||
|
||||
var i = $(this);
|
||||
var x = $(
|
||||
$('<div>')
|
||||
.append(i.clone())
|
||||
.remove()
|
||||
.html()
|
||||
.replace(/type="password"/i, 'type="text"')
|
||||
.replace(/type=password/i, 'type=text')
|
||||
);
|
||||
|
||||
if (i.attr('id') != '')
|
||||
x.attr('id', i.attr('id') + '-polyfill-field');
|
||||
|
||||
if (i.attr('name') != '')
|
||||
x.attr('name', i.attr('name') + '-polyfill-field');
|
||||
|
||||
x.addClass('polyfill-placeholder')
|
||||
.val(x.attr('placeholder')).insertAfter(i);
|
||||
|
||||
if (i.val() == '')
|
||||
i.hide();
|
||||
else
|
||||
x.hide();
|
||||
|
||||
i
|
||||
.on('blur', function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]');
|
||||
|
||||
if (i.val() == '') {
|
||||
|
||||
i.hide();
|
||||
x.show();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
x
|
||||
.on('focus', function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var i = x.parent().find('input[name=' + x.attr('name').replace('-polyfill-field', '') + ']');
|
||||
|
||||
x.hide();
|
||||
|
||||
i
|
||||
.show()
|
||||
.focus();
|
||||
|
||||
})
|
||||
.on('keypress', function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
x.val('');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Events.
|
||||
$this
|
||||
.on('submit', function() {
|
||||
|
||||
$this.find('input[type=text],input[type=password],textarea')
|
||||
.each(function(event) {
|
||||
|
||||
var i = $(this);
|
||||
|
||||
if (i.attr('name').match(/-polyfill-field$/))
|
||||
i.attr('name', '');
|
||||
|
||||
if (i.val() == i.attr('placeholder')) {
|
||||
|
||||
i.removeClass('polyfill-placeholder');
|
||||
i.val('');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
.on('reset', function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
$this.find('select')
|
||||
.val($('option:first').val());
|
||||
|
||||
$this.find('input,textarea')
|
||||
.each(function() {
|
||||
|
||||
var i = $(this),
|
||||
x;
|
||||
|
||||
i.removeClass('polyfill-placeholder');
|
||||
|
||||
switch (this.type) {
|
||||
|
||||
case 'submit':
|
||||
case 'reset':
|
||||
break;
|
||||
|
||||
case 'password':
|
||||
i.val(i.attr('defaultValue'));
|
||||
|
||||
x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]');
|
||||
|
||||
if (i.val() == '') {
|
||||
i.hide();
|
||||
x.show();
|
||||
}
|
||||
else {
|
||||
i.show();
|
||||
x.hide();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'checkbox':
|
||||
case 'radio':
|
||||
i.attr('checked', i.attr('defaultValue'));
|
||||
break;
|
||||
|
||||
case 'text':
|
||||
case 'textarea':
|
||||
i.val(i.attr('defaultValue'));
|
||||
|
||||
if (i.val() == '') {
|
||||
i.addClass('polyfill-placeholder');
|
||||
i.val(i.attr('placeholder'));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
i.val(i.attr('defaultValue'));
|
||||
break;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
return $this;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Moves elements to/from the first positions of their respective parents.
|
||||
* @param {jQuery} $elements Elements (or selector) to move.
|
||||
* @param {bool} condition If true, moves elements to the top. Otherwise, moves elements back to their original locations.
|
||||
*/
|
||||
$.prioritize = function($elements, condition) {
|
||||
|
||||
var key = '__prioritize';
|
||||
|
||||
// Expand $elements if it's not already a jQuery object.
|
||||
if (typeof $elements != 'jQuery')
|
||||
$elements = $($elements);
|
||||
|
||||
// Step through elements.
|
||||
$elements.each(function() {
|
||||
|
||||
var $e = $(this), $p,
|
||||
$parent = $e.parent();
|
||||
|
||||
// No parent? Bail.
|
||||
if ($parent.length == 0)
|
||||
return;
|
||||
|
||||
// Not moved? Move it.
|
||||
if (!$e.data(key)) {
|
||||
|
||||
// Condition is false? Bail.
|
||||
if (!condition)
|
||||
return;
|
||||
|
||||
// Get placeholder (which will serve as our point of reference for when this element needs to move back).
|
||||
$p = $e.prev();
|
||||
|
||||
// Couldn't find anything? Means this element's already at the top, so bail.
|
||||
if ($p.length == 0)
|
||||
return;
|
||||
|
||||
// Move element to top of parent.
|
||||
$e.prependTo($parent);
|
||||
|
||||
// Mark element as moved.
|
||||
$e.data(key, $p);
|
||||
|
||||
}
|
||||
|
||||
// Moved already?
|
||||
else {
|
||||
|
||||
// Condition is true? Bail.
|
||||
if (condition)
|
||||
return;
|
||||
|
||||
$p = $e.data(key);
|
||||
|
||||
// Move element back to its original location (using our placeholder).
|
||||
$e.insertAfter($p);
|
||||
|
||||
// Unmark element as moved.
|
||||
$e.removeData(key);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
|
@ -1,5 +1,4 @@
|
|||
How to add a new comic to Dosage
|
||||
=================================
|
||||
# Adding a comic to Dosage
|
||||
|
||||
To add a new comic, add a new class in one of the *.py files
|
||||
in the dosagelib/plugins module.
|
||||
|
|
Loading…
Reference in a new issue