mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-24 08:46:24 -07:00
Fix lightbox loading with pages that have full HTML
Also fix invalid HTML in template for board pages
This commit is contained in:
parent
d558bcc0d0
commit
14798cbeeb
2 changed files with 9 additions and 8 deletions
|
@ -135,19 +135,20 @@ function openStaffLightBox(action_url) {
|
|||
data: {
|
||||
action: action_url,
|
||||
},
|
||||
dataType:"xml",
|
||||
dataType:"html",
|
||||
async:false,
|
||||
|
||||
success: function(result) {
|
||||
var result_body = $jq(result).find("body");
|
||||
var header = $jq(result).find("h1");
|
||||
var body = '<div id="body-mock">' + result.replace(/^[\s\S]*<body.*?>|<\/body>[\s\S]*$/ig, '') + '</div>';
|
||||
var $body = $jq(body);
|
||||
var header = $body.find("h1");
|
||||
var header_text = header.text();
|
||||
header.remove()
|
||||
header.remove();
|
||||
if(header_text == "") header_text = "Manage";
|
||||
showLightBox(header_text,result_body.html());
|
||||
showLightBox(header_text,$body.html());
|
||||
},
|
||||
error: function(result) {
|
||||
var responsetext = result.responseText
|
||||
var responsetext = result.responseText;
|
||||
header = responsetext.substring(responsetext.indexOf("<h1>")+4,responsetext.indexOf("</h1>"))
|
||||
|
||||
responsetext = responsetext.substring(responsetext.indexOf("</h1>") + 5, responsetext.indexOf("</body>"));
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<table id="board-options">
|
||||
<tr><th class="option-column">Option</th><th class="value-column">Value</th></tr>
|
||||
<tr><td>Directory</td><td><input type="text" name="dir" value="" /></td></tr>
|
||||
<tr><td>Section</td><td><select name="section" selected="0">{{range $_, $section := .section_arr}}
|
||||
<tr><td>Section</td><td><select name="section">{{range $_, $section := .section_arr}}
|
||||
<option value="{{$section.ID}}">{{$section.Name}}</option>{{end}}
|
||||
</select></td></tr>
|
||||
<tr><td>Order</td><td><input type="text" name="order" value="0" /></td></tr>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<tr><td>Description</td><td><input type="text" name="description" value="" /></td></tr>
|
||||
<tr><td>Max image size</td><td><input type="text" name="maximagesize" value="4718592" /></td></tr>
|
||||
<tr><td>Max pages</td><td><input type="text" name="maxpages" value="11" /></td></tr>
|
||||
<tr><td>Default style</td><td><select name="defaultstyle" selected="">{{range $_, $style := $.config.Styles}}
|
||||
<tr><td>Default style</td><td><select name="defaultstyle">{{range $_, $style := $.config.Styles}}
|
||||
<option value="{{$style}}">{{$style}}</option>{{end}}
|
||||
</select></td></tr>
|
||||
<tr><td>Locked</td><td><input type="checkbox" name="locked" {{if $.board.Locked}}checked{{end}}/></td></tr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue