Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Hsin-Yu Chien
edx-platform-release
Commits
5432ef3b
Commit
5432ef3b
authored
9 years ago
by
cahrens
Browse files
Options
Downloads
Patches
Plain Diff
Make it clear that the logger methods are used by xblocks.
parent
ba06c899
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/static/js/spec/logger_spec.js
+6
-0
6 additions, 0 deletions
common/static/js/spec/logger_spec.js
common/static/js/src/logger.js
+10
-1
10 additions, 1 deletion
common/static/js/src/logger.js
with
16 additions
and
1 deletion
common/static/js/spec/logger_spec.js
+
6
−
0
View file @
5432ef3b
...
...
@@ -6,6 +6,8 @@
});
describe
(
'
log
'
,
function
()
{
// Note that log is used by external XBlocks, and the API cannot change without
// proper deprecation and notification for external authors.
it
(
'
can send a request to log event
'
,
function
()
{
spyOn
(
jQuery
,
'
ajaxWithPrefix
'
);
Logger
.
log
(
'
example
'
,
'
data
'
);
...
...
@@ -106,6 +108,8 @@
});
describe
(
'
listen
'
,
function
()
{
// Note that listen is used by external XBlocks, and the API cannot change without
// proper deprecation and notification for external authors.
beforeEach
(
function
()
{
spyOn
(
jQuery
,
'
ajaxWithPrefix
'
);
this
.
callbacks
=
_
.
map
(
_
.
range
(
4
),
function
()
{
...
...
@@ -146,6 +150,8 @@
});
describe
(
'
bind
'
,
function
()
{
// Note that bind may be used by external XBlocks, and the API cannot change without
// proper deprecation and notification for external authors.
beforeEach
(
function
()
{
this
.
initialPostWithPrefix
=
jQuery
.
postWithPrefix
;
this
.
initialGetWithPrefix
=
jQuery
.
getWithPrefix
;
...
...
This diff is collapsed.
Click to expand it.
common/static/js/src/logger.js
+
10
−
1
View file @
5432ef3b
...
...
@@ -24,6 +24,9 @@
return
{
/**
* Emits an event.
*
* Note that this method is used by external XBlocks, and the API cannot change without
* proper deprecation and notification for external authors.
*/
log
:
function
(
eventType
,
data
,
element
,
requestOptions
)
{
var
callbacks
;
...
...
@@ -62,7 +65,10 @@
/**
* Adds a listener. If you want any element to trigger this listener,
* do element = null
* do element = null.
*
* Note that this method is used by external XBlocks, and the API cannot change without
* proper deprecation and notification for external authors.
*/
listen
:
function
(
eventType
,
element
,
callback
)
{
listeners
[
eventType
]
=
listeners
[
eventType
]
||
{};
...
...
@@ -72,6 +78,9 @@
/**
* Binds `page_close` event.
*
* Note that this method is used by external XBlocks, and the API cannot change without
* proper deprecation and notification for external authors.
*/
bind
:
function
()
{
window
.
onunload
=
function
()
{
...
...
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