Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
4a211fb5
Commit
4a211fb5
authored
16 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Make quotes in HTML view collapsible and default to collapsed.
parent
b7b2eddb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
web/root/sajax-forum/body.xjs
+10
-7
10 additions, 7 deletions
web/root/sajax-forum/body.xjs
web/root/sajax-forum/client_functions.xjs
+19
-0
19 additions, 0 deletions
web/root/sajax-forum/client_functions.xjs
web/root/sajax-forum/style.css
+16
-1
16 additions, 1 deletion
web/root/sajax-forum/style.css
with
45 additions
and
8 deletions
web/root/sajax-forum/body.xjs
+
10
−
7
View file @
4a211fb5
...
@@ -52,6 +52,9 @@ if(ANSI_formatted) {
...
@@ -52,6 +52,9 @@ if(ANSI_formatted) {
}
}
}
}
else {
else {
var blockquote_start='<div class="quote"><a href="#" onclick="toggle_quote(this);return false">Show quote</a><blockquote style="display: none">';
var blockquote_end='</blockquote></div>';
writeln("<div class=\"ansi_toggle\"><a href=\"#\" onclick=\"load_ansi(this.parentNode.parentNode, "+html_sub_code_string+");return false\">ANSI Mode</a></div>");
writeln("<div class=\"ansi_toggle\"><a href=\"#\" onclick=\"load_ansi(this.parentNode.parentNode, "+html_sub_code_string+");return false\">ANSI Mode</a></div>");
// Strip CTRL-A
// Strip CTRL-A
body=body.replace(/\1./g,'');
body=body.replace(/\1./g,'');
...
@@ -87,7 +90,7 @@ else {
...
@@ -87,7 +90,7 @@ else {
// If the new length is smaller than the old one, close the extras
// If the new length is smaller than the old one, close the extras
for(p=new_prefixes.length; p<prefixes.length; p++) {
for(p=new_prefixes.length; p<prefixes.length; p++) {
if(quote_depth > 0) {
if(quote_depth > 0) {
line_prefix = line_prefix +
'</
blockquote
>'
;
line_prefix = line_prefix + blockquote
_end
;
quote_depth--;
quote_depth--;
}
}
else {
else {
...
@@ -100,11 +103,11 @@ else {
...
@@ -100,11 +103,11 @@ else {
if(prefixes[p]==undefined) {
if(prefixes[p]==undefined) {
/* New depth */
/* New depth */
line_prefix = line_prefix +
'<
blockquote
>'
;
line_prefix = line_prefix + blockquote
_start
;
quote_depth++;
quote_depth++;
}
}
else if(broken) {
else if(broken) {
line_prefix = line_prefix +
'<
blockquote
>'
;
line_prefix = line_prefix + blockquote
_start
;
quote_depth++;
quote_depth++;
}
}
else if(prefixes[p].replace(/^\s*(.*?)\s*$/,"$1") != new_prefixes[p].replace(/^\s*(.*?)\s*$/,"$1")) {
else if(prefixes[p].replace(/^\s*(.*?)\s*$/,"$1") != new_prefixes[p].replace(/^\s*(.*?)\s*$/,"$1")) {
...
@@ -112,14 +115,14 @@ else {
...
@@ -112,14 +115,14 @@ else {
var o;
var o;
for(o=p; o<prefixes.length && o<new_prefixes.length; o++) {
for(o=p; o<prefixes.length && o<new_prefixes.length; o++) {
if(quote_depth > 0) {
if(quote_depth > 0) {
line_prefix =
'</
blockquote
>'
+line_prefix;
line_prefix = blockquote
_end
+line_prefix;
quote_depth--;
quote_depth--;
}
}
else {
else {
log("BODY: Depth problem 2");
log("BODY: Depth problem 2");
}
}
}
}
line_prefix =
'<
blockquote
>'
+line_prefix;
line_prefix = blockquote
_start
+line_prefix;
quote_depth++;
quote_depth++;
broken=true;
broken=true;
}
}
...
@@ -130,7 +133,7 @@ else {
...
@@ -130,7 +133,7 @@ else {
else {
else {
for(p=0; p<prefixes.length; p++) {
for(p=0; p<prefixes.length; p++) {
if(quote_depth > 0) {
if(quote_depth > 0) {
line_prefix = line_prefix +
'</
blockquote
>'
;
line_prefix = line_prefix + blockquote
_end
;
quote_depth--;
quote_depth--;
}
}
else {
else {
...
@@ -145,7 +148,7 @@ else {
...
@@ -145,7 +148,7 @@ else {
if(quote_depth != 0) {
if(quote_depth != 0) {
log("BODY: Depth problem 4");
log("BODY: Depth problem 4");
for(;quote_depth > 0; quote_depth--) {
for(;quote_depth > 0; quote_depth--) {
body +=
"</
blockquote
>"
;
body += blockquote
_end
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
web/root/sajax-forum/client_functions.xjs
+
19
−
0
View file @
4a211fb5
...
@@ -91,6 +91,25 @@ function toggle_replies(sub_code, message_number)
...
@@ -91,6 +91,25 @@ function toggle_replies(sub_code, message_number)
}
}
}
}
function toggle_quote(container)
{
for(child in container.parentNode.childNodes) {
if(container.parentNode.childNodes[child].nodeName=='BLOCKQUOTE') {
switch(container.parentNode.childNodes[child].style.display) {
case 'none':
container.parentNode.childNodes[child].style.display='block';
container.innerHTML="Hide quote";
break;
default:
container.parentNode.childNodes[child].style.display='none';
container.innerHTML="Show quote";
break;
}
break;
}
}
}
function load_ansi(container, sub_code)
function load_ansi(container, sub_code)
{
{
var message=container.parentNode.parentNode;
var message=container.parentNode.parentNode;
...
...
This diff is collapsed.
Click to expand it.
web/root/sajax-forum/style.css
+
16
−
1
View file @
4a211fb5
...
@@ -93,8 +93,23 @@ body {
...
@@ -93,8 +93,23 @@ body {
background-color
:
#999
;
background-color
:
#999
;
}
}
blockquote
{
.ansi_toggle
{
}
.quote
{
}
.quote
a
{
font-size
:
25%
;
margin
:
0px
;
margin-left
:
20px
;
}
.quote
blockquote
{
border-width
:
1px
;
border-width
:
1px
;
border-color
:
black
;
border-color
:
black
;
border-style
:
dashed
;
border-style
:
dashed
;
margin
:
5px
;
margin-left
:
20px
;
margin-top
:
0px
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment