* Continued work on improving post view templates

* Added statistics-based estimator for related tag calculator
* Fleshed out IpBan class based on changes to Danbooru 1.xx
This commit is contained in:
albert
2010-04-29 17:32:15 -04:00
parent 3666364469
commit 23656e3fa9
39 changed files with 816 additions and 86 deletions

BIN
public/images/arrow2_n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

BIN
public/images/arrow2_s.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

View File

@@ -0,0 +1,79 @@
// Cookie.setup();
$(document).ready(function() {
// $("#hide-upgrade-account-link").click(function() {
// $("#upgrade-account").hide();
// Cookie.put('hide-upgrade-account', '1', 7);
// });
// Comment listing
$(".comment-section form").hide();
$(".comment-section input.expand-comment-response").click(function() {
var post_id = $(this).closest(".comment-section").attr("data-post-id");
$(".comment-section[data-post-id=" + post_id + "] form").show();
$(this).hide();
})
});
var Danbooru = {};
// ContextMenu
Danbooru.ContextMenu = {};
Danbooru.ContextMenu.add_icon = function() {
$("menu[type=context] > li").append('<img src="/images/arrow2_s.png">');
}
Danbooru.ContextMenu.toggle_icon = function(li) {
if (li == null) {
$("menu[type=context] > li > img").attr("src", "/images/arrow2_s.png");
} else {
$(li).find("img").attr("src", function() {
if (this.src.match(/_n/)) {
return "/images/arrow2_s.png";
} else {
return "/images/arrow2_n.png";
}
});
}
}
Danbooru.ContextMenu.setup = function() {
$("menu[type=context] li").hover(
function() {$(this).css({"background-color": "#F6F6F6"})},
function() {$(this).css({"background-color": "#EEE"})}
);
this.add_icon();
$("menu[type=context] > li").click(function(e) {
$(this).parent().find("ul").toggle();
e.stopPropagation();
Danbooru.ContextMenu.toggle_icon(this);
});
$(document).click(function() {
$("menu[type=context] > ul").hide();
Danbooru.ContextMenu.toggle_icon();
});
$("menu[type=context] > ul > li").click(function(element) {
$(this).closest("ul").toggle();
var text = $(this).text()
var menu = $(this).closest("menu");
menu.children("li").text(text);
if (menu.attr("data-update-field-id")) {
$("#" + menu.attr("data-update-field-id")).val(text);
Danbooru.ContextMenu.add_icon();
}
if (menu.attr("data-submit-on-change") == "true") {
menu.closest("form").submit();
}
});
}
$(document).ready(function() {
Danbooru.ContextMenu.setup();
});

View File

@@ -1,8 +0,0 @@
Cookie.setup();
$(document).ready(function() {
$("#hide-upgrade-account-link").click(function() {
$("#upgrade-account").hide();
Cookie.put('hide-upgrade-account', '1', 7);
});
});

View File

@@ -1,3 +0,0 @@
.blacklisted {
display: none !important;
}

View File

@@ -0,0 +1,259 @@
.blacklisted {
display: none !important;
}
body, div, h1, h2, h3, h4, h5, h6, p, ul, li, dd, dt {
font-family: verdana, sans-serif;
font-size: 100%;
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
}
h1, h2, h3, h4 {
font-family: Tahoma;
line-height: 1em;
}
body {
font-size: 80%;
padding: 1em 2em;
margin: 0;
}
article, section {
display: block;
}
a:link {
color: #006FFA;
text-decoration: none;
}
a:visited {
color: #006FFA;
text-decoration: none;
}
a:hover {
color: #9093FF;
text-decoration: none;
}
a:active {
color: #006FFA;
text-decoration: none;
}
addr {
display: block;
margin-left: 2em;
font-weight: bold;
}
blockquote {
margin: 0 0 1em 0;
padding: 1em;
border: 1px solid #666;
background: #EEE;
}
code {
font-family: monospace;
font-size: 1.2em;
}
dd {
margin-bottom: 1em;
}
dt {
font-weight: bold;
}
h1 {
font-size: 2em;
}
h2 {
font-size: 1.8em;
}
h3 {
font-size: 1.6em;
}
h4 {
font-size: 1.4em;
}
h5 {
font-size: 1.2em;
}
h6 {
font-size: 1em;
}
header {
margin: 0 0 1em 0;
padding: 0;
display: block;
}
img {
border: none;
vertical-align: middle;
}
input[type=text], input[type=password], textarea, button {
border: 1px solid #AAA;
font-size: 1em;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
input[type=submit] {
padding: 1px 4px;
border: 1px solid #AAA;
background-color: #EEE;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
font-size: 1em;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #F6F6F6;
}
menu {
margin: 0;
padding: 0;
}
menu ul {
margin: 0;
padding: 0;
}
menu li {
margin: 0 1em 0 0;
padding: 0;
list-style-type: none;
display: inline;
}
section {
display: block;
}
span.link {
color: #006FFA;
cursor: pointer;
}
div#content > aside {
width: 25%;
float: left;
}
div#content > aside > section {
margin-bottom: 2em;
}
div#content > section {
width: 75%;
float: left;
}
div.clearfix {
clear: both;
/* border: 1px solid red;*/
}
/*** Context Menu ***/
menu[type=context] {
width: 200px;
cursor: pointer;
}
menu[type=context] li {
list-style: none;
padding: 0px 4px;
}
menu[type=context] > li {
border: 1px solid #333;
-moz-border-radius: 3px;
background-color: #EEE;
}
menu[type=context] > li > img {
float: right;
padding-top: 2px;
}
menu[type=context] > ul {
width: 198px;
margin: 0;
padding: 0;
border: 1px solid #333;
background: #EEE;
-moz-border-radius: 3px;
margin-top: -1px;
display: none;
position: absolute;
}
menu[type=context] > ul li {
cursor: pointer;
}
/*** Header ***/
body > header > h1 {
font-size: 3em;
font-family: Tahoma, Helvetica, sans-serif;
}
/*** Sidebar ***/
aside.sidebar > section > h1 {
font-size: 1.5em;
}
aside.sidebar > section > ul > li {
list-style-type: none;
}
/*** Comments ***/
div.comment-response {
}
div.comment-response > div {
margin-top: 1em;
}
div.comment-list {
}
div.comment-list > article {
margin-bottom: 1em;
display: block;
}
div.comment-list > article > header {
float: left;
width: 15em;
}
div.comment-list > article > div {
float: left;
width: 40em;
}