Commit bc979bc5 authored by Julia Radzhabova's avatar Julia Radzhabova

Merge branch 'develop' into refactor

parents a731a62c 428bddd0
[![License](https://img.shields.io/badge/License-GNU%20AGPL%20V3-green.svg?style=flat)](http://www.gnu.org/licenses/agpl-3.0.ru.html) ![Release](https://img.shields.io/badge/Release-v4.1.0-blue.svg?style=flat)
[![License](https://img.shields.io/badge/License-GNU%20AGPL%20V3-green.svg?style=flat)](http://www.gnu.org/licenses/agpl-3.0.ru.html) ![Release](https://img.shields.io/badge/Release-v4.1.1-blue.svg?style=flat)
## web-apps
......
......@@ -105,7 +105,8 @@
text: 'Go to London'
},
chat: false,
comments: false
comments: false,
zoom: 100
},
plugins: {
url: '../../../../sdkjs-plugins/',
......
......@@ -219,8 +219,12 @@ define([
onPluginShow: function(plugin, variationIndex) {
var variation = plugin.get_Variations()[variationIndex];
if (variation.get_Visual()) {
var url = variation.get_Url();
if (!/(^https?:\/\/)/i.test(url) && !/(^www.)/i.test(url))
url = ((plugin.get_BaseUrl().length == 0) ? this.panelPlugins.pluginsPath : plugin.get_BaseUrl()) + url;
if (variation.get_InsideMode()) {
this.panelPlugins.openInsideMode(plugin.get_Name(), ((plugin.get_BaseUrl().length == 0) ? this.panelPlugins.pluginsPath : plugin.get_BaseUrl()) + variation.get_Url());
this.panelPlugins.openInsideMode(plugin.get_Name(), url);
} else {
var me = this,
arrBtns = variation.get_Buttons(),
......@@ -234,12 +238,11 @@ define([
});
}
var _baseUrl = (plugin.get_BaseUrl().length == 0) ? me.panelPlugins.pluginsPath : plugin.get_BaseUrl();
me.pluginDlg = new Common.Views.PluginDlg({
title: plugin.get_Name(),
width: size[0], // inner width
height: size[1], // inner height
url: _baseUrl + variation.get_Url(),
url: url,
buttons: newBtns,
toolcallback: _.bind(this.onToolClose, this)
});
......
......@@ -65,7 +65,8 @@ define([
isUpdateOleOnResize: false,
buttons: [],
size: [800, 600],
initOnSelectionChanged: false
initOnSelectionChanged: false,
isRelativeUrl: true
}
}
});
......
......@@ -92,7 +92,7 @@ define([
enableKeyEvents: false,
itemTemplate: _.template([
'<div id="<%= id %>" class="item-plugins" style="display: block;">',
'<div class="plugin-icon" style="background-image: url(' + '<% if (baseUrl !=="") { %>' + '<%= baseUrl %>' + '<% } else { %>' + this.pluginsPath + '<% } %>' + '<%= variations[currentVariation].get("icons")[(window.devicePixelRatio > 1) ? 1 : 0] %>);"></div>',
'<div class="plugin-icon" style="background-image: url(' + '<% if (variations[currentVariation].get("isRelativeUrl")) { if (baseUrl !=="") { %>' + '<%= baseUrl %>' + '<% } else { %>' + this.pluginsPath + '<% } } %>' + '<%= variations[currentVariation].get("icons")[(window.devicePixelRatio > 1) ? 1 : 0] %>);"></div>',
'<% if (variations.length>1) { %>',
'<div class="plugin-caret img-commonctrl"></div>',
'<% } %>',
......@@ -237,7 +237,7 @@ define([
var iframe = document.createElement("iframe");
iframe.id = 'plugin_iframe';
iframe.name = 'pluginFrameEditor',
iframe.name = 'pluginFrameEditor';
iframe.width = '100%';
iframe.height = '100%';
iframe.align = "top";
......@@ -249,7 +249,7 @@ define([
setTimeout(function(){
if (me.isLoaded) return;
me.loadMask = new Common.UI.LoadMask({owner: $('#id-plugin-placeholder')});
me.loadMask.setTitle(this.textLoading);
me.loadMask.setTitle(me.textLoading);
me.loadMask.show();
if (me.isLoaded) me.loadMask.hide();
}, 500);
......
......@@ -83,7 +83,6 @@
img {
-webkit-filter: invert(100%) brightness(4);
filter: invert(100%) brightness(4);
filter: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='invert'><feColorMatrix in='SourceGraphic' type='matrix' values='-.1 0 0 0 1 0 -.1 0 0 1 0 0 -.1 0 1 0 0 0 1 0'/></filter></svg>#invert");
}
canvas {
-webkit-filter: invert(100%) brightness(4);
......
......@@ -748,7 +748,8 @@ define([
/** coauthoring end **/
value = Common.localStorage.getItem("de-settings-zoom");
this.api.zoom((value!==null) ? parseInt(value) : 100);
var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : 100);
(zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100));
value = Common.localStorage.getItem("de-show-hiddenchars");
me.api.put_ShowParaMarks((value!==null) ? eval(value) : false);
......@@ -826,7 +827,7 @@ define([
application.getController('Common.Controllers.ExternalMergeEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});
pluginsController.setApi(me.api);
me.updatePluginsList(me.plugins);
me.updatePlugins(me.plugins);
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
documentHolderController.setApi(me.api);
......@@ -1129,8 +1130,12 @@ define([
config.msg = this.convertationTimeoutText;
break;
case Asc.c_oAscError.ID.ConvertationError:
config.msg = this.convertationErrorText;
case Asc.c_oAscError.ID.ConvertationOpenError:
config.msg = this.openErrorText;
break;
case Asc.c_oAscError.ID.ConvertationSaveError:
config.msg = this.saveErrorText;
break;
case Asc.c_oAscError.ID.DownloadError:
......@@ -1721,6 +1726,60 @@ define([
if (url) this.iframePrint.src = url;
},
updatePlugins: function(plugins) { // plugins from config
if (!plugins || !plugins.pluginsData || plugins.pluginsData.length<1) return;
var _createXMLHTTPObject = function() {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
};
var _getPluginJson = function(plugin) {
if (!plugin) return '';
try {
var xhrObj = _createXMLHTTPObject();
if (xhrObj && plugin) {
xhrObj.open('GET', plugin, false);
xhrObj.send('');
var pluginJson = eval("(" + xhrObj.responseText + ")");
return pluginJson;
}
}
catch (e) {}
return null;
};
var arr = [],
baseUrl = plugins.url;
plugins.pluginsData.forEach(function(item){
var url = item;
if (!/(^https?:\/\/)/i.test(url) && !/(^www.)/i.test(item))
url = baseUrl + item;
var value = _getPluginJson(url);
if (value) arr.push(value);
});
if (arr.length>0)
this.updatePluginsList({
url: plugins.url,
pluginsData: arr
});
},
updatePluginsList: function(plugins) {
var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins'),
isEdit = this.appOptions.isEdit;
......@@ -1752,7 +1811,8 @@ define([
isUpdateOleOnResize : itemVar.isUpdateOleOnResize,
buttons: itemVar.buttons,
size: itemVar.size,
initOnSelectionChanged: itemVar.initOnSelectionChanged
initOnSelectionChanged: itemVar.initOnSelectionChanged,
isRelativeUrl: !(/(^https?:\/\/)/i.test(itemVar.url) || /(^www.)/i.test(itemVar.url))
}));
});
if (variationsArr.length>0)
......@@ -1810,7 +1870,6 @@ define([
reloadButtonText: 'Reload Page',
unknownErrorText: 'Unknown error.',
convertationTimeoutText: 'Convertation timeout exceeded.',
convertationErrorText: 'Convertation failed.',
downloadErrorText: 'Download failed.',
unsupportedBrowserErrorText : 'Your browser is not supported.',
splitMaxRowsErrorText: 'The number of rows must be less than %1',
......@@ -1876,7 +1935,9 @@ define([
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.',
warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.',
titleLicenseExp: 'License expired'
titleLicenseExp: 'License expired',
openErrorText: 'An error has occurred while opening the file',
saveErrorText: 'An error has occurred while saving the file'
}
})(), DE.Controllers.Main || {}))
});
\ No newline at end of file
......@@ -210,7 +210,10 @@ define([
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
menuStyle : 'max-height: 210px;',
data : [
{ value: -1, displayValue: this.txtFitPage },
{ value: -2, displayValue: this.txtFitWidth },
{ value: 50, displayValue: "50%" },
{ value: 60, displayValue: "60%" },
{ value: 70, displayValue: "70%" },
......@@ -321,8 +324,9 @@ define([
this.chInputMode.setValue(value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem("de-settings-zoom");
var item = this.cmbZoom.store.findWhere({value: parseInt(value)});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : 100);
value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100);
var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/
value = Common.localStorage.getItem("de-settings-livecomment");
......@@ -432,7 +436,9 @@ define([
strStrict: 'Strict',
textAutoRecover: 'Autorecover',
strAutoRecover: 'Turn on autorecover',
txtInch: 'Inch'
txtInch: 'Inch',
txtFitPage: 'Fit Page',
txtFitWidth: 'Fit Width'
}, DE.Views.FileMenuPanels.Settings || {}));
DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
......
......@@ -442,14 +442,21 @@ define([
this.paragraphControls.push(this.btnMultilevels);
this.textOnlyControls.push(this.btnMultilevels);
var clone = function(source) {
var obj = {};
for (var prop in source)
obj[prop] = (typeof(source[prop])=='object') ? clone(source[prop]) : source[prop];
return obj;
};
this.mnuMarkersPicker = {
conf: {index:0},
selectByIndex: function (idx) {
this.conf.index = idx;
}
};
this.mnuNumbersPicker = _.clone(this.mnuMarkersPicker);
this.mnuMultilevelPicker = _.clone(this.mnuMarkersPicker);
this.mnuNumbersPicker = clone(this.mnuMarkersPicker);
this.mnuMultilevelPicker = clone(this.mnuMarkersPicker);
this.btnInsertTable = new Common.UI.Button({
id : 'id-toolbar-btn-inserttable',
......@@ -546,8 +553,8 @@ define([
this.conf.disabled = val;
}
};
this.mnuPageNumCurrentPos = _.clone(this.mnuPageNumberPosPicker);
this.mnuInsertPageNum = _.clone(this.mnuPageNumberPosPicker);
this.mnuPageNumCurrentPos = clone(this.mnuPageNumberPosPicker);
this.mnuInsertPageNum = clone(this.mnuPageNumberPosPicker);
this.paragraphControls.push(this.mnuPageNumCurrentPos);
this.toolbarControls.push(this.btnEditHeader);
......@@ -747,7 +754,7 @@ define([
setChecked: function(val) { this.conf.checked = val;},
isChecked: function () { return this.conf.checked; }
};
this.btnFitWidth = _.clone(this.btnFitPage);
this.btnFitWidth = clone(this.btnFitPage);
this.mnuZoom = {options: {value: 100}};
this.btnAdvSettings = new Common.UI.Button({
......
......@@ -164,6 +164,7 @@
"Common.Views.Plugins.strPlugins": "Plugins",
"Common.Views.Plugins.textLoading": "Loading",
"Common.Views.Plugins.textStart": "Start",
"Common.Views.PluginDlg.textLoading": "Loading",
"Common.Views.ReviewChanges.txtAccept": "Accept",
"Common.Views.ReviewChanges.txtAcceptAll": "Accept All Changes",
"Common.Views.ReviewChanges.txtAcceptCurrent": "Accept Current Change",
......@@ -184,7 +185,9 @@
"DE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
"DE.Controllers.Main.applyChangesTextText": "Loading the changes...",
"DE.Controllers.Main.applyChangesTitleText": "Loading the Changes",
"DE.Controllers.Main.convertationErrorText": "Conversion failed.",
"del_DE.Controllers.Main.convertationErrorText": "Conversion failed.",
"DE.Controllers.Main.openErrorText": "An error has occurred while opening the file",
"DE.Controllers.Main.saveErrorText": "An error has occurred while saving the file",
"DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.",
"DE.Controllers.Main.criticalErrorExtText": "Press \"OK\" to return to document list.",
"DE.Controllers.Main.criticalErrorTitle": "Error",
......@@ -927,6 +930,8 @@
"DE.Views.FileMenuPanels.Settings.txtPt": "Point",
"DE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking",
"DE.Views.FileMenuPanels.Settings.txtWin": "as Windows",
"DE.Views.FileMenuPanels.Settings.txtFitPage": "Fit Page",
"DE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit Width",
"DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom Center",
"DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom Left",
"DE.Views.HeaderFooterSettings.textBottomRight": "Bottom Right",
......
......@@ -3,7 +3,6 @@ body {
height: 100%;
.user-select(none);
color: @gray-deep;
position: fixed;
&.safari {
position: absolute;
......
......@@ -104,6 +104,8 @@ Ext.define('DE.controller.Main', {
},
loadDocument: function(data) {
this.permissions = {};
if ( data.doc ) {
this.permissions = data.doc.permissions;
......
......@@ -558,8 +558,8 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
value = Common.localStorage.getItem("pe-settings-zoom");
var zf = (value!==null) ? parseInt(value) : -1;
(zf == -1) ? this.api.zoomFitToPage() : this.api.zoom(zf);
var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : -1);
(zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100));
function checkWarns() {
if (!window['AscDesktopEditor']) {
......@@ -617,7 +617,7 @@ define([
application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});
pluginsController.setApi(me.api);
me.updatePluginsList(me.plugins);
me.updatePlugins(me.plugins);
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
documentHolderController.setApi(me.api);
......@@ -906,8 +906,12 @@ define([
config.msg = this.convertationTimeoutText;
break;
case Asc.c_oAscError.ID.ConvertationError:
config.msg = this.convertationErrorText;
case Asc.c_oAscError.ID.ConvertationOpenError:
config.msg = this.openErrorText;
break;
case Asc.c_oAscError.ID.ConvertationSaveError:
config.msg = this.saveErrorText;
break;
case Asc.c_oAscError.ID.DownloadError:
......@@ -1495,6 +1499,60 @@ define([
if (url) this.iframePrint.src = url;
},
updatePlugins: function(plugins) { // plugins from config
if (!plugins || !plugins.pluginsData || plugins.pluginsData.length<1) return;
var _createXMLHTTPObject = function() {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
};
var _getPluginJson = function(plugin) {
if (!plugin) return '';
try {
var xhrObj = _createXMLHTTPObject();
if (xhrObj && plugin) {
xhrObj.open('GET', plugin, false);
xhrObj.send('');
var pluginJson = eval("(" + xhrObj.responseText + ")");
return pluginJson;
}
}
catch (e) {}
return null;
};
var arr = [],
baseUrl = plugins.url;
plugins.pluginsData.forEach(function(item){
var url = item;
if (!/(^https?:\/\/)/i.test(url) && !/(^www.)/i.test(item))
url = baseUrl + item;
var value = _getPluginJson(url);
if (value) arr.push(value);
});
if (arr.length>0)
this.updatePluginsList({
url: plugins.url,
pluginsData: arr
});
},
updatePluginsList: function(plugins) {
var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins'),
isEdit = this.appOptions.isEdit;
......@@ -1526,7 +1584,8 @@ define([
isUpdateOleOnResize : itemVar.isUpdateOleOnResize,
buttons: itemVar.buttons,
size: itemVar.size,
initOnSelectionChanged: itemVar.initOnSelectionChanged
initOnSelectionChanged: itemVar.initOnSelectionChanged,
isRelativeUrl: !(/(^https?:\/\/)/i.test(itemVar.url) || /(^www.)/i.test(itemVar.url))
}));
});
if (variationsArr.length>0)
......@@ -1583,7 +1642,6 @@ define([
reloadButtonText: 'Reload Page',
unknownErrorText: 'Unknown error.',
convertationTimeoutText: 'Convertation timeout exceeded.',
convertationErrorText: 'Convertation failed.',
downloadErrorText: 'Download failed.',
unsupportedBrowserErrorText : 'Your browser is not supported.',
splitMaxRowsErrorText: 'The number of rows must be less than %1',
......@@ -1679,7 +1737,9 @@ define([
textContactUs: 'Contact sales',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.',
warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.',
titleLicenseExp: 'License expired'
titleLicenseExp: 'License expired',
openErrorText: 'An error has occurred while opening the file',
saveErrorText: 'An error has occurred while saving the file'
}
})(), PE.Controllers.Main || {}))
});
......@@ -164,8 +164,10 @@ define([
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
menuStyle : 'max-height: 210px;',
data : [
{ value: -1, displayValue: this.txtFitSlide },
{ value: -2, displayValue: this.txtFitWidth },
{ value: 50, displayValue: "50%" },
{ value: 60, displayValue: "60%" },
{ value: 70, displayValue: "70%" },
......@@ -267,9 +269,9 @@ define([
this.chInputMode.setValue(value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem("pe-settings-zoom");
value = (value!==null) ? parseInt(value) : -1;
value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : -1);
var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : 100);
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/
value = Common.localStorage.getItem("pe-settings-coauthmode");
......@@ -337,7 +339,8 @@ define([
strStrict: 'Strict',
textAutoRecover: 'Autorecover',
strAutoRecover: 'Turn on autorecover',
txtInch: 'Inch'
txtInch: 'Inch',
txtFitWidth: 'Fit Width'
}, PE.Views.FileMenuPanels.Settings || {}));
PE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
......
......@@ -201,6 +201,8 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem
var value = props.asc_getLockAspect();
this.btnRatio.toggle(value);
if (props.get_Height()>0)
this._nRatio = props.get_Width()/props.get_Height();
if (props.get_Position()) {
var Position = {X: props.get_Position().get_X(), Y: props.get_Position().get_Y()};
......
......@@ -96,12 +96,15 @@
"Common.Views.Plugins.strPlugins": "Plugins",
"Common.Views.Plugins.textLoading": "Loading",
"Common.Views.Plugins.textStart": "Start",
"Common.Views.PluginDlg.textLoading": "Loading",
"PE.Controllers.LeftMenu.newDocumentTitle": "Unnamed presentation",
"PE.Controllers.LeftMenu.requestEditRightsText": "Requesting editing rights...",
"PE.Controllers.LeftMenu.textNoTextFound": "The data you have been searching for could not be found. Please adjust your search options.",
"PE.Controllers.Main.applyChangesTextText": "Loading data...",
"PE.Controllers.Main.applyChangesTitleText": "Loading Data",
"PE.Controllers.Main.convertationErrorText": "Conversion failed.",
"del_PE.Controllers.Main.convertationErrorText": "Conversion failed.",
"PE.Controllers.Main.openErrorText": "An error has occurred while opening the file",
"PE.Controllers.Main.saveErrorText": "An error has occurred while saving the file",
"PE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.",
"PE.Controllers.Main.criticalErrorExtText": "Press \"OK\" to return to document list.",
"PE.Controllers.Main.criticalErrorTitle": "Error",
......@@ -379,6 +382,7 @@
"PE.Views.FileMenuPanels.Settings.txtAll": "View All",
"PE.Views.FileMenuPanels.Settings.txtCm": "Centimeter",
"PE.Views.FileMenuPanels.Settings.txtFitSlide": "Fit Slide",
"PE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit Width",
"PE.Views.FileMenuPanels.Settings.txtInch": "Inch",
"PE.Views.FileMenuPanels.Settings.txtInput": "Alternate Input",
"PE.Views.FileMenuPanels.Settings.txtLast": "View Last",
......
......@@ -3,7 +3,6 @@ body {
height: 100%;
.user-select(none);
color: @gray-deep;
position: fixed;
&.safari {
position: absolute;
......
......@@ -556,7 +556,8 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
value = (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram) ? 100 : Common.localStorage.getItem("sse-settings-zoom");
this.api.asc_setZoom(!value?1:parseInt(value)/100);
var zf = (value!==null) ? parseInt(value)/100 : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom)/100 : 1);
this.api.asc_setZoom(zf>0 ? zf : 1);
/** coauthoring begin **/
value = Common.localStorage.getItem("sse-settings-livecomment");
......@@ -599,7 +600,7 @@ define([
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) {
pluginsController.setApi(me.api);
me.updatePluginsList(me.plugins);
me.updatePlugins(me.plugins);
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
}
......@@ -966,8 +967,12 @@ define([
config.msg = this.convertationTimeoutText;
break;
case Asc.c_oAscError.ID.ConvertationError:
config.msg = this.convertationErrorText;
case Asc.c_oAscError.ID.ConvertationOpenError:
config.msg = this.openErrorText;
break;
case Asc.c_oAscError.ID.ConvertationSaveError:
config.msg = this.saveErrorText;
break;
case Asc.c_oAscError.ID.DownloadError:
......@@ -1723,6 +1728,60 @@ define([
if (url) this.iframePrint.src = url;
},
updatePlugins: function(plugins) { // plugins from config
if (!plugins || !plugins.pluginsData || plugins.pluginsData.length<1) return;
var _createXMLHTTPObject = function() {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
};
var _getPluginJson = function(plugin) {
if (!plugin) return '';
try {
var xhrObj = _createXMLHTTPObject();
if (xhrObj && plugin) {
xhrObj.open('GET', plugin, false);
xhrObj.send('');
var pluginJson = eval("(" + xhrObj.responseText + ")");
return pluginJson;
}
}
catch (e) {}
return null;
};
var arr = [],
baseUrl = plugins.url;
plugins.pluginsData.forEach(function(item){
var url = item;
if (!/(^https?:\/\/)/i.test(url) && !/(^www.)/i.test(item))
url = baseUrl + item;
var value = _getPluginJson(url);
if (value) arr.push(value);
});
if (arr.length>0)
this.updatePluginsList({
url: plugins.url,
pluginsData: arr
});
},
updatePluginsList: function(plugins) {
var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins'),
isEdit = this.appOptions.isEdit;
......@@ -1754,7 +1813,8 @@ define([
isUpdateOleOnResize : itemVar.isUpdateOleOnResize,
buttons: itemVar.buttons,
size: itemVar.size,
initOnSelectionChanged: itemVar.initOnSelectionChanged
initOnSelectionChanged: itemVar.initOnSelectionChanged,
isRelativeUrl: !(/(^https?:\/\/)/i.test(itemVar.url) || /(^www.)/i.test(itemVar.url))
}));
});
if (variationsArr.length>0)
......@@ -1812,7 +1872,6 @@ define([
reloadButtonText: 'Reload Page',
unknownErrorText: 'Unknown error.',
convertationTimeoutText: 'Convertation timeout exceeded.',
convertationErrorText: 'Convertation failed.',
downloadErrorText: 'Download failed.',
unsupportedBrowserErrorText : 'Your browser is not supported.',
requestEditFailedTitleText: 'Access denied',
......@@ -1895,7 +1954,9 @@ define([
confirmPutMergeRange: 'The source data contains merged cells.<br>They will be unmerged before they are pasted into the table.',
errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.',
warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.',
titleLicenseExp: 'License expired'
titleLicenseExp: 'License expired',
openErrorText: 'An error has occurred while opening the file',
saveErrorText: 'An error has occurred while saving the file'
}
})(), SSE.Controllers.Main || {}))
});
......@@ -523,6 +523,7 @@ define([
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
menuStyle : 'max-height: 210px;',
data : [
{ value: 50, displayValue: "50%" },
{ value: 60, displayValue: "60%" },
......@@ -660,8 +661,9 @@ define([
updateSettings: function() {
var value = Common.localStorage.getItem("sse-settings-zoom");
var item = this.cmbZoom.store.findWhere({value: parseInt(value)});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : 100);
value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100);
var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/
value = Common.localStorage.getItem("sse-settings-livecomment");
......
......@@ -91,6 +91,7 @@
"Common.Views.Plugins.strPlugins": "Plugins",
"Common.Views.Plugins.textLoading": "Loading",
"Common.Views.Plugins.textStart": "Start",
"Common.Views.PluginDlg.textLoading": "Loading",
"SSE.Controllers.DocumentHolder.errorInvalidLink": "The link reference does not exist. Please correct the link or delete it.",
"SSE.Controllers.DocumentHolder.guestText": "Guest",
"SSE.Controllers.DocumentHolder.notcriticalErrorTitle": "Warning",
......@@ -122,7 +123,9 @@
"SSE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
"SSE.Controllers.Main.confirmMoveCellRange": "The destination cell range can contain data. Continue the operation?",
"SSE.Controllers.Main.confirmPutMergeRange": "The source data contained merged cells.<br>They had been unmerged before they were pasted into the table.",
"SSE.Controllers.Main.convertationErrorText": "Conversion failed.",
"del_SSE.Controllers.Main.convertationErrorText": "Conversion failed.",
"SSE.Controllers.Main.openErrorText": "An error has occurred while opening the file",
"SSE.Controllers.Main.saveErrorText": "An error has occurred while saving the file",
"SSE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.",
"SSE.Controllers.Main.criticalErrorExtText": "Press \"OK\" to return to document list.",
"SSE.Controllers.Main.criticalErrorTitle": "Error",
......
......@@ -3,7 +3,6 @@ body {
height: 100%;
.user-select(none);
color: @gray-deep;
position: fixed;
&.safari {
position: absolute;
......
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