Commit 456dc3bf authored by Alexander.Trofimov's avatar Alexander.Trofimov

common/Drawings/TrackObjects/AdjustmentTracks to function-closure

common/Drawings/TrackObjects/MoveTracks to function-closure
common/Drawings/TrackObjects/NewShapeTracks to function-closure
common/Drawings/TrackObjects/PolyLine to function-closure
parent 7eda2c25
...@@ -35,6 +35,11 @@ ...@@ -35,6 +35,11 @@
"../common/Charts/3DTransformation.js", "../common/Charts/3DTransformation.js",
"../common/Charts/ChartsDrawer.js", "../common/Charts/ChartsDrawer.js",
"../common/Drawings/TrackObjects/AdjustmentTracks.js",
"../common/Drawings/TrackObjects/MoveTracks.js",
"../common/Drawings/TrackObjects/NewShapeTracks.js",
"../common/Drawings/TrackObjects/PolyLine.js",
"../common/scroll.js", "../common/scroll.js",
"../cell/view/iscroll.js", "../cell/view/iscroll.js",
...@@ -93,13 +98,9 @@ ...@@ -93,13 +98,9 @@
"../common/SerializeCommonWordExcel.js", "../common/SerializeCommonWordExcel.js",
"../common/SerializeChart.js", "../common/SerializeChart.js",
"../common/Drawings/DrawingObjectsHandlers.js", "../common/Drawings/DrawingObjectsHandlers.js",
"../common/Drawings/TrackObjects/AdjustmentTracks.js",
"../common/Drawings/TrackObjects/ResizeTracks.js", "../common/Drawings/TrackObjects/ResizeTracks.js",
"../common/Drawings/TrackObjects/RotateTracks.js", "../common/Drawings/TrackObjects/RotateTracks.js",
"../common/Drawings/TrackObjects/NewShapeTracks.js",
"../common/Drawings/TrackObjects/PolyLine.js",
"../common/Drawings/TrackObjects/Spline.js", "../common/Drawings/TrackObjects/Spline.js",
"../common/Drawings/TrackObjects/MoveTracks.js",
"../common/Drawings/TextDrawer.js", "../common/Drawings/TextDrawer.js",
"../cell/view/DrawingObjectsController.js", "../cell/view/DrawingObjectsController.js",
"../cell/model/DrawingObjects/Graphics.js", "../cell/model/DrawingObjects/Graphics.js",
......
...@@ -35,6 +35,11 @@ ...@@ -35,6 +35,11 @@
"../common/Charts/3DTransformation.js", "../common/Charts/3DTransformation.js",
"../common/Charts/ChartsDrawer.js", "../common/Charts/ChartsDrawer.js",
"../common/Drawings/TrackObjects/AdjustmentTracks.js",
"../common/Drawings/TrackObjects/MoveTracks.js",
"../common/Drawings/TrackObjects/NewShapeTracks.js",
"../common/Drawings/TrackObjects/PolyLine.js",
"../common/scroll.js", "../common/scroll.js",
"../common/wordcopypaste.js", "../common/wordcopypaste.js",
...@@ -68,13 +73,9 @@ ...@@ -68,13 +73,9 @@
"../word/Editor/Sections.js", "../word/Editor/Sections.js",
"../word/Editor/History.js", "../word/Editor/History.js",
"../common/Drawings/DrawingObjectsHandlers.js", "../common/Drawings/DrawingObjectsHandlers.js",
"../common/Drawings/TrackObjects/AdjustmentTracks.js",
"../common/Drawings/TrackObjects/ResizeTracks.js", "../common/Drawings/TrackObjects/ResizeTracks.js",
"../common/Drawings/TrackObjects/RotateTracks.js", "../common/Drawings/TrackObjects/RotateTracks.js",
"../common/Drawings/TrackObjects/NewShapeTracks.js",
"../common/Drawings/TrackObjects/PolyLine.js",
"../common/Drawings/TrackObjects/Spline.js", "../common/Drawings/TrackObjects/Spline.js",
"../common/Drawings/TrackObjects/MoveTracks.js",
"../word/Drawing/HatchPattern.js", "../word/Drawing/HatchPattern.js",
"../word/Drawing/Graphics.js", "../word/Drawing/Graphics.js",
"../common/Overlay.js", "../common/Overlay.js",
......
...@@ -38,6 +38,11 @@ ...@@ -38,6 +38,11 @@
"../common/Charts/3DTransformation.js", "../common/Charts/3DTransformation.js",
"../common/Charts/ChartsDrawer.js", "../common/Charts/ChartsDrawer.js",
"../common/Drawings/TrackObjects/AdjustmentTracks.js",
"../common/Drawings/TrackObjects/MoveTracks.js",
"../common/Drawings/TrackObjects/NewShapeTracks.js",
"../common/Drawings/TrackObjects/PolyLine.js",
"../common/scroll.js", "../common/scroll.js",
"../common/Scrolls/iscroll.js", "../common/Scrolls/iscroll.js",
...@@ -55,10 +60,6 @@ ...@@ -55,10 +60,6 @@
"../word/Drawing/Externals.js", "../word/Drawing/Externals.js",
"../common/GlobalLoaders.js", "../common/GlobalLoaders.js",
"../word/Drawing/translations.js", "../word/Drawing/translations.js",
"../common/Drawings/TrackObjects/AdjustmentTracks.js",
"../common/Drawings/TrackObjects/MoveTracks.js",
"../common/Drawings/TrackObjects/NewShapeTracks.js",
"../common/Drawings/TrackObjects/PolyLine.js",
"../common/Drawings/TrackObjects/ResizeTracks.js", "../common/Drawings/TrackObjects/ResizeTracks.js",
"../common/Drawings/TrackObjects/RotateTracks.js", "../common/Drawings/TrackObjects/RotateTracks.js",
"../common/Drawings/TrackObjects/Spline.js", "../common/Drawings/TrackObjects/Spline.js",
......
...@@ -875,7 +875,7 @@ TextArtPreviewManager.prototype.getShape = function() ...@@ -875,7 +875,7 @@ TextArtPreviewManager.prototype.getShape = function()
} }
} }
var oParentObjects = oShape.getParentObjects(); var oParentObjects = oShape.getParentObjects();
var oTrack = new NewShapeTrack("textRect", 0, 0, oParentObjects.theme, oParentObjects.master, oParentObjects.layout, oParentObjects.slide, 0); var oTrack = new AscFormat.NewShapeTrack("textRect", 0, 0, oParentObjects.theme, oParentObjects.master, oParentObjects.layout, oParentObjects.slide, 0);
oTrack.track({}, oShape.convertPixToMM(this.canvasWidth), oShape.convertPixToMM(this.canvasHeight)); oTrack.track({}, oShape.convertPixToMM(this.canvasWidth), oShape.convertPixToMM(this.canvasHeight));
oShape = oTrack.getShape(bWord, oShape.getDrawingDocument(), oShape.drawingObjects); oShape = oTrack.getShape(bWord, oShape.getDrawingDocument(), oShape.drawingObjects);
oShape.setStyle(null); oShape.setStyle(null);
......
...@@ -654,7 +654,7 @@ DrawingObjectsController.prototype = ...@@ -654,7 +654,7 @@ DrawingObjectsController.prototype =
this.arrPreTrackObjects.length = 0; this.arrPreTrackObjects.length = 0;
if(hit.adjPolarFlag === false) if(hit.adjPolarFlag === false)
{ {
this.arrPreTrackObjects.push(new XYAdjustmentTrack(selectedObject, hit.adjNum, hit.warp)); this.arrPreTrackObjects.push(new AscFormat.XYAdjustmentTrack(selectedObject, hit.adjNum, hit.warp));
} }
else else
{ {
......
...@@ -1674,7 +1674,7 @@ CGroupShape.prototype = ...@@ -1674,7 +1674,7 @@ CGroupShape.prototype =
createMoveTrack: function() createMoveTrack: function()
{ {
return new MoveGroupTrack(this); return new AscFormat.MoveGroupTrack(this);
}, },
createResizeTrack: function(cardDirection) createResizeTrack: function(cardDirection)
{ {
......
...@@ -327,7 +327,7 @@ CImageShape.prototype = ...@@ -327,7 +327,7 @@ CImageShape.prototype =
createMoveTrack: function() createMoveTrack: function()
{ {
return new MoveShapeImageTrack(this); return new AscFormat.MoveShapeImageTrack(this);
}, },
getInvertTransform: function() getInvertTransform: function()
......
...@@ -4901,7 +4901,7 @@ CShape.prototype = ...@@ -4901,7 +4901,7 @@ CShape.prototype =
}, },
createMoveTrack: function () { createMoveTrack: function () {
return new MoveShapeImageTrack(this); return new AscFormat.MoveShapeImageTrack(this);
}, },
......
...@@ -66,7 +66,7 @@ StartAddNewShape.prototype = ...@@ -66,7 +66,7 @@ StartAddNewShape.prototype =
slide = oParentObjects.slide; slide = oParentObjects.slide;
} }
} }
this.drawingObjects.arrPreTrackObjects.push(new NewShapeTrack(this.preset, x, y, this.drawingObjects.getTheme(), master, layout, slide, 0)); this.drawingObjects.arrPreTrackObjects.push(new AscFormat.NewShapeTrack(this.preset, x, y, this.drawingObjects.getTheme(), master, layout, slide, 0));
this.bStart = true; this.bStart = true;
this.drawingObjects.swapTrackObjects(); this.drawingObjects.swapTrackObjects();
}, },
...@@ -1819,7 +1819,7 @@ PolyLineAddState.prototype = ...@@ -1819,7 +1819,7 @@ PolyLineAddState.prototype =
return {objectId: "1", bMarker: true}; return {objectId: "1", bMarker: true};
this.drawingObjects.startTrackPos = {x: x, y: y, pageIndex:pageIndex}; this.drawingObjects.startTrackPos = {x: x, y: y, pageIndex:pageIndex};
this.drawingObjects.clearTrackObjects(); this.drawingObjects.clearTrackObjects();
this.drawingObjects.addTrackObject(new PolyLine(this.drawingObjects, this.drawingObjects.getTheme(), null, null, null, pageIndex)); this.drawingObjects.addTrackObject(new AscFormat.PolyLine(this.drawingObjects, this.drawingObjects.getTheme(), null, null, null, pageIndex));
this.drawingObjects.arrTrackObjects[0].arrPoint.push({x : x, y: y}); this.drawingObjects.arrTrackObjects[0].arrPoint.push({x : x, y: y});
this.drawingObjects.checkChartTextSelection(); this.drawingObjects.checkChartTextSelection();
this.drawingObjects.resetSelection(); this.drawingObjects.resetSelection();
...@@ -1935,7 +1935,7 @@ AddPolyLine2State.prototype = ...@@ -1935,7 +1935,7 @@ AddPolyLine2State.prototype =
this.drawingObjects.resetSelection(); this.drawingObjects.resetSelection();
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
this.drawingObjects.clearTrackObjects(); this.drawingObjects.clearTrackObjects();
this.drawingObjects.addTrackObject(new PolyLine(this.drawingObjects, this.drawingObjects.getTheme(), null, null, null, pageIndex)); this.drawingObjects.addTrackObject(new AscFormat.PolyLine(this.drawingObjects, this.drawingObjects.getTheme(), null, null, null, pageIndex));
this.drawingObjects.arrTrackObjects[0].arrPoint.push({x : x, y: y}); this.drawingObjects.arrTrackObjects[0].arrPoint.push({x : x, y: y});
this.drawingObjects.changeCurrentState(new AddPolyLine2State2(this.drawingObjects, x, y)); this.drawingObjects.changeCurrentState(new AddPolyLine2State2(this.drawingObjects, x, y));
}, },
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
*/ */
"use strict"; "use strict";
(function(window, undefined){
function XYAdjustmentTrack(originalShape, adjIndex, bTextWarp) function XYAdjustmentTrack(originalShape, adjIndex, bTextWarp)
{ {
AscFormat.ExecuteNoHistory(function(){ AscFormat.ExecuteNoHistory(function(){
...@@ -483,4 +485,10 @@ function PolarAdjustmentTrack(originalShape, adjIndex, bTextWarp) ...@@ -483,4 +485,10 @@ function PolarAdjustmentTrack(originalShape, adjIndex, bTextWarp)
} }
}; };
} }
PolarAdjustmentTrack.prototype.getBounds = XYAdjustmentTrack.prototype.getBounds; PolarAdjustmentTrack.prototype.getBounds = XYAdjustmentTrack.prototype.getBounds;
\ No newline at end of file
//--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].XYAdjustmentTrack = XYAdjustmentTrack;
window['AscFormat'].PolarAdjustmentTrack = PolarAdjustmentTrack;
})(window);
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
*/ */
"use strict"; "use strict";
(function(window, undefined){
function MoveShapeImageTrack(originalObject) function MoveShapeImageTrack(originalObject)
{ {
this.originalObject = originalObject; this.originalObject = originalObject;
...@@ -381,4 +383,11 @@ function MoveComment(comment) ...@@ -381,4 +383,11 @@ function MoveComment(comment)
{ {
this.comment.setPosition(this.x, this.y); this.comment.setPosition(this.x, this.y);
}; };
} }
\ No newline at end of file
//--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].MoveShapeImageTrack = MoveShapeImageTrack;
window['AscFormat'].MoveGroupTrack = MoveGroupTrack;
window['AscFormat'].MoveComment = MoveComment;
})(window);
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
*/ */
"use strict"; "use strict";
(function(window, undefined){
function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide, pageIndex) function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide, pageIndex)
{ {
...@@ -543,4 +545,8 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide, ...@@ -543,4 +545,8 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
boundsChecker.Bounds.extY = this.extY; boundsChecker.Bounds.extY = this.extY;
return boundsChecker.Bounds; return boundsChecker.Bounds;
} }
} }
\ No newline at end of file //--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].NewShapeTrack = NewShapeTrack;
})(window);
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
*/ */
"use strict"; "use strict";
(function(window, undefined){
function PolyLine (drawingObjects, theme, master, layout, slide, pageIndex) function PolyLine (drawingObjects, theme, master, layout, slide, pageIndex)
{ {
...@@ -247,4 +249,9 @@ function PolylineForDrawer(polyline) ...@@ -247,4 +249,9 @@ function PolylineForDrawer(polyline)
} }
g.ds(); g.ds();
}; };
} }
\ No newline at end of file
//--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].PolyLine = PolyLine;
})(window);
...@@ -24,14 +24,6 @@ ...@@ -24,14 +24,6 @@
*/ */
"use strict"; "use strict";
/**
* Created with JetBrains WebStorm.
* User: Sergey.Luzyanin
* Date: 6/27/13
* Time: 4:35 PM
* To change this template use File | Settings | File Templates.
*/
var TRANSLATE_HANDLE_NO_FLIP = []; var TRANSLATE_HANDLE_NO_FLIP = [];
TRANSLATE_HANDLE_NO_FLIP[0] = 0; TRANSLATE_HANDLE_NO_FLIP[0] = 0;
TRANSLATE_HANDLE_NO_FLIP[1] = 1; TRANSLATE_HANDLE_NO_FLIP[1] = 1;
......
...@@ -287,7 +287,7 @@ DrawingObjectsController.prototype.handleSlideComments = function(e, x, y, pag ...@@ -287,7 +287,7 @@ DrawingObjectsController.prototype.handleSlideComments = function(e, x, y, pag
if(this.handleEventMode === HANDLE_EVENT_MODE_HANDLE) if(this.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{ {
comments[i].selected = true; comments[i].selected = true;
this.addPreTrackObject(new MoveComment(comments[i])); this.addPreTrackObject(new AscFormat.MoveComment(comments[i]));
this.changeCurrentState(new PreMoveCommentState(this, x, y, comments[i])); this.changeCurrentState(new PreMoveCommentState(this, x, y, comments[i]));
if(i !== index_selected) if(i !== index_selected)
{ {
......
...@@ -596,7 +596,7 @@ CGraphicFrame.prototype = ...@@ -596,7 +596,7 @@ CGraphicFrame.prototype =
createMoveTrack: function() createMoveTrack: function()
{ {
return new MoveShapeImageTrack(this); return new AscFormat.MoveShapeImageTrack(this);
}, },
getSnapArrays: function(snapX, snapY) getSnapArrays: function(snapX, snapY)
......
...@@ -3750,7 +3750,7 @@ CPresentation.prototype = ...@@ -3750,7 +3750,7 @@ CPresentation.prototype =
CreateAndAddShapeFromSelectedContent : function(oDocContent) CreateAndAddShapeFromSelectedContent : function(oDocContent)
{ {
var track_object = new NewShapeTrack("textRect", 0, 0, this.Slides[this.CurPage].Layout.Master.Theme, this.Slides[this.CurPage].Layout.Master, this.Slides[this.CurPage].Layout, this.Slides[this.CurPage], this.CurPage); var track_object = new AscFormat.NewShapeTrack("textRect", 0, 0, this.Slides[this.CurPage].Layout.Master.Theme, this.Slides[this.CurPage].Layout.Master, this.Slides[this.CurPage].Layout, this.Slides[this.CurPage], this.CurPage);
track_object.track({}, 0, 0); track_object.track({}, 0, 0);
var shape = track_object.getShape(false, this.DrawingDocument, this.Slides[this.CurPage]); var shape = track_object.getShape(false, this.DrawingDocument, this.Slides[this.CurPage]);
shape.setParent(this.Slides[this.CurPage]); shape.setParent(this.Slides[this.CurPage]);
......
...@@ -66,7 +66,7 @@ StartAddNewShape.prototype = ...@@ -66,7 +66,7 @@ StartAddNewShape.prototype =
this.startX = x; this.startX = x;
this.startY = y; this.startY = y;
this.drawingObjects.arrPreTrackObjects.length = 0; this.drawingObjects.arrPreTrackObjects.length = 0;
this.drawingObjects.arrPreTrackObjects.push(new NewShapeTrack(this.preset, x, y, this.drawingObjects.document.theme, null, null, null, pageIndex)); this.drawingObjects.arrPreTrackObjects.push(new AscFormat.NewShapeTrack(this.preset, x, y, this.drawingObjects.document.theme, null, null, null, pageIndex));
this.bStart = true; this.bStart = true;
this.drawingObjects.swapTrackObjects(); this.drawingObjects.swapTrackObjects();
return true; return true;
...@@ -2005,7 +2005,7 @@ PolyLineAddState.prototype = ...@@ -2005,7 +2005,7 @@ PolyLineAddState.prototype =
return {objectId: null, bMarker: true}; return {objectId: null, bMarker: true};
this.drawingObjects.startTrackPos = {x: x, y: y, pageIndex:pageIndex}; this.drawingObjects.startTrackPos = {x: x, y: y, pageIndex:pageIndex};
this.drawingObjects.clearTrackObjects(); this.drawingObjects.clearTrackObjects();
this.drawingObjects.addTrackObject(new PolyLine(this.drawingObjects, this.drawingObjects.document.theme, null, null, null, pageIndex)); this.drawingObjects.addTrackObject(new AscFormat.PolyLine(this.drawingObjects, this.drawingObjects.document.theme, null, null, null, pageIndex));
this.drawingObjects.arrTrackObjects[0].arrPoint.push({x : x, y: y}); this.drawingObjects.arrTrackObjects[0].arrPoint.push({x : x, y: y});
this.drawingObjects.resetSelection(); this.drawingObjects.resetSelection();
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
...@@ -2101,7 +2101,7 @@ AddPolyLine2State.prototype = ...@@ -2101,7 +2101,7 @@ AddPolyLine2State.prototype =
this.drawingObjects.resetSelection(); this.drawingObjects.resetSelection();
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
this.drawingObjects.clearTrackObjects(); this.drawingObjects.clearTrackObjects();
this.drawingObjects.addTrackObject(new PolyLine(this.drawingObjects, this.drawingObjects.document.theme, null, null, null, pageIndex)); this.drawingObjects.addTrackObject(new AscFormat.PolyLine(this.drawingObjects, this.drawingObjects.document.theme, null, null, null, pageIndex));
this.drawingObjects.arrTrackObjects[0].arrPoint.push({x : x, y: y}); this.drawingObjects.arrTrackObjects[0].arrPoint.push({x : x, y: y});
this.drawingObjects.changeCurrentState(new AddPolyLine2State2(this.drawingObjects, x, y)); this.drawingObjects.changeCurrentState(new AddPolyLine2State2(this.drawingObjects, x, y));
}, },
......
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