Merge branch 'develop' into feature/sse-pivot-settings
7
.gitignore
vendored
|
@ -3,12 +3,17 @@ Thumbs.db
|
|||
.DS_Store
|
||||
/deploy
|
||||
build/node_modules
|
||||
build/sprites/node_modules/
|
||||
apps/documenteditor/embed/resources/less/node_modules
|
||||
apps/presentationeditor/embed/resources/less/node_modules
|
||||
apps/spreadsheeteditor/embed/resources/less/node_modules
|
||||
apps/documenteditor/mobile/resources/sass/.sass-cache
|
||||
apps/spreadsheeteditor/mobile/resources/sass/.sass-cache
|
||||
apps/presentationeditor/mobile/resources/sass/.sass-cache
|
||||
apps/**/main/resources/**/iconssmall*.png
|
||||
apps/**/main/resources/**/iconssmall*.less
|
||||
apps/**/main/resources/**/iconsbig*.png
|
||||
apps/**/main/resources/**/iconsbig*.less
|
||||
|
||||
|
||||
# test documents
|
||||
|
@ -22,4 +27,4 @@ apps/spreadsheeteditor/mobile/offlinedocs
|
|||
# tests
|
||||
selenium-debug.log
|
||||
**/test/bin
|
||||
**/test/reports
|
||||
**/test/reports
|
||||
|
|
10
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"filewatcher.commands": [
|
||||
{
|
||||
"match": "app-(ios|material)\\.less",
|
||||
"isAsync": true,
|
||||
"cmd": "lessc --js --no-color '${file}' '${fileDirname}/../css/${fileBasenameNoExt}.css'",
|
||||
"event": "onFileChange"
|
||||
}
|
||||
]
|
||||
}
|
54
Readme.md
|
@ -1,25 +1,29 @@
|
|||
[![License](https://img.shields.io/badge/License-GNU%20AGPL%20V3-green.svg?style=flat)](https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
|
||||
## web-apps
|
||||
|
||||
The frontend for [ONLYOFFICE Document Server][2]. Builds the program interface and allows the user create, edit, save and export text, spreadsheet and presentation documents using the common interface of a document editor.
|
||||
|
||||
## Project Information
|
||||
|
||||
Official website: [http://www.onlyoffice.org](http://onlyoffice.org "http://www.onlyoffice.org")
|
||||
|
||||
Code repository: [https://github.com/ONLYOFFICE/web-apps](https://github.com/ONLYOFFICE/web-apps "https://github.com/ONLYOFFICE/web-apps")
|
||||
|
||||
SaaS version: [http://www.onlyoffice.com](http://www.onlyoffice.com "http://www.onlyoffice.com")
|
||||
|
||||
## User Feedback and Support
|
||||
|
||||
If you have any problems with or questions about [ONLYOFFICE Document Server][2], please visit our official forum to find answers to your questions: [dev.onlyoffice.org][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][3].
|
||||
|
||||
[1]: http://dev.onlyoffice.org
|
||||
[2]: https://github.com/ONLYOFFICE/DocumentServer
|
||||
[3]: http://stackoverflow.com/questions/tagged/onlyoffice
|
||||
|
||||
## License
|
||||
|
||||
web-apps is released under an GNU AGPL v3.0 license. See the LICENSE file for more information.
|
||||
[![License](https://img.shields.io/badge/License-GNU%20AGPL%20V3-green.svg?style=flat)](https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
|
||||
## web-apps
|
||||
|
||||
The frontend for [ONLYOFFICE Document Server][2]. Builds the program interface and allows the user create, edit, save and export text, spreadsheet and presentation documents using the common interface of a document editor.
|
||||
|
||||
## Previos versions
|
||||
|
||||
Until 2019-10-23 the repository was called web-apps-pro
|
||||
|
||||
## Project Information
|
||||
|
||||
Official website: [http://www.onlyoffice.org](http://onlyoffice.org "http://www.onlyoffice.org")
|
||||
|
||||
Code repository: [https://github.com/ONLYOFFICE/web-apps](https://github.com/ONLYOFFICE/web-apps "https://github.com/ONLYOFFICE/web-apps")
|
||||
|
||||
SaaS version: [http://www.onlyoffice.com](http://www.onlyoffice.com "http://www.onlyoffice.com")
|
||||
|
||||
## User Feedback and Support
|
||||
|
||||
If you have any problems with or questions about [ONLYOFFICE Document Server][2], please visit our official forum to find answers to your questions: [dev.onlyoffice.org][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][3].
|
||||
|
||||
[1]: http://dev.onlyoffice.org
|
||||
[2]: https://github.com/ONLYOFFICE/DocumentServer
|
||||
[3]: http://stackoverflow.com/questions/tagged/onlyoffice
|
||||
|
||||
## License
|
||||
|
||||
web-apps is released under an GNU AGPL v3.0 license. See the LICENSE file for more information.
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
review: <can review>, // default = edit
|
||||
print: <can print>, // default = true
|
||||
rename: <can rename>, // default = false
|
||||
changeHistory: <can change history>, // default = false
|
||||
changeHistory: <can change history>, // default = false // must be deprecated, check onRequestRestore event instead
|
||||
comment: <can comment in view mode> // default = edit,
|
||||
modifyFilter: <can add, remove and save filter in the spreadsheet> // default = true
|
||||
modifyContentControl: <can modify content controls in documenteditor> // default = true
|
||||
|
@ -109,7 +109,8 @@
|
|||
goback: {
|
||||
url: 'http://...',
|
||||
text: 'Go to London',
|
||||
blank: true
|
||||
blank: true,
|
||||
requestClose: false // if true - goback send onRequestClose event instead opening url
|
||||
},
|
||||
chat: true,
|
||||
comments: true,
|
||||
|
@ -129,7 +130,8 @@
|
|||
toolbarNoTabs: false,
|
||||
toolbarHideFileName: false,
|
||||
reviewDisplay: 'original',
|
||||
spellcheck: true
|
||||
spellcheck: true,
|
||||
compatibleFeatures: false
|
||||
},
|
||||
plugins: {
|
||||
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
|
||||
|
@ -206,6 +208,8 @@
|
|||
_config.editorConfig.canRequestSaveAs = _config.events && !!_config.events.onRequestSaveAs;
|
||||
_config.editorConfig.canRequestInsertImage = _config.events && !!_config.events.onRequestInsertImage;
|
||||
_config.editorConfig.canRequestMailMergeRecipients = _config.events && !!_config.events.onRequestMailMergeRecipients;
|
||||
_config.editorConfig.canRequestCompareFile = _config.events && !!_config.events.onRequestCompareFile;
|
||||
_config.editorConfig.canRequestSharingSettings = _config.events && !!_config.events.onRequestSharingSettings;
|
||||
_config.frameEditorId = placeholderId;
|
||||
|
||||
var onMouseUp = function (evt) {
|
||||
|
@ -575,6 +579,13 @@
|
|||
});
|
||||
};
|
||||
|
||||
var _setRevisedFile = function(data) {
|
||||
_sendCommand({
|
||||
command: 'setRevisedFile',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
var _processMouse = function(evt) {
|
||||
var r = iframe.getBoundingClientRect();
|
||||
var data = {
|
||||
|
@ -619,7 +630,8 @@
|
|||
showSharingSettings : _showSharingSettings,
|
||||
setSharingSettings : _setSharingSettings,
|
||||
insertImage : _insertImage,
|
||||
setMailMergeRecipients: _setMailMergeRecipients
|
||||
setMailMergeRecipients: _setMailMergeRecipients,
|
||||
setRevisedFile : _setRevisedFile
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -730,8 +742,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
var userAgent = navigator.userAgent.toLowerCase(),
|
||||
check = function(regex){ return regex.test(userAgent); },
|
||||
isIE = !check(/opera/) && (check(/msie/) || check(/trident/) || check(/edge/)),
|
||||
isChrome = !isIE && check(/\bchrome\b/),
|
||||
isSafari_mobile = !isIE && !isChrome && check(/safari/) && (navigator.maxTouchPoints>0);
|
||||
|
||||
path += app + "/";
|
||||
path += config.type === "mobile"
|
||||
path += (config.type === "mobile" || isSafari_mobile)
|
||||
? "mobile"
|
||||
: config.type === "embedded"
|
||||
? "embed"
|
||||
|
@ -770,9 +788,19 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (config.editorConfig && (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge'))
|
||||
params += "&internal=true";
|
||||
|
||||
if (config.frameEditorId)
|
||||
params += "&frameEditorId=" + config.frameEditorId;
|
||||
|
||||
|
||||
if (config.editorConfig && config.editorConfig.mode == 'view' ||
|
||||
config.document && config.document.permissions && (config.document.permissions.edit === false && !config.document.permissions.review ))
|
||||
params += "&mode=view";
|
||||
|
||||
if (config.editorConfig && config.editorConfig.customization && !!config.editorConfig.customization.compactHeader)
|
||||
params += "&compact=true";
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
|
@ -788,7 +816,8 @@
|
|||
iframe.allowFullscreen = true;
|
||||
iframe.setAttribute("allowfullscreen",""); // for IE11
|
||||
iframe.setAttribute("onmousewheel",""); // for Safari on Mac
|
||||
|
||||
iframe.setAttribute("allow", "autoplay");
|
||||
|
||||
if (config.type == "mobile")
|
||||
{
|
||||
iframe.style.position = "fixed";
|
||||
|
|
|
@ -118,6 +118,10 @@ if (Common === undefined) {
|
|||
|
||||
'setMailMergeRecipients': function(data) {
|
||||
$me.trigger('setmailmergerecipients', data);
|
||||
},
|
||||
|
||||
'setRevisedFile': function(data) {
|
||||
$me.trigger('setrevisedfile', data);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -289,23 +293,31 @@ if (Common === undefined) {
|
|||
},
|
||||
|
||||
requestMakeActionLink: function (config) {
|
||||
_postMessage({event:'onMakeActionLink', data: config})
|
||||
_postMessage({event:'onMakeActionLink', data: config});
|
||||
},
|
||||
|
||||
requestUsers: function () {
|
||||
_postMessage({event:'onRequestUsers'})
|
||||
_postMessage({event:'onRequestUsers'});
|
||||
},
|
||||
|
||||
requestSendNotify: function (emails) {
|
||||
_postMessage({event:'onRequestSendNotify', data: emails})
|
||||
_postMessage({event:'onRequestSendNotify', data: emails});
|
||||
},
|
||||
|
||||
requestInsertImage: function () {
|
||||
_postMessage({event:'onRequestInsertImage'})
|
||||
_postMessage({event:'onRequestInsertImage'});
|
||||
},
|
||||
|
||||
requestMailMergeRecipients: function () {
|
||||
_postMessage({event:'onRequestMailMergeRecipients'})
|
||||
_postMessage({event:'onRequestMailMergeRecipients'});
|
||||
},
|
||||
|
||||
requestCompareFile: function () {
|
||||
_postMessage({event:'onRequestCompareFile'});
|
||||
},
|
||||
|
||||
requestSharingSettings: function () {
|
||||
_postMessage({event:'onRequestSharingSettings'});
|
||||
},
|
||||
|
||||
on: function(event, handler){
|
||||
|
|
|
@ -187,8 +187,9 @@ define([
|
|||
'<img src="<%= iconImg %>">' +
|
||||
'<% } else { %>' +
|
||||
'<% if (/svgicon/.test(iconCls)) {' +
|
||||
'print(\'<svg width="26" height="26" class=\"icon\"><use href=\"#\' + /svgicon\\s(\\S+)/.exec(iconCls)[1] + \'\"></use></svg>\');' +
|
||||
'} else ' +
|
||||
'print(\'<svg class=\"icon\"><use class=\"zoom-int\" xlink:href=\"#\' + /svgicon\\s(\\S+)/.exec(iconCls)[1] + \'\"></use>' +
|
||||
'<use class=\"zoom-grit\" xlink:href=\"#\' + /svgicon\\s(\\S+)/.exec(iconCls)[1] + \'-150\"></use></svg>\');' +
|
||||
'} else ' +
|
||||
'print(\'<i class=\"icon \' + iconCls + \'\"> </i>\'); %>' +
|
||||
'<% } %>';
|
||||
|
||||
|
@ -253,7 +254,8 @@ define([
|
|||
// '<% if (iconCls != "") { print(\'<i class=\"icon \' + iconCls + \'\"> </i>\'); }} %>',
|
||||
'<% if (iconCls != "") { ' +
|
||||
' if (/svgicon/.test(iconCls)) {' +
|
||||
'print(\'<svg class=\"icon\"><use xlink:href=\"#\' + /svgicon\\s(\\S+)/.exec(iconCls)[1] + \'\"></use></svg>\');' +
|
||||
'print(\'<svg class=\"icon\"><use class=\"zoom-int\" xlink:href=\"#\' + /svgicon\\s(\\S+)/.exec(iconCls)[1] + \'\"></use>' +
|
||||
'<use class=\"zoom-grit\" xlink:href=\"#\' + /svgicon\\s(\\S+)/.exec(iconCls)[1] + \'-150\"></use></svg>\');' +
|
||||
'} else ' +
|
||||
'print(\'<i class=\"icon \' + iconCls + \'\"> </i>\'); ' +
|
||||
'}} %>',
|
||||
|
@ -573,6 +575,13 @@ define([
|
|||
this.trigger('toggle', this, state);
|
||||
},
|
||||
|
||||
click: function(opts) {
|
||||
if ( !this.disabled ) {
|
||||
this.doToggle();
|
||||
this.trigger('click', this, opts);
|
||||
}
|
||||
},
|
||||
|
||||
isActive: function() {
|
||||
if (this.enableToggle)
|
||||
return this.pressed;
|
||||
|
@ -641,6 +650,24 @@ define([
|
|||
btnIconEl.addClass(cls || '');
|
||||
},
|
||||
|
||||
changeIcon: function(opts) {
|
||||
var me = this;
|
||||
if ( opts && (opts.curr || opts.next)) {
|
||||
!!opts.curr && (me.$icon.removeClass(opts.curr));
|
||||
!!opts.next && !me.$icon.hasClass(opts.next) && (me.$icon.addClass(opts.next));
|
||||
|
||||
if ( !!me.options.signals ) {
|
||||
if ( !(me.options.signals.indexOf('icon:changed') < 0) ) {
|
||||
me.trigger('icon:changed', me, opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
hasIcon: function(iconcls) {
|
||||
return this.$icon.hasClass(iconcls);
|
||||
},
|
||||
|
||||
setVisible: function(visible) {
|
||||
if (this.cmpEl) this.cmpEl.toggleClass('hidden', !visible);
|
||||
this.visible = visible;
|
||||
|
@ -710,7 +737,7 @@ define([
|
|||
this.caption = caption;
|
||||
|
||||
if (this.rendered) {
|
||||
var captionNode = this.cmpEl.find('button:first > .caption').addBack().filter('button > .caption');
|
||||
var captionNode = this.cmpEl.find('.caption');
|
||||
|
||||
if (captionNode.length > 0) {
|
||||
captionNode.text(caption);
|
||||
|
|
491
apps/common/main/lib/component/Calendar.js
Normal file
|
@ -0,0 +1,491 @@
|
|||
/*
|
||||
*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
|
||||
define([
|
||||
'common/main/lib/component/BaseView',
|
||||
'common/main/lib/util/utils'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
Common.UI.Calendar = Common.UI.BaseView.extend(_.extend({
|
||||
|
||||
template :
|
||||
_.template([
|
||||
'<div id="calendar" class="calendar-box">',
|
||||
'<div class="calendar-header">',
|
||||
'<div class="top-row">',
|
||||
'<div id="prev-arrow"><button type="button"><i class="arrow-prev img-commonctrl"> </i></button></div>',
|
||||
'<div class="title"></div>',
|
||||
'<div id="next-arrow"><button type="button"><i class="arrow-next img-commonctrl"> </i></button></div>',
|
||||
'</div>',
|
||||
'<div class="bottom-row">',
|
||||
'</div>',
|
||||
'</div>',
|
||||
'<div class="calendar-content"></div>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
|
||||
options: {
|
||||
date: undefined,
|
||||
firstday: 0 // 0 - sunday, 1 - monday
|
||||
},
|
||||
|
||||
initialize : function(options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||
|
||||
var me = this;
|
||||
|
||||
this.monthNames = [this.textJanuary, this.textFebruary, this.textMarch, this.textApril, this.textMay, this.textJune, this.textJuly, this.textAugust, this.textSeptember, this.textOctober, this.textNovember, this.textDecember];
|
||||
this.dayNamesShort = [this.textShortSunday, this.textShortMonday, this.textShortTuesday, this.textShortWednesday, this.textShortThursday, this.textShortFriday, this.textShortSaturday];
|
||||
this.monthShortNames = [this.textShortJanuary, this.textShortFebruary, this.textShortMarch, this.textShortApril, this.textShortMay, this.textShortJune, this.textShortJuly, this.textShortAugust, this.textShortSeptember, this.textShortOctober, this.textShortNovember, this.textShortDecember];
|
||||
|
||||
me.options.date = options.date;
|
||||
if (!_.isUndefined(options.firstday) && (options.firstday === 0 || options.firstday === 1)) {
|
||||
me.options.firstday = options.firstday;
|
||||
}
|
||||
|
||||
me.enableKeyEvents= me.options.enableKeyEvents;
|
||||
|
||||
me._state = undefined; // 0 - month, 1 - months, 2 - years
|
||||
|
||||
me.render();
|
||||
},
|
||||
|
||||
render: function () {
|
||||
var me = this;
|
||||
me.cmpEl = me.$el || $(this.el);
|
||||
me.cmpEl.html(this.template());
|
||||
|
||||
me.currentDate = me.options.date || new Date();
|
||||
|
||||
me.btnPrev = new Common.UI.Button({
|
||||
cls: '',
|
||||
iconCls: 'arrow-prev img-commonctrl'
|
||||
});
|
||||
me.btnPrev.render(me.cmpEl.find('#prev-arrow'));
|
||||
me.btnPrev.on('click', _.bind(me.onClickPrev, me));
|
||||
|
||||
me.btnNext = new Common.UI.Button({
|
||||
cls: '',
|
||||
iconCls: 'arrow-next img-commonctrl'
|
||||
});
|
||||
me.btnNext.render(me.cmpEl.find('#next-arrow'));
|
||||
me.btnNext.on('click', _.bind(me.onClickNext, me));
|
||||
|
||||
me.cmpEl.on('keydown', function(e) {
|
||||
me.trigger('calendar:keydown', me, e);
|
||||
});
|
||||
|
||||
me.renderMonth(me.currentDate);
|
||||
|
||||
this.trigger('render:after', this);
|
||||
return this;
|
||||
},
|
||||
|
||||
onClickPrev: function () {
|
||||
var me = this;
|
||||
if (me._state === 0) {
|
||||
var d = new Date(me.currentDate);
|
||||
d.setMonth(d.getMonth() - 1);
|
||||
if (d.getFullYear() > 0) {
|
||||
me.renderMonth(d);
|
||||
}
|
||||
} else if (me._state === 1) {
|
||||
var d = new Date(me.currentDate);
|
||||
d.setFullYear(d.getFullYear() - 1);
|
||||
if (d.getFullYear() > 0) {
|
||||
me.renderMonths(d);
|
||||
}
|
||||
} else if (me._state === 2) {
|
||||
var year = me.currentDate.getFullYear(),
|
||||
newYear;
|
||||
if (year % 10 !== 0) {
|
||||
newYear = String(year);
|
||||
newYear = Number(newYear.slice(0, -1) + '0') - 1;
|
||||
} else {
|
||||
newYear = year - 1;
|
||||
}
|
||||
if (newYear > 0) {
|
||||
me.currentDate.setFullYear(newYear);
|
||||
me.renderYears(newYear);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onClickNext: function () {
|
||||
var me = this;
|
||||
if (me._state === 0) {
|
||||
var d = new Date(me.currentDate);
|
||||
d.setMonth(d.getMonth() + 1);
|
||||
if (d.getFullYear() > 0) {
|
||||
me.renderMonth(d);
|
||||
}
|
||||
} else if (me._state === 1) {
|
||||
var d = new Date(me.currentDate);
|
||||
d.setFullYear(d.getFullYear() + 1);
|
||||
if (d.getFullYear() > 0) {
|
||||
me.renderMonths(d);
|
||||
}
|
||||
} else if (me._state === 2) {
|
||||
var year = me.currentDate.getFullYear(),
|
||||
newYear;
|
||||
if (year % 10 !== 9) {
|
||||
newYear = String(year);
|
||||
newYear = Number(newYear.slice(0, -1) + '9') + 1;
|
||||
} else {
|
||||
newYear = year + 1;
|
||||
}
|
||||
if (newYear > 0) {
|
||||
me.currentDate.setFullYear(newYear);
|
||||
me.renderYears(newYear);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
renderYears: function (year) {
|
||||
var me = this,
|
||||
year = _.isNumber(year) ? year : (me.currentDate ? me.currentDate.getFullYear() : new Date().getFullYear());
|
||||
|
||||
me._state = 2;
|
||||
|
||||
var firstYear = year,
|
||||
lastYear = year;
|
||||
if ((firstYear % 10) !== 0) {
|
||||
var strYear = String(year);
|
||||
firstYear = Number(strYear.slice(0, -1) + '0');
|
||||
}
|
||||
if ((lastYear % 10) !== 9) {
|
||||
var strYear = String(year);
|
||||
lastYear = Number(strYear.slice(0, -1) + '9');
|
||||
}
|
||||
|
||||
me.topTitle = _.template([
|
||||
'<label>' + firstYear + '-' + lastYear + '</label>'
|
||||
].join(''));
|
||||
me.cmpEl.find('.calendar-header .title').html(me.topTitle);
|
||||
|
||||
me.bottomTitle = _.template([
|
||||
'<label>' + me.textYears + '</label>'
|
||||
].join(''));
|
||||
me.cmpEl.find('.calendar-header .bottom-row').html(me.bottomTitle);
|
||||
|
||||
var arrYears = [];
|
||||
var tmpYear = firstYear - 3;
|
||||
|
||||
for (var i = 0; i < 16; i++) {
|
||||
arrYears.push({
|
||||
year: (tmpYear > 0) ? tmpYear : '',
|
||||
isCurrentDecade: ((tmpYear >= firstYear) && (tmpYear <= lastYear)) ? true : false,
|
||||
disabled: (tmpYear > 0) ? false : true,
|
||||
selected: (_.isDate(me.selectedDate)) ?
|
||||
(tmpYear === me.selectedDate.getFullYear()) :
|
||||
(tmpYear === new Date().getFullYear())
|
||||
});
|
||||
tmpYear++;
|
||||
}
|
||||
|
||||
if (!me.yearPicker) {
|
||||
me.yearPicker = new Common.UI.DataView({
|
||||
el: me.cmpEl.find('.calendar-content'),
|
||||
store: new Common.UI.DataViewStore(arrYears),
|
||||
itemTemplate: _.template('<div class="name-year <% if (!isCurrentDecade) { %> no-current-decade <% } %>" data-year="<%= year %>"><%= year %></div>')
|
||||
});
|
||||
me.yearPicker.on('item:click', function (picker, item, record, e) {
|
||||
var year = record.get('year'),
|
||||
date = new Date();
|
||||
date.setFullYear(year);
|
||||
me.renderMonths(date);
|
||||
});
|
||||
me.enableKeyEvents && this.yearPicker.on('item:keydown', function(view, record, e) {
|
||||
if (e.keyCode==Common.UI.Keys.ESC) {
|
||||
Common.NotificationCenter.trigger('dataview:blur');
|
||||
}
|
||||
});
|
||||
} else
|
||||
me.yearPicker.store.reset(arrYears);
|
||||
|
||||
me.enableKeyEvents && _.delay(function() {
|
||||
me.monthPicker.cmpEl.find('.dataview').focus();
|
||||
}, 10);
|
||||
},
|
||||
|
||||
renderMonths: function (date) {
|
||||
var me = this,
|
||||
curDate = (_.isDate(date)) ? date : (me.currentDate ? me.currentDate : new Date()),
|
||||
year = curDate.getFullYear();
|
||||
|
||||
me._state = 1;
|
||||
me.currentDate = curDate;
|
||||
|
||||
// Number of year
|
||||
me.topTitle = _.template([
|
||||
'<div class="button"><label>' + year + '</label></div>'
|
||||
].join(''));
|
||||
me.cmpEl.find('.calendar-header .title').html(me.topTitle);
|
||||
me.cmpEl.find('.calendar-header .title').off();
|
||||
me.cmpEl.find('.calendar-header .title').on('click', _.bind(me.renderYears, me));
|
||||
|
||||
me.bottomTitle = _.template([
|
||||
'<label>' + me.textMonths + '</label>'
|
||||
].join(''));
|
||||
me.cmpEl.find('.calendar-header .bottom-row').html(me.bottomTitle);
|
||||
|
||||
var arrMonths = [];
|
||||
var today = new Date();
|
||||
|
||||
for (var ind = 0; ind < 12; ind++) {
|
||||
arrMonths.push({
|
||||
indexMonth: ind,
|
||||
nameMonth: me.monthShortNames[ind],
|
||||
year: year,
|
||||
curYear: true,
|
||||
isCurrentMonth: (ind === curDate.getMonth()),
|
||||
selected: (_.isDate(me.selectedDate)) ?
|
||||
(ind === me.selectedDate.getMonth() && year === me.selectedDate.getFullYear()) :
|
||||
(ind === today.getMonth() && year === today.getFullYear())
|
||||
});
|
||||
}
|
||||
year = year + 1;
|
||||
for (var ind = 0; ind < 4; ind++) {
|
||||
arrMonths.push({
|
||||
indexMonth: ind,
|
||||
nameMonth: me.monthShortNames[ind],
|
||||
year: year,
|
||||
curYear: false,
|
||||
selected: (_.isDate(me.selectedDate)) ?
|
||||
(ind === me.selectedDate.getMonth() && year === me.selectedDate.getFullYear()) :
|
||||
(ind === today.getMonth() && year === today.getFullYear())
|
||||
});
|
||||
}
|
||||
|
||||
if (!me.monthsPicker) {
|
||||
me.monthsPicker = new Common.UI.DataView({
|
||||
el: me.cmpEl.find('.calendar-content'),
|
||||
store: new Common.UI.DataViewStore(arrMonths),
|
||||
itemTemplate: _.template('<div class="name-month <% if (!curYear) { %> no-cur-year <% } %>" data-month="<%= indexMonth %>" data-year="<%= year %>"><%= nameMonth %></div>')
|
||||
});
|
||||
me.monthsPicker.on('item:click', function (picker, item, record, e) {
|
||||
var month = record.get('indexMonth'),
|
||||
year = record.get('year'),
|
||||
date = new Date();
|
||||
date.setFullYear(year, month);
|
||||
me.renderMonth(date);
|
||||
});
|
||||
me.enableKeyEvents && this.monthsPicker.on('item:keydown', function(view, record, e) {
|
||||
if (e.keyCode==Common.UI.Keys.ESC) {
|
||||
Common.NotificationCenter.trigger('dataview:blur');
|
||||
}
|
||||
});
|
||||
} else
|
||||
me.monthsPicker.store.reset(arrMonths);
|
||||
|
||||
me.enableKeyEvents && _.delay(function() {
|
||||
me.monthPicker.cmpEl.find('.dataview').focus();
|
||||
}, 10);
|
||||
},
|
||||
|
||||
renderMonth: function (date) {
|
||||
var me = this;
|
||||
me._state = 0;
|
||||
var firstDay = me.options.firstday;
|
||||
|
||||
// Current date
|
||||
var curDate = date || new Date(),
|
||||
curMonth = curDate.getMonth(),
|
||||
curIndexDayInWeek = curDate.getDay(),
|
||||
curNumberDayInMonth = curDate.getDate(),
|
||||
curYear = curDate.getFullYear();
|
||||
|
||||
me.currentDate = curDate;
|
||||
|
||||
// Name month
|
||||
me.topTitle = _.template([
|
||||
'<div class="button">',
|
||||
'<label>' + me.monthNames[curMonth] + ' ' + curYear + '</label>',
|
||||
'</div>'
|
||||
].join(''));
|
||||
me.cmpEl.find('.calendar-header .title').html(me.topTitle);
|
||||
me.cmpEl.find('.calendar-header .title').off();
|
||||
me.cmpEl.find('.calendar-header .title').on('click', _.bind(me.renderMonths, me));
|
||||
|
||||
// Name days of week
|
||||
var dayNamesTemplate = '';
|
||||
for (var i = firstDay; i < 7; i++) {
|
||||
dayNamesTemplate += '<label>' + me.dayNamesShort[i] + '</label>';
|
||||
}
|
||||
if (firstDay > 0) {
|
||||
dayNamesTemplate += '<label>' + me.dayNamesShort[0] + '</label>';
|
||||
}
|
||||
me.cmpEl.find('.calendar-header .bottom-row').html(_.template(dayNamesTemplate));
|
||||
|
||||
// Month
|
||||
var rows = 6,
|
||||
cols = 7;
|
||||
|
||||
var arrDays = [];
|
||||
|
||||
var d = new Date(curDate);
|
||||
d.setDate(1);
|
||||
var firstDayOfMonthIndex = d.getDay();
|
||||
|
||||
var daysInPrevMonth = me.daysInMonth(d.getTime() - (10 * 24 * 60 * 60 * 1000)),
|
||||
numberDay,
|
||||
month,
|
||||
year;
|
||||
if (firstDay === 0) {
|
||||
numberDay = (firstDayOfMonthIndex > 0) ? (daysInPrevMonth - (firstDayOfMonthIndex - 1)) : 1;
|
||||
} else {
|
||||
if (firstDayOfMonthIndex === 0) {
|
||||
numberDay = daysInPrevMonth - 5;
|
||||
} else {
|
||||
numberDay = daysInPrevMonth - (firstDayOfMonthIndex - 2);
|
||||
}
|
||||
}
|
||||
if ((firstDayOfMonthIndex > 0 && firstDay === 0) || firstDay === 1) {
|
||||
if (curMonth - 1 >= 0) {
|
||||
month = curMonth - 1;
|
||||
year = curYear;
|
||||
} else {
|
||||
month = 11;
|
||||
year = curYear - 1;
|
||||
}
|
||||
} else {
|
||||
month = curMonth;
|
||||
year = curYear;
|
||||
}
|
||||
|
||||
var tmp = new Date();
|
||||
tmp.setFullYear(year, month, numberDay);
|
||||
var today = new Date();
|
||||
|
||||
for(var r = 0; r < rows; r++) {
|
||||
for(var c = 0; c < cols; c++) {
|
||||
var tmpDay = tmp.getDay(),
|
||||
tmpNumber = tmp.getDate(),
|
||||
tmpMonth = tmp.getMonth(),
|
||||
tmpYear = tmp.getFullYear();
|
||||
arrDays.push({
|
||||
indexInWeek: tmpDay,
|
||||
dayNumber: tmpNumber,
|
||||
month: tmpMonth,
|
||||
year: tmpYear,
|
||||
isCurrentMonth: tmpMonth === curMonth,
|
||||
selected: (_.isDate(me.selectedDate)) ?
|
||||
(tmpNumber === me.selectedDate.getDate() && tmpMonth === me.selectedDate.getMonth() && tmpYear === me.selectedDate.getFullYear()) :
|
||||
(tmpNumber === today.getDate() && tmpMonth === today.getMonth() && tmpYear === today.getFullYear())
|
||||
});
|
||||
tmp.setDate(tmpNumber + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!me.monthPicker) {
|
||||
me.monthPicker = new Common.UI.DataView({
|
||||
el: me.cmpEl.find('.calendar-content'),
|
||||
store: new Common.UI.DataViewStore(arrDays),
|
||||
itemTemplate: _.template('<div class="number-day<% if (indexInWeek === 6 || indexInWeek === 0) { %> weekend<% } %><% if (!isCurrentMonth) { %> no-current-month<% } %>" data-number="<%= dayNumber %>" data-month="<%= month %>" data-year="<%= year %>"><%= dayNumber %></div>')
|
||||
});
|
||||
me.monthPicker.on('item:click', function(picker, item, record, e) {
|
||||
var day = record.get('dayNumber'),
|
||||
month = record.get('month'),
|
||||
year = record.get('year');
|
||||
if (_.isUndefined(me.selectedDate)) {
|
||||
me.selectedDate = new Date();
|
||||
}
|
||||
me.selectedDate.setFullYear(year, month, day);
|
||||
me.trigger('date:click', me, me.selectedDate);
|
||||
});
|
||||
me.enableKeyEvents && this.monthPicker.on('item:keydown', function(view, record, e) {
|
||||
if (e.keyCode==Common.UI.Keys.ESC) {
|
||||
Common.NotificationCenter.trigger('dataview:blur');
|
||||
}
|
||||
});
|
||||
} else
|
||||
me.monthPicker.store.reset(arrDays);
|
||||
|
||||
me.enableKeyEvents && _.delay(function() {
|
||||
me.monthPicker.cmpEl.find('.dataview').focus();
|
||||
}, 10);
|
||||
},
|
||||
|
||||
daysInMonth: function (date) {
|
||||
var d;
|
||||
d = date ? new Date(date) : new Date();
|
||||
var result = new Date();
|
||||
result.setFullYear(d.getFullYear(), d.getMonth() + 1, 0);
|
||||
return result.getDate();
|
||||
},
|
||||
|
||||
setDate: function (date) {
|
||||
if (_.isDate(date)) {
|
||||
this.selectedDate = new Date(date);
|
||||
this.renderMonth(this.selectedDate);
|
||||
}
|
||||
},
|
||||
|
||||
textJanuary: 'January',
|
||||
textFebruary: 'February',
|
||||
textMarch: 'March',
|
||||
textApril: 'April',
|
||||
textMay: 'May',
|
||||
textJune: 'June',
|
||||
textJuly: 'July',
|
||||
textAugust: 'August',
|
||||
textSeptember: 'September',
|
||||
textOctober: 'October',
|
||||
textNovember: 'November',
|
||||
textDecember: 'December',
|
||||
textShortJanuary: 'Jan',
|
||||
textShortFebruary: 'Feb',
|
||||
textShortMarch: 'Mar',
|
||||
textShortApril: 'Apr',
|
||||
textShortMay: 'May',
|
||||
textShortJune: 'Jun',
|
||||
textShortJuly: 'Jul',
|
||||
textShortAugust: 'Aug',
|
||||
textShortSeptember: 'Sep',
|
||||
textShortOctober: 'Oct',
|
||||
textShortNovember: 'Nov',
|
||||
textShortDecember: 'Dec',
|
||||
textShortSunday: 'Su',
|
||||
textShortMonday: 'Mo',
|
||||
textShortTuesday: 'Tu',
|
||||
textShortWednesday: 'We',
|
||||
textShortThursday: 'Th',
|
||||
textShortFriday: 'Fr',
|
||||
textShortSaturday: 'Sa',
|
||||
textMonths: 'Months',
|
||||
textYears: 'Years'
|
||||
}, Common.UI.Calendar || {}));
|
||||
});
|
|
@ -94,7 +94,7 @@ define([
|
|||
checked : false,
|
||||
value : 'unchecked',
|
||||
|
||||
template : _.template('<label class="checkbox-indeterminate"><input type="button" class="img-commonctrl"><span><%= labelText %></span></label>'),
|
||||
template : _.template('<label class="checkbox-indeterminate"><input type="button" class="button__checkbox"><span><%= labelText %></span></label>'),
|
||||
|
||||
initialize : function(options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||
|
|
|
@ -268,4 +268,108 @@ define([
|
|||
formcontrol.css('background-position', '0 -' + record.get('offsety') + 'px');
|
||||
}
|
||||
}, Common.UI.ComboBorderType || {}));
|
||||
|
||||
Common.UI.ComboBoxColor = Common.UI.ComboBox.extend(_.extend({
|
||||
template: _.template([
|
||||
'<div class="input-group combobox input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
||||
'<div class="form-control" style="padding:2px 14px 2px 3px; <%= style %> display: block;">',
|
||||
'<div style="display: inline-block;overflow: hidden;width: 100%;height: 100%;"></div>',
|
||||
'</div>',
|
||||
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>',
|
||||
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
|
||||
'<% _.each(items, function(item) { %>',
|
||||
'<% if (item.value==-1) { %>',
|
||||
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>',
|
||||
'<% } else { %>',
|
||||
'<li id="<%= item.id %>" data-value="<%= item.value %>">',
|
||||
'<a tabindex="-1" type="menuitem" style="padding: 5px;"><div style="height: 15px;background-color: #<%= item.value %>"></div></a>',
|
||||
'</li>',
|
||||
'<% } %>',
|
||||
'<% }); %>',
|
||||
'</ul>',
|
||||
'</div>'
|
||||
].join('')),
|
||||
|
||||
itemClicked: function (e) {
|
||||
var el = $(e.currentTarget).parent();
|
||||
|
||||
this._selectedItem = this.store.findWhere({
|
||||
id: el.attr('id')
|
||||
});
|
||||
if (this._selectedItem) {
|
||||
$('.selected', $(this.el)).removeClass('selected');
|
||||
el.addClass('selected');
|
||||
this.updateFormControl(this._selectedItem);
|
||||
|
||||
this.trigger('selected', this, _.extend({}, this._selectedItem.toJSON()), e);
|
||||
e.preventDefault();
|
||||
}
|
||||
},
|
||||
|
||||
updateFormControl: function(record) {
|
||||
var formcontrol = $(this.el).find('.form-control > div');
|
||||
|
||||
if (record.get('value')!=-1) {
|
||||
formcontrol[0].innerHTML = '';
|
||||
formcontrol.css({'background': '#' + record.get('value'), 'margin-top': '0'});
|
||||
} else {
|
||||
formcontrol[0].innerHTML = record.get('displayValue');
|
||||
formcontrol.css({'background': '', 'margin-top': '1px'});
|
||||
}
|
||||
},
|
||||
|
||||
setValue: function(value) {
|
||||
var obj;
|
||||
this._selectedItem = this.store.findWhere((obj={}, obj[this.valueField]=value, obj));
|
||||
|
||||
$('.selected', $(this.el)).removeClass('selected');
|
||||
|
||||
if (this._selectedItem) {
|
||||
this.updateFormControl(this._selectedItem);
|
||||
$('#' + this._selectedItem.get('id'), $(this.el)).addClass('selected');
|
||||
} else {
|
||||
var formcontrol = $(this.el).find('.form-control > div');
|
||||
formcontrol[0].innerHTML = '';
|
||||
formcontrol.css('background', '');
|
||||
}
|
||||
},
|
||||
|
||||
onResetItems: function() {
|
||||
if (this.itemsTemplate) {
|
||||
$(this.el).find('ul').html( $(this.itemsTemplate({
|
||||
items: this.store.toJSON(),
|
||||
scope: this
|
||||
})));
|
||||
} else {
|
||||
$(this.el).find('ul').html(_.template([
|
||||
'<% _.each(items, function(item) { %>',
|
||||
'<% if (item.value==-1) { %>',
|
||||
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>',
|
||||
'<% } else { %>',
|
||||
'<li id="<%= item.id %>" data-value="<%= item.value %>">',
|
||||
'<a tabindex="-1" type="menuitem" style="padding: 5px;"><div style="height: 15px;background-color: #<%= item.value %>"></div></a>',
|
||||
'</li>',
|
||||
'<% } %>',
|
||||
'<% }); %>'
|
||||
].join(''))({
|
||||
items: this.store.toJSON(),
|
||||
scope: this
|
||||
}));
|
||||
}
|
||||
|
||||
if (!_.isUndefined(this.scroller)) {
|
||||
this.scroller.destroy();
|
||||
delete this.scroller;
|
||||
}
|
||||
this.scroller = new Common.UI.Scroller(_.extend({
|
||||
el: $('.dropdown-menu', this.cmpEl),
|
||||
minScrollbarLength : 40,
|
||||
includePadding : true,
|
||||
wheelSpeed: 10,
|
||||
alwaysVisibleY: this.scrollAlwaysVisible
|
||||
}, this.options.scroller));
|
||||
}
|
||||
|
||||
}, Common.UI.ComboBoxColor || {}));
|
||||
|
||||
});
|
|
@ -217,6 +217,11 @@ define([
|
|||
});
|
||||
}
|
||||
|
||||
var $list = el.find('.dropdown-menu');
|
||||
if ($list.hasClass('menu-absolute')) {
|
||||
$list.css('min-width', el.outerWidth());
|
||||
}
|
||||
|
||||
el.on('show.bs.dropdown', _.bind(me.onBeforeShowMenu, me));
|
||||
el.on('shown.bs.dropdown', _.bind(me.onAfterShowMenu, me));
|
||||
el.on('hide.bs.dropdown', _.bind(me.onBeforeHideMenu, me));
|
||||
|
@ -292,6 +297,12 @@ define([
|
|||
tip.hide();
|
||||
}
|
||||
}
|
||||
|
||||
var $list = this.cmpEl.find('ul');
|
||||
if ($list.hasClass('menu-absolute')) {
|
||||
var offset = this.cmpEl.offset();
|
||||
$list.css({left: offset.left, top: offset.top + this.cmpEl.outerHeight() + 2});
|
||||
}
|
||||
},
|
||||
|
||||
onAfterShowMenu: function(e) {
|
||||
|
@ -300,11 +311,13 @@ define([
|
|||
|
||||
if ($selected.length) {
|
||||
var itemTop = $selected.position().top,
|
||||
itemHeight = $selected.height(),
|
||||
listHeight = $list.height();
|
||||
itemHeight = $selected.outerHeight(),
|
||||
listHeight = $list.outerHeight();
|
||||
|
||||
if (itemTop < 0 || itemTop + itemHeight > listHeight) {
|
||||
$list.scrollTop($list.scrollTop() + itemTop + itemHeight - (listHeight/2));
|
||||
var height = $list.scrollTop() + itemTop + (itemHeight - listHeight)/2;
|
||||
height = (Math.floor(height/itemHeight) * itemHeight);
|
||||
$list.scrollTop(height);
|
||||
}
|
||||
setTimeout(function(){$selected.find('a').focus();}, 1);
|
||||
}
|
||||
|
@ -346,6 +359,8 @@ define([
|
|||
this.onAfterHideMenu(e);
|
||||
return false;
|
||||
} else if (this.search && e.keyCode > 64 && e.keyCode < 91 && e.key){
|
||||
if (typeof this._search !== 'object') return;
|
||||
|
||||
var me = this;
|
||||
clearTimeout(this._search.timer);
|
||||
this._search.timer = setTimeout(function () { me._search = {}; }, 1000);
|
||||
|
@ -389,10 +404,12 @@ define([
|
|||
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
|
||||
var $list = $(this.el).find('ul');
|
||||
var itemTop = item.position().top,
|
||||
itemHeight = item.height(),
|
||||
listHeight = $list.height();
|
||||
itemHeight = item.outerHeight(),
|
||||
listHeight = $list.outerHeight();
|
||||
if (itemTop < 0 || itemTop + itemHeight > listHeight) {
|
||||
$list.scrollTop($list.scrollTop() + itemTop + itemHeight - (listHeight/2));
|
||||
var height = $list.scrollTop() + itemTop;
|
||||
height = (Math.floor(height/itemHeight) * itemHeight);
|
||||
$list.scrollTop(height);
|
||||
}
|
||||
}
|
||||
item.focus();
|
||||
|
|
|
@ -430,7 +430,7 @@ define([
|
|||
},
|
||||
|
||||
addItemToRecent: function(record, silent) {
|
||||
if (this.recent<1) return;
|
||||
if (!record || this.recent<1) return;
|
||||
|
||||
var font = this.store.findWhere({name: record.get('name'),type:FONT_TYPE_RECENT});
|
||||
font && this.store.remove(font);
|
||||
|
|
|
@ -47,31 +47,6 @@ define([
|
|||
'use strict';
|
||||
|
||||
Common.UI.DimensionPicker = Common.UI.BaseView.extend((function(){
|
||||
var me,
|
||||
rootEl,
|
||||
areaMouseCatcher,
|
||||
areaUnHighLighted,
|
||||
areaHighLighted,
|
||||
areaStatus,
|
||||
curColumns = 0,
|
||||
curRows = 0;
|
||||
|
||||
var onMouseMove = function(event){
|
||||
me.setTableSize(
|
||||
Math.ceil((event.offsetX === undefined ? event.originalEvent.layerX : event.offsetX*Common.Utils.zoom()) / me.itemSize),
|
||||
Math.ceil((event.offsetY === undefined ? event.originalEvent.layerY : event.offsetY*Common.Utils.zoom()) / me.itemSize),
|
||||
event
|
||||
);
|
||||
};
|
||||
|
||||
var onMouseLeave = function(event){
|
||||
me.setTableSize(0, 0, event);
|
||||
};
|
||||
|
||||
var onHighLightedMouseClick = function(e){
|
||||
me.trigger('select', me, curColumns, curRows, e);
|
||||
};
|
||||
|
||||
return {
|
||||
options: {
|
||||
itemSize : 18,
|
||||
|
@ -95,9 +70,13 @@ define([
|
|||
initialize : function(options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||
|
||||
me = this;
|
||||
var me = this;
|
||||
|
||||
rootEl = me.$el || $(this.el);
|
||||
this.render();
|
||||
|
||||
this.cmpEl = me.$el || $(this.el);
|
||||
|
||||
var rootEl = this.cmpEl;
|
||||
|
||||
me.itemSize = me.options.itemSize;
|
||||
me.minRows = me.options.minRows;
|
||||
|
@ -105,31 +84,48 @@ define([
|
|||
me.maxRows = me.options.maxRows;
|
||||
me.maxColumns = me.options.maxColumns;
|
||||
|
||||
this.render();
|
||||
me.curColumns = 0;
|
||||
me.curRows = 0;
|
||||
|
||||
var onMouseMove = function(event){
|
||||
me.setTableSize(
|
||||
Math.ceil((event.offsetX === undefined ? event.originalEvent.layerX : event.offsetX*Common.Utils.zoom()) / me.itemSize),
|
||||
Math.ceil((event.offsetY === undefined ? event.originalEvent.layerY : event.offsetY*Common.Utils.zoom()) / me.itemSize),
|
||||
event
|
||||
);
|
||||
};
|
||||
|
||||
var onMouseLeave = function(event){
|
||||
me.setTableSize(0, 0, event);
|
||||
};
|
||||
|
||||
var onHighLightedMouseClick = function(e){
|
||||
me.trigger('select', me, me.curColumns, me.curRows, e);
|
||||
};
|
||||
|
||||
if (rootEl){
|
||||
areaMouseCatcher = rootEl.find('.dimension-picker-mousecatcher');
|
||||
areaUnHighLighted = rootEl.find('.dimension-picker-unhighlighted');
|
||||
areaHighLighted = rootEl.find('.dimension-picker-highlighted');
|
||||
areaStatus = rootEl.find('.dimension-picker-status');
|
||||
var areaMouseCatcher = rootEl.find('.dimension-picker-mousecatcher');
|
||||
me.areaUnHighLighted = rootEl.find('.dimension-picker-unhighlighted');
|
||||
me.areaHighLighted = rootEl.find('.dimension-picker-highlighted');
|
||||
me.areaStatus = rootEl.find('.dimension-picker-status');
|
||||
|
||||
rootEl.css({width: me.minColumns + 'em'});
|
||||
areaMouseCatcher.css('z-index', 1);
|
||||
areaMouseCatcher.width(me.maxColumns + 'em').height(me.maxRows + 'em');
|
||||
areaUnHighLighted.width(me.minColumns + 'em').height(me.minRows + 'em');
|
||||
areaStatus.html(curColumns + ' x ' + curRows);
|
||||
areaStatus.width(areaUnHighLighted.width());
|
||||
}
|
||||
me.areaUnHighLighted.width(me.minColumns + 'em').height(me.minRows + 'em');
|
||||
me.areaStatus.html(me.curColumns + ' x ' + me.curRows);
|
||||
me.areaStatus.width(me.areaUnHighLighted.width());
|
||||
|
||||
areaMouseCatcher.on('mousemove', onMouseMove);
|
||||
areaHighLighted.on('mousemove', onMouseMove);
|
||||
areaUnHighLighted.on('mousemove', onMouseMove);
|
||||
areaMouseCatcher.on('mouseleave', onMouseLeave);
|
||||
areaHighLighted.on('mouseleave', onMouseLeave);
|
||||
areaUnHighLighted.on('mouseleave', onMouseLeave);
|
||||
areaMouseCatcher.on('click', onHighLightedMouseClick);
|
||||
areaHighLighted.on('click', onHighLightedMouseClick);
|
||||
areaUnHighLighted.on('click', onHighLightedMouseClick);
|
||||
areaMouseCatcher.on('mousemove', onMouseMove);
|
||||
me.areaHighLighted.on('mousemove', onMouseMove);
|
||||
me.areaUnHighLighted.on('mousemove', onMouseMove);
|
||||
areaMouseCatcher.on('mouseleave', onMouseLeave);
|
||||
me.areaHighLighted.on('mouseleave', onMouseLeave);
|
||||
me.areaUnHighLighted.on('mouseleave', onMouseLeave);
|
||||
areaMouseCatcher.on('click', onHighLightedMouseClick);
|
||||
me.areaHighLighted.on('click', onHighLightedMouseClick);
|
||||
me.areaUnHighLighted.on('click', onHighLightedMouseClick);
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
|
@ -142,38 +138,38 @@ define([
|
|||
if (columns > this.maxColumns) columns = this.maxColumns;
|
||||
if (rows > this.maxRows) rows = this.maxRows;
|
||||
|
||||
if (curColumns != columns || curRows != rows){
|
||||
curColumns = columns;
|
||||
curRows = rows;
|
||||
if (this.curColumns != columns || this.curRows != rows){
|
||||
this.curColumns = columns;
|
||||
this.curRows = rows;
|
||||
|
||||
areaHighLighted.width(curColumns + 'em').height(curRows + 'em');
|
||||
areaUnHighLighted.width(
|
||||
((curColumns < me.minColumns)
|
||||
? me.minColumns
|
||||
: ((curColumns + 1 > me.maxColumns)
|
||||
? me.maxColumns
|
||||
: curColumns + 1)) + 'em'
|
||||
).height(((curRows < me.minRows)
|
||||
? me.minRows
|
||||
: ((curRows + 1 > me.maxRows)
|
||||
? me.maxRows
|
||||
: curRows + 1)) + 'em'
|
||||
this.areaHighLighted.width(this.curColumns + 'em').height(this.curRows + 'em');
|
||||
this.areaUnHighLighted.width(
|
||||
((this.curColumns < this.minColumns)
|
||||
? this.minColumns
|
||||
: ((this.curColumns + 1 > this.maxColumns)
|
||||
? this.maxColumns
|
||||
: this.curColumns + 1)) + 'em'
|
||||
).height(((this.curRows < this.minRows)
|
||||
? this.minRows
|
||||
: ((this.curRows + 1 > this.maxRows)
|
||||
? this.maxRows
|
||||
: this.curRows + 1)) + 'em'
|
||||
);
|
||||
|
||||
rootEl.width(areaUnHighLighted.width());
|
||||
areaStatus.html(curColumns + ' x ' + curRows);
|
||||
areaStatus.width(areaUnHighLighted.width());
|
||||
this.cmpEl.width(this.areaUnHighLighted.width());
|
||||
this.areaStatus.html(this.curColumns + ' x ' + this.curRows);
|
||||
this.areaStatus.width(this.areaUnHighLighted.width());
|
||||
|
||||
me.trigger('change', me, curColumns, curRows, event);
|
||||
this.trigger('change', this, this.curColumns, this.curRows, event);
|
||||
}
|
||||
},
|
||||
|
||||
getColumnsCount: function() {
|
||||
return curColumns;
|
||||
return this.curColumns;
|
||||
},
|
||||
|
||||
getRowsCount: function() {
|
||||
return curRows;
|
||||
return this.curRows;
|
||||
}
|
||||
}
|
||||
})())
|
||||
|
|
|
@ -67,11 +67,15 @@ define([
|
|||
this.trigger('items:reset', this);
|
||||
},
|
||||
|
||||
onAddItem: function(record, store, opts) {
|
||||
var view = new Common.UI.DataViewItem({
|
||||
createNewItem: function(record) {
|
||||
return new Common.UI.DataViewItem({
|
||||
template: this.itemTemplate,
|
||||
model: record
|
||||
});
|
||||
},
|
||||
|
||||
onAddItem: function(record, store, opts) {
|
||||
var view = this.createNewItem(record);
|
||||
|
||||
if (!this.innerEl)
|
||||
this.innerEl = $(this.el).find('.inner');
|
||||
|
|
|
@ -380,15 +380,23 @@ define([
|
|||
onAfterShowMenu: function(e) {
|
||||
this.trigger('show:after', this, e);
|
||||
if (this.scroller) {
|
||||
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
|
||||
var menuRoot = this.menuRoot,
|
||||
$selected = menuRoot.find('> li .checked');
|
||||
var menuRoot = this.menuRoot;
|
||||
if (this.wheelSpeed===undefined) {
|
||||
var item = menuRoot.find('> li:first'),
|
||||
itemHeight = (item.length) ? item.outerHeight() : 1;
|
||||
this.wheelSpeed = Math.min((Math.floor(menuRoot.height()/itemHeight) * itemHeight)/10, 20);
|
||||
}
|
||||
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible, wheelSpeed: this.wheelSpeed});
|
||||
|
||||
var $selected = menuRoot.find('> li .checked');
|
||||
if ($selected.length) {
|
||||
var itemTop = $selected.position().top,
|
||||
itemHeight = $selected.height(),
|
||||
listHeight = menuRoot.height();
|
||||
itemHeight = $selected.outerHeight(),
|
||||
listHeight = menuRoot.outerHeight();
|
||||
if (itemTop < 0 || itemTop + itemHeight > listHeight) {
|
||||
menuRoot.scrollTop(menuRoot.scrollTop() + itemTop + itemHeight - (listHeight/2));
|
||||
var height = menuRoot.scrollTop() + itemTop + (itemHeight - listHeight)/2;
|
||||
height = (Math.floor(height/itemHeight) * itemHeight);
|
||||
menuRoot.scrollTop(height);
|
||||
}
|
||||
setTimeout(function(){$selected.focus();}, 1);
|
||||
}
|
||||
|
@ -469,12 +477,14 @@ define([
|
|||
this._search.index = idxCandidate;
|
||||
var item = itemCandidate.cmpEl.find('a');
|
||||
if (this.scroller) {
|
||||
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
|
||||
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible, wheelSpeed: this.wheelSpeed});
|
||||
var itemTop = item.position().top,
|
||||
itemHeight = item.height(),
|
||||
listHeight = this.menuRoot.height();
|
||||
itemHeight = item.outerHeight(),
|
||||
listHeight = this.menuRoot.outerHeight();
|
||||
if (itemTop < 0 || itemTop + itemHeight > listHeight) {
|
||||
this.menuRoot.scrollTop(this.menuRoot.scrollTop() + itemTop + itemHeight - (listHeight/2));
|
||||
var height = this.menuRoot.scrollTop() + itemTop;
|
||||
height = (Math.floor(height/itemHeight) * itemHeight);
|
||||
this.menuRoot.scrollTop(height);
|
||||
}
|
||||
}
|
||||
item.focus();
|
||||
|
@ -541,6 +551,8 @@ define([
|
|||
} else {
|
||||
left = docW - menuW;
|
||||
}
|
||||
if (left < 0)
|
||||
left = 0;
|
||||
|
||||
if (this.options.restoreHeight) {
|
||||
if (typeof (this.options.restoreHeight) == "number") {
|
||||
|
@ -552,8 +564,10 @@ define([
|
|||
suppressScrollX: true,
|
||||
alwaysVisibleY: this.scrollAlwaysVisible
|
||||
}));
|
||||
this.wheelSpeed = undefined;
|
||||
} else if ( top + menuH < docH && menuRoot.height() < this.options.restoreHeight) {
|
||||
menuRoot.css('max-height', (Math.min(docH - top, this.options.restoreHeight)) + 'px');
|
||||
this.wheelSpeed = undefined;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -568,7 +582,6 @@ define([
|
|||
if (top < 0)
|
||||
top = 0;
|
||||
}
|
||||
|
||||
if (this.options.additionalAlign)
|
||||
this.options.additionalAlign.call(this, menuRoot, left, top);
|
||||
else
|
||||
|
@ -848,10 +861,12 @@ define([
|
|||
$selected = menuRoot.find('> li .checked');
|
||||
if ($selected.length) {
|
||||
var itemTop = $selected.position().top,
|
||||
itemHeight = $selected.height(),
|
||||
listHeight = menuRoot.height();
|
||||
itemHeight = $selected.outerHeight(),
|
||||
listHeight = menuRoot.outerHeight();
|
||||
if (itemTop < 0 || itemTop + itemHeight > listHeight) {
|
||||
menuRoot.scrollTop(menuRoot.scrollTop() + itemTop + itemHeight - (listHeight/2));
|
||||
var height = menuRoot.scrollTop() + itemTop + (itemHeight - listHeight)/2;
|
||||
height = (Math.floor(height/itemHeight) * itemHeight);
|
||||
menuRoot.scrollTop(height);
|
||||
}
|
||||
setTimeout(function(){$selected.focus();}, 1);
|
||||
}
|
||||
|
@ -936,10 +951,12 @@ define([
|
|||
if (this.scroller) {
|
||||
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
|
||||
var itemTop = item.position().top,
|
||||
itemHeight = item.height(),
|
||||
listHeight = this.menuRoot.height();
|
||||
itemHeight = item.outerHeight(),
|
||||
listHeight = this.menuRoot.outerHeight();
|
||||
if (itemTop < 0 || itemTop + itemHeight > listHeight) {
|
||||
this.menuRoot.scrollTop(this.menuRoot.scrollTop() + itemTop + itemHeight - (listHeight/2));
|
||||
var height = this.menuRoot.scrollTop() + itemTop;
|
||||
height = (Math.floor(height/itemHeight) * itemHeight);
|
||||
this.menuRoot.scrollTop(height);
|
||||
}
|
||||
}
|
||||
item.focus();
|
||||
|
|
|
@ -183,6 +183,7 @@ define([
|
|||
|
||||
if (this.checkable && firstChild) {
|
||||
firstChild.toggleClass('checkable', this.checkable);
|
||||
firstChild.toggleClass('no-checkmark', this.options.checkmark===false);
|
||||
firstChild.toggleClass('checked', this.checked);
|
||||
if (!_.isEmpty(this.iconCls)) {
|
||||
firstChild.css('background-image', 'none');
|
||||
|
|
|
@ -144,6 +144,9 @@ define([
|
|||
el.on('input', '.form-control', _.bind(this.onInput, this));
|
||||
if (!this.options.allowDecimal)
|
||||
el.on('keypress', '.form-control', _.bind(this.onKeyPress, this));
|
||||
el.on('focus', 'input.form-control', function() {
|
||||
me.$input && me.$input.select();
|
||||
});
|
||||
|
||||
this.switches = {
|
||||
count: 1,
|
||||
|
@ -347,6 +350,7 @@ define([
|
|||
var value = this.getRawValue();
|
||||
if (this.value != value) {
|
||||
this.onEnterValue();
|
||||
this.trigger('inputleave', this);
|
||||
return (this.value == value);
|
||||
}
|
||||
} else {
|
||||
|
@ -355,6 +359,8 @@ define([
|
|||
} else {
|
||||
this._fromKeyDown = true;
|
||||
}
|
||||
if (e.keyCode==Common.UI.Keys.RETURN || e.keyCode==Common.UI.Keys.ESC)
|
||||
this.trigger('inputleave', this);
|
||||
},
|
||||
|
||||
onKeyUp: function (e) {
|
||||
|
@ -477,6 +483,8 @@ define([
|
|||
|
||||
_step: function (type, suspend) {
|
||||
(type) ? this._increase(suspend) : this._decrease(suspend);
|
||||
if (this.options.hold && this.switches.fromKeyDown)
|
||||
this.$input && this.$input.select();
|
||||
},
|
||||
|
||||
_add: function (a, b, precision) {
|
||||
|
|
|
@ -74,7 +74,7 @@ define([
|
|||
if ( this.isFolded ) {
|
||||
if ( $(e.target).parents('.toolbar, #file-menu-panel').length ){
|
||||
} else {
|
||||
this.collapse();
|
||||
optsFold.$bar && optsFold.$bar.hasClass('expanded') && this.collapse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,11 +159,21 @@ define([
|
|||
me.changeSliderStyle();
|
||||
},
|
||||
|
||||
addNewThumb: function(index, color) {
|
||||
var me = this;
|
||||
me.thumbs[index].thumbcolor = me.thumbs[index].thumb.find('> div');
|
||||
(index>0) && this.setColorValue(color, index);
|
||||
me.sortThumbs();
|
||||
me.changeSliderStyle();
|
||||
me.changeGradientStyle();
|
||||
},
|
||||
|
||||
removeThumb: function(index) {
|
||||
if (index===undefined) index = this.thumbs.length-1;
|
||||
if (index>0) {
|
||||
if (this.thumbs.length > 2) {
|
||||
this.thumbs[index].thumb.remove();
|
||||
this.thumbs.splice(index, 1);
|
||||
this.sortThumbs();
|
||||
this.changeSliderStyle();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -71,7 +71,7 @@ define([
|
|||
disabled : false,
|
||||
rendered : false,
|
||||
|
||||
template : _.template('<label class="radiobox"><input type="button" name="<%= name %>" class="img-commonctrl"><span><%= labelText %></span></label>'),
|
||||
template : _.template('<label class="radiobox"><input type="button" name="<%= name %>" class="button__radiobox"><span><%= labelText %></span></label>'),
|
||||
|
||||
initialize : function(options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||
|
@ -111,6 +111,7 @@ define([
|
|||
return;
|
||||
|
||||
if (disabled !== this.disabled) {
|
||||
this.$label.toggleClass('disabled', disabled);
|
||||
this.$radio.toggleClass('disabled', disabled);
|
||||
(disabled) ? this.$radio.attr({disabled: disabled}) : this.$radio.removeAttr('disabled');
|
||||
}
|
||||
|
|
|
@ -347,17 +347,29 @@ define([
|
|||
pos = Math.max(0, Math.min(100, position)),
|
||||
value = pos/me.delta + me.minValue;
|
||||
|
||||
me.setThumbPosition(index, pos);
|
||||
me.thumbs[index].value = value;
|
||||
if (me.isRemoveThumb) {
|
||||
if (me.thumbs.length < 3) {
|
||||
$(document).off('mouseup', me.binding.onMouseUp);
|
||||
$(document).off('mousemove', me.binding.onMouseMove);
|
||||
return;
|
||||
}
|
||||
me.trigger('removethumb', me, _.findIndex(me.thumbs, {index: index}));
|
||||
me.trigger('change', me, value, lastValue);
|
||||
me.trigger('changecomplete', me, value, lastValue);
|
||||
} else {
|
||||
me.setThumbPosition(index, pos);
|
||||
me.thumbs[index].value = value;
|
||||
|
||||
if (need_sort)
|
||||
me.sortThumbs();
|
||||
if (need_sort)
|
||||
me.sortThumbs();
|
||||
}
|
||||
|
||||
$(document).off('mouseup', me.binding.onMouseUp);
|
||||
$(document).off('mousemove', me.binding.onMouseMove);
|
||||
|
||||
me._dragstart = undefined;
|
||||
me.trigger('changecomplete', me, value, lastValue);
|
||||
!me.isRemoveThumb && me.trigger('changecomplete', me, value, lastValue);
|
||||
me.isRemoveThumb = undefined;
|
||||
};
|
||||
|
||||
var onMouseMove = function (e) {
|
||||
|
@ -382,6 +394,10 @@ define([
|
|||
if (need_sort)
|
||||
me.sortThumbs();
|
||||
|
||||
var positionY = e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top;
|
||||
me.isRemoveThumb = positionY > me.cmpEl.height() || positionY < 0;
|
||||
me.setRemoveThumb(index, me.isRemoveThumb);
|
||||
|
||||
if (Math.abs(value-lastValue)>0.001)
|
||||
me.trigger('change', me, value, lastValue);
|
||||
};
|
||||
|
@ -403,7 +419,25 @@ define([
|
|||
$(document).on('mousemove', null, e.data, me.binding.onMouseMove);
|
||||
};
|
||||
|
||||
var onTrackMouseDown = function (e) {
|
||||
var onTrackMouseUp = function (e) {
|
||||
if ( me.disabled || !_.isUndefined(me._dragstart) || me.thumbs.length > 9) return;
|
||||
|
||||
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) / me.width * 100)))),
|
||||
nearIndex = findThumb(pos),
|
||||
thumbColor = me.thumbs[nearIndex].colorValue,
|
||||
thumbValue = me.thumbs[nearIndex].value,
|
||||
value = pos/me.delta + me.minValue;
|
||||
me.addThumb();
|
||||
var index = me.thumbs.length - 1;
|
||||
me.setThumbPosition(index, pos);
|
||||
me.thumbs[index].value = value;
|
||||
me.trigger('addthumb', me, index, nearIndex, thumbColor);
|
||||
|
||||
me.trigger('change', me);
|
||||
me.trigger('changecomplete', me);
|
||||
};
|
||||
|
||||
/*var onTrackMouseDown = function (e) {
|
||||
if ( me.disabled ) return;
|
||||
|
||||
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) / me.width * 100)))),
|
||||
|
@ -416,7 +450,7 @@ define([
|
|||
|
||||
me.trigger('change', me, value, lastValue);
|
||||
me.trigger('changecomplete', me, value, lastValue);
|
||||
};
|
||||
};*/
|
||||
|
||||
var findThumb = function(pos) {
|
||||
var nearest = 100,
|
||||
|
@ -462,7 +496,8 @@ define([
|
|||
me.setActiveThumb(0, true);
|
||||
|
||||
if (!me.rendered) {
|
||||
el.on('mousedown', '.track', onTrackMouseDown);
|
||||
/*el.on('mousedown', '.track', onTrackMouseDown);*/
|
||||
el.on('mouseup', '.track', onTrackMouseUp);
|
||||
}
|
||||
|
||||
me.rendered = true;
|
||||
|
@ -472,11 +507,23 @@ define([
|
|||
|
||||
setActiveThumb: function(index, suspend) {
|
||||
this.currentThumb = index;
|
||||
this.$thumbs = this.cmpEl.find('.thumb');
|
||||
this.$thumbs.removeClass('active');
|
||||
this.thumbs[index].thumb.addClass('active');
|
||||
if (suspend!==true) this.trigger('thumbclick', this, index);
|
||||
},
|
||||
|
||||
setRemoveThumb: function(index, remove) {
|
||||
var ind = _.findIndex(this.thumbs, {index: index});
|
||||
if (ind !== -1) {
|
||||
if (remove && this.thumbs.length > 2) {
|
||||
this.$el.find('.active').addClass('remove');
|
||||
} else {
|
||||
this.$el.find('.remove').removeClass('remove');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setThumbPosition: function(index, x) {
|
||||
this.thumbs[index].position = x;
|
||||
this.thumbs[index].thumb.css({left: x + '%'});
|
||||
|
|
|
@ -51,8 +51,8 @@ define([
|
|||
this.active = false;
|
||||
this.label = 'Tab';
|
||||
this.cls = '';
|
||||
this.template = _.template(['<li class="<% if(active){ %>active<% } %> <% if(cls.length){%><%= cls %><%}%>" data-label="<%= label %>">',
|
||||
'<a><%- label %></a>',
|
||||
this.template = _.template(['<li class="<% if(active){ %>active selected<% } %> <% if(cls.length){%><%= cls %><%}%>" data-label="<%= label %>">',
|
||||
'<a title="<%= label %>"><%- label %></a>',
|
||||
'</li>'].join(''));
|
||||
|
||||
this.initialize.call(this, opts);
|
||||
|
@ -82,6 +82,10 @@ define([
|
|||
this.$el.addClass('active');
|
||||
},
|
||||
|
||||
isSelected: function() {
|
||||
return this.$el.hasClass('selected');
|
||||
},
|
||||
|
||||
deactivate: function(){
|
||||
this.$el.removeClass('active');
|
||||
},
|
||||
|
@ -110,6 +114,11 @@ define([
|
|||
this.$el.removeClass(cls);
|
||||
},
|
||||
|
||||
toggleClass: function(cls) {
|
||||
if (cls.length)
|
||||
this.$el.toggleClass(cls);
|
||||
},
|
||||
|
||||
hasClass: function(cls) {
|
||||
return this.$el.hasClass(cls);
|
||||
},
|
||||
|
|
|
@ -69,12 +69,28 @@ define([
|
|||
};
|
||||
|
||||
StateManager.prototype.attach = function (tab) {
|
||||
tab.changeState = $.proxy(function () {
|
||||
this.trigger('tab:change', tab);
|
||||
this.bar.$el.find('ul > li.active').removeClass('active');
|
||||
tab.activate();
|
||||
tab.changeState = $.proxy(function (select) {
|
||||
if (select) {
|
||||
tab.toggleClass('selected');
|
||||
var selectTab = _.find(this.bar.selectTabs, function (item) {return item.sheetindex === tab.sheetindex;});
|
||||
if (selectTab) {
|
||||
this.bar.selectTabs = _.without(this.bar.selectTabs, selectTab);
|
||||
} else {
|
||||
this.bar.selectTabs.push(tab);
|
||||
}
|
||||
} else {
|
||||
if (!tab.isSelected()) {
|
||||
this.bar.$el.find('ul > li.selected').removeClass('selected');
|
||||
tab.addClass('selected');
|
||||
this.bar.selectTabs.length = 0;
|
||||
this.bar.selectTabs.push(tab);
|
||||
}
|
||||
this.trigger('tab:change', tab);
|
||||
this.bar.$el.find('ul > li.active').removeClass('active');
|
||||
tab.activate();
|
||||
|
||||
this.bar.trigger('tab:changed', this.bar, this.bar.tabs.indexOf(tab), tab);
|
||||
this.bar.trigger('tab:changed', this.bar, this.bar.tabs.indexOf(tab), tab);
|
||||
}
|
||||
}, this);
|
||||
|
||||
var dragHelper = new (function() {
|
||||
|
@ -87,6 +103,8 @@ define([
|
|||
var me = this,
|
||||
length = me.bar.tabs.length,
|
||||
barBounds = me.bar.$bar.get(0).getBoundingClientRect();
|
||||
me.leftBorder = barBounds.left;
|
||||
me.rightBorder = barBounds.right;
|
||||
|
||||
if (barBounds) {
|
||||
me.bounds = [];
|
||||
|
@ -97,6 +115,8 @@ define([
|
|||
this.bounds.push(me.bar.tabs[i].$el.get(0).getBoundingClientRect());
|
||||
}
|
||||
|
||||
me.lastTabRight = me.bounds[length - 1].right;
|
||||
|
||||
me.tabBarLeft = me.bounds[0].left;
|
||||
me.tabBarRight = me.bounds[length - 1].right;
|
||||
me.tabBarRight = Math.min(me.tabBarRight, barBounds.right - 1);
|
||||
|
@ -278,17 +298,105 @@ define([
|
|||
document.removeEventListener('dragstart',dragDropText);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
setHookTabs: function (e, bar, tabs) {
|
||||
var me = this;
|
||||
function dragComplete() {
|
||||
if (!_.isUndefined(me.drag)) {
|
||||
bar.dragging = false;
|
||||
bar.$el.find('li.mousemove').removeClass('mousemove right');
|
||||
var arrSelectIndex = [];
|
||||
tabs.forEach(function (item) {
|
||||
arrSelectIndex.push(item.sheetindex);
|
||||
});
|
||||
if (!_.isUndefined(me.drag.place)) {
|
||||
me.bar.trigger('tab:move', arrSelectIndex, me.drag.place);
|
||||
me.bar.$bar.scrollLeft(me.scrollLeft);
|
||||
me.bar.scrollX = undefined;
|
||||
} else {
|
||||
me.bar.trigger('tab:move', arrSelectIndex);
|
||||
me.bar.$bar.scrollLeft(me.scrollLeft);
|
||||
me.bar.scrollX = undefined;
|
||||
}
|
||||
|
||||
me.drag = undefined;
|
||||
}
|
||||
}
|
||||
function dragMove (event) {
|
||||
if (!_.isUndefined(me.drag)) {
|
||||
me.drag.moveX = event.clientX*Common.Utils.zoom();
|
||||
if (me.drag.moveX < me.leftBorder) {
|
||||
me.scrollLeft -= 20;
|
||||
me.bar.$bar.scrollLeft(me.scrollLeft);
|
||||
me.calculateBounds();
|
||||
} else if (me.drag.moveX < me.tabBarRight && me.drag.moveX > me.tabBarLeft) {
|
||||
var name = $(event.target).parent().data('label'),
|
||||
currentTab = _.findIndex(bar.tabs, {label: name});
|
||||
if (currentTab === -1) {
|
||||
bar.$el.find('li.mousemove').removeClass('mousemove right');
|
||||
me.drag.place = undefined;
|
||||
} else if (me.bounds[currentTab].left - me.scrollLeft >= me.tabBarLeft) {
|
||||
me.drag.place = currentTab;
|
||||
$(event.target).parent().parent().find('li.mousemove').removeClass('mousemove right');
|
||||
$(event.target).parent().addClass('mousemove');
|
||||
}
|
||||
} else if (me.drag.moveX > me.lastTabRight && Math.abs(me.tabBarRight - me.bounds[me.bar.tabs.length - 1].right) < 1) { //move to end of list, right border of the right tab is visible
|
||||
bar.$el.find('li.mousemove').removeClass('mousemove right');
|
||||
bar.tabs[bar.tabs.length - 1].$el.addClass('mousemove right');
|
||||
me.drag.place = bar.tabs.length;
|
||||
} else if (me.drag.moveX - me.rightBorder > 3) {
|
||||
me.scrollLeft += 20;
|
||||
me.bar.$bar.scrollLeft(me.scrollLeft);
|
||||
me.calculateBounds();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!_.isUndefined(bar) && !_.isUndefined(tabs) && bar.tabs.length > 1) {
|
||||
me.bar = bar;
|
||||
me.drag = {tabs: tabs};
|
||||
bar.dragging = true;
|
||||
this.calculateBounds();
|
||||
|
||||
$(document).on('mousemove.tabbar', dragMove);
|
||||
$(document).on('mouseup.tabbar', function (e) {
|
||||
dragComplete(e);
|
||||
$(document).off('mouseup.tabbar');
|
||||
$(document).off('mousemove.tabbar', dragMove);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
tab.$el.on({
|
||||
click: $.proxy(function () {
|
||||
if (!tab.disabled && !tab.$el.hasClass('active')) {
|
||||
if (tab.control == 'manual') {
|
||||
this.bar.trigger('tab:manual', this.bar, this.bar.tabs.indexOf(tab), tab);
|
||||
} else {
|
||||
tab.changeState();
|
||||
click: $.proxy(function (event) {
|
||||
if (!tab.disabled) {
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
if (!tab.isActive()) {
|
||||
tab.changeState(true);
|
||||
}
|
||||
} else if (event.shiftKey) {
|
||||
this.bar.$el.find('ul > li.selected').removeClass('selected');
|
||||
this.bar.selectTabs.length = 0;
|
||||
var $active = this.bar.$el.find('ul > li.active'),
|
||||
indexAct = $active.index(),
|
||||
indexCur = this.bar.tabs.indexOf(tab);
|
||||
var startIndex = (indexCur > indexAct) ? indexAct : indexCur,
|
||||
endIndex = (indexCur > indexAct) ? indexCur : indexAct;
|
||||
for (var i = startIndex; i <= endIndex; i++) {
|
||||
this.bar.tabs[i].changeState(true);
|
||||
}
|
||||
} else if (!tab.$el.hasClass('active')) {
|
||||
if (this.bar.tabs.length === this.bar.selectTabs.length) {
|
||||
this.bar.$el.find('ul > li.selected').removeClass('selected');
|
||||
this.bar.selectTabs.length = 0;
|
||||
}
|
||||
if (tab.control == 'manual') {
|
||||
this.bar.trigger('tab:manual', this.bar, this.bar.tabs.indexOf(tab), tab);
|
||||
} else {
|
||||
tab.changeState();
|
||||
}
|
||||
}
|
||||
}
|
||||
!tab.disabled && Common.NotificationCenter.trigger('edit:complete', this.bar);
|
||||
|
@ -297,12 +405,16 @@ define([
|
|||
this.trigger('tab:dblclick', this, this.tabs.indexOf(tab), tab);
|
||||
}, this.bar),
|
||||
contextmenu: $.proxy(function () {
|
||||
this.trigger('tab:contextmenu', this, this.tabs.indexOf(tab), tab);
|
||||
this.trigger('tab:contextmenu', this, this.tabs.indexOf(tab), tab, this.selectTabs);
|
||||
}, this.bar),
|
||||
mousedown: $.proxy(function (e) {
|
||||
if (this.bar.options.draggable && !_.isUndefined(dragHelper) && (3 !== e.which)) {
|
||||
if (!tab.isLockTheDrag) {
|
||||
dragHelper.setHook(e, this.bar, tab);
|
||||
if (this.bar.selectTabs.length > 1) {
|
||||
dragHelper.setHookTabs(e, this.bar, this.bar.selectTabs);
|
||||
} else {
|
||||
dragHelper.setHook(e, this.bar, tab);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, this)
|
||||
|
@ -322,6 +434,7 @@ define([
|
|||
|
||||
tabs: [],
|
||||
template: _.template('<ul class="nav nav-tabs <%= placement %>" />'),
|
||||
selectTabs: [],
|
||||
|
||||
initialize : function (options) {
|
||||
_.extend(this.config, options);
|
||||
|
@ -397,6 +510,10 @@ define([
|
|||
me.$bar.append(tab.render().$el);
|
||||
me.tabs.push(tab);
|
||||
me.manager.attach(tab);
|
||||
if (tab.isActive()) {
|
||||
me.selectTabs.length = 0;
|
||||
me.selectTabs.push(tab);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = tabs.length; i-- > 0 ; ) {
|
||||
|
@ -410,6 +527,11 @@ define([
|
|||
me.tabs.splice(index, 0, tab);
|
||||
}
|
||||
|
||||
if (tab.isActive()) {
|
||||
me.selectTabs.length = 0;
|
||||
me.selectTabs.push(tab);
|
||||
}
|
||||
|
||||
me.manager.attach(tab);
|
||||
}
|
||||
}
|
||||
|
@ -462,6 +584,27 @@ define([
|
|||
this.checkInvisible();
|
||||
},
|
||||
|
||||
setSelectAll: function(isSelect) {
|
||||
var me = this;
|
||||
me.selectTabs.length = 0;
|
||||
if (isSelect) {
|
||||
me.tabs.forEach(function(tab){
|
||||
if (!tab.isSelected()) {
|
||||
tab.addClass('selected');
|
||||
}
|
||||
me.selectTabs.push(tab);
|
||||
});
|
||||
} else {
|
||||
me.tabs.forEach(function(tab){
|
||||
if (tab.isActive()) {
|
||||
me.selectTabs.push(tab);
|
||||
} else if (tab.isSelected()) {
|
||||
tab.removeClass('selected');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
getActive: function(iselem) {
|
||||
return iselem ? this.$bar.find('> li.active') : this.$bar.find('> li.active').index();
|
||||
},
|
||||
|
@ -575,7 +718,7 @@ define([
|
|||
//left = tab.position().left;
|
||||
//right = left + tab.width();
|
||||
|
||||
return !(left < leftbound) && !(right > rightbound);
|
||||
return !(left < leftbound) && !(right - rightbound > 0.1);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -348,20 +348,11 @@ define([
|
|||
maxwidth = (this.initConfig.maxwidth) ? this.initConfig.maxwidth : main_width,
|
||||
maxheight = (this.initConfig.maxheight) ? this.initConfig.maxheight : main_height;
|
||||
|
||||
if (this.resizing.type[0]>0) {
|
||||
this.resizing.maxx = Math.min(main_width, left+maxwidth);
|
||||
this.resizing.minx = left+this.initConfig.minwidth;
|
||||
} else if (this.resizing.type[0]<0) {
|
||||
this.resizing.maxx = left+this.resizing.initw-this.initConfig.minwidth;
|
||||
this.resizing.minx = Math.max(0, left+this.resizing.initw-maxwidth);
|
||||
}
|
||||
if (this.resizing.type[1]>0) {
|
||||
this.resizing.maxy = Math.min(main_height, top+maxheight);
|
||||
this.resizing.miny = top+this.initConfig.minheight;
|
||||
} else if (this.resizing.type[1]<0) {
|
||||
this.resizing.maxy = top+this.resizing.inith-this.initConfig.minheight;
|
||||
this.resizing.miny = Math.max(0, top+this.resizing.inith-maxheight);
|
||||
}
|
||||
this.resizing.minw = this.initConfig.minwidth;
|
||||
this.resizing.maxw = (this.resizing.type[0]>0) ? Math.min(main_width-left, maxwidth) : Math.min(left+this.resizing.initw, maxwidth);
|
||||
|
||||
this.resizing.minh = this.initConfig.minheight;
|
||||
this.resizing.maxh = (this.resizing.type[1]>0) ? Math.min(main_height-top, maxheight) : Math.min(top+this.resizing.inith, maxheight);
|
||||
|
||||
$(document.body).css('cursor', el.css('cursor'));
|
||||
this.$window.find('.resize-border').addClass('resizing');
|
||||
|
@ -378,16 +369,34 @@ define([
|
|||
zoom = (event instanceof jQuery.Event) ? Common.Utils.zoom() : 1,
|
||||
pageX = event.pageX*zoom,
|
||||
pageY = event.pageY*zoom;
|
||||
if (this.resizing.type[0] && pageX<this.resizing.maxx && pageX>this.resizing.minx) {
|
||||
if (this.resizing.type[0]) {
|
||||
var new_width = this.resizing.initw + (pageX - this.resizing.initpage_x) * this.resizing.type[0];
|
||||
if (new_width>this.resizing.maxw) {
|
||||
pageX = pageX - (new_width-this.resizing.maxw) * this.resizing.type[0];
|
||||
new_width = this.resizing.maxw;
|
||||
} else if (new_width<this.resizing.minw) {
|
||||
pageX = pageX - (new_width-this.resizing.minw) * this.resizing.type[0];
|
||||
new_width = this.resizing.minw;
|
||||
}
|
||||
|
||||
if (this.resizing.type[0]<0)
|
||||
this.$window.css({left: pageX - this.resizing.initx});
|
||||
this.setWidth(this.resizing.initw + (pageX - this.resizing.initpage_x) * this.resizing.type[0]);
|
||||
this.setWidth(new_width);
|
||||
resized = true;
|
||||
}
|
||||
if (this.resizing.type[1] && pageY<this.resizing.maxy && pageY>this.resizing.miny) {
|
||||
if (this.resizing.type[1]) {
|
||||
var new_height = this.resizing.inith + (pageY - this.resizing.initpage_y) * this.resizing.type[1];
|
||||
if (new_height>this.resizing.maxh) {
|
||||
pageY = pageY - (new_height-this.resizing.maxh) * this.resizing.type[1];
|
||||
new_height = this.resizing.maxh;
|
||||
} else if (new_height<this.resizing.minh) {
|
||||
pageY = pageY - (new_height-this.resizing.minh) * this.resizing.type[1];
|
||||
new_height = this.resizing.minh;
|
||||
}
|
||||
|
||||
if (this.resizing.type[1]<0)
|
||||
this.$window.css({top: pageY - this.resizing.inity});
|
||||
this.setHeight(this.resizing.inith + (pageY - this.resizing.initpage_y) * this.resizing.type[1]);
|
||||
this.setHeight(new_height);
|
||||
resized = true;
|
||||
}
|
||||
if (resized) this.fireEvent('resizing');
|
||||
|
|
|
@ -126,6 +126,9 @@ define([
|
|||
'comment:closeEditing': _.bind(this.closeEditing, this),
|
||||
'comment:disableHint': _.bind(this.disableHint, this),
|
||||
'comment:addDummyComment': _.bind(this.onAddDummyComment, this)
|
||||
},
|
||||
'Common.Views.ReviewChanges': {
|
||||
'comment:removeComments': _.bind(this.onRemoveComments, this)
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -180,7 +183,7 @@ define([
|
|||
this.api.asc_registerCallback('asc_onAddComments', _.bind(this.onApiAddComments, this));
|
||||
this.api.asc_registerCallback('asc_onRemoveComment', _.bind(this.onApiRemoveComment, this));
|
||||
this.api.asc_registerCallback('asc_onChangeComments', _.bind(this.onChangeComments, this));
|
||||
this.api.asc_registerCallback('asc_onRemoveComments', _.bind(this.onRemoveComments, this));
|
||||
this.api.asc_registerCallback('asc_onRemoveComments', _.bind(this.onApiRemoveComments, this));
|
||||
this.api.asc_registerCallback('asc_onChangeCommentData', _.bind(this.onApiChangeCommentData, this));
|
||||
this.api.asc_registerCallback('asc_onLockComment', _.bind(this.onApiLockComment, this));
|
||||
this.api.asc_registerCallback('asc_onUnLockComment', _.bind(this.onApiUnLockComment, this));
|
||||
|
@ -233,6 +236,11 @@ define([
|
|||
this.api.asc_removeComment(id);
|
||||
}
|
||||
},
|
||||
onRemoveComments: function (type) {
|
||||
if (this.api) {
|
||||
this.api.asc_RemoveAllComments(type=='my' || !this.mode.canEditComments, type=='current');// 1 param = true if remove only my comments, 2 param - remove current comments
|
||||
}
|
||||
},
|
||||
onResolveComment: function (uid) {
|
||||
var t = this,
|
||||
reply = null,
|
||||
|
@ -725,7 +733,7 @@ define([
|
|||
|
||||
this.updateComments(true);
|
||||
},
|
||||
onRemoveComments: function (data) {
|
||||
onApiRemoveComments: function (data) {
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
this.onApiRemoveComment(data[i], true);
|
||||
}
|
||||
|
@ -821,6 +829,7 @@ define([
|
|||
}
|
||||
},
|
||||
onApiShowComment: function (uids, posX, posY, leftX, opts, hint) {
|
||||
var apihint = hint;
|
||||
var same_uids = (0 === _.difference(this.uids, uids).length) && (0 === _.difference(uids, this.uids).length);
|
||||
|
||||
if (hint && this.isSelectedComment && same_uids && !this.isModeChanged) {
|
||||
|
@ -886,7 +895,7 @@ define([
|
|||
this.animate = false;
|
||||
}
|
||||
|
||||
this.isSelectedComment = !hint || !this.hintmode;
|
||||
this.isSelectedComment = !apihint || !this.hintmode;
|
||||
this.uids = _.clone(uids);
|
||||
|
||||
comments.push(comment);
|
||||
|
|
|
@ -42,8 +42,15 @@ define([
|
|||
'use strict';
|
||||
|
||||
var Desktop = function () {
|
||||
var config = {};
|
||||
var app = window.AscDesktopEditor;
|
||||
var config = {version:'{{PRODUCT_VERSION}}'};
|
||||
var app = window.AscDesktopEditor,
|
||||
webapp = window.DE || window.PE || window.SSE;
|
||||
var titlebuttons;
|
||||
var btnsave_icons = {
|
||||
'btn-save': 'save',
|
||||
'btn-save-coauth': 'coauth',
|
||||
'btn-synch': 'synch' };
|
||||
|
||||
|
||||
if ( !!app ) {
|
||||
window.on_native_message = function (cmd, param) {
|
||||
|
@ -83,15 +90,80 @@ define([
|
|||
}
|
||||
} else
|
||||
if (/editor:config/.test(cmd)) {
|
||||
if ( param == 'request' )
|
||||
app.execCommand('editor:config', JSON.stringify({user: config.user, 'extraleft': $('#box-document-title #slot-btn-dt-save').parent().width()}));
|
||||
if ( param == 'request' ) {
|
||||
if ( !!titlebuttons ) {
|
||||
var opts = {
|
||||
user: config.user,
|
||||
title: { buttons: [] }
|
||||
};
|
||||
|
||||
var header = webapp.getController('Viewport').getView('Common.Views.Header');
|
||||
if ( header ) {
|
||||
for (var i in titlebuttons) {
|
||||
opts.title.buttons.push(_serializeHeaderButton(i, titlebuttons[i]));
|
||||
}
|
||||
}
|
||||
|
||||
app.execCommand('editor:config', JSON.stringify(opts));
|
||||
} else
|
||||
if ( !config.callback_editorconfig ) {
|
||||
config.callback_editorconfig = function() {
|
||||
setTimeout(function(){window.on_native_message(cmd, param);},0);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
if (/button:click/.test(cmd)) {
|
||||
var obj = JSON.parse(param);
|
||||
if ( !!obj.action ) {
|
||||
titlebuttons[obj.action].btn.click();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
app.execCommand('webapps:events', 'loading');
|
||||
app.execCommand('window:features', 'request');
|
||||
if ( !!window.native_message_cmd ) {
|
||||
for ( var c in window.native_message_cmd ) {
|
||||
window.on_native_message(c, window.native_message_cmd[c]);
|
||||
}
|
||||
}
|
||||
|
||||
// app.execCommand('window:features', {version: config.version, action: 'request'});
|
||||
app.execCommand('webapps:features', {version: config.version, eventloading:true, titlebuttons:true});
|
||||
}
|
||||
|
||||
var _serializeHeaderButton = function(action, config) {
|
||||
return {
|
||||
action: action,
|
||||
icon: config.icon || undefined,
|
||||
hint: config.btn.options.hint,
|
||||
disabled: config.disabled
|
||||
};
|
||||
};
|
||||
|
||||
var _onTitleButtonDisabled = function (action, e, status) {
|
||||
titlebuttons[action].disabled = status;
|
||||
var _buttons = {};
|
||||
_buttons[action] = status;
|
||||
app.execCommand('title:button', JSON.stringify({disabled: _buttons}));
|
||||
};
|
||||
|
||||
var _onSaveIconChanged = function (e, opts) {
|
||||
app.execCommand('title:button', JSON.stringify({'icon:changed': {'save': btnsave_icons[opts.next]}}));
|
||||
};
|
||||
|
||||
var _onModalDialog = function (status) {
|
||||
if ( status == 'open' ) {
|
||||
app.execCommand('title:button', JSON.stringify({disabled: {'all':true}}));
|
||||
} else {
|
||||
var _buttons = {};
|
||||
for (var i in titlebuttons) {
|
||||
_buttons[i] = titlebuttons[i].disabled;
|
||||
}
|
||||
|
||||
app.execCommand('title:button', JSON.stringify({'disabled': _buttons}));
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
init: function (opts) {
|
||||
_.extend(config, opts);
|
||||
|
@ -112,6 +184,35 @@ define([
|
|||
if ( config.canUndock ) {
|
||||
Common.NotificationCenter.trigger('app:config', {canUndock: true});
|
||||
}
|
||||
|
||||
var header = webapp.getController('Viewport').getView('Common.Views.Header');
|
||||
titlebuttons = {
|
||||
'save': {btn: header.btnSave, disabled:false},
|
||||
'print': {btn: header.btnPrint, disabled:false},
|
||||
'undo': {btn: header.btnUndo, disabled:false},
|
||||
'redo': {btn: header.btnRedo, disabled:false}
|
||||
};
|
||||
|
||||
for (var i in titlebuttons) {
|
||||
titlebuttons[i].btn.options.signals = ['disabled'];
|
||||
titlebuttons[i].btn.on('disabled', _onTitleButtonDisabled.bind(this, i));
|
||||
}
|
||||
|
||||
header.btnSave.options.signals.push('icon:changed');
|
||||
header.btnSave.on('icon:changed', _onSaveIconChanged.bind(this));
|
||||
|
||||
var iconname = /\s?([^\s]+)$/.exec(titlebuttons.save.btn.$icon.attr('class'));
|
||||
!!iconname && iconname.length && (titlebuttons.save.icon = btnsave_icons[iconname]);
|
||||
|
||||
if ( !!config.callback_editorconfig ) {
|
||||
config.callback_editorconfig();
|
||||
delete config.callback_editorconfig;
|
||||
}
|
||||
});
|
||||
|
||||
Common.NotificationCenter.on({
|
||||
'modal:show': _onModalDialog.bind(this, 'open'),
|
||||
'modal:close': _onModalDialog.bind(this, 'close')
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -81,6 +81,7 @@ define([
|
|||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
this.mode = mode;
|
||||
if (!mode.canHistoryClose) {
|
||||
this.panelHistory.$el.find('#history-header').hide();
|
||||
this.panelHistory.$el.find('#history-list').css('padding-top', 0);
|
||||
|
@ -163,6 +164,8 @@ define([
|
|||
},
|
||||
|
||||
onSetHistoryData: function(opts) {
|
||||
if (!this.mode.canUseHistory) return;
|
||||
|
||||
if (opts.data.error) {
|
||||
var config = {
|
||||
title: this.notcriticalErrorTitle,
|
||||
|
@ -177,7 +180,7 @@ define([
|
|||
if (historyStore && data!==null) {
|
||||
var rev, revisions = historyStore.findRevisions(data.version),
|
||||
urlGetTime = new Date();
|
||||
var diff = (this.currentChangeId===undefined) ? null : opts.data.changesUrl, // if revision has changes, but serverVersion !== app.buildVersion -> hide revision changes
|
||||
var diff = (!opts.data.previous || this.currentChangeId===undefined) ? null : opts.data.changesUrl, // if revision has changes, but serverVersion !== app.buildVersion -> hide revision changes
|
||||
url = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.url : opts.data.url,
|
||||
docId = opts.data.key ? opts.data.key : this.currentDocId,
|
||||
docIdPrev = opts.data.previous && opts.data.previous.key ? opts.data.previous.key : this.currentDocIdPrev,
|
||||
|
|
|
@ -367,14 +367,14 @@ define([
|
|||
var me = this,
|
||||
isCustomWindow = variation.get_CustomWindow(),
|
||||
arrBtns = variation.get_Buttons(),
|
||||
newBtns = {},
|
||||
newBtns = [],
|
||||
size = variation.get_Size();
|
||||
if (!size || size.length<2) size = [800, 600];
|
||||
|
||||
if (_.isArray(arrBtns)) {
|
||||
_.each(arrBtns, function(b, index){
|
||||
if (b.visible)
|
||||
newBtns[index] = {text: b.text, cls: 'custom' + ((b.primary) ? ' primary' : '')};
|
||||
newBtns[index] = {caption: b.text, value: index, primary: b.primary};
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -69,12 +69,17 @@ define([
|
|||
'FileMenu': {
|
||||
'settings:apply': this.applySettings.bind(this)
|
||||
},
|
||||
'LeftMenu': {
|
||||
'comments:show': _.bind(this.commentsShowHide, this, 'show'),
|
||||
'comments:hide': _.bind(this.commentsShowHide, this, 'hide')
|
||||
},
|
||||
'Common.Views.ReviewChanges': {
|
||||
'reviewchange:accept': _.bind(this.onAcceptClick, this),
|
||||
'reviewchange:reject': _.bind(this.onRejectClick, this),
|
||||
'reviewchange:delete': _.bind(this.onDeleteClick, this),
|
||||
'reviewchange:preview': _.bind(this.onBtnPreviewClick, this),
|
||||
'reviewchanges:view': _.bind(this.onReviewViewClick, this),
|
||||
'reviewchange:view': _.bind(this.onReviewViewClick, this),
|
||||
'reviewchange:compare': _.bind(this.onCompareClick, this),
|
||||
'lang:document': _.bind(this.onDocLanguage, this),
|
||||
'collaboration:coauthmode': _.bind(this.onCoAuthMode, this)
|
||||
},
|
||||
|
@ -95,12 +100,14 @@ define([
|
|||
this.collection = this.getApplication().getCollection('Common.Collections.ReviewChanges');
|
||||
this.userCollection = this.getApplication().getCollection('Common.Collections.Users');
|
||||
|
||||
this._state = {posx: -1000, posy: -1000, popoverVisible: false, previewMode: false};
|
||||
this._state = {posx: -1000, posy: -1000, popoverVisible: false, previewMode: false, compareSettings: null /*new AscCommon.CComparisonPr()*/};
|
||||
|
||||
Common.NotificationCenter.on('reviewchanges:turn', this.onTurnPreview.bind(this));
|
||||
Common.NotificationCenter.on('spelling:turn', this.onTurnSpelling.bind(this));
|
||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
Common.NotificationCenter.on('collaboration:sharing', this.changeAccessRights.bind(this));
|
||||
Common.NotificationCenter.on('collaboration:sharingdeny', this.onLostEditRights.bind(this));
|
||||
|
||||
this.userCollection.on('reset', _.bind(this.onUpdateUsers, this));
|
||||
this.userCollection.on('add', _.bind(this.onUpdateUsers, this));
|
||||
|
@ -112,6 +119,7 @@ define([
|
|||
this.currentUserId = data.config.user.id;
|
||||
this.sdkViewName = data['sdkviewname'] || this.sdkViewName;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
setApi: function (api) {
|
||||
if (api) {
|
||||
|
@ -120,8 +128,13 @@ define([
|
|||
if (this.appConfig.canReview || this.appConfig.canViewReview) {
|
||||
this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.onApiShowChange, this));
|
||||
this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, this));
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
|
||||
}
|
||||
this.api.asc_registerCallback('asc_onAcceptChangesBeforeCompare',_.bind(this.onAcceptChangesBeforeCompare, this));
|
||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
|
||||
|
||||
Common.Gateway.on('setrevisedfile', _.bind(this.setRevisedFile, this));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -130,9 +143,18 @@ define([
|
|||
this.popoverChanges = new Common.Collections.ReviewChanges();
|
||||
this.view = this.createView('Common.Views.ReviewChanges', { mode: mode });
|
||||
|
||||
if (!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length || this.appConfig.canRequestSharingSettings) {
|
||||
Common.Gateway.on('showsharingsettings', _.bind(this.changeAccessRights, this));
|
||||
Common.Gateway.on('setsharingsettings', _.bind(this.setSharingSettings, this));
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
loadDocument: function(data) {
|
||||
this.document = data.doc;
|
||||
},
|
||||
|
||||
SetDisabled: function(state) {
|
||||
if (this.dlgChanges)
|
||||
this.dlgChanges.close();
|
||||
|
@ -554,6 +576,84 @@ define([
|
|||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||
},
|
||||
|
||||
onCompareClick: function(item) {
|
||||
if (this.api) {
|
||||
var me = this;
|
||||
if (!this._state.compareSettings) {
|
||||
this._state.compareSettings = new AscCommonWord.ComparisonOptions();
|
||||
this._state.compareSettings.putWords(!Common.localStorage.getBool("de-compare-char"));
|
||||
}
|
||||
if (item === 'file') {
|
||||
if (this.api)
|
||||
this.api.asc_CompareDocumentFile(this._state.compareSettings);
|
||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||
} else if (item === 'url') {
|
||||
(new Common.Views.ImageFromUrlDialog({
|
||||
title: me.textUrl,
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
if (me.api) {
|
||||
var checkUrl = value.replace(/ /g, '');
|
||||
if (!_.isEmpty(checkUrl)) {
|
||||
me.api.asc_CompareDocumentUrl(checkUrl, me._state.compareSettings);
|
||||
}
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.view);
|
||||
}
|
||||
}
|
||||
})).show();
|
||||
} else if (item === 'storage') {
|
||||
if (this.appConfig.canRequestCompareFile) {
|
||||
Common.Gateway.requestCompareFile();
|
||||
} else {
|
||||
(new Common.Views.SelectFileDlg({
|
||||
fileChoiceUrl: this.appConfig.fileChoiceUrl.replace("{fileExt}", "").replace("{documentType}", "DocumentsOnly")
|
||||
})).on('selectfile', function(obj, file){
|
||||
me.setRevisedFile(file, me._state.compareSettings);
|
||||
}).show();
|
||||
}
|
||||
} else if (item === 'settings') {
|
||||
(new DE.Views.CompareSettingsDialog({
|
||||
props: me._state.compareSettings,
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
me._state.compareSettings = value;
|
||||
}
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
}
|
||||
})).show();
|
||||
}
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||
},
|
||||
|
||||
setRevisedFile: function(data) {
|
||||
if (!this._state.compareSettings) {
|
||||
this._state.compareSettings = new AscCommonWord.ComparisonOptions();
|
||||
this._state.compareSettings.putWords(!Common.localStorage.getBool("de-compare-char"));
|
||||
}
|
||||
if (data && data.url) {
|
||||
this.api.asc_CompareDocumentUrl(data.url, this._state.compareSettings, data.token);// for loading from storage
|
||||
}
|
||||
},
|
||||
|
||||
onAcceptChangesBeforeCompare: function(callback) {
|
||||
var me = this;
|
||||
Common.UI.warning({
|
||||
width: 550,
|
||||
msg: this.textAcceptBeforeCompare,
|
||||
buttons: ['yes', 'no'],
|
||||
primary: 'yes',
|
||||
callback: function(result) {
|
||||
_.defer(function() {
|
||||
if (callback) callback(result=='yes');
|
||||
});
|
||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
turnDisplayMode: function(mode) {
|
||||
if (this.api) {
|
||||
if (mode === 'final')
|
||||
|
@ -685,7 +785,9 @@ define([
|
|||
if (state !== me.view.btnChat.pressed)
|
||||
me.view.turnChat(state);
|
||||
});
|
||||
|
||||
}
|
||||
if (me.view && me.view.btnCommentRemove) {
|
||||
me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -724,9 +826,38 @@ define([
|
|||
},
|
||||
|
||||
onLostEditRights: function() {
|
||||
this._readonlyRights = true;
|
||||
this.view && this.view.onLostEditRights();
|
||||
},
|
||||
|
||||
changeAccessRights: function(btn,event,opts) {
|
||||
if (this._docAccessDlg || this._readonlyRights) return;
|
||||
|
||||
if (this.appConfig.canRequestSharingSettings) {
|
||||
Common.Gateway.requestSharingSettings();
|
||||
} else {
|
||||
var me = this;
|
||||
me._docAccessDlg = new Common.Views.DocumentAccessDialog({
|
||||
settingsurl: this.appConfig.sharingSettingsUrl
|
||||
});
|
||||
me._docAccessDlg.on('accessrights', function(obj, rights){
|
||||
me.setSharingSettings({sharingSettings: rights});
|
||||
}).on('close', function(obj){
|
||||
me._docAccessDlg = undefined;
|
||||
});
|
||||
|
||||
me._docAccessDlg.show();
|
||||
}
|
||||
},
|
||||
|
||||
setSharingSettings: function(data) {
|
||||
if (data) {
|
||||
this.document.info.sharingSettings = data.sharingSettings;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingupdate', data.sharingSettings);
|
||||
Common.NotificationCenter.trigger('mentions:clearusers', this);
|
||||
}
|
||||
},
|
||||
|
||||
onCoAuthoringDisconnect: function() {
|
||||
this.SetDisabled(true);
|
||||
},
|
||||
|
@ -739,6 +870,23 @@ define([
|
|||
});
|
||||
},
|
||||
|
||||
onAuthParticipantsChanged: function(users) {
|
||||
if (this.view && this.view.btnCompare) {
|
||||
var length = 0;
|
||||
_.each(users, function(item){
|
||||
if (!item.asc_getView())
|
||||
length++;
|
||||
});
|
||||
this.view.btnCompare.setDisabled(length>1 || this.viewmode);
|
||||
}
|
||||
},
|
||||
|
||||
commentsShowHide: function(mode) {
|
||||
if (!this.view) return;
|
||||
var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment");
|
||||
(value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(mode != 'show' && !value);
|
||||
},
|
||||
|
||||
textInserted: '<b>Inserted:</b>',
|
||||
textDeleted: '<b>Deleted:</b>',
|
||||
textParaInserted: '<b>Paragraph Inserted</b> ',
|
||||
|
@ -797,6 +945,8 @@ define([
|
|||
textTableRowsDel: '<b>Table Rows Deleted<b/>',
|
||||
textParaMoveTo: '<b>Moved:</b>',
|
||||
textParaMoveFromUp: '<b>Moved Up:</b>',
|
||||
textParaMoveFromDown: '<b>Moved Down:</b>'
|
||||
textParaMoveFromDown: '<b>Moved Down:</b>',
|
||||
textUrl: 'Paste a document URL',
|
||||
textAcceptBeforeCompare: 'In order to compare documents all the tracked changes in them will be considered to have been accepted. Do you want to continue?'
|
||||
}, Common.Controllers.ReviewChanges || {}));
|
||||
});
|
|
@ -205,10 +205,15 @@ function clearMenus(isFromInputControl) {
|
|||
})
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
$('.dropdown-backdrop').remove();
|
||||
}
|
||||
|
||||
$(document)
|
||||
.off('keydown.bs.dropdown.data-api')
|
||||
.on('keydown.bs.dropdown.data-api', '[data-toggle=dropdown], [role=menu]' , onDropDownKeyDown);
|
||||
|
||||
('ontouchstart' in document.documentElement) && $(document).on('click.bs.dropdown.data-api', '[data-toggle=dropdown]', toggle);
|
||||
/*
|
||||
* workaround closing menu by right click
|
||||
* */
|
||||
|
|
|
@ -155,8 +155,8 @@
|
|||
else
|
||||
$scrollbarYRail.css({top: $this.scrollTop(), right: scrollbarYRight - $this.scrollLeft(), height: scrollbarYRailHeight, display: scrollbarYActive ? "inherit": "none"});
|
||||
|
||||
$scrollbarX.css({left: scrollbarXLeft, width: scrollbarXWidth});
|
||||
$scrollbarY.css({top: scrollbarYTop, height: scrollbarYHeight});
|
||||
$scrollbarX && $scrollbarX.css({left: scrollbarXLeft, width: scrollbarXWidth});
|
||||
$scrollbarY && $scrollbarY.css({top: scrollbarYTop, height: scrollbarYHeight});
|
||||
};
|
||||
|
||||
var updateBarSizeAndPosition = function () {
|
||||
|
|
1335
apps/common/main/lib/util/character.js
Normal file
|
@ -30,14 +30,15 @@
|
|||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
if (Common === undefined) {
|
||||
var Common = {};
|
||||
}
|
||||
|
||||
define(function(){ 'use strict';
|
||||
|
||||
if (Common.define === undefined) {
|
||||
Common.define = {};
|
||||
}
|
||||
|
||||
define(function(){ 'use strict';
|
||||
|
||||
Common.define.c_oAscMathMainType = {
|
||||
Symbol : 0x00,
|
||||
|
@ -413,4 +414,86 @@ define(function(){ 'use strict';
|
|||
Matrix_Flat_Round : 0x0b040000,
|
||||
Matrix_Flat_Square : 0x0b040001
|
||||
};
|
||||
|
||||
Common.define.chartData = _.extend( new(function() {
|
||||
return {
|
||||
textLine: 'Line',
|
||||
textColumn: 'Column',
|
||||
textBar: 'Bar',
|
||||
textArea: 'Area',
|
||||
textPie: 'Pie',
|
||||
textPoint: 'XY (Scatter)',
|
||||
textStock: 'Stock',
|
||||
textSurface: 'Surface',
|
||||
textCharts: 'Charts',
|
||||
textSparks: 'Sparklines',
|
||||
textLineSpark: 'Line',
|
||||
textColumnSpark: 'Column',
|
||||
textWinLossSpark: 'Win/Loss',
|
||||
|
||||
getChartGroupData: function(headername) {
|
||||
return [
|
||||
{id: 'menu-chart-group-bar', caption: this.textColumn, headername: (headername) ? this.textCharts : undefined},
|
||||
{id: 'menu-chart-group-line', caption: this.textLine},
|
||||
{id: 'menu-chart-group-pie', caption: this.textPie},
|
||||
{id: 'menu-chart-group-hbar', caption: this.textBar},
|
||||
{id: 'menu-chart-group-area', caption: this.textArea, inline: true},
|
||||
{id: 'menu-chart-group-scatter', caption: this.textPoint, inline: true},
|
||||
{id: 'menu-chart-group-stock', caption: this.textStock, inline: true}
|
||||
// {id: 'menu-chart-group-surface', caption: this.textSurface}
|
||||
];
|
||||
},
|
||||
|
||||
getChartData: function() {
|
||||
return [
|
||||
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal, iconCls: 'column-normal'},
|
||||
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked, iconCls: 'column-stack'},
|
||||
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer, iconCls: 'column-pstack'},
|
||||
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3d, iconCls: 'column-3d-normal'},
|
||||
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStacked3d, iconCls: 'column-3d-stack'},
|
||||
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barStackedPer3d, iconCls: 'column-3d-pstack'},
|
||||
{ group: 'menu-chart-group-bar', type: Asc.c_oAscChartTypeSettings.barNormal3dPerspective, iconCls: 'column-3d-normal-per'},
|
||||
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineNormal, iconCls: 'line-normal'},
|
||||
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStacked, iconCls: 'line-stack'},
|
||||
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.lineStackedPer, iconCls: 'line-pstack'},
|
||||
{ group: 'menu-chart-group-line', type: Asc.c_oAscChartTypeSettings.line3d, iconCls: 'line-3d'},
|
||||
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie, iconCls: 'pie-normal'},
|
||||
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.doughnut, iconCls: 'pie-doughnut'},
|
||||
{ group: 'menu-chart-group-pie', type: Asc.c_oAscChartTypeSettings.pie3d, iconCls: 'pie-3d-normal'},
|
||||
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal, iconCls: 'bar-normal'},
|
||||
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked, iconCls: 'bar-stack'},
|
||||
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer, iconCls: 'bar-pstack'},
|
||||
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarNormal3d, iconCls: 'bar-3d-normal'},
|
||||
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStacked3d, iconCls: 'bar-3d-stack'},
|
||||
{ group: 'menu-chart-group-hbar', type: Asc.c_oAscChartTypeSettings.hBarStackedPer3d, iconCls: 'bar-3d-pstack'},
|
||||
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaNormal, iconCls: 'area-normal'},
|
||||
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStacked, iconCls: 'area-stack'},
|
||||
{ group: 'menu-chart-group-area', type: Asc.c_oAscChartTypeSettings.areaStackedPer, iconCls: 'area-pstack'},
|
||||
{ group: 'menu-chart-group-scatter', type: Asc.c_oAscChartTypeSettings.scatter, iconCls: 'point-normal'},
|
||||
{ group: 'menu-chart-group-stock', type: Asc.c_oAscChartTypeSettings.stock, iconCls: 'stock-normal'}
|
||||
// { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.surfaceNormal, iconCls: 'surface-normal'},
|
||||
// { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.surfaceWireframe, iconCls: 'surface-wireframe'},
|
||||
// { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.contourNormal, iconCls: 'contour-normal'},
|
||||
// { group: 'menu-chart-group-surface', type: Asc.c_oAscChartTypeSettings.contourWireframe, iconCls: 'contour-wireframe'}
|
||||
|
||||
];
|
||||
},
|
||||
|
||||
getSparkGroupData: function(headername) {
|
||||
return [
|
||||
{ id: 'menu-chart-group-sparkcolumn', inline: true, headername: (headername) ? this.textSparks : undefined },
|
||||
{ id: 'menu-chart-group-sparkline', inline: true },
|
||||
{ id: 'menu-chart-group-sparkwin', inline: true }
|
||||
];
|
||||
},
|
||||
|
||||
getSparkData: function() {
|
||||
return [
|
||||
{ group: 'menu-chart-group-sparkcolumn', type: Asc.c_oAscSparklineType.Column, allowSelected: true, iconCls: 'spark-column', tip: this.textColumnSpark},
|
||||
{ group: 'menu-chart-group-sparkline', type: Asc.c_oAscSparklineType.Line, allowSelected: true, iconCls: 'spark-line', tip: this.textLineSpark},
|
||||
{ group: 'menu-chart-group-sparkwin', type: Asc.c_oAscSparklineType.Stacked, allowSelected: true, iconCls: 'spark-win', tip: this.textWinLossSpark}
|
||||
];
|
||||
}
|
||||
}
|
||||
})(), Common.define.chartData || {});
|
||||
});
|
||||
|
|
|
@ -117,31 +117,30 @@ Common.Utils = _.extend(new(function() {
|
|||
isMobile = /android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera),
|
||||
me = this,
|
||||
checkSize = function() {
|
||||
me.zoom = 1;
|
||||
if (isChrome && !isOpera && !isMobile && document && document.firstElementChild && document.body)
|
||||
{
|
||||
me.zoom = 1;
|
||||
if (isChrome && !isOpera && !isMobile && document && document.firstElementChild && document.body) {
|
||||
// делаем простую проверку
|
||||
// считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio;
|
||||
// считаем: window.devicePixelRatio >= 2 => _devicePixelRatio = 2; zoom = window.devicePixelRatio / _devicePixelRatio;
|
||||
if (window.devicePixelRatio > 0.1)
|
||||
{
|
||||
if (window.devicePixelRatio < 1.99)
|
||||
{
|
||||
var _devicePixelRatio = 1;
|
||||
me.zoom = window.devicePixelRatio / _devicePixelRatio;
|
||||
if (window.devicePixelRatio > 0.1) {
|
||||
var _fraction = window.devicePixelRatio % 1;
|
||||
var _devicePixelRatio = Math.floor(window.devicePixelRatio);
|
||||
|
||||
if ( !(_fraction < .5) ) {
|
||||
_devicePixelRatio += .5;
|
||||
}
|
||||
else
|
||||
{
|
||||
var _devicePixelRatio = 2;
|
||||
me.zoom = window.devicePixelRatio / _devicePixelRatio;
|
||||
}
|
||||
// chrome 54.x: zoom = "reset" - clear retina zoom (windows)
|
||||
//document.firstElementChild.style.zoom = "reset";
|
||||
|
||||
me.zoom = window.devicePixelRatio / _devicePixelRatio;
|
||||
document.firstElementChild.style.zoom = 1.0 / me.zoom;
|
||||
|
||||
if ( _devicePixelRatio % 1 > 0 )
|
||||
$('#editor_sdk').css('zoom', 1.0 / _devicePixelRatio);
|
||||
else $('#editor_sdk').css('zoom', '');
|
||||
}
|
||||
else
|
||||
document.firstElementChild.style.zoom = "normal";
|
||||
}
|
||||
}
|
||||
|
||||
me.innerWidth = window.innerWidth * me.zoom;
|
||||
me.innerHeight = window.innerHeight * me.zoom;
|
||||
};
|
||||
|
@ -152,6 +151,8 @@ Common.Utils = _.extend(new(function() {
|
|||
$(window).on('resize', checkSize);
|
||||
|
||||
return {
|
||||
checkSize: checkSize,
|
||||
|
||||
userAgent: userAgent,
|
||||
isStrict: isStrict,
|
||||
isIEQuirks: isIE && (!isStrict && (isIE6 || isIE7 || isIE8 || isIE9)),
|
||||
|
|
|
@ -174,12 +174,12 @@ define([
|
|||
this.lblCompanyUrl = _$l.findById('#id-about-company-url');
|
||||
this.lblCompanyLic = _$l.findById('#id-about-company-lic');
|
||||
|
||||
if ( this.licData )
|
||||
this.setLicInfo(this.licData);
|
||||
|
||||
this.$el.html(_$l);
|
||||
this.$el.addClass('about-dlg');
|
||||
|
||||
if ( this.licData )
|
||||
this.setLicInfo(this.licData);
|
||||
|
||||
if (_.isUndefined(this.scroller)) {
|
||||
this.scroller = new Common.UI.Scroller({
|
||||
el: this.$el,
|
||||
|
|
|
@ -208,7 +208,7 @@ define([
|
|||
var user = this.storeUsers.findOriginalUser(m.get('userid'));
|
||||
m.set({
|
||||
usercolor : user ? user.get('color') : null,
|
||||
message : this._pickLink(Common.Utils.String.htmlEncode(m.get('message')))
|
||||
message : this._pickLink(m.get('message'))
|
||||
}, {silent:true});
|
||||
},
|
||||
|
||||
|
@ -256,14 +256,13 @@ define([
|
|||
|
||||
arr = _.sortBy(arr, function(item){ return item.start; });
|
||||
|
||||
var str_res = (arr.length>0) ? ( message.substring(0, arr[0].start) + arr[0].str) : message;
|
||||
var str_res = (arr.length>0) ? ( Common.Utils.String.htmlEncode(message.substring(0, arr[0].start)) + arr[0].str) : Common.Utils.String.htmlEncode(message);
|
||||
for (var i=1; i<arr.length; i++) {
|
||||
str_res += (message.substring(arr[i-1].end, arr[i].start) + arr[i].str);
|
||||
str_res += (Common.Utils.String.htmlEncode(message.substring(arr[i-1].end, arr[i].start)) + arr[i].str);
|
||||
}
|
||||
if (arr.length>0) {
|
||||
str_res += message.substring(arr[i-1].end, message.length);
|
||||
str_res += Common.Utils.String.htmlEncode(message.substring(arr[i-1].end, message.length));
|
||||
}
|
||||
|
||||
return str_res;
|
||||
},
|
||||
|
||||
|
|
|
@ -196,23 +196,23 @@ define([
|
|||
|
||||
me.commentsView.reply = replyId;
|
||||
|
||||
this.autoHeightTextBox();
|
||||
picker.autoHeightTextBox();
|
||||
|
||||
readdresolves();
|
||||
|
||||
me.hookTextBox();
|
||||
|
||||
this.autoScrollToEditButtons();
|
||||
this.setFocusToTextBox();
|
||||
picker.autoScrollToEditButtons();
|
||||
picker.setFocusToTextBox();
|
||||
} else {
|
||||
|
||||
if (!showEditBox) {
|
||||
me.fireEvent('comment:closeEditing');
|
||||
record.set('editText', true);
|
||||
|
||||
this.autoHeightTextBox();
|
||||
picker.autoHeightTextBox();
|
||||
readdresolves();
|
||||
this.setFocusToTextBox();
|
||||
picker.setFocusToTextBox();
|
||||
me.hookTextBox();
|
||||
}
|
||||
}
|
||||
|
@ -232,14 +232,14 @@ define([
|
|||
|
||||
readdresolves();
|
||||
|
||||
this.autoHeightTextBox();
|
||||
picker.autoHeightTextBox();
|
||||
me.hookTextBox();
|
||||
|
||||
this.autoScrollToEditButtons();
|
||||
this.setFocusToTextBox();
|
||||
picker.autoScrollToEditButtons();
|
||||
picker.setFocusToTextBox();
|
||||
} else if (btn.hasClass('btn-reply', false)) {
|
||||
if (showReplyBox) {
|
||||
me.fireEvent('comment:addReply', [commentId, this.getActiveTextBoxVal()]);
|
||||
me.fireEvent('comment:addReply', [commentId, picker.getActiveTextBoxVal()]);
|
||||
me.fireEvent('comment:closeEditing');
|
||||
|
||||
readdresolves();
|
||||
|
@ -250,10 +250,10 @@ define([
|
|||
|
||||
} else if (btn.hasClass('btn-inner-edit', false)) {
|
||||
if (!_.isUndefined(me.commentsView.reply)) {
|
||||
me.fireEvent('comment:changeReply', [commentId, me.commentsView.reply, this.getActiveTextBoxVal()]);
|
||||
me.fireEvent('comment:changeReply', [commentId, me.commentsView.reply, picker.getActiveTextBoxVal()]);
|
||||
me.commentsView.reply = undefined;
|
||||
} else if (showEditBox) {
|
||||
me.fireEvent('comment:change', [commentId, this.getActiveTextBoxVal()]);
|
||||
me.fireEvent('comment:change', [commentId, picker.getActiveTextBoxVal()]);
|
||||
}
|
||||
|
||||
me.fireEvent('comment:closeEditing');
|
||||
|
@ -559,9 +559,13 @@ define([
|
|||
add = $('.new-comment-ct', this.el),
|
||||
to = $('.add-link-ct', this.el),
|
||||
msgs = $('.messages-ct', this.el);
|
||||
msgs.toggleClass('stretch', !mode.canComments);
|
||||
if (!mode.canComments) {
|
||||
add.hide(); to.hide();
|
||||
msgs.toggleClass('stretch', !mode.canComments || mode.compatibleFeatures);
|
||||
if (!mode.canComments || mode.compatibleFeatures) {
|
||||
if (mode.compatibleFeatures) {
|
||||
add.remove(); to.remove();
|
||||
} else {
|
||||
add.hide(); to.hide();
|
||||
}
|
||||
this.layout.changeLayout([{el: msgs[0], rely: false, stretch: true}]);
|
||||
} else {
|
||||
var container = $('#comments-box', this.el),
|
||||
|
@ -656,8 +660,6 @@ define([
|
|||
|
||||
pickLink: function (message) {
|
||||
var arr = [], offset, len;
|
||||
message = Common.Utils.String.htmlEncode(message);
|
||||
|
||||
message.replace(Common.Utils.ipStrongRe, function(subStr) {
|
||||
var result = /[\.,\?\+;:=!\(\)]+$/.exec(subStr);
|
||||
if (result)
|
||||
|
@ -699,14 +701,13 @@ define([
|
|||
|
||||
arr = _.sortBy(arr, function(item){ return item.start; });
|
||||
|
||||
var str_res = (arr.length>0) ? ( message.substring(0, arr[0].start) + arr[0].str) : message;
|
||||
var str_res = (arr.length>0) ? ( Common.Utils.String.htmlEncode(message.substring(0, arr[0].start)) + arr[0].str) : Common.Utils.String.htmlEncode(message);
|
||||
for (var i=1; i<arr.length; i++) {
|
||||
str_res += (message.substring(arr[i-1].end, arr[i].start) + arr[i].str);
|
||||
str_res += (Common.Utils.String.htmlEncode(message.substring(arr[i-1].end, arr[i].start)) + arr[i].str);
|
||||
}
|
||||
if (arr.length>0) {
|
||||
str_res += message.substring(arr[i-1].end, message.length);
|
||||
str_res += Common.Utils.String.htmlEncode(message.substring(arr[i-1].end, message.length));
|
||||
}
|
||||
|
||||
return str_res;
|
||||
},
|
||||
|
||||
|
|
|
@ -88,6 +88,11 @@ define([
|
|||
this.$window.find('.dlg-btn').on('click', _.bind(this.onDlgBtnClick, this));
|
||||
},
|
||||
|
||||
show: function() {
|
||||
this.setPlaceholder();
|
||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
||||
},
|
||||
|
||||
setChartData: function(data) {
|
||||
this._chartData = data;
|
||||
if (this._isExternalDocReady)
|
||||
|
@ -143,6 +148,14 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
setPlaceholder: function(placeholder) {
|
||||
this._placeholder = placeholder;
|
||||
},
|
||||
|
||||
getPlaceholder: function() {
|
||||
return this._placeholder;
|
||||
},
|
||||
|
||||
textSave: 'Save & Exit',
|
||||
textClose: 'Close',
|
||||
textTitle: 'Chart Editor'
|
||||
|
|
|
@ -86,7 +86,7 @@ define([
|
|||
// '<span class="btn-slot text" id="slot-btn-users"></span>' +
|
||||
'<section id="tlb-box-users" class="box-cousers dropdown"">' +
|
||||
'<div class="btn-users">' +
|
||||
'<svg class="icon"><use xlink:href="#svg-btn-users"></use></svg>' +
|
||||
'<i class="icon toolbar__icon icon--inverse btn-users"></i>' +
|
||||
'<label class="caption">+</label>' +
|
||||
'</div>' +
|
||||
'<div class="cousers-menu dropdown-menu">' +
|
||||
|
@ -166,7 +166,7 @@ define([
|
|||
.removeClass('dropdown-toggle')
|
||||
.menu = false;
|
||||
|
||||
$panelUsers[(!_readonlyRights && appConfig && !appConfig.isReviewOnly && appConfig.sharingSettingsUrl && appConfig.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
||||
$panelUsers[(!_readonlyRights && appConfig && !appConfig.isReviewOnly && (appConfig.sharingSettingsUrl && appConfig.sharingSettingsUrl.length || appConfig.canRequestSharingSettings)) ? 'show' : 'hide']();
|
||||
}
|
||||
|
||||
$btnUsers.find('.caption')
|
||||
|
@ -183,14 +183,14 @@ define([
|
|||
|
||||
function onLostEditRights() {
|
||||
_readonlyRights = true;
|
||||
$panelUsers.find('#tlb-change-rights').hide();
|
||||
$panelUsers && $panelUsers.find('#tlb-change-rights').hide();
|
||||
$btnUsers && !$btnUsers.menu && $panelUsers.hide();
|
||||
}
|
||||
|
||||
function onUsersClick(e) {
|
||||
if ( !$btnUsers.menu ) {
|
||||
$panelUsers.removeClass('open');
|
||||
this.fireEvent('click:users', this);
|
||||
Common.NotificationCenter.trigger('collaboration:sharing');
|
||||
} else {
|
||||
var usertip = $btnUsers.data('bs.tooltip');
|
||||
if ( usertip ) {
|
||||
|
@ -245,11 +245,11 @@ define([
|
|||
var $labelChangeRights = $panelUsers.find('#tlb-change-rights');
|
||||
$labelChangeRights.on('click', function(e) {
|
||||
$panelUsers.removeClass('open');
|
||||
me.fireEvent('click:users', me);
|
||||
Common.NotificationCenter.trigger('collaboration:sharing');
|
||||
});
|
||||
|
||||
$labelChangeRights[(!mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length)?'show':'hide']();
|
||||
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
||||
$labelChangeRights[(!mode.isOffline && !mode.isReviewOnly && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings))?'show':'hide']();
|
||||
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.isRestrictedEdit || !mode.isOffline && !mode.isReviewOnly && (mode.sharingSettingsUrl && mode.sharingSettingsUrl.length || mode.canRequestSharingSettings)) ? 'show' : 'hide']();
|
||||
|
||||
if ( $saveStatus ) {
|
||||
$saveStatus.attr('data-width', me.textSaveExpander);
|
||||
|
@ -397,7 +397,7 @@ define([
|
|||
me.btnGoBack = new Common.UI.Button({
|
||||
id: 'btn-goback',
|
||||
cls: 'btn-header',
|
||||
iconCls: 'svgicon svg-btn-goback',
|
||||
iconCls: 'toolbar__icon icon--inverse btn-goback',
|
||||
split: true
|
||||
});
|
||||
|
||||
|
@ -410,7 +410,7 @@ define([
|
|||
|
||||
me.btnOptions = new Common.UI.Button({
|
||||
cls: 'btn-header no-caret',
|
||||
iconCls: 'svgicon svg-btn-options',
|
||||
iconCls: 'toolbar__icon icon--inverse btn-ic-options',
|
||||
menu: true
|
||||
});
|
||||
|
||||
|
@ -437,7 +437,7 @@ define([
|
|||
function createTitleButton(iconid, slot, disabled) {
|
||||
return (new Common.UI.Button({
|
||||
cls: 'btn-header',
|
||||
iconCls: 'svgicon ' + iconid,
|
||||
iconCls: iconid,
|
||||
disabled: disabled === true
|
||||
})).render(slot);
|
||||
}
|
||||
|
@ -489,13 +489,13 @@ define([
|
|||
|
||||
if ( !config.isEdit ) {
|
||||
if ( (config.canDownload || config.canDownloadOrigin) && !config.isOffline )
|
||||
this.btnDownload = createTitleButton('svg-btn-download', $html.findById('#slot-hbtn-download'));
|
||||
this.btnDownload = createTitleButton('toolbar__icon icon--inverse btn-download', $html.findById('#slot-hbtn-download'));
|
||||
|
||||
if ( config.canPrint )
|
||||
this.btnPrint = createTitleButton('svg-btn-print', $html.findById('#slot-hbtn-print'));
|
||||
this.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-hbtn-print'));
|
||||
|
||||
if ( config.canEdit && config.canRequestEditRights )
|
||||
this.btnEdit = createTitleButton('svg-btn-edit', $html.findById('#slot-hbtn-edit'));
|
||||
this.btnEdit = createTitleButton('toolbar__icon icon--inverse btn-edit', $html.findById('#slot-hbtn-edit'));
|
||||
}
|
||||
me.btnOptions.render($html.find('#slot-btn-options'));
|
||||
|
||||
|
@ -519,15 +519,15 @@ define([
|
|||
me.setUserName(me.options.userName);
|
||||
|
||||
if ( config.canPrint && config.isEdit ) {
|
||||
me.btnPrint = createTitleButton('svg-btn-print', $html.findById('#slot-btn-dt-print'), true);
|
||||
me.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-btn-dt-print'), true);
|
||||
}
|
||||
|
||||
me.btnSave = createTitleButton('svg-btn-save', $html.findById('#slot-btn-dt-save'), true);
|
||||
me.btnUndo = createTitleButton('svg-btn-undo', $html.findById('#slot-btn-dt-undo'), true);
|
||||
me.btnRedo = createTitleButton('svg-btn-redo', $html.findById('#slot-btn-dt-redo'), true);
|
||||
me.btnSave = createTitleButton('toolbar__icon icon--inverse btn-save', $html.findById('#slot-btn-dt-save'), true);
|
||||
me.btnUndo = createTitleButton('toolbar__icon icon--inverse btn-undo', $html.findById('#slot-btn-dt-undo'), true);
|
||||
me.btnRedo = createTitleButton('toolbar__icon icon--inverse btn-redo', $html.findById('#slot-btn-dt-redo'), true);
|
||||
|
||||
if ( me.btnSave.$icon.is('svg') ) {
|
||||
me.btnSave.$icon.addClass('icon-save');
|
||||
me.btnSave.$icon.addClass('icon-save btn-save');
|
||||
var _create_use = function (extid, intid) {
|
||||
var _use = document.createElementNS('http://www.w3.org/2000/svg', 'use');
|
||||
_use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', extid);
|
||||
|
|
|
@ -47,8 +47,7 @@ define([
|
|||
width: 330,
|
||||
header: false,
|
||||
cls: 'modal-dlg',
|
||||
buttons: ['ok', 'cancel'],
|
||||
footerCls: 'right'
|
||||
buttons: ['ok', 'cancel']
|
||||
},
|
||||
|
||||
initialize : function(options) {
|
||||
|
@ -57,7 +56,7 @@ define([
|
|||
this.template = [
|
||||
'<div class="box">',
|
||||
'<div class="input-row">',
|
||||
'<label>' + this.textUrl + '</label>',
|
||||
'<label>' + (this.options.title || this.textUrl) + '</label>',
|
||||
'</div>',
|
||||
'<div id="id-dlg-url" class="input-row"></div>',
|
||||
'</div>'
|
||||
|
@ -93,7 +92,7 @@ define([
|
|||
var me = this;
|
||||
_.delay(function(){
|
||||
me.getChild('input').focus();
|
||||
},500);
|
||||
},100);
|
||||
},
|
||||
|
||||
onPrimary: function(event) {
|
||||
|
|
|
@ -110,8 +110,8 @@ define([
|
|||
onBtnClick: function(event) {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, event.currentTarget.attributes['result'].value, {
|
||||
columns : this.udColumns.getValue(),
|
||||
rows : this.udRows.getValue()
|
||||
columns : this.udColumns.getNumberValue(),
|
||||
rows : this.udRows.getNumberValue()
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -121,8 +121,8 @@ define([
|
|||
onPrimary: function() {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, 'ok', {
|
||||
columns : this.udColumns.getValue(),
|
||||
rows : this.udRows.getValue()
|
||||
columns : this.udColumns.getNumberValue(),
|
||||
rows : this.udRows.getNumberValue()
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -52,8 +52,7 @@ define([
|
|||
header: false,
|
||||
width: 350,
|
||||
cls: 'modal-dlg',
|
||||
buttons: ['ok', 'cancel'],
|
||||
footerCls: 'right'
|
||||
buttons: ['ok', 'cancel']
|
||||
},
|
||||
|
||||
template: '<div class="box">' +
|
||||
|
|
293
apps/common/main/lib/view/ListSettingsDialog.js
Normal file
|
@ -0,0 +1,293 @@
|
|||
/*
|
||||
*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* ListSettingsDialog.js
|
||||
*
|
||||
* Created by Julia Radzhabova on 30.10.2019
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
|
||||
define([
|
||||
'common/main/lib/component/Window',
|
||||
'common/main/lib/component/MetricSpinner',
|
||||
'common/main/lib/component/ThemeColorPalette',
|
||||
'common/main/lib/component/ColorButton',
|
||||
'common/main/lib/view/SymbolTableDialog'
|
||||
], function () { 'use strict';
|
||||
|
||||
Common.Views.ListSettingsDialog = Common.UI.Window.extend(_.extend({
|
||||
options: {
|
||||
type: 0, // 0 - markers, 1 - numbers
|
||||
width: 230,
|
||||
height: 200,
|
||||
style: 'min-width: 240px;',
|
||||
cls: 'modal-dlg',
|
||||
split: false,
|
||||
buttons: ['ok', 'cancel']
|
||||
},
|
||||
|
||||
initialize : function(options) {
|
||||
this.type = options.type || 0;
|
||||
|
||||
_.extend(this.options, {
|
||||
title: this.txtTitle
|
||||
}, options || {});
|
||||
|
||||
this.template = [
|
||||
'<div class="box">',
|
||||
'<div class="input-row" style="margin-bottom: 10px;">',
|
||||
'<label class="text" style="width: 70px;">' + this.txtSize + '</label><div id="id-dlg-list-size"></div><label class="text" style="margin-left: 10px;">' + this.txtOfText + '</label>',
|
||||
'</div>',
|
||||
'<div style="margin-bottom: 10px;">',
|
||||
'<label class="text" style="width: 70px;">' + this.txtColor + '</label><div id="id-dlg-list-color" style="display: inline-block;"></div>',
|
||||
'</div>',
|
||||
'<% if (type == 0) { %>',
|
||||
'<div class="input-row" style="margin-bottom: 10px;">',
|
||||
'<label class="text" style="width: 70px;vertical-align: top;">' + this.txtBullet + '</label>',
|
||||
'<button type="button" class="btn btn-text-default" id="id-dlg-list-edit" style="width:53px;display: inline-block;vertical-align: top;"></button>',
|
||||
'</div>',
|
||||
'<% } %>',
|
||||
'<% if (type == 1) { %>',
|
||||
'<div class="input-row" style="margin-bottom: 10px;">',
|
||||
'<label class="text" style="width: 70px;">' + this.txtStart + '</label><div id="id-dlg-list-start"></div>',
|
||||
'</div>',
|
||||
'<% } %>',
|
||||
'</div>'
|
||||
].join('');
|
||||
|
||||
this.props = options.props;
|
||||
this.options.tpl = _.template(this.template)(this.options);
|
||||
|
||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
Common.UI.Window.prototype.render.call(this);
|
||||
|
||||
var me = this,
|
||||
$window = this.getChild();
|
||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
|
||||
this.spnSize = new Common.UI.MetricSpinner({
|
||||
el : $window.find('#id-dlg-list-size'),
|
||||
step : 1,
|
||||
width : 53,
|
||||
value : 100,
|
||||
defaultUnit : '',
|
||||
maxValue : 400,
|
||||
minValue : 25,
|
||||
allowDecimal: false
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
if (me._changedProps) {
|
||||
me._changedProps.asc_putBulletSize(field.getNumberValue());
|
||||
}
|
||||
});
|
||||
|
||||
this.btnColor = new Common.UI.ColorButton({
|
||||
style: "width:53px;",
|
||||
menu : new Common.UI.Menu({
|
||||
additionalAlign: this.menuAddAlign,
|
||||
items: [
|
||||
{ template: _.template('<div id="id-dlg-list-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
|
||||
{ template: _.template('<a id="id-dlg-list-color-new" style="padding-left:12px;">' + this.textNewColor + '</a>') }
|
||||
]
|
||||
})
|
||||
});
|
||||
this.btnColor.on('render:after', function(btn) {
|
||||
me.colors = new Common.UI.ThemeColorPalette({
|
||||
el: $('#id-dlg-list-color-menu'),
|
||||
transparent: false
|
||||
});
|
||||
me.colors.on('select', _.bind(me.onColorsSelect, me));
|
||||
});
|
||||
this.btnColor.render($window.find('#id-dlg-list-color'));
|
||||
$('#id-dlg-list-color-new').on('click', _.bind(this.addNewColor, this, this.colors));
|
||||
|
||||
this.menuAddAlign = function(menuRoot, left, top) {
|
||||
var self = this;
|
||||
if (!$window.hasClass('notransform')) {
|
||||
$window.addClass('notransform');
|
||||
menuRoot.addClass('hidden');
|
||||
setTimeout(function() {
|
||||
menuRoot.removeClass('hidden');
|
||||
menuRoot.css({left: left, top: top});
|
||||
self.options.additionalAlign = null;
|
||||
}, 300);
|
||||
} else {
|
||||
menuRoot.css({left: left, top: top});
|
||||
self.options.additionalAlign = null;
|
||||
}
|
||||
};
|
||||
|
||||
this.spnStart = new Common.UI.MetricSpinner({
|
||||
el : $window.find('#id-dlg-list-start'),
|
||||
step : 1,
|
||||
width : 53,
|
||||
value : 1,
|
||||
defaultUnit : '',
|
||||
maxValue : 32767,
|
||||
minValue : 1,
|
||||
allowDecimal: false
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
if (me._changedProps) {
|
||||
me._changedProps.put_NumStartAt(field.getNumberValue());
|
||||
}
|
||||
});
|
||||
|
||||
this.btnEdit = new Common.UI.Button({
|
||||
el: $window.find('#id-dlg-list-edit'),
|
||||
hint: this.tipChange
|
||||
});
|
||||
this.btnEdit.on('click', _.bind(this.onEditBullet, this));
|
||||
this.btnEdit.cmpEl.css({'font-size': '16px', 'line-height': '16px'});
|
||||
|
||||
this.afterRender();
|
||||
},
|
||||
|
||||
afterRender: function() {
|
||||
this.updateThemeColors();
|
||||
this._setDefaults(this.props);
|
||||
},
|
||||
|
||||
updateThemeColors: function() {
|
||||
this.colors.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
|
||||
},
|
||||
|
||||
addNewColor: function(picker, btn) {
|
||||
picker.addNewColor((typeof(btn.color) == 'object') ? btn.color.color : btn.color);
|
||||
},
|
||||
|
||||
onColorsSelect: function(picker, color) {
|
||||
this.btnColor.setColor(color);
|
||||
if (this._changedProps) {
|
||||
this._changedProps.asc_putBulletColor(Common.Utils.ThemeColor.getRgbColor(color));
|
||||
}
|
||||
},
|
||||
|
||||
onEditBullet: function() {
|
||||
var me = this,
|
||||
props = me.bulletProps,
|
||||
handler = function(dlg, result, settings) {
|
||||
if (result == 'ok') {
|
||||
props.changed = true;
|
||||
props.code = settings.code;
|
||||
props.font = settings.font;
|
||||
props.symbol = settings.symbol;
|
||||
props.font && me.btnEdit.cmpEl.css('font-family', props.font);
|
||||
settings.symbol && me.btnEdit.setCaption(settings.symbol);
|
||||
if (me._changedProps) {
|
||||
me._changedProps.asc_putBulletFont(props.font);
|
||||
me._changedProps.asc_putBulletSymbol(props.symbol);
|
||||
}
|
||||
}
|
||||
},
|
||||
win = new Common.Views.SymbolTableDialog({
|
||||
api: me.options.api,
|
||||
lang: me.options.interfaceLang,
|
||||
modal: true,
|
||||
type: 0,
|
||||
font: props.font,
|
||||
symbol: props.symbol,
|
||||
handler: handler
|
||||
});
|
||||
win.show();
|
||||
win.on('symbol:dblclick', handler);
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, state, this._changedProps);
|
||||
}
|
||||
this.close();
|
||||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
this._handleInput(event.currentTarget.attributes['result'].value);
|
||||
},
|
||||
|
||||
onPrimary: function(event) {
|
||||
this._handleInput('ok');
|
||||
return false;
|
||||
},
|
||||
|
||||
_setDefaults: function (props) {
|
||||
if (props) {
|
||||
this.spnSize.setValue(props.asc_getBulletSize() || '', true);
|
||||
this.spnStart.setValue(props.get_NumStartAt() || '', true);
|
||||
var color = props.asc_getBulletColor();
|
||||
if (color) {
|
||||
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
color = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value()};
|
||||
} else {
|
||||
color = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
|
||||
}
|
||||
} else
|
||||
color = 'transparent';
|
||||
this.btnColor.setColor(color);
|
||||
if ( typeof(color) == 'object' ) {
|
||||
var isselected = false;
|
||||
for (var i=0; i<10; i++) {
|
||||
if ( Common.Utils.ThemeColor.ThemeValues[i] == color.effectValue ) {
|
||||
this.colors.select(color,true);
|
||||
isselected = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isselected) this.colors.clearSelection();
|
||||
} else
|
||||
this.colors.select(color,true);
|
||||
|
||||
if (this.type==0) {
|
||||
this.bulletProps = {symbol: props.asc_getBulletSymbol(), font: props.asc_getBulletFont()};
|
||||
this.bulletProps.font && this.btnEdit.cmpEl.css('font-family', this.bulletProps.font);
|
||||
this.bulletProps.symbol && this.btnEdit.setCaption(this.bulletProps.symbol);
|
||||
}
|
||||
}
|
||||
this._changedProps = new Asc.asc_CParagraphProperty();
|
||||
},
|
||||
|
||||
txtTitle: 'List Settings',
|
||||
txtSize: 'Size',
|
||||
txtColor: 'Color',
|
||||
txtOfText: '% of text',
|
||||
textNewColor: 'Add New Custom Color',
|
||||
txtStart: 'Start at',
|
||||
txtBullet: 'Bullet',
|
||||
tipChange: 'Change bullet'
|
||||
}, Common.Views.ListSettingsDialog || {}))
|
||||
});
|
|
@ -366,11 +366,6 @@ define([
|
|||
'</div>',
|
||||
'<% if ((typeof buttons !== "undefined") && _.size(buttons) > 0) { %>',
|
||||
'<div class="separator horizontal"/>',
|
||||
'<div class="footer" style="text-align: center;">',
|
||||
'<% for(var bt in buttons) { %>',
|
||||
'<button class="btn normal dlg-btn <%= buttons[bt].cls %>" result="<%= bt %>"><%= buttons[bt].text %></button>',
|
||||
'<% } %>',
|
||||
'</div>',
|
||||
'<% } %>'
|
||||
].join('');
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ define([
|
|||
|
||||
this.btnPwd = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-protect',
|
||||
iconCls: 'toolbar__icon btn-ic-protect',
|
||||
caption: this.txtEncrypt,
|
||||
menu: true,
|
||||
visible: false
|
||||
|
|
|
@ -48,8 +48,7 @@ define([
|
|||
header: false,
|
||||
cls: 'modal-dlg',
|
||||
filename: '',
|
||||
buttons: ['ok', 'cancel'],
|
||||
footerCls: 'right'
|
||||
buttons: ['ok', 'cancel']
|
||||
},
|
||||
|
||||
initialize : function(options) {
|
||||
|
|
|
@ -64,6 +64,7 @@ define([
|
|||
'<div class="separator long sharing"/>' +
|
||||
'<div class="group">' +
|
||||
'<span class="btn-slot text x-huge slot-comment"></span>' +
|
||||
'<span class="btn-slot text x-huge" id="slot-comment-remove"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long comments"/>' +
|
||||
'<div class="group">' +
|
||||
|
@ -79,6 +80,10 @@ define([
|
|||
'<span id="btn-change-reject" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long review"/>' +
|
||||
'<div class="group">' +
|
||||
'<span id="btn-compare" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long compare"/>' +
|
||||
'<div class="group no-group-mask">' +
|
||||
'<span id="slot-btn-chat" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
|
@ -115,6 +120,16 @@ define([
|
|||
me.fireEvent('reviewchange:reject', [menu, item]);
|
||||
});
|
||||
|
||||
if (me.appConfig.canFeatureComparison) {
|
||||
this.btnCompare.on('click', function (e) {
|
||||
me.fireEvent('reviewchange:compare', ['file']);
|
||||
});
|
||||
|
||||
this.btnCompare.menu.on('item:click', function (menu, item, e) {
|
||||
me.fireEvent('reviewchange:compare', [item.value]);
|
||||
});
|
||||
}
|
||||
|
||||
this.btnsTurnReview.forEach(function (button) {
|
||||
button.on('click', _click_turnpreview.bind(me));
|
||||
});
|
||||
|
@ -129,7 +144,7 @@ define([
|
|||
});
|
||||
|
||||
this.btnReviewView && this.btnReviewView.menu.on('item:click', function (menu, item, e) {
|
||||
me.fireEvent('reviewchanges:view', [menu, item]);
|
||||
me.fireEvent('reviewchange:view', [menu, item]);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -161,6 +176,16 @@ define([
|
|||
this.btnChat && this.btnChat.on('click', function (btn, e) {
|
||||
me.fireEvent('collaboration:chat', [btn.pressed]);
|
||||
});
|
||||
|
||||
if (this.btnCommentRemove) {
|
||||
this.btnCommentRemove.on('click', function (e) {
|
||||
me.fireEvent('comment:removeComments', ['current']);
|
||||
});
|
||||
|
||||
this.btnCommentRemove.menu.on('item:click', function (menu, item, e) {
|
||||
me.fireEvent('comment:removeComments', [item.value]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -178,19 +203,27 @@ define([
|
|||
cls: 'btn-toolbar x-huge icon-top',
|
||||
caption: this.txtAccept,
|
||||
split: true,
|
||||
iconCls: 'review-save'
|
||||
iconCls: 'toolbar__icon btn-review-save'
|
||||
});
|
||||
|
||||
this.btnReject = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
caption: this.txtReject,
|
||||
split: true,
|
||||
iconCls: 'review-deny'
|
||||
iconCls: 'toolbar__icon btn-review-deny'
|
||||
});
|
||||
|
||||
if (this.appConfig.canFeatureComparison)
|
||||
this.btnCompare = new Common.UI.Button({
|
||||
cls : 'btn-toolbar x-huge icon-top',
|
||||
caption : this.txtCompare,
|
||||
split : true,
|
||||
iconCls: 'toolbar__icon btn-compare'
|
||||
});
|
||||
|
||||
this.btnTurnOn = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-review',
|
||||
iconCls: 'toolbar__icon btn-ic-review',
|
||||
caption: this.txtTurnon,
|
||||
enableToggle: true
|
||||
});
|
||||
|
@ -199,13 +232,13 @@ define([
|
|||
if (this.appConfig.canViewReview) {
|
||||
this.btnPrev = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'review-prev',
|
||||
iconCls: 'toolbar__icon btn-review-prev',
|
||||
caption: this.txtPrev
|
||||
});
|
||||
|
||||
this.btnNext = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'review-next',
|
||||
iconCls: 'toolbar__icon btn-review-next',
|
||||
caption: this.txtNext
|
||||
});
|
||||
|
||||
|
@ -216,7 +249,7 @@ define([
|
|||
|
||||
this.btnReviewView = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-reviewview',
|
||||
iconCls: 'toolbar__icon btn-ic-reviewview',
|
||||
caption: this.txtView,
|
||||
menu: new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar',
|
||||
|
@ -254,10 +287,10 @@ define([
|
|||
}
|
||||
}
|
||||
|
||||
if (!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length && this._readonlyRights!==true) {
|
||||
if ((!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length || this.appConfig.canRequestSharingSettings) && this._readonlyRights!==true) {
|
||||
this.btnSharing = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-sharing',
|
||||
iconCls: 'toolbar__icon btn-ic-sharing',
|
||||
caption: this.txtSharing
|
||||
});
|
||||
}
|
||||
|
@ -265,7 +298,7 @@ define([
|
|||
if (this.appConfig.isEdit && !this.appConfig.isOffline && this.appConfig.canCoAuthoring) {
|
||||
this.btnCoAuthMode = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-coedit',
|
||||
iconCls: 'toolbar__icon btn-ic-coedit',
|
||||
caption: this.txtCoAuthMode,
|
||||
menu: true
|
||||
});
|
||||
|
@ -277,7 +310,7 @@ define([
|
|||
if (this.appConfig.canUseHistory && !this.appConfig.isDisconnected) {
|
||||
this.btnHistory = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-history',
|
||||
iconCls: 'toolbar__icon btn-ic-history',
|
||||
caption: this.txtHistory
|
||||
});
|
||||
}
|
||||
|
@ -285,12 +318,21 @@ define([
|
|||
if (this.appConfig.canCoAuthoring && this.appConfig.canChat) {
|
||||
this.btnChat = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-chat',
|
||||
iconCls: 'toolbar__icon btn-ic-chat',
|
||||
caption: this.txtChat,
|
||||
enableToggle: true
|
||||
});
|
||||
}
|
||||
|
||||
if ( this.appConfig.canCoAuthoring && this.appConfig.canComments ) {
|
||||
this.btnCommentRemove = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
caption: this.txtCommentRemove,
|
||||
split: true,
|
||||
iconCls: 'toolbar__icon btn-rem-comment'
|
||||
});
|
||||
}
|
||||
|
||||
var filter = Common.localStorage.getKeysFilter();
|
||||
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
||||
|
||||
|
@ -348,6 +390,20 @@ define([
|
|||
);
|
||||
me.btnReject.updateHint([me.tipRejectCurrent, me.txtRejectChanges]);
|
||||
|
||||
if (config.canFeatureComparison) {
|
||||
me.btnCompare.setMenu(new Common.UI.Menu({
|
||||
items: [
|
||||
{caption: me.mniFromFile, value: 'file'},
|
||||
{caption: me.mniFromUrl, value: 'url'},
|
||||
{caption: me.mniFromStorage, value: 'storage'}
|
||||
// ,{caption: '--'},
|
||||
// {caption: me.mniSettings, value: 'settings'}
|
||||
]
|
||||
}));
|
||||
me.btnCompare.menu.items[2].setVisible(me.appConfig.canRequestCompareFile || me.appConfig.fileChoiceUrl && me.appConfig.fileChoiceUrl.indexOf("{documentType}")>-1);
|
||||
me.btnCompare.updateHint(me.tipCompare);
|
||||
}
|
||||
|
||||
me.btnAccept.setDisabled(config.isReviewOnly);
|
||||
me.btnReject.setDisabled(config.isReviewOnly);
|
||||
}
|
||||
|
@ -397,9 +453,32 @@ define([
|
|||
me.turnCoAuthMode((value===null || parseInt(value) == 1) && !(config.isDesktopApp && config.isOffline) && config.canCoAuthoring);
|
||||
}
|
||||
|
||||
if (me.btnCommentRemove) {
|
||||
var items = [
|
||||
{
|
||||
caption: config.canEditComments ? me.txtCommentRemCurrent : me.txtCommentRemMyCurrent,
|
||||
value: 'current'
|
||||
},
|
||||
{
|
||||
caption: me.txtCommentRemMy,
|
||||
value: 'my'
|
||||
}
|
||||
];
|
||||
if (config.canEditComments)
|
||||
items.push({
|
||||
caption: me.txtCommentRemAll,
|
||||
value: 'all'
|
||||
});
|
||||
me.btnCommentRemove.setMenu(
|
||||
new Common.UI.Menu({items: items})
|
||||
);
|
||||
me.btnCommentRemove.updateHint([me.tipCommentRemCurrent, me.tipCommentRem]);
|
||||
}
|
||||
|
||||
var separator_sharing = !(me.btnSharing || me.btnCoAuthMode) ? me.$el.find('.separator.sharing') : '.separator.sharing',
|
||||
separator_comments = !(config.canComments && config.canCoAuthoring) ? me.$el.find('.separator.comments') : '.separator.comments',
|
||||
separator_review = !(config.canReview || config.canViewReview) ? me.$el.find('.separator.review') : '.separator.review',
|
||||
separator_compare = !(config.canReview && config.canFeatureComparison) ? me.$el.find('.separator.compare') : '.separator.compare',
|
||||
separator_chat = !me.btnChat ? me.$el.find('.separator.chat') : '.separator.chat',
|
||||
separator_last;
|
||||
|
||||
|
@ -418,6 +497,11 @@ define([
|
|||
else
|
||||
separator_last = separator_review;
|
||||
|
||||
if (typeof separator_compare == 'object')
|
||||
separator_compare.hide().prev('.group').hide();
|
||||
else
|
||||
separator_last = separator_compare;
|
||||
|
||||
if (typeof separator_chat == 'object')
|
||||
separator_chat.hide().prev('.group').hide();
|
||||
else
|
||||
|
@ -426,7 +510,7 @@ define([
|
|||
if (!me.btnHistory && separator_last)
|
||||
me.$el.find(separator_last).hide();
|
||||
|
||||
Common.NotificationCenter.trigger('tab:visible', 'review', config.isEdit || config.canViewReview);
|
||||
Common.NotificationCenter.trigger('tab:visible', 'review', config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments);
|
||||
|
||||
setEvents.call(me);
|
||||
});
|
||||
|
@ -438,6 +522,7 @@ define([
|
|||
if ( this.appConfig.canReview ) {
|
||||
this.btnAccept.render(this.$el.find('#btn-change-accept'));
|
||||
this.btnReject.render(this.$el.find('#btn-change-reject'));
|
||||
this.appConfig.canFeatureComparison && this.btnCompare.render(this.$el.find('#btn-compare'));
|
||||
this.btnTurnOn.render(this.$el.find('#btn-review-on'));
|
||||
}
|
||||
this.btnPrev && this.btnPrev.render(this.$el.find('#btn-change-prev'));
|
||||
|
@ -448,6 +533,7 @@ define([
|
|||
this.btnCoAuthMode && this.btnCoAuthMode.render(this.$el.find('#slot-btn-coauthmode'));
|
||||
this.btnHistory && this.btnHistory.render(this.$el.find('#slot-btn-history'));
|
||||
this.btnChat && this.btnChat.render(this.$el.find('#slot-btn-chat'));
|
||||
this.btnCommentRemove && this.btnCommentRemove.render(this.$el.find('#slot-comment-remove'));
|
||||
|
||||
return this.$el;
|
||||
},
|
||||
|
@ -461,7 +547,7 @@ define([
|
|||
if ( type == 'turn' && parent == 'statusbar' ) {
|
||||
var button = new Common.UI.Button({
|
||||
cls : 'btn-toolbar',
|
||||
iconCls : 'btn-ic-review',
|
||||
iconCls : 'toolbar__icon btn-ic-review',
|
||||
hintAnchor : 'top',
|
||||
hint : this.tipReview,
|
||||
enableToggle: true
|
||||
|
@ -474,7 +560,7 @@ define([
|
|||
if ( type == 'spelling' ) {
|
||||
button = new Common.UI.Button({
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'btn-ic-docspell',
|
||||
iconCls: 'toolbar__icon btn-ic-docspell',
|
||||
hintAnchor : 'top',
|
||||
hint: this.tipSetSpelling,
|
||||
enableToggle: true
|
||||
|
@ -485,7 +571,7 @@ define([
|
|||
} else if (type == 'doclang' && parent == 'statusbar' ) {
|
||||
button = new Common.UI.Button({
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'btn-ic-doclang',
|
||||
iconCls: 'toolbar__icon btn-ic-doclang',
|
||||
hintAnchor : 'top',
|
||||
hint: this.tipSetDocLang,
|
||||
disabled: true
|
||||
|
@ -561,6 +647,7 @@ define([
|
|||
}
|
||||
}, this);
|
||||
this.btnChat && this.btnChat.setDisabled(state);
|
||||
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state);
|
||||
},
|
||||
|
||||
onLostEditRights: function() {
|
||||
|
@ -609,7 +696,20 @@ define([
|
|||
txtFinalCap: 'Final',
|
||||
txtOriginalCap: 'Original',
|
||||
strFastDesc: 'Real-time co-editing. All changes are saved automatically.',
|
||||
strStrictDesc: 'Use the \'Save\' button to sync the changes you and others make.'
|
||||
strStrictDesc: 'Use the \'Save\' button to sync the changes you and others make.',
|
||||
txtCompare: 'Compare',
|
||||
tipCompare: 'Compare current document with another one',
|
||||
mniFromFile: 'Document from File',
|
||||
mniFromUrl: 'Document from URL',
|
||||
mniFromStorage: 'Document from Storage',
|
||||
mniSettings: 'Comparison Settings',
|
||||
txtCommentRemove: 'Remove',
|
||||
tipCommentRemCurrent: 'Remove current comments',
|
||||
tipCommentRem: 'Remove comments',
|
||||
txtCommentRemCurrent: 'Remove Current Comments',
|
||||
txtCommentRemMyCurrent: 'Remove My Current Comments',
|
||||
txtCommentRemMy: 'Remove My Comments',
|
||||
txtCommentRemAll: 'Remove All Comments'
|
||||
}
|
||||
}()), Common.Views.ReviewChanges || {}));
|
||||
|
||||
|
|
|
@ -469,7 +469,7 @@ define([
|
|||
});
|
||||
|
||||
this.emailMenu = new Common.UI.Menu({
|
||||
maxHeight: 190,
|
||||
maxHeight: 200,
|
||||
cyclic: false,
|
||||
items: []
|
||||
}).on('render:after', function(mnu) {
|
||||
|
@ -1014,6 +1014,8 @@ define([
|
|||
});
|
||||
}
|
||||
}, this);
|
||||
if (this.emailMenu && this.emailMenu.rendered)
|
||||
this.emailMenu.cmpEl.css('display', 'none');
|
||||
},
|
||||
|
||||
isCommentsViewMouseOver: function () {
|
||||
|
@ -1121,7 +1123,10 @@ define([
|
|||
return (item.email && 0 === item.email.toLowerCase().indexOf(str) || item.name && 0 === item.name.toLowerCase().indexOf(str))
|
||||
});
|
||||
}
|
||||
var tpl = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem" style="font-size: 12px;"><div><%= Common.Utils.String.htmlEncode(caption) %></div><div style="color: #909090;"><%= Common.Utils.String.htmlEncode(options.value) %></div></a>'),
|
||||
var tpl = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem" style="font-size: 12px;">' +
|
||||
'<div style="overflow: hidden; text-overflow: ellipsis; max-width: 195px;"><%= Common.Utils.String.htmlEncode(caption) %></div>' +
|
||||
'<div style="overflow: hidden; text-overflow: ellipsis; max-width: 195px; color: #909090;"><%= Common.Utils.String.htmlEncode(options.value) %></div>' +
|
||||
'</a>'),
|
||||
divider = false;
|
||||
_.each(users, function(menuItem, index) {
|
||||
if (divider && !menuItem.hasAccess) {
|
||||
|
@ -1160,8 +1165,10 @@ define([
|
|||
},
|
||||
|
||||
insertEmailToTextbox: function(str, left, right) {
|
||||
var textBox = this.commentsView.getTextBox(),
|
||||
val = textBox.val();
|
||||
var textBox = this.commentsView.getTextBox();
|
||||
if (!textBox) return;
|
||||
|
||||
var val = textBox.val();
|
||||
textBox.val(val.substring(0, left) + '+' + str + ' ' + val.substring(right+1, val.length));
|
||||
setTimeout(function(){
|
||||
textBox[0].selectionStart = textBox[0].selectionEnd = left + str.length + 2;
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
this.btnOptions = new Common.UI.Button({
|
||||
id : 'search-btn-options',
|
||||
cls : 'btn-toolbar',
|
||||
iconCls : 'btn-settings',
|
||||
iconCls : 'toolbar__icon btn-settings',
|
||||
// hint : me.tipMerge,
|
||||
menu : new Common.UI.Menu({
|
||||
items : [
|
||||
|
|
1352
apps/common/main/lib/view/SymbolTableDialog.js
Normal file
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 51 KiB |
|
@ -21,8 +21,8 @@
|
|||
<polygon points="14.243,7.585 11,10.829 11,4 9,4 9,10.827 5.758,7.585 4.344,9 10.001,14.656 15.657,9 "/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-print" viewBox="0 0 20 20">
|
||||
<rect x="4" y="8" width="1" height="1" fill="#ffffff"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 4H6V6H14V4ZM5 4V6H3C2.44772 6 2 6.44772 2 7V12V13H3H5V15C5 15.5523 5.44772 16 6 16H14C14.5523 16 15 15.5523 15 15V13H17H18V12V7C18 6.44772 17.5523 6 17 6H15V4C15 3.44772 14.5523 3 14 3H6C5.44772 3 5 3.44772 5 4ZM15 12H17V7H14H6H3V12H5V11C5 10.4477 5.44772 10 6 10H14C14.5523 10 15 10.4477 15 11V12ZM6 11H14V15H6V11Z" fill="#ffffff"/>
|
||||
<rect x="4" y="8" width="1" height="1"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 4H6V6H14V4ZM5 4V6H3C2.44772 6 2 6.44772 2 7V12V13H3H5V15C5 15.5523 5.44772 16 6 16H14C14.5523 16 15 15.5523 15 15V13H17H18V12V7C18 6.44772 17.5523 6 17 6H15V4C15 3.44772 14.5523 3 14 3H6C5.44772 3 5 3.44772 5 4ZM15 12H17V7H14H6H3V12H5V11C5 10.4477 5.44772 10 6 10H14C14.5523 10 15 10.4477 15 11V12ZM6 11H14V15H6V11Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-edit" viewBox="0 0 20 20">
|
||||
<polygon points="11.738,7.891 6.434,13.195 5.02,14.859 4.5,17.5 7,17.5 8.555,15.566 13.859,10.137"/>
|
||||
|
@ -30,9 +30,9 @@
|
|||
c0.391,0.391,0.391,1.023,0,1.414L15.273,8.598z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-save" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 15H4V4H6V7H12V4H12.5858L15 6.41421V15ZM11 4H10V6H11V4ZM4 3H13L16 6V15C16 15.5523 15.5523 16 15 16H4C3.44772 16 3 15.5523 3 15V4C3 3.44772 3.44772 3 4 3Z" fill="#ffffff"/>
|
||||
<rect x="6" y="10" width="7" height="1" fill="#ffffff"/>
|
||||
<rect x="6" y="12" width="7" height="1" fill="#ffffff"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 15H4V4H6V7H12V4H12.5858L15 6.41421V15ZM11 4H10V6H11V4ZM4 3H13L16 6V15C16 15.5523 15.5523 16 15 16H4C3.44772 16 3 15.5523 3 15V4C3 3.44772 3.44772 3 4 3Z"/>
|
||||
<rect x="6" y="10" width="7" height="1"/>
|
||||
<rect x="6" y="12" width="7" height="1"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-save-coauth" viewBox="0 0 20 20">
|
||||
<rect x="6" y="10" width="3" height="1" fill="#ffffff"/>
|
||||
|
@ -67,4 +67,118 @@
|
|||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.64645 10.6464L14.1464 6.14642L14.8536 6.85353L10.3536 11.3535L9.64645 10.6464Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 6H11V7H14L14 10H15V7V6H14Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-align-left" viewBox="0 0 20 20">
|
||||
<path d="M16 5H4V6H16V5Z"/>
|
||||
<path d="M11 7H4V8H11V7Z"/>
|
||||
<path d="M14 9H4V10H14V9Z"/>
|
||||
<path d="M11 11H4V12H11V11Z"/>
|
||||
<path d="M11 13H4V14H11V13Z"/>
|
||||
<path d="M16 15H4V16H16V15Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-align-center" viewBox="0 0 20 20">
|
||||
<path d="M16 5H4V6H16V5Z"/>
|
||||
<path d="M13 7H7V8H13V7Z"/>
|
||||
<path d="M15 9H5V10H15V9Z"/>
|
||||
<path d="M13 11H7V12H13V11Z"/>
|
||||
<path d="M13 13H7V14H13V13Z"/>
|
||||
<path d="M16 15H4V16H16V15Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-align-right" viewBox="0 0 20 20">
|
||||
<path d="M16 5H4V6H16V5Z"/>
|
||||
<path d="M16 7H9V8H16V7Z"/>
|
||||
<path d="M16 9H6V10H16V9Z"/>
|
||||
<path d="M16 11H9V12H16V11Z"/>
|
||||
<path d="M16 13H9V14H16V13Z"/>
|
||||
<path d="M16 15H4V16H16V15Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-align-just" viewBox="0 0 20 20">
|
||||
<path d="M16 15H4V16H16V15Z"/>
|
||||
<path d="M16 13H4V14H16V13Z"/>
|
||||
<path d="M16 11H4V12H16V11Z"/>
|
||||
<path d="M16 9H4V10H16V9Z"/>
|
||||
<path d="M16 7H4V8H16V7Z"/>
|
||||
<path d="M16 5H4V6H16V5Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-hidenchars" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.5 11C8.66976 11 8.8367 10.9879 9 10.9646V16H10V5H12V16H13V5H14V4H9V4.03544C8.8367 4.01209 8.66976 4 8.5 4C6.567 4 5 5.567 5 7.5C5 9.433 6.567 11 8.5 11Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-setmarkers" viewBox="0 0 20 20">
|
||||
<circle cx="5.5" cy="5.5" r="1.5"/>
|
||||
<circle cx="5.5" cy="10.5" r="1.5"/>
|
||||
<circle cx="5.5" cy="15.5" r="1.5"/>
|
||||
<path d="M16 5H8V6H16V5Z"/>
|
||||
<path d="M16 10H8V11H16V10Z"/>
|
||||
<path d="M16 15H8V16H16V15Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-numbering" viewBox="0 0 20 20">
|
||||
<path d="M16 5H8V6H16V5Z"/>
|
||||
<path d="M16 10H8V11H16V10Z"/>
|
||||
<path d="M16 15H8V16H16V15Z"/>
|
||||
<path d="M7 12V11H5L7 9L6 8H5H4V9H6L4 11V12H7Z"/>
|
||||
<path d="M5 7H6V3H5H4V4H5V7Z"/>
|
||||
<path d="M6 16H4V17H6L7 16L6.5 15L7 14L6 13H4V14H5H6L5.5 15L6 16Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-multilevels" viewBox="0 0 20 20">
|
||||
<circle cx="4.5" cy="5.5" r="1.5"/>
|
||||
<circle cx="6.5" cy="10.5" r="1.5"/>
|
||||
<circle cx="8.5" cy="15.5" r="1.5"/>
|
||||
<path d="M17 5H7V6H17V5Z"/>
|
||||
<path d="M17 10H9V11H17V10Z"/>
|
||||
<path d="M17 15H11V16H17V15Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-decoffset" viewBox="0 0 20 20">
|
||||
<path d="M16 5H4V6H16V5Z"/>
|
||||
<path d="M16 7H10V8H16V7Z"/>
|
||||
<path d="M16 9H10V10H16V9Z"/>
|
||||
<path d="M16 11H10V12H16V11Z"/>
|
||||
<path d="M16 13H10V14H16V13Z"/>
|
||||
<path d="M16 15H4V16H16V15Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.70711 10L7.35355 8.35359L6.64645 7.64648L4.14645 10.1465L3.79289 10.5L4.14645 10.8536L6.64645 13.3536L7.35355 12.6465L5.70711 11H9V10H5.70711Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-incoffset" viewBox="0 0 20 20">
|
||||
<path d="M16 5H4V6H16V5Z"/>
|
||||
<path d="M16 7H10V8H16V7Z"/>
|
||||
<path d="M16 9H10V10H16V9Z"/>
|
||||
<path d="M16 11H10V12H16V11Z"/>
|
||||
<path d="M16 13H10V14H16V13Z"/>
|
||||
<path d="M16 15H4V16H16V15Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.29289 11L5.64645 12.6465L6.35355 13.3536L8.85355 10.8536L9.20711 10.5L8.85355 10.1465L6.35355 7.64648L5.64645 8.35359L7.29289 10H4V11H7.29289Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-linespace" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.64645 6.64652L6.14645 4.14652L6.50001 3.79297L6.85356 4.14652L9.35356 6.64652L8.64645 7.35363L7.00001 5.70718V14.293L8.64645 12.6465L9.35356 13.3536L6.85356 15.8536L6.50001 16.2072L6.14645 15.8536L3.64645 13.3536L4.35356 12.6465L6.00001 14.293V5.70718L4.35356 7.35363L3.64645 6.64652Z"/>
|
||||
<path d="M17 5H10V6H17V5Z"/>
|
||||
<path d="M17 8H10V9H17V8Z"/>
|
||||
<path d="M17 11H10V12H17V11Z"/>
|
||||
<path d="M17 14H10V15H17V14Z"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="svg-btn-insertimage" viewBox="0 0 28 28">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 5H23V18.2928L16.5 11.7928L10.5 17.7928L8.50001 15.7928L5 19.2929V5ZM5 20.7071V23H23V19.7071L16.5 13.2071L10.5 19.2071L8.50001 17.2071L5 20.7071ZM4 5C4 4.44772 4.44772 4 5 4H23C23.5523 4 24 4.44772 24 5V23C24 23.5523 23.5523 24 23 24H5C4.44772 24 4 23.5523 4 23V5Z"/>
|
||||
<circle cx="9" cy="9" r="1.5"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-insertchart" viewBox="0 0 28 28">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 24H8V18H4V24ZM8 25C8.6 25 9 24.6 9 24V18C9 17.4 8.6 17 8 17H4C3.4 17 3 17.4 3 18V24C3 24.6 3.4 25 4 25H8Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.9936 24C15.997 23.9822 16 23.9569 16 23.9231V12.0769C16 12.0431 15.997 12.0178 15.9936 12H12.0064C12.003 12.0178 12 12.0431 12 12.0769V23.9231C12 23.9569 12.003 23.9822 12.0064 24H15.9936ZM16 25C16.6 25 17 24.5692 17 23.9231V12.0769C17 11.4308 16.6 11 16 11H12C11.4 11 11 11.4308 11 12.0769V23.9231C11 24.5692 11.4 25 12 25H16Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.9892 24C23.9947 23.978 24 23.9441 24 23.8947V5.10526C24 5.05594 23.9947 5.02198 23.9892 5H20.0108C20.0053 5.02198 20 5.05594 20 5.10526V23.8947C20 23.9441 20.0053 23.978 20.0108 24H23.9892ZM23.9769 24.0335C23.9769 24.0335 23.9771 24.033 23.9778 24.0321ZM20.0231 24.0335C20.0231 24.0335 20.0228 24.0331 20.0222 24.0321ZM20.0231 4.96647C20.0231 4.96648 20.0229 4.96697 20.0222 4.9679ZM23.9769 4.96647C23.9769 4.96645 23.9772 4.96691 23.9778 4.9679ZM24 25C24.6 25 25 24.5579 25 23.8947V5.10526C25 4.44211 24.6 4 24 4H20C19.4 4 19 4.44211 19 5.10526V23.8947C19 24.5579 19.4 25 20 25H24Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-insertshape" viewBox="0 0 28 28">
|
||||
<path d="M5 17V5H17V8H18V5C18 4.4 17.6 4 17 4H5C4.4 4 4 4.4 4 5V17C4 17.6 4.4 18 5 18H8V17H5Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 23C20.0899 23 23 20.0899 23 16.5C23 12.9101 20.0899 10 16.5 10C12.9101 10 10 12.9101 10 16.5C10 20.0899 12.9101 23 16.5 23ZM16.5 24C20.6421 24 24 20.6421 24 16.5C24 12.3579 20.6421 9 16.5 9C12.3579 9 9 12.3579 9 16.5C9 20.6421 12.3579 24 16.5 24Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-inserttable" viewBox="0 0 28 28">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 8C3 6.89543 3.89543 6 5 6H23C24.1046 6 25 6.89543 25 8C25 9.50659 25 11.1093 25 13V14V17V18V20C25 21.1046 24.1046 22 23 22H5C3.89543 22 3 21.1046 3 20V18V17V14V13C3 11.3333 3 9.66667 3 8ZM4 17H10V14H4V17ZM4 18H10V21H5C4.44771 21 4 20.5523 4 20V18ZM17 21H11V18H17V21ZM18 21H23C23.5523 21 24 20.5523 24 20V18H18V21ZM18 17H24V14H18V17ZM17 14H11V17H17V14ZM17 13H11V10H17V13ZM18 13H24V10H18V13ZM10 10V13H4V10H10Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-editheader" viewBox="0 0 28 28">
|
||||
<path d="M20 20H8V23H20V20Z"/>
|
||||
<path d="M20 5H8V8H20V5Z"/>
|
||||
<path d="M22 4V24H6V4H22ZM22 3H6C5.4 3 5 3.4 5 4V24C5 24.6 5.4 25 6 25H22C22.6 25 23 24.6 23 24V4C23 3.4 22.5 3 22 3Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-pagebreak" viewBox="0 0 28 28">
|
||||
<path d="M24 16H23V15H24V16ZM22 16H21V15H22V16ZM20 16H19V15H20V16ZM18 16H17V15H18V16ZM16 16H15V15H16V16ZM14 16H13V15H14V16ZM12 16H11V15H12V16ZM10 16H9V15H10V16ZM8 16H7V15H8V16ZM6 16H5V15H6V16ZM4 16H3V15H4V16Z"/>
|
||||
<path d="M16 8H8V9H16V8Z"/>
|
||||
<path d="M20 5H8V6H20V5Z"/>
|
||||
<path d="M20 22H8V23H20V22Z"/>
|
||||
<path d="M22 3V12H6V3H5V12C5 12.6 5.4 13 6 13H22C22.6 13 23 12.6 23 12V3H22Z"/>
|
||||
<path d="M6 19H22V25H23V19C23 18.4 22.6 18 22 18H6C5.4 18 5 18.4 5 19V25H6V19Z"/>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 13 KiB |
170
apps/common/main/resources/img/header/buttons150.svg
Normal file
|
@ -0,0 +1,170 @@
|
|||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px"
|
||||
height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
|
||||
<symbol id="svg-btn-users-150" viewBox="0 0 30 30">
|
||||
<path display="inline" d="M11.051,6c2.205,0,4,1.794,4,4s-1.795,4-4,4c-2.206,0-4-1.794-4-4S8.845,6,11.051,6 M11.051,5
|
||||
c-2.761,0-5,2.238-5,5c0,2.76,2.239,5,5,5c2.762,0,5-2.24,5-5C16.051,7.238,13.813,5,11.051,5L11.051,5z"/>
|
||||
<path display="inline" d="M11,18c6.825,0,7.887,3.874,8,4.407V25H3v-2.593C3.11,21.895,4.176,18,11,18 M11,17
|
||||
c-8.216,0-9,5.316-9,5.316V26h18v-3.684C20,22.316,19.216,17,11,17L11,17z"/>
|
||||
<circle cx="21.041" cy="13" r="4"/>
|
||||
<path d="M21,18c-0.728,0-1,0-2,0c1.635,1.63,2,2,2,2v6h7v-3.146C28,22.854,27.572,18,21,18z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-goback-150" viewBox="0 0 28 28">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.1465 18.1465L15.8536 18.8536L19.2071 15.5L15.8536 12.1465L15.1465 12.8536L17.2929 15.0001H9V16.0001H17.2929L15.1465 18.1465Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 10V7H5V21H23V10H14ZM23 9C23.5523 9 24 9.44772 24 10V21C24 21.5523 23.5523 22 23 22H5C4.44771 22 4 21.5523 4 21V7C4 6.44772 4.44772 6 5 6H14C14.5523 6 15 6.44772 15 7V9H23Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-comments-150" viewBox="0 0 30 30">
|
||||
<rect x="9" y="11" width="12" height="1"/>
|
||||
<rect x="9" y="14" width="12" height="1"/>
|
||||
<rect x="9" y="17" width="9" height="1"/>
|
||||
<path d="M23.375,8C23.65,8,24,8.386,24,8.641V20c0,0.448-0.552,1-1,1h-6h-0.333L16.4,21.2L13,23.75L9.6,21.2
|
||||
L9.333,21H9H7c-0.449,0-1-0.552-1-1V8.656C6,8.401,6.318,8,6.594,8 M23.5,7h-17C5.671,7,5,7.653,5,8.462V20c0,1,1,2,2,2h2l4,3l4-3
|
||||
h6c1,0,2-1,2-2V8.462C25,7.653,24.329,7,23.5,7L23.5,7z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-options-150" viewBox="0 0 28 28">
|
||||
<path d="M24 8H4V9H24V8Z"/>
|
||||
<path d="M24 14H4V15H24V14Z"/>
|
||||
<path d="M24 20H4V21H24V20Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-print-150" viewBox="0 0 28 28">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 4H21V8H7V4ZM6 8V4C6 3.44772 6.44772 3 7 3H21C21.5523 3 22 3.44772 22 4V8H25C25.5523 8 26 8.44772 26 9V19C26 19.5523 25.5523 20 25 20H22V23C22 23.5523 21.5523 24 21 24H7C6.44772 24 6 23.5523 6 23V20H3C2.44772 20 2 19.5523 2 19V9C2 8.44771 2.44772 8 3 8H6ZM6 19V15C6 14.4477 6.44772 14 7 14H21C21.5523 14 22 14.4477 22 15V19H25V9H21H7H3V19H6ZM21 19V15H7V23H21V20V19ZM5 10H4V11H5V10Z"/>
|
||||
<rect x="9" y="17" width="10" height="1"/>
|
||||
<rect x="9" y="20" width="10" height="1"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-save-150" viewBox="0 0 28 28">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M20 22H22V8.79883L18.2012 5H18V9H9V5L5 5L5 22H7V14C7 13.4477 7.44772 13 8 13H19C19.5523 13 20 13.4477 20 14V22ZM19 23H22C22.5523 23 23 22.5523 23 22V8.79883C23 8.53361 22.8946 8.27926 22.7071 8.09172L18.9083 4.29289C18.7207 4.10536 18.4664 4 18.2012 4H5C4.44772 4 4 4.44771 4 5V22C4 22.5523 4.44771 23 5 23H8H19ZM19 22V14H8V22H19ZM15 5H17V8H15V5Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-undo-150" viewBox="0 0 28 28">
|
||||
<path d="M14.8966 9C12.1379 9 9.2931 10.7857 7.5 12.5L4 9V19H14L10.5 15.5C11.6034 13.6429 13.7931 12 16.1379 12C19.5862 12 23.5862 14.4286 24 17.8571C23.4483 12.8571 19.8621 9 14.8966 9Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-redo-150" viewBox="0 0 28 28">
|
||||
<path d="M13.1034 9C15.8621 9 18.7069 10.7857 20.5 12.5L24 9V19H14L17.5 15.5C16.3966 13.6429 14.2069 12 11.8621 12C8.41379 12 4.41379 14.4286 4 17.8571C4.55172 12.8571 8.13793 9 13.1034 9Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-align-left-150" viewBox="0 0 28 28">
|
||||
<path d="M23 6H5V7H23V6Z"/>
|
||||
<path d="M13 9H5V10H13V9Z"/>
|
||||
<path d="M19 12H5V13H19V12Z"/>
|
||||
<path d="M13 15H5V16H13V15Z"/>
|
||||
<path d="M13 18H5V19H13V18Z"/>
|
||||
<path d="M23 21H5V22H23V21Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-align-center-150" viewBox="0 0 28 28">
|
||||
<path d="M23 6H5V7H23V6Z"/>
|
||||
<path d="M18 9H10V10H18V9Z"/>
|
||||
<path d="M21 12H7V13H21V12Z"/>
|
||||
<path d="M18 15H10V16H18V15Z"/>
|
||||
<path d="M18 18H10V19H18V18Z"/>
|
||||
<path d="M23 21H5V22H23V21Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-align-right-150" viewBox="0 0 28 28">
|
||||
<path d="M23 6H5V7H23V6Z"/>
|
||||
<path d="M23 9H15V10H23V9Z"/>
|
||||
<path d="M23 12H9V13H23V12Z"/>
|
||||
<path d="M23 15H15V16H23V15Z"/>
|
||||
<path d="M23 18H15V19H23V18Z"/>
|
||||
<path d="M23 21H5V22H23V21Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-align-just-150" viewBox="0 0 28 28">
|
||||
<path d="M23 6H5V7H23V6Z"/>
|
||||
<path d="M23 21H5V22H23V21Z"/>
|
||||
<path d="M23 18H5V19H23V18Z"/>
|
||||
<path d="M23 15H5V16H23V15Z"/>
|
||||
<path d="M23 12H5V13H23V12Z"/>
|
||||
<path d="M23 9H5V10H23V9Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-hidenchars-150" viewBox="0 0 28 28">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.25 16C13.5046 16 13.755 15.9827 14 15.9494V22H15V7H18V22H19V7H21V6H14V6.05063C13.755 6.01727 13.5046 6 13.25 6C10.3505 6 8 8.23858 8 11C8 13.7614 10.3505 16 13.25 16Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-setmarkers-150" viewBox="0 0 28 28">
|
||||
<path d="M23 8H9V9H23V8Z"/>
|
||||
<path d="M23 14H9V15H23V14Z"/>
|
||||
<circle cx="6.5" cy="8.5" r="1.5"/>
|
||||
<circle cx="6.5" cy="14.5" r="1.5"/>
|
||||
<path d="M23 20H9V21H23V20Z"/>
|
||||
<circle cx="6.5" cy="20.5" r="1.5"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-numbering-150" viewBox="0 0 28 28">
|
||||
<path d="M22 8H10V9H22V8Z"/>
|
||||
<path d="M22 14H10V15H22V14Z"/>
|
||||
<path d="M9 17V16H7L9 14V13L8 12H7H6V13H8V14L6 16V17H9Z"/>
|
||||
<path d="M22 20H10V21H22V20Z"/>
|
||||
<path d="M7 21H8V22H6V23H8L9 22V20V19L8 18H6V19H7H8V20H7V21Z"/>
|
||||
<path d="M7 11H8V6H7H6V7H7V11Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-multilevels-150" viewBox="0 0 28 28">
|
||||
<path d="M24 8H8V9H24V8Z"/>
|
||||
<path d="M24 14H11V15H24V14Z"/>
|
||||
<circle cx="5.5" cy="8.5" r="1.5"/>
|
||||
<circle cx="8.5" cy="14.5" r="1.5"/>
|
||||
<path d="M24 20H14V21H24V20Z"/>
|
||||
<circle cx="11.5" cy="20.5" r="1.5"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-decoffset-150" viewBox="0 0 28 28">
|
||||
<path d="M6 7H22V8H6V7Z"/>
|
||||
<path d="M6 10H14V11H6V10Z"/>
|
||||
<path d="M6 13H14V14H6V13Z"/>
|
||||
<path d="M6 16H14V17H6V16Z"/>
|
||||
<path d="M6 19H22V20H6V19Z"/>
|
||||
<path d="M22 13H16V14H22V13Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.2071 13.5L19.3536 16.6464L18.6464 17.3535L14.7929 13.5L18.6464 9.64641L19.3536 10.3535L16.2071 13.5Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-incoffset-150" viewBox="0 0 28 28">
|
||||
<path d="M22 8H6V9H22V8Z"/>
|
||||
<path d="M22 11H14V12H22V11Z"/>
|
||||
<path d="M22 14H14V15H22V14Z"/>
|
||||
<path d="M22 17H14V18H22V17Z"/>
|
||||
<path d="M22 20H6V21H22V20Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.2929 14H6V15H11.2929L8.64645 17.6465L9.35355 18.3536L12.8536 14.8536L13.2071 14.5L12.8536 14.1465L9.35355 10.6465L8.64645 11.3536L11.2929 14Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-linespace-150" viewBox="0 0 28 28">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.64645 9.64652L8.14645 6.14652L8.50001 5.79297L8.85356 6.14652L12.3536 9.64652L11.6465 10.3536L9.00001 7.70718V19.293L11.6465 16.6465L12.3536 17.3536L8.85356 20.8536L8.50001 21.2072L8.14645 20.8536L4.64645 17.3536L5.35356 16.6465L8.00001 19.293V7.70718L5.35356 10.3536L4.64645 9.64652Z"/>
|
||||
<path d="M24 7H14V8H24V7Z"/>
|
||||
<path d="M24 11H14V12H24V11Z"/>
|
||||
<path d="M24 15H14V16H24V15Z"/>
|
||||
<path d="M24 19H14V20H24V19Z"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="svg-btn-insertimage-150" viewBox="0 0 40 40">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 7H32C32.5523 7 33 7.44772 33 8V27.2929L23.8536 18.1464L23.5 17.7929L23.1464 18.1464L14.5 26.7929L11.8536 24.1464L11.5 23.7929L11.1464 24.1464L7 28.2929V8C7 7.44772 7.44772 7 8 7ZM7 29.7071V32C7 32.5523 7.44772 33 8 33H32C32.5523 33 33 32.5523 33 32V28.7071L23.5 19.2071L14.8536 27.8536L14.5 28.2071L14.1464 27.8536L11.5 25.2071L7 29.7071ZM6 8C6 6.89543 6.89543 6 8 6H32C33.1046 6 34 6.89543 34 8V32C34 33.1046 33.1046 34 32 34H8C6.89543 34 6 33.1046 6 32V8Z"/>
|
||||
<circle cx="12" cy="12" r="2.5"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-insertchart-150" viewBox="0 0 40 40">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0048 33.067C12.049 33.0256 12.1111 32.9356 12.1111 32.75V25.25C12.1111 25.0644 12.049 24.9744 12.0048 24.933C11.9606 24.8916 11.8647 24.8333 11.6667 24.8333H6.33333C6.13533 24.8333 6.0394 24.8916 5.99521 24.933C5.95101 24.9744 5.88889 25.0644 5.88889 25.25V32.75C5.88889 32.9356 5.95101 33.0256 5.99521 33.067C6.0394 33.1084 6.13533 33.1667 6.33333 33.1667H11.6667C11.8647 33.1667 11.9606 33.1084 12.0048 33.067ZM11.6667 34C12.4667 34 13 33.5 13 32.75V25.25C13 24.5 12.4667 24 11.6667 24H6.33333C5.53333 24 5 24.5 5 25.25V32.75C5 33.5 5.53333 34 6.33333 34H11.6667Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.013 32.9407C23.0538 32.8983 23.1111 32.808 23.1111 32.6154V17.3846C23.1111 17.192 23.0538 17.1017 23.013 17.0593C22.9701 17.0148 22.8715 16.9474 22.6667 16.9474H17.3333C17.1285 16.9474 17.0299 17.0148 16.987 17.0593C16.9462 17.1017 16.8889 17.192 16.8889 17.3846V32.6154C16.8889 32.808 16.9462 32.8983 16.987 32.9407C17.0299 32.9852 17.1285 33.0526 17.3333 33.0526H22.6667C22.8715 33.0526 22.9701 32.9852 23.013 32.9407ZM22.6667 34C23.4667 34 24 33.4462 24 32.6154V17.3846C24 16.5538 23.4667 16 22.6667 16H17.3333C16.5333 16 16 16.5538 16 17.3846V32.6154C16 33.4462 16.5333 34 17.3333 34H22.6667Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.0104 32.8814C34.0522 32.8351 34.1111 32.7358 34.1111 32.5263V7.47368C34.1111 7.2642 34.0522 7.16487 34.0104 7.1186C33.9671 7.07077 33.8693 7 33.6667 7H28.3333C28.1307 7 28.0329 7.07077 27.9896 7.1186C27.9478 7.16487 27.8889 7.2642 27.8889 7.47368V32.5263C27.8889 32.7358 27.9478 32.8351 27.9896 32.8814C28.0329 32.9292 28.1307 33 28.3333 33H33.6667C33.8693 33 33.9671 32.9292 34.0104 32.8814ZM33.6667 34C34.4667 34 35 33.4105 35 32.5263V7.47368C35 6.58947 34.4667 6 33.6667 6H28.3333C27.5333 6 27 6.58947 27 7.47368V32.5263C27 33.4105 27.5333 34 28.3333 34H33.6667Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-insertshape-150" viewBox="0 0 40 40">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M24 34C29.5228 34 34 29.5228 34 24C34 18.4772 29.5228 14 24 14C18.4772 14 14 18.4772 14 24C14 29.5228 18.4772 34 24 34ZM24 35C30.0751 35 35 30.0751 35 24C35 17.9249 30.0751 13 24 13C17.9249 13 13 17.9249 13 24C13 30.0751 17.9249 35 24 35Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 6H24C24.5523 6 25 6.44772 25 7V12H26V7C26 5.89543 25.1046 5 24 5H7C5.89543 5 5 5.89543 5 7V24C5 25.1046 5.89543 26 7 26H12V25H7C6.44772 25 6 24.5523 6 24V7C6 6.44772 6.44772 6 7 6Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-inserttable-150" viewBox="0 0 40 40">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 10C4 8.89543 4.89543 8 6 8H34C35.1046 8 36 8.89543 36 10C36 13.1616 36 15.5994 36 19V20V25V26V30C36 31.1046 35.1046 32 34 32H6C4.89543 32 4 31.1046 4 30V26V25V20V19C4 15.5994 4 13.1616 4 10ZM5 25H14V20H5V25ZM5 26H14V31H6C5.44772 31 5 30.5523 5 30V26ZM25 31H15V26H25V31ZM26 31H34C34.5523 31 35 30.5523 35 30V26H26V31ZM26 25H35V20H26V25ZM25 20H15V25H25V20ZM25 19H15V14H25V19ZM26 19H35V14H26V19ZM14 14V19H5V14H14Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-editheader-150" viewBox="0 0 40 40">
|
||||
<path d="M30 28H10V33H30V28Z"/>
|
||||
<path d="M30 7H10V12H30V7Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M31 5H9C8.44772 5 8 5.44772 8 6V34C8 34.5523 8.44772 35 9 35H31C31.5523 35 32 34.5523 32 34V6C32 5.44772 31.5523 5 31 5ZM9 4C7.89543 4 7 4.89543 7 6V34C7 35.1046 7.89543 36 9 36H31C32.1046 36 33 35.1046 33 34V6C33 4.89543 32.1046 4 31 4H9Z"/>
|
||||
</symbol>
|
||||
<symbol id="svg-btn-pagebreak-150" viewBox="0 0 40 40">
|
||||
<path d="M24 13H10V14H24V13Z"/>
|
||||
<path d="M30 8H10V9H30V8Z"/>
|
||||
<path d="M30 31H10V32H30V31Z"/>
|
||||
<path d="M5 22H6V23H5V22Z"/>
|
||||
<path d="M7 22H8V23H7V22Z"/>
|
||||
<path d="M9 22H10V23H9V22Z"/>
|
||||
<path d="M11 22H12V23H11V22Z"/>
|
||||
<path d="M13 22H14V23H13V22Z"/>
|
||||
<path d="M15 22H16V23H15V22Z"/>
|
||||
<path d="M17 22H18V23H17V22Z"/>
|
||||
<path d="M19 22H20V23H19V22Z"/>
|
||||
<path d="M21 22H22V23H21V22Z"/>
|
||||
<path d="M23 22H24V23H23V22Z"/>
|
||||
<path d="M25 22H26V23H25V22Z"/>
|
||||
<path d="M27 22H28V23H27V22Z"/>
|
||||
<path d="M29 22H30V23H29V22Z"/>
|
||||
<path d="M31 22H32V23H31V22Z"/>
|
||||
<path d="M33 22H34V23H33V22Z"/>
|
||||
<path d="M35 22H36V23H35V22Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 5V19C6 19.5523 6.44771 20 7 20H33C33.5523 20 34 19.5523 34 19V5H33V19H7L7 5H6Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 26H33V35H34V26C34 25.4477 33.5523 25 33 25H7C6.44772 25 6 25.4477 6 26V35H7L7 26Z"/>
|
||||
</symbol>
|
||||
</svg>
|
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.3 KiB |
13
apps/common/main/resources/img/toolbar/1.5x/.css.handlebars
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{#spritesheet}}
|
||||
@media only screen {
|
||||
@media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9),
|
||||
(min-resolution: 1.5dppx) and (max-resolution: 1.9dppx),
|
||||
(min-resolution: 144dpi) and (max-resolution: 191dpi)
|
||||
{
|
||||
.toolbar__icon, .menu__icon {
|
||||
background-image: url(resources/{{{escaped_image}}});
|
||||
background-size: {{scaled width 1.5}}px auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/spritesheet}}
|
After Width: | Height: | Size: 320 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/arrange-back.png
Normal file
After Width: | Height: | Size: 175 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/arrange-backward.png
Normal file
After Width: | Height: | Size: 156 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/arrange-forward.png
Normal file
After Width: | Height: | Size: 156 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/arrange-front.png
Normal file
After Width: | Height: | Size: 186 B |
|
@ -0,0 +1,12 @@
|
|||
{{#spritesheet}}
|
||||
@media only screen {
|
||||
@media (-webkit-min-device-pixel-ratio: 1.5),
|
||||
(min-resolution: 1.5dppx), (min-resolution: 144dpi)
|
||||
{
|
||||
.x-huge .toolbar__icon {
|
||||
background-image: url(resources/{{{escaped_image}}});
|
||||
background-size: {{scaled width 1.5}}px auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/spritesheet}}
|
BIN
apps/common/main/resources/img/toolbar/1.5x/big/btn-compare.png
Normal file
After Width: | Height: | Size: 201 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/big/btn-controls.png
Normal file
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 203 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/big/btn-ic-chat.png
Normal file
After Width: | Height: | Size: 355 B |
After Width: | Height: | Size: 645 B |
After Width: | Height: | Size: 623 B |
After Width: | Height: | Size: 426 B |
After Width: | Height: | Size: 617 B |
After Width: | Height: | Size: 997 B |
After Width: | Height: | Size: 167 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/big/btn-img-bkwd.png
Normal file
After Width: | Height: | Size: 173 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/big/btn-img-frwd.png
Normal file
After Width: | Height: | Size: 173 B |
After Width: | Height: | Size: 184 B |
After Width: | Height: | Size: 233 B |
After Width: | Height: | Size: 532 B |
After Width: | Height: | Size: 407 B |
After Width: | Height: | Size: 423 B |
After Width: | Height: | Size: 562 B |
After Width: | Height: | Size: 151 B |
After Width: | Height: | Size: 282 B |
After Width: | Height: | Size: 154 B |
After Width: | Height: | Size: 275 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/big/btn-pagesize.png
Normal file
After Width: | Height: | Size: 230 B |
After Width: | Height: | Size: 169 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/big/btn-symbol.png
Normal file
After Width: | Height: | Size: 624 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/big/btn-text.png
Normal file
After Width: | Height: | Size: 168 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/big/btn-textart.png
Normal file
After Width: | Height: | Size: 645 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/btn-align-bottom.png
Normal file
After Width: | Height: | Size: 158 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/btn-align-center.png
Normal file
After Width: | Height: | Size: 112 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/btn-align-just.png
Normal file
After Width: | Height: | Size: 102 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/btn-align-left.png
Normal file
After Width: | Height: | Size: 114 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/btn-align-middle.png
Normal file
After Width: | Height: | Size: 188 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/btn-align-right.png
Normal file
After Width: | Height: | Size: 113 B |
BIN
apps/common/main/resources/img/toolbar/1.5x/btn-align-top.png
Normal file
After Width: | Height: | Size: 159 B |