Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
d21eb72f
Commit
d21eb72f
authored
Jun 21, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Рефакторинг
parent
93a4d3c9
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
328 additions
and
219 deletions
+328
-219
word/Editor/Document.js
word/Editor/Document.js
+164
-212
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+0
-4
word/Editor/DocumentControllerBase.js
word/Editor/DocumentControllerBase.js
+37
-1
word/Editor/DrawingsController.js
word/Editor/DrawingsController.js
+28
-0
word/Editor/Footnotes.js
word/Editor/Footnotes.js
+42
-0
word/Editor/HeaderFooterController.js
word/Editor/HeaderFooterController.js
+29
-0
word/Editor/LogicDocumentController.js
word/Editor/LogicDocumentController.js
+28
-2
No files found.
word/Editor/Document.js
View file @
d21eb72f
This diff is collapsed.
Click to expand it.
word/Editor/DocumentContent.js
View file @
d21eb72f
...
@@ -6647,9 +6647,6 @@ CDocumentContent.prototype.Paragraph_Format_Paste = function(TextPr,
...
@@ -6647,9 +6647,6 @@ CDocumentContent.prototype.Paragraph_Format_Paste = function(TextPr,
{
{
this
.
Content
[
Pos
].
Paragraph_Format_Paste
(
TextPr
,
ParaPr
,
(
Start
===
End
?
false
:
true
));
this
.
Content
[
Pos
].
Paragraph_Format_Paste
(
TextPr
,
ParaPr
,
(
Start
===
End
?
false
:
true
));
}
}
this
.
Recalculate
();
break
;
break
;
}
}
}
}
...
@@ -6657,7 +6654,6 @@ CDocumentContent.prototype.Paragraph_Format_Paste = function(TextPr,
...
@@ -6657,7 +6654,6 @@ CDocumentContent.prototype.Paragraph_Format_Paste = function(TextPr,
else
else
{
{
this
.
Content
[
this
.
CurPos
.
ContentPos
].
Paragraph_Format_Paste
(
TextPr
,
ParaPr
,
true
);
this
.
Content
[
this
.
CurPos
.
ContentPos
].
Paragraph_Format_Paste
(
TextPr
,
ParaPr
,
true
);
this
.
Recalculate
();
}
}
}
}
};
};
...
...
word/Editor/DocumentControllerBase.js
View file @
d21eb72f
...
@@ -235,7 +235,6 @@ CDocumentControllerBase.prototype.Is_DrawingShape = function(bRetShape)
...
@@ -235,7 +235,6 @@ CDocumentControllerBase.prototype.Is_DrawingShape = function(bRetShape)
* Событие о том, что контент изменился и пересчитался.
* Событие о том, что контент изменился и пересчитался.
* @param bChange
* @param bChange
* @param bForceRecalc
* @param bForceRecalc
* @constructor
*/
*/
CDocumentControllerBase
.
prototype
.
OnContentRecalculate
=
function
(
bChange
,
bForceRecalc
)
CDocumentControllerBase
.
prototype
.
OnContentRecalculate
=
function
(
bChange
,
bForceRecalc
)
{
{
...
@@ -545,6 +544,43 @@ CDocumentControllerBase.prototype.GetSelectedContent = function(SelectedContent)
...
@@ -545,6 +544,43 @@ CDocumentControllerBase.prototype.GetSelectedContent = function(SelectedContent)
* Обновляем вид курсора.
* Обновляем вид курсора.
*/
*/
CDocumentControllerBase
.
prototype
.
UpdateCursorType
=
function
(
X
,
Y
,
PageAbs
,
MouseEvent
){};
CDocumentControllerBase
.
prototype
.
UpdateCursorType
=
function
(
X
,
Y
,
PageAbs
,
MouseEvent
){};
/**
* Вставляем форматирование.
* @param TextPr
* @param ParaPr
*/
CDocumentControllerBase
.
prototype
.
PasteFormatting
=
function
(
TextPr
,
ParaPr
){};
/**
* Проверяем используется ли в данный момент селект.
* @returns {boolean}
*/
CDocumentControllerBase
.
prototype
.
IsSelectionUse
=
function
(){
return
false
;};
/**
* Проверяем выделен ли именно текст сейчас.
* @returns {boolean}
*/
CDocumentControllerBase
.
prototype
.
IsTextSelectionUse
=
function
(){
return
false
;};
/**
* Получаем XY текущей позиции.
* @returns {{X: number, Y: number}}
*/
CDocumentControllerBase
.
prototype
.
GetCurPosXY
=
function
(){
return
{
X
:
0
,
Y
:
0
};};
/**
* Получаем выделенный текст.
* @param {boolean} bClearText
* @returns {String}
*/
CDocumentControllerBase
.
prototype
.
GetSelectedText
=
function
(
bClearText
){
return
""
;};
/**
* Получаем текущий параграф.
* @returns {?Paragraph}
*/
CDocumentControllerBase
.
prototype
.
GetCurrentParagraph
=
function
(){
return
null
};
/**
* Собираем информацию о выделенной части документа.
* @param oInfo
*/
CDocumentControllerBase
.
prototype
.
GetSelectedElementsInfo
=
function
(
oInfo
){};
/**
/**
* Добавляем элемент в параграф.
* Добавляем элемент в параграф.
...
...
word/Editor/DrawingsController.js
View file @
d21eb72f
...
@@ -304,6 +304,34 @@ CDrawingsController.prototype.UpdateCursorType = function(X, Y, PageAbs, MouseEv
...
@@ -304,6 +304,34 @@ CDrawingsController.prototype.UpdateCursorType = function(X, Y, PageAbs, MouseEv
// TODO: Надо вызывать не у LogicDocument, а у DocumentContent заданного
// TODO: Надо вызывать не у LogicDocument, а у DocumentContent заданного
this
.
LogicDocument
.
controller_UpdateCursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
this
.
LogicDocument
.
controller_UpdateCursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
};
};
CDrawingsController
.
prototype
.
PasteFormatting
=
function
(
TextPr
,
ParaPr
)
{
this
.
DrawingObjects
.
paragraphFormatPaste
(
TextPr
,
ParaPr
,
false
);
};
CDrawingsController
.
prototype
.
IsSelectionUse
=
function
()
{
return
this
.
DrawingObjects
.
isSelectionUse
();
};
CDrawingsController
.
prototype
.
IsTextSelectionUse
=
function
()
{
return
this
.
DrawingObjects
.
isTextSelectionUse
();
};
CDrawingsController
.
prototype
.
GetCurPosXY
=
function
()
{
return
this
.
DrawingObjects
.
getCurPosXY
();
};
CDrawingsController
.
prototype
.
GetSelectedText
=
function
(
bClearText
)
{
return
this
.
DrawingObjects
.
getSelectedText
(
bClearText
);
};
CDrawingsController
.
prototype
.
GetCurrentParagraph
=
function
()
{
return
this
.
DrawingObjects
.
getCurrentParagraph
();
};
CDrawingsController
.
prototype
.
GetSelectedElementsInfo
=
function
(
oInfo
)
{
this
.
DrawingObjects
.
getSelectedElementsInfo
(
oInfo
);
};
CDrawingsController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
CDrawingsController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
{
{
...
...
word/Editor/Footnotes.js
View file @
d21eb72f
...
@@ -904,6 +904,48 @@ CFootnotesController.prototype.UpdateCursorType = function(X, Y, PageAbs, MouseE
...
@@ -904,6 +904,48 @@ CFootnotesController.prototype.UpdateCursorType = function(X, Y, PageAbs, MouseE
this
.
CurFootnote
.
Update_CursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
this
.
CurFootnote
.
Update_CursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
}
}
};
};
CFootnotesController
.
prototype
.
PasteFormatting
=
function
(
TextPr
,
ParaPr
)
{
// TODO: Доделать селект и курсор
if
(
true
===
this
.
Selection
.
Use
)
{
}
else
{
if
(
null
!==
this
.
CurFootnote
)
this
.
CurFootnote
.
Paragraph_Format_Paste
(
TextPr
,
ParaPr
,
true
);
}
};
CFootnotesController
.
prototype
.
IsSelectionUse
=
function
()
{
// TODO: Добавить селект
return
false
;
};
CFootnotesController
.
prototype
.
IsTextSelectionUse
=
function
()
{
// TODO: Реализовать
return
false
;
};
CFootnotesController
.
prototype
.
GetCurPosXY
=
function
()
{
// TODO: Реализовать
return
{
X
:
0
,
Y
:
0
};
};
CFootnotesController
.
prototype
.
GetSelectedText
=
function
(
bClearText
)
{
// TODO: Реализовать
return
""
;
};
CFootnotesController
.
prototype
.
GetCurrentParagraph
=
function
()
{
// TODO: Реализовать
return
null
;
};
CFootnotesController
.
prototype
.
GetSelectedElementsInfo
=
function
(
oInfo
)
{
// TODO: Реализовать
};
CFootnotesController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
CFootnotesController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
{
{
...
...
word/Editor/HeaderFooterController.js
View file @
d21eb72f
...
@@ -253,6 +253,35 @@ CHdrFtrController.prototype.UpdateCursorType = function(X, Y, PageAbs, MouseEven
...
@@ -253,6 +253,35 @@ CHdrFtrController.prototype.UpdateCursorType = function(X, Y, PageAbs, MouseEven
{
{
this
.
HdrFtr
.
Update_CursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
this
.
HdrFtr
.
Update_CursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
};
};
CHdrFtrController
.
prototype
.
PasteFormatting
=
function
(
TextPr
,
ParaPr
)
{
this
.
HdrFtr
.
Paragraph_Format_Paste
(
TextPr
,
ParaPr
,
false
);
};
CHdrFtrController
.
prototype
.
IsSelectionUse
=
function
()
{
return
this
.
HdrFtr
.
Is_SelectionUse
();
};
CHdrFtrController
.
prototype
.
IsTextSelectionUse
=
function
()
{
return
this
.
HdrFtr
.
Is_TextSelectionUse
();
};
CHdrFtrController
.
prototype
.
GetCurPosXY
=
function
()
{
return
this
.
HdrFtr
.
Get_CurPosXY
();
};
CHdrFtrController
.
prototype
.
GetSelectedText
=
function
(
bClearText
)
{
return
this
.
HdrFtr
.
Get_SelectedText
(
bClearText
);
};
CHdrFtrController
.
prototype
.
GetCurrentParagraph
=
function
()
{
return
this
.
HdrFtr
.
Get_CurrentParagraph
();
};
CHdrFtrController
.
prototype
.
GetSelectedElementsInfo
=
function
(
oInfo
)
{
this
.
HdrFtr
.
Get_SelectedElementsInfo
(
oInfo
);
};
CHdrFtrController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
CHdrFtrController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
{
{
...
...
word/Editor/LogicDocumentController.js
View file @
d21eb72f
...
@@ -229,8 +229,34 @@ CLogicDocumentController.prototype.UpdateCursorType = function(X, Y, PageAbs, Mo
...
@@ -229,8 +229,34 @@ CLogicDocumentController.prototype.UpdateCursorType = function(X, Y, PageAbs, Mo
{
{
this
.
LogicDocument
.
controller_UpdateCursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
this
.
LogicDocument
.
controller_UpdateCursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
};
};
CLogicDocumentController
.
prototype
.
PasteFormatting
=
function
(
TextPr
,
ParaPr
)
{
this
.
LogicDocument
.
controller_PasteFormatting
(
TextPr
,
ParaPr
);
};
CLogicDocumentController
.
prototype
.
IsSelectionUse
=
function
()
{
return
this
.
LogicDocument
.
controller_IsSelectionUse
();
};
CLogicDocumentController
.
prototype
.
IsTextSelectionUse
=
function
()
{
return
this
.
LogicDocument
.
controller_IsTextSelectionUse
();
};
CLogicDocumentController
.
prototype
.
GetCurPosXY
=
function
()
{
return
this
.
LogicDocument
.
controller_GetCurPosXY
();
};
CLogicDocumentController
.
prototype
.
GetSelectedText
=
function
(
bClearText
)
{
return
this
.
LogicDocument
.
controller_GetSelectedText
(
bClearText
);
};
CLogicDocumentController
.
prototype
.
GetCurrentParagraph
=
function
()
{
return
this
.
LogicDocument
.
controller_GetCurrentParagraph
();
};
CLogicDocumentController
.
prototype
.
GetSelectedElementsInfo
=
function
(
oInfo
)
{
this
.
LogicDocument
.
controller_GetSelectedElementsInfo
(
oInfo
);
};
CLogicDocumentController
.
prototype
.
AddToParagraph
=
function
(
oItem
)
CLogicDocumentController
.
prototype
.
AddToParagraph
=
function
(
oItem
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment