Commit e2ef004b authored by Julia Radzhabova's avatar Julia Radzhabova

Merge branch 'develop' into feature/force-save

parents 44c6f2fc 2eb46fa2
......@@ -96,7 +96,7 @@
info: 'Some info',
logo: ''
},
about: false,
about: true,
feedback: {
visible: false,
url: http://...
......@@ -259,25 +259,29 @@
};
var _onMessage = function(msg) {
if (msg && msg.frameEditorId == placeholderId) {
var events = _config.events || {},
handler = events[msg.event],
res;
if (msg.event === 'onRequestEditRights' && !handler) {
_applyEditRights(false, 'handler is\'n defined');
if ( msg ) {
if ( msg.type === "onExternalPluginMessage" ) {
_sendCommand(msg);
} else
if (msg.event === 'onInternalMessage' && msg.data && msg.data.type == 'localstorage') {
_callLocalStorage(msg.data.data);
} else {
if (msg.event === 'onReady') {
_onReady();
}
if ( msg.frameEditorId == placeholderId ) {
var events = _config.events || {},
handler = events[msg.event],
res;
if (msg.event === 'onRequestEditRights' && !handler) {
_applyEditRights(false, 'handler is\'n defined');
} else if (msg.event === 'onInternalMessage' && msg.data && msg.data.type == 'localstorage') {
_callLocalStorage(msg.data.data);
} else {
if (msg.event === 'onReady') {
_onReady();
}
if (handler) {
res = handler.call(_self, { target: _self, data: msg.data });
if (msg.event === 'onSave' && res !== false) {
_processSaveResult(true);
if (handler) {
res = handler.call(_self, {target: _self, data: msg.data});
if (msg.event === 'onSave' && res !== false) {
_processSaveResult(true);
}
}
}
}
......@@ -518,7 +522,8 @@
var data = {
type: evt.type,
x: evt.x - r.left,
y: evt.y - r.top
y: evt.y - r.top,
event: evt
};
_sendCommand({
......@@ -565,7 +570,7 @@
lang: 'en',
canCoAuthoring: true,
customization: {
about: false,
about: true,
feedback: false
}
}
......
......@@ -57,6 +57,7 @@ define([
this.currentArrColors = [];
this.currentDocId = '';
this.currentDocIdPrev = '';
this.currentRev = 0;
},
events: {
......@@ -74,6 +75,7 @@ define([
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
this.api.asc_registerCallback('asc_onExpiredToken', _.bind(this.onExpiredToken, this));
return this;
},
......@@ -127,6 +129,7 @@ define([
this.currentArrColors = record.get('arrColors');
this.currentDocId = record.get('docId');
this.currentDocIdPrev = record.get('docIdPrev');
this.currentRev = rev;
if ( _.isEmpty(url) || (urlGetTime - record.get('urlGetTime') > 5 * 60000)) {
_.delay(function() {
......@@ -142,6 +145,7 @@ define([
hist.asc_setCurrentChangeId(this.currentChangeId);
hist.asc_setArrColors(this.currentArrColors);
hist.asc_setToken(token);
hist.asc_setIsRequested(false);
this.api.asc_showRevision(hist);
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
......@@ -191,6 +195,7 @@ define([
hist.asc_setCurrentChangeId(this.currentChangeId);
hist.asc_setArrColors(this.currentArrColors);
hist.asc_setToken(token);
hist.asc_setIsRequested(true);
this.api.asc_showRevision(hist);
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
......@@ -199,6 +204,12 @@ define([
}
},
onExpiredToken: function() {
_.delay(function() {
Common.Gateway.requestHistoryData(this.currentRev); // получаем url-ы для ревизий
}, 10);
},
onClickBackToDocument: function () {
// reload editor
Common.Gateway.requestHistoryClose();
......
......@@ -873,7 +873,7 @@ define([
pluginsController.setApi(me.api);
me.updatePlugins(me.plugins, false);
me.requestPlugins('../../../../sdkjs-plugins/config.json');
me.requestPlugins('../../../../plugins.json');
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
documentHolderController.setApi(me.api);
......@@ -1500,8 +1500,12 @@ define([
hidePreloader: function() {
if (!this._state.customizationDone) {
this._state.customizationDone = true;
if (this.appOptions.customization && !this.appOptions.isDesktopApp)
this.appOptions.customization.about = true;
if (this.appOptions.customization) {
if (this.appOptions.isDesktopApp)
this.appOptions.customization.about = false;
else if (!this.appOptions.canBrandingExt)
this.appOptions.customization.about = true;
}
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
if (this.appOptions.canBrandingExt) {
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements);
......@@ -1961,11 +1965,18 @@ define([
return null;
};
var arr = [];
var arr = [],
baseUrl = _.isEmpty(plugins.url) ? "" : plugins.url;
if (baseUrl !== "")
console.log("Obsolete: The url parameter is deprecated. Please check the documentation for new plugin connection configuration.");
pluginsData.forEach(function(item){
item = baseUrl + item; // for compatibility with previouse version of server, where plugins.url is used.
var value = _getPluginJson(item);
if (value) {
value.baseUrl = item.substring(0, item.lastIndexOf("config.json"));
value.oldVersion = (baseUrl !== "");
arr.push(value);
}
});
......@@ -1983,7 +1994,7 @@ define([
if (plugins) {
var arr = [], arrUI = [];
plugins.pluginsData.forEach(function(item){
if (uiCustomize!==undefined && pluginStore.findWhere({baseUrl : item.baseUrl})) return;
if (uiCustomize!==undefined && (pluginStore.findWhere({baseUrl : item.baseUrl}) || pluginStore.findWhere({guid : item.guid}))) return;
var variations = item.variations,
variationsArr = [];
......@@ -1995,12 +2006,19 @@ define([
}
}
if (isSupported && (isEdit || itemVar.isViewer)) {
var icons = itemVar.icons;
if (item.oldVersion) { // for compatibility with previouse version of server, where plugins.url is used.
icons = [];
itemVar.icons.forEach(function(icon){
icons.push(icon.substring(icon.lastIndexOf("\/")+1));
});
}
item.isUICustomizer ? arrUI.push(item.baseUrl + itemVar.url) :
variationsArr.push(new Common.Models.PluginVariation({
description: itemVar.description,
index: variationsArr.length,
url : itemVar.url,
icons : itemVar.icons,
url : (item.oldVersion) ? (itemVar.url.substring(itemVar.url.lastIndexOf("\/")+1) ) : itemVar.url,
icons : icons,
isViewer: itemVar.isViewer,
EditorsSupport: itemVar.EditorsSupport,
isVisual: itemVar.isVisual,
......@@ -2157,4 +2175,4 @@ define([
textChangesSaved: 'All changes saved'
}
})(), DE.Controllers.Main || {}))
});
\ No newline at end of file
});
......@@ -92,11 +92,11 @@ define([
me.api.asc_GetDefaultTableStyles();
}
$('#add-table li').single('click', _.buffered(this.onStyleClick, 300, this));
$('#add-table li').single('click', _.buffered(this.onStyleClick, 100, this));
},
onViewRender: function () {
$('#add-table li').single('click', _.buffered(this.onStyleClick, 300, this));
$('#add-table li').single('click', _.buffered(this.onStyleClick, 100, this));
},
onStyleClick: function (e) {
......@@ -104,64 +104,66 @@ define([
$target = $(e.currentTarget),
type = $target.data('type');
if ($('.modal.modal-in').length > 0) {
return
}
DE.getController('AddContainer').hideModal();
_.delay(function () {
if ($target) {
var picker;
var modal = uiApp.modal({
title: me.textTableSize,
text: '',
afterText:
'<div class="content-block">' +
'<div class="row">' +
'<div class="col-50">' + me.textColumns + '</div>' +
'<div class="col-50">' + me.textRows + '</div>' +
'</div>' +
'<div id="picker-table-size"></div>' +
'</div>',
buttons: [
{
text: me.textCancel
},
{
text: 'OK',
bold: true,
onClick: function () {
var size = picker.value;
if (me.api) {
me.api.put_Table(parseInt(size[0]), parseInt(size[1]));
var properties = new Asc.CTableProp();
properties.put_TableStyle(type);
me.api.tblApply(properties);
}
if ($target) {
var picker;
var modal = uiApp.modal({
title: me.textTableSize,
text: '',
afterText:
'<div class="content-block">' +
'<div class="row">' +
'<div class="col-50">' + me.textColumns + '</div>' +
'<div class="col-50">' + me.textRows + '</div>' +
'</div>' +
'<div id="picker-table-size"></div>' +
'</div>',
buttons: [
{
text: me.textCancel
},
{
text: 'OK',
bold: true,
onClick: function () {
var size = picker.value;
if (me.api) {
me.api.put_Table(parseInt(size[0]), parseInt(size[1]));
var properties = new Asc.CTableProp();
properties.put_TableStyle(type);
me.api.tblApply(properties);
}
}
]
});
}
]
});
picker = uiApp.picker({
container: '#picker-table-size',
toolbar: false,
rotateEffect: true,
value: [3, 3],
cols: [{
textAlign: 'left',
values: [1,2,3,4,5,6,7,8,9,10]
}, {
values: [1,2,3,4,5,6,7,8,9,10]
}]
});
picker = uiApp.picker({
container: '#picker-table-size',
toolbar: false,
rotateEffect: true,
value: [3, 3],
cols: [{
textAlign: 'left',
values: [1,2,3,4,5,6,7,8,9,10]
}, {
values: [1,2,3,4,5,6,7,8,9,10]
}]
});
// Vertical align
$$(modal).css({
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px'
});
}
}, 300);
// Vertical align
$$(modal).css({
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px'
});
}
},
// Public
......
......@@ -54,7 +54,8 @@ define([
var _stack = [],
_chartObject = undefined,
_shapeObject = undefined,
_metricText = Common.Utils.Metric.getCurrentMetricName();
_metricText = Common.Utils.Metric.getCurrentMetricName(),
_borderColor = 'transparent';
var wrapTypesTransform = (function() {
var map = [
......@@ -80,7 +81,7 @@ define([
return obj.ui === type;
})[0];
return record ? record.sdk : 0;
},
}
}
})();
......@@ -260,13 +261,18 @@ define([
paletteFillColor && paletteFillColor.select(color);
// Init border color
var stroke = shapeProperties.get_stroke(),
strokeType = stroke.get_type();
me._initBorderColorView();
},
color = 'transparent';
_initBorderColorView: function () {
var me = this,
paletteBorderColor = me.getView('EditChart').paletteBorderColor,
stroke = _shapeObject.get_ShapeProperties().get_stroke();
var color = 'transparent';
if (stroke && strokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
sdkColor = stroke.get_color();
if (stroke && stroke.get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
var sdkColor = stroke.get_color();
if (sdkColor) {
if (sdkColor.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
......@@ -277,6 +283,7 @@ define([
}
}
}
_borderColor = color;
paletteBorderColor && paletteBorderColor.select(color);
$('#edit-chart-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)))
......@@ -440,29 +447,20 @@ define([
var me = this,
$target = $(e.currentTarget),
value = $target.val(),
currentShape = _shapeObject.get_ShapeProperties(),
image = new Asc.asc_CImgProperty(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke(),
currentColor = Common.Utils.ThemeColor.getRgbColor('000000');
stroke = new Asc.asc_CStroke();
value = borderSizeTransform.sizeByIndex(parseInt(value));
var currentStroke = currentShape.get_stroke();
if (currentStroke) {
var currentStrokeType = currentStroke.get_type();
if (currentStrokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
currentColor = currentStroke.get_color();
}
}
if (value < 0.01) {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(currentColor);
if (_borderColor == 'transparent')
stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
else
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(_borderColor)));
stroke.put_width(value * 25.4 / 72.0);
}
......@@ -470,6 +468,7 @@ define([
image.put_ShapeProperties(shape);
me.api.ImgApply(image);
me._initBorderColorView(); // when select STROKE_NONE or change from STROKE_NONE to STROKE_COLOR
},
onBorderSizeChanging: function (e) {
......@@ -506,8 +505,9 @@ define([
currentShape = _shapeObject.get_ShapeProperties();
$('#edit-chart-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)));
_borderColor = color;
if (me.api && currentShape) {
if (me.api && currentShape && currentShape.get_stroke().get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
var image = new Asc.asc_CImgProperty(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke();
......
......@@ -261,8 +261,16 @@ define([
$layoutPages.prop('outerHTML') +
'</div>' +
'</div>'
)).on('close', function (e) {
)).on('opened', function () {
if (_.isFunction(me.api.asc_OnShowContextMenu)) {
me.api.asc_OnShowContextMenu()
}
}).on('close', function (e) {
mainView.showNavbar();
}).on('closed', function () {
if (_.isFunction(me.api.asc_OnHideContextMenu)) {
me.api.asc_OnHideContextMenu()
}
});
mainView.hideNavbar();
} else {
......@@ -289,9 +297,17 @@ define([
$overlay.addClass('modal-overlay-visible')
}
});
if (_.isFunction(me.api.asc_OnShowContextMenu)) {
me.api.asc_OnShowContextMenu()
}
}).on('close', function () {
$overlay.off('removeClass');
$overlay.removeClass('modal-overlay-visible')
}).on('closed', function () {
if (_.isFunction(me.api.asc_OnHideContextMenu)) {
me.api.asc_OnHideContextMenu()
}
});
}
......
......@@ -53,7 +53,8 @@ define([
// Private
var _stack = [],
_shapeObject = undefined,
_metricText = Common.Utils.Metric.getCurrentMetricName();
_metricText = Common.Utils.Metric.getCurrentMetricName(),
_borderColor = 'transparent';
var wrapTypesTransform = (function() {
var map = [
......@@ -79,7 +80,7 @@ define([
return obj.ui === type;
})[0];
return record ? record.sdk : 0;
},
}
}
})();
......@@ -101,7 +102,7 @@ define([
}
});
return index
return index;
},
sizeByValue: function (value) {
......@@ -254,13 +255,18 @@ define([
paletteFillColor && paletteFillColor.select(color);
// Init border color
var stroke = shapeProperties.get_stroke(),
strokeType = stroke.get_type();
me._initBorderColorView();
},
color = 'transparent';
_initBorderColorView: function () {
var me = this,
paletteBorderColor = me.getView('EditShape').paletteBorderColor,
stroke = _shapeObject.get_ShapeProperties().get_stroke();
var color = 'transparent';
if (stroke && strokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
sdkColor = stroke.get_color();
if (stroke && stroke.get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
var sdkColor = stroke.get_color();
if (sdkColor) {
if (sdkColor.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
......@@ -271,6 +277,7 @@ define([
}
}
}
_borderColor = color;
paletteBorderColor && paletteBorderColor.select(color);
$('#edit-shape-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)))
......@@ -407,29 +414,20 @@ define([
var me = this,
$target = $(e.currentTarget),
value = $target.val(),
currentShape = _shapeObject.get_ShapeProperties(),
image = new Asc.asc_CImgProperty(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke(),
currentColor = Common.Utils.ThemeColor.getRgbColor('000000');
stroke = new Asc.asc_CStroke();
value = borderSizeTransform.sizeByIndex(parseInt(value));
var currentStroke = currentShape.get_stroke();
if (currentStroke) {
var currentStrokeType = currentStroke.get_type();
if (currentStrokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
currentColor = currentStroke.get_color();
}
}
if (value < 0.01) {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(currentColor);
if (_borderColor == 'transparent')
stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
else
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(_borderColor)));
stroke.put_width(value * 25.4 / 72.0);
}
......@@ -437,6 +435,7 @@ define([
image.put_ShapeProperties(shape);
me.api.ImgApply(image);
me._initBorderColorView(); // when select STROKE_NONE or change from STROKE_NONE to STROKE_COLOR
},
onBorderSizeChanging: function (e) {
......@@ -494,8 +493,9 @@ define([
currentShape = _shapeObject.get_ShapeProperties();
$('#edit-shape-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)));
_borderColor = color;
if (me.api && currentShape) {
if (me.api && currentShape && currentShape.get_stroke().get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
var image = new Asc.asc_CImgProperty(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke();
......
......@@ -80,14 +80,19 @@ define([
return _sizes[index];
},
sizeByValue: function (value) {
indexSizeByValue: function (value) {
var index = 0;
_.each(_sizes, function (size, idx) {
if (Math.abs(size - value) < 0.25) {
index = idx;
}
});
return _sizes[index];
return index;
},
sizeByValue: function (value) {
return _sizes[this.indexSizeByValue(value)];
}
}
})();
......@@ -207,7 +212,7 @@ define([
$('#table-option-repeatasheader input').prop('checked', _tableObject.get_RowsInHeader());
$('#table-option-resizetofit input').prop('checked', _tableObject.get_TableLayout()==Asc.c_oAscTableLayout.AutoFit);
var margins = _tableObject.get_DefaultMargins();
var margins = _tableObject.get_CellMargins();
if (margins) {
var distance = Common.Utils.Metric.fnRecalcFromMM(margins.get_Left());
$('#table-options-margins input').val(distance);
......@@ -313,7 +318,7 @@ define([
// });
// }
$('#edit-table-bordersize input').val([borderSizeTransform.sizeByIndex(_cellBorderWidth)]);
$('#edit-table-bordersize input').val([borderSizeTransform.indexSizeByValue(_cellBorderWidth)]);
$('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByValue(_cellBorderWidth) + ' ' + _metricText);
var borderPalette = me.getView('EditTable').paletteBorderColor;
......
......@@ -86,10 +86,13 @@ define([
// Render layout
render: function () {
var shapes = Common.SharedSettings.get('shapes').slice();
shapes.splice(0, 1); // Remove line shapes
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
shapes : Common.SharedSettings.get('shapes'),
shapes : shapes,
scope : this
}));
......
......@@ -652,7 +652,7 @@ define([
pluginsController.setApi(me.api);
me.updatePlugins(me.plugins, false);
me.requestPlugins('../../../../sdkjs-plugins/config.json');
me.requestPlugins('../../../../plugins.json');
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
documentHolderController.setApi(me.api);
......@@ -1253,8 +1253,12 @@ define([
hidePreloader: function() {
if (!this._state.customizationDone) {
this._state.customizationDone = true;
if (this.appOptions.customization && !this.appOptions.isDesktopApp)
this.appOptions.customization.about = true;
if (this.appOptions.customization) {
if (this.appOptions.isDesktopApp)
this.appOptions.customization.about = false;
else if (!this.appOptions.canBrandingExt)
this.appOptions.customization.about = true;
}
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
if (this.appOptions.canBrandingExt) {
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements);
......@@ -1724,11 +1728,18 @@ define([
return null;
};
var arr = [];
var arr = [],
baseUrl = _.isEmpty(plugins.url) ? "" : plugins.url;
if (baseUrl !== "")
console.log("Obsolete: The url parameter is deprecated. Please check the documentation for new plugin connection configuration.");
pluginsData.forEach(function(item){
item = baseUrl + item; // for compatibility with previouse version of server, where plugins.url is used.
var value = _getPluginJson(item);
if (value) {
value.baseUrl = item.substring(0, item.lastIndexOf("config.json"));
value.oldVersion = (baseUrl !== "");
arr.push(value);
}
});
......@@ -1746,6 +1757,8 @@ define([
if (plugins) {
var arr = [], arrUI = [];
plugins.pluginsData.forEach(function(item){
if (uiCustomize!==undefined && (pluginStore.findWhere({baseUrl : item.baseUrl}) || pluginStore.findWhere({guid : item.guid}))) return;
var variations = item.variations,
variationsArr = [];
variations.forEach(function(itemVar){
......@@ -1756,12 +1769,19 @@ define([
}
}
if (isSupported && (isEdit || itemVar.isViewer)){
var icons = itemVar.icons;
if (item.oldVersion) { // for compatibility with previouse version of server, where plugins.url is used.
icons = [];
itemVar.icons.forEach(function(icon){
icons.push(icon.substring(icon.lastIndexOf("\/")+1));
});
}
item.isUICustomizer ? arrUI.push(item.baseUrl + itemVar.url) :
variationsArr.push(new Common.Models.PluginVariation({
description: itemVar.description,
index: variationsArr.length,
url : itemVar.url,
icons : itemVar.icons,
url : (item.oldVersion) ? (itemVar.url.substring(itemVar.url.lastIndexOf("\/")+1) ) : itemVar.url,
icons : icons,
isViewer: itemVar.isViewer,
EditorsSupport: itemVar.EditorsSupport,
isVisual: itemVar.isVisual,
......
......@@ -60,8 +60,7 @@ define([
_linkType = c_oHyperlinkType.WebLink,
_slideLink = 0,
_slideNum = 0,
_slidesCount = 0,
_isDisplayChanged = false;
_slidesCount = 0;
return {
models: [],
......@@ -106,7 +105,6 @@ define([
if ($target && $target.prop('id') === 'add-link') {
_linkType = c_oHyperlinkType.WebLink;
_slideLink = _slideNum = 0;
_isDisplayChanged = false;
var text = this.api.can_AddHyperlink();
if (text !== false) {
$('#add-link-display input').val((text !== null) ? text : this.textDefault);
......@@ -170,9 +168,6 @@ define([
$('#page-addlink-type li').single('click', _.buffered(me.onLinkType, 100, me));
$('#page-addlink-slidenumber li').single('click', _.buffered(me.onSlideLink, 100, me));
$('#addlink-slide-number .button').single('click',_.buffered(me.onSlideNumber, 100, me));
$('#add-link-display input[type="text"]').single('input', _.bind(function(e) {
_isDisplayChanged = true;
}, this));
me.initSettings(pageId);
},
......@@ -232,7 +227,7 @@ define([
def_display = slidetip;
}
if (!$('#add-link-display').hasClass('disabled') && (_isDisplayChanged || _.isEmpty(display))) {
if (!$('#add-link-display').hasClass('disabled')) {
props.put_Text(_.isEmpty(display) ? def_display : display);
} else
props.put_Text(null);
......
......@@ -91,64 +91,66 @@ define([
$target = $(e.currentTarget),
type = $target.data('type');
if ($('.modal.modal-in').length > 0) {
return;
}
PE.getController('AddContainer').hideModal();
_.delay(function () {
if ($target) {
var picker;
var modal = uiApp.modal({
title: me.textTableSize,
text: '',
afterText:
'<div class="content-block">' +
'<div class="row">' +
'<div class="col-50">' + me.textColumns + '</div>' +
'<div class="col-50">' + me.textRows + '</div>' +
'</div>' +
'<div id="picker-table-size"></div>' +
'</div>',
buttons: [
{
text: me.textCancel
},
{
text: 'OK',
bold: true,
onClick: function () {
var size = picker.value;
if (me.api) {
me.api.put_Table(parseInt(size[0]), parseInt(size[1]));
var properties = new Asc.CTableProp();
properties.put_TableStyle(type);
me.api.tblApply(properties);
}
if ($target) {
var picker;
var modal = uiApp.modal({
title: me.textTableSize,
text: '',
afterText:
'<div class="content-block">' +
'<div class="row">' +
'<div class="col-50">' + me.textColumns + '</div>' +
'<div class="col-50">' + me.textRows + '</div>' +
'</div>' +
'<div id="picker-table-size"></div>' +
'</div>',
buttons: [
{
text: me.textCancel
},
{
text: 'OK',
bold: true,
onClick: function () {
var size = picker.value;
if (me.api) {
me.api.put_Table(parseInt(size[0]), parseInt(size[1]));
var properties = new Asc.CTableProp();
properties.put_TableStyle(type);
me.api.tblApply(properties);
}
}
]
});
}
]
});
picker = uiApp.picker({
container: '#picker-table-size',
toolbar: false,
rotateEffect: true,
value: [3, 3],
cols: [{
textAlign: 'left',
values: [1,2,3,4,5,6,7,8,9,10]
}, {
values: [1,2,3,4,5,6,7,8,9,10]
}]
});
picker = uiApp.picker({
container: '#picker-table-size',
toolbar: false,
rotateEffect: true,
value: [3, 3],
cols: [{
textAlign: 'left',
values: [1,2,3,4,5,6,7,8,9,10]
}, {
values: [1,2,3,4,5,6,7,8,9,10]
}]
});
// Vertical align
$$(modal).css({
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px'
});
}
}, 300);
// Vertical align
$$(modal).css({
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px'
});
}
},
// Public
......
......@@ -54,7 +54,8 @@ define([
var _stack = [],
_chartObject = undefined,
_shapeObject = undefined,
_metricText = Common.Utils.Metric.getCurrentMetricName();
_metricText = Common.Utils.Metric.getCurrentMetricName(),
_borderColor = 'transparent';
var borderSizeTransform = (function() {
var _sizes = [0, 0.5, 1, 1.5, 2.25, 3, 4.5, 6];
......@@ -66,14 +67,19 @@ define([
return _sizes[index];
},
sizeByValue: function (value) {
indexSizeByValue: function (value) {
var index = 0;
_.each(_sizes, function (size, idx) {
if (Math.abs(size - value) < 0.25) {
index = idx;
}
});
return _sizes[index];
return index
},
sizeByValue: function (value) {
return _sizes[this.indexSizeByValue(value)];
}
}
})();
......@@ -157,9 +163,10 @@ define([
$('.chart-types li[data-type=' + type + ']').addClass('active');
// Init style border size
var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4;
$('#edit-chart-bordersize input').val([borderSizeTransform.sizeByIndex(borderSize)]);
$('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByValue(borderSize) + ' ' + _metricText);
var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4,
borderType = _shapeObject.get_stroke().get_type();
$('#edit-chart-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]);
$('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText);
paletteFillColor && paletteFillColor.on('select', _.bind(me.onFillColor, me));
paletteBorderColor && paletteBorderColor.on('select', _.bind(me.onBorderColor, me));
......@@ -188,13 +195,18 @@ define([
paletteFillColor && paletteFillColor.select(color);
// Init border color
var stroke = shapeProperties.get_stroke(),
strokeType = stroke.get_type();
me._initBorderColorView();
},
color = 'transparent';
_initBorderColorView: function () {
var me = this,
paletteBorderColor = me.getView('EditChart').paletteBorderColor,
stroke = _shapeObject.get_stroke();
var color = 'transparent';
if (stroke && strokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
sdkColor = stroke.get_color();
if (stroke && stroke.get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
var sdkColor = stroke.get_color();
if (sdkColor) {
if (sdkColor.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
......@@ -205,6 +217,7 @@ define([
}
}
}
_borderColor = color;
paletteBorderColor && paletteBorderColor.select(color);
$('#edit-chart-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)))
......@@ -292,33 +305,25 @@ define([
$target = $(e.currentTarget),
value = $target.val(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke(),
currentColor = Common.Utils.ThemeColor.getRgbColor('000000');
stroke = new Asc.asc_CStroke();
value = borderSizeTransform.sizeByIndex(parseInt(value));
var currentStroke = _shapeObject.get_stroke();
if (currentStroke) {
var currentStrokeType = currentStroke.get_type();
if (currentStrokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
currentColor = currentStroke.get_color();
}
}
if (value < 0.01) {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(currentColor);
stroke.asc_putPrstDash(currentStroke.asc_getPrstDash());
if (_borderColor == 'transparent')
stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
else
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(_borderColor)));
stroke.put_width(value * 25.4 / 72.0);
}
shape.put_stroke(stroke);
me.api.ShapeApply(shape);
me._initBorderColorView(); // when select STROKE_NONE or change from STROKE_NONE to STROKE_COLOR
},
onBorderSizeChanging: function (e) {
......@@ -352,8 +357,9 @@ define([
var me = this;
$('#edit-chart-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)));
_borderColor = color;
if (me.api && _shapeObject) {
if (me.api && _shapeObject && _shapeObject.get_stroke().get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
var shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke();
......
......@@ -261,9 +261,18 @@ define([
$layoutPages.prop('outerHTML') +
'</div>' +
'</div>'
)).on('close', function (e) {
)).on('opened', function () {
if (_.isFunction(me.api.asc_OnShowContextMenu)) {
me.api.asc_OnShowContextMenu()
}
}).on('close', function (e) {
mainView.showNavbar();
}).on('closed', function () {
if (_.isFunction(me.api.asc_OnHideContextMenu)) {
me.api.asc_OnHideContextMenu()
}
});
mainView.hideNavbar();
} else {
me.picker = uiApp.popover(
......@@ -289,9 +298,17 @@ define([
$overlay.addClass('modal-overlay-visible')
}
});
if (_.isFunction(me.api.asc_OnShowContextMenu)) {
me.api.asc_OnShowContextMenu()
}
}).on('close', function () {
$overlay.off('removeClass');
$overlay.removeClass('modal-overlay-visible')
}).on('closed', function () {
if (_.isFunction(me.api.asc_OnHideContextMenu)) {
me.api.asc_OnHideContextMenu()
}
});
}
......
......@@ -65,8 +65,7 @@ define([
_linkType = c_oHyperlinkType.WebLink,
_slideLink = 0,
_slideNum = 0,
_slidesCount = 0,
_isDisplayChanged = false;
_slidesCount = 0;
return {
models: [],
......@@ -213,9 +212,6 @@ define([
$('#page-editlink-type li').single('click', _.buffered(me.onLinkType, 100, me));
$('#page-editlink-slidenumber li').single('click', _.buffered(me.onSlideLink, 100, me));
$('#editlink-slide-number .button').single('click',_.buffered(me.onSlideNumber, 100, me));
$('#edit-link-display input[type="text"]').single('input', _.bind(function(e) {
_isDisplayChanged = true;
}, this));
me.initSettings(pageId);
},
......@@ -275,7 +271,7 @@ define([
def_display = slidetip;
}
if (!$('#edit-link-display').hasClass('disabled') && (_isDisplayChanged || _.isEmpty(display))) {
if (!$('#edit-link-display').hasClass('disabled')) {
props.put_Text(_.isEmpty(display) ? def_display : display);
} else
props.put_Text(null);
......
......@@ -53,7 +53,8 @@ define([
// Private
var _stack = [],
_shapeObject = undefined,
_metricText = Common.Utils.Metric.getCurrentMetricName();
_metricText = Common.Utils.Metric.getCurrentMetricName(),
_borderColor = 'transparent';
var borderSizeTransform = (function() {
var _sizes = [0, 0.5, 1, 1.5, 2.25, 3, 4.5, 6];
......@@ -65,14 +66,19 @@ define([
return _sizes[index];
},
sizeByValue: function (value) {
indexSizeByValue: function (value) {
var index = 0;
_.each(_sizes, function (size, idx) {
if (Math.abs(size - value) < 0.25) {
index = idx;
}
});
return _sizes[index];
return index
},
sizeByValue: function (value) {
return _sizes[this.indexSizeByValue(value)];
}
}
})();
......@@ -146,9 +152,10 @@ define([
paletteBorderColor = me.getView('EditShape').paletteBorderColor;
// Init style border size
var borderSize = _shapeObject.get_stroke().get_width() * 72.0 / 25.4;
$('#edit-shape-bordersize input').val([borderSizeTransform.sizeByIndex(borderSize)]);
$('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByValue(borderSize) + ' ' + _metricText);
var borderSize = _shapeObject.get_stroke().get_width() * 72.0 / 25.4,
borderType = _shapeObject.get_stroke().get_type();
$('#edit-shape-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]);
$('#edit-shape-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText);
// Init style opacity
$('#edit-shape-effect input').val([_shapeObject.get_fill().asc_getTransparent() ? _shapeObject.get_fill().asc_getTransparent() / 2.55 : 100]);
......@@ -181,13 +188,18 @@ define([
paletteFillColor && paletteFillColor.select(color);
// Init border color
var stroke = _shapeObject.get_stroke(),
strokeType = stroke.get_type();
me._initBorderColorView();
},
color = 'transparent';
_initBorderColorView: function () {
var me = this,
paletteBorderColor = me.getView('EditShape').paletteBorderColor,
stroke = _shapeObject.get_stroke();
var color = 'transparent';
if (stroke && strokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
sdkColor = stroke.get_color();
if (stroke && stroke.get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
var sdkColor = stroke.get_color();
if (sdkColor) {
if (sdkColor.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
......@@ -198,6 +210,7 @@ define([
}
}
}
_borderColor = color;
paletteBorderColor && paletteBorderColor.select(color);
$('#edit-shape-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)))
......@@ -266,33 +279,25 @@ define([
$target = $(e.currentTarget),
value = $target.val(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke(),
currentColor = Common.Utils.ThemeColor.getRgbColor('000000');
stroke = new Asc.asc_CStroke();
value = borderSizeTransform.sizeByIndex(parseInt(value));
var currentStroke = _shapeObject.get_stroke();
if (currentStroke) {
var currentStrokeType = currentStroke.get_type();
if (currentStrokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
currentColor = currentStroke.get_color();
}
}
if (value < 0.01) {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(currentColor);
stroke.asc_putPrstDash(currentStroke.asc_getPrstDash());
if (_borderColor == 'transparent')
stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
else
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(_borderColor)));
stroke.put_width(value * 25.4 / 72.0);
}
shape.put_stroke(stroke);
me.api.ShapeApply(shape);
me._initBorderColorView(); // when select STROKE_NONE or change from STROKE_NONE to STROKE_COLOR
},
onBorderSizeChanging: function (e) {
......@@ -344,8 +349,9 @@ define([
var me = this;
$('#edit-shape-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)));
_borderColor = color;
if (me.api && _shapeObject) {
if (me.api && _shapeObject && _shapeObject.get_stroke().get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
var shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke();
......
......@@ -69,14 +69,19 @@ define([
return _sizes[index];
},
sizeByValue: function (value) {
indexSizeByValue: function (value) {
var index = 0;
_.each(_sizes, function (size, idx) {
if (Math.abs(size - value) < 0.25) {
index = idx;
}
});
return _sizes[index];
return index;
},
sizeByValue: function (value) {
return _sizes[this.indexSizeByValue(value)];
}
}
})();
......@@ -182,7 +187,7 @@ define([
},
_initTableOptionsView: function() {
var margins = _tableObject.get_DefaultMargins();
var margins = _tableObject.get_CellMargins();
if (margins) {
var distance = Common.Utils.Metric.fnRecalcFromMM(margins.get_Left());
$('#table-options-margins input').val(distance);
......@@ -262,7 +267,7 @@ define([
// });
// }
$('#edit-table-bordersize input').val([borderSizeTransform.sizeByIndex(_cellBorderWidth)]);
$('#edit-table-bordersize input').val([borderSizeTransform.indexSizeByValue(_cellBorderWidth)]);
$('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByValue(_cellBorderWidth) + ' ' + _metricText);
var borderPalette = me.getView('EditTable').paletteBorderColor;
......@@ -342,7 +347,7 @@ define([
$target = $(e.currentTarget),
value = $target.val(),
properties = new Asc.CTableProp(),
margins = new Asc.asc_CPaddings();
margins = new Asc.CMargins();
$('#table-options-margins .item-after').text(value + ' ' + _metricText);
......@@ -352,8 +357,9 @@ define([
margins.put_Right(value);
margins.put_Bottom(value);
margins.put_Left(value);
margins.put_Flag(2);
properties.put_DefaultMargins(margins);
properties.put_CellMargins(margins);
me.api.tblApply(properties);
},
......
......@@ -42,7 +42,7 @@
</li>
<li>
<% if (android) { %>
<a id="image-default" class="button button-raised button-fill" style="margin: 20px 16px; background-color: #f44336;"><%= scope.textRemove %></a>
<a id="image-remove" class="button button-raised button-fill" style="margin: 20px 16px; background-color: #f44336;"><%= scope.textRemove %></a>
<% } else { %>
<a id="image-remove" class="item-link list-button" style="text-align: center; color: #f00"><%= scope.textRemove %></a>
<% } %>
......
......@@ -6,7 +6,7 @@
<div class="center">
<form class="searchbar search">
<div class="searchbar-input search">
<input type="search" placeholder="Search"><a href="#" class="searchbar-clear"></a>
<input type="search" placeholder="<%= scope.textSearch %>"><a href="#" class="searchbar-clear"></a>
</div>
</form>
</div>
......
......@@ -131,7 +131,9 @@ define([
uiApp.hideNavbar(searchBar);
}, 10);
}
}
},
textSearch: 'Search'
}
})(), PE.Views.Search || {}))
});
\ No newline at end of file
......@@ -86,10 +86,13 @@ define([
// Render layout
render: function () {
var shapes = Common.SharedSettings.get('shapes').slice();
shapes.splice(0, 1); // Remove line shapes
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
shapes : Common.SharedSettings.get('shapes'),
shapes : shapes,
scope : this
}));
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -253,6 +253,8 @@ define([
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this));
this.api.asc_registerCallback('asc_onEntriesListMenu', _.bind(this.onEntriesListMenu, this)); // Alt + Down
this.api.asc_registerCallback('asc_onFormulaCompleteMenu', _.bind(this.onFormulaCompleteMenu, this));
this.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(this.onShowSpecialPasteOptions, this));
this.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(this.onHideSpecialPasteOptions, this));
return this;
},
......@@ -695,12 +697,15 @@ define([
(new SSE.Views.ChartSettingsDlg(
{
chartSettings: props,
imageSettings: item.chartInfo,
isChart: true,
api: me.api,
handler: function(result, value) {
if (result == 'ok') {
if (me.api) {
me.api.asc_editChartDrawingObject(value.chartSettings);
if (value.imageSettings)
me.api.asc_setGraphicObjectProps(value.imageSettings);
}
}
Common.NotificationCenter.trigger('edit:complete', me);
......@@ -1205,6 +1210,7 @@ define([
isshapemenu = true;
}
} else if ( elValue.asc_getChartProperties() ) {
documentHolder.mnuChartEdit.chartInfo = elValue;
ischartmenu = true;
has_chartprops = true;
}
......@@ -1594,6 +1600,89 @@ define([
}
},
onShowSpecialPasteOptions: function(specialPasteShowOptions) {
var me = this,
documentHolderView = me.documentHolder,
coord = specialPasteShowOptions.asc_getCellCoord(),
pasteContainer = documentHolderView.cmpEl.find('#special-paste-container'),
pasteItems = specialPasteShowOptions.asc_getOptions();
// Prepare menu container
if (pasteContainer.length < 1) {
me._arrSpecialPaste = [];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.paste] = me.txtPaste;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyFormula] = me.txtPasteFormulas;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaNumberFormat] = me.txtPasteFormulaNumFormat;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaAllFormatting] = me.txtPasteKeepSourceFormat;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaWithoutBorders] = me.txtPasteBorders;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaColumnWidth] = me.txtPasteColWidths;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.mergeConditionalFormating] = me.txtPasteMerge;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyValues] = me.txtPasteValues;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.valueNumberFormat] = me.txtPasteValNumFormat;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.valueAllFormating] = me.txtPasteValFormat;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyFormating] = me.txtPasteFormat;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.transpose] = me.txtPasteTranspose;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.link] = me.txtPasteLink;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.picture] = me.txtPastePicture;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.linkedPicture] = me.txtPasteLinkPicture;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.sourceformatting] = me.txtPasteSourceFormat;
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.destinationFormatting] = me.txtPasteDestFormat;
pasteContainer = $('<div id="special-paste-container" style="position: absolute;"><div id="id-document-holder-btn-special-paste"></div></div>');
documentHolderView.cmpEl.append(pasteContainer);
me.btnSpecialPaste = new Common.UI.Button({
cls : 'btn-toolbar',
iconCls : 'btn-paste',
menu : new Common.UI.Menu({items: []})
});
me.btnSpecialPaste.render($('#id-document-holder-btn-special-paste')) ;
}
if (pasteItems.length>0) {
var menu = me.btnSpecialPaste.menu;
for (var i = 0; i < menu.items.length; i++) {
menu.removeItem(menu.items[i]);
i--;
}
var group_prev = -1;
_.each(pasteItems, function(menuItem, index) {
var group = (menuItem<7) ? 0 : (menuItem>9 ? 2 : 1);
if (group_prev !== group && group_prev>=0)
menu.addItem(new Common.UI.MenuItem({ caption: '--' }));
group_prev = group;
var mnu = new Common.UI.MenuItem({
caption: me._arrSpecialPaste[menuItem],
value: menuItem,
checkable: true,
toggleGroup : 'specialPasteGroup'
}).on('click', function(item, e) {
var props = new Asc.SpecialPasteProps();
props.asc_setProps(item.value);
me.api.asc_SpecialPaste(props);
setTimeout(function(){menu.hide();}, 100);
});
menu.addItem(mnu);
});
(menu.items.length>0) && menu.items[0].setChecked(true, true);
}
if (coord.asc_getX()<0 || coord.asc_getY()<0) {
if (pasteContainer.is(':visible')) pasteContainer.hide();
} else {
var showPoint = [coord.asc_getX() + coord.asc_getWidth() + 3, coord.asc_getY() + coord.asc_getHeight() + 3];
pasteContainer.css({left: showPoint[0], top : showPoint[1]});
pasteContainer.show();
}
},
onHideSpecialPasteOptions: function() {
var pasteContainer = this.documentHolder.cmpEl.find('#special-paste-container');
if (pasteContainer.is(':visible'))
pasteContainer.hide();
},
onCellsRange: function(status) {
this.rangeSelectionMode = (status != Asc.c_oAscSelectionDialogType.None);
},
......@@ -2323,7 +2412,24 @@ define([
txtExpandSort: 'The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?',
txtExpand: 'Expand and sort',
txtSorting: 'Sorting',
txtSortSelected: 'Sort selected'
txtSortSelected: 'Sort selected',
txtPaste: 'Paste',
txtPasteFormulas: 'Paste only formula',
txtPasteFormulaNumFormat: 'Formula + number format',
txtPasteKeepSourceFormat: 'Formula + all formatting',
txtPasteBorders: 'Formula without borders',
txtPasteColWidths: 'Formula + column width',
txtPasteMerge: 'Merge conditional formatting',
txtPasteTranspose: 'Transpose',
txtPasteValues: 'Paste only value',
txtPasteValNumFormat: 'Value + number format',
txtPasteValFormat: 'Value + all formatting',
txtPasteFormat: 'Paste only formatting',
txtPasteLink: 'Paste Link',
txtPastePicture: 'Picture',
txtPasteLinkPicture: 'Linked Picture',
txtPasteSourceFormat: 'Source formatting',
txtPasteDestFormat: 'Destination formatting'
}, SSE.Controllers.DocumentHolder || {}));
});
\ No newline at end of file
......@@ -363,7 +363,7 @@ define([
var editor = document.getElementById('editor_sdk');
if (editor) {
var rect = editor.getBoundingClientRect();
var event = window.event || arguments.callee.caller.arguments[0];
var event = data.event || {};
this.api.asc_onMouseUp(event, data.x - rect.left, data.y - rect.top);
}
}
......@@ -630,7 +630,7 @@ define([
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) {
pluginsController.setApi(me.api);
me.updatePlugins(me.plugins, false);
me.requestPlugins('../../../../sdkjs-plugins/config.json');
me.requestPlugins('../../../../plugins.json');
me.api.asc_registerCallback('asc_onPluginsInit', _.bind(me.updatePluginsList, me));
}
......@@ -1387,8 +1387,12 @@ define([
hidePreloader: function() {
if (!this._state.customizationDone) {
this._state.customizationDone = true;
if (this.appOptions.customization && !this.appOptions.isDesktopApp)
this.appOptions.customization.about = true;
if (this.appOptions.customization) {
if (this.appOptions.isDesktopApp)
this.appOptions.customization.about = false;
else if (!this.appOptions.canBrandingExt)
this.appOptions.customization.about = true;
}
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
if (this.appOptions.canBrandingExt) {
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationExtElements);
......@@ -1944,11 +1948,18 @@ define([
return null;
};
var arr = [];
var arr = [],
baseUrl = _.isEmpty(plugins.url) ? "" : plugins.url;
if (baseUrl !== "")
console.log("Obsolete: The url parameter is deprecated. Please check the documentation for new plugin connection configuration.");
pluginsData.forEach(function(item){
item = baseUrl + item; // for compatibility with previouse version of server, where plugins.url is used.
var value = _getPluginJson(item);
if (value) {
value.baseUrl = item.substring(0, item.lastIndexOf("config.json"));
value.oldVersion = (baseUrl !== "");
arr.push(value);
}
});
......@@ -1966,6 +1977,8 @@ define([
if (plugins) {
var arr = [], arrUI = [];
plugins.pluginsData.forEach(function(item){
if (uiCustomize!==undefined && (pluginStore.findWhere({baseUrl : item.baseUrl}) || pluginStore.findWhere({guid : item.guid}))) return;
var variations = item.variations,
variationsArr = [];
variations.forEach(function(itemVar){
......@@ -1976,12 +1989,19 @@ define([
}
}
if (isSupported && (isEdit || itemVar.isViewer)) {
var icons = itemVar.icons;
if (item.oldVersion) { // for compatibility with previouse version of server, where plugins.url is used.
icons = [];
itemVar.icons.forEach(function(icon){
icons.push(icon.substring(icon.lastIndexOf("\/")+1));
});
}
item.isUICustomizer ? arrUI.push(item.baseUrl + itemVar.url) :
variationsArr.push(new Common.Models.PluginVariation({
description: itemVar.description,
index: variationsArr.length,
url : itemVar.url,
icons : itemVar.icons,
url : (item.oldVersion) ? (itemVar.url.substring(itemVar.url.lastIndexOf("\/")+1) ) : itemVar.url,
icons : icons,
isViewer: itemVar.isViewer,
EditorsSupport: itemVar.EditorsSupport,
isVisual: itemVar.isVisual,
......
......@@ -750,18 +750,30 @@ define([
var win, props;
if (me.api){
props = me.api.asc_getChartObject();
var selectedObjects = me.api.asc_getGraphicObjectProps(),
imageSettings = null;
for (var i = 0; i < selectedObjects.length; i++) {
if (selectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) {
var elValue = selectedObjects[i].asc_getObjectValue();
if ( elValue.asc_getChartProperties() )
imageSettings = elValue;
}
}
if (props) {
var ischartedit = ( me.toolbar.mode.isEditDiagram || info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeChart || info.asc_getFlags().asc_getSelectionType() == Asc.c_oAscSelectionType.RangeChartText);
(new SSE.Views.ChartSettingsDlg(
{
chartSettings: props,
imageSettings: imageSettings,
isChart: true,
api: me.api,
handler: function(result, value) {
if (result == 'ok') {
if (me.api) {
(ischartedit) ? me.api.asc_editChartDrawingObject(value.chartSettings) : me.api.asc_addChartDrawingObject(value.chartSettings);
if (value.imageSettings)
me.api.asc_setGraphicObjectProps(value.imageSettings);
}
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
......
......@@ -198,6 +198,23 @@
"SSE.Controllers.DocumentHolder.txtTop": "Top",
"SSE.Controllers.DocumentHolder.txtUnderbar": "Bar under text",
"SSE.Controllers.DocumentHolder.txtWidth": "Width",
"SSE.Controllers.DocumentHolder.txtPaste": "Paste",
"SSE.Controllers.DocumentHolder.txtPasteFormulas": "Paste only formula",
"SSE.Controllers.DocumentHolder.txtPasteFormulaNumFormat": "Formula + number format",
"SSE.Controllers.DocumentHolder.txtPasteKeepSourceFormat": "Formula + all formatting",
"SSE.Controllers.DocumentHolder.txtPasteBorders": "Formula without borders",
"SSE.Controllers.DocumentHolder.txtPasteColWidths": "Formula + column width",
"SSE.Controllers.DocumentHolder.txtPasteMerge": "Merge conditional formatting",
"SSE.Controllers.DocumentHolder.txtPasteTranspose": "Transpose",
"SSE.Controllers.DocumentHolder.txtPasteValues": "Paste only value",
"SSE.Controllers.DocumentHolder.txtPasteValNumFormat": "Value + number format",
"SSE.Controllers.DocumentHolder.txtPasteValFormat": "Value + all formatting",
"SSE.Controllers.DocumentHolder.txtPasteFormat": "Paste only formatting",
"SSE.Controllers.DocumentHolder.txtPasteLink": "Paste link",
"SSE.Controllers.DocumentHolder.txtPastePicture": "Picture",
"SSE.Controllers.DocumentHolder.txtPasteLinkPicture": "Linked picture",
"SSE.Controllers.DocumentHolder.txtPasteSourceFormat": "Source formatting",
"SSE.Controllers.DocumentHolder.txtPasteDestFormat": "Destination formatting",
"SSE.Controllers.LeftMenu.newDocumentTitle": "Unnamed spreadsheet",
"SSE.Controllers.LeftMenu.textByColumns": "By columns",
"SSE.Controllers.LeftMenu.textByRows": "By rows",
......
......@@ -258,3 +258,10 @@
border: 1px solid @gray;
.background-ximage('@{app-image-path}/toolbar/math.png', '@{app-image-path}/toolbar/math@2x.png', 1500px);
}
#special-paste-container {
position: absolute;
z-index: @zindex-dropdown - 20;
background-color: @gray-light;
border: 1px solid @gray;
}
\ No newline at end of file
......@@ -58,13 +58,15 @@ define([
],
initialize: function () {
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
var me = this;
Common.NotificationCenter.on('addcontainer:show', _.bind(me.initEvents, me));
Common.NotificationCenter.on('document:ready', _.bind(me.onDocumentReady, me));
this.addListeners({
me.addListeners({
'AddFunction': {
'function:insert': this.onInsertFunction.bind(this),
'function:info': this.onFunctionInfo.bind(this)
'function:insert': me.onInsertFunction.bind(me),
'function:info': me.onFunctionInfo.bind(me)
}
});
},
......@@ -75,12 +77,6 @@ define([
onLaunch: function () {
this.createView('AddFunction').render();
var me = this;
_.defer(function () {
me.api.asc_setLocalization(fc);
me.fillFunctions.call(me);
});
},
initEvents: function () {
......@@ -90,35 +86,67 @@ define([
var me = this;
_.defer(function () {
me.api.asc_setLocalization(fc);
me.fillFunctions.call(me);
var editorLang = SSE.getController("Main").editorConfig.lang;
var localizationFunctions = function(data) {
fc = data;
me.api.asc_setLocalization(fc);
me.fillFunctions.call(me);
};
$.getJSON(Common.Utils.String.format("{0}/{1}.json", "resources/l10n/functions", editorLang), function(json) {
localizationFunctions(json);
}).fail(function() {
localizationFunctions(fc);
});
});
},
fillFunctions: function() {
var functions = {};
var jsonDescr = JSON.parse(fd);
var grouparr = this.api.asc_getFormulasInfo();
for (var g in grouparr) {
var group = grouparr[g];
var groupname = group.asc_getGroupName();
var funcarr = group.asc_getFormulasArray();
for (var f in funcarr) {
var func = funcarr[f];
var _name = func.asc_getName();
functions[_name] = {
type: _name,
group: groupname,
caption: func.asc_getLocaleName(),
args: jsonDescr[_name].a || '',
descr: jsonDescr[_name].d || ''
};
var me = this,
functions = {},
editorLang = SSE.getController("Main").editorConfig.lang;
var localizationFunctionsDesc = function (data) {
var jsonDesc = {},
view = me.getView('AddFunction');
fd = data;
try {
jsonDesc = JSON.parse(fd);
} catch (e) {
jsonDesc = fd
}
var grouparr = me.api.asc_getFormulasInfo();
for (var g in grouparr) {
var group = grouparr[g];
var groupname = group.asc_getGroupName();
var funcarr = group.asc_getFormulasArray();
for (var f in funcarr) {
var func = funcarr[f];
var _name = func.asc_getName();
functions[_name] = {
type: _name,
group: groupname,
caption: func.asc_getLocaleName(),
args: jsonDesc[_name].a || '',
descr: jsonDesc[_name].d || ''
};
}
}
}
this.getView('AddFunction').setFunctions(functions);
view.setFunctions(functions);
view.render();
};
$.getJSON(Common.Utils.String.format("{0}/{1}_desc.json", "resources/l10n/functions", editorLang), function(json) {
localizationFunctionsDesc(json);
}).fail(function() {
localizationFunctionsDesc(fd);
});
},
onInsertFunction: function (type) {
......
......@@ -73,9 +73,12 @@ define([
link.asc_setHyperlinkUrl(url);
display = url;
} else {
if ( !/^[A-Z]+[1-9]\d*:[A-Z]+[1-9]\d*$/.test(args.url) ||
!/^[A-Z]+[1-9]\d*$/.test(args.url) )
{
var isValid = /^[A-Z]+[1-9]\d*:[A-Z]+[1-9]\d*$/.test(args.url);
if (!isValid)
isValid = /^[A-Z]+[1-9]\d*$/.test(args.url);
if (!isValid) {
uiApp.alert(this.textInvalidRange);
return;
}
......
......@@ -265,7 +265,7 @@ define([
initBorderStyle: function () {
$('.page[data-page=edit-border-style] a[data-type]').single('click', _.bind(this.onBorderStyle, this));
$('#edit-border-color .color-preview').css('background-color', '#' + _borderInfo.color);
$('#edit-border-color .color-preview').css('background-color', '#' + (_.isObject(_borderInfo.color) ? _borderInfo.color.color : _borderInfo.color));
$('#edit-border-size select').val(_borderInfo.width);
$('#edit-border-size .item-after').text($('#edit-border-size select option[value=' +_borderInfo.width + ']').text());
......
......@@ -69,14 +69,19 @@ define([
return _sizes[index];
},
sizeByValue: function (value) {
indexSizeByValue: function (value) {
var index = 0;
_.each(_sizes, function (size, idx) {
if (Math.abs(size - value) < 0.25) {
index = idx;
}
});
return _sizes[index];
return index
},
sizeByValue: function (value) {
return _sizes[this.indexSizeByValue(value)];
}
}
})();
......@@ -212,25 +217,29 @@ define([
// Init border
var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4;
$('#edit-chart-bordersize input').val([borderSizeTransform.sizeByIndex(borderSize)]);
$('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByValue(borderSize) + ' ' + _metricText);
var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4,
borderType = shapeProperties.get_stroke().get_type();
$('#edit-chart-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]);
$('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText);
$('#edit-chart-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me));
$('#edit-chart-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me));
var stroke = shapeProperties.get_stroke(),
strokeType = stroke.get_type();
// Init border color
me._initBorderColorView();
},
if (stroke && strokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
_borderInfo.color = me._sdkToThemeColor(stroke.get_color());
}
_initBorderColorView: function () {
var me = this,
stroke = _shapeObject.get_ShapeProperties().get_stroke();
_borderInfo.color = (stroke && stroke.get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) ? me._sdkToThemeColor(stroke.get_color()) : 'transparent';
$('#edit-chart-bordercolor .color-preview').css('background-color',
('transparent' == _borderInfo.color)
? _borderInfo.color
: ('#' + (_.isObject(_borderInfo.color) ? _borderInfo.color.color : _borderInfo.color))
)
);
},
initLayoutPage: function () {
......@@ -618,29 +627,20 @@ define([
var me = this,
$target = $(e.currentTarget),
value = $target.val(),
currentShape = _shapeObject.get_ShapeProperties(),
image = new Asc.asc_CImgProperty(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke(),
currentColor = Common.Utils.ThemeColor.getRgbColor('000000');
stroke = new Asc.asc_CStroke();
value = borderSizeTransform.sizeByIndex(parseInt(value));
var currentStroke = currentShape.get_stroke();
if (currentStroke) {
var currentStrokeType = currentStroke.get_type();
if (currentStrokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
currentColor = currentStroke.get_color();
}
}
if (value < 0.01) {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(currentColor);
if (_borderInfo.color == 'transparent')
stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
else
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(_borderInfo.color)));
stroke.put_width(value * 25.4 / 72.0);
}
......@@ -648,6 +648,7 @@ define([
image.put_ShapeProperties(shape);
me.api.asc_setGraphicObjectProps(image);
me._initBorderColorView(); // when select STROKE_NONE or change from STROKE_NONE to STROKE_COLOR
},
onBorderSizeChanging: function (e) {
......@@ -660,14 +661,13 @@ define([
currentShape = _shapeObject.get_ShapeProperties();
$('#edit-chart-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)));
_borderInfo.color = color;
if (me.api && currentShape) {
if (me.api && currentShape && currentShape.get_stroke().get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
var image = new Asc.asc_CImgProperty(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke();
_borderInfo.color = Common.Utils.ThemeColor.getRgbColor(color);
if (currentShape.get_stroke().get_width() < 0.01) {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_NONE);
} else {
......@@ -1032,7 +1032,12 @@ define([
chartObject = this.api.asc_getChartObject();
if (!_.isUndefined(chartObject) && value && value.length > 0) {
var intValue = parseInt(value);
chartObject[propertyMethod](parseInt(value));
if ("putDataLabelsPos" == propertyMethod && intValue != 0)
chartObject["putShowVal"](true);
this.api.asc_editChartDrawingObject(chartObject);
}
},
......
......@@ -262,9 +262,17 @@ define([
$layoutPages.prop('outerHTML') +
'</div>' +
'</div>'
)).on('close', function (e) {
)).on('opened', function () {
if (_.isFunction(me.api.asc_OnShowContextMenu)) {
me.api.asc_OnShowContextMenu()
}
}).on('close', function (e) {
mainView.showNavbar();
Common.NotificationCenter.trigger('layout:changed','navbar', {hidden:false});
}).on('closed', function () {
if (_.isFunction(me.api.asc_OnHideContextMenu)) {
me.api.asc_OnHideContextMenu()
}
});
mainView.hideNavbar();
Common.NotificationCenter.trigger('layout:changed','navbar', {hidden:true});
......@@ -292,9 +300,17 @@ define([
$overlay.addClass('modal-overlay-visible')
}
});
if (_.isFunction(me.api.asc_OnShowContextMenu)) {
me.api.asc_OnShowContextMenu()
}
}).on('close', function () {
$overlay.off('removeClass');
$overlay.removeClass('modal-overlay-visible')
}).on('closed', function () {
if (_.isFunction(me.api.asc_OnHideContextMenu)) {
me.api.asc_OnHideContextMenu()
}
});
}
......
......@@ -67,14 +67,19 @@ define([
return _sizes[index];
},
sizeByValue: function (value) {
indexSizeByValue: function (value) {
var index = 0;
_.each(_sizes, function (size, idx) {
if (Math.abs(size - value) < 0.25) {
index = idx;
}
});
return _sizes[index];
return index;
},
sizeByValue: function (value) {
return _sizes[this.indexSizeByValue(value)];
}
}
})();
......@@ -173,25 +178,16 @@ define([
// Init border
var borderSize = this._mm2pt(shapeProperties.get_stroke().get_width());
$('#edit-shape-bordersize input').val([borderSizeTransform.sizeByIndex(borderSize)]);
$('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByValue(borderSize) + ' ' + _metricText);
var borderSize = me._mm2pt(shapeProperties.get_stroke().get_width()),
borderType = shapeProperties.get_stroke().get_type();
$('#edit-shape-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]);
$('#edit-shape-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText);
$('#edit-shape-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me));
$('#edit-shape-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me));
var stroke = shapeProperties.get_stroke(),
strokeType = stroke.get_type();
if (stroke && strokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
_borderInfo.color = me._sdkToThemeColor(stroke.get_color());
}
$('#edit-shape-bordercolor .color-preview').css('background-color',
('transparent' == _borderInfo.color)
? _borderInfo.color
: ('#' + (_.isObject(_borderInfo.color) ? _borderInfo.color.color : _borderInfo.color))
)
// Init border color
me._initBorderColorView();
// Effect
// Init style opacity
......@@ -201,6 +197,19 @@ define([
$('#edit-shape-effect input').single('input', _.bind(me.onOpacityChanging, me));
},
_initBorderColorView: function () {
var me = this,
stroke = _shapeObject.get_ShapeProperties().get_stroke();
_borderInfo.color = (stroke && stroke.get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) ? me._sdkToThemeColor(stroke.get_color()) : 'transparent';
$('#edit-shape-bordercolor .color-preview').css('background-color',
('transparent' == _borderInfo.color)
? _borderInfo.color
: ('#' + (_.isObject(_borderInfo.color) ? _borderInfo.color.color : _borderInfo.color))
);
},
initReplacePage: function () {
$('.shape-replace li').single('click', _.buffered(this.onReplace, 100, this));
},
......@@ -263,36 +272,28 @@ define([
var me = this,
$target = $(e.currentTarget),
value = $target.val(),
currentShape = _shapeObject.get_ShapeProperties(),
image = new Asc.asc_CImgProperty(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke(),
currentColor = Common.Utils.ThemeColor.getRgbColor('000000');
stroke = new Asc.asc_CStroke();
value = borderSizeTransform.sizeByIndex(parseInt(value));
var currentStroke = currentShape.get_stroke();
if (currentStroke) {
var currentStrokeType = currentStroke.get_type();
if (currentStrokeType == Asc.c_oAscStrokeType.STROKE_COLOR) {
currentColor = currentStroke.get_color();
}
}
if (value < 0.01) {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(currentColor);
stroke.put_width(this._pt2mm(value));
if (_borderInfo.color == 'transparent')
stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
else
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(_borderInfo.color)));
stroke.put_width(me._pt2mm(value));
}
shape.put_stroke(stroke);
image.asc_putShapeProperties(shape);
me.api.asc_setGraphicObjectProps(image);
me._initBorderColorView(); // when select STROKE_NONE or change from STROKE_NONE to STROKE_COLOR
},
onBorderSizeChanging: function (e) {
......@@ -350,8 +351,9 @@ define([
currentShape = _shapeObject.get_ShapeProperties();
$('#edit-shape-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)));
_borderInfo.color = color;
if (me.api && currentShape) {
if (me.api && currentShape && currentShape.get_stroke().get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
var image = new Asc.asc_CImgProperty(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke();
......@@ -370,8 +372,6 @@ define([
me.api.asc_setGraphicObjectProps(image);
}
},
// API handlers
......@@ -399,6 +399,10 @@ define([
return;
}
if (_stack.length < 1) {
_stack = this.api.asc_getGraphicObjectProps();
}
var shapes = [];
_.each(_stack, function (object) {
......
......@@ -151,8 +151,7 @@ define([
var color = _fontInfo.asc_getColor(),
clr = me._sdkToThemeColor(color);
$('#text-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr));
$('#font-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr));
// Align
$('#edit-text-align-block').css('display', (_textIn == TextType.inShape) ? 'block' : 'none');
......@@ -279,7 +278,7 @@ define([
onTextColor:function (palette, color) {
this.api.asc_setCellTextColor(Common.Utils.ThemeColor.getRgbColor(color));
$('#text-color .color-preview').css('background-color', '#' + (_.isObject(color) ? color.color : color));
$('#font-color .color-preview').css('background-color', '#' + (_.isObject(color) ? color.color : color));
},
onHAlignChange: function (e) {
......
......@@ -47,7 +47,7 @@
<div id="add-function-group">
<div class="navbar">
<div class="navbar-inner">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= textBack %></span><% } %></a></div>
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= groupname %></div>
</div>
</div>
......@@ -79,7 +79,7 @@
<div id="add-function-info">
<div class="navbar">
<div class="navbar-inner">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= textBack %></span><% } %></a></div>
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= caption %></div>
</div>
</div>
......
......@@ -2,7 +2,7 @@
<div id="addlink-root-view">
<div class="page" data-page="add-link">
<div class="page-content">
<div class="list-block">
<div class="list-block" style="<%= android ? 'margin-bottom: 0' : '' %>">
<ul>
<li>
<a id="add-link-type" class="item-link smart-select">
......@@ -30,25 +30,33 @@
</div>
</a>
</li>
<div id="add-link-range" class="item-content">
<div class="item-inner">
<div class="item-title label"><%= scope.textRange %></div>
<div class="item-after">
<div class="item-input">
<input type="text" class="field right range" placeholder="<%= scope.textRequired %>">
</div>
<% if (android) { %>
</ul>
</div>
<div class="list-block" style="margin-top: 0">
<ul>
<% } %>
<li>
<div id="add-link-range" class="item-content">
<div class="item-inner">
<div class="item-title label"><%= scope.textRange %></div>
<% if (!android) { %><div class="item-after"><% } %>
<div class="item-input">
<input type="text" class="field right range" placeholder="<%= scope.textRequired %>">
</div>
<% if (!android) { %></div><% } %>
</div>
</div>
</div>
</li>
<li>
<div id="add-link-url" class="item-content">
<div class="item-inner">
<div class="item-title label"><%= scope.textLink %></div>
<div class="item-after">
<% if (!android) { %><div class="item-after"><% } %>
<div class="item-input">
<input type="url" class="field right" placeholder="<%= scope.textRequired %>">
</div>
</div>
<% if (!android) { %></div><% } %>
</div>
</div>
</li>
......@@ -56,11 +64,11 @@
<div id="add-link-display" class="item-content">
<div class="item-inner">
<div class="item-title label"><%= scope.textDisplay %></div>
<div class="item-after">
<% if (!android) { %><div class="item-after"><% } %>
<div class="item-input">
<input type="text" class="field right">
</div>
</div>
<% if (!android) { %></div><% } %>
</div>
</div>
</li>
......@@ -68,11 +76,11 @@
<div id="add-link-tip" class="item-content">
<div class="item-inner">
<div class="item-title label"><%= scope.textTip %></div>
<div class="item-after">
<% if (!android) { %><div class="item-after"><% } %>
<div class="item-input">
<input type="text" class="field right">
</div>
</div>
<% if (!android) { %></div><% } %>
</div>
</div>
</li>
......
......@@ -461,7 +461,7 @@
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textTickOptions %>Tick Options</div>
<div class="content-block-title"><%= scope.textTickOptions %></div>
<div class="list-block">
<ul>
<li>
......@@ -480,7 +480,7 @@
<select name="vertical-axis-tick-minor"></select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textMajorType %></div>
<div class="item-title"><%= scope.textMinorType %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
......@@ -596,7 +596,7 @@
<select name="horizontal-axis-tick-minor"></select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textMajorType %></div>
<div class="item-title"><%= scope.textMinorType %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
......
......@@ -24,7 +24,7 @@
</div>
</li>
<li>
<a id="text-color" class="item-link" data-page="#edit-text-color">
<a id="font-color" class="item-link" data-page="#edit-text-color">
<div class="item-content">
<% if (!android) { %><div class="item-media" style="padding-top: 0;"><i class="icon icon-text-color"><span class="color-preview"></span></i></div><% } %>
<div class="item-inner">
......
......@@ -89,7 +89,7 @@ define([
].join(''));
var $target = $('#' + _anchorId)
.css({left: posX, top: posY});
.css({left: posX, top: Math.max(0, posY)});
uiApp.closeModal('.document-menu.modal-in');
......
......@@ -53,7 +53,7 @@ define([
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
view : viewid,
textBack : 'Back'
scope : this
};
_.extend(_params, args);
......@@ -94,6 +94,8 @@ define([
// Render layout
render: function () {
var me = this;
var quickFunctions = [
{caption: 'SUM', type: 'SUM'},
{caption: 'MIN', type: 'MIN'},
......@@ -101,24 +103,30 @@ define([
{caption: 'COUNT', type: 'COUNT'}
];
this.groups = {
'DateAndTime': this.sCatDateAndTime,
'Engineering': this.sCatEngineering,
'TextAndData': this.sCatTextAndData,
'Statistical': this.sCatStatistical,
'Financial': this.sCatFinancial,
'Mathematic': this.sCatMathematic,
'LookupAndReference': this.sCatLookupAndReference,
'Information': this.sCatInformation,
'Logical': this.sCatLogical
if (me.functions) {
_.each(quickFunctions, function (quickFunction) {
quickFunction.caption = me.functions[quickFunction.type].caption
});
}
me.groups = {
'DateAndTime': me.sCatDateAndTime,
'Engineering': me.sCatEngineering,
'TextAndData': me.sCatTextAndData,
'Statistical': me.sCatStatistical,
'Financial': me.sCatFinancial,
'Mathematic': me.sCatMathematic,
'LookupAndReference': me.sCatLookupAndReference,
'Information': me.sCatInformation,
'Logical': me.sCatLogical
};
this.layout = $('<div/>').append(_.template(this.template, {
me.layout = $('<div/>').append(_.template(me.template, {
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
textGroups : this.textGroups,
textGroups : me.textGroups,
quick : quickFunctions,
groups : this.groups,
groups : me.groups,
view : 'root'
}));
......@@ -180,6 +188,7 @@ define([
},
textGroups: 'CATEGORIES',
textBack: 'Back',
sCatLogical: 'Logical',
// sCatCube: 'Cube',
// sCatDatabase: 'Database',
......
......@@ -215,6 +215,16 @@ define([
})
);
var $view = $('.settings');
if ($view.length > 0) {
$view.find('#add-link-sheet select').html(
_.template(tpl, {
worksheets: sheets
})
);
}
var active = _.findWhere(sheets, {active:true});
if ( active )
this.setActiveWorksheet(active.value, active.caption);
......
......@@ -259,6 +259,7 @@ define([
textValReverseOrder: 'Values in Reverse Order',
textTickOptions: 'Tick Options',
textMajorType: 'Major Type',
textMinorType: 'Minor Type',
textLabelOptions: 'Label Options',
textLabelPos: 'Label Position',
textAxisPosition: 'Axis Position',
......
......@@ -81,11 +81,14 @@ define([
// Render layout
render: function () {
var shapes = Common.SharedSettings.get('shapes').slice();
shapes.splice(0, 1); // Remove line shapes
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
imgpath : '../../common/mobile/resources/img/shapes',
shapes : Common.SharedSettings.get('shapes'),
shapes : shapes,
scope : this
}));
......
......@@ -222,6 +222,7 @@
"SSE.Views.AddFunction.sCatStatistical": "Statistisch",
"SSE.Views.AddFunction.sCatTextAndData": "Text und Daten",
"SSE.Views.AddFunction.textGroups": "Kategorien",
"SSE.Views.AddFunction.textBack": "Zurück",
"SSE.Views.AddLink.textAddLink": "Link hinzufügen",
"SSE.Views.AddLink.textAddress": "Adresse",
"SSE.Views.AddLink.textDisplay": "Anzeigen",
......
......@@ -224,6 +224,7 @@
"SSE.Views.AddFunction.sCatStatistical": "Statistical",
"SSE.Views.AddFunction.sCatTextAndData": "Text and data",
"SSE.Views.AddFunction.textGroups": "Categories",
"SSE.Views.AddFunction.textBack": "Back",
"SSE.Views.AddLink.textAddLink": "Add Link",
"SSE.Views.AddLink.textAddress": "Address",
"SSE.Views.AddLink.textDisplay": "Display",
......@@ -325,6 +326,7 @@
"SSE.Views.EditChart.textMajorType": "Major Type",
"SSE.Views.EditChart.textMaxValue": "Maximum Value",
"SSE.Views.EditChart.textMinor": "Minor",
"SSE.Views.EditChart.textMinorType": "Minor Type",
"SSE.Views.EditChart.textMinValue": "Minimum Value",
"SSE.Views.EditChart.textNone": "None",
"SSE.Views.EditChart.textNoOverlay": "No Overlay",
......
......@@ -222,6 +222,7 @@
"SSE.Views.AddFunction.sCatStatistical": "Statistiques",
"SSE.Views.AddFunction.sCatTextAndData": "Texte et données",
"SSE.Views.AddFunction.textGroups": "Catégories",
"SSE.Views.AddFunction.textBack": "Retour",
"SSE.Views.AddLink.textAddLink": "Ajouter le lien",
"SSE.Views.AddLink.textAddress": "Adresse",
"SSE.Views.AddLink.textDisplay": "Afficher",
......
......@@ -222,6 +222,7 @@
"SSE.Views.AddFunction.sCatStatistical": "Статистические",
"SSE.Views.AddFunction.sCatTextAndData": "Текст и данные",
"SSE.Views.AddFunction.textGroups": "Категории",
"SSE.Views.AddFunction.textBack": "Назад",
"SSE.Views.AddLink.textAddLink": "Добавить ссылку",
"SSE.Views.AddLink.textAddress": "Адрес",
"SSE.Views.AddLink.textDisplay": "Отображать",
......
......@@ -336,6 +336,12 @@
"cwd": "../apps/spreadsheeteditor/mobile/locale/",
"src": "*",
"dest": "../deploy/web-apps/apps/spreadsheeteditor/mobile/locale/"
},
{
"expand": true,
"cwd": "../apps/spreadsheeteditor/mobile/resources/l10n/functions/",
"src": "*",
"dest": "../deploy/web-apps/apps/spreadsheeteditor/mobile/resources/l10n/functions/"
}
],
"images-app": [
......
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