Commit 0a3d87e1 authored by Oleg Korshul's avatar Oleg Korshul

.

parent ed9ad629
...@@ -244,7 +244,20 @@ window["DesktopOfflineAppDocumentSignatures"] = function(_json) ...@@ -244,7 +244,20 @@ window["DesktopOfflineAppDocumentSignatures"] = function(_json)
_editor.signatures = []; _editor.signatures = [];
var _signatures = JSON.parse(_json); var _signatures = null;
try
{
_signatures = JSON.parse(_json);
}
catch (err)
{
return;
}
if (!_signatures)
return;
var _count = _signatures["count"]; var _count = _signatures["count"];
var _data = _signatures["data"]; var _data = _signatures["data"];
var _sign; var _sign;
......
...@@ -384,39 +384,6 @@ ...@@ -384,39 +384,6 @@
} }
return false; return false;
} }
function Utf8ArrayToStr(array) {
var out, i, len, c;
var char2, char3;
out = "";
len = array.length;
i = 0;
while(i < len) {
c = array[i++];
switch(c >> 4)
{
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
// 0xxxxxxx
out += String.fromCharCode(c);
break;
case 12: case 13:
// 110x xxxx 10xx xxxx
char2 = array[i++];
out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));
break;
case 14:
// 1110 xxxx 10xx xxxx 10xx xxxx
char2 = array[i++];
char3 = array[i++];
out += String.fromCharCode(((c & 0x0F) << 12) |
((char2 & 0x3F) << 6) |
((char3 & 0x3F) << 0));
break;
}
}
return out;
}
function openFileCommand(binUrl, changesUrl, Signature, callback) function openFileCommand(binUrl, changesUrl, Signature, callback)
{ {
var bError = false, oResult = new OpenFileResult(), bEndLoadFile = false, bEndLoadChanges = false; var bError = false, oResult = new OpenFileResult(), bEndLoadFile = false, bEndLoadChanges = false;
...@@ -449,8 +416,7 @@ ...@@ -449,8 +416,7 @@
if (oResult.bSerFormat) { if (oResult.bSerFormat) {
oResult.data = stream; oResult.data = stream;
} else { } else {
//todo arraybuffer oResult.data = stream;
oResult.data = Utf8ArrayToStr(stream.data);
} }
} else { } else {
bError = true; bError = true;
......
...@@ -1737,7 +1737,7 @@ function CDrawingDocument() ...@@ -1737,7 +1737,7 @@ function CDrawingDocument()
} }
var x_pix = (__x * g_dKoef_mm_to_pix + 10 + (_word_control.m_oMainParent.AbsolutePosition.L + _word_control.m_oNotesContainer.AbsolutePosition.L) * g_dKoef_mm_to_pix) >> 0; var x_pix = (__x * g_dKoef_mm_to_pix + 10 + (_word_control.m_oMainParent.AbsolutePosition.L + _word_control.m_oNotesContainer.AbsolutePosition.L) * g_dKoef_mm_to_pix) >> 0;
var y_pix = (__y * g_dKoef_mm_to_pix + 10 + (_word_control.m_oMainParent.AbsolutePosition.T + _word_control.m_oNotesContainer.AbsolutePosition.T) * g_dKoef_mm_to_pix) >> 0; var y_pix = (__y * g_dKoef_mm_to_pix + (_word_control.m_oMainParent.AbsolutePosition.T + _word_control.m_oNotesContainer.AbsolutePosition.T) * g_dKoef_mm_to_pix) >> 0;
return {X: x_pix, Y: y_pix, Error: false}; return {X: x_pix, Y: y_pix, Error: false};
} }
......
...@@ -283,27 +283,3 @@ Asc['asc_docs_api'].prototype.asc_setAdvancedOptions = function(idOption, option ...@@ -283,27 +283,3 @@ Asc['asc_docs_api'].prototype.asc_setAdvancedOptions = function(idOption, option
} }
}; };
Asc['asc_docs_api'].prototype["asc_setAdvancedOptions"] = Asc['asc_docs_api'].prototype.asc_setAdvancedOptions; Asc['asc_docs_api'].prototype["asc_setAdvancedOptions"] = Asc['asc_docs_api'].prototype.asc_setAdvancedOptions;
Asc['asc_docs_api'].prototype.DemonstrationReporterStart = function(startObject)
{
this.reporterStartObject = startObject;
window["AscDesktopEditor"]["startReporter"](window.location.ref);
};
Asc['asc_docs_api'].prototype.DemonstrationReporterEnd = function()
{
window["AscDesktopEditor"]["endReporter"]();
};
Asc['asc_docs_api'].prototype.sendToReporter = function(value)
{
window["AscDesktopEditor"]["sendToReporter"](value);
};
Asc['asc_docs_api'].prototype.sendFromReporter = function(value)
{
window["AscDesktopEditor"]["sendFromReporter"](value);
};
Asc['asc_docs_api'].prototype["sendFromReporter"] = Asc['asc_docs_api'].prototype.sendFromReporter;
\ No newline at end of file
...@@ -5860,10 +5860,11 @@ background-repeat: no-repeat;\ ...@@ -5860,10 +5860,11 @@ background-repeat: no-repeat;\
asc_docs_api.prototype.StartDemonstration = function(div_id, slidestart_num, reporterStartObject) asc_docs_api.prototype.StartDemonstration = function(div_id, slidestart_num, reporterStartObject)
{ {
if (reporterStartObject && !this.isReporterMode) var is_reporter = (reporterStartObject && !this.isReporterMode);
if (is_reporter)
this.DemonstrationReporterStart(reporterStartObject); this.DemonstrationReporterStart(reporterStartObject);
if (this.reporterWindow) if (is_reporter && (this.reporterWindow || window["AscDesktopEditor"]))
this.WordControl.DemonstrationManager.StartWaitReporter(div_id, slidestart_num, true); this.WordControl.DemonstrationManager.StartWaitReporter(div_id, slidestart_num, true);
else else
this.WordControl.DemonstrationManager.Start(div_id, slidestart_num, true); this.WordControl.DemonstrationManager.Start(div_id, slidestart_num, true);
...@@ -5881,6 +5882,12 @@ background-repeat: no-repeat;\ ...@@ -5881,6 +5882,12 @@ background-repeat: no-repeat;\
{ {
this.reporterStartObject = startObject; this.reporterStartObject = startObject;
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["startReporter"](window.location.href);
return;
}
var dualScreenLeft = (window.screenLeft != undefined) ? window.screenLeft : screen.left; var dualScreenLeft = (window.screenLeft != undefined) ? window.screenLeft : screen.left;
var dualScreenTop = (window.screenTop != undefined) ? window.screenTop : screen.top; var dualScreenTop = (window.screenTop != undefined) ? window.screenTop : screen.top;
...@@ -5906,6 +5913,12 @@ background-repeat: no-repeat;\ ...@@ -5906,6 +5913,12 @@ background-repeat: no-repeat;\
asc_docs_api.prototype.DemonstrationReporterEnd = function() asc_docs_api.prototype.DemonstrationReporterEnd = function()
{ {
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["endReporter"]();
return;
}
if (!this.reporterWindow) if (!this.reporterWindow)
return; return;
...@@ -5995,12 +6008,24 @@ background-repeat: no-repeat;\ ...@@ -5995,12 +6008,24 @@ background-repeat: no-repeat;\
asc_docs_api.prototype.sendToReporter = function(value) asc_docs_api.prototype.sendToReporter = function(value)
{ {
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["sendToReporter"](value);
return;
}
if (this.reporterWindow) if (this.reporterWindow)
this.reporterWindow.postMessage(value, "*"); this.reporterWindow.postMessage(value, "*");
}; };
asc_docs_api.prototype.sendFromReporter = function(value) asc_docs_api.prototype.sendFromReporter = function(value)
{ {
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["sendFromReporter"](value);
return;
}
window.postMessage(value, "*"); window.postMessage(value, "*");
}; };
...@@ -7217,6 +7242,9 @@ background-repeat: no-repeat;\ ...@@ -7217,6 +7242,9 @@ background-repeat: no-repeat;\
asc_docs_api.prototype["asc_OnHideContextMenu"] = asc_docs_api.prototype.asc_OnHideContextMenu; asc_docs_api.prototype["asc_OnHideContextMenu"] = asc_docs_api.prototype.asc_OnHideContextMenu;
asc_docs_api.prototype["asc_OnShowContextMenu"] = asc_docs_api.prototype.asc_OnShowContextMenu; asc_docs_api.prototype["asc_OnShowContextMenu"] = asc_docs_api.prototype.asc_OnShowContextMenu;
asc_docs_api.prototype["DemonstrationReporterMessages"] = asc_docs_api.prototype.DemonstrationReporterMessages;
asc_docs_api.prototype["DemonstrationToReporterMessages"] = asc_docs_api.prototype.DemonstrationToReporterMessages;
window['Asc']['asc_CCommentData'] = window['Asc'].asc_CCommentData = asc_CCommentData; window['Asc']['asc_CCommentData'] = window['Asc'].asc_CCommentData = asc_CCommentData;
asc_CCommentData.prototype['asc_getText'] = asc_CCommentData.prototype.asc_getText; asc_CCommentData.prototype['asc_getText'] = asc_CCommentData.prototype.asc_getText;
......
...@@ -194,6 +194,18 @@ function CStream(data, size) ...@@ -194,6 +194,18 @@ function CStream(data, size)
function CreateDocumentData(szSrc) function CreateDocumentData(szSrc)
{ {
var isBase64 = false;
if (typeof(szSrc) == "string" || szSrc instanceof String){
isBase64 = true;
}
var stream = null;
if (!isBase64)
{
stream = new CStream(szSrc.data, szSrc.size);
return stream;
}
var srcLen = szSrc.length; var srcLen = szSrc.length;
var nWritten = 0; var nWritten = 0;
...@@ -216,7 +228,7 @@ function CreateDocumentData(szSrc) ...@@ -216,7 +228,7 @@ function CreateDocumentData(szSrc)
return null; return null;
var pointer = g_memory.Alloc(dstLen); var pointer = g_memory.Alloc(dstLen);
var stream = new CStream(pointer.data, dstLen); stream = new CStream(pointer.data, dstLen);
stream.obj = pointer.obj; stream.obj = pointer.obj;
var dstPx = stream.data; var dstPx = stream.data;
......
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