Commit 2f50c4e1 authored by Alexander.Trofimov's avatar Alexander.Trofimov

common/charts/charts to function-closure

parent 2297c498
......@@ -13,8 +13,10 @@
"../common/NumFormat.js",
"../common/wordcopypaste.js",
"../common/Charts/charts.js",
"../cell/apiDefines.js",
"../common/Charts/charts.js",
"../common/Charts/DrawingArea.js",
"../common/Charts/DrawingObjects.js",
"../common/Charts/ChartsDrawer.js",
......
......@@ -13,6 +13,8 @@
"../common/NumFormat.js",
"../common/wordcopypaste.js",
"../common/Charts/charts.js",
"../slide/apiDefines.js",
"../common/FontsFreeType/font_engine.js",
......@@ -25,7 +27,7 @@
"../common/Charts/DrawingObjects.js",
"../common/SerializeCommonWordExcel.js",
"../common/SerializeChart.js",
"../common/Charts/charts.js",
"../common/Charts/ChartsDrawer.js",
"../common/Charts/3DTransformation.js",
"../common/Charts/DrawingArea.js",
......
......@@ -16,6 +16,8 @@
"../common/NumFormat.js",
"../common/wordcopypaste.js",
"../common/Charts/charts.js",
"../word/apiDefines.js",
"../common/Shapes/Serialize.js",
......@@ -31,7 +33,7 @@
"../word/Drawing/Externals.js",
"../common/GlobalLoaders.js",
"../word/Drawing/translations.js",
"../common/Charts/charts.js",
"../common/Charts/ChartsDrawer.js",
"../common/Charts/3DTransformation.js",
"../common/Charts/DrawingArea.js",
......
......@@ -5657,8 +5657,8 @@ function OfflineEditor () {
};
// chat styles
ChartPreviewManager.prototype.clearPreviews = function() {window["native"]["ClearCacheChartStyles"]();};
ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex) {
AscCommon.ChartPreviewManager.prototype.clearPreviews = function() {window["native"]["ClearCacheChartStyles"]();};
AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex) {
return ExecuteNoHistory(function(){
if(!this.chartsByTypes[type])
this.chartsByTypes[type] = this.getChartByType(type);
......@@ -5707,7 +5707,7 @@ function OfflineEditor () {
}, this, []);
};
ChartPreviewManager.prototype.getChartPreviews = function(chartType) {
AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType) {
if (isRealNumber(chartType))
{
......
......@@ -30,6 +30,19 @@ var globalGapDepth = 150;
var isTurnOn3DCharts = true;
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*****
function CChartsDrawer()
{
......
......@@ -24,6 +24,12 @@
*/
"use strict";
(
/**
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
// Import
var c_oAscChartTypeSettings = Asc.c_oAscChartTypeSettings;
var c_oAscTickMark = Asc.c_oAscTickMark;
......@@ -485,19 +491,6 @@ ChartPreviewManager.prototype.getChartPreviews = function(chartType) {
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)
{
var oColor = new Asc.asc_CColor();
......@@ -657,7 +650,7 @@ TextArtPreviewManager.prototype.initStyles = function()
oTextPr.TextOutline = CreateNoFillLine();
this.aStylesByIndex[11] = oTextPr;
this.aStylesByIndexToApply[11] = oTextPr;
}
};
TextArtPreviewManager.prototype.getStylesToApply = function()
{
......@@ -1044,3 +1037,8 @@ function GenerateWordArtPrewiewCode()
return oRetString;
}
//----------------------------------------------------------export----------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window['AscCommon'].ChartPreviewManager = ChartPreviewManager;
window['AscCommon'].TextArtPreviewManager = TextArtPreviewManager;
})(window);
......@@ -5519,11 +5519,11 @@ window["NativeCorrectImageUrlOnCopy"] = function(url)
};
// chat styles
ChartPreviewManager.prototype.clearPreviews = function()
AscCommon.ChartPreviewManager.prototype.clearPreviews = function()
{
window["native"]["DD_ClearCacheChartStyles"]();
};
ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex)
AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex)
{
return ExecuteNoHistory(function(){
if(!this.chartsByTypes[type])
......@@ -5570,7 +5570,7 @@ ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, sty
};
ChartPreviewManager.prototype.getChartPreviews = function(chartType)
AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType)
{
if (isRealNumber(chartType))
{
......
......@@ -91,8 +91,8 @@ function baseEditorsApi(name) {
// Chart
this.chartTranslate = new asc_CChartTranslate();
this.textArtTranslate = new Asc.asc_TextArtTranslate();
this.chartPreviewManager = new ChartPreviewManager();
this.textArtPreviewManager = new TextArtPreviewManager();
this.chartPreviewManager = new AscCommon.ChartPreviewManager();
this.textArtPreviewManager = new AscCommon.TextArtPreviewManager();
// Режим вставки диаграмм в редакторе документов
this.isChartEditor = 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