Added syntax-highlighting, made tables sortable and many CSS fixes.
This commit is contained in:
parent
e6250a2ba4
commit
a5c9826ab7
12 changed files with 955 additions and 310 deletions
|
|
@ -53,6 +53,10 @@ paginate_path: /blog/page/:num/
|
|||
permalink: /blog/:year/:month/:day/:title/
|
||||
|
||||
markdown: kramdown
|
||||
highlighter: rouge
|
||||
kramdown:
|
||||
input: GFM
|
||||
|
||||
|
||||
tocTopTag: h2
|
||||
anchorPrefix: ""
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ layout:
|
|||
});
|
||||
</script>
|
||||
|
||||
<script src="/js/sorttable-2.min.js" charset="utf-8"></script>
|
||||
<script src="/js/cookieconsent.min.js" data-cfasync="false"></script>
|
||||
<!-- Source for documentation and download: https://www.osano.com/cookieconsent/download/ - https://www.osano.com/cookieconsent/documentation/compliance/ -->
|
||||
<script>window.cookieconsent.initialise({"palette":{"popup":{"background":"#000","text":"#e8e8e8"},"button":{"background":"#bc6c21"}},"theme":"classic","position":"bottom","static":false,"content":{"message":"{{ site.cookiebanner_text }} ","dismiss":"{{ site.cookiebanner_dismiss_text }}","link":"{{ site.cookiebanner_link_text }}.","href":"{{ site.cookiebanner_link }}"}});</script>
|
||||
|
|
|
|||
116
_posts/2024-02-10-code.md
Normal file
116
_posts/2024-02-10-code.md
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
---
|
||||
layout: post
|
||||
published: true
|
||||
author: hanez
|
||||
title: /code/
|
||||
date: 2024-02-10
|
||||
date_updated: 2024-11-26
|
||||
categories:
|
||||
- news
|
||||
- project
|
||||
tags:
|
||||
- xw3
|
||||
- cgi
|
||||
- static
|
||||
- dynamic
|
||||
- jekyll
|
||||
---
|
||||
|
||||
This is just a test with syntax highlighting and some examples made by [Rouge](https://rouge.jneen.net/){:class="ext" target="_blank"}.
|
||||
|
||||
## Bash
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
echo "Hello World!";
|
||||
```
|
||||
|
||||
## C
|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
// printf() displays the string inside quotation
|
||||
printf("Hello, World!");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"firstName": "John",
|
||||
"lastName": "Smith",
|
||||
"age": 25
|
||||
}
|
||||
```
|
||||
|
||||
## Perl
|
||||
|
||||
```perl
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use warnings;
|
||||
print "a: ";
|
||||
my $a = "foo";
|
||||
print $a;
|
||||
```
|
||||
|
||||
## PHP
|
||||
|
||||
```php
|
||||
<?php
|
||||
echo "Hello World!";
|
||||
?>
|
||||
```
|
||||
|
||||
## Python
|
||||
|
||||
```python
|
||||
#!/usr/bin/env python
|
||||
|
||||
def hello(name):
|
||||
print("Hello ", name)
|
||||
|
||||
hello("World")
|
||||
```
|
||||
|
||||
## Ruby
|
||||
|
||||
```ruby
|
||||
class Greeter
|
||||
def initialize(name="World")
|
||||
@name = name
|
||||
end
|
||||
|
||||
def say_hi
|
||||
puts "Hi #{@name}!"
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
## Rust
|
||||
|
||||
```rust
|
||||
use core::*;
|
||||
|
||||
fn main() {
|
||||
for ["Alice", "Bob", "Carol"].each |&name| {
|
||||
do task::spawn {
|
||||
let v = rand::Rng().shuffle([1, 2, 3]);
|
||||
for v.each |&num| {
|
||||
io::print(fmt!("%s says: '%d'\n", name, num))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## SQL
|
||||
|
||||
```sql
|
||||
SELECT * FROM `users` WHERE `user`.`id` = 1
|
||||
```
|
||||
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
---
|
||||
layout: post
|
||||
published: true
|
||||
author: hanez
|
||||
title: /test/
|
||||
date: 2024-02-10
|
||||
date_updated: 2024-10-06
|
||||
categories:
|
||||
- news
|
||||
- project
|
||||
tags:
|
||||
- xw3
|
||||
- cgi
|
||||
- static
|
||||
- dynamic
|
||||
- jekyll
|
||||
---
|
||||
|
||||
This is just a test...!
|
||||
|
||||
## Bash\:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
echo "Hello World!";
|
||||
```
|
||||
|
||||
## C\:
|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
// printf() displays the string inside quotation
|
||||
printf("Hello, World!");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## JSON\:
|
||||
|
||||
```json
|
||||
{
|
||||
"firstName": "John",
|
||||
"lastName": "Smith",
|
||||
"age": 25
|
||||
}
|
||||
```
|
||||
|
||||
## Python\:
|
||||
|
||||
```python
|
||||
#!/usr/bin/env python
|
||||
print "Hello World"
|
||||
```
|
||||
|
|
@ -4,7 +4,7 @@ published: true
|
|||
author: hanez
|
||||
title: /checkpw/
|
||||
date: 2024-09-25
|
||||
date_updated: 2024-09-27
|
||||
date_updated: 2024-11-26
|
||||
tags:
|
||||
- cgi
|
||||
- static
|
||||
|
|
@ -23,7 +23,7 @@ The program returns 0 on success, 1 otherwise.
|
|||
|
||||
With this program, it will be possible to authenticate an xw3 application user against the system's user database.
|
||||
|
||||
Currently only tested on [Linux](https://kernel.org/){:class="ext" target="_blank"}, but it should work on [AIX](https://en.wikipedia.org/wiki/IBM_AIX){:class="ext" target="_blank"}, [DragonFly BSD](https://www.dragonflybsd.org/){:class="ext" target="_blank"}, [FreeBSD](https://www.freebsd.org/){:class="ext" target="_blank"}, [HP-UX](https://en.wikipedia.org/wiki/HP-UX){:class="ext" target="_blank"}, [macOS](https://en.wikipedia.org/wiki/MacOS){:class="ext" target="_blank"}, [NetBSD](https://netbsd.org/){:class="ext" target="_blank"} and [Solaris](https://en.wikipedia.org/wiki/Oracle_Solaris){:class="ext" target="_blank"} operating systems too. I will test API compatibility for all OS's listed soon... ;)
|
||||
Currently only tested on [Linux](https://kernel.org/){:class="ext" target="_blank"}, but it should work on [AIX](https://en.wikipedia.org/wiki/IBM_AIX){:class="ext" target="_blank"}, [DragonFly BSD](https://www.dragonflybsd.org/){:class="ext" target="_blank"}, [FreeBSD](https://www.freebsd.org/){:class="ext" target="_blank"}, [HP-UX](https://en.wikipedia.org/wiki/HP-UX){:class="ext" target="_blank"}, [macOS](https://en.wikipedia.org/wiki/MacOS){:class="ext" target="_blank"}, [NetBSD](https://netbsd.org/){:class="ext" target="_blank"} and [Solaris](https://en.wikipedia.org/wiki/Oracle_Solaris){:class="ext" target="_blank"} operating systems too. I will test API compatibility for all OS's listed ~~soon~~ maybe some day... ;)
|
||||
|
||||
<span style="color:red;">HELP NEEDED!</span> I need some people porting or helping me porting this to other OS's than Linux. AFAIK it should compile on listed OS's above and should then work, but I don't know how... :(
|
||||
|
||||
|
|
|
|||
125
_sass/_base.scss
125
_sass/_base.scss
|
|
@ -3,17 +3,14 @@
|
|||
src: url("../fonts/Courier-Prime-Sans.ttf");
|
||||
}
|
||||
|
||||
/*@font-face {
|
||||
font-family: "MDI";
|
||||
src: url("../fonts/materialdesignicons-webfont.woff") format("woff");
|
||||
}*/
|
||||
|
||||
@font-face {
|
||||
font-family: "MDI";
|
||||
src: url("../fonts/materialdesignicons-webfont.woff2") format("woff2");
|
||||
}
|
||||
|
||||
html {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body, h1, h2, h3, h4, h5, h6, p, code, blockquote,
|
||||
|
|
@ -90,6 +87,8 @@ li {
|
|||
|
||||
a {
|
||||
color: $brand-color;
|
||||
//display: inline-block;
|
||||
//position: relative;
|
||||
}
|
||||
|
||||
a:link {
|
||||
|
|
@ -113,6 +112,116 @@ a:active {
|
|||
text-decoration: none;
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/questions/2011142/how-to-change-the-style-of-the-title-attribute-inside-an-anchor-tag
|
||||
// https://css-tricks.com/css-content/
|
||||
/*a[title]:hover::after {
|
||||
background: rgba(0,0,0,1.0);
|
||||
//content: attr(title);
|
||||
//position: absolute;
|
||||
//top: -100%;
|
||||
//left: 0;
|
||||
border-radius: 0px;
|
||||
//border: 1px solid red;
|
||||
//color: #fff;
|
||||
//background: $brand-color;
|
||||
}*/
|
||||
|
||||
a.bug::after {
|
||||
content: "\F0A30";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.chat::after {
|
||||
content: "\F0EDE";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.code::after {
|
||||
content: "\F102B";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.community::after {
|
||||
content: "\F112D";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.cube::after {
|
||||
content: "\F01A7";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.document {
|
||||
content: "\F09EE";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.ext::after {
|
||||
content: "\F03CC";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.file::after {
|
||||
content: "\F0224";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.git::after {
|
||||
content: "\F02A2";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.home::after {
|
||||
content: "\F06A1";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.mail::after {
|
||||
content: "\F01F0";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.privacy::after {
|
||||
content: "\F0CC8";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.rss::after {
|
||||
content: "\F046B";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.search::after {
|
||||
content: "\F0349";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.user::after {
|
||||
content: "\F0013";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.wiki::after {
|
||||
content: "\F1CCC";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
p {
|
||||
padding: 0px 0px 14px 0px;
|
||||
}
|
||||
|
|
@ -130,8 +239,6 @@ blockquote {
|
|||
}
|
||||
|
||||
pre {
|
||||
-moz-tab-size: 2;
|
||||
border: 0px $grey-color solid;
|
||||
background: $grey-color-dark;
|
||||
background-image: -webkit-linear-gradient($grey-color-dark 50%, $grey-color-light 50%);
|
||||
background-image: -moz-linear-gradient($grey-color-dark 50%, $grey-color-light 50%);
|
||||
|
|
@ -141,6 +248,7 @@ pre {
|
|||
background-position: 0 0;
|
||||
background-repeat: repeat;
|
||||
background-size: 2.8em 2.8em;
|
||||
border: 0px $grey-color solid;
|
||||
counter-reset: line;
|
||||
font-family: "CourierPrimeSans";
|
||||
font-size: $base-font-size;
|
||||
|
|
@ -149,8 +257,9 @@ pre {
|
|||
margin: 0 0 0 0;
|
||||
overflow: auto;
|
||||
overflow-x: auto;
|
||||
padding: 0 0 0 0.5em;
|
||||
padding: 0 0 0 0;
|
||||
tab-size: 2;
|
||||
-moz-tab-size: 2;
|
||||
}
|
||||
|
||||
pre > code {
|
||||
|
|
|
|||
|
|
@ -233,134 +233,6 @@
|
|||
margin-right: 4px;
|
||||
}
|
||||
|
||||
a.bug::after {
|
||||
content: "\F0A30";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.chat::after {
|
||||
content: "\F0EDE";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.code::after {
|
||||
content: "\F102B";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.community::after {
|
||||
content: "\F112D";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}F112D
|
||||
|
||||
a.cube::after {
|
||||
content: "\F01A7";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.document {
|
||||
content: "\F09EE";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.ext::after {
|
||||
content: "\F03CC";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.file::after {
|
||||
content: "\F0224";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.git::after {
|
||||
content: "\F02A2";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.home::after {
|
||||
content: "\F06A1";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.mail::after {
|
||||
content: "\F01F0";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.privacy::after {
|
||||
content: "\F0CC8";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.rss::after {
|
||||
content: "\F046B";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.search::after {
|
||||
content: "\F0349";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.user::after {
|
||||
content: "\F0013";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.wiki::after {
|
||||
content: "\F1CCC";
|
||||
font-family: "MDI";
|
||||
padding-left: 5px;
|
||||
color: $brand-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
span.feed {
|
||||
border: 1px solid;
|
||||
border-color: #FC9 #630 #330 #F96;
|
||||
|
|
@ -653,3 +525,64 @@ span.cursor {
|
|||
background: $headline-color;
|
||||
}
|
||||
|
||||
/*.highlight { background: #ffffff; }*/
|
||||
.highlight .c { color: #999988; font-style: italic } /* Comment */
|
||||
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
|
||||
.highlight .k { font-weight: bold } /* Keyword */
|
||||
.highlight .o { font-weight: bold } /* Operator */
|
||||
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
|
||||
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
|
||||
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
|
||||
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
|
||||
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
|
||||
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
|
||||
.highlight .ge { font-style: italic } /* Generic.Emph */
|
||||
.highlight .gr { color: #aa0000 } /* Generic.Error */
|
||||
.highlight .gh { color: #999999 } /* Generic.Heading */
|
||||
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
|
||||
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
|
||||
.highlight .go { color: #888888 } /* Generic.Output */
|
||||
.highlight .gp { color: #555555 } /* Generic.Prompt */
|
||||
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
||||
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
|
||||
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
|
||||
.highlight .kc { font-weight: bold } /* Keyword.Constant */
|
||||
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
|
||||
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
|
||||
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
|
||||
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
|
||||
.highlight .m { color: #009999 } /* Literal.Number */
|
||||
.highlight .s { color: #d14 } /* Literal.String */
|
||||
.highlight .na { color: #008080 } /* Name.Attribute */
|
||||
.highlight .nb { color: #0086B3 } /* Name.Builtin */
|
||||
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
|
||||
.highlight .no { color: #008080 } /* Name.Constant */
|
||||
.highlight .ni { color: #800080 } /* Name.Entity */
|
||||
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
|
||||
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
|
||||
.highlight .nn { color: #555555 } /* Name.Namespace */
|
||||
.highlight .nt { color: #000080 } /* Name.Tag */
|
||||
.highlight .nv { color: #008080 } /* Name.Variable */
|
||||
.highlight .ow { font-weight: bold } /* Operator.Word */
|
||||
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
|
||||
.highlight .mf { color: #009999 } /* Literal.Number.Float */
|
||||
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
|
||||
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
|
||||
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
|
||||
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
|
||||
.highlight .sc { color: #d14 } /* Literal.String.Char */
|
||||
.highlight .sd { color: #d14 } /* Literal.String.Doc */
|
||||
.highlight .s2 { color: #d14 } /* Literal.String.Double */
|
||||
.highlight .se { color: #d14 } /* Literal.String.Escape */
|
||||
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
|
||||
.highlight .si { color: #d14 } /* Literal.String.Interpol */
|
||||
.highlight .sx { color: #d14 } /* Literal.String.Other */
|
||||
.highlight .sr { color: #009926 } /* Literal.String.Regex */
|
||||
.highlight .s1 { color: #d14 } /* Literal.String.Single */
|
||||
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
|
||||
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
|
||||
.highlight .vc { color: #008080 } /* Name.Variable.Class */
|
||||
.highlight .vg { color: #008080 } /* Name.Variable.Global */
|
||||
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
|
||||
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
|
||||
|
||||
|
|
|
|||
155
about/about.html
155
about/about.html
|
|
@ -31,15 +31,16 @@ tags:
|
|||
<ul>
|
||||
<li>Maintainable</li>
|
||||
<li>Minimal</li>
|
||||
<li>MIT licensed
|
||||
<li><a href="https://opensource.org/license/MIT" class="ext" target="_blank">MIT</a> licensed
|
||||
<ul>
|
||||
<li>All included libs are <a href="https://opensource.org/license/MIT" class="ext" target="_blank">MIT</a> licensed too</li>
|
||||
<li>All included libraries are MIT or similarly licensed (<a href="https://www.apache.org/licenses/" class="ext" target="_blank">Apache</a>, <a href="https://en.wikipedia.org/wiki/BSD_licenses" class="ext" target="_blank">BSD</a>, <a href="https://spdx.org/licenses/X11.html" class="ext" target="_blank">X11</a>, etc.)</li>
|
||||
<li>The font is <a href="https://openfontlicense.org/" class="ext" target="_blank">OFL</a> licensed</li>
|
||||
<li>The icons are <a href="https://www.apache.org/licenses/LICENSE-2.0" class="ext" target="_blank">Apache 2.0</a> licensed</li>
|
||||
</ul>
|
||||
<li>No MVC framework bloat</li>
|
||||
<li>No oversized template parsing</li>
|
||||
<li>Scalable</li>
|
||||
<li>Write content in <a href="https://daringfireball.net/projects/markdown/" class="ext" target="_blank">Markdown</a>/<a href="https://kramdown.gettalong.org/" class="ext" target="_blank">kramdown</a> or <a href="https://html.spec.whatwg.org/" class="ext" target="_blank">HTML</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Cons</h3>
|
||||
|
|
@ -50,36 +51,128 @@ tags:
|
|||
|
||||
<h2>Software used in this project</h2>
|
||||
|
||||
<p>Not all of the listed software is required. This is, what we use!</p>
|
||||
<p>Not all of the listed software is required.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://alpinelinux.org/" class="ext" target="_blank">Alpine Linux</a> - A rolling-release, security-oriented, lightweight Linux distribution. Systemd-free! (This server)</li>
|
||||
<li><a href="https://artixlinux.org/" class="ext" target="_blank">Artix Linux</a> - A rolling-release Linux distribution, based on Arch Linux. Systemd-free! (My desktop)</li>
|
||||
<li><a href="https://www.gnu.org/software/bash/" class="ext" target="_blank">Bash</a> - The <a href="https://www.gnu.org/" class="ext" target="_blank">GNU Project</a>'s shell</li>
|
||||
<li><a href="https://quoteunquoteapps.com/courierprime/" class="ext" target="_blank">Courier Prime</a> - It's Courier, just better. The font used overall in this project</li>
|
||||
<li><a href="https://www.docker.com/" class="ext" target="_blank">Docker</a> - Allows you to pack, ship and run any application as a lightweight container</li>
|
||||
<li><a href="https://forgejo.org/" class="ext" target="_blank">Forgejo</a> - A free and open source self-hosted lightweight software forge like GitHub</li>
|
||||
<li><a href="https://gcc.gnu.org/" class="ext" target="_blank">GCC</a> - The GNU Compiler Collection</li>
|
||||
<li><a href="https://www.gentoo.org/" class="ext" target="_blank">Gentoo Linux</a> - A rolling-release Linux distribution built using the Portage package management system. Systemd-free!</li>
|
||||
<li><a href="https://git-scm.com/" class="ext" target="_blank">Git</a> - A free and open source distributed version control system</li>
|
||||
<li><a href="https://isso-comments.de/" class="ext" target="_blank">Isso</a> - A commenting server similar to Disqus</li>
|
||||
<li><a href="https://jekyllrb.com/" class="ext" target="_blank">Jekyll</a> - A simple, blog-aware, static site generator</li>
|
||||
<li><a href="https://github.com/js-cookie/js-cookie" class="ext" target="_blank">js-cookie</a> - A simple, lightweight JavaScript API for handling browser cookies</li>
|
||||
<li><a href="https://jquery.com/" class="ext" target="_blank">jQuery</a> - A fast, small, and feature-rich JavaScript library</li>
|
||||
<li><a href="https://leafletjs.com/" class="ext" target="_blank">Leaflet</a> - An open-source JavaScript library for mobile-friendly interactive maps</li>
|
||||
<li><a href="https://www.lighttpd.net/" class="ext" target="_blank">lighttpd</a> - A secure, fast, compliant, and very flexible web server</li>
|
||||
<li><a href="https://kernel.org/" class="ext" target="_blank">Linux</a> - A family of open-source Unix-like operating systems based on the Linux kernel</li>
|
||||
<li><a href="https://www.lua.org/" class="ext" target="_blank">Lua</a> - A powerful, efficient, lightweight, embeddable scripting language</li>
|
||||
<li><a href="https://www.gnu.org/software/make/" class="ext" target="_blank">Make</a> - A tool which controls the generation of executables and a lot more for automation</li>
|
||||
<li><a href="https://pictogrammers.com/library/mdi/" class="ext" target="_blank">Material Design Icons</a> - Open-source iconography for designers and developers</li>
|
||||
<li><a href="https://github.com/tdewolff/minify" class="ext" target="_blank">Minify</a> - A minifier package which provides HTML5, CSS3, JS, JSON, SVG and XML minifiers</li>
|
||||
<li><a href="https://www.perl.org/" class="ext" target="_blank">Perl</a> - A highly capable, feature-rich programming language with over 36 years of development</li>
|
||||
<li><a href="https://www.php.net/" class="ext" target="_blank">PHP</a> - A popular general-purpose scripting language for web development</li>
|
||||
<li><a href="https://www.python.org/" class="ext" target="_blank">Python</a> - A programming language that lets you work quickly</li>
|
||||
<li><a href="https://rsync.samba.org/" class="ext" target="_blank">rsync</a> - An open source utility that provides fast incremental file transfer</li>
|
||||
<li><a href="https://www.ruby-lang.org/en/" class="ext" target="_blank">Ruby</a> - A dynamic, open source programming language with a focus on simplicity and productivity</li>
|
||||
<li><a href="https://xtermjs.org/" class="ext" target="_blank">xterm.js</a> - Build terminals in the browser</li>
|
||||
</ul>
|
||||
<p>We use software from the following projects:</p>
|
||||
|
||||
<table width="100%" border="1" style="table-layout: fixed;" class="sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: left; width: 146px;">Project</th>
|
||||
<th style="text-align: left;">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><a href="https://alpinelinux.org/" class="ext" target="_blank">Alpine Linux</a></td>
|
||||
<td>A rolling-release, security-oriented, lightweight Linux distribution. Systemd-free! (This server)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://artixlinux.org/" class="ext" target="_blank">Artix Linux</a></td>
|
||||
<td>A rolling-release Linux distribution, based on Arch Linux. Systemd-free! (My desktop)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.gnu.org/software/bash/" class="ext" target="_blank">Bash</a></td>
|
||||
<td>The <a href="https://www.gnu.org/" class="ext" target="_blank">GNU Project</a>'s shell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://quoteunquoteapps.com/courierprime/" class="ext" target="_blank">Courier Prime</a></td>
|
||||
<td>It's Courier, just better. The font used overall in this project</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.docker.com/" class="ext" target="_blank">Docker</a></td>
|
||||
<td>Allows you to pack, ship and run any application as a lightweight container</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://forgejo.org/" class="ext" target="_blank">Forgejo</a></td>
|
||||
<td>A free and open source self-hosted lightweight software forge like GitHub</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://gcc.gnu.org/" class="ext" target="_blank">GCC</a></td>
|
||||
<td>The GNU Compiler Collection</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.gentoo.org/" class="ext" target="_blank">Gentoo Linux</a></td>
|
||||
<td>A rolling-release Linux distribution built using the Portage package management system. Systemd-free!</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://git-scm.com/" class="ext" target="_blank">Git</a></td>
|
||||
<td>A free and open source distributed version control system</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://isso-comments.de/" class="ext" target="_blank">Isso</a></td>
|
||||
<td>A commenting server similar to Disqus</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://jekyllrb.com/" class="ext" target="_blank">Jekyll</a></td>
|
||||
<td>A simple, blog-aware, static site generator</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/js-cookie/js-cookie" class="ext" target="_blank">js-cookie</a></td>
|
||||
<td>A simple, lightweight JavaScript API for handling browser cookies</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://jquery.com/" class="ext" target="_blank">jQuery</a></td>
|
||||
<td>A fast, small, and feature-rich JavaScript library</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://leafletjs.com/" class="ext" target="_blank">Leaflet</a></td>
|
||||
<td>An open-source JavaScript library for mobile-friendly interactive maps</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.lighttpd.net/" class="ext" target="_blank">lighttpd</a></td>
|
||||
<td>A secure, fast, compliant, and very flexible web server</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://kernel.org/" class="ext" target="_blank">Linux</a></td>
|
||||
<td>A family of open-source Unix-like operating systems based on the Linux kernel</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.lua.org/" class="ext" target="_blank">Lua</a></td>
|
||||
<td>A powerful, efficient, lightweight, embeddable scripting language</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.gnu.org/software/make/" class="ext" target="_blank">Make</a></td>
|
||||
<td>A tool which controls the generation of executables and a lot more for automation</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://pictogrammers.com/library/mdi/" class="ext" target="_blank">Material Design Icons</a></td>
|
||||
<td>Open-source iconography for designers and developers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://github.com/tdewolff/minify" class="ext" target="_blank">Minify</a></td>
|
||||
<td>A minifier package which provides HTML5, CSS3, JS, JSON, SVG and XML minifiers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.perl.org/" class="ext" target="_blank">Perl</a></td>
|
||||
<td>A highly capable, feature-rich programming language with over 36 years of development</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.php.net/" class="ext" target="_blank">PHP</a></td>
|
||||
<td>A popular general-purpose scripting language for web development</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.python.org/" class="ext" target="_blank">Python</a></td>
|
||||
<td>A programming language that lets you work quickly</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://rsync.samba.org/" class="ext" target="_blank">rsync</a></td>
|
||||
<td>An open source utility that provides fast incremental file transfer</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.ruby-lang.org/en/" class="ext" target="_blank">Ruby</a></td>
|
||||
<td>A dynamic, open source programming language with a focus on simplicity and productivity</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.kryogenix.org/code/browser/sorttable/" class="ext" target="_blank">sortable</a></td>
|
||||
<td>sorttable: Make all your tables sortable</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://xtermjs.org/" class="ext" target="_blank">xterm.js</a></td>
|
||||
<td>Build terminals in the browser</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2>Developers</h2>
|
||||
|
||||
|
|
|
|||
|
|
@ -10,133 +10,79 @@ permalink: /community/code-of-conduct/
|
|||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||
identity and orientation.
|
||||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
Examples of behavior that contributes to a positive environment for our community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
||||
- Focusing on what is best not just for us as individuals, but for the overall community
|
||||
|
||||
<br>
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
- The use of sexualized language or imagery, and sexual attention or advances of any kind
|
||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or email address, without their explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
community@xw3.org. All complaints will be reviewed and investigated promptly and
|
||||
fairly.
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [community@xw3.org](mailto:community@xw3.org){:class="mail"}. All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### Correction
|
||||
|
||||
Community Impact: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
||||
|
||||
Consequence: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### Warning
|
||||
|
||||
Community Impact: A violation through a single incident or series of
|
||||
actions.
|
||||
Community Impact: A violation through a single incident or series of actions.
|
||||
|
||||
Consequence: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or permanent
|
||||
ban.
|
||||
Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
||||
|
||||
### Temporary Ban
|
||||
|
||||
Community Impact: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
Community Impact: A serious violation of community standards, including sustained inappropriate behavior.
|
||||
|
||||
Consequence: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
||||
|
||||
### Permanent Ban
|
||||
|
||||
Community Impact: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
Consequence: A permanent ban from any sort of public interaction within the
|
||||
community.
|
||||
Consequence: A permanent ban from any sort of public interaction within the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.1, available at
|
||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org){:class="ext" target="_blank"}, version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html){:class="ext" target="_blank"}.
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity){:class="ext" target="_blank"}.
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
||||
[https://www.contributor-covenant.org/translations][translations].
|
||||
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq){:class="ext" target="_blank"}. Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations){:class="ext" target="_blank"}.
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ permalink: /community/
|
|||
|
||||
<p>Just click the channel name to open a web based client in your browser for instant chat.</p>
|
||||
|
||||
<table width="100%" border="1" style="table-layout: fixed;">
|
||||
<table width="100%" border="1" style="table-layout: fixed;" class="sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: left; width: 98px;">Channel</th>
|
||||
|
|
@ -51,7 +51,7 @@ permalink: /community/
|
|||
|
||||
<p>Simply click "Subscribe" to join a list by sending a blank email.</a>
|
||||
|
||||
<table width="100%" border="1">
|
||||
<table width="100%" border="1" class="sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: left;">List</th>
|
||||
|
|
|
|||
495
js/sorttable-2.js
Normal file
495
js/sorttable-2.js
Normal file
|
|
@ -0,0 +1,495 @@
|
|||
/*
|
||||
SortTable
|
||||
version 2
|
||||
7th April 2007
|
||||
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
|
||||
|
||||
Instructions:
|
||||
Download this file
|
||||
Add <script src="sorttable.js"></script> to your HTML
|
||||
Add class="sortable" to any table you'd like to make sortable
|
||||
Click on the headers to sort
|
||||
|
||||
Thanks to many, many people for contributions and suggestions.
|
||||
Licenced as X11: http://www.kryogenix.org/code/browser/licence.html
|
||||
This basically means: do what you want with it.
|
||||
*/
|
||||
|
||||
|
||||
var stIsIE = /*@cc_on!@*/false;
|
||||
|
||||
sorttable = {
|
||||
init: function() {
|
||||
// quit if this function has already been called
|
||||
if (arguments.callee.done) return;
|
||||
// flag this function so we don't do the same thing twice
|
||||
arguments.callee.done = true;
|
||||
// kill the timer
|
||||
if (_timer) clearInterval(_timer);
|
||||
|
||||
if (!document.createElement || !document.getElementsByTagName) return;
|
||||
|
||||
sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
|
||||
|
||||
forEach(document.getElementsByTagName('table'), function(table) {
|
||||
if (table.className.search(/\bsortable\b/) != -1) {
|
||||
sorttable.makeSortable(table);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
makeSortable: function(table) {
|
||||
if (table.getElementsByTagName('thead').length == 0) {
|
||||
// table doesn't have a tHead. Since it should have, create one and
|
||||
// put the first table row in it.
|
||||
the = document.createElement('thead');
|
||||
the.appendChild(table.rows[0]);
|
||||
table.insertBefore(the,table.firstChild);
|
||||
}
|
||||
// Safari doesn't support table.tHead, sigh
|
||||
if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
|
||||
|
||||
if (table.tHead.rows.length != 1) return; // can't cope with two header rows
|
||||
|
||||
// Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
|
||||
// "total" rows, for example). This is B&R, since what you're supposed
|
||||
// to do is put them in a tfoot. So, if there are sortbottom rows,
|
||||
// for backwards compatibility, move them to tfoot (creating it if needed).
|
||||
sortbottomrows = [];
|
||||
for (var i=0; i<table.rows.length; i++) {
|
||||
if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
|
||||
sortbottomrows[sortbottomrows.length] = table.rows[i];
|
||||
}
|
||||
}
|
||||
if (sortbottomrows) {
|
||||
if (table.tFoot == null) {
|
||||
// table doesn't have a tfoot. Create one.
|
||||
tfo = document.createElement('tfoot');
|
||||
table.appendChild(tfo);
|
||||
}
|
||||
for (var i=0; i<sortbottomrows.length; i++) {
|
||||
tfo.appendChild(sortbottomrows[i]);
|
||||
}
|
||||
delete sortbottomrows;
|
||||
}
|
||||
|
||||
// work through each column and calculate its type
|
||||
headrow = table.tHead.rows[0].cells;
|
||||
for (var i=0; i<headrow.length; i++) {
|
||||
// manually override the type with a sorttable_type attribute
|
||||
if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col
|
||||
mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/);
|
||||
if (mtch) { override = mtch[1]; }
|
||||
if (mtch && typeof sorttable["sort_"+override] == 'function') {
|
||||
headrow[i].sorttable_sortfunction = sorttable["sort_"+override];
|
||||
} else {
|
||||
headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
|
||||
}
|
||||
// make it clickable to sort
|
||||
headrow[i].sorttable_columnindex = i;
|
||||
headrow[i].sorttable_tbody = table.tBodies[0];
|
||||
dean_addEvent(headrow[i],"click", sorttable.innerSortFunction = function(e) {
|
||||
|
||||
if (this.className.search(/\bsorttable_sorted\b/) != -1) {
|
||||
// if we're already sorted by this column, just
|
||||
// reverse the table, which is quicker
|
||||
sorttable.reverse(this.sorttable_tbody);
|
||||
this.className = this.className.replace('sorttable_sorted',
|
||||
'sorttable_sorted_reverse');
|
||||
this.removeChild(document.getElementById('sorttable_sortfwdind'));
|
||||
sortrevind = document.createElement('span');
|
||||
sortrevind.id = "sorttable_sortrevind";
|
||||
sortrevind.innerHTML = stIsIE ? ' <font face="webdings">5</font>' : ' ▴';
|
||||
this.appendChild(sortrevind);
|
||||
return;
|
||||
}
|
||||
if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
|
||||
// if we're already sorted by this column in reverse, just
|
||||
// re-reverse the table, which is quicker
|
||||
sorttable.reverse(this.sorttable_tbody);
|
||||
this.className = this.className.replace('sorttable_sorted_reverse',
|
||||
'sorttable_sorted');
|
||||
this.removeChild(document.getElementById('sorttable_sortrevind'));
|
||||
sortfwdind = document.createElement('span');
|
||||
sortfwdind.id = "sorttable_sortfwdind";
|
||||
sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾';
|
||||
this.appendChild(sortfwdind);
|
||||
return;
|
||||
}
|
||||
|
||||
// remove sorttable_sorted classes
|
||||
theadrow = this.parentNode;
|
||||
forEach(theadrow.childNodes, function(cell) {
|
||||
if (cell.nodeType == 1) { // an element
|
||||
cell.className = cell.className.replace('sorttable_sorted_reverse','');
|
||||
cell.className = cell.className.replace('sorttable_sorted','');
|
||||
}
|
||||
});
|
||||
sortfwdind = document.getElementById('sorttable_sortfwdind');
|
||||
if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
|
||||
sortrevind = document.getElementById('sorttable_sortrevind');
|
||||
if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }
|
||||
|
||||
this.className += ' sorttable_sorted';
|
||||
sortfwdind = document.createElement('span');
|
||||
sortfwdind.id = "sorttable_sortfwdind";
|
||||
sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾';
|
||||
this.appendChild(sortfwdind);
|
||||
|
||||
// build an array to sort. This is a Schwartzian transform thing,
|
||||
// i.e., we "decorate" each row with the actual sort key,
|
||||
// sort based on the sort keys, and then put the rows back in order
|
||||
// which is a lot faster because you only do getInnerText once per row
|
||||
row_array = [];
|
||||
col = this.sorttable_columnindex;
|
||||
rows = this.sorttable_tbody.rows;
|
||||
for (var j=0; j<rows.length; j++) {
|
||||
row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]];
|
||||
}
|
||||
/* If you want a stable sort, uncomment the following line */
|
||||
//sorttable.shaker_sort(row_array, this.sorttable_sortfunction);
|
||||
/* and comment out this one */
|
||||
row_array.sort(this.sorttable_sortfunction);
|
||||
|
||||
tb = this.sorttable_tbody;
|
||||
for (var j=0; j<row_array.length; j++) {
|
||||
tb.appendChild(row_array[j][1]);
|
||||
}
|
||||
|
||||
delete row_array;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
guessType: function(table, column) {
|
||||
// guess the type of a column based on its first non-blank row
|
||||
sortfn = sorttable.sort_alpha;
|
||||
for (var i=0; i<table.tBodies[0].rows.length; i++) {
|
||||
text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
|
||||
if (text != '') {
|
||||
if (text.match(/^-?[£$€]?[\d,.]+%?$/)) {
|
||||
return sorttable.sort_numeric;
|
||||
}
|
||||
// check for a date: dd/mm/yyyy or dd/mm/yy
|
||||
// can have / or . or - as separator
|
||||
// can be mm/dd as well
|
||||
possdate = text.match(sorttable.DATE_RE)
|
||||
if (possdate) {
|
||||
// looks like a date
|
||||
first = parseInt(possdate[1]);
|
||||
second = parseInt(possdate[2]);
|
||||
if (first > 12) {
|
||||
// definitely dd/mm
|
||||
return sorttable.sort_ddmm;
|
||||
} else if (second > 12) {
|
||||
return sorttable.sort_mmdd;
|
||||
} else {
|
||||
// looks like a date, but we can't tell which, so assume
|
||||
// that it's dd/mm (English imperialism!) and keep looking
|
||||
sortfn = sorttable.sort_ddmm;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sortfn;
|
||||
},
|
||||
|
||||
getInnerText: function(node) {
|
||||
// gets the text we want to use for sorting for a cell.
|
||||
// strips leading and trailing whitespace.
|
||||
// this is *not* a generic getInnerText function; it's special to sorttable.
|
||||
// for example, you can override the cell text with a customkey attribute.
|
||||
// it also gets .value for <input> fields.
|
||||
|
||||
if (!node) return "";
|
||||
|
||||
hasInputs = (typeof node.getElementsByTagName == 'function') &&
|
||||
node.getElementsByTagName('input').length;
|
||||
|
||||
if (node.getAttribute("sorttable_customkey") != null) {
|
||||
return node.getAttribute("sorttable_customkey");
|
||||
}
|
||||
else if (typeof node.textContent != 'undefined' && !hasInputs) {
|
||||
return node.textContent.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else if (typeof node.innerText != 'undefined' && !hasInputs) {
|
||||
return node.innerText.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else if (typeof node.text != 'undefined' && !hasInputs) {
|
||||
return node.text.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else {
|
||||
switch (node.nodeType) {
|
||||
case 3:
|
||||
if (node.nodeName.toLowerCase() == 'input') {
|
||||
return node.value.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
case 4:
|
||||
return node.nodeValue.replace(/^\s+|\s+$/g, '');
|
||||
break;
|
||||
case 1:
|
||||
case 11:
|
||||
var innerText = '';
|
||||
for (var i = 0; i < node.childNodes.length; i++) {
|
||||
innerText += sorttable.getInnerText(node.childNodes[i]);
|
||||
}
|
||||
return innerText.replace(/^\s+|\s+$/g, '');
|
||||
break;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
reverse: function(tbody) {
|
||||
// reverse the rows in a tbody
|
||||
newrows = [];
|
||||
for (var i=0; i<tbody.rows.length; i++) {
|
||||
newrows[newrows.length] = tbody.rows[i];
|
||||
}
|
||||
for (var i=newrows.length-1; i>=0; i--) {
|
||||
tbody.appendChild(newrows[i]);
|
||||
}
|
||||
delete newrows;
|
||||
},
|
||||
|
||||
/* sort functions
|
||||
each sort function takes two parameters, a and b
|
||||
you are comparing a[0] and b[0] */
|
||||
sort_numeric: function(a,b) {
|
||||
aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
|
||||
if (isNaN(aa)) aa = 0;
|
||||
bb = parseFloat(b[0].replace(/[^0-9.-]/g,''));
|
||||
if (isNaN(bb)) bb = 0;
|
||||
return aa-bb;
|
||||
},
|
||||
sort_alpha: function(a,b) {
|
||||
if (a[0]==b[0]) return 0;
|
||||
if (a[0]<b[0]) return -1;
|
||||
return 1;
|
||||
},
|
||||
sort_ddmm: function(a,b) {
|
||||
mtch = a[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; m = mtch[2]; d = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt1 = y+m+d;
|
||||
mtch = b[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; m = mtch[2]; d = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt2 = y+m+d;
|
||||
if (dt1==dt2) return 0;
|
||||
if (dt1<dt2) return -1;
|
||||
return 1;
|
||||
},
|
||||
sort_mmdd: function(a,b) {
|
||||
mtch = a[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; d = mtch[2]; m = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt1 = y+m+d;
|
||||
mtch = b[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; d = mtch[2]; m = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt2 = y+m+d;
|
||||
if (dt1==dt2) return 0;
|
||||
if (dt1<dt2) return -1;
|
||||
return 1;
|
||||
},
|
||||
|
||||
shaker_sort: function(list, comp_func) {
|
||||
// A stable sort function to allow multi-level sorting of data
|
||||
// see: http://en.wikipedia.org/wiki/Cocktail_sort
|
||||
// thanks to Joseph Nahmias
|
||||
var b = 0;
|
||||
var t = list.length - 1;
|
||||
var swap = true;
|
||||
|
||||
while(swap) {
|
||||
swap = false;
|
||||
for(var i = b; i < t; ++i) {
|
||||
if ( comp_func(list[i], list[i+1]) > 0 ) {
|
||||
var q = list[i]; list[i] = list[i+1]; list[i+1] = q;
|
||||
swap = true;
|
||||
}
|
||||
} // for
|
||||
t--;
|
||||
|
||||
if (!swap) break;
|
||||
|
||||
for(var i = t; i > b; --i) {
|
||||
if ( comp_func(list[i], list[i-1]) < 0 ) {
|
||||
var q = list[i]; list[i] = list[i-1]; list[i-1] = q;
|
||||
swap = true;
|
||||
}
|
||||
} // for
|
||||
b++;
|
||||
|
||||
} // while(swap)
|
||||
}
|
||||
}
|
||||
|
||||
/* ******************************************************************
|
||||
Supporting functions: bundled here to avoid depending on a library
|
||||
****************************************************************** */
|
||||
|
||||
// Dean Edwards/Matthias Miller/John Resig
|
||||
|
||||
/* for Mozilla/Opera9 */
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener("DOMContentLoaded", sorttable.init, false);
|
||||
}
|
||||
|
||||
/* for Internet Explorer */
|
||||
/*@cc_on @*/
|
||||
/*@if (@_win32)
|
||||
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
|
||||
var script = document.getElementById("__ie_onload");
|
||||
script.onreadystatechange = function() {
|
||||
if (this.readyState == "complete") {
|
||||
sorttable.init(); // call the onload handler
|
||||
}
|
||||
};
|
||||
/*@end @*/
|
||||
|
||||
/* for Safari */
|
||||
if (/WebKit/i.test(navigator.userAgent)) { // sniff
|
||||
var _timer = setInterval(function() {
|
||||
if (/loaded|complete/.test(document.readyState)) {
|
||||
sorttable.init(); // call the onload handler
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
|
||||
/* for other browsers */
|
||||
window.onload = sorttable.init;
|
||||
|
||||
// written by Dean Edwards, 2005
|
||||
// with input from Tino Zijdel, Matthias Miller, Diego Perini
|
||||
|
||||
// http://dean.edwards.name/weblog/2005/10/add-event/
|
||||
|
||||
function dean_addEvent(element, type, handler) {
|
||||
if (element.addEventListener) {
|
||||
element.addEventListener(type, handler, false);
|
||||
} else {
|
||||
// assign each event handler a unique ID
|
||||
if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++;
|
||||
// create a hash table of event types for the element
|
||||
if (!element.events) element.events = {};
|
||||
// create a hash table of event handlers for each element/event pair
|
||||
var handlers = element.events[type];
|
||||
if (!handlers) {
|
||||
handlers = element.events[type] = {};
|
||||
// store the existing event handler (if there is one)
|
||||
if (element["on" + type]) {
|
||||
handlers[0] = element["on" + type];
|
||||
}
|
||||
}
|
||||
// store the event handler in the hash table
|
||||
handlers[handler.$$guid] = handler;
|
||||
// assign a global event handler to do all the work
|
||||
element["on" + type] = handleEvent;
|
||||
}
|
||||
};
|
||||
// a counter used to create unique IDs
|
||||
dean_addEvent.guid = 1;
|
||||
|
||||
function removeEvent(element, type, handler) {
|
||||
if (element.removeEventListener) {
|
||||
element.removeEventListener(type, handler, false);
|
||||
} else {
|
||||
// delete the event handler from the hash table
|
||||
if (element.events && element.events[type]) {
|
||||
delete element.events[type][handler.$$guid];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function handleEvent(event) {
|
||||
var returnValue = true;
|
||||
// grab the event object (IE uses a global event object)
|
||||
event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
|
||||
// get a reference to the hash table of event handlers
|
||||
var handlers = this.events[event.type];
|
||||
// execute each event handler
|
||||
for (var i in handlers) {
|
||||
this.$$handleEvent = handlers[i];
|
||||
if (this.$$handleEvent(event) === false) {
|
||||
returnValue = false;
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
function fixEvent(event) {
|
||||
// add W3C standard event methods
|
||||
event.preventDefault = fixEvent.preventDefault;
|
||||
event.stopPropagation = fixEvent.stopPropagation;
|
||||
return event;
|
||||
};
|
||||
fixEvent.preventDefault = function() {
|
||||
this.returnValue = false;
|
||||
};
|
||||
fixEvent.stopPropagation = function() {
|
||||
this.cancelBubble = true;
|
||||
}
|
||||
|
||||
// Dean's forEach: http://dean.edwards.name/base/forEach.js
|
||||
/*
|
||||
forEach, version 1.0
|
||||
Copyright 2006, Dean Edwards
|
||||
License: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
// array-like enumeration
|
||||
if (!Array.forEach) { // mozilla already supports this
|
||||
Array.forEach = function(array, block, context) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
block.call(context, array[i], i, array);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// generic enumeration
|
||||
Function.prototype.forEach = function(object, block, context) {
|
||||
for (var key in object) {
|
||||
if (typeof this.prototype[key] == "undefined") {
|
||||
block.call(context, object[key], key, object);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// character enumeration
|
||||
String.forEach = function(string, block, context) {
|
||||
Array.forEach(string.split(""), function(chr, index) {
|
||||
block.call(context, chr, index, string);
|
||||
});
|
||||
};
|
||||
|
||||
// globally resolve forEach enumeration
|
||||
var forEach = function(object, block, context) {
|
||||
if (object) {
|
||||
var resolve = Object; // default
|
||||
if (object instanceof Function) {
|
||||
// functions have a "length" property
|
||||
resolve = Function;
|
||||
} else if (object.forEach instanceof Function) {
|
||||
// the object implements a custom forEach method so use that
|
||||
object.forEach(block, context);
|
||||
return;
|
||||
} else if (typeof object == "string") {
|
||||
// the object is a string
|
||||
resolve = String;
|
||||
} else if (typeof object.length == "number") {
|
||||
// the object is array-like
|
||||
resolve = Array;
|
||||
}
|
||||
resolve.forEach(object, block, context);
|
||||
}
|
||||
};
|
||||
|
||||
2
js/sorttable-2.min.js
vendored
Normal file
2
js/sorttable-2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue