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
0cd6175a
Commit
0cd6175a
authored
18 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Update new scan pointers when the page is unloaded.
parent
c801d044
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
web/root/sajax-forum/client_functions.xjs
+31
-8
31 additions, 8 deletions
web/root/sajax-forum/client_functions.xjs
web/root/sajax-forum/index.xjs
+1
-1
1 addition, 1 deletion
web/root/sajax-forum/index.xjs
web/root/sajax-forum/update_ptr.xjs
+9
-0
9 additions, 0 deletions
web/root/sajax-forum/update_ptr.xjs
with
41 additions
and
9 deletions
web/root/sajax-forum/client_functions.xjs
+
31
−
8
View file @
0cd6175a
...
...
@@ -53,8 +53,10 @@ var groups_url="<?xjs write(http_request.virtual_path.replace(/client_functions\
var plus_url="<?xjs write(http_request.virtual_path.replace(/client_functions\.xjs$/,'plus.gif')) ?>";
var minus_url="<?xjs write(http_request.virtual_path.replace(/client_functions\.xjs$/,'minus.gif')) ?>";
var login_url="<?xjs write(http_request.virtual_path.replace(/client_functions\.xjs$/,'login.xjs')) ?>";
var update_ptr_url="<?xjs write(http_request.virtual_path.replace(/client_functions\.xjs$/,'update_ptr.xjs')) ?>";
var user=<?xjs if(user.alias != '') write(user.alias.toSource()); else write(user.name.toSource()) ?>;
var password=<?xjs write(user.security.password.toSource()) ?>;
var read_ptr=new Object();
function clean_id(id)
{
...
...
@@ -65,6 +67,7 @@ function toggle_replies(sub_code, message_number)
{
var containerid='replies-'+clean_id(sub_code)+'-'+message_number;
var expanderid='reply-expander-'+clean_id(sub_code)+'-'+message_number;
if(document.getElementById(containerid).innerHTML=='')
ajaxpage(messages_url+"?sub_code="+sub_code+"&msg_number="+message_number+'&user='+user,containerid,expanderid,minus_url);
else {
...
...
@@ -81,6 +84,9 @@ function toggle_body(sub_code, message_number)
if(container.innerHTML=='') {
ajaxpage(body_url+"?sub_code="+sub_code+"&msg_number="+message_number+'&user='+user,containerid);
/* If this is higher than the current read_ptr, update it */
if(read_ptr[sub_code] < message_number)
read_ptr[sub_code] = message_number;
/* If this item was new, "un-new" it */
if(message.className=='message_is_new') {
/* No longer new... update it and it's parents... */
...
...
@@ -114,8 +120,11 @@ function toggle_body(sub_code, message_number)
function toggle_messages(sub_code)
{
var containerid='message-list-'+clean_id(sub_code);
if(document.getElementById(containerid).innerHTML=='')
if(document.getElementById(containerid).innerHTML=='')
{
ajaxpage(messages_url+"?sub_code="+sub_code+'&user='+user,containerid);
if(read_ptr[sub_code]==undefined)
read_ptr[sub_code]=0;
}
else
document.getElementById(containerid).innerHTML='';
}
...
...
@@ -153,14 +162,16 @@ function ajaxpage(url, containerid, buttonid, buttonurl, is_script)
}
else
return false;
if(is_script) {
page_request.onreadystatechange=function() {
evalpage(page_request, containerid);
if(containerid != undefined) {
if(is_script) {
page_request.onreadystatechange=function() {
evalpage(page_request, containerid);
}
}
}
else
{
page_request
.onreadystatechange=function(){
loadpage(page_request, containerid, buttonid, buttonurl);
else {
page_request.onreadystatechange=function()
{
loadpage(
page_request
, containerid, buttonid, buttonurl);
}
}
}
document.body.style.cursor="progress";
...
...
@@ -220,5 +231,17 @@ function login()
{
var new_user=document.getElementById('login_username').value;
var new_password=document.getElementById('login_password').value;
/* Clear newest read pointers */
read_ptr=new Object();
ajaxpage(login_url+'?user='+new_user+'&pass='+new_password+'&killcache='+new Date().getTime()+Math.random(), 'current_user',undefined,undefined,true);
}
function update_pointers()
{
var args=new Array();
for(sub_code in read_ptr)
args.push(encodeURIComponent(sub_code)+'='+read_ptr[sub_code]);
ajaxpage(update_ptr_url+"?"+args.join('&'));
}
This diff is collapsed.
Click to expand it.
web/root/sajax-forum/index.xjs
+
1
−
1
View file @
0cd6175a
...
...
@@ -9,7 +9,7 @@ var sub_code="dove-gen";
<title>
The SAJAX Forum
</title>
<script
src=
"<?xjs write(http_request.virtual_path.replace(/index\.xjs$/,'client_functions.xjs')); ?>"
type=
"text/javascript"
></script>
</head>
<body
onLoad=
"reload_groups()"
>
<body
onLoad=
"reload_groups()"
onUnLoad=
"update_pointers()"
>
<h2>
Your header goes here...
</h2>
<div
class=
"login_form"
>
<div
id=
"current_user"
>
Currently logged in as:
<?xjs if(user.alias=='') write(user.name); else write(user.alias); ?>
</div>
...
...
This diff is collapsed.
Click to expand it.
web/root/sajax-forum/update_ptr.xjs
0 → 100644
+
9
−
0
View file @
0cd6175a
<xjs
load(cwd+"functions.js");
for(sub_code in http_request.query) {
var newval=parseInt(http_request.query[sub_code][0]);
if(newval > msg_area[sub_code].scan_ptr)
msg_area[sub_code].scan_ptr=newval;
}
?>
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