Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.

Commit

Permalink
Minor fixes on admin, improved htaccess
Browse files Browse the repository at this point in the history
  • Loading branch information
carbon-tigerlab committed Jan 30, 2015
1 parent 0afdf9c commit 1818131
Show file tree
Hide file tree
Showing 16 changed files with 199 additions and 36 deletions.
17 changes: 14 additions & 3 deletions .htaccess
@@ -1,9 +1,15 @@
# kusaba as directory index
DirectoryIndex kusaba.php DirectoryIndex kusaba.php
AddCharset UTF-8 .html
AddCharset UTF-8 .php


FileETag None # set utf8
#AddCharset UTF-8 .html
#AddCharset UTF-8 .php
AddDefaultCharset utf-8


# only useful when behind a load balancer
#FileETag None

# set expiry headers for html
<IfModule mod_headers.c> <IfModule mod_headers.c>
<Files *.html> <Files *.html>
Header add Expires "Mon, 26 Jul 1997 05:00:00 GMT" Header add Expires "Mon, 26 Jul 1997 05:00:00 GMT"
Expand All @@ -13,10 +19,15 @@ Header set Expires "0"
Header unset Vary Header unset Vary
</Files> </Files>
</IfModule> </IfModule>

# prevent access to spam.txt
<Files spam.txt> <Files spam.txt>
order allow,deny order allow,deny
deny from all deny from all
</Files> </Files>


# error pages
ErrorDocument 404 /404.html

# Warning: Contents below this line may be erased, please place all .htaccess rules above this line # Warning: Contents below this line may be erased, please place all .htaccess rules above this line
## !KU_BANS: ## !KU_BANS:
22 changes: 22 additions & 0 deletions 404.html
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>404 - Page Not Found</title>

<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="/custom/css/common.css">
<style>
body{font-size:24px}
a{color:#364283}
img{max-width:100%;height:auto}
</style>
</head>
<body class="text-center">
<img src="/404.jpg"><br>
404 - Page Not Found<br>
<a href="http://www.helma.us/">www.helma.us</a>
</body>
</html>
20 changes: 0 additions & 20 deletions 404.shtml

This file was deleted.

27 changes: 26 additions & 1 deletion custom/css/board.css
@@ -1 +1,26 @@
#menu h1 {font-size:16px; padding:5px; margin:0} /* common */
a, a:hover {text-decoration:none}

/* menu */
#menu-title {font-size:18px; margin:0; padding:2px; text-align:center}
#menu-main-list, .menu-section-list {margin:4px 0}
#menu-main-list > li, .menu-section-list > li {padding:2px 6px}
#menu-boards-empty, .menu-section-empty {padding:6px}

.menu-section-title {font-size:13px; margin:12px 0 4px;padding:2px 6px; position:relative; cursor:pointer}
.menu-section-title:before {content:"+"; position:absolute; top:0; right:8px; font-weight:700; font-size:16px}

/* news */
#news-container {padding:15px; max-width:940px; margin:0 auto}

#news-title > h1 {font-size:18px}
#news-title > h1, #news-title > h3 {margin:0}

#news-tab {border-width:0 0 1px; border-style:solid; padding-left:12px; margin:10px 0}
#news-tab > li {border-width:0 0 1px; border-style:solid; margin:0 2px -1px}
#news-tab > li.active {border-width:1px 1px 0 1px; border-bottom-color:rgba(0,0,0,0)}
#news-tab > li > a {display:block; padding:4px; min-width:40px}

#news-entry > li {margin-bottom:15px}
.news-entry-title {padding:2px 6px; font-weight:700}
.news-entry-content {padding:2px 6px}
8 changes: 8 additions & 0 deletions custom/css/board_burichan.css
@@ -0,0 +1,8 @@
html {color:#000}
a {color:#34345c}
a:hover {color:#d00}

.bg-main {background-color:#eef2ff}
.bg-sub {background-color:#d6daf0}

.border-sub {border-color:#b7c5d9}
8 changes: 8 additions & 0 deletions custom/css/board_futaba.css
@@ -0,0 +1,8 @@
html {color:#800000}
a {color:#00e}
a:hover {color:#f00}

.bg-main {background-color:#ffe}
.bg-sub {background-color:#f0e0d6}

.border-sub {border-color:#d9bfb7}
1 change: 0 additions & 1 deletion custom/css/burichan.css

This file was deleted.

2 changes: 1 addition & 1 deletion custom/css/common.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions custom/css/frame.css
@@ -1,12 +1,12 @@
html, body, iframe {width:100%; height:100%; margin:0; padding:0} html, body, iframe {width:100%; height:100%; margin:0; padding:0}
html {min-width:768px} html {min-width:560px}
iframe {border:0; display:block} iframe {border:0; display:block}


.frame-wrapper {position:relative; height:100%} .frame-wrapper {position:relative; height:100%}
.frame-wrapper > div {position:absolute; top:0; bottom:0} .frame-wrapper > div {position:absolute; top:0; bottom:0}
.frame-left {left:0; width:240px; box-shadow:0 0 10px rgba(0,0,0,0.3); z-index:200} .frame-left {left:0; width:240px; box-shadow:0 0 10px rgba(0,0,0,0.3); z-index:200}
.frame-right {left:240px; right:0; z-index:100} .frame-right {left:240px; right:0; z-index:100; min-width:320px}


#info {text-align:center; font-family:sans-serif; padding:20px 15px} #info {text-align:center; font-family:sans-serif; padding:20px 15px}
#info > h1 {margin:0 0 20px} #info > h1 {margin:0 0 20px}
#info > ul {margin:0; padding:0; list-style:none} #info > ul {margin:0; padding:0; list-style:none}
3 changes: 1 addition & 2 deletions custom/css/manage.css
@@ -1,5 +1,5 @@
/* common */ /* common */
body {background-color:#f4f5fc; color:#111} html {background-color:#F4F5FC; color:#111}
p {margin:0 0 10px} p {margin:0 0 10px}
hr {border:0; border-top:1px solid #7d87bb; margin:10px 0} hr {border:0; border-top:1px solid #7d87bb; margin:10px 0}
h1, h2 {background-color:#d6daf0; padding:5px; border-bottom:1px solid #7d87bb} h1, h2 {background-color:#d6daf0; padding:5px; border-bottom:1px solid #7d87bb}
Expand Down Expand Up @@ -88,4 +88,3 @@ td.table-col-btn {padding:0}


.label-required {position:relative} .label-required {position:relative}
.label-required:before {content:"*"; color:#c55d89; font-size:18px; font-weight:700; position:absolute; top:0; left:-10px; line-height:1} .label-required:before {content:"*"; color:#c55d89; font-size:18px; font-weight:700; position:absolute; top:0; left:-10px; line-height:1}

99 changes: 99 additions & 0 deletions custom/js/board.js
@@ -0,0 +1,99 @@
// https://github.com/pamelafox/lscache
!function(a,b){"function"==typeof define&&define.amd?define([],b):"undefined"!=typeof module&&module.exports?module.exports=b():a.lscache=b()}(this,function(){function a(){var a="__lscachetest__",c=a;if(void 0!==m)return m;try{g(a,c),h(a),m=!0}catch(d){m=b(d)?!0:!1}return m}function b(a){return a&&"QUOTA_EXCEEDED_ERR"===a.name||"NS_ERROR_DOM_QUOTA_REACHED"===a.name||"QuotaExceededError"===a.name?!0:!1}function c(){return void 0===n&&(n=null!=window.JSON),n}function d(a){return a+p}function e(){return Math.floor((new Date).getTime()/r)}function f(a){return localStorage.getItem(o+t+a)}function g(a,b){localStorage.removeItem(o+t+a),localStorage.setItem(o+t+a,b)}function h(a){localStorage.removeItem(o+t+a)}function i(a){for(var b=new RegExp("^"+o+t+"(.*)"),c=localStorage.length-1;c>=0;--c){var e=localStorage.key(c);e=e&&e.match(b),e=e&&e[1],e&&e.indexOf(p)<0&&a(e,d(e))}}function j(a){var b=d(a);h(a),h(b)}function k(a){var b=d(a),c=f(b);if(c){var g=parseInt(c,q);if(e()>=g)return h(a),h(b),!0}}function l(a,b){u&&"console"in window&&"function"==typeof window.console.warn&&(window.console.warn("lscache - "+a),b&&window.console.warn("lscache - The error was: "+b.message))}var m,n,o="lscache-",p="-cacheexpiration",q=10,r=6e4,s=Math.floor(864e13/r),t="",u=!1,v={set:function(k,m,n){if(a()){if("string"!=typeof m){if(!c())return;try{m=JSON.stringify(m)}catch(o){return}}try{g(k,m)}catch(o){if(!b(o))return void l("Could not add item with key '"+k+"'",o);var p,r=[];i(function(a,b){var c=f(b);c=c?parseInt(c,q):s,r.push({key:a,size:(f(a)||"").length,expiration:c})}),r.sort(function(a,b){return b.expiration-a.expiration});for(var t=(m||"").length;r.length&&t>0;)p=r.pop(),l("Cache is full, removing item with key '"+k+"'"),j(p.key),t-=p.size;try{g(k,m)}catch(o){return void l("Could not add item with key '"+k+"', perhaps it's too big?",o)}}n?g(d(k),(e()+n).toString(q)):h(d(k))}},get:function(b){if(!a())return null;if(k(b))return null;var d=f(b);if(!d||!c())return d;try{return JSON.parse(d)}catch(e){return d}},remove:function(b){a()&&j(b)},supported:function(){return a()},flush:function(){a()&&i(function(a){j(a)})},flushExpired:function(){a()&&i(function(a){k(a)})},setBucket:function(a){t=a},resetBucket:function(){t=""},enableWarnings:function(a){u=a}};return v});

(function (d, w, cache) {
// add css ready
$(d.documentElement).addClass('css-ready');

// flush expired cache
cache.flushExpired();

// variables
var changeStyle = function (targetStyle) {
var name = '.css-board',
fn = function (index, item) {
item.disabled = true;
item.rel = 'alternate stylesheet';

if (item.id == targetStyle) {
item.disabled = false;
item.rel = 'stylesheet';
}
};

$(name).each(fn);

if (w.parent.board_page) {
w.parent.board_page.jQuery(name).each(fn);
}

if (w.parent.board_menu) {
w.parent.board_menu.jQuery(name).each(fn);
}

cache.set('main-style', targetStyle);
};


// get default style
if (cache.get('main-style')) {
changeStyle(cache.get('main-style'));
}

// toggler
$('.toggle').each(function () {
$(this).on('click', function (e) {
var target = $(this).data('target');

e.preventDefault();

if ($(this).hasClass('toggle-animate')) {
$(target).finish().addClass('no-transition').slideToggle(200, function () {
$(this).removeClass('no-transition');
});
}
else {
$(target).toggle();
}
});
});

// change style
$('#menu-site-style').one('click', function () {
$(this).hide();

$('#menu-site-style-list').show().find('a').on('click', function () {
changeStyle($(this).data('target-id'));

/*var targetId = $(this).data('target-id');
$('.css-board').each(changeStyle);
if (w.parent.board_page) {
w.parent.board_page.jQuery('.css-board').each(changeStyle);
}
cache.set('main-style', targetId);*/
});
});

/*function changeStyle (targetStyle) {
item.disabled = true;
item.rel = 'alternate stylesheet';
if (item.id == targetId) {
item.disabled = false;
item.rel = 'stylesheet';
}
};*/

// remove frame
$('#menu-remove-frame').one('click', function () {
var text = $(this).data('alt-text');

$(this).parent().empty().text(text);

$('.menu-section-list > li > a').attr('target', '_top');
});
})(document, window, lscache);
1 change: 0 additions & 1 deletion custom/js/manage.js
Expand Up @@ -12,7 +12,6 @@
$(target).finish().addClass('no-transition').slideToggle(200, function () { $(target).finish().addClass('no-transition').slideToggle(200, function () {
$(this).removeClass('no-transition'); $(this).removeClass('no-transition');
}); });

}); });
}); });


Expand Down
3 changes: 2 additions & 1 deletion dwoo/templates/manage.tpl
Expand Up @@ -2,6 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">


<title>Manage Boards</title> <title>Manage Boards</title>
Expand All @@ -20,7 +21,7 @@
{$page} {$page}
{$footer} {$footer}


<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="{%KU_WEBPATH}/custom/js/manage.js"></script> <script src="{%KU_WEBPATH}/custom/js/manage.js"></script>
</body> </body>
</html> </html>
3 changes: 2 additions & 1 deletion dwoo/templates/manage_menu.tpl
Expand Up @@ -2,6 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">


<title>Manage Boards</title> <title>Manage Boards</title>
Expand All @@ -18,7 +19,7 @@


{$links} {$links}


<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="{%KU_WEBPATH}/custom/js/manage.js"></script> <script src="{%KU_WEBPATH}/custom/js/manage.js"></script>
</body> </body>
</html> </html>
12 changes: 11 additions & 1 deletion inc/pages/manage_login.html
Expand Up @@ -7,12 +7,22 @@
<title>Manage Boards</title> <title>Manage Boards</title>


<link rel="shortcut icon" href="{%KU_WEBPATH}/favicon.ico"> <link rel="shortcut icon" href="{%KU_WEBPATH}/favicon.ico">

<link rel="stylesheet" href="{%KU_WEBPATH}/custom/css/common.css"> <link rel="stylesheet" href="{%KU_WEBPATH}/custom/css/common.css">
<link rel="stylesheet" href="{%KU_WEBPATH}/custom/css/manage.css"> <link rel="stylesheet" href="{%KU_WEBPATH}/custom/css/manage.css">
</head> </head>
<body id="page"> <body id="page">
<form action="?action=login" method="post" id="manage-login" name="managelogin"> <form action="?action=login" method="post" id="manage-login" name="managelogin">
<table class="table table-sm"> <table class="table table-sm">
<tr>
<td>
<!--[if lt IE 9]>
<div class="alert alert-red">
Unsupported browser. Proceed at your own risk.
</div>
<![endif]-->
</td>
</tr>
<tr> <tr>
<td><input class="input input-block" type="text" name="username" placeholder="Username" required autofocus></td> <td><input class="input input-block" type="text" name="username" placeholder="Username" required autofocus></td>
</tr> </tr>
Expand Down
3 changes: 2 additions & 1 deletion manage.php
Expand Up @@ -30,6 +30,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">


<title>Manage Boards</title> <title>Manage Boards</title>
Expand All @@ -47,4 +48,4 @@
</div> </div>
</div> </div>
</body> </body>
</html> </html>

0 comments on commit 1818131

Please sign in to comment.