Commit 950fe5b5 authored by Alexander.Trofimov's avatar Alexander.Trofimov

common/AdvansedOptions to function-closure

parent f4fda519
......@@ -13,6 +13,7 @@
"../common/editorscommon.js",
"../common/NumFormat.js",
"../common/SerializeChart.js",
"../common/AdvancedOptions.js",
"../common/FontsFreeType/font_engine.js",
"../common/FontsFreeType/FontFile.js",
......@@ -91,7 +92,6 @@
"../cell/model/WorkbookElems.js",
"../cell/model/Workbook.js",
"../cell/model/CellInfo.js",
"../common/AdvancedOptions.js",
"../cell/model/History.js",
"../cell/model/CellComment.js",
"../cell/view/mobileTouch.js",
......
......@@ -13,6 +13,7 @@
"../common/editorscommon.js",
"../common/NumFormat.js",
"../common/SerializeChart.js",
"../common/AdvancedOptions.js",
"../common/FontsFreeType/font_engine.js",
"../common/FontsFreeType/FontFile.js",
......@@ -141,8 +142,7 @@
"../cell/model/Serialize.js",
"../cell/model/WorkbookElems.js",
"../cell/model/Workbook.js",
"../cell/model/CellInfo.js",
"../common/AdvancedOptions.js"
"../cell/model/CellInfo.js"
],
"private": [
"../common/Private/license.js",
......
......@@ -16,6 +16,7 @@
"../common/editorscommon.js",
"../common/NumFormat.js",
"../common/SerializeChart.js",
"../common/AdvancedOptions.js",
"../common/FontsFreeType/font_engine.js",
"../common/FontsFreeType/FontFile.js",
......@@ -141,8 +142,7 @@
"../cell/model/Serialize.js",
"../cell/model/WorkbookElems.js",
"../cell/model/Workbook.js",
"../cell/model/CellInfo.js",
"../common/AdvancedOptions.js"
"../cell/model/CellInfo.js"
],
"private": [
"../common/Private/license.js",
......
......@@ -74,7 +74,7 @@ var c_oAscError = Asc.c_oAscError;
{
var cp = JSON.parse("{\"codepage\":46,\"delimiter\":1}");
cp['encodings'] = AscCommon.getEncodingParams();
this.handlers.trigger("asc_onAdvancedOptions", new asc.asc_CAdvancedOptions(Asc.c_oAscAdvancedOptionsID.CSV, cp), AscCommon.c_oAscAdvancedOptionsAction.Open);
this.handlers.trigger("asc_onAdvancedOptions", new AscCommon.asc_CAdvancedOptions(Asc.c_oAscAdvancedOptionsID.CSV, cp), AscCommon.c_oAscAdvancedOptionsAction.Open);
};
asc['spreadsheet_api'].prototype.asc_addImageDrawingObject = function(url)
......
......@@ -828,7 +828,7 @@ var editor;
}
var cp = JSON.parse(result);
cp['encodings'] = AscCommon.getEncodingParams();
t.handlers.trigger("asc_onAdvancedOptions", new asc.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.CSV, cp), t.advancedOptionsAction);
t.handlers.trigger("asc_onAdvancedOptions", new AscCommon.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.CSV, cp), t.advancedOptionsAction);
});
} else {
t.handlers.trigger("asc_onError", c_oAscError.ID.Unknown, c_oAscError.Level.NoCritical);
......@@ -928,7 +928,7 @@ var editor;
}
var cp = {'delimiter': AscCommon.c_oAscCsvDelimiter.Comma, 'codepage': AscCommon.c_oAscCodePageUtf8, 'encodings': AscCommon.getEncodingParams()};
this.downloadType = options.downloadType;
this.handlers.trigger("asc_onAdvancedOptions", new asc.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.CSV, cp), this.advancedOptionsAction);
this.handlers.trigger("asc_onAdvancedOptions", new AscCommon.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.CSV, cp), this.advancedOptionsAction);
return;
} else {
this.wb._initCommentsToSave();
......
......@@ -2789,11 +2789,11 @@ function getFormulasInfo() {
var list = [], a, b, f;
for (var type in cFormulaFunctionGroup) {
b = new Asc.asc_CFormulaGroup(type);
b = new AscCommon.asc_CFormulaGroup(type);
for (var i = 0; i < cFormulaFunctionGroup[type].length; ++i) {
a = new cFormulaFunctionGroup[type][i]();
if (a.getInfo) {
f = new Asc.asc_CFormula(a.getInfo());
f = new AscCommon.asc_CFormula(a.getInfo());
b.asc_addFormulaElement(f);
cFormulaFunction[f.asc_getName()] = cFormulaFunctionGroup[type][i];
}
......
......@@ -31,9 +31,6 @@
*/
function ( window, undefined) {
if (!window["Asc"]) {window["Asc"] = {};}
var prot;
/** @constructor */
function asc_CAdvancedOptions(id,opt){
this.optionId = null;
......@@ -53,11 +50,6 @@
asc_CAdvancedOptions.prototype.asc_getOptionId = function(){ return this.optionId; };
asc_CAdvancedOptions.prototype.asc_getOptions = function(){ return this.options; };
window["Asc"].asc_CAdvancedOptions = window["Asc"]["asc_CAdvancedOptions"] = asc_CAdvancedOptions;
prot = asc_CAdvancedOptions.prototype;
prot["asc_getOptionId"] = prot.asc_getOptionId;
prot["asc_getOptions"] = prot.asc_getOptions;
/** @constructor */
function asc_CCSVOptions(opt){
this.codePages = function(){
......@@ -74,13 +66,6 @@
asc_CCSVOptions.prototype.asc_getCodePages = function(){ return this.codePages;};
asc_CCSVOptions.prototype.asc_getRecommendedSettings = function () { return this.recommendedSettings; };
window["Asc"].asc_CCSVOptions = asc_CCSVOptions;
window["Asc"]["asc_CCSVOptions"] = asc_CCSVOptions;
prot = asc_CCSVOptions.prototype;
prot["asc_getCodePages"] = prot.asc_getCodePages;
prot["asc_getRecommendedSettings"] = prot.asc_getRecommendedSettings;
/** @constructor */
function asc_CTXTOptions(opt){
this.codePages = function(){
......@@ -97,13 +82,6 @@
asc_CTXTOptions.prototype.asc_getCodePages = function(){ return this.codePages;};
asc_CTXTOptions.prototype.asc_getRecommendedSettings = function () { return this.recommendedSettings; };
window["Asc"].asc_CTXTOptions = asc_CTXTOptions;
window["Asc"]["asc_CTXTOptions"] = asc_CTXTOptions;
prot = asc_CTXTOptions.prototype;
prot["asc_getCodePages"] = prot.asc_getCodePages;
prot["asc_getRecommendedSettings"] = prot.asc_getRecommendedSettings;
/** @constructor */
function asc_CCSVAdvancedOptions(codepage,delimiter){
this.codePage = codepage;
......@@ -113,13 +91,6 @@
asc_CCSVAdvancedOptions.prototype.asc_setDelimiter = function(v){this.delimiter = v;};
asc_CCSVAdvancedOptions.prototype.asc_getCodePage = function(){return this.codePage;};
asc_CCSVAdvancedOptions.prototype.asc_setCodePage = function(v){this.codePage = v;};
window["Asc"].asc_CCSVAdvancedOptions = window["Asc"]["asc_CCSVAdvancedOptions"] = asc_CCSVAdvancedOptions;
prot = asc_CCSVAdvancedOptions.prototype;
prot["asc_getDelimiter"] = prot.asc_getDelimiter;
prot["asc_setDelimiter"] = prot.asc_setDelimiter;
prot["asc_getCodePage"] = prot.asc_getCodePage;
prot["asc_setCodePage"] = prot.asc_setCodePage;
/** @constructor */
function asc_CTXTAdvancedOptions(codepage){
......@@ -128,11 +99,6 @@
asc_CTXTAdvancedOptions.prototype.asc_getCodePage = function(){return this.codePage;};
asc_CTXTAdvancedOptions.prototype.asc_setCodePage = function(v){this.codePage = v;};
window["Asc"].asc_CTXTAdvancedOptions = window["Asc"]["asc_CTXTAdvancedOptions"] = asc_CTXTAdvancedOptions;
prot = asc_CTXTAdvancedOptions.prototype;
prot["asc_getCodePage"] = prot.asc_getCodePage;
prot["asc_setCodePage"] = prot.asc_setCodePage;
/** @constructor */
function asc_CCodePage(){
this.codePageName = null;
......@@ -151,15 +117,6 @@
asc_CCodePage.prototype.asc_getText = function(){return this.text;};
asc_CCodePage.prototype.asc_setText = function(v){this.text = v;};
window["Asc"].asc_CCodePage = window["Asc"]["asc_CCodePage"] = asc_CCodePage;
prot = asc_CCodePage.prototype;
prot["asc_getCodePageName"] = prot.asc_getCodePageName;
prot["asc_setCodePageName"] = prot.asc_setCodePageName;
prot["asc_getCodePage"] = prot.asc_getCodePage;
prot["asc_setCodePage"] = prot.asc_setCodePage;
prot["asc_getText"] = prot.asc_getText;
prot["asc_setText"] = prot.asc_setText;
/** @constructor */
function asc_CDelimiter(delimiter){
this.delimiterName = delimiter;
......@@ -167,11 +124,6 @@
asc_CDelimiter.prototype.asc_getDelimiterName = function(){return this.delimiterName;};
asc_CDelimiter.prototype.asc_setDelimiterName = function(v){ this.delimiterName = v;};
window["Asc"].asc_CDelimiter = window["Asc"]["asc_CDelimiter"] = asc_CDelimiter;
prot = asc_CDelimiter.prototype;
prot["asc_getDelimiterName"] = prot.asc_getDelimiterName;
prot["asc_setDelimiterName"] = prot.asc_setDelimiterName;
/** @constructor */
function asc_CFormulaGroup(name){
this.groupName = name;
......@@ -181,12 +133,6 @@
asc_CFormulaGroup.prototype.asc_getFormulasArray = function() { return this.formulasArray; };
asc_CFormulaGroup.prototype.asc_addFormulaElement = function(o) { return this.formulasArray.push(o); };
window["Asc"].asc_CFormulaGroup = window["Asc"]["asc_CFormulaGroup"] = asc_CFormulaGroup;
prot = asc_CFormulaGroup.prototype;
prot["asc_getGroupName"] = prot.asc_getGroupName;
prot["asc_getFormulasArray"] = prot.asc_getFormulasArray;
prot["asc_addFormulaElement"] = prot.asc_addFormulaElement;
/** @constructor */
function asc_CFormula(o){
this.name = o.name;
......@@ -199,10 +145,56 @@
return this.arg;
};
window["Asc"].asc_CFormula = window["Asc"]["asc_CFormula"] = asc_CFormula;
//----------------------------------------------------------export----------------------------------------------------
var prot;
window['Asc'] = window['Asc'] || {};
window['AscCommon'] = window['AscCommon'] || {};
window["AscCommon"].asc_CAdvancedOptions = asc_CAdvancedOptions;
prot = asc_CAdvancedOptions.prototype;
prot["asc_getOptionId"] = prot.asc_getOptionId;
prot["asc_getOptions"] = prot.asc_getOptions;
prot = asc_CCSVOptions.prototype;
prot["asc_getCodePages"] = prot.asc_getCodePages;
prot["asc_getRecommendedSettings"] = prot.asc_getRecommendedSettings;
prot = asc_CTXTOptions.prototype;
prot["asc_getCodePages"] = prot.asc_getCodePages;
prot["asc_getRecommendedSettings"] = prot.asc_getRecommendedSettings;
window["Asc"].asc_CCSVAdvancedOptions = window["Asc"]["asc_CCSVAdvancedOptions"] = asc_CCSVAdvancedOptions;
prot = asc_CCSVAdvancedOptions.prototype;
prot["asc_getDelimiter"] = prot.asc_getDelimiter;
prot["asc_setDelimiter"] = prot.asc_setDelimiter;
prot["asc_getCodePage"] = prot.asc_getCodePage;
prot["asc_setCodePage"] = prot.asc_setCodePage;
window["Asc"].asc_CTXTAdvancedOptions = window["Asc"]["asc_CTXTAdvancedOptions"] = asc_CTXTAdvancedOptions;
prot = asc_CTXTAdvancedOptions.prototype;
prot["asc_getCodePage"] = prot.asc_getCodePage;
prot["asc_setCodePage"] = prot.asc_setCodePage;
prot = asc_CCodePage.prototype;
prot["asc_getCodePageName"] = prot.asc_getCodePageName;
prot["asc_setCodePageName"] = prot.asc_setCodePageName;
prot["asc_getCodePage"] = prot.asc_getCodePage;
prot["asc_setCodePage"] = prot.asc_setCodePage;
prot["asc_getText"] = prot.asc_getText;
prot["asc_setText"] = prot.asc_setText;
prot = asc_CDelimiter.prototype;
prot["asc_getDelimiterName"] = prot.asc_getDelimiterName;
prot["asc_setDelimiterName"] = prot.asc_setDelimiterName;
window["AscCommon"].asc_CFormulaGroup = asc_CFormulaGroup;
prot = asc_CFormulaGroup.prototype;
prot["asc_getGroupName"] = prot.asc_getGroupName;
prot["asc_getFormulasArray"] = prot.asc_getFormulasArray;
prot["asc_addFormulaElement"] = prot.asc_addFormulaElement;
window["AscCommon"].asc_CFormula = asc_CFormula;
prot = asc_CFormula.prototype;
prot["asc_getName"] = prot.asc_getName;
prot["asc_getArguments"] = prot.asc_getArguments;
}
)(window);
\ No newline at end of file
......@@ -6659,7 +6659,7 @@ window["asc_nativeOnSpellCheck"] = function (response)
asc_docs_api.prototype._onNeedParams = function(data) {
var cp = {'codepage': AscCommon.c_oAscCodePageUtf8, 'encodings': AscCommon.getEncodingParams()};
this.asc_fireCallback("asc_onAdvancedOptions", new Asc.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.TXT, cp), this.advancedOptionsAction);
this.asc_fireCallback("asc_onAdvancedOptions", new AscCommon.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.TXT, cp), this.advancedOptionsAction);
};
asc_docs_api.prototype._onOpenCommand = function(data) {
var t = this;
......@@ -6721,7 +6721,7 @@ function _downloadAs(editor, command, filetype, actionType, options, fCallbackRe
}
var cp = {'codepage': AscCommon.c_oAscCodePageUtf8, 'encodings': AscCommon.getEncodingParams()};
editor.downloadType = options.downloadType;
editor.asc_fireCallback("asc_onAdvancedOptions", new Asc.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.TXT, cp), editor.advancedOptionsAction);
editor.asc_fireCallback("asc_onAdvancedOptions", new AscCommon.asc_CAdvancedOptions(c_oAscAdvancedOptionsID.TXT, cp), editor.advancedOptionsAction);
return;
} else if (c_oAscFileType.HTML === filetype && null == options.oDocumentMailMerge && null == options.oMailMergeSendData) {
//в asc_nativeGetHtml будет вызван select all, чтобы выделился документ должны выйти из колонтитулов и автофигур
......
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