@@ -38,7 +38,9 @@ RunestoneBase.prototype.logBookEvent = function (eventInfo) {
3838 null , 'json' ) ;
3939 }
4040 console . log ( "logging event " + JSON . stringify ( eventInfo ) ) ;
41- pageProgressTracker . updateProgress ( eventInfo . div_id ) ;
41+ if ( typeof pageProgressTracker . updateProgress === "function" ) {
42+ pageProgressTracker . updateProgress ( eventInfo . div_id ) ;
43+ }
4244 return post_return ;
4345} ;
4446
@@ -61,7 +63,9 @@ RunestoneBase.prototype.logRunEvent = function (eventInfo) {
6163 this . forceSave = true ; } ) . bind ( this ) )
6264 }
6365 console . log ( "running " + JSON . stringify ( eventInfo ) ) ;
64- pageProgressTracker . updateProgress ( eventInfo . div_id ) ;
66+ if ( typeof pageProgressTracker . updateProgress === "function" ) {
67+ pageProgressTracker . updateProgress ( eventInfo . div_id ) ;
68+ }
6569
6670} ;
6771
@@ -137,3 +141,15 @@ RunestoneBase.prototype.shouldUseServer = function (data) {
137141RunestoneBase . prototype . localStorageKey = function ( ) {
138142 return eBookConfig . email + ":" + eBookConfig . course + ":" + this . divid + "-given" ;
139143}
144+
145+
146+ RunestoneBase . prototype . addCaption = function ( elType ) {
147+ //someElement.parentNode.insertBefore(newElement, someElement.nextSibling);
148+ var capDiv = document . createElement ( 'p' ) ;
149+ $ ( capDiv ) . html ( this . caption + " (" + this . divid + ")" ) ;
150+ $ ( capDiv ) . addClass ( `${ elType } _caption` ) ;
151+ $ ( capDiv ) . addClass ( `${ elType } _caption_text` ) ;
152+
153+ //this.outerDiv.parentNode.insertBefore(capDiv, this.outerDiv.nextSibling);
154+ this . containerDiv . appendChild ( capDiv ) ;
155+ } ;
0 commit comments