Skip to content

Commit 5cc42f7

Browse files
committed
latest
1 parent 1cbe1c9 commit 5cc42f7

File tree

137 files changed

+7150
-327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+7150
-327
lines changed

.htaccess

+17
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ DirectoryIndex index.php
44
RewriteEngine on
55
RewriteBase /boards/
66

7+
## there is no reason for there to be anything but post and get
8+
#tank 12/29/2019
9+
RewriteEngine on
10+
RewriteCond %{THE_REQUEST} !^(POST|GET)\ /.*\ HTTP/1\.1$
11+
RewriteRule .* - [F]
12+
13+
14+
#handle hotlinking
15+
RewriteCond %{HTTP_REFERER} !^$
16+
RewriteCond %{HTTP_REFERER} !^https://(www\.)autohotkey.com/.*$ [NC]
17+
RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|png|css|pdf)$ - [F]
18+
19+
#fraud site
20+
RewriteCond %{HTTP_REFERER} ^https://www\.autohotkey\.fr [NC]
21+
RewriteRule ^(.*)$ https://www.autohotkey.com/boards/viewtopic.php?f=2&t=70926 [R=301,L]
22+
23+
724
RewriteCond %{HTTP_HOST} !=""
825
RewriteCond %{HTTP_HOST} !^www\. [NC]
926
RewriteCond %{HTTPS}s ^on(s)|

assets/javascript/core.js

+82-7
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ $(function() {
16841684
// modified by joedf from https://greasyfork.org/en/scripts/374036-ahk-forum-fix/code
16851685

16861686
window.expandCode = function (e) {
1687-
var c = e.parentNode.parentNode.getElementsByTagName('code')[0];
1687+
var c = e.parentNode.parentNode.getElementsByTagName('code')[0];
16881688
if (c.getAttribute('expanded') == 'true') {
16891689
c.style.height = '200px';
16901690
e.innerHTML = 'Expand View';
@@ -1703,7 +1703,7 @@ function expand_code_init() {
17031703
for (var i = 0; i < boxes.length; i++) {
17041704
if (boxes[i].scrollHeight > boxes[i].offsetHeight + 1) {
17051705
add_expand = true;
1706-
} else if (boxes[i].scrollHeight == 0) { /* possibly inside a spoiler control */
1706+
} else if (boxes[i].scrollHeight == 0) { /* possibly inside a spoiler control */
17071707
if (boxes[i].innerHTML.split('\n').length-1 > 17) {
17081708
add_expand = true;
17091709
}
@@ -1714,12 +1714,87 @@ function expand_code_init() {
17141714

17151715
if (add_expand) {
17161716
var tagP = (boxes[i].parentNode.tagName.toLowerCase() == 'pre' ? boxes[i].parentNode.previousSibling : boxes[i].previousSibling);
1717-
tagP.innerHTML += ' - <a href="#" onclick="expandCode(this); return false;">Expand View</a>';
1718-
var c = tagP.parentNode.getElementsByTagName('code')[0];
1719-
c.setAttribute('expanded','false');
1720-
c.style.height = '200px';
1717+
tagP.innerHTML += ' - <a href="#" onclick="expandCode(this); return false;">Expand View</a>';
1718+
var c = tagP.parentNode.getElementsByTagName('code')[0];
1719+
c.setAttribute('expanded','false');
1720+
c.style.height = '200px';
17211721
c.style.maxHeight = 'unset';
17221722
}
17231723
}
17241724
}
1725-
expand_code_init();
1725+
expand_code_init();
1726+
1727+
1728+
1729+
// joedf: add download for codeboxes
1730+
// should work for IE11, Chrome v1+, FF36+
1731+
1732+
function download_code_init(){
1733+
var boxes = document.getElementsByTagName('code');
1734+
for (var i = 0; i < boxes.length; i++) {
1735+
if (boxes[i].parentNode.parentNode.getAttribute('data-filename') != null) {
1736+
1737+
var filename = boxes[i].parentNode.parentNode.getAttribute('data-filename').trim().replace(/[<>:"\/\\\|\?\'\*]/g,'_');
1738+
1739+
var tagP = (boxes[i].parentNode.tagName.toLowerCase() == 'pre' ? boxes[i].parentNode.previousSibling : boxes[i].previousSibling);
1740+
tagP.innerHTML += ' - <a href="#" title="download '+filename+'" onclick="downloadCode(this); return false;">Download</a>';
1741+
}
1742+
}
1743+
}
1744+
// joedf: modified from https://stackoverflow.com/a/33542499/883015
1745+
window.downloadCode = function(e) {
1746+
// get Filename (regex ensures valid and safe name) and Data
1747+
var filename = e.parentNode.parentNode.getAttribute('data-filename').trim().replace(/[<>:"\/\\\|\?\'\*]/g,'_');
1748+
var data = e.parentNode.parentNode.getElementsByTagName('code')[0].innerText;
1749+
1750+
var blob = new Blob([data], {type: 'text/plain'});
1751+
if(window.navigator.msSaveOrOpenBlob) {
1752+
window.navigator.msSaveBlob(blob, filename);
1753+
} else {
1754+
var elem = window.document.createElement('a');
1755+
elem.href = window.URL.createObjectURL(blob);
1756+
elem.download = filename;
1757+
document.body.appendChild(elem);
1758+
elem.click();
1759+
document.body.removeChild(elem);
1760+
}
1761+
}
1762+
download_code_init();
1763+
1764+
1765+
// joedf: add option toggle line numbers in codeboxes
1766+
// created Jan 2020
1767+
// updated July 01, 2020 - use line-numbers plugin, with a css fixes and tweak to allowing toggling
1768+
1769+
function toggleLineNums_init(){
1770+
// add css rules
1771+
var ir = document.createElement('style');
1772+
ir.innerHTML = "pre[class*=\"language-\"].line-numbers-hide .line-numbers-rows { display: none; }";
1773+
document.body.appendChild(ir);
1774+
1775+
// add toggle anchor links ...
1776+
var boxes = document.getElementsByTagName('code');
1777+
for (var i = 0; i < boxes.length; i++) {
1778+
var tagP = (boxes[i].parentNode.tagName.toLowerCase() == 'pre' ? boxes[i].parentNode.previousSibling : boxes[i].previousSibling);
1779+
tagP.innerHTML += ' - <a href="#" title="Toggle Line numbers" onclick="toggleLineNums(this); return false;">Toggle Line numbers</a>';
1780+
1781+
var tagPre = (boxes[i].parentNode.tagName.toLowerCase() == 'pre' ? boxes[i].parentNode : boxes[i].previousSibling);
1782+
if (tagPre) {
1783+
tagPre.className = tagPre.className.trim() + " line-numbers";
1784+
}
1785+
}
1786+
}
1787+
function toggleLineNums(e) {
1788+
var eCode = e.parentNode.parentNode.getElementsByTagName('code')[0];
1789+
1790+
var tagPre = (eCode.parentNode.tagName.toLowerCase() == 'pre' ? eCode.parentNode : eCode.previousSibling);
1791+
if (tagPre) {
1792+
1793+
if (tagPre.className.indexOf('line-numbers-hide') >= 0){
1794+
tagPre.className = tagPre.className.replace('line-numbers-hide','line-numbers').trim();
1795+
} else {
1796+
tagPre.className = tagPre.className.replace('line-numbers','line-numbers-hide').trim();
1797+
}
1798+
}
1799+
}
1800+
toggleLineNums_init();

assets/javascript/gotcha.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var msg = "Dear visitor. This domain autohotkey.fr is trying to trick you. The official domain is autohotkey.com.\n\n";
2+
alert(msg );
3+
//location.href = "https://www.autohotkey.com/boards/viewtopic.php?f=2&t=70926"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/* PrismJS 1.15.0
2+
https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript */
3+
/**
4+
* okaidia theme for JavaScript, CSS and HTML
5+
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
6+
* @author ocodia
7+
*/
8+
9+
code[class*="language-"],
10+
pre[class*="language-"] {
11+
color: #f8f8f2;
12+
background: none;
13+
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
14+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
15+
text-align: left;
16+
white-space: pre;
17+
word-spacing: normal;
18+
word-break: normal;
19+
word-wrap: normal;
20+
line-height: 1.5;
21+
22+
-moz-tab-size: 4;
23+
-o-tab-size: 4;
24+
tab-size: 4;
25+
26+
-webkit-hyphens: none;
27+
-moz-hyphens: none;
28+
-ms-hyphens: none;
29+
hyphens: none;
30+
}
31+
32+
/* Code blocks */
33+
pre[class*="language-"] {
34+
padding: 1em;
35+
margin: .5em 0;
36+
overflow: auto;
37+
border-radius: 0.3em;
38+
}
39+
40+
:not(pre) > code[class*="language-"],
41+
pre[class*="language-"] {
42+
background: #272822;
43+
}
44+
45+
/* Inline code */
46+
:not(pre) > code[class*="language-"] {
47+
padding: .1em;
48+
border-radius: .3em;
49+
white-space: normal;
50+
}
51+
52+
.token.comment,
53+
.token.prolog,
54+
.token.doctype,
55+
.token.cdata {
56+
color: slategray;
57+
}
58+
59+
.token.punctuation {
60+
color: #f8f8f2;
61+
}
62+
63+
.namespace {
64+
opacity: .7;
65+
}
66+
67+
.token.property,
68+
.token.tag,
69+
.token.constant,
70+
.token.symbol,
71+
.token.deleted {
72+
color: #f92672;
73+
}
74+
75+
.token.boolean,
76+
.token.number {
77+
color: #ae81ff;
78+
}
79+
80+
.token.selector,
81+
.token.attr-name,
82+
.token.string,
83+
.token.char,
84+
.token.builtin,
85+
.token.inserted {
86+
color: #a6e22e;
87+
}
88+
89+
.token.operator,
90+
.token.entity,
91+
.token.url,
92+
.language-css .token.string,
93+
.style .token.string,
94+
.token.variable {
95+
color: #f8f8f2;
96+
}
97+
98+
.token.atrule,
99+
.token.attr-value,
100+
.token.function,
101+
.token.class-name {
102+
color: #e6db74;
103+
}
104+
105+
.token.keyword {
106+
color: #66d9ef;
107+
}
108+
109+
.token.regex,
110+
.token.important {
111+
color: #fd971f;
112+
}
113+
114+
.token.important,
115+
.token.bold {
116+
font-weight: bold;
117+
}
118+
.token.italic {
119+
font-style: italic;
120+
}
121+
122+
.token.entity {
123+
cursor: help;
124+
}
125+

0 commit comments

Comments
 (0)