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

common/charts/charts to function-closure

parent ee9b35ef
......@@ -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",
......
......@@ -5633,8 +5633,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);
......@@ -5683,7 +5683,7 @@ function OfflineEditor () {
}, this, []);
};
ChartPreviewManager.prototype.getChartPreviews = function(chartType) {
AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType) {
if (isRealNumber(chartType))
{
......
......@@ -6,6 +6,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()
{
......
"use strict";
(
/**
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
// Import
var c_oAscChartTypeSettings = Asc.c_oAscChartTypeSettings;
var c_oAscTickMark = Asc.c_oAscTickMark;
......@@ -461,19 +467,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();
......@@ -633,7 +626,7 @@ TextArtPreviewManager.prototype.initStyles = function()
oTextPr.TextOutline = CreateNoFillLine();
this.aStylesByIndex[11] = oTextPr;
this.aStylesByIndexToApply[11] = oTextPr;
}
};
TextArtPreviewManager.prototype.getStylesToApply = function()
{
......@@ -1020,3 +1013,8 @@ function GenerateWordArtPrewiewCode()
return oRetString;
}
//----------------------------------------------------------export----------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window['AscCommon'].ChartPreviewManager = ChartPreviewManager;
window['AscCommon'].TextArtPreviewManager = TextArtPreviewManager;
})(window);
......@@ -5495,11 +5495,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])
......@@ -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))
{
......
......@@ -67,8 +67,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