remove minimal theme, it is full of ugly

This commit is contained in:
Shish 2009-08-04 17:18:02 +01:00
parent 9a79f77deb
commit e73abc1545
5 changed files with 0 additions and 563 deletions

View file

@ -1,83 +0,0 @@
<?php
class Layout {
function display_page($page) {
global $config;
$theme_name = $config->get_string('theme', 'default');
$data_href = get_base_href();
$contact_link = $config->get_string('contact_link');
$version = "Shimmie-".VERSION;
$header_html = "";
foreach($page->headers as $line) {
$header_html .= "\t\t$line\n";
}
$left_block_html = "";
$main_block_html = "";
foreach($page->blocks as $block) {
switch($block->section) {
case "left":
$left_block_html .= $this->block_to_html($block, true, "left");
break;
case "main":
$main_block_html .= $this->block_to_html($block, false, "main");
break;
default:
print "<p>error: {$block->header} using an unknown section ({$block->section})";
break;
}
}
$debug = get_debug_info();
$contact = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a>";
if(empty($page->subheading)) {
$subheading = "";
}
else {
$subheading = "<div id='subtitle'>{$page->subheading}</div>";
}
print <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>{$page->title}</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link rel="stylesheet" href="$data_href/themes/$theme_name/style.css" type="text/css">
$header_html
<script src='$data_href/themes/$theme_name/script.js' type='text/javascript'></script>
</head>
<body>
<div id="nav">$left_block_html</div>
<div id="body">$main_block_html</div>
<div id="footer">
<hr>
Images &copy; their respective owners,
<a href="http://code.shishnet.org/shimmie2/">$version</a> &copy;
<a href="http://www.shishnet.org/">Shish</a> 2007-2009,
based on the Danbooru concept.
$debug
$contact
</div>
</body>
</html>
EOD;
}
function block_to_html($block, $hidable=false, $salt="") {
$h = $block->header;
$b = $block->body;
$html = "";
$i = str_replace(' ', '_', $h) . $salt;
if(!is_null($b)) $html .= "<div id='$i'>$b</div>\n";
return $html;
}
}
?>

View file

@ -1,136 +0,0 @@
var defaultTexts = new Array();
window.onload = function(e) {
var sections=get_sections();
for(var i=0;i<sections.length;i++) toggle(sections[i]);
initGray("search_input", "Search");
initGray("commentBox", "Comment");
initGray("tagBox", "tagme");
// if we're going to show with JS, hide with JS first
pass_confirm = byId("pass_confirm");
if(pass_confirm) {
pass_confirm.style.display = "none";
}
}
function initGray(boxname, text) {
var box = byId(boxname);
if(!box) return;
var clr = function () {cleargray(box, text);};
var set = function () {setgray(box, text);};
addEvent(box, "focus", clr, false);
addEvent(box, "blur", set, false);
if(box.value == text) {
box.style.color = "#999";
box.style.textAlign = "center";
}
else {
box.style.color = "#000";
box.style.textAlign = "left";
}
}
function cleargray(box, text) {
if(box.value == text) {
box.value = "";
box.style.color = "#000";
box.style.textAlign = "left";
}
}
function setgray(box, text) {
if(box.value == "") {
box.style.textAlign = "center";
box.style.color = "gray";
box.value = text;
}
}
function showUp(elem) {
e = document.getElementById(elem)
if(!e) return;
e.style.display = "";
// alert(e.type+": "+e.value);
if(e.value.match(/^http|^ftp/)) {
e.type = "text";
alert("Box is web upload");
}
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* LibShish-JS *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function addEvent(obj, event, func, capture){
if (obj.addEventListener){
obj.addEventListener(event, func, capture);
} else if (obj.attachEvent){
obj.attachEvent("on"+event, func);
}
}
function byId(id) {
return document.getElementById(id);
}
function getHTTPObject() {
if (window.XMLHttpRequest){
return new XMLHttpRequest();
}
else if(window.ActiveXObject){
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
function ajaxRequest(url, callback) {
var http = getHTTPObject();
http.open("GET", url, true);
http.onreadystatechange = function() {
if(http.readyState == 4) callback(http.responseText);
}
http.send(null);
}
/* get, set, and delete cookies */
function getCookie( name ) {
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}
function setCookie( name, value, expires, path, domain, secure ) {
var today = new Date();
today.setTime( today.getTime() );
if ( expires ) {
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name+"="+escape( value ) +
( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + //expires.toGMTString()
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
function deleteCookie( name, path, domain ) {
if ( getCookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

View file

@ -1,83 +0,0 @@
/*
* This script shamelessly stolen from wakachan.org d(^_^)b
*/
var cookie_name="shimmie_sidebar";
var default_sections=["upload", "edit_tags"];
function toggle(id)
{
var e=document.getElementById(id);
if(!e) return;
if(e.style.display)
{
remove_section(id);
e.style.display="";
var e2 = document.getElementById(id+"-toggle");
if(e2) {
e2.style.color = "#000";
}
}
else
{
add_section(id);
e.style.display="none";
var e2 = document.getElementById(id+"-toggle");
if(e2) {
e2.style.color = "#AAA";
}
}
}
function add_section(id)
{
var sections=get_sections();
for(var i=0;i<sections.length;i++) if(sections[i]==id) return;
sections.push(id);
set_sections(sections);
}
function remove_section(id)
{
var sections=get_sections();
var new_sections=new Array();
for(var i=0;i<sections.length;i++) if(sections[i]!=id) new_sections.push(sections[i]);
set_sections(new_sections);
}
function get_sections()
{
var cookie=get_cookie(cookie_name);
if(cookie) return cookie.split(/,/);
else return default_sections;
}
function set_sections(sections) { set_cookie(cookie_name,sections.join(","),365); }
function get_cookie(name)
{
with(document.cookie)
{
var index=indexOf(name+"=");
if(index==-1) return '';
index=indexOf("=",index)+1;
var endstr=indexOf(";",index);
if(endstr==-1) endstr=length;
return unescape(substring(index,endstr));
}
};
function set_cookie(name,value,days)
{
if(days)
{
var date=new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires="; expires="+date.toGMTString();
}
else expires="";
document.cookie=name+"="+value+expires+"; path=/";
}

View file

@ -1,172 +0,0 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* things common to all pages *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
BODY {
background: #EEE;
font-family: "Arial", sans-serif;
font-size: 14px;
}
H1, H3 {
border: 1px solid black;
background: #DDD;
text-align: center;
}
H1 {
margin-top: 0px;
margin-bottom: 0px;
padding: 2px;
}
H1 A {
color: black;
}
H3 {
margin-top: 32px;
padding: 1px;
}
THEAD {
background: #DEDEDE;
font-weight: bold;
}
TD {
vertical-align: top;
text-align: center;
}
#subtitle {
width: 256px;
font-size: 0.75em;
margin: auto;
text-align: center;
border: 1px solid black;
border-top: none;
background: #DDD;
}
#body SELECT {width: 150px;}
TD>INPUT[type="submit"] {width: 100%;}
TD>INPUT[type="text"] {width: 100%;}
TD>INPUT[type="password"] {width: 100%;}
TD>SELECT {width: 100%;}
#footer {
clear: both;
padding-top: 8px;
font-size: 0.7em;
text-align: center;
}
*[onclick] {cursor: pointer;}
IMG {border: none;}
FORM {margin: 0px;}
A {text-decoration: none;}
A:hover {text-decoration: underline;}
BLOCKQUOTE {
border: 1px solid black;
padding: 8px;
background: #DDD;
}
UL {
text-align: left;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* the navigation bar, and all its blocks *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#nav {
width: 150px;
float: left;
text-align: center;
font-size: 0.9em;
}
#nav TABLE {
width: 150px;
}
#nav TD {
vertical-align: middle;
}
#nav INPUT {
width: 100%;
padding: 0px;
}
#nav SELECT {
width: 100%;
padding: 0px;
}
#comments P {
text-align: left;
width: 150px;
max-width: 150px;
overflow: hidden;
}
.more:after {
content: " >>>";
}
.tag_count:before {
content: "(";
}
.tag_count:after {
content: ")";
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* the main part of each page *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#body {
margin-left: 160px;
text-align: center;
height: 1%;
}
#body TABLE {
width: 90%;
margin: auto;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* specific page types *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#pagelist {
margin-top: 32px;
}
#tagmap A {
padding: 8px 4px 8px 4px;
}
.comment {
text-align: left;
}
.setupblock {
border: 1px solid #AAA;
padding: 8px;
margin: 16px;
width: 350px;
}
.helpable {
border-bottom: 1px dashed gray;
}
.ok {
background: #AFA;
}
.bad {
background: #FAA;
}
.thumb {
width: 220px;
display: inline-block;
margin-bottom: 16px;
}

View file

@ -1,89 +0,0 @@
<?php
class Themelet {
/**
* Generic error message display
*/
public function display_error(Page $page, $title, $message) {
$page->set_title($title);
$page->set_heading($title);
$page->add_block(new NavBlock());
$page->add_block(new Block("Error", $message));
}
/**
* A specific, common error message
*/
public function display_permission_denied(Page $page) {
header("HTTP/1.0 403 Permission Denied");
$this->display_error($page, "Permission Denied", "You do not have permission to access this page");
}
/**
* Generic thumbnail code; returns HTML rather than adding
* a block since thumbs tend to go inside blocks...
*/
public function build_thumb_html(Image $image, $query=null) {
global $config;
$i_id = int_escape($image->id);
$h_view_link = make_link("post/view/$i_id", $query);
$h_tip = html_escape($image->get_tooltip());
$h_thumb_link = $image->get_thumb_link();
$tsize = get_thumbnail_size($image->width, $image->height);
return "<a class='thumb' href='$h_view_link'><img id='$i_id' title='$h_tip' alt='$h_tip' ".
"width='{$tsize[0]}' height='{$tsize[1]}' src='$h_thumb_link' /></a>";
}
/**
* Add a generic paginator
*/
public function display_paginator(Page $page, $base, $query, $page_number, $total_pages) {
if($total_pages == 0) $total_pages = 1;
$body = $this->build_paginator($page_number, $total_pages, $base, $query);
$page->add_block(new Block(null, $body, "main", 90));
}
private function gen_page_link($base_url, $query, $page, $name) {
$link = make_link("$base_url/$page", $query);
return "<a href='$link'>$name</a>";
}
private function gen_page_link_block($base_url, $query, $page, $current_page, $name) {
$paginator = "";
if($page == $current_page) $paginator .= "<b>";
$paginator .= $this->gen_page_link($base_url, $query, $page, $name);
if($page == $current_page) $paginator .= "</b>";
return $paginator;
}
private function build_paginator($current_page, $total_pages, $base_url, $query) {
$next = $current_page + 1;
$prev = $current_page - 1;
$rand = rand(1, $total_pages);
$at_start = ($current_page <= 1 || $total_pages <= 1);
$at_end = ($current_page >= $total_pages);
$first_html = $at_start ? "First" : $this->gen_page_link($base_url, $query, 1, "First");
$prev_html = $at_start ? "Prev" : $this->gen_page_link($base_url, $query, $prev, "Prev");
$random_html = $this->gen_page_link($base_url, $query, $rand, "Random");
$next_html = $at_end ? "Next" : $this->gen_page_link($base_url, $query, $next, "Next");
$last_html = $at_end ? "Last" : $this->gen_page_link($base_url, $query, $total_pages, "Last");
$start = $current_page-5 > 1 ? $current_page-5 : 1;
$end = $start+10 < $total_pages ? $start+10 : $total_pages;
$pages = array();
foreach(range($start, $end) as $i) {
$pages[] = $this->gen_page_link_block($base_url, $query, $i, $current_page, $i);
}
$pages_html = implode(" | ", $pages);
return "<p class='paginator'>$first_html | $prev_html | $random_html | $next_html | $last_html".
"<br>&lt;&lt; $pages_html &gt;&gt;</p>";
}
}
?>