Skip to content

Commit 366b6fb

Browse files
gokaysatireszkadev
authored andcommitted
Rename OtherViewCursorSection to TextCursorSection.
Signed-off-by: Gökay Şatır <[email protected]> Change-Id: Idf88f847dc10ca24ab50da175e4efba9ade20578
1 parent 7471e0f commit 366b6fb

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

browser/src/canvas/sections/OtherViewCursorSection.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// This is used for other views' cursors.
1414

15-
class OtherViewCursorSection extends HTMLObjectSection {
15+
class TextCursorSection extends HTMLObjectSection {
1616
documentObject: boolean = true;
1717
interactable: boolean = false; // We don't bother with events.
1818
zIndex: number = app.CSections.DefaultForDocumentObjects.processingOrder;
@@ -21,7 +21,7 @@ class OtherViewCursorSection extends HTMLObjectSection {
2121
app.CSections.DefaultForDocumentObjects.processingOrder;
2222

2323
static sectionNamePrefix = 'OtherViewCursor ';
24-
static sectionPointers: Array<OtherViewCursorSection> = [];
24+
static sectionPointers: Array<TextCursorSection> = [];
2525

2626
constructor(
2727
viewId: number,
@@ -31,7 +31,7 @@ class OtherViewCursorSection extends HTMLObjectSection {
3131
mode: number,
3232
) {
3333
super(
34-
OtherViewCursorSection.sectionNamePrefix + viewId,
34+
TextCursorSection.sectionNamePrefix + viewId,
3535
rectangle.pWidth / app.dpiScale,
3636
rectangle.pHeight / app.dpiScale,
3737
new cool.SimplePoint(rectangle.x1, rectangle.y1),
@@ -95,12 +95,12 @@ class OtherViewCursorSection extends HTMLObjectSection {
9595

9696
rectangle.pWidth = 2 * app.dpiScale; // Width of the cursor.
9797

98-
const sectionName = OtherViewCursorSection.sectionNamePrefix + viewId;
99-
let section: OtherViewCursorSection;
98+
const sectionName = TextCursorSection.sectionNamePrefix + viewId;
99+
let section: TextCursorSection;
100100
if (app.sectionContainer.doesSectionExist(sectionName)) {
101101
section = app.sectionContainer.getSectionWithName(
102102
sectionName,
103-
) as OtherViewCursorSection;
103+
) as TextCursorSection;
104104
section.sectionProperties.part = part;
105105
section.sectionProperties.mode = mode;
106106
section.size[0] = rectangle.pWidth;
@@ -113,15 +113,15 @@ class OtherViewCursorSection extends HTMLObjectSection {
113113

114114
section.setPosition(rectangle.pX1, rectangle.pY1);
115115
} else {
116-
section = new OtherViewCursorSection(
116+
section = new TextCursorSection(
117117
viewId,
118118
color,
119119
rectangle,
120120
part,
121121
mode,
122122
);
123123
app.sectionContainer.addSection(section);
124-
OtherViewCursorSection.sectionPointers.push(section);
124+
TextCursorSection.sectionPointers.push(section);
125125
}
126126

127127
section.setShowSection(section.checkMyVisibility());
@@ -144,13 +144,13 @@ class OtherViewCursorSection extends HTMLObjectSection {
144144
}
145145

146146
public static removeView(viewId: number) {
147-
const sectionName = OtherViewCursorSection.sectionNamePrefix + viewId;
147+
const sectionName = TextCursorSection.sectionNamePrefix + viewId;
148148
if (app.sectionContainer.doesSectionExist(sectionName)) {
149149
const section = app.sectionContainer.getSectionWithName(
150150
sectionName,
151-
) as OtherViewCursorSection;
152-
OtherViewCursorSection.sectionPointers.splice(
153-
OtherViewCursorSection.sectionPointers.indexOf(section),
151+
) as TextCursorSection;
152+
TextCursorSection.sectionPointers.splice(
153+
TextCursorSection.sectionPointers.indexOf(section),
154154
1,
155155
);
156156
app.sectionContainer.removeSection(sectionName);
@@ -159,20 +159,20 @@ class OtherViewCursorSection extends HTMLObjectSection {
159159
}
160160

161161
public static doesViewCursorSectionExist(viewId: number) {
162-
const name = OtherViewCursorSection.sectionNamePrefix + viewId;
162+
const name = TextCursorSection.sectionNamePrefix + viewId;
163163
return app.sectionContainer.doesSectionExist(name);
164164
}
165165

166166
public static getViewCursorSection(viewId: number) {
167-
if (OtherViewCursorSection.doesViewCursorSectionExist(viewId)) {
168-
const name = OtherViewCursorSection.sectionNamePrefix + viewId;
167+
if (TextCursorSection.doesViewCursorSectionExist(viewId)) {
168+
const name = TextCursorSection.sectionNamePrefix + viewId;
169169
return app.sectionContainer.getSectionWithName(name);
170170
} else return null;
171171
}
172172

173173
public static updateVisibilities(hideCursors: boolean = false) {
174-
for (let i = 0; i < OtherViewCursorSection.sectionPointers.length; i++) {
175-
const section = OtherViewCursorSection.sectionPointers[i];
174+
for (let i = 0; i < TextCursorSection.sectionPointers.length; i++) {
175+
const section = TextCursorSection.sectionPointers[i];
176176
section.setShowSection(section.checkMyVisibility());
177177
if (hideCursors) section.getHTMLObject().style.opacity = '0';
178178
else section.getHTMLObject().style.opacity = '1';

browser/src/control/Parts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515
/* global app _ cool */
16-
/* global _ JSDialog app OtherViewCellCursorSection TileManager OtherViewCursorSection */
16+
/* global _ JSDialog app OtherViewCellCursorSection TileManager TextCursorSection */
1717

1818
window.L.Map.include({
1919
/*
@@ -112,7 +112,7 @@ window.L.Map.include({
112112
});
113113

114114
OtherViewCellCursorSection.updateVisibilities();
115-
OtherViewCursorSection.updateVisibilities();
115+
TextCursorSection.updateVisibilities();
116116
app.definitions.otherViewGraphicSelectionSection.updateVisibilities();
117117
docLayer.eachView(docLayer._viewSelections, docLayer._onUpdateTextViewSelection, docLayer);
118118
docLayer._clearSelections(calledFromSetPartHandler);

browser/src/layer/tile/CanvasTileLayer.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* window.L.CanvasTileLayer is a layer with canvas based rendering.
44
*/
55

6-
/* global app JSDialog CanvasSectionContainer GraphicSelection CanvasOverlay CDarkOverlay CursorHeaderSection $ _ CPointSet CPolyUtil CPolygon Cursor CCellSelection PathGroupType UNOKey cool OtherViewCellCursorSection TileManager SplitSection TextSelections CellSelectionMarkers URLPopUpSection CalcValidityDropDown DocumentBase CellCursorSection FormFieldButton OtherViewCursorSection */
6+
/* global app JSDialog CanvasSectionContainer GraphicSelection CanvasOverlay CDarkOverlay CursorHeaderSection $ _ CPointSet CPolyUtil CPolygon Cursor CCellSelection PathGroupType UNOKey cool OtherViewCellCursorSection TileManager SplitSection TextSelections CellSelectionMarkers URLPopUpSection CalcValidityDropDown DocumentBase CellCursorSection FormFieldButton TextCursorSection */
77

88
function clamp(num, min, max)
99
{
@@ -1040,7 +1040,7 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
10401040
// update tiles and selection because mode could be changed
10411041
TileManager.update();
10421042
app.definitions.otherViewGraphicSelectionSection.updateVisibilities();
1043-
OtherViewCursorSection.updateVisibilities();
1043+
TextCursorSection.updateVisibilities();
10441044
this.updateAllTextViewSelection();
10451045
}
10461046
else if (textMsg.startsWith('partstatus:')) {
@@ -1984,7 +1984,7 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
19841984
for (let i = 0; i < rectangle.length; i++) rectangle[i] = parseInt(rectangle[i]);
19851985
}
19861986

1987-
OtherViewCursorSection.addOrUpdateOtherViewCursor(viewId, username, rectangle, parseInt(obj.part), mode);
1987+
TextCursorSection.addOrUpdateOtherViewCursor(viewId, username, rectangle, parseInt(obj.part), mode);
19881988

19891989
if (app.getFollowedViewId() === viewId && (app.isFollowingEditor() || app.isFollowingUser())) {
19901990
if (this._map.getDocType() === 'text' || this._map.getDocType() === 'presentation') {
@@ -2060,7 +2060,7 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
20602060
return;
20612061
}
20622062

2063-
const section = OtherViewCursorSection.getViewCursorSection(viewId);
2063+
const section = TextCursorSection.getViewCursorSection(viewId);
20642064
if (section) {
20652065
const showCursor = obj.visible === 'true';
20662066
section.sectionProperties.showCursor = showCursor;
@@ -2086,7 +2086,7 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
20862086
delete this._viewSelections[viewId];
20872087
}
20882088

2089-
OtherViewCursorSection.removeView(viewId);
2089+
TextCursorSection.removeView(viewId);
20902090

20912091
OtherViewCellCursorSection.removeView(viewId);
20922092
app.definitions.otherViewGraphicSelectionSection.removeView(viewId);
@@ -2933,7 +2933,7 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
29332933
if (!this.isCalc())
29342934
this._replayPrintTwipsMsgs(false);
29352935
this._onUpdateCursor(null, true);
2936-
OtherViewCursorSection.updateVisibilities();
2936+
TextCursorSection.updateVisibilities();
29372937
},
29382938

29392939
_updateCursorPos: function () {
@@ -3023,7 +3023,7 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
30233023

30243024
if (!app.file.textCursor.visible) {
30253025
this._updateCursorAndOverlay();
3026-
OtherViewCursorSection.updateVisibilities(true);
3026+
TextCursorSection.updateVisibilities(true);
30273027
return;
30283028
}
30293029

@@ -3078,7 +3078,7 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
30783078

30793079
this._updateCursorAndOverlay();
30803080

3081-
OtherViewCursorSection.updateVisibilities();
3081+
TextCursorSection.updateVisibilities();
30823082
},
30833083

30843084
activateCursor: function () {
@@ -3145,7 +3145,7 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
31453145
return;
31463146
}
31473147

3148-
const section = OtherViewCursorSection.getViewCursorSection(viewId);
3148+
const section = TextCursorSection.getViewCursorSection(viewId);
31493149

31503150
if (section && section.showSection) {
31513151
const point = new cool.SimplePoint(section.position[0] * app.pixelsToTwips, section.position[1] * app.pixelsToTwips);
@@ -3970,7 +3970,7 @@ window.L.CanvasTileLayer = window.L.Layer.extend({
39703970

39713971
TextSelections.hideHandles();
39723972

3973-
OtherViewCursorSection.updateVisibilities(true);
3973+
TextCursorSection.updateVisibilities(true);
39743974
},
39753975

39763976
postZoomAnimation: function () {

0 commit comments

Comments
 (0)