Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
588bcdde
Commit
588bcdde
authored
Aug 11, 2012
by
benjaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making notifications update in a smart way. Fixing wrong urls in accounts
parent
bf09bf4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
wiki/plugins/notifications/static/wiki/plugins/notifications/js/ui.js
+11
-3
wiki/views/accounts.py
+3
-3
No files found.
wiki/plugins/notifications/static/wiki/plugins/notifications/js/ui.js
View file @
588bcdde
notify_latest_id
=
0
;
notify_update_timeout
=
30000
;
notify_update_timeout_adjust
=
1.2
;
// factor to adjust between each timeout.
function
notify_update
()
{
jsonWrapper
(
URL_NOTIFY_GET_NEW
,
function
(
data
)
{
...
...
@@ -29,9 +31,15 @@ function notify_mark_read() {
});
}
function
update_timeout
()
{
setTimeout
(
"notify_update()"
,
notify_update_timeout
);
setTimeout
(
"update_timeout()"
,
notify_update_timeout
);
notify_update_timeout
*=
notify_update_timeout_adjust
;
}
$
(
document
).
ready
(
function
()
{
notify_update
();
// Update every second minute.
setInterval
(
"notify_update()"
,
120000
);
// Don't check immediately... some users just click through pages very quickly.
setTimeout
(
"notify_update()"
,
2000
);
update_timeout
(
);
})
wiki/views/accounts.py
View file @
588bcdde
...
...
@@ -28,8 +28,8 @@ class Logout(View):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
auth_logout
(
request
)
messages
.
info
(
request
,
_
(
u"You are no longer logged in. Bye bye!"
))
print
redirect
(
"wiki:get
_url
"
,
URLPath
.
root
()
.
path
)
return
redirect
(
"wiki:get
_url
"
,
URLPath
.
root
()
.
path
)
print
redirect
(
"wiki:get"
,
URLPath
.
root
()
.
path
)
return
redirect
(
"wiki:get"
,
URLPath
.
root
()
.
path
)
class
Login
(
FormView
):
...
...
@@ -47,5 +47,5 @@ class Login(FormView):
messages
.
info
(
self
.
request
,
_
(
u"You are now logged in! Have fun!"
))
if
self
.
request
.
GET
.
get
(
"next"
,
None
):
return
redirect
(
self
.
request
.
GET
[
'next'
])
return
redirect
(
"wiki:get
_url
"
,
URLPath
.
root
()
.
path
)
return
redirect
(
"wiki:get"
,
URLPath
.
root
()
.
path
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment