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
b7835aa0
Commit
b7835aa0
authored
Jun 29, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First version of moving cursor left in footnotes.
parent
3966e0ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
107 additions
and
50 deletions
+107
-50
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+2
-21
word/Editor/Footnotes.js
word/Editor/Footnotes.js
+105
-29
No files found.
word/Editor/DocumentContent.js
View file @
b7835aa0
...
...
@@ -1899,28 +1899,9 @@ CDocumentContent.prototype.Cursor_MoveToEndPos = function(AddToSelect)
for
(
var
Index
=
StartPos
+
1
;
Index
<=
EndPos
;
Index
++
)
{
var
Item
=
this
.
Content
[
Index
];
Item
.
Selection
.
Use
=
true
;
var
ItemType
=
Item
.
GetType
();
if
(
type_Paragraph
===
ItemType
)
{
Item
.
Selection
.
Set_StartPos
(
Item
.
Internal_GetStartPos
(),
-
1
);
Item
.
Selection
.
Set_EndPos
(
Item
.
Content
.
length
-
1
,
-
1
);
}
else
//if ( type_Table === ItemType )
{
var
Row
=
Item
.
Content
.
length
-
1
;
var
Cell
=
Item
.
Content
[
Row
].
Get_CellsCount
()
-
1
;
var
Pos0
=
{
Row
:
0
,
Cell
:
0
};
var
Pos1
=
{
Row
:
Row
,
Cell
:
Cell
};
Item
.
Selection
.
StartPos
.
Pos
=
Pos0
;
Item
.
Selection
.
EndPos
.
Pos
=
Pos1
;
Item
.
Internal_Selection_UpdateCells
();
}
this
.
Content
[
Index
].
Select_All
(
1
);
}
this
.
Content
[
StartPos
].
Cursor_MoveToEndPos
(
true
);
}
}
...
...
word/Editor/Footnotes.js
View file @
b7835aa0
...
...
@@ -336,24 +336,11 @@ CFootnotesController.prototype.StartSelection = function(X, Y, PageAbs, MouseEve
this
.
Selection
.
Start
.
Footnote
.
Selection_SetStart
(
X
,
Y
,
0
,
MouseEvent
);
this
.
Selection
.
Start
.
Pos
=
{
X
:
X
,
Y
:
Y
,
PageAbs
:
PageAbs
,
MouseEvent
:
MouseEvent
};
this
.
Selection
.
End
.
Pos
=
{
X
:
X
,
Y
:
Y
,
PageAbs
:
PageAbs
,
MouseEvent
:
MouseEvent
};
this
.
CurFootnote
=
this
.
Selection
.
Start
.
Footnote
;
this
.
Selection
.
Footnotes
=
{};
this
.
Selection
.
Footnotes
[
this
.
Selection
.
Start
.
Footnote
.
Get_Id
()]
=
this
.
Selection
.
Start
.
Footnote
;
this
.
Selection
.
Direction
=
0
;
};
CFootnotesController
.
prototype
.
EndSelection
=
function
(
X
,
Y
,
PageAbs
,
MouseEvent
)
{
...
...
@@ -366,12 +353,6 @@ CFootnotesController.prototype.EndSelection = function(X, Y, PageAbs, MouseEvent
}
this
.
Selection
.
End
=
oResult
;
this
.
Selection
.
End
.
Pos
=
{
X
:
X
,
Y
:
Y
,
PageAbs
:
PageAbs
,
MouseEvent
:
MouseEvent
};
this
.
CurFootnote
=
this
.
Selection
.
End
.
Footnote
;
var
sStartId
=
this
.
Selection
.
Start
.
Footnote
.
Get_Id
();
...
...
@@ -390,12 +371,14 @@ CFootnotesController.prototype.EndSelection = function(X, Y, PageAbs, MouseEvent
if
(
this
.
Selection
.
Start
.
Page
>
this
.
Selection
.
End
.
Page
||
this
.
Selection
.
Start
.
Index
>
this
.
Selection
.
End
.
Index
)
{
this
.
Selection
.
Start
.
Footnote
.
Selection_SetEnd
(
-
MEASUREMENT_MAX_MM_VALUE
,
-
MEASUREMENT_MAX_MM_VALUE
,
0
,
MouseEvent
);
this
.
Selection
.
End
.
Footnote
.
Selection_SetStart
(
MEASUREMENT_MAX_MM_VALUE
,
MEASUREMENT_MAX_MM_VALUE
,
0
,
this
.
Selection
.
Start
.
Pos
.
MouseEvent
);
this
.
Selection
.
End
.
Footnote
.
Selection_SetStart
(
MEASUREMENT_MAX_MM_VALUE
,
MEASUREMENT_MAX_MM_VALUE
,
0
,
MouseEvent
);
this
.
Selection
.
Direction
=
-
1
;
}
else
{
this
.
Selection
.
Start
.
Footnote
.
Selection_SetEnd
(
MEASUREMENT_MAX_MM_VALUE
,
MEASUREMENT_MAX_MM_VALUE
,
0
,
MouseEvent
);
this
.
Selection
.
End
.
Footnote
.
Selection_SetStart
(
-
MEASUREMENT_MAX_MM_VALUE
,
-
MEASUREMENT_MAX_MM_VALUE
,
0
,
this
.
Selection
.
Start
.
Pos
.
MouseEvent
);
this
.
Selection
.
End
.
Footnote
.
Selection_SetStart
(
-
MEASUREMENT_MAX_MM_VALUE
,
-
MEASUREMENT_MAX_MM_VALUE
,
0
,
MouseEvent
);
this
.
Selection
.
Direction
=
1
;
}
this
.
Selection
.
End
.
Footnote
.
Selection_SetEnd
(
X
,
Y
,
0
,
MouseEvent
);
...
...
@@ -415,6 +398,7 @@ CFootnotesController.prototype.EndSelection = function(X, Y, PageAbs, MouseEvent
this
.
Selection
.
End
.
Footnote
.
Selection_SetEnd
(
X
,
Y
,
0
,
MouseEvent
);
this
.
Selection
.
Footnotes
=
{};
this
.
Selection
.
Footnotes
[
this
.
Selection
.
Start
.
Footnote
.
Get_Id
()]
=
this
.
Selection
.
Start
.
Footnote
;
this
.
Selection
.
Direction
=
0
;
}
};
CFootnotesController
.
prototype
.
Undo
=
function
()
...
...
@@ -619,6 +603,18 @@ CFootnotesController.prototype.private_CheckFootnotesSelectionBeforeAction = fun
return
true
;
};
CFootnotesController
.
prototype
.
private_SetCurrentFootnoteNoSelection
=
function
(
oFootnote
)
{
this
.
Selection
.
Use
=
false
;
this
.
CurFootnote
=
oFootnote
;
this
.
Selection
.
Start
.
Footnote
=
oFootnote
;
this
.
Selection
.
End
.
Footnote
=
oFootnote
;
this
.
Selection
.
Direction
=
0
;
this
.
Selection
.
Footnotes
=
{};
this
.
Selection
.
Footnotes
[
oFootnote
.
Get_Id
()]
=
oFootnote
;
};
//CF
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Controller area
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -746,7 +742,8 @@ CFootnotesController.prototype.MoveCursorToStartPos = function(AddToSelect)
if
(
arrRange
.
length
<=
0
)
return
;
this
.
LogicDocument
.
Start_SelectionFromCurPos
();
if
(
true
!==
this
.
Selection
.
Use
)
this
.
LogicDocument
.
Start_SelectionFromCurPos
();
this
.
Selection
.
End
.
Footnote
=
arrRange
[
0
];
this
.
Selection
.
Start
.
Footnote
=
oFootnote
;
...
...
@@ -764,28 +761,107 @@ CFootnotesController.prototype.MoveCursorToStartPos = function(AddToSelect)
this
.
Selection
.
Footnotes
[
oTempFootnote
.
Get_Id
()]
=
oTempFootnote
;
}
}
if
(
this
.
Selection
.
Start
.
Footnote
!==
this
.
Selection
.
End
.
Footnote
)
this
.
Selection
.
Direction
=
-
1
;
else
this
.
Selection
.
Direction
=
0
;
}
};
CFootnotesController
.
prototype
.
MoveCursorToEndPos
=
function
(
AddToSelect
)
{
// TODO: Реализовать
if
(
true
!==
AddToSelect
)
{
this
.
LogicDocument
.
controller_MoveCursorToEndPos
(
false
);
}
else
{
var
oFootnote
=
this
.
CurFootnote
;
if
(
true
===
this
.
Selection
.
Use
)
oFootnote
=
this
.
Selection
.
Start
.
Footnote
;
var
arrRange
=
this
.
LogicDocument
.
Get_FootnotesList
(
oFootnote
,
null
);
if
(
arrRange
.
length
<=
0
)
return
;
if
(
true
!==
this
.
Selection
.
Use
)
this
.
LogicDocument
.
Start_SelectionFromCurPos
();
this
.
Selection
.
End
.
Footnote
=
arrRange
[
arrRange
.
length
-
1
];
this
.
Selection
.
Start
.
Footnote
=
oFootnote
;
this
.
Selection
.
Footnotes
=
{};
oFootnote
.
Cursor_MoveToEndPos
(
true
);
this
.
Selection
.
Footnotes
=
{};
this
.
Selection
.
Footnotes
[
oFootnote
.
Get_Id
()]
=
oFootnote
;
for
(
var
nIndex
=
0
,
nCount
=
arrRange
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
var
oTempFootnote
=
arrRange
[
nIndex
];
if
(
oTempFootnote
!==
oFootnote
)
{
oTempFootnote
.
Select_All
(
1
);
this
.
Selection
.
Footnotes
[
oTempFootnote
.
Get_Id
()]
=
oTempFootnote
;
}
}
if
(
this
.
Selection
.
Start
.
Footnote
!==
this
.
Selection
.
End
.
Footnote
)
this
.
Selection
.
Direction
=
1
;
else
this
.
Selection
.
Direction
=
0
;
}
};
CFootnotesController
.
prototype
.
MoveCursorLeft
=
function
(
AddToSelect
,
Word
)
{
var
bRetValue
=
false
;
// TODO: Доделать селект и курсор
if
(
true
===
this
.
Selection
.
Use
)
{
if
(
true
!==
AddToSelect
)
{
var
oFootnote
=
this
.
CurFootnote
;
if
(
0
===
this
.
Selection
.
Direction
)
oFootnote
=
this
.
CurFootnote
;
else
if
(
1
===
this
.
Selection
.
Direction
)
oFootnote
=
this
.
Selection
.
Start
.
Footnote
;
else
oFootnote
=
this
.
Selection
.
End
.
Footnote
;
for
(
var
sId
in
this
.
Selection
.
Footnotes
)
{
if
(
oFootnote
!==
this
.
Selection
.
Footnotes
[
sId
])
this
.
Selection
.
Footnotes
[
sId
].
Selection_Remove
();
}
oFootnote
.
Cursor_MoveLeft
(
false
,
Word
);
oFootnote
.
Selection_Remove
();
this
.
private_SetCurrentFootnoteNoSelection
(
oFootnote
);
}
else
{
var
oFootnote
=
this
.
Selection
.
End
.
Footnote
;
if
(
false
===
oFootnote
.
Cursor_MoveLeft
(
true
,
Word
))
{
}
}
}
else
{
if
(
null
!==
this
.
CurFootnote
)
bRetValue
=
this
.
CurFootnote
.
Cursor_MoveLeft
(
AddToSelect
,
Word
);
if
(
true
===
AddToSelect
)
{
}
else
{
var
oFootnote
=
this
.
CurFootnote
;
if
(
false
===
oFootnote
.
Cursor_MoveLeft
(
false
,
Word
))
{
}
}
}
return
bRetVal
ue
;
return
tr
ue
;
};
CFootnotesController
.
prototype
.
MoveCursorRight
=
function
(
AddToSelect
,
Word
,
FromPaste
)
{
...
...
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