Skip to content

Commit

Permalink
feature: forum spoiler tag support
Browse files Browse the repository at this point in the history
  • Loading branch information
ccbrown committed Mar 11, 2017
1 parent 0b33180 commit 391b341
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/index_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var index = `<!DOCTYPE html><html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>GGG Tracker</title>
<link rel="shortcut icon" href="static/favicon.ico" />
<link rel="stylesheet" type="text/css" href="static/style.css" />
<link rel="stylesheet" type="text/css" href="static/style.css?v2" />
<link rel="alternate" type="application/rss+xml" title="GGG Tracker Forum Feed" href="rss" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
Expand Down Expand Up @@ -63,7 +63,7 @@ var index = `<!DOCTYPE html><html>
</footer>
</div>
<script src="static/index.js?v3"></script>
<script src="static/index.js?v4"></script>
</body>
</html>`

Expand Down
21 changes: 18 additions & 3 deletions server/static/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
var currentPage = undefined
var currentPage = undefined;

var POE = {
Forum: {
SpoilerClick: function(element) {
var $spoiler = $(element).closest('.spoiler');
if ($spoiler.hasClass('spoilerHidden')) {
$(element).val("Hide");
$spoiler.removeClass('spoilerHidden');
} else {
$(element).val("Show");
$spoiler.addClass('spoilerHidden');
}
},
},
};

function loadActivity() {
var page = location.hash.replace(/^#page=/, '');
if (currentPage !== undefined && page == currentPage) {
return;
}
var previousPage = currentPage
currentPage = page
var previousPage = currentPage;
currentPage = page;

$.get('activity.json?next=' + page, function(data) {
var $tbody = $('#activity-table tbody');
Expand Down
26 changes: 26 additions & 0 deletions server/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,29 @@ td.body blockquote {
margin: 1.5em 10px;
padding: 0.5em 10px;
}

.spoilerHidden .spoilerContent {
display: none;
}

.spoilerTitle input[type="button"] {
margin-left: 8px;
color: #c9ba8a;
background-color: #0f0f0f;
border: 0;
cursor: pointer;
text-decoration: none;
}

.spoilerTitle input[type="button"]:hover {
text-decoration: underline;
}

.spoiler {
border: 1px solid #1a1a1a;
background-color: #323232;
}

.spoilerTitle, .spoilerContent {
padding: 8px;
}

0 comments on commit 391b341

Please sign in to comment.