Commit b7f3d4b7 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

реализация Document_Is_SelectionLock из класса CPresentation перенесена в...

реализация Document_Is_SelectionLock из класса CPresentation перенесена в Word/Editor/Private/Locs.js

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62245 954022d7-b5bf-4e40-9824-e11837661b57
parent 03d35050
...@@ -4118,251 +4118,7 @@ CPresentation.prototype = ...@@ -4118,251 +4118,7 @@ CPresentation.prototype =
Document_Is_SelectionLocked : function(CheckType, AdditionalData) Document_Is_SelectionLocked : function(CheckType, AdditionalData)
{ {
if ( true === CollaborativeEditing.Get_GlobalLock() ) return false;
return true;
if(this.Slides.length === 0)
return false;
if(changestype_Document_SectPr === CheckType)
{
return true;
}
if(CheckType === changestype_None && isRealObject(AdditionalData) && AdditionalData.CheckType === changestype_Table_Properties)
{
CheckType = changestype_Drawing_Props;
}
var cur_slide = this.Slides[this.CurPage];
var slide_id = cur_slide.deleteLock.Get_Id();
CollaborativeEditing.OnStart_CheckLock();
if(CheckType === changestype_Drawing_Props)
{
if(cur_slide.deleteLock.Lock.Type !== locktype_Mine && cur_slide.deleteLock.Lock.Type !== locktype_None)
return true;
var selected_objects = cur_slide.graphicObjects.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Object,
"slideId": slide_id,
"objId": selected_objects[i].Get_Id(),
"guid": selected_objects[i].Get_Id()
};
selected_objects[i].Lock.Check(check_obj);
}
}
if(CheckType === changestype_AddShape || CheckType === changestype_AddComment)
{
if(cur_slide.deleteLock.Lock.Type !== locktype_Mine && cur_slide.deleteLock.Lock.Type !== locktype_None)
return true;
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Object,
"slideId": slide_id,
"objId": AdditionalData.Get_Id(),
"guid": AdditionalData.Get_Id()
};
AdditionalData.Lock.Check(check_obj);
}
if(CheckType === changestype_AddShapes)
{
if(cur_slide.deleteLock.Lock.Type !== locktype_Mine && cur_slide.deleteLock.Lock.Type !== locktype_None)
return true;
for(var i = 0; i < AdditionalData.length; ++i)
{
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Object,
"slideId": slide_id,
"objId": AdditionalData[i].Get_Id(),
"guid": AdditionalData[i].Get_Id()
};
AdditionalData[i].Lock.Check(check_obj);
}
}
if(CheckType === changestype_MoveComment)
{
var comment = g_oTableId.Get_ById(AdditionalData);
if(isRealObject(comment))
{
var slides = this.Slides;
var check_slide = null;
for(var i = 0; i < slides.length; ++i)
{
if(slides[i].slideComments)
{
var comments = slides[i].slideComments.comments;
for(var j = 0; j < comments.length; ++j)
{
if(comments[j] === comment)
{
check_slide = slides[i];
break;
}
}
if(j < comments.length)
{
break;
}
}
}
if(isRealObject(check_slide))
{
if(check_slide.deleteLock.Lock.Type !== locktype_Mine && check_slide.deleteLock.Lock.Type !== locktype_None)
return true;
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Object,
"slideId": slide_id,
"objId": comment.Get_Id(),
"guid": comment.Get_Id()
};
comment.Lock.Check(check_obj);
}
else
{
return true;
}
}
else
{
return true;
}
}
if(CheckType === changestype_SlideBg)
{
var selected_slides = editor.WordControl.Thumbnails.GetSelectedArray();
for(var i = 0; i < selected_slides.length; ++i)
{
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Slide,
"val": this.Slides[selected_slides[i]].backgroundLock.Get_Id(),
"guid": this.Slides[selected_slides[i]].backgroundLock.Get_Id()
};
this.Slides[selected_slides[i]].backgroundLock.Lock.Check(check_obj);
}
}
if(CheckType === changestype_SlideTiming)
{
var selected_slides = editor.WordControl.Thumbnails.GetSelectedArray();
for(var i = 0; i < selected_slides.length; ++i)
{
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Slide,
"val": this.Slides[selected_slides[i]].timingLock.Get_Id(),
"guid": this.Slides[selected_slides[i]].timingLock.Get_Id()
};
this.Slides[selected_slides[i]].timingLock.Lock.Check(check_obj);
}
}
if(CheckType === changestype_Text_Props)
{
if(cur_slide.deleteLock.Lock.Type !== locktype_Mine && cur_slide.deleteLock.Lock.Type !== locktype_None)
return true;
var selected_objects = cur_slide.graphicObjects.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Object,
"slideId": slide_id,
"objId": selected_objects[i].Get_Id(),
"guid":selected_objects[i].Get_Id()
};
selected_objects[i].Lock.Check(check_obj);
}
}
if(CheckType === changestype_RemoveSlide)
{
var selected_slides = editor.WordControl.Thumbnails.GetSelectedArray();
for(var i = 0; i < selected_slides.length; ++i)
{
if(this.Slides[selected_slides[i]].isLockedObject())
return true;
}
for(var i = 0; i < selected_slides.length; ++i)
{
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Slide,
"val": this.Slides[selected_slides[i]].deleteLock.Get_Id(),
"guid": this.Slides[selected_slides[i]].deleteLock.Get_Id()
};
this.Slides[selected_slides[i]].deleteLock.Lock.Check(check_obj);
}
}
if(CheckType === changestype_Theme)
{
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Slide,
"val": this.themeLock.Get_Id(),
"guid": this.themeLock.Get_Id()
};
this.themeLock.Lock.Check(check_obj);
}
if(CheckType === changestype_Layout)
{
var selected_slides = editor.WordControl.Thumbnails.GetSelectedArray();
for(var i = 0; i < selected_slides.length; ++i)
{
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Slide,
"val": this.Slides[selected_slides[i]].layoutLock.Get_Id(),
"guid": this.Slides[selected_slides[i]].layoutLock.Get_Id()
};
this.Slides[selected_slides[i]].layoutLock.Lock.Check(check_obj);
}
}
if(CheckType === changestype_ColorScheme)
{
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Slide,
"val": this.schemeLock.Get_Id(),
"guid": this.schemeLock.Get_Id()
};
this.schemeLock.Lock.Check(check_obj);
}
if(CheckType === changestype_SlideSize)
{
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Slide,
"val": this.slideSizeLock.Get_Id(),
"guid": this.slideSizeLock.Get_Id()
};
this.slideSizeLock.Lock.Check(check_obj);
}
var bResult = CollaborativeEditing.OnEnd_CheckLock();
if ( true === bResult )
{
this.Document_UpdateSelectionState();
this.Document_UpdateInterfaceState();
}
return bResult;
}, },
......
...@@ -393,6 +393,8 @@ ...@@ -393,6 +393,8 @@
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/AdvancedOptions.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Excel/model/AdvancedOptions.js"></script>
<script src="../../../../OfficeWeb/Word/Editor/FlowObjects.js"></script> <script src="../../../../OfficeWeb/Word/Editor/FlowObjects.js"></script>
<script src="../../../../OfficeWeb/Word/Editor/Paragraph.js"></script> <script src="../../../../OfficeWeb/Word/Editor/Paragraph.js"></script>
<script src="../../../../OfficeWeb/Word/Editor/Paragraph_Recalculate.js"></script> <script src="../../../../OfficeWeb/Word/Editor/Paragraph_Recalculate.js"></script>
...@@ -415,6 +417,10 @@ ...@@ -415,6 +417,10 @@
<!-- apply changes --> <!-- apply changes -->
<script type="text/javascript" src="../../../../OfficeWeb/OfflineDocuments/ApplyDocumentChanges.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/OfflineDocuments/ApplyDocumentChanges.js"></script>
<!-- Private -->
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/Private/Locks.js"></script>
<!-- debug begin --> <!-- debug begin -->
<script type="text/javascript">var less=less||{};less.env='development';</script> <script type="text/javascript">var less=less||{};less.env='development';</script>
<script src="../../../vendor/less/dist/less-1.5.1.js" type="text/javascript"></script> <script src="../../../vendor/less/dist/less-1.5.1.js" type="text/javascript"></script>
......
This diff is collapsed.
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