Commit 1210968a authored by Oleg Korshul's avatar Oleg Korshul

Fix bug 33280 , bug 33301

parent e8924bcd
...@@ -77,28 +77,28 @@ var AscCommonSlide = window["AscCommonSlide"]; ...@@ -77,28 +77,28 @@ var AscCommonSlide = window["AscCommonSlide"];
function ConvertJSC_Array(_array) function ConvertJSC_Array(_array)
{ {
var _len = _array.length; var _len = _array.length;
var ret = new Uint8Array(_len); var ret = new Uint8Array(_len);
for (var i = 0; i < _len; i++) for (var i = 0; i < _len; i++)
ret[i] = _array.getAt(i); ret[i] = _array.getAt(i);
return ret; return ret;
} }
function Image() function Image()
{ {
this.src = ""; this.src = "";
this.onload = function() this.onload = function ()
{ {
} };
this.onerror = function() this.onerror = function ()
{ {
} };
} }
function _image_data() function _image_data()
{ {
this.data = null; this.data = null;
this.length = 0; this.length = 0;
} }
function native_pattern_fill() function native_pattern_fill()
...@@ -106,7 +106,9 @@ function native_pattern_fill() ...@@ -106,7 +106,9 @@ function native_pattern_fill()
} }
native_pattern_fill.prototype = native_pattern_fill.prototype =
{ {
setTransform : function(transform) {} setTransform: function (transform)
{
}
}; };
function native_gradient_fill() function native_gradient_fill()
...@@ -114,111 +116,182 @@ function native_gradient_fill() ...@@ -114,111 +116,182 @@ function native_gradient_fill()
} }
native_gradient_fill.prototype = native_gradient_fill.prototype =
{ {
addColorStop : function(offset,color) {} addColorStop: function (offset, color)
{
}
}; };
function native_context2d(parent) function native_context2d(parent)
{ {
this.canvas = parent; this.canvas = parent;
this.globalAlpha = 0; this.globalAlpha = 0;
this.globalCompositeOperation = ""; this.globalCompositeOperation = "";
this.fillStyle = ""; this.fillStyle = "";
this.strokeStyle = ""; this.strokeStyle = "";
this.lineWidth = 0; this.lineWidth = 0;
this.lineCap = 0; this.lineCap = 0;
this.lineJoin = 0; this.lineJoin = 0;
this.miterLimit = 0; this.miterLimit = 0;
this.shadowOffsetX = 0; this.shadowOffsetX = 0;
this.shadowOffsetY = 0; this.shadowOffsetY = 0;
this.shadowBlur = 0; this.shadowBlur = 0;
this.shadowColor = 0; this.shadowColor = 0;
this.font = ""; this.font = "";
this.textAlign = 0; this.textAlign = 0;
this.textBaseline = 0; this.textBaseline = 0;
} }
native_context2d.prototype = native_context2d.prototype =
{ {
save : function() {}, save: function ()
restore : function() {}, {
},
scale : function(x,y) {}, restore: function ()
rotate : function(angle) {}, {
translate : function(x,y) {}, },
transform : function(m11,m12,m21,m22,dx,dy) {},
setTransform : function(m11,m12,m21,m22,dx,dy) {}, scale: function (x, y)
{
createLinearGradient : function(x0,y0,x1,y1) { return new native_gradient_fill(); }, },
createRadialGradient : function(x0,y0,r0,x1,y1,r1) { return null; }, rotate: function (angle)
createPattern : function(image,repetition) { return new native_pattern_fill(); }, {
},
clearRect : function(x,y,w,h) {}, translate: function (x, y)
fillRect : function(x,y,w,h) {}, {
strokeRect : function(x,y,w,h) {}, },
transform: function (m11, m12, m21, m22, dx, dy)
beginPath : function() {}, {
closePath : function() {}, },
moveTo : function(x,y) {}, setTransform: function (m11, m12, m21, m22, dx, dy)
lineTo : function(x,y) {}, {
quadraticCurveTo : function(cpx,cpy,x,y) {}, },
bezierCurveTo : function(cp1x,cp1y,cp2x,cp2y,x,y) {},
arcTo : function(x1,y1,x2,y2,radius) {}, createLinearGradient: function (x0, y0, x1, y1)
rect : function(x,y,w,h) {}, {
arc : function(x,y,radius,startAngle,endAngle,anticlockwise) {}, return new native_gradient_fill();
},
fill : function() {}, createRadialGradient: function (x0, y0, r0, x1, y1, r1)
stroke : function() {}, {
clip : function() {}, return null;
isPointInPath : function(x,y) {}, },
drawFocusRing : function(element,xCaret,yCaret,canDrawCustom) {}, createPattern: function (image, repetition)
{
fillText : function(text,x,y,maxWidth) {}, return new native_pattern_fill();
strokeText : function(text,x,y,maxWidth) {}, },
measureText : function(text) {},
clearRect: function (x, y, w, h)
drawImage : function(img_elem,dx_or_sx,dy_or_sy,dw_or_sw,dh_or_sh,dx,dy,dw,dh) {}, {
},
createImageData : function(imagedata_or_sw,sh) fillRect: function (x, y, w, h)
{ {
var _data = new _image_data(); },
_data.length = imagedata_or_sw * sh * 4; strokeRect: function (x, y, w, h)
_data.data = (typeof(Uint8Array) != 'undefined') ? new Uint8Array(_data.length) : new Array(_data.length); {
return _data; },
},
getImageData : function(sx,sy,sw,sh) {}, beginPath: function ()
putImageData : function(image_data,dx,dy,dirtyX,dirtyY,dirtyWidth,dirtyHeight) {} {
},
closePath: function ()
{
},
moveTo: function (x, y)
{
},
lineTo: function (x, y)
{
},
quadraticCurveTo: function (cpx, cpy, x, y)
{
},
bezierCurveTo: function (cp1x, cp1y, cp2x, cp2y, x, y)
{
},
arcTo: function (x1, y1, x2, y2, radius)
{
},
rect: function (x, y, w, h)
{
},
arc: function (x, y, radius, startAngle, endAngle, anticlockwise)
{
},
fill: function ()
{
},
stroke: function ()
{
},
clip: function ()
{
},
isPointInPath: function (x, y)
{
},
drawFocusRing: function (element, xCaret, yCaret, canDrawCustom)
{
},
fillText: function (text, x, y, maxWidth)
{
},
strokeText: function (text, x, y, maxWidth)
{
},
measureText: function (text)
{
},
drawImage: function (img_elem, dx_or_sx, dy_or_sy, dw_or_sw, dh_or_sh, dx, dy, dw, dh)
{
},
createImageData: function (imagedata_or_sw, sh)
{
var _data = new _image_data();
_data.length = imagedata_or_sw * sh * 4;
_data.data = (typeof(Uint8Array) != 'undefined') ? new Uint8Array(_data.length) : new Array(_data.length);
return _data;
},
getImageData: function (sx, sy, sw, sh)
{
},
putImageData: function (image_data, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight)
{
}
}; };
function native_canvas() function native_canvas()
{ {
this.id = ""; this.id = "";
this.width = 300; this.width = 300;
this.height = 150; this.height = 150;
this.nodeType = 1; this.nodeType = 1;
} }
native_canvas.prototype = native_canvas.prototype =
{ {
getContext : function(type) getContext: function (type)
{ {
if (type == "2d") if (type == "2d")
return new native_context2d(this); return new native_context2d(this);
return null; return null;
}, },
toDataUrl : function(type) toDataUrl: function (type)
{ {
return ""; return "";
}, },
addEventListener : function() addEventListener: function ()
{ {
}, },
attr : function() attr: function ()
{ {
} }
}; };
var _null_object = {}; var _null_object = {};
...@@ -236,58 +309,117 @@ _null_object.body = _null_object; ...@@ -236,58 +309,117 @@ _null_object.body = _null_object;
_null_object.ownerDocument = _null_object; _null_object.ownerDocument = _null_object;
_null_object.defaultView = _null_object; _null_object.defaultView = _null_object;
_null_object.addEventListener = function(){}; _null_object.addEventListener = function ()
_null_object.setAttribute = function(){}; {
_null_object.getElementsByTagName = function() { return []; }; };
_null_object.appendChild = function() {}; _null_object.setAttribute = function ()
_null_object.removeChild = function() {}; {
_null_object.insertBefore = function() {}; };
_null_object.getElementsByTagName = function ()
{
return [];
};
_null_object.appendChild = function ()
{
};
_null_object.removeChild = function ()
{
};
_null_object.insertBefore = function ()
{
};
_null_object.childNodes = []; _null_object.childNodes = [];
_null_object.parent = _null_object; _null_object.parent = _null_object;
_null_object.parentNode = _null_object; _null_object.parentNode = _null_object;
_null_object.find = function() { return this; }; _null_object.find = function ()
_null_object.appendTo = function() { return this; }; {
_null_object.css = function() { return this; }; return this;
_null_object.width = function() { return 0; }; };
_null_object.height = function() { return 0; }; _null_object.appendTo = function ()
_null_object.attr = function() { return this; }; {
_null_object.prop = function() { return this; }; return this;
_null_object.val = function() { return this; }; };
_null_object.remove = function() {}; _null_object.css = function ()
_null_object.getComputedStyle = function() { return null; }; {
_null_object.getContext = function(type) { return this;
if (type == "2d") };
return new native_context2d(this); _null_object.width = function ()
return null; {
return 0;
};
_null_object.height = function ()
{
return 0;
};
_null_object.attr = function ()
{
return this;
};
_null_object.prop = function ()
{
return this;
};
_null_object.val = function ()
{
return this;
};
_null_object.remove = function ()
{
};
_null_object.getComputedStyle = function ()
{
return null;
};
_null_object.getContext = function (type)
{
if (type == "2d")
return new native_context2d(this);
return null;
}; };
window._null_object = _null_object; window._null_object = _null_object;
document.createElement = function(type) document.createElement = function (type)
{ {
if (type && type.toLowerCase) if (type && type.toLowerCase)
{ {
if (type.toLowerCase() == "canvas") if (type.toLowerCase() == "canvas")
return new native_canvas(); return new native_canvas();
} }
return _null_object;
}
function _return_empty_html_element() { return _null_object; }; return _null_object;
};
function _return_empty_html_element()
{
return _null_object;
};
document.createDocumentFragment = _return_empty_html_element; document.createDocumentFragment = _return_empty_html_element;
document.getElementsByTagName = function(tag) { document.getElementsByTagName = function (tag)
var ret = []; {
if ("head" == tag) var ret = [];
ret.push(_null_object); if ("head" == tag)
return ret; ret.push(_null_object);
}; return ret;
document.insertBefore = function() {}; };
document.appendChild = function() {}; document.insertBefore = function ()
document.removeChild = function() {}; {
document.getElementById = function() { return _null_object; }; };
document.createComment = function() { return undefined; }; document.appendChild = function ()
{
};
document.removeChild = function ()
{
};
document.getElementById = function ()
{
return _null_object;
};
document.createComment = function ()
{
return undefined;
};
document.documentElement = _null_object; document.documentElement = _null_object;
document.body = _null_object; document.body = _null_object;
...@@ -295,18 +427,17 @@ document.body = _null_object; ...@@ -295,18 +427,17 @@ document.body = _null_object;
var native = (typeof native === undefined) ? undefined : native; var native = (typeof native === undefined) ? undefined : native;
if (!native) if (!native)
{ {
if (typeof NativeEngine === "undefined") if (typeof NativeEngine === "undefined")
{ {
native = CreateNativeEngine(); native = CreateNativeEngine();
} }
else else
{ {
native = NativeEngine; native = NativeEngine;
} }
} }
window.native = native; window.native = native;
window["native"] = native;
function GetNativeEngine() function GetNativeEngine()
{ {
...@@ -319,38 +450,38 @@ var _api = null; ...@@ -319,38 +450,38 @@ var _api = null;
function NativeOpenFileData(data, version) function NativeOpenFileData(data, version)
{ {
window.NATIVE_DOCUMENT_TYPE = window.native.GetEditorType(); window.NATIVE_DOCUMENT_TYPE = window.native.GetEditorType();
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document") if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
{ {
_api = new window["Asc"]["asc_docs_api"]({}); _api = new window["Asc"]["asc_docs_api"]({});
_api.asc_nativeOpenFile(data, version); _api.asc_nativeOpenFile(data, version);
} }
else else
{ {
_api = new window["Asc"]["spreadsheet_api"]({}); _api = new window["Asc"]["spreadsheet_api"]({});
_api.asc_nativeOpenFile(data, version); _api.asc_nativeOpenFile(data, version);
} }
Api = _api; Api = _api;
} }
function NativeOpenFile() function NativeOpenFile()
{ {
var doc_bin = window.native.GetFileString(window.native.GetFilePath()); var doc_bin = window.native.GetFileString(window.native.GetFilePath());
window.NATIVE_DOCUMENT_TYPE = window.native.GetEditorType(); window.NATIVE_DOCUMENT_TYPE = window.native.GetEditorType();
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document") if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
{ {
_api = new window["Asc"]["asc_docs_api"](""); _api = new window["Asc"]["asc_docs_api"]("");
_api.asc_nativeOpenFile(doc_bin); _api.asc_nativeOpenFile(doc_bin);
} }
else else
{ {
_api = new window["Asc"]["spreadsheet_api"](); _api = new window["Asc"]["spreadsheet_api"]();
_api.asc_nativeOpenFile(doc_bin); _api.asc_nativeOpenFile(doc_bin);
} }
Api = _api; Api = _api;
} }
function NativeOpenFile2(_params) function NativeOpenFile2(_params)
...@@ -359,41 +490,43 @@ function NativeOpenFile2(_params) ...@@ -359,41 +490,43 @@ function NativeOpenFile2(_params)
window.g_file_path = "native_open_file"; window.g_file_path = "native_open_file";
window.NATIVE_DOCUMENT_TYPE = window.native.GetEditorType(); window.NATIVE_DOCUMENT_TYPE = window.native.GetEditorType();
var doc_bin = window.native.GetFileString(window.g_file_path); var doc_bin = window.native.GetFileString(window.g_file_path);
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document") if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
{ {
_api = new window["Asc"]["asc_docs_api"](""); _api = new window["Asc"]["asc_docs_api"]("");
if (undefined !== _api.Native_Editor_Initialize_Settings) if (undefined !== _api.Native_Editor_Initialize_Settings)
{ {
_api.Native_Editor_Initialize_Settings(_params); _api.Native_Editor_Initialize_Settings(_params);
} }
_api.asc_nativeOpenFile(doc_bin); _api.asc_nativeOpenFile(doc_bin);
if (_api.NativeAfterLoad) if (_api.NativeAfterLoad)
_api.NativeAfterLoad(); _api.NativeAfterLoad();
if(_api.__SendThemeColorScheme) if (_api.__SendThemeColorScheme)
_api.__SendThemeColorScheme(); _api.__SendThemeColorScheme();
if(_api.get_PropertyThemeColorSchemes){ if (_api.get_PropertyThemeColorSchemes)
var schemes = _api.get_PropertyThemeColorSchemes(); {
if (schemes) { var schemes = _api.get_PropertyThemeColorSchemes();
var st = global_memory_stream_menu; if (schemes)
st["ClearNoAttack"](); {
AscCommon.asc_WriteColorSchemes(schemes, st); var st = global_memory_stream_menu;
window["native"]["OnCallMenuEvent"](2404, st); // ASC_MENU_EVENT_TYPE_COLOR_SCHEMES st["ClearNoAttack"]();
} AscCommon.asc_WriteColorSchemes(schemes, st);
} window["native"]["OnCallMenuEvent"](2404, st); // ASC_MENU_EVENT_TYPE_COLOR_SCHEMES
} }
else }
{ }
_api = new window["Asc"]["spreadsheet_api"](); else
_api.asc_nativeOpenFile(doc_bin); {
} _api = new window["Asc"]["spreadsheet_api"]();
_api.asc_nativeOpenFile(doc_bin);
Api = _api; }
Api = _api;
} }
function NativeCalculateFile() function NativeCalculateFile()
...@@ -403,94 +536,94 @@ function NativeCalculateFile() ...@@ -403,94 +536,94 @@ function NativeCalculateFile()
function NativeApplyChangesData(data, isFull) function NativeApplyChangesData(data, isFull)
{ {
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document") if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
{ {
_api.asc_nativeApplyChanges2(data, isFull); _api.asc_nativeApplyChanges2(data, isFull);
} }
else else
{ {
_api.asc_nativeApplyChanges2(data, isFull); _api.asc_nativeApplyChanges2(data, isFull);
} }
} }
function NativeApplyChanges() function NativeApplyChanges()
{ {
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document") if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
{ {
var __changes = []; var __changes = [];
var _count_main = window.native.GetCountChanges(); var _count_main = window.native.GetCountChanges();
for (var i = 0; i < _count_main; i++) for (var i = 0; i < _count_main; i++)
{ {
var _changes_file = window.native.GetChangesFile(i); var _changes_file = window.native.GetChangesFile(i);
var _changes = JSON.parse(window.native.GetFileString(_changes_file)); var _changes = JSON.parse(window.native.GetFileString(_changes_file));
for (var j = 0; j < _changes.length; j++) for (var j = 0; j < _changes.length; j++)
{ {
__changes.push(_changes[j]); __changes.push(_changes[j]);
} }
} }
_api.asc_nativeApplyChanges(__changes); _api.asc_nativeApplyChanges(__changes);
} }
else else
{ {
var __changes = []; var __changes = [];
var _count_main = window.native.GetCountChanges(); var _count_main = window.native.GetCountChanges();
for (var i = 0; i < _count_main; i++) for (var i = 0; i < _count_main; i++)
{ {
var _changes_file = window.native.GetChangesFile(i); var _changes_file = window.native.GetChangesFile(i);
var _changes = JSON.parse(window.native.GetFileString(_changes_file)); var _changes = JSON.parse(window.native.GetFileString(_changes_file));
for (var j = 0; j < _changes.length; j++) for (var j = 0; j < _changes.length; j++)
{ {
__changes.push(_changes[j]); __changes.push(_changes[j]);
} }
} }
_api.asc_nativeApplyChanges(__changes); _api.asc_nativeApplyChanges(__changes);
} }
} }
function NativeGetFileString() function NativeGetFileString()
{ {
return _api.asc_nativeGetFile(); return _api.asc_nativeGetFile();
} }
function NativeGetFileData() function NativeGetFileData()
{ {
return _api.asc_nativeGetFileData(); return _api.asc_nativeGetFileData();
} }
function NativeGetFileDataHtml() function NativeGetFileDataHtml()
{ {
if (_api.asc_nativeGetHtml) if (_api.asc_nativeGetHtml)
return _api.asc_nativeGetHtml(); return _api.asc_nativeGetHtml();
return ""; return "";
} }
function NativeStartMailMergeByList(database) function NativeStartMailMergeByList(database)
{ {
if (_api.asc_StartMailMergeByList) if (_api.asc_StartMailMergeByList)
return _api.asc_StartMailMergeByList(database); return _api.asc_StartMailMergeByList(database);
return undefined; return undefined;
} }
function NativePreviewMailMergeResult(index) function NativePreviewMailMergeResult(index)
{ {
if (_api.asc_PreviewMailMergeResult) if (_api.asc_PreviewMailMergeResult)
return _api.asc_PreviewMailMergeResult(index); return _api.asc_PreviewMailMergeResult(index);
return undefined; return undefined;
} }
function NativeGetMailMergeFiledValue(index, name) function NativeGetMailMergeFiledValue(index, name)
{ {
if (_api.asc_GetMailMergeFiledValue) if (_api.asc_GetMailMergeFiledValue)
return _api.asc_GetMailMergeFiledValue(index, name); return _api.asc_GetMailMergeFiledValue(index, name);
return ""; return "";
} }
function GetNativeCountPages() function GetNativeCountPages()
{ {
return _api.asc_nativePrintPagesCount(); return _api.asc_nativePrintPagesCount();
} }
function GetNativeFileDataPDF(_param) function GetNativeFileDataPDF(_param)
{ {
return _api.asc_nativeGetPDF(_param); return _api.asc_nativeGetPDF(_param);
} }
window.memory1 = null; window.memory1 = null;
...@@ -498,38 +631,38 @@ window.memory2 = null; ...@@ -498,38 +631,38 @@ window.memory2 = null;
function GetNativePageBase64(pageIndex) function GetNativePageBase64(pageIndex)
{ {
if (null == window.memory1) if (null == window.memory1)
window.memory1 = CreateNativeMemoryStream(); window.memory1 = CreateNativeMemoryStream();
else else
window.memory1.ClearNoAttack(); window.memory1.ClearNoAttack();
if (null == window.memory2) if (null == window.memory2)
window.memory2 = CreateNativeMemoryStream(); window.memory2 = CreateNativeMemoryStream();
else else
window.memory2.ClearNoAttack(); window.memory2.ClearNoAttack();
if (native_renderer == null) if (native_renderer == null)
{ {
native_renderer = _api.asc_nativeCheckPdfRenderer(window.memory1, window.memory2); native_renderer = _api.asc_nativeCheckPdfRenderer(window.memory1, window.memory2);
} }
else else
{ {
window.memory1.ClearNoAttack(); window.memory1.ClearNoAttack();
window.memory2.ClearNoAttack(); window.memory2.ClearNoAttack();
} }
_api.asc_nativePrint(native_renderer, pageIndex); _api.asc_nativePrint(native_renderer, pageIndex);
return window.memory1; return window.memory1;
} }
function GetNativePageMeta(pageIndex) function GetNativePageMeta(pageIndex)
{ {
return _api.GetNativePageMeta(pageIndex); return _api.GetNativePageMeta(pageIndex);
} }
function GetNativeId() function GetNativeId()
{ {
return window.native.GetFileId(); return window.native.GetFileId();
} }
// для работы с таймерами // для работы с таймерами
...@@ -538,177 +671,186 @@ window.NativeTimeoutObject = {}; ...@@ -538,177 +671,186 @@ window.NativeTimeoutObject = {};
function clearTimeout(_id) function clearTimeout(_id)
{ {
if (!window.NativeSupportTimeouts) if (!window.NativeSupportTimeouts)
return; return;
window.NativeTimeoutObject["" + _id] = undefined; window.NativeTimeoutObject["" + _id] = undefined;
window.native["ClearTimeout"](_id); window.native["ClearTimeout"](_id);
} }
function setTimeout(func, interval) function setTimeout(func, interval)
{ {
if (!window.NativeSupportTimeouts) if (!window.NativeSupportTimeouts)
return; return;
var _id = window.native["GenerateTimeoutId"](interval); var _id = window.native["GenerateTimeoutId"](interval);
window.NativeTimeoutObject["" + _id] = func; window.NativeTimeoutObject["" + _id] = func;
return _id; return _id;
} }
window.native.Call_TimeoutFire = function(_id) window.native.Call_TimeoutFire = function (_id)
{ {
if (!window.NativeSupportTimeouts) if (!window.NativeSupportTimeouts)
return; return;
var _prop = "" + _id; var _prop = "" + _id;
var _func = window.NativeTimeoutObject[_prop]; var _func = window.NativeTimeoutObject[_prop];
window.NativeTimeoutObject[_prop] = undefined; window.NativeTimeoutObject[_prop] = undefined;
if (!_func) if (!_func)
return; return;
_func.call(null); _func.call(null);
_func = null; _func = null;
}; };
function clearInterval(_id) function clearInterval(_id)
{ {
if (!window.NativeSupportTimeouts) if (!window.NativeSupportTimeouts)
return; return;
window.NativeTimeoutObject["" + _id] = undefined; window.NativeTimeoutObject["" + _id] = undefined;
window.native["ClearTimeout"](_id); window.native["ClearTimeout"](_id);
} }
function setInterval(func, interval) function setInterval(func, interval)
{ {
if (!window.NativeSupportTimeouts) if (!window.NativeSupportTimeouts)
return; return;
var _intervalFunc = function() var _intervalFunc = function ()
{ {
func.call(null); func.call(null);
setTimeout(func, interval); setTimeout(func, interval);
}; };
var _id = window.native["GenerateTimeoutId"](interval); var _id = window.native["GenerateTimeoutId"](interval);
window.NativeTimeoutObject["" + _id] = _intervalFunc; window.NativeTimeoutObject["" + _id] = _intervalFunc;
return _id; return _id;
} }
window.clearTimeout = clearTimeout; window.clearTimeout = clearTimeout;
window.setTimeout = setTimeout; window.setTimeout = setTimeout;
window.clearInterval = clearInterval; window.clearInterval = clearInterval;
window.setInterval = setInterval; window.setInterval = setInterval;
var console = { var console = {
log : function(param) { window.native.ConsoleLog(param); }, log: function (param)
time : function(param) {}, {
timeEnd : function(param) {} window.native.ConsoleLog(param);
},
time: function (param)
{
},
timeEnd: function (param)
{
}
}; };
window["NativeCorrectImageUrlOnPaste"] = function(url) { window["NativeCorrectImageUrlOnPaste"] = function (url)
return window["native"]["CorrectImageUrlOnPaste"](url); {
return window["native"]["CorrectImageUrlOnPaste"](url);
}; };
window["NativeCorrectImageUrlOnCopy"] = function(url) { window["NativeCorrectImageUrlOnCopy"] = function (url)
return window["native"]["CorrectImageUrlOnCopy"](url); {
return window["native"]["CorrectImageUrlOnCopy"](url);
}; };
var global_memory_stream_menu = CreateNativeMemoryStream(); var global_memory_stream_menu = CreateNativeMemoryStream();
// HTML page interface // HTML page interface
window.native.Call_OnUpdateOverlay = function(param) window.native.Call_OnUpdateOverlay = function (param)
{ {
return _api.Call_OnUpdateOverlay(param); return _api.Call_OnUpdateOverlay(param);
}; };
window.native.Call_OnMouseDown = function(e) window.native.Call_OnMouseDown = function (e)
{ {
return _api.Call_OnMouseDown(e); return _api.Call_OnMouseDown(e);
}; };
window.native.Call_OnMouseUp = function(e) window.native.Call_OnMouseUp = function (e)
{ {
return _api.Call_OnMouseUp(e); return _api.Call_OnMouseUp(e);
}; };
window.native.Call_OnMouseMove = function(e) window.native.Call_OnMouseMove = function (e)
{ {
return _api.Call_OnMouseMove(e); return _api.Call_OnMouseMove(e);
}; };
window.native.Call_OnCheckMouseDown = function(e) window.native.Call_OnCheckMouseDown = function (e)
{ {
return _api.Call_OnCheckMouseDown(e); return _api.Call_OnCheckMouseDown(e);
}; };
window.native.Call_OnKeyDown = function(e) window.native.Call_OnKeyDown = function (e)
{ {
return _api.Call_OnKeyDown(e); return _api.Call_OnKeyDown(e);
}; };
window.native.Call_OnKeyPress = function(e) window.native.Call_OnKeyPress = function (e)
{ {
return _api.Call_OnKeyPress(e); return _api.Call_OnKeyPress(e);
}; };
window.native.Call_OnKeyUp = function(e) window.native.Call_OnKeyUp = function (e)
{ {
return _api.Call_OnKeyUp(e); return _api.Call_OnKeyUp(e);
}; };
window.native.Call_OnKeyboardEvent = function(e) window.native.Call_OnKeyboardEvent = function (e)
{ {
return _api.Call_OnKeyboardEvent(e); return _api.Call_OnKeyboardEvent(e);
}; };
window.native.Call_CalculateResume = function() window.native.Call_CalculateResume = function ()
{ {
return _api.Call_CalculateResume(); return _api.Call_CalculateResume();
}; };
window.native.Call_TurnOffRecalculate = function() window.native.Call_TurnOffRecalculate = function ()
{ {
return _api.Call_TurnOffRecalculate(); return _api.Call_TurnOffRecalculate();
}; };
window.native.Call_TurnOnRecalculate = function() window.native.Call_TurnOnRecalculate = function ()
{ {
return _api.Call_TurnOnRecalculate(); return _api.Call_TurnOnRecalculate();
}; };
window.native.Call_CheckTargetUpdate = function() window.native.Call_CheckTargetUpdate = function ()
{ {
return _api.Call_CheckTargetUpdate(); return _api.Call_CheckTargetUpdate();
}; };
window.native.Call_Common = function(type, param) window.native.Call_Common = function (type, param)
{ {
return _api.Call_Common(type, param); return _api.Call_Common(type, param);
}; };
window.native.Call_HR_Tabs = function(arrT, arrP) window.native.Call_HR_Tabs = function (arrT, arrP)
{ {
return _api.Call_HR_Tabs(arrT, arrP); return _api.Call_HR_Tabs(arrT, arrP);
}; };
window.native.Call_HR_Pr = function(_indent_left, _indent_right, _indent_first) window.native.Call_HR_Pr = function (_indent_left, _indent_right, _indent_first)
{ {
return _api.Call_HR_Pr(_indent_left, _indent_right, _indent_first); return _api.Call_HR_Pr(_indent_left, _indent_right, _indent_first);
}; };
window.native.Call_HR_Margins = function(_margin_left, _margin_right) window.native.Call_HR_Margins = function (_margin_left, _margin_right)
{ {
return _api.Call_HR_Margins(_margin_left, _margin_right); return _api.Call_HR_Margins(_margin_left, _margin_right);
}; };
window.native.Call_HR_Table = function(_params, _cols, _margins, _rows) window.native.Call_HR_Table = function (_params, _cols, _margins, _rows)
{ {
return _api.Call_HR_Table(_params, _cols, _margins, _rows); return _api.Call_HR_Table(_params, _cols, _margins, _rows);
}; };
window.native.Call_VR_Margins = function(_top, _bottom) window.native.Call_VR_Margins = function (_top, _bottom)
{ {
return _api.Call_VR_Margins(_top, _bottom); return _api.Call_VR_Margins(_top, _bottom);
}; };
window.native.Call_VR_Header = function(_header_top, _header_bottom) window.native.Call_VR_Header = function (_header_top, _header_bottom)
{ {
return _api.Call_VR_Header(_header_top, _header_bottom); return _api.Call_VR_Header(_header_top, _header_bottom);
}; };
window.native.Call_VR_Table = function(_params, _cols, _margins, _rows) window.native.Call_VR_Table = function (_params, _cols, _margins, _rows)
{ {
return _api.Call_VR_Table(_params, _cols, _margins, _rows); return _api.Call_VR_Table(_params, _cols, _margins, _rows);
}; };
window.native.Call_Menu_Event = function(type, _params) window.native.Call_Menu_Event = function (type, _params)
{ {
return _api.Call_Menu_Event(type, _params); return _api.Call_Menu_Event(type, _params);
}; };
...@@ -7163,6 +7163,11 @@ function Check_LoadingDataBeforePrepaste(_api, _fonts, _images, _callback) ...@@ -7163,6 +7163,11 @@ function Check_LoadingDataBeforePrepaste(_api, _fonts, _images, _callback)
else else
_images[image] = "local"; _images[image] = "local";
} }
else if (window["AscDesktopEditor"] !== undefined)
{
if (!g_oDocumentUrls.getImageLocal(src))
aImagesToDownload.push(src);
}
else if (!g_oDocumentUrls.getImageUrl(src) && !g_oDocumentUrls.getImageLocal(src)) else if (!g_oDocumentUrls.getImageUrl(src) && !g_oDocumentUrls.getImageLocal(src))
aImagesToDownload.push(src); aImagesToDownload.push(src);
} }
......
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