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

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

parent 83b7a1f0
......@@ -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",
......
"use strict";
(function(window, undefined){
// Import
var CShape = AscFormat.CShape;
var CChartSpace = AscFormat.CChartSpace;
// ToDo перенести в один файл!
function getChartTranslateManager()
{
return window["Asc"]["editor"].chartTranslate;
......@@ -483,3 +486,8 @@ CChartSpace.prototype.recalculateLocalTransform = CShape.prototype.recalculateLo
CChartSpace.prototype.Get_Theme = CShape.prototype.Get_Theme;
CChartSpace.prototype.Get_ColorMap = CShape.prototype.Get_ColorMap;
//----------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].getChartTranslateManager = getChartTranslateManager;
})(window);
"use strict";
(function(window, undefined){
// Import
var CShape = AscFormat.CShape;
var CGroupShape = AscFormat.CGroupShape;
......@@ -226,3 +228,4 @@ CGroupShape.prototype.recalculate = function()
}
}, this, []);
};
})(window);
"use strict";
(function(window, undefined){
// Import
var CShape = AscFormat.CShape;
var CImageShape = AscFormat.CImageShape;
......@@ -168,3 +170,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);
......@@ -269,15 +269,12 @@ 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])
{
} 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]);
}
}
......@@ -828,25 +825,18 @@ 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])
{
} 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
{
} else {
return null;
}
}
......
......@@ -3706,7 +3706,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)
......@@ -23421,17 +23421,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();
}
}
}
......
......@@ -115,6 +115,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
......@@ -149,6 +150,9 @@ baseEditorsApi.prototype._editorNameById = function() {
}
return res;
};
baseEditorsApi.prototype.getEditorId = function() {
return this.editorId;
};
baseEditorsApi.prototype.asc_GetFontThumbnailsPath = function() {
return '../Common/Images/';
};
......
......@@ -708,3 +708,7 @@ CTablePr.prototype.Init_Default = function()
this.TableW = new CTableMeasurement(tblwidth_Auto, 0);
this.TableLayout = tbllayout_AutoFit;
};
//----------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].getChartTranslateManager = getChartTranslateManager;
\ No newline at end of file
......@@ -621,3 +621,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