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

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

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