Commit 03def2e9 authored by Alexander.Trofimov's avatar Alexander.Trofimov

common/charts/charts to function-closure

parent ee9b35ef
...@@ -13,8 +13,10 @@ ...@@ -13,8 +13,10 @@
"../common/NumFormat.js", "../common/NumFormat.js",
"../common/wordcopypaste.js", "../common/wordcopypaste.js",
"../common/Charts/charts.js",
"../cell/apiDefines.js", "../cell/apiDefines.js",
"../common/Charts/charts.js",
"../common/Charts/DrawingArea.js", "../common/Charts/DrawingArea.js",
"../common/Charts/DrawingObjects.js", "../common/Charts/DrawingObjects.js",
"../common/Charts/ChartsDrawer.js", "../common/Charts/ChartsDrawer.js",
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
"../common/NumFormat.js", "../common/NumFormat.js",
"../common/wordcopypaste.js", "../common/wordcopypaste.js",
"../common/Charts/charts.js",
"../slide/apiDefines.js", "../slide/apiDefines.js",
"../common/FontsFreeType/font_engine.js", "../common/FontsFreeType/font_engine.js",
...@@ -25,7 +27,7 @@ ...@@ -25,7 +27,7 @@
"../common/Charts/DrawingObjects.js", "../common/Charts/DrawingObjects.js",
"../common/SerializeCommonWordExcel.js", "../common/SerializeCommonWordExcel.js",
"../common/SerializeChart.js", "../common/SerializeChart.js",
"../common/Charts/charts.js",
"../common/Charts/ChartsDrawer.js", "../common/Charts/ChartsDrawer.js",
"../common/Charts/3DTransformation.js", "../common/Charts/3DTransformation.js",
"../common/Charts/DrawingArea.js", "../common/Charts/DrawingArea.js",
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
"../common/NumFormat.js", "../common/NumFormat.js",
"../common/wordcopypaste.js", "../common/wordcopypaste.js",
"../common/Charts/charts.js",
"../word/apiDefines.js", "../word/apiDefines.js",
"../common/Shapes/Serialize.js", "../common/Shapes/Serialize.js",
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
"../word/Drawing/Externals.js", "../word/Drawing/Externals.js",
"../common/GlobalLoaders.js", "../common/GlobalLoaders.js",
"../word/Drawing/translations.js", "../word/Drawing/translations.js",
"../common/Charts/charts.js",
"../common/Charts/ChartsDrawer.js", "../common/Charts/ChartsDrawer.js",
"../common/Charts/3DTransformation.js", "../common/Charts/3DTransformation.js",
"../common/Charts/DrawingArea.js", "../common/Charts/DrawingArea.js",
......
...@@ -5633,8 +5633,8 @@ function OfflineEditor () { ...@@ -5633,8 +5633,8 @@ function OfflineEditor () {
}; };
// chat styles // chat styles
ChartPreviewManager.prototype.clearPreviews = function() {window["native"]["ClearCacheChartStyles"]();}; AscCommon.ChartPreviewManager.prototype.clearPreviews = function() {window["native"]["ClearCacheChartStyles"]();};
ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex) { AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex) {
return ExecuteNoHistory(function(){ return ExecuteNoHistory(function(){
if(!this.chartsByTypes[type]) if(!this.chartsByTypes[type])
this.chartsByTypes[type] = this.getChartByType(type); this.chartsByTypes[type] = this.getChartByType(type);
...@@ -5683,7 +5683,7 @@ function OfflineEditor () { ...@@ -5683,7 +5683,7 @@ function OfflineEditor () {
}, this, []); }, this, []);
}; };
ChartPreviewManager.prototype.getChartPreviews = function(chartType) { AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType) {
if (isRealNumber(chartType)) if (isRealNumber(chartType))
{ {
......
...@@ -6,6 +6,19 @@ var globalGapDepth = 150; ...@@ -6,6 +6,19 @@ var globalGapDepth = 150;
var isTurnOn3DCharts = true; var isTurnOn3DCharts = true;
var standartMarginForCharts = 13; var standartMarginForCharts = 13;
function arrReverse(arr) {
if(!arr || !arr.length)
return;
var newarr = [];
for (var i = 0; i < arr[0].length; ++i) {
newarr[i] = [];
for (var j = 0; j < arr.length; ++j) {
newarr[i][j] = arr[j][i];
}
}
return newarr;
}
//*****MAIN***** //*****MAIN*****
function CChartsDrawer() function CChartsDrawer()
{ {
......
"use strict"; "use strict";
(
/**
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
// Import // Import
var c_oAscChartTypeSettings = Asc.c_oAscChartTypeSettings; var c_oAscChartTypeSettings = Asc.c_oAscChartTypeSettings;
var c_oAscTickMark = Asc.c_oAscTickMark; var c_oAscTickMark = Asc.c_oAscTickMark;
...@@ -461,19 +467,6 @@ ChartPreviewManager.prototype.getChartPreviews = function(chartType) { ...@@ -461,19 +467,6 @@ ChartPreviewManager.prototype.getChartPreviews = function(chartType) {
return null; return null;
}; };
function arrReverse(arr) {
if(!arr || !arr.length)
return;
var newarr = [];
for (var i = 0; i < arr[0].length; ++i) {
newarr[i] = [];
for (var j = 0; j < arr.length; ++j) {
newarr[i][j] = arr[j][i];
}
}
return newarr;
}
function CreateAscColorByIndex(nIndex) function CreateAscColorByIndex(nIndex)
{ {
var oColor = new Asc.asc_CColor(); var oColor = new Asc.asc_CColor();
...@@ -633,7 +626,7 @@ TextArtPreviewManager.prototype.initStyles = function() ...@@ -633,7 +626,7 @@ TextArtPreviewManager.prototype.initStyles = function()
oTextPr.TextOutline = CreateNoFillLine(); oTextPr.TextOutline = CreateNoFillLine();
this.aStylesByIndex[11] = oTextPr; this.aStylesByIndex[11] = oTextPr;
this.aStylesByIndexToApply[11] = oTextPr; this.aStylesByIndexToApply[11] = oTextPr;
} };
TextArtPreviewManager.prototype.getStylesToApply = function() TextArtPreviewManager.prototype.getStylesToApply = function()
{ {
...@@ -1020,3 +1013,8 @@ function GenerateWordArtPrewiewCode() ...@@ -1020,3 +1013,8 @@ function GenerateWordArtPrewiewCode()
return oRetString; return oRetString;
} }
//----------------------------------------------------------export----------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window['AscCommon'].ChartPreviewManager = ChartPreviewManager;
window['AscCommon'].TextArtPreviewManager = TextArtPreviewManager;
})(window);
...@@ -5495,11 +5495,11 @@ window["NativeCorrectImageUrlOnCopy"] = function(url) ...@@ -5495,11 +5495,11 @@ window["NativeCorrectImageUrlOnCopy"] = function(url)
}; };
// chat styles // chat styles
ChartPreviewManager.prototype.clearPreviews = function() AscCommon.ChartPreviewManager.prototype.clearPreviews = function()
{ {
window["native"]["DD_ClearCacheChartStyles"](); window["native"]["DD_ClearCacheChartStyles"]();
}; };
ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex) AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex)
{ {
return ExecuteNoHistory(function(){ return ExecuteNoHistory(function(){
if(!this.chartsByTypes[type]) if(!this.chartsByTypes[type])
...@@ -5546,7 +5546,7 @@ ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, sty ...@@ -5546,7 +5546,7 @@ ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, sty
}; };
ChartPreviewManager.prototype.getChartPreviews = function(chartType) AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType)
{ {
if (isRealNumber(chartType)) if (isRealNumber(chartType))
{ {
......
...@@ -67,8 +67,8 @@ function baseEditorsApi(name) { ...@@ -67,8 +67,8 @@ function baseEditorsApi(name) {
// Chart // Chart
this.chartTranslate = new asc_CChartTranslate(); this.chartTranslate = new asc_CChartTranslate();
this.textArtTranslate = new Asc.asc_TextArtTranslate(); this.textArtTranslate = new Asc.asc_TextArtTranslate();
this.chartPreviewManager = new ChartPreviewManager(); this.chartPreviewManager = new AscCommon.ChartPreviewManager();
this.textArtPreviewManager = new TextArtPreviewManager(); this.textArtPreviewManager = new AscCommon.TextArtPreviewManager();
// Режим вставки диаграмм в редакторе документов // Режим вставки диаграмм в редакторе документов
this.isChartEditor = false; this.isChartEditor = false;
this.isOpenedChartFrame = false; this.isOpenedChartFrame = false;
......
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