Commit 30b1df1b authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил Lock для цвета листа.

Добавил выставление цвета в undo/redo
Добавил отправку изменений между пользователями для выставления цвета
Добавил перенаправление для цветов (для обмена с меню).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56162 954022d7-b5bf-4e40-9824-e11837661b57
parent fe5cef85
...@@ -1965,6 +1965,38 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1965,6 +1965,38 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.collaborativeEditing.onEndCheckLock(callback); this.collaborativeEditing.onEndCheckLock(callback);
}, },
// Залочена ли панель для закрепления
_isLockedTabColor: function (index, callback) {
if (false === this.collaborativeEditing.isCoAuthoringExcellEnable()) {
// Запрещено совместное редактирование
asc_applyFunction(callback, true);
return;
}
var sheetId = this.wbModel.getWorksheet(index).getId();
var lockInfo = this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null, sheetId, c_oAscLockNameTabColor);
if (false === this.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
asc_applyFunction(callback, true);
callback = undefined;
}
if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeMine, /*bCheckOnlyLockAll*/false)) {
// Редактируем сами
asc_applyFunction(callback, true);
return;
} else if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeOther, /*bCheckOnlyLockAll*/false)) {
// Уже ячейку кто-то редактирует
asc_applyFunction(callback, false);
return;
}
this.collaborativeEditing.onStartCheckLock();
this.collaborativeEditing.addCheckLock(lockInfo);
this.collaborativeEditing.onEndCheckLock(callback);
},
// Toolbar interface // Toolbar interface
/*asc_getEditorFonts: function () { /*asc_getEditorFonts: function () {
...@@ -2011,7 +2043,14 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2011,7 +2043,14 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
return this.wbModel.getWorksheet(index).getTabColor(); return this.wbModel.getWorksheet(index).getTabColor();
}, },
asc_setWorksheetTabColor: function (index, color) { asc_setWorksheetTabColor: function (index, color) {
this.wbModel.getWorksheet(index).setTabColor(color); var t = this;
var changeTabColorCallback = function (res) {
if (res) {
color = CorrectAscColor(color);
t.wbModel.getWorksheet(index).setTabColor(color);
}
};
this._isLockedTabColor(index, changeTabColorCallback);
}, },
asc_getActiveWorksheetIndex: function () { asc_getActiveWorksheetIndex: function () {
......
...@@ -495,5 +495,6 @@ var c_oAscCoAuthoringDottedWidth = 2; ...@@ -495,5 +495,6 @@ var c_oAscCoAuthoringDottedWidth = 2;
var c_oAscCoAuthoringDottedDistance = 2; var c_oAscCoAuthoringDottedDistance = 2;
var c_oAscLockNameFrozenPane = "frozenPane"; var c_oAscLockNameFrozenPane = "frozenPane";
var c_oAscLockNameTabColor = "tabColor";
var FONT_THUMBNAIL_HEIGHT = parseInt(7 * 96.0 / 25.4); var FONT_THUMBNAIL_HEIGHT = parseInt(7 * 96.0 / 25.4);
...@@ -36,6 +36,7 @@ var historyitem_Worksheet_SetViewSettings = 23; ...@@ -36,6 +36,7 @@ var historyitem_Worksheet_SetViewSettings = 23;
var historyitem_Worksheet_RemoveCellFormula = 24; var historyitem_Worksheet_RemoveCellFormula = 24;
var historyitem_Worksheet_ChangeMerge = 25; var historyitem_Worksheet_ChangeMerge = 25;
var historyitem_Worksheet_ChangeHyperlink = 26; var historyitem_Worksheet_ChangeHyperlink = 26;
var historyitem_Worksheet_SetTabColor = 27;
// Frozen cell // Frozen cell
var historyitem_Worksheet_ChangeFrozenCell = 30; var historyitem_Worksheet_ChangeFrozenCell = 30;
......
...@@ -357,6 +357,7 @@ var UndoRedoDataTypes = new function() { ...@@ -357,6 +357,7 @@ var UndoRedoDataTypes = new function() {
this.DocContentParaItemId = 66; this.DocContentParaItemId = 66;
this.ParagraphAddParaItem = 67; this.ParagraphAddParaItem = 67;
this.ParagraphParaItemAdd = 68; this.ParagraphParaItemAdd = 68;
this.SheetPr = 69;
this.Create = function(nType) this.Create = function(nType)
{ {
...@@ -3349,6 +3350,8 @@ UndoRedoWoorksheet.prototype = { ...@@ -3349,6 +3350,8 @@ UndoRedoWoorksheet.prototype = {
worksheetView = this.wb.oApi.wb.getWorksheetById(nSheetId); worksheetView = this.wb.oApi.wb.getWorksheetById(nSheetId);
var updateData = bUndo ? Data.from : Data.to; var updateData = bUndo ? Data.from : Data.to;
worksheetView._updateFreezePane(updateData.c1, updateData.r1, /*lockDraw*/true); worksheetView._updateFreezePane(updateData.c1, updateData.r1, /*lockDraw*/true);
} else if (historyitem_Worksheet_SetTabColor === Type) {
ws.setTabColor(bUndo ? Data.from : Data.to);
} }
} }
}; };
......
...@@ -2106,11 +2106,16 @@ Woorksheet.prototype.setName=function(name){ ...@@ -2106,11 +2106,16 @@ Woorksheet.prototype.setName=function(name){
} }
}; };
Woorksheet.prototype.getTabColor=function(){ Woorksheet.prototype.getTabColor=function(){
return this.sheetPr ? this.sheetPr.TabColor : null; return this.sheetPr && this.sheetPr.TabColor ? Asc.colorObjToAscColor(this.sheetPr.TabColor) : null;
}; };
Woorksheet.prototype.setTabColor=function(color){ Woorksheet.prototype.setTabColor=function(color){
if (!this.sheetPr) if (!this.sheetPr)
this.sheetPr = new Asc.asc_CSheetPr(); this.sheetPr = new Asc.asc_CSheetPr();
History.Create_NewPoint();
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_SetTabColor, this.getId(), null,
new UndoRedoData_FromTo(this.sheetPr.TabColor ? this.sheetPr.TabColor.clone() : null, color ? color.clone() : null));
this.sheetPr.TabColor = color; this.sheetPr.TabColor = color;
}; };
Woorksheet.prototype.renameWsToCollaborate=function(name){ Woorksheet.prototype.renameWsToCollaborate=function(name){
......
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