Commit f39ee7dc authored by Oleg Korshul's avatar Oleg Korshul Committed by GitHub

Merge pull request #85 from ONLYOFFICE/release/v4.2.0

Release/v4.2.0
parents 9bbdb104 755d0f55
......@@ -3659,6 +3659,7 @@ var editor;
prot["asc_pluginButtonClick"] = prot.asc_pluginButtonClick;
prot["asc_addOleObject"] = prot.asc_addOleObject;
prot["asc_editOleObject"] = prot.asc_editOleObject;
prot["asc_startEditCurrentOleObject"] = prot.asc_startEditCurrentOleObject;
prot["asc_pluginEnableMouseEvents"] = prot.asc_pluginEnableMouseEvents;
// system input
......
......@@ -1757,6 +1757,9 @@
if (isRetina) {
this.canvas.style.width = this.canvasOverlay.style.width = this.canvasGraphic.style.width = this.canvasGraphicOverlay.style.width = styleWidth + 'px';
this.canvas.style.height = this.canvasOverlay.style.height = this.canvasGraphic.style.height = this.canvasGraphicOverlay.style.height = styleHeight + 'px';
} else {
this.canvas.style.width = this.canvasOverlay.style.width = this.canvasGraphic.style.width = this.canvasGraphicOverlay.style.width = width + 'px';
this.canvas.style.height = this.canvasOverlay.style.height = this.canvasGraphic.style.height = this.canvasGraphicOverlay.style.height = height + 'px';
}
// При смене ориентации у планшета, сбрасываются флаги у canvas!
......
......@@ -8237,7 +8237,7 @@ DrawingObjectsController.prototype =
{
this.selection.groupSelection.bringToFront();
}
this.drawingObjects.showDrawingObjects(true);
},
bringForward : function()
......@@ -8284,7 +8284,7 @@ DrawingObjectsController.prototype =
{
this.selection.groupSelection.sendToBack();
}
this.drawingObjects.showDrawingObjects(true);
},
......@@ -8307,6 +8307,7 @@ DrawingObjectsController.prototype =
{
this.selection.groupSelection.bringBackward();
}
this.drawingObjects.showDrawingObjects(true);
}
};
......
......@@ -121,26 +121,56 @@ AscBrowser.checkZoom = function()
if (AscBrowser.isChrome && !AscBrowser.isOpera && document && document.firstElementChild && document.body)
{
if (window.innerWidth > 300)
AscBrowser.zoom = window.outerWidth / window.innerWidth;
if (Math.abs(AscBrowser.zoom - 1) < 0.1)
AscBrowser.zoom = 1;
AscBrowser.zoom = window.outerWidth / window.innerWidth;
if (false)
{
// этот код - рабочий, но только если этот ифрейм открыт на весь размер браузера
// (window.outerWidth и window.innerWidth зависимы)
if (window.innerWidth > 300)
AscBrowser.zoom = window.outerWidth / window.innerWidth;
var _devicePixelRatio = window.devicePixelRatio / AscBrowser.zoom;
if (Math.abs(AscBrowser.zoom - 1) < 0.1)
AscBrowser.zoom = 1;
// device pixel ratio: кратно 0.5
_devicePixelRatio = (5 * (((2.5 + 10 * _devicePixelRatio) / 5) >> 0)) / 10;
AscBrowser.zoom = window.devicePixelRatio / _devicePixelRatio;
if (2 == _devicePixelRatio)
AscBrowser.isRetina = true;
AscBrowser.zoom = window.outerWidth / window.innerWidth;
// chrome 54.x: zoom = "reset" - clear retina zoom (windows)
//document.firstElementChild.style.zoom = "reset";
document.firstElementChild.style.zoom = 1.0 / AscBrowser.zoom;
var _devicePixelRatio = window.devicePixelRatio / AscBrowser.zoom;
// device pixel ratio: кратно 0.5
_devicePixelRatio = (5 * (((2.5 + 10 * _devicePixelRatio) / 5) >> 0)) / 10;
AscBrowser.zoom = window.devicePixelRatio / _devicePixelRatio;
if (2 == _devicePixelRatio)
AscBrowser.isRetina = true;
// chrome 54.x: zoom = "reset" - clear retina zoom (windows)
//document.firstElementChild.style.zoom = "reset";
document.firstElementChild.style.zoom = 1.0 / AscBrowser.zoom;
}
else
{
// делаем простую проверку
// считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio;
// считаем: window.devicePixelRatio >= 2 => _devicePixelRatio = 2; zoom = window.devicePixelRatio / _devicePixelRatio;
if (window.devicePixelRatio > 0.1)
{
if (window.devicePixelRatio < 1.99)
{
var _devicePixelRatio = 1;
AscBrowser.zoom = window.devicePixelRatio / _devicePixelRatio;
}
else
{
var _devicePixelRatio = 2;
AscBrowser.zoom = window.devicePixelRatio / _devicePixelRatio;
AscBrowser.isRetina = true;
}
// chrome 54.x: zoom = "reset" - clear retina zoom (windows)
//document.firstElementChild.style.zoom = "reset";
document.firstElementChild.style.zoom = 1.0 / AscBrowser.zoom;
}
else
document.firstElementChild.style.zoom = "normal";
}
}
else
{
......
......@@ -632,7 +632,7 @@
};
DocsCoApi.prototype.askLock = function(arrayBlockId, callback) {
if (ConnectionState.SaveChanges === this._state) {
if (ConnectionState.SaveChanges === this._state || ConnectionState.AskSaveChanges === this._state) {
// Мы в режиме сохранения. Lock-и запросим после окончания.
this._lockBuffer.push(new LockBufferElement(arrayBlockId, callback));
return;
......@@ -722,9 +722,13 @@
t._saveCallback[indexCallback] = null;
//Not signaled already
oTmpCallback({error: "Timed out"});
t._state = ConnectionState.Authorized;
// Делаем отложенные lock-и
t._sendBufferedLocks();
}
}, this.errorTimeOut);
}
this._state = ConnectionState.AskSaveChanges;
this._send({"type": "isSaveLock"});
};
......@@ -1025,7 +1029,7 @@
};
DocsCoApi.prototype._onSaveLock = function(data) {
if (undefined != data["saveLock"] && null != data["saveLock"]) {
if (null != data["saveLock"]) {
var indexCallback = this._saveCallback.length - 1;
var oTmpCallback = this._saveCallback[indexCallback];
if (oTmpCallback) {
......@@ -1037,6 +1041,11 @@
this._saveCallback[indexCallback] = null;
oTmpCallback(data);
if (data['error']) {
this._state = ConnectionState.Authorized;
// Делаем отложенные lock-и
this._sendBufferedLocks();
}
}
}
};
......
This diff is collapsed.
......@@ -518,7 +518,7 @@ SlideLayout.prototype =
var _shape_count = _shapes.length;
for(_shape_index = 0; _shape_index < _shape_count; ++_shape_index)
{
if(_shapes[_shape_index].isPlaceholder())
if(_shapes[_shape_index].isPlaceholder && _shapes[_shape_index].isPlaceholder())
_shapes[_shape_index].recalculate();
}
},
......@@ -891,12 +891,7 @@ function CLayoutThumbnailDrawer()
for (var i = 0; i < _layout.cSld.spTree.length; i++)
{
var _sp_elem = _layout.cSld.spTree[i];
/*if (!_sp_elem.isPlaceholder())
{
if (use_layout_shapes !== false)
_sp_elem.draw(g);
}
else*/
if(_sp_elem.isPlaceholder && _sp_elem.isPlaceholder())
{
var _ph_type = _sp_elem.getPlaceholderType();
var _usePH = true;
......
......@@ -352,7 +352,7 @@ MasterSlide.prototype =
{
for(var i=0; i < this.cSld.spTree.length; ++i)
{
if(!this.cSld.spTree[i].isPlaceholder())
if(this.cSld.spTree[i].isPlaceholder && !this.cSld.spTree[i].isPlaceholder())
this.cSld.spTree[i].draw(graphics);
}
},
......
......@@ -6931,6 +6931,7 @@ background-repeat: no-repeat;\
asc_docs_api.prototype["asc_addOleObject"] = asc_docs_api.prototype.asc_addOleObject;
asc_docs_api.prototype["asc_editOleObject"] = asc_docs_api.prototype.asc_editOleObject;
asc_docs_api.prototype["asc_startEditCurrentOleObject"] = asc_docs_api.prototype.asc_startEditCurrentOleObject;
asc_docs_api.prototype["asc_InputClearKeyboardElement"] = asc_docs_api.prototype.asc_InputClearKeyboardElement;
asc_docs_api.prototype["asc_getCurrentFocusObject"] = asc_docs_api.prototype.asc_getCurrentFocusObject;
......
......@@ -742,6 +742,8 @@ CGraphicObjects.prototype =
{
History.Create_NewPoint(AscDFH.historydescription_Document_GrObjectsBringForwardGroup);
this.selection.groupSelection.bringForward();
this.document.Recalculate();
this.document.Document_UpdateUndoRedoState();
}
}
else
......@@ -797,6 +799,8 @@ CGraphicObjects.prototype =
{
History.Create_NewPoint(AscDFH.historydescription_Document_GrObjectsSendToBackGroup);
this.selection.groupSelection.sendToBack();
this.document.Recalculate();
this.document.Document_UpdateUndoRedoState();
}
}
else
......@@ -831,6 +835,8 @@ CGraphicObjects.prototype =
{
History.Create_NewPoint(AscDFH.historydescription_Document_GrObjectsBringBackwardGroup);
this.selection.groupSelection.bringBackward();
this.document.Recalculate();
this.document.Document_UpdateUndoRedoState();
}
}
else
......
......@@ -9020,6 +9020,7 @@ background-repeat: no-repeat;\
asc_docs_api.prototype["asc_SetSilentMode"] = asc_docs_api.prototype.asc_SetSilentMode;
asc_docs_api.prototype["asc_addOleObject"] = asc_docs_api.prototype.asc_addOleObject;
asc_docs_api.prototype["asc_editOleObject"] = asc_docs_api.prototype.asc_editOleObject;
asc_docs_api.prototype["asc_startEditCurrentOleObject"] = asc_docs_api.prototype.asc_startEditCurrentOleObject;
asc_docs_api.prototype["asc_InputClearKeyboardElement"] = asc_docs_api.prototype.asc_InputClearKeyboardElement;
// mobile
......
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