Try hash based cache busting with stylesheets too.
Use a semantic blockquote element instead of span in plugin_bbcode for [quote] You can now use <blockquote> elements directly in posts. Added styling for quotes to Shadow, Cosora and Nox. Experimenting with the padding on Nox's Control Panel Menu. Tweaked the padding for the User Manager items on Nox. Fixed #back filling up all the space it can on Tempra Simple. Added a bit of padding below the last element before the footer on Tempra Simple. Tempra Simple's misc.js is now loaded asynchronously. Shadow's misc.js is now loaded asynchronously. profile_member.js is now loaded asynchronously. account.js is now loaded asynchronously.
This commit is contained in:
parent
660f24acff
commit
23a0bf3f41
|
@ -25,7 +25,7 @@ type Header struct {
|
|||
PreScriptsAsync []HResource
|
||||
ScriptsAsync []HResource
|
||||
//Preload []string
|
||||
Stylesheets []string
|
||||
Stylesheets []HResource
|
||||
Widgets PageWidgets
|
||||
Site *site
|
||||
Settings SettingMap
|
||||
|
@ -92,7 +92,15 @@ func (header *Header) AddScriptAsync(name string) {
|
|||
}*/
|
||||
|
||||
func (header *Header) AddSheet(name string) {
|
||||
header.Stylesheets = append(header.Stylesheets, name)
|
||||
fname := "/static/" + name
|
||||
var hash string
|
||||
if fname[0] == '/' && fname[1] != '/' {
|
||||
file, ok := StaticFiles.Get(fname)
|
||||
if ok {
|
||||
hash = file.Sha256
|
||||
}
|
||||
}
|
||||
header.Stylesheets = append(header.Stylesheets, HResource{name, hash})
|
||||
}
|
||||
|
||||
func (header *Header) AddNotice(name string) {
|
||||
|
|
|
@ -217,7 +217,7 @@ func PreparseMessage(msg string) string {
|
|||
's': []string{"", "trong", "pan"},
|
||||
'd': []string{"el"},
|
||||
'u': []string{""},
|
||||
'b': []string{""},
|
||||
'b': []string{"", "lockquote"},
|
||||
'i': []string{""},
|
||||
'g': []string{""}, // Quick and dirty fix for Grammarly
|
||||
}
|
||||
|
@ -261,7 +261,10 @@ func PreparseMessage(msg string) string {
|
|||
},
|
||||
'd': []*TagToAction{&TagToAction{"el", buildLitMatch("del"), 0, false}},
|
||||
'u': []*TagToAction{&TagToAction{"", buildLitMatch("u"), 0, false}},
|
||||
'b': []*TagToAction{&TagToAction{"", buildLitMatch("strong"), 0, false}},
|
||||
'b': []*TagToAction{
|
||||
&TagToAction{"", buildLitMatch("strong"), 0, false},
|
||||
&TagToAction{"lockquote", buildLitMatch("blockquote"), 0, false},
|
||||
},
|
||||
'i': []*TagToAction{&TagToAction{"", buildLitMatch("em"), 0, false}},
|
||||
'g': []*TagToAction{
|
||||
&TagToAction{"", func(act *TagToAction, open bool, i int, runes []rune) (int, string) {
|
||||
|
|
|
@ -108,7 +108,7 @@ func tmplInitHeaders(user User, user2 User, user3 User) (*Header, *Header, *Head
|
|||
Theme: Themes[DefaultThemeBox.Load().(string)],
|
||||
CurrentUser: user,
|
||||
NoticeList: []string{"test"},
|
||||
Stylesheets: []string{"panel.css"},
|
||||
Stylesheets: []HResource{HResource{"panel.css", "d"}},
|
||||
Scripts: []HResource{HResource{"whatever.js", "d"}},
|
||||
PreScriptsAsync: []HResource{HResource{"whatever.js", "d"}},
|
||||
ScriptsAsync: []HResource{HResource{"whatever.js", "d"}},
|
||||
|
|
|
@ -60,7 +60,7 @@ func bbcodeRegexParse(msg string) string {
|
|||
msg = bbcodeStrikethrough.ReplaceAllString(msg, "<s>$1</s>")
|
||||
msg = bbcodeURL.ReplaceAllString(msg, "<a href=''$1$2//$3' rel='nofollow'>$1$2//$3</i>")
|
||||
msg = bbcodeURLLabel.ReplaceAllString(msg, "<a href=''$1$2//$3' rel='nofollow'>$4</i>")
|
||||
msg = bbcodeQuotes.ReplaceAllString(msg, "<span class='postQuote'>$1</span>")
|
||||
msg = bbcodeQuotes.ReplaceAllString(msg, "<blockquote>$1</blockquote>")
|
||||
//msg = bbcodeCode.ReplaceAllString(msg,"<span class='codequotes'>$1</span>")
|
||||
return msg
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ func bbcodeParseWithoutCode(msg string) string {
|
|||
msg = string(msgbytes)
|
||||
msg = bbcodeURL.ReplaceAllString(msg, "<a href='$1$2//$3' rel='nofollow'>$1$2//$3</i>")
|
||||
msg = bbcodeURLLabel.ReplaceAllString(msg, "<a href='$1$2//$3' rel='nofollow'>$4</i>")
|
||||
msg = bbcodeQuotes.ReplaceAllString(msg, "<span class='postQuote'>$1</span>")
|
||||
msg = bbcodeQuotes.ReplaceAllString(msg, "<blockquote>$1</blockquote>")
|
||||
return bbcodeCode.ReplaceAllString(msg, "<span class='codequotes'>$1</span>")
|
||||
}
|
||||
return string(msgbytes)
|
||||
|
@ -323,7 +323,7 @@ func bbcodeFullParse(msg string) string {
|
|||
|
||||
//msg = bbcode_url.ReplaceAllString(msg,"<a href=\"$1$2//$3\" rel=\"nofollow\">$1$2//$3</i>")
|
||||
msg = bbcodeURLLabel.ReplaceAllString(msg, "<a href='$1$2//$3' rel='nofollow'>$4</i>")
|
||||
msg = bbcodeQuotes.ReplaceAllString(msg, "<span class='postQuote'>$1</span>")
|
||||
msg = bbcodeQuotes.ReplaceAllString(msg, "<blockquote>$1</blockquote>")
|
||||
msg = bbcodeCode.ReplaceAllString(msg, "<span class='codequotes'>$1</span>")
|
||||
} else {
|
||||
msg = string(msgbytes[0 : len(msgbytes)-10])
|
||||
|
|
|
@ -60,10 +60,10 @@ func TestBBCodeRender(t *testing.T) {
|
|||
msgList.Add("[code]hi[/code]", "<span class='codequotes'>hi</span>")
|
||||
msgList.Add("[code][b]hi[/b][/code]", "<span class='codequotes'>[b]hi[/b]</span>")
|
||||
msgList.Add("[code][b]hi[/code][/b]", "<span class='codequotes'>[b]hi</span>[/b]")
|
||||
msgList.Add("[quote]hi[/quote]", "<span class='postQuote'>hi</span>")
|
||||
msgList.Add("[quote][b]hi[/b][/quote]", "<span class='postQuote'><b>hi</b></span>")
|
||||
msgList.Add("[quote][b]h[/b][/quote]", "<span class='postQuote'><b>h</b></span>")
|
||||
msgList.Add("[quote][b][/b][/quote]", "<span class='postQuote'><b></b></span>")
|
||||
msgList.Add("[quote]hi[/quote]", "<blockquote>hi</blockquote>")
|
||||
msgList.Add("[quote][b]hi[/b][/quote]", "<blockquote><b>hi</b></blockquote>")
|
||||
msgList.Add("[quote][b]h[/b][/quote]", "<blockquote><b>h</b></blockquote>")
|
||||
msgList.Add("[quote][b][/b][/quote]", "<blockquote><b></b></blockquote>")
|
||||
msgList.Add("[url][/url]", "<a href=''></a>")
|
||||
msgList.Add("[url]https://github.com/Azareal/Gosora[/url]", "<a href='https://github.com/Azareal/Gosora'>https://github.com/Azareal/Gosora</a>")
|
||||
msgList.Add("[url]http://github.com/Azareal/Gosora[/url]", "<a href='http://github.com/Azareal/Gosora'>http://github.com/Azareal/Gosora</a>")
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
"use strict"
|
||||
"use strict";
|
||||
|
||||
$(document).ready(function(){
|
||||
(() => {
|
||||
addInitHook("end_init", () => {
|
||||
$("#dash_username input").click(function(){
|
||||
$("#dash_username button").show();
|
||||
});
|
||||
});
|
||||
})();
|
|
@ -12,7 +12,9 @@ function handle_profile_hashbit() {
|
|||
$("." + hash_class).show();
|
||||
}
|
||||
|
||||
$(document).ready(() => {
|
||||
(() => {
|
||||
addInitHook("end_init", () => {
|
||||
if(window.location.hash) handle_profile_hashbit();
|
||||
window.addEventListener("hashchange", handle_profile_hashbit, false);
|
||||
});
|
||||
});
|
||||
})();
|
|
@ -356,7 +356,7 @@ func accountEditHead(titlePhrase string, w http.ResponseWriter, r *http.Request,
|
|||
header.Title = phrases.GetTitlePhrase(titlePhrase)
|
||||
header.Path = "/user/edit/"
|
||||
header.AddSheet(header.Theme.Name + "/account.css")
|
||||
header.AddScript("account.js")
|
||||
header.AddScriptAsync("account.js")
|
||||
}
|
||||
|
||||
func AccountEdit(w http.ResponseWriter, r *http.Request, user common.User, header *common.Header) common.RouteError {
|
||||
|
|
|
@ -32,7 +32,7 @@ func ViewProfile(w http.ResponseWriter, r *http.Request, user common.User, heade
|
|||
// TODO: Preload this?
|
||||
header.AddSheet(header.Theme.Name + "/profile.css")
|
||||
if user.Loggedin {
|
||||
header.AddScript("profile_member.js")
|
||||
header.AddScriptAsync("profile_member.js")
|
||||
}
|
||||
|
||||
var err error
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<title>{{.Title}} | {{.Header.Site.Name}}</title>
|
||||
<link href="/static/{{.Header.Theme.Name}}/main.css" rel="stylesheet" type="text/css">
|
||||
{{range .Header.Stylesheets}}
|
||||
<link href="/static/{{.}}" rel="stylesheet" type="text/css">{{end}}
|
||||
<link href="/static/{{.Name}}{{if .Hash}}?h={{.Hash}}{{end}}" rel="stylesheet" type="text/css">{{end}}
|
||||
{{range .Header.PreScriptsAsync}}
|
||||
<script async type="text/javascript" src="/static/{{.Name}}{{if .Hash}}?h={{.Hash}}{{end}}"></script>{{end}}
|
||||
<meta property="x-loggedin" content="{{.CurrentUser.Loggedin}}" />
|
||||
|
|
|
@ -997,6 +997,12 @@ textarea {
|
|||
width: 100%;
|
||||
max-width: 240px;
|
||||
}
|
||||
blockquote {
|
||||
margin: 0px;
|
||||
background-color: #EEEEEE;
|
||||
padding: 12px;
|
||||
margin-bottom: -3px;
|
||||
}
|
||||
.post_item {
|
||||
display: flex;
|
||||
margin-bottom: 16px;
|
||||
|
|
|
@ -32,14 +32,16 @@
|
|||
|
||||
.rowmenu {
|
||||
margin-left: 18px;
|
||||
margin-bottom: 2px;
|
||||
/*margin-bottom: 2px;*/
|
||||
margin-bottom: 3px;
|
||||
font-size: 17px;
|
||||
}
|
||||
.rowmenu a {
|
||||
color: rgb(180, 180, 180);
|
||||
}
|
||||
.rowmenu .rowitem {
|
||||
margin-bottom: 4px;
|
||||
/*margin-bottom: 4px;*/
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.to_right {
|
||||
|
|
|
@ -199,6 +199,7 @@ li a {
|
|||
border-radius: 3px;
|
||||
background-color: #444444;
|
||||
padding: 16px;
|
||||
/*padding: 18px;*/
|
||||
}
|
||||
.filter_item {
|
||||
margin-bottom: 5px;
|
||||
|
@ -729,6 +730,19 @@ button, .formbutton, .panel_right_button:not(.has_inner_button) {
|
|||
width: 100%;
|
||||
max-width: 320px;
|
||||
}
|
||||
blockquote {
|
||||
background-color: #555555;
|
||||
border-radius: 3px;
|
||||
padding: 8px;
|
||||
margin: 0px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
blockquote + br {
|
||||
display: none;
|
||||
}
|
||||
blockquote:only-child {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.post_item {
|
||||
display: flex;
|
||||
margin-bottom: 12px;
|
||||
|
|
|
@ -18,8 +18,10 @@
|
|||
{{template "acc_panel_common.css" }}
|
||||
.colstack_left .colstack_head {
|
||||
font-size: 19px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
/*padding-top: 10px;
|
||||
padding-bottom: 10px;*/
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
.menu_stats {
|
||||
margin-left: 4px;
|
||||
|
@ -120,8 +122,10 @@
|
|||
}
|
||||
|
||||
#panel_users .rowitem {
|
||||
padding-top: 20px;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
padding-bottom: 18px;
|
||||
}
|
||||
button, .formbutton, .panel_right_button:not(.has_inner_button), #panel_users .profile_url {
|
||||
background: rgb(100,100,200);
|
||||
|
|
|
@ -888,6 +888,11 @@ input[type=checkbox]:checked + label.poll_option_label .sel {
|
|||
background-color: rgb(71,71,71);
|
||||
padding: 10px;
|
||||
}
|
||||
blockquote {
|
||||
background-color: rgb(71,71,71);
|
||||
margin: 0px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* Profiles */
|
||||
#profile_left_lane {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
$(document).ready(function(){
|
||||
(() => {
|
||||
addInitHook("end_init", () => {
|
||||
// TODO: Run this when the image is loaded rather than when the document is ready?
|
||||
$(".topic_list img").each(function(){
|
||||
let aspectRatio = this.naturalHeight / this.naturalWidth;
|
||||
|
@ -10,4 +11,5 @@ $(document).ready(function(){
|
|||
height: aspectRatio * this.width
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
|
@ -16,7 +16,8 @@
|
|||
"Resources": [
|
||||
{
|
||||
"Name":"shadow/misc.js",
|
||||
"Location":"global"
|
||||
"Location":"global",
|
||||
"Async":true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#back {
|
||||
width: 100%;
|
||||
}
|
||||
.sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -155,6 +155,9 @@ li a {
|
|||
#main {
|
||||
width: 100%;
|
||||
}
|
||||
main > *:last-child {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.rowblock {
|
||||
border: 1px solid hsl(0, 0%, 80%);
|
||||
|
@ -541,6 +544,14 @@ input, select {
|
|||
background-color: white;
|
||||
padding: 10px;
|
||||
}
|
||||
/*blockquote {
|
||||
background-color: #EEEEEE;
|
||||
padding: 12px;
|
||||
margin: 0px;
|
||||
}
|
||||
.staff_post blockquote {
|
||||
background-color: rgba(255, 214, 255, 1);
|
||||
}*/
|
||||
|
||||
.little_row_avatar {
|
||||
display: none;
|
||||
|
@ -742,7 +753,7 @@ button.username {
|
|||
background-color: rgb(255,245,245);
|
||||
}
|
||||
|
||||
.postQuote {
|
||||
blockquote {
|
||||
border: 1px solid hsl(0, 0%, 80%);
|
||||
background: white;
|
||||
padding: 5px;
|
||||
|
@ -967,8 +978,9 @@ input[type=checkbox]:checked + label.poll_option_label .sel {
|
|||
|
||||
.pageset {
|
||||
display: flex;
|
||||
margin-bottom: 10px;
|
||||
/*margin-bottom: 10px;*/
|
||||
margin-top: 8px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.pageitem {
|
||||
background-color: white;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
@media(min-width: 881px) {
|
||||
.shrink_main {
|
||||
float: left;
|
||||
width: calc(75% - 12px);
|
||||
/*width: calc(75% - 12px);*/
|
||||
}
|
||||
.sidebar {
|
||||
float: left;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
$(document).ready(function(){
|
||||
(() => {
|
||||
addInitHook("end_init", () => {
|
||||
// TODO: Run this when the image is loaded rather than when the document is ready?
|
||||
$(".topic_list img").each(function(){
|
||||
let aspectRatio = this.naturalHeight / this.naturalWidth;
|
||||
|
@ -10,4 +11,5 @@ $(document).ready(function(){
|
|||
height: aspectRatio * this.width
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
|
@ -1,3 +1,6 @@
|
|||
#back {
|
||||
width: 100%;
|
||||
}
|
||||
.sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#back {
|
||||
width: 100%;
|
||||
}
|
||||
.sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
"Resources": [
|
||||
{
|
||||
"Name":"tempra_simple/misc.js",
|
||||
"Location":"global"
|
||||
"Location":"global",
|
||||
"Async":true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue