diff --git a/README.md b/README.md index 9fe3e86..de707b2 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,12 @@ __Content:__ ## Change log +### Version 1.6.4 2018-03-22 + +Extension in sending slideExit event + +- Added sending slideExit event necessary data + ### Version 1.6.3 2016-06-29 Extension of provisioning API diff --git a/agnitio.js b/agnitio.js index 2c27eea..e13134f 100644 --- a/agnitio.js +++ b/agnitio.js @@ -15,6 +15,7 @@ * Has to be directly on window object * @public */ + window.setAgnitioPlatform = function(data) { var info = JSON.parse(data); window.agnitioInfo = info; @@ -26,7 +27,7 @@ window.setAgnitioPlatform = function(data) { // Create the global Agnitio namespace 'ag' var ag = window.ag || {}; - var api_version = '1.6.3', + var api_version = '1.6.4', customInvoke = false, appInterface = null, ua = navigator.userAgent, @@ -811,35 +812,39 @@ window.setAgnitioPlatform = function(data) { * @private */ function slideExit () { - - var data, now; - if (!currentSlideId) { return; } - now = timestamp(); - - data = { - type: "system", - categoryId: null, - category: "slideExit", - labelId: "id", - label: "name", - valueId: currentSlideId, - value: undefined, - valueType: undefined, - time: now, - slideIndex: undefined, - slidePath: undefined, - chapterName:undefined, - chapterId: undefined, - subChapterName: undefined, - subChapterId: undefined + var monitoringData, + now = timestamp(), + chapterName = currentData.chapter || null, + chapterId = currentData.chapterId || null, + subChapterName = currentData.subChapter || null, + subChapterId = currentData.subChapterId || null, + slideIndex = currentData.slideIndex || null, + slidePath = currentData.path || null, + + monitoringData = { + type: "system", + categoryId: null, + category: "slideExit", + labelId: "id", + label: "name", + valueId: currentSlideId, + value: currentData.name, + valueType: null, + time: now, + slideIndex: slideIndex, + slidePath: slidePath, + chapterName: chapterName, + chapterId: chapterId, + subChapterName: subChapterName, + subChapterId: subChapterId }; // Remove current slide currentSlideId = null; - ag.submit.save(data); + ag.submit.save(monitoringData); } /**