Commit 93a38219 authored by Oleg Korshul's avatar Oleg Korshul

reporter mode developing...

parent 9fb2e43c
......@@ -642,9 +642,56 @@ function CEditorPage(api)
_buttonsContent += "<div class=\"separator block_elem_no_select\" id=\"dem_id_sep\" style=\"left: 185px; bottom: 3px;\"></div>";
_buttonsContent += "<label class=\"block_elem_no_select\" id=\"dem_id_slides\" style=\"color:#666666;text-shadow: none;white-space: nowrap;font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 11px; position:absolute; left:207px; bottom: 7px;\">Slide 1 of 3</label>";
_buttonsContent += "<label class=\"block_elem_no_select\" id=\"dem_id_slides\" style=\"color:#666666;text-shadow: none;white-space: nowrap;font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 11px; position:absolute; left:207px; bottom: 7px;\"></label>";
demBottonsDiv.innerHTML = _buttonsContent;
// events
this.m_oApi.asc_registerCallback("asc_onDemonstrationSlideChanged", function (slideNum)
{
var _elem = document.getElementById("dem_id_slides");
if (!_elem)
return;
var _count = window.editor.getCountPages();
var _current = slideNum + 1;
if (_current > _count)
_current = _count;
_elem.innerHTML = "Slide " + _current + " of " + _count;
});
this.m_oApi.asc_registerCallback("asc_onEndDemonstration", function ()
{
try
{
window.postMessage("{ \"reporter_command\" : \"end\" }", "*");
}
catch (err)
{
}
});
document.getElementById("dem_id_end").onclick = function() {
window.editor.EndDemonstration();
};
document.getElementById("dem_id_prev").onclick = function() {
window.editor.DemonstrationPrevSlide();
};
document.getElementById("dem_id_next").onclick = function() {
window.editor.DemonstrationNextSlide();
};
window.onbeforeunload = function(e)
{
window.editor.sync_endDemonstration();
};
}
// --------------------------------------------------------------------------
......@@ -3645,9 +3692,17 @@ function CEditorPage(api)
this.GoToPage = function(lPageNum, isFromZoom, bIsAttack)
{
if (this.m_oApi.isReporterMode && !this.DemonstrationManager.Mode)
if (this.m_oApi.isReporterMode)
{
this.m_oApi.StartDemonstration("id_reporter_dem", 0);
if (!this.DemonstrationManager.Mode)
{
// first run
this.m_oApi.StartDemonstration("id_reporter_dem", 0);
}
else
{
this.m_oApi.DemonstrationGoToSlide(lPageNum);
}
return;
}
......
......@@ -3159,6 +3159,9 @@ function CDemonstrationManager(htmlpage)
if (!this.Mode)
return;
if (this.HtmlPage.m_oApi.isReporterMode)
window.postMessage("{ \"reporter_command\" : \"next\" }", "*");
this.CorrectSlideNum();
var _is_transition = this.Transition.IsPlaying();
......@@ -3187,6 +3190,9 @@ function CDemonstrationManager(htmlpage)
if (!this.Mode)
return;
if (this.HtmlPage.m_oApi.isReporterMode)
window.postMessage("{ \"reporter_command\" : \"prev\" }", "*");
if (0 != this.SlideNum)
{
this.CorrectSlideNum();
......
......@@ -5912,6 +5912,45 @@ background-repeat: no-repeat;\
this.reporterStartObject = null;
_this.reporterWindow.postMessage(JSON.stringify(_msg_), '*');
return;
}
try
{
var _obj = JSON.parse(e.data);
if (undefined == _obj["reporter_command"])
return;
switch (_obj["reporter_command"])
{
case "end":
{
_this.EndDemonstration();
break;
}
case "next":
{
_this.DemonstrationNextSlide();
break;
}
case "prev":
{
_this.DemonstrationPrevSlide();
break;
}
case "slide":
{
_this.DemonstrationGoToSlide(_obj["slide"]);
break;
}
default:
break;
}
}
catch (err)
{
}
};
......@@ -5951,6 +5990,9 @@ background-repeat: no-repeat;\
asc_docs_api.prototype.DemonstrationGoToSlide = function(slideNum)
{
this.WordControl.DemonstrationManager.GoToSlide(slideNum);
if (this.isReporterMode)
window.postMessage("{ \"reporter_command\" : \"slide\", \"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