[SSE mobile] cleared project sources

This commit is contained in:
Maxim Kadushkin 2020-12-10 16:11:49 +03:00
parent 88d02f90d8
commit 9dec0adbf6
90 changed files with 0 additions and 38774 deletions

View file

@ -1,224 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* app.js
*
* Created by Maxim Kadushkin on 11/14/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
'use strict';
var reqerr;
require.config({
baseUrl: '../../',
paths: {
jquery : '../vendor/jquery/jquery',
underscore : '../vendor/underscore/underscore',
backbone : '../vendor/backbone/backbone',
framework7 : '../vendor/framework7/js/framework7',
text : '../vendor/requirejs-text/text',
xregexp : '../vendor/xregexp/xregexp-all-min',
sockjs : '../vendor/sockjs/sockjs.min',
jszip : '../vendor/jszip/jszip.min',
jsziputils : '../vendor/jszip-utils/jszip-utils.min',
api : 'api/documents/api',
core : 'common/main/lib/core/application',
extendes : 'common/mobile/utils/extendes',
notification : 'common/main/lib/core/NotificationCenter',
analytics : 'common/Analytics',
gateway : 'common/Gateway',
locale : 'common/locale',
irregularstack : 'common/IrregularStack',
sharedsettings : 'common/mobile/utils/SharedSettings',
features : '../../web-apps-mobile/cell/patch'
},
shim: {
framework7: {
exports: 'Framework7'
},
underscore: {
exports: '_'
},
backbone: {
deps: [
'underscore',
'jquery'
],
exports: 'Backbone'
},
core: {
deps: [
'backbone',
'notification',
'irregularstack',
'sharedsettings'
]
}
}
});
require([
'backbone',
'framework7',
'core',
'underscore',
'extendes',
'api',
'analytics',
'gateway',
'locale',
'jszip',
'jsziputils',
'sockjs'
], function (Backbone, Framework7) {
Backbone.history.start();
/**
* Application instance with SSE namespace defined
*/
var app = new Backbone.Application({
nameSpace: 'SSE',
autoCreate: false,
controllers : [
'Common.Controllers.Plugins',
'Editor',
'Toolbar',
'Search',
'CellEditor',
'Main',
'DocumentHolder'
,'Statusbar'
,'Settings'
,'EditContainer'
,'EditCell'
,'EditText'
,'EditImage'
,'EditShape'
,'EditChart'
,'EditHyperlink'
,'AddContainer'
,'AddChart'
,'AddFunction'
,'AddShape'
,'AddOther'
,'AddLink'
,'FilterOptions'
,'Common.Controllers.Collaboration'
]
});
var device = Framework7.prototype.device;
var loadPlatformCss = function (filename, opt){
var fileref = document.createElement('link');
fileref.setAttribute('rel', 'stylesheet');
fileref.setAttribute('type', 'text/css');
fileref.setAttribute('href', filename);
if (typeof fileref != 'undefined') {
document.getElementsByTagName("head")[0].appendChild(fileref);
}
};
//Store Framework7 initialized instance for easy access
window.uiApp = new Framework7({
// Default title for modals
modalTitle: 'ONLYOFFICE',
// Enable tap hold events
tapHold: true,
// If it is webapp, we can enable hash navigation:
// pushState: false,
// If Android
material: device.android,
// Hide and show indicator during ajax requests
onAjaxStart: function (xhr) {
uiApp.showIndicator();
},
onAjaxComplete: function (xhr) {
uiApp.hideIndicator();
}
});
//Export DOM7 to local variable to make it easy accessable
window.$$ = Dom7;
//Load platform styles
loadPlatformCss('resources/css/app-' + (device.android ? 'material' : 'ios') + '.css');
Common.Locale.apply(function(){
require([
'common/main/lib/util/LocalStorage',
'common/main/lib/util/utils',
'common/mobile/lib/controller/Plugins',
'spreadsheeteditor/mobile/app/controller/Editor',
'spreadsheeteditor/mobile/app/controller/Toolbar',
'spreadsheeteditor/mobile/app/controller/Search',
'spreadsheeteditor/mobile/app/controller/Main',
'spreadsheeteditor/mobile/app/controller/DocumentHolder'
,'spreadsheeteditor/mobile/app/controller/CellEditor'
,'spreadsheeteditor/mobile/app/controller/Statusbar'
,'spreadsheeteditor/mobile/app/controller/Settings'
,'spreadsheeteditor/mobile/app/controller/edit/EditContainer'
,'spreadsheeteditor/mobile/app/controller/edit/EditCell'
,'spreadsheeteditor/mobile/app/controller/edit/EditText'
,'spreadsheeteditor/mobile/app/controller/edit/EditImage'
,'spreadsheeteditor/mobile/app/controller/edit/EditShape'
,'spreadsheeteditor/mobile/app/controller/edit/EditChart'
,'spreadsheeteditor/mobile/app/controller/edit/EditHyperlink'
,'spreadsheeteditor/mobile/app/controller/add/AddContainer'
,'spreadsheeteditor/mobile/app/controller/add/AddChart'
,'spreadsheeteditor/mobile/app/controller/add/AddFunction'
,'spreadsheeteditor/mobile/app/controller/add/AddShape'
,'spreadsheeteditor/mobile/app/controller/add/AddOther'
,'spreadsheeteditor/mobile/app/controller/add/AddLink'
,'spreadsheeteditor/mobile/app/controller/FilterOptions'
,'common/mobile/lib/controller/Collaboration'
], function() {
window.compareVersions = true;
var _s = app.start.bind(app);
require(['features'], _s, _s);
});
});
}, function(err) {
if (err.requireType == 'timeout' && !reqerr && window.requireTimeourError) {
reqerr = window.requireTimeourError();
window.alert(reqerr);
window.location.reload();
}
});

View file

@ -1,232 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* app.js
*
* Created by Maxim Kadushkin on 1/13/2017
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
'use strict';
var reqerr;
require.config({
baseUrl: '../../',
paths: {
jquery : '../vendor/jquery/jquery',
underscore : '../vendor/underscore/underscore',
backbone : '../vendor/backbone/backbone',
framework7 : '../vendor/framework7/js/framework7',
text : '../vendor/requirejs-text/text',
xregexp : '../vendor/xregexp/xregexp-all-min',
sockjs : '../vendor/sockjs/sockjs.min',
jszip : '../vendor/jszip/jszip.min',
jsziputils : '../vendor/jszip-utils/jszip-utils.min',
allfonts : '../../sdkjs/common/AllFonts',
sdk : '../../sdkjs/cell/sdk-all-min',
api : 'api/documents/api',
core : 'common/main/lib/core/application',
extendes : 'common/mobile/utils/extendes',
notification : 'common/main/lib/core/NotificationCenter',
analytics : 'common/Analytics',
gateway : 'common/Gateway',
locale : 'common/locale',
irregularstack : 'common/IrregularStack',
sharedsettings : 'common/mobile/utils/SharedSettings'
},
shim: {
framework7: {
exports: 'Framework7'
},
underscore: {
exports: '_'
},
sdk: {
deps: [
'jquery',
'underscore',
'allfonts',
'xregexp',
'sockjs',
'jszip',
'jsziputils'
]
},
backbone: {
deps: [
'underscore',
'jquery'
],
exports: 'Backbone'
},
core: {
deps: [
'backbone',
'notification',
'irregularstack',
'sharedsettings'
]
}
}
});
require([
'backbone',
'framework7',
'core',
'underscore',
'extendes',
'sdk',
'api',
'analytics',
'gateway',
'locale'
], function (Backbone, Framework7) {
Backbone.history.start();
/**
* Application instance with SSE namespace defined
*/
var app = new Backbone.Application({
nameSpace: 'SSE',
autoCreate: false,
controllers : [
'Common.Controllers.Plugins',
'Editor',
'Toolbar',
'Search',
'CellEditor',
'Main',
'DocumentHolder'
,'Statusbar'
,'Settings'
,'EditContainer'
,'EditCell'
,'EditText'
,'EditImage'
,'EditShape'
,'EditChart'
,'EditHyperlink'
,'AddContainer'
,'AddChart'
,'AddFunction'
,'AddShape'
,'AddOther'
,'AddLink'
,'FilterOptions'
,'Common.Controllers.Collaboration'
]
});
var device = Framework7.prototype.device;
var loadPlatformCss = function (filename, opt){
var fileref = document.createElement('link');
fileref.setAttribute('rel', 'stylesheet');
fileref.setAttribute('type', 'text/css');
fileref.setAttribute('href', filename);
if (typeof fileref != 'undefined') {
document.getElementsByTagName("head")[0].appendChild(fileref);
}
};
//Store Framework7 initialized instance for easy access
window.uiApp = new Framework7({
// Default title for modals
modalTitle: '{{APP_TITLE_TEXT}}',
// Enable tap hold events
tapHold: true,
// If it is webapp, we can enable hash navigation:
// pushState: false,
// If Android
material: device.android,
// Hide and show indicator during ajax requests
onAjaxStart: function (xhr) {
uiApp.showIndicator();
},
onAjaxComplete: function (xhr) {
uiApp.hideIndicator();
}
});
//Export DOM7 to local variable to make it easy accessable
window.$$ = Dom7;
//Load platform styles
loadPlatformCss('resources/css/app-' + (device.android ? 'material' : 'ios') + '.css');
Common.Locale.apply(function(){
require([
'common/main/lib/util/LocalStorage',
'common/main/lib/util/utils',
'common/mobile/lib/controller/Plugins',
'spreadsheeteditor/mobile/app/controller/Editor',
'spreadsheeteditor/mobile/app/controller/Toolbar',
'spreadsheeteditor/mobile/app/controller/Search',
'spreadsheeteditor/mobile/app/controller/Main',
'spreadsheeteditor/mobile/app/controller/DocumentHolder'
,'spreadsheeteditor/mobile/app/controller/CellEditor'
,'spreadsheeteditor/mobile/app/controller/Statusbar'
,'spreadsheeteditor/mobile/app/controller/Settings'
,'spreadsheeteditor/mobile/app/controller/edit/EditContainer'
,'spreadsheeteditor/mobile/app/controller/edit/EditCell'
,'spreadsheeteditor/mobile/app/controller/edit/EditText'
,'spreadsheeteditor/mobile/app/controller/edit/EditImage'
,'spreadsheeteditor/mobile/app/controller/edit/EditShape'
,'spreadsheeteditor/mobile/app/controller/edit/EditChart'
,'spreadsheeteditor/mobile/app/controller/edit/EditHyperlink'
,'spreadsheeteditor/mobile/app/controller/add/AddContainer'
,'spreadsheeteditor/mobile/app/controller/add/AddChart'
,'spreadsheeteditor/mobile/app/controller/add/AddFunction'
,'spreadsheeteditor/mobile/app/controller/add/AddShape'
,'spreadsheeteditor/mobile/app/controller/add/AddOther'
,'spreadsheeteditor/mobile/app/controller/add/AddLink'
,'spreadsheeteditor/mobile/app/controller/FilterOptions'
,'common/mobile/lib/controller/Collaboration'
], function() {
app.start();
});
});
}, function(err) {
if (err.requireType == 'timeout' && !reqerr && window.requireTimeourError) {
reqerr = window.requireTimeourError();
window.alert(reqerr);
window.location.reload();
}
});

View file

@ -1,51 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* sheets.js
*
* Created by Maxim.Kadushkin on 11/29/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'backbone',
'spreadsheeteditor/mobile/app/model/sheet'
], function(Backbone) {
'use strict';
SSE.Collections = SSE.Collections || {};
SSE.Collections.Sheets = Backbone.Collection.extend({
model: SSE.Models.Sheets
});
});

View file

@ -1,188 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* CellEditor.js
*
* CellEditor Controller
*
* Created by Maxim Kadushkin on 11/24/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/CellEditor'
], function (core) {
'use strict';
SSE.Controllers.CellEditor = Backbone.Controller.extend({
views: [
'CellEditor'
],
events: function() {
return {
// 'keyup input#ce-cell-name': _.bind(this.onCellName,this),
// 'keyup textarea#ce-cell-content': _.bind(this.onKeyupCellEditor,this),
// 'blur textarea#ce-cell-content': _.bind(this.onBlurCellEditor,this),
// 'click a#ce-function': _.bind(this.onInsertFunction, this)
};
},
initialize: function() {
var me = this;
this.addListeners({
'CellEditor': {
'function:click': this.onInsertFunction.bind(this),
'function:hint': function (name, type) {
setTimeout(function(){
me.api.asc_insertInCell(name, type, false);
}, 0);
}
}
// 'Viewport': {
// 'layout:resizedrag': _.bind(this.onLayoutResize, this)
// }
});
},
setApi: function(api) {
this.api = api;
// this.api.isCEditorFocused = false;
this.api.asc_registerCallback('asc_onSelectionNameChanged', _.bind(this.onApiCellSelection, this));
this.api.asc_registerCallback('asc_onEditCell', _.bind(this.onApiEditCell, this));
this.api.asc_registerCallback('asc_onFormulaCompleteMenu', _.bind(this.onFormulaCompleteMenu, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiDisconnect,this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiDisconnect, this));
// Common.NotificationCenter.on('cells:range', _.bind(this.onCellsRange, this));
// this.api.asc_registerCallback('asc_onInputKeyDown', _.bind(this.onInputKeyDown, this));
return this;
},
setMode: function(mode) {
this.mode = mode;
// this.editor.$btnfunc[this.mode.isEdit?'removeClass':'addClass']('disabled');
// this.editor.btnNamedRanges.setVisible(this.mode.isEdit && !this.mode.isEditDiagram && !this.mode.isEditMailMerge);
},
onInputKeyDown: function(e) {
if (Common.UI.Keys.UP === e.keyCode || Common.UI.Keys.DOWN === e.keyCode ||
Common.UI.Keys.TAB === e.keyCode || Common.UI.Keys.RETURN === e.keyCode || Common.UI.Keys.ESC === e.keyCode ||
Common.UI.Keys.LEFT === e.keyCode || Common.UI.Keys.RIGHT === e.keyCode) {
var menu = $('#menu-formula-selection'); // for formula menu
if (menu.hasClass('open'))
menu.find('.dropdown-menu').trigger('keydown', e);
}
},
onLaunch: function() {
this.editor = this.createView('CellEditor').render();
// this.bindViewEvents(this.editor, this.events);
// this.editor.$el.parent().find('.after').css({zIndex: '4'}); // for spreadsheets - bug 23127
},
onApiEditCell: function(state) {
if (state == Asc.c_oAscCellEditorState.editStart){
this.api.isCellEdited = true;
this.editor.cellNameDisabled(true);
} else if (state == Asc.c_oAscCellEditorState.editEnd) {
this.api.isCellEdited = false;
this.api.isCEditorFocused = false;
this.editor.cellNameDisabled(false);
}
},
onApiCellSelection: function(info) {
this.editor.updateCellInfo(info);
},
onApiDisconnect: function() {
this.mode.isEdit = false;
$('#ce-function').addClass('disabled');
},
onCellsRange: function(status) {
// this.editor.cellNameDisabled(status != Asc.c_oAscSelectionDialogType.None);
},
onCellName: function(e) {
if (e.keyCode == Common.UI.Keys.RETURN){
var name = this.editor.$cellname.val();
if (name && name.length) {
this.api.asc_findCell(name);
}
Common.NotificationCenter.trigger('edit:complete', this.editor);
}
},
onBlurCellEditor: function() {
if (this.api.isCEditorFocused == 'clear')
this.api.isCEditorFocused = undefined;
else if (this.api.isCellEdited)
this.api.isCEditorFocused = true;
// if (Common.Utils.isIE && !$('#menu-formula-selection').hasClass('open')) {// for formula menu
// this.getApplication().getController('DocumentHolder').documentHolder.focus();
// }
},
onKeyupCellEditor: function(e) {
if(e.keyCode == Common.UI.Keys.RETURN && !e.altKey){
this.api.isCEditorFocused = 'clear';
}
},
onInsertFunction: function() {
if (this.mode && this.mode.isEdit) {
SSE.getController('AddContainer').showModal({
panel: 'function',
button: '#ce-function'
});
}
},
onFormulaCompleteMenu: function(funcarr) {
if ( funcarr && funcarr.length ) {
this.editor.resetFunctionsHint(funcarr);
!this.editor.$boxfuncs.hasClass('.opened') && this.editor.$boxfuncs.addClass('opened');
} else {
this.editor.$boxfuncs.removeClass('opened');
}
}
});
});

View file

@ -1,527 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* DocumentHolder.js
*
* Created by Maxim Kadushkin on 11/15/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'jquery',
'underscore',
'backbone',
'spreadsheeteditor/mobile/app/view/DocumentHolder'
], function (core, $, _, Backbone) {
'use strict';
SSE.Controllers.DocumentHolder = Backbone.Controller.extend(_.extend((function() {
// private
var _actionSheets = [],
_isEdit = false,
_canViewComments = true,
_isComments = false;
function openLink(url) {
var newDocumentPage = window.open(url, '_blank');
if (newDocumentPage) {
newDocumentPage.focus();
}
}
return {
models: [],
collections: [],
views: [
'DocumentHolder'
],
initialize: function() {
this.addListeners({
'DocumentHolder': {
'contextmenu:click' : this.onContextMenuClick
}
});
},
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onShowPopMenu', _.bind(this.onApiShowPopMenu, this));
this.api.asc_registerCallback('asc_onHidePopMenu', _.bind(this.onApiHidePopMenu, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect,this));
this.api.asc_registerCallback('asc_onShowComment', _.bind(this.onApiShowComment, this));
this.api.asc_registerCallback('asc_onHideComment', _.bind(this.onApiHideComment, this));
},
onApiShowComment: function(comments) {
_isComments = comments && comments.length>0;
},
onApiHideComment: function() {
_isComments = false;
},
setMode: function (mode) {
_isEdit = mode.isEdit;
if (_isEdit) {
this.api.asc_registerCallback('asc_onSetAFDialog', _.bind(this.onApiFilterOptions, this));
}
_canViewComments = mode.canViewComments;
},
// When our application is ready, lets get started
onLaunch: function() {
var me = this;
me.view = me.createView('DocumentHolder').render();
$$(window).on('resize', _.bind(me.onEditorResize, me));
},
// Handlers
onContextMenuClick: function (view, event) {
var me = this;
var info = me.api.asc_getCellInfo();
switch (event) {
case 'cut':
var res = me.api.asc_Cut();
if (!res) {
me.view.hideMenu();
if (!Common.localStorage.getBool("sse-hide-copy-cut-paste-warning")) {
uiApp.modal({
title: me.textCopyCutPasteActions,
text: me.errorCopyCutPaste,
afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-cut">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
buttons: [{
text: 'OK',
onClick: function () {
var dontshow = $('input[name="checkbox-show-cut"]').prop('checked');
if (dontshow) Common.localStorage.setItem("sse-hide-copy-cut-paste-warning", 1);
}
}]
});
}
}
break;
case 'copy':
var res = me.api.asc_Copy();
if (!res) {
me.view.hideMenu();
if (!Common.localStorage.getBool("sse-hide-copy-cut-paste-warning")) {
uiApp.modal({
title: me.textCopyCutPasteActions,
afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-copy">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
buttons: [{
text: 'OK',
onClick: function () {
var dontshow = $('input[name="checkbox-show-copy"]').prop('checked');
if (dontshow) Common.localStorage.setItem("sse-hide-copy-cut-paste-warning", 1);
}
}]
});
}
}
break;
case 'paste':
var res = me.api.asc_Paste();
if (!res) {
me.view.hideMenu();
if (!Common.localStorage.getBool("sse-hide-copy-cut-paste-warning")) {
uiApp.modal({
title: me.textCopyCutPasteActions,
text: me.errorCopyCutPaste,
afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-paste">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
buttons: [{
text: 'OK',
onClick: function () {
var dontshow = $('input[name="checkbox-show-paste"]').prop('checked');
if (dontshow) Common.localStorage.setItem("sse-hide-copy-cut-paste-warning", 1);
}
}]
});
}
}
break;
case 'del': me.api.asc_emptyCells(Asc.c_oAscCleanOptions.All); break;
case 'wrap': me.api.asc_setCellTextWrap(true); break;
case 'unwrap': me.api.asc_setCellTextWrap(false); break;
case 'edit':
me.view.hideMenu();
SSE.getController('EditContainer').showModal();
// SSE.getController('EditCell').getView('EditCell');
break;
case 'merge':
if (me.api.asc_mergeCellsDataLost(Asc.c_oAscMergeOptions.Merge)) {
_.defer(function () {
uiApp.confirm(me.warnMergeLostData, undefined, function(){
me.api.asc_mergeCells(Asc.c_oAscMergeOptions.Merge);
});
});
} else {
me.api.asc_mergeCells(Asc.c_oAscMergeOptions.Merge);
}
break;
case 'unmerge':
me.api.asc_mergeCells(Asc.c_oAscMergeOptions.None);
break;
case 'hide':
me.api[info.asc_getSelectionType() == Asc.c_oAscSelectionType.RangeRow ? 'asc_hideRows' : 'asc_hideColumns']();
break;
case 'show':
me.api[info.asc_getSelectionType() == Asc.c_oAscSelectionType.RangeRow ? 'asc_showRows' : 'asc_showColumns']();
break;
case 'addlink':
me.view.hideMenu();
SSE.getController('AddContainer').showModal({
panel: 'hyperlink'
});
break;
case 'openlink':
var linkinfo = info.asc_getHyperlink();
if ( linkinfo.asc_getType() == Asc.c_oAscHyperlinkType.RangeLink ) {
var nameSheet = linkinfo.asc_getSheet();
var curActiveSheet = this.api.asc_getActiveWorksheetIndex();
me.api.asc_setWorksheetRange(linkinfo);
SSE.getController('Statusbar').onLinkWorksheetRange(nameSheet, curActiveSheet);
} else {
var url = linkinfo.asc_getHyperlinkUrl().replace(/\s/g, "%20");
me.api.asc_getUrlType(url) > 0 && openLink(url);
}
break;
case 'freezePanes':
me.api.asc_freezePane();
break;
case 'viewcomment':
me.view.hideMenu();
SSE.getController('Common.Controllers.Collaboration').showCommentModal();
break;
case 'addcomment':
me.view.hideMenu();
SSE.getController('AddContainer').showModal();
SSE.getController('AddOther').getView('AddOther').showPageComment(false);
}
if ('showActionSheet' == event && _actionSheets.length > 0) {
_.delay(function () {
_.each(_actionSheets, function (action) {
action.text = action.caption
action.onClick = function () {
me.onContextMenuClick(null, action.event)
}
});
uiApp.actions([_actionSheets, [
{
text: me.sheetCancel,
bold: true
}
]]);
}, 100);
}
me.view.hideMenu();
},
// API Handlers
onEditorResize: function(cmp) {
// Hide context menu
},
onApiShowPopMenu: function(posX, posY) {
if (this.isDisconnected) return;
if ($('.popover.settings, .popup.settings, .picker-modal.settings, .modal-in, .actions-modal').length > 0) {
return;
}
var me = this,
items;
items = me._initMenu(me.api.asc_getCellInfo());
me.view.showMenu(items, posX, posY);
},
onApiHidePopMenu: function() {
this.view.hideMenu();
},
// Internal
_initMenu: function (cellinfo) {
var me = this,
arrItems = [],
arrItemsIcon = [];
_actionSheets.length = 0;
var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu;
var iscelllocked = cellinfo.asc_getLocked(),
seltype = cellinfo.asc_getSelectionType(),
xfs = cellinfo.asc_getXfs();
switch (seltype) {
case Asc.c_oAscSelectionType.RangeCells: iscellmenu = true; break;
case Asc.c_oAscSelectionType.RangeRow: isrowmenu = true; break;
case Asc.c_oAscSelectionType.RangeCol: iscolmenu = true; break;
case Asc.c_oAscSelectionType.RangeMax: isallmenu = true; break;
case Asc.c_oAscSelectionType.RangeImage: isimagemenu = true; break;
case Asc.c_oAscSelectionType.RangeShape: isshapemenu = true; break;
case Asc.c_oAscSelectionType.RangeChart: ischartmenu = true; break;
case Asc.c_oAscSelectionType.RangeChartText: istextchartmenu = true; break;
case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = true; break;
}
if (!_isEdit) {
if (iscellmenu || istextchartmenu || istextshapemenu) {
arrItemsIcon = [{
caption: me.menuCopy,
event: 'copy',
icon: 'icon-copy'
}];
}
if (iscellmenu && cellinfo.asc_getHyperlink()) {
arrItems.push({
caption: me.menuOpenLink,
event: 'openlink'
});
}
if (_canViewComments && _isComments) {
arrItems.push({
caption: me.menuViewComment,
event: 'viewcomment'
});
}
} else {
if (!iscelllocked && (isimagemenu || isshapemenu || ischartmenu || istextshapemenu || istextchartmenu)) {
this.api.asc_getGraphicObjectProps().every(function (object) {
if (object.asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) {
iscelllocked = object.asc_getObjectValue().asc_getLocked();
}
return !iscelllocked;
});
}
if (iscelllocked || this.api.isCellEdited) {
arrItemsIcon = [{
caption: me.menuCopy,
event: 'copy',
icon: 'icon-copy'
}];
} else {
var arrItemsIcon = [{
caption: me.menuCut,
event: 'cut',
icon: 'icon-cut'
}, {
caption: me.menuCopy,
event: 'copy',
icon: 'icon-copy'
}, {
caption: me.menuPaste,
event: 'paste',
icon: 'icon-paste'
}];
arrItems.push({
caption: me.menuDelete,
event: 'del'
});
// isTableLocked = cellinfo.asc_getLockedTable()===true;
if (isimagemenu || isshapemenu || ischartmenu ||
istextshapemenu || istextchartmenu) {
arrItems.push({
caption: me.menuEdit,
event: 'edit'
});
} else {
if (iscolmenu || isrowmenu) {
arrItems.push({
caption: me.menuHide,
event: 'hide'
}, {
caption: me.menuShow,
event: 'show'
});
} else if (iscellmenu) {
!iscelllocked &&
arrItems.push({
caption: me.menuCell,
event: 'edit'
});
(cellinfo.asc_getMerge() == Asc.c_oAscMergeOptions.None) &&
arrItems.push({
caption: me.menuMerge,
event: 'merge'
});
(cellinfo.asc_getMerge() == Asc.c_oAscMergeOptions.Merge) &&
arrItems.push({
caption: me.menuUnmerge,
event: 'unmerge'
});
arrItems.push(
xfs.asc_getWrapText() ?
{
caption: me.menuUnwrap,
event: 'unwrap'
} :
{
caption: me.menuWrap,
event: 'wrap'
});
if (cellinfo.asc_getHyperlink() && !cellinfo.asc_getMultiselect()) {
arrItems.push({
caption: me.menuOpenLink,
event: 'openlink'
});
} else if (!cellinfo.asc_getHyperlink() && !cellinfo.asc_getMultiselect() &&
!cellinfo.asc_getLockText() && !!cellinfo.asc_getText()) {
arrItems.push({
caption: me.menuAddLink,
event: 'addlink'
});
}
}
arrItems.push({
caption: this.api.asc_getSheetViewSettings().asc_getIsFreezePane() ? me.menuUnfreezePanes : me.menuFreezePanes,
event: 'freezePanes'
});
}
if (_canViewComments) {
if (_isComments) {
arrItems.push({
caption: me.menuViewComment,
event: 'viewcomment'
});
} else if (iscellmenu) {
arrItems.push({
caption: me.menuAddComment,
event: 'addcomment'
});
}
}
}
if (Common.SharedSettings.get('phone') && arrItems.length > 2) {
_actionSheets = arrItems.slice(2);
arrItems = arrItems.slice(0, 2);
arrItems.push({
caption: me.menuMore,
event: 'showActionSheet'
});
}
}
var menuItems = {itemsIcon: arrItemsIcon, items: arrItems};
return menuItems;
},
onCoAuthoringDisconnect: function() {
this.isDisconnected = true;
},
onApiFilterOptions: function(config) {
if(_isEdit) {
var rect = config.asc_getCellCoord(),
posX = rect.asc_getX() + rect.asc_getWidth() - 9,
posY = rect.asc_getY() + rect.asc_getHeight() - 9;
SSE.getController('FilterOptions').showModal(posX,posY);
}
},
warnMergeLostData: 'Operation can destroy data in the selected cells.<br>Continue?',
menuCopy: 'Copy',
menuCut: 'Cut',
menuPaste: 'Paste',
menuDelete: 'Delete',
menuAddLink: 'Add Link',
menuOpenLink: 'Open Link',
menuWrap: 'Wrap',
menuUnwrap: 'Unwrap',
menuMerge: 'Merge',
menuUnmerge: 'Unmerge',
menuShow: 'Show',
menuHide: 'Hide',
menuEdit: 'Edit',
menuCell: 'Cell',
menuMore: 'More',
sheetCancel: 'Cancel',
menuFreezePanes: 'Freeze Panes',
menuUnfreezePanes: 'Unfreeze Panes',
menuViewComment: 'View Comment',
menuAddComment: 'Add Comment',
textCopyCutPasteActions: 'Copy, Cut and Paste Actions',
errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only.',
textDoNotShowAgain: 'Don\'t show again'
}
})(), SSE.Controllers.DocumentHolder || {}))
});

View file

@ -1,126 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* Editor.js
*
* Created by Maxim Kadushkin on 11/15/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/Editor'
], function (core) {
'use strict';
SSE.Controllers.Editor = Backbone.Controller.extend((function() {
// private
function isPhone() {
var ua = navigator.userAgent,
isMobile = /Mobile(\/|\s|;)/.test(ua);
return /(iPhone|iPod)/.test(ua) ||
(!/(Silk)/.test(ua) && (/(Android)/.test(ua) && (/(Android 2)/.test(ua) || isMobile))) ||
(/(BlackBerry|BB)/.test(ua) && isMobile) ||
/(Windows Phone)/.test(ua);
}
function isTablet() {
var ua = navigator.userAgent;
return !isPhone(ua) && (/iPad/.test(ua) || /Android/.test(ua) || /(RIM Tablet OS)/.test(ua) ||
(/MSIE 10/.test(ua) && /; Touch/.test(ua)));
}
function isSailfish() {
var ua = navigator.userAgent;
return /Sailfish/.test(ua) || /Jolla/.test(ua);
}
return {
// Specifying a EditorController model
models: [],
// Specifying a collection of out EditorView
collections: [],
// Specifying application views
views: [
'Editor' // is main application layout
],
// When controller is created let's setup view event listeners
initialize: function() {
// This most important part when we will tell our controller what events should be handled
},
setApi: function(api) {
this.api = api;
},
// When our application is ready, lets get started
onLaunch: function() {
// Device detection
var phone = isPhone();
// console.debug('Layout profile:', phone ? 'Phone' : 'Tablet');
if ( isSailfish() ) {
Common.SharedSettings.set('sailfish', true);
$('html').addClass('sailfish');
}
Common.SharedSettings.set('android', Framework7.prototype.device.android);
Common.SharedSettings.set('phone', phone);
$('html').addClass(phone ? 'phone' : 'tablet');
// Create and render main view
this.editorView = this.createView('Editor').render();
$$(window).on('resize', _.bind(this.onWindowResize, this));
Common.NotificationCenter.on('layout:changed', function(source, args) {
if ( source == 'navbar' ) {
this.editorView.$el.find('.page.editor')[args.hidden?'addClass':'removeClass']('no-padding');
}
}.bind(this));
},
onWindowResize: function(e) {
this.api && this.api.asc_Resize();
}
}
})());
});

View file

@ -1,381 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* FilterOptions.js
* Spreadsheet Editor
*
* Created by Julia Svinareva on 13/6/19
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'jquery',
'underscore',
'backbone',
'spreadsheeteditor/mobile/app/view/FilterOptions'
], function (core, $, _, Backbone) {
'use strict';
SSE.Controllers.FilterOptions = Backbone.Controller.extend(_.extend((function() {
// Private
var rootView,
dataFilter,
indChecked = [],
modalView;
return {
models: [],
collections: [],
views: [
'FilterOptions'
],
initialize: function() {
var me = this;
me.addListeners({
'FilterOptions': {
'page:show' : me.onPageShow
}
});
},
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onSetAFDialog', _.bind(this.setSettings, this));
},
onLaunch: function () {
this.createView('FilterOptions').render();
},
setMode: function(mode) {
this.appConfig = mode;
},
showModal: function(posX,posY) {
var me = this,
isAndroid = Framework7.prototype.device.android === true,
mainView = SSE.getController('Editor').getView('Editor').f7View;
uiApp.closeModal();
if (Common.SharedSettings.get('phone')) {
modalView = $$(uiApp.pickerModal(
'<div class="picker-modal settings container-filter">' +
'<div class="view filter-root-view navbar-through">' +
this.getView('FilterOptions').rootLayout() +
'</div>' +
'</div>'
)).on('opened', function () {
if (_.isFunction(me.api.asc_OnShowContextMenu)) {
me.api.asc_OnShowContextMenu()
}
}).on('close', function (e) {
mainView.showNavbar();
me.isValidChecked();
}).on('closed', function () {
if (_.isFunction(me.api.asc_OnHideContextMenu)) {
me.api.asc_OnHideContextMenu()
}
});
mainView.hideNavbar();
} else {
var popoverHTML =
'<div class="popover settings container-filter">' +
'<div class="popover-angle"></div>' +
'<div class="popover-inner">' +
'<div class="content-block">' +
'<div class="view popover-view filter-root-view navbar-through">' +
this.getView('FilterOptions').rootLayout() +
'</div>' +
'</div>' +
'</div>' +
'</div>';
var $target = $('#context-menu-target')
.css({left: posX, top: Math.max(0, posY)});
modalView = uiApp.popover(popoverHTML, $target);
$$(modalView).on('close', function (e) {
me.isValidChecked();
});
if (Common.SharedSettings.get('android')) {
Common.Utils.androidMenuTop($(modalView), $target);
}
}
if (Framework7.prototype.device.android === true) {
$$('.view.filter-root-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed');
$$('.view.filter-root-view .navbar').prependTo('.view.filter-root-view > .pages > .page');
}
rootView = uiApp.addView('.filter-root-view', {
dynamicNavbar: true,
domCache: true
});
Common.NotificationCenter.trigger('filtercontainer:show');
this.onPageShow(this.getView('FilterOptions'));
SSE.getController('Toolbar').getView('Toolbar').hideSearch();
},
isValidChecked: function () {
var me = this,
isValid = true;
if (indChecked.length === indChecked.filter(function (item) {return item === false;}).length) {
isValid = false;
}
if(!isValid) {
uiApp.modal({
title : me.textErrorTitle,
text : me.textErrorMsg,
buttons: [
{
text: 'OK',
}
]
});
}
},
rootView : function() {
return rootView;
},
onPageShow: function(view, pageId) {
var me = this;
var $clearFilter = $("#btn-clear-filter"),
$deleteFilter = $("#btn-delete-filter");
this.setClearDisable();
$clearFilter.single('click', _.bind(me.onClickClearFilter, me));
$deleteFilter.single('click', _.bind(me.onClickDeleteFilter, me));
$('.sortdown').single('click', _.bind(me.onClickSort, me, 'down'));
$('.sortup').single('click', _.bind(me.onClickSort, me, 'up'));
this.setDataFilterCells();
},
setSettings: function(config) {
dataFilter = config;
},
hideModal: function() {
if (modalView) {
uiApp.closeModal(modalView);
}
},
onClickSort: function(type) {
this.api.asc_sortColFilter(type == 'down' ? Asc.c_oAscSortOptions.Ascending : Asc.c_oAscSortOptions.Descending, '', dataFilter.asc_getCellId(), dataFilter.asc_getDisplayName(),true);
},
onClickClearFilter: function () {
var me = this;
if (me.api)
me.api.asc_clearFilter();
for(var i=0; i<indChecked.length; i++) {
indChecked[i] = true;
}
setTimeout(function () {
me.updateCell();
},20);
$('[name="filter-cell"]').prop('checked', true);
$('[name="filter-cell-all"]').prop('checked', true);
},
onClickDeleteFilter: function () {
var formatTableInfo = this.api.asc_getCellInfo().asc_getFormatTableInfo();
var tablename = (formatTableInfo) ? formatTableInfo.asc_getTableName() : undefined;
if (this.api)
this.api.asc_changeAutoFilter(tablename, Asc.c_oAscChangeFilterOptions.filter, false);
this.hideModal();
},
setClearDisable: function() {
var $clearFilter = $("#btn-clear-filter");
var arr = dataFilter.asc_getValues();
var lenCheck = arr.filter(function (item) {
return item.visible == true;
}).length;
if (lenCheck == arr.length) {
$clearFilter.addClass("disabled");
} else {
$clearFilter.removeClass("disabled");
}
},
setDataFilterCells: function() {
function isNumeric(value) {
return !isNaN(parseFloat(value)) && isFinite(value);
}
var me = this,
isnumber, value,
index = 0, throughIndex = 0,
selectedCells = 0,
arrCells = [],
idxs = [];
dataFilter.asc_getValues().forEach(function (item) {
value = item.asc_getText();
isnumber = isNumeric(value);
if (idxs[throughIndex]==undefined) {
idxs[throughIndex] = item.asc_getVisible();
}
arrCells.push({
id : index++,
selected : false,
allowSelected : true,
cellvalue : value ? value : me.textEmptyItem,
value : isnumber ? value : (value.length > 0 ? value: me.textEmptyItem),
intval : isnumber ? parseFloat(value) : undefined,
strval : !isnumber ? value : '',
groupid : '1',
check : idxs[throughIndex],
throughIndex : throughIndex
});
if (idxs[throughIndex]) selectedCells++;
++throughIndex;
});
indChecked = idxs;
if(arrCells.length > 0) {
var templateItemCell = _.template([
'<% _.each(cells, function (cell) { %>',
'<li>' +
'<label class="label-radio item-content">' +
'<input id="<%= cell.throughIndex %>" type="checkbox" name="filter-cell" value="<%= cell.cellvalue%>"/>' +
'<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>' +
'<div class="item-inner">' +
'<div class="item-title"><%= cell.cellvalue%></div>' +
'</div>' +
'</label>' +
'</li>',
'<% }); %>'].join(''));
var templateListCells = _.template(
'<ul>' +
'<li>' +
'<label class="label-radio item-content">' +
'<input type="checkbox" name="filter-cell-all" />' +
'<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>' +
'<div class="item-inner">' +
'<div class="item-title"><%= textSelectAll %></div>' +
'</div>' +
'</label>' +
'</li>' +
templateItemCell({cells: arrCells, android: Framework7.prototype.device.android}) +
'</ul>');
$('#list-cells').html(templateListCells({textSelectAll: this.textSelectAll, android: Framework7.prototype.device.android}));
var $filterCell = $('[name="filter-cell"]'),
$filterCellAll = $('[name="filter-cell-all"]');
$filterCell.single('change', _.bind(me.updateCell, me));
$filterCellAll.single('change', _.bind(me.updateCell, me));
if(selectedCells == arrCells.length) {
$filterCellAll.prop('checked', true);
$filterCell.prop('checked', true);
} else {
for(var i=0; i<arrCells.length; i++) {
$filterCell.eq(i).prop('checked', idxs[i]);
}
}
}
},
updateCell: function(e) {
var me = this;
// Checkbox change
var $filterCell = $('[name="filter-cell"]'),
$filterCellAll = $('[name="filter-cell-all"]'),
filterCellChecked = $('[name="filter-cell"]:checked').length,
filterCellCheckedAll = $('[name="filter-cell"]').length,
isValid = true;
if(e) {
if (e.target.name == "filter-cell") {
if (filterCellChecked < filterCellCheckedAll) {
$filterCellAll.prop('checked', false);
} else if (filterCellChecked === filterCellCheckedAll) {
$filterCellAll.prop('checked', true);
}
indChecked[e.target.id] = e.target.checked;
}
// Select All change
if (e.target.name == "filter-cell-all") {
var checkAll = false;
if (e.target.checked) {
$filterCell.prop('checked', true);
checkAll = true;
} else {
$filterCell.prop('checked', false);
checkAll = false;
isValid = false;
filterCellChecked = 0;
}
for (var i = 0; i < indChecked.length; i++) {
indChecked[i] = checkAll;
}
}
}
if(filterCellChecked === 0) {
isValid = false;
} else {
isValid = true;
}
if(isValid) {
var arrCells = dataFilter.asc_getValues();
arrCells.forEach(function (item, index) {
item.asc_setVisible(indChecked[index]);
});
dataFilter.asc_getFilterObj().asc_setType(Asc.c_oAscAutoFilterTypes.Filters);
this.api.asc_applyAutoFilter(dataFilter);
}
me.setClearDisable();
},
textEmptyItem: '{Blanks}',
textSelectAll: 'Select All',
textErrorTitle: 'Warning',
textErrorMsg: 'You must choose at least one value'
}
})(), SSE.Controllers.FilterOptions || {}))
});

File diff suppressed because it is too large Load diff

View file

@ -1,436 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* Search.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/5/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'jquery',
'underscore',
'backbone',
'spreadsheeteditor/mobile/app/view/Search'
], function (core, $, _, Backbone) {
'use strict';
SSE.Controllers.Search = Backbone.Controller.extend(_.extend((function() {
// private
var _isShow = false,
_startPoint = {};
var pointerEventToXY = function(e){
var out = {x:0, y:0};
if(e.type == 'touchstart' || e.type == 'touchend'){
var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
out.x = touch.pageX;
out.y = touch.pageY;
} else if (e.type == 'mousedown' || e.type == 'mouseup') {
out.x = e.pageX;
out.y = e.pageY;
}
return out;
};
function iOSVersion() {
var ua = navigator.userAgent;
var m;
return (m = /(iPad|iPhone|iphone).*?(OS |os |OS\_)(\d+((_|\.)\d)?((_|\.)\d)?)/.exec(ua)) ? parseFloat(m[3]) : 0;
}
return {
models: [],
collections: [],
views: [
'Search'
],
initialize: function() {
this.addListeners({
'Search': {
'searchbar:show' : this.onSearchbarShow,
'searchbar:hide' : this.onSearchbarHide,
'searchbar:render' : this.onSearchbarRender,
'searchbar:showsettings': this.onSearchbarSettings,
'search:highlight' : this.onSearchHighlight
}
});
},
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onRenameCellTextEnd', _.bind(this.onReplaceNext, this));
},
setMode: function (mode) {
this.getView('Search').setMode(mode);
},
onLaunch: function() {
var me = this;
me.createView('Search').render();
if (iOSVersion()<13) {
$('#editor_sdk').single('mousedown touchstart', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('mouseup touchend', _.bind(me.onEditorTouchEnd, me));
} else {
$('#editor_sdk').single('pointerdown', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('pointerup', _.bind(me.onEditorTouchEnd, me));
}
},
showSearch: function () {
this.getView('Search').showSearch();
},
hideSearch: function () {
this.getView('Search').hideSearch();
},
// Handlers
onEditorTouchStart: function (e) {
_startPoint = pointerEventToXY(e);
},
onEditorTouchEnd: function (e) {
var _endPoint = pointerEventToXY(e);
if (_isShow) {
var distance = (_startPoint.x===undefined || _startPoint.y===undefined) ? 0 :
Math.sqrt((_endPoint.x -= _startPoint.x) * _endPoint.x + (_endPoint.y -= _startPoint.y) * _endPoint.y);
if (distance < 1) {
this.hideSearch();
}
}
},
onSearchbarRender: function(bar) {
var me = this,
searchString = Common.SharedSettings.get('search-search') || '',
replaceString = Common.SharedSettings.get('search-replace')|| '';
me.searchBar = uiApp.searchbar('.searchbar.document .searchbar.search', {
customSearch: true,
onSearch : _.bind(me.onSearchChange, me),
onEnable : _.bind(me.onSearchEnable, me),
onClear : _.bind(me.onSearchClear, me)
});
me.replaceBar = uiApp.searchbar('.searchbar.document .searchbar.replace', {
customSearch: true,
onSearch : _.bind(me.onReplaceChange, me),
onEnable : _.bind(me.onReplaceEnable, me),
onClear : _.bind(me.onReplaceClear, me)
});
me.searchPrev = $('.searchbar.document .prev');
me.searchNext = $('.searchbar.document .next');
me.replaceBtn = $('.searchbar.document .link.replace');
me.searchPrev.single('click', _.bind(me.onSearchPrev, me));
me.searchNext.single('click', _.bind(me.onSearchNext, me));
me.replaceBtn.single('click', _.bind(me.onReplace, me));
$$('.searchbar.document .link.replace').on('taphold', _.bind(me.onReplaceAll, me));
me.searchBar.search(searchString);
me.replaceBar.search(replaceString);
},
onSearchbarSettings: function (view) {
var me = this,
isReplace = Common.SharedSettings.get('search-is-replace') === true,
searchIn = Common.SharedSettings.get('search-in') === 'sheet' ? 'sheet' : 'workbook',
isMatchCase = Common.SharedSettings.get('search-match-case') === true,
isMatchCell = Common.SharedSettings.get('search-match-cell') === true,
isHighlightRes = Common.SharedSettings.get('search-highlight-res') === true,
searchBy = Common.SharedSettings.get('search-by') === 'rows' ? 'rows' : 'columns',
lookIn = Common.SharedSettings.get('look-in') === 'formulas' ? 'formulas' : 'values',
$pageSettings = $('.page[data-page=search-settings]'),
$inputType = $pageSettings.find('input[name=search-type]'),
$inputSearchIn = $pageSettings.find('input[name=search-in]'),
$inputSearchBy = $pageSettings.find('input[name=search-by]'),
$inputMatchCase = $pageSettings.find('#search-match-case input:checkbox'),
$inputMatchCell = $pageSettings.find('#search-match-cell input:checkbox'),
$inputHighlightResults = $pageSettings.find('#search-highlight-res input:checkbox'),
$inputLookIn = $pageSettings.find('input[name=look-in]');
$inputType.val([isReplace ? 'replace' : 'search']);
$inputSearchIn.val([searchIn]);
$inputMatchCase.prop('checked', isMatchCase);
$inputMatchCell.prop('checked', isMatchCell);
$inputHighlightResults.prop('checked', isHighlightRes);
$inputSearchBy.val([searchBy]);
$inputLookIn.val([lookIn]);
// init events
$inputType.single('change', _.bind(me.onTypeChange, me));
$inputSearchIn.single('change', _.bind(me.onSearchInChange, me));
$inputSearchBy.single('change', _.bind(me.onSearchByChange, me));
$inputLookIn.single('change', _.bind(me.onLookInChange, me));
$inputMatchCase.single('change', _.bind(me.onMatchCaseClick, me));
$inputMatchCell.single('change', _.bind(me.onMatchCellClick, me));
$inputHighlightResults.single('change', _.bind(me.onHighlightResultsClick, me));
if (isReplace) {
Common.SharedSettings.set('look-in', 'formulas');
$('input[name=look-in]').val(['formulas']);
$('input[name=look-in]:eq(1)').parent().addClass('disabled');
}
},
onSearchbarShow: function(bar) {
_isShow = true;
// this.api.asc_selectSearchingResults(Common.SharedSettings.get('search-highlight'));
},
onSearchEnable: function (bar) {
this.replaceBar.container.removeClass('searchbar-active');
},
onSearchbarHide: function(bar) {
_isShow = false;
// this.api.asc_selectSearchingResults(false);
},
onSearchChange: function(search) {
var me = this,
isEmpty = (search.query.trim().length < 1);
Common.SharedSettings.set('search-search', search.query);
_.each([me.searchPrev, me.searchNext, me.replaceBtn], function(btn) {
btn.toggleClass('disabled', isEmpty);
});
},
onSearchClear: function(search) {
Common.SharedSettings.set('search-search', '');
// window.focus();
// document.activeElement.blur();
},
onReplaceChange: function(replace) {
var me = this,
isEmpty = (replace.query.trim().length < 1);
Common.SharedSettings.set('search-replace', replace.query);
},
onReplaceEnable: function (bar) {
this.searchBar.container.removeClass('searchbar-active');
},
onReplaceClear: function(replace) {
Common.SharedSettings.set('search-replace', '');
},
onSearchPrev: function(btn) {
this.onQuerySearch(this.searchBar.query, 'back');
},
onSearchNext: function(btn) {
this.onQuerySearch(this.searchBar.query, 'next');
},
onReplace: function (btn) {
var me = this;
me.onQueryReplace(me.searchBar.query, me.replaceBar.query ? me.replaceBar.query : "");
},
onReplaceNext: function() {
this.onQuerySearch(this.searchBar.query, 'next');
},
onReplaceAll: function (e) {
var me = this,
popover = [
'<div class="popover" style="width: auto;">',
'<div class="popover-inner">',
'<div class="list-block">',
'<ul>',
'<li><a href="#" id="replace-all" class="item-link list-button">{0}</li>'.format(me.textReplaceAll),
'</ul>',
'</div>',
'</div>',
'</div>'
].join('');
popover = uiApp.popover(popover, $$(e.currentTarget));
$('#replace-all').single('click', _.bind(function () {
me.onQueryReplaceAll(this.searchBar.query, this.replaceBar.query);
uiApp.closeModal(popover);
}, me))
},
onQuerySearch: function(query, direction) {
var matchCase = Common.SharedSettings.get('search-match-case') || false,
matchCell = Common.SharedSettings.get('search-match-cell') || false,
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
searchBy = Common.SharedSettings.get('search-by') === 'rows',
lookIn = Common.SharedSettings.get('look-in') === 'formulas';
if (query && query.length) {
var options = new Asc.asc_CFindOptions();
options.asc_setFindWhat(query);
options.asc_setScanForward(direction != 'back');
options.asc_setIsMatchCase(matchCase);
options.asc_setIsWholeCell(matchCell);
options.asc_setScanOnOnlySheet(lookInSheet);
options.asc_setScanByRows(searchBy);
options.asc_setLookIn(lookIn ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
if (!this.api.asc_findText(options)) {
var me = this;
uiApp.alert(
'',
me.textNoTextFound,
function () {
me.searchBar.input.focus();
}
);
}
}
},
onQueryReplace: function(search, replace) {
var matchCase = Common.SharedSettings.get('search-match-case') || false,
matchCell = Common.SharedSettings.get('search-match-cell') || false,
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
searchBy = Common.SharedSettings.get('search-by') === 'rows',
lookIn = Common.SharedSettings.get('look-in') === 'formulas';
if (search && search.length) {
this.api.isReplaceAll = false;
var options = new Asc.asc_CFindOptions();
options.asc_setFindWhat(search);
options.asc_setReplaceWith(replace);
options.asc_setIsMatchCase(matchCase);
options.asc_setIsWholeCell(matchCell);
options.asc_setScanOnOnlySheet(lookInSheet);
options.asc_setScanByRows(searchBy);
options.asc_setLookIn(lookIn ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
options.asc_setIsReplaceAll(false);
this.api.asc_replaceText(options);
}
},
onQueryReplaceAll: function(search, replace) {
var matchCase = Common.SharedSettings.get('search-match-case') || false,
matchCell = Common.SharedSettings.get('search-match-cell') || false,
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
searchBy = Common.SharedSettings.get('search-by') === 'rows',
lookIn = Common.SharedSettings.get('look-in') === 'formulas';
if (search && search.length) {
this.api.isReplaceAll = true;
var options = new Asc.asc_CFindOptions();
options.asc_setFindWhat(search);
options.asc_setReplaceWith(replace);
options.asc_setIsMatchCase(matchCase);
options.asc_setIsWholeCell(matchCell);
options.asc_setScanOnOnlySheet(lookInSheet);
options.asc_setScanByRows(searchBy);
options.asc_setLookIn(lookIn ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
options.asc_setIsReplaceAll(true);
this.api.asc_replaceText(options);
}
},
onTypeChange: function (e) {
var $target = $(e.currentTarget),
isReplace = ($target.val() === 'replace');
Common.SharedSettings.set('search-is-replace', isReplace);
$('.searchbar.document').toggleClass('replace', isReplace);
if (isReplace) {
Common.SharedSettings.set('look-in', 'formulas');
$('input[name=look-in]').val(['formulas']);
$('input[name=look-in]:eq(1)').parent().addClass('disabled');
} else {
$('input[name=look-in]:eq(1)').parent().removeClass('disabled');
}
},
onSearchInChange: function (e) {
Common.SharedSettings.set('search-in', $(e.currentTarget).val());
},
onSearchByChange: function(e) {
Common.SharedSettings.set('search-by', $(e.currentTarget).val());
},
onLookInChange: function(e) {
Common.SharedSettings.set('look-in', $(e.currentTarget).val());
},
onMatchCaseClick: function (e) {
Common.SharedSettings.set('search-match-case', $(e.currentTarget).is(':checked'));
},
onMatchCellClick: function (e) {
Common.SharedSettings.set('search-match-cell', $(e.currentTarget).is(':checked'));
},
onHighlightResultsClick: function (e) {
var value = $(e.currentTarget).is(':checked');
Common.SharedSettings.set('search-highlight-res', value);
this.api.asc_selectSearchingResults(value);
},
onSearchHighlight: function(w, highlight) {
this.api.asc_selectSearchingResults(highlight);
},
// API handlers
textNoTextFound: 'Text not found',
textReplaceAll: 'Replace All'
}
})(), SSE.Controllers.Search || {}))
});

View file

@ -1,716 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* Settings.js
*
* Created by Maxim Kadushkin on 12/05/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/Settings'
], function (core) {
'use strict';
SSE.Controllers.Settings = Backbone.Controller.extend(_.extend((function() {
// private
var rootView,
inProgress,
infoObj,
modalView,
_licInfo,
_pageSizesIndex = 0,
_pageSizesCurrent = [0, 0],
txtCm = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.cm),
_pageSizes = [
{ caption: 'US Letter', subtitle: Common.Utils.String.format('21,59{0} x 27,94{0}', txtCm), value: [215.9, 279.4] },
{ caption: 'US Legal', subtitle: Common.Utils.String.format('21,59{0} x 35,56{0}', txtCm), value: [215.9, 355.6] },
{ caption: 'A4', subtitle: Common.Utils.String.format('21{0} x 29,7{0}', txtCm), value: [210, 297] },
{ caption: 'A5', subtitle: Common.Utils.String.format('14,8{0} x 21{0}', txtCm), value: [148, 210] },
{ caption: 'B5', subtitle: Common.Utils.String.format('17,6{0} x 25{0}', txtCm), value: [176, 250] },
{ caption: 'Envelope #10', subtitle: Common.Utils.String.format('10,48{0} x 24,13{0}', txtCm), value: [104.8, 241.3] },
{ caption: 'Envelope DL', subtitle: Common.Utils.String.format('11{0} x 22{0}', txtCm), value: [110, 220] },
{ caption: 'Tabloid', subtitle: Common.Utils.String.format('27,94{0} x 43,18{0}', txtCm), value: [279.4, 431.8] },
{ caption: 'A3', subtitle: Common.Utils.String.format('29,7{0} x 42{0}', txtCm), value: [297, 420] },
{ caption: 'Tabloid Oversize', subtitle: Common.Utils.String.format('30,48{0} x 45,71{0}', txtCm), value: [304.8, 457.1] },
{ caption: 'ROC 16K', subtitle: Common.Utils.String.format('19,68{0} x 27,3{0}', txtCm), value: [196.8, 273] },
{ caption: 'Envelope Choukei 3', subtitle: Common.Utils.String.format('11,99{0} x 23,49{0}', txtCm), value: [119.9, 234.9] },
{ caption: 'Super B/A3', subtitle: Common.Utils.String.format('33,02{0} x 48,25{0}', txtCm), value: [330.2, 482.5] },
{ caption: 'A0', subtitle: Common.Utils.String.format('84,1{0} x 118,9{0}', txtCm), value: [841, 1189] },
{ caption: 'A1', subtitle: Common.Utils.String.format('59,4{0} x 84,1{0}', txtCm), value: [594, 841] },
{ caption: 'A2', subtitle: Common.Utils.String.format('42{0} x 59,4{0}', txtCm), value: [420, 594] },
{ caption: 'A6', subtitle: Common.Utils.String.format('10,5{0} x 14,8{0}', txtCm), value: [105, 148] }
],
_metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()),
_dataLang = [
{ value: 'en', displayValue: 'English', exampleValue: ' SUM; MIN; MAX; COUNT' },
{ value: 'de', displayValue: 'Deutsch', exampleValue: ' SUMME; MIN; MAX; ANZAHL' },
{ value: 'es', displayValue: 'Spanish', exampleValue: ' SUMA; MIN; MAX; CALCULAR' },
{ value: 'fr', displayValue: 'French', exampleValue: ' SOMME; MIN; MAX; NB' },
{ value: 'it', displayValue: 'Italian', exampleValue: ' SOMMA; MIN; MAX; CONTA.NUMERI' },
{ value: 'ru', displayValue: 'Russian', exampleValue: ' СУММ; МИН; МАКС; СЧЁТ' },
{ value: 'pl', displayValue: 'Polish', exampleValue: ' SUMA; MIN; MAX; ILE.LICZB' }
],
_indexLang = 0,
_regDataCode = [{ value: 0x042C }, { value: 0x0402 }, { value: 0x0405 }, { value: 0x0407 }, {value: 0x0807}, { value: 0x0408 }, { value: 0x0C09 }, { value: 0x0809 }, { value: 0x0409 }, { value: 0x0C0A }, { value: 0x080A },
{ value: 0x040B }, { value: 0x040C }, { value: 0x0410 }, { value: 0x0411 }, { value: 0x0412 }, { value: 0x0426 }, { value: 0x0413 }, { value: 0x0415 }, { value: 0x0416 },
{ value: 0x0816 }, { value: 0x0419 }, { value: 0x041B }, { value: 0x0424 }, { value: 0x081D }, { value: 0x041D }, { value: 0x041F }, { value: 0x0422 }, { value: 0x042A }, { value: 0x0804 }],
_regdata = [],
_lang;
var mm2Cm = function(mm) {
return parseFloat((mm/10.).toFixed(2));
};
return {
models: [],
collections: [],
views: [
'Settings'
],
initialize: function () {
Common.NotificationCenter.on('settingscontainer:show', _.bind(this.initEvents, this));
this.addListeners({
'Settings': {
'page:show' : this.onPageShow
, 'settings:showhelp': function(e) {
var url = '{{HELP_URL}}';
if (url.charAt(url.length-1) !== '/') {
url += '/';
}
if (Common.SharedSettings.get('sailfish')) {
url+='mobile-applications/documents/mobile-web-editors/android/index.aspx';
} else if (Common.SharedSettings.get('android')) {
url+='mobile-applications/documents/mobile-web-editors/android/index.aspx';
} else {
url+='mobile-applications/documents/mobile-web-editors/ios/index.aspx';
}
window.open(url, "_blank");
this.hideModal();
}
}
});
this.localMarginProps = null;
_regDataCode.forEach(function(item) {
var langinfo = Common.util.LanguageInfo.getLocalLanguageName(item.value);
_regdata.push({code: item.value, displayName: langinfo[1], langName: langinfo[0]});
});
},
setApi: function (api) {
this.api = api;
this.api.asc_registerCallback('asc_onSendThemeColorSchemes', _.bind(this.onSendThemeColorSchemes, this));
},
onLaunch: function () {
this.createView('Settings').render();
},
setMode: function (mode) {
this.getView('Settings').setMode(mode);
if (mode.canBranding)
_licInfo = mode.customization;
_lang = mode.lang;
},
initEvents: function () {
},
rootView : function() {
return rootView;
},
showModal: function() {
uiApp.closeModal();
if (Common.SharedSettings.get('phone')) {
modalView = uiApp.popup(
'<div class="popup settings container-settings">' +
'<div class="content-block">' +
'<div class="view settings-root-view navbar-through">' +
this.getView('Settings').rootLayout() +
'</div>' +
'</div>' +
'</div>'
);
} else {
modalView = uiApp.popover(
'<div class="popover settings container-settings">' +
'<div class="popover-angle"></div>' +
'<div class="popover-inner">' +
'<div class="content-block">' +
'<div class="view popover-view settings-root-view navbar-through">' +
this.getView('Settings').rootLayout() +
'</div>' +
'</div>' +
'</div>' +
'</div>',
$$('#toolbar-settings')
);
}
if (Framework7.prototype.device.android === true) {
$$('.view.settings-root-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed');
$$('.view.settings-root-view .navbar').prependTo('.view.settings-root-view > .pages > .page');
}
rootView = uiApp.addView('.settings-root-view', {
dynamicNavbar: true,
domCache: true
});
if (!Common.SharedSettings.get('phone')) {
this.picker = $$(modalView);
var $overlay = $('.modal-overlay');
$$(this.picker).on('opened', function () {
$overlay.on('removeClass', function () {
if (!$overlay.hasClass('modal-overlay-visible')) {
$overlay.addClass('modal-overlay-visible')
}
});
}).on('close', function () {
$overlay.off('removeClass');
$overlay.removeClass('modal-overlay-visible');
});
}
Common.NotificationCenter.trigger('settingscontainer:show');
this.onPageShow(this.getView('Settings'));
},
hideModal: function() {
if (modalView) {
uiApp.closeModal(modalView);
}
},
onPageShow: function(view, pageId) {
var me = this;
$('#settings-search').single('click', _.bind(me._onSearch, me));
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
$('#settings-print').single('click', _.bind(me._onPrint, me));
$('#settings-collaboration').single('click', _.bind(me.onCollaboration, me));
me.initSettings(pageId);
},
initSettings: function (pageId) {
var me = this;
if (pageId == '#settings-about-view') {
// About
me.setLicInfo(_licInfo);
} else if ('#settings-application-view' == pageId) {
me.initPageApplicationSettings();
Common.Utils.addScrollIfNeed('.page[data-page=settings-application-view]', '.page[data-page=settings-application-view] .page-content');
} else if ('#color-schemes-view' == pageId) {
me.initPageColorSchemes();
Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view]', '.page[data-page=color-schemes-view] .page-content');
} else if ('#settings-spreadsheet-view' == pageId) {
me.initSpreadsheetSettings();
} else if ('#settings-page-size-view' == pageId) {
me.initSpreadsheetPageSize();
} else if ('#margins-view' == pageId) {
me.initSpreadsheetMargins();
} else if ('#language-formula-view' == pageId) {
me.initFormulaLang();
} else if ('#regional-settings-view' == pageId) {
me.initRegSettings();
} else if ('#settings-info-view' == pageId) {
me.initPageInfo();
} else if ('#settings-macros-view' == pageId) {
me.initPageMacrosSettings();
} else {
var _userCount = SSE.getController('Main').returnUserCount();
if (_userCount > 0) {
$('#settings-collaboration').show();
}
}
},
initPageMacrosSettings: function() {
var me = this,
$pageMacrosSettings = $('.page[data-page="settings-macros-view"] input:radio[name=macros-settings]'),
value = Common.Utils.InternalSettings.get("sse-mobile-macros-mode") || 0;
$pageMacrosSettings.single('change', _.bind(me.onChangeMacrosSettings, me));
$pageMacrosSettings.val([value]);
},
onChangeMacrosSettings: function(e) {
var value = parseInt($(e.currentTarget).val());
Common.Utils.InternalSettings.set("sse-mobile-macros-mode", value);
Common.localStorage.setItem("sse-mobile-macros-mode", value);
},
initPageInfo: function() {
var document = Common.SharedSettings.get('document') || {},
info = document.info || {};
document.title ? $('#settings-spreadsheet-title').html(document.title) : $('.display-spreadsheet-title').remove();
var value = info.owner || info.author;
value ? $('#settings-sse-owner').html(value) : $('.display-owner').remove();
value = info.uploaded || info.created;
value ? $('#settings-sse-uploaded').html(value) : $('.display-uploaded').remove();
info.folder ? $('#settings-sse-location').html(info.folder) : $('.display-location').remove();
var appProps = (this.api) ? this.api.asc_getAppProps() : null;
if (appProps) {
var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || '');
appName ? $('#settings-sse-application').html(appName) : $('.display-application').remove();
}
var props = (this.api) ? this.api.asc_getCoreProps() : null;
if (props) {
value = props.asc_getTitle();
value ? $('#settings-sse-title').html(value) : $('.display-title').remove();
value = props.asc_getSubject();
value ? $('#settings-sse-subject').html(value) : $('.display-subject').remove();
value = props.asc_getDescription();
value ? $('#settings-sse-comment').html(value) : $('.display-comment').remove();
value = props.asc_getModified();
value ? $('#settings-sse-last-mod').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(_lang, {timeStyle: 'short'})) : $('.display-last-mode').remove();
value = props.asc_getLastModifiedBy();
value ? $('#settings-sse-mod-by').html(value) : $('.display-mode-by').remove();
value = props.asc_getCreated();
value ? $('#settings-sse-date').html(value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleString(_lang, {timeStyle: 'short'})) : $('.display-created-date').remove();
value = props.asc_getCreator();
var templateCreator = "";
value && value.split(/\s*[,;]\s*/).forEach(function(item) {
templateCreator = templateCreator + "<li class='item-content'><div class='item-inner'><div class='item-title'>" + item + "</div></div></li>";
});
templateCreator ? $('#list-creator').html(templateCreator) : $('.display-author').remove();
}
},
initRegSettings: function() {
var value = Number(Common.localStorage.getItem('sse-settings-regional'));
this.getView('Settings').renderRegSettings(value ? value : 0x0409, _regdata);
$('.page[data-page=regional-settings-view] input:radio[name=region-settings]').single('change', _.bind(this.onRegSettings, this));
Common.Utils.addScrollIfNeed('.page[data-page=regional-settings-view]', '.page[data-page=regional-settings-view] .page-content');
},
onRegSettings: function(e) {
var regCode = $(e.currentTarget).val();
Common.localStorage.setItem("sse-settings-regional", regCode);
this.initPageApplicationSettings();
if (regCode!==null) this.api.asc_setLocale(parseInt(regCode));
},
initFormulaLang: function() {
var value = Common.localStorage.getItem('sse-settings-func-lang');
var item = _.findWhere(_dataLang, {value: value});
this.getView('Settings').renderFormLang(item ? _dataLang.indexOf(item) : 0, _dataLang);
$('.page[data-page=language-formula-view] input:radio[name=language-formula]').single('change', _.bind(this.onFormulaLangChange, this));
Common.Utils.addScrollIfNeed('.page[data-page=language-formula-view]', '.page[data-page=language-formula-view] .page-content');
},
onFormulaLangChange: function(e) {
var langValue = $(e.currentTarget).val();
Common.localStorage.setItem("sse-settings-func-lang", langValue);
this.initPageApplicationSettings();
SSE.getController('AddFunction').onDocumentReady();
},
onCollaboration: function() {
SSE.getController('Common.Controllers.Collaboration').showModal();
},
initSpreadsheetSettings: function() {
var me = this,
$pageSpreadsheetSettings = $('.page[data-page=settings-spreadsheet-view]'),
$switchHideHeadings = $pageSpreadsheetSettings.find('#hide-headings input'),
$switchHideGridlines = $pageSpreadsheetSettings.find('#hide-gridlines input'),
$pageOrientation = $('.page[data-page=settings-spreadsheet-view] input:radio[name=table-orientation]');
$switchHideHeadings.single('change', _.bind(me.clickCheckboxHideHeadings, me));
$switchHideGridlines.single('change', _.bind(me.clickCheckboxHideGridlines, me));
var params = me.api.asc_getSheetViewSettings();
$switchHideHeadings.prop('checked',!params.asc_getShowRowColHeaders());
$switchHideGridlines.prop('checked',!params.asc_getShowGridLines());
// Init orientation
var currentSheet = this.api.asc_getActiveWorksheetIndex(),
props = this.api.asc_getPageOptions(currentSheet),
opt = props.asc_getPageSetup();
if(opt.asc_getOrientation() === Asc.c_oAscPageOrientation.PagePortrait) {
$('.page[data-page=settings-spreadsheet-view] input:radio[name=table-orientation][value="0"]').prop( "checked", true );
} else {
$('.page[data-page=settings-spreadsheet-view] input:radio[name=table-orientation][value="1"]').prop( "checked", true );
}
$pageOrientation.single('change', _.bind(me.onOrientationChange, me));
//Init format
var $pageSize = $('#settings-spreadsheet-format');
this.changeCurrentPageSize(opt.asc_getWidth(), opt.asc_getHeight());
$pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']);
var curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()),
sizeW = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2)),
sizeH = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2));
var pageSizeTxt = sizeW + ' ' + curMetricName + ' x ' + sizeH + ' ' + curMetricName;
$pageSize.find('.item-subtitle').text(pageSizeTxt);
},
changeCurrentPageSize: function(w, h) {
if (Math.abs(_pageSizesCurrent[0] - w) > 0.1 ||
Math.abs(_pageSizesCurrent[1] - h) > 0.1) {
_pageSizesCurrent = [w, h];
_.find(_pageSizes, function(size, index) {
if (Math.abs(size.value[0] - w) < 0.1 && Math.abs(size.value[1] - h) < 0.1) {
_pageSizesIndex = index;
}
}, this);
}
},
initSpreadsheetPageSize: function() {
this.getView('Settings').renderPageSizes(_pageSizes, _pageSizesIndex);
$('.page[data-page=settings-page-size-view] input:radio[name=spreadsheet-format]').single('change', _.bind(this.onFormatChange, this));
Common.Utils.addScrollIfNeed('.page[data-page=settings-page-size-view]', '.page[data-page=settings-page-size-view] .page-content');
},
onFormatChange: function(e) {
var rawValue = $(e.currentTarget).val(),
value = rawValue.split(',');
this.api.asc_changeDocSize(parseFloat(value[0]), parseFloat(value[1]), this.api.asc_getActiveWorksheetIndex());
this.initSpreadsheetSettings();
},
initSpreadsheetMargins: function() {
var me = this;
// Init page margins
var currentSheet = me.api.asc_getActiveWorksheetIndex(),
props = me.api.asc_getPageOptions(currentSheet);
me.localMarginProps = props.asc_getPageMargins();
_metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric());
var left = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getLeft()).toFixed(2)),
top = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getTop()).toFixed(2)),
right = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getRight()).toFixed(2)),
bottom = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getBottom()).toFixed(2));
if (me.localMarginProps) {
$('#spreadsheet-margin-top .item-after label').text(top + ' ' + _metricText);
$('#spreadsheet-margin-bottom .item-after label').text(bottom + ' ' + _metricText);
$('#spreadsheet-margin-left .item-after label').text(left + ' ' + _metricText);
$('#spreadsheet-margin-right .item-after label').text(right + ' ' + _metricText);
}
_.each(["top", "left", "bottom", "right"], function(align) {
$(Common.Utils.String.format('#spreadsheet-margin-{0} .button', align)).single('click', _.bind(me.onPageMarginsChange, me, align));
})
},
onPageMarginsChange: function (align, e) {
var me = this,
$button = $(e.currentTarget),
step = 1, // mm
txtCm = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.cm),
marginValue = null;
var maxMarginsH = 482.5,
maxMarginsW = 482.5;
if(Common.Utils.Metric.getCurrentMetric() == Common.Utils.Metric.c_MetricUnits.pt) {
step = 1;
} else {
step = 0.1;
}
step = Common.Utils.Metric.fnRecalcToMM(step);
switch (align) {
case 'left': marginValue = me.localMarginProps.asc_getLeft(); break;
case 'top': marginValue = me.localMarginProps.asc_getTop(); break;
case 'right': marginValue = me.localMarginProps.asc_getRight(); break;
case 'bottom': marginValue = me.localMarginProps.asc_getBottom(); break;
}
var changeProps = new Asc.asc_CPageMargins();
changeProps.asc_setTop(me.localMarginProps.asc_getTop());
changeProps.asc_setBottom(me.localMarginProps.asc_getBottom());
changeProps.asc_setLeft(me.localMarginProps.asc_getLeft());
changeProps.asc_setRight(me.localMarginProps.asc_getRight());
if ($button.hasClass('decrement')) {
marginValue = Math.max(0, marginValue - step);
} else {
marginValue = Math.min((align == 'left' || align == 'right') ? maxMarginsW : maxMarginsH, marginValue + step);
}
switch (align) {
case 'left': changeProps.asc_setLeft(marginValue); break;
case 'top': changeProps.asc_setTop(marginValue); break;
case 'right': changeProps.asc_setRight(marginValue); break;
case 'bottom': changeProps.asc_setBottom(marginValue); break;
}
$(Common.Utils.String.format('#document-margin-{0} .item-after label', align)).text(parseFloat(Common.Utils.Metric.fnRecalcFromMM(marginValue)).toFixed(2) + ' ' + _metricText);
me.api.asc_changePageMargins(changeProps.asc_getLeft(), changeProps.asc_getRight(), changeProps.asc_getTop(), changeProps.asc_getBottom(), me.api.asc_getActiveWorksheetIndex());
me.initSpreadsheetMargins();
},
onOrientationChange: function(e) {
var value = $(e.currentTarget).attr('value');
this.api.asc_changePageOrient(Number(value) === Asc.c_oAscPageOrientation.PagePortrait, this.api.asc_getActiveWorksheetIndex());
},
clickCheckboxHideHeadings: function(e) {
var $target = $(e.currentTarget),
checked = $target.prop('checked');
this.api.asc_setDisplayHeadings(!checked);
},
clickCheckboxHideGridlines: function(e) {
var $target = $(e.currentTarget),
checked = $target.prop('checked');
this.api.asc_setDisplayGridlines(!checked);
},
initPageColorSchemes: function() {
this.curSchemas = (this.api) ? this.api.asc_GetCurrentColorSchemeIndex() : 0;
this.getView('Settings').renderSchemaSettings(this.curSchemas, this.schemas);
$('.page[data-page=color-schemes-view] input:radio[name=color-schema]').single('change', _.bind(this.onColorSchemaChange, this));
Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view', '.page[data-page=color-schemes-view] .page-content');
},
onSendThemeColorSchemes: function (schemas) {
this.schemas = schemas;
},
onColorSchemaChange: function(event) {
if (this.api) {
var ind = $(event.currentTarget).val();
if (this.curSchemas !== ind)
this.api.asc_ChangeColorSchemeByIdx(parseInt(ind));
}
},
setLicInfo: function(data){
if (data && typeof data == 'object' && typeof(data.customer)=='object') {
$('.page[data-page=settings-about-view] .logo').hide();
$('#settings-about-tel').parent().hide();
$('#settings-about-licensor').show();
var customer = data.customer,
value = customer.name;
value && value.length ?
$('#settings-about-name').text(value) :
$('#settings-about-name').hide();
value = customer.address;
value && value.length ?
$('#settings-about-address').text(value) :
$('#settings-about-address').parent().hide();
(value = customer.mail) && value.length ?
$('#settings-about-email').attr('href', "mailto:"+value).text(value) :
$('#settings-about-email').parent().hide();
if ((value = customer.www) && value.length) {
var http = !/^https?:\/{2}/i.test(value) ? "http:\/\/" : '';
$('#settings-about-url').attr('href', http+value).text(value);
} else
$('#settings-about-url').hide();
if ((value = customer.info) && value.length) {
$('#settings-about-info').show().text(value);
}
if ( (value = customer.logo) && value.length ) {
$('#settings-about-logo').show().html('<img src="'+value+'" style="max-width:216px; max-height: 35px;" />');
}
}
},
initPageApplicationSettings: function() {
var me = this,
$unitMeasurement = $('.page[data-page=settings-application-view] input:radio[name=unit-of-measurement]');
$unitMeasurement.single('change', _.bind(me.unitMeasurementChange, me));
var value = Common.Utils.Metric.getCurrentMetric();
$unitMeasurement.val([value]);
//init formula language
value = Common.localStorage.getItem('sse-settings-func-lang');
var item = _.findWhere(_dataLang, {value: value});
if(!item) {
item = _dataLang[0];
}
var $pageLang = $('#language-formula');
$pageLang.find('.item-title').text(item.displayValue);
$pageLang.find('.item-example').text(item.exampleValue);
//init regional settings
value = Number(Common.localStorage.getItem('sse-settings-regional'));
var item = _.findWhere(_regdata, {code: value});
if(!item) {
item = _.findWhere(_regdata, {code: 0x0409});
}
var $regSettings = $('#regional-settings');
$regSettings.find('.item-title').text(item.displayName);
var info = new Asc.asc_CFormatCellsInfo();
info.asc_setType(Asc.c_oAscNumFormatType.None);
info.asc_setSymbol(value);
var arr = this.api.asc_getFormatCells(info);
var text = this.api.asc_getLocaleExample(arr[4], 1000.01, value);
text = text + ' ' + this.api.asc_getLocaleExample(arr[5], Asc.cDate().getExcelDateWithTime(), value);
text = text + ' ' + this.api.asc_getLocaleExample(arr[6], Asc.cDate().getExcelDateWithTime(), value);
$regSettings.find('.item-example').text(text);
//init r1c1 reference
value = Common.localStorage.getBool('sse-settings-r1c1');
var $r1c1Style = $('.page[data-page=settings-application-view] #r1-c1-style input');
$r1c1Style.prop('checked',value);
$r1c1Style.single('change', _.bind(me.clickR1C1Style, me));
//init Commenting Display
var displayComments = Common.localStorage.getBool("sse-mobile-settings-livecomment", true);
$('#settings-display-comments input:checkbox').attr('checked', displayComments);
$('#settings-display-comments input:checkbox').single('change', _.bind(me.onChangeDisplayComments, me));
var displayResolved = Common.localStorage.getBool("sse-settings-resolvedcomment", true);
if (!displayComments) {
$("#settings-display-resolved").addClass("disabled");
displayResolved = false;
}
$('#settings-display-resolved input:checkbox').attr('checked', displayResolved);
$('#settings-display-resolved input:checkbox').single('change', _.bind(me.onChangeDisplayResolved, me));
},
onChangeDisplayComments: function(e) {
var displayComments = $(e.currentTarget).is(':checked');
if (!displayComments) {
this.api.asc_hideComments();
$("#settings-display-resolved input").prop( "checked", false );
Common.localStorage.setBool("sse-settings-resolvedcomment", false);
$("#settings-display-resolved").addClass("disabled");
} else {
var resolved = Common.localStorage.getBool("sse-settings-resolvedcomment");
this.api.asc_showComments(resolved);
$("#settings-display-resolved").removeClass("disabled");
}
Common.localStorage.setBool("sse-mobile-settings-livecomment", displayComments);
},
onChangeDisplayResolved: function(e) {
var displayComments = Common.localStorage.getBool("sse-mobile-settings-livecomment");
if (displayComments) {
var resolved = $(e.currentTarget).is(':checked');
if (this.api) {
this.api.asc_showComments(resolved);
}
Common.localStorage.setBool("sse-settings-resolvedcomment", resolved);
}
},
clickR1C1Style: function(e) {
var $target = $(e.currentTarget),
checked = $target.prop('checked');
Common.localStorage.setBool('sse-settings-r1c1', checked);
this.api.asc_setR1C1Mode(checked);
},
unitMeasurementChange: function (e) {
var value = $(e.currentTarget).val();
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
Common.Utils.Metric.setCurrentMetric(value);
Common.localStorage.setItem("se-mobile-settings-unit", value);
},
// API handlers
_onSearch: function (e) {
var toolbarView = SSE.getController('Toolbar').getView('Toolbar');
if (toolbarView) {
toolbarView.showSearch();
}
this.hideModal();
},
_onPrint: function(e) {
var me = this;
_.defer(function () {
me.api.asc_Print();
});
me.hideModal();
},
_onSaveFormat: function(e) {
var me = this,
format = $(e.currentTarget).data('format');
me.hideModal();
if (format) {
if (format == Asc.c_oAscFileType.CSV) {
setTimeout(function () {
uiApp.confirm(
me.warnDownloadAs,
me.notcriticalErrorTitle,
function () {
Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.CSV, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format));
}
);
}, 50);
} else {
setTimeout(function () {
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
}, 50);
}
}
},
notcriticalErrorTitle : 'Warning',
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.Settings || {}))
});

View file

@ -1,632 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* Statusbar.js
*
* Statusbar controller
*
* Created by Maxim Kadushkin on 11/28/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/Statusbar',
'spreadsheeteditor/mobile/app/collection/sheets'
], function () {
'use strict';
SSE.Controllers.Statusbar = Backbone.Controller.extend(_.extend({
models: [],
collections: ['Sheets'],
views: [
'Statusbar'
],
initialize: function() {
this.addListeners({
'Statusbar': {
'sheet:click': this.onTabClick,
'sheet:addnew': this.onAddTab,
'contextmenu:click': this.onTabMenu
}
});
this._moreAction = [];
},
events: function() {
},
onLaunch: function() {
var me = this;
this.statusbar = this.createView('Statusbar').render();
// this.statusbar.$el.css('z-index', 10);
this.sheets = this.getApplication().getCollection('Sheets');
this.sheets.bind({
add: function (model, collection, opts) {
var $item = me.statusbar.addSheet(model);
model.set('el', $item, {silent:true});
},
change: function (model) {
if ( model.changed ) {
if ( model.changed.locked != undefined ) {
model.get('el').toggleClass('locked', model.changed.locked);
}
}
},
reset: function (collection, opts) {
me.statusbar.clearTabs();
me.statusbar.addSheets(collection);
}
});
this.hiddensheets = this.getApplication().createCollection('Sheets');
// this.bindViewEvents(this.statusbar, this.events);
Common.NotificationCenter.on('document:ready', this.onApiSheetsChanged.bind(this));
},
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiDisconnect, this));
this.api.asc_registerCallback('asc_onUpdateTabColor', _.bind(this.onApiUpdateTabColor, this));
// this.api.asc_registerCallback('asc_onEditCell', _.bind(this.onApiEditCell, this));
this.api.asc_registerCallback('asc_onWorkbookLocked', _.bind(this.onWorkbookLocked, this));
this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, this));
// this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this));
this.api.asc_registerCallback('asc_onSheetsChanged', this.onApiSheetsChanged.bind(this));
},
setMode: function(mode) {
this.statusbar.setMode(mode);
this.isEdit = mode.isEdit;
},
/*
* api events
* */
onApiSheetsChanged: function() {
var me = this;
var sheets_count = this.api.asc_getWorksheetsCount(), i = -1;
var hiddentems = [], items = [], tab, locked;
var active_index = this.api.asc_getActiveWorksheetIndex();
while ( ++i < sheets_count ) {
locked = me.api.asc_isWorksheetLockedOrDeleted(i);
tab = {
index : i,
active : active_index == i,
name : me.api.asc_getWorksheetName(i),
// cls : locked ? 'coauth-locked':'',
locked : locked,
color : me.api.asc_getWorksheetTabColor(i)
};
(this.api.asc_isWorksheetHidden(i) ? hiddentems : items).push(new SSE.Models.Sheet(tab));
}
this.sheets.reset(items);
this.hiddensheets.reset(hiddentems);
this.updateTabsColors();
return;
if (this.api) {
// if (!this.tabbar.isTabVisible(sindex))
// this.tabbar.setTabVisible(sindex);
// this.btnAddWorksheet.setDisabled(me.mode.isDisconnected || me.api.asc_isWorkbookLocked());
// $('#status-label-zoom').text(Common.Utils.String.format(this.zoomText, Math.floor((this.api.asc_getZoom() +.005)*100)));
}
},
onApiDisconnect: function() {
this.statusbar.setMode('disconnect');
this.isDisconnected = true;
},
onWorkbookLocked: function(locked) {
this.statusbar.$btnAddTab.toggleClass('disabled', locked);
return;
this.statusbar.tabbar[locked?'addClass':'removeClass']('coauth-locked');
this.statusbar.btnAddWorksheet.setDisabled(locked || this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.Chart ||
this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.FormatTable);
var item, i = this.statusbar.tabbar.getCount();
while (i-- > 0) {
item = this.statusbar.tabbar.getAt(i);
if (item.sheetindex >= 0) {
// if (locked) item.reorderable = false;
// else item.reorderable = !this.api.asc_isWorksheetLockedOrDeleted(item.sheetindex);
} else {
item.disable(locked);
}
}
},
onWorksheetLocked: function(index, locked) {
var model = this.sheets.findWhere({index: index});
if ( model && model.get('locked') != locked )
model.set('locked', locked);
},
onApiEditCell: function(state) {
var disableAdd = (state == Asc.c_oAscCellEditorState.editFormula),
disable = (state != Asc.c_oAscCellEditorState.editEnd),
mask = $('.statusbar-mask'),
statusbar = this.statusbar;
statusbar.isEditFormula = disableAdd;
if (disableAdd && mask.length>0 || !disableAdd && mask.length==0) return;
statusbar.$el.find('.statusbar').toggleClass('masked', disableAdd);
if(disableAdd) {
mask = $("<div class='statusbar-mask'>").appendTo(statusbar.$el);
} else {
mask.remove();
}
},
createDelayedElements: function() {
this.statusbar.$el.css('z-index', '');
this.statusbar.btnAddWorksheet.on('click', _.bind(this.onAddWorksheetClick, this));
Common.NotificationCenter.on('window:resize', _.bind(this.onWindowResize, this));
// Common.NotificationCenter.on('cells:range', _.bind(this.onRangeDialogMode, this));
},
onWindowResize: function(area) {
// this.statusbar.onTabInvisible(undefined, this.statusbar.tabbar.checkInvisible(true));
},
createSheetName: function() {
var items = [], wc = this.api.asc_getWorksheetsCount();
while (wc--) {
items.push(this.api.asc_getWorksheetName(wc).toLowerCase());
}
var index = 0, name;
while(++index < 1000) {
name = this.strSheet + index;
if (items.indexOf(name.toLowerCase()) < 0) break;
}
return name;
},
createCopyName: function(orig) {
var wc = this.api.asc_getWorksheetsCount(), names = [];
while (wc--) {
names.push(this.api.asc_getWorksheetName(wc).toLowerCase());
}
var re = /^(.*)\((\d)\)$/.exec(orig);
var first = re ? re[1] : orig + ' ';
var index = 1, name;
while(++index < 1000) {
name = first + '(' + index + ')';
if (names.indexOf(name.toLowerCase()) < 0) break;
}
return name;
},
deleteWorksheet: function() {
var me = this;
if (me.sheets.length == 1) {
uiApp.alert(me.errorLastSheet);
} else {
uiApp.confirm(me.warnDeleteSheet, undefined, _.buffered(function() {
if ( !me.api.asc_deleteWorksheet() ) {
_.defer(function(){
uiApp.alert(me.errorRemoveSheet);
});
}
}, 300));
}
},
hideWorksheet: function(hide, index) {
if ( hide ) {
this.sheets.length == 1 ?
uiApp.alert(this.errorLastSheet) :
this.api['asc_hideWorksheet']([index]);
} else {
this.api['asc_showWorksheet'](index);
this.loadTabColor(index);
}
},
onAddWorksheetClick: function(o, index, opts) {
if (this.api) {
this.api.asc_closeCellEditor();
this.api.asc_addWorksheet(this.createSheetName());
Common.NotificationCenter.trigger('comments:updatefilter',
{property: 'uid',
value: new RegExp('^(doc_|sheet' + this.api.asc_getActiveWorksheetId() + '_)')
},
false // hide popover
);
}
Common.NotificationCenter.trigger('edit:complete', this.statusbar);
},
selectTab: function (index) {
if (this.api) {
var hidden = this.api.asc_isWorksheetHidden(sheetindex);
if (!hidden) {
var tab = _.findWhere(this.statusbar.tabbar.tabs, {sheetindex: sheetindex});
if (tab) {
this.statusbar.tabbar.setActive(tab);
}
}
}
},
moveCurrentTab: function (direction) {
if (this.api) {
var indTab = 0,
tabBar = this.statusbar.tabbar,
index = this.api.asc_getActiveWorksheetIndex(),
length = tabBar.tabs.length;
this.statusbar.tabMenu.hide();
this.api.asc_closeCellEditor();
for (var i = 0; i < length; ++i) {
if (tabBar.tabs[i].sheetindex === index) {
indTab = i;
if (direction > 0) {
indTab++;
if (indTab >= length) {
indTab = 0;
}
} else {
indTab--;
if (indTab < 0) {
indTab = length - 1;
}
}
tabBar.setActive(indTab);
this.api.asc_showWorksheet(tabBar.getAt(indTab).sheetindex);
break;
}
}
}
},
renameWorksheet: function() {
var me = this;
if (me.api.asc_getWorksheetsCount() > 0) {
var sindex = me.api.asc_getActiveWorksheetIndex();
if (me.api.asc_isWorksheetLockedOrDeleted(sindex)) {
return;
}
var current = me.api.asc_getWorksheetName(me.api.asc_getActiveWorksheetIndex());
var renameDlg = uiApp.modal({
title: me.strRenameSheet,
afterText: '<div class="input-field"><input type="text" name="modal-sheet-name" placeholder="' + me.strSheetName + '" class="modal-text-input"></div>',
buttons: [
{
text: 'OK',
bold: true,
onClick: function () {
var s = $(renameDlg).find('.modal-text-input[name="modal-sheet-name"]').val(),
wc = me.api.asc_getWorksheetsCount(), items = [],
err = _.isEmpty(s) ? me.errNotEmpty : ((s.length > 2 && s[0]=='"' && s[s.length-1]=='"' || !/[:\\\/\*\?\[\]\']/.test(s)) ? null : me.errNameWrongChar);
if (!err) {
while (wc--) {
if (sindex !== wc) {
items.push(me.api.asc_getWorksheetName(wc).toLowerCase());
}
}
if (items) {
var testval = s.toLowerCase();
for (var i = items.length - 1; i >= 0; --i) {
if (items[i] === testval) {
err = me.errNameExists;
}
}
}
}
if (err) {
uiApp.alert(
err,
me.notcriticalErrorTitle,
function () {
_.defer(function() {
me.renameWorksheet();
});
}
);
} else if (s != current)
me.api.asc_renameWorksheet(s);
}
},
{
text: me.cancelButtonText
}
]
});
}
},
// colors
onApiUpdateTabColor: function (index) {
this.loadTabColor(index);
},
updateThemeColors: function() {
var updateColors = function(picker, defaultColorIndex) {
if (picker) {
var clr,
effectcolors = Common.Utils.ThemeColor.getEffectColors();
for (var i = 0; i < effectcolors.length; ++i) {
if (typeof(picker.currentColor) == 'object' &&
clr === undefined &&
picker.currentColor.effectId == effectcolors[i].effectId)
clr = effectcolors[i];
}
picker.updateColors(effectcolors, Common.Utils.ThemeColor.getStandartColors());
if (picker.currentColor === undefined) {
picker.currentColor = effectcolors[defaultColorIndex];
} else if (clr!==undefined) {
picker.currentColor = clr;
}
}
};
if (this.statusbar) {
updateColors(this.statusbar.mnuTabColor, 1);
}
},
onNewBorderColor: function() {
if (this.statusbar && this.statusbar.mnuTabColor) {
this.statusbar.mnuTabColor.addNewColor();
}
},
loadTabColor: function (sheetindex) {
if (this.api) {
var tab = this.sheets.findWhere({index: sheetindex});
if (tab) {
this.setTabLineColor(tab, this.api.asc_getWorksheetTabColor(sheetindex));
}
}
},
setTabLineColor: function (tab, color) {
if (tab) {
if (null !== color) {
color = '#' + Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
} else {
color = '';
}
if (color.length) {
if (!tab.get('active')) {
color = '0px 4px 0 ' + Common.Utils.RGBColor(color).toRGBA(0.7) + ' inset';
} else {
color = '0px 4px 0 ' + color + ' inset';
}
tab.get('el').find('a').css('box-shadow', color);
} else {
tab.get('el').find('a').css('box-shadow', '');
}
}
},
updateTabsColors: function () {
var me = this;
_.each(this.sheets.models, function (item) {
me.setTabLineColor(item, me.api.asc_getWorksheetTabColor(item.get('index')));
});
},
onError: function(id, level, errData) {
// if (id == Asc.c_oAscError.ID.LockedWorksheetRename)
// this.statusbar.update();
},
onTabClick: function(index, model) {
var opened = $('.document-menu.modal-in').length;
uiApp.closeModal('.document-menu.modal-in');
var sdkindex = model.get('index');
if ( sdkindex == this.api.asc_getActiveWorksheetIndex () ) {
if ( !opened ) {
if ( this.isEdit && !this.isDisconnected ) {
this.api.asc_closeCellEditor();
this.statusbar.showTabContextMenu(this._getTabMenuItems(model), model);
}
}
} else {
this.api.asc_showWorksheet( sdkindex );
this.statusbar.setActiveTab(index);
Common.NotificationCenter.trigger('sheet:active', sdkindex);
}
},
onLinkWorksheetRange: function(nameSheet, prevSheet) {
var tab = this.sheets.findWhere({name: nameSheet});
var sdkIndex = tab.get('index');
if (sdkIndex !== prevSheet) {
var index = this.sheets.indexOf(tab);
this.statusbar.setActiveTab(index);
Common.NotificationCenter.trigger('sheet:active', sdkIndex);
}
},
onAddTab: function () {
this.api.asc_closeCellEditor();
this.api.asc_addWorksheet(this.createSheetName());
},
onTabMenu: function (view, event, model) {
var me = this;
switch (event) {
case 'del': me.deleteWorksheet(); break;
case 'hide': me.hideWorksheet(true, model.get('index')); break;
case 'ins': me.api.asc_insertWorksheet(me.createSheetName()); break;
case 'copy':
var name = me.createCopyName(me.api.asc_getWorksheetName(me.api.asc_getActiveWorksheetIndex()));
me.api.asc_copyWorksheet(model.get('index'), name);
break;
case 'unhide':
var items = [];
_.each(this.hiddensheets.models, function (item) {
items.push({
caption: item.get('name'),
event: 'reveal:' + item.get('index')
})
});
_.defer(function () {
me.statusbar.showTabContextMenu(items, model);
});
break;
case 'ren': me.renameWorksheet(); break;
case 'showMore':
if (me._moreAction.length > 0) {
_.delay(function () {
_.each(me._moreAction, function (action) {
action.text = action.caption;
action.onClick = function () {
me.onTabMenu(null, action.event, model)
}
});
uiApp.actions([me._moreAction, [
{
text: me.cancelButtonText,
bold: true
}
]]);
}, 100);
}
break;
default:
var _re = /reveal\:(\d+)/.exec(event);
if ( _re && !!_re[1] ) {
me.hideWorksheet(false, parseInt(_re[1]));
}
}
},
_getTabMenuItems: function(model) {
var wbLocked = this.api.asc_isWorkbookLocked();
var shLocked = this.api.asc_isWorksheetLockedOrDeleted(model.get('index'));
var items = [{
caption: this.menuDuplicate,
event: 'copy',
locked: wbLocked || shLocked
},{
caption: this.menuDelete,
event: 'del',
locked: wbLocked || shLocked
},{
caption: this.menuRename,
event: 'ren',
locked: wbLocked || shLocked
},{
caption: this.menuHide,
event: 'hide',
locked: wbLocked || shLocked
}];
if ( !wbLocked && !shLocked && this.hiddensheets.length ) {
items.push({
caption: this.menuUnhide,
event: 'unhide'
});
}
if (Common.SharedSettings.get('phone') && items.length > 3) {
this._moreAction = items.slice(2);
items = items.slice(0, 2);
items.push({
caption: this.menuMore,
event: 'showMore'
});
}
return items;
},
menuDuplicate : 'Duplicate',
menuDelete : 'Delete',
menuHide : 'Hide',
menuUnhide : 'Unhide',
errorLastSheet : 'Workbook must have at least one visible worksheet.',
errorRemoveSheet: 'Can\'t delete the worksheet.',
warnDeleteSheet : 'The worksheet maybe has data. Proceed operation?',
strSheet : 'Sheet',
menuRename : 'Rename',
errNameExists : 'Worksheet with such name already exist.',
errNameWrongChar: 'A sheet name cannot contains characters: \\, \/, *, ?, [, ], :',
errNotEmpty: 'Sheet name must not be empty',
strRenameSheet: 'Rename Sheet',
strSheetName : 'Sheet Name',
cancelButtonText: 'Cancel',
notcriticalErrorTitle: 'Warning',
menuMore: 'More'
}, SSE.Controllers.Statusbar || {}));
});

View file

@ -1,243 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* Toolbar.js
* Spreadsheet Editor
*
* Created by Maxim Kadushkin on 11/15/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'jquery',
'underscore',
'backbone',
'spreadsheeteditor/mobile/app/view/Toolbar'
], function (core, $, _, Backbone) {
'use strict';
SSE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() {
// private
var locked = {
book: false,
sheet: false
};
return {
models: [],
collections: [],
views: [
'Toolbar'
],
initialize: function() {
Common.Gateway.on('init', _.bind(this.loadConfig, this));
},
loadConfig: function (data) {
if (data && data.config && data.config.canBackToFolder !== false &&
data.config.customization && data.config.customization.goback && (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) {
$('#document-back').show().single('click', _.bind(this.onBack, this));
}
},
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onCanUndoChanged', _.bind(this.onApiCanRevert, this, 'undo'));
this.api.asc_registerCallback('asc_onCanRedoChanged', _.bind(this.onApiCanRevert, this, 'redo'));
this.api.asc_registerCallback('asc_onSelectionChanged', this.onApiSelectionChanged.bind(this));
this.api.asc_registerCallback('asc_onWorkbookLocked', _.bind(this.onApiWorkbookLocked, this));
this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onApiWorksheetLocked, this));
this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.displayCollaboration, this));
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.displayCollaboration, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('sheet:active', this.onApiActiveSheetChanged.bind(this));
},
setMode: function (mode) {
this.getView('Toolbar').setMode(mode);
},
onLaunch: function() {
var me = this;
me.createView('Toolbar').render();
$('#toolbar-undo').single('click', _.bind(me.onUndo, me));
$('#toolbar-redo').single('click', _.bind(me.onRedo, me));
},
setDocumentTitle: function (title) {
$('#toolbar-title').html(title);
},
// Handlers
onBack: function (e) {
var me = this;
if (me.api.asc_isDocumentModified()) {
uiApp.modal({
title : me.dlgLeaveTitleText,
text : me.dlgLeaveMsgText,
verticalButtons: true,
buttons : [
{
text: me.leaveButtonText,
onClick: function() {
Common.NotificationCenter.trigger('goback', true);
}
},
{
text: me.stayButtonText,
bold: true
}
]
});
} else {
Common.NotificationCenter.trigger('goback', true);
}
},
onUndo: function (e) {
if ( this.api ) this.api.asc_Undo();
},
onRedo: function (e) {
if ( this.api ) this.api.asc_Redo();
},
// API handlers
onApiWorkbookLocked: function (l) {
locked.book = l;
this.onApiSelectionChanged();
},
onApiWorksheetLocked: function (l) {
locked.sheet = l;
this.onApiSelectionChanged();
},
onApiActiveSheetChanged: function (index) {
locked.sheet = this.api.asc_isWorksheetLockedOrDeleted(index);
Common.NotificationCenter.trigger('comments:filterchange', ['doc', 'sheet' + this.api.asc_getWorksheetId(index)], false );
},
onApiCanRevert: function(which, can) {
if (this.isDisconnected) return;
if (which == 'undo') {
$('#toolbar-undo').toggleClass('disabled', !can);
} else {
$('#toolbar-redo').toggleClass('disabled', !can);
}
},
onApiSelectionChanged: function(info) {
if (this.isDisconnected) return;
if ( !info ) info = this.api.asc_getCellInfo();
var islocked = false;
switch (info.asc_getSelectionType()) {
case Asc.c_oAscSelectionType.RangeChart:
case Asc.c_oAscSelectionType.RangeImage:
case Asc.c_oAscSelectionType.RangeShape:
case Asc.c_oAscSelectionType.RangeChartText:
case Asc.c_oAscSelectionType.RangeShapeText:
var objects = this.api.asc_getGraphicObjectProps();
for ( var i in objects ) {
if ( objects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image ) {
if ((islocked = objects[i].asc_getObjectValue().asc_getLocked()))
break;
}
}
break;
default:
islocked = info.asc_getLocked();
}
this.getView('Toolbar').disableControl(['add', 'edit'], islocked);
},
activateControls: function() {
$('#toolbar-settings, #toolbar-search, #document-back, #toolbar-edit-document, #toolbar-collaboration').removeClass('disabled');
},
activateViewControls: function() {
$('#toolbar-search, #document-back, #toolbar-collaboration').removeClass('disabled');
},
deactivateEditControls: function() {
$('#toolbar-edit, #toolbar-add, #toolbar-settings').addClass('disabled');
},
onCoAuthoringDisconnect: function() {
this.isDisconnected = true;
this.deactivateEditControls();
$('#toolbar-undo').toggleClass('disabled', true);
$('#toolbar-redo').toggleClass('disabled', true);
SSE.getController('AddContainer').hideModal();
SSE.getController('EditContainer').hideModal();
SSE.getController('Settings').hideModal();
},
displayCollaboration: function(users) {
if(users !== undefined) {
var length = 0;
_.each(users, function (item) {
if (!item.asc_getView())
length++;
});
if (length > 0) {
$('#toolbar-collaboration').show();
} else {
$('#toolbar-collaboration').hide();
}
}
},
dlgLeaveTitleText : 'You leave the application',
dlgLeaveMsgText : 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
leaveButtonText : 'Leave this Page',
stayButtonText : 'Stay on this Page'
}
})(), SSE.Controllers.Toolbar || {}))
});

View file

@ -1,89 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddTable.js
*
* Created by Maxim Kadushkin on 12/13/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/add/AddChart'
], function (core) {
'use strict';
SSE.Controllers.AddChart = Backbone.Controller.extend(_.extend((function() {
return {
models: [],
collections: [],
views: [
'AddChart'
],
initialize: function () {
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
this.addListeners({
'AddChart': {
'chart:insert': this.onInsertChart.bind(this)
}
});
},
setApi: function (api) {
this.api = api;
},
onLaunch: function () {
this.createView('AddChart').render();
},
initEvents: function () {
},
onInsertChart: function (type) {
SSE.getController('AddContainer').hideModal();
},
txtDiagramTitle: 'Chart Title',
txtXAxis: 'X Axis',
txtYAxis: 'Y Axis',
txtSeries: 'Seria'
}
})(), SSE.Controllers.AddChart || {}))
});

View file

@ -1,325 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddContainer.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/6/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'jquery',
'underscore',
'backbone'
], function (core, $, _, Backbone) {
'use strict';
SSE.Controllers.AddContainer = Backbone.Controller.extend(_.extend((function() {
// private
var parentButton = null,
options;
return {
models: [],
collections: [],
views: [],
initialize: function() {
//
},
setApi: function(api) {
this.api = api;
},
onLaunch: function() {
//
},
showModal: function(opts) {
var me = this;
if ($$('.container-add.modal-in').length > 0) {
return;
}
uiApp.closeModal();
var cellinfo = me.api.asc_getCellInfo();
var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu,
seltype = cellinfo.asc_getSelectionType(),
iscelllocked = cellinfo.asc_getLocked(),
isTableLocked = cellinfo.asc_getLockedTable()===true;
if ( !iscelllocked ) {
options = opts;
if ( !options ) {
switch (seltype) {
case Asc.c_oAscSelectionType.RangeCells:
case Asc.c_oAscSelectionType.RangeRow:
case Asc.c_oAscSelectionType.RangeCol:
case Asc.c_oAscSelectionType.RangeMax: break;
case Asc.c_oAscSelectionType.RangeImage:
case Asc.c_oAscSelectionType.RangeShape:
case Asc.c_oAscSelectionType.RangeChart:
case Asc.c_oAscSelectionType.RangeChartText:
case Asc.c_oAscSelectionType.RangeShapeText:
options = {panels: ['image','shape']};
break;
}
}
parentButton = !opts || !opts.button ? '#toolbar-add' : opts.button;
me._showByStack(Common.SharedSettings.get('phone'));
}
this.api.asc_closeCellEditor();
SSE.getController('Toolbar').getView('Toolbar').hideSearch();
},
hideModal: function () {
if (this.picker) {
uiApp.closeModal(this.picker);
}
},
_layoutEditorsByStack: function () {
var me = this,
addViews = [];
// var seltype = this.api.asc_getCellInfo().asc_getSelectionType();
if ( !options )
addViews.push({
caption: me.textChart,
id: 'add-chart',
icon: 'icon-add-chart',
layout: SSE.getController('AddChart').getView('AddChart').rootLayout()
});
if ( !options || options.panel == 'function' ) {
view = SSE.getController('AddFunction').getView('AddFunction');
addViews.push({
caption: me.textFormula,
id: 'add-formula',
icon: 'icon-add-formula',
layout: options ? view.rootLayout() : view.layoutPanel()
});
}
if ( !options || !(_.indexOf(options.panels, 'shape') < 0) )
addViews.push({
caption: me.textShape,
id: 'add-shape',
icon: 'icon-add-shape',
layout: SSE.getController('AddShape').getView('AddShape').rootLayout()
});
if ( !options )
addViews.push({
caption: me.textOther,
id: 'add-other',
icon: 'icon-add-other',
layout: SSE.getController('AddOther').getView('AddOther').rootLayout()
});
if ( options && options.panel == 'hyperlink' ) {
var view = SSE.getController('AddLink').getView();
addViews.push({
caption: view.getTitle(),
id: 'add-link',
layout: view.rootLayout()
});
}
if ( options && !(_.indexOf(options.panels, 'image')) ) {
addViews.push({
caption: me.textImage,
id: 'add-image',
icon: 'icon-add-image',
layout: SSE.getController('AddOther').getView('AddOther').childLayout('image')
});
}
return addViews;
},
_showByStack: function(isPhone) {
var me = this,
isAndroid = Framework7.prototype.device.android === true,
layoutAdds = me._layoutEditorsByStack();
if ($$('.container-add.modal-in').length > 0) {
return;
}
// Navigation bar
var $layoutNavbar = $(
'<div class="navbar">' +
'<div data-page="index" class="navbar-inner">' +
'<div class="center sliding categories"></div>' +
(isPhone ? '<div class="right sliding"><a href="#" class="link icon-only close-popup"><i class="icon icon-expand-down"></i></a></div>' : '') +
'</div>' +
'</div>'
);
if (layoutAdds.length == 1) {
$layoutNavbar
.find('.center')
.removeClass('categories')
.html(layoutAdds[0].caption);
$layoutPages = $('<div class="pages">' +
layoutAdds[0].layout +
'</div>');
} else {
if (isAndroid) {
$layoutNavbar
.find('.center')
.append('<div class="toolbar tabbar"><div data-page="index" class="toolbar-inner"></div></div>');
_.each(layoutAdds, function (layout, index) {
$layoutNavbar
.find('.toolbar-inner')
.append(
'<a href="#' + layout.id + '" class="tab-link ' + (index < 1 ? 'active' : '') + '"><i class="icon ' + layout.icon + '"></i></a>'
);
});
$layoutNavbar
.find('.toolbar-inner')
.append('<span class="tab-link-highlight" style="width: ' + (100 / layoutAdds.length) + '%;"></span>');
} else {
$layoutNavbar
.find('.center')
.append('<div class="buttons-row"></div>');
_.each(layoutAdds, function (layout, index) {
$layoutNavbar
.find('.buttons-row')
.append(
'<a href="#' + layout.id + '" class="tab-link button ' + (index < 1 ? 'active' : '') + '"><i class="icon ' + layout.icon + '"></i></a>'
);
});
}
// Content
var _arrangePages = _.template(
'<% _.each(pages, function(view, index) { %>' +
'<div id="<%= view.id %>" class="tab view<% if (index < 1) print(" active"); %>">' +
'<div class="pages">' +
'<div class="page no-navbar">' +
'<div class="page-content">' +
'<%= view.layout %>' +
'</div>' +
'</div>' +
'</div>' +
'</div>' +
'<% }); %>');
var $layoutPages = $('<div class="pages">' +
'<div class="page" data-page="index">' +
'<div class="page-content tabs">' +
_arrangePages({pages: layoutAdds}) +
'</div>' +
'</div>' +
'</div>');
}
if (isPhone) {
me.picker = $$(uiApp.popup(
'<div class="popup settings container-add">' +
'<div class="view add-root-view navbar-through">' +
$layoutNavbar.prop('outerHTML') +
$layoutPages.prop('outerHTML') +
'</div>' +
'</div>'
))
} else {
me.picker = uiApp.popover(
'<div class="popover settings container-add">' +
'<div class="popover-angle"></div>' +
'<div class="popover-inner">' +
'<div class="content-block">' +
'<div class="view popover-view add-root-view navbar-through">' +
$layoutNavbar.prop('outerHTML') +
$layoutPages.prop('outerHTML') +
'</div>' +
'</div>' +
'</div>',
$$(parentButton)
);
// Prevent hide overlay. Conflict popover and modals.
var $overlay = $('.modal-overlay');
$$(me.picker).on('opened', function () {
$overlay.on('removeClass', function () {
if (!$overlay.hasClass('modal-overlay-visible')) {
$overlay.addClass('modal-overlay-visible')
}
});
}).on('close', function () {
$overlay.off('removeClass');
$overlay.removeClass('modal-overlay-visible')
});
}
if (isAndroid) {
$$('.view.add-root-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed');
$$('.view.add-root-view .navbar').prependTo('.view.add-root-view > .pages > .page');
}
me.rootView = uiApp.addView('.add-root-view', {
dynamicNavbar: true,
domCache: true
});
Common.NotificationCenter.trigger('addcontainer:show', options);
},
textChart: 'Chart',
textFormula: 'Function',
textShape: 'Shape',
textImage: 'Image',
textOther: 'Other'
}
})(), SSE.Controllers.AddContainer || {}))
});

View file

@ -1,133 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddFunction.js
*
* Created by Maxim Kadushkin on 12/14/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/add/AddFunction',
'text!../../../resources/l10n/functions/en.json',
'text!../../../resources/l10n/functions/en_desc.json'
], function (core, view, fc, fd) {
'use strict';
SSE.Controllers.AddFunction = Backbone.Controller.extend(_.extend((function() {
return {
models: [],
collections: [],
views: [
'AddFunction'
],
initialize: function () {
var me = this;
Common.NotificationCenter.on('addcontainer:show', _.bind(me.initEvents, me));
Common.NotificationCenter.on('document:ready', _.bind(me.onDocumentReady, me));
me.addListeners({
'AddFunction': {
'function:insert': me.onInsertFunction.bind(me),
'function:info': me.onFunctionInfo.bind(me)
}
});
this.fd = fd;
},
setApi: function (api) {
this.api = api;
},
onLaunch: function () {
this.createView('AddFunction').render();
},
initEvents: function () {
},
onDocumentReady: function () {
var me = this;
_.defer(function () {
var editorLang = Common.localStorage.getItem('sse-settings-func-lang');
editorLang = (editorLang ? editorLang : 'en').split(/[\-\_]/)[0].toLowerCase();
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 me = this,
functions = {};
var editorLang = Common.localStorage.getItem('sse-settings-func-lang');
editorLang = (editorLang ? editorLang : 'en').split(/[\-\_]/)[0].toLowerCase();
var localizationFunctionsDesc = function (data) {};
$.getJSON(Common.Utils.String.format("{0}/{1}_desc.json", "resources/l10n/functions", editorLang), function(json) {
localizationFunctionsDesc(json);
}).fail(function() {
localizationFunctionsDesc(fd);
});
},
onInsertFunction: function (type) {
SSE.getController('AddContainer').hideModal();
},
onFunctionInfo: function (type) {
this.getView('AddFunction').openFunctionInfo(type);
}
}
})(), SSE.Controllers.AddFunction || {}))
});

View file

@ -1,181 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddLink.js
*
* Created by Maxim.Kadushkin on 1/10/2017
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/add/AddLink'
], function (core) {
'use strict';
SSE.Controllers.AddLink = Backbone.Controller.extend(_.extend((function() {
var cfgLink;
// Handlers
function onChangePanel (view, pageId) {
var me = this;
if (pageId == '#addother-change-linktype') {
view.optionLinkType( me.optsLink.type );
}
}
function onChangeLinkType (view, type) {
cfgLink.type = type;
view.optionLinkType( cfgLink.type, 'caption' );
}
function onChangeLinkSheet (view, index) {
}
function applyLocked(view) {
var _view = view || this.getView();
var cell = this.api.asc_getCellInfo(),
celltype = cell.asc_getSelectionType();
var allowinternal = (celltype!==Asc.c_oAscSelectionType.RangeImage && celltype!==Asc.c_oAscSelectionType.RangeShape &&
celltype!==Asc.c_oAscSelectionType.RangeShapeText && celltype!==Asc.c_oAscSelectionType.RangeChart &&
celltype!==Asc.c_oAscSelectionType.RangeChartText);
_view.optionDisplayText(cell.asc_getLockText() ? 'locked' : cell.asc_getText());
_view.optionAllowInternal(allowinternal);
allowinternal && _view.optionLinkType( cfgLink.type );
}
return {
models: [],
collections: [],
views: [
'AddLink'
],
initialize: function () {
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
this.addListeners({
'AddLink': {
'panel:change' : onChangePanel.bind(this)
, 'link:insert': this.onInsertLink.bind(this)
, 'link:changetype': onChangeLinkType.bind(this)
, 'link:changesheet': onChangeLinkSheet.bind(this)
}
});
},
setApi: function (api) {
this.api = api;
},
onLaunch: function () {
this.createView('AddLink').render();
},
getView: function (name) {
return Backbone.Controller.prototype.getView.call(this, name ? name: 'AddLink');
},
initEvents: function (opts) {
var me = this;
var wsc = me.api.asc_getWorksheetsCount(), items = null;
var aws = me.api.asc_getActiveWorksheetIndex();
if (wsc > 0) {
items = [];
while ( !(--wsc < 0) ) {
if ( !this.api.asc_isWorksheetHidden(wsc) ) {
items.unshift({
value: wsc,
caption: me.api.asc_getWorksheetName(wsc),
active: wsc==aws
});
}
}
}
cfgLink = {
type: 'ext',
sheets: items
};
// uiApp.addView('#add-link', {
// dynamicNavbar: true
// });
_.defer(function () {
var view = me.getView().acceptWorksheets( items );
if ( opts ) {
if ( opts.panel === 'hyperlink' ) {
view.showPanel();
applyLocked.call(me, view);
}
}
});
},
showPage: function (navbar) {
var me = this;
var view = this.getView();
var rootView = SSE.getController('AddContainer').rootView;
view.showPage(rootView, navbar);
var cell = me.api.asc_getCellInfo(),
celltype = cell.asc_getSelectionType();
var allowinternal = (celltype!==Asc.c_oAscSelectionType.RangeImage && celltype!==Asc.c_oAscSelectionType.RangeShape &&
celltype!==Asc.c_oAscSelectionType.RangeShapeText && celltype!==Asc.c_oAscSelectionType.RangeChart &&
celltype!==Asc.c_oAscSelectionType.RangeChartText);
view.optionDisplayText(cell.asc_getLockText() ? 'locked' : cell.asc_getText());
view.optionAllowInternal(allowinternal);
allowinternal && view.optionLinkType( cfgLink.type );
view.fireEvent('page:show', [this, '#addlink']);
},
onInsertLink: function(args){
SSE.getController('AddContainer').hideModal();
},
textInvalidRange : 'ERROR! Invalid cells range',
txtNotUrl : 'This field should be a URL in the format \"http://www.example.com\"'
}
})(), SSE.Controllers.AddLink || {}))
});

View file

@ -1,208 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddOther.js
*
* Created by Kadushkin Maxim on 12/07/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/add/AddOther'
], function (core) {
'use strict';
SSE.Controllers.AddOther = Backbone.Controller.extend(_.extend((function() {
return {
models: [],
collections: [],
views: [
'AddOther'
],
initialize: function () {
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
this.addListeners({
'AddOther': {
'page:show' : this.onPageShow
, 'image:insert': this.onInsertImage
, 'insert:sort': this.onInsertSort
, 'insert:filter': this.onInsertFilter
}
});
},
setApi: function (api) {
var me = this;
me.api = api;
me.api.asc_registerCallback('asc_onError', _.bind(me.onError, me));
// me.api.asc_registerCallback('asc_onInitEditorFonts', _.bind(onApiLoadFonts, me));
},
setMode: function (mode) {
this.view = this.getView('AddOther');
this.view.canViewComments = mode.canViewComments;
},
setHideAddComment: function(hide) {
this.view.isComments = hide; //prohibit adding multiple comments in one cell
},
onLaunch: function () {
this.createView('AddOther').render();
},
initEvents: function (args) {
if ( args && !(_.indexOf(args.panels, 'image') < 0) ) {
this.onPageShow(this.getView('AddOther'), '#addother-insimage');
}
this.view.hideInsertComments = this.isHideInsertComment();
},
isHideInsertComment: function() {
var cellinfo = this.api.asc_getCellInfo();
var iscelllocked = cellinfo.asc_getLocked(),
seltype = cellinfo.asc_getSelectionType();
if (seltype === Asc.c_oAscSelectionType.RangeCells && !iscelllocked) {
return false;
}
return true;
},
onPageShow: function (view, pageId) {
var me = this;
if (pageId == '#addother-sort') {
var filterInfo = me.api.asc_getCellInfo().asc_getAutoFilterInfo();
view.optionAutofilter( filterInfo ? filterInfo.asc_getIsAutoFilter() : null)
} else
if (pageId == '#addother-insimage') {
$('#addimage-url').single('click', function(e) {
view.showImageFromUrl();
});
$('#addimage-file').single('click', function () {
me.onInsertImage({islocal:true});
});
} else if (pageId === "#addother-insert-comment") {
me.initInsertComment(false);
}
},
// Handlers
initInsertComment: function (documentFlag) {
var comment = SSE.getController('Common.Controllers.Collaboration').getCommentInfo();
if (comment) {
this.getView('AddOther').renderComment(comment);
$('#done-comment').single('click', _.bind(this.onDoneComment, this, documentFlag));
$('.back-from-add-comment').single('click', _.bind(function () {
if ($('#comment-text').val().length > 0) {
uiApp.modal({
title: '',
text: this.textDeleteDraft,
buttons: [
{
text: this.textCancel
},
{
text: this.textDelete,
bold: true,
onClick: function () {
SSE.getController('AddContainer').rootView.router.back();
}
}]
})
} else {
SSE.getController('AddContainer').rootView.router.back();
}
}, this))
}
},
onDoneComment: function(documentFlag) {
var value = $('#comment-text').val().trim();
if (value.length > 0) {
if (SSE.getController('Common.Controllers.Collaboration').onAddNewComment(value, documentFlag)) {
this.view.isComments = true;
}
SSE.getController('AddContainer').hideModal();
}
},
onInsertImage: function (args) {
if ( !args.islocal ) {
var me = this;
var url = args.url;
if (!_.isEmpty(url)) {
if ((/((^https?)|(^ftp)):\/\/.+/i.test(url))) {
SSE.getController('AddContainer').hideModal();
} else {
uiApp.alert(me.txtNotUrl);
}
} else {
uiApp.alert(me.textEmptyImgUrl);
}
} else {
SSE.getController('AddContainer').hideModal();
}
},
onInsertSort: function(type) {
this.api.asc_sortColFilter(type == 'down' ? Asc.c_oAscSortOptions.Ascending : Asc.c_oAscSortOptions.Descending, '', undefined, undefined, true);
},
onInsertFilter: function(checked) {
},
onError: function(id, level, errData) {
if(id === Asc.c_oAscError.ID.AutoFilterDataRangeError) {
this.getView('AddOther').optionAutofilter(false);
}
},
textEmptyImgUrl : 'You need to specify image URL.',
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"',
textDeleteDraft: 'Do you really want to delete draft?',
textCancel: 'Cancel',
//textContinue: 'Continue',
textDelete: 'Delete'
}
})(), SSE.Controllers.AddOther || {}))
});

View file

@ -1,224 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddShape.js
*
* Created by Maxim Kadushkin on 12/07/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/add/AddShape'
], function (core) {
'use strict';
SSE.Controllers.AddShape = Backbone.Controller.extend(_.extend((function() {
var _styles = [];
return {
models: [],
collections: [],
views: [
'AddShape'
],
initialize: function () {
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
// Fill shapes
function randomColor() {
return '#' + Math.floor(Math.random()*16777215).toString(16);
}
_styles = [
{
title: 'Text',
thumb: 'shape-01.svg',
type: 'textRect'
},
{
title: 'Line',
thumb: 'shape-02.svg',
type: 'line'
},
{
title: 'Line with arrow',
thumb: 'shape-03.svg',
type: 'lineWithArrow'
},
{
title: 'Line with two arrows',
thumb: 'shape-04.svg',
type: 'lineWithTwoArrows'
},
{
title: 'Rect',
thumb: 'shape-05.svg',
type: 'rect'
},
{
title: 'Hexagon',
thumb: 'shape-06.svg',
type: 'hexagon'
},
{
title: 'Round rect',
thumb: 'shape-07.svg',
type: 'roundRect'
},
{
title: 'Ellipse',
thumb: 'shape-08.svg',
type: 'ellipse'
},
{
title: 'Triangle',
thumb: 'shape-09.svg',
type: 'triangle'
},
{
title: 'Triangle',
thumb: 'shape-10.svg',
type: 'rtTriangle'
},
{
title: 'Trapezoid',
thumb: 'shape-11.svg',
type: 'trapezoid'
},
{
title: 'Diamond',
thumb: 'shape-12.svg',
type: 'diamond'
},
{
title: 'Right arrow',
thumb: 'shape-13.svg',
type: 'rightArrow'
},
{
title: 'Left-right arrow',
thumb: 'shape-14.svg',
type: 'leftRightArrow'
},
{
title: 'Left arrow callout',
thumb: 'shape-15.svg',
type: 'leftArrow'
},
{
title: 'Right arrow callout',
thumb: 'shape-16.svg',
type: 'bentUpArrow'
},
{
title: 'Flow chart off page connector',
thumb: 'shape-17.svg',
type: 'flowChartOffpageConnector'
},
{
title: 'Heart',
thumb: 'shape-18.svg',
type: 'heart'
},
{
title: 'Math minus',
thumb: 'shape-19.svg',
type: 'mathMinus'
},
{
title: 'Math plus',
thumb: 'shape-20.svg',
type: 'mathPlus'
},
{
title: 'Parallelogram',
thumb: 'shape-21.svg',
type: 'parallelogram'
},
{
title: 'Wedge rect callout',
thumb: 'shape-22.svg',
type: 'wedgeRectCallout'
},
{
title: 'Wedge ellipse callout',
thumb: 'shape-23.svg',
type: 'wedgeEllipseCallout'
},
{
title: 'Cloud callout',
thumb: 'shape-24.svg',
type: 'cloudCallout'
}
];
var elementsInRow = 4;
var groups = _.chain(_styles).groupBy(function(element, index){
return Math.floor(index/elementsInRow);
}).toArray().value();
Common.SharedSettings.set('shapes', groups);
Common.NotificationCenter.trigger('shapes:load', groups);
},
setApi: function (api) {
this.api = api;
},
onLaunch: function () {
this.createView('AddShape').render();
},
initEvents: function () {
var me = this;
$('#add-shape li').single('click', _.buffered(me.onShapeClick, 100, me));
},
onShapeClick: function (e) {
SSE.getController('AddContainer').hideModal();
},
// Public
getStyles: function () {
return _styles;
}
}
})(), SSE.Controllers.AddShape || {}))
});

View file

@ -1,559 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditCell.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/6/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/edit/EditCell',
'jquery',
'underscore',
'backbone',
'common/mobile/lib/component/ThemeColorPalette'
], function (core, view, $, _, Backbone) {
'use strict';
SSE.Controllers.EditCell = Backbone.Controller.extend(_.extend((function() {
var _stack = [],
_borderInfo = {color: '000000', width: Asc.c_oAscBorderStyles.Medium};
return {
models: [],
collections: [],
views: [
'EditCell'
],
initialize: function () {
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
this.addListeners({
'EditCell': {
'page:show' : this.onPageShow,
'font:click' : this.onFontClick,
'style:click' : this.onStyleClick
}
});
this._fontsArray = [];
this._styleSize = {width: 100, height: 50};
this._cellStyles = [];
this._cellInfo = undefined;
this._fontInfo = {};
this._isEdit = false;
},
setApi: function (api) {
var me = this;
me.api = api;
me.api.asc_setThumbnailStylesSizes(me._styleSize.width, me._styleSize.height);
me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onApiSelectionChanged, me));
me.api.asc_registerCallback('asc_onEditorSelectionChanged', _.bind(me.onApiEditorSelectionChanged, me));
},
setMode: function (mode) {
this._isEdit = mode.isEdit;
},
onLaunch: function () {
this.createView('EditCell').render();
},
initEvents: function () {
if ($('#edit-cell').length < 1) {
return;
}
var me = this;
$('#font-bold').single('click', _.bind(me.onBold, me));
$('#font-italic').single('click', _.bind(me.onItalic, me));
$('#font-underline').single('click', _.bind(me.onUnderline, me));
me.getView('EditCell').renderStyles(me._cellStyles);
me.initSettings();
},
onPageShow: function (view, pageId) {
var me = this;
me.initSettings(pageId);
},
initSettings: function (pageId) {
var me = this;
if ('#edit-text-fonts' == pageId) {
me.initFontsPage();
} else if ('#edit-text-color' == pageId) {
me.initTextColorPage();
} else if ('#edit-fill-color' == pageId) {
me.initFillColorPage();
} else if ('#edit-cell-border-color' == pageId) {
me.initBorderColorPage();
} else if ('#edit-text-format' == pageId) {
me.initTextFormat();
} else if ('#edit-text-orientation' == pageId) {
me.initTextOrientation();
} else if ('#edit-border-style' == pageId) {
me.initBorderStyle();
} else if (!_.isUndefined(pageId) && pageId.indexOf('#edit-cell-format') > -1) {
me.initCellFormat();
} else {
me.initCellSettings(me._cellInfo);
}
},
// Public
getFonts: function() {
return this._fontsArray;
},
getStack: function() {
return _stack;
},
getFontInfo: function () {
return this._fontInfo;
},
getCell: function () {
return this._cellInfo;
},
getStyleSize: function () {
return this._styleSize;
},
initFontsPage: function () {
var me = this,
displaySize = this._fontInfo.size;
_.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt;
$('#font-size .item-after label').html(displaySize);
$('#font-size .button').single('click', _.bind(me.onFontSize, me));
},
initTextColorPage: function () {
var me = this,
palette = me.getView('EditCell').paletteTextColor,
color = me._sdkToThemeColor(this._fontInfo.color);
if (palette) {
palette.select(color);
palette.on('select', _.bind(me.onTextColor, me));
}
},
initFillColorPage: function () {
if (_.isUndefined(this._cellInfo)) return;
var me = this,
palette = me.getView('EditCell').paletteFillColor,
color = me._sdkToThemeColor(me._cellInfo.asc_getXfs().asc_getFillColor());
if (palette) {
palette.select(color);
palette.on('select', _.bind(me.onFillColor, me));
}
},
initBorderColorPage: function () {
var me = this;
me.getView('EditCell').showBorderColorPage();
var palette = me.getView('EditCell').paletteBorderColor;
if (palette) {
palette.select(_borderInfo.color);
palette.on('select', _.bind(function (palette, color) {
_borderInfo.color = color;
$('#edit-border-color .color-preview').css('background-color', '#' + (_.isObject(_borderInfo.color) ? _borderInfo.color.color : _borderInfo.color));
}, me));
}
},
initTextFormat: function () {
if (_.isUndefined(this._cellInfo)) return;
var me = this,
$pageTextFormat = $('.page[data-page=edit-text-format]'),
xfs = me._cellInfo.asc_getXfs(),
hAlign = xfs.asc_getHorAlign(),
vAlign = xfs.asc_getVertAlign(),
hAlignStr = 'left',
vAlignStr = 'bottom',
isWrapText = xfs.asc_getWrapText();
if (vAlign == Asc.c_oAscVAlign.Top)
vAlignStr = 'top';
else if (vAlign == Asc.c_oAscVAlign.Center)
vAlignStr = 'center';
switch (hAlign) {
case AscCommon.align_Center: hAlignStr = 'center'; break;
case AscCommon.align_Right: hAlignStr = 'right'; break;
case AscCommon.align_Justify: hAlignStr = 'justify'; break;
}
$('#text-format .item-media i').removeClass().addClass(Common.Utils.String.format('icon icon-text-align-{0}', hAlignStr));
if ($pageTextFormat.length > 0) {
var $radioHAlign = $pageTextFormat.find('input:radio[name=text-halign]'),
$radioVAlign = $pageTextFormat.find('input:radio[name=text-valign]'),
$switchWrapText = $pageTextFormat.find('#edit-cell-wrap-text input');
$radioHAlign.val([hAlignStr]);
$radioVAlign.val([vAlignStr]);
$switchWrapText.prop('checked', isWrapText);
$radioHAlign.single('change', _.bind(me.onHAlignChange, me));
$radioVAlign.single('change', _.bind(me.onVAlignChange, me));
$switchWrapText.single('change', _.bind(me.onWrapTextChange, me));
}
},
initCellFormat: function () {
var me = this,
$pageCellFormat = $('.page[data-page=edit-cell-format]');
if ($pageCellFormat.length > 0) {
$pageCellFormat.find('.item-link.no-indicator[data-type]').single('click', _.bind(me.onCellFormat, me));
}
},
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', '#' + (_.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());
$('#edit-border-size select').single('change', function (e) {
_borderInfo.width = parseInt($(e.currentTarget).val());
})
},
initFontSettings: function (fontObj) {
if (_.isUndefined(fontObj)) {
return;
}
var me = this;
// Init font name
var fontName = fontObj.asc_getFontName() || this.textFonts;
this._fontInfo.name = fontName;
$('#font-fonts .item-title').html(fontName);
// Init font style
$('#font-bold').toggleClass('active', fontObj.asc_getFontBold() === true);
$('#font-italic').toggleClass('active', fontObj.asc_getFontItalic() === true);
$('#font-underline').toggleClass('active', fontObj.asc_getFontUnderline() === true);
// Init font size
this._fontInfo.size = fontObj.asc_getFontSize();
var displaySize = this._fontInfo.size;
_.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt;
$('#font-fonts .item-after span:first-child').html(displaySize);
$('#font-size .item-after label').html(displaySize);
// Init font color
this._fontInfo.color = fontObj.asc_getFontColor();
var color = this._fontInfo.color,
clr = me._sdkToThemeColor(color);
$('#text-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr));
},
initCellSettings: function (cellInfo) {
if (_.isUndefined(cellInfo)) {
return;
}
var me = this,
selectionType = cellInfo.asc_getSelectionType(),
// coAuthDisable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (cellInfo.asc_getLocked()===true || cellInfo.asc_getLockedTable()===true) : false,
// editOptionsDisabled = this._disableEditOptions(selectionType, coAuthDisable),
xfs = cellInfo.asc_getXfs(),
val,
need_disable = false;
me.initFontSettings(xfs);
// Init fill color
var color = xfs.asc_getFillColor(),
clr = me._sdkToThemeColor(color);
$('#fill-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr));
var styleName = cellInfo.asc_getStyleName();
$('#edit-cell .cell-styles li[data-type="' + styleName + '"]').addClass('active');
if (selectionType == Asc.c_oAscSelectionType.RangeChart || selectionType == Asc.c_oAscSelectionType.RangeChartText) {
return;
}
me.initTextOrientation();
me.initTextFormat();
},
// Handlers
onFontSize: function (e) {
var me = this,
$button = $(e.currentTarget),
fontSize = this._fontInfo.size;
if ($button.hasClass('decrement')) {
_.isUndefined(fontSize) ? me.api.asc_decreaseFontSize() : fontSize = Math.max(1, --fontSize);
} else {
_.isUndefined(fontSize) ? me.api.asc_increaseFontSize() : fontSize = Math.min(100, ++fontSize);
}
if (! _.isUndefined(fontSize)) {
me.api.asc_setCellFontSize(fontSize);
}
},
onFontClick: function (view, e) {
var $item = $(e.currentTarget).find('input');
if ($item) {
this.api.asc_setCellFontName($item.prop('value'));
}
},
onStyleClick: function (view, type) {
this.api.asc_setCellStyle(type);
},
onBold: function (e) {
var pressed = this._toggleButton(e);
if (this.api) {
this.api.asc_setCellBold(pressed);
}
},
onItalic: function (e) {
var pressed = this._toggleButton(e);
if (this.api) {
this.api.asc_setCellItalic(pressed);
}
},
onUnderline: function (e) {
var pressed = this._toggleButton(e);
if (this.api) {
this.api.asc_setCellUnderline(pressed);
}
},
onTextColor:function (palette, color) {
this.api.asc_setCellTextColor(Common.Utils.ThemeColor.getRgbColor(color));
},
onFillColor:function (palette, color) {
this.api.asc_setCellBackgroundColor(color == 'transparent' ? null : Common.Utils.ThemeColor.getRgbColor(color));
},
onHAlignChange: function (e) {
var $target = $(e.currentTarget),
value = $target.prop('value'),
type = AscCommon.align_Left;
if (value == 'center')
type = AscCommon.align_Center;
else if (value == 'right')
type = AscCommon.align_Right;
else if (value == 'justify')
type = AscCommon.align_Justify;
this.api.asc_setCellAlign(type);
},
onVAlignChange: function (e) {
var $target = $(e.currentTarget),
value = $target.prop('value'),
type = Asc.c_oAscVAlign.Bottom;
if (value == 'top') {
type = Asc.c_oAscVAlign.Top;
} else if (value == 'center') {
type = Asc.c_oAscVAlign.Center;
}
this.api.asc_setCellVertAlign(type);
},
onWrapTextChange: function (e) {
var $target = $(e.currentTarget),
checked = $target.prop('checked');
this.api.asc_setCellTextWrap(checked);
},
onCellFormat: function (e) {
},
onBorderStyle: function (e) {
var me = this,
$target = $(e.currentTarget),
type = $target.data('type'),
newBorders = [],
bordersWidth = _borderInfo.width,
bordersColor = Common.Utils.ThemeColor.getRgbColor(_borderInfo.color);
if (type == 'inner') {
newBorders[Asc.c_oAscBorderOptions.InnerV] = new Asc.asc_CBorder(bordersWidth, bordersColor);
newBorders[Asc.c_oAscBorderOptions.InnerH] = new Asc.asc_CBorder(bordersWidth, bordersColor);
} else if (type == 'all') {
newBorders[Asc.c_oAscBorderOptions.InnerV] = new Asc.asc_CBorder(bordersWidth, bordersColor);
newBorders[Asc.c_oAscBorderOptions.InnerH] = new Asc.asc_CBorder(bordersWidth, bordersColor);
newBorders[Asc.c_oAscBorderOptions.Left] = new Asc.asc_CBorder(bordersWidth, bordersColor);
newBorders[Asc.c_oAscBorderOptions.Top] = new Asc.asc_CBorder(bordersWidth, bordersColor);
newBorders[Asc.c_oAscBorderOptions.Right] = new Asc.asc_CBorder(bordersWidth, bordersColor);
newBorders[Asc.c_oAscBorderOptions.Bottom] = new Asc.asc_CBorder(bordersWidth, bordersColor);
} else if (type == 'outer') {
newBorders[Asc.c_oAscBorderOptions.Left] = new Asc.asc_CBorder(bordersWidth, bordersColor);
newBorders[Asc.c_oAscBorderOptions.Top] = new Asc.asc_CBorder(bordersWidth, bordersColor);
newBorders[Asc.c_oAscBorderOptions.Right] = new Asc.asc_CBorder(bordersWidth, bordersColor);
newBorders[Asc.c_oAscBorderOptions.Bottom] = new Asc.asc_CBorder(bordersWidth, bordersColor);
} else if (type != 'none') {
var borderId = parseInt(type);
newBorders[borderId] = new Asc.asc_CBorder(bordersWidth, bordersColor);
}
me.api.asc_setCellBorders(newBorders);
},
// API handlers
onApiEditorSelectionChanged: function(fontObj) {
},
onApiSelectionChanged: function(cellInfo) {
},
// Helpers
_toggleButton: function (e) {
return $(e.currentTarget).toggleClass('active').hasClass('active');
},
_sdkToThemeColor: function (color) {
var clr = 'transparent';
if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
clr = {
color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()),
effectValue: color.get_value()
}
} else {
clr = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
}
return clr;
},
initTextOrientation: function() {
if (_.isUndefined(this._cellInfo)) return;
var me = this,
$pageTextOrientation = $('.page[data-page=edit-text-orientation]'),
orientationStr = 'horizontal',
xfs = this._cellInfo.asc_getXfs();
var textAngle = xfs.asc_getAngle();
switch(textAngle) {
case 45: orientationStr = 'anglecount'; break;
case -45: orientationStr = 'angleclock'; break;
case 255: orientationStr = 'vertical'; break;
case 90: orientationStr = 'rotateup'; break;
case -90: orientationStr = 'rotatedown'; break;
case 0: orientationStr = 'horizontal'; break;
}
$('#text-orientation .item-media i').removeClass().addClass(Common.Utils.String.format('icon icon-text-orientation-{0}', orientationStr));
if ($pageTextOrientation.length > 0) {
var $radioOrientation = $pageTextOrientation.find('input:radio[name=text-orientation]');
$radioOrientation.val([orientationStr]);
$radioOrientation.single('change', _.bind(me.onTextOrientationChange, me));
}
},
onTextOrientationChange: function(e) {
var $target = $(e.currentTarget),
value = $target.prop('value');
var angle = 0;
switch (value) {
case 'anglecount': angle = 45; break;
case 'angleclock': angle = -45; break;
case 'vertical': angle = 255; break;
case 'rotateup': angle = 90; break;
case 'rotatedown': angle = -90; break;
}
if (this.api)
this.api.asc_setCellAngle(angle);
},
textFonts: 'Fonts',
textAuto: 'Auto',
textPt: 'pt'
}
})(), SSE.Controllers.EditCell || {}))
});

File diff suppressed because it is too large Load diff

View file

@ -1,625 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditContainer.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/6/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'jquery',
'underscore',
'backbone'
], function (core, $, _, Backbone) {
'use strict';
SSE.Controllers.EditContainer = Backbone.Controller.extend(_.extend((function() {
// Private
var _settings = [];
return {
models: [],
collections: [],
views: [],
initialize: function() {
//
},
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this)); //????
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onApiSelectionChanged, this));
},
onLaunch: function() {
//
},
showModal: function() {
var me = this,
mainView = SSE.getController('Editor').getView('Editor').f7View,
isAndroid = Framework7.prototype.device.android === true;
if ($$('.container-edit.modal-in').length > 0) {
// myApp.closeModal('.picker-modal.edit.modal-in');
// me.fireEvent('editcontainer:error', [this, 'alreadyOpen']);
return;
}
uiApp.closeModal();
me._showByStack(Common.SharedSettings.get('phone'));
SSE.getController('Toolbar').getView('Toolbar').hideSearch();
},
hideModal: function () {
if (this.picker) {
uiApp.closeModal(this.picker);
}
},
_emptyEditController: function () {
var layout =
'<div class="content-block inset">' +
'<div class="content-block-inner"> ' +
'<p>Select object to edit</p>' +
'</div>' +
'</div>';
return {
caption: this.textSettings,
layout: layout
}
},
_layoutEditorsByStack: function () {
var me = this,
editors = [];
if (_settings.length < 1) {
editors.push(me._emptyEditController());
} else {
if (_.contains(_settings, 'cell')) {
editors.push({
caption: me.textCell,
id: 'edit-cell',
layout: SSE.getController('EditCell').getView('EditCell').rootLayout()
})
}
if (_.contains(_settings, 'table')) {
editors.push({
caption: me.textTable,
id: 'edit-table',
layout: SSE.getController('EditTable').getView('EditTable').rootLayout()
})
}
if (_.contains(_settings, 'shape')) {
editors.push({
caption: me.textShape,
id: 'edit-shape',
layout: SSE.getController('EditShape').getView('EditShape').rootLayout()
})
}
if (_.contains(_settings, 'image')) {
editors.push({
caption: me.textImage,
id: 'edit-image',
layout: SSE.getController('EditImage').getView('EditImage').rootLayout()
})
}
if (_.contains(_settings, 'chart')) {
editors.push({
caption: me.textChart,
id: 'edit-chart',
layout: SSE.getController('EditChart').getView('EditChart').rootLayout()
})
}
if (_.contains(_settings, 'text')) {
editors.push({
caption: me.textText,
id: 'edit-text',
layout: SSE.getController('EditText').getView('EditText').rootLayout()
})
}
if (_.contains(_settings, 'hyperlink')) {
editors.push({
caption: me.textHyperlink,
id: 'edit-link',
layout: SSE.getController('EditHyperlink').getView('EditHyperlink').rootLayout()
})
}
}
return editors;
},
_showByStack: function(isPhone) {
var me = this,
mainView = SSE.getController('Editor').getView('Editor').f7View,
isAndroid = Framework7.prototype.device.android === true,
layoutEditors = me._layoutEditorsByStack();
if ($$('.container-edit.modal-in').length > 0) {
return;
}
// Navigation bar
var $layoutNavbar = $(
'<div class="navbar">' +
'<div data-page="index" class="navbar-inner">' +
'<div class="center sliding categories"></div>' +
(isPhone ? '<div class="right sliding"><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a></div>' : '') +
'</div>' +
'</div>'
);
if (layoutEditors.length < 2) {
$layoutNavbar
.find('.center')
.removeClass('categories')
.html(layoutEditors[0].caption);
} else {
if (isAndroid) {
$layoutNavbar
.find('.center')
.append('<div class="toolbar tabbar"><div data-page="index" class="toolbar-inner"></div></div>');
_.each(layoutEditors, function (layout, index) {
$layoutNavbar
.find('.toolbar-inner')
.append(
'<a href="#' + layout.id + '" class="tab-link ' + (index < 1 ? 'active' : '') + '">' + layout.caption + '</a>'
);
});
$layoutNavbar
.find('.toolbar-inner')
.append('<span class="tab-link-highlight" style="width: ' + (100/layoutEditors.length) + '%;"></span>');
} else {
$layoutNavbar
.find('.center')
.append('<div class="buttons-row"></div>');
_.each(layoutEditors, function (layout, index) {
$layoutNavbar
.find('.buttons-row')
.append(
'<a href="#' + layout.id + '" class="tab-link button ' + (index < 1 ? 'active' : '') + '">' + layout.caption + '</a>'
);
});
}
}
// Content
var $layoutPages = $(
'<div class="pages">' +
'<div class="page" data-page="index">' +
'<div class="page-content tabs">' +
'</div>' +
'</div>' +
'</div>'
);
_.each(layoutEditors, function (editor, index) {
$layoutPages.find('.tabs').append(
'<div id="' + editor.id + '" class="tab view ' + (index < 1 ? 'active' : '') + '">' +
'<div class="pages">' +
'<div class="page no-navbar">' +
'<div class="page-content">' +
editor.layout +
'</div>' +
'</div>' +
'</div>' +
'</div>'
);
});
if (isPhone) {
me.picker = $$(uiApp.pickerModal(
'<div class="picker-modal settings container-edit">' +
'<div class="view edit-root-view navbar-through">' +
$layoutNavbar.prop('outerHTML') +
$layoutPages.prop('outerHTML') +
'</div>' +
'</div>'
)).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});
} else {
me.picker = uiApp.popover(
'<div class="popover settings container-edit">' +
'<div class="popover-angle"></div>' +
'<div class="popover-inner">' +
'<div class="content-block">' +
'<div class="view popover-view edit-root-view navbar-through">' +
$layoutNavbar.prop('outerHTML') +
$layoutPages.prop('outerHTML') +
'</div>' +
'</div>' +
'</div>',
$$('#toolbar-edit')
);
// Prevent hide overlay. Conflict popover and modals.
var $overlay = $('.modal-overlay');
$$(me.picker).on('opened', function () {
$overlay.on('removeClass', function () {
if (!$overlay.hasClass('modal-overlay-visible')) {
$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()
}
});
}
$('.container-edit .tab').single('show', function (e) {
Common.NotificationCenter.trigger('editcategory:show', e);
});
if (isAndroid) {
$$('.view.edit-root-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed');
$$('.view.edit-root-view .navbar').prependTo('.view.edit-root-view > .pages > .page');
}
me.rootView = uiApp.addView('.edit-root-view', {
dynamicNavbar: true,
domCache: true
});
Common.NotificationCenter.trigger('editcontainer:show');
},
// API handlers
onApiFocusObject: function (objects) {
_settings = [];
// Paragraph : 0,
// Table : 1,
// Image : 2,
// Header : 3,
// Shape : 4,
// Slide : 5,
// Chart : 6,
// MailMerge : 7,
// TextArt : 8
_.each(objects, function(object) {
var type = object.get_ObjectType();
if (Asc.c_oAscTypeSelectElement.Paragraph == type) {
_settings.push('text', 'paragraph');
} else if (Asc.c_oAscTypeSelectElement.Table == type) {
_settings.push('table');
} else if (Asc.c_oAscTypeSelectElement.Image == type) {
if (object.get_ObjectValue().get_ChartProperties()) {
_settings.push('chart');
} else if (object.get_ObjectValue().get_ShapeProperties()) {
_settings.push('shape');
} else {
_settings.push('image');
}
} else if (Asc.c_oAscTypeSelectElement.Hyperlink == type) {
_settings.push('hyperlink');
}
});
// Exclude shapes if chart exist
if (_settings.indexOf('chart') > -1) {
_settings = _.without(_settings, 'shape');
}
_settings = _.uniq(_settings);
//TODO: DEBUG ONLY
_settings = [];
},
onApiSelectionChanged: function (cellInfo) {
_settings = [];
var isCell, isRow, isCol, isAll, isChart, isImage, isTextShape, isShape, isTextChart,
selType = cellInfo.asc_getSelectionType(),
isCellLocked = cellInfo.asc_getLocked(),
isTableLocked = cellInfo.asc_getLockedTable()===true,
isObjLocked = false;
switch (selType) {
case Asc.c_oAscSelectionType.RangeCells: isCell = true; break;
case Asc.c_oAscSelectionType.RangeRow: isRow = true; break;
case Asc.c_oAscSelectionType.RangeCol: isCol = true; break;
case Asc.c_oAscSelectionType.RangeMax: isAll = true; break;
case Asc.c_oAscSelectionType.RangeImage: isImage = true; break;
case Asc.c_oAscSelectionType.RangeShape: isShape = true; break;
case Asc.c_oAscSelectionType.RangeChart: isChart = true; break;
case Asc.c_oAscSelectionType.RangeChartText:isTextChart = true; break;
case Asc.c_oAscSelectionType.RangeShapeText: isTextShape = true; break;
}
if (isImage || isShape || isChart) {
isImage = isShape = isChart = false;
var has_chartprops = false;
var selectedObjects = this.api.asc_getGraphicObjectProps();
for (var i = 0; i < selectedObjects.length; i++) {
if (selectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) {
var elValue = selectedObjects[i].asc_getObjectValue();
isObjLocked = isObjLocked || elValue.asc_getLocked();
var shapeProps = elValue.asc_getShapeProperties();
if (shapeProps) {
if (shapeProps.asc_getFromChart()) {
isChart = true;
} else {
// documentHolder.mnuShapeAdvanced.shapeInfo = elValue;
isShape = true;
}
} else if (elValue.asc_getChartProperties()) {
isChart = true;
has_chartprops = true;
} else {
isImage = true;
}
}
}
// documentHolder.mnuUnGroupImg.setDisabled(isObjLocked || !this.api.asc_canUnGroupGraphicsObjects());
// documentHolder.mnuGroupImg.setDisabled(isObjLocked || !this.api.asc_canGroupGraphicsObjects());
// documentHolder.mnuShapeAdvanced.setVisible(isShape && !isImage && !isChart);
// documentHolder.mnuShapeAdvanced.setDisabled(isObjLocked);
// documentHolder.mnuChartEdit.setVisible(isChart && !isImage && !isShape && has_chartprops);
// documentHolder.mnuChartEdit.setDisabled(isObjLocked);
// documentHolder.pmiImgCut.setDisabled(isObjLocked);
// documentHolder.pmiImgPaste.setDisabled(isObjLocked);
// if (showMenu) this.showPopupMenu(documentHolder.imgMenu, {}, event);
// documentHolder.mnuShapeSeparator.setVisible(documentHolder.mnuShapeAdvanced.isVisible() || documentHolder.mnuChartEdit.isVisible());
} else if (isTextShape || isTextChart) {
var selectedObjects = this.api.asc_getGraphicObjectProps(),
isEquation = false;
for (var i = 0; i < selectedObjects.length; i++) {
var elType = selectedObjects[i].asc_getObjectType();
if (elType == Asc.c_oAscTypeSelectElement.Image) {
var value = selectedObjects[i].asc_getObjectValue(),
align = value.asc_getVerticalTextAlign(),
direct = value.asc_getVert();
isObjLocked = isObjLocked || value.asc_getLocked();
// documentHolder.menuParagraphTop.setChecked(align == Asc.c_oAscVAlign.Top);
// documentHolder.menuParagraphCenter.setChecked(align == Asc.c_oAscVAlign.Center);
// documentHolder.menuParagraphBottom.setChecked(align == Asc.c_oAscVAlign.Bottom);
//
// documentHolder.menuParagraphDirectH.setChecked(direct == Asc.c_oAscVertDrawingText.normal);
// documentHolder.menuParagraphDirect90.setChecked(direct == Asc.c_oAscVertDrawingText.vert);
// documentHolder.menuParagraphDirect270.setChecked(direct == Asc.c_oAscVertDrawingText.vert270);
} else if (elType == Asc.c_oAscTypeSelectElement.Paragraph) {
// documentHolder.pmiTextAdvanced.textInfo = selectedObjects[i].asc_getObjectValue();
// isObjLocked = isObjLocked || documentHolder.pmiTextAdvanced.textInfo.asc_getLocked();
} else if (elType == Asc.c_oAscTypeSelectElement.Math) {
// this._currentMathObj = selectedObjects[i].asc_getObjectValue();
isEquation = true;
}
}
var hyperInfo = cellInfo.asc_getHyperlink(),
can_add_hyperlink = this.api.asc_canAddShapeHyperlink();
// documentHolder.menuHyperlinkShape.setVisible(isTextShape && can_add_hyperlink!==false && hyperInfo);
// documentHolder.menuAddHyperlinkShape.setVisible(isTextShape && can_add_hyperlink!==false && !hyperInfo);
// documentHolder.menuParagraphVAlign.setVisible(isTextChart!==true && !isEquation); // убрать после того, как заголовок можно будет растягивать по вертикали!!
// documentHolder.menuParagraphDirection.setVisible(isTextChart!==true && !isEquation); // убрать после того, как заголовок можно будет растягивать по вертикали!!
// documentHolder.pmiTextAdvanced.setVisible(documentHolder.pmiTextAdvanced.textInfo!==undefined);
//
// _.each(documentHolder.textInShapeMenu.items, function(item) {
// item.setDisabled(isObjLocked);
// });
// documentHolder.pmiTextCopy.setDisabled(false);
//
// //equation menu
// var eqlen = 0;
// this._currentParaObjDisabled = isObjLocked;
// if (isEquation) {
// eqlen = this.addEquationMenu(4);
// } else
// this.clearEquationMenu(4);
//
// if (showMenu) this.showPopupMenu(documentHolder.textInShapeMenu, {}, event);
// documentHolder.textInShapeMenu.items[3].setVisible( documentHolder.menuHyperlinkShape.isVisible() ||
// documentHolder.menuAddHyperlinkShape.isVisible() ||
// documentHolder.menuParagraphVAlign.isVisible() || isEquation);
}
// } else if (selType !== Asc.c_oAscSelectionType.RangeImage && selType !== Asc.c_oAscSelectionType.RangeShape &&
// selType !== Asc.c_oAscSelectionType.RangeChart && selType !== Asc.c_oAscSelectionType.RangeChartText && selType !== Asc.c_oAscSelectionType.RangeShapeText) {
//
// var isCellEdit = this.api.isCellEdited,
// formatTableInfo = cellInfo.asc_getFormatTableInfo(),
// isinsparkline = (cellInfo.asc_getSparklineInfo()!==null),
// isintable = (formatTableInfo !== null),
// ismultiselect = cellInfo.asc_getMultiselect();
// documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null;
// documentHolder.ssMenu.cellColor = cellInfo.asc_getFill().asc_getColor();
// documentHolder.ssMenu.fontColor = cellInfo.asc_getXfs().asc_getFontColor();
//
// documentHolder.pmiInsertEntire.setVisible(isRow||isCol);
// documentHolder.pmiInsertEntire.setCaption((isRow) ? this.textInsertTop : this.textInsertLeft);
// documentHolder.pmiDeleteEntire.setVisible(isRow||isCol);
// documentHolder.pmiInsertCells.setVisible(isCell && !isCellEdit && !isintable);
// documentHolder.pmiDeleteCells.setVisible(isCell && !isCellEdit && !isintable);
// documentHolder.pmiSelectTable.setVisible(isCell && !isCellEdit && isintable);
// documentHolder.pmiInsertTable.setVisible(isCell && !isCellEdit && isintable);
// documentHolder.pmiDeleteTable.setVisible(isCell && !isCellEdit && isintable);
// documentHolder.pmiSparklines.setVisible(isinsparkline);
// documentHolder.pmiSortCells.setVisible((isCell||isAll||cansort) && !isCellEdit);
// documentHolder.pmiFilterCells.setVisible((isCell||cansort) && !isCellEdit);
// documentHolder.pmiReapply.setVisible((isCell||isAll||cansort) && !isCellEdit);
// documentHolder.ssMenu.items[12].setVisible((isCell||isAll||cansort||isinsparkline) && !isCellEdit);
// documentHolder.pmiInsFunction.setVisible(isCell||insfunc);
// documentHolder.pmiAddNamedRange.setVisible(isCell && !isCellEdit);
//
// if (isintable) {
// documentHolder.pmiInsertTable.menu.items[0].setDisabled(!formatTableInfo.asc_getIsInsertRowAbove());
// documentHolder.pmiInsertTable.menu.items[1].setDisabled(!formatTableInfo.asc_getIsInsertRowBelow());
// documentHolder.pmiInsertTable.menu.items[2].setDisabled(!formatTableInfo.asc_getIsInsertColumnLeft());
// documentHolder.pmiInsertTable.menu.items[3].setDisabled(!formatTableInfo.asc_getIsInsertColumnRight());
//
// documentHolder.pmiDeleteTable.menu.items[0].setDisabled(!formatTableInfo.asc_getIsDeleteRow());
// documentHolder.pmiDeleteTable.menu.items[1].setDisabled(!formatTableInfo.asc_getIsDeleteColumn());
// documentHolder.pmiDeleteTable.menu.items[2].setDisabled(!formatTableInfo.asc_getIsDeleteTable());
//
// }
//
// var hyperinfo = cellInfo.asc_getHyperlink();
// documentHolder.menuHyperlink.setVisible(isCell && hyperinfo && !isCellEdit && !ismultiselect);
// documentHolder.menuAddHyperlink.setVisible(isCell && !hyperinfo && !isCellEdit && !ismultiselect);
//
// documentHolder.pmiRowHeight.setVisible(isRow||isAll);
// documentHolder.pmiColumnWidth.setVisible(isCol||isAll);
// documentHolder.pmiEntireHide.setVisible(isCol||isRow);
// documentHolder.pmiEntireShow.setVisible(isCol||isRow);
// documentHolder.pmiFreezePanes.setVisible(!isCellEdit);
// documentHolder.pmiFreezePanes.setCaption(this.api.asc_getSheetViewSettings().asc_getIsFreezePane() ? documentHolder.textUnFreezePanes : documentHolder.textFreezePanes);
// documentHolder.pmiEntriesList.setVisible(!isCellEdit);
//
// /** coauthoring begin **/
// documentHolder.ssMenu.items[17].setVisible(isCell && !isCellEdit && this.permissions.canCoAuthoring && this.permissions.canComments);
// documentHolder.pmiAddComment.setVisible(isCell && !isCellEdit && this.permissions.canCoAuthoring && this.permissions.canComments);
// /** coauthoring end **/
// documentHolder.pmiCellMenuSeparator.setVisible(isCell || isRow || isCol || isAll || insfunc);
// documentHolder.pmiEntireHide.isrowmenu = isRow;
// documentHolder.pmiEntireShow.isrowmenu = isRow;
//
// documentHolder.setMenuItemCommentCaptionMode(cellInfo.asc_getComments().length > 0);
// commentsController && commentsController.blockPopover(true);
//
// documentHolder.pmiClear.menu.items[1].setDisabled(isCellEdit);
// documentHolder.pmiClear.menu.items[2].setDisabled(isCellEdit);
// documentHolder.pmiClear.menu.items[3].setDisabled(isCellEdit);
// documentHolder.pmiClear.menu.items[4].setDisabled(isCellEdit);
//
// documentHolder.pmiClear.menu.items[3].setVisible(!this.permissions.isEditDiagram);
// documentHolder.pmiClear.menu.items[4].setVisible(!this.permissions.isEditDiagram);
//
// var filterInfo = cellInfo.asc_getAutoFilterInfo(),
// isApplyAutoFilter = (filterInfo) ? filterInfo.asc_getIsApplyAutoFilter() : false;
// filterInfo = (filterInfo) ? filterInfo.asc_getIsAutoFilter() : null;
// documentHolder.pmiInsertCells.menu.items[0].setDisabled(isApplyAutoFilter);
// documentHolder.pmiDeleteCells.menu.items[0].setDisabled(isApplyAutoFilter);
// documentHolder.pmiInsertCells.menu.items[1].setDisabled(isApplyAutoFilter);
// documentHolder.pmiDeleteCells.menu.items[1].setDisabled(isApplyAutoFilter);
//
// _.each(documentHolder.ssMenu.items, function(item) {
// item.setDisabled(isCellLocked);
// });
// documentHolder.pmiCopy.setDisabled(false);
// documentHolder.pmiInsertEntire.setDisabled(isCellLocked || isTableLocked);
// documentHolder.pmiInsertCells.setDisabled(isCellLocked || isTableLocked);
// documentHolder.pmiInsertTable.setDisabled(isCellLocked || isTableLocked);
// documentHolder.pmiDeleteEntire.setDisabled(isCellLocked || isTableLocked);
// documentHolder.pmiDeleteCells.setDisabled(isCellLocked || isTableLocked);
// documentHolder.pmiDeleteTable.setDisabled(isCellLocked || isTableLocked);
// documentHolder.pmiFilterCells.setDisabled(isCellLocked || isTableLocked|| (filterInfo==null));
// documentHolder.pmiSortCells.setDisabled(isCellLocked || isTableLocked|| (filterInfo==null));
// documentHolder.pmiReapply.setDisabled(isCellLocked || isTableLocked|| (isApplyAutoFilter!==true));
// if (showMenu) this.showPopupMenu(documentHolder.ssMenu, {}, event);
// }
if (isChart || isTextChart) {
_settings.push('chart');
if (isTextChart) {
_settings.push('text');
}
} else if ((isShape || isTextShape) && !isImage) {
_settings.push('shape');
if (isTextShape) {
_settings.push('text');
}
} else if (isImage) {
_settings.push('image');
if (isShape) {
_settings.push('shape');
}
} else {
_settings.push('cell');
if (cellInfo.asc_getHyperlink()) {
_settings.push('hyperlink');
}
}
},
textSettings: 'Settings',
textCell: 'Cell',
textTable: 'Table',
textShape: 'Shape',
textImage: 'Image',
textChart: 'Chart',
textText: 'Text',
textHyperlink: 'Hyperlink'
}
})(), SSE.Controllers.EditContainer || {}))
});

View file

@ -1,259 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditHyperlink.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/20/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/edit/EditHyperlink',
'jquery',
'underscore',
'backbone'
], function (core, view, $, _, Backbone) {
'use strict';
SSE.Controllers.EditHyperlink = Backbone.Controller.extend(_.extend((function() {
return {
models: [],
collections: [],
views: [
'EditHyperlink'
],
initialize: function () {
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
this.addListeners({
'EditHyperlink': {
'page:show' : this.onPageShow
}
});
},
setApi: function (api) {
var me = this;
me.api = api;
},
onLaunch: function () {
this.createView('EditHyperlink').render();
},
initEvents: function () {
if ($('#edit-link').length < 1) {
return;
}
uiApp.addView('#edit-link');
var me = this;
me.initSettings();
},
onPageShow: function (view, pageId) {
var me = this;
me.initSettings(pageId);
},
initSettings: function (pageId) {
var me = this;
if ('#edit-link-type-view' == pageId) {
var $radioLinkType = $('.page[data-page=edit-link-type-view]').find('input:radio[name=link-type]');
$radioLinkType.val([me.linkType]);
$radioLinkType.single('change', _.bind(me.onTypeChange, me));
} else if ('#edit-link-sheet-view' == pageId) {
var sheetCount = me.api.asc_getWorksheetsCount(),
i = -1,
template = '';
while (++i < sheetCount) {
if (!me.api.asc_isWorksheetHidden(i)) {
template += '<li>' +
'<label class="label-radio item-content">' +
'<input type="radio" name="link-sheet" value="' + me.api.asc_getWorksheetName(i) + '">';
if (Common.SharedSettings.get('android')) {
template += '<div class="item-media"><i class="icon icon-form-radio"></i></div>';
}
template += '<div class="item-inner">' +
'<div class="item-title">' + me.api.asc_getWorksheetName(i) + '</div>' +
'</div>' +
'</label>' +
'</li>';
}
}
$('.page[data-page="edit-link-sheet-view"] .page-content .list-block ul').html(_.template([template].join('')));
var $radioLinkSheet = $('.page[data-page=edit-link-sheet-view]').find('input:radio[name=link-sheet]');
$radioLinkSheet.val([me.linkSheet]);
$radioLinkSheet.single('change', _.bind(function (e) {
me.linkSheet = $(e.currentTarget).prop('value');
$('#edit-link-sheet .item-after').text(me.linkSheet);
}, me));
} else {
var cellInfo = me.api.asc_getCellInfo(),
linkInfo = cellInfo.asc_getHyperlink(),
isLock = cellInfo.asc_getLockText();
me.linkType = linkInfo.asc_getType();
$('#edit-link-type .item-after').text((me.linkType == Asc.c_oAscHyperlinkType.RangeLink) ? me.textInternalLink : me.textExternalLink);
$('#edit-link-sheet, #edit-link-range').css('display', (linkInfo.asc_getType() == Asc.c_oAscHyperlinkType.RangeLink) ? 'block' : 'none');
$('#edit-link-link').css('display', (linkInfo.asc_getType() != Asc.c_oAscHyperlinkType.RangeLink) ? 'block' : 'none');
me.currentSheet = me.api.asc_getWorksheetName(me.api.asc_getActiveWorksheetIndex());
me.linkSheet = (linkInfo.asc_getType() == Asc.c_oAscHyperlinkType.RangeLink) ? linkInfo.asc_getSheet() : me.currentSheet;
$('#edit-link-sheet .item-after').text(me.linkSheet);
$('#edit-link-range input').val(linkInfo.asc_getRange());
$('#edit-link-link input').val(linkInfo.asc_getHyperlinkUrl() ? linkInfo.asc_getHyperlinkUrl().replace(new RegExp(" ", 'g'), "%20") : '');
$('#edit-link-display input').val(isLock ? me.textDefault : linkInfo.asc_getText());
$('#edit-link-display input').toggleClass('disabled', isLock);
$('#edit-link-tip input').val(linkInfo.asc_getTooltip());
var focusInput = ((linkInfo.asc_getType() == Asc.c_oAscHyperlinkType.RangeLink) ? $('#edit-link-range input') : $('#edit-link-link input'));
$('#edit-link-edit').toggleClass('disabled', _.isEmpty(focusInput.val()));
$('#edit-link-link input, #edit-link-range input').single('input', _.bind(function (e) {
$('#edit-link-edit').toggleClass('disabled', _.isEmpty($(e.currentTarget).val()));
}, me));
$('#edit-link-edit').single('click', _.bind(me.onEdit, me));
$('#edit-link-remove').single('click', _.bind(me.onRemove, me));
}
},
// Handlers
onTypeChange: function (e) {
var val = parseInt($(e.currentTarget).prop('value'));
this.linkType = val;
$('#edit-link-sheet, #edit-link-range').css('display', (val == Asc.c_oAscHyperlinkType.RangeLink) ? 'block' : 'none');
$('#edit-link-link').css('display', (val != Asc.c_oAscHyperlinkType.RangeLink) ? 'block' : 'none');
$('#edit-link-type .item-after').text((this.linkType == Asc.c_oAscHyperlinkType.RangeLink) ? this.textInternalLink : this.textExternalLink);
},
onEdit: function () {
var me = this,
linkProps = new Asc.asc_CHyperlink(),
defaultDisplay = "",
sheet = this.linkSheet,
$range = $('#edit-link-range input'),
$link = $('#edit-link-link input'),
$display = $('#edit-link-display input'),
$tip = $('#edit-link-tip input'),
type = parseInt(this.linkType);
linkProps.asc_setType(type);
if (type == Asc.c_oAscHyperlinkType.RangeLink) {
var range = $.trim($range.val()),
isValidRange = /^[A-Z]+[1-9]\d*:[A-Z]+[1-9]\d*$/.test(range);
if (!isValidRange)
isValidRange = /^[A-Z]+[1-9]\d*$/.test(range);
if (!isValidRange) {
uiApp.alert(me.textInvalidRange);
return;
}
linkProps.asc_setSheet(sheet);
linkProps.asc_setRange(range);
defaultDisplay = sheet + '!' + range;
} else {
var url = $link.val().replace(/^\s+|\s+$/g,'');
if (! /(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(url)) {
var urlType = me.api.asc_getUrlType($.trim(url));
if (urlType < 1) {
uiApp.alert(me.txtNotUrl);
return;
}
url = ( (urlType==2) ? 'mailto:' : 'http://' ) + url;
}
url = url.replace(new RegExp("%20",'g')," ");
linkProps.asc_setHyperlinkUrl(url);
defaultDisplay = url;
}
if ($display.hasClass('disabled')) {
linkProps.asc_setText(null);
} else {
if (_.isEmpty($display.val())) {
$display.val(defaultDisplay);
}
linkProps.asc_setText($display.val());
}
linkProps.asc_setTooltip($tip.val());
me.api.asc_insertHyperlink(linkProps);
SSE.getController('EditContainer').hideModal();
},
onRemove: function () {
this.api && this.api.asc_removeHyperlink();
SSE.getController('EditContainer').hideModal();
},
textExternalLink: 'External Link',
textInternalLink: 'Internal Data Range',
textDefault: 'Selected range',
textInvalidRange: 'Invalid cells range',
textEmptyImgUrl: 'You need to specify image URL.',
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"'
}
})(), SSE.Controllers.EditHyperlink || {}))
});

View file

@ -1,268 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditImage.js
* Document Editor
*
* Created by Alexander Yuzhin on 11/3/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/edit/EditImage',
'jquery',
'underscore',
'backbone'
], function (core, view, $, _, Backbone) {
'use strict';
SSE.Controllers.EditImage = Backbone.Controller.extend(_.extend((function() {
// Private
var _stack = [],
_imageObject = undefined,
_isEdit = false;
return {
models: [],
collections: [],
views: [
'EditImage'
],
initialize: function () {
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
this.addListeners({
'EditImage': {
'page:show': this.onPageShow
}
});
},
setApi: function (api) {
var me = this;
me.api = api;
me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onApiSelectionChanged, me));
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onApiFocusObject, me));
},
setMode: function (mode) {
_isEdit = mode.isEdit;
},
onPageShow: function (view, pageId) {
var me = this;
me.initSettings(pageId);
},
onLaunch: function () {
this.createView('EditImage').render();
},
initEvents: function () {
var me = this;
me.initSettings();
},
initSettings: function (pageId) {
if ($('#edit-image').length < 1) {
return;
}
var me = this;
if ('#edit-image-replace-view' == pageId) {
me.initReplacePage();
} else if ('#edit-image-reorder-view' == pageId) {
me.initReorderPage();
} else if ('#edit-image-url-view' == pageId) {
me.initLinkPage();
} else {
me.initRootPage();
}
},
initRootPage: function () {
$('#image-default').single('click', _.bind(this.onDefaultSize, this));
$('#image-remove').single('click', _.bind(this.onRemoveImage, this));
},
initReplacePage: function () {
$('#edit-image-file').single('click', _.bind(this.onReplaceByFile, this));
},
initReorderPage: function () {
$('.page[data-page=edit-image-reorder-view] a.item-link').single('click', _.bind(this.onReorder, this));
},
initLinkPage: function () {
$('.edit-image-url-link .button, .edit-image-url-link .list-button').single('click', _.bind(this.onReplaceByUrl, this));
$('.edit-image-url-link input[type=url]').single('input', _.bind(function(e) {
$('.edit-image-url-link .buttons').toggleClass('disabled', _.isEmpty($(e.currentTarget).val()));
}, this));
_.delay(function () {
$('.edit-image-url-link input[type=url]').focus();
}, 1000);
},
// Public
getImage: function () {
return _imageObject;
},
// Handlers
onDefaultSize: function () {
var me = this;
if (me.api) {
var imgSize = me.api.asc_getOriginalImageSize(),
properties = new Asc.asc_CImgProperty();
properties.put_Width(imgSize.get_ImageWidth());
properties.put_Height(imgSize.get_ImageHeight());
properties.put_ResetCrop(true);
me.api.asc_setGraphicObjectProps(properties);
}
},
onRemoveImage: function () {
this.api.asc_Remove();
SSE.getController('EditContainer').hideModal();
},
onReplaceByFile: function () {
this.api.asc_changeImageFromFile();
SSE.getController('EditContainer').hideModal();
},
onReplaceByUrl: function () {
var me = this,
$input = $('.edit-image-url-link input[type=url]');
if ($input) {
var value = ($input.val()).replace(/ /g, '');
if (!_.isEmpty(value)) {
if ((/((^https?)|(^ftp)):\/\/.+/i.test(value))) {
SSE.getController('EditContainer').hideModal();
_.defer(function () {
var image = new Asc.asc_CImgProperty();
image.asc_putImageUrl(value);
me.api.asc_setGraphicObjectProps(image);
});
} else {
uiApp.alert(me.txtNotUrl);
}
} else {
uiApp.alert(me.textEmptyImgUrl);
}
}
},
onReorder: function (e) {
var $target = $(e.currentTarget),
type = $target.data('type'),
ascType;
if (type == 'all-up') {
ascType = Asc.c_oAscDrawingLayerType.BringToFront;
} else if (type == 'all-down') {
ascType = Asc.c_oAscDrawingLayerType.SendToBack;
} else if (type == 'move-up') {
ascType = Asc.c_oAscDrawingLayerType.BringForward;
} else {
ascType = Asc.c_oAscDrawingLayerType.SendBackward;
}
this.api.asc_setSelectedDrawingObjectLayer(ascType);
},
// API handlers
onApiSelectionChanged: function(info) {
if (!_isEdit) {
return;
}
var me = this,
selectedObjects = [],
selectType = info.asc_getSelectionType();
if (selectType == Asc.c_oAscSelectionType.RangeImage) {
selectedObjects = me.api.asc_getGraphicObjectProps();
}
me.onApiFocusObject(selectedObjects);
},
onApiFocusObject: function (objects) {
_stack = objects;
if (!_isEdit) {
return;
}
var images = [];
_.each(_stack, function (object) {
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Image) {
images.push(object.get_ObjectValue());
}
});
var getTopObject = function(array) {
if (array.length > 0) {
return array[array.length - 1]; // get top
} else {
return undefined;
}
};
_imageObject = getTopObject(images);
},
textEmptyImgUrl: 'You need to specify image URL.',
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"'
}
})(), SSE.Controllers.EditImage || {}))
});

View file

@ -1,437 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditShape.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/19/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/edit/EditShape',
'jquery',
'underscore',
'backbone'
], function (core, view, $, _, Backbone) {
'use strict';
SSE.Controllers.EditShape = Backbone.Controller.extend(_.extend((function() {
// Private
var _stack = [],
_shapeObject = undefined,
_borderInfo = {color: '000000', width: 1},
_metricText = Common.Utils.Metric.getCurrentMetricName(),
_isEdit = false;
var borderSizeTransform = (function() {
var _sizes = [0, 0.5, 1, 1.5, 2.25, 3, 4.5, 6];
return {
sizeByIndex: function (index) {
if (index < 1) return _sizes[0];
if (index > _sizes.length - 1) return _sizes[_sizes.length - 1];
return _sizes[index];
},
indexSizeByValue: function (value) {
var index = 0;
_.each(_sizes, function (size, idx) {
if (Math.abs(size - value) < 0.25) {
index = idx;
}
});
return index;
},
sizeByValue: function (value) {
return _sizes[this.indexSizeByValue(value)];
}
}
})();
return {
models: [],
collections: [],
views: [
'EditShape'
],
initialize: function () {
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
this.addListeners({
'EditShape': {
'page:show': this.onPageShow
}
});
},
setApi: function (api) {
var me = this;
me.api = api;
me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onApiSelectionChanged, me));
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onApiFocusObject, me));
},
setMode: function (mode) {
_isEdit = mode.isEdit;
},
onPageShow: function (view, pageId) {
var me = this;
me.initSettings(pageId);
},
onLaunch: function () {
this.createView('EditShape').render();
},
initEvents: function () {
var me = this;
me.initSettings();
},
initSettings: function (pageId) {
if ($('#edit-shape').length < 1) {
return;
}
var me = this;
if ('#edit-shape-style' == pageId || '#edit-shape-style-nofill' == pageId ) {
me.initStylePage();
} else if ('#edit-shape-border-color-view' == pageId) {
me.initBorderColorPage();
} else if ('#edit-shape-replace' == pageId) {
me.initReplacePage();
} else if ('#edit-shape-reorder' == pageId) {
me.initReorderPage();
} else {
me.initRootPage();
}
},
initRootPage: function () {
$('#shape-remove').single('click', _.bind(this.onRemoveShape, this));
this.getView('EditShape').isShapeCanFill = _shapeObject.get_ShapeProperties().asc_getCanFill();
},
initStylePage: function () {
var me = this,
color,
shapeProperties = _shapeObject.get_ShapeProperties();
// Fill
var paletteFillColor = me.getView('EditShape').paletteFillColor;
paletteFillColor.on('select', _.bind(me.onFillColor, me));
var fill = shapeProperties.asc_getFill(),
fillType = fill.asc_getType();
if (fillType == Asc.c_oAscFill.FILL_TYPE_SOLID) {
color = me._sdkToThemeColor(fill.asc_getFill().asc_getColor());
}
paletteFillColor.select(color);
// Init border
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)) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
$('#edit-shape-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me));
$('#edit-shape-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me));
// Init border color
me._initBorderColorView();
// Effect
// Init style opacity
$('#edit-shape-effect input').val([shapeProperties.get_fill().asc_getTransparent() ? shapeProperties.get_fill().asc_getTransparent() / 2.55 : 100]);
$('#edit-shape-effect .item-after').text($('#edit-shape-effect input').val() + ' ' + "%");
$('#edit-shape-effect input').single('change touchend', _.buffered(me.onOpacity, 100, me));
$('#edit-shape-effect input').single('input', _.bind(me.onOpacityChanging, me));
},
_initBorderColorView: function () {
if (!_shapeObject) return;
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));
},
initReorderPage: function () {
$('.page[data-page=edit-shape-reorder] a.item-link').single('click', _.bind(this.onReorder, this));
},
initBorderColorPage: function () {
var me = this,
palette = me.getView('EditShape').paletteBorderColor;
if (palette) {
palette.select(_borderInfo.color);
palette.on('select', _.bind(me.onBorderColor, me));
}
},
// Public
getShape: function () {
return _shapeObject;
},
// Handlers
onRemoveShape: function () {
this.api.asc_Remove();
SSE.getController('EditContainer').hideModal();
},
onReorder: function(e) {
},
onReplace: function (e) {
},
onBorderSize: function (e) {
var me = this,
$target = $(e.currentTarget),
value = $target.val(),
image = new Asc.asc_CImgProperty(),
shape = new Asc.asc_CShapeProperty(),
stroke = new Asc.asc_CStroke();
value = borderSizeTransform.sizeByIndex(parseInt(value));
if (value < 0.01) {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_COLOR);
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) {
var $target = $(e.currentTarget);
$('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
},
onOpacity: function (e) {
var me = this,
$target = $(e.currentTarget),
value = $target.val(),
properties = new Asc.asc_CImgProperty(),
fill = new Asc.asc_CShapeFill(),
shape = new Asc.asc_CShapeProperty();
fill.asc_putTransparent(parseInt(value * 2.55));
shape.asc_putFill(fill);
properties.put_ShapeProperties(shape);
me.api.asc_setGraphicObjectProps(properties);
},
onOpacityChanging: function (e) {
var $target = $(e.currentTarget);
$('#edit-shape-effect .item-after').text($target.val() + ' %');
},
onFillColor: function(palette, color) {
var me = this,
currentShape = _shapeObject.get_ShapeProperties();
if (me.api) {
var image = new Asc.asc_CImgProperty(),
shape = new Asc.asc_CShapeProperty(),
fill = new Asc.asc_CShapeFill();
if (color == 'transparent') {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
} else {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill(new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor(color));
}
shape.asc_putFill(fill);
image.asc_putShapeProperties(shape);
me.api.asc_setGraphicObjectProps(image);
}
},
onBorderColor: function (palette, color) {
var me = this,
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 && 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();
if (currentShape.get_stroke().get_width() < 0.01) {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_NONE);
} else {
stroke.put_type(Asc.c_oAscStrokeType.STROKE_COLOR);
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(color));
stroke.put_width(currentShape.get_stroke().get_width());
stroke.asc_putPrstDash(currentShape.get_stroke().asc_getPrstDash());
}
shape.put_stroke(stroke);
image.asc_putShapeProperties(shape);
me.api.asc_setGraphicObjectProps(image);
}
},
// API handlers
onApiSelectionChanged: function(info) {
if (!_isEdit) {
return;
}
var me = this,
selectedObjects = [],
selectType = info.asc_getSelectionType();
if (selectType == Asc.c_oAscSelectionType.RangeShape) {
selectedObjects = me.api.asc_getGraphicObjectProps();
}
me.onApiFocusObject(selectedObjects);
},
onApiFocusObject: function (objects) {
_stack = objects;
if (!_isEdit) {
return;
}
if (_stack.length < 1) {
_stack = this.api.asc_getGraphicObjectProps();
}
var shapes = [];
_.each(_stack, function (object) {
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Image) {
if (object.get_ObjectValue() && object.get_ObjectValue().get_ShapeProperties()) {
shapes.push(object);
}
}
});
var getTopObject = function(array) {
if (array.length > 0) {
var object = array[array.length - 1]; // get top
return object.get_ObjectValue();
} else {
return undefined;
}
};
_shapeObject = getTopObject(shapes);
if (_shapeObject)
this.getView('EditShape').isShapeCanFill = _shapeObject.get_ShapeProperties().asc_getCanFill();
},
// Helpers
_pt2mm: function(value) {
return (value * 25.4 / 72.0);
},
_mm2pt: function(value) {
return (value * 72.0 / 25.4);
},
_sdkToThemeColor: function (color) {
var clr = 'transparent';
if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
clr = {
color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()),
effectValue: color.get_value()
}
} else {
clr = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
}
return clr;
}
};
})(), SSE.Controllers.EditShape || {}))
});

View file

@ -1,372 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditText.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/21/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'spreadsheeteditor/mobile/app/view/edit/EditText',
'jquery',
'underscore',
'backbone'
], function (core, view, $, _, Backbone) {
'use strict';
SSE.Controllers.EditText = Backbone.Controller.extend(_.extend((function() {
// Private
var TextType = {inUnknown: 0, inChart: 1, inShape: 2};
var _textIn = TextType.inUnknown,
_fontInfo = undefined,
_cellInfo = undefined,
_isEdit = false;
return {
models: [],
collections: [],
views: [
'EditText'
],
initialize: function () {
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
this.addListeners({
'EditText': {
'page:show' : this.onPageShow,
'font:click' : this.onFontClick
}
});
},
setApi: function (api) {
var me = this;
me.api = api;
me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onApiSelectionChanged, me));
me.api.asc_registerCallback('asc_onEditorSelectionChanged', _.bind(me.onApiEditorSelectionChanged, me));
},
setMode: function (mode) {
_isEdit = mode.isEdit;
},
onPageShow: function (view, pageId) {
var me = this;
me.initSettings(pageId);
},
onLaunch: function () {
this.createView('EditText').render();
},
initEvents: function () {
var me = this;
me.initSettings();
},
initSettings: function (pageId) {
if ($('#edit-text').length < 1) {
return;
}
var me = this;
if ('#edit-text-fonts' == pageId) {
me.initFontsPage();
} else if ('#edit-text-color' == pageId) {
me.initTextColorPage();
} else {
me.initRootPage();
}
},
initRootPage: function () {
if (_.isUndefined(_fontInfo)) {
return;
}
var me = this;
// Init font name
var fontName = _fontInfo.asc_getFontName() || this.textFonts;
$('#font-fonts .item-title').html(fontName);
// Init font size
var displaySize = _fontInfo.asc_getFontSize();
_.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt;
$('#font-fonts .item-after span:first-child').html(displaySize);
$('#font-size .item-after label').html(displaySize);
// Init font style
$('#font-bold').toggleClass('active', _fontInfo.asc_getFontBold() === true);
$('#font-italic').toggleClass('active', _fontInfo.asc_getFontItalic() === true);
$('#font-underline').toggleClass('active', _fontInfo.asc_getFontUnderline() === true);
// Init font color
var color = _fontInfo.asc_getFontColor(),
clr = me._sdkToThemeColor(color);
$('#font-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr));
// Align
$('#edit-text-align-block').css('display', (_textIn == TextType.inShape) ? 'block' : 'none');
var hAlign = _fontInfo.asc_getHorAlign(),
vAlign = _fontInfo.asc_getVertAlign();
$('#font-left').toggleClass('active', hAlign===AscCommon.align_Left);
$('#font-center').toggleClass('active', hAlign===AscCommon.align_Center);
$('#font-right').toggleClass('active', hAlign===AscCommon.align_Right);
$('#font-just').toggleClass('active', hAlign===AscCommon.align_Justify);
$('#font-top').toggleClass('active', vAlign===Asc.c_oAscVAlign.Top);
$('#font-middle').toggleClass('active', vAlign===Asc.c_oAscVAlign.Center);
$('#font-bottom').toggleClass('active', vAlign===Asc.c_oAscVAlign.Bottom);
// Handlers
$('#font-bold').single('click', _.bind(me.onBold, me));
$('#font-italic').single('click', _.bind(me.onItalic, me));
$('#font-underline').single('click', _.bind(me.onUnderline, me));
$('#font-left').single('click', _.bind(me.onHAlign, me, AscCommon.align_Left));
$('#font-center').single('click', _.bind(me.onHAlign, me, AscCommon.align_Center));
$('#font-right').single('click', _.bind(me.onHAlign, me, AscCommon.align_Right));
$('#font-just').single('click', _.bind(me.onHAlign, me, AscCommon.align_Justify));
$('#font-top').single('click', _.bind(me.onVAlign, me, Asc.c_oAscVAlign.Top));
$('#font-middle').single('click', _.bind(me.onVAlign, me, Asc.c_oAscVAlign.Center));
$('#font-bottom').single('click', _.bind(me.onVAlign, me, Asc.c_oAscVAlign.Bottom));
},
initFontsPage: function () {
var me = this,
displaySize = _fontInfo.size;
_.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt;
$('#font-size .item-after label').html(displaySize);
$('#font-size .button').single('click', _.bind(me.onFontSize, me));
_.defer(function () {
me.getView('EditText').renderFonts();
}, me);
},
initTextColorPage: function () {
var me = this,
color = me._sdkToThemeColor(_fontInfo.color),
palette = me.getView('EditText').paletteTextColor;
if (palette) {
palette.select(color);
palette.on('select', _.bind(me.onTextColor, me));
}
},
// Handlers
onFontSize: function (e) {
var me = this,
$button = $(e.currentTarget),
fontSize = _fontInfo.size;
if ($button.hasClass('decrement')) {
_.isUndefined(fontSize) ? me.api.asc_decreaseFontSize() : fontSize = Math.max(1, --fontSize);
} else {
_.isUndefined(fontSize) ? me.api.asc_increaseFontSize() : fontSize = Math.min(100, ++fontSize);
}
if (! _.isUndefined(fontSize)) {
me.api.asc_setCellFontSize(fontSize);
}
},
onFontClick: function (view, e) {
var $item = $(e.currentTarget).find('input');
if ($item) {
this.api.asc_setCellFontName($item.prop('value'));
}
},
onBold: function (e) {
var pressed = this._toggleButton(e);
if (this.api) {
this.api.asc_setCellBold(pressed);
}
},
onItalic: function (e) {
var pressed = this._toggleButton(e);
if (this.api) {
this.api.asc_setCellItalic(pressed);
}
},
onUnderline: function (e) {
var pressed = this._toggleButton(e);
if (this.api) {
this.api.asc_setCellUnderline(pressed);
}
},
onHAlign: function(type, e) {
var $target = $(e.currentTarget);
$target.parent('.row').find('a.button').removeClass('active');
$target.addClass('active');
this.api.asc_setCellAlign(type);
},
onVAlign: function(type, e) {
var $target = $(e.currentTarget);
$target.parent('.row').find('a.button').removeClass('active');
$target.addClass('active');
this.api.asc_setCellVertAlign(type);
},
onTextColor:function (palette, color) {
this.api.asc_setCellTextColor(Common.Utils.ThemeColor.getRgbColor(color));
$('#font-color .color-preview').css('background-color', '#' + (_.isObject(color) ? color.color : color));
},
onHAlignChange: function (e) {
var $target = $(e.currentTarget),
value = $target.prop('value'),
type = AscCommon.align_Left;
if (value == 'center')
type = AscCommon.align_Center;
else if (value == 'right')
type = AscCommon.align_Right;
else if (value == 'justify')
type = AscCommon.align_Justify;
this.api.asc_setCellAlign(type);
},
onVAlignChange: function (e) {
var $target = $(e.currentTarget),
value = $target.prop('value'),
type = Asc.c_oAscVAlign.Bottom;
if (value == 'top') {
type = Asc.c_oAscVAlign.Top;
} else if (value == 'center') {
type = Asc.c_oAscVAlign.Center;
}
this.api.asc_setCellVertAlign(type);
},
// Public
getFontInfo: function () {
return _fontInfo;
},
// API handlers
onApiSelectionChanged: function(info) {
if (!_isEdit) {
return;
}
_cellInfo = info;
_fontInfo = info.asc_getXfs();
var selectType = info.asc_getSelectionType();
switch (selectType) {
case Asc.c_oAscSelectionType.RangeChartText: _textIn = TextType.inChart; break;
case Asc.c_oAscSelectionType.RangeShapeText: _textIn = TextType.inShape; break;
default: _textIn = TextType.inUnknown;
}
},
onApiEditorSelectionChanged: function(fontObj) {
if (!_isEdit) {
return;
}
_fontInfo = fontObj;
},
// Helpers
_toggleButton: function (e) {
return $(e.currentTarget).toggleClass('active').hasClass('active');
},
_sdkToThemeColor: function (color) {
var clr = 'transparent';
if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
clr = {
color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()),
effectValue: color.get_value()
}
} else {
clr = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
}
return clr;
},
textFonts: 'Fonts',
textAuto: 'Auto',
textPt: 'pt'
};
})(), SSE.Controllers.EditText || {}))
});

View file

@ -1,60 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* sheet.js
*
* Model for sheet.
*
* Created by Maxim.Kadushkin on 11/29/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'backbone'
], function(Backbone){
'use strict';
SSE.Models = SSE.Models || {};
SSE.Models.Sheet = Backbone.Model.extend({
initialize: function () {
// this.uid = _.uniqueId(/*prefix || */"asc-gen");
},
defaults: {
index : undefined,
name : null
}
});
});

View file

@ -1,14 +0,0 @@
<!-- Root view -->
<div id="add-chart-root">
<div class="page-content dataview chart-types">
<% _.each(types, function(row) { %>
<ul class="row">
<% _.each(row, function(type) { %>
<li data-type="<%= type.type %>">
<div class="thumb <%= type.thumb %>"></div>
</li>
<% }); %>
</ul>
<% }); %>
</div>
</div>

View file

@ -1,95 +0,0 @@
<!-- Root view -->
<% if (view == 'root') { %>
<div id="add-function-root">
<div class="page" data-page="add-function">
<div class="page-content">
<div class="list-block">
<ul>
<% _.each(quick, function(f) { %>
<li class="function">
<a data-func="<%= f.type %>" class="item-link no-indicator quick">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= f.caption %></div>
<div class="item-after"><i class="icon icon-info"></i></div>
</div>
</div>
</a>
</li>
<% }); %>
</ul>
</div>
<div class="content-block-title"><%= textGroups %></div>
<div class="list-block">
<ul class="groups">
<% for (var g in groups) { %>
<li>
<a data-type="<%= g %>" class="item-link group">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= groups[g] %></div>
</div>
</div>
</a>
</li>
<% }; %>
</ul>
</div>
</div>
</div>
</div>
<% } %>
<!-- Category view -->
<% if (view == 'group') { %>
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= groupname %></div>
</div>
</div>
<div class="page">
<div class="page-content">
<div class="list-block">
<ul>
<% _.each(functions, function(f) { %>
<li class="function">
<a data-func="<%= f.type %>" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= f.caption %></div>
<div class="item-after"><i class="icon icon-info"></i></div>
</div>
</div>
</a>
</li>
<% }); %>
</ul>
</div>
</div>
</div>
</div>
<% } %>
<!-- Description view -->
<% if (view == 'info') { %>
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= caption %></div>
</div>
</div>
<div class="page">
<div class="page-content" style="background-color: #fff;">
<div class="content-block" style="color: #000;">
<h3><%= caption %><%= args %></h3>
<p><%= descr %></p>
</div>
</div>
</div>
</div>
<% } %>

View file

@ -1,102 +0,0 @@
<!-- Link view -->
<div id="addlink-root-view">
<div class="page" data-page="add-link">
<div class="page-content">
<div class="list-block" style="<%= android ? 'margin-bottom: 0' : '' %>">
<ul>
<li>
<a id="add-link-type" class="item-link smart-select">
<select name="linktype">
<option value="ext"><%= scope.textExternalLink %></option>
<option value="int"><%= scope.textInternalLink %></option>
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title label"><%= scope.textLinkType %></div>
<div class="item-after"><%= scope.textExternalLink %></div>
</div>
</div>
</a>
</li>
<li>
<a id="add-link-sheet" class="item-link smart-select">
<select>
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title label"><%= scope.textSheet %></div>
<div class="item-after">Sheet 5</div>
</div>
</div>
</a>
</li>
<% 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" <% if (!android) { %>style="padding-right: 35px;"<% } %>>
<div class="item-title label"><%= scope.textRange %></div>
<% if (!android) { %><div class="item-after" style="max-width: 70%;"><% } %>
<div class="item-input">
<input type="text" class="field right range" placeholder="<%= scope.textRequired %>">
</div>
<% if (!android) { %></div><% } %>
</div>
</div>
</li>
<li>
<div id="add-link-url" class="item-content">
<div class="item-inner" <% if (!android) { %>style="padding-right: 35px;"<% } %>>
<div class="item-title label"><%= scope.textLink %></div>
<% if (!android) { %><div class="item-after" style="max-width: 70%;"><% } %>
<div class="item-input">
<input type="url" class="field right" placeholder="<%= scope.textRequired %>">
</div>
<% if (!android) { %></div><% } %>
</div>
</div>
</li>
<li>
<div id="add-link-display" class="item-content">
<div class="item-inner" <% if (!android) { %>style="padding-right: 35px;"<% } %>>
<div class="item-title label"><%= scope.textDisplay %></div>
<% if (!android) { %><div class="item-after" style="max-width: 70%;"><% } %>
<div class="item-input">
<input type="text" class="field right">
</div>
<% if (!android) { %></div><% } %>
</div>
</div>
</li>
<li>
<div id="add-link-tip" class="item-content">
<div class="item-inner" <% if (!android) { %>style="padding-right: 35px;"<% } %>>
<div class="item-title label"><%= scope.textTip %></div>
<% if (!android) { %><div class="item-after" style="max-width: 70%;"><% } %>
<div class="item-input">
<input type="text" class="field right">
</div>
<% if (!android) { %></div><% } %>
</div>
</div>
</li>
</ul>
</div>
<div class="list-block disabled" id="add-link-insert">
<% if (android) { %>
<a href="#" class="button button-fill button-raised" style="margin: 20px 16px;"><%= scope.textInsert %></a>
<% } else { %>
<ul>
<li>
<a href="#" class="list-button item-link"><%= scope.textInsert %></a>
</li>
</ul>
<% } %>
</div>
</div>
</div>
</div>

View file

@ -1,173 +0,0 @@
<!-- Root view -->
<div id="addother-root-view">
<div class="list-block">
<ul>
<li>
<a id="add-other-insimage" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-insimage"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textInsertImage %></div>
</div>
</div>
</a>
</li>
<li id='item-comment'>
<a id="add-other-comment" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-insert-comment"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textComment %></div>
</div>
</div>
</a>
</li>
<li>
<a id="add-other-link" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-link"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textLink %></div>
</div>
</div>
</a>
</li>
<li>
<a id="add-other-sort" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-sort"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textSort %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
<!-- Add image view -->
<div id="addother-insimage">
<div class="page" data-page="addother-image">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a id="addimage-file" class="item-link no-indicator no-fastclick">
<div class="item-content">
<div class="item-media">
<i class="icon icon-image-library"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textFromLibrary %></div>
</div>
</div>
</a>
</li>
<li>
<a id="addimage-url" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-link"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textFromURL %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Url view -->
<div id="addother-imagefromurl">
<div class="page" id="addimage-fromurl" data-page="addimage-url">
<div class="page-content">
<% if (!android) { %><div class="content-block-title"><%= scope.textAddress %></div><% } %>
<div class="list-block">
<ul>
<li>
<div id="addimage-link-url" class="item-content">
<div class="item-inner">
<% if (android) { %><div class="item-title label"><%= scope.textAddress %></div><% } %>
<div class="item-input">
<input type="url" placeholder="<%= scope.textImageURL %>">
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="list-block disabled" id="addimage-insert">
<% if (android) { %>
<a href="#" class="button button-fill button-raised" style="margin: 20px 16px;"><%= scope.textInsertImage %></a>
<% } else { %>
<ul>
<li>
<a href="#" class="list-button item-link"><%= scope.textInsertImage %></a>
</li>
</ul>
<% } %>
</div>
</div>
</div>
</div>
<!-- View for Sort&Filter -->
<div id="addother-sort">
<div class="page">
<div class="page-content">
<div class="list-block">
<ul><li>
<div class="item-content buttons">
<div class="item-inner">
<div class="row">
<a class="button no-ripple"><i class="icon sortdown"></i></a>
<a class="button no-ripple"><i class="icon sortup"></i></a>
</div>
</div>
</div>
</li></ul>
</div>
<div class="list-block">
<ul>
<li id="other-chb-insfilter">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textFilter %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Page Insert Comment view -->
<div id="addother-insert-comment">
<div class="page page-add-comment" data-page="addother-insert-comment">
<div class="page-content">
<div id="comment-info" class="wrap-comment">
</div>
</div>
</div>
</div>

View file

@ -1,14 +0,0 @@
<!-- Root view -->
<div id="add-shapes-root">
<div class="page-content dataview shapes">
<% _.each(shapes, function(row) { %>
<ul class="row">
<% _.each(row, function(shape) { %>
<li data-type="<%= shape.type %>">
<div class="thumb" style="-webkit-mask-image:url('<%= imgpath %>/<%= shape.thumb %>')"></div>
</li>
<% }); %>
</ul>
<% }); %>
</div>
</div>

View file

@ -1,17 +0,0 @@
<div id="cell-editing-box">
<div class="ce-group group-name">
<span id="ce-cell-name"></span>
<a href="#" id="ce-function" class="link icon-only">
<i class="icon icon-function"></i>
</a>
</div>
<div class="ce-group group-content">
<textarea id="ce-cell-content" spellcheck="false" rows="1" cols="20"></textarea>
</div>
<div class="ce-group group-expand">
<button id="ce-btn-expand" type="button" class="btn"><span class="caret"></span></button>
</div>
<div class="ce-group group-functions-list">
<ul class="func-list"></ul>
</div>
</div>

View file

@ -1,990 +0,0 @@
<!-- Root view -->
<div id="edit-cell-root">
<div class="list-block">
<ul>
<li>
<a id="font-fonts" class="item-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textFonts %></div>
<div class="item-after" style="color: #000;"><span></span><span style="margin-left: 5px;"></span></div>
</div>
</div>
</a>
</li>
<li>
<div class="item-content buttons">
<div class="item-inner">
<div class="row">
<a id="font-bold" class="button"><b><%= scope.textCharacterBold %></b></a>
<a id="font-italic" class="button"><i><%= scope.textCharacterItalic %></i></a>
<a id="font-underline" class="button" style="text-decoration: underline;"><%= scope.textCharacterUnderline %></a>
</div>
</div>
</div>
</li>
<li>
<a id="text-color" class="item-link">
<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">
<div class="item-title"><%= scope.textTextColor %></div>
<% if (android) { %><div class="item-after"><div class="color-preview"></div></div><% } %>
</div>
</div>
</a>
</li>
<li>
<a id="fill-color" class="item-link">
<div class="item-content">
<% if (!android) { %><div class="item-media" style="padding-top: 0;"><i class="icon icon-fill-color"><span class="color-preview"></span></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textFillColor %></div>
<% if (android) { %><div class="item-after"><div class="color-preview"></div></div><% } %>
</div>
</div>
</a>
</li>
<li>
<a id="text-format" class="item-link" data-page="#edit-text-format">
<div class="item-content">
<% if (!android) { %><div class="item-media"><i class="icon icon-text-additional"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textTextFormat %></div>
</div>
</div>
</a>
</li>
<li>
<a id="text-orientation" class="item-link" data-page="#edit-text-orientation">
<div class="item-content">
<% if (!android) { %><div class="item-media"><i class="icon icon-text-orientation"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textTextOrientation %></div>
</div>
</div>
</a>
</li>
<li>
<a id="border-style" class="item-link" data-page="#edit-border-style">
<div class="item-content">
<% if (!android) { %><div class="item-media"><i class="icon icon-table-borders-all" style="width: 22px; height: 22px;"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textBorderStyle %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<a class="item-link" data-page="#edit-cell-format">
<div class="item-content">
<% if (!android) { %><div class="item-media"><i class="icon icon-format-general"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textFormat %></div>
</div>
</div>
</a>
</ul>
</div>
<div class="content-block-title"><%= scope.textCellStyle %></div>
<div class="list-block">
<ul>
<li class="cell-styles dataview">
</li>
</ul>
</div>
</div>
<!-- Fonts view -->
<div id="edit-text-fonts">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textFonts %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-text-font-page">
<div class="page-content">
<div class="list-block">
<ul>
<li id="font-size">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textSize %></div>
<div class="item-after splitter">
<% if (!android) { %><label></label><% } %>
<p class="buttons-row">
<span class="button decrement no-ripple"><% if (android) { %><i class="icon icon-expand-down"></i><% } else { %>-<% } %></span>
<% if (android) { %><label></label><% } %>
<span class="button increment no-ripple"><% if (android) { %><i class="icon icon-expand-up"></i><% } else { %>+<% } %></span>
</p>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textFonts %></div>
<div id="font-list" class="list-block virtual-list">
<!-- Fonts List -->
</div>
</div>
</div>
</div>
<!-- Text color view -->
<div id="edit-text-color">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textTextColor %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-text-color">
<div class="page-content">
</div>
</div>
</div>
<!-- Fill color view -->
<div id="edit-fill-color">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textFillColor %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-fill-color">
<div class="page-content">
</div>
</div>
</div>
<!-- Border color view -->
<div id="edit-cell-border-color">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textBorderColor %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-border-color">
<div class="page-content">
</div>
</div>
</div>
<!-- Text Format view -->
<div id="edit-text-format">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textTextFormat %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-text-format">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-halign" value="left">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-align-left"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textAlignLeft %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-halign" value="center">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-align-center"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textAlignCenter %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-halign" value="right">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-align-right"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textAlignRight %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-halign" value="justify">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-align-jast"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textJustified %></div>
</div>
</label>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-valign" value="top">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-valign-top"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textAlignTop %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-valign" value="center">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-valign-middle"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textAlignMiddle %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-valign" value="bottom">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-valign-bottom"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textAlignBottom %></div>
</div>
</label>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li id="edit-cell-wrap-text">
<div class="item-content">
<% if (!android) { %><div class="item-media"><i class="icon icon-cell-wrap"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textWrapText %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Text Orientation view -->
<div id="edit-text-orientation">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textTextOrientation %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-text-orientation">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-orientation" value="horizontal">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-orientation-horizontal"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textHorizontalText %></div>
<% if (android) { %>
<div class="item-after"><i class="icon icon-text-orientation-horizontal"></i></div>
<% } %>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-orientation" value="anglecount">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-orientation-anglecount"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textAngleCounterclockwise %></div>
<% if (android) { %>
<div class="item-after"><i class="icon icon-text-orientation-anglecount"></i></div>
<% } %>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-orientation" value="angleclock">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-orientation-angleclock"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textAngleClockwise %></div>
<% if (android) { %>
<div class="item-after"><i class="icon icon-text-orientation-angleclock"></i></div>
<% } %>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-orientation" value="vertical">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-orientation-vertical"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textVerticalText %></div>
<% if (android) { %>
<div class="item-after"><i class="icon icon-text-orientation-vertical"></i></div>
<% } %>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-orientation" value="rotateup">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-orientation-rotateup"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textRotateTextUp %></div>
<% if (android) { %>
<div class="item-after"><i class="icon icon-text-orientation-rotateup"></i></div>
<% } %>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="text-orientation" value="rotatedown">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } else { %>
<div class="item-media"><i class="icon icon-text-orientation-rotatedown"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textRotateTextDown %></div>
<% if (android) { %>
<div class="item-after"><i class="icon icon-text-orientation-rotatedown"></i></div>
<% } %>
</div>
</label>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Border Styles view -->
<div id="edit-border-style">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textBorderStyle %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="edit-border-style">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a data-type="none" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-none"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textNoBorder %></div></div>
</div>
</a>
</li>
<li>
<a data-type="all" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-all"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textAllBorders %></div></div>
</div>
</a>
</li>
<li>
<a data-type="2" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-bottom"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textBottomBorder %></div></div>
</div>
</a>
</li>
<li>
<a data-type="0" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-top"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textTopBorder %></div></div>
</div>
</a>
</li>
<li>
<a data-type="3" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-left"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textLeftBorder %></div></div>
</div>
</a>
</li>
<li>
<a data-type="1" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-right"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textRightBorder %></div></div>
</div>
</a>
</li>
<li>
<a data-type="inner" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-inner"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textInBorders %></div></div>
</div>
</a>
</li>
<li>
<a data-type="6" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-center"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textInVertBorder %></div></div>
</div>
</a>
</li>
<li>
<a data-type="7" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-middle"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textInHorBorder %></div></div>
</div>
</a>
</li>
<li>
<a data-type="5" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-dup"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textDiagUpBorder %></div></div>
</div>
</a>
</li>
<li>
<a data-type="4" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-table-borders-ddown"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textDiagDownBorder %></div></div>
</div>
</a>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textStyles %></div>
<div class="list-block">
<ul>
<li>
<a id="edit-border-color" class="item-link" data-page="#edit-cell-border-color">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textColor %></div>
<div class="item-after"><div class="color-preview"></div></div>
</div>
</div>
</a>
</li>
<li>
<a id="edit-border-size" class="item-link smart-select" data-back-on-select="true">
<select name="cell-border-size">
<option value="<%= Asc.c_oAscBorderStyles.Thin %>"><%= scope.textThin %></option>
<option value="<%= Asc.c_oAscBorderStyles.Medium %>"><%= scope.textMedium %></option>
<option value="<%= Asc.c_oAscBorderStyles.Thick %>"><%= scope.textThick %></option>
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textSize %></div>
<div class="item-after"><%= scope.textThin %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Cell Format view -->
<div id="edit-cell-format">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textFormat %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="edit-cell-format">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a data-type="R2VuZXJhbA==" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-format-general"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textGeneral %></div></div>
</div>
</a>
</li>
<li>
<a data-type="MC4wMA==" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-format-number"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textNumber %></div></div>
</div>
</a>
</li>
<li>
<a data-type="JTIzMA==" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-format-integer"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textInteger %></div></div>
</div>
</a>
</li>
<li>
<a data-type="MC4wMEUlMkIwMA==" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-format-scientific"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textScientific %></div></div>
</div>
</a>
</li>
<li>
<a class="item-link" data-page="#edit-cell-format-accounting">
<div class="item-content">
<div class="item-media"><i class="icon icon-format-accounting"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textAccounting %></div></div>
</div>
</a>
</li>
<li>
<a class="item-link" data-page="#edit-cell-format-currency">
<div class="item-content">
<div class="item-media"><i class="icon icon-format-currency"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textCurrency %></div></div>
</div>
</a>
</li>
<li>
<a class="item-link" data-page="#edit-cell-format-date">
<div class="item-content">
<div class="item-media"><i class="icon icon-format-date"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textDate %></div></div>
</div>
</a>
</li>
<li>
<a class="item-link" data-page="#edit-cell-format-time">
<div class="item-content">
<div class="item-media"><i class="icon icon-format-time"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textTime %></div></div>
</div>
</a>
</li>
<li>
<a data-type="MC4wMCUyNQ==" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-format-percentage"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textPercentage %></div></div>
</div>
</a>
</li>
<li>
<a data-type="JTQw" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-format-text"></i></div>
<div class="item-inner"><div class="item-title"><%= scope.textText %></div></div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Cell Format Accounting view -->
<div id="edit-cell-format-accounting">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textAccounting %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="edit-cell-format">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a data-type="XyglMjQqJTIwJTIzJTJDJTIzJTIzMC4wMF8pJTNCXyglMjQqJTIwKCUyMyUyQyUyMyUyMzAuMDApJTNCXyglMjQqJTIwJTIyLSUyMiUzRiUzRl8pJTNCXyglNDBfKQ==" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textDollar %></div>
<div class="item-after">$</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="XyglRTIlODIlQUMqJTIwJTIzJTJDJTIzJTIzMC4wMF8pJTNCXyglRTIlODIlQUMqJTIwKCUyMyUyQyUyMyUyMzAuMDApJTNCXyglRTIlODIlQUMqJTIwJTIyLSUyMiUzRiUzRl8pJTNCXyglNDBfKQ==" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textEuro %></div>
<div class="item-after">€</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="XyglQzIlQTMqJTIwJTIzJTJDJTIzJTIzMC4wMF8pJTNCXyglQzIlQTMqJTIwKCUyMyUyQyUyMyUyMzAuMDApJTNCXyglQzIlQTMqJTIwJTIyLSUyMiUzRiUzRl8pJTNCXyglNDBfKQ==" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textPound %></div>
<div class="item-after">£</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="Xy0qJTIwJTIzJTJDJTIzJTIzMC4wMCU1QiUyNCVEMSU4MC4tNDE5JTVEXy0lM0ItKiUyMCUyMyUyQyUyMyUyMzAuMDAlNUIlMjQlRDElODAuLTQxOSU1RF8tJTNCXy0qJTIwJTIyLSUyMiUzRiUzRiU1QiUyNCVEMSU4MC4tNDE5JTVEXy0lM0JfLSU0MF8t" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textRouble %></div>
<div class="item-after">₽</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="XyglQzIlQTUqJTIwJTIzJTJDJTIzJTIzMC4wMF8pJTNCXyglQzIlQTUqJTIwKCUyMyUyQyUyMyUyMzAuMDApJTNCXyglQzIlQTUqJTIwJTIyLSUyMiUzRiUzRl8pJTNCXyglNDBfKQ==" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textYen %></div>
<div class="item-after">¥</div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Cell Format Accounting view -->
<div id="edit-cell-format-currency">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textCurrency %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="edit-cell-format">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a data-type="JTI0JTIzJTJDJTIzJTIzMC4wMA==" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textDollar %></div>
<div class="item-after">$</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="JUUyJTgyJUFDJTIzJTJDJTIzJTIzMC4wMA==" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textEuro %></div>
<div class="item-after">€</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="JUMyJUEzJTIzJTJDJTIzJTIzMC4wMA==" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textPound %></div>
<div class="item-after">£</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="JTIzJTJDJTIzJTIzMC4wMCUyMiVEMSU4MC4lMjI=" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textRouble %></div>
<div class="item-after">₽</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="JUMyJUE1JTIzJTJDJTIzJTIzMC4wMA==" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textYen %></div>
<div class="item-after">¥</div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Cell Format Date view -->
<div id="edit-cell-format-date">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textDate %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="edit-cell-format">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a data-type="TU0tZGQteXk=" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">07-24-88</div>
<div class="item-after">MM-dd-yy</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="TU0tZGQteXl5eQ==" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">07-24-1988</div>
<div class="item-after">MM-dd-yyyy</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="ZGQtTU0teXk=" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">24-07-88</div>
<div class="item-after">dd-MM-yy</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="ZGQtTU0teXl5eQ==" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">24-07-1988</div>
<div class="item-after">dd-MM-yyyy</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="ZGQtTU1NLXl5eXk=" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">24-Jul-1988</div>
<div class="item-after">dd-MMM-yyyy</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="ZGQtTU1N" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">24-Jul</div>
<div class="item-after">dd-MMM</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="TU1NLXl5" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">Jul-88</div>
<div class="item-after">MMM-yy</div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Cell Format Time view -->
<div id="edit-cell-format-time">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textTime %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="edit-cell-format">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a data-type="SEg6bW0=" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">10:56</div>
<div class="item-after">HH:mm</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="SEg6TU06c3M=" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">21:56:00</div>
<div class="item-after">HH:MM:ss</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="aGg6bW0gdHQ=" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">05:56 AM</div>
<div class="item-after">hh:mm tt</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="aGg6bW06c3MgdHQ=" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">05:56:00 AM</div>
<div class="item-after">hh:mm:ss tt</div>
</div>
</div>
</a>
</li>
<li>
<a data-type="W2hdOm1tOnNz" class="item-link no-indicator">
<div class="item-content">
<div class="item-inner">
<div class="item-title">38:56:00</div>
<div class="item-after">[h]:mm:ss</div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Custom color view -->
<div id="edit-cell-custom-color-view">
<div class="navbar">
<div class="navbar-inner" data-page="edit-cell-custom-color">
<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"><%= scope.textCustomColor %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-cell-custom-color">
<div class="page-content">
<!--Color HSB palette-->
</div>
</div>
</div>

View file

@ -1,640 +0,0 @@
<!-- Root view -->
<div id="edit-chart-root">
<div class="list-block">
<ul>
<li>
<a id="chart-style" class="item-link" data-page="#edit-chart-style">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textDesign %></div>
</div>
</div>
</a>
</li>
<li>
<a id="chart-layout" class="item-link" data-page="#edit-chart-layout">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textLayout %></div>
</div>
</div>
</a>
</li>
<li>
<a id="chart-vaxis" class="item-link" data-page="#edit-chart-vertical-axis">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textVerAxis %></div>
</div>
</div>
</a>
</li>
<li>
<a id="chart-haxis" class="item-link" data-page="#edit-chart-horizontal-axis">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textHorAxis %></div>
</div>
</div>
</a>
</li>
<li>
<a id="chart-reorder" class="item-link" data-page="#edit-chart-reorder">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textReorder %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="list-block">
<% if (!android) { %>
<ul>
<li>
<a id="chart-remove" class="item-link list-button" style="text-align: center; color: #f00"><%= scope.textRemoveChart %></a>
</li>
</ul>
<% } else { %>
<a id="chart-remove" class="button button-raised button-fill" style="margin: 20px 16px; background-color: #f44336;"><%= scope.textRemoveChart %></a>
<% } %>
</div>
</div>
<!-- Reorder view -->
<div id="edit-chart-reorder">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textReorder %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-chart-reorder">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a data-type="all-up" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-foreground"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textToForeground %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="all-down" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-background"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textToBackground %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="move-up" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-forward"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textForward %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="move-down" class="item-link no-indicator">
<div data-type="move-down" class="item-content">
<div class="item-media"><i class="icon icon-move-backward"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textBackward %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Styles view -->
<div id="edit-chart-style">
<div class="navbar">
<div class="navbar-inner edit-chart-style" data-page="edit-chart-style">
<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"><%= scope.textDesign %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
<% if (!android) { %>
<div class="edit-chart-style subnavbar categories">
<div class="buttons-row">
<a href="#tab-chart-type" class="button tab-link active"><%= scope.textType %></a>
<a href="#tab-chart-style" class="button tab-link"><%= scope.textStyle %></a>
<a href="#tab-chart-fill" class="button tab-link"><%= scope.textFill %></a>
<a href="#tab-chart-border" class="button tab-link"><%= scope.textBorder %></a>
</div>
</div>
<% } %>
</div>
<% if (android) { %>
<div class="edit-chart-style subnavbar categories" style="padding: 0;">
<div class="toolbar tabbar" style="top: 0;">
<div data-page="index" class="toolbar-inner">
<a href="#tab-chart-type" class="tab-link active"><%= scope.textType %></a>
<a href="#tab-chart-style" class="tab-link"><%= scope.textStyle %></a>
<a href="#tab-chart-fill" class="tab-link"><%= scope.textFill %></a>
<a href="#tab-chart-border" class="tab-link"><%= scope.textBorder %></a>
</div>
</div>
</div>
<% } %>
</div>
<div class="page with-subnavbar" data-page="edit-chart-style">
<div class="page-content tabs" style="padding-top: 0;">
<div id="tab-chart-type" class="page-content tab dataview chart-types active">
<% _.each(types, function(row) { %>
<ul class="row">
<% _.each(row, function(type) { %>
<li data-type="<%= type.type %>">
<div class="thumb" style="background-image:url('../mobile/resources/img/charts/<%= type.thumb %>')"></div>
</li>
<% }); %>
</ul>
<% }); %>
</div>
<div id="tab-chart-style" class="page-content tab dataview chart-styles" style="width: 100%;">
<!--Style-->
</div>
<div id="tab-chart-fill" class="page-content tab">
<!--Fill-->
</div>
<div id="tab-chart-border" class="page-content tab">
<div class="list-block">
<ul>
<li id="edit-chart-bordersize">
<div style="padding: 15px 0 0 15px;"><%= scope.textSize %></div>
<div class="item-content">
<div class="item-inner">
<div class="item-input">
<div class="range-slider">
<input type="range" min="0" max="7" value="0" step="1">
</div>
</div>
<div class="item-after value">0 pt</div>
</div>
</div>
</li>
<li>
<a id="edit-chart-bordercolor" class="item-link" data-page="#edit-chart-border-color-view">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textColor %></div>
<div class="item-after"><div class="color-preview"></div></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Border color view -->
<div id="edit-chart-border-color-view">
<div class="navbar">
<div class="navbar-inner" data-page="edit-chart-border-color">
<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"><%= scope.textColor %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-chart-border-color">
<div class="page-content">
<!--Color palette-->
</div>
</div>
</div>
<!-- Layout view -->
<div id="edit-chart-layout">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textLayout %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="edit-chart-layout">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a id="chart-layout-title" class="item-link smart-select" data-back-on-select="true">
<select name="chart-layout-title">
<option value="0" selected><%= scope.textNone %></option>
<option value="1"><%= scope.textOverlay %></option>
<option value="2"><%= scope.textNoOverlay %></option>
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textChartTitle %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
<li>
<a id="chart-layout-legend" class="item-link smart-select" data-back-on-select="true">
<select name="chart-layout-legend">
<option value="0" selected><%= scope.textNone %></option>
<option value="1"><%= scope.textLeft %></option>
<option value="2"><%= scope.textTop %></option>
<option value="3"><%= scope.textRight %></option>
<option value="4"><%= scope.textBottom %></option>
<option value="5"><%= scope.textLeftOverlay %></option>
<option value="6"><%= scope.textRightOverlay %></option>
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textLegend %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textAxisTitle %></div>
<div class="list-block">
<ul>
<li>
<a id="chart-layout-axis-title-horizontal" class="item-link smart-select" data-back-on-select="true">
<select name="chart-layout-axis-title-horizontal">
<option value="0" selected><%= scope.textNone %></option>
<option value="1"><%= scope.textNoOverlay %></option>
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textHorizontal %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
<li>
<a id="chart-layout-axis-title-vertical" class="item-link smart-select" data-back-on-select="true">
<select name="chart-layout-axis-title-vertical">
<option value="0" selected><%= scope.textNone %></option>
<option value="1"><%= scope.textRotated %></option>
<option value="3"><%= scope.textHorizontal %></option>
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textVertical %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textGridlines %></div>
<div class="list-block">
<ul>
<li>
<a id="chart-layout-gridlines-horizontal" class="item-link smart-select" data-back-on-select="true">
<select name="chart-layout-gridlines-horizontal">
<option value="0" selected><%= scope.textNone %></option>
<option value="1"><%= scope.textMajor %></option>
<option value="2"><%= scope.textMinor %></option>
<option value="3"><%= scope.textMajorMinor %></option>
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textHorizontal %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
<li>
<a id="chart-layout-gridlines-vertical" class="item-link smart-select" data-back-on-select="true">
<select name="chart-layout-gridlines-vertical">
<option value="0" selected><%= scope.textNone %></option>
<option value="1"><%= scope.textMajor %></option>
<option value="2"><%= scope.textMinor %></option>
<option value="3"><%= scope.textMajorMinor %></option>
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textVertical %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li>
<a id="chart-layout-data-labels" class="item-link smart-select" data-back-on-select="true">
<select name="chart-layout-data-labels">
<option value="0" selected><%= scope.textNone %></option>
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textDataLabels %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Vertical Axis view -->
<div id="edit-chart-vertical-axis">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textAxisOptions %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="edit-chart-vertical-axis">
<div class="page-content">
<div class="list-block">
<ul>
<li id="edit-vertical-axis-min-val">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textMinValue %></div>
<div class="item-after">
<div class="item-input">
<input class="field right placeholder-color" type="number" placeholder="<%= scope.textAuto %>">
</div>
</div>
</div>
</div>
</li>
<li id="edit-vertical-axis-max-val">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textMaxValue %></div>
<div class="item-after">
<div class="item-input">
<input class="field right placeholder-color" type="number" placeholder="<%= scope.textAuto %>">
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li>
<a id="vertical-axis-cross" class="item-link smart-select" data-back-on-select="true">
<select name="vertical-axis-cross"></select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textAxisCrosses %></div>
<div class="item-after"><%= scope.textAuto %></div>
</div>
</div>
</a>
</li>
<li id="edit-vertical-axis-cross-value" style="display: none;">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textCrossesValue %></div>
<div class="item-after">
<div class="item-input">
<input class="field right placeholder-color" type="number" placeholder="0">
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li>
<a id="vertical-axis-display-units" class="item-link smart-select" data-back-on-select="true">
<select name="vertical-axis-display-units">
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textDisplayUnits %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
<li id="vertical-axis-in-reverse">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textValReverseOrder %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textTickOptions %></div>
<div class="list-block">
<ul>
<li>
<a id="vertical-axis-tick-major" class="item-link smart-select" data-back-on-select="true">
<select name="vertical-axis-tick-major"></select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textMajorType %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
<li>
<a id="vertical-axis-tick-minor" class="item-link smart-select" data-back-on-select="true">
<select name="vertical-axis-tick-minor"></select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textMinorType %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textLabelOptions %></div>
<div class="list-block">
<ul>
<li>
<a id="vertical-axis-label-pos" class="item-link smart-select" data-back-on-select="true">
<select name="vertical-axis-label-pos"></select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textLabelPos %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Horizontal Axis view -->
<div id="edit-chart-horizontal-axis">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textAxisOptions %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="edit-chart-horizontal-axis">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a id="horizontal-axis-cross" class="item-link smart-select" data-back-on-select="true">
<select name="horizontal-axis-cross"></select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textAxisCrosses %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
<li id="edit-horizontal-axis-cross-value" style="display: none;">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textCrossesValue %></div>
<div class="item-after">
<div class="item-input">
<input class="field right placeholder-color" type="number" placeholder="0">
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li>
<a id="horizontal-axis-position" class="item-link smart-select" data-back-on-select="true">
<select name="horizontal-axis-position">
</select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textAxisPosition %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
<li id="horizontal-axis-in-reverse">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textValReverseOrder %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textTickOptions %></div>
<div class="list-block">
<ul>
<li>
<a id="horizontal-axis-tick-major" class="item-link smart-select" data-back-on-select="true">
<select name="horizontal-axis-tick-major"></select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textMajorType %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
<li>
<a id="horizontal-axis-tick-minor" class="item-link smart-select" data-back-on-select="true">
<select name="horizontal-axis-tick-minor"></select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textMinorType %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textLabelOptions %></div>
<div class="list-block">
<ul>
<li>
<a id="horizontal-axis-label-pos" class="item-link smart-select" data-back-on-select="true">
<select name="horizontal-axis-label-pos"></select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textLabelPos %></div>
<div class="item-after"><%= scope.textNone %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Custom color view -->
<div id="edit-chart-custom-color-view">
<div class="navbar">
<div class="navbar-inner" data-page="edit-chart-custom-color">
<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"><%= scope.textCustomColor %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-chart-custom-color">
<div class="page-content">
<!--Color HSB palette-->
</div>
</div>
</div>

View file

@ -1,148 +0,0 @@
<!-- Link view -->
<div id="edit-link-root">
<div class="list-block">
<ul>
<li>
<a id="edit-link-type" class="item-link" data-page="#edit-link-type-view">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textLinkType %></div>
<div class="item-after"><%= scope.textExternalLink %></div>
</div>
</div>
</a>
</li>
<li>
<a id="edit-link-sheet" class="item-link" data-page="#edit-link-sheet-view">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textSheet %></div>
<div class="item-after"></div>
</div>
</div>
</a>
</li>
<li id="edit-link-range">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textRange %></div>
<div class="item-after">
<div class="item-input">
<input class="field right" type="text" placeholder="Required">
</div>
</div>
</div>
</div>
</li>
<li id="edit-link-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textLink %></div>
<div class="item-after">
<div class="item-input">
<input class="field right" type="url" placeholder="Required">
</div>
</div>
</div>
</div>
</li>
<li id="edit-link-display">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textDisplay %></div>
<div class="item-after">
<div class="item-input">
<input class="field right" type="text">
</div>
</div>
</div>
</div>
</li>
<li id="edit-link-tip">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textScreenTip %></div>
<div class="item-after">
<div class="item-input">
<input class="field right" type="text">
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="list-block">
<% if (android) { %>
<a href="#" id="edit-link-edit" class="button button-raised button-fill disabled" style="margin: 20px 16px;"><%= scope.textEditLink %></a>
<a href="#" id="edit-link-remove" class="button button-raised button-fill" style="margin: 20px 16px; background-color: #f44336;"><%= scope.textRemoveLink %></a>
<% } else { %>
<ul>
<li>
<a href="#" id="edit-link-edit" class="list-button item-link disabled" style="text-align: center;"><%= scope.textEditLink %></a>
</li>
<li>
<a href="#" id="edit-link-remove" class="list-button item-link" style="text-align: center; color: #f00"><%= scope.textRemoveLink %></a>
</li>
</ul>
<% } %>
</div>
</div>
<div id="edit-link-type-view">
<div class="navbar">
<div class="navbar-inner" data-page="edit-link-type-view">
<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"><%= scope.textLinkType %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-link-type-view">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="link-type" value="1">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textExternalLink %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="link-type" value="2">
<% if (android) { %>
<div class="item-media"><i class="icon icon-form-radio"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textInternalLink %></div>
</div>
</label>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="edit-link-sheet-view">
<div class="navbar">
<div class="navbar-inner" data-page="edit-link-sheet-view">
<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"><%= scope.textSheet %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-link-sheet-view">
<div class="page-content">
<div class="list-block">
<ul>
</ul>
</div>
</div>
</div>
</div>

View file

@ -1,184 +0,0 @@
<!-- Root view -->
<div id="edit-image-root">
<div class="list-block">
<ul>
<li>
<a id="image-replace" class="item-link" data-page="#edit-image-replace-view">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textReplace %></div>
</div>
</div>
</a>
</li>
<li>
<a id="image-reorder" class="item-link" data-page="#edit-image-reorder-view">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textReorder %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li>
<% if (android) { %>
<a id="image-default" class="button button-raised button-fill" style="margin: 20px 16px;"><%= scope.textDefault %></a>
<% } else { %>
<a id="image-default" class="item-link list-button" style="text-align: center;"><%= scope.textDefault %></a>
<% } %>
</li>
<li>
<% if (android) { %>
<a id="image-default" 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>
<% } %>
</li>
</ul>
</div>
</div>
<!-- Reorder view -->
<div id="edit-image-reorder-view">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textReorder %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page image-reorder" data-page="edit-image-reorder-view">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a data-type="all-up" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-foreground"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textToForeground %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="all-down" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-background"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textToBackground %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="move-up" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-forward"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textForward %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="move-down" class="item-link no-indicator">
<div data-type="move-down" class="item-content">
<div class="item-media"><i class="icon icon-move-backward"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textBackward %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Replace view -->
<div id="edit-image-replace-view">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textReplace %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-image-replace-view">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a id="edit-image-file" class="item-link no-indicator no-fastclick">
<div class="item-content">
<div class="item-media">
<i class="icon icon-image-library"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textFromLibrary %></div>
</div>
</div>
</a>
</li>
<li>
<a id="edit-image-url" class="item-link" data-page="#edit-image-url-view">
<div class="item-content">
<div class="item-media">
<i class="icon icon-link"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textFromURL %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Url view -->
<div id="edit-image-url-view">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textLinkSettings %></div>
</div>
</div>
<div class="page edit-image-url-link" data-page="edit-image-url-view">
<div class="page-content">
<div class="content-block-title"><%= scope.textAddress %></div>
<div class="list-block">
<ul>
<li>
<div class="item-content">
<div class="item-inner">
<div class="item-input">
<input type="url" placeholder="<%= scope.textImageURL %>">
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="list-block disabled buttons">
<% if (android) { %>
<a href="#" class="button button-fill button-raised" style="margin: 20px 16px;"><%= scope.textReplaceImg %></a>
<% } else { %>
<ul>
<li>
<a href="#" class="list-button item-link"><%= scope.textReplaceImg %></a>
</li>
</ul>
<% } %>
</div>
</div>
</div>
</div>

View file

@ -1,283 +0,0 @@
<!-- Root view -->
<div id="edit-shape-root">
<div class="list-block">
<ul>
<li>
<a id="shape-style" class="item-link" data-page="#edit-shape-style">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textStyle %></div>
</div>
</div>
</a>
</li>
<li>
<a id="shape-replace" class="item-link" data-page="#edit-shape-replace">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textReplace %></div>
</div>
</div>
</a>
</li>
<li>
<a id="shape-reorder" class="item-link" data-page="#edit-shape-reorder">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textReorder %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li>
<% if (android) { %>
<a id="shape-remove" class="button button-raised button-fill" style="margin: 20px 16px; background-color: #f44336;"><%= scope.textRemoveShape %></a>
<% } else { %>
<a id="shape-remove" class="item-link list-button" style="text-align: center; color: #f00"><%= scope.textRemoveShape %></a>
<% } %>
</li>
</ul>
</div>
</div>
<!-- Reorder view -->
<div id="edit-shape-reorder">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textReorder %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page shape-reorder" data-page="edit-shape-reorder">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a data-type="all-up" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-foreground"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textToForeground %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="all-down" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-background"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textToBackground %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="move-up" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-forward"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textForward %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="move-down" class="item-link no-indicator">
<div data-type="move-down" class="item-content">
<div class="item-media"><i class="icon icon-move-backward"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textBackward %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Replace view -->
<div id="edit-shape-replace">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textReplace %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page shape-replace" data-page="edit-shape-replace">
<div class="page-content dataview shapes">
<% _.each(shapes, function(row) { %>
<ul class="row">
<% _.each(row, function(shape) { %>
<li data-type="<%= shape.type %>">
<div class="thumb" style="-webkit-mask-image:url('<%= imgpath %>/<%= shape.thumb %>')"></div>
</li>
<% }); %>
</ul>
<% }); %>
</div>
</div>
</div>
<!-- Styles view -->
<div id="edit-shape-style">
<div class="navbar">
<div class="navbar-inner edit-shape-style" data-page="edit-shape-style">
<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 categories">
<% if (android) { %>
<div class="toolbar tabbar">
<div data-page="index" class="toolbar-inner">
<a href="#tab-shape-fill" data-type="fill" class="tab-link active"><%= scope.textFill %></a>
<a href="#tab-shape-border" data-type="border" class="tab-link"><%= scope.textBorder %></a>
<a href="#tab-shape-effects" data-type="effects" class="tab-link"><%= scope.textEffects %></a>
</div>
</div>
<% } else { %>
<div class="buttons-row">
<a href="#tab-shape-fill" data-type="fill" class="tab-link button active"><%= scope.textFill %></a>
<a href="#tab-shape-border" data-type="border" class="tab-link button"><%= scope.textBorder %></a>
<a href="#tab-shape-effects" data-type="effects" class="tab-link button"><%= scope.textEffects %></a>
</div>
<% } %>
</div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-shape-style">
<div class="page-content tabs" style="padding-top: 0;">
<div id="tab-shape-fill" class="page-content tab active">
<!--Fill colors-->
</div>
<div id="tab-shape-border" class="page-content tab">
<div class="list-block">
<ul>
<li id="edit-shape-bordersize">
<div style="padding: 15px 0 0 15px;"><%= scope.textSize %></div>
<div class="item-content">
<div class="item-inner">
<div class="item-input">
<div class="range-slider">
<input type="range" min="0" max="7" value="0" step="1">
</div>
</div>
<div class="item-after value">0 pt</div>
</div>
</div>
</li>
<li>
<a id="edit-shape-bordercolor" class="item-link" data-page="#edit-shape-border-color-view">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textColor %></div>
<div class="item-after"><div class="color-preview"></div></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
<div id="tab-shape-effects" class="page-content tab">
<div class="list-block">
<ul>
<li id="edit-shape-effect">
<div style="padding: 15px 0 0 15px;"><%= scope.textOpacity %></div>
<div class="item-content">
<div class="item-inner">
<div class="item-input">
<div class="range-slider">
<input type="range" min="0" max="100" value="0" step="1">
</div>
</div>
<div class="item-after value">0 %</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="edit-shape-style-nofill">
<div class="navbar">
<div class="navbar-inner edit-shape-style" data-page="edit-shape-style">
<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"><%= scope.textBorder %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-shape-style">
<div class="page-content">
<div class="list-block">
<ul>
<li id="edit-shape-bordersize">
<div style="padding: 15px 0 0 15px;"><%= scope.textSize %></div>
<div class="item-content">
<div class="item-inner">
<div class="item-input">
<div class="range-slider">
<input type="range" min="0" max="7" value="0" step="1">
</div>
</div>
<div class="item-after value">0 pt</div>
</div>
</div>
</li>
<li>
<a id="edit-shape-bordercolor" class="item-link" data-page="#edit-shape-border-color-view">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textColor %></div>
<div class="item-after"><div class="color-preview"></div></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Border color view -->
<div id="edit-shape-border-color-view">
<div class="navbar">
<div class="navbar-inner" data-page="edit-shape-border-color">
<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"><%= scope.textColor %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-shape-border-color-view">
<div class="page-content">
<!--Color palette-->
</div>
</div>
</div>
<!-- Custom color view -->
<div id="edit-shape-custom-color-view">
<div class="navbar">
<div class="navbar-inner" data-page="edit-shape-custom-color">
<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"><%= scope.textCustomColor %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-shape-custom-color">
<div class="page-content">
<!--Color HSB palette-->
</div>
</div>
</div>

View file

@ -1,136 +0,0 @@
<!-- Root view -->
<div id="edit-text-root">
<div class="list-block">
<ul>
<li>
<a id="font-fonts" class="item-link" data-page="#edit-text-fonts">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textFonts %></div>
<div class="item-after" style="color: #000;"><span></span><span style="margin-left: 5px;"></span></div>
</div>
</div>
</a>
</li>
<li>
<div class="item-content buttons">
<div class="item-inner">
<div class="row">
<a id="font-bold" class="button"><b><%= scope.textCharacterBold %></b></a>
<a id="font-italic" class="button"><i><%= scope.textCharacterItalic %></i></a>
<a id="font-underline" class="button" style="text-decoration: underline;"><%= scope.textCharacterUnderline %></a>
</div>
</div>
</div>
</li>
<li>
<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">
<div class="item-title"><%= scope.textTextColor %></div>
<% if (android) { %><div class="item-after"><div class="color-preview"></div></div><% } %>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="list-block" id="edit-text-align-block">
<ul>
<li>
<div class="item-content buttons">
<div class="item-inner">
<div class="row">
<a id="font-left" class="button no-ripple" data-value="left"><i class="icon icon-text-align-left"></i></a>
<a id="font-center" class="button no-ripple" data-value="center"><i class="icon icon-text-align-center"></i></a>
<a id="font-right" class="button no-ripple" data-value="right"><i class="icon icon-text-align-right"></i></a>
<a id="font-just" class="button no-ripple" data-value="justify"><i class="icon icon-text-align-jast"></i></a>
</div>
</div>
</div>
</li>
<li>
<div class="item-content buttons">
<div class="item-inner">
<div class="row">
<a id="font-top" class="button no-ripple" data-value="top"><i class="icon icon-text-valign-top"></i></a>
<a id="font-middle" class="button no-ripple" data-value="center"><i class="icon icon-text-valign-middle"></i></a>
<a id="font-bottom" class="button no-ripple" data-value="bottom"><i class="icon icon-text-valign-bottom"></i></a>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
<!-- Fonts view -->
<div id="edit-text-fonts">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textFonts %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-text-fonts">
<div class="page-content">
<div class="list-block">
<ul>
<li id="font-size">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textSize %></div>
<div class="item-after splitter">
<% if (!android) { %><label></label><% } %>
<p class="buttons-row">
<span class="button decrement no-ripple"><% if (android) { %><i class="icon icon-expand-down"></i><% } else { %>-<% } %></span>
<% if (android) { %><label></label><% } %>
<span class="button increment no-ripple"><% if (android) { %><i class="icon icon-expand-up"></i><% } else { %>+<% } %></span>
</p>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textFonts %></div>
<div id="font-list" class="list-block virtual-list">
<!-- Fonts List -->
</div>
</div>
</div>
</div>
<!-- Text color view -->
<div id="edit-text-color">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textTextColor %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-text-color">
<div class="page-content">
</div>
</div>
</div>
<!-- Custom color view -->
<div id="edit-text-custom-color-view">
<div class="navbar">
<div class="navbar-inner" data-page="edit-text-custom-color">
<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"><%= scope.textCustomColor %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" data-page="edit-text-custom-color">
<div class="page-content">
<!--Color HSB palette-->
</div>
</div>
</div>

View file

@ -1,10 +0,0 @@
<div class="views">
<div class="view view-main">
<div class="pages navbar-through">
<div data-page="index" class="page editor flex-horizontal with-logo">
<div id="editor_sdk" class="page-content no-fastclick">
</div>
</div>
</div>
</div>
</div>

View file

@ -1,51 +0,0 @@
<!-- Root view -->
<div id="filter-root-view">
<div class="navbar">
<div class="navbar-inner">
<div class="center sliding"><%= scope.textFilter %></div>
<div class="right sliding close-filter"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="filter-root-view">
<div class="page-content">
<div class="list-block">
<ul><li>
<div class="item-content buttons">
<div class="item-inner">
<div class="row">
<a class="button no-ripple"><i class="icon sortdown"></i></a>
<a class="button no-ripple"><i class="icon sortup"></i></a>
</div>
</div>
</div>
</li></ul>
</div>
<div class="list-block list-center">
<ul>
<li id="btn-clear-filter">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textClearFilter %></div>
</div>
</div>
</li>
<li id="btn-delete-filter">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textDeleteFilter %></div>
</div>
</div>
</li>
</ul>
</div>
<div id="list-cells" class="list-block">
</div>
</div>
</div>
</div>
</div>

View file

@ -1,189 +0,0 @@
<!--Search panel-->
<div id="search-panel-view">
<div class="searchbar document navbar navbar-hidden">
<div class="navbar-inner">
<div class="left">
<a id="search-settings" href="#" class="link icon-only"><i class="icon icon-settings"></i></a>
</div>
<div class="center">
<form class="searchbar search">
<div class="searchbar-input search">
<input type="search" placeholder="<%= scope.textSearch %>"><a href="#" class="searchbar-clear"></a>
</div>
</form>
<form class="searchbar replace">
<div class="searchbar-input replace">
<input type="search" placeholder="<%= scope.textReplace %>"><a href="#" class="searchbar-clear"></a>
</div>
</form>
</div>
<div class="right">
<% if (phone) { %>
<p class="buttons-row">
<a href="#" class="link icon-only prev disabled"><i class="icon icon-prev"></i></a>
<a href="#" class="link icon-only next disabled"><i class="icon icon-next"></i></a>
</p>
<p class="buttons-row replace">
<a href="#" class="link replace disabled"><%= scope.textReplace %></a>
</p>
<% } else { %>
<p class="buttons-row">
<a href="#" class="link replace disabled"><%= scope.textReplace %></a>
<a href="#" class="link icon-only prev disabled"><i class="icon icon-prev"></i></a>
<a href="#" class="link icon-only next disabled"><i class="icon icon-next"></i></a>
</p>
<% } %>
</div>
</div>
</div>
</div>
<!--Settings-->
<div id="search-settings-view">
<div class="navbar">
<div class="navbar-inner">
<div class="center sliding"><%= isEdit ? scope.textFindAndReplace : scope.textFind %></div>
<div class="right"><% if (phone) { %><a href="#" class="link close-popup"><b><%= scope.textDone %></b></a><% } %></div>
</div>
</div>
<div class="page" data-page="search-settings">
<div class="page-content">
<% if (isEdit) { %>
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="search-type" value="search">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textFind %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="search-type" value="replace">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textFindAndReplace %></div>
</div>
</label>
</li>
</ul>
</div>
<% } %>
<div class="content-block-title"><%= scope.textSearchIn %></div>
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="search-in" value="workbook">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textWorkbook %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="search-in" value="sheet">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textSheet %></div>
</div>
</label>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textSearchBy %></div>
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="search-by" value="rows">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textByRows %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="search-by" value="columns">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textByColumns %></div>
</div>
</label>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textLookIn %></div>
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="look-in" value="formulas">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textFormulas %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="look-in" value="values">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textValues %></div>
</div>
</label>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li>
<div id="search-match-case" class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textMatchCase %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
<li>
<div id="search-match-cell" class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textMatchCell %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
<li>
<div id="search-highlight-res" class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textHighlightRes %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>

View file

@ -1,911 +0,0 @@
<!-- Root view -->
<div id="settings-root-view">
<div class="navbar">
<div class="navbar-inner">
<div class="center sliding"><%= scope.textSettings %></div>
<div class="right"><% if (phone) { %><a href="#" class="link close-popup"><%= scope.textDone %></a><% } %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="settings-root-view">
<div class="page-content">
<div class="list-block">
<ul>
<% if (phone) { %>
<li>
<a id="settings-search" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-search"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textFind %></div>
</div>
</div>
</a>
</li>
<% } %>
<% if(width < 360) {%>
<li>
<div id="settings-collaboration" class="item-content" style="display: none;">
<div class="item-media">
<i class="icon icon-collaboration"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textCollaboration %></div>
</div>
</div>
</li>
<% } %>
<li>
<a id="settings-spreadsheet" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-table-settings"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textSpreadsheetSettings %></div>
</div>
</div>
</a>
</li>
<li>
<a id="settings-application" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-app-settings"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textApplicationSettings %></div>
</div>
</div>
</a>
</li>
<li>
<a id="settings-download" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-download"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textDownload %></div>
</div>
</div>
</a>
</li>
<li>
<a id="settings-print" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-print"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textPrint %></div>
</div>
</div>
</a>
</li>
<li>
<a id="settings-document-info" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-info"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textDocInfo %></div>
</div>
</div>
</a>
</li>
<!--<li>-->
<!--<a id="settings-history" class="item-link">-->
<!--<div class="item-content">-->
<!--<div class="item-media">-->
<!--<i class="icon icon-versions"></i>-->
<!--</div>-->
<!--<div class="item-inner">-->
<!--<div class="item-title">Document History</div>-->
<!--</div>-->
<!--</div>-->
<!--</a>-->
<!--</li>-->
<li>
<a id="settings-help" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-help"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textHelp %></div>
</div>
</div>
</a>
</li>
<li>
<a id="settings-about" class="item-link">
<div class="item-content">
<div class="item-media">
<i class="icon icon-about"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textAbout %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Document Info view -->
<div id="settings-info-view">
<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><%= scope.textBack %></span><% } %>
</a>
</div>
<div class="center sliding"><%= scope.textDocInfo %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="settings-info-view">
<div class="page-content">
<div class="content-block-title display-spreadsheet-title"><%= scope.textDocTitle %></div>
<div class="list-block display-spreadsheet-title">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-spreadsheet-title" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-owner"><%= scope.textOwner %></div>
<div class="list-block display-owner">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-owner" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-location"><%= scope.textLocation %></div>
<div class="list-block display-location">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-location" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-uploaded"><%= scope.textUploaded %></div>
<div class="list-block display-uploaded">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-uploaded" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-title"><%= scope.textTitle %></div>
<div class="list-block display-title">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-title" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-subject"><%= scope.textSubject %></div>
<div class="list-block display-subject">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-subject" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-comment"><%= scope.textComment %></div>
<div class="list-block display-comment">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-comment" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-last-mode"><%= scope.textLastModified %></div>
<div class="list-block display-last-mode">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-last-mod" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-mode-by"><%= scope.textLastModifiedBy %></div>
<div class="list-block display-mode-by">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-mod-by" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-created-date"><%= scope.textCreated %></div>
<div class="list-block display-created-date">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-date" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-application"><%= scope.textApplication %></div>
<div class="list-block display-application">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-application" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-author"><%= scope.textAuthor %></div>
<div class="list-block display-author">
<ul id="list-creator">
<li class="item-content">
<div class="item-inner">
<div id="settings-sse-author" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Download view -->
<div id="settings-download-view">
<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><%= scope.textBack %></span><% } %>
</a>
</div>
<div class="center sliding"><%= scope.textDownload %></div>
</div>
</div>
<div class="pages">
<div class="page formats" data-page="settings-download-view">
<div class="page-content">
<div class="content-block-title"><%= scope.textDownloadAs %></div>
<div class="list-block">
<ul>
<li>
<a data-format="<%= saveas.xlsx %>" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-format-xlsx"></i>
</div>
<div class="item-inner">
<div class="item-title">XLSX</div>
</div>
</div>
</a>
</li>
<li>
<a data-format="<%= saveas.pdf %>" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-format-pdf"></i>
</div>
<div class="item-inner">
<div class="item-title">PDF</div>
</div>
</div>
</a>
</li>
<li>
<a data-format="<%= saveas.pdfa %>" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-format-pdfa"></i>
</div>
<div class="item-inner">
<div class="item-title">PDF/A</div>
</div>
</div>
</a>
</li>
<li>
<a data-format="<%= saveas.ods %>" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-format-ods"></i>
</div>
<div class="item-inner">
<div class="item-title">ODS</div>
</div>
</div>
</a>
</li>
<li>
<a data-format="<%= saveas.csv %>" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-format-csv"></i>
</div>
<div class="item-inner">
<div class="item-title">CSV</div>
</div>
</div>
</a>
</li>
<li>
<a data-format="<%= saveas.xltx %>" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-format-xltx"></i>
</div>
<div class="item-inner">
<div class="item-title">XLTX</div>
</div>
</div>
</a>
</li>
<li>
<a data-format="<%= saveas.ots %>" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-format-ots"></i>
</div>
<div class="item-inner">
<div class="item-title">OTS</div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- History view -->
<div id="settings-history-view">
<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><%= scope.textBack %></span><% } %>
</a>
</div>
<div class="center sliding">Version History</div>
</div>
</div>
<div class="pages">
<div class="page" data-page="settings-history-view">
<div class="page-content">
<div class="content-block-title">Saved versions</div>
<div class="content-block inset">
<div class="content-block-inner">
<p>Under construction</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- About view -->
<div id="settings-about-view">
<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><%= scope.textBack %></span><% } %>
</a>
</div>
<div class="center sliding"><%= scope.textAbout %></div>
</div>
</div>
<div class="pages">
<div class="page about" data-page="settings-about-view">
<div class="page-content">
<div class="content-block">
<div class="logo" style="display: inline-block; width: 100%; height: 55px;"></div>
<div id="settings-about-logo" style="margin-top: 20px;display: none;"></div>
</div>
<div class="content-block">
<h3>SPREADSHEET EDITOR</h3>
<h3><%= scope.textVersion %> <%= prodversion %></h3>
</div>
<div class="content-block">
<h3 id="settings-about-name" class="vendor"><%= publishername %></h3>
<p><label><%= scope.textAddress %>:</label><a id="settings-about-address" class="external" href="#"><%= publisheraddr %></a></p>
<p><label><%= scope.textEmail %>:</label><a id="settings-about-email" class="external" target="_blank" href="mailto:<%= supportemail %>"><%= supportemail %></a></p>
<p><label><%= scope.textTel %>:</label><a id="settings-about-tel" class="external" target="_blank" href="tel:<%= phonenum %>"><%= phonenum %></a></p>
<p><a id="settings-about-url" class="external" target="_blank" href="<%= publisherurl %>"><%= printed_url %></a></p>
<p><label id="settings-about-info" style="display: none;"></label></p>
</div>
<div class="content-block" id="settings-about-licensor" style="display: none;">
<div class="content-block-inner" style="padding-top:0; padding-bottom: 1px;"></div>
<p><label><%= scope.textPoweredBy %></label></p>
<h3 class="vendor"><%= publishername %></h3>
<p><a class="external" target="_blank" href="<%= publisherurl %>"><%= printed_url %></a></p>
</div>
</div>
</div>
</div>
</div>
<!-- Application settings -->
<div id="settings-application-view">
<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><%= scope.textBack %></span><% } %>
</a>
</div>
<div class="center sliding"><%= scope.textApplicationSettings %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="settings-application-view">
<div class="page-content">
<div class="content-block-title"><%= scope.textUnitOfMeasurement %></div>
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="unit-of-measurement" value="0">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textCentimeter %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="unit-of-measurement" value="1">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textPoint %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="unit-of-measurement" value="2">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textInch %></div>
</div>
</label>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textFormulaLanguage %></div>
<div class="list-block">
<ul>
<li class="media-item">
<a id="language-formula" class="item-link item-content" data-page="#language-formula-view">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title"><%= scope.textCustom %></div>
</div>
<div class="item-subtitle"><%= scope.textExample + ": "%><span class="item-example"><%= scope.textCustomSize %></span></div>
</div>
</a>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textRegionalSettings %></div>
<div class="list-block">
<ul>
<li class="media-item">
<a id="regional-settings" class="item-link item-content" data-page="#regional-settings-view">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title"><%= scope.textCustom %></div>
</div>
<div class="item-subtitle"><%= scope.textExample + ": "%><span class="item-example"><%= scope.textCustomSize %></span></div>
</div>
</a>
</li>
</ul>
</div>
<div class="content-block-title display-view"><%= scope.textCommentingDisplay %></div>
<div class="list-block display-view">
<ul>
<div id="settings-display-comments" class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textDisplayComments %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
<div id="settings-display-resolved" class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textDisplayResolvedComments %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</ul>
</div>
<div class="list-block display-view">
<ul>
<li id="r1-c1-style">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textR1C1Style %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="list-block display-view">
<ul>
<li>
<a id="settings-macros" class="item-link item-content" data-page="#settings-macros-view">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title"><%= scope.textMacrosSettings %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="settings-spreadsheet-view">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textSpreadsheetSettings %></div>
</div>
</div>
<div class="page" id="page-settings-spreadsheet-view" data-page="settings-spreadsheet-view">
<div class="page-content">
<div class="content-block-title"><%= scope.textOrientation %></div>
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="table-orientation" value="0">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textPortrait %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="table-orientation" value="1">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textLandscape %></div>
</div>
</label>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textFormat %></div>
<div class="list-block">
<ul>
<li class="media-item">
<a id="settings-spreadsheet-format" class="item-link item-content" data-page="#settings-page-size-view">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title"><%= scope.textCustom %></div>
</div>
<div class="item-subtitle"><%= scope.textCustomSize %></div>
</div>
</a>
</li>
<li>
<a id="margin-settings" class="item-link item-content" data-page="#margins-view">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title"><%= scope.textMargins %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li id="hide-headings">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textHideHeadings %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
<li id="hide-gridlines">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textHideGridlines %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="list-block">
<ul>
<li>
<a id="color-schemes" class="item-link item-content">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title"><%= scope.textColorSchemes %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Color schemes view -->
<div id="color-schemes-view">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textColorSchemes %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="color-schemes-view">
<div class="page-content">
<div id="color-schemes-content" class="list-block">
<ul></ul>
</div>
</div>
</div>
</div>
</div>
<!-- Spreadsheet Page Size view -->
<div id="settings-page-size-view">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textSpreadsheetFormats %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="settings-page-size-view">
<div class="page-content">
<div class="list-block media-list">
<ul></ul>
</div>
</div>
</div>
</div>
</div>
<!-- Margin settings view -->
<div id="margins-view">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textMargins %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="margins-view">
<div class="page-content">
<div class="list-block">
<ul>
<li id="spreadsheet-margin-top">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textTop %></div>
<div class="item-after splitter">
<% if (!android) { %><label></label><% } %>
<p class="buttons-row">
<span class="button decrement"><% if (android) { %><i class="icon icon-expand-down"></i><% } else { %>-<% } %></span>
<% if (android) { %><label></label><% } %>
<span class="button increment"><% if (android) { %><i class="icon icon-expand-up"></i><% } else { %>+<% } %></span>
</p>
</div>
</div>
</div>
</li>
<li id="spreadsheet-margin-bottom">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textBottom %></div>
<div class="item-after splitter">
<% if (!android) { %><label></label><% } %>
<p class="buttons-row">
<span class="button decrement"><% if (android) { %><i class="icon icon-expand-down"></i><% } else { %>-<% } %></span>
<% if (android) { %><label></label><% } %>
<span class="button increment"><% if (android) { %><i class="icon icon-expand-up"></i><% } else { %>+<% } %></span>
</p>
</div>
</div>
</div>
</li>
<li id="spreadsheet-margin-left">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textLeft %></div>
<div class="item-after splitter">
<% if (!android) { %><label></label><% } %>
<p class="buttons-row">
<span class="button decrement"><% if (android) { %><i class="icon icon-expand-down"></i><% } else { %>-<% } %></span>
<% if (android) { %><label></label><% } %>
<span class="button increment"><% if (android) { %><i class="icon icon-expand-up"></i><% } else { %>+<% } %></span>
</p>
</div>
</div>
</div>
</li>
<li id="spreadsheet-margin-right">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textRight %></div>
<div class="item-after splitter">
<% if (!android) { %><label></label><% } %>
<p class="buttons-row">
<span class="button decrement"><% if (android) { %><i class="icon icon-expand-down"></i><% } else { %>-<% } %></span>
<% if (android) { %><label></label><% } %>
<span class="button increment"><% if (android) { %><i class="icon icon-expand-up"></i><% } else { %>+<% } %></span>
</p>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Regional Settings View --->
<div id="regional-settings-view">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textRegionalSettings %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="regional-settings-view">
<div class="page-content">
<div class="list-block">
<ul>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Language Formula View --->
<div id="language-formula-view">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textFormulaLanguage %></div>
</div>
</div>
<div class="pages">
<div class="page" data-page="language-formula-view">
<div class="page-content">
<div class="list-block media-list">
<ul>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Macros Settings view -->
<div id="settings-macros-view">
<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><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textMacrosSettings %></div>
</div>
</div>
<div class="pages">
<div class="page page-macros-settings" data-page="settings-macros-view">
<div class="page-content">
<div class="list-block">
<ul>
<li class="media-item">
<label class="label-radio item-content">
<input type="radio" name="macros-settings" value="2">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textDisableAll %></div>
<div class="item-subtitle"><%= scope.textDisableAllMacrosWithoutNotification %></div>
</div>
</label>
</li>
<li class="media-item">
<label class="label-radio item-content">
<input type="radio" name="macros-settings" value="0">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textShowNotification %></div>
<div class="item-subtitle"><%= scope.textDisableAllMacrosWithNotification %></div>
</div>
</label>
</li>
<li class="media-item">
<label class="label-radio item-content">
<input type="radio" name="macros-settings" value="1">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textEnableAll %></div>
<div class="item-subtitle"><%= scope.textEnableAllMacrosWithoutNotification %></div>
</div>
</label>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>

View file

@ -1,56 +0,0 @@
<div class="navbar logo-navbar" id="editor-navbar">
<div id="navbar-logo" style="padding-top: 12px;display: flex;justify-content: center;"><i class="icon icon-logo"></i></div>
<div class="navbar-inner">
<div class="left">
<a id="document-back" href="#" class="link" style="min-width: 22px; display: none;">
<i class="icon icon-back"></i>
<% if (backTitle && !phone) { %>
<span class="subtitle"><%= backTitle %></span>
<% } %>
</a>
<% if (!android) { %>
<a href="#" id="toolbar-undo" class="link icon-only disabled" style="display: none;">
<i class="icon icon-undo"></i>
</a>
<a href="#" id="toolbar-redo" class="link icon-only disabled" style="display: none;">
<i class="icon icon-redo"></i>
</a>
<% } %>
</div>
<% if (!phone) { %>
<div class="center" id="toolbar-title"></div>
<% } %>
<div class="right">
<% if (android) { %>
<a href="#" id="toolbar-undo" class="link icon-only disabled" style="display: none;">
<i class="icon icon-undo"></i>
</a>
<a href="#" id="toolbar-redo" class="link icon-only disabled" style="display: none;">
<i class="icon icon-redo"></i>
</a>
<% } %>
<a href="#" id="toolbar-edit" class="link icon-only" style="display: none;">
<i class="icon icon-edit-settings"></i>
</a>
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
<i class="icon icon-plus"></i>
</a>
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
<i class="icon icon-edit"></i>
</a>
<% if (!phone) { %>
<a href="#" id="toolbar-search" class="link icon-only">
<i class="icon icon-search"></i>
</a>
<% } %>
<% if (width >= 360) { %>
<a href="#" id="toolbar-collaboration" class="link icon-only disabled" style="display: none;">
<i class="icon icon-collaboration"></i>
</a>
<% } %>
<a href="#" id="toolbar-settings" class="link icon-only">
<i class="icon icon-settings"></i>
</a>
</div>
</div>
</div>

View file

@ -1,191 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* CellEdit.js
*
* Created by Maxim Kadushkin on 11/28/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/CellEditor.template',
'jquery',
'underscore',
'backbone'
], function (template, $, _, Backbone) {
'use strict';
SSE.Views.CellEditor = Backbone.View.extend({
el: '.pages > .page',
template: _.template(template),
events: {
'click button#ce-btn-expand': 'expandEditor',
'click #ce-function': function (e) {
this.fireEvent('function:click', this);
}
},
touch: {},
tplHintItem: _.template('<li><a><%= caption %></a></li>'),
initialize: function (options) {
},
render: function () {
var $el = $(this.el);
this.$el = $(this.template()).prependTo($el);
this.$cellname = $('#ce-cell-name', this.el);
this.$btnexpand = $('#ce-btn-expand', this.el);
this.$boxfuncs = $('.group-functions-list', this.el);
this.$listfuncs = $('.func-list', this.$boxfuncs);
// this.$btnfunc = $('#ce-function', this.el);
this.$listfuncs.on({
'touchstart': this.onTouchStart.bind(this),
'touchmove': this.onTouchMove.bind(this),
'touchend': this.onTouchEnd.bind(this)
});
return this;
},
updateCellInfo: function(info) {
if (info) {
this.$cellname.html(typeof(info)=='string' ? info : info.asc_getName());
}
},
expandEditor: function() {
if (this.$el.hasClass('expanded')) {
this.$el.removeClass('expanded');
this.$btnexpand.removeClass('collapse');
} else {
this.$el.addClass('expanded');
this.$btnexpand.addClass('collapse');
}
// Common.NotificationCenter.trigger('layout:changed', 'celleditor');
// Common.NotificationCenter.trigger('edit:complete', this.editor, {restorefocus:true});
},
clearFunctionsHint: function () {
this.$listfuncs.find('li').off('click');
this.$listfuncs.empty();
this.$listfuncs.scrollLeft(0);
},
cellNameDisabled: function(disabled){
// (disabled) ? this.$cellname.attr('disabled', 'disabled') : this.$cellname.removeAttr('disabled');
// this.$btnfunc.toggleClass('disabled', disabled);
// this.btnNamedRanges.setDisabled(disabled);
},
resetFunctionsHint: function(funcarr) {
this.clearFunctionsHint();
var me = this;
var onhintclick = function(name, type, e) {
this.fireEvent('function:hint', [name, type]);
};
var items = [];
_.each(funcarr, function(func, index) {
var $item = $(me.tplHintItem({
caption: func.asc_getName()
}));
$item.on('click', onhintclick.bind(me, func.asc_getName(), func.asc_getType()));
items.push($item);
});
this.$listfuncs.append(items);
},
hasHiddenFunctionsHint: function() {
var _left_bound_ = this.$boxfuncs.offset().left,
_right_bound_ = _left_bound_ + this.$boxfuncs.width();
var $items = this.$listfuncs.find('li');
var rect = $items.first().get(0).getBoundingClientRect();
if ( !(rect.left < _left_bound_) ) {
rect = $items.last().get(0).getBoundingClientRect();
if ( !(rect.right > _right_bound_) )
return false;
}
return true;
},
onTouchStart: function(e) {
if ( this.hasHiddenFunctionsHint() ) {
var touches = e.originalEvent.changedTouches;
this.touch.startx = touches[0].clientX;
this.touch.scrollx = this.$listfuncs.scrollLeft();
this.touch.timer = setTimeout(function () {
// touch.longtouch = true;
}, 500);
e.preventDefault();
}
},
onTouchMove: function(e) {
if ( this.touch.startx !== undefined ) {
var touches = e.originalEvent.changedTouches;
if ( this.touch.longtouch ) {}
else {
if ( this.touch.timer ) clearTimeout(this.touch.timer), delete this.touch.timer;
this.$listfuncs.scrollLeft(this.touch.scrollx + (this.touch.startx - touches[0].clientX));
}
e.preventDefault();
}
},
onTouchEnd: function(e) {
if ( this.touch.startx !== undefined ) {
this.touch.longtouch = false;
delete this.touch.startx;
e.preventDefault();
}
}
});
});

View file

@ -1,135 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* DocumentHolder.js
*
* Created by Maxim Kadushkin on 11/8/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'jquery',
'underscore',
'backbone'
, 'common/mobile/utils/utils'
], function ($, _, Backbone) {
'use strict';
SSE.Views.DocumentHolder = Backbone.View.extend((function() {
// private
var _anchorId = 'context-menu-target';
return {
el: '#editor_sdk',
template: _.template('<div id="' + _anchorId + '" style="position: absolute;"></div>'),
// Delegated events for creating new items, and clearing completed ones.
events: {
},
// Set innerHTML and get the references to the DOM elements
initialize: function() {
Common.NotificationCenter.on('document:ready', function () {
this.$el.append(this.template());
}.bind(this));
},
// Render layout
render: function() {
var el = $(this.el);
// this.f7View = uiApp.addView('.view-main', {
// // params
// });
return this;
},
showMenu: function (items, posX, posY) {
if (items.itemsIcon.length < 1 && items.items.length < 1) {
return;
}
var menuItemTemplate = _.template([
'<% if(menuItems.itemsIcon) {%>',
'<% _.each(menuItems.itemsIcon, function(item) { %>',
'<li data-event="<%= item.event %>"><a href="#" class="item-link list-button"><i class="icon <%= item.icon %>"></i></a></li>',
'<% }); }%>',
'<% if(menuItems.items) {%>',
'<% _.each(menuItems.items, function(item) { %>',
'<li data-event="<%= item.event %>"><a href="#" class="item-link list-button"><%= item.caption %></a></li>',
'<% }); }%>'
].join(''));
var $target = $('#' + _anchorId)
.css({left: posX, top: Math.max(0, posY)});
uiApp.closeModal('.document-menu.modal-in');
var popoverHTML =
'<div class="popover document-menu">'+
'<div class="popover-inner">'+
'<div class="list-block">'+
'<ul>'+
menuItemTemplate({menuItems: items}) +
'</ul>'+
'</div>'+
'</div>'+
'</div>';
var popover = uiApp.popover(popoverHTML, $target);
if (Common.SharedSettings.get('android')) {
Common.Utils.androidMenuTop($(popover), $target);
}
$('.modal-overlay').removeClass('modal-overlay-visible');
$('.document-menu li').single('click', _.buffered(function(e) {
var $el = $(e.currentTarget),
eventName = $el.data('event');
this.fireEvent('contextmenu:click', [this, eventName]);
}, 100, this));
},
hideMenu: function () {
$('#' + _anchorId)
.css({'left': -1000, 'top': -1000});
uiApp.closeModal('.document-menu.modal-in');
}
}
})());
});

View file

@ -1,80 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* Editor.js
*
* Created by Maxim Kadushkin on 11/15/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/Editor.template',
'jquery',
'underscore',
'backbone'
], function (editorTemplate, $, _, Backbone) {
'use strict';
SSE.Views.Editor = Backbone.View.extend({
el: 'body',
// Compile our stats template
template: _.template(editorTemplate),
// Delegated events for creating new items, and clearing completed ones.
events: {
},
// Set innerHTML and get the references to the DOM elements
initialize: function() {
//
},
// Render layout
render: function() {
var el = $(this.el);
el.prepend(this.template({
backTitle: Framework7.prototype.device.android ? '' : ''
}));
this.f7View = uiApp.addView('.view-main', {
// params
});
return this;
}
});
});

View file

@ -1,146 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* FilterOptions.js
* Spreadsheet Editor
*
* Created by Julia Svinareva on 13/6/19
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/FilterOptions.template',
'jquery',
'underscore',
'backbone'
], function (settingsTemplate, $, _, Backbone) {
'use strict';
SSE.Views.FilterOptions = Backbone.View.extend(_.extend((function() {
// private
return {
template: _.template(settingsTemplate),
events: {
//
},
initialize: function() {
Common.NotificationCenter.on('filtercontainer:show', _.bind(this.initEvents, this));
this.on('page:show', _.bind(this.updateItemHandlers, this));
},
initEvents: function () {
var me = this;
Common.Utils.addScrollIfNeed('.view[data-page=filter-root-view] .pages', '.view[data-page=filter-root-view] .page');
me.updateItemHandlers();
},
initControls: function() {
//
},
// Render layout
render: function() {
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
orthography: Common.SharedSettings.get('sailfish'),
scope : this
}));
return this;
},
updateItemHandlers: function () {
var selectorsDynamicPage = [
'.page[data-page=filter-root-view]'
].map(function (selector) {
return selector + ' a.item-link[data-page]';
}).join(', ');
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
},
onItemClick: function (e) {
var $target = $(e.currentTarget),
page = $target.data('page');
if (page && page.length > 0 ) {
this.showPage(page);
}
},
rootLayout: function () {
if (this.layout) {
var $layour = this.layout.find('#filter-root-view'),
isPhone = Common.SharedSettings.get('phone');
return $layour.html();
}
return '';
},
showPage: function(templateId, animate) {
var rootView = SSE.getController('FilterOptions').rootView();
if (rootView && this.layout) {
var $content = this.layout.find(templateId);
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append($content.find('.navbar'));
}
rootView.router.load({
content: $content.html(),
animatePages: animate !== false
});
this.fireEvent('page:show', [this, templateId]);
}
},
textFilter: 'Filter Options',
textClearFilter: 'Clear Filter',
textDeleteFilter: 'Delete Filter'
}
})(), SSE.Views.FilterOptions || {}))
});

View file

@ -1,229 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* Search.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/5/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/Search.template',
'jquery',
'underscore',
'backbone'
], function (searchTemplate, $, _, Backbone) {
'use strict';
SSE.Views.Search = Backbone.View.extend(_.extend((function() {
// private
var _isEdit = false,
_layout;
return {
el: '.view-main',
// Compile our stats template
template: _.template(searchTemplate),
// Delegated events for creating new items, and clearing completed ones.
events: {},
// Set innerHTML and get the references to the DOM elements
initialize: function () {
this.on('searchbar:show', _.bind(this.initEvents, this));
},
initEvents: function() {
$('#search-settings').single('click', _.bind(this.showSettings, this));
},
// Render layout
render: function () {
_layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
isEdit : _isEdit,
scope : this
}));
return this;
},
setMode: function (mode) {
_isEdit = mode.isEdit;
this.render();
},
showSettings: function (e) {
var me = this;
uiApp.closeModal();
if (Common.SharedSettings.get('phone')) {
me.picker = $$(uiApp.popup([
'<div class="popup settings">',
'<div class="view search-settings-view navbar-through">',
_layout.find('#search-settings-view').html(),
'</div>',
'</div>'].join('')
))
} else {
me.picker = uiApp.popover([
'<div class="popover settings" style="width: 280px; height: 300px;">',
'<div class="popover-angle"></div>',
'<div class="popover-inner">',
'<div class="content-block">',
'<div class="view popover-view search-settings-view navbar-through" style="height: 300px;">',
_layout.find('#search-settings-view').html(),
'</div>',
'</div>',
'</div>',
'</div>'].join(''),
$$('#search-settings')
);
// Prevent hide overlay. Conflict popover and modals.
var $overlay = $('.modal-overlay');
$$(me.picker).on('opened', function () {
$overlay.on('removeClass', function () {
if (!$overlay.hasClass('modal-overlay-visible')) {
$overlay.addClass('modal-overlay-visible')
}
});
}).on('close', function () {
$overlay.off('removeClass');
$overlay.removeClass('modal-overlay-visible')
});
}
if (Common.SharedSettings.get('android')) {
$$('.view.search-settings-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed');
$$('.view.search-settings-view .navbar').prependTo('.view.search-settings-view > .pages > .page');
}
me.fireEvent('searchbar:showsettings', me);
},
showSearch: function () {
var me = this,
searchBar = $$('.searchbar.document');
if (searchBar.length < 1) {
$(_layout.find('#search-panel-view').html()).insertAfter($(me.el).find('.pages'));
if ($('.logo-navbar').length > 0) {
$('.searchbar.document').css('margin-top', '26px');
}
//$(_layout.find('#search-panel-view').html()).insertAfter($(me.el).find('#cell-editing-box'));
// $(me.el).find('.pages .page').prepend(_layout.find('#search-panel-view').html());
// Show replace mode if needed
var isReplace = Common.SharedSettings.get('search-is-replace');
$('.searchbar.document').toggleClass('replace', !_.isUndefined(isReplace) && (isReplace === true));
me.fireEvent('searchbar:render', me);
me.fireEvent('searchbar:show', me);
if(Common.SharedSettings.get('search-highlight-res') === undefined) {
Common.SharedSettings.set('search-highlight-res', true);
}
if (Common.SharedSettings.get('search-highlight-res')) {
this.fireEvent('search:highlight', [this, true]);
}
if(Common.SharedSettings.get('search-by') === undefined) {
Common.SharedSettings.set('search-by', 'rows');
}
if(Common.SharedSettings.get('look-in') === undefined) {
Common.SharedSettings.set('look-in', 'formulas');
}
searchBar = $$('.searchbar.document');
if ($('.logo-navbar').length > 0) {
var top = Common.SharedSettings.get('android') ? '110px' : '98px';
$('.navbar-through .page > .searchbar').css('top', top);
}
uiApp.showNavbar(searchBar);
if (!searchBar.hasClass('navbar-hidden')) {
$('.searchbar.search input').focus();
}
}
},
hideSearch: function () {
var me = this,
searchBar = $$('.searchbar.document');
if (searchBar.length > 0) {
// Animating
if (searchBar.hasClass('.navbar-hidding')) {
return;
}
me.fireEvent('searchbar:hide', me);
searchBar.remove();
uiApp.hideNavbar(searchBar);
}
this.fireEvent('search:highlight', [this, false]);
},
textFind: 'Find',
textFindAndReplace: 'Find and Replace',
textDone: 'Done',
textSearch: 'Search',
textReplace: 'Replace',
textMatchCase: 'Match Case',
textMatchCell: 'Match Cell',
textSearchIn: 'Search In',
textWorkbook: 'Workbook',
textSheet: 'Sheet',
textHighlightRes: 'Highlight results',
textByColumns: 'By columns',
textByRows: 'By rows',
textSearchBy: 'Search',
textLookIn: 'Look In',
textFormulas: 'Formulas',
textValues: 'Values'
}
})(), SSE.Views.Search || {}))
});

View file

@ -1,444 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* Settings.js
*
* Created by Maxim Kadushkin on 12/05/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/Settings.template',
'jquery',
'underscore',
'backbone'
], function (settingsTemplate, $, _, Backbone) {
'use strict';
SSE.Views.Settings = Backbone.View.extend(_.extend((function() {
// private
var isEdit,
canEdit = false,
canDownload = false,
canAbout = true,
canHelp = true,
canPrint = false,
isShowMacros = true;
return {
// el: '.view-main',
template: _.template(settingsTemplate),
events: {
//
},
initialize: function() {
Common.NotificationCenter.on('settingscontainer:show', _.bind(this.initEvents, this));
Common.Gateway.on('opendocument', _.bind(this.loadDocument, this));
},
initEvents: function () {
var me = this;
$('#settings-document-info').single('click', _.bind(me.showDocumentInfo, me));
$('#settings-download').single('click', _.bind(me.showDownload, me));
$('#settings-history').single('click', _.bind(me.showHistory, me));
$('#settings-help').single('click', _.bind(me.showHelp, me));
$('#settings-about').single('click', _.bind(me.showAbout, me));
$('#settings-application').single('click', _.bind(me.showSetApp, me));
$('#settings-spreadsheet').single('click', _.bind(me.showSetSpreadsheet, me));
Common.Utils.addScrollIfNeed('.view[data-page=settings-root-view] .pages', '.view[data-page=settings-root-view] .page');
me.initControls();
},
// Render layout
render: function() {
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
scope : this
, saveas: {
xlsx: Asc.c_oAscFileType.XLSX,
pdf: Asc.c_oAscFileType.PDF,
pdfa: Asc.c_oAscFileType.PDFA,
ods: Asc.c_oAscFileType.ODS,
csv: Asc.c_oAscFileType.CSV,
xltx: Asc.c_oAscFileType.XLTX,
ots: Asc.c_oAscFileType.OTS
},
width : $(window).width(),
prodversion: '{{PRODUCT_VERSION}}',
publishername: '{{PUBLISHER_NAME}}',
publisheraddr: '{{PUBLISHER_ADDRESS}}',
publisherurl: '{{PUBLISHER_URL}}',
printed_url: ("{{PUBLISHER_URL}}").replace(/https?:\/{2}/, "").replace(/\/$/,""),
supportemail: '{{SUPPORT_EMAIL}}',
phonenum: '{{PUBLISHER_PHONE}}'
}));
return this;
},
setMode: function (mode) {
isEdit = mode.isEdit;
canEdit = !mode.isEdit && mode.canEdit && mode.canRequestEditRights;
canDownload = mode.canDownload || mode.canDownloadOrigin;
canPrint = mode.canPrint;
if (mode.customization && mode.canBrandingExt) {
canAbout = (mode.customization.about!==false);
}
if (mode.customization) {
canHelp = (mode.customization.help!==false);
isShowMacros = (mode.customization.macros!==false);
}
},
rootLayout: function () {
if (this.layout) {
var $layout = this.layout.find('#settings-root-view'),
isPhone = Common.SharedSettings.get('phone');
if (isEdit) {
$layout.find('#settings-search .item-title').text(this.textFindAndReplace)
} else {
$layout.find('#settings-spreadsheet').hide();
}
if (!canDownload) $layout.find('#settings-download').hide();
if (!canAbout) $layout.find('#settings-about').hide();
if (!canHelp) $layout.find('#settings-help').hide();
if (!canPrint) $layout.find('#settings-print').hide();
if (!isShowMacros) $layour.find('#settings-macros').hide();
return $layout.html();
}
return '';
},
initControls: function() {
//
},
showPage: function(templateId) {
var rootView = SSE.getController('Settings').rootView();
if (rootView && this.layout) {
var $content = this.layout.find(templateId);
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append($content.find('.navbar'));
}
rootView.router.load({
content: $content.html()
});
this.fireEvent('page:show', [this, templateId]);
}
},
showMacros: function () {
this.showPage('#settings-macros-view');
},
showSetApp: function() {
this.showPage('#settings-application-view');
$('#language-formula').single('click', _.bind(this.showFormulaLanguage, this));
$('#regional-settings').single('click', _.bind(this.showRegionalSettings, this));
if (!isEdit) {
$('.page[data-page=settings-application-view] .page-content > :not(.display-view)').hide();
}
if (isShowMacros) {
$('#settings-macros').single('click', _.bind(this.showMacros, this));
}
},
showFormulaLanguage: function () {
this.showPage('#language-formula-view');
},
showColorSchemes: function () {
this.showPage('#color-schemes-view');
},
showRegionalSettings: function () {
this.showPage('#regional-settings-view');
},
showSetSpreadsheet: function () {
this.showPage('#settings-spreadsheet-view');
$('#color-schemes').single('click', _.bind(this.showColorSchemes, this));
$('#settings-spreadsheet-format').single('click', _.bind(this.showPageSize, this));
$('#margin-settings').single('click', _.bind(this.showMargins, this));
},
showPageSize: function() {
this.showPage('#settings-page-size-view');
},
showMargins: function() {
this.showPage('#margins-view');
},
showDocumentInfo: function() {
this.showPage('#settings-info-view');
},
showDownload: function () {
this.showPage('#settings-download-view');
Common.Utils.addScrollIfNeed('.page[data-page=settings-download-view]', '.page[data-page=settings-download-view] .page-content');
},
showHistory: function () {
this.showPage('#settings-history-view');
},
showHelp: function () {
this.fireEvent('settings:showhelp');
},
showAbout: function () {
this.showPage('#settings-about-view');
Common.Utils.addScrollIfNeed('.page[data-page=settings-about-view]', '.page[data-page=settings-about-view] .page-content');
},
loadDocument: function(data) {
var permissions = {};
if (data.doc) {
permissions = _.extend(permissions, data.doc.permissions);
if (permissions.edit === false) {
}
}
},
renderPageSizes: function(sizes, selectIndex) {
var $pageFormats = $('.page[data-page=settings-page-size-view]'),
$list = $pageFormats.find('ul'),
items = [];
_.each(sizes, function (size, index) {
items.push(_.template([
'<li>',
'<label class="label-radio item-content">',
'<input type="radio" name="spreadsheet-format" value="<%= item.value %>" <% if (index == selectIndex) { %>checked="checked"<% } %> >',
'<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>',
'<div class="item-inner">',
'<div class="item-title-row">',
'<div class="item-title"><%= item.caption %></div>',
'</div>',
'<div class="item-subtitle"><%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(item.value[0]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %> x <%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(item.value[1]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %></div>',
'</div>',
'</label>',
'</li>'
].join(''))({
android: Framework7.prototype.device.android,
item: size,
index: index,
selectIndex: selectIndex
}));
});
$list.html(items.join(''));
},
renderFormLang: function(indexLang, languages) {
var $pageLang = $('.page[data-page=language-formula-view]'),
$list = $pageLang.find('ul'),
items = [],
textEx = this.textExample;
_.each(languages, function (lang, index) {
items.push(_.template([
'<li>',
'<label class="label-radio item-content">',
'<input type="radio" name="language-formula" value="<%= item.value %>" <% if (index == selectIndex) { %>checked="checked"<% } %> >',
'<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>',
'<div class="item-inner">',
'<div class="item-title-row">',
'<div class="item-title"><%= item.displayValue %></div>',
'</div>',
'<div class="item-subtitle"><%= textExamp + ": "%> <%= item.exampleValue %></div>',
'</div>',
'</label>',
'</li>'
].join(''))({
android: Framework7.prototype.device.android,
item: lang,
index: index,
selectIndex: indexLang,
textExamp: textEx
}));
});
$list.html(items.join(''));
},
renderRegSettings: function(regCode, regions) {
var $pageLang = $('.page[data-page=regional-settings-view]'),
$list = $pageLang.find('ul'),
items = [];
_.each(regions, function (reg) {
var itemTemplate = [
'<li>',
'<label class="label-radio item-content">',
'<input type="radio" name="region-settings" value="<%= item.code %>" <% if (item.code == selectReg) { %>checked="checked"<% } %> >',
'<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>',
'<div class="item-inner">',
'<div class="item-title-row">',
'<i class="icon lang-flag <%= item.langName%>"></i>',
'<div class="item-title"><%= item.displayName %></div>',
'</div>',
'</div>',
'</label>',
'</li>'
].join('');
items.push(_.template(itemTemplate)({
android: Framework7.prototype.device.android,
item: reg,
selectReg: regCode,
}));
});
$list.html(items);
},
renderSchemaSettings: function(currentSchema, arrSchemas) {
if (arrSchemas) {
var templateInsert = "";
_.each(arrSchemas, function (schema, index) {
var colors = schema.get_colors(),//schema.colors;
name = schema.get_name();
templateInsert += '<li class="color-schemes-menu"><label class="label-radio item-content"><input type="radio" name="color-schema" value="' + index + '"';
if (index === currentSchema) {
templateInsert += ' checked="checked"'
}
templateInsert += '>';
if (Framework7.prototype.device.android) {
templateInsert += '<div class="item-media"><i class="icon icon-form-radio"></i></div>';
}
templateInsert += '<div class="item-inner"><span class="color-schema-block">';
for (var j = 2; j < 7; j++) {
var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b());
templateInsert = templateInsert + "<span class='color' style='background: " + clr + ";'></span>"
}
templateInsert += '</span><span class="text">' + name + '</span></div></label></li>';
}, this);
$('#color-schemes-content ul').html(templateInsert);
}
},
unknownText: 'Unknown',
textFindAndReplace: 'Find and Replace',
textSettings: 'Settings',
textDone: 'Done',
textFind: 'Find',
textEditDoc: 'Edit Document',
textDownload: 'Download',
textDocInfo: 'Document Info',
textHelp: 'Help',
textAbout: 'About',
textBack: 'Back',
textDocTitle: 'Document title',
textLoading: 'Loading...',
textAuthor: 'Author',
textCreateDate: 'Create date',
textDownloadAs: 'Download As...',
textVersion: 'Version',
textAddress: 'address',
textEmail: 'email',
textTel: 'tel',
textPoweredBy: 'Powered by',
textPrint: 'Print',
textApplicationSettings: 'Application Settings',
textUnitOfMeasurement: 'Unit of Measurement',
textCentimeter: 'Centimeter',
textPoint: 'Point',
textInch: 'Inch',
textSpreadsheetSettings: 'Spreadsheet Settings',
textColorSchemes: 'Color Schemes',
textHideHeadings: 'Hide Headings',
textHideGridlines: 'Hide Gridlines',
textOrientation: 'Orientation',
textPortrait: 'Portrait',
textLandscape: 'Landscape',
textFormat: 'Format',
textSpreadsheetFormats: 'Spreadsheet Formats',
textCustom: 'Custom',
textCustomSize: 'Custom Size',
textMargins: 'Margins',
textTop: 'Top',
textLeft: 'Left',
textBottom: 'Bottom',
textRight: 'Right',
textCollaboration: 'Collaboration',
textFormulaLanguage: 'Formula Language',
textExample: 'Example',
textR1C1Style: 'R1C1 Reference Style',
textRegionalSettings: 'Regional Settings',
textCommentingDisplay: 'Commenting Display',
textDisplayComments: 'Comments',
textDisplayResolvedComments: 'Resolved Comments',
textSubject: 'Subject',
textTitle: 'Title',
textComment: 'Comment',
textOwner: 'Owner',
textApplication : 'Application',
textCreated: 'Created',
textLastModified: 'Last Modified',
textLastModifiedBy: 'Last Modified By',
textUploaded: 'Uploaded',
textLocation: 'Location',
textMacrosSettings: 'Macros Settings',
textDisableAll: 'Disable All',
textDisableAllMacrosWithoutNotification: 'Disable all macros without notification',
textShowNotification: 'Show Notification',
textDisableAllMacrosWithNotification: 'Disable all macros with notification',
textEnableAll: 'Enable All',
textEnableAllMacrosWithoutNotification: 'Enable all macros without notification'
}
})(), SSE.Views.Settings || {}))
});

View file

@ -1,328 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* StatusBar View
*
* Created by Maxim Kadushkin on 11/28/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'core',
'underscore'
, 'common/mobile/utils/utils'
],
function(core){
'use strict';
SSE.Views.Statusbar = Backbone.View.extend((function(){
function tabVisible(t) {
var leftbound = arguments[1] || this.$boxTabs.offset().left,
rightbound = arguments[2] || (leftbound + this.$boxTabs.width()),
tab;
if ( typeof t == 'number' ) {
if ( !(t < 0) && t < this.$boxTabs.children().length ) {
tab = this.$boxTabs.children().eq(t);
}
} else {
tab = t.get('el');
}
if ( tab ) {
var rect = tab.get(0).getBoundingClientRect();
return !(rect.left < leftbound) && !(rect.right > rightbound);
}
return false;
}
function setTabVisible(tab) {
var _sheets = SSE.getCollection('Sheets');
if ( typeof tab == 'object' ) {
if ( tab == _sheets.first() ) tab = 'first'; else
if ( tab == _sheets.last() ) tab = 'last';
} else
if ( typeof tab == 'number' ) {
if ( !(tab > 0) ) tab = 'first'; else
if ( !(tab + 1 < _sheets.size()) ) tab = 'last';
else tab = _sheets.at(tab);
}
if (tab <= 0 || tab == 'first') {
this.$boxTabs.scrollLeft(0);
} else
if ( tab == 'last' || tab >= (_sheets.size() - 1) ) {
this.$boxTabs.scrollLeft(10000);
} else {
var $el = tab.get('el');
if ( $el ) {
var rightbound = this.$boxTabs.width();
var left = $el.position().left,
right = left + parseInt($el.css('width'));
if (left < 0) {
this.$boxTabs.scrollLeft(/*this.$boxTabs.scrollLeft() + */left - 26);
} else if (right > rightbound) {
this.$boxTabs.scrollLeft(/*this.$boxTabs.scrollLeft() + */(right - rightbound) + 20);
}
}
}
}
function hasInvisible() {
var _sheets = SSE.getCollection('Sheets');
var _left_bound_ = this.$boxTabs.offset().left,
_right_bound_ = _left_bound_ + this.$boxTabs.width();
var tab = _sheets.first().get('el');
var rect = tab.get(0).getBoundingClientRect();
if ( !(rect.left < _left_bound_) ) {
tab = _sheets.last().get('el');
rect = tab.get(0).getBoundingClientRect();
if ( !(rect.right > _right_bound_) )
return false;
}
return true;
}
var touch = {};
function onTouchStart(e) {
if ( hasInvisible.call(this) )
{
var touches = e.originalEvent.changedTouches;
touch.startx = touches[0].clientX;
touch.scrollx = this.$boxTabs.scrollLeft();
touch.timer = setTimeout(function () {
// touch.longtouch = true;
}, 500);
e.preventDefault();
}
}
function onTouchMove(e) {
if ( touch.startx !== undefined ) {
var touches = e.originalEvent.changedTouches;
if ( touch.longtouch ) {}
else {
if ( touch.timer ) clearTimeout(touch.timer), delete touch.timer;
this.$boxTabs.scrollLeft(touch.scrollx + (touch.startx - touches[0].clientX));
}
e.preventDefault();
}
}
function onTouchEnd(e) {
if ( touch.startx !== undefined ) {
touch.longtouch = false;
delete touch.startx;
e.preventDefault();
}
}
return {
el: '.pages > .page',
template: '<div class="statusbar">' +
'<div id="box-addtab" class="status-group">' +
'<a href="#" id="btn-addtab" class="button" style="display:none"><i class="icon icon-plus"></i></a>' +
'</div>' +
'<div class="box-tabs">' +
'<ul class="sheet-tabs bottom"></ul>' +
'</div>' +
'</div>',
tabtemplate: _.template('<li class="tab<% if (locked) print(" locked"); %>"><a><%= label %></a></li>'),
menutemplate: _.template(
'<% _.each(menuItems, function(item) { %>' +
'<li data-event="<%= item.event %>" class="<% if (item.locked===true) print("disabled") %>">' +
'<a href="#" class="item-link list-button"><%= item.caption %>' +
'</li>' +
'<% }); %>'),
events: {},
api: undefined,
initialize: function (options) {
_.extend(this, options);
},
render: function () {
var me = this;
me.$el = $(me.template).appendTo($(me.el));
me.$boxTabs = me.$el.find('.box-tabs > ul');
me.$btnAddTab = me.$el.find('#box-addtab > .button');
me.$btnAddTab.single('click', _.buffered(function(e) {
me.fireEvent('sheet:addnew');
}, 300));
me.$boxTabs.on({
'touchstart': onTouchStart.bind(this),
'touchmove': onTouchMove.bind(this),
'touchend': onTouchEnd
});
// me.editMode = false;
return me;
},
setMode: function(mode) {
if ('disconnect' == mode) {
this.$btnAddTab.toggleClass('disabled', true);
} else if (mode.isEdit) {
this.$btnAddTab.show();
}
},
setVisible: function(visible) {
visible ? this.show(): this.hide();
},
addSheet: function(model) {
var index = this.$boxTabs.children().length;
var $item = $(this.tabtemplate({
label: model.get('name'),
locked: model.get('locked')
})).appendTo(this.$boxTabs);
$item.on('click', this.onSheetClick.bind(this, index, model));
model.get('active') && $item.addClass('active');
model.set('el', $item, {silent:true});
return $item;
},
addSheets: function (collection) {
var active;
collection.each(function(model) {
this.addSheet(model);
if ( model.get('active') )
active = model;
}, this);
if ( active && !tabVisible.call(this, active) )
setTabVisible.call(this, active);
},
clearTabs: function () {
this.$boxTabs.children().off('click');
this.$boxTabs.empty();
},
setActiveTab: function (index) {
this.$boxTabs.children().removeClass('active')
.eq(index).addClass('active');
if ( !tabVisible.call(this, index) )
setTabVisible.call(this, index);
},
onSheetClick: function (index, model, e) {
this.fireEvent('sheet:click', [index, model]);
return false;
},
// onSheetChanged: function(o, index, tab) {
// this.api.asc_showWorksheet(tab.sheetindex);
//
// if (this.hasTabInvisible && !this.tabbar.isTabVisible(index)) {
// this.tabbar.setTabVisible(index);
// }
//
// this.fireEvent('sheet:changed', [this, tab.sheetindex]);
// this.fireEvent('sheet:updateColors', [true]);
//
// Common.NotificationCenter.trigger('comments:updatefilter',
// {
// property: 'uid',
// value: new RegExp('^(doc_|sheet' + this.api.asc_getActiveWorksheetId() + '_)')
// },
// false // hide popover
// );
// },
changeViewMode: function (edit) {
if (edit) {
this.tabBarBox.css('left', '152px');
} else {
this.tabBarBox.css('left', '');
}
this.tabbar.options.draggable = edit;
this.editMode = edit;
},
showTabContextMenu: function (items, model) {
uiApp.closeModal('.document-menu.modal-in');
var popoverHTML =
'<div class="popover document-menu">'+
'<div class="popover-inner">'+
'<div class="list-block">'+
'<ul>'+
this.menutemplate({menuItems: items}) +
'</ul>'+
'</div>'+
'</div>'+
'</div>';
var $target = model.get('el');
var popover = uiApp.popover(popoverHTML, $target);
if (Common.SharedSettings.get('android')) {
Common.Utils.androidMenuTop($(popover), $target);
}
$('.modal-overlay').removeClass('modal-overlay-visible');
$('.document-menu li').single('click', _.buffered(function(e) {
uiApp.closeModal('.document-menu.modal-in');
var $target = $(e.currentTarget),
eventName = $target.data('event');
this.fireEvent('contextmenu:click', [this, eventName, model]);
}, 100, this));
}
}
})())
}
);

View file

@ -1,168 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* Toolbar.js
* Spreadsheet Editor
*
* Created by Maxim Kadushkin on 11/15/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/Toolbar.template',
'jquery',
'underscore',
'backbone'
], function (toolbarTemplate, $, _, Backbone) {
'use strict';
SSE.Views.Toolbar = Backbone.View.extend(_.extend((function() {
// private
return {
el: '.view-main',
// Compile our stats template
template: _.template(toolbarTemplate),
// Delegated events for creating new items, and clearing completed ones.
events: {
"click #toolbar-search" : "searchToggle",
"click #toolbar-edit" : "showEdition",
"click #toolbar-add" : "showInserts",
"click #toolbar-settings" : "showSettings",
"click #toolbar-edit-document": "editDocument",
"click #toolbar-collaboration" : "showCollaboration"
},
// Set innerHTML and get the references to the DOM elements
initialize: function() {
var me = this;
},
// Render layout
render: function() {
var me = this,
$el = $(me.el);
$el.prepend(me.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
backTitle : Common.SharedSettings.get('android') ? '' : me.textBack,
width : $(window).width()
}));
$('.view-main .navbar').on('addClass removeClass', _.bind(me.onDisplayMainNavbar, me));
$('#toolbar-edit, #toolbar-add, #toolbar-settings, #toolbar-search, #document-back, #toolbar-edit-document').addClass('disabled');
this.$btnEdit = $el.find('#toolbar-edit');
this.$btnAdd = $el.find('#toolbar-add');
return me;
},
setMode: function (mode) {
if (mode.isEdit) {
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
} else if (mode.canEdit && mode.canRequestEditRights){
$('#toolbar-edit-document').show();
}
},
onDisplayMainNavbar: function (e) {
var $target = $(e.currentTarget),
navbarHidden = $target.hasClass('navbar-hidden'),
pickerHeight = $('.picker-modal').height() || 260;
$('#editor_sdk').css({
top : navbarHidden ? 0 : '',
bottom : navbarHidden ? pickerHeight : ''
});
},
// Search
searchToggle: function() {
if ($$('.searchbar.document').length > 0) {
this.hideSearch();
} else {
this.showSearch();
}
},
showSearch: function () {
SSE.getController('Search').showSearch();
},
hideSearch: function () {
SSE.getController('Search').hideSearch();
},
// Editor
showEdition: function () {
SSE.getController('EditContainer').showModal();
},
// Inserts
showInserts: function () {
SSE.getController('AddContainer').showModal();
},
// Settings
showSettings: function () {
SSE.getController('Settings').showModal();
},
disableControl: function (opts, val) {
if (!(opts.indexOf('add') < 0))
this.$btnAdd.toggleClass('disabled', val);
if (!(opts.indexOf('edit') < 0))
this.$btnEdit.toggleClass('disabled', val);
},
editDocument: function () {
Common.Gateway.requestEditRights();
},
//Collaboration
showCollaboration: function () {
SSE.getController('Common.Controllers.Collaboration').showModal();
},
textBack: 'Back'
}
})(), SSE.Views.Toolbar || {}))
});

View file

@ -1,138 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddChart.js
*
* Created by Maxim Kadushkin on 12/13/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/AddChart.template',
'backbone'
], function (addTemplate, Backbone) {
'use strict';
SSE.Views.AddChart = Backbone.View.extend(_.extend((function() {
// private
var _types = [
{ type: Asc.c_oAscChartTypeSettings.barNormal, thumb: 'bar-normal'},
{ type: Asc.c_oAscChartTypeSettings.barStacked, thumb: 'bar-stacked'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer, thumb: 'bar-pstacked'},
{ type: Asc.c_oAscChartTypeSettings.lineNormal, thumb: 'line-normal'},
{ type: Asc.c_oAscChartTypeSettings.lineStacked, thumb: 'line-stacked'},
{ type: Asc.c_oAscChartTypeSettings.lineStackedPer, thumb: 'line-pstacked'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal, thumb: 'hbar-normal'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked, thumb: 'hbar-stacked'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer, thumb: 'hbar-pstacked'},
{ type: Asc.c_oAscChartTypeSettings.areaNormal, thumb: 'area-normal'},
{ type: Asc.c_oAscChartTypeSettings.areaStacked, thumb: 'area-stacked'},
{ type: Asc.c_oAscChartTypeSettings.areaStackedPer, thumb: 'area-pstacked'},
{ type: Asc.c_oAscChartTypeSettings.pie, thumb: 'pie'},
{ type: Asc.c_oAscChartTypeSettings.doughnut, thumb: 'doughnut'},
{ type: Asc.c_oAscChartTypeSettings.pie3d, thumb: 'pie3d'},
{ type: Asc.c_oAscChartTypeSettings.scatter, thumb: 'scatter'},
{ type: Asc.c_oAscChartTypeSettings.stock, thumb: 'stock'},
{ type: Asc.c_oAscChartTypeSettings.line3d, thumb: 'line3d'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3d, thumb: 'bar3dnormal'},
{ type: Asc.c_oAscChartTypeSettings.barStacked3d, thumb: 'bar3dstack'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer3d, thumb: 'bar3dpstack'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal3d, thumb: 'hbar3dnormal'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked3d, thumb: 'hbar3dstack'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, thumb: 'hbar3dpstack'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, thumb: 'bar3dpsnormal'}
];
return {
// el: '.view-main',
template: _.template(addTemplate),
events: {
},
initialize: function () {
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
},
initEvents: function () {
var me = this;
$('.chart-types .thumb').single('click', this.onTypeClick.bind(this));
Common.Utils.addScrollIfNeed('#add-chart .pages', '#add-chart .page');
me.initControls();
},
// Render layout
render: function () {
var elementsInRow = 3;
var groupsOfTypes = _.chain(_types).groupBy(function(element, index){
return Math.floor(index/elementsInRow);
}).toArray().value();
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
types : groupsOfTypes
}));
var $chartStyles = $('.container-add .chart-styles');
if ( $chartStyles ) {
$chartStyles.replaceWith(this.layout.find('#add-chart-root').html());
}
return this;
},
rootLayout: function () {
if (this.layout) {
return this.layout.html();
}
return '';
},
initControls: function () {
//
},
onTypeClick: function (e) {
this.fireEvent('chart:insert', [$(e.target.parentElement).data('type')]);
}
}
})(), SSE.Views.AddChart || {}))
});

View file

@ -1,278 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddFunction.js
*
* Created by Maxim Kadushkin on 12/14/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/AddFunction.template',
'backbone'
], function (addTemplate, Backbone) {
'use strict';
SSE.Views.AddFunction = Backbone.View.extend(_.extend((function() {
var _openView = function (viewid, args) {
var rootView = SSE.getController('AddContainer').rootView;
if ( rootView ) {
var _params = {
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
view : viewid,
scope : this
};
_.extend(_params, args);
var $content = $('<div/>').append(_.template(this.template)(_params));
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append($content.find('.navbar'));
}
rootView.router.load({
content: $content.html()
});
}
};
return {
// el: '.view-main',
template: addTemplate,
events: {
},
initialize: function () {
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
},
initEvents: function () {
var me = this;
$('.settings').single('click', '.function .icon-info', this.onFunctionInfoClick.bind(this))
.on('click', '.function > a', this.onFunctionClick.bind(this));
$('.groups a.group').single('click', this.onGroupClick.bind(this));
Common.Utils.addScrollIfNeed('#add-formula .pages', '#add-formula .page');
me.initControls();
},
// Render layout
render: function () {
var me = this;
var quickFunctions = [
{caption: 'SUM', type: 'SUM'},
{caption: 'MIN', type: 'MIN'},
{caption: 'MAX', type: 'MAX'},
{caption: 'COUNT', type: 'COUNT'}
];
if (me.functions) {
_.each(quickFunctions, function (quickFunction) {
quickFunction.caption = me.functions[quickFunction.type].caption
});
}
var lang = me.lang;
this.translatTable = {};
var name = '', translate = '',
descriptions = ['DateAndTime', 'Engineering', 'Financial', 'Information', 'Logical', 'LookupAndReference', 'Mathematic', 'Statistical', 'TextAndData' ];
for (var i=0; i<descriptions.length; i++) {
name = descriptions[i];
translate = 'sCat' + name;
this.translatTable[name] = {
en: this[translate],
de: this[translate+'_de'],
ru: this[translate+'_ru'],
pl: this[translate+'_pl'],
es: this[translate+'_es'],
fr: this[translate+'_fr']
};
}
me.groups = {
'DateAndTime': me.translatTable['DateAndTime'][lang] || me.translatTable['DateAndTime']['en'],
'Engineering': me.translatTable['Engineering'][lang] || me.translatTable['Engineering']['en'],
'TextAndData': me.translatTable['TextAndData'][lang] || me.translatTable['TextAndData']['en'],
'Statistical': me.translatTable['Statistical'][lang] || me.translatTable['Statistical']['en'],
'Financial': me.translatTable['Financial'][lang] || me.translatTable['Financial']['en'],
'Mathematic': me.translatTable['Mathematic'][lang] || me.translatTable['Mathematic']['en'],
'LookupAndReference': me.translatTable['LookupAndReference'][lang] || me.translatTable['LookupAndReference']['en'],
'Information': me.translatTable['Information'][lang] || me.translatTable['Information']['en'],
'Logical': me.translatTable['Logical'][lang] || me.translatTable['Logical']['en']
};
me.layout = $('<div/>').append(_.template(me.template)({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
textGroups : me.textGroups,
quick : quickFunctions,
groups : me.groups,
view : 'root'
}));
return this;
},
setFunctions: function (arr, lang) {
this.functions = arr;
this.lang = lang;
},
rootLayout: function () {
if (this.layout) {
return this.layout.find('#add-function-root').html();
}
return '';
},
layoutPage: function () {
return this.layout ? this.layout.find('#add-function-root').html() : '';
},
layoutPanel: function() {
return this.layout ? this.layout.find('#add-function-root .page-content').html() : '';
},
initControls: function () {
//
},
onFunctionClick: function (e) {
// if ( !/info/.test(e.target.className) )
this.fireEvent('function:insert', [$(e.currentTarget).data('func')]);
},
onFunctionInfoClick: function(e) {
e.stopPropagation();
var type = $(e.target).parents('.item-link').data('func');
this.fireEvent('function:info', [type]);
},
onGroupClick: function (e) {
var group = $(e.target).parents('.group').data('type');
var items = [];
for (var k in this.functions) {
if (this.functions[k].group == group)
items.push(this.functions[k]);
}
_openView.call(this, 'group', {
groupname : this.groups[group],
functions : items
});
Common.Utils.addScrollIfNeed('.view.add-root-view .page-on-center', '.view.add-root-view .page-on-center .page-content');
},
openFunctionInfo: function (type) {
_openView.call(this, 'info', this.functions[type]);
Common.Utils.addScrollIfNeed('.view.add-root-view .page-on-center', '.view.add-root-view .page-on-center .page-content');
},
textGroups: 'CATEGORIES',
textBack: 'Back',
sCatLogical: 'Logical',
// sCatCube: 'Cube',
// sCatDatabase: 'Database',
sCatDateAndTime: 'Date and time',
sCatEngineering: 'Engineering',
sCatFinancial: 'Financial',
sCatInformation: 'Information',
sCatLookupAndReference: 'Lookup and Reference',
sCatMathematic: 'Math and trigonometry',
sCatStatistical: 'Statistical',
sCatTextAndData: 'Text and data',
sCatDateAndTime_ru: 'Дата и время',
sCatEngineering_ru: 'Инженерные',
sCatFinancial_ru: 'Финансовые',
sCatInformation_ru: 'Информационные',
sCatLogical_ru: 'Логические',
sCatLookupAndReference_ru: 'Поиск и ссылки',
sCatMathematic_ru: 'Математические',
sCatStatistical_ru: 'Статистические',
sCatTextAndData_ru: 'Текст и данные',
sCatLogical_es: 'Lógico',
sCatDateAndTime_es: 'Fecha y hora',
sCatEngineering_es: 'Ingenería',
sCatFinancial_es: 'Financial',
sCatInformation_es: 'Información',
sCatLookupAndReference_es: 'Búsqueda y referencia',
sCatMathematic_es: 'Matemáticas y trigonometría',
sCatStatistical_es: 'Estadístico',
sCatTextAndData_es: 'Texto y datos',
sCatLogical_fr: 'Logique',
sCatDateAndTime_fr: 'Date et heure',
sCatEngineering_fr: 'Ingénierie',
sCatFinancial_fr: 'Financier',
sCatInformation_fr: 'Information',
sCatLookupAndReference_fr: 'Recherche et référence',
sCatMathematic_fr: 'Maths et trigonométrie',
sCatStatistical_fr: 'Statistiques',
sCatTextAndData_fr: 'Texte et données',
sCatLogical_pl: 'Logiczny',
sCatDateAndTime_pl: 'Data i czas',
sCatEngineering_pl: 'Inżyniera',
sCatFinancial_pl: 'Finansowe',
sCatInformation_pl: 'Informacja',
sCatLookupAndReference_pl: 'Wyszukiwanie i odniesienie',
sCatMathematic_pl: 'Matematyczne i trygonometryczne',
sCatStatistical_pl: 'Statystyczny',
sCatTextAndData_pl: 'Tekst i data',
sCatDateAndTime_de: 'Datum und Uhrzeit',
sCatEngineering_de: 'Konstruktion',
sCatFinancial_de: 'Finanzmathematik',
sCatInformation_de: 'Information',
sCatLogical_de: 'Logisch',
sCatLookupAndReference_de: 'Suchen und Bezüge',
sCatMathematic_de: 'Mathematik und Trigonometrie',
sCatStatistical_de: 'Statistik',
sCatTextAndData_de: 'Text und Daten'
}
})(), SSE.Views.AddFunction || {}));
});

View file

@ -1,267 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddLink.js
*
* Created by Maxim.Kadushkin on 1/10/2017
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/AddLink.template',
'backbone'
], function (addTemplate, Backbone) {
'use strict';
SSE.Views.AddLink = Backbone.View.extend(_.extend((function() {
// private
var cfgLink = {
type : 'ext',
internal : {}
};
var clickInsertLink = function (e) {
var $view = $('.settings');
var type = cfgLink.type;
var $text = $view.find('#add-link-display input');
this.fireEvent('link:insert', [{
type : type,
sheet : type == 'ext' ? undefined : cfgLink.internal.sheet.caption,
url : $view.find(type == 'ext' ? '#add-link-url input' : '#add-link-range input').val(),
text : $text.is(':disabled') ? null : $text.val(),
tooltip : $view.find('#add-link-tip input').val()
}]);
};
function initEvents() {
var me = this;
var $view = $('.settings');
$('.page[data-page=add-link]').find('input[type=url], input.range')
.single('input', function(e) {
$view.find('#add-link-insert').toggleClass('disabled', _.isEmpty($(e.target).val()));
});
_.delay(function () {
$view.find('.page[data-page=addother-link] input[type=url]').focus();
}, 1000);
$view.find('#add-link-insert').single('click', _.buffered(clickInsertLink, 100, this));
$view.find('#add-link-type select').single('change', function (e) {
me.fireEvent('link:changetype', [me, $(e.currentTarget).val()]);
});
$view.find('#add-link-sheet select').single('change', function (e) {
var index = $(e.currentTarget).val(),
caption = $(e.currentTarget[e.currentTarget.selectedIndex]).text();
cfgLink.internal = { sheet: {index: index, caption: caption}};
// me.fireEvent('link:changesheet', [me, $(e.currentTarget).val()]);
}).val(cfgLink.internal.sheet.index);
Common.Utils.addScrollIfNeed('.page[data-page=add-link]', '.page[data-page=add-link] .page-content');
}
return {
// el: '.view-main',
template: _.template(addTemplate),
events: {},
initialize: function () {
// Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
},
initEvents: function () {
var me = this;
me.initControls();
},
// Render layout
render: function () {
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
scope : this
}));
return this;
},
rootLayout: function () {
return this.layout ?
this.layout.find('#addlink-root-view').html() : '';
},
initControls: function () {
//
},
showPage: function (root, navbar) {
if (root && this.layout) {
var $content = this.layout;
if ( !$content.find('.navbar').length ) {
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append(navbar);
} else {
$content.prepend(navbar);
}
}
root.router.load({
content: $content.html()
});
initEvents.call(this);
}
},
showPanel: function () {
initEvents.call(this);
},
optionLinkType: function (type, opts) {
cfgLink.type = type;
var $view = $('.settings');
if ( !(opts == 'caption') ) {
$view.find('#add-link-type select').val(type);
$view.find('#add-link-type .item-after').html(
type == 'int' ? this.textInternalLink : this.textExternalLink );
}
var $btnInsertLink = $view.find('#add-link-insert');
if ( type == 'int' ) {
$view.find('#add-link-url').hide();
$view.find('#add-link-sheet').show()
.find('.item-after').html(cfgLink.internal.sheet.caption);
$view.find('#add-link-range').show();
$btnInsertLink.toggleClass('disabled', _.isEmpty($view.find('#add-link-range input').val()));
} else {
$view.find('#add-link-url').show();
$view.find('#add-link-sheet').hide();
$view.find('#add-link-range').hide();
$btnInsertLink.toggleClass('disabled', _.isEmpty($view.find('#add-link-url input').val()));
}
},
optionAllowInternal: function(allow) {
var $view = $('.settings');
if ( allow )
$view.find('#add-link-type').show();
else {
this.optionLinkType('ext');
$view.find('#add-link-type').hide();
}
},
optionDisplayText: function (text) {
var $view = $('.settings');
var disabled = text == 'locked';
disabled && (text = this.textSelectedRange);
$view.find('#add-link-display input').prop('disabled', disabled).val(text);
$view.find('#add-link-display .label').toggleClass('disabled', disabled);
},
acceptWorksheets: function (sheets) {
this.worksheets = sheets;
var tpl = '<% _.each(worksheets, function(item){ %>' +
'<option value="<%= item.value %>"><%= item.caption %></option>' +
'<% }) %>';
this.layout.find('#add-link-sheet select').html(
_.template(tpl)({
worksheets: sheets
})
);
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);
return this;
},
setActiveWorksheet: function (index, caption) {
cfgLink.internal = { sheet: {index: index, caption: caption}};
var $view = $('.settings');
// $view.find('#add-link-sheet .item-after').html(this.link.internal.sheet.caption);
$view.find('#add-link-sheet select').val(index);
$view.find('#add-link-sheet .item-after').text(caption);
return this;
},
getTitle: function () {
return this.textAddLink;
},
textLink: 'Link',
textAddLink: 'Add Link',
textDisplay: 'Display',
textTip: 'Screen Tip',
textInsert: 'Insert',
textAddress: 'Address',
textLinkType: 'Link Type',
textExternalLink: 'External Link',
textInternalLink: 'Internal Data Range',
textSheet: 'Sheet',
textRange: 'Range',
textRequired: 'Required',
textSelectedRange: 'Selected Range'
}
})(), SSE.Views.AddLink || {}))
});

View file

@ -1,315 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddOther.js
*
* Created by Kadushkin Maxim on 12/07/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/AddOther.template',
'backbone'
], function (addTemplate, Backbone) {
'use strict';
SSE.Views.AddOther = Backbone.View.extend(_.extend((function() {
// private
var tplNavigation = '<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="center sliding"><%= title %></div>' +
'</div>' +
'</div>';
var mapNavigation = {};
var tplNavigationComment = '<div class="navbar">' +
'<div class="navbar-inner">' +
'<div class="left sliding">' +
'<a href="#" class="back-from-add-comment link">' +
'<i class="icon icon-back"></i>' +
'<% if (!android) { %><span><%= textBack %></span><% } %>' +
'</a>' +
'</div>' +
'<div class="center sliding"><%= title %></div>' +
'<div class="right sliding">' +
'<a id="done-comment">' +
'<% if (android) { %><i class="icon icon-done-comment-white"></i><% } else { %><%= textDone %><% } %>' +
'</a>' +
'</div>' +
'</div>' +
'</div>';
var getNavigation = function (panelid) {
var el = mapNavigation[panelid];
if ( !el ) {
var _title;
switch ( panelid ) {
case '#addlink':
_title = SSE.getController('AddLink').getView('AddLink').getTitle();
break;
case '#addother-insimage': _title = this.textInsertImage; break;
case '#addother-sort': _title = this.textSort; break;
case '#addother-imagefromurl': _title = this.textLinkSettings; break;
case '#addother-insert-comment': _title = this.textAddComment; break;
}
if (panelid === '#addother-insert-comment') {
el = _.template(tplNavigationComment)({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
textBack : this.textBack,
textDone : this.textDone,
title : _title
}
);
} else {
mapNavigation =
el = _.template(tplNavigation)({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
textBack : this.textBack,
title : _title
}
);
}
}
return el;
};
return {
// el: '.view-main',
template: _.template(addTemplate),
events: {},
initialize: function () {
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
},
initEvents: function () {
var me = this;
var $page = $('#add-other');
$page.find('#add-other-insimage').single('click', _.bind(me.showInsertImage, me));
$page.find('#add-other-link').single('click', _.bind(me.showInsertLink, me));
$page.find('#add-other-sort').single('click', _.bind(me.showSortPage, me));
if (me.hideInsertComments || me.isComments) {
$('#item-comment').hide();
} else {
$('#item-comment').show();
$('#add-other-comment').single('click', _.bind(me.showPageComment, me));
}
me.initControls();
},
// Render layout
render: function () {
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
scope : this
}));
return this;
},
rootLayout: function () {
if (this.layout) {
if (!this.canViewComments) {
this.layout.find('#addother-root-view #item-comment').remove();
}
return this.layout
.find('#addother-root-view')
.html();
}
return '';
},
childLayout: function (name) {
if (this.layout) {
if ( name == 'image' )
return this.layout.find('#addother-insimage .page-content').html();
}
return '';
},
initControls: function () {
//
},
showPage: function (templateId, animate) {
var rootView = SSE.getController('AddContainer').rootView;
if (rootView && this.layout) {
var $content = this.layout.find(templateId);
var navbar = getNavigation.call(this, templateId);
if ( !$content.find('.navbar').length ) {
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append(navbar);
} else {
$content.prepend(navbar);
}
}
rootView.router.load({
content: $content.html(),
animatePages: animate !== false
});
this.fireEvent('page:show', [this, templateId]);
}
},
showPageComment: function(animate) {
this.showPage('#addother-insert-comment', animate);
},
renderComment: function(comment) {
var me = this;
_.delay(function () {
var $commentInfo = $('#comment-info');
var template = [
'<% if (android) { %><div class="header-comment"><div class="initials-comment" style="background-color: <%= comment.usercolor %>;"><%= comment.userInitials %></div><div><% } %>',
'<div class="user-name"><%= comment.username %></div>',
'<div class="comment-date"><%= comment.date %></div>',
'<% if (android) { %></div></div><% } %>',
'<div class="wrap-textarea"><textarea id="comment-text" class="comment-textarea" placeholder="<%= textAddComment %>" autofocus></textarea></div>'
].join('');
var insert = _.template(template)({
android: Framework7.prototype.device.android,
comment: comment,
textAddComment: me.textAddComment
});
$commentInfo.html(insert);
_.defer(function () {
var $textarea = $('.comment-textarea')[0];
var $btnAddComment = $('#done-comment');
$btnAddComment.addClass('disabled');
$textarea.focus();
$textarea.oninput = function () {
if ($textarea.value.length < 1) {
if (!$btnAddComment.hasClass('disabled'))
$btnAddComment.addClass('disabled');
} else {
if ($btnAddComment.hasClass('disabled')) {
$btnAddComment.removeClass('disabled');
}
}
};
});
}, 100);
},
showInsertImage: function () {
this.showPage('#addother-insimage');
$('#addimage-url').single('click', this.showImageFromUrl.bind(this));
$('#addimage-file').single('click', function () {
this.fireEvent('image:insert',[{islocal:true}]);
}.bind(this));
},
showInsertLink: function () {
SSE.getController('AddLink').showPage(getNavigation.call(this, '#addlink'));
},
showSortPage: function (e) {
this.showPage('#addother-sort');
var me = this;
$('.settings .sortdown').single('click', function (e) {me.fireEvent('insert:sort',['down']);});
$('.settings .sortup').single('click', function (e) {me.fireEvent('insert:sort',['up']);});
$('.settings #other-chb-insfilter input:checkbox').single('change', function (e) {
var $checkbox = $(e.currentTarget);
me.fireEvent('insert:filter', [$checkbox.is(':checked')]);
});
},
showImageFromUrl: function () {
this.showPage('#addother-imagefromurl');
var me = this;
var $input = $('#addimage-link-url input[type=url]');
$('#addimage-insert a').single('click', _.buffered(function () {
var value = ($input.val()).replace(/ /g, '');
me.fireEvent('image:insert', [{islocal:false, url:value}]);
}, 100, me));
var $btnInsert = $('#addimage-insert');
$('#addimage-fromurl input[type=url]').single('input', function (e) {
$btnInsert.toggleClass('disabled', _.isEmpty($(e.currentTarget).val()));
});
_.delay(function () { $input.focus(); }, 1000);
},
optionAutofilter: function (checked) {
$('.settings #other-chb-insfilter input:checkbox').prop('checked', checked);
},
textInsertImage: 'Insert Image',
textSort: 'Sort and Filter',
textLink: 'Link',
textBack: 'Back',
textInsert: 'Insert',
textFromLibrary: 'Picture from Library',
textFromURL: 'Picture from URL',
textAddress: 'Address',
textImageURL: 'Image URL',
textFilter: 'Filter',
textLinkSettings: 'Link Settings',
textComment: 'Comment',
textAddComment: 'Add Comment',
textDone: 'Done'
}
})(), SSE.Views.AddOther || {}))
});

View file

@ -1,97 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* AddShape.js
*
* Created by Maxim Kadushkin on 12/07/2016
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/AddShape.template',
'backbone'
], function (addTemplate, Backbone) {
'use strict';
SSE.Views.AddShape = Backbone.View.extend(_.extend((function() {
// private
return {
// el: '.view-main',
template: _.template(addTemplate),
events: {
},
initialize: function () {
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
Common.NotificationCenter.on('shapes:load', _.bind(this.render, this));
},
initEvents: function () {
Common.Utils.addScrollIfNeed('#add-shape .pages', '#add-shape .page');
this.initControls();
},
// Render layout
render: function () {
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')
}));
return this;
},
rootLayout: function () {
if (this.layout) {
return this.layout
.find('#add-shapes-root')
.html();
}
return '';
},
initControls: function () {
//
}
}
})(), SSE.Views.AddShape || {}))
});

View file

@ -1,437 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditCell.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/6/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/EditCell.template',
'jquery',
'underscore',
'backbone',
'common/mobile/lib/component/ThemeColorPalette',
'common/mobile/lib/component/HsbColorPicker'
], function (editTemplate, $, _, Backbone) {
'use strict';
SSE.Views.EditCell = Backbone.View.extend(_.extend((function() {
// private
var _fontsList,
_editCellController;
return {
// el: '.view-main',
template: _.template(editTemplate),
events: {
},
initialize: function () {
_editCellController = SSE.getController('EditCell');
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
this.on('page:show', _.bind(this.updateItemHandlers, this));
},
initEvents: function () {
var me = this;
me.updateItemHandlers();
$('#font-fonts').single('click', _.bind(me.showFonts, me));
$('#text-color').single('click', _.bind(me.showTextColor, me));
$('#fill-color').single('click', _.bind(me.showFillColor, me));
Common.Utils.addScrollIfNeed('#edit-cell .pages', '#edit-cell .page');
me.initControls();
},
// Render layout
render: function () {
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
scope : this
}));
return this;
},
rootLayout: function () {
if (this.layout) {
return this.layout
.find('#edit-cell-root')
.html();
}
return '';
},
initControls: function () {
//
},
renderStyles: function (cellStyles) {
var $styleContainer = $('#edit-cell .cell-styles');
if ($styleContainer.length > 0) {
var styleSize = _editCellController.getStyleSize(),
columns = parseInt($styleContainer.width() / (styleSize.width + 5)),
row = -1,
styles = [];
_.each(cellStyles, function (style, index) {
if (0 == index % columns) {
styles.push([]);
row++
}
styles[row].push(style);
});
var template = _.template([
'<% _.each(styles, function(row) { %>',
'<ul class="row">',
'<% _.each(row, function(style) { %>',
'<li data-type="<%= style.asc_getName() %>">',
'<div class="thumb" style="background-image:url(<%= style.asc_getImage() %>); width: <%= styleSize.width %>px; height: <%= styleSize.height %>px;">',
'</li>',
'<% }); %>',
'</ul>',
'<% }); %>'
].join(''))({
styles: styles,
styleSize: styleSize
});
$styleContainer.html(template);
$('#edit-cell .cell-styles li').single('click', _.buffered(function (e) {
var $target = $(e.currentTarget),
type = $target.data('type');
$('#edit-cell .cell-styles li').removeClass('active');
$target.addClass('active');
this.fireEvent('style:click', [this, type]);
}, 100, this));
}
},
updateItemHandlers: function () {
var selectorsDynamicPage = [
'#edit-cell',
'.page[data-page=edit-border-style]',
'.page[data-page=edit-cell-format]'
].map(function (selector) {
return selector + ' a.item-link[data-page]';
}).join(', ');
Common.Utils.addScrollIfNeed('.page[data-page=edit-border-style]', '.page[data-page=edit-border-style] .page-content');
Common.Utils.addScrollIfNeed('.page[data-page=edit-cell-format]', '.page[data-page=edit-cell-format] .page-content');
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-format]', '.page[data-page=edit-text-format] .page-content');
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-orientation]', '.page[data-page=edit-text-orientation] .page-content');
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
},
showPage: function (templateId, suspendEvent) {
var rootView = SSE.getController('EditContainer').rootView;
if (rootView && this.layout) {
var $content = this.layout.find(templateId);
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append($content.find('.navbar'));
}
rootView.router.load({
content: $content.html()
});
if (suspendEvent !== true) {
this.fireEvent('page:show', [this, templateId]);
}
}
},
onItemClick: function (e) {
var $target = $(e.currentTarget),
page = $target.data('page');
if (page && page.length > 0 ) {
this.showPage(page);
}
},
showFonts: function () {
this.showPage('#edit-text-fonts');
var me = this,
$template = $(
'<div>' +
'<li>' +
'<label class="label-radio item-content">' +
'<input type="radio" name="font-name" value="{{name}}">' +
(Framework7.prototype.device.android ? '<div class="item-media"><i class="icon icon-form-radio"></i></div>' : '') +
'<div class="item-inner">' +
'<div class="item-title" style="font-family: \'{{name}}\';">{{name}}</div>' +
'</div>' +
'</label>' +
'</li>' +
'</div>'
);
_fontsList = uiApp.virtualList('#font-list.virtual-list', {
items: SSE.getController('EditCell').getFonts(),
template: $template.html(),
onItemsAfterInsert: function (list, fragment) {
var fontInfo = _editCellController.getFontInfo();
$('#font-list input[name=font-name]').val([fontInfo.name]);
$('#font-list li').single('click', _.buffered(function (e) {
me.fireEvent('font:click', [me, e]);
}, 100));
}
});
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-font-page]', '.page[data-page=edit-text-font-page] .page-content');
},
showTextColor: function () {
var me = this;
this.showPage('#edit-text-color', true);
this.paletteTextColor = new Common.UI.ThemeColorPalette({
el: $('.page[data-page=edit-text-color] .page-content')
});
this.paletteTextColor.on('customcolor', function () {
me.showCustomTextColor();
});
var template = _.template(['<div class="list-block">',
'<ul>',
'<li>',
'<a id="edit-cell-add-custom-text-color" class="item-link">',
'<div class="item-content">',
'<div class="item-inner">',
'<div class="item-title"><%= scope.textAddCustomColor %></div>',
'</div>',
'</div>',
'</a>',
'</li>',
'</ul>',
'</div>'].join(''));
$('.page[data-page=edit-text-color] .page-content').append(template({scope: this}));
$('#edit-cell-add-custom-text-color').single('click', _.bind(this.showCustomTextColor, this));
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-color]', '.page[data-page=edit-text-color] .page-content');
this.fireEvent('page:show', [this, '#edit-text-color']);
},
showCustomTextColor: function () {
var me = this,
selector = '#edit-cell-custom-color-view';
me.showPage(selector, true);
me.customTextColorPicker = new Common.UI.HsbColorPicker({
el: $('.page[data-page=edit-cell-custom-color] .page-content'),
color: me.paletteTextColor.currentColor
});
me.customTextColorPicker.on('addcustomcolor', function (colorPicker, color) {
me.paletteTextColor.addNewDynamicColor(colorPicker, color);
SSE.getController('EditContainer').rootView.router.back();
});
me.fireEvent('page:show', [me, selector]);
},
showFillColor: function () {
var me = this;
this.showPage('#edit-fill-color', true);
this.paletteFillColor = new Common.UI.ThemeColorPalette({
el: $('.page[data-page=edit-fill-color] .page-content'),
transparent: true
});
this.paletteFillColor.on('customcolor', function () {
me.showCustomFillColor();
});
var template = _.template(['<div class="list-block">',
'<ul>',
'<li>',
'<a id="edit-cell-add-custom-color" class="item-link">',
'<div class="item-content">',
'<div class="item-inner">',
'<div class="item-title"><%= scope.textAddCustomColor %></div>',
'</div>',
'</div>',
'</a>',
'</li>',
'</ul>',
'</div>'].join(''));
$('.page[data-page=edit-fill-color] .page-content').append(template({scope: this}));
$('#edit-cell-add-custom-color').single('click', _.bind(this.showCustomFillColor, this));
Common.Utils.addScrollIfNeed('.page[data-page=edit-fill-color]', '.page[data-page=edit-fill-color] .page-content');
this.fireEvent('page:show', [this, '#edit-fill-color']);
},
showCustomFillColor: function () {
var me = this,
selector = '#edit-cell-custom-color-view';
me.showPage(selector, true);
me.customFillColorPicker = new Common.UI.HsbColorPicker({
el: $('.page[data-page=edit-cell-custom-color] .page-content'),
color: me.paletteFillColor.currentColor
});
me.customFillColorPicker.on('addcustomcolor', function (colorPicker, color) {
me.paletteFillColor.addNewDynamicColor(colorPicker, color);
SSE.getController('EditContainer').rootView.router.back();
});
me.fireEvent('page:show', [me, selector]);
},
showBorderColorPage: function () {
var me = this;
this.paletteBorderColor = new Common.UI.ThemeColorPalette({
el: $('.page[data-page=edit-border-color] .page-content')
});
this.paletteBorderColor.on('customcolor', function () {
me.showCustomBorderColor();
});
var template = _.template(['<div class="list-block">',
'<ul>',
'<li>',
'<a id="edit-cell-add-custom-border-color" class="item-link">',
'<div class="item-content">',
'<div class="item-inner">',
'<div class="item-title"><%= scope.textAddCustomColor %></div>',
'</div>',
'</div>',
'</a>',
'</li>',
'</ul>',
'</div>'].join(''));
$('.page[data-page=edit-border-color] .page-content').append(template({scope: this}));
$('#edit-cell-add-custom-border-color').single('click', _.bind(this.showCustomBorderColor, this));
},
showCustomBorderColor: function () {
var me = this,
selector = '#edit-cell-custom-color-view';
me.showPage(selector, true);
me.customBorderColorPicker = new Common.UI.HsbColorPicker({
el: $('.page[data-page=edit-cell-custom-color] .page-content'),
color: me.paletteBorderColor.currentColor
});
me.customBorderColorPicker.on('addcustomcolor', function (colorPicker, color) {
me.paletteBorderColor.addNewDynamicColor(colorPicker, color);
SSE.getController('EditContainer').rootView.router.back();
});
me.fireEvent('page:show', [me, selector]);
},
textBack: 'Back',
textFonts: 'Fonts',
textTextColor: 'Text Color',
textFillColor: 'Fill Color',
textTextFormat: 'Text Format',
textBorderStyle: 'Border Style',
textSize: 'Size',
textFormat: 'Format',
textCellStyle: 'Cell Styles',
textAlignLeft: 'Align Left',
textAlignCenter: 'Align Center',
textAlignRight: 'Align Right',
textJustified: 'Justified',
textAlignTop: 'Align Top',
textAlignMiddle: 'Align Middle',
textAlignBottom: 'Align Bottom',
textWrapText: 'Wrap Text',
textNoBorder: 'No Border',
textAllBorders: 'All Borders',
textBottomBorder: 'Bottom Border',
textTopBorder: 'Top Border',
textLeftBorder: 'Left Border',
textRightBorder: 'Right Border',
textInBorders: 'Inside Borders',
textInVertBorder: 'Inside Vertical Border',
textInHorBorder: 'Inside Horizontal Border',
textDiagUpBorder: 'Diagonal Up Border',
textDiagDownBorder: 'Diagonal Down Border',
textColor: 'Color',
textThin: 'Thin',
textMedium: 'Medium',
textThick: 'Thick',
textInteger: 'Integer',
textGeneral: 'General',
textNumber: 'Number',
textScientific: 'Scientific',
textAccounting: 'Accounting',
textCurrency: 'Currency',
textDate: 'Date',
textTime: 'Time',
textPercentage: 'Percentage',
textText: 'Text',
textDollar: 'Dollar',
textEuro: 'Euro',
textPound: 'Pound',
textRouble: 'Rouble',
textYen: 'Yen',
textCharacterBold: 'B',
textCharacterItalic: 'I',
textCharacterUnderline: 'U',
textAddCustomColor: 'Add Custom Color',
textCustomColor: 'Custom Color',
textTextOrientation: 'Text Orientation',
textHorizontalText: 'Horizontal Text',
textAngleCounterclockwise: 'Angle Counterclockwise',
textAngleClockwise: 'Angle Clockwise',
textVerticalText: 'Vertical Text',
textRotateTextUp: 'Rotate Text Up',
textRotateTextDown: 'Rotate Text Down'
}
})(), SSE.Views.EditCell || {}))
});

View file

@ -1,375 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditChart.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/12/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/EditChart.template',
'jquery',
'underscore',
'backbone',
'common/mobile/lib/component/ThemeColorPalette',
'common/mobile/lib/component/HsbColorPicker'
], function (editTemplate, $, _, Backbone) {
'use strict';
SSE.Views.EditChart = Backbone.View.extend(_.extend((function() {
// private
var _editTextController,
_types = [
{ type: Asc.c_oAscChartTypeSettings.barNormal, thumb: 'chart-03.png'},
{ type: Asc.c_oAscChartTypeSettings.barStacked, thumb: 'chart-02.png'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer, thumb: 'chart-01.png'},
{ type: Asc.c_oAscChartTypeSettings.lineNormal, thumb: 'chart-06.png'},
{ type: Asc.c_oAscChartTypeSettings.lineStacked, thumb: 'chart-05.png'},
{ type: Asc.c_oAscChartTypeSettings.lineStackedPer, thumb: 'chart-04.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal, thumb: 'chart-09.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked, thumb: 'chart-08.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer, thumb: 'chart-07.png'},
{ type: Asc.c_oAscChartTypeSettings.areaNormal, thumb: 'chart-12.png'},
{ type: Asc.c_oAscChartTypeSettings.areaStacked, thumb: 'chart-11.png'},
{ type: Asc.c_oAscChartTypeSettings.areaStackedPer, thumb: 'chart-10.png'},
{ type: Asc.c_oAscChartTypeSettings.pie, thumb: 'chart-13.png'},
{ type: Asc.c_oAscChartTypeSettings.doughnut, thumb: 'chart-14.png'},
{ type: Asc.c_oAscChartTypeSettings.pie3d, thumb: 'chart-22.png'},
{ type: Asc.c_oAscChartTypeSettings.scatter, thumb: 'chart-15.png'},
{ type: Asc.c_oAscChartTypeSettings.stock, thumb: 'chart-16.png'},
{ type: Asc.c_oAscChartTypeSettings.line3d, thumb: 'chart-21.png'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3d, thumb: 'chart-17.png'},
{ type: Asc.c_oAscChartTypeSettings.barStacked3d, thumb: 'chart-18.png'},
{ type: Asc.c_oAscChartTypeSettings.barStackedPer3d, thumb: 'chart-19.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarNormal3d, thumb: 'chart-25.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStacked3d, thumb: 'chart-24.png'},
{ type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, thumb: 'chart-23.png'},
{ type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, thumb: 'chart-20.png'}
];
return {
// el: '.view-main',
template: _.template(editTemplate),
events: {
},
initialize: function () {
_editTextController = SSE.getController('EditChart');
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
this.on('page:show', _.bind(this.updateItemHandlers, this));
},
initEvents: function () {
var me = this;
me.updateItemHandlers();
me.initControls();
Common.Utils.addScrollIfNeed('#edit-chart .pages', '#edit-chart .page');
},
// Render layout
render: function () {
var elementsInRow = 3;
var groupsOfTypes = _.chain(_types).groupBy(function(element, index){
return Math.floor(index/elementsInRow);
}).toArray().value();
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
types : groupsOfTypes,
scope : this
}));
return this;
},
rootLayout: function () {
if (this.layout) {
return this.layout
.find('#edit-chart-root')
.html();
}
return '';
},
initControls: function () {
//
},
renderStyles: function (chartStyles) {
var $styleContainer = $('#tab-chart-style');
if ($styleContainer.length > 0) {
var columns = parseInt($styleContainer.width() / 70), // magic
row = -1,
styles = [];
_.each(chartStyles, function (style, index) {
if (0 == index % columns) {
styles.push([]);
row++
}
styles[row].push(style);
});
var template = _.template([
'<% _.each(styles, function(row) { %>',
'<ul class="row">',
'<% _.each(row, function(style) { %>',
'<li data-type="<%= style.asc_getName() %>">',
'<img src="<%= style.asc_getImage() %>" width="50px" height="50px">',
'</li>',
'<% }); %>',
'</ul>',
'<% }); %>'
].join(''))({
styles: styles
});
$styleContainer.html(template);
}
},
updateItemHandlers: function () {
var selectorsDynamicPage = [
'#edit-chart',
'.page[data-page=edit-chart-style]'
].map(function (selector) {
return selector + ' a.item-link[data-page]';
}).join(', ');
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
$('#chart-style').single('click', _.bind(this.showStyle, this));
$('#edit-chart-bordercolor').single('click', _.bind(this.showBorderColor, this));
$('.edit-chart-style.subnavbar.categories a').single('click', function () {
$('.page[data-page=edit-chart-style]').find('.list-block.inputs-list').removeClass('inputs-list');
});
},
showPage: function (templateId, suspendEvent) {
var rootView = SSE.getController('EditContainer').rootView;
if (rootView && this.layout) {
var $content = this.layout.find(templateId);
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append($content.find('.navbar'));
}
rootView.router.load({
content: $content.html()
});
if (suspendEvent !== true) {
this.fireEvent('page:show', [this, templateId]);
}
}
},
showStyle: function () {
var me = this;
var page = '#edit-chart-style';
this.showPage(page, true);
this.paletteFillColor = new Common.UI.ThemeColorPalette({
el: $('#tab-chart-fill'),
transparent: true
});
this.paletteFillColor.on('customcolor', function () {
me.showCustomFillColor();
});
var template = _.template(['<div class="list-block">',
'<ul>',
'<li>',
'<a id="edit-chart-add-custom-fill-color" class="item-link">',
'<div class="item-content">',
'<div class="item-inner">',
'<div class="item-title"><%= scope.textAddCustomColor %></div>',
'</div>',
'</div>',
'</a>',
'</li>',
'</ul>',
'</div>'].join(''));
$('#tab-chart-fill').append(template({scope: this}));
$('#edit-chart-add-custom-fill-color').single('click', _.bind(this.showCustomFillColor, this));
Common.Utils.addScrollIfNeed('.page[data-page=edit-chart-style]', '.page[data-page=edit-chart-style] .page-content');
this.fireEvent('page:show', [this, page]);
},
showCustomFillColor: function () {
var me = this,
selector = '#edit-chart-custom-color-view';
me.showPage(selector, true);
me.customFillColorPicker = new Common.UI.HsbColorPicker({
el: $('.page[data-page=edit-chart-custom-color] .page-content'),
color: me.paletteFillColor.currentColor
});
me.customFillColorPicker.on('addcustomcolor', function (colorPicker, color) {
me.paletteFillColor.addNewDynamicColor(colorPicker, color);
SSE.getController('EditContainer').rootView.router.back();
});
me.fireEvent('page:show', [me, selector]);
},
showBorderColor: function () {
var me = this;
var selector = '#edit-chart-border-color-view';
this.showPage(selector, true);
this.paletteBorderColor = new Common.UI.ThemeColorPalette({
el: $('.page[data-page=edit-chart-border-color] .page-content')
});
this.paletteBorderColor.on('customcolor', function () {
me.showCustomBorderColor();
});
var template = _.template(['<div class="list-block">',
'<ul>',
'<li>',
'<a id="edit-chart-add-custom-border-color" class="item-link">',
'<div class="item-content">',
'<div class="item-inner">',
'<div class="item-title"><%= scope.textAddCustomColor %></div>',
'</div>',
'</div>',
'</a>',
'</li>',
'</ul>',
'</div>'].join(''));
$('.page[data-page=edit-chart-border-color] .page-content').append(template({scope: this}));
$('#edit-chart-add-custom-border-color').single('click', _.bind(this.showCustomBorderColor, this));
this.fireEvent('page:show', [this, selector]);
},
showCustomBorderColor: function () {
var me = this,
selector = '#edit-chart-custom-color-view';
me.showPage(selector, true);
me.customBorderColorPicker = new Common.UI.HsbColorPicker({
el: $('.page[data-page=edit-chart-custom-color] .page-content'),
color: me.paletteBorderColor.currentColor
});
me.customBorderColorPicker.on('addcustomcolor', function (colorPicker, color) {
me.paletteBorderColor.addNewDynamicColor(colorPicker, color);
me.paletteFillColor.updateDynamicColors();
me.paletteFillColor.select(me.paletteFillColor.currentColor);
SSE.getController('EditContainer').rootView.router.back();
});
me.fireEvent('page:show', [me, selector]);
},
onItemClick: function (e) {
var $target = $(e.currentTarget),
page = $target.data('page');
if (page && page.length > 0 ) {
this.showPage(page);
}
},
textBack: 'Back',
textChart: 'Chart',
textReorder: 'Reorder',
textRemoveChart: 'Remove Chart',
textToForeground: 'Bring to Foreground',
textToBackground: 'Send to Background',
textForward: 'Move Forward',
textBackward: 'Move Backward',
textStyle: 'Style',
textDesign: 'Design',
textLayout: 'Layout',
textVerAxis: 'Vertical Axis',
textHorAxis: 'Horizontal Axis',
textType: 'Type',
textFill: 'Fill',
textBorder: 'Border',
textSize: 'Size',
textColor: 'Color',
textOverlay: 'Overlay',
textNoOverlay: 'No Overlay',
textChartTitle: 'Chart Title',
textLeft: 'Left',
textTop: 'Top',
textRight: 'Right',
textBottom: 'Bottom',
textLeftOverlay: 'Left Overlay',
textRightOverlay: 'Right Overlay',
textLegend: 'Legend',
textAxisTitle: 'Axis Title',
textHorizontal: 'Horizontal',
textRotated: 'Rotated',
textVertical: 'Vertical',
textMajor: 'Major',
textMinor: 'Minor',
textMajorMinor: 'Major and Minor',
textDataLabels: 'Data Labels',
textAxisOptions: 'Axis Options',
textMinValue: 'Minimum Value',
textMaxValue: 'Maximum Value',
textAxisCrosses: 'Axis Crosses',
textAuto: 'Auto',
textCrossesValue: 'Crosses Value',
textDisplayUnits: 'Display Units',
textValReverseOrder: 'Values in Reverse Order',
textTickOptions: 'Tick Options',
textMajorType: 'Major Type',
textMinorType: 'Minor Type',
textLabelOptions: 'Label Options',
textLabelPos: 'Label Position',
textAxisPosition: 'Axis Position',
textNone: 'None',
textGridlines: 'Gridlines',
textAddCustomColor: 'Add Custom Color',
textCustomColor: 'Custom Color'
}
})(), SSE.Views.EditChart || {}))
});

View file

@ -1,160 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditHyperlink.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/20/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/EditHyperlink.template',
'jquery',
'underscore',
'backbone'
], function (editTemplate, $, _, Backbone) {
'use strict';
SSE.Views.EditHyperlink = Backbone.View.extend(_.extend((function() {
// private
var _editCellController;
return {
// el: '.view-main',
template: _.template(editTemplate),
events: {
},
initialize: function () {
_editCellController = SSE.getController('EditHyperlink');
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
this.on('page:show', _.bind(this.updateItemHandlers, this));
},
initEvents: function () {
var me = this;
me.updateItemHandlers();
Common.Utils.addScrollIfNeed('#edit-link .pages', '#edit-link .page');
me.initControls();
},
// Render layout
render: function () {
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
scope : this
}));
return this;
},
rootLayout: function () {
if (this.layout) {
return this.layout
.find('#edit-link-root')
.html();
}
return '';
},
initControls: function () {
//
},
showPage: function (templateId, suspendEvent) {
var rootView = SSE.getController('EditContainer').rootView;
if (rootView && this.layout) {
var $content = this.layout.find(templateId);
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append($content.find('.navbar'));
}
rootView.router.load({
content: $content.html()
});
if (suspendEvent !== true) {
this.fireEvent('page:show', [this, templateId]);
}
}
},
onItemClick: function (e) {
var $target = $(e.currentTarget),
page = $target.data('page');
if (page && page.length > 0 ) {
this.showPage(page);
}
},
updateItemHandlers: function () {
var selectorsDynamicPage = [
'#edit-link'
].map(function (selector) {
return selector + ' a.item-link[data-page]';
}).join(', ');
Common.Utils.addScrollIfNeed('.page[data-page=edit-link-type]', '.page[data-page=edit-border-style] .page-content');
Common.Utils.addScrollIfNeed('.page[data-page=edit-link-sheet]', '.page[data-page=edit-cell-format] .page-content');
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
},
textBack: 'Back',
textExternalLink: 'External Link',
textInternalLink: 'Internal Data Range',
textLinkType: 'Link Type',
textSheet: 'Sheet',
textRange: 'Range',
textLink: 'Link',
textDisplay: 'Display',
textScreenTip: 'Screen Tip',
textEditLink: 'Save Link',
textRemoveLink: 'Remove Link'
}
})(), SSE.Views.EditHyperlink || {}))
});

View file

@ -1,166 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditImage.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/19/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/EditImage.template',
'jquery',
'underscore',
'backbone'
], function (editTemplate, $, _, Backbone) {
'use strict';
SSE.Views.EditImage = Backbone.View.extend(_.extend((function() {
// private
return {
// el: '.view-main',
template: _.template(editTemplate),
events: {
},
initialize: function () {
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
Common.NotificationCenter.on('editcategory:show', _.bind(this.categoryShow, this));
this.on('page:show', _.bind(this.updateItemHandlers, this));
},
initEvents: function () {
var me = this;
me.updateItemHandlers();
me.initControls();
},
categoryShow: function(e) {
// if ('edit-shape' == $(e.currentTarget).prop('id')) {
// this.initEvents();
// }
},
// Render layout
render: function () {
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
scope : this
}));
return this;
},
rootLayout: function () {
if (this.layout) {
return this.layout
.find('#edit-image-root')
.html();
}
return '';
},
initControls: function () {
//
},
updateItemHandlers: function () {
var selectorsDynamicPage = [
'#edit-image',
'.page[data-page=edit-image-replace-view]'
].map(function (selector) {
return selector + ' a.item-link[data-page]';
}).join(', ');
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
},
showPage: function (templateId, suspendEvent) {
var rootView = SSE.getController('EditContainer').rootView;
if (rootView && this.layout) {
var $content = this.layout.find(templateId);
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append($content.find('.navbar'));
}
rootView.router.load({
content: $content.html()
});
if (suspendEvent !== true) {
this.fireEvent('page:show', [this, templateId]);
}
this.initEvents();
}
},
onItemClick: function (e) {
var $target = $(e.currentTarget),
page = $target.data('page');
if (page && page.length > 0 ) {
this.showPage(page);
}
},
textReplace: 'Replace',
textReorder: 'Reorder',
textDefault: 'Actual Size',
textRemove: 'Remove Image',
textBack: 'Back',
textToForeground: 'Bring to Foreground',
textToBackground: 'Send to Background',
textForward: 'Move Forward',
textBackward: 'Move Backward',
textFromLibrary: 'Picture from Library',
textFromURL: 'Picture from URL',
textLinkSettings: 'Link Settings',
textAddress: 'Address',
textImageURL: 'Image URL',
textReplaceImg: 'Replace Image'
}
})(), SSE.Views.EditImage || {}))
});

View file

@ -1,298 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditShape.js
*
* Created by Alexander Yuzhin on 12/19/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/EditShape.template',
'jquery',
'underscore',
'backbone',
'common/mobile/lib/component/ThemeColorPalette',
'common/mobile/lib/component/HsbColorPicker'
], function (editTemplate, $, _, Backbone) {
'use strict';
SSE.Views.EditShape = Backbone.View.extend(_.extend((function() {
// private
return {
// el: '.view-main',
template: _.template(editTemplate),
events: {
},
initialize: function () {
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
Common.NotificationCenter.on('editcategory:show', _.bind(this.categoryShow, this));
//this.on('page:show', _.bind(this.updateItemHandlers, this));
this.isShapeCanFill = true;
},
initEvents: function () {
var me = this;
me.updateItemHandlers();
$('.edit-shape-style .categories a').single('click', _.bind(me.showStyleCategory, me));
Common.Utils.addScrollIfNeed('#edit-shape .pages', '#edit-shape .page');
me.initControls();
},
categoryShow: function(e) {
// if ('edit-shape' == $(e.currentTarget).prop('id')) {
// this.initEvents();
// }
},
// 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 : shapes,
scope : this
}));
return this;
},
rootLayout: function () {
if (this.layout) {
return this.layout
.find('#edit-shape-root')
.html();
}
return '';
},
initControls: function () {
//
},
updateItemHandlers: function () {
var selectorsDynamicPage = [
'#edit-shape',
'.page[data-page=edit-shape-style]'
].map(function (selector) {
return selector + ' a.item-link[data-page]';
}).join(', ');
Common.Utils.addScrollIfNeed('.page[data-page=edit-shape-border-color-view]', '.page[data-page=edit-shape-border-color-view] .page-content');
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
$('#shape-style').single('click', _.bind(this.showStyle, this));
$('#edit-shape-bordercolor').single('click', _.bind(this.showBorderColor, this));
},
showPage: function (templateId, suspendEvent) {
var rootView = SSE.getController('EditContainer').rootView;
if (rootView && this.layout) {
var $content = this.layout.find(templateId);
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append($content.find('.navbar'));
}
rootView.router.load({
content: $content.html()
});
if (suspendEvent !== true) {
this.fireEvent('page:show', [this, templateId]);
}
this.initEvents();
}
},
showStyle: function () {
var me = this;
var page = '#edit-shape-style';
if (!this.isShapeCanFill) {
page = '#edit-shape-style-nofill';
}
this.showPage(page, true);
this.paletteFillColor = new Common.UI.ThemeColorPalette({
el: $('#tab-shape-fill'),
transparent: true
});
this.paletteFillColor.on('customcolor', function () {
me.showCustomFillColor();
});
var template = _.template(['<div class="list-block">',
'<ul>',
'<li>',
'<a id="edit-cell-add-custom-fill-color" class="item-link">',
'<div class="item-content">',
'<div class="item-inner">',
'<div class="item-title"><%= scope.textAddCustomColor %></div>',
'</div>',
'</div>',
'</a>',
'</li>',
'</ul>',
'</div>'].join(''));
$('#tab-shape-fill').append(template({scope: this}));
$('#edit-cell-add-custom-fill-color').single('click', _.bind(this.showCustomFillColor, this));
if (!this.isShapeCanFill)
this.showStyleCategory();
Common.Utils.addScrollIfNeed('.page[data-page=edit-shape-style]', '.page[data-page=edit-shape-style] .page-content');
this.fireEvent('page:show', [this, page]);
},
showCustomFillColor: function () {
var me = this,
selector = '#edit-shape-custom-color-view';
me.showPage(selector, true);
me.customFillColorPicker = new Common.UI.HsbColorPicker({
el: $('.page[data-page=edit-shape-custom-color] .page-content'),
color: me.paletteFillColor.currentColor
});
me.customFillColorPicker.on('addcustomcolor', function (colorPicker, color) {
me.paletteFillColor.addNewDynamicColor(colorPicker, color);
SSE.getController('EditContainer').rootView.router.back();
});
me.fireEvent('page:show', [me, selector]);
},
showBorderColor: function () {
var me = this;
var selector = '#edit-shape-border-color-view';
this.showPage(selector, true);
this.paletteBorderColor = new Common.UI.ThemeColorPalette({
el: $('.page[data-page=edit-shape-border-color-view] .page-content')
});
this.paletteBorderColor.on('customcolor', function () {
me.showCustomBorderColor();
});
var template = _.template(['<div class="list-block">',
'<ul>',
'<li>',
'<a id="edit-shape-add-custom-border-color" class="item-link">',
'<div class="item-content">',
'<div class="item-inner">',
'<div class="item-title"><%= scope.textAddCustomColor %></div>',
'</div>',
'</div>',
'</a>',
'</li>',
'</ul>',
'</div>'].join(''));
$('.page[data-page=edit-shape-border-color-view] .page-content').append(template({scope: this}));
$('#edit-shape-add-custom-border-color').single('click', _.bind(this.showCustomBorderColor, this));
this.fireEvent('page:show', [this, selector]);
},
showCustomBorderColor: function () {
var me = this,
selector = '#edit-shape-custom-color-view';
me.showPage(selector, true);
me.customBorderColorPicker = new Common.UI.HsbColorPicker({
el: $('.page[data-page=edit-shape-custom-color] .page-content'),
color: me.paletteBorderColor.currentColor
});
me.customBorderColorPicker.on('addcustomcolor', function (colorPicker, color) {
me.paletteBorderColor.addNewDynamicColor(colorPicker, color);
me.paletteFillColor.updateDynamicColors();
me.paletteFillColor.select(me.paletteFillColor.currentColor);
SSE.getController('EditContainer').rootView.router.back();
});
me.fireEvent('page:show', [me, selector]);
},
showStyleCategory: function (e) {
// remove android specific style
$('.page[data-page=edit-shape-style] .list-block.inputs-list').removeClass('inputs-list');
},
onItemClick: function (e) {
var $target = $(e.currentTarget),
page = $target.data('page');
if (page && page.length > 0 ) {
this.showPage(page);
}
Common.Utils.addScrollIfNeed('.page[data-page=edit-shape-style]', '.page[data-page=edit-shape-style] .page-content');
Common.Utils.addScrollIfNeed('.page[data-page=edit-shape-replace]', '.page[data-page=edit-shape-replace] .page-content');
Common.Utils.addScrollIfNeed('.page[data-page=edit-shape-reorder]', '.page[data-page=edit-shape-reorder] .page-content');
},
textStyle: 'Style',
textReplace: 'Replace',
textReorder: 'Reorder',
textRemoveShape: 'Remove Shape',
textBack: 'Back',
textToForeground: 'Bring to Foreground',
textToBackground: 'Send to Background',
textForward: 'Move Forward',
textBackward: 'Move Backward',
textFill: 'Fill',
textBorder: 'Border',
textEffects: 'Effects',
textSize: 'Size',
textColor: 'Color',
textOpacity: 'Opacity',
textAddCustomColor: 'Add Custom Color',
textCustomColor: 'Custom Color'
}
})(), SSE.Views.EditShape || {}))
});

View file

@ -1,239 +0,0 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* EditText.js
* Spreadsheet Editor
*
* Created by Alexander Yuzhin on 12/21/16
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/mobile/app/template/EditText.template',
'jquery',
'underscore',
'backbone',
'common/mobile/lib/component/ThemeColorPalette',
'common/mobile/lib/component/HsbColorPicker'
], function (editTemplate, $, _, Backbone) {
'use strict';
SSE.Views.EditText = Backbone.View.extend(_.extend((function() {
// private
var _fontsArray = [];
return {
// el: '.view-main',
template: _.template(editTemplate),
events: {
},
initialize: function () {
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
Common.NotificationCenter.on('fonts:load', _.bind(this.onApiFontsLoad, this));
},
initEvents: function () {
var me = this;
me.updateItemHandlers();
me.initControls();
},
// Render layout
render: function () {
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
scope : this
}));
return this;
},
rootLayout: function () {
if (this.layout) {
return this.layout
.find('#edit-text-root')
.html();
}
return '';
},
initControls: function () {
//
},
updateItemHandlers: function () {
var selectorsDynamicPage = [
'#edit-text'
].map(function (selector) {
return selector + ' a.item-link[data-page]';
}).join(', ');
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
$('#font-color').single('click', _.bind(this.showFontColor, this));
},
showPage: function (templateId, suspendEvent) {
var rootView = SSE.getController('EditContainer').rootView;
if (rootView && this.layout) {
var $content = this.layout.find(templateId);
// Android fix for navigation
if (Framework7.prototype.device.android) {
$content.find('.page').append($content.find('.navbar'));
}
rootView.router.load({
content: $content.html()
});
if (suspendEvent !== true) {
this.fireEvent('page:show', [this, templateId]);
}
this.initEvents();
}
},
showFontColor: function () {
var me = this;
var page = '#edit-text-color';
this.showPage(page, true);
this.paletteTextColor = new Common.UI.ThemeColorPalette({
el: $('.page[data-page=edit-text-color] .page-content'),
transparent: true
});
this.paletteTextColor.on('customcolor', function () {
me.showCustomTextColor();
});
var template = _.template(['<div class="list-block">',
'<ul>',
'<li>',
'<a id="edit-text-add-custom-fill-color" class="item-link">',
'<div class="item-content">',
'<div class="item-inner">',
'<div class="item-title"><%= scope.textAddCustomColor %></div>',
'</div>',
'</div>',
'</a>',
'</li>',
'</ul>',
'</div>'].join(''));
$('.page[data-page=edit-text-color] .page-content').append(template({scope: this}));
$('#edit-text-add-custom-fill-color').single('click', _.bind(this.showCustomTextColor, this));
Common.Utils.addScrollIfNeed('.page[data-page=edit-text]', '.page[data-page=edit-text] .page-content');
this.fireEvent('page:show', [this, page]);
},
showCustomTextColor: function () {
var me = this,
selector = '#edit-text-custom-color-view';
me.showPage(selector, true);
me.customTextColorPicker = new Common.UI.HsbColorPicker({
el: $('.page[data-page=edit-text-custom-color] .page-content'),
color: me.paletteTextColor.currentColor
});
me.customTextColorPicker.on('addcustomcolor', function (colorPicker, color) {
me.paletteTextColor.addNewDynamicColor(colorPicker, color);
SSE.getController('EditContainer').rootView.router.back();
});
me.fireEvent('page:show', [me, selector]);
},
renderFonts: function () {
var me = this,
$template = $(
'<div>' +
'<li>' +
'<label class="label-radio item-content">' +
'<input type="radio" name="font-name" value="{{name}}">' +
(Framework7.prototype.device.android ? '<div class="item-media"><i class="icon icon-form-radio"></i></div>' : '') +
'<div class="item-inner">' +
'<div class="item-title" style="font-family: \'{{name}}\';">{{name}}</div>' +
'</div>' +
'</label>' +
'</li>' +
'</div>'
);
uiApp.virtualList('#font-list.virtual-list', {
items: _fontsArray,
template: $template.html(),
onItemsAfterInsert: function (list, fragment) {
var fontInfo = SSE.getController('EditText').getFontInfo();
$('#font-list input[name=font-name]').val([fontInfo.name]);
$('#font-list li').single('click', _.buffered(function (e) {
me.fireEvent('font:click', [me, e]);
}, 100));
}
});
},
onItemClick: function (e) {
var $target = $(e.currentTarget),
page = $target.data('page');
if (page && page.length > 0 ) {
this.showPage(page);
}
},
onApiFontsLoad: function (fonts, selcted) {
_fontsArray = fonts;
},
textBack: 'Back',
textFonts: 'Fonts',
textTextColor: 'Text Color',
textFillColor: 'Fill Color',
textSize: 'Size',
textCharacterBold: 'B',
textCharacterItalic: 'I',
textCharacterUnderline: 'U',
textAddCustomColor: 'Add Custom Color',
textCustomColor: 'Custom Color'
}
})(), SSE.Views.EditText || {}))
});

View file

@ -1,245 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<title>ONLYOFFICE Spreadsheet Editor</title>
<link rel="stylesheet" type="text/css" href="../../../../sdkjs/cell/css/main-mobile.css"/>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,500,700" rel="stylesheet" type="text/css">
<style type="text/css">
.loadmask {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 10000;
}
.loadmask > .brendpanel {
width: 100%;
position: absolute;
height: 68px;
background-color: #e2e2e2;
opacity: 0;
}
.loadmask > .brendpanel.visible {
opacity: 1;
}
.loadmask > .brendpanel.android {
height: 80px;
background: #40865c;
}
.loadmask > .brendpanel > div {
display: flex;
align-items: flex-start;
height: 100%;
}
.loadmask > .brendpanel .loading-logo {
max-width: 200px;
height: 20px;
margin: 0 auto;
margin-top: 12px;
line-height: 14px;
opacity: 0;
}
.loadmask > .brendpanel .loading-logo > img {
display: inline-block;
max-width: 100px;
max-height: 20px;
}
.loadmask > .brendpanel .circle {
width: 28px;
height: 28px;
border-radius: 14px;
margin: 0 16px;
margin-bottom: 10px;
align-self: flex-end;
background: rgba(255, 255, 255, 0.3);
}
.loadmask > .brendpanel.android .circle {
margin-bottom: 12px;
background: rgba(255, 255, 255, 0.2);
}
.loadmask > .placeholder {
background: #fbfbfb;
width: 100%;
height: 100%;
font-size: 0;
border: 1px solid #dfdfdf;
white-space: nowrap;
padding-top: 67px;
}
.loadmask > .placeholder.android {
padding-top: 79px;
}
.loadmask > .placeholder > .columns {
width: 100%;
height: 100%;
display: inline-block;
background: linear-gradient(90deg, #d5d5d5 0px, rgba(0,0,0,0) 1px) 0 0,
linear-gradient(rgba(0,255,0,0) 19px, #d5d5d5 20px) 0 0,
linear-gradient( #f1f1f1 0px, #f1f1f1 20px) 0 0 repeat-x;
background-size: 80px 20px;
-webkit-animation: flickerAnimation 2s infinite ease-in-out;
-moz-animation: flickerAnimation 2s infinite ease-in-out;
-o-animation: flickerAnimation 2s infinite ease-in-out;
animation: flickerAnimation 2s infinite ease-in-out;
}
.loadmask > .placeholder > .columns:first-child {
position: absolute;
background: linear-gradient(#f1f1f1 19px, #d5d5d5 20px) 0 0;
background-size: 20px 20px;
width: 25px;
}
@keyframes flickerAnimation {
0% { opacity:1; }
50% { opacity:0.3; }
100% { opacity:1; }
}
@-o-keyframes flickerAnimation{
0% { opacity:1; }
50% { opacity:0.3; }
100% { opacity:1; }
}
@-moz-keyframes flickerAnimation{
0% { opacity:1; }
50% { opacity:0.3; }
100% { opacity:1; }
}
@-webkit-keyframes flickerAnimation{
0% { opacity:1; }
50% { opacity:0.3; }
100% { opacity:1; }
}
</style>
</head>
<body>
<div id="loading-mask" class="loadmask">
<div class="brendpanel">
<div>
<div class="circle"></div>
<div class="loading-logo">
</div>
<div class="circle"></div>
</div>
</div>
<div class="placeholder">
<div class="columns"></div>
<div class="columns"></div>
</div>
</div>
<script type="text/javascript">
var ua = navigator.userAgent;
if (/Sailfish/.test(ua) || /Jolla/.test(ua)) {
document.write('<script type="text/javascript" src="../../../vendor/iscroll/iscroll.min.js"><\/script>');
if (!/Android/.test(ua)) {
var ua = navigator.userAgent + ';Android 5.0;';
Object.defineProperty(navigator, 'userAgent', {
get: function () { return ua; }
});
}
}
function getUrlParams() {
var e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
q = window.location.search.substring(1),
urlParams = {};
while (e = r.exec(q))
urlParams[d(e[1])] = d(e[2]);
return urlParams;
}
function encodeUrlParam(str) {
return str.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
logo = /*params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : */null;
var logoOO = null;
if (!logo) {
logoOO = /Android/.test(navigator.userAgent) ? "../../../apps/spreadsheeteditor/mobile/resources/img/header/header-logo-android.png" : "../../../apps/spreadsheeteditor/mobile/resources/img/header/header-logo-ios.png";
}
window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"];
var brendpanel = document.getElementsByClassName('brendpanel')[0];
if (brendpanel) {
if (/Android/.test(navigator.userAgent)) {
brendpanel.classList.add('android');
}
brendpanel.classList.add('visible');
var elem = document.querySelector('.loading-logo');
if (elem) {
logo && (elem.innerHTML = '<img src=' + logo + '>');
logoOO && (elem.innerHTML = '<img src=' + logoOO + '>');
elem.style.opacity = 1;
}
}
var placeholder = document.getElementsByClassName('placeholder')[0];
if (placeholder && /Android/.test(navigator.userAgent)) {
placeholder.classList.add('android');
}
window.requireTimeourError = function(){
var reqerr;
if ( lang == 'de') reqerr = 'Die Verbindung ist zu langsam, einige Komponenten konnten nicht geladen werden. Aktualisieren Sie bitte die Seite.';
else if ( lang == 'es') reqerr = 'La conexión es muy lenta, algunos de los componentes no han podido cargar. Por favor recargue la página.';
else if ( lang == 'fr') reqerr = 'La connexion est trop lente, certains des composants n\'ons pas pu être chargé. Veuillez recharger la page.';
else if ( lang == 'ru') reqerr = 'Слишком медленное соединение, не удается загрузить некоторые компоненты. Пожалуйста, обновите страницу.';
else reqerr = 'The connection is too slow, some of the components could not be loaded. Please reload the page.';
return reqerr;
};
var requireTimeoutID = setTimeout(function(){
window.alert(window.requireTimeourError());
window.location.reload();
}, 30000);
var require = {
waitSeconds: 30,
callback: function(){
clearTimeout(requireTimeoutID);
}
};
</script>
<script data-main="app" src="../../../vendor/requirejs/require.js"></script>
</body>
</html>

View file

@ -1,265 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<title>ONLYOFFICE Spreadsheets</title>
<link rel="stylesheet" type="text/css" href="../../../../sdkjs/cell/css/main-mobile.css"/>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,500,700" rel="stylesheet" type="text/css">
<!-- App styles -->
<!-- splash -->
<style type="text/css">
.loadmask {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 10000;
}
.loader-page {
width: 100%;
height: 170px;
bottom: 42%;
position: absolute;
text-align: center;
line-height: 10px;
}
.loader-logo {
max-height: 160px;
margin-bottom: 10px;
}
.loader-page-romb {
width: 40px;
display: inline-block;
}
.loader-page-text {
width: 100%;
bottom: 42%;
position: absolute;
text-align: center;
color: #888;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
line-height: 20px;
}
.loader-page-text-loading {
font-size: 14px;
}
.loader-page-text-customer {
font-size: 16px;
margin-bottom: 5px;
}
.romb {
width: 40px;
height: 40px;
-webkit-transform: rotate(135deg) skew(20deg, 20deg);
-moz-transform: rotate(135deg) skew(20deg, 20deg);
-ms-transform: rotate(135deg) skew(20deg, 20deg);
-o-transform: rotate(135deg) skew(20deg, 20deg);
position: absolute;
background: red;
border-radius: 6px;
-webkit-animation: movedown 3s infinite ease;
-moz-animation: movedown 3s infinite ease;
-ms-animation: movedown 3s infinite ease;
-o-animation: movedown 3s infinite ease;
animation: movedown 3s infinite ease;
}
#blue {
z-index: 3;
background: #55bce6;
-webkit-animation-name: blue;
-moz-animation-name: blue;
-ms-animation-name: blue;
-o-animation-name: blue;
animation-name: blue;
}
#red {
z-index:1;
background: #de7a59;
-webkit-animation-name: red;
-moz-animation-name: red;
-ms-animation-name: red;
-o-animation-name: red;
animation-name: red;
}
#green {
z-index: 2;
background: #a1cb5c;
-webkit-animation-name: green;
-moz-animation-name: green;
-ms-animation-name: green;
-o-animation-name: green;
animation-name: green;
}
@-webkit-keyframes red {
0% { top:120px; background: #de7a59; }
10% { top:120px; background: #F2CBBF; }
14% { background: #f4f4f4; top:120px; }
15% { background: #f4f4f4; top:0;}
20% { background: #E6E4E4; }
30% { background: #D2D2D2; }
40% { top:120px; }
100% { top:120px; background: #de7a59; }
}
@keyframes red {
0% { top:120px; background: #de7a59; }
10% { top:120px; background: #F2CBBF; }
14% { background: #f4f4f4; top:120px; }
15% { background: #f4f4f4; top:0; }
20% { background: #E6E4E4; }
30% { background: #D2D2D2; }
40% { top:120px; }
100% { top:120px; background: #de7a59; }
}
@-webkit-keyframes green {
0% { top:110px; background: #a1cb5c; opacity:1; }
10% { top:110px; background: #CBE0AC; opacity:1; }
14% { background: #f4f4f4; top:110px; opacity:1; }
15% { background: #f4f4f4; top:0; opacity:1; }
20% { background: #f4f4f4; top:0; opacity:0; }
25% { background: #EFEFEF; top:0; opacity:1; }
30% { background:#E6E4E4; }
70% { top:110px; }
100% { top:110px; background: #a1cb5c; }
}
@keyframes green {
0% { top:110px; background: #a1cb5c; opacity:1; }
10% { top:110px; background: #CBE0AC; opacity:1; }
14% { background: #f4f4f4; top:110px; opacity:1; }
15% { background: #f4f4f4; top:0; opacity:1; }
20% { background: #f4f4f4; top:0; opacity:0; }
25% { background: #EFEFEF; top:0; opacity:1; }
30% { background:#E6E4E4; }
70% { top:110px; }
100% { top:110px; background: #a1cb5c; }
}
@-webkit-keyframes blue {
0% { top:100px; background: #55bce6; opacity:1; }
10% { top:100px; background: #BFE8F8; opacity:1; }
14% { background: #f4f4f4; top:100px; opacity:1; }
15% { background: #f4f4f4; top:0; opacity:1; }
20% { background: #f4f4f4; top:0; opacity:0; }
25% { background: #f4f4f4; top:0; opacity:0; }
45% { background: #EFEFEF; top:0; opacity:0.2; }
100% { top:100px; background: #55bce6; }
}
@keyframes blue {
0% { top:100px; background: #55bce6; opacity:1; }
10% { top:100px; background: #BFE8F8; opacity:1; }
14% { background: #f4f4f4; top:100px; opacity:1; }
15% { background: #f4f4f4; top:0; opacity:1; }
20% { background: #f4f4f4; top:0; opacity:0; }
25% { background: #fff; top:0; opacity:0; }
45% { background: #EFEFEF; top:0; opacity:0.2; }
100% { top:100px; background: #55bce6; }
}
</style>
</head>
<body>
<script type="text/javascript">
function getUrlParams() {
var e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
q = window.location.search.substring(1),
urlParams = {};
while (e = r.exec(q))
urlParams[d(e[1])] = d(e[2]);
return urlParams;
}
function encodeUrlParam(str) {
return str.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
margin = (customer !== '') ? 50 : 20,
loading = 'Loading...',
logo = params["logo"] ? ((params["logo"] !== 'none') ? ('<img src="' + encodeUrlParam(params["logo"]) + '" class="loader-logo" />') : '') : null;
window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"];
if ( lang == 'de') loading = 'Ladevorgang...';
else if ( lang == 'es') loading = 'Cargando...';
else if ( lang == 'fr') loading = 'Chargement en cours...';
else if ( lang == 'it') loading = 'Caricamento in corso...';
else if ( lang == 'pt') loading = 'Carregando...';
else if ( lang == 'ru') loading = 'Загрузка...';
else if ( lang == 'sl') loading = 'Nalaganje...';
else if ( lang == 'tr') loading = 'Yükleniyor...';
else if ( lang == 'bg') loading = 'Зареждане...';
else if ( lang == 'cs') loading = 'Nahrávám...';
else if ( lang == 'hu') loading = 'Betöltés...';
else if ( lang == 'ja') loading = '読み込み中...';
else if ( lang == 'ko') loading = '로드 중...';
else if ( lang == 'lv') loading = 'Ieladēšana ...';
else if ( lang == 'nl') loading = 'Laden...';
else if ( lang == 'pl') loading = 'Ładowanie...';
else if ( lang == 'sk') loading = 'Nahrávam...';
else if ( lang == 'uk') loading = 'Завантаження...';
else if ( lang == 'vi') loading = 'Đang tải...';
else if ( lang == 'zh') loading = '加载中...';
document.write(
'<div id="loading-mask" class="loadmask">' +
'<div class="loader-page" style="margin-bottom: ' + margin + 'px;' + ((logo!==null) ? 'height: auto;' : '') + '">' +
((logo!==null) ? logo :
'<div class="loader-page-romb">' +
'<div class="romb" id="blue"></div>' +
'<div class="romb" id="green"></div>' +
'<div class="romb" id="red"></div>' +
'</div>') +
'</div>' +
'<div class="loader-page-text">' + customer +
'<div class="loader-page-text-loading">' + loading + '</div>' +
'</div>' +
'</div>');
</script>
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/xregexp/xregexp-all-min.js"></script>
<script type="text/javascript" src="../../../../sdkjs/develop/sdkjs/cell/scripts.js"></script>
<script>
var ua = navigator.userAgent;
if (/Sailfish/.test(ua) || /Jolla/.test(ua)) {
document.write('<script type="text/javascript" src="../../../vendor/iscroll/iscroll.min.js"><\/script>');
if (!/Android/.test(ua)) {
var ua = navigator.userAgent + ';Android 5.0;';
Object.defineProperty(navigator, 'userAgent', {
get: function () { return ua; }
});
}
}
window.sdk_scripts.forEach(function(item){
document.write('<script type="text/javascript" src="' + item + '"><\/script>');
});
window.requireTimeourError = function(){
var reqerr;
if ( lang == 'de') reqerr = 'Die Verbindung ist zu langsam, einige Komponenten konnten nicht geladen werden. Aktualisieren Sie bitte die Seite.';
else if ( lang == 'es') reqerr = 'La conexión es muy lenta, algunos de los componentes no han podido cargar. Por favor recargue la página.';
else if ( lang == 'fr') reqerr = 'La connexion est trop lente, certains des composants n\'ons pas pu être chargé. Veuillez recharger la page.';
else if ( lang == 'ru') reqerr = 'Слишком медленное соединение, не удается загрузить некоторые компоненты. Пожалуйста, обновите страницу.';
else reqerr = 'The connection is too slow, some of the components could not be loaded. Please reload the page.';
return reqerr;
};
</script>
<!-- application -->
<script data-main="app-dev" src="../../../vendor/requirejs/require.js"></script>
</body>
</html>

View file

@ -1,293 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<title>ONLYOFFICE Spreadsheet Editor</title>
<link rel="stylesheet" type="text/css" href="../../../../sdkjs/cell/css/main-mobile.css"/>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,500,700" rel="stylesheet" type="text/css">
<style type="text/css">
.loadmask {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
overflow: hidden;
border: none;
background-color: #f4f4f4;
z-index: 10000;
}
.loader-page {
width: 100%;
height: 170px;
bottom: 42%;
position: absolute;
text-align: center;
line-height: 10px;
}
.loader-logo {
max-height: 160px;
margin-bottom: 10px;
}
.loader-page-romb {
width: 40px;
display: inline-block;
}
.loader-page-text {
width: 100%;
bottom: 42%;
position: absolute;
text-align: center;
color: #888;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
line-height: 20px;
}
.loader-page-text-loading {
font-size: 14px;
}
.loader-page-text-customer {
font-size: 16px;
margin-bottom: 5px;
}
.romb {
width: 40px;
height: 40px;
-webkit-transform: rotate(135deg) skew(20deg, 20deg);
-moz-transform: rotate(135deg) skew(20deg, 20deg);
-ms-transform: rotate(135deg) skew(20deg, 20deg);
-o-transform: rotate(135deg) skew(20deg, 20deg);
position: absolute;
background: red;
border-radius: 6px;
-webkit-animation: movedown 3s infinite ease;
-moz-animation: movedown 3s infinite ease;
-ms-animation: movedown 3s infinite ease;
-o-animation: movedown 3s infinite ease;
animation: movedown 3s infinite ease;
}
#blue {
z-index: 3;
background: #55bce6;
-webkit-animation-name: blue;
-moz-animation-name: blue;
-ms-animation-name: blue;
-o-animation-name: blue;
animation-name: blue;
}
#red {
z-index:1;
background: #de7a59;
-webkit-animation-name: red;
-moz-animation-name: red;
-ms-animation-name: red;
-o-animation-name: red;
animation-name: red;
}
#green {
z-index: 2;
background: #a1cb5c;
-webkit-animation-name: green;
-moz-animation-name: green;
-ms-animation-name: green;
-o-animation-name: green;
animation-name: green;
}
@-webkit-keyframes red {
0% { top:120px; background: #de7a59; }
10% { top:120px; background: #F2CBBF; }
14% { background: #f4f4f4; top:120px; }
15% { background: #f4f4f4; top:0;}
20% { background: #E6E4E4; }
30% { background: #D2D2D2; }
40% { top:120px; }
100% { top:120px; background: #de7a59; }
}
@keyframes red {
0% { top:120px; background: #de7a59; }
10% { top:120px; background: #F2CBBF; }
14% { background: #f4f4f4; top:120px; }
15% { background: #f4f4f4; top:0; }
20% { background: #E6E4E4; }
30% { background: #D2D2D2; }
40% { top:120px; }
100% { top:120px; background: #de7a59; }
}
@-webkit-keyframes green {
0% { top:110px; background: #a1cb5c; opacity:1; }
10% { top:110px; background: #CBE0AC; opacity:1; }
14% { background: #f4f4f4; top:110px; opacity:1; }
15% { background: #f4f4f4; top:0; opacity:1; }
20% { background: #f4f4f4; top:0; opacity:0; }
25% { background: #EFEFEF; top:0; opacity:1; }
30% { background:#E6E4E4; }
70% { top:110px; }
100% { top:110px; background: #a1cb5c; }
}
@keyframes green {
0% { top:110px; background: #a1cb5c; opacity:1; }
10% { top:110px; background: #CBE0AC; opacity:1; }
14% { background: #f4f4f4; top:110px; opacity:1; }
15% { background: #f4f4f4; top:0; opacity:1; }
20% { background: #f4f4f4; top:0; opacity:0; }
25% { background: #EFEFEF; top:0; opacity:1; }
30% { background:#E6E4E4; }
70% { top:110px; }
100% { top:110px; background: #a1cb5c; }
}
@-webkit-keyframes blue {
0% { top:100px; background: #55bce6; opacity:1; }
10% { top:100px; background: #BFE8F8; opacity:1; }
14% { background: #f4f4f4; top:100px; opacity:1; }
15% { background: #f4f4f4; top:0; opacity:1; }
20% { background: #f4f4f4; top:0; opacity:0; }
25% { background: #f4f4f4; top:0; opacity:0; }
45% { background: #EFEFEF; top:0; opacity:0.2; }
100% { top:100px; background: #55bce6; }
}
@keyframes blue {
0% { top:100px; background: #55bce6; opacity:1; }
10% { top:100px; background: #BFE8F8; opacity:1; }
14% { background: #f4f4f4; top:100px; opacity:1; }
15% { background: #f4f4f4; top:0; opacity:1; }
20% { background: #f4f4f4; top:0; opacity:0; }
25% { background: #fff; top:0; opacity:0; }
45% { background: #EFEFEF; top:0; opacity:0.2; }
100% { top:100px; background: #55bce6; }
}
</style>
</head>
<body>
<script type="text/javascript">
var ua = navigator.userAgent;
if (/Sailfish/.test(ua) || /Jolla/.test(ua)) {
document.write('<script type="text/javascript" src="../../../vendor/iscroll/iscroll.min.js"><\/script>');
if (!/Android/.test(ua)) {
var ua = navigator.userAgent + ';Android 5.0;';
Object.defineProperty(navigator, 'userAgent', {
get: function () { return ua; }
});
}
}
function getUrlParams() {
var e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
q = window.location.search.substring(1),
urlParams = {};
while (e = r.exec(q))
urlParams[d(e[1])] = d(e[2]);
return urlParams;
}
function encodeUrlParam(str) {
return str.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
margin = (customer !== '') ? 50 : 20,
loading = 'Loading...',
logo = params["logo"] ? ((params["logo"] !== 'none') ? ('<img src="' + encodeUrlParam(params["logo"]) + '" class="loader-logo" />') : '') : null;
window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"];
if ( lang == 'de') loading = 'Ladevorgang...';
else if ( lang == 'es') loading = 'Cargando...';
else if ( lang == 'fr') loading = 'Chargement en cours...';
else if ( lang == 'it') loading = 'Caricamento in corso...';
else if ( lang == 'pt') loading = 'Carregando...';
else if ( lang == 'ru') loading = 'Загрузка...';
else if ( lang == 'sl') loading = 'Nalaganje...';
else if ( lang == 'tr') loading = 'Yükleniyor...';
else if ( lang == 'bg') loading = 'Зареждане...';
else if ( lang == 'cs') loading = 'Nahrávám...';
else if ( lang == 'hu') loading = 'Betöltés...';
else if ( lang == 'ja') loading = '読み込み中...';
else if ( lang == 'ko') loading = '로드 중...';
else if ( lang == 'lv') loading = 'Ieladēšana ...';
else if ( lang == 'nl') loading = 'Laden...';
else if ( lang == 'pl') loading = 'Ładowanie...';
else if ( lang == 'sk') loading = 'Nahrávam...';
else if ( lang == 'uk') loading = 'Завантаження...';
else if ( lang == 'vi') loading = 'Đang tải...';
else if ( lang == 'zh') loading = '加载中...';
document.write(
'<div id="loading-mask" class="loadmask">' +
'<div class="loader-page" style="margin-bottom: ' + margin + 'px;' + ((logo!==null) ? 'height: auto;' : '') + '">' +
((logo!==null) ? logo :
'<div class="loader-page-romb">' +
'<div class="romb" id="blue"></div>' +
'<div class="romb" id="green"></div>' +
'<div class="romb" id="red"></div>' +
'</div>') +
'</div>' +
'<div class="loader-page-text">' + customer +
'<div class="loader-page-text-loading">' + loading + '</div>' +
'</div>' +
'</div>');
window.requireTimeourError = function(){
var reqerr;
if ( lang == 'de') reqerr = 'Die Verbindung ist zu langsam, einige Komponenten konnten nicht geladen werden. Aktualisieren Sie bitte die Seite.';
else if ( lang == 'es') reqerr = 'La conexión es muy lenta, algunos de los componentes no han podido cargar. Por favor recargue la página.';
else if ( lang == 'fr') reqerr = 'La connexion est trop lente, certains des composants n\'ons pas pu être chargé. Veuillez recharger la page.';
else if ( lang == 'ru') reqerr = 'Слишком медленное соединение, не удается загрузить некоторые компоненты. Пожалуйста, обновите страницу.';
else reqerr = 'The connection is too slow, some of the components could not be loaded. Please reload the page.';
return reqerr;
};
var requireTimeoutID = setTimeout(function(){
window.alert(window.requireTimeourError());
window.location.reload();
}, 30000);
var require = {
waitSeconds: 30,
callback: function(){
clearTimeout(requireTimeoutID);
}
};
</script>
<script data-main="app" src="../../../vendor/requirejs/require.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,45 +0,0 @@
@appStatusbarHeight: 30px;
@baseZIndex: 10;
.navbar-hidden + .navbar-through {
> .page.editor {
padding-top: 0;
}
}
.navbar-through {
> .page.editor {
padding-top: @appToolbarHeight;
transition: padding-top 400ms ease-in;
}
}
.navbar-through .page {
& > .searchbar {
top: @appToolbarHeight + @cellEditorHeight;
}
#cell-editing-box.expanded + .searchbar {
top: @appToolbarHeight + @cellEditorExpandedHeight;
}
}
.flex-horizontal {
display: flex;
flex-direction: column;
align-items: stretch;
}
.flex-vertical {
display: flex;
flex-direction: row;
align-items: stretch;
}
.small-picker {
.picker-item {
font-size: 14px;
padding: 0;
}
}

View file

@ -1,372 +0,0 @@
@import url('../../../../../vendor/framework7/src/less/ios/_mixins.less');
@import url('../../../../../vendor/framework7/src/less/ios/_colors-vars.less');
// Colors
@themeColor: #40865c; // (79,158,79)
@appToolbarHeight: @toolbarSize;
@import url('../../../../../vendor/framework7/src/less/ios/intro.less');
@import url('../../../../../vendor/framework7/src/less/ios/grid.less');
@import url('../../../../../vendor/framework7/src/less/ios/views.less');
@import url('../../../../../vendor/framework7/src/less/ios/pages.less');
@import url('../../../../../vendor/framework7/src/less/ios/toolbars.less');
@import url('../../../../../vendor/framework7/src/less/ios/toolbars-pages.less');
@import url('../../../../../vendor/framework7/src/less/ios/searchbar.less');
@import url('../../../../../vendor/framework7/src/less/ios/messagebar.less');
@import url('../../../../../vendor/framework7/src/less/ios/icons.less');
//@import url('../../../../../vendor/framework7/src/less/ios/badges.less');
//@import url('../../../../../vendor/framework7/src/less/ios/chips.less');
@import url('../../../../../vendor/framework7/src/less/ios/content-block.less');
@import url('../../../../../vendor/framework7/src/less/ios/lists.less');
//@import url('../../../../../vendor/framework7/src/less/ios/contacts.less');
@import url('../../../../../vendor/framework7/src/less/ios/forms.less');
//@import url('../../../../../vendor/framework7/src/less/ios/floating-button.less');
//@import url('../../../../../vendor/framework7/src/less/ios/accordion.less');
@import url('../../../../../vendor/framework7/src/less/ios/cards.less');
@import url('../../../../../vendor/framework7/src/less/ios/modals.less');
@import url('../../../../../vendor/framework7/src/less/ios/panels.less');
//@import url('../../../../../vendor/framework7/src/less/ios/lazy-load.less');
@import url('../../../../../vendor/framework7/src/less/ios/tabs.less');
@import url('../../../../../vendor/framework7/src/less/ios/messages.less');
@import url('../../../../../vendor/framework7/src/less/ios/statusbar.less');
@import url('../../../../../vendor/framework7/src/less/ios/preloader.less');
@import url('../../../../../vendor/framework7/src/less/ios/progressbar.less');
//@import url('../../../../../vendor/framework7/src/less/ios/pull-to-refresh.less');
//@import url('../../../../../vendor/framework7/src/less/ios/infinite-scroll.less');
//@import url('../../../../../vendor/framework7/src/less/ios/autocomplete.less');
@import url('../../../../../vendor/framework7/src/less/ios/swiper.less');
//@import url('../../../../../vendor/framework7/src/less/ios/photo-browser.less');
@import url('../../../../../vendor/framework7/src/less/ios/picker.less');
//@import url('../../../../../vendor/framework7/src/less/ios/calendar.less');
@import url('../../../../../vendor/framework7/src/less/ios/notifications.less');
//@import url('../../../../../vendor/framework7/src/less/ios/login-screen.less');
@import url('../../../../../vendor/framework7/src/less/ios/disabled.less');
// Disable text select
* {
-webkit-user-select: none;
user-select: none;
}
input, textarea {
-webkit-touch-callout:default;
-webkit-user-select:text;
user-select:text;
}
// Main Toolbar
#editor-navbar.navbar .right a + a,
#editor-navbar.navbar .left a + a {
margin-left: 0;
html:not(.phone) & {
margin-left: 10px;
}
}
@import url('../../../../common/mobile/resources/less/_mixins.less');
@import url('../../../../common/mobile/resources/less/ios/_container.less');
@import url('../../../../common/mobile/resources/less/ios/_dataview.less');
@import url('../../../../common/mobile/resources/less/ios/_listview.less');
@import url('../../../../common/mobile/resources/less/ios/_button.less');
@import url('../../../../common/mobile/resources/less/ios/_contextmenu.less');
@import url('../../../../common/mobile/resources/less/ios/_color-palette.less');
@import url('../../../../common/mobile/resources/less/ios/_about.less');
@import url('../../../../common/mobile/resources/less/ios/_color-schema.less');
@import url('../../../../common/mobile/resources/less/ios/_collaboration.less');
@import url('ios/_icons.less');
@import url('app-common');
@import url('celleditor');
@import url('statusbar');
@import url('ios/_search.less');
.logo-navbar {
height: 68px;
.navbar-inner {
top: 24px;
height: 44px;
}
}
.navbar-through > .page.editor.with-logo {
padding-top: 68px;
}
.navbar-hidden + .navbar-through > .page.editor.with-logo {
padding-top: 0;
}
.label-switch input[type="checkbox"]:checked + .checkbox {
background: @themeColor;
}
// Add Container
#add-table,
#add-shape {
.page {
background-color: #fff;
}
}
// Table styles
.table-styles {
.row {
&, li {
margin-bottom: 12px;
}
}
li {
margin: 0;
padding: 1px;
img {
width: 70px;
height: 50px;
}
}
}
// Shapes
.shapes {
li {
width: 70px;
height: 70px;
margin: 0 1px;
.thumb {
width: 100%;
height: 100%;
background-color: @themeColor;
}
}
}
// Charts
.chart-types {
li {
width: 60px;
height: 60px;
margin: 6px;
.thumb {
width: 100%;
height: 100%;
background-size: contain;
}
}
}
// Cell style
.cell-styles.dataview {
.active:after {
right: 2px;
bottom: 2px;
}
.row {
padding: 5px;
li {
border: 1px solid @listBlockBorderColor;
html.pixel-ratio-2 & {
border: 0.5px solid @listBlockBorderColor;
}
html.pixel-ratio-3 & {
border: 0.33px solid @listBlockBorderColor;
}
padding: 2px;
.thumb {
width: 112px;
height: 38px;
background-size: contain;
}
}
}
}
// Workaround ios 10.3
.range-slider input[type=range]::-webkit-slider-thumb {
height: 28px;
width: 28px;
border-radius: 28px;
background: #fff;
box-shadow: 0 2px 4px rgba(0,0,0,0.4);
z-index: 10;
-webkit-appearance: none;
}
.modal.modal-in {
max-height: 100%;
overflow: auto;
}
//Filter Options
.filter-root-view {
.list-center .item-title {
text-align: center;
width: 100%;
}
#btn-delete-filter {
color: @red;
}
}
//Regional Settings
[data-page="regional-settings-view"] {
.list-block .item-title-row {
justify-content: start;
align-items: center;
display: flex;
}
.item-title {
margin-left: 20px;
font-weight: 500;
white-space: normal;
}
}
@common-image-path: "../../../../common/mobile/resources/img";
@img-flags-width: 48px;
.icon.lang-flag {
width: 16px;
height: 12px;
background-image: data-uri(%("%s",'@{common-image-path}/controls/flags.png'));
background-repeat: no-repeat;
background-size: auto;
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 2dppx),
only screen and (min-resolution: 192dpi) {
background-image: data-uri(%("%s",'@{common-image-path}/controls/flags@2x.png'));
background-size: @img-flags-width auto;
}
}
.lang-flag {
background-position: -16px -108px;
&.ca, &.ca-ES {background-position: 0 0;}
&.cs, &.cs-CZ {background-position: -16px 0;}
&.da, &.da-DK {background-position: -32px 0;}
&.de, &.de-DE {background-position: 0 -12px;}
&.el, &.el-GR {background-position: -16px -12px;}
&.en, &.en-US {background-position: -32px -12px;}
&.fr, &.fr-FR {background-position: 0 -24px;}
&.hu, &.hu-HU {background-position: -16px -24px;}
&.it, &.it-IT {background-position: -32px -24px;}
&.ko, &.ko-KR {background-position: 0 -36px;}
&.nl, &.nl-NL {background-position: -16px -36px;}
&.nb, &.nb-NO, &.nn, &.nn-NO {background-position: -32px -36px;}
&.pl, &.pl-PL {background-position: 0 -48px;}
&.pt, &.pt-BR {background-position: -16px -48px;}
&.ro, &.ro-RO {background-position: -32px -48px;}
&.ru, &.ru-RU {background-position: 0 -60px;}
&.sv, &.sv-SE {background-position: -32px -60px;}
&.tr, &.tr-TR {background-position: 0 -72px;}
&.uk, &.uk-UA {background-position: -16px -72px;}
&.lv, &.lv-LV {background-position: -32px -72px;}
&.lt, &.lt-LT {background-position: 0 -84px;}
&.vi, &.vi-VN {background-position: -16px -84px;}
&.de-CH {background-position: -32px -84px;}
&.pt-PT {background-position: -16px -96px;}
&.de-AT {background-position: -32px -96px;}
&.es, &.es-ES {background-position: 0 -108px;}
&.en-GB {background-position: -32px -108px;}
&.en-AU {background-position: 0 -120px;}
&.az-Latn-AZ {background-position: -16px -120px;}
&.id, &.id-ID {background-position: -32px -120px;}
&.bg, &.bg-BG {background-position: 0 -132px;}
&.ca-ES-valencia {background-position: -16px -132px;}
&.en-CA {background-position: -32px -132px;}
&.en-ZA {background-position: 0 -144px;}
&.eu, &.eu-ES {background-position: -16px -144px;}
&.gl, &.gl-ES {background-position: -32px -144px;}
&.hr, &.hr-HR {background-position: 0 -156px;}
&.lb, &.lb-LU {background-position: -16px -156px;}
&.mn, &.mn-MN {background-position: -32px -156px;}
&.sl, &.sl-SI {background-position: 0 -168px;}
&.sr, &.sr-Cyrl-RS, &.sr-Latn-RS {background-position: -16px -168px;}
&.sk, &.sk-SK {background-position: -32px -168px;}
&.kk, &.kk-KZ {background-position: 0 -180px;}
&.fi, &.fi-FI, &.sv-FI {background-position: -16px -180px;}
&.zh, &.zh-CN {background-position: -32px -180px;}
&.ja, &.ja-JP {background-position: 0 -192px;}
&.es-MX {background-position: -16px -192px;}
}
// Skeleton of workbook
.doc-placeholder {
background: #fbfbfb;
width: 100%;
height: 100%;
border: 1px solid #dfdfdf;
white-space: nowrap;
padding-top: 0;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
font-size: 0;
> .columns {
width: 100%;
height: 100%;
display: inline-block;
background: linear-gradient(90deg, #d5d5d5 0px, rgba(0,0,0,0) 1px) 0 0,
linear-gradient(rgba(0,0,0,0) 19px, #d5d5d5 20px) 0 0,
linear-gradient( #f1f1f1 0px, #f1f1f1 20px) 0 0 repeat-x;
background-size: 80px 20px;
-webkit-animation: flickerAnimation 2s infinite ease-in-out;
-moz-animation: flickerAnimation 2s infinite ease-in-out;
-o-animation: flickerAnimation 2s infinite ease-in-out;
animation: flickerAnimation 2s infinite ease-in-out;
&:first-child {
background: linear-gradient(#f1f1f1 19px, #d5d5d5 20px) 0 0;
background-size: 20px 20px;
width: 25px;
}
}
}
//Comments
.picker-modal.container-view-comment {
&.onHide {
.swipe-container, .toolbar-inner, .pages {
opacity: 0.6;
}
}
background-color: #efeff4;
.swipe-container, .toolbar, .pages {
background-color: #FFFFFF;
}
}
// Macros settings
.page-macros-settings[data-page="settings-macros-view"] {
.list-block {
li.media-item {
.item-title {
font-weight: normal;
}
.item-subtitle {
font-size: 14px;
color: @gray;
}
}
}
}

View file

@ -1,373 +0,0 @@
@import url('../../../../../vendor/framework7/src/less/material/_mixins.less');
@import url('../../../../../vendor/framework7/src/less/material/_colors-vars.less');
// Colors
@themeColor: #40865c; // (79,158,79)
@themeColorLight: #c7e8d1;
@navBarIconColor: #fff;
@appToolbarHeight: @navbarSize;
@import url('../../../../../vendor/framework7/src/less/material/intro.less');
@import url('../../../../../vendor/framework7/src/less/material/grid.less');
@import url('../../../../../vendor/framework7/src/less/material/views.less');
@import url('../../../../../vendor/framework7/src/less/material/pages.less');
@import url('../../../../../vendor/framework7/src/less/material/toolbars.less');
@import url('../../../../../vendor/framework7/src/less/material/toolbars-pages.less');
@import url('../../../../../vendor/framework7/src/less/material/searchbar.less');
@import url('../../../../../vendor/framework7/src/less/material/messagebar.less');
@import url('../../../../../vendor/framework7/src/less/material/icons.less');
@import url('../../../../../vendor/framework7/src/less/material/badges.less');
//@import url('../../../../../vendor/framework7/src/less/material/chips.less');
@import url('../../../../../vendor/framework7/src/less/material/content-block.less');
@import url('../../../../../vendor/framework7/src/less/material/lists.less');
//@import url('../../../../../vendor/framework7/src/less/material/contacts.less');
@import url('../../../../../vendor/framework7/src/less/material/forms.less');
@import url('../../../../../vendor/framework7/src/less/material/floating-button.less');
//@import url('../../../../../vendor/framework7/src/less/material/accordion.less');
//@import url('../../../../../vendor/framework7/src/less/material/cards.less');
@import url('../../../../../vendor/framework7/src/less/material/modals.less');
@import url('../../../../../vendor/framework7/src/less/material/panels.less');
//@import url('../../../../../vendor/framework7/src/less/material/lazy-load.less');
@import url('../../../../../vendor/framework7/src/less/material/tabs.less');
@import url('../../../../../vendor/framework7/src/less/material/messages.less');
@import url('../../../../../vendor/framework7/src/less/material/statusbar.less');
@import url('../../../../../vendor/framework7/src/less/material/preloader.less');
@import url('../../../../../vendor/framework7/src/less/material/progressbar.less');
//@import url('../../../../../vendor/framework7/src/less/material/pull-to-refresh.less');
//@import url('../../../../../vendor/framework7/src/less/material/infinite-scroll.less');
//@import url('../../../../../vendor/framework7/src/less/material/autocomplete.less');
//@import url('../../../../../vendor/framework7/src/less/material/swiper.less');
//@import url('../../../../../vendor/framework7/src/less/material/photo-browser.less');
@import url('../../../../../vendor/framework7/src/less/material/picker.less');
//@import url('../../../../../vendor/framework7/src/less/material/calendar.less');
@import url('../../../../../vendor/framework7/src/less/material/notifications.less');
//@import url('../../../../../vendor/framework7/src/less/material/login-screen.less');
@import url('../../../../../vendor/framework7/src/less/material/ripple.less');
@import url('../../../../../vendor/framework7/src/less/material/disabled.less');
// Disable text select
* {
-webkit-user-select: none;
user-select: none;
}
input, textarea {
-webkit-touch-callout:default;
-webkit-user-select:text;
user-select:text;
}
@import url('../../../../common/mobile/resources/less/_mixins.less');
@import url('../../../../common/mobile/resources/less/material/_container.less');
@import url('../../../../common/mobile/resources/less/material/_dataview.less');
@import url('../../../../common/mobile/resources/less/material/_listview.less');
@import url('../../../../common/mobile/resources/less/material/_button.less');
@import url('../../../../common/mobile/resources/less/material/_contextmenu.less');
@import url('../../../../common/mobile/resources/less/material/_color-palette.less');
@import url('../../../../common/mobile/resources/less/material/_about.less');
@import url('../../../../common/mobile/resources/less/material/_color-schema.less');
@import url('../../../../common/mobile/resources/less/material/_collaboration.less');
@import url('material/_search.less');
@import url('material/_icons.less');
@import url('../../../../common/mobile/resources/less/material/_sailfish_fix.less');
@import url('app-common');
@import url('celleditor');
@import url('statusbar');
@import url('sailfish-fix');
// Main Toolbar
#editor-navbar.navbar .right {
padding-right: 4px;
}
#editor-navbar.navbar .right a.link,
#editor-navbar.navbar .left a.link {
padding: 0 13px;
}
.logo-navbar {
height: 80px;
.navbar-inner {
top: 24px;
height: 56px;
}
}
.navbar-through > .page.editor.with-logo {
padding-top: 80px;
}
.navbar-hidden + .navbar-through > .page.editor.with-logo {
padding-top: 0;
}
// Add Container
#add-table,
#add-shape {
.page {
background-color: #fff;
}
}
.container-add {
.categories {
i.icon {
opacity: 0.5;
}
.active {
i.icon {
opacity: 1;
}
}
}
}
// Table styles
.table-styles {
.row {
&, li {
margin-bottom: 12px;
}
}
li {
margin: 0;
padding: 1px;
img {
width: 70px;
height: 50px;
}
}
}
// Shapes
.shapes {
li {
width: 70px;
height: 70px;
margin: 0 1px;
.thumb {
width: 100%;
height: 100%;
background-color: @themeColor;
}
}
}
// Charts
.chart-types {
li {
width: 60px;
height: 60px;
margin: 6px;
.thumb {
width: 100%;
height: 100%;
background-size: contain;
}
}
}
// Cell style
.cell-styles.dataview {
.active:after {
right: 2px;
bottom: 2px;
}
.row {
padding: 5px 0;
li {
border: 1px solid @listBlockBorderColor;
html.pixel-ratio-2 & {
border: 0.5px solid @listBlockBorderColor;
}
html.pixel-ratio-3 & {
border: 0.33px solid @listBlockBorderColor;
}
padding: 2px;
.thumb {
width: 112px;
height: 38px;
background-size: contain;
}
}
}
}
.modal.modal-in {
max-height: 100%;
overflow: auto;
}
//Filter Options
.filter-root-view {
.list-center .item-title {
text-align: center;
width: 100%;
}
#btn-delete-filter {
color: @red;
}
}
//Regional Settings
[data-page="regional-settings-view"] {
.list-block .item-title-row {
justify-content: space-between;
align-items: center;
display: flex;
width: 100%;
}
.item-title {
font-weight: 400;
white-space: normal;
order: 1;
}
}
@common-image-path: "../../../../common/mobile/resources/img";
@img-flags-width: 48px;
.icon.lang-flag {
order: 2;
width: 16px;
height: 12px;
background-image: data-uri(%("%s",'@{common-image-path}/controls/flags.png'));
background-repeat: no-repeat;
background-size: auto;
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 2dppx),
only screen and (min-resolution: 192dpi) {
background-image: data-uri(%("%s",'@{common-image-path}/controls/flags@2x.png'));
background-size: @img-flags-width auto;
}
}
.lang-flag {
background-position: -16px -108px;
&.ca, &.ca-ES {background-position: 0 0;}
&.cs, &.cs-CZ {background-position: -16px 0;}
&.da, &.da-DK {background-position: -32px 0;}
&.de, &.de-DE {background-position: 0 -12px;}
&.el, &.el-GR {background-position: -16px -12px;}
&.en, &.en-US {background-position: -32px -12px;}
&.fr, &.fr-FR {background-position: 0 -24px;}
&.hu, &.hu-HU {background-position: -16px -24px;}
&.it, &.it-IT {background-position: -32px -24px;}
&.ko, &.ko-KR {background-position: 0 -36px;}
&.nl, &.nl-NL {background-position: -16px -36px;}
&.nb, &.nb-NO, &.nn, &.nn-NO {background-position: -32px -36px;}
&.pl, &.pl-PL {background-position: 0 -48px;}
&.pt, &.pt-BR {background-position: -16px -48px;}
&.ro, &.ro-RO {background-position: -32px -48px;}
&.ru, &.ru-RU {background-position: 0 -60px;}
&.sv, &.sv-SE {background-position: -32px -60px;}
&.tr, &.tr-TR {background-position: 0 -72px;}
&.uk, &.uk-UA {background-position: -16px -72px;}
&.lv, &.lv-LV {background-position: -32px -72px;}
&.lt, &.lt-LT {background-position: 0 -84px;}
&.vi, &.vi-VN {background-position: -16px -84px;}
&.de-CH {background-position: -32px -84px;}
&.pt-PT {background-position: -16px -96px;}
&.de-AT {background-position: -32px -96px;}
&.es, &.es-ES {background-position: 0 -108px;}
&.en-GB {background-position: -32px -108px;}
&.en-AU {background-position: 0 -120px;}
&.az-Latn-AZ {background-position: -16px -120px;}
&.id, &.id-ID {background-position: -32px -120px;}
&.bg, &.bg-BG {background-position: 0 -132px;}
&.ca-ES-valencia {background-position: -16px -132px;}
&.en-CA {background-position: -32px -132px;}
&.en-ZA {background-position: 0 -144px;}
&.eu, &.eu-ES {background-position: -16px -144px;}
&.gl, &.gl-ES {background-position: -32px -144px;}
&.hr, &.hr-HR {background-position: 0 -156px;}
&.lb, &.lb-LU {background-position: -16px -156px;}
&.mn, &.mn-MN {background-position: -32px -156px;}
&.sl, &.sl-SI {background-position: 0 -168px;}
&.sr, &.sr-Cyrl-RS, &.sr-Latn-RS {background-position: -16px -168px;}
&.sk, &.sk-SK {background-position: -32px -168px;}
&.kk, &.kk-KZ {background-position: 0 -180px;}
&.fi, &.fi-FI, &.sv-FI {background-position: -16px -180px;}
&.zh, &.zh-CN {background-position: -32px -180px;}
&.ja, &.ja-JP {background-position: 0 -192px;}
&.es-MX {background-position: -16px -192px;}
}
// Skeleton of workbook
.doc-placeholder {
background: #fbfbfb;
width: 100%;
height: 100%;
border: 1px solid #dfdfdf;
white-space: nowrap;
padding-top: 0;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
font-size: 0;
> .columns {
width: 100%;
height: 100%;
display: inline-block;
background: linear-gradient(90deg, #d5d5d5 0px, rgba(0,0,0,0) 1px) 0 0,
linear-gradient(rgba(0,0,0,0) 19px, #d5d5d5 20px) 0 0,
linear-gradient( #f1f1f1 0px, #f1f1f1 20px) 0 0 repeat-x;
background-size: 80px 20px;
-webkit-animation: flickerAnimation 2s infinite ease-in-out;
-moz-animation: flickerAnimation 2s infinite ease-in-out;
-o-animation: flickerAnimation 2s infinite ease-in-out;
animation: flickerAnimation 2s infinite ease-in-out;
&:first-child {
background: linear-gradient(#f1f1f1 19px, #d5d5d5 20px) 0 0;
background-size: 20px 20px;
width: 25px;
}
}
}
//Comments
.picker-modal.container-view-comment {
&.onHide {
.swipe-container, .toolbar-inner, .pages {
opacity: 0.6;
}
}
background-color: #efeff4;
.swipe-container, .toolbar, .pages {
background-color: #FFFFFF;
}
}
// Macros settings
.page-macros-settings[data-page="settings-macros-view"] {
.list-block {
li.media-item {
.item-title {
font-weight: normal;
}
.item-subtitle {
font-size: 14px;
color: @gray;
}
}
}
}

View file

@ -1,183 +0,0 @@
@gray-dark: #c4c4c4;
@gray-darker: #848484; //rgb(132, 132, 132)
@gray-light: #f1f1f1; //rgb(241, 241, 241)
@cellEditorHeight: 30px;
@cellEditorExpandedHeight: 70px;
.border-radius(@radius: 2px) {
border-radius: @radius;
}
#cell-editing-box {
box-sizing: border-box;
* {
box-sizing: border-box;
}
position: relative;
height: @cellEditorHeight;
min-height: @cellEditorHeight;
transition: min-height .1s;
background-color: #fff;
display: flex;
//align-items: stretch;
z-index: 500;
.hairline(bottom, @gray-dark);//@toolbarBorderColor);
&.expanded {
min-height: @cellEditorExpandedHeight;
//height: @cellEditorExpandedHeight;
transition: min-height .1s;
}
.btn {
border: 0 none;
height: @cellEditorHeight;
}
.ce-group {
overflow: hidden;
height: 100%;
position: relative;
}
.group-name {
display: inline-flex;
background-color: @gray-light;
z-index: 1;
}
.group-content {
position: relative;
padding-left: 1px;
.hairline(left, @gray-dark);
flex-grow: 1;
//height: 100%;
}
.group-name, .group-content,
.group-expand {
z-index: 1;
}
.group-functions-list {
position: absolute;
height: @cellEditorHeight;
}
#ce-cell-name {
display: inline-block;
width: 90px;
padding: 0 4px;
border: 0 none;
line-height: 30px;
//font-size: 17px;
text-align: center;
&[disabled] {
color: @gray-darker;
opacity: 0.5;
}
}
#ce-function {
height: @cellEditorHeight;
line-height: @cellEditorHeight;
padding: 0 10px;
}
#ce-btn-expand {
width: @cellEditorHeight;
background-color: #fff;
padding: 0 2px 0;
.caret {
display: block;
transition: transform 0.1s ease;
width: 16px;
height: 16px;
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="#000"><g><path d="M20.5,6.5l1.1,1.1L11,18l0,0l0,0L0.5,7.5l1.1-1.1l9.5,9.5L20.5,6.5z"/></g></svg>');
}
&.collapse {
.caret {
transform: rotate(180deg);
}
}
}
#ce-cell-content {
display: block;
width: 100%;
padding: 3px 3px;
line-height: 1.428571429;
color: #000;
vertical-align: middle;
background-color: #fff;
height: 100%;
resize: none;
min-height: @cellEditorHeight;
border: 0 none;
font-size: 16px;
&[disabled] {
color: @gray-darker;
opacity: 0.5;
}
}
#ce-cell-name, #ce-cell-content {
border-radius: 0;
}
&.expanded {
.group-functions-list {
&.opened {
top: @cellEditorExpandedHeight;
}
}
}
}
.group-functions-list {
width: 100%;
background-color: #fff;
top: 0;
.hairline(bottom, @gray-dark);
transition: top .2s;
&.opened {
top: @cellEditorHeight;
}
&:not(.opened) {
display: none;
}
ul {
white-space: nowrap;
overflow: hidden;
padding: 0;
margin: 0;
> li {
display: inline-block;
> a {
line-height: 30px;
padding: 0 8px 0;
}
}
}
}
.phone {
#cell-editing-box #ce-cell-name {
display: none;
}
}

File diff suppressed because one or more lines are too long

View file

@ -1,122 +0,0 @@
// Search
.tablet {
// Replace mode
.searchbar.document.replace {
.center {
.searchbar:first-child {
margin-right: 10px;
}
.replace {
display: flex;
}
}
.right {
.replace {
display: flex;
margin: 0 10px;
}
}
}
// Search mode
.searchbar.document {
.center {
width: 100%;
.searchbar {
background: inherit;
padding: 0;
}
.replace {
display: none;
}
}
.right {
.prev {
margin-left: 0;
}
.replace {
display: none;
}
}
}
}
.phone {
// Replace mode
.searchbar.document.replace {
height: 88px;
.left {
margin-top: -(44+30)px;
}
.center {
.searchbar-input {
margin: 8px 0;
}
.replace {
display: block;
}
}
.right {
> .replace {
display: flex;
}
}
}
// Search mode
.searchbar.document {
.left,
.center,
.right {
flex-direction: column;
}
.left {
min-width: 22px;
max-width: 22px;
}
.center {
width: 100%;
.searchbar {
background: inherit;
padding: 0;
&:after {
content: none;
}
}
.replace {
display: none;
}
}
.right {
> p {
margin: 0;
}
> .replace {
display: none;
}
}
}
}
.searchbar.document {
//background: lighten(@searchbarBg, 10%);
background-color: #f7f7f8;
}

File diff suppressed because one or more lines are too long

View file

@ -1,120 +0,0 @@
// Search
.tablet {
// Replace mode
.searchbar.document.replace {
.center {
> .replace {
display: flex;
}
}
.right {
.replace {
display: flex;
}
}
.link.replace {
font-size: 16px;
}
}
// Search mode
.searchbar.document {
.center {
width: 100%;
display: flex;
margin: 0;
overflow: visible;
.searchbar {
overflow: visible;
&.search {
padding: 0;
}
}
> .replace {
display: none;
}
}
.right {
.replace {
display: none;
}
}
}
}
@phoneSearchHeight: 48px;
.phone {
// Replace mode
.searchbar.document.replace {
height: @phoneSearchHeight * 2;
.link.replace {
font-size: 16px;
}
.left {
margin-top: -@phoneSearchHeight;
}
.center {
.replace {
display: block;
}
}
.right {
> .replace {
display: flex;
}
}
}
// Search mode
.searchbar.document {
.left,
.center,
.right {
flex-direction: column;
}
.left {
//
}
.center {
width: 100%;
margin: 0;
overflow: visible;
.searchbar {
padding: 0;
}
.replace {
display: none;
}
}
.right {
> p {
margin: 0;
a.link {
height: @phoneSearchHeight;
}
}
> .replace {
display: none;
}
}
}
}

View file

@ -1,35 +0,0 @@
.sailfish {
#cell-editing-box {
display: block;
.group-content {
position: absolute;
top: 0;
left: 42px;
right: 30px;
.tablet& {
left: 132px;
}
}
.group-expand {
position: absolute;
top: 0;
right: 0;
}
#ce-btn-expand {
.caret {
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" fill="#000"><g><path d="M20.5,6.5l1.1,1.1L11,18l0,0l0,0L0.5,7.5l1.1-1.1l9.5,9.5L20.5,6.5z" transform="matrix(0.743684 0 0 0.743684 -0.299854 -0.590536)"/></g></svg>');
}
}
}
.statusbar {
position: absolute;
bottom: 0;
width: 100%;
}
}

View file

@ -1,88 +0,0 @@
@statusBarBorderColor: #cbcbcb;
@statusBarHeight: 30px;
@fontColor: #000;
.statusbar {
position: relative;
box-sizing: border-box;
background-color: @gray-light;
z-index: @baseZIndex + 1;
* {
box-sizing: border-box;
}
.hairline(top, @statusBarBorderColor);
height: @statusBarHeight;
min-height: @statusBarHeight;
.box-tabs {
}
#box-addtab {
float: left;
}
.button {
border: 0 none;
border-radius: 0;
color: #000;
font-size: 18px;
line-height: inherit;
min-width: 48px;
.hairline(right, @statusBarBorderColor);
}
i.icon {
width: 22px;
height: 22px;
&.icon-plus {
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{fontColor}"><g><path d="M22,12H12v10h-1V12H1v-1h10V1h1v10h10V12z"/></g></svg>');
}
}
}
.box-tabs {
ul {
margin: 0;
padding: 0;
white-space: nowrap;
overflow: hidden;
> li {
list-style: none;
display: inline-block;
position: relative;
.hairline(right, @statusBarBorderColor);
&:not(.active) {
a {
opacity: 0.5;
}
}
a {
display: inline-block;
font-size: 12px;
padding: 0 10px 0;
line-height: @statusBarHeight;
margin-right: -1px;
outline: none;
color: @fontColor;
height: 100%;
&:hover {
cursor: pointer;
}
}
}
}
.locked {
a {
box-shadow: inset 0 2px #f00;
}
}
}