Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
5432ef3b
Commit
5432ef3b
authored
Mar 04, 2016
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it clear that the logger methods are used by xblocks.
parent
ba06c899
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletions
+16
-1
common/static/js/spec/logger_spec.js
+6
-0
common/static/js/src/logger.js
+10
-1
No files found.
common/static/js/spec/logger_spec.js
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
;
...
...
common/static/js/src/logger.js
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
()
{
...
...
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