Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1d746a2

Browse files
committed
added missing slideExit data to send
1 parent 12614cb commit 1d746a2

File tree

2 files changed

+34
-23
lines changed

2 files changed

+34
-23
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ __Content:__
1818

1919
## Change log
2020

21+
### Version 1.6.4 2018-03-22
22+
23+
Extension in sending slideExit event
24+
25+
- Added sending slideExit event necessary data
26+
2127
### Version 1.6.3 2016-06-29
2228

2329
Extension of provisioning API

agnitio.js

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Has to be directly on window object
1616
* @public
1717
*/
18+
1819
window.setAgnitioPlatform = function(data) {
1920
var info = JSON.parse(data);
2021
window.agnitioInfo = info;
@@ -26,7 +27,7 @@ window.setAgnitioPlatform = function(data) {
2627
// Create the global Agnitio namespace 'ag'
2728
var ag = window.ag || {};
2829

29-
var api_version = '1.6.3',
30+
var api_version = '1.6.4',
3031
customInvoke = false,
3132
appInterface = null,
3233
ua = navigator.userAgent,
@@ -811,35 +812,39 @@ window.setAgnitioPlatform = function(data) {
811812
* @private
812813
*/
813814
function slideExit () {
814-
815-
var data, now;
816-
817815
if (!currentSlideId) { return; }
818816

819-
now = timestamp();
820-
821-
data = {
822-
type: "system",
823-
categoryId: null,
824-
category: "slideExit",
825-
labelId: "id",
826-
label: "name",
827-
valueId: currentSlideId,
828-
value: undefined,
829-
valueType: undefined,
830-
time: now,
831-
slideIndex: undefined,
832-
slidePath: undefined,
833-
chapterName:undefined,
834-
chapterId: undefined,
835-
subChapterName: undefined,
836-
subChapterId: undefined
817+
var monitoringData,
818+
now = timestamp(),
819+
chapterName = currentData.chapter || null,
820+
chapterId = currentData.chapterId || null,
821+
subChapterName = currentData.subChapter || null,
822+
subChapterId = currentData.subChapterId || null,
823+
slideIndex = currentData.slideIndex || null,
824+
slidePath = currentData.path || null,
825+
826+
monitoringData = {
827+
type: "system",
828+
categoryId: null,
829+
category: "slideExit",
830+
labelId: "id",
831+
label: "name",
832+
valueId: currentSlideId,
833+
value: currentData.name,
834+
valueType: null,
835+
time: now,
836+
slideIndex: slideIndex,
837+
slidePath: slidePath,
838+
chapterName: chapterName,
839+
chapterId: chapterId,
840+
subChapterName: subChapterName,
841+
subChapterId: subChapterId
837842
};
838843

839844
// Remove current slide
840845
currentSlideId = null;
841846

842-
ag.submit.save(data);
847+
ag.submit.save(monitoringData);
843848
}
844849

845850
/**

0 commit comments

Comments
 (0)