Index: lams_central/web/includes/javascript/addLesson.js
===================================================================
diff -u -r33f9914fba416faeaa89be285fa2cd182c4d29ed -rf14dd6ce1f03d0ce6d3914ea1d009cee059cc41b
--- lams_central/web/includes/javascript/addLesson.js (.../addLesson.js) (revision 33f9914fba416faeaa89be285fa2cd182c4d29ed)
+++ lams_central/web/includes/javascript/addLesson.js (.../addLesson.js) (revision f14dd6ce1f03d0ce6d3914ea1d009cee059cc41b)
@@ -482,17 +482,20 @@
generatingLearningDesign = true;
// iframe just to load Authoring for a single purpose, generate the SVG
- $('').appendTo('body').load(function(){
+ $('').appendTo('body').css('visibility', 'hidden').load(function(){
// call svgGenerator.jsp code to store LD SVG on the server
var frame = $(this),
win = frame[0].contentWindow || frame[0].contentDocument;
- win.GeneralLib.saveLearningDesignImage();
- frame.remove();
- // load the image again, avoid caching
- loadLearningDesignSVG(ldId);
- }).attr('src', LAMS_URL
- + 'authoring/generateSVG.do?selectable=false&learningDesignID='
- + ldId);
+ // when LD opens, make a callback which save the thumbnail and displays it in current window
+ win.GeneralLib.openLearningDesign(ldId, function(){
+ result = win.GeneralLib.saveLearningDesignImage();
+ frame.remove();
+ if (result) {
+ // load the image again
+ loadLearningDesignSVG(ldId);
+ }
+ });
+ }).attr('src', LAMS_URL + 'authoring/generateSVG.do?selectable=false');
}
});
Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js
===================================================================
diff -u -rf5852bd3f19beebb0e143f3e23e604289d0963e4 -rf14dd6ce1f03d0ce6d3914ea1d009cee059cc41b
--- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision f5852bd3f19beebb0e143f3e23e604289d0963e4)
+++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision f14dd6ce1f03d0ce6d3914ea1d009cee059cc41b)
@@ -3052,7 +3052,7 @@
return;
}
// iframe just to load another instance of Authoring for a single purpose, generate the SVG
- $('').appendTo('body').load(function(){
+ $('').appendTo('body').css('visibility', 'hidden').load(function(){
// call svgGenerator.jsp code to store LD SVG on the server
var frame = $(this),
win = frame[0].contentWindow || frame[0].contentDocument;
Index: lams_monitoring/web/includes/javascript/monitorLesson.js
===================================================================
diff -u -r86303d027fb929a45c53fc89f3f3c9c855ea0eb8 -rf14dd6ce1f03d0ce6d3914ea1d009cee059cc41b
--- lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 86303d027fb929a45c53fc89f3f3c9c855ea0eb8)
+++ lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision f14dd6ce1f03d0ce6d3914ea1d009cee059cc41b)
@@ -1239,17 +1239,20 @@
return;
}
// iframe just to load Authoring for a single purpose, generate the SVG
- $('').appendTo('body').load(function(){
+ $('').appendTo('body').css('visibility', 'hidden').load(function(){
// call svgGenerator.jsp code to store LD SVG on the server
var frame = $(this),
win = frame[0].contentWindow || frame[0].contentDocument;
- win.GeneralLib.saveLearningDesignImage();
- frame.remove();
-
- // run the whole fetch again
- updateSequenceTab();
- }).attr('src', LAMS_URL
- + 'authoring/generateSVG.do?selectable=false&learningDesignID=' + ldId).attr('width',0).attr('height',0).attr('style','border: 0px');
+ // when LD opens, make a callback which save the thumbnail and displays it in current window
+ win.GeneralLib.openLearningDesign(ldId, function(){
+ result = win.GeneralLib.saveLearningDesignImage();
+ frame.remove();
+ if (result) {
+ // load the image again
+ updateSequenceTab();
+ }
+ });
+ }).attr('src', LAMS_URL + 'authoring/generateSVG.do?selectable=false');
}
});