Commit ee2f0d20 authored by Oleg Korshul's avatar Oleg Korshul

reporter bugs

parent 6d6e8e98
......@@ -853,11 +853,6 @@ function CEditorPage(api)
_wordControl.DemonstrationManager.PointerRemove();
};
window.onbeforeunload = function(e)
{
window.editor.sync_endDemonstration();
};
window.onkeydown = this.onKeyDown;
window.onkeyup = this.onKeyUp;
......
......@@ -3153,6 +3153,7 @@ function CDemonstrationManager(htmlpage)
this.End = function(isNoUseFullScreen)
{
this.PointerRemove();
if (this.waitReporterObject)
{
this.EndWaitReporter(true);
......@@ -3199,12 +3200,12 @@ function CDemonstrationManager(htmlpage)
this.HtmlPage.m_oApi.sync_endDemonstration();
}
this.NextSlide = function()
this.NextSlide = function(isNoSendFormReporter)
{
if (!this.Mode)
return;
if (this.HtmlPage.m_oApi.isReporterMode)
if (this.HtmlPage.m_oApi.isReporterMode && !isNoSendFormReporter)
this.HtmlPage.m_oApi.sendFromReporter("{ \"reporter_command\" : \"next\" }");
this.CorrectSlideNum();
......@@ -3230,12 +3231,12 @@ function CDemonstrationManager(htmlpage)
return (this.HtmlPage.m_oApi.WordControl.m_oLogicDocument.isLoopShowMode() || this.HtmlPage.m_oApi.isEmbedVersion);
}
this.PrevSlide = function()
this.PrevSlide = function(isNoSendFormReporter)
{
if (!this.Mode)
return;
if (this.HtmlPage.m_oApi.isReporterMode)
if (this.HtmlPage.m_oApi.isReporterMode && !isNoSendFormReporter)
this.HtmlPage.m_oApi.sendFromReporter("{ \"reporter_command\" : \"prev\" }");
if (0 != this.SlideNum)
......@@ -3255,12 +3256,12 @@ function CDemonstrationManager(htmlpage)
}
}
this.GoToSlide = function(slideNum)
this.GoToSlide = function(slideNum, isNoSendFormReporter)
{
if (!this.Mode)
return;
if (this.HtmlPage.m_oApi.isReporterMode)
if (this.HtmlPage.m_oApi.isReporterMode && !isNoSendFormReporter)
this.HtmlPage.m_oApi.sendFromReporter("{ \"reporter_command\" : \"go_to_slide\", \"slide\" : " + slideNum + " }");
this.CorrectSlideNum();
......@@ -3274,13 +3275,13 @@ function CDemonstrationManager(htmlpage)
this.StartSlide(true, false);
}
this.Play = function()
this.Play = function(isNoSendFormReporter)
{
this.IsPlayMode = true;
if (-1 == this.CheckSlideDuration)
{
this.NextSlide();
this.NextSlide(isNoSendFormReporter);
}
}
......
......@@ -5885,6 +5885,7 @@ background-repeat: no-repeat;\
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["startReporter"](window.location.href);
this.reporterWindow = {};
return;
}
......@@ -5905,6 +5906,11 @@ background-repeat: no-repeat;\
if (!this.reporterWindow)
return;
this.reporterWindow.onbeforeunload = function()
{
window.editor.EndDemonstration();
};
if ( this.reporterWindow.attachEvent )
this.reporterWindow.attachEvent('onmessage', this.DemonstrationReporterMessages);
else
......@@ -5916,6 +5922,7 @@ background-repeat: no-repeat;\
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["endReporter"]();
this.reporterWindow = null;
return;
}
......@@ -5964,17 +5971,12 @@ background-repeat: no-repeat;\
}
case "next":
{
_this.DemonstrationNextSlide();
_this.WordControl.DemonstrationManager.NextSlide();
break;
}
case "prev":
{
_this.DemonstrationPrevSlide();
break;
}
case "slide":
{
_this.DemonstrationGoToSlide(_obj["slide"]);
_this.WordControl.DemonstrationManager.PrevSlide();
break;
}
case "go_to_slide":
......@@ -6092,6 +6094,52 @@ background-repeat: no-repeat;\
{
_this.WordControl.DemonstrationManager.Resize();
}
else if (true === _obj["next"])
{
_this.WordControl.DemonstrationManager.NextSlide(true);
}
else if (true === _obj["prev"])
{
_this.WordControl.DemonstrationManager.PrevSlide(true);
}
else if (undefined !== _obj["go_to_slide"])
{
_this.WordControl.DemonstrationManager.GoToSlide(_obj["go_to_slide"], true);
}
else if (true === _obj["play"])
{
var _isNowPlaying = _this.WordControl.DemonstrationManager.IsPlayMode;
_this.WordControl.DemonstrationManager.Play(true);
var _elem = document.getElementById("dem_id_play_span");
if (_elem && !_isNowPlaying)
{
_elem.classList.remove("btn-play");
_elem.classList.add("btn-pause");
_this.WordControl.reporterTimerLastStart = new Date().getTime();
_this.WordControl.reporterTimer = setInterval(_this.WordControl.reporterTimerFunc, 1000);
}
}
else if (true === _obj["pause"])
{
var _isNowPlaying = _this.WordControl.DemonstrationManager.IsPlayMode;
_this.WordControl.DemonstrationManager.Pause();
var _elem = document.getElementById("dem_id_play_span");
if (_elem && _isNowPlaying)
{
_elem.classList.remove("btn-pause");
_elem.classList.add("btn-play");
if (-1 != _this.WordControl.reporterTimer)
{
clearInterval(_this.WordControl.reporterTimer);
_this.WordControl.reporterTimer = -1;
}
_this.WordControl.reporterTimerAdd = _this.WordControl.reporterTimerFunc(true);
}
}
}
catch (err)
{
......@@ -6106,11 +6154,16 @@ background-repeat: no-repeat;\
this.EndShowMessage = undefined;
}
this.WordControl.DemonstrationManager.Play();
if (this.reporterWindow)
this.sendToReporter("{ \"main_command\" : true, \"play\" : true }");
};
asc_docs_api.prototype.DemonstrationPause = function()
{
this.WordControl.DemonstrationManager.Pause();
if (this.reporterWindow)
this.sendToReporter("{ \"main_command\" : true, \"pause\" : true }");
};
asc_docs_api.prototype.DemonstrationEndShowMessage = function(message)
......@@ -6124,11 +6177,15 @@ background-repeat: no-repeat;\
asc_docs_api.prototype.DemonstrationNextSlide = function()
{
this.WordControl.DemonstrationManager.NextSlide();
if (this.reporterWindow)
this.sendToReporter("{ \"main_command\" : true, \"next\" : true }");
};
asc_docs_api.prototype.DemonstrationPrevSlide = function()
{
this.WordControl.DemonstrationManager.PrevSlide();
if (this.reporterWindow)
this.sendToReporter("{ \"main_command\" : true, \"prev\" : true }");
};
asc_docs_api.prototype.DemonstrationGoToSlide = function(slideNum)
......@@ -6136,7 +6193,10 @@ background-repeat: no-repeat;\
this.WordControl.DemonstrationManager.GoToSlide(slideNum);
if (this.isReporterMode)
this.sendFromReporter("{ \"reporter_command\" : \"slide\", \"slide\" : " + slideNum + " }");
this.sendFromReporter("{ \"reporter_command\" : \"go_to_slide\", \"slide\" : " + slideNum + " }");
if (this.reporterWindow)
this.sendToReporter("{ \"main_command\" : true, \"go_to_slide\" : " + slideNum + " }");
};
asc_docs_api.prototype.SetDemonstrationModeOnly = 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