[DE][mobile] removed project sources
This commit is contained in:
parent
8165ceac4b
commit
929495644f
|
@ -1,238 +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 Alexander Yuzhin on 9/21/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',
|
||||
localstorage : 'common/main/lib/util/LocalStorage',
|
||||
analytics : 'common/Analytics',
|
||||
gateway : 'common/Gateway',
|
||||
locale : 'common/locale',
|
||||
irregularstack : 'common/IrregularStack',
|
||||
sharedsettings : 'common/mobile/utils/SharedSettings',
|
||||
features : '../../web-apps-mobile/word/patch'
|
||||
},
|
||||
|
||||
shim: {
|
||||
framework7: {
|
||||
exports: 'Framework7'
|
||||
},
|
||||
underscore: {
|
||||
exports: '_'
|
||||
},
|
||||
backbone: {
|
||||
deps: [
|
||||
'underscore',
|
||||
'jquery'
|
||||
],
|
||||
exports: 'Backbone'
|
||||
},
|
||||
core: {
|
||||
deps: [
|
||||
'backbone',
|
||||
'notification',
|
||||
'irregularstack',
|
||||
'sharedsettings'
|
||||
]
|
||||
},
|
||||
extendes: {
|
||||
deps: [
|
||||
'underscore',
|
||||
'jquery',
|
||||
'framework7'
|
||||
]
|
||||
},
|
||||
gateway: {
|
||||
deps: [
|
||||
'jquery'
|
||||
]
|
||||
},
|
||||
analytics: {
|
||||
deps: [
|
||||
'jquery'
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
require([
|
||||
'backbone',
|
||||
'framework7',
|
||||
'core',
|
||||
'underscore',
|
||||
'extendes',
|
||||
'api',
|
||||
'analytics',
|
||||
'gateway',
|
||||
'locale',
|
||||
'jszip',
|
||||
'jsziputils',
|
||||
'sockjs'
|
||||
], function (Backbone, Framework7, Core) {
|
||||
Backbone.history.start();
|
||||
|
||||
/**
|
||||
* Application instance with DE namespace defined
|
||||
*/
|
||||
var app = new Backbone.Application({
|
||||
nameSpace: 'DE',
|
||||
autoCreate: false,
|
||||
controllers : [
|
||||
'Common.Controllers.Plugins',
|
||||
'Editor',
|
||||
'Toolbar',
|
||||
'Search',
|
||||
'Main',
|
||||
'DocumentHolder',
|
||||
'Settings',
|
||||
'EditContainer',
|
||||
'EditText',
|
||||
'EditParagraph',
|
||||
'EditHeader',
|
||||
'EditTable',
|
||||
'EditImage',
|
||||
'EditShape',
|
||||
'EditChart',
|
||||
'EditHyperlink',
|
||||
'AddContainer',
|
||||
'AddTable',
|
||||
'AddShape',
|
||||
'AddImage',
|
||||
'AddOther',
|
||||
'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',
|
||||
'documenteditor/mobile/app/controller/Editor',
|
||||
'documenteditor/mobile/app/controller/Toolbar',
|
||||
'documenteditor/mobile/app/controller/Search',
|
||||
'documenteditor/mobile/app/controller/Main',
|
||||
'documenteditor/mobile/app/controller/DocumentHolder',
|
||||
'documenteditor/mobile/app/controller/Settings',
|
||||
'documenteditor/mobile/app/controller/edit/EditContainer',
|
||||
'documenteditor/mobile/app/controller/edit/EditText',
|
||||
'documenteditor/mobile/app/controller/edit/EditParagraph',
|
||||
'documenteditor/mobile/app/controller/edit/EditHeader',
|
||||
'documenteditor/mobile/app/controller/edit/EditTable',
|
||||
'documenteditor/mobile/app/controller/edit/EditImage',
|
||||
'documenteditor/mobile/app/controller/edit/EditShape',
|
||||
'documenteditor/mobile/app/controller/edit/EditChart',
|
||||
'documenteditor/mobile/app/controller/edit/EditHyperlink',
|
||||
'documenteditor/mobile/app/controller/add/AddContainer',
|
||||
'documenteditor/mobile/app/controller/add/AddTable',
|
||||
'documenteditor/mobile/app/controller/add/AddShape',
|
||||
'documenteditor/mobile/app/controller/add/AddImage',
|
||||
'documenteditor/mobile/app/controller/add/AddOther',
|
||||
'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();
|
||||
}
|
||||
});
|
|
@ -1,246 +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 Alexander Yuzhin on 9/21/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',
|
||||
allfonts : '../../sdkjs/common/AllFonts',
|
||||
sdk : '../../sdkjs/word/sdk-all-min',
|
||||
api : 'api/documents/api',
|
||||
core : 'common/main/lib/core/application',
|
||||
extendes : 'common/mobile/utils/extendes',
|
||||
notification : 'common/main/lib/core/NotificationCenter',
|
||||
localstorage : 'common/main/lib/util/LocalStorage',
|
||||
analytics : 'common/Analytics',
|
||||
gateway : 'common/Gateway',
|
||||
locale : 'common/locale',
|
||||
irregularstack : 'common/IrregularStack',
|
||||
sharedsettings : 'common/mobile/utils/SharedSettings'
|
||||
},
|
||||
|
||||
shim: {
|
||||
framework7: {
|
||||
exports: 'Framework7'
|
||||
},
|
||||
underscore: {
|
||||
exports: '_'
|
||||
},
|
||||
backbone: {
|
||||
deps: [
|
||||
'underscore',
|
||||
'jquery'
|
||||
],
|
||||
exports: 'Backbone'
|
||||
},
|
||||
core: {
|
||||
deps: [
|
||||
'backbone',
|
||||
'notification',
|
||||
'irregularstack',
|
||||
'sharedsettings'
|
||||
]
|
||||
},
|
||||
extendes: {
|
||||
deps: [
|
||||
'underscore',
|
||||
'jquery',
|
||||
'framework7'
|
||||
]
|
||||
},
|
||||
sdk: {
|
||||
deps: [
|
||||
'jquery',
|
||||
'underscore',
|
||||
'allfonts',
|
||||
'xregexp',
|
||||
'sockjs',
|
||||
'jszip',
|
||||
'jsziputils'
|
||||
]
|
||||
},
|
||||
gateway: {
|
||||
deps: [
|
||||
'jquery'
|
||||
]
|
||||
},
|
||||
analytics: {
|
||||
deps: [
|
||||
'jquery'
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
require([
|
||||
'backbone',
|
||||
'framework7',
|
||||
'core',
|
||||
'underscore',
|
||||
'extendes',
|
||||
'sdk',
|
||||
'api',
|
||||
'analytics',
|
||||
'gateway',
|
||||
'locale'
|
||||
], function (Backbone, Framework7, Core) {
|
||||
Backbone.history.start();
|
||||
|
||||
/**
|
||||
* Application instance with DE namespace defined
|
||||
*/
|
||||
var app = new Backbone.Application({
|
||||
nameSpace: 'DE',
|
||||
autoCreate: false,
|
||||
controllers : [
|
||||
'Common.Controllers.Plugins',
|
||||
'Editor',
|
||||
'Toolbar',
|
||||
'Search',
|
||||
'Main',
|
||||
'DocumentHolder',
|
||||
'Settings',
|
||||
'EditContainer',
|
||||
'EditText',
|
||||
'EditParagraph',
|
||||
'EditHeader',
|
||||
'EditTable',
|
||||
'EditImage',
|
||||
'EditShape',
|
||||
'EditChart',
|
||||
'EditHyperlink',
|
||||
'AddContainer',
|
||||
'AddTable',
|
||||
'AddShape',
|
||||
'AddImage',
|
||||
'AddOther',
|
||||
'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',
|
||||
'documenteditor/mobile/app/controller/Editor',
|
||||
'documenteditor/mobile/app/controller/Toolbar',
|
||||
'documenteditor/mobile/app/controller/Search',
|
||||
'documenteditor/mobile/app/controller/Main',
|
||||
'documenteditor/mobile/app/controller/DocumentHolder',
|
||||
'documenteditor/mobile/app/controller/Settings',
|
||||
'documenteditor/mobile/app/controller/edit/EditContainer',
|
||||
'documenteditor/mobile/app/controller/edit/EditText',
|
||||
'documenteditor/mobile/app/controller/edit/EditParagraph',
|
||||
'documenteditor/mobile/app/controller/edit/EditHeader',
|
||||
'documenteditor/mobile/app/controller/edit/EditTable',
|
||||
'documenteditor/mobile/app/controller/edit/EditImage',
|
||||
'documenteditor/mobile/app/controller/edit/EditShape',
|
||||
'documenteditor/mobile/app/controller/edit/EditChart',
|
||||
'documenteditor/mobile/app/controller/edit/EditHyperlink',
|
||||
'documenteditor/mobile/app/controller/add/AddContainer',
|
||||
'documenteditor/mobile/app/controller/add/AddTable',
|
||||
'documenteditor/mobile/app/controller/add/AddShape',
|
||||
'documenteditor/mobile/app/controller/add/AddImage',
|
||||
'documenteditor/mobile/app/controller/add/AddOther',
|
||||
'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();
|
||||
}
|
||||
});
|
|
@ -1,678 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 11/8/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'core',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'documenteditor/mobile/app/view/DocumentHolder',
|
||||
'common/main/lib/collection/Users'
|
||||
], function (core, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.DocumentHolder = Backbone.Controller.extend(_.extend((function() {
|
||||
// private
|
||||
var _stack,
|
||||
_view,
|
||||
_fastCoAuthTips = [],
|
||||
_actionSheets = [],
|
||||
_isEdit = false,
|
||||
_canReview = false,
|
||||
_inRevisionChange = false,
|
||||
_isComments = false,
|
||||
_menuPos = [],
|
||||
_timer = 0,
|
||||
_canViewComments = true;
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [
|
||||
'Common.Collections.Users'
|
||||
],
|
||||
views: [
|
||||
'DocumentHolder'
|
||||
],
|
||||
|
||||
initialize: function() {
|
||||
this.addListeners({
|
||||
'DocumentHolder': {
|
||||
'contextmenu:click' : this.onContextMenuClick
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
var me = this;
|
||||
|
||||
me.api = api;
|
||||
|
||||
me.api.asc_registerCallback('asc_onShowPopMenu', _.bind(me.onApiShowPopMenu, me));
|
||||
me.api.asc_registerCallback('asc_onHidePopMenu', _.bind(me.onApiHidePopMenu, me));
|
||||
me.api.asc_registerCallback('asc_onShowForeignCursorLabel', _.bind(me.onApiShowForeignCursorLabel, me));
|
||||
me.api.asc_registerCallback('asc_onHideForeignCursorLabel', _.bind(me.onApiHideForeignCursorLabel, me));
|
||||
me.api.asc_registerCallback('asc_onAuthParticipantsChanged',_.bind(me.onApiUsersChanged, me));
|
||||
me.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(me.onApiUserConnection, me));
|
||||
me.api.asc_registerCallback('asc_onDocumentContentReady', _.bind(me.onApiDocumentContentReady, me));
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(me.onCoAuthoringDisconnect, me));
|
||||
me.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(me.onCoAuthoringDisconnect,me));
|
||||
me.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(me.onApiShowChange, me));
|
||||
me.api.asc_registerCallback('asc_onShowComment', _.bind(me.onApiShowComment, me));
|
||||
me.api.asc_registerCallback('asc_onHideComment', _.bind(me.onApiHideComment, me));
|
||||
me.api.asc_coAuthoringGetUsers();
|
||||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
_isEdit = mode.isEdit;
|
||||
_canReview = mode.canReview;
|
||||
_canViewComments = mode.canViewComments;
|
||||
},
|
||||
|
||||
// When our application is ready, lets get started
|
||||
onLaunch: function() {
|
||||
var me = this;
|
||||
|
||||
_view = me.createView('DocumentHolder').render();
|
||||
|
||||
$$(window).on('resize', _.bind(me.onEditorResize, me));
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onContextMenuClick: function (view, eventName) {
|
||||
var me = this;
|
||||
|
||||
if ('cut' == eventName) {
|
||||
var res = me.api.Cut();
|
||||
if (!res) {
|
||||
_view.hideMenu();
|
||||
if (!Common.localStorage.getBool("de-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("de-hide-copy-cut-paste-warning", 1);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if ('copy' == eventName) {
|
||||
var res = me.api.Copy();
|
||||
if (!res) {
|
||||
_view.hideMenu();
|
||||
if (!Common.localStorage.getBool("de-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-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("de-hide-copy-cut-paste-warning", 1);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if ('paste' == eventName) {
|
||||
var res = me.api.Paste();
|
||||
if (!res) {
|
||||
_view.hideMenu();
|
||||
if (!Common.localStorage.getBool("de-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("de-hide-copy-cut-paste-warning", 1);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if ('merge' == eventName) {
|
||||
me.api.MergeCells();
|
||||
} else if ('split' == eventName) {
|
||||
_view.hideMenu();
|
||||
me.showSplitModal();
|
||||
} else if ('delete' == eventName) {
|
||||
me.api.asc_Remove();
|
||||
} else if('deletetable' == eventName) {
|
||||
me.api.remTable();
|
||||
} else if ('edit' == eventName) {
|
||||
_view.hideMenu();
|
||||
|
||||
DE.getController('EditContainer').showModal();
|
||||
} else if ('addlink' == eventName) {
|
||||
_view.hideMenu();
|
||||
|
||||
DE.getController('AddContainer').showModal();
|
||||
DE.getController('AddOther').getView('AddOther').showLink(false);
|
||||
} else if ('openlink' == eventName) {
|
||||
_.some(_stack, function (item) {
|
||||
if (item.get_ObjectType() == Asc.c_oAscTypeSelectElement.Hyperlink) {
|
||||
me._openLink(item.get_ObjectValue().get_Value());
|
||||
return true;
|
||||
}
|
||||
});
|
||||
} else if ('review' == eventName) {
|
||||
var getCollaboration = DE.getController('Common.Controllers.Collaboration');
|
||||
getCollaboration.showModal();
|
||||
getCollaboration.getView('Common.Views.Collaboration').showPage('#reviewing-settings-view', false);
|
||||
} else if('reviewchange' == eventName) {
|
||||
var getCollaboration = DE.getController('Common.Controllers.Collaboration');
|
||||
getCollaboration.showModal();
|
||||
getCollaboration.getView('Common.Views.Collaboration').showPage('#reviewing-settings-view', false);
|
||||
getCollaboration.getView('Common.Views.Collaboration').showPage('#change-view', false);
|
||||
} else if ('viewcomment' == eventName) {
|
||||
var getCollaboration = DE.getController('Common.Controllers.Collaboration');
|
||||
getCollaboration.showCommentModal();
|
||||
} else if ('addcomment' == eventName) {
|
||||
_view.hideMenu();
|
||||
DE.getController('AddContainer').showModal();
|
||||
DE.getController('AddOther').getView('AddOther').showPageComment(false);
|
||||
} else if ('showActionSheet' == eventName && _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);
|
||||
}
|
||||
|
||||
_view.hideMenu();
|
||||
},
|
||||
|
||||
showSplitModal: function() {
|
||||
var me = this,
|
||||
picker;
|
||||
uiApp.modal({
|
||||
title : me.menuSplit,
|
||||
text: '',
|
||||
afterText:
|
||||
'<div class="content-block">' +
|
||||
'<div class="row no-gutter" style="text-align: center;">' +
|
||||
'<div class="col-50 size-columns">' + me.textColumns + '</div>' +
|
||||
'<div class="col-50 size-rows">' + me.textRows + '</div>' +
|
||||
'</div>' +
|
||||
'<div id="picker-split-size"></div>' +
|
||||
'</div>',
|
||||
buttons: [
|
||||
{
|
||||
text: me.textCancel
|
||||
},
|
||||
{
|
||||
text: 'OK',
|
||||
bold: true,
|
||||
onClick: function () {
|
||||
var size = picker.value;
|
||||
if (me.api) {
|
||||
me.api.SplitCell(parseInt(size[0]), parseInt(size[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
picker = uiApp.picker({
|
||||
container: '#picker-split-size',
|
||||
toolbar: false,
|
||||
rotateEffect: true,
|
||||
value: [3, 3],
|
||||
cols: [{
|
||||
textAlign: 'center',
|
||||
width: '100%',
|
||||
values: [1,2,3,4,5,6,7,8,9,10]
|
||||
}, {
|
||||
textAlign: 'center',
|
||||
width: '100%',
|
||||
values: [1,2,3,4,5,6,7,8,9,10]
|
||||
}]
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// API Handlers
|
||||
|
||||
onEditorResize: function(cmp) {
|
||||
// Hide context menu
|
||||
},
|
||||
|
||||
onApiShowPopMenu: function(posX, posY) {
|
||||
if ($('.popover.settings, .popup.settings, .picker-modal.settings, .modal.modal-in, .actions-modal').length > 0) {
|
||||
return;
|
||||
}
|
||||
var now = (new Date).getTime();
|
||||
if (now - _timer < 1000) return;
|
||||
_timer = 0;
|
||||
|
||||
_menuPos = [posX, posY];
|
||||
|
||||
var me = this,
|
||||
items;
|
||||
|
||||
_stack = me.api.getSelectedElements();
|
||||
items = me._initMenu(_stack);
|
||||
|
||||
_view.showMenu(items, posX, posY);
|
||||
},
|
||||
|
||||
onApiHidePopMenu: function() {
|
||||
var now = (new Date).getTime();
|
||||
if (now - _timer < 1000) return;
|
||||
_view && _view.hideMenu();
|
||||
},
|
||||
|
||||
onApiShowForeignCursorLabel: function(userId, X, Y, color) {
|
||||
var me = this,
|
||||
tipHeight = 20;
|
||||
|
||||
var getUserName = function(id) {
|
||||
var usersStore = DE.getCollection('Common.Collections.Users');
|
||||
|
||||
if (usersStore){
|
||||
var rec = usersStore.findUser(id);
|
||||
if (rec)
|
||||
return rec.get('username');
|
||||
}
|
||||
return me.textGuest;
|
||||
};
|
||||
|
||||
/** coauthoring begin **/
|
||||
var src = _.find(_fastCoAuthTips, function(tip){ return tip.attr('userid') == userId; });
|
||||
|
||||
if (!src) {
|
||||
src = $(document.createElement('div'));
|
||||
src.addClass('username-tip');
|
||||
src.attr('userid', userId);
|
||||
src.css({
|
||||
height: tipHeight + 'px',
|
||||
position: 'absolute',
|
||||
zIndex: '900',
|
||||
display: 'none',
|
||||
'pointer-events': 'none',
|
||||
'background-color': '#' + Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b())});
|
||||
src.text(getUserName(userId));
|
||||
$('#id_main_view').append(src);
|
||||
|
||||
_fastCoAuthTips.push(src);
|
||||
|
||||
src.fadeIn(150);
|
||||
}
|
||||
src.css({
|
||||
top: (Y - tipHeight) + 'px',
|
||||
left: X + 'px'});
|
||||
/** coauthoring end **/
|
||||
},
|
||||
|
||||
onApiHideForeignCursorLabel: function(userId) {
|
||||
/** coauthoring begin **/
|
||||
for (var i=0; i<_fastCoAuthTips.length; i++) {
|
||||
if (_fastCoAuthTips[i].attr('userid') == userId) {
|
||||
var src = _fastCoAuthTips[i];
|
||||
_fastCoAuthTips[i].fadeOut(150, function(){src.remove()});
|
||||
_fastCoAuthTips.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/** coauthoring end **/
|
||||
},
|
||||
|
||||
onApiUsersChanged: function(users){
|
||||
var usersStore = this.getApplication().getCollection('Common.Collections.Users');
|
||||
|
||||
if (usersStore) {
|
||||
var arrUsers = [], name, user;
|
||||
|
||||
for (name in users) {
|
||||
if (undefined !== name) {
|
||||
user = users[name];
|
||||
if (user) {
|
||||
arrUsers.push(new Common.Models.User({
|
||||
id : user.asc_getId(),
|
||||
username : user.asc_getUserName(),
|
||||
online : true,
|
||||
color : user.asc_getColor(),
|
||||
view : user.asc_getView()
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
usersStore[usersStore.size() > 0 ? 'add' : 'reset'](arrUsers);
|
||||
}
|
||||
},
|
||||
|
||||
onApiUserConnection: function(change){
|
||||
var usersStore = this.getApplication().getCollection('Common.Collections.Users');
|
||||
|
||||
if (usersStore){
|
||||
var user = usersStore.findUser(change.asc_getId());
|
||||
if (!user) {
|
||||
usersStore.add(new Common.Models.User({
|
||||
id : change.asc_getId(),
|
||||
username : change.asc_getUserName(),
|
||||
online : change.asc_getState(),
|
||||
color : change.asc_getColor(),
|
||||
view : change.asc_getView()
|
||||
}));
|
||||
} else {
|
||||
user.set({online: change.asc_getState()});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onApiDocumentContentReady: function () {
|
||||
_view = this.createView('DocumentHolder').render();
|
||||
},
|
||||
|
||||
onApiShowChange: function(sdkchange) {
|
||||
_inRevisionChange = sdkchange && sdkchange.length>0;
|
||||
},
|
||||
|
||||
onApiShowComment: function(comments) {
|
||||
_isComments = comments && comments.length>0;
|
||||
},
|
||||
|
||||
onApiHideComment: function() {
|
||||
_isComments = false;
|
||||
},
|
||||
|
||||
// Internal
|
||||
|
||||
_openLink: function(url) {
|
||||
if (this.api.asc_getUrlType(url) > 0) {
|
||||
var newDocumentPage = window.open(url, '_blank');
|
||||
|
||||
if (newDocumentPage) {
|
||||
newDocumentPage.focus();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_initMenu: function (stack) {
|
||||
var me = this,
|
||||
arrItems = [],
|
||||
arrItemsIcon = [],
|
||||
canCopy = me.api.can_CopyCut();
|
||||
|
||||
_actionSheets = [];
|
||||
|
||||
if (canCopy) {
|
||||
arrItemsIcon.push({
|
||||
caption: me.menuCopy,
|
||||
event: 'copy',
|
||||
icon: 'icon-copy'
|
||||
});
|
||||
}
|
||||
if (_canViewComments && _isComments && !_isEdit) {
|
||||
arrItems.push({
|
||||
caption: me.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
var isText = false,
|
||||
isTable = false,
|
||||
isImage = false,
|
||||
isChart = false,
|
||||
isShape = false,
|
||||
isLink = false,
|
||||
lockedText = false,
|
||||
lockedTable = false,
|
||||
lockedImage = false,
|
||||
lockedHeader = false;
|
||||
|
||||
_.each(stack, function (item) {
|
||||
var objectType = item.get_ObjectType(),
|
||||
objectValue = item.get_ObjectValue();
|
||||
|
||||
if (objectType == Asc.c_oAscTypeSelectElement.Header) {
|
||||
lockedHeader = objectValue.get_Locked();
|
||||
}
|
||||
|
||||
if (objectType == Asc.c_oAscTypeSelectElement.Paragraph) {
|
||||
isText = true;
|
||||
lockedText = objectValue.get_Locked();
|
||||
} else if (objectType == Asc.c_oAscTypeSelectElement.Image) {
|
||||
lockedImage = objectValue.get_Locked();
|
||||
if (objectValue && objectValue.get_ChartProperties()) {
|
||||
isChart = true;
|
||||
} else if (objectType && objectValue.get_ShapeProperties()) {
|
||||
isShape = true;
|
||||
} else {
|
||||
isImage = true;
|
||||
}
|
||||
} else if (objectType == Asc.c_oAscTypeSelectElement.Table) {
|
||||
isTable = true;
|
||||
lockedTable = objectValue.get_Locked();
|
||||
} else if (objectType == Asc.c_oAscTypeSelectElement.Hyperlink) {
|
||||
isLink = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (stack.length > 0) {
|
||||
|
||||
var swapItems = function(items, indexBefore, indexAfter) {
|
||||
items[indexAfter] = items.splice(indexBefore, 1, items[indexAfter])[0];
|
||||
};
|
||||
|
||||
if (_isEdit && !me.isDisconnected) {
|
||||
if (!lockedText && !lockedTable && !lockedImage && !lockedHeader && canCopy) {
|
||||
arrItemsIcon.push({
|
||||
caption: me.menuCut,
|
||||
event: 'cut',
|
||||
icon: 'icon-cut'
|
||||
});
|
||||
|
||||
// Swap 'Copy' and 'Cut'
|
||||
swapItems(arrItemsIcon, 0, 1);
|
||||
}
|
||||
|
||||
if (!lockedText && !lockedTable && !lockedImage && !lockedHeader) {
|
||||
arrItemsIcon.push({
|
||||
caption: me.menuPaste,
|
||||
event: 'paste',
|
||||
icon: 'icon-paste'
|
||||
});
|
||||
}
|
||||
|
||||
if(isTable && me.api.CheckBeforeMergeCells() && !lockedTable && !lockedHeader) {
|
||||
arrItems.push({
|
||||
caption: me.menuMerge,
|
||||
event: 'merge'
|
||||
});
|
||||
}
|
||||
|
||||
if(isTable && me.api.CheckBeforeSplitCells() && !lockedTable && !lockedHeader) {
|
||||
arrItems.push({
|
||||
caption: me.menuSplit,
|
||||
event: 'split'
|
||||
});
|
||||
}
|
||||
|
||||
if(!lockedText && !lockedTable && !lockedImage && !lockedHeader) {
|
||||
arrItems.push({
|
||||
caption: me.menuDelete,
|
||||
event: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
if(isTable && !lockedTable && !lockedText && !lockedHeader) {
|
||||
arrItems.push({
|
||||
caption: me.menuDeleteTable,
|
||||
event: 'deletetable'
|
||||
});
|
||||
}
|
||||
|
||||
if(!lockedText && !lockedTable && !lockedImage && !lockedHeader){
|
||||
arrItems.push({
|
||||
caption: me.menuEdit,
|
||||
event: 'edit'
|
||||
});
|
||||
}
|
||||
|
||||
if (!_.isEmpty(me.api.can_AddHyperlink()) && !lockedHeader) {
|
||||
arrItems.push({
|
||||
caption: me.menuAddLink,
|
||||
event: 'addlink'
|
||||
});
|
||||
}
|
||||
|
||||
if (_canReview) {
|
||||
if (_inRevisionChange) {
|
||||
arrItems.push({
|
||||
caption: me.menuReviewChange,
|
||||
event: 'reviewchange'
|
||||
});
|
||||
} else {
|
||||
arrItems.push({
|
||||
caption: me.menuReview,
|
||||
event: 'review'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (_isComments && _canViewComments) {
|
||||
arrItems.push({
|
||||
caption: me.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
var isObject = isShape || isChart || isImage || isTable;
|
||||
var hideAddComment = !_canViewComments || me.api.can_AddQuotedComment() === false || lockedText || lockedTable || lockedImage || lockedHeader || (!isText && isObject);
|
||||
if (!hideAddComment) {
|
||||
arrItems.push({
|
||||
caption: me.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isLink) {
|
||||
arrItems.push({
|
||||
caption: me.menuOpenLink,
|
||||
event: 'openlink'
|
||||
});
|
||||
}
|
||||
|
||||
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;
|
||||
},
|
||||
|
||||
textGuest: 'Guest',
|
||||
textCancel: 'Cancel',
|
||||
textColumns: 'Columns',
|
||||
textRows: 'Rows',
|
||||
menuCut: 'Cut',
|
||||
menuCopy: 'Copy',
|
||||
menuPaste: 'Paste',
|
||||
menuEdit: 'Edit',
|
||||
menuDelete: 'Delete',
|
||||
menuAddLink: 'Add Link',
|
||||
menuOpenLink: 'Open Link',
|
||||
menuMore: 'More',
|
||||
sheetCancel: 'Cancel',
|
||||
menuReview: 'Review',
|
||||
menuMerge: 'Merge Cells',
|
||||
menuSplit: 'Split Cell',
|
||||
menuDeleteTable: 'Delete Table',
|
||||
menuReviewChange: 'Review Change',
|
||||
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'
|
||||
}
|
||||
})(), DE.Controllers.DocumentHolder || {}))
|
||||
});
|
|
@ -1,122 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 9/22/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/Editor'
|
||||
], function (core) {
|
||||
'use strict';
|
||||
|
||||
DE.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));
|
||||
},
|
||||
|
||||
onWindowResize: function(e) {
|
||||
this.api && this.api.Resize();
|
||||
}
|
||||
}
|
||||
})());
|
||||
});
|
File diff suppressed because it is too large
Load diff
|
@ -1,355 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 11/15/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'core',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'documenteditor/mobile/app/view/Search'
|
||||
], function (core, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.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
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
this.api = api;
|
||||
},
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
Common.NotificationCenter.on('readermode:change', function (reader) {
|
||||
_startPoint = {};
|
||||
});
|
||||
},
|
||||
|
||||
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 strictBool = function (settingName) {
|
||||
var value = Common.SharedSettings.get(settingName);
|
||||
return !_.isUndefined(value) && (value === true);
|
||||
};
|
||||
|
||||
var me = this,
|
||||
isReplace = strictBool('search-is-replace'),
|
||||
isCaseSensitive = strictBool('search-case-sensitive'),
|
||||
isHighlight = strictBool('search-highlight'),
|
||||
$pageSettings = $('.page[data-page=search-settings]'),
|
||||
$inputType = $pageSettings.find('input[name=search-type]'),
|
||||
$inputCase = $pageSettings.find('#search-case-sensitive input:checkbox'),
|
||||
$inputHighlight = $pageSettings.find('#search-highlight-results input:checkbox');
|
||||
|
||||
$inputType.val([isReplace ? 'replace' : 'search']);
|
||||
$inputCase.prop('checked', isCaseSensitive);
|
||||
$inputHighlight.prop('checked', isHighlight);
|
||||
|
||||
// init events
|
||||
$inputType.single('change', _.bind(me.onTypeChange, me));
|
||||
$inputCase.single('change', _.bind(me.onCaseClick, me));
|
||||
$inputHighlight.single('change', _.bind(me.onHighlightClick, me));
|
||||
},
|
||||
|
||||
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) {
|
||||
this.onQueryReplace(this.searchBar.query, this.replaceBar.query);
|
||||
},
|
||||
|
||||
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-case-sensitive') || false,
|
||||
matchword = Common.SharedSettings.get('search-highlight') || false;
|
||||
|
||||
if (query && query.length) {
|
||||
if (!this.api.asc_findText(query, direction != 'back', matchcase, matchword)) {
|
||||
var me = this;
|
||||
uiApp.alert(
|
||||
'',
|
||||
me.textNoTextFound,
|
||||
function () {
|
||||
me.searchBar.input.focus();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onQueryReplace: function(search, replace) {
|
||||
var matchcase = Common.SharedSettings.get('search-case-sensitive') || false,
|
||||
matchword = Common.SharedSettings.get('search-highlight') || false;
|
||||
|
||||
if (search && search.length) {
|
||||
if (!this.api.asc_replaceText(search, replace, false, matchcase, matchword)) {
|
||||
var me = this;
|
||||
uiApp.alert(
|
||||
'',
|
||||
me.textNoTextFound,
|
||||
function () {
|
||||
me.searchBar.input.focus();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onQueryReplaceAll: function(search, replace) {
|
||||
var matchcase = Common.SharedSettings.get('search-case-sensitive') || false,
|
||||
matchword = Common.SharedSettings.get('search-highlight') || false;
|
||||
|
||||
if (search && search.length) {
|
||||
this.api.asc_replaceText(search, replace, true, matchcase, matchword);
|
||||
}
|
||||
},
|
||||
|
||||
onTypeChange: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
isReplace = ($target.val() === 'replace');
|
||||
|
||||
Common.SharedSettings.set('search-is-replace', isReplace);
|
||||
$('.searchbar.document').toggleClass('replace', isReplace);
|
||||
},
|
||||
|
||||
onCaseClick: function (e) {
|
||||
Common.SharedSettings.set('search-case-sensitive', $(e.currentTarget).is(':checked'));
|
||||
},
|
||||
|
||||
onHighlightClick: function (e) {
|
||||
Common.SharedSettings.set('search-highlight', $(e.currentTarget).is(':checked'));
|
||||
this.api.asc_selectSearchingResults(Common.SharedSettings.get('search-highlight'));
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
textNoTextFound: 'Text not found',
|
||||
textReplaceAll: 'Replace All'
|
||||
}
|
||||
})(), DE.Controllers.Search || {}))
|
||||
});
|
|
@ -1,791 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/7/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'core',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'documenteditor/mobile/app/view/Settings',
|
||||
'common/mobile/lib/controller/Collaboration'
|
||||
], function (core, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.Settings = Backbone.Controller.extend(_.extend((function() {
|
||||
// private
|
||||
var rootView,
|
||||
inProgress,
|
||||
infoObj,
|
||||
modalView,
|
||||
_isPortrait = false,
|
||||
_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] }
|
||||
],
|
||||
_licInfo,
|
||||
_canReview = false,
|
||||
_isReviewOnly = false,
|
||||
_fileKey,
|
||||
_metricText = Common.Utils.Metric.getCurrentMetricName(),
|
||||
_isEdit,
|
||||
_lang;
|
||||
|
||||
var mm2Cm = function(mm) {
|
||||
return parseFloat((mm/10.).toFixed(2));
|
||||
};
|
||||
|
||||
var cm2Mm = function(cm) {
|
||||
return cm * 10.;
|
||||
};
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [
|
||||
'Settings'
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
var me = this;
|
||||
|
||||
Common.SharedSettings.set('readerMode', false);
|
||||
Common.NotificationCenter.on('settingscontainer:show', _.bind(this.initEvents, this));
|
||||
|
||||
me.maxMarginsW = me.maxMarginsH = 0;
|
||||
me.localSectionProps = null;
|
||||
|
||||
me.addListeners({
|
||||
'Settings': {
|
||||
'page:show' : me.onPageShow
|
||||
}
|
||||
});
|
||||
|
||||
uiApp.onPageAfterBack('margin-view', function (page) {
|
||||
me.applyPageMarginsIfNeed()
|
||||
});
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
var me = this;
|
||||
me.api = api;
|
||||
|
||||
me.api.asc_registerCallback('asc_onGetDocInfoStart', _.bind(me.onApiGetDocInfoStart, me));
|
||||
me.api.asc_registerCallback('asc_onGetDocInfoStop', _.bind(me.onApiGetDocInfoEnd, me));
|
||||
me.api.asc_registerCallback('asc_onDocInfo', _.bind(me.onApiDocInfo, me));
|
||||
me.api.asc_registerCallback('asc_onGetDocInfoEnd', _.bind(me.onApiGetDocInfoEnd, me));
|
||||
me.api.asc_registerCallback('asc_onDocumentName', _.bind(me.onApiDocumentName, me));
|
||||
me.api.asc_registerCallback('asc_onDocSize', _.bind(me.onApiPageSize, me));
|
||||
me.api.asc_registerCallback('asc_onPageOrient', _.bind(me.onApiPageOrient, me));
|
||||
me.api.asc_registerCallback('asc_onSendThemeColorSchemes', _.bind(me.onSendThemeColorSchemes, me));
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('Settings').render();
|
||||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
this.getView('Settings').setMode(mode);
|
||||
if (mode.canBranding)
|
||||
_licInfo = mode.customization;
|
||||
_canReview = mode.canReview;
|
||||
_isReviewOnly = mode.isReviewOnly;
|
||||
_fileKey = mode.fileKey;
|
||||
_isEdit = mode.isEdit;
|
||||
_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
|
||||
});
|
||||
|
||||
Common.NotificationCenter.trigger('settingscontainer:show');
|
||||
this.onPageShow(this.getView('Settings'));
|
||||
},
|
||||
|
||||
hideModal: function() {
|
||||
if (modalView) {
|
||||
uiApp.closeModal(modalView);
|
||||
}
|
||||
},
|
||||
|
||||
onPageShow: function(view, pageId) {
|
||||
var me = this;
|
||||
|
||||
if ('#settings-document-view' == pageId) {
|
||||
me.initPageDocumentSettings();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-document-view]', '.page[data-page=settings-document-view] .page-content');
|
||||
} else if ('#settings-document-formats-view' == pageId) {
|
||||
me.getView('Settings').renderPageSizes(_pageSizes, _pageSizesIndex);
|
||||
$('.page[data-page=settings-document-formats-view] input:radio[name=document-format]').single('change', _.bind(me.onFormatChange, me));
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-document-formats-view]', '.page[data-page=settings-document-formats-view] .page-content');
|
||||
} else if ('#settings-download-view' == pageId) {
|
||||
$(modalView).find('.formats a').single('click', _.bind(me.onSaveFormat, me));
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-download-view]', '.page[data-page=settings-download-view] .page-content');
|
||||
} else if ('#settings-info-view' == pageId) {
|
||||
me.initPageInfo();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-info-view]', '.page[data-page=settings-info-view] .page-content');
|
||||
} else if ('#settings-about-view' == pageId) {
|
||||
// About
|
||||
me.setLicInfo(_licInfo);
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-about-view]', '.page[data-page=settings-about-view] .page-content');
|
||||
} else if ('#settings-advanced-view' == pageId) {
|
||||
me.initPageAdvancedSettings();
|
||||
$('#settings-spellcheck input:checkbox').attr('checked', Common.Utils.InternalSettings.get("de-mobile-spellcheck"));
|
||||
$('#settings-spellcheck input:checkbox').single('change', _.bind(me.onSpellcheck, me));
|
||||
$('#settings-no-characters input:checkbox').attr('checked', (Common.localStorage.getItem("de-mobile-no-characters") == 'true') ? true : false);
|
||||
$('#settings-no-characters input:checkbox').single('change', _.bind(me.onNoCharacters, me));
|
||||
$('#settings-hidden-borders input:checkbox').attr('checked', (Common.localStorage.getItem("de-mobile-hidden-borders") == 'true') ? true : false);
|
||||
$('#settings-hidden-borders input:checkbox').single('change', _.bind(me.onShowTableEmptyLine, me));
|
||||
$('#settings-orthography').single('click', _.bind(me.onOrthographyCheck, me));
|
||||
var displayComments = Common.localStorage.getBool("de-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("de-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));
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-advanced-view]', '.page[data-page=settings-advanced-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 ('#margins-view' == pageId) {
|
||||
me.initPageMargin();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=margin-view]', '.page[data-page=margin-view] .page-content');
|
||||
} else if ('#macros-settings-view' == pageId) {
|
||||
me.initPageMacrosSettings();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=macros-settings-view]', '.page[data-page=macros-settings-view] .page-content');
|
||||
} else {
|
||||
$('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode'));
|
||||
$('#settings-search').single('click', _.bind(me.onSearch, me));
|
||||
$('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me));
|
||||
$('#settings-help').single('click', _.bind(me.onShowHelp, me));
|
||||
$('#settings-download').single('click', _.bind(me.onDownloadOrigin, me));
|
||||
$('#settings-print').single('click', _.bind(me.onPrint, me));
|
||||
$('#settings-collaboration').single('click', _.bind(me.clickCollaboration, me));
|
||||
var _stateDisplayMode = DE.getController('Common.Controllers.Collaboration').getDisplayMode();
|
||||
if(_stateDisplayMode == "final" || _stateDisplayMode == "original") {
|
||||
$('#settings-document').addClass('disabled');
|
||||
}
|
||||
var _userCount = DE.getController('Main').returnUserCount();
|
||||
if (_userCount > 0) {
|
||||
$('#settings-collaboration').show();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
initPageMacrosSettings: function() {
|
||||
var me = this,
|
||||
$pageMacrosSettings = $('.page[data-page="macros-settings-view"] input:radio[name=macros-settings]'),
|
||||
value = Common.Utils.InternalSettings.get("de-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("de-mobile-macros-mode", value);
|
||||
Common.localStorage.setItem("de-mobile-macros-mode", value);
|
||||
},
|
||||
|
||||
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("de-settings-resolvedcomment", false);
|
||||
$("#settings-display-resolved").addClass("disabled");
|
||||
} else {
|
||||
var resolved = Common.localStorage.getBool("de-settings-resolvedcomment");
|
||||
this.api.asc_showComments(resolved);
|
||||
$("#settings-display-resolved").removeClass("disabled");
|
||||
}
|
||||
Common.localStorage.setBool("de-mobile-settings-livecomment", displayComments);
|
||||
},
|
||||
|
||||
onChangeDisplayResolved: function(e) {
|
||||
var displayComments = Common.localStorage.getBool("de-mobile-settings-livecomment");
|
||||
if (displayComments) {
|
||||
var resolved = $(e.currentTarget).is(':checked');
|
||||
if (this.api) {
|
||||
this.api.asc_showComments(resolved);
|
||||
}
|
||||
Common.localStorage.setBool("de-settings-resolvedcomment", resolved);
|
||||
}
|
||||
},
|
||||
|
||||
clickCollaboration: function() {
|
||||
DE.getController('Common.Controllers.Collaboration').showModal();
|
||||
},
|
||||
|
||||
onNoCharacters: function(e) {
|
||||
var me = this;
|
||||
var $checkbox = $(e.currentTarget),
|
||||
state = $checkbox.is(':checked');
|
||||
Common.localStorage.setItem("de-mobile-no-characters", state);
|
||||
me.api.put_ShowParaMarks(state);
|
||||
},
|
||||
|
||||
onShowTableEmptyLine: function(e) {
|
||||
var me = this,
|
||||
$checkbox = $(e.currentTarget),
|
||||
state = $checkbox.is(':checked');
|
||||
Common.localStorage.setItem("de-mobile-hidden-borders", state);
|
||||
me.api.put_ShowTableEmptyLine(state);
|
||||
},
|
||||
|
||||
initPageMargin: function() {
|
||||
var me = this;
|
||||
_metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric());
|
||||
|
||||
// Init page margins
|
||||
me.localSectionProps = me.api.asc_GetSectionProps();
|
||||
|
||||
if (me.localSectionProps) {
|
||||
me.maxMarginsH = me.localSectionProps.get_H() - 26;
|
||||
me.maxMarginsW = me.localSectionProps.get_W() - 127;
|
||||
|
||||
var top = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_TopMargin()).toFixed(2)),
|
||||
bottom = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_BottomMargin()).toFixed(2)),
|
||||
left = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_LeftMargin()).toFixed(2)),
|
||||
right = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_RightMargin()).toFixed(2));
|
||||
|
||||
$('#document-margin-top .item-after label').text(top + ' ' + _metricText);
|
||||
$('#document-margin-bottom .item-after label').text(bottom + ' ' + _metricText);
|
||||
$('#document-margin-left .item-after label').text(left + ' ' + _metricText);
|
||||
$('#document-margin-right .item-after label').text(right + ' ' + _metricText);
|
||||
}
|
||||
|
||||
_.each(["top", "left", "bottom", "right"], function(align) {
|
||||
$(Common.Utils.String.format('#document-margin-{0} .button', align)).single('click', _.bind(me.onPageMarginsChange, me, align));
|
||||
})
|
||||
},
|
||||
|
||||
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));
|
||||
}
|
||||
},
|
||||
|
||||
initPageAdvancedSettings: function() {
|
||||
var me = this,
|
||||
$unitMeasurement = $('.page[data-page=settings-advanced-view] input:radio[name=unit-of-measurement]');
|
||||
$unitMeasurement.single('change', _.bind(me.unitMeasurementChange, me));
|
||||
var value = Common.Utils.Metric.getCurrentMetric();
|
||||
$unitMeasurement.val([value]);
|
||||
var _stateDisplayMode = DE.getController('Common.Controllers.Collaboration').getDisplayMode();
|
||||
if(_stateDisplayMode == "final" || _stateDisplayMode == "original") {
|
||||
$('#settings-no-characters').addClass('disabled');
|
||||
$('#settings-hidden-borders').addClass('disabled');
|
||||
}
|
||||
if (!_isEdit) {
|
||||
$('.page[data-page=settings-advanced-view] .page-content > :not(.display-view)').hide();
|
||||
}
|
||||
},
|
||||
|
||||
initPageDocumentSettings: function () {
|
||||
var me = this,
|
||||
$pageOrientation = $('.page[data-page=settings-document-view] input:radio[name=doc-orientation]'),
|
||||
$pageSize = $('#settings-document-format'),
|
||||
curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()),
|
||||
sizeW,
|
||||
sizeH;
|
||||
|
||||
// Init orientation
|
||||
$pageOrientation.val([_isPortrait]);
|
||||
$pageOrientation.single('change', _.bind(me.onOrientationChange, me));
|
||||
|
||||
// Init format
|
||||
if (_pageSizesIndex === -1) {
|
||||
$pageSize.find('.item-title').text(me.textCustomSize);
|
||||
sizeW = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizesCurrent[0]).toFixed(2));
|
||||
sizeH = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizesCurrent[1]).toFixed(2));
|
||||
} else {
|
||||
$pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']);
|
||||
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);
|
||||
},
|
||||
|
||||
initPageInfo: function () {
|
||||
var me = this;
|
||||
|
||||
if (me.api) {
|
||||
me.api.startGetDocInfo();
|
||||
|
||||
var document = Common.SharedSettings.get('document') || {},
|
||||
info = document.info || {};
|
||||
|
||||
document.title ? $('#settings-document-title').html(document.title) : $('.display-document-title').remove();
|
||||
var value = info.owner || info.author;
|
||||
value ? $('#settings-document-owner').html(value) : $('.display-owner').remove();
|
||||
value = info.uploaded || info.created;
|
||||
value ? $('#settings-doc-uploaded').html(value) : $('.display-uploaded').remove();
|
||||
info.folder ? $('#settings-doc-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-doc-application').html(appName) : $('.display-application').remove();
|
||||
}
|
||||
var props = (this.api) ? this.api.asc_getCoreProps() : null;
|
||||
if (props) {
|
||||
value = props.asc_getTitle();
|
||||
value ? $('#settings-doc-title').html(value) : $('.display-title').remove();
|
||||
value = props.asc_getSubject();
|
||||
value ? $('#settings-doc-subject').html(value) : $('.display-subject').remove();
|
||||
value = props.asc_getDescription();
|
||||
value ? $('#settings-doc-comment').html(value) : $('.display-comment').remove();
|
||||
value = props.asc_getModified();
|
||||
value ? $('#settings-doc-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-doc-mod-by').html(value) : $('.display-mode-by').remove();
|
||||
value = props.asc_getCreated();
|
||||
value ? $('#settings-doc-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();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
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;" />');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Utils
|
||||
|
||||
applyPageMarginsIfNeed: function() {
|
||||
var me = this,
|
||||
originalMarginsProps = me.api.asc_GetSectionProps(),
|
||||
originalMarginsChecksum = _.reduce([
|
||||
originalMarginsProps.get_TopMargin(),
|
||||
originalMarginsProps.get_LeftMargin(),
|
||||
originalMarginsProps.get_RightMargin(),
|
||||
originalMarginsProps.get_BottomMargin()
|
||||
], function(memo, num){ return memo + num; }, 0),
|
||||
localMarginsChecksum = _.reduce([
|
||||
me.localSectionProps.get_TopMargin(),
|
||||
me.localSectionProps.get_LeftMargin(),
|
||||
me.localSectionProps.get_RightMargin(),
|
||||
me.localSectionProps.get_BottomMargin()
|
||||
], function(memo, num){ return memo + num; }, 0);
|
||||
|
||||
if (Math.abs(originalMarginsChecksum - localMarginsChecksum) > 0.01) {
|
||||
me.api.asc_SetSectionProps(me.localSectionProps);
|
||||
}
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onSearch: function (e) {
|
||||
var toolbarView = DE.getController('Toolbar').getView('Toolbar');
|
||||
|
||||
if (toolbarView) {
|
||||
toolbarView.showSearch();
|
||||
}
|
||||
|
||||
this.hideModal();
|
||||
},
|
||||
|
||||
onReaderMode: function (e) {
|
||||
var me = this;
|
||||
|
||||
Common.SharedSettings.set('readerMode', !Common.SharedSettings.get('readerMode'));
|
||||
|
||||
me.api && me.api.ChangeReaderMode();
|
||||
|
||||
if (Common.SharedSettings.get('phone')) {
|
||||
_.defer(function () {
|
||||
me.hideModal();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
Common.NotificationCenter.trigger('readermode:change', Common.SharedSettings.get('readerMode'));
|
||||
},
|
||||
|
||||
onSpellcheck: function (e) {
|
||||
var $checkbox = $(e.currentTarget),
|
||||
state = $checkbox.is(':checked');
|
||||
Common.localStorage.setItem("de-mobile-spellcheck", state ? 1 : 0);
|
||||
Common.Utils.InternalSettings.set("de-mobile-spellcheck", state);
|
||||
this.api && this.api.asc_setSpellCheck(state);
|
||||
},
|
||||
|
||||
onOrthographyCheck: function (e) {
|
||||
this.hideModal();
|
||||
|
||||
this.api && this.api.asc_pluginRun("asc.{B631E142-E40B-4B4C-90B9-2D00222A286E}", 0);
|
||||
},
|
||||
|
||||
onShowHelp: function () {
|
||||
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();
|
||||
},
|
||||
|
||||
onSaveFormat: function(e) {
|
||||
var me = this,
|
||||
format = $(e.currentTarget).data('format');
|
||||
|
||||
if (format) {
|
||||
if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) {
|
||||
_.defer(function () {
|
||||
uiApp.confirm(
|
||||
(format === Asc.c_oAscFileType.TXT) ? me.warnDownloadAs : me.warnDownloadAsRTF,
|
||||
me.notcriticalErrorTitle,
|
||||
function () {
|
||||
if (format == Asc.c_oAscFileType.TXT)
|
||||
Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format));
|
||||
else
|
||||
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||
}
|
||||
);
|
||||
});
|
||||
} else {
|
||||
_.defer(function () {
|
||||
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||
});
|
||||
}
|
||||
|
||||
me.hideModal();
|
||||
}
|
||||
},
|
||||
|
||||
onDownloadOrigin: function(e) {
|
||||
var me = this;
|
||||
|
||||
_.defer(function () {
|
||||
me.api.asc_DownloadOrigin();
|
||||
});
|
||||
me.hideModal();
|
||||
},
|
||||
|
||||
onPrint: function(e) {
|
||||
var me = this;
|
||||
|
||||
_.defer(function () {
|
||||
me.api.asc_Print();
|
||||
});
|
||||
me.hideModal();
|
||||
},
|
||||
|
||||
onFormatChange: function (e) {
|
||||
var me = this,
|
||||
rawValue = $(e.currentTarget).val(),
|
||||
value = rawValue.split(',');
|
||||
|
||||
_.delay(function () {
|
||||
me.api.change_DocSize(parseFloat(value[0]), parseFloat(value[1]));
|
||||
}, 300);
|
||||
},
|
||||
|
||||
onOrientationChange: function (e) {
|
||||
var me = this,
|
||||
value = $(e.currentTarget).val();
|
||||
|
||||
_.delay(function () {
|
||||
me.api.change_PageOrient(value === 'true');
|
||||
}, 300);
|
||||
},
|
||||
|
||||
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("de-mobile-settings-unit", value);
|
||||
this.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
|
||||
},
|
||||
|
||||
onPageMarginsChange: function (align, e) {
|
||||
var me = this,
|
||||
$button = $(e.currentTarget),
|
||||
step,
|
||||
txtCm = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.cm),
|
||||
marginValue = null;
|
||||
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.localSectionProps.get_LeftMargin(); break;
|
||||
case 'top': marginValue = me.localSectionProps.get_TopMargin(); break;
|
||||
case 'right': marginValue = me.localSectionProps.get_RightMargin(); break;
|
||||
case 'bottom': marginValue = me.localSectionProps.get_BottomMargin(); break;
|
||||
}
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
marginValue = Math.max(0, marginValue - step);
|
||||
} else {
|
||||
marginValue = Math.min((align == 'left' || align == 'right') ? me.maxMarginsW : me.maxMarginsH, marginValue + step);
|
||||
}
|
||||
|
||||
switch (align) {
|
||||
case 'left': me.localSectionProps.put_LeftMargin(marginValue); break;
|
||||
case 'top': me.localSectionProps.put_TopMargin(marginValue); break;
|
||||
case 'right': me.localSectionProps.put_RightMargin(marginValue); break;
|
||||
case 'bottom': me.localSectionProps.put_BottomMargin(marginValue); break;
|
||||
}
|
||||
|
||||
var valueCurrentMetric = parseFloat(Common.Utils.Metric.fnRecalcFromMM(marginValue).toFixed(2));
|
||||
$(Common.Utils.String.format('#document-margin-{0} .item-after label', align)).text(valueCurrentMetric + ' ' + _metricText);
|
||||
|
||||
me.applyPageMarginsIfNeed()
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiGetDocInfoStart: function () {
|
||||
var me = this;
|
||||
inProgress = true;
|
||||
infoObj = {
|
||||
PageCount : 0,
|
||||
WordsCount : 0,
|
||||
ParagraphCount : 0,
|
||||
SymbolsCount : 0,
|
||||
SymbolsWSCount : 0
|
||||
};
|
||||
|
||||
_.defer(function(){
|
||||
if (!inProgress)
|
||||
return;
|
||||
|
||||
$('#statistic-pages').html(me.txtLoading);
|
||||
$('#statistic-words').html(me.txtLoading);
|
||||
$('#statistic-paragraphs').html(me.txtLoading);
|
||||
$('#statistic-symbols').html(me.txtLoading);
|
||||
$('#statistic-spaces').html(me.txtLoading);
|
||||
});
|
||||
},
|
||||
|
||||
onApiGetDocInfoEnd: function() {
|
||||
inProgress = false;
|
||||
|
||||
$('#statistic-pages').html(infoObj.PageCount);
|
||||
$('#statistic-words').html(infoObj.WordsCount);
|
||||
$('#statistic-paragraphs').html(infoObj.ParagraphCount);
|
||||
$('#statistic-symbols').html(infoObj.SymbolsCount);
|
||||
$('#statistic-spaces').html(infoObj.SymbolsWSCount);
|
||||
},
|
||||
|
||||
onApiDocInfo: function(obj) {
|
||||
if (obj) {
|
||||
if (obj.get_PageCount() > -1)
|
||||
infoObj.PageCount = obj.get_PageCount();
|
||||
if (obj.get_WordsCount() > -1)
|
||||
infoObj.WordsCount = obj.get_WordsCount();
|
||||
if (obj.get_ParagraphCount() > -1)
|
||||
infoObj.ParagraphCount = obj.get_ParagraphCount();
|
||||
if (obj.get_SymbolsCount() > -1)
|
||||
infoObj.SymbolsCount = obj.get_SymbolsCount();
|
||||
if (obj.get_SymbolsWSCount() > -1)
|
||||
infoObj.SymbolsWSCount = obj.get_SymbolsWSCount();
|
||||
}
|
||||
},
|
||||
|
||||
onApiDocumentName: function(name) {
|
||||
$('#settings-document-title').html(name ? name : '-');
|
||||
},
|
||||
|
||||
onApiPageSize: function(w, h) {
|
||||
if (!_isPortrait) {
|
||||
var tempW = w; w = h; h = tempW;
|
||||
}
|
||||
|
||||
if (Math.abs(_pageSizesCurrent[0] - w) > 0.1 ||
|
||||
Math.abs(_pageSizesCurrent[1] - h) > 0.1) {
|
||||
_pageSizesCurrent = [w, h];
|
||||
var ind = -1;
|
||||
_.find(_pageSizes, function(size, index) {
|
||||
if (Math.abs(size.value[0] - w) < 0.1 && Math.abs(size.value[1] - h) < 0.1) {
|
||||
_pageSizesIndex = index;
|
||||
ind = index;
|
||||
}
|
||||
}, this);
|
||||
if (ind === -1) {
|
||||
_pageSizesIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
this.initPageDocumentSettings();
|
||||
},
|
||||
|
||||
onApiPageOrient: function(isPortrait) {
|
||||
_isPortrait = isPortrait;
|
||||
},
|
||||
|
||||
unknownText: 'Unknown',
|
||||
txtLoading : 'Loading...',
|
||||
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?',
|
||||
warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?',
|
||||
textCustomSize : 'Custom Size'
|
||||
}
|
||||
})(), DE.Controllers.Settings || {}))
|
||||
});
|
|
@ -1,215 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 9/23/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'documenteditor/mobile/app/view/Toolbar'
|
||||
], function (core, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() {
|
||||
// private
|
||||
var stateDisplayMode = 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_onCanUndo', _.bind(this.onApiCanRevert, this, 'undo'));
|
||||
this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo'));
|
||||
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, 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));
|
||||
},
|
||||
|
||||
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.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.Undo();
|
||||
},
|
||||
|
||||
onRedo: function (e) {
|
||||
if (this.api)
|
||||
this.api.Redo();
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiCanRevert: function(which, can) {
|
||||
if (this.isDisconnected) return;
|
||||
|
||||
if (which == 'undo') {
|
||||
$('#toolbar-undo').toggleClass('disabled', !can);
|
||||
} else {
|
||||
$('#toolbar-redo').toggleClass('disabled', !can);
|
||||
}
|
||||
},
|
||||
|
||||
setDisplayMode: function(displayMode) {
|
||||
stateDisplayMode = displayMode == "final" || displayMode == "original" ? true : false;
|
||||
var selected = this.api.getSelectedElements();
|
||||
this.onApiFocusObject(selected);
|
||||
},
|
||||
|
||||
onApiFocusObject: function (objects) {
|
||||
if (this.isDisconnected) return;
|
||||
|
||||
if (objects.length > 0) {
|
||||
var topObject = _.find(objects.reverse(), function (obj) {
|
||||
return obj.get_ObjectType() != Asc.c_oAscTypeSelectElement.SpellCheck;
|
||||
}),
|
||||
topObjectValue = topObject.get_ObjectValue(),
|
||||
objectLocked = _.isFunction(topObjectValue.get_Locked) ? topObjectValue.get_Locked() : false;
|
||||
|
||||
$('#toolbar-add, #toolbar-edit').toggleClass('disabled', objectLocked || stateDisplayMode);
|
||||
}
|
||||
},
|
||||
|
||||
activateControls: function() {
|
||||
$('#toolbar-edit, #toolbar-add, #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);
|
||||
DE.getController('AddContainer').hideModal();
|
||||
DE.getController('EditContainer').hideModal();
|
||||
DE.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'
|
||||
}
|
||||
})(), DE.Controllers.Toolbar || {}))
|
||||
});
|
|
@ -1,265 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/14/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core'
|
||||
], function (core) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.AddContainer = Backbone.Controller.extend(_.extend((function() {
|
||||
// private
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [],
|
||||
|
||||
initialize: function() {
|
||||
//
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
this.api = api;
|
||||
},
|
||||
|
||||
onLaunch: function() {
|
||||
//
|
||||
},
|
||||
|
||||
showModal: function() {
|
||||
var me = this;
|
||||
|
||||
if ($$('.container-add.modal-in').length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
uiApp.closeModal();
|
||||
|
||||
me._showByStack(Common.SharedSettings.get('phone'));
|
||||
uiApp.showTab('#add-other');
|
||||
|
||||
DE.getController('Toolbar').getView('Toolbar').hideSearch();
|
||||
},
|
||||
|
||||
hideModal: function () {
|
||||
if (this.picker) {
|
||||
uiApp.closeModal(this.picker);
|
||||
}
|
||||
},
|
||||
|
||||
_layoutEditorsByStack: function () {
|
||||
var me = this,
|
||||
addViews = [];
|
||||
|
||||
addViews.push({
|
||||
caption: me.textTable,
|
||||
id: 'add-table',
|
||||
icon: 'icon-add-table',
|
||||
layout: DE.getController('AddTable')
|
||||
.getView('AddTable')
|
||||
.rootLayout()
|
||||
});
|
||||
|
||||
addViews.push({
|
||||
caption: me.textShape,
|
||||
id: 'add-shape',
|
||||
icon: 'icon-add-shape',
|
||||
layout: DE.getController('AddShape')
|
||||
.getView('AddShape')
|
||||
.rootLayout()
|
||||
});
|
||||
|
||||
addViews.push({
|
||||
caption: me.textImage,
|
||||
id: 'add-image',
|
||||
icon: 'icon-add-image',
|
||||
layout: DE.getController('AddImage')
|
||||
.getView('AddImage')
|
||||
.rootLayout()
|
||||
});
|
||||
|
||||
addViews.push({
|
||||
caption: me.textOther,
|
||||
id: 'add-other',
|
||||
icon: 'icon-add-other',
|
||||
layout: DE.getController('AddOther')
|
||||
.getView('AddOther')
|
||||
.rootLayout()
|
||||
});
|
||||
|
||||
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 (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 $layoutPages = $(
|
||||
'<div class="pages">' +
|
||||
'<div class="page" data-page="index">' +
|
||||
'<div class="page-content tabs">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
_.each(layoutAdds, function (addView, index) {
|
||||
$layoutPages.find('.tabs').append(
|
||||
'<div id="' + addView.id + '" class="tab view ' + (index < 1 ? 'active' : '') + '">' +
|
||||
'<div class="pages">' +
|
||||
'<div class="page no-navbar">' +
|
||||
'<div class="page-content">' +
|
||||
addView.layout +
|
||||
'</div>' +
|
||||
'</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>',
|
||||
$$('#toolbar-add')
|
||||
);
|
||||
|
||||
// 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');
|
||||
},
|
||||
|
||||
textTable: 'Table',
|
||||
textShape: 'Shape',
|
||||
textImage: 'Image',
|
||||
textOther: 'Other'
|
||||
}
|
||||
})(), DE.Controllers.AddContainer || {}))
|
||||
});
|
|
@ -1,130 +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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* AddImage.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/18/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/add/AddImage',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.AddImage = Backbone.Controller.extend(_.extend((function() {
|
||||
//
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [
|
||||
'AddImage'
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
|
||||
|
||||
this.addListeners({
|
||||
'AddImage': {
|
||||
'page:show' : this.onPageShow
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
this.api = api;
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('AddImage').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
$('#add-image-file').single('click', _.bind(me.onInsertByFile, me));
|
||||
},
|
||||
|
||||
onPageShow: function () {
|
||||
var me = this;
|
||||
|
||||
$('#addimage-insert a').single('click', _.buffered(me.onInsertByUrl, 100, me));
|
||||
$('#addimage-url input[type=url]').single('input', _.bind(me.onUrlChange, me));
|
||||
|
||||
_.delay(function () {
|
||||
$('#addimage-link-url input[type=url]').focus();
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onInsertByFile: function (e) {
|
||||
DE.getController('AddContainer').hideModal();
|
||||
},
|
||||
|
||||
onUrlChange: function (e) {
|
||||
$('#addimage-insert').toggleClass('disabled', _.isEmpty($(e.currentTarget).val()));
|
||||
},
|
||||
|
||||
onInsertByUrl: function (e) {
|
||||
var me = this,
|
||||
$input = $('#addimage-link-url input[type=url]');
|
||||
|
||||
if ($input) {
|
||||
var value = ($input.val()).replace(/ /g, '');
|
||||
|
||||
if (!_.isEmpty(value)) {
|
||||
if ((/((^https?)|(^ftp)):\/\/.+/i.test(value))) {
|
||||
DE.getController('AddContainer').hideModal();
|
||||
} else {
|
||||
uiApp.alert(me.txtNotUrl);
|
||||
}
|
||||
} else {
|
||||
uiApp.alert(me.textEmptyImgUrl);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
textEmptyImgUrl : 'You need to specify image URL.',
|
||||
txtNotUrl : 'This field should be a URL in the format \"http://www.example.com\"'
|
||||
}
|
||||
})(), DE.Controllers.AddImage || {}))
|
||||
});
|
|
@ -1,474 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/17/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/add/AddOther',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.AddOther = Backbone.Controller.extend(_.extend((function() {
|
||||
var c_pageNumPosition = {
|
||||
PAGE_NUM_POSITION_TOP: 0x01,
|
||||
PAGE_NUM_POSITION_BOTTOM: 0x02,
|
||||
PAGE_NUM_POSITION_RIGHT: 0,
|
||||
PAGE_NUM_POSITION_LEFT: 1,
|
||||
PAGE_NUM_POSITION_CENTER: 2
|
||||
};
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [
|
||||
'AddOther'
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
|
||||
|
||||
this.addListeners({
|
||||
'AddOther': {
|
||||
'page:show' : this.onPageShow
|
||||
}
|
||||
});
|
||||
this.toCustomFormat;
|
||||
this.fromCustomFormat;
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
var me = this;
|
||||
me.api = api;
|
||||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
this.view = this.getView('AddOther');
|
||||
this.view.canViewComments = mode.canViewComments;
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('AddOther').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
this.setDisableMenuItem();
|
||||
},
|
||||
|
||||
setDisableMenuItem: function() {
|
||||
var isDisableComment = true,
|
||||
isDisableBreak = false,
|
||||
isDisableFootnote = false;
|
||||
var stack = this.api.getSelectedElements();
|
||||
var isText = false,
|
||||
isTable = false,
|
||||
isImage = false,
|
||||
isChart = false,
|
||||
isShape = false,
|
||||
isLink = false,
|
||||
lockedText = false,
|
||||
lockedTable = false,
|
||||
lockedImage = false,
|
||||
lockedHeader = false;
|
||||
_.each(stack, function (item) {
|
||||
var objectType = item.get_ObjectType(),
|
||||
objectValue = item.get_ObjectValue();
|
||||
if (objectType == Asc.c_oAscTypeSelectElement.Header) {
|
||||
lockedHeader = objectValue.get_Locked();
|
||||
}
|
||||
if (objectType == Asc.c_oAscTypeSelectElement.Paragraph) {
|
||||
isText = true;
|
||||
lockedText = objectValue.get_Locked();
|
||||
} else if (objectType == Asc.c_oAscTypeSelectElement.Image) {
|
||||
lockedImage = objectValue.get_Locked();
|
||||
if (objectValue && objectValue.get_ChartProperties()) {
|
||||
isChart = true;
|
||||
} else if (objectType && objectValue.get_ShapeProperties()) {
|
||||
isShape = true;
|
||||
} else {
|
||||
isImage = true;
|
||||
}
|
||||
} else if (objectType == Asc.c_oAscTypeSelectElement.Table) {
|
||||
isTable = true;
|
||||
lockedTable = objectValue.get_Locked();
|
||||
} else if (objectType == Asc.c_oAscTypeSelectElement.Hyperlink) {
|
||||
isLink = true;
|
||||
}
|
||||
});
|
||||
if (stack.length > 0) {
|
||||
var isObject = isShape || isChart || isImage || isTable;
|
||||
isDisableComment = (this.api.can_AddQuotedComment() === false || lockedText || lockedTable || lockedImage || lockedHeader || (!isText && isObject));
|
||||
if (isShape && isText) {
|
||||
isDisableBreak = isDisableFootnote = true;
|
||||
}
|
||||
}
|
||||
this.view.isDisableComment = isDisableComment;
|
||||
this.view.isDisableBreak = isDisableBreak;
|
||||
this.view.isDisableFootnote = isDisableFootnote;
|
||||
},
|
||||
|
||||
onPageShow: function (view, pageId) {
|
||||
var me = this;
|
||||
|
||||
$('.page[data-page=addother-sectionbreak] li a').single('click', _.buffered(me.onInsertSectionBreak, 100, me));
|
||||
$('.page[data-page=addother-pagenumber] li a').single('click', _.buffered(me.onInsertPageNumber, 100, me));
|
||||
$('#add-link-insert').single('click', _.buffered(me.onInsertLink, 100, me));
|
||||
|
||||
|
||||
if (pageId == '#addother-link') {
|
||||
if ($('#addother-link-view')) {
|
||||
_.defer(function () {
|
||||
var text = me.api.can_AddHyperlink();
|
||||
$('#add-link-display input').val(_.isString(text) ? text : '');
|
||||
});
|
||||
}
|
||||
} else if (pageId == '#addother-insert-footnote') {
|
||||
me.initInsertFootnote();
|
||||
} else if (pageId === "#addother-insert-comment") {
|
||||
me.initInsertComment(false);
|
||||
} else if (pageId === "#addother-insert-break") {
|
||||
$('#add-other-pagebreak').single('click', _.bind(me.onPageBreak, me));
|
||||
$('#add-other-columnbreak').single('click', _.bind(me.onColumnBreak, me));
|
||||
}
|
||||
},
|
||||
|
||||
// Handlers
|
||||
initInsertComment: function (documentFlag) {
|
||||
var comment = DE.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 () {
|
||||
DE.getController('AddContainer').rootView.router.back();
|
||||
}
|
||||
}]
|
||||
})
|
||||
} else {
|
||||
DE.getController('AddContainer').rootView.router.back();
|
||||
}
|
||||
}, this));
|
||||
}
|
||||
},
|
||||
|
||||
onDoneComment: function(documentFlag) {
|
||||
var value = $('#comment-text').val().trim();
|
||||
if (value.length > 0) {
|
||||
DE.getController('Common.Controllers.Collaboration').onAddNewComment(value, documentFlag);
|
||||
DE.getController('AddContainer').hideModal();
|
||||
}
|
||||
},
|
||||
|
||||
initInsertFootnote: function () {
|
||||
var me = this,
|
||||
dataFormatFootnote = [
|
||||
{ text: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal },
|
||||
{ text: 'a, b, c,...', value: Asc.c_oAscNumberingFormat.LowerLetter },
|
||||
{ text: 'A, B, C,...', value: Asc.c_oAscNumberingFormat.UpperLetter },
|
||||
{ text: 'i, ii, iii,...', value: Asc.c_oAscNumberingFormat.LowerRoman },
|
||||
{ text: 'I, II, III,...', value: Asc.c_oAscNumberingFormat.UpperRoman }
|
||||
],
|
||||
dataPosFootnote = [
|
||||
{value: Asc.c_oAscFootnotePos.PageBottom, displayValue: this.textBottomOfPage },
|
||||
{value: Asc.c_oAscFootnotePos.BeneathText, displayValue: this.textBelowText }
|
||||
],
|
||||
props = me.api.asc_GetFootnoteProps(),
|
||||
propsFormat = props.get_NumFormat(),
|
||||
propsPos = props.get_Pos();
|
||||
|
||||
me.onFormatFootnoteChange(propsFormat);
|
||||
|
||||
var view = me.getView('AddOther');
|
||||
view.renderNumFormat(dataFormatFootnote, propsFormat);
|
||||
view.renderFootnotePos(dataPosFootnote, propsPos);
|
||||
|
||||
$('#start-at-footnote .button').single('click', _.bind(me.onStartAt, me));
|
||||
$('.page[data-page=addother-insert-footnote] input:radio[name=doc-footnote-format]').single('change', _.bind(me.onFormatFootnoteChange, me));
|
||||
$('#footnote-insert').single('click', _.bind(this.onClickInsertFootnote, this));
|
||||
},
|
||||
|
||||
onClickInsertFootnote: function() {
|
||||
DE.getController('AddContainer').hideModal();
|
||||
},
|
||||
|
||||
onFormatFootnoteChange: function(e) {
|
||||
var me = this;
|
||||
var value = e.currentTarget ? $(e.currentTarget).data('value') : e;
|
||||
var startAt = $('#start-at-footnote .item-after label'),
|
||||
currValue;
|
||||
if(e.currentTarget) {
|
||||
currValue = me.fromCustomFormat(startAt.text());
|
||||
} else {
|
||||
currValue = me.api.asc_GetFootnoteProps().get_NumStart();
|
||||
}
|
||||
switch (value) {
|
||||
case Asc.c_oAscNumberingFormat.UpperRoman: // I, II, III, ...
|
||||
me.toCustomFormat = me._10toRome;
|
||||
me.fromCustomFormat = me._Rometo10;
|
||||
break;
|
||||
case Asc.c_oAscNumberingFormat.LowerRoman: // i, ii, iii, ...
|
||||
me.toCustomFormat = function(value) { return me._10toRome(value).toLocaleLowerCase(); };
|
||||
me.fromCustomFormat = function(value) { return me._Rometo10(value.toLocaleUpperCase()); };
|
||||
break;
|
||||
case Asc.c_oAscNumberingFormat.UpperLetter: // A, B, C, ...
|
||||
me.toCustomFormat = me._10toS;
|
||||
me.fromCustomFormat = me._Sto10;
|
||||
break;
|
||||
case Asc.c_oAscNumberingFormat.LowerLetter: // a, b, c, ...
|
||||
me.toCustomFormat = function(value) { return me._10toS(value).toLocaleLowerCase(); };
|
||||
me.fromCustomFormat = function(value) { return me._Sto10(value.toLocaleUpperCase()); };
|
||||
break;
|
||||
default: // 1, 2, 3, ...
|
||||
me.toCustomFormat = function(value) { return value; };
|
||||
me.fromCustomFormat = function(value) { return value; };
|
||||
break;
|
||||
}
|
||||
var newValue = me.toCustomFormat(currValue);
|
||||
startAt.text(newValue);
|
||||
},
|
||||
|
||||
onStartAt: function(e) {
|
||||
var $button = $(e.currentTarget),
|
||||
value = $('#start-at-footnote .item-after label').text(),
|
||||
intValue,
|
||||
step = 1,
|
||||
maxValue = 16383,
|
||||
me = this;
|
||||
if(me.fromCustomFormat) {
|
||||
intValue = parseInt(me.fromCustomFormat(value));
|
||||
} else {
|
||||
intValue = me.api.asc_GetFootnoteProps().get_NumStart();
|
||||
}
|
||||
if ($button.hasClass('decrement')) {
|
||||
intValue = Math.max(1, intValue - step);
|
||||
} else {
|
||||
intValue = Math.min(maxValue, intValue + step);
|
||||
}
|
||||
var newValue = me.toCustomFormat(intValue);
|
||||
$('#start-at-footnote .item-after label').text(newValue);
|
||||
},
|
||||
|
||||
onInsertLink: function (e) {
|
||||
DE.getController('AddContainer').hideModal();
|
||||
},
|
||||
|
||||
onPageBreak: function (e) {
|
||||
this.api && this.api.put_AddPageBreak();
|
||||
DE.getController('AddContainer').hideModal();
|
||||
},
|
||||
|
||||
onColumnBreak: function () {
|
||||
this.api && this.api.put_AddColumnBreak();
|
||||
DE.getController('AddContainer').hideModal();
|
||||
},
|
||||
|
||||
onInsertSectionBreak: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
|
||||
if ($target && this.api) {
|
||||
var type = $target.data('type'),
|
||||
value;
|
||||
|
||||
if ('next' == type) {
|
||||
value = Asc.c_oAscSectionBreakType.NextPage;
|
||||
} else if ('continuous' == type) {
|
||||
value = Asc.c_oAscSectionBreakType.Continuous;
|
||||
} else if ('even' == type) {
|
||||
value = Asc.c_oAscSectionBreakType.EvenPage;
|
||||
} else if ('odd' == type) {
|
||||
value = Asc.c_oAscSectionBreakType.OddPage;
|
||||
}
|
||||
|
||||
this.api.add_SectionBreak(value);
|
||||
}
|
||||
|
||||
DE.getController('AddContainer').hideModal();
|
||||
},
|
||||
|
||||
onInsertPageNumber: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
|
||||
if ($target && this.api) {
|
||||
var value = -1,
|
||||
type = $target.data('type');
|
||||
|
||||
if (2 == type.length) {
|
||||
value = {};
|
||||
|
||||
if (type[0] == 'l') {
|
||||
value.subtype = c_pageNumPosition.PAGE_NUM_POSITION_LEFT;
|
||||
} else if (type[0] == 'c') {
|
||||
value.subtype = c_pageNumPosition.PAGE_NUM_POSITION_CENTER;
|
||||
} else if (type[0] == 'r') {
|
||||
value.subtype = c_pageNumPosition.PAGE_NUM_POSITION_RIGHT;
|
||||
}
|
||||
|
||||
if (type[1] == 't') {
|
||||
value.type = c_pageNumPosition.PAGE_NUM_POSITION_TOP;
|
||||
} else if (type[1] == 'b') {
|
||||
value.type = c_pageNumPosition.PAGE_NUM_POSITION_BOTTOM;
|
||||
}
|
||||
|
||||
this.api.put_PageNum(value.type, value.subtype);
|
||||
} else {
|
||||
this.api.put_PageNum(value);
|
||||
}
|
||||
}
|
||||
|
||||
DE.getController('AddContainer').hideModal();
|
||||
},
|
||||
|
||||
_10toS: function(value) {
|
||||
value = parseInt(value);
|
||||
var n = Math.ceil(value / 26),
|
||||
code = String.fromCharCode((value-1) % 26 + "A".charCodeAt(0)) ,
|
||||
result = '';
|
||||
|
||||
for (var i=0; i<n; i++ ) {
|
||||
result += code;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
_Sto10: function(str) {
|
||||
if ( str.length<1 || (new RegExp('[^' + str.charAt(0) + ']')).test(str) || !/[A-Z]/.test(str)) return 1;
|
||||
|
||||
var n = str.length-1,
|
||||
result = str.charCodeAt(0) - "A".charCodeAt(0) + 1;
|
||||
result += 26*n;
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
_10toRome: function(value) {
|
||||
value = parseInt(value);
|
||||
var result = '',
|
||||
digits = [
|
||||
['M', 1000],
|
||||
['CM', 900],
|
||||
['D', 500],
|
||||
['CD', 400],
|
||||
['C', 100],
|
||||
['XC', 90],
|
||||
['L', 50],
|
||||
['XL', 40],
|
||||
['X', 10],
|
||||
['IX', 9],
|
||||
['V', 5],
|
||||
['IV', 4],
|
||||
['I', 1]
|
||||
];
|
||||
|
||||
var val = digits[0][1],
|
||||
div = Math.floor(value / val),
|
||||
n = 0;
|
||||
|
||||
for (var i=0; i<div; i++)
|
||||
result += digits[n][0];
|
||||
value -= div * val;
|
||||
n++;
|
||||
|
||||
while (value>0) {
|
||||
val = digits[n][1];
|
||||
div = value - val;
|
||||
if (div>=0) {
|
||||
result += digits[n][0];
|
||||
value = div;
|
||||
} else
|
||||
n++;
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
_Rometo10: function(str) {
|
||||
if ( !/[IVXLCDM]/.test(str) || str.length<1 ) return 1;
|
||||
|
||||
var digits = {
|
||||
'I': 1,
|
||||
'V': 5,
|
||||
'X': 10,
|
||||
'L': 50,
|
||||
'C': 100,
|
||||
'D': 500,
|
||||
'M': 1000
|
||||
};
|
||||
|
||||
var n = str.length-1,
|
||||
result = digits[str.charAt(n)],
|
||||
prev = result;
|
||||
|
||||
for (var i=n-1; i>=0; i-- ) {
|
||||
var val = digits[str.charAt(i)];
|
||||
if (val<prev) {
|
||||
if (prev/val>10) return 1;
|
||||
val *= -1;
|
||||
}
|
||||
|
||||
result += val;
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"',
|
||||
textBottomOfPage: 'Bottom Of Page',
|
||||
textBelowText: 'Below Text',
|
||||
textDeleteDraft: 'Do you really want to delete draft?',
|
||||
textCancel: 'Cancel',
|
||||
//textContinue: 'Continue',
|
||||
textDelete: 'Delete'
|
||||
|
||||
}
|
||||
})(), DE.Controllers.AddOther || {}))
|
||||
});
|
|
@ -1,228 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/18/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/add/AddShape',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.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, 300, me));
|
||||
},
|
||||
|
||||
onShapeClick: function (e) {
|
||||
DE.getController('AddContainer').hideModal();
|
||||
},
|
||||
|
||||
// Public
|
||||
|
||||
getStyles: function () {
|
||||
return _styles;
|
||||
}
|
||||
}
|
||||
})(), DE.Controllers.AddShape || {}))
|
||||
});
|
|
@ -1,173 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/17/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/add/AddTable',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.AddTable = Backbone.Controller.extend(_.extend((function() {
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [
|
||||
'AddTable'
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
|
||||
|
||||
this.addListeners({
|
||||
'AddTable': {
|
||||
'view:render' : this.onViewRender
|
||||
}
|
||||
});
|
||||
|
||||
this._styles = [];
|
||||
this._initDefaultStyles = false;
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
var me = this;
|
||||
me.api = api;
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('AddTable').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
$('#add-table li').single('click', _.buffered(this.onStyleClick, 100, this));
|
||||
},
|
||||
|
||||
onViewRender: function () {
|
||||
$('#add-table li').single('click', _.buffered(this.onStyleClick, 100, this));
|
||||
},
|
||||
|
||||
onStyleClick: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
type = $target.data('type');
|
||||
|
||||
if ($('.modal.modal-in').length > 0) {
|
||||
return
|
||||
}
|
||||
|
||||
DE.getController('AddContainer').hideModal();
|
||||
|
||||
if ($target) {
|
||||
var picker;
|
||||
var modal = uiApp.modal({
|
||||
title: me.textTableSize,
|
||||
text: '',
|
||||
afterText:
|
||||
'<div class="content-block">' +
|
||||
'<div class="row no-gutter" style="text-align: center;">' +
|
||||
'<div class="col-50">' + me.textColumns + '</div>' +
|
||||
'<div class="col-50">' + me.textRows + '</div>' +
|
||||
'</div>' +
|
||||
'<div id="picker-table-size"></div>' +
|
||||
'</div>',
|
||||
buttons: [
|
||||
{
|
||||
text: me.textCancel
|
||||
},
|
||||
{
|
||||
text: 'OK',
|
||||
bold: true,
|
||||
onClick: function () {
|
||||
var size = picker.value;
|
||||
|
||||
if (me.api) {
|
||||
me.api.put_Table(parseInt(size[0]), parseInt(size[1]));
|
||||
|
||||
var properties = new Asc.CTableProp();
|
||||
properties.put_TableStyle(type);
|
||||
|
||||
me.api.tblApply(properties);
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
picker = uiApp.picker({
|
||||
container: '#picker-table-size',
|
||||
toolbar: false,
|
||||
rotateEffect: true,
|
||||
value: [3, 3],
|
||||
cols: [{
|
||||
textAlign: 'center',
|
||||
width: '100%',
|
||||
values: [1,2,3,4,5,6,7,8,9,10]
|
||||
}, {
|
||||
textAlign: 'center',
|
||||
width: '100%',
|
||||
values: [1,2,3,4,5,6,7,8,9,10]
|
||||
}]
|
||||
});
|
||||
|
||||
// Vertical align
|
||||
$$(modal).css({
|
||||
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Public
|
||||
|
||||
getStyles: function () {
|
||||
return this._styles;
|
||||
},
|
||||
|
||||
textTableSize: 'Table Size',
|
||||
textColumns: 'Columns',
|
||||
textRows: 'Rows',
|
||||
textCancel: 'Cancel'
|
||||
}
|
||||
})(), DE.Controllers.AddTable || {}))
|
||||
});
|
|
@ -1,583 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 11/7/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/edit/EditChart',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.EditChart = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var _stack = [],
|
||||
_shapeObject = undefined,
|
||||
_metricText = Common.Utils.Metric.getCurrentMetricName(),
|
||||
_borderColor = 'transparent';
|
||||
|
||||
var wrapTypesTransform = (function() {
|
||||
var map = [
|
||||
{ ui:'inline', sdk: Asc.c_oAscWrapStyle2.Inline },
|
||||
{ ui:'square', sdk: Asc.c_oAscWrapStyle2.Square },
|
||||
{ ui:'tight', sdk: Asc.c_oAscWrapStyle2.Tight },
|
||||
{ ui:'through', sdk: Asc.c_oAscWrapStyle2.Through },
|
||||
{ ui:'top-bottom', sdk: Asc.c_oAscWrapStyle2.TopAndBottom },
|
||||
{ ui:'behind', sdk: Asc.c_oAscWrapStyle2.Behind },
|
||||
{ ui:'infront', sdk: Asc.c_oAscWrapStyle2.InFront }
|
||||
];
|
||||
|
||||
return {
|
||||
sdkToUi: function(type) {
|
||||
var record = map.filter(function(obj) {
|
||||
return obj.sdk === type;
|
||||
})[0];
|
||||
return record ? record.ui : '';
|
||||
},
|
||||
|
||||
uiToSdk: function(type) {
|
||||
var record = map.filter(function(obj) {
|
||||
return obj.ui === type;
|
||||
})[0];
|
||||
return record ? record.sdk : 0;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
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: [
|
||||
'EditChart'
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
|
||||
|
||||
this.addListeners({
|
||||
'EditChart': {
|
||||
'page:show': this.onPageShow
|
||||
}
|
||||
});
|
||||
|
||||
this._chartObject = undefined;
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
var me = this;
|
||||
me.api = api;
|
||||
|
||||
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onApiFocusObject, me));
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('EditChart').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#chart-remove').single('click', _.bind(me.onRemoveChart, me));
|
||||
|
||||
me.initSettings();
|
||||
},
|
||||
|
||||
onPageShow: function (view, pageId) {
|
||||
var me = this;
|
||||
|
||||
$('.chart-reorder a').single('click', _.bind(me.onReorder, me));
|
||||
$('.chart-replace li').single('click', _.buffered(me.onReplace, 100, me));
|
||||
$('.chart-wrap .chart-wrap-types li').single('click', _.buffered(me.onWrapType, 100, me));
|
||||
$('.chart-wrap .align a').single('click', _.bind(me.onAlign, me));
|
||||
$('#edit-chart-movetext input').single('change', _.bind(me.onMoveText, me));
|
||||
$('#edit-chart-overlap input').single('change', _.bind(me.onOverlap, me));
|
||||
$('.chart-wrap .distance input').single('change touchend', _.buffered(me.onWrapDistance, 100, me));
|
||||
$('.chart-wrap .distance input').single('input', _.bind(me.onWrapDistanceChanging, me));
|
||||
|
||||
$('#edit-chart-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me));
|
||||
$('#edit-chart-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me));
|
||||
|
||||
$('#tab-chart-type li').single('click', _.buffered(me.onType, 100, me));
|
||||
|
||||
me.initSettings(pageId);
|
||||
},
|
||||
|
||||
initSettings: function (pageId) {
|
||||
var me = this;
|
||||
_metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric());
|
||||
if (me._chartObject) {
|
||||
if (pageId == '#edit-chart-wrap') {
|
||||
me._initWrapView();
|
||||
} else if (pageId == '#edit-chart-style') {
|
||||
me._updateChartStyles(me.api.asc_getChartPreviews(me._chartObject.get_ChartProperties().getType()));
|
||||
me._initStyleView();
|
||||
} else if (pageId == '#edit-chart-border-color-view') {
|
||||
me._initStyleView();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_initWrapView: function() {
|
||||
// Wrap type
|
||||
var me = this,
|
||||
wrapping = me._chartObject.get_WrappingStyle(),
|
||||
$chartWrapInput = $('.chart-wrap input'),
|
||||
chartWrapType = wrapTypesTransform.sdkToUi(wrapping);
|
||||
|
||||
$chartWrapInput.val([chartWrapType]);
|
||||
me._uiTransformByWrap(chartWrapType);
|
||||
|
||||
// Wrap align
|
||||
var chartHAlign = me._chartObject.get_PositionH().get_Align();
|
||||
|
||||
$('.chart-wrap .align a[data-type=left]').toggleClass('active', chartHAlign == Asc.c_oAscAlignH.Left);
|
||||
$('.chart-wrap .align a[data-type=center]').toggleClass('active', chartHAlign == Asc.c_oAscAlignH.Center);
|
||||
$('.chart-wrap .align a[data-type=right]').toggleClass('active', chartHAlign == Asc.c_oAscAlignH.Right);
|
||||
|
||||
|
||||
// Wrap flags
|
||||
$('#edit-chart-movetext input').prop('checked', me._chartObject.get_PositionV().get_RelativeFrom() == Asc.c_oAscRelativeFromV.Paragraph);
|
||||
$('#edit-chart-overlap input').prop('checked', me._chartObject.get_AllowOverlap());
|
||||
|
||||
// Wrap distance
|
||||
var paddings = me._chartObject.get_Paddings();
|
||||
if (paddings) {
|
||||
var distance = Common.Utils.Metric.fnRecalcFromMM(paddings.get_Top());
|
||||
$('.chart-wrap .distance input').val(distance);
|
||||
$('.chart-wrap .distance .item-after').text(distance + ' ' + _metricText);
|
||||
}
|
||||
},
|
||||
|
||||
_initStyleView: function (updateStyles) {
|
||||
var me = this,
|
||||
chartProperties = me._chartObject.get_ChartProperties(),
|
||||
shapeProperties = _shapeObject.get_ShapeProperties(),
|
||||
paletteFillColor = me.getView('EditChart').paletteFillColor,
|
||||
paletteBorderColor = me.getView('EditChart').paletteBorderColor;
|
||||
|
||||
|
||||
// Style
|
||||
|
||||
var type = chartProperties.getType();
|
||||
$('.chart-types li').removeClass('active');
|
||||
$('.chart-types li[data-type=' + type + ']').addClass('active');
|
||||
|
||||
// Init style border size
|
||||
var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4;
|
||||
var borderType = shapeProperties.get_stroke().get_type();
|
||||
$('#edit-chart-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]);
|
||||
$('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||
|
||||
paletteFillColor && paletteFillColor.on('select', _.bind(me.onFillColor, me));
|
||||
paletteBorderColor && paletteBorderColor.on('select', _.bind(me.onBorderColor, me));
|
||||
|
||||
var sdkColor, color;
|
||||
|
||||
// Init fill color
|
||||
var fill = shapeProperties.get_fill(),
|
||||
fillType = fill.get_type();
|
||||
|
||||
color = 'transparent';
|
||||
|
||||
if (fillType == Asc.c_oAscFill.FILL_TYPE_SOLID) {
|
||||
fill = fill.get_fill();
|
||||
sdkColor = fill.get_color();
|
||||
|
||||
if (sdkColor) {
|
||||
if (sdkColor.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
color = {color: Common.Utils.ThemeColor.getHexColor(sdkColor.get_r(), sdkColor.get_g(), sdkColor.get_b()), effectValue: sdkColor.get_value()};
|
||||
} else {
|
||||
color = Common.Utils.ThemeColor.getHexColor(sdkColor.get_r(), sdkColor.get_g(), sdkColor.get_b());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
paletteFillColor && paletteFillColor.select(color);
|
||||
|
||||
// Init border color
|
||||
me._initBorderColorView();
|
||||
},
|
||||
|
||||
_initBorderColorView: function () {
|
||||
if (!_shapeObject) return;
|
||||
|
||||
var me = this,
|
||||
paletteBorderColor = me.getView('EditChart').paletteBorderColor,
|
||||
stroke = _shapeObject.get_ShapeProperties().get_stroke();
|
||||
|
||||
var color = 'transparent';
|
||||
|
||||
if (stroke && stroke.get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
|
||||
var sdkColor = stroke.get_color();
|
||||
|
||||
if (sdkColor) {
|
||||
if (sdkColor.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
color = {color: Common.Utils.ThemeColor.getHexColor(sdkColor.get_r(), sdkColor.get_g(), sdkColor.get_b()), effectValue: sdkColor.get_value()};
|
||||
}
|
||||
else {
|
||||
color = Common.Utils.ThemeColor.getHexColor(sdkColor.get_r(), sdkColor.get_g(), sdkColor.get_b());
|
||||
}
|
||||
}
|
||||
}
|
||||
_borderColor = color;
|
||||
|
||||
paletteBorderColor && paletteBorderColor.select(color);
|
||||
$('#edit-chart-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)))
|
||||
},
|
||||
|
||||
// Public
|
||||
|
||||
getChart: function () {
|
||||
return this._chartObject;
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onType: function (e) {
|
||||
},
|
||||
|
||||
onStyle: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
type = $target.data('type');
|
||||
|
||||
var image = new Asc.asc_CImgProperty(),
|
||||
chart = me._chartObject.get_ChartProperties();
|
||||
|
||||
chart.putStyle(type);
|
||||
image.put_ChartProperties(chart);
|
||||
|
||||
me.api.ImgApply(image);
|
||||
},
|
||||
|
||||
onRemoveChart: function () {
|
||||
this.api.asc_Remove();
|
||||
DE.getController('EditContainer').hideModal();
|
||||
},
|
||||
|
||||
onReorder: function (e) {
|
||||
var $target = $(e.currentTarget),
|
||||
type = $target.data('type');
|
||||
|
||||
var properties = new Asc.asc_CImgProperty();
|
||||
|
||||
if ('all-up' == type) {
|
||||
properties.put_ChangeLevel(Asc.c_oAscChangeLevel.BringToFront);
|
||||
} else if ('all-down' == type) {
|
||||
properties.put_ChangeLevel(Asc.c_oAscChangeLevel.SendToBack);
|
||||
} else if ('move-up' == type) {
|
||||
properties.put_ChangeLevel(Asc.c_oAscChangeLevel.BringForward);
|
||||
} else if ('move-down' == type) {
|
||||
properties.put_ChangeLevel(Asc.c_oAscChangeLevel.BringBackward);
|
||||
}
|
||||
|
||||
this.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onWrapType: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget).find('input'),
|
||||
value = $target.val(),
|
||||
properties = new Asc.asc_CImgProperty();
|
||||
|
||||
me._uiTransformByWrap(value);
|
||||
|
||||
var sdkType = wrapTypesTransform.uiToSdk(value);
|
||||
|
||||
properties.put_WrappingStyle(sdkType);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onAlign: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
type = $target.data('type');
|
||||
|
||||
$('.chart-wrap .align a').removeClass('active');
|
||||
$target.addClass('active');
|
||||
|
||||
var hAlign = Asc.c_oAscAlignH.Left;
|
||||
|
||||
if ('center' == type) {
|
||||
hAlign = Asc.c_oAscAlignH.Center;
|
||||
} else if ('right' == type) {
|
||||
hAlign = Asc.c_oAscAlignH.Right;
|
||||
}
|
||||
|
||||
var properties = new Asc.asc_CImgProperty();
|
||||
properties.put_PositionH(new Asc.CImagePositionH());
|
||||
properties.get_PositionH().put_UseAlign(true);
|
||||
properties.get_PositionH().put_Align(hAlign);
|
||||
properties.get_PositionH().put_RelativeFrom(Asc.c_oAscRelativeFromH.Page);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onMoveText: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
properties = new Asc.asc_CImgProperty();
|
||||
|
||||
properties.put_PositionV(new Asc.CImagePositionV());
|
||||
properties.get_PositionV().put_UseAlign(true);
|
||||
properties.get_PositionV().put_RelativeFrom($target.is(':checked') ? Asc.c_oAscRelativeFromV.Paragraph : Asc.c_oAscRelativeFromV.Page);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onOverlap: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
properties = new Asc.asc_CImgProperty();
|
||||
|
||||
properties.put_AllowOverlap($target.is(':checked'));
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onWrapDistance: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
value = $target.val(),
|
||||
properties = new Asc.asc_CImgProperty(),
|
||||
paddings = new Asc.asc_CPaddings();
|
||||
|
||||
|
||||
$('.chart-wrap .distance .item-after').text(value + ' ' + _metricText);
|
||||
|
||||
value = Common.Utils.Metric.fnRecalcToMM(parseInt(value));
|
||||
|
||||
paddings.put_Top(value);
|
||||
paddings.put_Right(value);
|
||||
paddings.put_Bottom(value);
|
||||
paddings.put_Left(value);
|
||||
|
||||
properties.put_Paddings(paddings);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onWrapDistanceChanging: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
$('.chart-wrap .distance .item-after').text($target.val() + ' ' + _metricText);
|
||||
},
|
||||
|
||||
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 (_borderColor == 'transparent')
|
||||
stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
|
||||
else
|
||||
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(_borderColor)));
|
||||
stroke.put_width(value * 25.4 / 72.0);
|
||||
}
|
||||
|
||||
shape.put_stroke(stroke);
|
||||
image.put_ShapeProperties(shape);
|
||||
|
||||
me.api.ImgApply(image);
|
||||
me._initBorderColorView(); // when select STROKE_NONE or change from STROKE_NONE to STROKE_COLOR
|
||||
},
|
||||
|
||||
onBorderSizeChanging: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
$('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||
},
|
||||
|
||||
onFillColor: function(palette, color) {
|
||||
var me = this;
|
||||
|
||||
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.put_fill(fill);
|
||||
image.put_ShapeProperties(shape);
|
||||
|
||||
me.api.ImgApply(image);
|
||||
}
|
||||
},
|
||||
|
||||
onBorderColor: function (palette, color) {
|
||||
var me = this,
|
||||
currentShape = _shapeObject.get_ShapeProperties();
|
||||
|
||||
$('#edit-chart-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)));
|
||||
_borderColor = color;
|
||||
|
||||
if (me.api && currentShape && 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.put_ShapeProperties(shape);
|
||||
|
||||
me.api.ImgApply(image);
|
||||
}
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiFocusObject: function (objects) {
|
||||
_stack = objects;
|
||||
|
||||
var charts = [],
|
||||
shapes = [];
|
||||
|
||||
_.each(_stack, function (object) {
|
||||
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Image) {
|
||||
if (object.get_ObjectValue() && object.get_ObjectValue().get_ChartProperties()) {
|
||||
charts.push(object);
|
||||
}
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
this._chartObject = getTopObject(charts);
|
||||
_shapeObject = getTopObject(shapes);
|
||||
},
|
||||
|
||||
// Helpers
|
||||
|
||||
_updateChartStyles: function(styles) {
|
||||
},
|
||||
|
||||
_uiTransformByWrap: function(type) {
|
||||
$('.chart-wrap .align')[('inline' == type) ? 'hide' : 'show']();
|
||||
$('.chart-wrap .distance')[('behind' == type || 'infront' == type) ? 'hide' : 'show']();
|
||||
$('#edit-chart-movetext').toggleClass('disabled', ('inline' == type));
|
||||
},
|
||||
|
||||
_closeIfNeed: function () {
|
||||
if (!this._isChartInStack()) {
|
||||
DE.getController('EditContainer').hideModal();
|
||||
}
|
||||
},
|
||||
|
||||
_isChartInStack: function () {
|
||||
var chartExist = false;
|
||||
|
||||
_.some(_stack, function(object) {
|
||||
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Image) {
|
||||
if (object.get_ObjectValue() && object.get_ObjectValue().get_ChartProperties()) {
|
||||
chartExist = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return chartExist;
|
||||
}
|
||||
};
|
||||
})(), DE.Controllers.EditChart || {}))
|
||||
});
|
|
@ -1,403 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 9/27/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
define([
|
||||
'core',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.EditContainer = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var _settings = [],
|
||||
_headerType = 1,
|
||||
_activeTab;
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [],
|
||||
|
||||
initialize: function() {
|
||||
//
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
|
||||
},
|
||||
|
||||
onLaunch: function() {
|
||||
//
|
||||
},
|
||||
|
||||
showModal: function() {
|
||||
var me = this,
|
||||
mainView = DE.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'));
|
||||
|
||||
DE.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, 'text')) {
|
||||
editors.push({
|
||||
caption: me.textText,
|
||||
id: 'edit-text',
|
||||
layout: DE.getController('EditText').getView('EditText').rootLayout()
|
||||
})
|
||||
}
|
||||
if (_.contains(_settings, 'paragraph')) {
|
||||
editors.push({
|
||||
caption: me.textParagraph,
|
||||
id: 'edit-paragraph',
|
||||
layout: DE.getController('EditParagraph').getView('EditParagraph').rootLayout()
|
||||
})
|
||||
}
|
||||
if (_.contains(_settings, 'table')) {
|
||||
editors.push({
|
||||
caption: me.textTable,
|
||||
id: 'edit-table',
|
||||
layout: DE.getController('EditTable').getView('EditTable').rootLayout()
|
||||
})
|
||||
}
|
||||
if (_.contains(_settings, 'header')) {
|
||||
editors.push({
|
||||
caption: _headerType==2 ? me.textFooter : me.textHeader,
|
||||
id: 'edit-header',
|
||||
layout: DE.getController('EditHeader').getView('EditHeader').rootLayout()
|
||||
})
|
||||
}
|
||||
if (_.contains(_settings, 'shape')) {
|
||||
editors.push({
|
||||
caption: me.textShape,
|
||||
id: 'edit-shape',
|
||||
layout: DE.getController('EditShape').getView('EditShape').rootLayout()
|
||||
})
|
||||
}
|
||||
if (_.contains(_settings, 'image')) {
|
||||
editors.push({
|
||||
caption: me.textImage,
|
||||
id: 'edit-image',
|
||||
layout: DE.getController('EditImage').getView('EditImage').rootLayout()
|
||||
})
|
||||
}
|
||||
if (_.contains(_settings, 'chart')) {
|
||||
editors.push({
|
||||
caption: me.textChart,
|
||||
id: 'edit-chart',
|
||||
layout: DE.getController('EditChart').getView('EditChart').rootLayout()
|
||||
})
|
||||
}
|
||||
if (_.contains(_settings, 'hyperlink')) {
|
||||
editors.push({
|
||||
caption: me.textHyperlink,
|
||||
id: 'edit-link',
|
||||
layout: DE.getController('EditHyperlink').getView('EditHyperlink').rootLayout()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return editors;
|
||||
},
|
||||
|
||||
_showByStack: function(isPhone) {
|
||||
var me = this,
|
||||
mainView = DE.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();
|
||||
}).on('closed', function () {
|
||||
if (_.isFunction(me.api.asc_OnHideContextMenu)) {
|
||||
me.api.asc_OnHideContextMenu()
|
||||
}
|
||||
});
|
||||
mainView.hideNavbar();
|
||||
} 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');
|
||||
|
||||
if (_activeTab === 'edit-link') {
|
||||
uiApp.showTab('#' + _activeTab, false);
|
||||
}
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiFocusObject: function (objects) {
|
||||
_settings = [];
|
||||
_activeTab = undefined;
|
||||
|
||||
// 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');
|
||||
if (_.isUndefined(_activeTab)) {
|
||||
_activeTab = 'edit-link';
|
||||
}
|
||||
} else if (Asc.c_oAscTypeSelectElement.Header == type) {
|
||||
_settings.push('header');
|
||||
_headerType = object.get_ObjectValue().get_Type();
|
||||
}
|
||||
});
|
||||
|
||||
// Exclude shapes if chart exist
|
||||
if (_settings.indexOf('chart') > -1) {
|
||||
_settings = _.without(_settings, 'shape');
|
||||
}
|
||||
|
||||
_settings = _.uniq(_settings);
|
||||
},
|
||||
|
||||
textSettings: 'Settings',
|
||||
textText: 'Text',
|
||||
textParagraph: 'Paragraph',
|
||||
textTable: 'Table',
|
||||
textShape: 'Shape',
|
||||
textImage: 'Image',
|
||||
textChart: 'Chart',
|
||||
textHyperlink: 'Hyperlink',
|
||||
textHeader: 'Header',
|
||||
textFooter: 'Footer'
|
||||
}
|
||||
})(), DE.Controllers.EditContainer || {}))
|
||||
});
|
|
@ -1,194 +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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* EditHeader.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Julia Radzhabova on 2/15/19
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/edit/EditHeader',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.EditHeader = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var _stack = [],
|
||||
_headerObject = undefined,
|
||||
_startAt = 1;
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [
|
||||
'EditHeader'
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
|
||||
Common.NotificationCenter.on('editcategory:show', _.bind(this.categoryShow, this));
|
||||
|
||||
this.addListeners({
|
||||
'EditHeader': {
|
||||
'page:show' : this.onPageShow
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
var me = this;
|
||||
me.api = api;
|
||||
|
||||
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onApiFocusObject, me));
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('EditHeader').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#header-diff-first input:checkbox').single('change', _.bind(me.onDiffFirst, me));
|
||||
$('#header-diff-odd input:checkbox').single('change', _.bind(me.onDiffOdd, me));
|
||||
$('#header-same-as input:checkbox').single('change', _.bind(me.onSameAs, me));
|
||||
$('#header-numbering-continue input:checkbox').single('change', _.bind(me.onNumberingContinue, me));
|
||||
$('#header-numbering-start .button').single('click', _.bind(me.onStartAt, me));
|
||||
|
||||
me.initSettings();
|
||||
},
|
||||
|
||||
categoryShow: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
|
||||
if ($target && $target.prop('id') === 'edit-header') {
|
||||
this.initSettings();
|
||||
}
|
||||
},
|
||||
|
||||
onPageShow: function () {
|
||||
var me = this;
|
||||
me.initSettings();
|
||||
},
|
||||
|
||||
initSettings: function () {
|
||||
var me = this;
|
||||
|
||||
if (_headerObject) {
|
||||
$('#header-diff-first input:checkbox').prop('checked', _headerObject.get_DifferentFirst());
|
||||
$('#header-diff-odd input:checkbox').prop('checked', _headerObject.get_DifferentEvenOdd());
|
||||
|
||||
var value = _headerObject.get_LinkToPrevious();
|
||||
$('#header-same-as input:checkbox').prop('checked', !!value);
|
||||
$('#header-same-as').toggleClass('disabled', value===null);
|
||||
|
||||
value = _headerObject.get_StartPageNumber();
|
||||
$('#header-numbering-continue input:checkbox').prop('checked', value<0);
|
||||
$('#header-numbering-start').toggleClass('disabled', value<0);
|
||||
if (value>=0)
|
||||
_startAt=value;
|
||||
$('#header-numbering-start .item-after label').text(_startAt);
|
||||
}
|
||||
},
|
||||
|
||||
// Public
|
||||
// Handlers
|
||||
|
||||
onDiffFirst: function (e) {
|
||||
var $checkbox = $(e.currentTarget);
|
||||
this.api.HeadersAndFooters_DifferentFirstPage($checkbox.is(':checked'));
|
||||
},
|
||||
|
||||
onDiffOdd: function (e) {
|
||||
var $checkbox = $(e.currentTarget);
|
||||
this.api.HeadersAndFooters_DifferentOddandEvenPage($checkbox.is(':checked'));
|
||||
},
|
||||
|
||||
onSameAs: function (e) {
|
||||
var $checkbox = $(e.currentTarget);
|
||||
this.api.HeadersAndFooters_LinkToPrevious($checkbox.is(':checked'));
|
||||
},
|
||||
|
||||
onNumberingContinue: function (e) {
|
||||
var $checkbox = $(e.currentTarget);
|
||||
$('#header-numbering-start').toggleClass('disabled', $checkbox.is(':checked'));
|
||||
this.api.asc_SetSectionStartPage($checkbox.is(':checked') ? -1 : _startAt);
|
||||
},
|
||||
|
||||
onStartAt: function (e) {
|
||||
var $button = $(e.currentTarget),
|
||||
start = _startAt;
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
start = Math.max(1, --start);
|
||||
} else {
|
||||
start = Math.min(2147483646, ++start);
|
||||
}
|
||||
_startAt = start;
|
||||
|
||||
$('#header-numbering-start .item-after label').text(start);
|
||||
|
||||
this.api.asc_SetSectionStartPage(start);
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiFocusObject: function (objects) {
|
||||
_stack = objects;
|
||||
|
||||
var headers = [];
|
||||
|
||||
_.each(_stack, function(object) {
|
||||
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Header) {
|
||||
headers.push(object);
|
||||
}
|
||||
});
|
||||
|
||||
if (headers.length > 0) {
|
||||
var object = headers[headers.length - 1]; // get top
|
||||
_headerObject = object.get_ObjectValue();
|
||||
} else {
|
||||
_headerObject = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
})(), DE.Controllers.EditHeader || {}))
|
||||
});
|
|
@ -1,178 +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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* EditLink.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 11/7/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/edit/EditHyperlink'
|
||||
], function (core) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.EditHyperlink = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var _stack = [],
|
||||
_linkObject = undefined;
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [
|
||||
'EditHyperlink'
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
|
||||
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
var me = this;
|
||||
me.api = api;
|
||||
|
||||
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onApiFocusObject, me));
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('EditHyperlink').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#edit-link-edit').single('click', _.bind(me.onEditLink, me));
|
||||
$('#edit-link-remove').single('click', _.bind(me.onRemoveLink, me));
|
||||
|
||||
me.initSettings();
|
||||
},
|
||||
|
||||
initSettings: function () {
|
||||
if (_linkObject) {
|
||||
if (_linkObject.get_Value()) {
|
||||
$('#edit-link-url input').val([_linkObject.get_Value().replace(new RegExp(" ", 'g'), "%20")]);
|
||||
} else {
|
||||
$('#edit-link-url input').val('');
|
||||
}
|
||||
|
||||
if (!_.isNull(_linkObject.get_Text())) {
|
||||
$('#edit-link-display input').val([_linkObject.get_Text()]);
|
||||
}
|
||||
|
||||
$('#edit-link-tip input').val([_linkObject.get_ToolTip()]);
|
||||
|
||||
$('#edit-link-edit').toggleClass('disabled', _.isEmpty($('#edit-link-url input').val()));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// Handlers
|
||||
|
||||
onEditLink: function () {
|
||||
var me = this,
|
||||
url = $('#edit-link-url input').val(),
|
||||
display = $('#edit-link-display input').val(),
|
||||
tip = $('#edit-link-tip input').val(),
|
||||
urltype = me.api.asc_getUrlType($.trim(url)),
|
||||
isEmail = (urltype == 2);
|
||||
|
||||
if (urltype < 1) {
|
||||
uiApp.alert(me.txtNotUrl);
|
||||
return;
|
||||
}
|
||||
|
||||
url = url.replace(/^\s+|\s+$/g,'');
|
||||
|
||||
if (! /(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(url) )
|
||||
url = (isEmail ? 'mailto:' : 'http://' ) + url;
|
||||
|
||||
url = url.replace(new RegExp("%20",'g')," ");
|
||||
|
||||
var props = new Asc.CHyperlinkProperty();
|
||||
props.put_Value(url);
|
||||
props.put_Text(_.isEmpty(display) ? url : display);
|
||||
props.put_ToolTip(tip);
|
||||
if (_linkObject)
|
||||
props.put_InternalHyperlink(_linkObject.get_InternalHyperlink());
|
||||
|
||||
me.api.change_Hyperlink(props);
|
||||
|
||||
DE.getController('EditContainer').hideModal();
|
||||
},
|
||||
|
||||
onRemoveLink: function () {
|
||||
this.api && this.api.remove_Hyperlink(_linkObject);
|
||||
DE.getController('EditContainer').hideModal();
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiFocusObject: function (objects) {
|
||||
_stack = objects;
|
||||
|
||||
var links = [];
|
||||
|
||||
_.each(_stack, function (object) {
|
||||
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Hyperlink) {
|
||||
links.push(object);
|
||||
}
|
||||
});
|
||||
|
||||
if (links.length > 0) {
|
||||
var object = links[links.length - 1]; // get top
|
||||
_linkObject = object.get_ObjectValue();
|
||||
} else {
|
||||
_linkObject = undefined;
|
||||
}
|
||||
},
|
||||
|
||||
// Helpers
|
||||
|
||||
_closeIfNeed: function () {
|
||||
if (!this._isImageInStack()) {
|
||||
DE.getController('EditContainer').hideModal();
|
||||
}
|
||||
},
|
||||
|
||||
textEmptyImgUrl: 'You need to specify image URL.',
|
||||
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"'
|
||||
};
|
||||
})(), DE.Controllers.EditHyperlink || {}))
|
||||
});
|
|
@ -1,406 +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',
|
||||
'documenteditor/mobile/app/view/edit/EditImage',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.EditImage = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var _stack = [],
|
||||
_imageObject = undefined,
|
||||
_metricText = Common.Utils.Metric.getCurrentMetricName();
|
||||
|
||||
var wrapTypesTransform = (function() {
|
||||
var map = [
|
||||
{ ui:'inline', sdk: Asc.c_oAscWrapStyle2.Inline },
|
||||
{ ui:'square', sdk: Asc.c_oAscWrapStyle2.Square },
|
||||
{ ui:'tight', sdk: Asc.c_oAscWrapStyle2.Tight },
|
||||
{ ui:'through', sdk: Asc.c_oAscWrapStyle2.Through },
|
||||
{ ui:'top-bottom', sdk: Asc.c_oAscWrapStyle2.TopAndBottom },
|
||||
{ ui:'behind', sdk: Asc.c_oAscWrapStyle2.Behind },
|
||||
{ ui:'infront', sdk: Asc.c_oAscWrapStyle2.InFront }
|
||||
];
|
||||
|
||||
return {
|
||||
sdkToUi: function(type) {
|
||||
var record = map.filter(function(obj) {
|
||||
return obj.sdk === type;
|
||||
})[0];
|
||||
return record ? record.ui : '';
|
||||
},
|
||||
|
||||
uiToSdk: function(type) {
|
||||
var record = map.filter(function(obj) {
|
||||
return obj.ui === type;
|
||||
})[0];
|
||||
return record ? record.sdk : 0;
|
||||
},
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
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_onFocusObject', _.bind(me.onApiFocusObject, me));
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('EditImage').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#image-default').single('click', _.bind(me.onDefaulSize, me));
|
||||
$('#image-remove').single('click', _.bind(me.onRemoveImage, me));
|
||||
|
||||
me.initSettings();
|
||||
},
|
||||
|
||||
onPageShow: function (view, pageId) {
|
||||
var me = this;
|
||||
|
||||
$('.image-wrap .image-wrap-types li').single('click', _.buffered(me.onWrapType, 100, me));
|
||||
$('.image-wrap .align a').single('click', _.bind(me.onAlign, me));
|
||||
$('#edit-image-movetext input').single('change', _.bind(me.onMoveText, me));
|
||||
$('#edit-image-overlap input').single('change', _.bind(me.onOverlap, me));
|
||||
$('.image-wrap .distance input').single('change touchend', _.buffered(me.onWrapDistance, 100, me));
|
||||
$('.image-wrap .distance input').single('input', _.bind(me.onWrapDistanceChanging, me));
|
||||
|
||||
$('#edit-image-file').single('click', _.bind(me.onReplaceByFile, me));
|
||||
$('.edit-image-url-link .button, .edit-image-url-link .list-button').single('click', _.bind(me.onReplaceByUrl, me));
|
||||
|
||||
$('.image-reorder a').single('click', _.bind(me.onReorder, me));
|
||||
|
||||
me.initSettings(pageId);
|
||||
},
|
||||
|
||||
initSettings: function (pageId) {
|
||||
var me = this;
|
||||
|
||||
_metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric());
|
||||
|
||||
if (_imageObject) {
|
||||
if (pageId == '#edit-image-wrap-view') {
|
||||
me._initWrapView();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_initWrapView: function() {
|
||||
// Wrap type
|
||||
var me = this,
|
||||
wrapping = _imageObject.get_WrappingStyle(),
|
||||
$imageWrapInput = $('.image-wrap input'),
|
||||
imageWrapType = wrapTypesTransform.sdkToUi(wrapping);
|
||||
|
||||
$imageWrapInput.val([imageWrapType]);
|
||||
me._uiTransformByWrap(imageWrapType);
|
||||
|
||||
// Wrap align
|
||||
var imageHAlign = _imageObject.get_PositionH().get_Align();
|
||||
|
||||
$('.image-wrap .align a[data-type=left]').toggleClass('active', imageHAlign == Asc.c_oAscAlignH.Left);
|
||||
$('.image-wrap .align a[data-type=center]').toggleClass('active', imageHAlign == Asc.c_oAscAlignH.Center);
|
||||
$('.image-wrap .align a[data-type=right]').toggleClass('active', imageHAlign == Asc.c_oAscAlignH.Right);
|
||||
|
||||
|
||||
// Wrap flags
|
||||
$('#edit-image-movetext input').prop('checked', _imageObject.get_PositionV().get_RelativeFrom() == Asc.c_oAscRelativeFromV.Paragraph);
|
||||
$('#edit-image-overlap input').prop('checked', _imageObject.get_AllowOverlap());
|
||||
|
||||
// Wrap distance
|
||||
var paddings = _imageObject.get_Paddings();
|
||||
if (paddings) {
|
||||
var distance = Common.Utils.Metric.fnRecalcFromMM(paddings.get_Top());
|
||||
$('.image-wrap .distance input').val(distance);
|
||||
$('.image-wrap .distance .item-after').text(distance + ' ' + _metricText);
|
||||
}
|
||||
},
|
||||
|
||||
// Public
|
||||
|
||||
getImage: function () {
|
||||
return _imageObject;
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onDefaulSize: function () {
|
||||
var me = this;
|
||||
|
||||
if (me.api) {
|
||||
var imgsize = me.api.get_OriginalSizeImage(),
|
||||
properties = new Asc.asc_CImgProperty();
|
||||
|
||||
properties.put_Width(imgsize.get_ImageWidth());
|
||||
properties.put_Height(imgsize.get_ImageHeight());
|
||||
properties.put_ResetCrop(true);
|
||||
me.api.ImgApply(properties);
|
||||
}
|
||||
},
|
||||
|
||||
onRemoveImage: function () {
|
||||
this.api.asc_Remove();
|
||||
DE.getController('EditContainer').hideModal();
|
||||
},
|
||||
|
||||
onWrapType: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget).find('input'),
|
||||
value = $target.val(),
|
||||
properties = new Asc.asc_CImgProperty();
|
||||
|
||||
me._uiTransformByWrap(value);
|
||||
|
||||
var sdkType = wrapTypesTransform.uiToSdk(value);
|
||||
|
||||
properties.put_WrappingStyle(sdkType);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onAlign: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
type = $target.data('type');
|
||||
|
||||
$('.image-wrap .align a').removeClass('active');
|
||||
$target.addClass('active');
|
||||
|
||||
var hAlign = Asc.c_oAscAlignH.Left;
|
||||
|
||||
if ('center' == type) {
|
||||
hAlign = Asc.c_oAscAlignH.Center;
|
||||
} else if ('right' == type) {
|
||||
hAlign = Asc.c_oAscAlignH.Right;
|
||||
}
|
||||
|
||||
var properties = new Asc.asc_CImgProperty();
|
||||
properties.put_PositionH(new Asc.CImagePositionH());
|
||||
properties.get_PositionH().put_UseAlign(true);
|
||||
properties.get_PositionH().put_Align(hAlign);
|
||||
properties.get_PositionH().put_RelativeFrom(Asc.c_oAscRelativeFromH.Page);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onMoveText: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
properties = new Asc.asc_CImgProperty();
|
||||
|
||||
properties.put_PositionV(new Asc.CImagePositionV());
|
||||
properties.get_PositionV().put_UseAlign(true);
|
||||
properties.get_PositionV().put_RelativeFrom($target.is(':checked') ? Asc.c_oAscRelativeFromV.Paragraph : Asc.c_oAscRelativeFromV.Page);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onOverlap: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
properties = new Asc.asc_CImgProperty();
|
||||
|
||||
properties.put_AllowOverlap($target.is(':checked'));
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onWrapDistance: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
value = $target.val(),
|
||||
properties = new Asc.asc_CImgProperty(),
|
||||
paddings = new Asc.asc_CPaddings();
|
||||
|
||||
$('.image-wrap .distance .item-after').text(value + ' ' + _metricText);
|
||||
|
||||
value = Common.Utils.Metric.fnRecalcToMM(parseInt(value));
|
||||
|
||||
paddings.put_Top(value);
|
||||
paddings.put_Right(value);
|
||||
paddings.put_Bottom(value);
|
||||
paddings.put_Left(value);
|
||||
|
||||
properties.put_Paddings(paddings);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onWrapDistanceChanging: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
$('.image-wrap .distance .item-after').text($target.val() + ' ' + _metricText);
|
||||
},
|
||||
|
||||
onReplaceByFile: function () {
|
||||
this.api.ChangeImageFromFile();
|
||||
DE.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))) {
|
||||
DE.getController('EditContainer').hideModal();
|
||||
_.defer(function () {
|
||||
var image = new Asc.asc_CImgProperty();
|
||||
image.put_ImageUrl(value);
|
||||
me.api.ImgApply(image);
|
||||
});
|
||||
} else {
|
||||
uiApp.alert(me.txtNotUrl);
|
||||
}
|
||||
} else {
|
||||
uiApp.alert(me.textEmptyImgUrl);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onReorder: function (e) {
|
||||
var $target = $(e.currentTarget),
|
||||
type = $target.data('type');
|
||||
|
||||
var properties = new Asc.asc_CImgProperty();
|
||||
|
||||
if ('all-up' == type) {
|
||||
properties.put_ChangeLevel(Asc.c_oAscChangeLevel.BringToFront);
|
||||
} else if ('all-down' == type) {
|
||||
properties.put_ChangeLevel(Asc.c_oAscChangeLevel.SendToBack);
|
||||
} else if ('move-up' == type) {
|
||||
properties.put_ChangeLevel(Asc.c_oAscChangeLevel.BringForward);
|
||||
} else if ('move-down' == type) {
|
||||
properties.put_ChangeLevel(Asc.c_oAscChangeLevel.BringBackward);
|
||||
}
|
||||
|
||||
this.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiFocusObject: function (objects) {
|
||||
_stack = objects;
|
||||
|
||||
var images = [];
|
||||
|
||||
_.each(_stack, function (object) {
|
||||
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Image) {
|
||||
var imageObject = object.get_ObjectValue();
|
||||
if (imageObject && _.isNull(imageObject.get_ShapeProperties()) && _.isNull(imageObject.get_ChartProperties())) {
|
||||
images.push(object);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (images.length > 0) {
|
||||
var object = images[images.length - 1]; // get top
|
||||
_imageObject = object.get_ObjectValue();
|
||||
} else {
|
||||
_imageObject = undefined;
|
||||
}
|
||||
},
|
||||
|
||||
// Helpers
|
||||
|
||||
_uiTransformByWrap: function(type) {
|
||||
$('.image-wrap .align')[('inline' == type) ? 'hide' : 'show']();
|
||||
$('.image-wrap .distance')[('inline' == type || 'behind' == type || 'infront' == type) ? 'hide' : 'show']();
|
||||
$('#edit-image-movetext').toggleClass('disabled', ('inline' == type));
|
||||
},
|
||||
|
||||
_closeIfNeed: function () {
|
||||
if (!this._isImageInStack()) {
|
||||
DE.getController('EditContainer').hideModal();
|
||||
}
|
||||
},
|
||||
|
||||
_isImageInStack: function () {
|
||||
var imageExist = false;
|
||||
|
||||
_.some(_stack, function(object) {
|
||||
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Image) {
|
||||
var imageObject = object.get_ObjectValue();
|
||||
if (imageObject && _.isNull(imageObject.get_imageProperties()) && _.isNull(imageObject.get_ChartProperties())) {
|
||||
imageExist = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return imageExist;
|
||||
},
|
||||
|
||||
textEmptyImgUrl: 'You need to specify image URL.',
|
||||
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"'
|
||||
}
|
||||
})(), DE.Controllers.EditImage || {}))
|
||||
});
|
|
@ -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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* EditParagraph.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/14/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/edit/EditParagraph',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.EditParagraph = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var _paragraphInfo = {},
|
||||
_paragraphProperty = undefined,
|
||||
_styleName,
|
||||
metricText = Common.Utils.Metric.getCurrentMetricName();
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [
|
||||
'EditParagraph'
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
|
||||
Common.NotificationCenter.on('editcategory:show', _.bind(this.categoryShow, this));
|
||||
|
||||
this.addListeners({
|
||||
'EditParagraph': {
|
||||
'page:show' : this.onPageShow,
|
||||
'style:click' : this.onStyleClick
|
||||
}
|
||||
});
|
||||
|
||||
this._styles = [];
|
||||
this._styleThumbSize = undefined;
|
||||
this._paragraphObject = undefined;
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
var me = this;
|
||||
me.api = api;
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('EditParagraph').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
me.initSettings();
|
||||
},
|
||||
|
||||
categoryShow: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
|
||||
if ($target && $target.prop('id') === 'edit-paragraph') {
|
||||
this.initSettings();
|
||||
}
|
||||
},
|
||||
|
||||
onPageShow: function () {
|
||||
var me = this,
|
||||
paletteBackgroundColor = me.getView('EditParagraph').paletteBackgroundColor;
|
||||
|
||||
$('#paragraph-distance-before .button').single('click', _.bind(me.onDistanceBefore, me));
|
||||
$('#paragraph-distance-after .button').single('click', _.bind(me.onDistanceAfter, me));
|
||||
$('#paragraph-spin-first-line .button').single('click', _.bind(me.onSpinFirstLine, me));
|
||||
$('#paragraph-space input:checkbox').single('change', _.bind(me.onSpaceBetween, me));
|
||||
$('#paragraph-page-break input:checkbox').single('change', _.bind(me.onBreakBefore, me));
|
||||
$('#paragraph-page-orphan input:checkbox').single('change', _.bind(me.onOrphan, me));
|
||||
$('#paragraph-page-keeptogether input:checkbox').single('change',_.bind(me.onKeepTogether, me));
|
||||
$('#paragraph-page-keepnext input:checkbox').single('change', _.bind(me.onKeepNext, me));
|
||||
|
||||
paletteBackgroundColor && paletteBackgroundColor.on('select', _.bind(me.onBackgroundColor, me));
|
||||
|
||||
me.initSettings();
|
||||
},
|
||||
|
||||
initSettings: function () {
|
||||
var me = this;
|
||||
|
||||
metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric());
|
||||
var selectedElements = me.api.getSelectedElements();
|
||||
if (selectedElements && _.isArray(selectedElements)) {
|
||||
for (var i = selectedElements.length - 1; i >= 0; i--) {
|
||||
if (Asc.c_oAscTypeSelectElement.Paragraph == selectedElements[i].get_ObjectType()) {
|
||||
_paragraphProperty = selectedElements[i].get_ObjectValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_paragraphProperty) {
|
||||
if (_paragraphProperty.get_Ind()===null || _paragraphProperty.get_Ind()===undefined) {
|
||||
_paragraphProperty.get_Ind().put_FirstLine(0);
|
||||
}
|
||||
var firstLineFix = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_paragraphProperty.get_Ind().get_FirstLine()).toFixed(2));
|
||||
$('#paragraph-spin-first-line .item-after label').text(firstLineFix + ' ' + metricText);
|
||||
}
|
||||
|
||||
if (me._paragraphObject) {
|
||||
_paragraphInfo.spaceBefore = me._paragraphObject.get_Spacing().get_Before() < 0 ? me._paragraphObject.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(me._paragraphObject.get_Spacing().get_Before());
|
||||
_paragraphInfo.spaceAfter = me._paragraphObject.get_Spacing().get_After() < 0 ? me._paragraphObject.get_Spacing().get_After() : Common.Utils.Metric.fnRecalcFromMM(me._paragraphObject.get_Spacing().get_After());
|
||||
var distanceBeforeFix = parseFloat(_paragraphInfo.spaceBefore.toFixed(2));
|
||||
var distanceAfterFix = parseFloat(_paragraphInfo.spaceAfter.toFixed(2));
|
||||
$('#paragraph-distance-before .item-after label').text(_paragraphInfo.spaceBefore < 0 ? 'Auto' : distanceBeforeFix + ' ' + metricText);
|
||||
$('#paragraph-distance-after .item-after label').text(_paragraphInfo.spaceAfter < 0 ? 'Auto' : distanceAfterFix + ' ' + metricText);
|
||||
|
||||
$('#paragraph-space input:checkbox').prop('checked', me._paragraphObject.get_ContextualSpacing());
|
||||
$('#paragraph-page-break input:checkbox').prop('checked', me._paragraphObject.get_PageBreakBefore());
|
||||
$('#paragraph-page-orphan input:checkbox').prop('checked', me._paragraphObject.get_WidowControl());
|
||||
$('#paragraph-page-keeptogether input:checkbox').prop('checked', me._paragraphObject.get_KeepLines());
|
||||
$('#paragraph-page-keepnext input:checkbox').prop('checked', me._paragraphObject.get_KeepNext());
|
||||
|
||||
|
||||
// Background color
|
||||
var shade = me._paragraphObject.get_Shade(),
|
||||
backColor = 'transparent';
|
||||
|
||||
if (!_.isNull(shade) && !_.isUndefined(shade) && shade.get_Value()===Asc.c_oAscShdClear) {
|
||||
var color = shade.get_Color();
|
||||
if (color) {
|
||||
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
backColor = {
|
||||
color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()),
|
||||
effectValue: color.get_value()
|
||||
};
|
||||
} else {
|
||||
backColor = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$('#paragraph-background .color-preview').css('background-color', (backColor === 'transparent') ? backColor : ('#' + (_.isObject(backColor) ? backColor.color : backColor)));
|
||||
|
||||
var palette = me.getView('EditParagraph').paletteBackgroundColor;
|
||||
|
||||
if (palette) {
|
||||
palette.select(backColor);
|
||||
}
|
||||
|
||||
$('#paragraph-list input[name=paragraph-style]').val([_styleName]);
|
||||
}
|
||||
},
|
||||
|
||||
onStyleClick: function (view, e) {
|
||||
var $item = $(e.currentTarget).find('input');
|
||||
|
||||
if ($item) {
|
||||
this.api.put_Style($item.prop('value'));
|
||||
}
|
||||
},
|
||||
|
||||
// Public
|
||||
getStyles: function () {
|
||||
return this._styles || [];
|
||||
},
|
||||
|
||||
getThumbSize: function () {
|
||||
return this._styleThumbSize || {width: 0, height: 0};
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onBackgroundColor: function (palette, color) {
|
||||
var me = this;
|
||||
|
||||
$('#paragraph-background .color-preview').css('background-color', (color === 'transparent') ? color : ('#' + (_.isObject(color) ? color.color : color)));
|
||||
|
||||
if (me.api) {
|
||||
var properties = new Asc.asc_CParagraphProperty();
|
||||
|
||||
properties.put_Shade(new Asc.asc_CParagraphShd());
|
||||
|
||||
if (color == 'transparent') {
|
||||
properties.get_Shade().put_Value(Asc.c_oAscShdNil);
|
||||
} else {
|
||||
properties.get_Shade().put_Value(Asc.c_oAscShdClear);
|
||||
properties.get_Shade().put_Color(Common.Utils.ThemeColor.getRgbColor(color));
|
||||
}
|
||||
|
||||
me.api.paraApply(properties);
|
||||
}
|
||||
},
|
||||
|
||||
onDistanceBefore: function (e) {
|
||||
var $button = $(e.currentTarget),
|
||||
distance = _paragraphInfo.spaceBefore,
|
||||
step,
|
||||
maxValue;
|
||||
|
||||
if (Common.Utils.Metric.getCurrentMetric() == Common.Utils.Metric.c_MetricUnits.pt) {
|
||||
step = 1;
|
||||
} else {
|
||||
step = 0.01;
|
||||
}
|
||||
|
||||
maxValue = Common.Utils.Metric.fnRecalcFromMM(558.8);
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
distance = Math.max(-1, distance - step);
|
||||
} else {
|
||||
distance = Math.min(maxValue, distance + step);
|
||||
}
|
||||
|
||||
var distanceFix = parseFloat(distance.toFixed(2));
|
||||
|
||||
_paragraphInfo.spaceBefore = distance;
|
||||
|
||||
$('#paragraph-distance-before .item-after label').text(_paragraphInfo.spaceBefore < 0 ? 'Auto' : distanceFix + ' ' + metricText);
|
||||
|
||||
this.api.put_LineSpacingBeforeAfter(0, (_paragraphInfo.spaceBefore < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(_paragraphInfo.spaceBefore));
|
||||
},
|
||||
|
||||
onDistanceAfter: function (e) {
|
||||
var $button = $(e.currentTarget),
|
||||
distance = _paragraphInfo.spaceAfter,
|
||||
step,
|
||||
maxValue;
|
||||
|
||||
if (Common.Utils.Metric.getCurrentMetric() == Common.Utils.Metric.c_MetricUnits.pt) {
|
||||
step = 1;
|
||||
} else {
|
||||
step = 0.01;
|
||||
}
|
||||
|
||||
maxValue = Common.Utils.Metric.fnRecalcFromMM(558.8);
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
distance = Math.max(-1, distance - step);
|
||||
} else {
|
||||
distance = Math.min(maxValue, distance + step);
|
||||
}
|
||||
|
||||
var distanceFix = parseFloat(distance.toFixed(2));
|
||||
|
||||
_paragraphInfo.spaceAfter = distance;
|
||||
|
||||
$('#paragraph-distance-after .item-after label').text(_paragraphInfo.spaceAfter < 0 ? 'Auto' : distanceFix + ' ' + metricText);
|
||||
this.api.put_LineSpacingBeforeAfter(1, (_paragraphInfo.spaceAfter < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(_paragraphInfo.spaceAfter));
|
||||
},
|
||||
|
||||
onSpinFirstLine: function(e) {
|
||||
var $button = $(e.currentTarget),
|
||||
distance = _paragraphProperty.get_Ind().get_FirstLine(),
|
||||
step,
|
||||
minValue,
|
||||
maxValue;
|
||||
|
||||
distance = Common.Utils.Metric.fnRecalcFromMM(distance);
|
||||
|
||||
if (Common.Utils.Metric.getCurrentMetric() == Common.Utils.Metric.c_MetricUnits.pt) {
|
||||
step = 1;
|
||||
} else {
|
||||
step = 0.1;
|
||||
}
|
||||
|
||||
minValue = Common.Utils.Metric.fnRecalcFromMM(-558.7);
|
||||
maxValue = Common.Utils.Metric.fnRecalcFromMM(558.7);
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
distance = Math.max(minValue, distance - step);
|
||||
} else {
|
||||
distance = Math.min(maxValue, distance + step);
|
||||
}
|
||||
|
||||
var distanceFix = parseFloat(distance.toFixed(2));
|
||||
|
||||
$('#paragraph-spin-first-line .item-after label').text(distanceFix + ' ' + metricText);
|
||||
|
||||
distance = Common.Utils.Metric.fnRecalcToMM(distance);
|
||||
|
||||
var newParagraphProp = new Asc.asc_CParagraphProperty();
|
||||
|
||||
_paragraphProperty.get_Ind().put_FirstLine(distance);
|
||||
|
||||
newParagraphProp.get_Ind().put_FirstLine(distance);
|
||||
|
||||
this.api.paraApply(newParagraphProp);
|
||||
},
|
||||
|
||||
onSpaceBetween: function (e) {
|
||||
var $checkbox = $(e.currentTarget);
|
||||
this.api.put_AddSpaceBetweenPrg($checkbox.is(':checked'));
|
||||
},
|
||||
|
||||
onBreakBefore: function (e) {
|
||||
var $checkbox = $(e.currentTarget);
|
||||
var properties = new Asc.asc_CParagraphProperty();
|
||||
|
||||
properties.put_PageBreakBefore($checkbox.is(':checked'));
|
||||
this.api.paraApply(properties);
|
||||
},
|
||||
|
||||
onOrphan: function (e) {
|
||||
var $checkbox = $(e.currentTarget);
|
||||
var properties = new Asc.asc_CParagraphProperty();
|
||||
|
||||
properties.put_WidowControl($checkbox.is(':checked'));
|
||||
this.api.paraApply(properties);
|
||||
},
|
||||
|
||||
onKeepTogether: function (e) {
|
||||
var $checkbox = $(e.currentTarget);
|
||||
var properties = new Asc.asc_CParagraphProperty();
|
||||
|
||||
properties.put_KeepLines($checkbox.is(':checked'));
|
||||
this.api.paraApply(properties);
|
||||
},
|
||||
|
||||
onKeepNext: function (e) {
|
||||
var $checkbox = $(e.currentTarget);
|
||||
var properties = new Asc.asc_CParagraphProperty();
|
||||
|
||||
properties.put_KeepNext($checkbox.is(':checked'));
|
||||
this.api.paraApply(properties);
|
||||
},
|
||||
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiParagraphStyleChange: function(name) {
|
||||
_styleName = name;
|
||||
$('#paragraph-list input[name=paragraph-style]').val([_styleName]);
|
||||
}
|
||||
}
|
||||
})(), DE.Controllers.EditParagraph || {}))
|
||||
});
|
|
@ -1,557 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/21/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/edit/EditShape',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.EditShape = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var _stack = [],
|
||||
_shapeObject = undefined,
|
||||
_metricText = Common.Utils.Metric.getCurrentMetricName(),
|
||||
_borderColor = 'transparent';
|
||||
|
||||
var wrapTypesTransform = (function() {
|
||||
var map = [
|
||||
{ ui:'inline', sdk: Asc.c_oAscWrapStyle2.Inline },
|
||||
{ ui:'square', sdk: Asc.c_oAscWrapStyle2.Square },
|
||||
{ ui:'tight', sdk: Asc.c_oAscWrapStyle2.Tight },
|
||||
{ ui:'through', sdk: Asc.c_oAscWrapStyle2.Through },
|
||||
{ ui:'top-bottom', sdk: Asc.c_oAscWrapStyle2.TopAndBottom },
|
||||
{ ui:'behind', sdk: Asc.c_oAscWrapStyle2.Behind },
|
||||
{ ui:'infront', sdk: Asc.c_oAscWrapStyle2.InFront }
|
||||
];
|
||||
|
||||
return {
|
||||
sdkToUi: function(type) {
|
||||
var record = map.filter(function(obj) {
|
||||
return obj.sdk === type;
|
||||
})[0];
|
||||
return record ? record.ui : '';
|
||||
},
|
||||
|
||||
uiToSdk: function(type) {
|
||||
var record = map.filter(function(obj) {
|
||||
return obj.ui === type;
|
||||
})[0];
|
||||
return record ? record.sdk : 0;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
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_onFocusObject', _.bind(me.onApiFocusObject, me));
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('EditShape').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#shape-remove').single('click', _.bind(me.onRemoveShape, me));
|
||||
|
||||
me.initSettings();
|
||||
},
|
||||
|
||||
onPageShow: function (view, pageId) {
|
||||
var me = this;
|
||||
|
||||
$('.shape-reorder a').single('click', _.bind(me.onReorder, me));
|
||||
$('.shape-replace li').single('click', _.buffered(me.onReplace, 100, me));
|
||||
$('.shape-wrap .shape-wrap-types li').single('click', _.buffered(me.onWrapType, 100, me));
|
||||
$('.shape-wrap .align a').single('click', _.bind(me.onAlign, me));
|
||||
$('#edit-shape-movetext input').single('change', _.bind(me.onMoveText, me));
|
||||
$('#edit-shape-overlap input').single('change', _.bind(me.onOverlap, me));
|
||||
$('.shape-wrap .distance input').single('change touchend', _.buffered(me.onWrapDistance, 100, me));
|
||||
$('.shape-wrap .distance input').single('input', _.bind(me.onWrapDistanceChanging, me));
|
||||
|
||||
$('#edit-shape-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me));
|
||||
$('#edit-shape-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me));
|
||||
$('#edit-shape-effect input').single('change touchend', _.buffered(me.onOpacity, 100, me));
|
||||
$('#edit-shape-effect input').single('input', _.bind(me.onOpacityChanging, me));
|
||||
|
||||
me.initSettings(pageId);
|
||||
},
|
||||
|
||||
initSettings: function (pageId) {
|
||||
var me = this;
|
||||
|
||||
// me.api && me.api.UpdateInterfaceState();
|
||||
_metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric());
|
||||
if (_shapeObject) {
|
||||
if (pageId == '#edit-shape-wrap') {
|
||||
me._initWrapView();
|
||||
} else if (pageId == '#edit-shape-style' || pageId == '#edit-shape-style-nofill' || pageId == '#edit-shape-border-color-view') {
|
||||
me._initStyleView();
|
||||
} else {
|
||||
me.getView('EditShape').isShapeCanFill = _shapeObject.get_ShapeProperties().get_CanFill();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_initWrapView: function() {
|
||||
// Wrap type
|
||||
var me = this,
|
||||
wrapping = _shapeObject.get_WrappingStyle(),
|
||||
$shapeWrapInput = $('.shape-wrap input'),
|
||||
shapeWrapType = wrapTypesTransform.sdkToUi(wrapping);
|
||||
|
||||
$shapeWrapInput.val([shapeWrapType]);
|
||||
me._uiTransformByWrap(shapeWrapType);
|
||||
|
||||
// Wrap align
|
||||
var shapeHAlign = _shapeObject.get_PositionH().get_Align();
|
||||
|
||||
$('.shape-wrap .align a[data-type=left]').toggleClass('active', shapeHAlign == Asc.c_oAscAlignH.Left);
|
||||
$('.shape-wrap .align a[data-type=center]').toggleClass('active', shapeHAlign == Asc.c_oAscAlignH.Center);
|
||||
$('.shape-wrap .align a[data-type=right]').toggleClass('active', shapeHAlign == Asc.c_oAscAlignH.Right);
|
||||
|
||||
|
||||
// Wrap flags
|
||||
$('#edit-shape-movetext input').prop('checked', _shapeObject.get_PositionV().get_RelativeFrom() == Asc.c_oAscRelativeFromV.Paragraph);
|
||||
$('#edit-shape-overlap input').prop('checked', _shapeObject.get_AllowOverlap());
|
||||
|
||||
// Wrap distance
|
||||
var paddings = _shapeObject.get_Paddings();
|
||||
if (paddings) {
|
||||
var distance = Common.Utils.Metric.fnRecalcFromMM(paddings.get_Top());
|
||||
$('.shape-wrap .distance input').val(distance);
|
||||
$('.shape-wrap .distance .item-after').text(distance + ' ' + _metricText);
|
||||
}
|
||||
},
|
||||
|
||||
_initStyleView: function () {
|
||||
var me = this,
|
||||
shapeProperties = _shapeObject.get_ShapeProperties(),
|
||||
paletteFillColor = me.getView('EditShape').paletteFillColor,
|
||||
paletteBorderColor = me.getView('EditShape').paletteBorderColor;
|
||||
|
||||
// Init style border size
|
||||
var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4;
|
||||
var 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));
|
||||
|
||||
// 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() + ' ' + "%");
|
||||
|
||||
paletteFillColor && paletteFillColor.on('select', _.bind(me.onFillColor, me));
|
||||
paletteBorderColor && paletteBorderColor.on('select', _.bind(me.onBorderColor, me));
|
||||
|
||||
var sdkColor, color;
|
||||
|
||||
// Init fill color
|
||||
var fill = shapeProperties.get_fill(),
|
||||
fillType = fill.get_type();
|
||||
|
||||
color = 'transparent';
|
||||
|
||||
if (fillType == Asc.c_oAscFill.FILL_TYPE_SOLID) {
|
||||
fill = fill.get_fill();
|
||||
sdkColor = fill.get_color();
|
||||
|
||||
if (sdkColor) {
|
||||
if (sdkColor.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
color = {color: Common.Utils.ThemeColor.getHexColor(sdkColor.get_r(), sdkColor.get_g(), sdkColor.get_b()), effectValue: sdkColor.get_value()};
|
||||
} else {
|
||||
color = Common.Utils.ThemeColor.getHexColor(sdkColor.get_r(), sdkColor.get_g(), sdkColor.get_b());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
paletteFillColor && paletteFillColor.select(color);
|
||||
|
||||
// Init border color
|
||||
me._initBorderColorView();
|
||||
},
|
||||
|
||||
_initBorderColorView: function () {
|
||||
if (!_shapeObject) return;
|
||||
|
||||
var me = this,
|
||||
paletteBorderColor = me.getView('EditShape').paletteBorderColor,
|
||||
stroke = _shapeObject.get_ShapeProperties().get_stroke();
|
||||
|
||||
var color = 'transparent';
|
||||
|
||||
if (stroke && stroke.get_type() == Asc.c_oAscStrokeType.STROKE_COLOR) {
|
||||
var sdkColor = stroke.get_color();
|
||||
|
||||
if (sdkColor) {
|
||||
if (sdkColor.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
color = {color: Common.Utils.ThemeColor.getHexColor(sdkColor.get_r(), sdkColor.get_g(), sdkColor.get_b()), effectValue: sdkColor.get_value()};
|
||||
}
|
||||
else {
|
||||
color = Common.Utils.ThemeColor.getHexColor(sdkColor.get_r(), sdkColor.get_g(), sdkColor.get_b());
|
||||
}
|
||||
}
|
||||
}
|
||||
_borderColor = color;
|
||||
|
||||
paletteBorderColor && paletteBorderColor.select(color);
|
||||
$('#edit-shape-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)))
|
||||
},
|
||||
|
||||
// Public
|
||||
|
||||
getShape: function () {
|
||||
return _shapeObject;
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onRemoveShape: function () {
|
||||
this.api.asc_Remove();
|
||||
DE.getController('EditContainer').hideModal();
|
||||
},
|
||||
|
||||
onReorder: function (e) {
|
||||
},
|
||||
|
||||
onReplace: function (e) {
|
||||
},
|
||||
|
||||
onWrapType: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget).find('input'),
|
||||
value = $target.val(),
|
||||
properties = new Asc.asc_CImgProperty();
|
||||
|
||||
me._uiTransformByWrap(value);
|
||||
|
||||
var sdkType = wrapTypesTransform.uiToSdk(value);
|
||||
|
||||
properties.put_WrappingStyle(sdkType);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onAlign: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
type = $target.data('type');
|
||||
|
||||
$('.shape-wrap .align a').removeClass('active');
|
||||
$target.addClass('active');
|
||||
|
||||
var hAlign = Asc.c_oAscAlignH.Left;
|
||||
|
||||
if ('center' == type) {
|
||||
hAlign = Asc.c_oAscAlignH.Center;
|
||||
} else if ('right' == type) {
|
||||
hAlign = Asc.c_oAscAlignH.Right;
|
||||
}
|
||||
|
||||
var properties = new Asc.asc_CImgProperty();
|
||||
properties.put_PositionH(new Asc.CImagePositionH());
|
||||
properties.get_PositionH().put_UseAlign(true);
|
||||
properties.get_PositionH().put_Align(hAlign);
|
||||
properties.get_PositionH().put_RelativeFrom(Asc.c_oAscRelativeFromH.Page);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onMoveText: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
properties = new Asc.asc_CImgProperty();
|
||||
|
||||
properties.put_PositionV(new Asc.CImagePositionV());
|
||||
properties.get_PositionV().put_UseAlign(true);
|
||||
properties.get_PositionV().put_RelativeFrom($target.is(':checked') ? Asc.c_oAscRelativeFromV.Paragraph : Asc.c_oAscRelativeFromV.Page);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onOverlap: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
properties = new Asc.asc_CImgProperty();
|
||||
|
||||
properties.put_AllowOverlap($target.is(':checked'));
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onWrapDistance: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
value = $target.val(),
|
||||
properties = new Asc.asc_CImgProperty(),
|
||||
paddings = new Asc.asc_CPaddings();
|
||||
|
||||
$('.shape-wrap .distance .item-after').text(value + ' ' + _metricText);
|
||||
|
||||
value = Common.Utils.Metric.fnRecalcToMM(parseInt(value));
|
||||
|
||||
paddings.put_Top(value);
|
||||
paddings.put_Right(value);
|
||||
paddings.put_Bottom(value);
|
||||
paddings.put_Left(value);
|
||||
|
||||
properties.put_Paddings(paddings);
|
||||
|
||||
me.api.ImgApply(properties);
|
||||
},
|
||||
|
||||
onWrapDistanceChanging: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
$('.shape-wrap .distance .item-after').text($target.val() + ' ' + _metricText);
|
||||
},
|
||||
|
||||
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 (_borderColor == 'transparent')
|
||||
stroke.put_color(Common.Utils.ThemeColor.getRgbColor({color: '000000', effectId: 29}));
|
||||
else
|
||||
stroke.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(_borderColor)));
|
||||
stroke.put_width(value * 25.4 / 72.0);
|
||||
}
|
||||
|
||||
shape.put_stroke(stroke);
|
||||
image.put_ShapeProperties(shape);
|
||||
|
||||
me.api.ImgApply(image);
|
||||
me._initBorderColorView(); // when select STROKE_NONE or change from STROKE_NONE to STROKE_COLOR
|
||||
},
|
||||
|
||||
onBorderSizeChanging: function (e) {
|
||||
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.put_transparent(parseInt(value * 2.55));
|
||||
shape.put_fill(fill);
|
||||
properties.put_ShapeProperties(shape);
|
||||
|
||||
me.api.ImgApply(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.put_fill(fill);
|
||||
image.put_ShapeProperties(shape);
|
||||
|
||||
me.api.ImgApply(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)));
|
||||
_borderColor = 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.put_ShapeProperties(shape);
|
||||
|
||||
me.api.ImgApply(image);
|
||||
}
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiFocusObject: function (objects) {
|
||||
_stack = objects;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (shapes.length > 0) {
|
||||
var object = shapes[shapes.length - 1]; // get top shape
|
||||
_shapeObject = object.get_ObjectValue();
|
||||
this.getView('EditShape').isShapeCanFill = _shapeObject.get_ShapeProperties().get_CanFill();
|
||||
} else {
|
||||
_shapeObject = undefined;
|
||||
}
|
||||
},
|
||||
|
||||
// Helpers
|
||||
|
||||
_uiTransformByWrap: function(type) {
|
||||
$('.shape-wrap .align')[('inline' == type) ? 'hide' : 'show']();
|
||||
$('.shape-wrap .distance')[('behind' == type || 'infront' == type) ? 'hide' : 'show']();
|
||||
$('#edit-shape-movetext').toggleClass('disabled', ('inline' == type));
|
||||
},
|
||||
|
||||
_closeIfNeed: function () {
|
||||
if (!this._isShapeInStack()) {
|
||||
DE.getController('EditContainer').hideModal();
|
||||
}
|
||||
},
|
||||
|
||||
_isShapeInStack: function () {
|
||||
var shapeExist = false;
|
||||
|
||||
_.some(_stack, function(object) {
|
||||
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Image) {
|
||||
if (object.get_ObjectValue() && object.get_ObjectValue().get_ShapeProperties()) {
|
||||
shapeExist = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return shapeExist;
|
||||
}
|
||||
};
|
||||
})(), DE.Controllers.EditShape || {}))
|
||||
});
|
|
@ -1,675 +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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* EditTable.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/20/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/edit/EditTable',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.EditTable = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var _stack = [],
|
||||
_metricText = Common.Utils.Metric.getCurrentMetricName(),
|
||||
_tableObject = undefined,
|
||||
_tableLook = {},
|
||||
_cellBorders = undefined,
|
||||
_cellBorderColor = '000000',
|
||||
_cellBorderWidth = 0.5;
|
||||
|
||||
var c_tableWrap = {
|
||||
TABLE_WRAP_NONE: 0,
|
||||
TABLE_WRAP_PARALLEL: 1
|
||||
};
|
||||
|
||||
var c_tableAlign = {
|
||||
TABLE_ALIGN_LEFT: 0,
|
||||
TABLE_ALIGN_CENTER: 1,
|
||||
TABLE_ALIGN_RIGHT: 2
|
||||
};
|
||||
|
||||
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: [
|
||||
'EditTable'
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
|
||||
|
||||
this.addListeners({
|
||||
'EditTable': {
|
||||
'page:show' : this.onPageShow
|
||||
}
|
||||
});
|
||||
|
||||
var me = this;
|
||||
uiApp.onPageBack('edit-table-style-options', function (page) {
|
||||
$('.dataview.table-styles .row div').single('click', _.bind(me.onStyleClick, me));
|
||||
me.initSettings('#edit-table-style');
|
||||
});
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
var me = this;
|
||||
me.api = api;
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('EditTable').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
me.initSettings();
|
||||
},
|
||||
|
||||
onPageShow: function (view, pageId) {
|
||||
var me = this,
|
||||
paletteFillColor = me.getView('EditTable').paletteFillColor,
|
||||
paletteBorderColor = me.getView('EditTable').paletteBorderColor;
|
||||
|
||||
$('#table-wrap-type li').single('click', _.buffered(me.onWrapType, 100, me));
|
||||
$('#table-move-text input:checkbox').single('change', _.bind(me.onWrapMoveText, me));
|
||||
$('#table-distance input').single('change touchend', _.buffered(me.onWrapDistance, 100, me));
|
||||
$('#table-distance input').single('input', _.bind(me.onWrapDistanceChanging, me));
|
||||
$('#table-align-left').single('click', _.bind(me.onWrapAlign, me, c_tableAlign.TABLE_ALIGN_LEFT));
|
||||
$('#table-align-center').single('click', _.bind(me.onWrapAlign, me, c_tableAlign.TABLE_ALIGN_CENTER));
|
||||
$('#table-align-right').single('click', _.bind(me.onWrapAlign, me, c_tableAlign.TABLE_ALIGN_RIGHT));
|
||||
|
||||
$('#table-option-repeatasheader input:checkbox').single('change', _.bind(me.onOptionRepeat, me));
|
||||
$('#table-option-resizetofit input:checkbox').single('change', _.bind(me.onOptionResize, me));
|
||||
$('#table-options-margins input').single('change touchend', _.buffered(me.onOptionMargin, 100, me));
|
||||
$('#table-options-margins input').single('input', _.bind(me.onOptionMarginChanging, me));
|
||||
|
||||
$('#table-options-header-row input:checkbox').single('change', _.bind(me.onCheckTemplateChange, me, 0));
|
||||
$('#table-options-total-row input:checkbox').single('change', _.bind(me.onCheckTemplateChange, me, 1));
|
||||
$('#table-options-banded-row input:checkbox').single('change', _.bind(me.onCheckTemplateChange, me, 2));
|
||||
$('#table-options-first-column input:checkbox').single('change', _.bind(me.onCheckTemplateChange, me, 3));
|
||||
$('#table-options-last-column input:checkbox').single('change', _.bind(me.onCheckTemplateChange, me, 4));
|
||||
$('#table-options-banded-column input:checkbox').single('change', _.bind(me.onCheckTemplateChange, me, 5));
|
||||
|
||||
$('#edit-table-bordertypes a').single('click', _.bind(me.onBorderTypeClick, me));
|
||||
|
||||
$('.dataview.table-styles .row div').single('click', _.bind(me.onStyleClick, me));
|
||||
$('#edit-table-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me));
|
||||
$('#edit-table-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me));
|
||||
|
||||
paletteFillColor && paletteFillColor.on('select', _.bind(me.onFillColor, me));
|
||||
paletteBorderColor && paletteBorderColor.on('select', _.bind(me.onBorderColor, me));
|
||||
|
||||
me.initSettings(pageId);
|
||||
},
|
||||
|
||||
initSettings: function (pageId) {
|
||||
var me = this;
|
||||
_metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric());
|
||||
|
||||
if (_tableObject) {
|
||||
if (pageId == '#edit-table-wrap') {
|
||||
me._initWrappView();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-table-wrap]', '.page[data-page=edit-table-wrap] .page-content');
|
||||
} else if (pageId == "#edit-table-style" || pageId == '#edit-table-border-color-view') {
|
||||
me._initStyleView();
|
||||
|
||||
if (pageId == '#edit-table-border-color-view') {
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-table-border-color]', '.page[data-page=edit-table-border-color] .page-content');
|
||||
} else {
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-table-style]', '.page[data-page=edit-table-style] .page-content');
|
||||
}
|
||||
|
||||
Common.Utils.addScrollIfNeed('#tab-table-border .list-block', '#tab-table-border .list-block ul');
|
||||
Common.Utils.addScrollIfNeed('#tab-table-fill .list-block', '#tab-table-fill .list-block ul');
|
||||
Common.Utils.addScrollIfNeed('#tab-table-style .list-block', '#tab-table-style .list-block ul');
|
||||
} else if (pageId == '#edit-table-options') {
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-table-wrap]', '.page[data-page=edit-table-wrap] .page-content');
|
||||
me._initTableOptionsView();
|
||||
} else if (pageId == '#edit-table-style-options-view') {
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-table-style-options]', '.page[data-page=edit-table-style-options] .page-content');
|
||||
me._initStyleOptionsView();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_initStyleOptionsView: function() {
|
||||
$('#table-options-header-row input').prop('checked', _tableLook.get_FirstRow());
|
||||
$('#table-options-total-row input').prop('checked', _tableLook.get_LastRow());
|
||||
$('#table-options-banded-row input').prop('checked', _tableLook.get_BandHor());
|
||||
$('#table-options-first-column input').prop('checked', _tableLook.get_FirstCol());
|
||||
$('#table-options-last-column input').prop('checked', _tableLook.get_LastCol());
|
||||
$('#table-options-banded-column input').prop('checked', _tableLook.get_BandVer());
|
||||
},
|
||||
|
||||
_initTableOptionsView: function() {
|
||||
$('#table-option-repeatasheader input').prop('checked', !!_tableObject.get_RowsInHeader());
|
||||
if (_tableObject.get_RowsInHeader() === null)
|
||||
$('#table-option-repeatasheader').addClass('disabled');
|
||||
else
|
||||
$('#table-option-repeatasheader').removeClass('disabled');
|
||||
$('#table-option-resizetofit input').prop('checked', _tableObject.get_TableLayout()==Asc.c_oAscTableLayout.AutoFit);
|
||||
|
||||
var margins = _tableObject.get_CellMargins();
|
||||
if (margins) {
|
||||
var distance = Common.Utils.Metric.fnRecalcFromMM(margins.get_Left());
|
||||
$('#table-options-margins input').val(distance);
|
||||
$('#table-options-margins .item-after').text(distance + ' ' + _metricText);
|
||||
}
|
||||
},
|
||||
|
||||
_initWrappView: function() {
|
||||
var me = this,
|
||||
type = _tableObject.get_TableWrap() == c_tableWrap.TABLE_WRAP_NONE ? 'inline' : 'flow';
|
||||
|
||||
// wrap type
|
||||
$('#table-wrap-type input').val([type]);
|
||||
me._uiTransformByWrap(type);
|
||||
|
||||
// wrap move text
|
||||
$('#table-move-text input').prop('checked', (_tableObject.get_PositionV() && _tableObject.get_PositionV().get_RelativeFrom()==Asc.c_oAscVAnchor.Text));
|
||||
|
||||
// wrap align
|
||||
var align = _tableObject.get_TableAlignment();
|
||||
$('#table-align-left').toggleClass('active', align == c_tableAlign.TABLE_ALIGN_LEFT);
|
||||
$('#table-align-center').toggleClass('active', align == c_tableAlign.TABLE_ALIGN_CENTER);
|
||||
$('#table-align-right').toggleClass('active', align == c_tableAlign.TABLE_ALIGN_RIGHT);
|
||||
|
||||
// wrap distance
|
||||
var paddings = _tableObject.get_TablePaddings();
|
||||
if (paddings) {
|
||||
var distance = Common.Utils.Metric.fnRecalcFromMM(paddings.get_Top());
|
||||
$('#table-distance input').val(distance);
|
||||
$('#table-distance .item-after').text(distance + ' ' + _metricText);
|
||||
}
|
||||
},
|
||||
|
||||
_initStyleView: function() {
|
||||
var me = this;
|
||||
|
||||
/**
|
||||
* Style
|
||||
*/
|
||||
|
||||
var styleId = _tableObject.get_TableStyle();
|
||||
$('#edit-table-styles .table-styles div').removeClass('active');
|
||||
$('#edit-table-styles .table-styles div[data-type=' + styleId + ']').addClass('active');
|
||||
|
||||
/**
|
||||
* Fill
|
||||
*/
|
||||
|
||||
var background = _tableObject.get_CellsBackground(),
|
||||
fillColor = 'transparent';
|
||||
|
||||
if (background) {
|
||||
if (background.get_Value()==0) {
|
||||
var color = background.get_Color();
|
||||
if (color) {
|
||||
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
fillColor = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value()};
|
||||
} else {
|
||||
fillColor = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var palette = me.getView('EditTable').paletteFillColor;
|
||||
|
||||
if (palette) {
|
||||
palette.select(fillColor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Border
|
||||
*/
|
||||
|
||||
// if (_.isUndefined(_cellBorderColor) || _.isUndefined(_cellBorderWidth)) {
|
||||
// _cellBorders = _tableObject.get_CellBorders();
|
||||
//
|
||||
// _.some([
|
||||
// _cellBorders.get_Left(),
|
||||
// _cellBorders.get_Top(),
|
||||
// _cellBorders.get_Right(),
|
||||
// _cellBorders.get_Bottom(),
|
||||
// _cellBorders.get_InsideV(),
|
||||
// _cellBorders.get_InsideH()
|
||||
// ], function (border) {
|
||||
// if (border.get_Value() > 0) {
|
||||
// var borderColor = border.get_Color();
|
||||
//
|
||||
// if (borderColor.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
// borderColor = {
|
||||
// color: Common.Utils.ThemeColor.getHexColor(borderColor.get_r(), borderColor.get_g(), borderColor.get_b()),
|
||||
// effectValue: borderColor.get_value()
|
||||
// };
|
||||
// } else {
|
||||
// borderColor = Common.Utils.ThemeColor.getHexColor(borderColor.get_r(), borderColor.get_g(), borderColor.get_b());
|
||||
// }
|
||||
//
|
||||
// _cellBorderWidth = border.get_Size();
|
||||
// _cellBorderColor = borderColor;
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
$('#edit-table-bordersize input').val([borderSizeTransform.indexSizeByValue(_cellBorderWidth)]);
|
||||
$('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByValue(_cellBorderWidth) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||
|
||||
var borderPalette = me.getView('EditTable').paletteBorderColor;
|
||||
|
||||
if (borderPalette) {
|
||||
borderPalette.select(_cellBorderColor);
|
||||
}
|
||||
|
||||
$('#edit-table-bordercolor .color-preview').css('background-color', ('transparent' == _cellBorderColor) ? _cellBorderColor : ('#' + (_.isObject(_cellBorderColor) ? _cellBorderColor.color : _cellBorderColor)));
|
||||
},
|
||||
|
||||
_updateBordersStyle: function(border) {
|
||||
_cellBorders = new Asc.CBorders();
|
||||
var updateBorders = _cellBorders;
|
||||
|
||||
var visible = (border != '');
|
||||
|
||||
if (border.indexOf('l') > -1 || !visible) {
|
||||
if (updateBorders.get_Left()===null || updateBorders.get_Left()===undefined)
|
||||
updateBorders.put_Left(new Asc.asc_CTextBorder());
|
||||
this._updateBorderStyle (updateBorders.get_Left(), visible);
|
||||
}
|
||||
if (border.indexOf('t') > -1 || !visible) {
|
||||
if (updateBorders.get_Top()===null || updateBorders.get_Top()===undefined)
|
||||
updateBorders.put_Top(new Asc.asc_CTextBorder());
|
||||
this._updateBorderStyle (updateBorders.get_Top(), visible);
|
||||
}
|
||||
if (border.indexOf('r') > -1 || !visible) {
|
||||
if (updateBorders.get_Right()===null || updateBorders.get_Right()===undefined)
|
||||
updateBorders.put_Right(new Asc.asc_CTextBorder());
|
||||
this._updateBorderStyle (updateBorders.get_Right(), visible);
|
||||
}
|
||||
if (border.indexOf('b') > -1 || !visible) {
|
||||
if (updateBorders.get_Bottom()===null || updateBorders.get_Bottom()===undefined)
|
||||
updateBorders.put_Bottom(new Asc.asc_CTextBorder());
|
||||
this._updateBorderStyle (updateBorders.get_Bottom(), visible);
|
||||
}
|
||||
if (border.indexOf('c') > -1 || !visible) {
|
||||
if (updateBorders.get_InsideV()===null || updateBorders.get_InsideV()===undefined)
|
||||
updateBorders.put_InsideV(new Asc.asc_CTextBorder());
|
||||
this._updateBorderStyle (updateBorders.get_InsideV(), visible);
|
||||
}
|
||||
if (border.indexOf('m') > -1 || !visible) {
|
||||
if (updateBorders.get_InsideH()===null || updateBorders.get_InsideH()===undefined)
|
||||
updateBorders.put_InsideH(new Asc.asc_CTextBorder());
|
||||
this._updateBorderStyle (updateBorders.get_InsideH(), visible);
|
||||
}
|
||||
},
|
||||
|
||||
_updateBorderStyle: function(border, visible) {
|
||||
if (_.isNull(border)) {
|
||||
border = new Asc.asc_CTextBorder();
|
||||
}
|
||||
|
||||
if (visible && _cellBorderWidth > 0){
|
||||
var size = parseFloat(_cellBorderWidth);
|
||||
border.put_Value(1);
|
||||
border.put_Size(size * 25.4 / 72.0);
|
||||
var color = Common.Utils.ThemeColor.getRgbColor(_cellBorderColor);
|
||||
border.put_Color(color);
|
||||
}
|
||||
else {
|
||||
border.put_Value(0);
|
||||
}
|
||||
},
|
||||
|
||||
// Public
|
||||
|
||||
getTable: function() {
|
||||
return _tableObject;
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onWrapType: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget).find('input'),
|
||||
value = $target.val();
|
||||
|
||||
me._uiTransformByWrap(value);
|
||||
|
||||
var properties = new Asc.CTableProp();
|
||||
|
||||
if ('inline' == value) {
|
||||
properties.put_TableWrap(c_tableWrap.TABLE_WRAP_NONE);
|
||||
} else {
|
||||
properties.put_TableWrap(c_tableWrap.TABLE_WRAP_PARALLEL);
|
||||
}
|
||||
|
||||
me.api.tblApply(properties);
|
||||
},
|
||||
|
||||
onWrapMoveText :function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
isOn = $target.is(':checked'),
|
||||
properties = new Asc.CTableProp(),
|
||||
position = new Asc.CTablePositionV();
|
||||
|
||||
position.put_UseAlign(false);
|
||||
position.put_RelativeFrom(isOn ? Asc.c_oAscVAnchor.Text : Asc.c_oAscVAnchor.Page);
|
||||
position.put_Value(_tableObject.get_Value_Y(isOn ? Asc.c_oAscVAnchor.Text : Asc.c_oAscVAnchor.Page));
|
||||
|
||||
properties.put_PositionV(position);
|
||||
|
||||
me.api.tblApply(properties);
|
||||
},
|
||||
|
||||
onWrapDistance: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
value = $target.val(),
|
||||
properties = new Asc.CTableProp(),
|
||||
paddings = new Asc.asc_CPaddings();
|
||||
|
||||
$('#table-distance .item-after').text(value + ' ' + _metricText);
|
||||
|
||||
value = Common.Utils.Metric.fnRecalcToMM(parseInt(value));
|
||||
|
||||
paddings.put_Top(value);
|
||||
paddings.put_Right(value);
|
||||
paddings.put_Bottom(value);
|
||||
paddings.put_Left(value);
|
||||
|
||||
properties.put_TablePaddings(paddings);
|
||||
|
||||
me.api.tblApply(properties);
|
||||
},
|
||||
|
||||
onWrapDistanceChanging: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
$('#table-distance .item-after').text($target.val() + ' ' + _metricText);
|
||||
},
|
||||
|
||||
onWrapAlign: function (type, e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
properties = new Asc.CTableProp();
|
||||
|
||||
$('#table-align .button').removeClass('active');
|
||||
$target.addClass('active');
|
||||
|
||||
properties.put_TableAlignment(type);
|
||||
me.api.tblApply(properties);
|
||||
},
|
||||
|
||||
onOptionRepeat: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
properties = new Asc.CTableProp();
|
||||
|
||||
properties.put_RowsInHeader($target.is(':checked'));
|
||||
me.api.tblApply(properties);
|
||||
},
|
||||
|
||||
onOptionResize: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
properties = new Asc.CTableProp();
|
||||
|
||||
properties.put_TableLayout($target.is(':checked') ? Asc.c_oAscTableLayout.AutoFit : Asc.c_oAscTableLayout. Fixed);
|
||||
me.api.tblApply(properties);
|
||||
},
|
||||
|
||||
onOptionMargin: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
value = $target.val(),
|
||||
properties = new Asc.CTableProp(),
|
||||
margins = new Asc.CMargins();
|
||||
|
||||
$('#table-options-margins .item-after').text(value + ' ' + _metricText);
|
||||
|
||||
value = Common.Utils.Metric.fnRecalcToMM(value);
|
||||
|
||||
margins.put_Top(value);
|
||||
margins.put_Right(value);
|
||||
margins.put_Bottom(value);
|
||||
margins.put_Left(value);
|
||||
margins.put_Flag(2);
|
||||
|
||||
properties.put_CellMargins(margins);
|
||||
|
||||
me.api.tblApply(properties);
|
||||
},
|
||||
|
||||
onOptionMarginChanging: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
$('#table-options-margins .item-after').text($target.val() + ' ' + _metricText);
|
||||
},
|
||||
|
||||
onCheckTemplateChange: function(type, e) {
|
||||
if (this.api) {
|
||||
var properties = new Asc.CTableProp();
|
||||
|
||||
switch (type) {
|
||||
case 0:
|
||||
_tableLook.put_FirstRow($('#table-options-header-row input').is(':checked'));
|
||||
break;
|
||||
case 1:
|
||||
_tableLook.put_LastRow($('#table-options-total-row input').is(':checked'));
|
||||
break;
|
||||
case 2:
|
||||
_tableLook.put_BandHor($('#table-options-banded-row input').is(':checked'));
|
||||
break;
|
||||
case 3:
|
||||
_tableLook.put_FirstCol($('#table-options-first-column input').is(':checked'));
|
||||
break;
|
||||
case 4:
|
||||
_tableLook.put_LastCol($('#table-options-last-column input').is(':checked'));
|
||||
break;
|
||||
case 5:
|
||||
_tableLook.put_BandVer($('#table-options-banded-column input').is(':checked'));
|
||||
break;
|
||||
}
|
||||
|
||||
properties.put_TableLook(_tableLook);
|
||||
this.api.tblApply(properties);
|
||||
}
|
||||
},
|
||||
|
||||
onBorderTypeClick: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
type = $target.data('type');
|
||||
|
||||
this._updateBordersStyle(type);
|
||||
|
||||
if (me.api) {
|
||||
var properties = new Asc.CTableProp();
|
||||
_cellBorders = _.isUndefined(_cellBorders) ? new Asc.CBorders() : _cellBorders;
|
||||
|
||||
properties.put_CellBorders(_cellBorders);
|
||||
properties.put_CellSelect(true);
|
||||
|
||||
me.api.tblApply(properties);
|
||||
}
|
||||
},
|
||||
|
||||
onFillColor: function(palette, color) {
|
||||
if (this.api) {
|
||||
var properties = new Asc.CTableProp(),
|
||||
background = new Asc.CBackground();
|
||||
|
||||
properties.put_CellsBackground(background);
|
||||
|
||||
if ('transparent' == color) {
|
||||
background.put_Value(1);
|
||||
} else {
|
||||
background.put_Value(0);
|
||||
background.put_Color(Common.Utils.ThemeColor.getRgbColor(color));
|
||||
}
|
||||
|
||||
properties.put_CellSelect(true);
|
||||
|
||||
this.api.tblApply(properties);
|
||||
}
|
||||
},
|
||||
|
||||
onBorderColor: function (palette, color) {
|
||||
_cellBorderColor = color;
|
||||
$('#edit-table-bordercolor .color-preview').css('background-color', ('transparent' == color) ? color : ('#' + (_.isObject(color) ? color.color : color)));
|
||||
},
|
||||
|
||||
onStyleClick: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
type = $target.data('type'),
|
||||
properties = new Asc.CTableProp();
|
||||
|
||||
$('#edit-table-styles .table-styles div').removeClass('active');
|
||||
$target.addClass('active');
|
||||
|
||||
properties.put_TableStyle(type);
|
||||
me.api.tblApply(properties);
|
||||
},
|
||||
|
||||
|
||||
onBorderSize: function (e) {
|
||||
var $target = $(e.currentTarget),
|
||||
value = $target.val();
|
||||
|
||||
_cellBorderWidth = borderSizeTransform.sizeByIndex(parseInt(value));
|
||||
},
|
||||
|
||||
onBorderSizeChanging: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
$('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiFocusObject: function (objects) {
|
||||
_stack = objects;
|
||||
|
||||
var tables = [];
|
||||
|
||||
_.each(_stack, function(object) {
|
||||
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Table) {
|
||||
tables.push(object);
|
||||
}
|
||||
});
|
||||
|
||||
if (tables.length > 0) {
|
||||
var object = tables[tables.length - 1]; // get top table
|
||||
|
||||
_tableObject = object.get_ObjectValue();
|
||||
_tableLook = _tableObject.get_TableLook();
|
||||
} else {
|
||||
_tableObject = undefined;
|
||||
}
|
||||
},
|
||||
|
||||
// Helpers
|
||||
|
||||
_closeIfNeed: function () {
|
||||
if (!this._isTableInStack()) {
|
||||
DE.getController('EditContainer').hideModal();
|
||||
}
|
||||
},
|
||||
|
||||
_isTableInStack: function () {
|
||||
var tableExist = false;
|
||||
|
||||
_.some(_stack, function(object) {
|
||||
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Table) {
|
||||
tableExist = true;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
return tableExist;
|
||||
},
|
||||
|
||||
_uiTransformByWrap: function (type) {
|
||||
if ('inline' == type) {
|
||||
$('#edit-tablewrap-page .inline').show();
|
||||
$('#edit-tablewrap-page .flow').hide();
|
||||
$('#table-move-text').addClass('disabled');
|
||||
} else {
|
||||
$('#edit-tablewrap-page .inline').hide();
|
||||
$('#edit-tablewrap-page .flow').show();
|
||||
$('#table-move-text').removeClass('disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
})(), DE.Controllers.EditTable || {}))
|
||||
});
|
|
@ -1,547 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/4/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'core',
|
||||
'documenteditor/mobile/app/view/edit/EditText',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common/mobile/lib/component/ThemeColorPalette'
|
||||
], function (core, view, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.EditText = Backbone.Controller.extend(_.extend((function() {
|
||||
var _stack = [],
|
||||
_paragraphObject = undefined,
|
||||
_fontInfo = {};
|
||||
|
||||
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
|
||||
}
|
||||
});
|
||||
|
||||
this._fontsArray = [];
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
var me = this;
|
||||
me.api = api;
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('EditText').render();
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
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));
|
||||
$('#font-strikethrough').single('click', _.bind(me.onStrikethrough, me));
|
||||
|
||||
$('#paragraph-align .button').single('click', _.bind(me.onParagraphAlign, me));
|
||||
$('#font-moveleft, #font-moveright').single('click', _.bind(me.onParagraphMove, me));
|
||||
|
||||
me.initSettings();
|
||||
},
|
||||
|
||||
onPageShow: function (view, pageId) {
|
||||
var me = this,
|
||||
paletteTextColor = me.getView('EditText').paletteTextColor,
|
||||
paletteBackgroundColor = me.getView('EditText').paletteBackgroundColor;
|
||||
|
||||
$('#text-additional li').single('click', _.buffered(me.onAdditional, 100, me));
|
||||
$('#page-text-linespacing li').single('click', _.buffered(me.onLineSpacing, 100, me));
|
||||
$('#font-size .button').single('click', _.bind(me.onFontSize, me));
|
||||
$('#letter-spacing .button').single('click', _.bind(me.onLetterSpacing, me));
|
||||
|
||||
$('.dataview.bullets li').single('click', _.buffered(me.onBullet, 100, me));
|
||||
$('.dataview.numbers li').single('click', _.buffered(me.onNumber, 100, me));
|
||||
|
||||
$('#font-color-auto').single('click', _.bind(me.onTextColorAuto, me));
|
||||
paletteTextColor && paletteTextColor.on('select', _.bind(me.onTextColor, me));
|
||||
paletteBackgroundColor && paletteBackgroundColor.on('select', _.bind(me.onBackgroundColor, me));
|
||||
|
||||
me.initSettings(pageId);
|
||||
},
|
||||
|
||||
initSettings: function (pageId) {
|
||||
var me = this;
|
||||
|
||||
me.api && me.api.UpdateInterfaceState();
|
||||
|
||||
if (_paragraphObject) {
|
||||
var $inputStrikethrough = $('#text-additional input[name=text-strikethrough]');
|
||||
var $inputTextCaps = $('#text-additional input[name=text-caps]');
|
||||
|
||||
_paragraphObject.get_Strikeout() && $inputStrikethrough.val(['strikethrough']).prop('prevValue', 'strikethrough');
|
||||
_paragraphObject.get_DStrikeout() && $inputStrikethrough.val(['double-strikethrough']).prop('prevValue', 'double-strikethrough');
|
||||
|
||||
_paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small');
|
||||
_paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all');
|
||||
|
||||
_fontInfo.letterSpacing = Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing());
|
||||
$('#letter-spacing .item-after label').text(_fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName());
|
||||
}
|
||||
},
|
||||
|
||||
// Public
|
||||
|
||||
getFonts: function() {
|
||||
return this._fontsArray;
|
||||
},
|
||||
|
||||
getStack: function() {
|
||||
return _stack;
|
||||
},
|
||||
|
||||
getFontInfo: function () {
|
||||
return _fontInfo;
|
||||
},
|
||||
|
||||
getParagraph: function () {
|
||||
return _paragraphObject;
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onBold: function (e) {
|
||||
var pressed = this._toggleButton(e);
|
||||
|
||||
if (this.api) {
|
||||
this.api.put_TextPrBold(pressed);
|
||||
}
|
||||
},
|
||||
|
||||
onItalic: function (e) {
|
||||
var pressed = this._toggleButton(e);
|
||||
|
||||
if (this.api) {
|
||||
this.api.put_TextPrItalic(pressed);
|
||||
}
|
||||
},
|
||||
|
||||
onUnderline: function (e) {
|
||||
var pressed = this._toggleButton(e);
|
||||
|
||||
if (this.api) {
|
||||
this.api.put_TextPrUnderline(pressed);
|
||||
}
|
||||
},
|
||||
|
||||
onStrikethrough: function (e) {
|
||||
var pressed = this._toggleButton(e);
|
||||
|
||||
if (this.api) {
|
||||
this.api.put_TextPrStrikeout(pressed);
|
||||
}
|
||||
},
|
||||
|
||||
onParagraphAlign: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
|
||||
if ($target) {
|
||||
var id = $target.attr('id'),
|
||||
type = 1;
|
||||
|
||||
if ('font-just' == id) {
|
||||
type = 3;
|
||||
} else if ('font-right' == id) {
|
||||
type = 0;
|
||||
} else if ('font-center' == id) {
|
||||
type = 2;
|
||||
}
|
||||
|
||||
$('#paragraph-align .button').removeClass('active');
|
||||
$target.addClass('active');
|
||||
|
||||
this.api.put_PrAlign(type);
|
||||
}
|
||||
},
|
||||
|
||||
onParagraphMove: function (e) {
|
||||
var $target = $(e.currentTarget);
|
||||
|
||||
if ($target && this.api) {
|
||||
var id = $target.attr('id');
|
||||
|
||||
if ('font-moveleft' == id) {
|
||||
this.api.DecreaseIndent();
|
||||
} else {
|
||||
this.api.IncreaseIndent();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onAdditionalStrikethrough : function ($target) {
|
||||
var value = $target.prop('value'),
|
||||
checked = $target.prop('checked');
|
||||
|
||||
if ('strikethrough' == value) {
|
||||
this.api.put_TextPrStrikeout(checked);
|
||||
} else {
|
||||
this.api.put_TextPrDStrikeout(checked);
|
||||
}
|
||||
},
|
||||
|
||||
onAdditionalScript : function ($target) {
|
||||
var value = $target.prop('value'),
|
||||
checked = $target.prop('checked');
|
||||
|
||||
if ('superscript' == value) {
|
||||
this.api.put_TextPrBaseline(checked ? 1 : 0);
|
||||
} else {
|
||||
this.api.put_TextPrBaseline(checked ? 2 : 0);
|
||||
}
|
||||
},
|
||||
|
||||
onAdditionalCaps : function ($target) {
|
||||
var value = $target.prop('value'),
|
||||
checked = $target.prop('checked'),
|
||||
paragraphProps = new Asc.asc_CParagraphProperty();
|
||||
|
||||
if ('small' == value) {
|
||||
paragraphProps.put_AllCaps(false);
|
||||
paragraphProps.put_SmallCaps(checked);
|
||||
} else {
|
||||
paragraphProps.put_AllCaps(checked);
|
||||
paragraphProps.put_SmallCaps(false);
|
||||
}
|
||||
|
||||
this.api.paraApply(paragraphProps);
|
||||
},
|
||||
|
||||
onAdditional: function(e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget).find('input'),
|
||||
prevValue = $target.prop('prevValue');
|
||||
|
||||
if (prevValue == $target.prop('value')) {
|
||||
$target.prop('checked', false);
|
||||
prevValue = null;
|
||||
} else {
|
||||
$target.prop('checked', true);
|
||||
prevValue = $target.prop('value');
|
||||
}
|
||||
|
||||
$('#page-text-additional input[name="'+ $target.prop('name') +'"]').prop('prevValue', prevValue);
|
||||
|
||||
var radioName = $target.prop('name');
|
||||
if ('text-strikethrough' == radioName) {
|
||||
me.onAdditionalStrikethrough($target);
|
||||
} else if ('text-script' == radioName) {
|
||||
me.onAdditionalScript($target);
|
||||
} else if ('text-caps' == radioName){
|
||||
me.onAdditionalCaps($target);
|
||||
}
|
||||
},
|
||||
|
||||
onLineSpacing: function (e) {
|
||||
var $target = $(e.currentTarget).find('input');
|
||||
|
||||
if ($target && this.api) {
|
||||
var value = parseFloat($target.prop('value')),
|
||||
LINERULE_AUTO = 1;
|
||||
|
||||
this.api.put_PrLineSpacing(LINERULE_AUTO, value);
|
||||
}
|
||||
},
|
||||
|
||||
onFontClick: function (view, e) {
|
||||
var $item = $(e.currentTarget).find('input');
|
||||
|
||||
if ($item) {
|
||||
this.api.put_TextPrFontName($item.prop('value'));
|
||||
}
|
||||
},
|
||||
|
||||
onFontSize: function (e) {
|
||||
var $button = $(e.currentTarget),
|
||||
fontSize = _fontInfo.size;
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
_.isUndefined(fontSize) ? this.api.FontSizeOut() : fontSize = Math.max(1, --fontSize);
|
||||
} else {
|
||||
_.isUndefined(fontSize) ? this.api.FontSizeIn() : fontSize = Math.min(100, ++fontSize);
|
||||
}
|
||||
|
||||
if (! _.isUndefined(fontSize)) {
|
||||
this.api.put_TextPrFontSize(fontSize);
|
||||
}
|
||||
},
|
||||
|
||||
onLetterSpacing: function (e) {
|
||||
var $button = $(e.currentTarget),
|
||||
spacing = _fontInfo.letterSpacing;
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
spacing = Math.max(-100, --spacing);
|
||||
} else {
|
||||
spacing = Math.min(100, ++spacing);
|
||||
}
|
||||
_fontInfo.letterSpacing = spacing;
|
||||
|
||||
$('#letter-spacing .item-after label').text(spacing + ' ' + Common.Utils.Metric.getCurrentMetricName());
|
||||
|
||||
var properties = new Asc.asc_CParagraphProperty();
|
||||
properties.put_TextSpacing(Common.Utils.Metric.fnRecalcToMM(spacing));
|
||||
|
||||
this.api.paraApply(properties);
|
||||
},
|
||||
|
||||
onBullet: function (e) {
|
||||
var $bullet = $(e.currentTarget),
|
||||
type = $bullet.data('type');
|
||||
|
||||
$('.dataview.bullets li').removeClass('active');
|
||||
$bullet.addClass('active');
|
||||
|
||||
this.api.put_ListType(0, parseInt(type));
|
||||
},
|
||||
|
||||
onNumber: function (e) {
|
||||
var $number = $(e.currentTarget),
|
||||
type = $number.data('type');
|
||||
|
||||
$('.dataview.numbers li').removeClass('active');
|
||||
$number.addClass('active');
|
||||
|
||||
this.api.put_ListType(1, parseInt(type));
|
||||
},
|
||||
|
||||
onTextColorAuto: function (e) {
|
||||
var me = this,
|
||||
paletteTextColor = me.getView('EditText').paletteTextColor;
|
||||
|
||||
if (paletteTextColor) {
|
||||
paletteTextColor.clearSelection();
|
||||
}
|
||||
|
||||
if (this.api) {
|
||||
this.api.put_TextColor(Common.Utils.ThemeColor.getRgbColor("000000"));
|
||||
}
|
||||
},
|
||||
|
||||
onTextColor: function (palette, color) {
|
||||
// $('.btn-color-value-line', this.toolbar.btnFontColor.cmpEl).css('background-color', '#' + clr);
|
||||
|
||||
if (this.api) {
|
||||
this.api.put_TextColor(Common.Utils.ThemeColor.getRgbColor(color));
|
||||
}
|
||||
},
|
||||
|
||||
onBackgroundColor: function (palette, color) {
|
||||
if (this.api) {
|
||||
if (color == 'transparent') {
|
||||
this.api.put_ParagraphShade(false);
|
||||
} else {
|
||||
this.api.put_ParagraphShade(true, Common.Utils.ThemeColor.getRgbColor(color));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// API handlers
|
||||
|
||||
onApiFocusObject: function (objects) {
|
||||
_stack = objects;
|
||||
|
||||
var paragraphs = [];
|
||||
|
||||
_.each(_stack, function(object) {
|
||||
if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Paragraph) {
|
||||
paragraphs.push(object);
|
||||
}
|
||||
});
|
||||
|
||||
if (paragraphs.length > 0) {
|
||||
var object = paragraphs[paragraphs.length - 1]; // get top
|
||||
_paragraphObject = object.get_ObjectValue();
|
||||
} else {
|
||||
_paragraphObject = undefined;
|
||||
}
|
||||
},
|
||||
|
||||
onApiChangeFont: function(font) {
|
||||
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getName()) || this.textFonts;
|
||||
_fontInfo.name = name;
|
||||
|
||||
$('#font-fonts .item-title').html(name);
|
||||
},
|
||||
|
||||
onApiFontSize: function(size) {
|
||||
_fontInfo.size = size;
|
||||
var displaySize = _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);
|
||||
},
|
||||
|
||||
onApiBold: function(on) {
|
||||
$('#font-bold').toggleClass('active', on);
|
||||
},
|
||||
|
||||
onApiItalic: function(on) {
|
||||
$('#font-italic').toggleClass('active', on);
|
||||
},
|
||||
|
||||
onApiUnderline: function(on) {
|
||||
$('#font-underline').toggleClass('active', on);
|
||||
},
|
||||
|
||||
onApiStrikeout: function(on) {
|
||||
$('#font-strikethrough').toggleClass('active', on);
|
||||
},
|
||||
|
||||
onApiBullets: function(data) {
|
||||
var type = data.get_ListType(),
|
||||
subtype = data.get_ListSubType();
|
||||
|
||||
switch (type) {
|
||||
case 0:
|
||||
$('.dataview.bullets li[data-type=' + subtype + ']').addClass('active');
|
||||
break;
|
||||
case 1:
|
||||
$('.dataview.numbers li[data-type=' + subtype + ']').addClass('active');
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
onApiParagraphAlign: function(align) {
|
||||
$('#font-right').toggleClass('active', align===0);
|
||||
$('#font-left').toggleClass('active', align===1);
|
||||
$('#font-center').toggleClass('active', align===2);
|
||||
$('#font-just').toggleClass('active', align===3);
|
||||
},
|
||||
|
||||
onApiVerticalAlign: function(typeBaseline) {
|
||||
var value;
|
||||
|
||||
typeBaseline==1 && (value = 'superscript');
|
||||
typeBaseline==2 && (value = 'subscript');
|
||||
|
||||
if (!_.isUndefined(value)) {
|
||||
$('#text-additional input[name=text-script]').val([value]).prop('prevValue', value);
|
||||
}
|
||||
},
|
||||
|
||||
onApiTextColor: function (color) {
|
||||
var me = this;
|
||||
|
||||
if (color.get_auto()) {
|
||||
$('#font-color .color-preview').css('background-color', '#000');
|
||||
} else {
|
||||
var palette = me.getView('EditText').paletteTextColor,
|
||||
clr;
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
$('#font-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr));
|
||||
}
|
||||
|
||||
if (palette) {
|
||||
palette.select(clr);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onApiLineSpacing: function(vc) {
|
||||
var line = (vc.get_Line() === null || vc.get_LineRule() === null || vc.get_LineRule() != 1) ? -1 : vc.get_Line();
|
||||
|
||||
$('#page-text-linespacing input').val([line]);
|
||||
},
|
||||
|
||||
onApiTextShd: function(shd) {
|
||||
var color = shd.get_Color(),
|
||||
uiColor;
|
||||
|
||||
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
uiColor = {
|
||||
color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()),
|
||||
effectValue: color.get_value()
|
||||
}
|
||||
} else {
|
||||
uiColor = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
|
||||
}
|
||||
|
||||
$('#font-background .color-preview').css('background-color', '#' + (_.isObject(uiColor) ? uiColor.color : uiColor));
|
||||
|
||||
var palette = this.getView('EditText').paletteBackgroundColor;
|
||||
|
||||
if (palette) {
|
||||
palette.select(uiColor);
|
||||
}
|
||||
},
|
||||
|
||||
// Helpers
|
||||
_toggleButton: function (e) {
|
||||
return $(e.currentTarget).toggleClass('active').hasClass('active');
|
||||
},
|
||||
|
||||
textFonts: 'Fonts',
|
||||
textAuto: 'Auto',
|
||||
textPt: 'pt'
|
||||
}
|
||||
})(), DE.Controllers.EditText || {}))
|
||||
});
|
|
@ -1,71 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="addimage-root-view">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="add-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="add-image-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>
|
||||
|
||||
<!-- Url view -->
|
||||
<div id="addimage-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" id="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>
|
|
@ -1,387 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="addother-root-view">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<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-pagenumber" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-pagenumber"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textPageNumber %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li id="item-break">
|
||||
<a id="add-other-break" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-sectionbreak"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textBreak %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li id="item-footnote">
|
||||
<a id="add-other-footnote" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-footnote"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textFootnote %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Secton break view -->
|
||||
<div id="addother-sectionbreak">
|
||||
<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.textSectionBreak %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page" data-page="addother-sectionbreak">
|
||||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a data-type="next" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textNextPage %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="continuous" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textContPage %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="even" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textEvenPage %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="odd" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textOddPage %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Link view -->
|
||||
<div id="addother-link">
|
||||
<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.textAddLink %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page" data-page="addother-link">
|
||||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<div id="add-link-url" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label"><%= scope.textLink %></div>
|
||||
<div class="item-input">
|
||||
<input type="url" placeholder="<%= scope.textLink %>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="add-link-display" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label"><%= scope.textDisplay %></div>
|
||||
<div class="item-input">
|
||||
<input type="text" placeholder="<%= scope.textDisplay %>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="add-link-tip" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label"><%= scope.textTip %></div>
|
||||
<div class="item-input">
|
||||
<input type="text" placeholder="<%= scope.textTip %>">
|
||||
</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>
|
||||
|
||||
<!-- Page Number Position view -->
|
||||
<div id="addother-pagenumber">
|
||||
<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.textPosition %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page" data-page="addother-pagenumber">
|
||||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a data-type="lt" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textLeftTop %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="ct" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textCenterTop %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="rt" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textRightTop %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="lb" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textLeftBottom %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="cb" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textCenterBottom %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="rb" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textRightBottom %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="current" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textCurrentPos %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Page Insert Footnote view -->
|
||||
<div id="addother-insert-footnote">
|
||||
<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.textInsertFootnote %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page" data-page="addother-insert-footnote">
|
||||
<div class="page-content">
|
||||
<div class="content-block-title"><%= scope.textFormat %></div>
|
||||
<div id="list-format-footnote" class="list-block">
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="start-at-footnote" class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textStartFrom %></div>
|
||||
<div class="item-after splitter">
|
||||
<% if (!android) { %><label><%= scope.textAuto %></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><%= scope.textAuto %></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.textLocation %></div>
|
||||
<div id="position-footnote" class="list-block">
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-block" id="footnote-insert">
|
||||
<% if (android) { %>
|
||||
<a href="#" class="button button-fill button-raised" style="margin: 20px 16px;"><%= scope.textInsertFootnote %></a>
|
||||
<% } else { %>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#" class="list-button item-link"><%= scope.textInsertFootnote %></a>
|
||||
</li>
|
||||
</ul>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Page Insert Comment view -->
|
||||
<div id="addother-insert-comment">
|
||||
<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><%= scope.textBack %></span><% } %></a></div>
|
||||
<div class="center sliding"><%= scope.textAddComment %></div>
|
||||
<div class="right sliding"><a id="done-comment"><% if (android) { %><i class="icon icon-done-comment-white"></i><% } else { %><%= scope.textDone %><% } %></a></div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
<!-- Break view -->
|
||||
<div id="addother-insert-break">
|
||||
<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.textBreak %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page" data-page="addother-insert-break">
|
||||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="add-other-pagebreak" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-pagebreak"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textPageBreak %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="add-other-columnbreak" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-stringbreak"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textColumnBreak %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="add-other-section" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-sectionbreak"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSectionBreak %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -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('../mobile/resources/img/shapes/<%= shape.thumb %>')"></div>
|
||||
</li>
|
||||
<% }); %>
|
||||
</ul>
|
||||
<% }); %>
|
||||
</div>
|
||||
</div>
|
|
@ -1,12 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="add-table-root">
|
||||
<div class="page-content dataview table-styles">
|
||||
<ul class="row">
|
||||
<% _.each(styles, function(style) { %>
|
||||
<li data-type="<%= style.templateId %>">
|
||||
<img src="<%= style.imageUrl %>">
|
||||
</li>
|
||||
<% }); %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -1,390 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="edit-chart-root">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="chart-style" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textStyle %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="chart-wrap" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textWrap %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="chart-reorder" class="item-link">
|
||||
<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 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>
|
||||
|
||||
<!-- Wrap view -->
|
||||
<div id="edit-chart-wrap">
|
||||
<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.textWrap %></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 chart-wrap">
|
||||
<div class="page-content">
|
||||
<div class="list-block chart-wrap-types">
|
||||
<ul>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="chart-wrap" value="inline">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-inline"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textInline %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="chart-wrap" value="square">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-square"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSquare %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="chart-wrap" value="tight">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-tight"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textTight %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="chart-wrap" value="through">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-through"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textThrough %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="chart-wrap" value="top-bottom">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-top-bottom"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textTopBottom %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="chart-wrap" value="infront">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-infront"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textInFront %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="chart-wrap" value="behind">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-behind"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textBehind %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-block-title align"><%= scope.textAlign %></div>
|
||||
<div class="list-block align">
|
||||
<ul>
|
||||
<li id="edit-chart-align">
|
||||
<div class="item-content buttons">
|
||||
<div class="item-inner">
|
||||
<div class="row">
|
||||
<a data-type="left" class="button no-ripple"><i class="icon icon-text-align-left"></i></a>
|
||||
<a data-type="center" class="button no-ripple"><i class="icon icon-text-align-center"></i></a>
|
||||
<a data-type="right" class="button no-ripple"><i class="icon icon-text-align-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-block inline">
|
||||
<ul>
|
||||
<li id="edit-chart-movetext">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textMoveText %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="edit-chart-overlap">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textOverlap %></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 distance"><%= scope.textDistanceText %></div>
|
||||
<div class="list-block distance" style="margin-bottom: 40px;">
|
||||
<ul>
|
||||
<li id="table-distance">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-input">
|
||||
<div class="range-slider">
|
||||
<input type="range" min="0" max="200" value="0" step="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-after value">0 pt</div>
|
||||
</div>
|
||||
</div>
|
||||
</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 categories">
|
||||
<% if (android) { %>
|
||||
<div class="toolbar tabbar">
|
||||
<div data-page="index" class="toolbar-inner">
|
||||
<a href="#tab-chart-type" data-type="type" class="tab-link active"><%= scope.textType %></a>
|
||||
<a href="#tab-chart-style" data-type="style" class="tab-link"><%= scope.textStyle %></a>
|
||||
<a href="#tab-chart-fill" data-type="fill" class="tab-link"><%= scope.textFill %></a>
|
||||
<a href="#tab-chart-border" data-type="border" class="tab-link"><%= scope.textBorder %></a>
|
||||
</div>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<div class="buttons-row">
|
||||
<a href="#tab-chart-type" data-type="type" class="tab-link button active"><%= scope.textType %></a>
|
||||
<a href="#tab-chart-style" data-type="style" class="tab-link button"><%= scope.textStyle %></a>
|
||||
<a href="#tab-chart-fill" data-type="fill" class="tab-link button"><%= scope.textFill %></a>
|
||||
<a href="#tab-chart-border" data-type="border" class="tab-link button"><%= scope.textBorder %></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="pages">
|
||||
<div class="page" data-page="edit-chart-style">
|
||||
<div class="page-content tabs" style="padding-top: 0;">
|
||||
<div id="tab-chart-type" class="page-content tab active dataview chart-types">
|
||||
<% _.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%;">
|
||||
<!--Styles-->
|
||||
</div>
|
||||
<div id="tab-chart-fill" class="page-content tab">
|
||||
<!--Fill colors-->
|
||||
</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">
|
||||
<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>
|
||||
</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>
|
||||
|
||||
<!-- 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>
|
|
@ -1,79 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="edit-header-root">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li id="header-diff-first">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textDiffFirst %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="header-diff-odd">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textDiffOdd %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="header-same-as">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSameAs %></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.textPageNumbering %></div>
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li id="header-numbering-continue">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textPrev %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="header-numbering-start">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textFrom %></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>
|
|
@ -1,52 +0,0 @@
|
|||
<!-- Link view -->
|
||||
<div id="edit-link-root">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<div id="edit-link-url" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label"><%= scope.textLink %></div>
|
||||
<div class="item-input">
|
||||
<input type="url" placeholder="<%= scope.textLink %>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="edit-link-display" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label"><%= scope.textDisplay %></div>
|
||||
<div class="item-input">
|
||||
<input type="text" placeholder="<%= scope.textDisplay %>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="edit-link-tip" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label"><%= scope.textTip %></div>
|
||||
<div class="item-input">
|
||||
<input type="text" placeholder="<%= scope.textTip %>">
|
||||
</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.textEdit %></a>
|
||||
<a href="#" id="edit-link-remove" class="button button-raised button-fill" style="margin: 20px 16px; background-color: #f44336;"><%= scope.textRemove %></a>
|
||||
<% } else { %>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#" id="edit-link-edit" class="list-button item-link disabled" style="text-align: center;"><%= scope.textEdit %></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" id="edit-link-remove" class="list-button item-link" style="text-align: center; color: #f00"><%= scope.textRemove %></a>
|
||||
</li>
|
||||
</ul>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
|
@ -1,366 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="edit-image-root">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="image-wrap" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textWrap %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="image-replace" class="item-link">
|
||||
<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">
|
||||
<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-remove" class="button button-raised button-fill" style="margin: 20px 16px; background-color: #f44336;"><%= scope.textRemove %></a>
|
||||
<% } else { %>
|
||||
<a id="image-remove" class="item-link list-button" style="text-align: center; color: #f00"><%= scope.textRemove %></a>
|
||||
<% } %>
|
||||
</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">
|
||||
<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>
|
||||
|
||||
<!-- Wrap view -->
|
||||
<div id="edit-image-wrap-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.textWrap %></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-wrap">
|
||||
<div class="page-content">
|
||||
<div class="list-block image-wrap-types">
|
||||
<ul>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="image-wrap" value="inline">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-inline"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textInline %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="image-wrap" value="square">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-inline"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSquare %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="image-wrap" value="tight">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-tight"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textTight %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="image-wrap" value="through">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-through"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textThrough %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="image-wrap" value="top-bottom">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-top-bottom"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textTopBottom %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="image-wrap" value="infront">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-infront"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textInFront %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="image-wrap" value="behind">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-behind"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textBehind %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-block-title align"><%= scope.textAlign %></div>
|
||||
<div class="list-block align">
|
||||
<ul>
|
||||
<li id="edit-image-align">
|
||||
<div class="item-content buttons">
|
||||
<div class="item-inner">
|
||||
<div class="row">
|
||||
<a data-type="left" class="button no-ripple"><i class="icon icon-text-align-left"></i></a>
|
||||
<a data-type="center" class="button no-ripple"><i class="icon icon-text-align-center"></i></a>
|
||||
<a data-type="right" class="button no-ripple"><i class="icon icon-text-align-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-block inline">
|
||||
<ul>
|
||||
<li id="edit-image-movetext">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textMoveText %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="edit-image-overlap">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textOverlap %></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 distance"><%= scope.textDistanceText %></div>
|
||||
<div class="list-block distance" style="margin-bottom: 40px;">
|
||||
<ul>
|
||||
<li id="table-distance">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-input">
|
||||
<div class="range-slider">
|
||||
<input type="range" min="0" max="200" value="0" step="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-after value">0 pt</div>
|
||||
</div>
|
||||
</div>
|
||||
</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">
|
||||
<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">
|
||||
<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">
|
||||
<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>
|
|
@ -1,203 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="edit-paragraph-root">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="paragraph-background" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textBackground %></div>
|
||||
<div class="item-after"><div class="color-preview"></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="paragraph-advanced" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textAdvSettings %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-block-title"><%= scope.textPrgStyles %></div>
|
||||
<div id="paragraph-list" class="list-block">
|
||||
<ul></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Background color view -->
|
||||
<div id="edit-paragraph-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.textBackground %></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-paragraph-color">
|
||||
<div class="page-content">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Advanced view -->
|
||||
<div id="edit-paragraph-advanced">
|
||||
<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.textAdvanced %></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-paragraph-advanced">
|
||||
<div class="page-content">
|
||||
<div class="content-block-title"><%= scope.textFromText %></div>
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li id="paragraph-distance-before">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textBefore %></div>
|
||||
<div class="item-after splitter">
|
||||
<% if (!android) { %><label><%= scope.textAuto %></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><%= scope.textAuto %></label><% } %>
|
||||
<span class="button increment no-ripple"><% if (android) { %><i class="icon icon-expand-up"></i><% } else { %>+<% } %></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="paragraph-distance-after">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textAfter %></div>
|
||||
<div class="item-after splitter">
|
||||
<% if (!android) { %><label><%= scope.textAuto %></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><%= scope.textAuto %></label><% } %>
|
||||
<span class="button increment no-ripple"><% if (android) { %><i class="icon icon-expand-up"></i><% } else { %>+<% } %></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="paragraph-spin-first-line">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textFirstLine %></div>
|
||||
<div class="item-after splitter">
|
||||
<% if (!android) { %><label><%= scope.textAuto %></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><%= scope.textAuto %></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="list-block">
|
||||
<ul>
|
||||
<li id="paragraph-space">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSpaceBetween %></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 id="paragraph-page-break">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textPageBreak %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="paragraph-page-orphan">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textOrphan %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="paragraph-page-keeptogether">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textKeepLines %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="paragraph-page-keepnext">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textKeepNext %></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>
|
||||
|
||||
<!-- Custom color view -->
|
||||
<div id="edit-paragraph-custom-color-view">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner" data-page="edit-paragraph-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-paragraph-custom-color">
|
||||
<div class="page-content">
|
||||
<!--Color HSB palette-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,465 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="edit-shape-root">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="shape-style" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textStyle %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="shape-wrap" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textWrap %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="shape-replace" class="item-link">
|
||||
<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">
|
||||
<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">
|
||||
<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">
|
||||
<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('../mobile/resources/img/shapes/<%= shape.thumb %>')"></div>
|
||||
</li>
|
||||
<% }); %>
|
||||
</ul>
|
||||
<% }); %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Wrap view -->
|
||||
<div id="edit-shape-wrap">
|
||||
<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.textWrap %></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-wrap">
|
||||
<div class="page-content">
|
||||
<div class="list-block shape-wrap-types">
|
||||
<ul>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="shape-wrap" value="inline">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-inline"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textInline %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="shape-wrap" value="square">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-square"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSquare %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="shape-wrap" value="tight">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-tight"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textTight %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="shape-wrap" value="through">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-through"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textThrough %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="shape-wrap" value="top-bottom">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-top-bottom"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textTopAndBottom %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="shape-wrap" value="infront">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-infront"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textInFront %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="shape-wrap" value="behind">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-behind"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textBehind %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-block-title align"><%= scope.textAlign %></div>
|
||||
<div class="list-block align">
|
||||
<ul>
|
||||
<li id="edit-shape-align">
|
||||
<div class="item-content buttons">
|
||||
<div class="item-inner">
|
||||
<div class="row">
|
||||
<a data-type="left" class="button no-ripple"><i class="icon icon-text-align-left"></i></a>
|
||||
<a data-type="center" class="button no-ripple"><i class="icon icon-text-align-center"></i></a>
|
||||
<a data-type="right" class="button no-ripple"><i class="icon icon-text-align-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-block inline">
|
||||
<ul>
|
||||
<li id="edit-shape-movetext">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textWithText %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="edit-shape-overlap">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textOverlap %></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 distance"><%= scope.textFromText %></div>
|
||||
<div class="list-block distance" style="margin-bottom: 40px;">
|
||||
<ul>
|
||||
<li id="table-distance">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-input">
|
||||
<div class="range-slider">
|
||||
<input type="range" min="0" max="200" value="0" step="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-after value">0 pt</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</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">
|
||||
<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">
|
||||
<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">
|
||||
<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 back-fill"><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>
|
|
@ -1,467 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="edit-table-root">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li id="table-insert">
|
||||
<div class="item-content buttons">
|
||||
<div class="item-inner">
|
||||
<div class="row">
|
||||
<a id="insert-column-left" class="button no-ripple"><i class="icon icon-table-add-column-left"></i></a>
|
||||
<a id="insert-column-right" class="button no-ripple"><i class="icon icon-table-add-column-right"></i></a>
|
||||
<a id="insert-row-above" class="button no-ripple"><i class="icon icon-table-add-row-above"></i></a>
|
||||
<a id="insert-row-below" class="button no-ripple"><i class="icon icon-table-add-row-below"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="table-remove">
|
||||
<div class="item-content buttons">
|
||||
<div class="item-inner">
|
||||
<div class="row">
|
||||
<a id="remove-column" class="button no-ripple"><i class="icon icon-table-remove-column"></i></a>
|
||||
<a id="remove-row" class="button no-ripple"><i class="icon icon-table-remove-row"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<% if (!android) { %>
|
||||
<a id="table-remove-all" class="item-link list-button" style="text-align: center; color: #f00"><%= scope.textRemoveTable %></a>
|
||||
<% } %>
|
||||
</li>
|
||||
</ul>
|
||||
<% if (android) { %>
|
||||
<a id="table-remove-all" class="button button-raised button-fill" style="margin: 20px 16px; background-color: #f44336;"><%= scope.textRemoveTable %></a>
|
||||
<% } %>
|
||||
</div>
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="table-options" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textTableOptions %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="table-style" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textStyle %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="table-wrap" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textWrap %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Wrap view -->
|
||||
<div id="edit-table-wrap">
|
||||
<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.textWrap %></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" id="edit-tablewrap-page" data-page="edit-table-wrap">
|
||||
<div class="page-content">
|
||||
<div class="list-block" id="table-wrap-type">
|
||||
<ul>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="table-wrap" value="inline">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-table-inline"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textInline %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="table-wrap" value="flow">
|
||||
<% if (android) { %>
|
||||
<div class="item-media"><i class="icon icon-form-radio"></i></div>
|
||||
<% } else { %>
|
||||
<div class="item-media"><i class="icon icon-wrap-table-flow"></i></div>
|
||||
<% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textFlow %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li id="table-move-text">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textWithText %></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 flow"><%= scope.textFromText %></div>
|
||||
<div class="list-block flow" style="margin-bottom: 40px;">
|
||||
<ul>
|
||||
<li id="table-distance">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-input">
|
||||
<div class="range-slider">
|
||||
<input type="range" min="0" max="200" value="0" step="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-after value">0 pt</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-block-title inline"><%= scope.textAlign %></div>
|
||||
<div class="list-block inline" style="margin-bottom: 40px;">
|
||||
<ul>
|
||||
<li id="table-align">
|
||||
<div class="item-content buttons">
|
||||
<div class="item-inner">
|
||||
<div class="row">
|
||||
<a id="table-align-left" class="button no-ripple"><i class="icon icon-block-align-left"></i></a>
|
||||
<a id="table-align-center" class="button no-ripple"><i class="icon icon-block-align-center"></i></a>
|
||||
<a id="table-align-right" class="button no-ripple"><i class="icon icon-block-align-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Options view -->
|
||||
<div id="edit-table-options">
|
||||
<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.textOptions %></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-table-wrap">
|
||||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li id="table-option-repeatasheader">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textRepeatHeader %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="table-option-resizetofit">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textResizeFit %></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.textCellMargins %></div>
|
||||
<div class="list-block" style="margin-bottom: 40px;">
|
||||
<ul>
|
||||
<li id="table-options-margins">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-input">
|
||||
<div class="range-slider">
|
||||
<input type="range" min="0" max="150" value="0" step="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-after value">0 pt</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Styles view -->
|
||||
<div id="edit-table-style">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner edit-table-style" data-page="edit-table-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-table-style" data-type="style" class="tab-link active"><%= scope.textStyle %></a>
|
||||
<a href="#tab-table-fill" data-type="fill" class="tab-link"><%= scope.textFill %></a>
|
||||
<a href="#tab-table-border" data-type="border" class="tab-link"><%= scope.textBorder %></a>
|
||||
</div>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<div class="buttons-row">
|
||||
<a href="#tab-table-style" data-type="style" class="tab-link button active"><%= scope.textStyle %></a>
|
||||
<a href="#tab-table-fill" data-type="fill" class="tab-link button"><%= scope.textFill %></a>
|
||||
<a href="#tab-table-border" data-type="border" class="tab-link button"><%= scope.textBorder %></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-table-style">
|
||||
<div class="page-content tabs" style="padding-top: 0;">
|
||||
<div id="tab-table-style" class="page-content tab active">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li id="edit-table-styles">
|
||||
<div class="item-content">
|
||||
<div class="item-inner"></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-block" style="margin-bottom: 40px;">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="edit-table-style-options" class="item-link">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textStyleOptions %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-table-fill" class="page-content tab">
|
||||
<!--Fill colors-->
|
||||
</div>
|
||||
<div id="tab-table-border" class="page-content tab">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li id="edit-table-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-table-bordercolor" class="item-link">
|
||||
<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 id="edit-table-bordertypes">
|
||||
<div class="item-content buttons" style="-webkit-flex-flow: row wrap;justify-content: space-around;">
|
||||
<div class="item-inner" style="margin: 20px 0;">
|
||||
<div class="row">
|
||||
<a class="button no-ripple" style="min-width:0;" data-type="lrtbcm"><i class="icon icon-table-borders-all"></i></a>
|
||||
<a class="button no-ripple" style="min-width:0;" data-type=""><i class="icon icon-table-borders-none"></i></a>
|
||||
<a class="button no-ripple" style="min-width:0;" data-type="cm"><i class="icon icon-table-borders-inner"></i></a>
|
||||
<a class="button no-ripple" style="min-width:0;" data-type="lrtb"><i class="icon icon-table-borders-outer"></i></a>
|
||||
<a class="button no-ripple" style="min-width:0;" data-type="l"><i class="icon icon-table-borders-left"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-inner" style="margin: 0 0 20px;">
|
||||
<div class="row">
|
||||
<a class="button no-ripple" style="min-width:0;" data-type="c"><i class="icon icon-table-borders-center"></i></a>
|
||||
<a class="button no-ripple" style="min-width:0;" data-type="r"><i class="icon icon-table-borders-right"></i></a>
|
||||
<a class="button no-ripple" style="min-width:0;" data-type="t"><i class="icon icon-table-borders-top"></i></a>
|
||||
<a class="button no-ripple" style="min-width:0;" data-type="m"><i class="icon icon-table-borders-middle"></i></a>
|
||||
<a class="button no-ripple" style="min-width:0;" data-type="b"><i class="icon icon-table-borders-bottom"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Style options view -->
|
||||
<div id="edit-table-style-options-view">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner" data-page="edit-table-style-options">
|
||||
<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.textOptions %></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-table-style-options">
|
||||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li id="table-options-header-row">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textHeaderRow %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="table-options-total-row">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textTotalRow %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="table-options-banded-row">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textBandedRow %></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 id="table-options-first-column">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textFirstColumn %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="table-options-last-column">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textLastColumn %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="table-options-banded-column">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textBandedColumn %></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>
|
||||
|
||||
<!-- Style options view -->
|
||||
<div id="edit-table-border-color-view">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner" data-page="edit-table-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-table-border-color">
|
||||
<div class="page-content">
|
||||
<!--Color palette-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Custom color view -->
|
||||
<div id="edit-table-custom-color-view">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner" data-page="edit-table-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-table-custom-color">
|
||||
<div class="page-content">
|
||||
<!--Color HSB palette-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,426 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="edit-text-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>
|
||||
<a id="font-strikethrough" class="button" style="text-decoration: line-through"><%= scope.textCharacterStrikethrough %></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a id="font-color" class="item-link">
|
||||
<div class="item-content">
|
||||
<% if (!android) { %><div class="item-media"><i class="icon icon-text-color"><span class="color-preview"></span></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textFontColor %></div>
|
||||
<% if (android) { %><div class="item-after"><div class="color-preview"></div></div><% } %>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="font-background" class="item-link">
|
||||
<div class="item-content">
|
||||
<% if (!android) { %><div class="item-media"><i class="icon icon-text-selection"><span class="color-preview"></span></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textHighlightColor %></div>
|
||||
<% if (android) { %><div class="item-after"><div class="color-preview"></div></div><% } %>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="font-additional" class="item-link">
|
||||
<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.textAdditionalFormat %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li><div id="paragraph-align" class="item-content buttons">
|
||||
<div class="item-inner">
|
||||
<div class="row">
|
||||
<a id="font-left" class="button no-ripple"><i class="icon icon-text-align-left"></i></a>
|
||||
<a id="font-center" class="button no-ripple"><i class="icon icon-text-align-center"></i></a>
|
||||
<a id="font-right" class="button no-ripple"><i class="icon icon-text-align-right"></i></a>
|
||||
<a id="font-just" class="button no-ripple"><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-moveleft" class="button no-ripple"><i class="icon icon-de-indent"></i></a>
|
||||
<a id="font-moveright" class="button no-ripple"><i class="icon icon-in-indent"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div></li>
|
||||
<li><a id="font-bullets" class="item-link">
|
||||
<div class="item-content">
|
||||
<% if (!android) { %><div class="item-media"><i class="icon icon-bullets"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textBullets %></div>
|
||||
</div>
|
||||
</div></a></li>
|
||||
<li><a id="font-numbers" class="item-link">
|
||||
<div class="item-content">
|
||||
<% if (!android) { %><div class="item-media"><i class="icon icon-numbers"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textNumbers %></div>
|
||||
</div>
|
||||
</div></a></li>
|
||||
<li><a id="font-line-spacing" class="item-link">
|
||||
<div class="item-content">
|
||||
<% if (!android) { %><div class="item-media"><i class="icon icon-linespacing"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textLineSpacing %></div>
|
||||
</div>
|
||||
</div></a></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>
|
||||
|
||||
<!-- Font 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></a></div>
|
||||
<div class="center sliding"><%= scope.textFontColors %></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-color">
|
||||
<div class="page-content">
|
||||
<div class="list-block" style="<% if (!android) { %>margin-bottom: -36px;<% } %>">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="font-color-auto" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<div style="width:22px; height: 22px; background-color: #000;"></div>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textAutomatic %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Highlight color view -->
|
||||
<div id="edit-text-background">
|
||||
<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></a></div>
|
||||
<div class="center sliding"><%= scope.textHighlightColors %></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-background">
|
||||
<div class="page-content">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Additional view -->
|
||||
<div id="edit-text-additional">
|
||||
<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></a></div>
|
||||
<div class="center sliding"><%= scope.textAdditional %></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" id="page-text-additional" data-page="edit-text-additional">
|
||||
<div class="page-content">
|
||||
<div class="list-block" id="text-additional">
|
||||
<ul>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="text-strikethrough" value="strikethrough">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textStrikethrough %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="text-strikethrough" value="double-strikethrough">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textDblStrikethrough %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="text-script" value="superscript">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textDblSuperscript %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="text-script" value="subscript">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSubscript %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="text-caps" value="small">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSmallCaps %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="text-caps" value="all">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textAllCaps %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li id="letter-spacing" id="letter-spacing">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textLetterSpacing %></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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Line Spacing view -->
|
||||
<div id="edit-text-linespacing">
|
||||
<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></a></div>
|
||||
<div class="center sliding"><%= scope.textLineSpacing %></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" id="page-text-linespacing" data-page="edit-text-additional">
|
||||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="line-spacing" value="1">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">1.0</div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="line-spacing" value="1.15">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">1.15</div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="line-spacing" value="1.5">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">1.5</div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="line-spacing" value="2">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">2.0</div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="line-spacing" value="2.5">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">2.5</div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="line-spacing" value="3">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">3.0</div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bullets view -->
|
||||
<div id="edit-text-bullets">
|
||||
<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></a></div>
|
||||
<div class="center sliding"><%= scope.textBullets %></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" id="page-text-bullets">
|
||||
<div class="page-content dataview bullets">
|
||||
<% _.each(bullets, function(row) { %>
|
||||
<ul class="row">
|
||||
<% _.each(row, function(bullet) { %>
|
||||
<li data-type="<%= bullet.type %>">
|
||||
<% if (bullet.thumb.length < 1) { %>
|
||||
<div class="thumb" style="position: relative;"><label><%= scope.textNone %></label></div>
|
||||
<% } else { %>
|
||||
<div class="thumb" style="background-image:url('../mobile/resources/img/bullets/<%= bullet.thumb %>')"></div>
|
||||
<% } %>
|
||||
</li>
|
||||
<% }); %>
|
||||
</ul>
|
||||
<% }); %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Numbers view -->
|
||||
<div id="edit-text-numbers">
|
||||
<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></a></div>
|
||||
<div class="center sliding"><%= scope.textNumbers %></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" id="page-text-numbers">
|
||||
<div class="page-content dataview numbers">
|
||||
<% _.each(numbers, function(row) { %>
|
||||
<ul class="row">
|
||||
<% _.each(row, function(number) { %>
|
||||
<li data-type="<%= number.type %>">
|
||||
<% if (number.thumb.length < 1) { %>
|
||||
<div class="thumb" style="position: relative;"><label><%= scope.textNone %></label></div>
|
||||
<% } else { %>
|
||||
<div class="thumb" style="background-image:url('../mobile/resources/img/numbers/<%= number.thumb %>')"></div>
|
||||
<% } %>
|
||||
</li>
|
||||
<% }); %>
|
||||
</ul>
|
||||
<% }); %>
|
||||
</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>
|
|
@ -1,9 +0,0 @@
|
|||
<div class="views">
|
||||
<div class="view view-main">
|
||||
<div class="pages navbar-through">
|
||||
<div data-page="index" class="page">
|
||||
<div id="editor-container" class="page-content no-fastclick"><div id="editor_sdk" class="no-fastclick with-logo"></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,107 +0,0 @@
|
|||
<!--Toolbar 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="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<div id="search-case-sensitive" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textCase %></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-results" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textHighlight %></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>
|
|
@ -1,940 +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>
|
||||
<% } %>
|
||||
<li>
|
||||
<div id="settings-readermode" class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-reader"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textReader %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<% if (orthography) { %>
|
||||
<li>
|
||||
<a id="settings-orthography" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-spellcheck"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">Проверка правописания</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-document" class="item-link" data-page="#settings-document-view">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-doc-setup"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textDocumentSettings %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="settings-advanced" class="item-link" data-page="#settings-advanced-view">
|
||||
<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.textAdvancedSettings %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="settings-download-as" class="item-link" data-page="#settings-download-view">
|
||||
<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-download" class="item-link no-indicator">
|
||||
<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" data-page="#settings-info-view">
|
||||
<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" data-page="#settings-history-view">-->
|
||||
<!--<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" data-page="#settings-about-view">
|
||||
<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 Settings view -->
|
||||
<div id="settings-document-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.textDocumentSettings %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="page" data-page="settings-document-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="doc-orientation" value="true">
|
||||
<% 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="doc-orientation" value="false">
|
||||
<% 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-document-format" class="item-link item-content" data-page="#settings-document-formats-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>
|
||||
<a id="color-schemes" class="item-link item-content" data-page="#color-schemes-view">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<!-- Document Formats view -->
|
||||
<div id="settings-document-formats-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.textDocumentFormats %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="page" data-page="settings-document-formats-view">
|
||||
<div class="page-content">
|
||||
<div class="list-block media-list">
|
||||
<ul></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"><%= scope.textDocTitle %></div>
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li class="item-content">
|
||||
<div class="item-inner">
|
||||
<div id="settings-document-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-document-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-doc-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-doc-uploaded" class="item-title"><%= scope.textLoading %></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-block-title"><%= scope.textStatistic %></div>
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textPages %></div>
|
||||
<div class="item-after" id="statistic-pages">0</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textParagraphs %></div>
|
||||
<div class="item-after" id="statistic-paragraphs">0</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textWords %></div>
|
||||
<div class="item-after" id="statistic-words">0</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSymbols %></div>
|
||||
<div class="item-after" id="statistic-symbols">0</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSpaces %></div>
|
||||
<div class="item-after" id="statistic-spaces">0</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-doc-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-doc-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-doc-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-doc-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-doc-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-doc-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-doc-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-doc-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="65" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-format-docx"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">DOCX</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-format="513" 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="2305" 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="69" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-format-txt"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">TXT</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-format="68" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-format-rtf"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">RTF</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-format="67" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-format-odt"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">ODT</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-format="2051" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-format-html"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">HTML</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-format="76" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-format-dotx"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">DOTX</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-format="79" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<i class="icon icon-format-ott"></i>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title">OTT</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>DOCUMENT 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>
|
||||
|
||||
<!-- Advanced Settings view -->
|
||||
<div id="settings-advanced-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.textAdvancedSettings %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="page" data-page="settings-advanced-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="list-block">
|
||||
<ul>
|
||||
<div id="settings-spellcheck" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textSpellcheck %></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">
|
||||
<ul>
|
||||
<div id="settings-no-characters" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textNoCharacters %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="settings-hidden-borders" class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textHiddenTableBorders %></div>
|
||||
<div class="item-after">
|
||||
<label class="label-switch">
|
||||
<input type="checkbox">
|
||||
<div class="checkbox"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
||||
<a id="settings-macros" class="item-link item-content" data-page="#macros-settings-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>
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<!-- 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="document-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="document-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="document-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="document-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>
|
||||
|
||||
<!-- Macros Settings view -->
|
||||
<div id="macros-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.textMacrosSettings %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="page page-macros-settings" data-page="macros-settings-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>
|
|
@ -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>
|
|
@ -1,141 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin 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';
|
||||
|
||||
DE.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() {
|
||||
//
|
||||
},
|
||||
|
||||
// Render layout
|
||||
render: function() {
|
||||
var el = $(this.el);
|
||||
|
||||
if (el.length > 0 && el.find('#' + _anchorId).length < 1) {
|
||||
el.append(this.template());
|
||||
}
|
||||
|
||||
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(''));
|
||||
|
||||
$('#' + _anchorId)
|
||||
.css('left', posX)
|
||||
.css('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, $('#' + _anchorId));
|
||||
|
||||
if (Common.SharedSettings.get('android')) {
|
||||
Common.Utils.androidMenuTop($(popover), $('#' + _anchorId));
|
||||
}
|
||||
|
||||
$('.modal-overlay').removeClass('modal-overlay-visible');
|
||||
|
||||
$('.document-menu li').single('click', _.buffered(function(e) {
|
||||
var $target = $(e.currentTarget),
|
||||
eventName = $target.data('event');
|
||||
|
||||
this.fireEvent('contextmenu:click', [this, eventName]);
|
||||
}, 100, this));
|
||||
},
|
||||
|
||||
hideMenu: function () {
|
||||
if ($('.document-menu').length > 0) {
|
||||
$('#' + _anchorId)
|
||||
.css('left', -1000)
|
||||
.css('top', -1000);
|
||||
|
||||
uiApp.closeModal('.document-menu.modal-in');
|
||||
} else if ($('.actions-modal').length > 0) {
|
||||
uiApp.closeModal('.actions-modal.modal-in');
|
||||
}
|
||||
}
|
||||
}
|
||||
})());
|
||||
});
|
|
@ -1,81 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 9/22/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/Editor.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (editorTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.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;
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,200 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 11/15/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/Search.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (searchTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.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', '27px');
|
||||
}
|
||||
//$(me.el).find('.pages .page').first().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);
|
||||
|
||||
searchBar = $$('.searchbar.document');
|
||||
|
||||
if ($('.logo-navbar').length > 0) {
|
||||
var top = Common.SharedSettings.get('android') ? '80px' : '68px';
|
||||
$('.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);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
textFind: 'Find',
|
||||
textFindAndReplace: 'Find and Replace',
|
||||
textDone: 'Done',
|
||||
textSearch: 'Search',
|
||||
textReplace: 'Replace',
|
||||
textCase: 'Case sensitive',
|
||||
textHighlight: 'Highlight results'
|
||||
}
|
||||
})(), DE.Views.Search || {}))
|
||||
});
|
|
@ -1,350 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/7/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/Settings.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (settingsTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.Settings = Backbone.View.extend(_.extend((function() {
|
||||
// private
|
||||
var _isEdit = false,
|
||||
_canEdit = false,
|
||||
_canDownload = false,
|
||||
_canDownloadOrigin = false,
|
||||
_canReader = false,
|
||||
_canAbout = true,
|
||||
_canHelp = true,
|
||||
_canPrint = false,
|
||||
_canReview = false,
|
||||
_isReviewOnly = 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));
|
||||
this.on('page:show', _.bind(this.updateItemHandlers, this));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
Common.Utils.addScrollIfNeed('.view[data-page=settings-root-view] .pages', '.view[data-page=settings-root-view] .page');
|
||||
me.updateItemHandlers();
|
||||
me.initControls();
|
||||
},
|
||||
|
||||
// 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,
|
||||
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;
|
||||
_canDownloadOrigin = mode.canDownloadOrigin;
|
||||
_canReader = !mode.isEdit && mode.canReader;
|
||||
_canPrint = mode.canPrint;
|
||||
_canReview = mode.canReview;
|
||||
_isReviewOnly = mode.isReviewOnly;
|
||||
|
||||
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 $layour = this.layout.find('#settings-root-view'),
|
||||
isPhone = Common.SharedSettings.get('phone');
|
||||
|
||||
if (_isEdit) {
|
||||
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
|
||||
} else {
|
||||
$layour.find('#settings-document').hide();
|
||||
$layour.find('#color-schemes').hide();
|
||||
$layour.find('#settings-spellcheck').hide();
|
||||
$layour.find('#settings-orthography').hide();
|
||||
}
|
||||
if (!_canReader)
|
||||
$layour.find('#settings-readermode').hide();
|
||||
else {
|
||||
$layour.find('#settings-readermode input:checkbox')
|
||||
.prop('checked', Common.SharedSettings.get('readerMode'));
|
||||
}
|
||||
if (!_canDownload) $layour.find('#settings-download-as').hide();
|
||||
if (!_canDownloadOrigin) $layour.find('#settings-download').hide();
|
||||
if (!_canAbout) $layour.find('#settings-about').hide();
|
||||
if (!_canHelp) $layour.find('#settings-help').hide();
|
||||
if (!_canPrint) $layour.find('#settings-print').hide();
|
||||
if (!_canReview) $layour.find('#settings-review').hide();
|
||||
if (_isReviewOnly) $layour.find('#settings-review').addClass('disabled');
|
||||
if (!_isShowMacros) $layour.find('#settings-macros').hide();
|
||||
|
||||
return $layour.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
initControls: function() {
|
||||
//
|
||||
},
|
||||
|
||||
updateItemHandlers: function () {
|
||||
var selectorsDynamicPage = [
|
||||
'.page[data-page=settings-root-view]',
|
||||
'.page[data-page=settings-document-view]',
|
||||
'.page[data-page=settings-advanced-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 = DE.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()
|
||||
});
|
||||
|
||||
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);
|
||||
}
|
||||
},
|
||||
|
||||
renderPageSizes: function(sizes, selectIndex) {
|
||||
var $pageFormats = $('.page[data-page=settings-document-formats-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="document-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(''));
|
||||
},
|
||||
|
||||
loadDocument: function(data) {
|
||||
var permissions = {};
|
||||
|
||||
if (data.doc) {
|
||||
permissions = _.extend(permissions, data.doc.permissions);
|
||||
|
||||
if (permissions.edit === false) {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
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);
|
||||
}
|
||||
},
|
||||
|
||||
textFindAndReplace: 'Find and Replace',
|
||||
textSettings: 'Settings',
|
||||
textDone: 'Done',
|
||||
textFind: 'Find',
|
||||
textEditDoc: 'Edit Document',
|
||||
textReader: 'Reader Mode',
|
||||
textDownload: 'Download',
|
||||
textDocInfo: 'Document Info',
|
||||
textHelp: 'Help',
|
||||
textAbout: 'About',
|
||||
textBack: 'Back',
|
||||
textDocTitle: 'Document title',
|
||||
textLoading: 'Loading...',
|
||||
textAuthor: 'Author',
|
||||
textCreateDate: 'Create date',
|
||||
textStatistic: 'Statistic',
|
||||
textPages: 'Pages',
|
||||
textParagraphs: 'Paragraphs',
|
||||
textWords: 'Words',
|
||||
textSymbols: 'Symbols',
|
||||
textSpaces: 'Spaces',
|
||||
textDownloadAs: 'Download As...',
|
||||
textVersion: 'Version',
|
||||
textAddress: 'address',
|
||||
textEmail: 'email',
|
||||
textTel: 'tel',
|
||||
textDocumentSettings: 'Document Settings',
|
||||
textPortrait: 'Portrait',
|
||||
textLandscape: 'Landscape',
|
||||
textFormat: 'Format',
|
||||
textCustom: 'Custom',
|
||||
textCustomSize: 'Custom Size',
|
||||
textDocumentFormats: 'Document Formats',
|
||||
textOrientation: 'Orientation',
|
||||
textPoweredBy: 'Powered by',
|
||||
textSpellcheck: 'Spell Checking',
|
||||
textPrint: 'Print',
|
||||
textReview: 'Review',
|
||||
textMargins: 'Margins',
|
||||
textTop: 'Top',
|
||||
textLeft: 'Left',
|
||||
textBottom: 'Bottom',
|
||||
textRight: 'Right',
|
||||
textAdvancedSettings: 'Application Settings',
|
||||
textUnitOfMeasurement: 'Unit of Measurement',
|
||||
textCentimeter: 'Centimeter',
|
||||
textPoint: 'Point',
|
||||
textInch: 'Inch',
|
||||
textColorSchemes: 'Color Schemes',
|
||||
textNoCharacters: 'Nonprinting Characters',
|
||||
textHiddenTableBorders: 'Hidden Table Borders',
|
||||
textCollaboration: 'Collaboration',
|
||||
textCommentingDisplay: 'Commenting Display',
|
||||
textDisplayComments: 'Comments',
|
||||
textDisplayResolvedComments: 'Resolved Comments',
|
||||
textSubject: 'Subject',
|
||||
textTitle: 'Title',
|
||||
textComment: 'Comment',
|
||||
textOwner: 'Owner',
|
||||
textApplication : 'Application',
|
||||
textLocation: 'Location',
|
||||
textUploaded: 'Uploaded',
|
||||
textLastModified: 'Last Modified',
|
||||
textLastModifiedBy: 'Last Modified By',
|
||||
textCreated: 'Created',
|
||||
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'
|
||||
|
||||
|
||||
}
|
||||
})(), DE.Views.Settings || {}))
|
||||
});
|
|
@ -1,167 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 9/23/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/Toolbar.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (toolbarTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.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;
|
||||
|
||||
Common.NotificationCenter.on('readermode:change', function (reader) {
|
||||
if (reader) {
|
||||
me.hideSearch();
|
||||
$('#toolbar-search').addClass('disabled');
|
||||
} else {
|
||||
$('#toolbar-search').removeClass('disabled');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 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,
|
||||
scope : me,
|
||||
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');
|
||||
|
||||
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 () {
|
||||
DE.getController('Search').showSearch();
|
||||
},
|
||||
|
||||
hideSearch: function () {
|
||||
DE.getController('Search').hideSearch();
|
||||
},
|
||||
|
||||
// Editor
|
||||
showEdition: function () {
|
||||
DE.getController('EditContainer').showModal();
|
||||
},
|
||||
|
||||
// Inserts
|
||||
|
||||
showInserts: function () {
|
||||
DE.getController('AddContainer').showModal();
|
||||
},
|
||||
|
||||
// Settings
|
||||
showSettings: function () {
|
||||
DE.getController('Settings').showModal();
|
||||
},
|
||||
|
||||
//Collaboration
|
||||
showCollaboration: function () {
|
||||
DE.getController('Common.Controllers.Collaboration').showModal();
|
||||
},
|
||||
|
||||
editDocument: function () {
|
||||
Common.Gateway.requestEditRights();
|
||||
},
|
||||
|
||||
textBack: 'Back'
|
||||
}
|
||||
})(), DE.Views.Toolbar || {}))
|
||||
});
|
|
@ -1,132 +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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* AddImage.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/18/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/AddImage.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (addTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.AddImage = 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));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#add-image-url').single('click', _.bind(me.showImageUrl, 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) {
|
||||
return this.layout
|
||||
.find('#addimage-root-view')
|
||||
.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
initControls: function () {
|
||||
//
|
||||
},
|
||||
|
||||
showPage: function (templateId) {
|
||||
var rootView = DE.getController('AddContainer').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);
|
||||
}
|
||||
},
|
||||
|
||||
showImageUrl: function () {
|
||||
this.showPage('#addimage-url-view');
|
||||
},
|
||||
|
||||
textFromLibrary: 'Picture from Library',
|
||||
textFromURL: 'Picture from URL',
|
||||
textBack: 'Back',
|
||||
textLinkSettings: 'Link Settings',
|
||||
textAddress: 'Address',
|
||||
textImageURL: 'Image URL',
|
||||
textInsertImage: 'Insert Image'
|
||||
}
|
||||
})(), DE.Views.AddImage || {}))
|
||||
});
|
|
@ -1,296 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/17/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/AddOther.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (addTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.AddOther = 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));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#add-other-link').single('click', _.bind(me.showLink, me));
|
||||
$('#add-other-pagenumber').single('click', _.bind(me.showPagePosition, me));
|
||||
if (this.isDisableComment) {
|
||||
$('#item-comment').addClass('disabled');
|
||||
} else {
|
||||
$('#item-comment').removeClass('disabled');
|
||||
$('#add-other-comment').single('click', _.bind(me.showPageComment, me));
|
||||
}
|
||||
if (this.isDisableBreak) {
|
||||
$('#item-break').addClass('disabled');
|
||||
} else {
|
||||
$('#item-break').removeClass('disabled');
|
||||
$('#add-other-break').single('click', _.bind(me.showPageBreak, me));
|
||||
}
|
||||
if (this.isDisableFootnote) {
|
||||
$('#item-footnote').addClass('disabled');
|
||||
} else {
|
||||
$('#item-footnote').removeClass('disabled');
|
||||
$('#add-other-footnote').single('click', _.bind(me.showPageFootnote, 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 '';
|
||||
},
|
||||
|
||||
initControls: function () {
|
||||
//
|
||||
},
|
||||
|
||||
showPage: function (templateId, animate) {
|
||||
var rootView = DE.getController('AddContainer').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]);
|
||||
}
|
||||
},
|
||||
|
||||
showPageBreak: function() {
|
||||
this.showPage('#addother-insert-break');
|
||||
$('#add-other-section').single('click', _.bind(this.showSectionBreak, this));
|
||||
},
|
||||
|
||||
showSectionBreak: function () {
|
||||
this.showPage('#addother-sectionbreak');
|
||||
},
|
||||
|
||||
showLink: function (animate) {
|
||||
this.showPage('#addother-link', animate);
|
||||
|
||||
$('.page[data-page=addother-link] input[type=url]').single('input', _.bind(function(e) {
|
||||
$('#add-link-insert').toggleClass('disabled', _.isEmpty($('#add-link-url input').val()));
|
||||
}, this));
|
||||
|
||||
_.delay(function () {
|
||||
$('.page[data-page=addother-link] input[type=url]').focus();
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
showPagePosition: function () {
|
||||
this.showPage('#addother-pagenumber');
|
||||
},
|
||||
|
||||
showPageFootnote: function () {
|
||||
this.showPage('#addother-insert-footnote');
|
||||
},
|
||||
|
||||
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);
|
||||
},
|
||||
|
||||
renderNumFormat: function (dataFormat, selectFormat) {
|
||||
var $listFormat = $('#list-format-footnote ul'),
|
||||
items = [];
|
||||
|
||||
_.each(dataFormat, function (formatItem) {
|
||||
var itemTemplate = [
|
||||
'<li>',
|
||||
'<label class="label-radio item-content">',
|
||||
'<input type="radio" name="doc-footnote-format" data-value="<%= item.value %>" <% if (item.value == select) { %>checked="checked"<% } %> >',
|
||||
'<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>',
|
||||
'<div class="item-inner">',
|
||||
'<div class="item-title"><%= item.text %></div>',
|
||||
'</div>',
|
||||
'</label>',
|
||||
'</li>'
|
||||
].join('');
|
||||
items.push(_.template(itemTemplate)({
|
||||
android: Framework7.prototype.device.android,
|
||||
item: formatItem,
|
||||
select: selectFormat
|
||||
}));
|
||||
});
|
||||
|
||||
$listFormat.html(items);
|
||||
},
|
||||
|
||||
renderFootnotePos: function (dataPosition, selectPosition) {
|
||||
var $listPos = $('#position-footnote ul'),
|
||||
items = [];
|
||||
|
||||
_.each(dataPosition, function (posItem) {
|
||||
var itemTemplate = [
|
||||
'<li>',
|
||||
'<label class="label-radio item-content">',
|
||||
'<input type="radio" name="doc-footnote-pos" data-value="<%= item.value%>" <% if (item.value == select) { %>checked="checked"<% } %> >',
|
||||
'<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>',
|
||||
'<div class="item-inner">',
|
||||
'<div class="item-title"><%= item.displayValue %></div>',
|
||||
'</div>',
|
||||
'</label>',
|
||||
'</li>'
|
||||
].join('');
|
||||
items.push(_.template(itemTemplate)({
|
||||
android: Framework7.prototype.device.android,
|
||||
item: posItem,
|
||||
select: selectPosition
|
||||
}));
|
||||
});
|
||||
|
||||
$listPos.html(items);
|
||||
},
|
||||
|
||||
textPageBreak: 'Page Break',
|
||||
textSectionBreak: 'Section Break',
|
||||
textColumnBreak: 'Column Break',
|
||||
textLink: 'Link',
|
||||
textPageNumber: 'Page Number',
|
||||
textBack: 'Back',
|
||||
textAddLink: 'Add Link',
|
||||
textDisplay: 'Display',
|
||||
textTip: 'Screen Tip',
|
||||
textInsert: 'Insert',
|
||||
textPosition: 'Position',
|
||||
textLeftTop: 'Left Top',
|
||||
textCenterTop: 'Center Top',
|
||||
textRightTop: 'Right Top',
|
||||
textLeftBottom: 'Left Bottom',
|
||||
textCenterBottom: 'Center Bottom',
|
||||
textRightBottom: 'Right Bottom',
|
||||
textCurrentPos: 'Current Position',
|
||||
textNextPage: 'Next Page',
|
||||
textContPage: 'Continuous Page',
|
||||
textEvenPage: 'Even Page',
|
||||
textOddPage: 'Odd Page',
|
||||
textFootnote: 'Footnote',
|
||||
textInsertFootnote: 'Insert Footnote',
|
||||
textFormat: 'Format',
|
||||
textStartFrom: 'Start At',
|
||||
textLocation: 'Location',
|
||||
textComment: 'Comment',
|
||||
textAddComment: 'Add Comment',
|
||||
textDone: 'Done',
|
||||
textBreak: 'Break'
|
||||
|
||||
}
|
||||
})(), DE.Views.AddOther || {}))
|
||||
});
|
|
@ -1,98 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/18/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/AddShape.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (addTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.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 () {
|
||||
this.initControls();
|
||||
},
|
||||
|
||||
// Render layout
|
||||
render: function () {
|
||||
this.layout = $('<div/>').append(this.template({
|
||||
android : Common.SharedSettings.get('android'),
|
||||
phone : Common.SharedSettings.get('phone'),
|
||||
shapes : Common.SharedSettings.get('shapes')
|
||||
}));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
rootLayout: function () {
|
||||
if (this.layout) {
|
||||
return this.layout
|
||||
.find('#add-shapes-root')
|
||||
.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
initControls: function () {
|
||||
//
|
||||
}
|
||||
}
|
||||
})(), DE.Views.AddShape || {}))
|
||||
});
|
|
@ -1,105 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/17/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/AddTable.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (addTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.AddTable = 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));
|
||||
},
|
||||
|
||||
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'),
|
||||
styles : DE.getController('AddTable').getStyles()
|
||||
}));
|
||||
|
||||
var $tableStyles = $('.container-add .table-styles');
|
||||
if ($tableStyles) {
|
||||
$tableStyles.replaceWith(this.layout.find('#add-table-root').html());
|
||||
}
|
||||
|
||||
this.fireEvent('view:render', this);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
rootLayout: function () {
|
||||
if (this.layout) {
|
||||
return this.layout
|
||||
.find('#add-table-root')
|
||||
.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
initControls: function () {
|
||||
//
|
||||
}
|
||||
}
|
||||
})(), DE.Views.AddTable || {}))
|
||||
});
|
|
@ -1,352 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 11/7/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/EditChart.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (editTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.EditChart = Backbone.View.extend(_.extend((function() {
|
||||
// private
|
||||
var _styles = [];
|
||||
|
||||
var _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 () {
|
||||
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
|
||||
Common.NotificationCenter.on('editcategory:show', _.bind(this.categoryShow, this));
|
||||
Common.NotificationCenter.on('chartstyles:load', _.bind(this.onStylesLoad, this));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#chart-style').single('click', _.bind(me.showStyle, me));
|
||||
$('#chart-wrap').single('click', _.bind(me.showWrap, me));
|
||||
$('#chart-reorder').single('click', _.bind(me.showReorder, me));
|
||||
$('#edit-chart-bordercolor').single('click', _.bind(me.showBorderColor, me));
|
||||
|
||||
$('.edit-chart-style .categories a').single('click', _.bind(me.showStyleCategory, me));
|
||||
|
||||
Common.Utils.addScrollIfNeed('#edit-chart .pages', '#edit-chart .page');
|
||||
me.initControls();
|
||||
me.renderStyles();
|
||||
},
|
||||
|
||||
categoryShow: function(e) {
|
||||
//
|
||||
},
|
||||
|
||||
onStylesLoad: function () {
|
||||
_styles = Common.SharedSettings.get('chartstyles');
|
||||
this.renderStyles();
|
||||
},
|
||||
|
||||
// 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 () {
|
||||
//
|
||||
},
|
||||
|
||||
showPage: function (templateId, suspendEvent) {
|
||||
var rootView = DE.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();
|
||||
}
|
||||
},
|
||||
|
||||
showStyleCategory: function (e) {
|
||||
// remove android specific style
|
||||
$('.page[data-page=edit-chart-style] .list-block.inputs-list').removeClass('inputs-list');
|
||||
},
|
||||
|
||||
renderStyles: function() {
|
||||
var $styleContainer = $('#tab-chart-style');
|
||||
|
||||
if ($styleContainer.length > 0) {
|
||||
var columns = parseInt($styleContainer.width() / 70), // magic
|
||||
row = -1,
|
||||
styles = [];
|
||||
|
||||
_.each(_styles, 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);
|
||||
}
|
||||
},
|
||||
|
||||
showStyle: function () {
|
||||
var me = this;
|
||||
var selector = '#edit-chart-style';
|
||||
this.showPage(selector, 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-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-color').single('click', _.bind(this.showCustomFillColor, this));
|
||||
|
||||
|
||||
this.fireEvent('page:show', [this, selector]);
|
||||
},
|
||||
|
||||
showWrap: function () {
|
||||
this.showPage('#edit-chart-wrap');
|
||||
Common.Utils.addScrollIfNeed('.page.chart-wrap', '.page.chart-wrap .page-content');
|
||||
},
|
||||
|
||||
showReorder: function () {
|
||||
this.showPage('#edit-chart-reorder');
|
||||
Common.Utils.addScrollIfNeed('.page.chart-reorder', '.page.chart-reorder .page-content');
|
||||
},
|
||||
|
||||
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]);
|
||||
},
|
||||
|
||||
showCustomFillColor: function() {
|
||||
var me = this,
|
||||
selector = '#edit-chart-custom-color-view';
|
||||
me.showPage(selector, true);
|
||||
|
||||
me.customColorPicker = new Common.UI.HsbColorPicker({
|
||||
el: $('.page[data-page=edit-chart-custom-color] .page-content'),
|
||||
color: me.paletteFillColor.currentColor
|
||||
});
|
||||
me.customColorPicker.on('addcustomcolor', function (colorPicker, color) {
|
||||
me.paletteFillColor.addNewDynamicColor(colorPicker, color);
|
||||
DE.getController('EditContainer').rootView.router.back();
|
||||
});
|
||||
|
||||
me.fireEvent('page:show', [me, 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);
|
||||
DE.getController('EditContainer').rootView.router.back();
|
||||
});
|
||||
|
||||
me.fireEvent('page:show', [me, selector]);
|
||||
},
|
||||
|
||||
textStyle: 'Style',
|
||||
textWrap: 'Wrap',
|
||||
textReorder: 'Reorder',
|
||||
textRemoveChart: 'Remove Chart',
|
||||
textBack: 'Back',
|
||||
textToForeground: 'Bring to Foreground',
|
||||
textToBackground: 'Send to Background',
|
||||
textForward: 'Move Forward',
|
||||
textBackward: 'Move Backward',
|
||||
textInline: 'Inline',
|
||||
textSquare: 'Square',
|
||||
textTight: 'Tight',
|
||||
textThrough: 'Through',
|
||||
textTopBottom: 'Top and Bottom',
|
||||
textInFront: 'In Front',
|
||||
textBehind: 'Behind',
|
||||
textAlign: 'Align',
|
||||
textMoveText: 'Move with Text',
|
||||
textOverlap: 'Allow Overlap',
|
||||
textDistanceText: 'Distance from Text',
|
||||
textType: 'Type',
|
||||
textFill: 'Fill',
|
||||
textBorder: 'Border',
|
||||
textSize: 'Size',
|
||||
textColor: 'Color',
|
||||
textAddCustomColor: 'Add Custom Color',
|
||||
textCustomColor: 'Custom Color'
|
||||
}
|
||||
})(), DE.Views.EditChart || {}))
|
||||
});
|
|
@ -1,121 +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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* EditHeader.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Julia Radzhabova on 2/15/19
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/EditHeader.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (editTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.EditHeader = Backbone.View.extend(_.extend((function() {
|
||||
// private
|
||||
|
||||
return {
|
||||
template: _.template(editTemplate),
|
||||
|
||||
events: {
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
DE.getController('EditHeader').initSettings();
|
||||
Common.Utils.addScrollIfNeed('#edit-header .pages', '#edit-header .page');
|
||||
},
|
||||
|
||||
// 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-header-root')
|
||||
.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
showPage: function (templateId, customFireEvent) {
|
||||
var rootView = DE.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 (customFireEvent !== true) {
|
||||
this.fireEvent('page:show', [this, templateId]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
textDiffFirst: 'Different first page',
|
||||
textDiffOdd: 'Different odd and even pages',
|
||||
textSameAs: 'Link to Previous',
|
||||
textPageNumbering: 'Page Numbering',
|
||||
textPrev: 'Continue from previous section',
|
||||
textFrom: 'Start at'
|
||||
}
|
||||
})(), DE.Views.EditHeader || {}))
|
||||
});
|
|
@ -1,107 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 11/7/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/EditHyperlink.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (editTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.EditHyperlink = 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));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
$('#edit-link-url input[type=url]').single('input', _.bind(function(e) {
|
||||
$('#edit-link-edit').toggleClass('disabled', _.isEmpty($(e.currentTarget).val()));
|
||||
}, this));
|
||||
Common.Utils.addScrollIfNeed('#edit-link .pages', '#edit-link .page');
|
||||
},
|
||||
|
||||
categoryShow: function(e) {
|
||||
//
|
||||
},
|
||||
|
||||
// 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 '';
|
||||
},
|
||||
|
||||
textLink: 'Link',
|
||||
textDisplay: 'Display',
|
||||
textTip: 'Screen Tip',
|
||||
textEdit: 'Save Link',
|
||||
textRemove: 'Remove Link'
|
||||
}
|
||||
})(), DE.Views.EditHyperlink || {}))
|
||||
});
|
|
@ -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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* EditImage.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 11/3/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/EditImage.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (editTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.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));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#image-wrap').single('click', _.bind(me.showWrap, me));
|
||||
$('#image-replace').single('click', _.bind(me.showReplace, me));
|
||||
$('#image-reorder').single('click', _.bind(me.showReorder, me));
|
||||
$('#edit-image-url').single('click', _.bind(me.showEditUrl, me));
|
||||
|
||||
Common.Utils.addScrollIfNeed('#edit-image .pages', '#edit-image .page');
|
||||
me.initControls();
|
||||
},
|
||||
|
||||
categoryShow: function(e) {
|
||||
//
|
||||
},
|
||||
|
||||
// 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 () {
|
||||
//
|
||||
},
|
||||
|
||||
showPage: function (templateId, suspendEvent) {
|
||||
var rootView = DE.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();
|
||||
}
|
||||
},
|
||||
|
||||
showWrap: function () {
|
||||
this.showPage('#edit-image-wrap-view');
|
||||
$('.image-wrap .list-block.inputs-list').removeClass('inputs-list');
|
||||
Common.Utils.addScrollIfNeed('.page.image-wrap', '.page.image-wrap .page-content');
|
||||
},
|
||||
|
||||
showReplace: function () {
|
||||
this.showPage('#edit-image-replace-view');
|
||||
},
|
||||
|
||||
showReorder: function () {
|
||||
this.showPage('#edit-image-reorder-view');
|
||||
Common.Utils.addScrollIfNeed('.page.image-reorder', '.page.image-reorder .page-content');
|
||||
},
|
||||
|
||||
showEditUrl: function () {
|
||||
this.showPage('#edit-image-url-view');
|
||||
|
||||
$('.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);
|
||||
Common.Utils.addScrollIfNeed('.page.edit-image-url-link', '.page.edit-image-url-link .page-content');
|
||||
},
|
||||
|
||||
textWrap: 'Wrap',
|
||||
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',
|
||||
textInline: 'Inline',
|
||||
textSquare: 'Square',
|
||||
textTight: 'Tight',
|
||||
textThrough: 'Through',
|
||||
textTopBottom: 'Top and Bottom',
|
||||
textInFront: 'In Front',
|
||||
textBehind: 'Behind',
|
||||
textAlign: 'Align',
|
||||
textMoveText: 'Move with Text',
|
||||
textOverlap: 'Allow Overlap',
|
||||
textDistanceText: 'Distance from Text',
|
||||
textFromLibrary: 'Picture from Library',
|
||||
textFromURL: 'Picture from URL',
|
||||
textLinkSettings: 'Link Settings',
|
||||
textAddress: 'Address',
|
||||
textImageURL: 'Image URL',
|
||||
textReplaceImg: 'Replace Image'
|
||||
}
|
||||
})(), DE.Views.EditImage || {}))
|
||||
});
|
|
@ -1,218 +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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* EditParagraph.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/14/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/EditParagraph.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (editTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.EditParagraph = Backbone.View.extend(_.extend((function() {
|
||||
// private
|
||||
// var _paragraphStyles;
|
||||
|
||||
return {
|
||||
// el: '.view-main',
|
||||
|
||||
template: _.template(editTemplate),
|
||||
|
||||
events: {
|
||||
// "click #font-fonts" : "showPage",
|
||||
// "click #font-color" : "showPage"
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#paragraph-background').single('click', _.bind(me.showColors, me));
|
||||
$('#paragraph-advanced').single('click', _.bind(me.showAdvanced, me));
|
||||
|
||||
me.renderStyles();
|
||||
|
||||
DE.getController('EditParagraph').initSettings();
|
||||
Common.Utils.addScrollIfNeed('#edit-paragraph .pages', '#edit-paragraph .page');
|
||||
},
|
||||
|
||||
// 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-paragraph-root')
|
||||
.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
showPage: function (templateId, customFireEvent) {
|
||||
var rootView = DE.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 (customFireEvent !== true) {
|
||||
this.fireEvent('page:show', [this, templateId]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
renderStyles: function () {
|
||||
var me = this,
|
||||
thumbSize = DE.getController('EditParagraph').getThumbSize(),
|
||||
$styleList = $('#paragraph-list ul'),
|
||||
template = _.template(
|
||||
'<li>' +
|
||||
'<label class="label-radio item-content">' +
|
||||
'<input type="radio" name="paragraph-style" value="<%= name %>">' +
|
||||
(Framework7.prototype.device.android ? '<div class="item-media"><i class="icon icon-form-radio"></i></div>' : '') +
|
||||
'<div class="item-inner">' +
|
||||
'<div data-name="<%= name %>" class="item-title style" style="background-image: url(<%= image %>); width:{0}px; height:{1}px; background-size:{0}px {1}px; background-repeat: no-repeat;"></div>'.format(thumbSize.width, thumbSize.height) +
|
||||
'</div>' +
|
||||
'</label>' +
|
||||
'</li>'
|
||||
);
|
||||
|
||||
_.each(DE.getController('EditParagraph').getStyles(), function(style) {
|
||||
$(template(style)).appendTo($styleList).on('click', _.buffered(function (e) {
|
||||
me.fireEvent('style:click', [me, e]);
|
||||
}, 100))
|
||||
});
|
||||
},
|
||||
|
||||
showColors: function () {
|
||||
var me = this;
|
||||
this.showPage('#edit-paragraph-color', true);
|
||||
|
||||
this.paletteBackgroundColor = new Common.UI.ThemeColorPalette({
|
||||
el: $('.page[data-page=edit-paragraph-color] .page-content'),
|
||||
transparent: true
|
||||
});
|
||||
this.paletteBackgroundColor.on('customcolor', function () {
|
||||
me.showCustomColor();
|
||||
});
|
||||
var template = _.template(['<div class="list-block">',
|
||||
'<ul>',
|
||||
'<li>',
|
||||
'<a id="edit-paragraph-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-paragraph-color] .page-content').append(template({scope: this}));
|
||||
$('#edit-paragraph-add-custom-color').single('click', _.bind(this.showCustomColor, this));
|
||||
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-paragraph-color]', '.page[data-page=edit-paragraph-color] .page-content');
|
||||
this.fireEvent('page:show', [this, '#edit-paragraph-color']);
|
||||
},
|
||||
|
||||
showAdvanced: function () {
|
||||
this.showPage('#edit-paragraph-advanced');
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-paragraph-advanced]', '.page[data-page=edit-paragraph-advanced] .page-content');
|
||||
},
|
||||
|
||||
showCustomColor: function () {
|
||||
var me = this,
|
||||
selector = '#edit-paragraph-custom-color-view';
|
||||
me.showPage(selector, true);
|
||||
|
||||
me.customColorPicker = new Common.UI.HsbColorPicker({
|
||||
el: $('.page[data-page=edit-paragraph-custom-color] .page-content'),
|
||||
color: me.paletteBackgroundColor.currentColor
|
||||
});
|
||||
me.customColorPicker.on('addcustomcolor', function (colorPicker, color) {
|
||||
me.paletteBackgroundColor.addNewDynamicColor(colorPicker, color);
|
||||
DE.getController('EditContainer').rootView.router.back();
|
||||
});
|
||||
|
||||
me.fireEvent('page:show', [me, selector]);
|
||||
},
|
||||
|
||||
textBackground: 'Background',
|
||||
textAdvSettings: 'Advanced settings',
|
||||
textPrgStyles: 'Paragraph styles',
|
||||
textBack: 'Back',
|
||||
textAdvanced: 'Advanced',
|
||||
textFromText: 'Distance from Text',
|
||||
textBefore: 'Before',
|
||||
textAuto: 'Auto',
|
||||
textFirstLine: 'First Line',
|
||||
textAfter: 'After',
|
||||
textSpaceBetween: 'Space Between Paragraphs',
|
||||
textPageBreak: 'Page Break Before',
|
||||
textOrphan: 'Orphan Control',
|
||||
textKeepLines: 'Keep Lines Together',
|
||||
textKeepNext: 'Keep with Next',
|
||||
textAddCustomColor: 'Add Custom Color',
|
||||
textCustomColor: 'Custom Color'
|
||||
}
|
||||
})(), DE.Views.EditParagraph || {}))
|
||||
});
|
|
@ -1,293 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/21/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/EditShape.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common/mobile/lib/component/HsbColorPicker'
|
||||
], function (editTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.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.isShapeCanFill = true;
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#shape-style').single('click', _.bind(me.showStyle, me));
|
||||
$('#shape-wrap').single('click', _.bind(me.showWrap, me));
|
||||
$('#shape-replace').single('click', _.bind(me.showReplace, me));
|
||||
$('#shape-reorder').single('click', _.bind(me.showReorder, me));
|
||||
$('#edit-shape-bordercolor').single('click', _.bind(me.showBorderColor, me));
|
||||
|
||||
$('.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'),
|
||||
shapes : shapes,
|
||||
scope : this
|
||||
}));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
rootLayout: function () {
|
||||
if (this.layout) {
|
||||
return this.layout
|
||||
.find('#edit-shape-root')
|
||||
.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
initControls: function () {
|
||||
//
|
||||
},
|
||||
|
||||
showPage: function (templateId, suspendEvent) {
|
||||
var rootView = DE.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();
|
||||
}
|
||||
},
|
||||
|
||||
showStyleCategory: function (e) {
|
||||
// remove android specific style
|
||||
$('.page[data-page=edit-shape-style] .list-block.inputs-list').removeClass('inputs-list');
|
||||
},
|
||||
|
||||
showStyle: function () {
|
||||
var me = this;
|
||||
var selector = this.isShapeCanFill ? '#edit-shape-style' : '#edit-shape-style-nofill';
|
||||
this.showPage(selector, true);
|
||||
|
||||
if (!this.isShapeCanFill)
|
||||
this.showStyleCategory();
|
||||
|
||||
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-shape-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(''));
|
||||
$('#tab-shape-fill').append(template({scope: this}));
|
||||
$('#edit-shape-add-custom-color').single('click', _.bind(this.showCustomFillColor, this));
|
||||
Common.Utils.addScrollIfNeed('.page.shape-style', '.page.shape-style .page-content');
|
||||
this.fireEvent('page:show', [this, selector]);
|
||||
},
|
||||
|
||||
showWrap: function () {
|
||||
this.showPage('#edit-shape-wrap');
|
||||
Common.Utils.addScrollIfNeed('.page.shape-wrap', '.page.shape-wrap .page-content');
|
||||
},
|
||||
|
||||
showReplace: function () {
|
||||
this.showPage('#edit-shape-replace');
|
||||
Common.Utils.addScrollIfNeed('.page.shape-replace', '.page.shape-replace .page-content');
|
||||
},
|
||||
|
||||
showReorder: function () {
|
||||
this.showPage('#edit-shape-reorder');
|
||||
Common.Utils.addScrollIfNeed('.page.shape-reorder', '.page.shape-reorder .page-content');
|
||||
},
|
||||
|
||||
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] .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] .page-content').append(template({scope: this}));
|
||||
$('#edit-shape-add-custom-border-color').single('click', _.bind(this.showCustomBorderColor, this));
|
||||
|
||||
this.fireEvent('page:show', [this, selector]);
|
||||
},
|
||||
|
||||
showCustomFillColor: function() {
|
||||
var me = this,
|
||||
selector = '#edit-shape-custom-color-view';
|
||||
me.showPage(selector, true);
|
||||
|
||||
me.customColorPicker = new Common.UI.HsbColorPicker({
|
||||
el: $('.page[data-page=edit-shape-custom-color] .page-content'),
|
||||
color: me.paletteFillColor.currentColor
|
||||
});
|
||||
me.customColorPicker.on('addcustomcolor', function (colorPicker, color) {
|
||||
me.paletteFillColor.addNewDynamicColor(colorPicker, color);
|
||||
DE.getController('EditContainer').rootView.router.back();
|
||||
});
|
||||
|
||||
me.fireEvent('page:show', [me, 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);
|
||||
DE.getController('EditContainer').rootView.router.back();
|
||||
});
|
||||
|
||||
me.fireEvent('page:show', [me, selector]);
|
||||
},
|
||||
|
||||
textStyle: 'Style',
|
||||
textWrap: 'Wrap',
|
||||
textReplace: 'Replace',
|
||||
textReorder: 'Reorder',
|
||||
textRemoveShape: 'Remove Shape',
|
||||
textBack: 'Back',
|
||||
textToForeground: 'Bring to Foreground',
|
||||
textToBackground: 'Send to Background',
|
||||
textForward: 'Move Forward',
|
||||
textBackward: 'Move Backward',
|
||||
textInline: 'Inline',
|
||||
textSquare: 'Square',
|
||||
textTight: 'Tight',
|
||||
textThrough: 'Through',
|
||||
textTopAndBottom: 'Top and Bottom',
|
||||
textInFront: 'In Front',
|
||||
textBehind: 'Behind',
|
||||
textAlign: 'Align',
|
||||
textWithText: 'Move with Text',
|
||||
textOverlap: 'Allow Overlap',
|
||||
textFromText: 'Distance from Text',
|
||||
textFill: 'Fill',
|
||||
textBorder: 'Border',
|
||||
textEffects: 'Effects',
|
||||
textSize: 'Size',
|
||||
textColor: 'Color',
|
||||
textOpacity: 'Opacity',
|
||||
textAddCustomColor: 'Add Custom Color',
|
||||
textCustomColor: 'Custom Color'
|
||||
}
|
||||
})(), DE.Views.EditShape || {}))
|
||||
});
|
|
@ -1,324 +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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* EditTable.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/20/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/EditTable.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common/mobile/lib/component/ThemeColorPalette'
|
||||
], function (editTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.EditTable = Backbone.View.extend(_.extend((function() {
|
||||
// private
|
||||
var _styles = [];
|
||||
|
||||
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));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#table-wrap').single('click', _.bind(me.showTableWrap, me));
|
||||
$('#table-style').single('click', _.bind(me.showTableStyle, me));
|
||||
$('#table-options').single('click', _.bind(me.showTableOptions, me));
|
||||
$('#edit-table-style-options').single('click', _.bind(me.showTableStyleOptions, me));
|
||||
$('#edit-table-bordercolor').single('click', _.bind(me.showBorderColor, me));
|
||||
$('.edit-table-style .categories a').single('click', _.bind(me.showStyleCategory, me));
|
||||
|
||||
Common.Utils.addScrollIfNeed('#edit-table .pages', '#edit-table .page');
|
||||
me.initControls();
|
||||
me.renderStyles();
|
||||
},
|
||||
|
||||
// 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-table-root')
|
||||
.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
initControls: function () {
|
||||
//
|
||||
},
|
||||
|
||||
updateStyles: function (styles) {
|
||||
_styles = styles;
|
||||
this.renderStyles();
|
||||
},
|
||||
|
||||
renderStyles: function() {
|
||||
var $styleContainer = $('#edit-table-styles .item-inner');
|
||||
|
||||
if ($styleContainer.length > 0) {
|
||||
var columns = parseInt(($styleContainer.width() - 15) / 70), // magic
|
||||
row = -1,
|
||||
styles = [];
|
||||
|
||||
_.each(_styles, function (style, index) {
|
||||
if (0 == index % columns) {
|
||||
styles.push([]);
|
||||
row++
|
||||
}
|
||||
styles[row].push(style);
|
||||
});
|
||||
|
||||
var template = _.template([
|
||||
'<div class="dataview table-styles" style="width: 100%;">',
|
||||
'<% _.each(styles, function(row) { %>',
|
||||
'<div class="row">',
|
||||
'<% _.each(row, function(style) { %>',
|
||||
'<div data-type="<%= style.templateId %>">',
|
||||
'<img src="<%= style.imageUrl %>">',
|
||||
'</div>',
|
||||
'<% }); %>',
|
||||
'</div>',
|
||||
'<% }); %>',
|
||||
'</div>'
|
||||
].join(''))({
|
||||
styles: styles
|
||||
});
|
||||
|
||||
$styleContainer.html(template);
|
||||
}
|
||||
},
|
||||
|
||||
categoryShow: function(e) {
|
||||
// if ('edit-shape' == $(e.currentTarget).prop('id')) {
|
||||
// this.initEvents();
|
||||
// }
|
||||
},
|
||||
|
||||
showStyleCategory: function (e) {
|
||||
// remove android specific style
|
||||
$('.page[data-page=edit-table-style] .list-block.inputs-list').removeClass('inputs-list');
|
||||
if ($(e.currentTarget).data('type') == 'fill') {
|
||||
this.fireEvent('page:show', [this, '#edit-table-style']);
|
||||
}
|
||||
// this.fireEvent('page:show', [this, '#edit-table-style']);
|
||||
},
|
||||
|
||||
showPage: function (templateId, suspendEvent) {
|
||||
var rootView = DE.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();
|
||||
}
|
||||
},
|
||||
|
||||
showTableWrap: function () {
|
||||
this.showPage('#edit-table-wrap');
|
||||
},
|
||||
|
||||
showTableStyle: function () {
|
||||
var me = this;
|
||||
this.showPage('#edit-table-style', true);
|
||||
|
||||
this.paletteFillColor = new Common.UI.ThemeColorPalette({
|
||||
el: $('#tab-table-fill'),
|
||||
transparent: true
|
||||
});
|
||||
this.paletteFillColor.on('customcolor', function () {
|
||||
me.showCustomFillColor();
|
||||
});
|
||||
var template = _.template(['<div class="list-block">',
|
||||
'<ul>',
|
||||
'<li>',
|
||||
'<a id="edit-table-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(''));
|
||||
$('#tab-table-fill').append(template({scope: this}));
|
||||
$('#edit-table-add-custom-color').single('click', _.bind(this.showCustomFillColor, this));
|
||||
|
||||
this.fireEvent('page:show', [this, '#edit-table-style']);
|
||||
},
|
||||
|
||||
showBorderColor: function () {
|
||||
var me = this;
|
||||
this.showPage('#edit-table-border-color-view', true);
|
||||
|
||||
this.paletteBorderColor = new Common.UI.ThemeColorPalette({
|
||||
el: $('.page[data-page=edit-table-border-color] .page-content')
|
||||
});
|
||||
this.paletteBorderColor.on('customcolor', function () {
|
||||
me.showCustomBorderColor();
|
||||
});
|
||||
var template = _.template(['<div class="list-block">',
|
||||
'<ul>',
|
||||
'<li>',
|
||||
'<a id="edit-table-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-table-border-color] .page-content').append(template({scope: this}));
|
||||
$('#edit-table-add-custom-border-color').single('click', _.bind(this.showCustomBorderColor, this));
|
||||
|
||||
this.fireEvent('page:show', [this, '#edit-table-border-color-view']);
|
||||
},
|
||||
|
||||
showTableOptions: function () {
|
||||
this.showPage('#edit-table-options');
|
||||
},
|
||||
|
||||
showTableStyleOptions: function () {
|
||||
this.showPage('#edit-table-style-options-view');
|
||||
},
|
||||
|
||||
showCustomFillColor: function () {
|
||||
var me = this,
|
||||
selector = '#edit-table-custom-color-view';
|
||||
me.showPage(selector, true);
|
||||
|
||||
me.customColorPicker = new Common.UI.HsbColorPicker({
|
||||
el: $('.page[data-page=edit-table-custom-color] .page-content'),
|
||||
color: me.paletteFillColor.currentColor
|
||||
});
|
||||
me.customColorPicker.on('addcustomcolor', function (colorPicker, color) {
|
||||
me.paletteFillColor.addNewDynamicColor(colorPicker, color);
|
||||
DE.getController('EditContainer').rootView.router.back();
|
||||
});
|
||||
|
||||
me.fireEvent('page:show', [me, selector]);
|
||||
},
|
||||
|
||||
showCustomBorderColor: function() {
|
||||
var me = this,
|
||||
selector = '#edit-table-custom-color-view';
|
||||
me.showPage(selector, true);
|
||||
|
||||
me.customBorderColorPicker = new Common.UI.HsbColorPicker({
|
||||
el: $('.page[data-page=edit-table-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);
|
||||
DE.getController('EditContainer').rootView.router.back();
|
||||
});
|
||||
|
||||
me.fireEvent('page:show', [me, selector]);
|
||||
},
|
||||
|
||||
textRemoveTable: 'Remove Table',
|
||||
textTableOptions: 'Table Options',
|
||||
textStyle: 'Style',
|
||||
textWrap: 'Wrap',
|
||||
textBack: 'Back',
|
||||
textInline: 'Inline',
|
||||
textFlow: 'Flow',
|
||||
textWithText: 'Move with Text',
|
||||
textFromText: 'Distance from Text',
|
||||
textAlign: 'Align',
|
||||
textOptions: 'Options',
|
||||
textRepeatHeader: 'Repeat as Header Row',
|
||||
textResizeFit: 'Resize to Fit Content',
|
||||
textCellMargins: 'Cell Margins',
|
||||
textFill: 'Fill',
|
||||
textBorder: 'Border',
|
||||
textStyleOptions: 'Style Options',
|
||||
textSize: 'Size',
|
||||
textColor: 'Color',
|
||||
textHeaderRow: 'Header Row',
|
||||
textTotalRow: 'Total Row',
|
||||
textBandedRow: 'Banded Row',
|
||||
textFirstColumn: 'First Column',
|
||||
textLastColumn: 'Last Column',
|
||||
textBandedColumn: 'Banded Column',
|
||||
textAddCustomColor: 'Add Custom Color',
|
||||
textCustomColor: 'Custom Color'
|
||||
}
|
||||
})(), DE.Views.EditTable || {}))
|
||||
});
|
|
@ -1,339 +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
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Alexander Yuzhin on 10/4/16
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/EditText.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common/mobile/lib/component/ThemeColorPalette'
|
||||
], function (editTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.EditText = Backbone.View.extend(_.extend((function() {
|
||||
// private
|
||||
var _fontsList,
|
||||
_editTextController;
|
||||
|
||||
var _bullets = [
|
||||
[
|
||||
{type: -1, thumb: ''},
|
||||
{type: 1, thumb: 'bullet-01.png'},
|
||||
{type: 2, thumb: 'bullet-02.png'},
|
||||
{type: 3, thumb: 'bullet-03.png'}
|
||||
],
|
||||
[
|
||||
{type: 4, thumb: 'bullet-04.png'},
|
||||
{type: 5, thumb: 'bullet-05.png'},
|
||||
{type: 6, thumb: 'bullet-06.png'},
|
||||
{type: 7, thumb: 'bullet-07.png'}
|
||||
]
|
||||
];
|
||||
|
||||
var _numbers = [
|
||||
[
|
||||
{type: -1, thumb: ''},
|
||||
{type: 4, thumb: 'number-01.png'},
|
||||
{type: 5, thumb: 'number-02.png'},
|
||||
{type: 6, thumb: 'number-03.png'}
|
||||
],
|
||||
[
|
||||
{type: 1, thumb: 'number-04.png'},
|
||||
{type: 2, thumb: 'number-05.png'},
|
||||
{type: 3, thumb: 'number-06.png'},
|
||||
{type: 7, thumb: 'number-07.png'}
|
||||
]
|
||||
];
|
||||
|
||||
return {
|
||||
// el: '.view-main',
|
||||
|
||||
template: _.template(editTemplate),
|
||||
|
||||
events: {
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
_editTextController = DE.getController('EditText');
|
||||
Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
$('#font-fonts').single('click', _.bind(me.showFonts, me));
|
||||
$('#font-color').single('click', _.bind(me.showFontColor, me));
|
||||
$('#font-background').single('click', _.bind(me.showBackgroundColor, me));
|
||||
$('#font-additional').single('click', _.bind(me.showAdditional, me));
|
||||
$('#font-line-spacing').single('click', _.bind(me.showLineSpacing, me));
|
||||
$('#font-bullets').single('click', _.bind(me.showBullets, me));
|
||||
$('#font-numbers').single('click', _.bind(me.showNumbers, me));
|
||||
|
||||
Common.Utils.addScrollIfNeed('#edit-text .pages', '#edit-text .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,
|
||||
bullets : _bullets,
|
||||
numbers : _numbers
|
||||
}));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
rootLayout: function () {
|
||||
if (this.layout) {
|
||||
return this.layout
|
||||
.find('#edit-text-root')
|
||||
.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
initControls: function () {
|
||||
//
|
||||
},
|
||||
|
||||
showPage: function (templateId, suspendEvent) {
|
||||
var rootView = DE.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]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
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: DE.getController('EditText').getFonts(),
|
||||
template: $template.html(),
|
||||
onItemsAfterInsert: function (list, fragment) {
|
||||
var fontInfo = _editTextController.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');
|
||||
},
|
||||
|
||||
showFontColor: function () {
|
||||
var me = this;
|
||||
this.showPage('#edit-text-color', true);
|
||||
|
||||
this.paletteTextColor = new Common.UI.ThemeColorPalette({
|
||||
el: $('.page[data-page=edit-text-font-color] .page-content')
|
||||
});
|
||||
this.paletteTextColor.on('customcolor', function () {
|
||||
me.showCustomFontColor();
|
||||
});
|
||||
var template = _.template(['<div class="list-block">',
|
||||
'<ul>',
|
||||
'<li>',
|
||||
'<a id="edit-text-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-text-font-color] .page-content').append(template({scope: this}));
|
||||
$('#edit-text-add-custom-color').single('click', _.bind(this.showCustomFontColor, this));
|
||||
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-font-color]', '.page[data-page=edit-text-font-color] .page-content');
|
||||
this.fireEvent('page:show', [this, '#edit-text-color']);
|
||||
},
|
||||
|
||||
showCustomFontColor: function () {
|
||||
var me = this,
|
||||
selector = '#edit-text-custom-color-view';
|
||||
me.showPage(selector, true);
|
||||
|
||||
me.customColorPicker = new Common.UI.HsbColorPicker({
|
||||
el: $('.page[data-page=edit-text-custom-color] .page-content'),
|
||||
color: me.paletteTextColor.currentColor
|
||||
});
|
||||
me.customColorPicker.on('addcustomcolor', function (colorPicker, color) {
|
||||
me.paletteTextColor.addNewDynamicColor(colorPicker, color);
|
||||
DE.getController('EditContainer').rootView.router.back();
|
||||
});
|
||||
|
||||
me.fireEvent('page:show', [me, selector]);
|
||||
},
|
||||
|
||||
showBackgroundColor: function () {
|
||||
var me = this;
|
||||
this.showPage('#edit-text-background', true);
|
||||
|
||||
this.paletteBackgroundColor = new Common.UI.ThemeColorPalette({
|
||||
el: $('.page[data-page=edit-text-font-background] .page-content'),
|
||||
transparent: true
|
||||
});
|
||||
this.paletteBackgroundColor.on('customcolor', function () {
|
||||
me.showCustomBackgroundColor();
|
||||
});
|
||||
var template = _.template(['<div class="list-block">',
|
||||
'<ul>',
|
||||
'<li>',
|
||||
'<a id="edit-text-add-custom-background-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-font-background] .page-content').append(template({scope: this}));
|
||||
$('#edit-text-add-custom-background-color').single('click', _.bind(this.showCustomBackgroundColor, this));
|
||||
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-font-background]', '.page[data-page=edit-text-font-background] .page-content');
|
||||
this.fireEvent('page:show', [this, '#edit-text-background']);
|
||||
},
|
||||
|
||||
showCustomBackgroundColor: function () {
|
||||
var me = this,
|
||||
selector = '#edit-text-custom-color-view';
|
||||
me.showPage(selector, true);
|
||||
|
||||
me.customBackgroundColorPicker = new Common.UI.HsbColorPicker({
|
||||
el: $('.page[data-page=edit-text-custom-color] .page-content'),
|
||||
color: me.paletteBackgroundColor.currentColor
|
||||
});
|
||||
me.customBackgroundColorPicker.on('addcustomcolor', function (colorPicker, color) {
|
||||
me.paletteBackgroundColor.addNewDynamicColor(colorPicker, color);
|
||||
DE.getController('EditContainer').rootView.router.back();
|
||||
});
|
||||
|
||||
me.fireEvent('page:show', [me, selector]);
|
||||
},
|
||||
|
||||
showAdditional: function () {
|
||||
this.showPage('#edit-text-additional');
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-additional]', '.page[data-page=edit-text-additional] .page-content');
|
||||
},
|
||||
|
||||
showLineSpacing: function () {
|
||||
this.showPage('#edit-text-linespacing');
|
||||
Common.Utils.addScrollIfNeed('#page-text-linespacing', '#page-text-linespacing .page-content');
|
||||
},
|
||||
|
||||
showBullets: function () {
|
||||
this.showPage('#edit-text-bullets');
|
||||
},
|
||||
|
||||
showNumbers: function () {
|
||||
this.showPage('#edit-text-numbers');
|
||||
},
|
||||
|
||||
textFonts: 'Fonts',
|
||||
textFontColor: 'Font Color',
|
||||
textHighlightColor: 'Highlight Color',
|
||||
textAdditionalFormat: 'Additional Formatting',
|
||||
textBack: 'Back',
|
||||
textSize: 'Size',
|
||||
textFontColors: 'Font Colors',
|
||||
textAutomatic: 'Automatic',
|
||||
textHighlightColors: 'Highlight Colors',
|
||||
textAdditional: 'Additional',
|
||||
textStrikethrough: 'Strikethrough',
|
||||
textDblStrikethrough: 'Double Strikethrough',
|
||||
textDblSuperscript: 'Superscript',
|
||||
textSubscript: 'Subscript',
|
||||
textSmallCaps: 'Small Caps',
|
||||
textAllCaps: 'All Caps',
|
||||
textLetterSpacing: 'Letter Spacing',
|
||||
textLineSpacing: 'Line Spacing',
|
||||
textBullets: 'Bullets',
|
||||
textNone: 'None',
|
||||
textNumbers: 'Numbers',
|
||||
textCharacterBold: 'B',
|
||||
textCharacterItalic: 'I',
|
||||
textCharacterUnderline: 'U',
|
||||
textCharacterStrikethrough: 'S',
|
||||
textAddCustomColor: 'Add Custom Color',
|
||||
textCustomColor: 'Custom Color'
|
||||
}
|
||||
})(), DE.Views.EditText || {}))
|
||||
});
|
|
@ -1,224 +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 Document Editor</title>
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,500,700" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- splash -->
|
||||
|
||||
<style type="text/css">
|
||||
.loadmask {
|
||||
left: 0;
|
||||
top: 0;
|
||||
position: absolute;
|
||||
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: #446995;
|
||||
}
|
||||
|
||||
.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%;
|
||||
padding-top: 65px;
|
||||
}
|
||||
|
||||
.loadmask > .placeholder.android {
|
||||
padding-top: 75px;
|
||||
}
|
||||
|
||||
.loadmask > .placeholder > .line {
|
||||
height: 15px;
|
||||
margin: 30px;
|
||||
background: #e2e2e2;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
-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;
|
||||
}
|
||||
|
||||
@keyframes flickerAnimation {
|
||||
0% { opacity:0.1; }
|
||||
50% { opacity:1; }
|
||||
100% { opacity:0.1; }
|
||||
}
|
||||
@-o-keyframes flickerAnimation{
|
||||
0% { opacity:0.1; }
|
||||
50% { opacity:1; }
|
||||
100% { opacity:0.1; }
|
||||
}
|
||||
@-moz-keyframes flickerAnimation{
|
||||
0% { opacity:0.1; }
|
||||
50% { opacity:1; }
|
||||
100% { opacity:0.1; }
|
||||
}
|
||||
@-webkit-keyframes flickerAnimation{
|
||||
0% { opacity:0.1; }
|
||||
50% { opacity:1; }
|
||||
100% { opacity:0.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="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line"></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, '&')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
logo = /*params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : */null,
|
||||
logoOO = null;
|
||||
if (!logo) {
|
||||
logoOO = /Android/.test(navigator.userAgent) ? "../../../apps/documenteditor/mobile/resources/img/header/header-logo-android.png" : "../../../apps/documenteditor/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>
|
|
@ -1,264 +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 Documents</title>
|
||||
|
||||
<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, '&')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
}
|
||||
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/word/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>
|
|
@ -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 Document Editor</title>
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,500,700" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- 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">
|
||||
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, '&')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
}
|
||||
|
||||
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>
|
|
@ -1,34 +0,0 @@
|
|||
{
|
||||
"src_folders" : ["tests"],
|
||||
"output_folder" : "reports",
|
||||
"custom_commands_path" : "",
|
||||
"custom_assertions_path" : "",
|
||||
"page_objects_path" : "",
|
||||
"globals_path" : "",
|
||||
|
||||
"selenium" : {
|
||||
"start_process" : true,
|
||||
"server_path" : "./bin/selenium-server-standalone-2.53.1.jar",
|
||||
"log_path" : "",
|
||||
"port" : 4444,
|
||||
"cli_args" : {
|
||||
"webdriver.chrome.driver" : "./bin/chromedriver"
|
||||
}
|
||||
},
|
||||
|
||||
"test_settings" : {
|
||||
"default" : {
|
||||
"launch_url" : "http://localhost",
|
||||
"selenium_port" : 4444,
|
||||
"selenium_host" : "localhost",
|
||||
"silent": true,
|
||||
"screenshots" : {
|
||||
"enabled" : true,
|
||||
"path" : "reports/screens"
|
||||
},
|
||||
"desiredCapabilities": {
|
||||
"browserName": "chrome"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,117 +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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* de-mobile-edit-tablet-ios.js
|
||||
*
|
||||
* Created by Alexander Yuzhin on 1/10/17
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
var Utils = require('../utils');
|
||||
|
||||
module.exports = {
|
||||
before : function (browser) {
|
||||
Utils.init(browser);
|
||||
browser.resizeWindow(800, 600);
|
||||
},
|
||||
|
||||
'Launch Document Editor' : function (browser) {
|
||||
Utils.openEditor('http://local:3000/editor?type=mobile&mode=edit&fileName=sample.docx');
|
||||
},
|
||||
|
||||
'Text settings' : function (browser) {
|
||||
Utils.canvasClick(280, 280)
|
||||
.click('#toolbar-edit')
|
||||
.pause(500);
|
||||
|
||||
Utils.isPresent('div.edit-root-view');
|
||||
Utils.isPresent('#edit-text');
|
||||
Utils.isPresent('#edit-paragraph');
|
||||
|
||||
// Text tap
|
||||
Utils.hasClass('#edit-text', 'active');
|
||||
|
||||
browser.expect.element('#font-fonts .item-title').text.to.equal('Arial');
|
||||
browser.expect.element('#font-fonts .item-after span:first-child').text.to.equal('11 pt');
|
||||
|
||||
Utils.hasClass('#font-bold', 'active');
|
||||
Utils.hasNoClass('#font-italic', 'active');
|
||||
Utils.hasNoClass('#font-underline', 'active');
|
||||
Utils.hasNoClass('#font-strikethrough', 'active');
|
||||
|
||||
Utils.hasClass('#font-left', 'active');
|
||||
Utils.hasNoClass('#font-center', 'active');
|
||||
Utils.hasNoClass('#font-right', 'active');
|
||||
Utils.hasNoClass('#font-just', 'active');
|
||||
|
||||
// Fonts view
|
||||
browser
|
||||
.click('#font-fonts')
|
||||
.waitForElementVisible('.page[data-page=edit-text-font-page]', 1000)
|
||||
.pause(500);
|
||||
|
||||
browser.expect.element('#font-size .item-after label').text.to.equal('11 pt');
|
||||
browser.elements('css selector', '#font-list li', function(result) {
|
||||
browser.assert.ok(result.value.length > 1, 'Font name list is not empty');
|
||||
});
|
||||
|
||||
browser
|
||||
.click('.navbar-on-center a.back')
|
||||
.pause(500);
|
||||
|
||||
// Paragraph tap
|
||||
browser
|
||||
.click('.categories a[href*=edit-paragraph]')
|
||||
.pause(500);
|
||||
|
||||
Utils.hasClass('#edit-paragraph', 'active');
|
||||
|
||||
browser.elements('css selector', '#paragraph-list li', function(result) {
|
||||
browser.assert.ok(result.value.length > 1, 'Paragraph style list is not empty');
|
||||
});
|
||||
},
|
||||
|
||||
'Exit from Document Editor' : function (browser) {
|
||||
var delay = 3000;
|
||||
|
||||
Utils.isPresent('.view-main');
|
||||
console.log('Finish testing after delay', delay, 'ms.');
|
||||
|
||||
browser
|
||||
.pause(delay)
|
||||
.frame(null) // Exit from iframe
|
||||
.end(); // Close browser
|
||||
}
|
||||
};
|
|
@ -1,82 +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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* utils.js
|
||||
*
|
||||
* Created by Alexander Yuzhin on 1/11/17
|
||||
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
var browser;
|
||||
|
||||
module.exports = {
|
||||
init: function (client) {
|
||||
browser = client;
|
||||
},
|
||||
|
||||
openEditor: function (url) {
|
||||
browser
|
||||
.url(url)
|
||||
.waitForElementVisible('body', 1000)
|
||||
.frame(0) // Deep into editor iframe
|
||||
.waitForElementPresent('.modal-preloader', 1000)
|
||||
.waitForElementNotPresent('.modal-preloader', 10000);
|
||||
// .frame(null); // Exit from iframe
|
||||
// .end(); // Close browser
|
||||
|
||||
return browser;
|
||||
},
|
||||
|
||||
canvasClick: function (x, y) {
|
||||
browser
|
||||
.moveToElement('#area_id_main', x, y)
|
||||
.mouseButtonDown('left')
|
||||
.mouseButtonUp('left');
|
||||
|
||||
return browser;
|
||||
},
|
||||
|
||||
isPresent: function (selector) {
|
||||
return browser.expect.element(selector).to.be.present;
|
||||
},
|
||||
|
||||
hasClass: function (selector, className) {
|
||||
return browser.expect.element(selector).to.have.attribute('class').which.contains(className);
|
||||
},
|
||||
|
||||
hasNoClass: function (selector, className) {
|
||||
return browser.expect.element(selector).to.not.have.attribute('class').which.contains(className);
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue