Commit 2635ada0 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50375 954022d7-b5bf-4e40-9824-e11837661b57
parent 5b8c63d0
...@@ -2612,6 +2612,8 @@ function BinaryPPTYLoader() ...@@ -2612,6 +2612,8 @@ function BinaryPPTYLoader()
case 7: case 7:
_comment.WriteParentCommentId = s.GetLong(); _comment.WriteParentCommentId = s.GetLong();
break; break;
case 8:
_comment.AdditionalData = s.GetString2();
default: default:
break; break;
} }
......
...@@ -896,6 +896,8 @@ function CBinaryFileWriter() ...@@ -896,6 +896,8 @@ function CBinaryFileWriter()
this._WriteInt1(7, _comment.WriteParentCommentId); this._WriteInt1(7, _comment.WriteParentCommentId);
} }
this._WriteString1(8, _comment.AdditionalData);
this.WriteUChar(g_nodeAttributeEnd); this.WriteUChar(g_nodeAttributeEnd);
this.EndRecord(); this.EndRecord();
......
...@@ -2388,7 +2388,7 @@ function CDrawingDocument() ...@@ -2388,7 +2388,7 @@ function CDrawingDocument()
this.m_oWordControl.Thumbnails.RecalculateAll(); this.m_oWordControl.Thumbnails.RecalculateAll();
} }
this.CheckGuiControlColors = function() this.CheckGuiControlColors = function(bIsAttack)
{ {
// потом реализовать проверку на то, что нужно ли посылать // потом реализовать проверку на то, что нужно ли посылать
if (-1 == this.SlideCurrent) if (-1 == this.SlideCurrent)
...@@ -2438,7 +2438,7 @@ function CDrawingDocument() ...@@ -2438,7 +2438,7 @@ function CDrawingDocument()
bIsSend = true; bIsSend = true;
} }
if (bIsSend) if (bIsSend || (bIsAttack === true))
{ {
for (var i = 0; i < _count; ++i) for (var i = 0; i < _count; ++i)
{ {
......
...@@ -171,6 +171,8 @@ function CEditorPage(api) ...@@ -171,6 +171,8 @@ function CEditorPage(api)
this.bIsUseKeyPress = true; this.bIsUseKeyPress = true;
this.bIsEventPaste = false; this.bIsEventPaste = false;
this.DrawingFreeze = false;
this.m_bIsIE = (/MSIE/g.test(navigator.userAgent)) ? true : false; this.m_bIsIE = (/MSIE/g.test(navigator.userAgent)) ? true : false;
// сплиттеры (для табнейлов и для заметок) // сплиттеры (для табнейлов и для заметок)
...@@ -2803,7 +2805,7 @@ function CEditorPage(api) ...@@ -2803,7 +2805,7 @@ function CEditorPage(api)
this.m_oDrawingDocument.SendThemeColorScheme(); this.m_oDrawingDocument.SendThemeColorScheme();
} }
this.m_oDrawingDocument.CheckGuiControlColors(); this.m_oDrawingDocument.CheckGuiControlColors(bIsAttack);
} }
this.GoToPage = function(lPageNum) this.GoToPage = function(lPageNum)
......
...@@ -15,6 +15,8 @@ function CWriteCommentData() ...@@ -15,6 +15,8 @@ function CWriteCommentData()
this.WriteTime = ""; this.WriteTime = "";
this.WriteText = ""; this.WriteText = "";
this.AdditionalData = "";
this.x = 0; this.x = 0;
this.y = 0; this.y = 0;
} }
...@@ -60,12 +62,82 @@ CWriteCommentData.prototype = ...@@ -60,12 +62,82 @@ CWriteCommentData.prototype =
{ {
var d = new Date(this.Data.m_sTime - 0); var d = new Date(this.Data.m_sTime - 0);
this.WriteTime = this.DateToISO8601(d); this.WriteTime = this.DateToISO8601(d);
this.CalculateAdditionalData();
}, },
Calculate2 : function() Calculate2 : function()
{ {
var _time = this.Iso8601ToDate(this.WriteTime); var _time = this.Iso8601ToDate(this.WriteTime);
this.WriteTime = _time; this.WriteTime = _time;
},
CalculateAdditionalData : function()
{
if (null == this.Data)
this.AdditionalData = "";
else
{
this.AdditionalData = "teamlab_data:";
this.AdditionalData += ("0;" + this.Data.m_sUserId.length + ";" + this.Data.m_sUserId + ";" );
this.AdditionalData += ("1;" + this.Data.m_sUserName.length + ";" + this.Data.m_sUserName + ";" );
this.AdditionalData += ("2;1;" + (this.Data.m_bSolved ? "1;" : "0;"));
}
},
ReadNextInteger : function(_parsed)
{
var _len = _parsed.data.length;
var _found = -1;
var _Found = ";".charCodeAt(0);
for (var i = _parsed.pos; i < _len; i++)
{
if (_Found == _parsed.data.charCodeAt(i))
{
_found = i;
break;
}
}
if (-1 == _found)
return -1;
var _ret = parseInt(_parsed.data.substr(_parsed.pos, _found - _parsed.pos));
if (isNaN(_ret))
return -1;
_parsed.pos = _found + 1;
return _ret;
},
ParceAdditionalData : function(_comment_data)
{
if (this.AdditionalData.indexOf("teamlab_data:") != 0)
return;
var _parsed = { data : this.AdditionalData, pos : "teamlab_data:".length };
while (true)
{
var _attr = this.ReadNextInteger(_parsed);
if (-1 == _attr)
break;
var _len = this.ReadNextInteger(_parsed);
if (-1 == _len)
break;
var _value = _parsed.data.substr(_parsed.pos, _len);
_parsed.pos += (_len + 1);
if (0 == _attr)
_comment_data.m_sUserId = _value;
else if (1 == _attr)
_comment_data.m_sUserName = _value;
else if (2 == _attr)
_comment_data.m_bSolved = ("1" == _value) ? true : false;
}
} }
}; };
......
...@@ -7037,6 +7037,8 @@ CPresentation.prototype = ...@@ -7037,6 +7037,8 @@ CPresentation.prototype =
this.CommentAuthors = {}; this.CommentAuthors = {};
var _AuthorId = 0; var _AuthorId = 0;
var _slidesCount = this.Slides.length; var _slidesCount = this.Slides.length;
var _uniIdSplitter = ";__teamlab__;";
for (var _sldIdx = 0; _sldIdx < _slidesCount; _sldIdx++) for (var _sldIdx = 0; _sldIdx < _slidesCount; _sldIdx++)
{ {
this.Slides[_sldIdx].writecomments = []; this.Slides[_sldIdx].writecomments = [];
...@@ -7049,11 +7051,12 @@ CPresentation.prototype = ...@@ -7049,11 +7051,12 @@ CPresentation.prototype =
var _data = _comments[i].Data; var _data = _comments[i].Data;
var _commId = 0; var _commId = 0;
var _author = this.CommentAuthors[_data.m_sUserName]; var _autID = _data.m_sUserId + _uniIdSplitter + _data.m_sUserName;
var _author = this.CommentAuthors[_autID];
if (!_author) if (!_author)
{ {
this.CommentAuthors[_data.m_sUserName] = new CCommentAuthor(); this.CommentAuthors[_autID] = new CCommentAuthor();
_author = this.CommentAuthors[_data.m_sUserName]; _author = this.CommentAuthors[_autID];
_author.Name = _data.m_sUserName; _author.Name = _data.m_sUserName;
_author.Calculate(); _author.Calculate();
...@@ -7083,11 +7086,12 @@ CPresentation.prototype = ...@@ -7083,11 +7086,12 @@ CPresentation.prototype =
{ {
var _data2 = _comments2[j]; var _data2 = _comments2[j];
var _author2 = this.CommentAuthors[_data2.m_sUserName]; var _autID2 = _data2.m_sUserId + _uniIdSplitter + _data2.m_sUserName;
var _author2 = this.CommentAuthors[_autID2];
if (!_author2) if (!_author2)
{ {
this.CommentAuthors[_data2.m_sUserName] = new CCommentAuthor(); this.CommentAuthors[_autID2] = new CCommentAuthor();
_author2 = this.CommentAuthors[_data2.m_sUserName]; _author2 = this.CommentAuthors[_autID2];
_author2.Name = _data2.m_sUserName; _author2.Name = _data2.m_sUserName;
_anchor2.Calculate(); _anchor2.Calculate();
......
...@@ -2015,6 +2015,7 @@ Slide.prototype = ...@@ -2015,6 +2015,7 @@ Slide.prototype =
var _comments_count = this.writecomments.length; var _comments_count = this.writecomments.length;
var _comments_id = []; var _comments_id = [];
var _comments_data = []; var _comments_data = [];
var _comments_data_author_id = [];
var _comments = []; var _comments = [];
for (var i = 0; i < _comments_count; i++) for (var i = 0; i < _comments_count; i++)
...@@ -2043,6 +2044,9 @@ Slide.prototype = ...@@ -2043,6 +2044,9 @@ Slide.prototype =
{ {
_comments_id.push(_wc.WriteCommentId); _comments_id.push(_wc.WriteCommentId);
_comments_data.push(commentData); _comments_data.push(commentData);
_comments_data_author_id.push(_wc.WriteAuthorId);
_wc.ParceAdditionalData(commentData);
var comment = new CComment(undefined, null); var comment = new CComment(undefined, null);
comment.setPosition(_wc.x / 25.4, _wc.y / 25.4); comment.setPosition(_wc.x / 25.4, _wc.y / 25.4);
...@@ -2067,10 +2071,12 @@ Slide.prototype = ...@@ -2067,10 +2071,12 @@ Slide.prototype =
} }
} }
_wc.ParceAdditionalData(commentData);
var _parent = null; var _parent = null;
for (var j = 0; j < _comments_data.length; j++) for (var j = 0; j < _comments_data.length; j++)
{ {
if ((("" + _wc.WriteParentAuthorId) == _comments_data[j].m_sUserId) && (_wc.WriteParentCommentId == _comments_id[j])) if ((_wc.WriteParentAuthorId == _comments_data_author_id[j]) && (_wc.WriteParentCommentId == _comments_id[j]))
{ {
_parent = _comments_data[j]; _parent = _comments_data[j];
break; break;
......
...@@ -899,8 +899,6 @@ asc_docs_api.prototype.InitEditor = function() ...@@ -899,8 +899,6 @@ asc_docs_api.prototype.InitEditor = function()
{ {
this.WordControl.m_oLogicDocument = new CPresentation(this.WordControl.m_oDrawingDocument); this.WordControl.m_oLogicDocument = new CPresentation(this.WordControl.m_oDrawingDocument);
this.WordControl.m_oDrawingDocument.m_oLogicDocument = this.WordControl.m_oLogicDocument; this.WordControl.m_oDrawingDocument.m_oLogicDocument = this.WordControl.m_oLogicDocument;
this.sync_InitStandartTextures();
} }
asc_docs_api.prototype.SetInterfaceDrawImagePlaceShape = function(div_id) asc_docs_api.prototype.SetInterfaceDrawImagePlaceShape = function(div_id)
...@@ -1003,32 +1001,6 @@ asc_docs_api.prototype.asc_registerCallback = function(name, callback) { ...@@ -1003,32 +1001,6 @@ asc_docs_api.prototype.asc_registerCallback = function(name, callback) {
if (!_callbacks.hasOwnProperty(name)) if (!_callbacks.hasOwnProperty(name))
_callbacks[name] = [] _callbacks[name] = []
_callbacks[name].push(callback); _callbacks[name].push(callback);
if ("asc_onInitEditorShapes" == name)
{
this.asc_fireCallback("asc_onInitEditorShapes", g_oAutoShapesGroups, g_oAutoShapesTypes);
}
else if ("asc_onInitEditorFonts" == name)
{
if (this._gui_fonts != null)
{
this.asc_fireCallback("asc_onInitEditorFonts", this._gui_fonts);
this._gui_fonts = null;
}
}
else if ("asc_onInitEditorThemes" == name)
{
if (this._gui_editor_themes != null || this._gui_document_themes)
{
this.asc_fireCallback("asc_onInitEditorThemes", this._gui_editor_themes, this._gui_document_themes);
this._gui_editor_themes = null;
this._gui_document_themes = null;
}
}
else if ("asc_onInitStandartTextures" == name)
{
this.sync_InitStandartTextures();
}
} }
asc_docs_api.prototype.asc_unregisterCallback = function(name, callback) { asc_docs_api.prototype.asc_unregisterCallback = function(name, callback) {
...@@ -1073,6 +1045,37 @@ asc_docs_api.prototype.get_TextProps = function() ...@@ -1073,6 +1045,37 @@ asc_docs_api.prototype.get_TextProps = function()
return new CParagraphAndTextProp (ParaPr, TextPr); // uncomment if this method will be used externally. 20/03/2012 uncommented for testers return new CParagraphAndTextProp (ParaPr, TextPr); // uncomment if this method will be used externally. 20/03/2012 uncommented for testers
} }
// -------
// тут методы, замены евентов
asc_docs_api.prototype.get_PropertyEditorShapes = function()
{
var ret = [g_oAutoShapesGroups, g_oAutoShapesTypes];
return ret;
}
asc_docs_api.prototype.get_PropertyEditorFonts = function()
{
return this._gui_fonts;
}
asc_docs_api.prototype.get_PropertyStandartTextures = function()
{
var _count = g_oUserTexturePresets.length;
var arr = new Array(_count);
for (var i = 0; i < _count; ++i)
{
arr[i] = new CAscTexture();
arr[i].Id = i;
arr[i].Image = g_oUserTexturePresets[i];
}
return arr;
}
asc_docs_api.prototype.get_PropertyEditorThemes = function()
{
var ret = [this._gui_editor_themes, this._gui_document_themes];
return ret;
}
// -------
// ------- // -------
asc_docs_api.prototype.get_ContentCount = function() asc_docs_api.prototype.get_ContentCount = function()
{ {
...@@ -1655,19 +1658,10 @@ asc_docs_api.prototype.sync_PrLineSpacingCallBack = function(LineSpacing){ ...@@ -1655,19 +1658,10 @@ asc_docs_api.prototype.sync_PrLineSpacingCallBack = function(LineSpacing){
asc_docs_api.prototype.sync_InitEditorFonts = function(gui_fonts){ asc_docs_api.prototype.sync_InitEditorFonts = function(gui_fonts){
this._gui_fonts = gui_fonts; this._gui_fonts = gui_fonts;
var ret = this.asc_fireCallback("asc_onInitEditorFonts",gui_fonts);
if (ret)
this._gui_fonts = null;
} }
asc_docs_api.prototype.sync_InitEditorThemes = function(gui_editor_themes, gui_document_themes){ asc_docs_api.prototype.sync_InitEditorThemes = function(gui_editor_themes, gui_document_themes){
this._gui_editor_themes = gui_editor_themes; this._gui_editor_themes = gui_editor_themes;
this._gui_document_themes = gui_document_themes; this._gui_document_themes = gui_document_themes;
var ret = this.asc_fireCallback("asc_onInitEditorThemes", gui_editor_themes, gui_document_themes);
if (ret)
{
this._gui_editor_themes = null;
this._gui_document_themes = null;
}
} }
asc_docs_api.prototype.sync_InitEditorTableStyles = function(styles){ asc_docs_api.prototype.sync_InitEditorTableStyles = function(styles){
this.asc_fireCallback("asc_onInitTableTemplates",styles); this.asc_fireCallback("asc_onInitTableTemplates",styles);
...@@ -2175,20 +2169,6 @@ asc_docs_api.prototype.put_LineEndSize = function(_size) ...@@ -2175,20 +2169,6 @@ asc_docs_api.prototype.put_LineEndSize = function(_size)
this.WordControl.m_oLogicDocument.putLineEndSize(_size); this.WordControl.m_oLogicDocument.putLineEndSize(_size);
} }
asc_docs_api.prototype.sync_InitStandartTextures = function()
{
var _count = g_oUserTexturePresets.length;
var arr = new Array(_count);
for (var i = 0; i < _count; ++i)
{
arr[i] = new CAscTexture();
arr[i].Id = i;
arr[i].Image = g_oUserTexturePresets[i];
}
this.asc_fireCallback("asc_onInitStandartTextures", arr);
}
asc_docs_api.prototype.put_TextColor2 = function(r, g, b) asc_docs_api.prototype.put_TextColor2 = function(r, g, b)
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(); this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
...@@ -3137,6 +3117,30 @@ asc_docs_api.prototype.sync_ImgWrapStyleChangedCallback = function(style){ ...@@ -3137,6 +3117,30 @@ asc_docs_api.prototype.sync_ImgWrapStyleChangedCallback = function(style){
this.asc_fireCallback("asc_onImgWrapStyleChanged",style); this.asc_fireCallback("asc_onImgWrapStyleChanged",style);
} }
asc_docs_api.prototype.SetDrawingFreeze = function(bIsFreeze)
{
this.WordControl.DrawingFreeze = bIsFreeze;
var _elem1 = document.getElementById("id_main");
if (_elem1)
{
var _elem2 = document.getElementById("id_horscrollpanel");
var _elem3 = document.getElementById("id_panel_right");
if (bIsFreeze)
{
_elem1.style.display = "none";
_elem2.style.display = "none";
_elem3.style.display = "none";
}
else
{
_elem1.style.display = "block";
_elem2.style.display = "block";
_elem3.style.display = "block";
}
}
}
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
/*functions for working with zoom & navigation*/ /*functions for working with zoom & navigation*/
asc_docs_api.prototype.zoomIn = function(){ asc_docs_api.prototype.zoomIn = function(){
......
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