Commit 5432ef3b by cahrens

Make it clear that the logger methods are used by xblocks.

parent ba06c899
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
}); });
describe('log', function() { 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() { it('can send a request to log event', function() {
spyOn(jQuery, 'ajaxWithPrefix'); spyOn(jQuery, 'ajaxWithPrefix');
Logger.log('example', 'data'); Logger.log('example', 'data');
...@@ -106,6 +108,8 @@ ...@@ -106,6 +108,8 @@
}); });
describe('listen', function() { 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 () { beforeEach(function () {
spyOn(jQuery, 'ajaxWithPrefix'); spyOn(jQuery, 'ajaxWithPrefix');
this.callbacks = _.map(_.range(4), function () { this.callbacks = _.map(_.range(4), function () {
...@@ -146,6 +150,8 @@ ...@@ -146,6 +150,8 @@
}); });
describe('bind', function() { 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() { beforeEach(function() {
this.initialPostWithPrefix = jQuery.postWithPrefix; this.initialPostWithPrefix = jQuery.postWithPrefix;
this.initialGetWithPrefix = jQuery.getWithPrefix; this.initialGetWithPrefix = jQuery.getWithPrefix;
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
return { return {
/** /**
* Emits an event. * 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) { log: function(eventType, data, element, requestOptions) {
var callbacks; var callbacks;
...@@ -62,7 +65,10 @@ ...@@ -62,7 +65,10 @@
/** /**
* Adds a listener. If you want any element to trigger this listener, * 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) { listen: function(eventType, element, callback) {
listeners[eventType] = listeners[eventType] || {}; listeners[eventType] = listeners[eventType] || {};
...@@ -72,6 +78,9 @@ ...@@ -72,6 +78,9 @@
/** /**
* Binds `page_close` event. * 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() { bind: function() {
window.onunload = function() { window.onunload = function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment