save bytes

This commit is contained in:
Azareal 2020-03-11 19:28:00 +10:00
parent e19e478e32
commit c7c3dcead2
15 changed files with 33 additions and 34 deletions

View File

@ -428,7 +428,7 @@ function mainInit(){
ev.preventDefault(); ev.preventDefault();
//$(this).unbind("click"); //$(this).unbind("click");
let target = this.closest("a").getAttribute("href"); let target = this.closest("a").getAttribute("href");
console.log("target", target); console.log("target",target);
let controls = this.closest(".controls"); let controls = this.closest(".controls");
let hadLikes = controls.classList.contains("has_likes"); let hadLikes = controls.classList.contains("has_likes");
@ -570,7 +570,7 @@ function mainInit(){
$(".topic_list_title h1").text(that.innerText); $(".topic_list_title h1").text(that.innerText);
}).catch(ex => { }).catch(ex => {
console.log("Unable to get script '"+url+"&js=1"+"'"); console.log("Unable to get script '"+url+"&js=1"+"'");
console.log("ex", ex); console.log("ex",ex);
console.trace(); console.trace();
}); });
}); });
@ -580,7 +580,7 @@ function mainInit(){
// TODO: Show a search button when JS is disabled? // TODO: Show a search button when JS is disabled?
$(".widget_search_input").keypress(function(e) { $(".widget_search_input").keypress(function(e) {
if (e.keyCode != '13') return; if(e.keyCode!='13') return;
event.preventDefault(); event.preventDefault();
// TODO: Take mostviewed into account // TODO: Take mostviewed into account
let url = "//"+window.location.host+window.location.pathname; let url = "//"+window.location.host+window.location.pathname;
@ -615,7 +615,7 @@ function mainInit(){
rebindPaginator(); rebindPaginator();
}).catch(ex => { }).catch(ex => {
console.log("Unable to get script '"+url+q+"&js=1"+"'"); console.log("Unable to get script '"+url+q+"&js=1"+"'");
console.log("ex", ex); console.log("ex",ex);
console.trace(); console.trace();
}); });
}); });
@ -648,7 +648,7 @@ function mainInit(){
$(".edit_fields").click(function(ev) { $(".edit_fields").click(function(ev) {
ev.preventDefault(); ev.preventDefault();
if($(this).find("input").length !== 0) return; if($(this).find("input").length!==0) return;
//console.log("clicked .edit_fields"); //console.log("clicked .edit_fields");
var blockParent = $(this).closest('.editable_parent'); var blockParent = $(this).closest('.editable_parent');
blockParent.find('.hide_on_edit').addClass("edit_opened"); blockParent.find('.hide_on_edit').addClass("edit_opened");
@ -796,7 +796,7 @@ function mainInit(){
console.log("date", date); console.log("date", date);
let day = "0" + date.getDate(); let day = "0" + date.getDate();
let formattedTime = monthList[date.getMonth()] + " " + day.substr(-2) + " " + date.getFullYear(); let formattedTime = monthList[date.getMonth()] + " " + day.substr(-2) + " " + date.getFullYear();
console.log("formattedTime", formattedTime); console.log("formattedTime",formattedTime);
this.innerText = formattedTime; this.innerText = formattedTime;
}); });
@ -833,8 +833,8 @@ function mainInit(){
} }
$("#poll_results_"+pollID+" .user_content").html("<div id='poll_results_chart_"+pollID+"'></div>"); $("#poll_results_"+pollID+" .user_content").html("<div id='poll_results_chart_"+pollID+"'></div>");
console.log("rawData", rawData); console.log("rawData",rawData);
console.log("series", data); console.log("series",data);
Chartist.Pie('#poll_results_chart_'+pollID, { Chartist.Pie('#poll_results_chart_'+pollID, {
series: data, series: data,
}, { }, {
@ -903,8 +903,8 @@ function bindTopic() {
$.ajax({ $.ajax({
url: this.form.getAttribute("action"), url: this.form.getAttribute("action"),
type: "POST", type:"POST",
dataType: "json", dataType:"json",
data: { data: {
name: nameInput, name: nameInput,
status: statusInput, status: statusInput,
@ -993,7 +993,7 @@ function bindTopic() {
console.log("content.value", content.value); console.log("content.value", content.value);
let item; let item;
if(content.value == "") item = "<blockquote>" + src.innerHTML + "</blockquote>" if(content.value=="") item = "<blockquote>" + src.innerHTML + "</blockquote>"
else item = "\r\n<blockquote>" + src.innerHTML + "</blockquote>"; else item = "\r\n<blockquote>" + src.innerHTML + "</blockquote>";
content.value = content.value + item; content.value = content.value + item;
console.log("content.value", content.value); console.log("content.value", content.value);

View File

@ -6,7 +6,7 @@
{{range .ItemList}} {{range .ItemList}}
<div class="rowitem{{if not .Success}} bg_red{{end}}"> <div class="rowitem{{if not .Success}} bg_red{{end}}">
<span class="to_left"> <span class="to_left">
<span>{{if .Success}}{{lang "account_logins_success"}}{{else}}{{lang "account_logins_failure"}}"{{end}}</span><br /> <span>{{if .Success}}{{lang "account_logins_success"}}{{else}}{{lang "account_logins_failure"}}"{{end}}</span><br>
<small title="{{.IP}}">{{.IP}}</small> <small title="{{.IP}}">{{.IP}}</small>
</span> </span>
<span class="to_right"> <span class="to_right">

View File

@ -4,7 +4,7 @@
<div class="rowitem"><h1>{{lang "areyousure_head"}}</h1></div> <div class="rowitem"><h1>{{lang "areyousure_head"}}</h1></div>
</div> </div>
<div class="rowblock"> <div class="rowblock">
<div class="rowitem passive rowmsg">{{.Something.Message}}<br /><br /> <div class="rowitem passive rowmsg">{{.Something.Message}}<br><br>
<a class="username" href="{{.Something.URL}}?s={{.CurrentUser.Session}}">{{lang "areyousure_continue"}}</a> <a class="username" href="{{.Something.URL}}?s={{.CurrentUser.Session}}">{{lang "areyousure_continue"}}</a>
</div> </div>
</div> </div>

View File

@ -50,10 +50,10 @@
{{range .ItemList}}<div class="topic_row{{if .Sticky}} topic_sticky{{else if .IsClosed}} topic_closed{{end}}" data-tid="{{.ID}}"> {{range .ItemList}}<div class="topic_row{{if .Sticky}} topic_sticky{{else if .IsClosed}} topic_closed{{end}}" data-tid="{{.ID}}">
<div class="rowitem topic_left passive datarow"> <div class="rowitem topic_left passive datarow">
<span class="selector"></span> <span class="selector"></span>
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar" title="{{.Creator.Name}}'s Avatar" aria-hidden="true"/></a> <a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar"title="{{.Creator.Name}}'s Avatar"aria-hidden="true"/></a>
<span class="topic_inner_left"> <span class="topic_inner_left">
<a class="rowtopic" href="{{.Link}}" itemprop="itemListElement" title="{{.Title}}"><span>{{.Title}}</span></a> <a class="rowtopic" href="{{.Link}}" itemprop="itemListElement" title="{{.Title}}"><span>{{.Title}}</span></a>
<br /><a class="rowsmall starter" href="{{.Creator.Link}}" title="{{.Creator.Name}}">{{.Creator.Name}}</a> <br><a class="rowsmall starter" href="{{.Creator.Link}}" title="{{.Creator.Name}}">{{.Creator.Name}}</a>
{{/** TODO: Avoid the double '|' when both .IsClosed and .Sticky are set to true. We could probably do this with CSS **/}} {{/** TODO: Avoid the double '|' when both .IsClosed and .Sticky are set to true. We could probably do this with CSS **/}}
{{if .IsClosed}}<span class="rowsmall topic_status_e topic_status_closed" title="{{lang "status.closed_tooltip"}}"> | &#x1F512;&#xFE0E</span>{{end}} {{if .IsClosed}}<span class="rowsmall topic_status_e topic_status_closed" title="{{lang "status.closed_tooltip"}}"> | &#x1F512;&#xFE0E</span>{{end}}
{{if .Sticky}}<span class="rowsmall topic_status_e topic_status_sticky" title="{{lang "status.pinned_tooltip"}}"> | &#x1F4CD;&#xFE0E</span>{{end}} {{if .Sticky}}<span class="rowsmall topic_status_e topic_status_sticky" title="{{lang "status.pinned_tooltip"}}"> | &#x1F4CD;&#xFE0E</span>{{end}}

View File

@ -51,7 +51,7 @@
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar" title="{{.Creator.Name}}'s Avatar" aria-hidden="true"/></a> <a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar" title="{{.Creator.Name}}'s Avatar" aria-hidden="true"/></a>
<span class="topic_inner_left"> <span class="topic_inner_left">
<a class="rowtopic" href="{{.Link}}" itemprop="itemListElement" title="{{.Title}}"><span>{{.Title}}</span></a> <a class="rowtopic" href="{{.Link}}" itemprop="itemListElement" title="{{.Title}}"><span>{{.Title}}</span></a>
<br /><a class="rowsmall starter" href="{{.Creator.Link}}" title="{{.Creator.Name}}">{{.Creator.Name}}</a> <br><a class="rowsmall starter" href="{{.Creator.Link}}" title="{{.Creator.Name}}">{{.Creator.Name}}</a>
</span> </span>
</div>--> </div>-->
<!--<div class="topic_middle"> <!--<div class="topic_middle">

View File

@ -8,7 +8,7 @@
{{range .ItemList}}<div id="forum_{{.ID}}" class="rowitem{{if (.Desc) or (.LastTopic.Title)}} datarow{{end}}" itemprop="itemListElement" itemscope {{range .ItemList}}<div id="forum_{{.ID}}" class="rowitem{{if (.Desc) or (.LastTopic.Title)}} datarow{{end}}" itemprop="itemListElement" itemscope
itemtype="http://schema.org/ListItem"> itemtype="http://schema.org/ListItem">
<span class="forum_left shift_left"> <span class="forum_left shift_left">
<a href="{{.Link}}" itemprop="item">{{.Name}}</a><br /> <a href="{{.Link}}"itemprop="item">{{.Name}}</a><br>
{{if .Desc}} {{if .Desc}}
<span class="rowsmall" itemprop="description">{{.Desc}}</span> <span class="rowsmall" itemprop="description">{{.Desc}}</span>
{{else}} {{else}}
@ -16,13 +16,12 @@
{{end}} {{end}}
</span> </span>
<span class="forum_right shift_right"> <span class="forum_right shift_right">
{{if .LastReplyer.MicroAvatar}}<img class="extra_little_row_avatar" src="{{.LastReplyer.MicroAvatar}}" height=64 width=64 alt="Avatar" title="{{.LastReplyer.Name}}'s Avatar" aria-hidden="true" />{{end}} {{if .LastReplyer.MicroAvatar}}<img class="extra_little_row_avatar" src="{{.LastReplyer.MicroAvatar}}" height=64 width=64 alt="Avatar" title="{{.LastReplyer.Name}}'s Avatar" aria-hidden="true"/>{{end}}
<span> <span>
<a {{if .LastTopic.Link}}href="{{.LastTopic.Link}}"{{else}}class="forum_no_poster"{{end}}>{{if .LastTopic.Title}}{{.LastTopic.Title}}{{else}}{{lang "forums_none"}}{{end}}</a> <a {{if .LastTopic.Link}}href="{{.LastTopic.Link}}"{{else}}class="forum_no_poster"{{end}}>{{if .LastTopic.Title}}{{.LastTopic.Title}}{{else}}{{lang "forums_none"}}{{end}}</a>
{{if .LastTopicTime}}<br /><span class="rowsmall" title="{{abstime .LastTopic.LastReplyAt}}">{{.LastTopicTime}}</span>{{end}} {{if .LastTopicTime}}<br><span class="rowsmall" title="{{abstime .LastTopic.LastReplyAt}}">{{.LastTopicTime}}</span>{{end}}
</span> </span>
</span> </span><div style="clear:both;"></div>
<div style="clear:both;"></div>
</div> </div>
{{else}}<div class="rowitem passive rowmsg">{{lang "forums_no_forums"}}</div>{{end}} {{else}}<div class="rowitem passive rowmsg">{{lang "forums_no_forums"}}</div>{{end}}
</div> </div>

View File

@ -7,11 +7,11 @@
{{range .GuildList}}<div class="rowitem datarow"> {{range .GuildList}}<div class="rowitem datarow">
<span style="float:left;"> <span style="float:left;">
<a href="{{.Link}}" style="">{{.Name}}</a> <a href="{{.Link}}" style="">{{.Name}}</a>
<br /><span class="rowsmall">{{.Desc}}</span> <br><span class="rowsmall">{{.Desc}}</span>
</span> </span>
<span style="float:right;"> <span style="float:right;">
<span style="float:right;font-size:14px;">{{.MemberCount}} members</span> <span style="float:right;font-size:14px;">{{.MemberCount}} members</span>
<br /><span class="rowsmall">{{.LastUpdateTime}}</span> <br><span class="rowsmall">{{.LastUpdateTime}}</span>
</span> </span>
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>

View File

@ -21,13 +21,13 @@
<main id="socialgroups_member_list" class="rowblock member_list" style="position:relative;z-index:50;"> <main id="socialgroups_member_list" class="rowblock member_list" style="position:relative;z-index:50;">
{{range .ItemList}}<div class="rowitem passive datarow" style="background-image:url({{.User.Avatar}});background-position:left;background-repeat:no-repeat;background-size:64px;padding-left:78px;{{if .Offline}}background-color:#eaeaea;{{else if gt .Rank 0}}background-color:#e6f3ff;{{end}}"> {{range .ItemList}}<div class="rowitem passive datarow" style="background-image:url({{.User.Avatar}});background-position:left;background-repeat:no-repeat;background-size:64px;padding-left:78px;{{if .Offline}}background-color:#eaeaea;{{else if gt .Rank 0}}background-color:#e6f3ff;{{end}}">
<span style="float:right;"> <span style="float:right;">
<span class="rank" style="font-size:15px;">{{.RankString}}</span><br /> <span class="rank" style="font-size:15px;">{{.RankString}}</span><br>
<span class="joinedAt rowsmall">{{.JoinedAt}}</span> <span class="joinedAt rowsmall">{{.JoinedAt}}</span>
</span> </span>
<span> <span>
<a class="rowtopic" href="{{.Link}}">{{.User.Name}}</a> <a class="rowtopic" href="{{.Link}}">{{.User.Name}}</a>
{{/** Use this for badges instead of rank? Both? Guild Titles? **/}} {{/** Use this for badges instead of rank? Both? Guild Titles? **/}}
<br /><span class="rowsmall postCount">{{.PostCount}} posts</span> <br><span class="rowsmall postCount">{{.PostCount}} posts</span>
</span> </span>
</div> </div>
{{end}} {{end}}

View File

@ -21,12 +21,12 @@
<main id="forum_topic_list" class="rowblock topic_list" style="position:relative;z-index:50;"> <main id="forum_topic_list" class="rowblock topic_list" style="position:relative;z-index:50;">
{{range .ItemList}}<div class="rowitem topic_left passive datarow" style="background-image:url({{.Creator.Avatar}});background-position:left;background-repeat:no-repeat;background-size:64px;padding-left:72px;{{if .Sticky}}background-color:#FFFFCC;{{else if .IsClosed}}background-color:#eaeaea;{{end}}"> {{range .ItemList}}<div class="rowitem topic_left passive datarow" style="background-image:url({{.Creator.Avatar}});background-position:left;background-repeat:no-repeat;background-size:64px;padding-left:72px;{{if .Sticky}}background-color:#FFFFCC;{{else if .IsClosed}}background-color:#eaeaea;{{end}}">
<span class="topic_inner_right rowsmall" style="float:right;"> <span class="topic_inner_right rowsmall" style="float:right;">
<span class="replyCount">{{.PostCount}} replies</span><br /> <span class="replyCount">{{.PostCount}} replies</span><br>
<span class="lastReplyAt">{{.LastReplyAt}}</span> <span class="lastReplyAt">{{.LastReplyAt}}</span>
</span> </span>
<span> <span>
<a class="rowtopic" href="{{.Link}}">{{.Title}}</a> <a class="rowtopic" href="{{.Link}}">{{.Title}}</a>
<br /><a class="rowsmall" href="{{.Creator.Link}}">Starter: {{.Creator.Name}}</a> <br><a class="rowsmall" href="{{.Creator.Link}}">Starter: {{.Creator.Name}}</a>
{{if .IsClosed}}<span class="rowsmall topic_status_e topic_status_closed" title="{{lang "status.closed_tooltip"}}"> | &#x1F512;&#xFE0E{{end}}</span> {{if .IsClosed}}<span class="rowsmall topic_status_e topic_status_closed" title="{{lang "status.closed_tooltip"}}"> | &#x1F512;&#xFE0E{{end}}</span>
</span> </span>
</div> </div>

View File

@ -6,7 +6,7 @@
<div class="rowitem panel_compactrow"> <div class="rowitem panel_compactrow">
<span class="to_left"> <span class="to_left">
<span>{{.Action}}</span> <span>{{.Action}}</span>
{{if $.CurrentUser.Perms.ViewIPs}}<br /><small title="{{.IP}}">{{.IP}}</small>{{end}} {{if $.CurrentUser.Perms.ViewIPs}}<br><small title="{{.IP}}">{{.IP}}</small>{{end}}
</span> </span>
<span class="to_right"> <span class="to_right">
<span title="{{.DoneAt}}">{{.DoneAt}}</span> <span title="{{.DoneAt}}">{{.DoneAt}}</span>

View File

@ -7,7 +7,7 @@
<div class="rowitem"><h1>{{lang "areyousure_head"}}</h1></div> <div class="rowitem"><h1>{{lang "areyousure_head"}}</h1></div>
</div> </div>
<div class="colstack_item"> <div class="colstack_item">
<div class="rowitem passive rowmsg">{{.Something.Message}}<br /><br /> <div class="rowitem passive rowmsg">{{.Something.Message}}<br><br>
<a class="username" href="{{.Something.URL}}?s={{.CurrentUser.Session}}">{{lang "areyousure_continue"}}</a> <a class="username" href="{{.Something.URL}}?s={{.CurrentUser.Session}}">{{lang "areyousure_continue"}}</a>
</div> </div>
</div> </div>

View File

@ -11,7 +11,7 @@
<span id="panel_forums_left_box"> <span id="panel_forums_left_box">
{{/** TODO: Make sure the forum_active_name class is set and unset when the activity status of this forum is changed **/}} {{/** TODO: Make sure the forum_active_name class is set and unset when the activity status of this forum is changed **/}}
<a data-field="forum_name" data-type="text" class="editable_block forum_name{{if not .Active}} forum_active_name{{end}}">{{.Name}}</a> <a data-field="forum_name" data-type="text" class="editable_block forum_name{{if not .Active}} forum_active_name{{end}}">{{.Name}}</a>
<br /><span data-field="forum_desc" data-type="text" class="editable_block forum_desc rowsmall">{{.Desc}}</span> <br><span data-field="forum_desc" data-type="text" class="editable_block forum_desc rowsmall">{{.Desc}}</span>
</span> </span>
<span class="panel_floater"> <span class="panel_floater">
<span data-field="forum_active" data-type="list" class="panel_tag editable_block forum_active forum_active_{{if .Active}}Show" data-value="1{{else}}Hide" data-value="0{{end}}" title="{{lang "panel.forums_hidden"}}"></span> <span data-field="forum_active" data-type="list" class="panel_tag editable_block forum_active forum_active_{{if .Active}}Show" data-value="1{{else}}Hide" data-value="0{{end}}" title="{{lang "panel.forums_hidden"}}"></span>

View File

@ -6,7 +6,7 @@
<div class="rowitem panel_compactrow"> <div class="rowitem panel_compactrow">
<span class="to_left"> <span class="to_left">
<span>{{.Action}}</span> <span>{{.Action}}</span>
{{if $.CurrentUser.Perms.ViewIPs}}<br /><small title="{{.IP}}">{{.IP}}</small>{{end}} {{if $.CurrentUser.Perms.ViewIPs}}<br><small title="{{.IP}}">{{.IP}}</small>{{end}}
</span> </span>
<span class="to_right"> <span class="to_right">
<span title="{{.DoneAt}}">{{.DoneAt}}</span> <span title="{{.DoneAt}}">{{.DoneAt}}</span>

View File

@ -5,7 +5,7 @@
{{range .ItemList}} {{range .ItemList}}
<div class="rowitem editable_parent"> <div class="rowitem editable_parent">
<span class="panel_plugin_meta"> <span class="panel_plugin_meta">
<a{{if .URL}} href="{{.URL}}" {{end}}class="editable_block" class="panel_upshift">{{.Name}}</a><br /> <a{{if .URL}} href="{{.URL}}" {{end}}class="editable_block" class="panel_upshift">{{.Name}}</a><br>
<small style="margin-left:2px;">{{lang "panel_plugins_author_prefix"}}{{.Author}}</small> <small style="margin-left:2px;">{{lang "panel_plugins_author_prefix"}}{{.Author}}</small>
</span> </span>
<span class="to_right"> <span class="to_right">

View File

@ -5,7 +5,7 @@
{{range .PrimaryThemes}} {{range .PrimaryThemes}}
<div class="theme_row rowitem editable_parent"{{if .FullImage}} style="background-image:url('/s/{{.FullImage}}');background-position:center;background-size:50%;background-repeat:no-repeat;"{{end}}> <div class="theme_row rowitem editable_parent"{{if .FullImage}} style="background-image:url('/s/{{.FullImage}}');background-position:center;background-size:50%;background-repeat:no-repeat;"{{end}}>
<span style="float:left;"> <span style="float:left;">
<a href="/panel/themes/{{.Name}}" class="editable_block" style="font-size:17px;">{{.FriendlyName}}</a><br /> <a href="/panel/themes/{{.Name}}" class="editable_block" style="font-size:17px;">{{.FriendlyName}}</a><br>
<small class="panel_theme_author" style="margin-left:2px;">{{lang "panel_themes_author_prefix"}}<a href="//{{.URL}}">{{.Creator}}</a></small> <small class="panel_theme_author" style="margin-left:2px;">{{lang "panel_themes_author_prefix"}}<a href="//{{.URL}}">{{.Creator}}</a></small>
</span> </span>
<span class="panel_floater"> <span class="panel_floater">
@ -24,7 +24,7 @@
{{range .VariantThemes}} {{range .VariantThemes}}
<div class="theme_row rowitem editable_parent"{{if .FullImage}} style="background-image:url('/s/{{.FullImage}}');background-position:center;background-size:50%;background-repeat:no-repeat;"{{end}}> <div class="theme_row rowitem editable_parent"{{if .FullImage}} style="background-image:url('/s/{{.FullImage}}');background-position:center;background-size:50%;background-repeat:no-repeat;"{{end}}>
<span style="float:left;"> <span style="float:left;">
<a href="/panel/themes/{{.Name}}" class="editable_block" style="font-size:17px;">{{.FriendlyName}}</a><br /> <a href="/panel/themes/{{.Name}}" class="editable_block" style="font-size:17px;">{{.FriendlyName}}</a><br>
<small class="panel_theme_author" style="margin-left:2px;">{{lang "panel_themes_author_prefix"}}<a href="//{{.URL}}">{{.Creator}}</a></small> <small class="panel_theme_author" style="margin-left:2px;">{{lang "panel_themes_author_prefix"}}<a href="//{{.URL}}">{{.Creator}}</a></small>
</span> </span>
<span class="panel_floater"> <span class="panel_floater">