Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OERu
register-enrol
Commits
b51bdf0b
Commit
b51bdf0b
authored
Nov 27, 2020
by
Dave Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some tweaks to fix broken keyboard nav
parent
30461770
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
js/ore_script.js
js/ore_script.js
+10
-5
No files found.
js/ore_script.js
View file @
b51bdf0b
/* created by Dave Lane, dave@oerfoundation.org, https://oeru.org */
var
ORE_DEBUG
=
fals
e
;
// set to false to disable debugging
var
ORE_DEBUG
=
tru
e
;
// set to false to disable debugging
function
LOG
()
{
if
(
ORE_DEBUG
)
{
console
.
log
.
apply
(
this
,
arguments
);
}}
LOG
(
'
ORE DEBUG =
'
,
ORE_DEBUG
);
// only prints if DEBUG = true
// jQuery selectors and related functions in that context
...
...
@@ -500,7 +500,9 @@ jQuery(document).ready(function() {
close_dialog
();
clear_hash
();
}
else
{
busy
();
handle_action
(
action
);
not_busy
();
}
});
// handle links
...
...
@@ -510,7 +512,9 @@ jQuery(document).ready(function() {
if
(
current_focus
.
hasClass
(
'
ore-button
'
))
{
action
=
action_from_id
(
e
.
currentTarget
.
id
);
LOG
(
'
executing action
'
,
action
);
busy
();
handle_action
(
action
);
not_busy
();
}
else
{
LOG
(
'
just forwarding on the click...
'
);
e
.
preventDefault
();
...
...
@@ -544,8 +548,8 @@ jQuery(document).ready(function() {
}
else
if
(
current_focus
.
hasClass
(
'
ore-button
'
))
{
LOG
(
'
a button is focused
'
);
}
current_focus
.
click
();
}
current_focus
.
click
();
}
});
...
...
@@ -555,17 +559,16 @@ jQuery(document).ready(function() {
var
orig_action
=
action
;
// check if there's a form that needs processing
if
(
action
==
'
log_out
'
)
{
busy
();
LOG
(
'
logging user out
'
);
log_out
(
action
);
not_
busy
();
busy
();
return
;
}
if
(
process_form
(
action
))
{
LOG
(
'
processed form for
'
,
action
);
not_busy
();
return
;
}
if
(
ore_data
.
dialogs
.
hasOwnProperty
(
action
))
{
LOG
(
'
orig action
'
+
orig_action
+
'
and new action
'
+
action
);
if
(
create_dialog
(
action
))
{
...
...
@@ -576,6 +579,7 @@ jQuery(document).ready(function() {
}
else
{
LOG
(
'
unknown button clicked!
'
);
}
not_busy
();
//LOG('failed to processes form for ', action);
// if no form, or after it's processed, take further action
//return;
...
...
@@ -951,6 +955,7 @@ jQuery(document).ready(function() {
// do special stuff for changes that have an impact on what
// the user is allowed to see on the site...
if
(
action
==
'
login
'
||
action
==
'
edit_profile
'
||
action
==
'
enrol
'
||
action
==
'
leave
'
)
{
busy
();
LOG
(
'
Reloading page for completed action:
'
,
action
);
reload
(
ore_data
.
dialogs
[
action
].
default
.
success
);
}
else
{
...
...
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