Commit d463be77 authored by Alexander.Trofimov's avatar Alexander.Trofimov

cell/model/DrawingObjects/Format/ to function-closure

parent 8c21da27
......@@ -116,10 +116,10 @@
"../cell/model/DrawingObjects/DrawingDocument.js",
"../cell/model/DrawingObjects/GlobalCounters.js",
"../cell/model/DrawingObjects/Format/ShapePrototype.js",
"../cell/model/DrawingObjects/Format/ImagePrototype.js",
"../cell/model/DrawingObjects/Format/GroupPrototype.js",
"../cell/model/DrawingObjects/Format/ChartSpacePrototype.js",
"../slide/Editor/Format/GraphicFrame.js",
"../word/Editor/Comments.js",
"../word/Editor/Styles.js",
......
......@@ -24,10 +24,13 @@
*/
"use strict";
(function(window, undefined){
// Import
var CShape = AscFormat.CShape;
var CChartSpace = AscFormat.CChartSpace;
// ToDo перенести в один файл!
function getChartTranslateManager()
{
return window["Asc"]["editor"].chartTranslate;
......@@ -506,4 +509,9 @@ CChartSpace.prototype.getDrawingDocument = CShape.prototype.getDrawingDocument;
CChartSpace.prototype.recalculateLocalTransform = CShape.prototype.recalculateLocalTransform;
CChartSpace.prototype.Get_Theme = CShape.prototype.Get_Theme;
CChartSpace.prototype.Get_ColorMap = CShape.prototype.Get_ColorMap;
\ No newline at end of file
CChartSpace.prototype.Get_ColorMap = CShape.prototype.Get_ColorMap;
//----------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].getChartTranslateManager = getChartTranslateManager;
})(window);
......@@ -24,6 +24,8 @@
*/
"use strict";
(function(window, undefined){
// Import
var CShape = AscFormat.CShape;
var CGroupShape = AscFormat.CGroupShape;
......@@ -250,3 +252,4 @@ CGroupShape.prototype.recalculate = function()
}
}, this, []);
};
})(window);
......@@ -24,6 +24,8 @@
*/
"use strict";
(function(window, undefined){
// Import
var CShape = AscFormat.CShape;
var CImageShape = AscFormat.CImageShape;
......@@ -192,3 +194,4 @@ CImageShape.prototype.getCardDirectionByNum = CShape.prototype.getCardDirectionB
CImageShape.prototype.getResizeCoefficients = CShape.prototype.getResizeCoefficients;
CImageShape.prototype.check_bounds = CShape.prototype.check_bounds;
CImageShape.prototype.normalize = CShape.prototype.normalize;
})(window);
......@@ -293,18 +293,15 @@ ChartPreviewManager.prototype.getChartByType = function(type)
var chartSeries = {series: this.getAscChartSeriesDefault(type), parsedHeaders: {bLeft: true, bTop: true}};
var chart_space = AscFormat.DrawingObjectsController.prototype._getChartSpace(chartSeries, settings, true);
chart_space.bPreview = true;
if(window["Asc"]["editor"])
{
var api_sheet = window["Asc"]["editor"];
if (Asc.editor && AscCommon.c_oEditorId.Spreadsheet === Asc.editor.getEditorId()) {
var api_sheet = Asc.editor;
chart_space.setWorksheet(api_sheet.wb.getWorksheet().model);
} else {
if (editor && editor.WordControl && editor.WordControl.m_oLogicDocument.Slides &&
editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]) {
chart_space.setParent(editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]);
}
}
else
{
if(editor && editor.WordControl && editor.WordControl.m_oLogicDocument.Slides && editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage])
{
chart_space.setParent(editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]);
}
}
AscFormat.CheckSpPrXfrm(chart_space);
chart_space.spPr.xfrm.setOffX(0);
chart_space.spPr.xfrm.setOffY(0);
......@@ -852,27 +849,20 @@ TextArtPreviewManager.prototype.getShape = function()
var oShape = new AscFormat.CShape();
var oParent = null, oWorkSheet = null;
var bWord = true;
if(window["Asc"]["editor"])
{
var api_sheet = window["Asc"]["editor"];
if (Asc.editor && AscCommon.c_oEditorId.Spreadsheet === Asc.editor.getEditorId()) {
var api_sheet = Asc.editor;
oShape.setWorksheet(api_sheet.wb.getWorksheet().model);
oWorkSheet = api_sheet.wb.getWorksheet().model;
bWord = false;
}
else
{
if(editor && editor.WordControl && Array.isArray(editor.WordControl.m_oLogicDocument.Slides))
{
if(editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage])
{
oShape.setParent(editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]);
oParent = editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage];
bWord = false;
}
else
{
return null;
}
} else {
if (editor && editor.WordControl && Array.isArray(editor.WordControl.m_oLogicDocument.Slides)) {
if (editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]) {
oShape.setParent(editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]);
oParent = editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage];
bWord = false;
} else {
return null;
}
}
}
var oParentObjects = oShape.getParentObjects();
......
......@@ -3675,7 +3675,7 @@ CAreaSeries.prototype =
return this.tx.strRef.strCache.pt[0].val;
}
}
return getChartTranslateManager().asc_getSeries() + " " + (this.idx + 1) ;
return AscFormat.getChartTranslateManager().asc_getSeries() + " " + (this.idx + 1) ;
},
getCatName: function(idx)
......@@ -23200,17 +23200,17 @@ CTitle.prototype =
return oTx.strRef.strCache.pt[0].val;
}
}
return getChartTranslateManager().asc_getTitle();
return AscFormat.getChartTranslateManager().asc_getTitle();
}
else
{
if(this.parent.axPos === AX_POS_B || this.parent.axPos === AX_POS_T)
{
return getChartTranslateManager().asc_getXAxis();
return AscFormat.getChartTranslateManager().asc_getXAxis();
}
else
{
return getChartTranslateManager().asc_getYAxis();
return AscFormat.getChartTranslateManager().asc_getYAxis();
}
}
}
......
......@@ -139,6 +139,7 @@ function baseEditorsApi(name) {
}
baseEditorsApi.prototype._baseInit = function() {
var t = this;
//Asc.editor = Asc['editor'] = AscCommon['editor'] = AscCommon.editor = this; // ToDo сделать это!
this.HtmlElement = document.getElementById(this.HtmlElementName);
// init OnMessage
......@@ -173,6 +174,9 @@ baseEditorsApi.prototype._editorNameById = function() {
}
return res;
};
baseEditorsApi.prototype.getEditorId = function() {
return this.editorId;
};
baseEditorsApi.prototype.asc_GetFontThumbnailsPath = function() {
return '../Common/Images/';
};
......
......@@ -731,4 +731,8 @@ CTablePr.prototype.Init_Default = function()
this.TableInd = 0;
this.TableW = new CTableMeasurement(tblwidth_Auto, 0);
this.TableLayout = tbllayout_AutoFit;
};
\ No newline at end of file
};
//----------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].getChartTranslateManager = getChartTranslateManager;
\ No newline at end of file
......@@ -645,3 +645,4 @@ function CreateNoFillUniFill()
window['AscFormat'].CreateUnifillSolidFillSchemeColor = CreateUnifillSolidFillSchemeColor;
window['AscFormat'].CreateNoFillLine = CreateNoFillLine;
window['AscFormat'].CreateNoFillUniFill = CreateNoFillUniFill;
window['AscFormat'].getChartTranslateManager = getChartTranslateManager;
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