Compare commits
7 commits
master
...
feature/sp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88a7d76b9c | ||
|
|
d4574ef39c | ||
|
|
af6e58fd87 | ||
|
|
10b2d8e5b2 | ||
|
|
8c8a562637 | ||
|
|
8a0ade63f5 | ||
|
|
93ba07adeb |
1
.gitignore
vendored
|
|
@ -3,7 +3,6 @@ Thumbs.db
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/deploy
|
/deploy
|
||||||
build/node_modules
|
build/node_modules
|
||||||
build/plugins/**/node_modules/
|
|
||||||
build/sprites/node_modules/
|
build/sprites/node_modules/
|
||||||
vendor/framework7-react/
|
vendor/framework7-react/
|
||||||
apps/documenteditor/embed/resources/less/node_modules
|
apps/documenteditor/embed/resources/less/node_modules
|
||||||
|
|
|
||||||
16
Readme.md
|
|
@ -2,23 +2,25 @@
|
||||||
|
|
||||||
## web-apps
|
## web-apps
|
||||||
|
|
||||||
The frontend for [ONLYOFFICE Document Server][2] and [ONLYOFFICE Desktop Editors](https://github.com/ONLYOFFICE/DesktopEditors). Builds the program interface and allows the user create, edit, save and export text documents, spreadsheets, and presentations.
|
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.
|
||||||
|
|
||||||
## Previous versions
|
## Previous versions
|
||||||
|
|
||||||
Until 2019-10-23 the repository was called web-apps-pro.
|
Until 2019-10-23 the repository was called web-apps-pro
|
||||||
|
|
||||||
## Project information
|
## Project Information
|
||||||
|
|
||||||
Official website: [https://www.onlyoffice.com/](https://www.onlyoffice.com "https://www.onlyoffice.com")
|
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")
|
Code repository: [https://github.com/ONLYOFFICE/web-apps](https://github.com/ONLYOFFICE/web-apps "https://github.com/ONLYOFFICE/web-apps")
|
||||||
|
|
||||||
## User feedback and support
|
SaaS version: [http://www.onlyoffice.com](http://www.onlyoffice.com "http://www.onlyoffice.com")
|
||||||
|
|
||||||
If you have any problems with or questions about [ONLYOFFICE Document Server][2], please visit our official forum: [forum.onlyoffice.com][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][3].
|
## User Feedback and Support
|
||||||
|
|
||||||
[1]: https://forum.onlyoffice.com
|
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
|
[2]: https://github.com/ONLYOFFICE/DocumentServer
|
||||||
[3]: http://stackoverflow.com/questions/tagged/onlyoffice
|
[3]: http://stackoverflow.com/questions/tagged/onlyoffice
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,7 @@
|
||||||
view: ["Group1", ""] // current user can view comments made by users from Group1 and users without a group.
|
view: ["Group1", ""] // current user can view comments made by users from Group1 and users without a group.
|
||||||
edit: ["Group1", ""] // current user can edit comments made by users from Group1 and users without a group.
|
edit: ["Group1", ""] // current user can edit comments made by users from Group1 and users without a group.
|
||||||
remove: ["Group1", ""] // current user can remove comments made by users from Group1 and users without a group.
|
remove: ["Group1", ""] // current user can remove comments made by users from Group1 and users without a group.
|
||||||
},
|
}
|
||||||
userInfoGroups: ["Group1", ""], // show tooltips/cursors/info in header only for users in userInfoGroups groups. [""] - means users without group, [] - don't show any users, null/undefined/"" - show all users
|
|
||||||
protect: <can protect document> // default = true. show/hide protect tab or protect buttons
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
editorConfig: {
|
editorConfig: {
|
||||||
|
|
@ -85,7 +83,7 @@
|
||||||
user: {
|
user: {
|
||||||
id: 'user id',
|
id: 'user id',
|
||||||
name: 'user name',
|
name: 'user name',
|
||||||
group: 'group name' // for customization.reviewPermissions or permissions.reviewGroups or permissions.commentGroups. Can be multiple groups separated by commas (,) : 'Group1' or 'Group1,Group2'
|
group: 'group name' // for customization.reviewPermissions parameter
|
||||||
},
|
},
|
||||||
recent: [
|
recent: [
|
||||||
{
|
{
|
||||||
|
|
@ -106,8 +104,7 @@
|
||||||
customization: {
|
customization: {
|
||||||
logo: {
|
logo: {
|
||||||
image: url,
|
image: url,
|
||||||
imageDark: url, // logo for dark theme
|
imageEmbedded: url,
|
||||||
imageEmbedded: url, // deprecated, use image instead
|
|
||||||
url: http://...
|
url: http://...
|
||||||
},
|
},
|
||||||
customer: {
|
customer: {
|
||||||
|
|
@ -115,10 +112,8 @@
|
||||||
address: 'New-York, 125f-25',
|
address: 'New-York, 125f-25',
|
||||||
mail: 'support@gmail.com',
|
mail: 'support@gmail.com',
|
||||||
www: 'www.superpuper.com',
|
www: 'www.superpuper.com',
|
||||||
phone: '1234567890',
|
|
||||||
info: 'Some info',
|
info: 'Some info',
|
||||||
logo: '',
|
logo: ''
|
||||||
logoDark: '', // logo for dark theme
|
|
||||||
},
|
},
|
||||||
about: true,
|
about: true,
|
||||||
feedback: {
|
feedback: {
|
||||||
|
|
@ -140,90 +135,39 @@
|
||||||
request: bool (default: true), // enable set name
|
request: bool (default: true), // enable set name
|
||||||
label: string (default: "Guest") // postfix for user name
|
label: string (default: "Guest") // postfix for user name
|
||||||
},
|
},
|
||||||
review: {
|
|
||||||
hideReviewDisplay: false, // hide button Review mode
|
|
||||||
hoverMode: false, // true - show review balloons on mouse move, not on click on text
|
|
||||||
showReviewChanges: false,
|
|
||||||
reviewDisplay: 'original', // original for viewer, markup for editor
|
|
||||||
trackChanges: undefined // true/false - open editor with track changes mode on/off,
|
|
||||||
},
|
|
||||||
layout: { // hide elements, but don't disable feature
|
|
||||||
toolbar: {
|
|
||||||
file: { // menu file
|
|
||||||
close: false / true, // close menu button
|
|
||||||
settings: false / true, // advanced settings
|
|
||||||
info: false / true // document info
|
|
||||||
save: false/true // save button
|
|
||||||
} / false / true,
|
|
||||||
home: {
|
|
||||||
mailmerge: false/true // mail merge button
|
|
||||||
},
|
|
||||||
layout: false / true, // layout tab
|
|
||||||
references: false / true, // de references tab
|
|
||||||
collaboration: false / true // collaboration tab
|
|
||||||
protect: false / true, // protect tab
|
|
||||||
plugins: false / true // plugins tab
|
|
||||||
view: {
|
|
||||||
navigation: false/true // navigation button in de
|
|
||||||
} / false / true, // view tab
|
|
||||||
save: false/true // save button on toolbar in
|
|
||||||
} / false / true, // use instead of customization.toolbar,
|
|
||||||
header: {
|
|
||||||
users: false/true // users list button
|
|
||||||
save: false/true // save button
|
|
||||||
},
|
|
||||||
leftMenu: {
|
|
||||||
navigation: false/true,
|
|
||||||
spellcheck: false/true // spellcheck button in sse
|
|
||||||
} / false / true, // use instead of customization.leftMenu
|
|
||||||
rightMenu: false/true, // use instead of customization.rightMenu
|
|
||||||
statusBar: {
|
|
||||||
textLang: false/true // text language button in de/pe
|
|
||||||
docLang: false/true // document language button in de/pe
|
|
||||||
actionStatus: false/true // status of operation
|
|
||||||
} / false / true, // use instead of customization.statusBar
|
|
||||||
},
|
|
||||||
features: { // disable feature
|
|
||||||
spellcheck: {
|
|
||||||
mode: false/true // init value in de/pe
|
|
||||||
change: false/true // hide/show feature in de/pe/sse
|
|
||||||
} / false / true // if false/true - use as init value in de/pe. use instead of customization.spellcheck parameter
|
|
||||||
},
|
|
||||||
chat: true,
|
chat: true,
|
||||||
comments: true,
|
comments: true,
|
||||||
zoom: 100,
|
zoom: 100,
|
||||||
compactToolbar: false,
|
compactToolbar: false,
|
||||||
leftMenu: true, // must be deprecated. use layout.leftMenu instead
|
leftMenu: true,
|
||||||
rightMenu: true, // must be deprecated. use layout.rightMenu instead
|
rightMenu: true,
|
||||||
hideRightMenu: false, // hide or show right panel on first loading
|
hideRightMenu: false, // hide or show right panel on first loading
|
||||||
toolbar: true, // must be deprecated. use layout.toolbar instead
|
toolbar: true,
|
||||||
statusBar: true, // must be deprecated. use layout.statusBar instead
|
statusBar: true,
|
||||||
autosave: true,
|
autosave: true,
|
||||||
forcesave: false,
|
forcesave: false,
|
||||||
commentAuthorOnly: false, // must be deprecated. use permissions.editCommentAuthorOnly and permissions.deleteCommentAuthorOnly instead
|
commentAuthorOnly: false, // must be deprecated. use permissions.editCommentAuthorOnly and permissions.deleteCommentAuthorOnly instead
|
||||||
showReviewChanges: false, // must be deprecated. use customization.review.showReviewChanges instead
|
showReviewChanges: false,
|
||||||
help: true,
|
help: true,
|
||||||
compactHeader: false,
|
compactHeader: false,
|
||||||
toolbarNoTabs: false,
|
toolbarNoTabs: false,
|
||||||
toolbarHideFileName: false,
|
toolbarHideFileName: false,
|
||||||
reviewDisplay: 'original', // must be deprecated. use customization.review.reviewDisplay instead
|
reviewDisplay: 'original',
|
||||||
spellcheck: true, // must be deprecated. use customization.features.spellcheck instead
|
spellcheck: true,
|
||||||
compatibleFeatures: false,
|
compatibleFeatures: false,
|
||||||
unit: 'cm' // cm, pt, inch,
|
unit: 'cm' // cm, pt, inch,
|
||||||
mentionShare : true // customize tooltip for mention,
|
mentionShare : true // customize tooltip for mention,
|
||||||
macros: true // can run macros in document
|
macros: true // can run macros in document
|
||||||
plugins: true // can run plugins in document
|
plugins: true // can run plugins in document
|
||||||
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn',
|
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn',
|
||||||
trackChanges: undefined // true/false - open editor with track changes mode on/off, // must be deprecated. use customization.review.trackChanges instead
|
trackChanges: undefined // true/false - open editor with track changes mode on/off,
|
||||||
hideRulers: false // hide or show rulers on first loading (presentation or document editor)
|
hideRulers: false // hide or show rulers on first loading (presentation or document editor)
|
||||||
hideNotes: false // hide or show notes panel on first loading (presentation editor)
|
hideNotes: false // hide or show notes panel on first loading (presentation editor)
|
||||||
uiTheme: 'theme-dark' // set interface theme: id or default-dark/default-light
|
uiTheme: 'theme-dark' // set interface theme: id or default-dark/default-light
|
||||||
integrationMode: "embed" // turn off scroll to frame
|
|
||||||
},
|
},
|
||||||
coEditing: {
|
coEditing: {
|
||||||
mode: 'fast', // <coauthoring mode>, 'fast' or 'strict'. if 'fast' and 'customization.autosave'=false -> set 'customization.autosave'=true. 'fast' - default for editor
|
mode: 'fast', // <coauthoring mode>, 'fast' or 'strict'. if 'fast' and 'customization.autosave'=false -> set 'customization.autosave'=true
|
||||||
// for viewer: 'strict' is default, offline viewer; 'fast' - live viewer, show changes from other users
|
change: true, // can change co-authoring mode
|
||||||
change: true, // can change co-authoring mode. true - default for editor, false - default for viewer
|
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
|
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
|
||||||
|
|
@ -375,6 +319,36 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var _callLocalStorage = function(data) {
|
||||||
|
if (data.cmd == 'get') {
|
||||||
|
if (data.keys && data.keys.length) {
|
||||||
|
var af = data.keys.split(','), re = af[0];
|
||||||
|
for (i = 0; ++i < af.length;)
|
||||||
|
re += '|' + af[i];
|
||||||
|
|
||||||
|
re = new RegExp(re); k = {};
|
||||||
|
for (i in localStorage)
|
||||||
|
if (re.test(i)) k[i] = localStorage[i];
|
||||||
|
} else {
|
||||||
|
k = localStorage;
|
||||||
|
}
|
||||||
|
|
||||||
|
_sendCommand({
|
||||||
|
command: 'internalCommand',
|
||||||
|
data: {
|
||||||
|
type: 'localstorage',
|
||||||
|
keys: k
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else
|
||||||
|
if (data.cmd == 'set') {
|
||||||
|
var k = data.keys, i;
|
||||||
|
for (i in k) {
|
||||||
|
localStorage.setItem(i, k[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var _onMessage = function(msg) {
|
var _onMessage = function(msg) {
|
||||||
if ( msg ) {
|
if ( msg ) {
|
||||||
if ( msg.type === "onExternalPluginMessage" ) {
|
if ( msg.type === "onExternalPluginMessage" ) {
|
||||||
|
|
@ -389,6 +363,8 @@
|
||||||
|
|
||||||
if (msg.event === 'onRequestEditRights' && !handler) {
|
if (msg.event === 'onRequestEditRights' && !handler) {
|
||||||
_applyEditRights(false, 'handler isn\'t defined');
|
_applyEditRights(false, 'handler isn\'t defined');
|
||||||
|
} else if (msg.event === 'onInternalMessage' && msg.data && msg.data.type == 'localstorage') {
|
||||||
|
_callLocalStorage(msg.data.data);
|
||||||
} else {
|
} else {
|
||||||
if (msg.event === 'onAppReady') {
|
if (msg.event === 'onAppReady') {
|
||||||
_onAppReady();
|
_onAppReady();
|
||||||
|
|
@ -435,7 +411,7 @@
|
||||||
|
|
||||||
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
|
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
|
||||||
_config.document.fileType = _config.document.fileType.toLowerCase();
|
_config.document.fileType = _config.document.fileType.toLowerCase();
|
||||||
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots|xlsb)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|oxps|docm|dot|dotm|dotx|fodt|ott|fb2|xml|oform|docxf))$/
|
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott|fb2|xml))$/
|
||||||
.exec(_config.document.fileType);
|
.exec(_config.document.fileType);
|
||||||
if (!type) {
|
if (!type) {
|
||||||
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
|
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
|
||||||
|
|
@ -447,7 +423,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var type = /^(?:(pdf|djvu|xps|oxps))$/.exec(_config.document.fileType);
|
var type = /^(?:(pdf|djvu|xps))$/.exec(_config.document.fileType);
|
||||||
if (type && typeof type[1] === 'string') {
|
if (type && typeof type[1] === 'string') {
|
||||||
_config.editorConfig.canUseHistory = false;
|
_config.editorConfig.canUseHistory = false;
|
||||||
}
|
}
|
||||||
|
|
@ -491,9 +467,6 @@
|
||||||
|
|
||||||
if (target && _checkConfigParams()) {
|
if (target && _checkConfigParams()) {
|
||||||
iframe = createIframe(_config);
|
iframe = createIframe(_config);
|
||||||
if (_config.editorConfig.customization && _config.editorConfig.customization.integrationMode==='embed')
|
|
||||||
window.AscEmbed && window.AscEmbed.initWorker(iframe);
|
|
||||||
|
|
||||||
if (iframe.src) {
|
if (iframe.src) {
|
||||||
var pathArray = iframe.src.split('/');
|
var pathArray = iframe.src.split('/');
|
||||||
this.frameOrigin = pathArray[0] + '//' + pathArray[2];
|
this.frameOrigin = pathArray[0] + '//' + pathArray[2];
|
||||||
|
|
@ -858,24 +831,9 @@
|
||||||
return extensionParams["url"] + "apps/";
|
return extensionParams["url"] + "apps/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getTestPath() {
|
|
||||||
var scripts = document.getElementsByTagName('script'),
|
|
||||||
match;
|
|
||||||
|
|
||||||
for (var i = scripts.length - 1; i >= 0; i--) {
|
|
||||||
match = scripts[i].src.match(/(.*)apps\/api\/documents\/api.js/i);
|
|
||||||
if (match) {
|
|
||||||
return match[1] + "test/";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAppPath(config) {
|
function getAppPath(config) {
|
||||||
var extensionPath = getExtensionPath(),
|
var extensionPath = getExtensionPath(),
|
||||||
path = extensionPath ? extensionPath : (config.type=="test" ? getTestPath() : getBasePath()),
|
path = extensionPath ? extensionPath : getBasePath(),
|
||||||
appMap = {
|
appMap = {
|
||||||
'text': 'documenteditor',
|
'text': 'documenteditor',
|
||||||
'text-pdf': 'documenteditor',
|
'text-pdf': 'documenteditor',
|
||||||
|
|
@ -891,7 +849,7 @@
|
||||||
app = appMap[config.documentType.toLowerCase()];
|
app = appMap[config.documentType.toLowerCase()];
|
||||||
} else
|
} else
|
||||||
if (!!config.document && typeof config.document.fileType === 'string') {
|
if (!!config.document && typeof config.document.fileType === 'string') {
|
||||||
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots|xlsb)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp))$/
|
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp))$/
|
||||||
.exec(config.document.fileType);
|
.exec(config.document.fileType);
|
||||||
if (type) {
|
if (type) {
|
||||||
if (typeof type[1] === 'string') app = appMap['cell']; else
|
if (typeof type[1] === 'string') app = appMap['cell']; else
|
||||||
|
|
@ -903,23 +861,23 @@
|
||||||
check = function(regex){ return regex.test(userAgent); },
|
check = function(regex){ return regex.test(userAgent); },
|
||||||
isIE = !check(/opera/) && (check(/msie/) || check(/trident/) || check(/edge/)),
|
isIE = !check(/opera/) && (check(/msie/) || check(/trident/) || check(/edge/)),
|
||||||
isChrome = !isIE && check(/\bchrome\b/),
|
isChrome = !isIE && check(/\bchrome\b/),
|
||||||
isSafari_mobile = !isIE && !isChrome && check(/safari/) && (navigator.maxTouchPoints>0),
|
isSafari_mobile = !isIE && !isChrome && check(/safari/) && (navigator.maxTouchPoints>0);
|
||||||
path_type;
|
|
||||||
|
|
||||||
path += app + "/";
|
path += app + "/";
|
||||||
path_type = (config.type === "mobile" || isSafari_mobile)
|
path += (config.type === "mobile" || isSafari_mobile)
|
||||||
? "mobile" : (config.type === "embedded")
|
? "mobile"
|
||||||
? "embed" : (config.document && typeof config.document.fileType === 'string' && config.document.fileType.toLowerCase() === 'oform')
|
: (config.type === "embedded" || (app=='documenteditor') && config.document && config.document.permissions && (config.document.permissions.fillForms===true) &&
|
||||||
? "forms" : "main";
|
(config.document.permissions.edit === false) && (config.document.permissions.review !== true) && (config.editorConfig.mode !== 'view'))
|
||||||
|
? "embed"
|
||||||
|
: "main";
|
||||||
|
|
||||||
path += path_type;
|
|
||||||
var index = "/index.html";
|
var index = "/index.html";
|
||||||
if (config.editorConfig && path_type!=="forms") {
|
if (config.editorConfig) {
|
||||||
var customization = config.editorConfig.customization;
|
var customization = config.editorConfig.customization;
|
||||||
if ( typeof(customization) == 'object' && ( customization.toolbarNoTabs ||
|
if ( typeof(customization) == 'object' && ( customization.toolbarNoTabs ||
|
||||||
(config.editorConfig.targetApp!=='desktop') && (customization.loaderName || customization.loaderLogo))) {
|
(config.editorConfig.targetApp!=='desktop') && (customization.loaderName || customization.loaderLogo))) {
|
||||||
index = "/index_loader.html";
|
index = "/index_loader.html";
|
||||||
} else if (config.editorConfig.mode === 'editdiagram' || config.editorConfig.mode === 'editmerge' || config.editorConfig.mode === 'editole')
|
} else if (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge')
|
||||||
index = "/index_internal.html";
|
index = "/index_internal.html";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -935,25 +893,20 @@
|
||||||
|
|
||||||
if (config.editorConfig && config.editorConfig.targetApp!=='desktop') {
|
if (config.editorConfig && config.editorConfig.targetApp!=='desktop') {
|
||||||
if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.loaderName) {
|
if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.loaderName) {
|
||||||
if (config.editorConfig.customization.loaderName !== 'none') params += "&customer=" + encodeURIComponent(config.editorConfig.customization.loaderName);
|
if (config.editorConfig.customization.loaderName !== 'none') params += "&customer=" + config.editorConfig.customization.loaderName;
|
||||||
} else
|
} else
|
||||||
params += "&customer={{APP_CUSTOMER_NAME}}";
|
params += "&customer={{APP_CUSTOMER_NAME}}";
|
||||||
if (typeof(config.editorConfig.customization) == 'object') {
|
if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.loaderLogo) {
|
||||||
if ( config.editorConfig.customization.loaderLogo && config.editorConfig.customization.loaderLogo !== '') {
|
if (config.editorConfig.customization.loaderLogo !== '') params += "&logo=" + config.editorConfig.customization.loaderLogo;
|
||||||
params += "&logo=" + encodeURIComponent(config.editorConfig.customization.loaderLogo);
|
} else if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.logo) {
|
||||||
}
|
if (config.type=='embedded' && config.editorConfig.customization.logo.imageEmbedded)
|
||||||
if ( config.editorConfig.customization.logo ) {
|
params += "&headerlogo=" + config.editorConfig.customization.logo.imageEmbedded;
|
||||||
if (config.type=='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded))
|
else if (config.type!='embedded' && config.editorConfig.customization.logo.image)
|
||||||
params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded);
|
params += "&headerlogo=" + config.editorConfig.customization.logo.image;
|
||||||
else if (config.type!='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageDark)) {
|
|
||||||
config.editorConfig.customization.logo.image && (params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image));
|
|
||||||
config.editorConfig.customization.logo.imageDark && (params += "&headerlogodark=" + encodeURIComponent(config.editorConfig.customization.logo.imageDark));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.editorConfig && (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge' || config.editorConfig.mode == 'editole'))
|
if (config.editorConfig && (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge'))
|
||||||
params += "&internal=true";
|
params += "&internal=true";
|
||||||
|
|
||||||
if (config.frameEditorId)
|
if (config.frameEditorId)
|
||||||
|
|
@ -968,6 +921,8 @@
|
||||||
|
|
||||||
if (config.editorConfig && config.editorConfig.customization && (config.editorConfig.customization.toolbar===false))
|
if (config.editorConfig && config.editorConfig.customization && (config.editorConfig.customization.toolbar===false))
|
||||||
params += "&toolbar=false";
|
params += "&toolbar=false";
|
||||||
|
else if (config.document && config.document.permissions && (config.document.permissions.edit === false && config.document.permissions.fillForms ))
|
||||||
|
params += "&toolbar=true";
|
||||||
|
|
||||||
if (config.parentOrigin)
|
if (config.parentOrigin)
|
||||||
params += "&parentOrigin=" + config.parentOrigin;
|
params += "&parentOrigin=" + config.parentOrigin;
|
||||||
|
|
@ -987,11 +942,10 @@
|
||||||
iframe.align = "top";
|
iframe.align = "top";
|
||||||
iframe.frameBorder = 0;
|
iframe.frameBorder = 0;
|
||||||
iframe.name = "frameEditor";
|
iframe.name = "frameEditor";
|
||||||
config.title && (typeof config.title === 'string') && (iframe.title = config.title);
|
|
||||||
iframe.allowFullscreen = true;
|
iframe.allowFullscreen = true;
|
||||||
iframe.setAttribute("allowfullscreen",""); // for IE11
|
iframe.setAttribute("allowfullscreen",""); // for IE11
|
||||||
iframe.setAttribute("onmousewheel",""); // for Safari on Mac
|
iframe.setAttribute("onmousewheel",""); // for Safari on Mac
|
||||||
iframe.setAttribute("allow", "autoplay; camera; microphone; display-capture; clipboard-write;");
|
iframe.setAttribute("allow", "autoplay; camera; microphone; display-capture");
|
||||||
|
|
||||||
if (config.type == "mobile")
|
if (config.type == "mobile")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,6 @@
|
||||||
},
|
},
|
||||||
mode : urlParams["mode"] || 'edit',
|
mode : urlParams["mode"] || 'edit',
|
||||||
lang : urlParams["lang"] || 'en',
|
lang : urlParams["lang"] || 'en',
|
||||||
createUrl : 'desktop://create.new',
|
|
||||||
user: {
|
user: {
|
||||||
id: urlParams["userid"] || urlParams["username"] || 'uid-901', name: urlParams["username"] || 'Chuk.Gek'
|
id: urlParams["userid"] || urlParams["username"] || 'uid-901', name: urlParams["username"] || 'Chuk.Gek'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ div {
|
||||||
<div id="iframeEditor">
|
<div id="iframeEditor">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="../../../web-apps/apps/api/documents/api.js"></script>
|
<script type="text/javascript" src="../../web-apps/apps/api/documents/api.js"></script>
|
||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript">
|
||||||
|
|
||||||
var docEditor;
|
var docEditor;
|
||||||
|
|
@ -102,7 +102,6 @@ div {
|
||||||
var sendNotificationTimer;
|
var sendNotificationTimer;
|
||||||
var sessionId;
|
var sessionId;
|
||||||
var fileInfo;
|
var fileInfo;
|
||||||
var insertImageType;
|
|
||||||
|
|
||||||
var innerAlert = function (message) {
|
var innerAlert = function (message) {
|
||||||
if (console && console.log)
|
if (console && console.log)
|
||||||
|
|
@ -118,12 +117,6 @@ div {
|
||||||
innerAlert('Grab_Focus');
|
innerAlert('Grab_Focus');
|
||||||
docEditor.grabFocus();
|
docEditor.grabFocus();
|
||||||
},
|
},
|
||||||
'Action_InsertGraphic': function (data) {
|
|
||||||
data && data.Values && docEditor.insertImage({
|
|
||||||
"c": insertImageType,
|
|
||||||
"images": [{ "url": data.Values.url }]
|
|
||||||
});
|
|
||||||
},
|
|
||||||
'Host_PostmessageReady': function (data) {
|
'Host_PostmessageReady': function (data) {
|
||||||
innerAlert('Host_PostmessageReady');
|
innerAlert('Host_PostmessageReady');
|
||||||
}
|
}
|
||||||
|
|
@ -233,11 +226,6 @@ div {
|
||||||
window.open(fileInfo.FileVersionUrl, "_blank");
|
window.open(fileInfo.FileVersionUrl, "_blank");
|
||||||
};
|
};
|
||||||
|
|
||||||
var onRequestInsertImage = function (event) {
|
|
||||||
insertImageType = event.data.c;
|
|
||||||
_postMessage('UI_InsertGraphic', {});
|
|
||||||
};
|
|
||||||
|
|
||||||
var onError = function (event) {
|
var onError = function (event) {
|
||||||
if (event)
|
if (event)
|
||||||
innerAlert(event.data);
|
innerAlert(event.data);
|
||||||
|
|
@ -248,7 +236,6 @@ div {
|
||||||
fileInfo = <%- JSON.stringify(fileInfo) %>;
|
fileInfo = <%- JSON.stringify(fileInfo) %>;
|
||||||
|
|
||||||
var key = "<%- key %>";
|
var key = "<%- key %>";
|
||||||
var documentType = "<%- documentType %>";
|
|
||||||
var userAuth = <%- JSON.stringify(userAuth) %>;
|
var userAuth = <%- JSON.stringify(userAuth) %>;
|
||||||
var token = "<%- token %>";
|
var token = "<%- token %>";
|
||||||
var queryParams = <%- JSON.stringify(queryParams) %>;
|
var queryParams = <%- JSON.stringify(queryParams) %>;
|
||||||
|
|
@ -262,8 +249,8 @@ div {
|
||||||
var config = {
|
var config = {
|
||||||
"width": "100%",
|
"width": "100%",
|
||||||
"height": "100%",
|
"height": "100%",
|
||||||
"type": queryParams.embed==="1" ? "embedded" : "desktop",
|
"type": "desktop",
|
||||||
"documentType": documentType,
|
"documentType": queryParams.documenttype,
|
||||||
"token": token,
|
"token": token,
|
||||||
"document": {
|
"document": {
|
||||||
"title": fileInfo.BreadcrumbDocName || fileInfo.BaseFileName,
|
"title": fileInfo.BreadcrumbDocName || fileInfo.BaseFileName,
|
||||||
|
|
@ -281,7 +268,7 @@ div {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"editorConfig": {
|
"editorConfig": {
|
||||||
"mode": userAuth.mode,
|
"mode": queryParams.mode,
|
||||||
"lang": queryParams.lang || queryParams.ui || "en-US",
|
"lang": queryParams.lang || queryParams.ui || "en-US",
|
||||||
"region": queryParams.rs,
|
"region": queryParams.rs,
|
||||||
"callbackUrl": JSON.stringify(userAuth),
|
"callbackUrl": JSON.stringify(userAuth),
|
||||||
|
|
@ -302,7 +289,7 @@ div {
|
||||||
"uiTheme": queryParams.thm==="1" ? "default-light" : (queryParams.thm==="2" ? "default-dark" : undefined)
|
"uiTheme": queryParams.thm==="1" ? "default-light" : (queryParams.thm==="2" ? "default-dark" : undefined)
|
||||||
},
|
},
|
||||||
"coEditing": {
|
"coEditing": {
|
||||||
"mode": userAuth.mode !== "view" ? "fast" : "strict",
|
"mode": "fast",
|
||||||
"change": false
|
"change": false
|
||||||
},
|
},
|
||||||
"wopi": {
|
"wopi": {
|
||||||
|
|
@ -317,12 +304,11 @@ div {
|
||||||
"onRequestClose": fileInfo.ClosePostMessage || fileInfo.CloseUrl ? onRequestClose : undefined,
|
"onRequestClose": fileInfo.ClosePostMessage || fileInfo.CloseUrl ? onRequestClose : undefined,
|
||||||
"onRequestRename": fileInfo.SupportsRename && fileInfo.UserCanRename ? onRequestRename : undefined,
|
"onRequestRename": fileInfo.SupportsRename && fileInfo.UserCanRename ? onRequestRename : undefined,
|
||||||
"onRequestSharingSettings": fileInfo.FileSharingPostMessage || fileInfo.FileSharingUrl ? onRequestSharingSettings : undefined,
|
"onRequestSharingSettings": fileInfo.FileSharingPostMessage || fileInfo.FileSharingUrl ? onRequestSharingSettings : undefined,
|
||||||
"onRequestHistory": fileInfo.FileVersionUrl || fileInfo.FileVersionPostMessage ? onRequestHistory : undefined,
|
"onRequestHistory": fileInfo.FileVersionUrl || fileInfo.FileVersionPostMessage ? onRequestHistory : undefined
|
||||||
"onRequestInsertImage": fileInfo.EnableInsertRemoteImage ? onRequestInsertImage : undefined
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
postMessageOrigin = fileInfo.PostMessageOrigin || "*";
|
postMessageOrigin = fileInfo.PostMessageOrigin;
|
||||||
if (postMessageOrigin && (typeof postMessageOrigin === 'string') && postMessageOrigin.charAt(postMessageOrigin.length-1)=='/')
|
if (postMessageOrigin && (typeof postMessageOrigin === 'string') && postMessageOrigin.charAt(postMessageOrigin.length-1)=='/')
|
||||||
postMessageOrigin = postMessageOrigin.substring(0, postMessageOrigin.length - 1);
|
postMessageOrigin = postMessageOrigin.substring(0, postMessageOrigin.length - 1);
|
||||||
lang = config.editorConfig.lang;
|
lang = config.editorConfig.lang;
|
||||||
|
|
|
||||||
|
|
@ -203,13 +203,12 @@ if (window.Common === undefined) {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
requestRestore: function(version, url, fileType) {
|
requestRestore: function(version, url) {
|
||||||
_postMessage({
|
_postMessage({
|
||||||
event: 'onRequestRestore',
|
event: 'onRequestRestore',
|
||||||
data: {
|
data: {
|
||||||
version: version,
|
version: version,
|
||||||
url: url,
|
url: url
|
||||||
fileType: fileType
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -274,23 +273,19 @@ if (window.Common === undefined) {
|
||||||
_postMessage({ event: 'onOutdatedVersion' });
|
_postMessage({ event: 'onOutdatedVersion' });
|
||||||
},
|
},
|
||||||
|
|
||||||
downloadAs: function(url, fileType) {
|
downloadAs: function(url) {
|
||||||
_postMessage({
|
_postMessage({
|
||||||
event: 'onDownloadAs',
|
event: 'onDownloadAs',
|
||||||
data: {
|
data: url
|
||||||
url: url,
|
|
||||||
fileType: fileType
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
requestSaveAs: function(url, title, fileType) {
|
requestSaveAs: function(url, title) {
|
||||||
_postMessage({
|
_postMessage({
|
||||||
event: 'onRequestSaveAs',
|
event: 'onRequestSaveAs',
|
||||||
data: {
|
data: {
|
||||||
url: url,
|
url: url,
|
||||||
title: title,
|
title: title
|
||||||
fileType: fileType
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -57,16 +57,6 @@
|
||||||
|
|
||||||
$dlgShare.find('#btn-copyshort').on('click', copytext.bind(this, $dlgShare.find('#id-short-url')));
|
$dlgShare.find('#btn-copyshort').on('click', copytext.bind(this, $dlgShare.find('#id-short-url')));
|
||||||
$dlgShare.find('.share-buttons > span').on('click', function(e){
|
$dlgShare.find('.share-buttons > span').on('click', function(e){
|
||||||
if ( window.config ) {
|
|
||||||
const key = $(e.target).attr('data-name');
|
|
||||||
const btn = config.btnsShare[key];
|
|
||||||
if ( btn && btn.getUrl ) {
|
|
||||||
window.open(btn.getUrl(appConfig.shareUrl, appConfig.docTitle), btn.target || '',
|
|
||||||
btn.features || 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var _url;
|
var _url;
|
||||||
switch ($(e.target).attr('data-name')) {
|
switch ($(e.target).attr('data-name')) {
|
||||||
case 'facebook':
|
case 'facebook':
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,6 @@
|
||||||
!common.utils && (common.utils = {});
|
!common.utils && (common.utils = {});
|
||||||
|
|
||||||
common.utils = new(function(){
|
common.utils = new(function(){
|
||||||
var userAgent = navigator.userAgent.toLowerCase(),
|
|
||||||
check = function(regex){
|
|
||||||
return regex.test(userAgent);
|
|
||||||
},
|
|
||||||
isMac = check(/macintosh|mac os x/);
|
|
||||||
return {
|
return {
|
||||||
openLink: function(url) {
|
openLink: function(url) {
|
||||||
if (url) {
|
if (url) {
|
||||||
|
|
@ -97,17 +92,7 @@
|
||||||
str = num.toString();
|
str = num.toString();
|
||||||
for (var i=str.length; i<digits; i++) strfill += fill;
|
for (var i=str.length; i<digits; i++) strfill += fill;
|
||||||
return strfill + str;
|
return strfill + str;
|
||||||
},
|
}
|
||||||
getKeyByValue: function(obj, value) {
|
|
||||||
for(var prop in obj) {
|
|
||||||
if(obj.hasOwnProperty(prop)) {
|
|
||||||
if(obj[prop] === value)
|
|
||||||
return prop;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
isMac : isMac
|
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
}();
|
}();
|
||||||
|
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* (c) Copyright Ascensio System SIA 2010-2020
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SearchBar.js
|
|
||||||
*
|
|
||||||
* Created by Julia Svinareva on 27.04.2022
|
|
||||||
* Copyright (c) 2022 Ascensio System SIA. All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
!window.common && (window.common = {});
|
|
||||||
!common.view && (common.view = {});
|
|
||||||
common.view.SearchBar = new(function() {
|
|
||||||
var tpl = '<div class="asc-window search-window" style="display: none;">' +
|
|
||||||
'<div class="body">{body}</div>' +
|
|
||||||
'</div>';
|
|
||||||
var tplBody = '<input type="text" id="search-bar-text" placeholder="{textFind}" autocomplete="off">' +
|
|
||||||
'<div class="tools">' +
|
|
||||||
'<button id="search-bar-back" class="svg-icon search-arrow-up"></button>' +
|
|
||||||
'<button id="search-bar-next" class="svg-icon search-arrow-down"></button>' +
|
|
||||||
'<button id="search-bar-close" class="svg-icon search-close"></button>' +
|
|
||||||
'</div>';
|
|
||||||
|
|
||||||
return {
|
|
||||||
create: function(parent) {
|
|
||||||
!parent && (parent = 'body');
|
|
||||||
|
|
||||||
var _$dlg = $(tpl
|
|
||||||
.replace(/\{body}/, tplBody)
|
|
||||||
.replace(/\{textFind}/, this.textFind))
|
|
||||||
.appendTo(parent)
|
|
||||||
.attr('id', 'dlg-search');
|
|
||||||
|
|
||||||
return _$dlg;
|
|
||||||
},
|
|
||||||
|
|
||||||
disableNavButtons: function (resultNumber, allResults) {
|
|
||||||
var disable = $('#search-bar-text').val() === '' || !allResults;
|
|
||||||
$('#search-bar-back').attr({disabled: disable});
|
|
||||||
$('#search-bar-next').attr({disabled: disable});
|
|
||||||
},
|
|
||||||
|
|
||||||
textFind: 'Find'
|
|
||||||
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
|
|
@ -73,20 +73,6 @@ common.view.modals = new(function() {
|
||||||
|
|
||||||
var _$dlg;
|
var _$dlg;
|
||||||
if (name == 'share') {
|
if (name == 'share') {
|
||||||
if ( window.config && window.config.btnsShare ) {
|
|
||||||
let _btns = [];
|
|
||||||
for (const key of Object.keys(config.btnsShare))
|
|
||||||
_btns.push(`<span class="svg big-${key}" data-name="${key}"></span>`);
|
|
||||||
|
|
||||||
if ( _btns ) {
|
|
||||||
let $sharebox = $(_tplbody_share);
|
|
||||||
$sharebox.find('.autotest').prevAll().remove();
|
|
||||||
$sharebox.eq(1).prepend(_btns.join(''));
|
|
||||||
|
|
||||||
_tplbody_share = $("<div>").append($sharebox).html();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_$dlg = $(tplDialog
|
_$dlg = $(tplDialog
|
||||||
.replace(/\{title}/, this.txtShare)
|
.replace(/\{title}/, this.txtShare)
|
||||||
.replace(/\{body}/, _tplbody_share)
|
.replace(/\{body}/, _tplbody_share)
|
||||||
|
|
|
||||||
|
|
@ -1,220 +1,152 @@
|
||||||
<svg width="580" height="40" viewBox="0 0 580 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="380" height="40" viewBox="0 0 380 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<g id="icon-menu-sprite Embedded Viewer">
|
<g id="icon-menu-sprite Embedded Viewer">
|
||||||
<g id="view-settings">
|
<g id="view-settings">
|
||||||
<path id="Vector" d="M17 26H3V27H17V26Z" fill="white"/>
|
<path id="Vector" d="M17 26H3V27H17V26Z" fill="white"/>
|
||||||
<path id="Vector_2" d="M17 30H3V31H17V30Z" fill="white"/>
|
<path id="Vector_2" d="M17 30H3V31H17V30Z" fill="white"/>
|
||||||
<path id="Vector_3" d="M17 34H3V35H17V34Z" fill="white"/>
|
<path id="Vector_3" d="M17 34H3V35H17V34Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="download">
|
<g id="download">
|
||||||
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M31 22H30V33.2929L25.3536 28.6464L24.6465 29.3536L30.1465 34.8536L30.5 35.2071L30.8536 34.8536L36.3536 29.3536L35.6465 28.6464L31 33.2929V22Z" fill="white"/>
|
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M31 22H30V33.2929L25.3536 28.6464L24.6465 29.3536L30.1465 34.8536L30.5 35.2071L30.8536 34.8536L36.3536 29.3536L35.6465 28.6464L31 33.2929V22Z" fill="white"/>
|
||||||
<rect id="Rectangle 88" x="24" y="36" width="13" height="1" fill="white"/>
|
<rect id="Rectangle 88" x="24" y="36" width="13" height="1" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="share">
|
<g id="share">
|
||||||
<path id="share_2" d="M56 25C56 26.1046 55.1046 27 54 27C53.4663 27 52.9815 26.791 52.6229 26.4503L47.9076 29.3974C47.9676 29.5875 48 29.79 48 30C48 30.21 47.9676 30.4125 47.9076 30.6026L52.6229 33.5497C52.9815 33.209 53.4663 33 54 33C55.1046 33 56 33.8954 56 35C56 36.1046 55.1046 37 54 37C52.8954 37 52 36.1046 52 35C52 34.79 52.0324 34.5875 52.0924 34.3974L47.3771 31.4503C47.0185 31.791 46.5337 32 46 32C44.8954 32 44 31.1046 44 30C44 28.8954 44.8954 28 46 28C46.5337 28 47.0185 28.209 47.3771 28.5497L52.0924 25.6026C52.0324 25.4125 52 25.21 52 25C52 23.8954 52.8954 23 54 23C55.1046 23 56 23.8954 56 25Z" fill="white"/>
|
<path id="share_2" d="M56 25C56 26.1046 55.1046 27 54 27C53.4663 27 52.9815 26.791 52.6229 26.4503L47.9076 29.3974C47.9676 29.5875 48 29.79 48 30C48 30.21 47.9676 30.4125 47.9076 30.6026L52.6229 33.5497C52.9815 33.209 53.4663 33 54 33C55.1046 33 56 33.8954 56 35C56 36.1046 55.1046 37 54 37C52.8954 37 52 36.1046 52 35C52 34.79 52.0324 34.5875 52.0924 34.3974L47.3771 31.4503C47.0185 31.791 46.5337 32 46 32C44.8954 32 44 31.1046 44 30C44 28.8954 44.8954 28 46 28C46.5337 28 47.0185 28.209 47.3771 28.5497L52.0924 25.6026C52.0324 25.4125 52 25.21 52 25C52 23.8954 52.8954 23 54 23C55.1046 23 56 23.8954 56 25Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="embed ">
|
<g id="embed ">
|
||||||
<g id="embed _2">
|
<g id="embed _2">
|
||||||
<path d="M67.8536 25.3536L67.1465 24.6465L62.293 29.5L67.1465 34.3536L67.8536 33.6465L63.7072 29.5L67.8536 25.3536Z" fill="white"/>
|
<path d="M67.8536 25.3536L67.1465 24.6465L62.293 29.5L67.1465 34.3536L67.8536 33.6465L63.7072 29.5L67.8536 25.3536Z" fill="white"/>
|
||||||
<path d="M72.1465 25.3536L72.8536 24.6465L77.7072 29.5L72.8536 34.3536L72.1465 33.6465L76.293 29.5L72.1465 25.3536Z" fill="white"/>
|
<path d="M72.1465 25.3536L72.8536 24.6465L77.7072 29.5L72.8536 34.3536L72.1465 33.6465L76.293 29.5L72.1465 25.3536Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
<g id="full-screen">
|
<g id="full-screen">
|
||||||
<path id="Rectangle 81 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M93 27H87V33H93V27ZM86 26V34H94V26H86Z" fill="white"/>
|
<path id="Rectangle 81 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M93 27H87V33H93V27ZM86 26V34H94V26H86Z" fill="white"/>
|
||||||
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M86 23H83V26H84V24H86V23Z" fill="white"/>
|
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M86 23H83V26H84V24H86V23Z" fill="white"/>
|
||||||
<path id="Subtract_2" fill-rule="evenodd" clip-rule="evenodd" d="M97 26L97 23L94 23L94 24L96 24L96 26L97 26Z" fill="white"/>
|
<path id="Subtract_2" fill-rule="evenodd" clip-rule="evenodd" d="M97 26L97 23L94 23L94 24L96 24L96 26L97 26Z" fill="white"/>
|
||||||
<path id="Subtract_3" fill-rule="evenodd" clip-rule="evenodd" d="M94 37L97 37L97 34L96 34L96 36L94 36L94 37Z" fill="white"/>
|
<path id="Subtract_3" fill-rule="evenodd" clip-rule="evenodd" d="M94 37L97 37L97 34L96 34L96 36L94 36L94 37Z" fill="white"/>
|
||||||
<path id="Subtract_4" fill-rule="evenodd" clip-rule="evenodd" d="M83 34L83 37L86 37L86 36L84 36L84 34L83 34Z" fill="white"/>
|
<path id="Subtract_4" fill-rule="evenodd" clip-rule="evenodd" d="M83 34L83 37L86 37L86 36L84 36L84 34L83 34Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="zoom-in">
|
<g id="zoom-in">
|
||||||
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M111 25H110V30H105V31H110V36H111V31H116V30H111V25Z" fill="white"/>
|
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M111 25H110V30H105V31H110V36H111V31H116V30H111V25Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="zoom-out">
|
<g id="zoom-out">
|
||||||
<rect id="Rectangle 44.8" x="135" y="30" width="1" height="10" transform="rotate(90 135 30)" fill="white"/>
|
<rect id="Rectangle 44.8" x="135" y="30" width="1" height="10" transform="rotate(90 135 30)" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="scroll-to-first-sheet">
|
<g id="scroll-to-first-sheet">
|
||||||
<path id="Vector 13 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M155 25L147 30L155 35V25Z" fill="white"/>
|
<path id="Vector 13 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M155 25L147 30L155 35V25Z" fill="white"/>
|
||||||
<path id="Rectangle 225" d="M145 25H146V35H145V25Z" fill="white"/>
|
<path id="Rectangle 225" d="M145 25H146V35H145V25Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="scroll-to-last-sheet">
|
<g id="scroll-to-last-sheet">
|
||||||
<path id="Vector 13 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M165 35L173 30L165 25V35Z" fill="white"/>
|
<path id="Vector 13 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M165 35L173 30L165 25V35Z" fill="white"/>
|
||||||
<path id="Rectangle 225 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M174 35H175V25H174V35Z" fill="white"/>
|
<path id="Rectangle 225 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M174 35H175V25H174V35Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="play">
|
<g id="play">
|
||||||
<path id="Vector 8 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M185 23L198 30L185 37V23Z" fill="white"/>
|
<path id="Vector 8 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M185 23L198 30L185 37V23Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="pause">
|
<g id="pause">
|
||||||
<path id="Rectangle 81 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M205 25V35H209V25H205Z" fill="white"/>
|
<path id="Rectangle 81 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M205 25V35H209V25H205Z" fill="white"/>
|
||||||
<path id="Rectangle 81.1 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M211 25V35H215V25H211Z" fill="white"/>
|
<path id="Rectangle 81.1 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M211 25V35H215V25H211Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id=" print">
|
<g id=" print">
|
||||||
<path id="Union_3" fill-rule="evenodd" clip-rule="evenodd" d="M226 24H234V26H226V24ZM225 26V24C225 23.4477 225.448 23 226 23H234C234.552 23 235 23.4477 235 24V26H237C237.552 26 238 26.4477 238 27V33C238 33.5523 237.552 34 237 34H235V36C235 36.5523 234.552 37 234 37H226C225.448 37 225 36.5523 225 36V34H223C222.448 34 222 33.5523 222 33V27C222 26.4477 222.448 26 223 26H225ZM225 33V31C225 30.4477 225.448 30 226 30H234C234.552 30 235 30.4477 235 31V33H237V27H234H226H223V33H225ZM225 28H224V29H225V28ZM234 31H226V36H234V31ZM227 32H233V33H227V32ZM233 34H227V35H233V34Z" fill="white"/>
|
<path id="Union_3" fill-rule="evenodd" clip-rule="evenodd" d="M226 24H234V26H226V24ZM225 26V24C225 23.4477 225.448 23 226 23H234C234.552 23 235 23.4477 235 24V26H237C237.552 26 238 26.4477 238 27V33C238 33.5523 237.552 34 237 34H235V36C235 36.5523 234.552 37 234 37H226C225.448 37 225 36.5523 225 36V34H223C222.448 34 222 33.5523 222 33V27C222 26.4477 222.448 26 223 26H225ZM225 33V31C225 30.4477 225.448 30 226 30H234C234.552 30 235 30.4477 235 31V33H237V27H234H226H223V33H225ZM225 28H224V29H225V28ZM234 31H226V36H234V31ZM227 32H233V33H227V32ZM233 34H227V35H233V34Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="clear-style">
|
<g id="clear-style">
|
||||||
<path id="Union_4" fill-rule="evenodd" clip-rule="evenodd" d="M253.268 24.5608C252.291 23.5845 250.708 23.5845 249.732 24.5608L243.561 30.7324C242.584 31.7087 242.584 33.2916 243.561 34.268L245.146 35.8537L245.293 36.0002L245.5 36.0002H249.5L249.707 36.0002L255 36.0002V35.0002H250.707L255.439 30.268C256.416 29.2916 256.416 27.7087 255.439 26.7324L253.268 24.5608ZM249.293 35.0002L252.793 31.5002L248.5 27.2073L244.268 31.4395C243.682 32.0253 243.682 32.9751 244.268 33.5609L245.707 35.0002L249.293 35.0002ZM249.207 26.5002L253.5 30.7931L254.732 29.5608C255.318 28.9751 255.318 28.0253 254.732 27.4395L252.561 25.268C251.975 24.6822 251.025 24.6822 250.439 25.268L249.207 26.5002Z" fill="white"/>
|
<path id="Union_4" fill-rule="evenodd" clip-rule="evenodd" d="M253.268 24.5608C252.291 23.5845 250.708 23.5845 249.732 24.5608L243.561 30.7324C242.584 31.7087 242.584 33.2916 243.561 34.268L245.146 35.8537L245.293 36.0002L245.5 36.0002H249.5L249.707 36.0002L255 36.0002V35.0002H250.707L255.439 30.268C256.416 29.2916 256.416 27.7087 255.439 26.7324L253.268 24.5608ZM249.293 35.0002L252.793 31.5002L248.5 27.2073L244.268 31.4395C243.682 32.0253 243.682 32.9751 244.268 33.5609L245.707 35.0002L249.293 35.0002ZM249.207 26.5002L253.5 30.7931L254.732 29.5608C255.318 28.9751 255.318 28.0253 254.732 27.4395L252.561 25.268C251.975 24.6822 251.025 24.6822 250.439 25.268L249.207 26.5002Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="view-settings_2">
|
<g id="view-settings_2">
|
||||||
<path id="Vector_4" d="M17 6H3V7H17V6Z" fill="black"/>
|
<path id="Vector_4" d="M17 6H3V7H17V6Z" fill="black"/>
|
||||||
<path id="Vector_5" d="M17 10H3V11H17V10Z" fill="black"/>
|
<path id="Vector_5" d="M17 10H3V11H17V10Z" fill="black"/>
|
||||||
<path id="Vector_6" d="M17 14H3V15H17V14Z" fill="black"/>
|
<path id="Vector_6" d="M17 14H3V15H17V14Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="download_2">
|
<g id="download_2">
|
||||||
<path id="Union_5" fill-rule="evenodd" clip-rule="evenodd" d="M31 2H30V13.2929L25.3536 8.64645L24.6465 9.35355L30.1465 14.8536L30.5 15.2071L30.8536 14.8536L36.3536 9.35355L35.6465 8.64645L31 13.2929V2Z" fill="black"/>
|
<path id="Union_5" fill-rule="evenodd" clip-rule="evenodd" d="M31 2H30V13.2929L25.3536 8.64645L24.6465 9.35355L30.1465 14.8536L30.5 15.2071L30.8536 14.8536L36.3536 9.35355L35.6465 8.64645L31 13.2929V2Z" fill="black"/>
|
||||||
<rect id="Rectangle 88_2" x="24" y="16" width="13" height="1" fill="black"/>
|
<rect id="Rectangle 88_2" x="24" y="16" width="13" height="1" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="share_3">
|
<g id="share_3">
|
||||||
<path id="share_4" d="M56 5C56 6.10457 55.1046 7 54 7C53.4663 7 52.9815 6.79098 52.6229 6.45034L47.9076 9.39737C47.9676 9.58754 48 9.78999 48 10C48 10.21 47.9676 10.4125 47.9076 10.6026L52.6229 13.5497C52.9815 13.209 53.4663 13 54 13C55.1046 13 56 13.8954 56 15C56 16.1046 55.1046 17 54 17C52.8954 17 52 16.1046 52 15C52 14.79 52.0324 14.5875 52.0924 14.3974L47.3771 11.4503C47.0185 11.791 46.5337 12 46 12C44.8954 12 44 11.1046 44 10C44 8.89543 44.8954 8 46 8C46.5337 8 47.0185 8.20902 47.3771 8.54966L52.0924 5.60264C52.0324 5.41246 52 5.21001 52 5C52 3.89543 52.8954 3 54 3C55.1046 3 56 3.89543 56 5Z" fill="black"/>
|
<path id="share_4" d="M56 5C56 6.10457 55.1046 7 54 7C53.4663 7 52.9815 6.79098 52.6229 6.45034L47.9076 9.39737C47.9676 9.58754 48 9.78999 48 10C48 10.21 47.9676 10.4125 47.9076 10.6026L52.6229 13.5497C52.9815 13.209 53.4663 13 54 13C55.1046 13 56 13.8954 56 15C56 16.1046 55.1046 17 54 17C52.8954 17 52 16.1046 52 15C52 14.79 52.0324 14.5875 52.0924 14.3974L47.3771 11.4503C47.0185 11.791 46.5337 12 46 12C44.8954 12 44 11.1046 44 10C44 8.89543 44.8954 8 46 8C46.5337 8 47.0185 8.20902 47.3771 8.54966L52.0924 5.60264C52.0324 5.41246 52 5.21001 52 5C52 3.89543 52.8954 3 54 3C55.1046 3 56 3.89543 56 5Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="embed _3">
|
<g id="embed _3">
|
||||||
<g id="embed _4">
|
<g id="embed _4">
|
||||||
<path d="M67.8536 5.35359L67.1465 4.64648L62.293 9.50004L67.1465 14.3536L67.8536 13.6465L63.7072 9.50004L67.8536 5.35359Z" fill="black"/>
|
<path d="M67.8536 5.35359L67.1465 4.64648L62.293 9.50004L67.1465 14.3536L67.8536 13.6465L63.7072 9.50004L67.8536 5.35359Z" fill="black"/>
|
||||||
<path d="M72.1465 5.35359L72.8536 4.64648L77.7072 9.50004L72.8536 14.3536L72.1465 13.6465L76.293 9.50004L72.1465 5.35359Z" fill="black"/>
|
<path d="M72.1465 5.35359L72.8536 4.64648L77.7072 9.50004L72.8536 14.3536L72.1465 13.6465L76.293 9.50004L72.1465 5.35359Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
<g id="full-screen_2">
|
<g id="full-screen_2">
|
||||||
<path id="Rectangle 81 (Stroke)_3" fill-rule="evenodd" clip-rule="evenodd" d="M93 7H87V13H93V7ZM86 6V14H94V6H86Z" fill="black"/>
|
<path id="Rectangle 81 (Stroke)_3" fill-rule="evenodd" clip-rule="evenodd" d="M93 7H87V13H93V7ZM86 6V14H94V6H86Z" fill="black"/>
|
||||||
<path id="Subtract_5" fill-rule="evenodd" clip-rule="evenodd" d="M86 3H83V6H84V4H86V3Z" fill="black"/>
|
<path id="Subtract_5" fill-rule="evenodd" clip-rule="evenodd" d="M86 3H83V6H84V4H86V3Z" fill="black"/>
|
||||||
<path id="Subtract_6" fill-rule="evenodd" clip-rule="evenodd" d="M97 6L97 3L94 3L94 4L96 4L96 6L97 6Z" fill="black"/>
|
<path id="Subtract_6" fill-rule="evenodd" clip-rule="evenodd" d="M97 6L97 3L94 3L94 4L96 4L96 6L97 6Z" fill="black"/>
|
||||||
<path id="Subtract_7" fill-rule="evenodd" clip-rule="evenodd" d="M94 17L97 17L97 14L96 14L96 16L94 16L94 17Z" fill="black"/>
|
<path id="Subtract_7" fill-rule="evenodd" clip-rule="evenodd" d="M94 17L97 17L97 14L96 14L96 16L94 16L94 17Z" fill="black"/>
|
||||||
<path id="Subtract_8" fill-rule="evenodd" clip-rule="evenodd" d="M83 14L83 17L86 17L86 16L84 16L84 14L83 14Z" fill="black"/>
|
<path id="Subtract_8" fill-rule="evenodd" clip-rule="evenodd" d="M83 14L83 17L86 17L86 16L84 16L84 14L83 14Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="zoom-in_2">
|
<g id="zoom-in_2">
|
||||||
<path id="Union_6" fill-rule="evenodd" clip-rule="evenodd" d="M111 5H110V10H105V11H110V16H111V11H116V10H111V5Z" fill="black"/>
|
<path id="Union_6" fill-rule="evenodd" clip-rule="evenodd" d="M111 5H110V10H105V11H110V16H111V11H116V10H111V5Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="zoom-out_2">
|
<g id="zoom-out_2">
|
||||||
<rect id="Rectangle 44.8_2" x="135" y="10" width="1" height="10" transform="rotate(90 135 10)" fill="black"/>
|
<rect id="Rectangle 44.8_2" x="135" y="10" width="1" height="10" transform="rotate(90 135 10)" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="scroll-to-first-sheet_2">
|
<g id="scroll-to-first-sheet_2">
|
||||||
<path id="Vector 13 (Stroke)_3" fill-rule="evenodd" clip-rule="evenodd" d="M155 5L147 10L155 15V5Z" fill="black"/>
|
<path id="Vector 13 (Stroke)_3" fill-rule="evenodd" clip-rule="evenodd" d="M155 5L147 10L155 15V5Z" fill="black"/>
|
||||||
<path id="Rectangle 225_2" d="M145 5H146V15H145V5Z" fill="black"/>
|
<path id="Rectangle 225_2" d="M145 5H146V15H145V5Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="scroll-to-last-sheet_2">
|
<g id="scroll-to-last-sheet_2">
|
||||||
<path id="Vector 13 (Stroke)_4" fill-rule="evenodd" clip-rule="evenodd" d="M165 15L173 10L165 5V15Z" fill="black"/>
|
<path id="Vector 13 (Stroke)_4" fill-rule="evenodd" clip-rule="evenodd" d="M165 15L173 10L165 5V15Z" fill="black"/>
|
||||||
<path id="Rectangle 225 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M174 15H175V5H174V15Z" fill="black"/>
|
<path id="Rectangle 225 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M174 15H175V5H174V15Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="play_2">
|
<g id="play_2">
|
||||||
<path id="Vector 8 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M185 3L198 10L185 17V3Z" fill="black"/>
|
<path id="Vector 8 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M185 3L198 10L185 17V3Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="pause_2">
|
<g id="pause_2">
|
||||||
<path id="Rectangle 81 (Stroke)_4" fill-rule="evenodd" clip-rule="evenodd" d="M205 5V15H209V5H205Z" fill="black"/>
|
<path id="Rectangle 81 (Stroke)_4" fill-rule="evenodd" clip-rule="evenodd" d="M205 5V15H209V5H205Z" fill="black"/>
|
||||||
<path id="Rectangle 81.1 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M211 5V15H215V5H211Z" fill="black"/>
|
<path id="Rectangle 81.1 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M211 5V15H215V5H211Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id=" print_2">
|
<g id=" print_2">
|
||||||
<path id="Union_7" fill-rule="evenodd" clip-rule="evenodd" d="M226 4H234V6H226V4ZM225 6V4C225 3.44772 225.448 3 226 3H234C234.552 3 235 3.44772 235 4V6H237C237.552 6 238 6.44772 238 7V13C238 13.5523 237.552 14 237 14H235V16C235 16.5523 234.552 17 234 17H226C225.448 17 225 16.5523 225 16V14H223C222.448 14 222 13.5523 222 13V7C222 6.44772 222.448 6 223 6H225ZM225 13V11C225 10.4477 225.448 10 226 10H234C234.552 10 235 10.4477 235 11V13H237V7H234H226H223V13H225ZM225 8H224V9H225V8ZM234 11H226V16H234V11ZM227 12H233V13H227V12ZM233 14H227V15H233V14Z" fill="black"/>
|
<path id="Union_7" fill-rule="evenodd" clip-rule="evenodd" d="M226 4H234V6H226V4ZM225 6V4C225 3.44772 225.448 3 226 3H234C234.552 3 235 3.44772 235 4V6H237C237.552 6 238 6.44772 238 7V13C238 13.5523 237.552 14 237 14H235V16C235 16.5523 234.552 17 234 17H226C225.448 17 225 16.5523 225 16V14H223C222.448 14 222 13.5523 222 13V7C222 6.44772 222.448 6 223 6H225ZM225 13V11C225 10.4477 225.448 10 226 10H234C234.552 10 235 10.4477 235 11V13H237V7H234H226H223V13H225ZM225 8H224V9H225V8ZM234 11H226V16H234V11ZM227 12H233V13H227V12ZM233 14H227V15H233V14Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="clear-style_2">
|
<g id="clear-style_2">
|
||||||
<path id="Union_8" fill-rule="evenodd" clip-rule="evenodd" d="M253.268 4.56085C252.291 3.58454 250.708 3.58453 249.732 4.56085L243.561 10.7324C242.584 11.7087 242.584 13.2916 243.561 14.268L245.146 15.8537L245.293 16.0002L245.5 16.0002H249.5L249.707 16.0002L255 16.0002V15.0002H250.707L255.439 10.268C256.416 9.29164 256.416 7.70873 255.439 6.73242L253.268 4.56085ZM249.293 15.0002L252.793 11.5002L248.5 7.20729L244.268 11.4395C243.682 12.0253 243.682 12.9751 244.268 13.5609L245.707 15.0002L249.293 15.0002ZM249.207 6.50019L253.5 10.7931L254.732 9.56085C255.318 8.97506 255.318 8.02531 254.732 7.43953L252.561 5.26795C251.975 4.68217 251.025 4.68217 250.439 5.26795L249.207 6.50019Z" fill="black"/>
|
<path id="Union_8" fill-rule="evenodd" clip-rule="evenodd" d="M253.268 4.56085C252.291 3.58454 250.708 3.58453 249.732 4.56085L243.561 10.7324C242.584 11.7087 242.584 13.2916 243.561 14.268L245.146 15.8537L245.293 16.0002L245.5 16.0002H249.5L249.707 16.0002L255 16.0002V15.0002H250.707L255.439 10.268C256.416 9.29164 256.416 7.70873 255.439 6.73242L253.268 4.56085ZM249.293 15.0002L252.793 11.5002L248.5 7.20729L244.268 11.4395C243.682 12.0253 243.682 12.9751 244.268 13.5609L245.707 15.0002L249.293 15.0002ZM249.207 6.50019L253.5 10.7931L254.732 9.56085C255.318 8.97506 255.318 8.02531 254.732 7.43953L252.561 5.26795C251.975 4.68217 251.025 4.68217 250.439 5.26795L249.207 6.50019Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="edit">
|
<g id="edit">
|
||||||
<path id="Vector_7" d="M263 34V37H266L274 29L271 26L263 34Z" fill="white"/>
|
<path id="Vector_7" d="M263 34V37H266L274 29L271 26L263 34Z" fill="white"/>
|
||||||
<path id="Vector 2" d="M275 28L272 25L274 23H275L277 25V26L275 28Z" fill="white"/>
|
<path id="Vector 2" d="M275 28L272 25L274 23H275L277 25V26L275 28Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="more-vertical">
|
<g id="more-vertical">
|
||||||
<circle id="Ellipse" cx="290" cy="26" r="1" transform="rotate(90 290 26)" fill="white"/>
|
<circle id="Ellipse" cx="290" cy="26" r="1" transform="rotate(90 290 26)" fill="white"/>
|
||||||
<circle id="Ellipse_2" cx="290" cy="30" r="1" transform="rotate(90 290 30)" fill="white"/>
|
<circle id="Ellipse_2" cx="290" cy="30" r="1" transform="rotate(90 290 30)" fill="white"/>
|
||||||
<circle id="Ellipse_3" cx="290" cy="34" r="1" transform="rotate(90 290 34)" fill="white"/>
|
<circle id="Ellipse_3" cx="290" cy="34" r="1" transform="rotate(90 290 34)" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="go-to-location">
|
<g id="go-to-location">
|
||||||
<path id="Vector_8" d="M317 26H311V25C311 24.45 310.55 24 310 24H303C302.45 24 302 24.45 302 25V36C302 36.55 302.45 37 303 37H317C317.55 37 318 36.55 318 36V27C318 26.45 317.55 26 317 26ZM317 36H303V25H310V27H317V36Z" fill="white"/>
|
<path id="Vector_8" d="M317 26H311V25C311 24.45 310.55 24 310 24H303C302.45 24 302 24.45 302 25V36C302 36.55 302.45 37 303 37H317C317.55 37 318 36.55 318 36V27C318 26.45 317.55 26 317 26ZM317 36H303V25H310V27H317V36Z" fill="white"/>
|
||||||
<path id="Union_9" fill-rule="evenodd" clip-rule="evenodd" d="M309.646 33.6465L310.354 34.3536L313.207 31.5L310.354 28.6465L309.646 29.3536L311.268 30.9747H306V31.9747H311.318L309.646 33.6465Z" fill="white"/>
|
<path id="Union_9" fill-rule="evenodd" clip-rule="evenodd" d="M309.646 33.6465L310.354 34.3536L313.207 31.5L310.354 28.6465L309.646 29.3536L311.268 30.9747H306V31.9747H311.318L309.646 33.6465Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="arrow-down">
|
<g id="arrow-down">
|
||||||
<path id="Union_10" fill-rule="evenodd" clip-rule="evenodd" d="M331 23H330V34.2929L325.354 29.6464L324.646 30.3536L330.146 35.8536L330.5 36.2071L330.854 35.8536L336.354 30.3536L335.646 29.6464L331 34.2929V23Z" fill="white"/>
|
<path id="Union_10" fill-rule="evenodd" clip-rule="evenodd" d="M331 23H330V34.2929L325.354 29.6464L324.646 30.3536L330.146 35.8536L330.5 36.2071L330.854 35.8536L336.354 30.3536L335.646 29.6464L331 34.2929V23Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="edit_2">
|
<g id="edit_2">
|
||||||
<path id="Vector_9" d="M263 14V17H266L274 9L271 6L263 14Z" fill="black"/>
|
<path id="Vector_9" d="M263 14V17H266L274 9L271 6L263 14Z" fill="black"/>
|
||||||
<path id="Vector 2_2" d="M275 8L272 5L274 3H275L277 5V6L275 8Z" fill="black"/>
|
<path id="Vector 2_2" d="M275 8L272 5L274 3H275L277 5V6L275 8Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="more-vertical_2">
|
<g id="more-vertical_2">
|
||||||
<circle id="Ellipse_4" cx="290" cy="6" r="1" transform="rotate(90 290 6)" fill="black"/>
|
<circle id="Ellipse_4" cx="290" cy="6" r="1" transform="rotate(90 290 6)" fill="black"/>
|
||||||
<circle id="Ellipse_5" cx="290" cy="10" r="1" transform="rotate(90 290 10)" fill="black"/>
|
<circle id="Ellipse_5" cx="290" cy="10" r="1" transform="rotate(90 290 10)" fill="black"/>
|
||||||
<circle id="Ellipse_6" cx="290" cy="14" r="1" transform="rotate(90 290 14)" fill="black"/>
|
<circle id="Ellipse_6" cx="290" cy="14" r="1" transform="rotate(90 290 14)" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="go-to-location_2">
|
<g id="go-to-location_2">
|
||||||
<path id="Vector_10" d="M317 6H311V5C311 4.45 310.55 4 310 4H303C302.45 4 302 4.45 302 5V16C302 16.55 302.45 17 303 17H317C317.55 17 318 16.55 318 16V7C318 6.45 317.55 6 317 6ZM317 16H303V5H310V7H317V16Z" fill="black"/>
|
<path id="Vector_10" d="M317 6H311V5C311 4.45 310.55 4 310 4H303C302.45 4 302 4.45 302 5V16C302 16.55 302.45 17 303 17H317C317.55 17 318 16.55 318 16V7C318 6.45 317.55 6 317 6ZM317 16H303V5H310V7H317V16Z" fill="black"/>
|
||||||
<path id="Union_11" fill-rule="evenodd" clip-rule="evenodd" d="M309.646 13.6465L310.354 14.3536L313.207 11.5L310.354 8.64648L309.646 9.35359L311.268 10.9747H306V11.9747H311.318L309.646 13.6465Z" fill="black"/>
|
<path id="Union_11" fill-rule="evenodd" clip-rule="evenodd" d="M309.646 13.6465L310.354 14.3536L313.207 11.5L310.354 8.64648L309.646 9.35359L311.268 10.9747H306V11.9747H311.318L309.646 13.6465Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="arrow-down_2">
|
<g id="arrow-down_2">
|
||||||
<path id="Union_12" fill-rule="evenodd" clip-rule="evenodd" d="M331 3H330V14.2929L325.354 9.64645L324.646 10.3536L330.146 15.8536L330.5 16.2071L330.854 15.8536L336.354 10.3536L335.646 9.64645L331 14.2929V3Z" fill="black"/>
|
<path id="Union_12" fill-rule="evenodd" clip-rule="evenodd" d="M331 3H330V14.2929L325.354 9.64645L324.646 10.3536L330.146 15.8536L330.5 16.2071L330.854 15.8536L336.354 10.3536L335.646 9.64645L331 14.2929V3Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="arrow-up">
|
<g id="arrow-up">
|
||||||
<path id="Union_13" fill-rule="evenodd" clip-rule="evenodd" d="M350 36.207L351 36.207L351 24.9141L355.646 29.5606L356.354 28.8535L350.854 23.3535L350.5 22.9999L350.146 23.3535L344.646 28.8535L345.354 29.5606L350 24.9141L350 36.207Z" fill="white"/>
|
<path id="Union_13" fill-rule="evenodd" clip-rule="evenodd" d="M350 36.207L351 36.207L351 24.9141L355.646 29.5606L356.354 28.8535L350.854 23.3535L350.5 22.9999L350.146 23.3535L344.646 28.8535L345.354 29.5606L350 24.9141L350 36.207Z" fill="white"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="arrow-up_2">
|
<g id="arrow-up_2">
|
||||||
<path id="Union_14" fill-rule="evenodd" clip-rule="evenodd" d="M350 16.207L351 16.207L351 4.91414L355.646 9.56059L356.354 8.85348L350.854 3.35348L350.5 2.99993L350.146 3.35348L344.646 8.85348L345.354 9.56059L350 4.91414L350 16.207Z" fill="black"/>
|
<path id="Union_14" fill-rule="evenodd" clip-rule="evenodd" d="M350 16.207L351 16.207L351 4.91414L355.646 9.56059L356.354 8.85348L350.854 3.35348L350.5 2.99993L350.146 3.35348L344.646 8.85348L345.354 9.56059L350 4.91414L350 16.207Z" fill="black"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="close">
|
<g id="close">
|
||||||
<path id="Vector 73" d="M366 25L375 34M375 25L366 34" stroke="white" stroke-width="1.5"/>
|
<path id="Vector 73" d="M366 25L375 34M375 25L366 34" stroke="white" stroke-width="1.5"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="close_2">
|
<g id="close_2">
|
||||||
<path id="Vector 73_2" d="M366 5L375 14M375 5L366 14" stroke="black" stroke-width="1.5"/>
|
<path id="Vector 73_2" d="M366 5L375 14M375 5L366 14" stroke="black" stroke-width="1.5"/>
|
||||||
</g>
|
</g>
|
||||||
<g id="сut">
|
</g>
|
||||||
<circle id="Ellipse 103" cx="385.5" cy="13.5" r="2" stroke="black"/>
|
|
||||||
<circle id="Ellipse 104" cx="385.5" cy="6.5" r="2" stroke="black"/>
|
|
||||||
<path id="Rectangle 1552" d="M387.188 7.56689L398.446 14.0669V14.0669C398.17 14.5452 397.559 14.7091 397.08 14.4329L386.688 8.43292L387.188 7.56689Z" fill="black"/>
|
|
||||||
<path id="Rectangle 1553" d="M386.688 11.5669L397.08 5.56689C397.558 5.29075 398.17 5.45463 398.446 5.93292V5.93292L387.188 12.4329L386.688 11.5669Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="сut_2">
|
|
||||||
<circle id="Ellipse 103_2" cx="385.5" cy="33.5" r="2" stroke="white"/>
|
|
||||||
<circle id="Ellipse 104_2" cx="385.5" cy="26.5" r="2" stroke="white"/>
|
|
||||||
<path id="Rectangle 1552_2" d="M387.188 27.5669L398.446 34.0669V34.0669C398.17 34.5452 397.559 34.7091 397.08 34.4329L386.688 28.4329L387.188 27.5669Z" fill="white"/>
|
|
||||||
<path id="Rectangle 1553_2" d="M386.688 31.5669L397.08 25.5669C397.558 25.2908 398.17 25.4546 398.446 25.9329V25.9329L387.188 32.4329L386.688 31.5669Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="copy">
|
|
||||||
<path id="Union_27" fill-rule="evenodd" clip-rule="evenodd" d="M404 5H412V7H413V5C413 4.44772 412.552 4 412 4H404C403.448 4 403 4.44772 403 5V12C403 12.5523 403.448 13 404 13H406V12H404V5ZM411 6H405V7H411V6ZM408 9V16H416V9H408ZM408 8C407.448 8 407 8.44772 407 9V16C407 16.5523 407.448 17 408 17H416C416.552 17 417 16.5523 417 16V9C417 8.44772 416.552 8 416 8H408ZM406 8H405V9H406V8ZM405 10H406V11H405V10ZM415 11V10H409V11H415ZM415 12V13H409V12H415ZM415 15V14H409V15H415Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="copy_2">
|
|
||||||
<path id="Union_28" fill-rule="evenodd" clip-rule="evenodd" d="M404 25H412V27H413V25C413 24.4477 412.552 24 412 24H404C403.448 24 403 24.4477 403 25V32C403 32.5523 403.448 33 404 33H406V32H404V25ZM411 26H405V27H411V26ZM408 29V36H416V29H408ZM408 28C407.448 28 407 28.4477 407 29V36C407 36.5523 407.448 37 408 37H416C416.552 37 417 36.5523 417 36V29C417 28.4477 416.552 28 416 28H408ZM406 28H405V29H406V28ZM405 30H406V31H405V30ZM415 31V30H409V31H415ZM415 32V33H409V32H415ZM415 35V34H409V35H415Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="paste">
|
|
||||||
<path id="Union_29" fill-rule="evenodd" clip-rule="evenodd" d="M426 3H432V4H434C434.552 4 435 4.44772 435 5V7H434V5H432V6H426V5H424V12H426V13H424C423.448 13 423 12.5523 423 12V5C423 4.44772 423.448 4 424 4H426V3ZM436 16V9H428V16H436ZM428 8C427.448 8 427 8.44772 427 9V16C427 16.5523 427.448 17 428 17H436C436.552 17 437 16.5523 437 16V9C437 8.44772 436.552 8 436 8H428ZM429 11V10H435V11H429ZM435 12H429V13H435V12ZM429 15V14H435V15H429Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="paste_2">
|
|
||||||
<path id="Union_30" fill-rule="evenodd" clip-rule="evenodd" d="M426 23H432V24H434C434.552 24 435 24.4477 435 25V27H434V25H432V26H426V25H424V32H426V33H424C423.448 33 423 32.5523 423 32V25C423 24.4477 423.448 24 424 24H426V23ZM436 36V29H428V36H436ZM428 28C427.448 28 427 28.4477 427 29V36C427 36.5523 427.448 37 428 37H436C436.552 37 437 36.5523 437 36V29C437 28.4477 436.552 28 436 28H428ZM429 31V30H435V31H429ZM435 32H429V33H435V32ZM429 35V34H435V35H429Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="redo">
|
|
||||||
<path id="Vector" d="M469.1 7C471.1 7 473.2 8.3 474.5 9.5L477 7V14H470L472.5 11.5C471.7 10.2 469.9 9.1 468.2 9.1C465.7 9.1 462.8 10.8 462.5 13.2C462.9 9.7 465.5 7 469.1 7Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="redo_2">
|
|
||||||
<path id="Vector_2" d="M469.1 27C471.1 27 473.2 28.3 474.5 29.5L477 27V34H470L472.5 31.5C471.7 30.2 469.9 29.1 468.2 29.1C465.7 29.1 462.8 30.8 462.5 33.2C462.9 29.7 465.5 27 469.1 27Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="undo">
|
|
||||||
<path id="Vector_3" d="M450.9 7C448.9 7 446.8 8.3 445.5 9.5L443 7V14H450L447.5 11.5C448.3 10.2 450.1 9.1 451.8 9.1C454.3 9.1 457.2 10.8 457.5 13.2C457.1 9.7 454.5 7 450.9 7Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="undo_2">
|
|
||||||
<path id="Vector_4" d="M450.9 27C448.9 27 446.8 28.3 445.5 29.5L443 27V34H450L447.5 31.5C448.3 30.2 450.1 29.1 451.8 29.1C454.3 29.1 457.2 30.8 457.5 33.2C457.1 29.7 454.5 27 450.9 27Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="search">
|
|
||||||
<path id="Union_31" fill-rule="evenodd" clip-rule="evenodd" d="M493 8.5C493 10.9853 490.985 13 488.5 13C486.015 13 484 10.9853 484 8.5C484 6.01472 486.015 4 488.5 4C490.985 4 493 6.01472 493 8.5ZM492.02 12.7266C491.066 13.5217 489.839 14 488.5 14C485.462 14 483 11.5376 483 8.5C483 5.46243 485.462 3 488.5 3C491.538 3 494 5.46243 494 8.5C494 9.83875 493.522 11.0658 492.727 12.0195L496.854 16.1465L496.146 16.8536L492.02 12.7266Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="search_2">
|
|
||||||
<path id="Union_32" fill-rule="evenodd" clip-rule="evenodd" d="M493 28.5C493 30.9853 490.985 33 488.5 33C486.015 33 484 30.9853 484 28.5C484 26.0147 486.015 24 488.5 24C490.985 24 493 26.0147 493 28.5ZM492.02 32.7266C491.066 33.5217 489.839 34 488.5 34C485.462 34 483 31.5376 483 28.5C483 25.4624 485.462 23 488.5 23C491.538 23 494 25.4624 494 28.5C494 29.8387 493.522 31.0658 492.727 32.0195L496.854 36.1465L496.146 36.8536L492.02 32.7266Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="btn-sheet-view">
|
|
||||||
<path id="Union_33" fill-rule="evenodd" clip-rule="evenodd" d="M509.93 13C507.552 13 505.45 11.8151 504.184 10C505.45 8.18485 507.552 7 509.93 7C512.307 7 514.409 8.18486 515.675 10C514.409 11.8151 512.307 13 509.93 13ZM509.93 6C512.891 6 515.476 7.6088 516.859 10C515.476 12.3912 512.891 14 509.93 14C506.969 14 504.383 12.3912 503 10C504.383 7.60879 506.969 6 509.93 6ZM509.93 12C511.034 12 511.93 11.1046 511.93 10C511.93 8.89543 511.034 8 509.93 8C508.825 8 507.93 8.89543 507.93 10C507.93 11.1046 508.825 12 509.93 12Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="btn-sheet-view_2">
|
|
||||||
<path id="Union_34" fill-rule="evenodd" clip-rule="evenodd" d="M509.93 33C507.552 33 505.45 31.8151 504.184 30C505.45 28.1849 507.552 27 509.93 27C512.307 27 514.409 28.1849 515.675 30C514.409 31.8151 512.307 33 509.93 33ZM509.93 26C512.891 26 515.476 27.6088 516.859 30C515.476 32.3912 512.891 34 509.93 34C506.969 34 504.383 32.3912 503 30C504.383 27.6088 506.969 26 509.93 26ZM509.93 32C511.034 32 511.93 31.1046 511.93 30C511.93 28.8954 511.034 28 509.93 28C508.825 28 507.93 28.8954 507.93 30C507.93 31.1046 508.825 32 509.93 32Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="hide-password">
|
|
||||||
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M530.948 6.05196C530.638 6.01766 530.321 6 530 6C526.91 6 524.243 7.63505 523 10C523.439 10.8356 524.056 11.5801 524.807 12.1935L525.518 11.4821C524.979 11.055 524.519 10.5539 524.158 10C525.311 8.23092 527.473 7 530 7C530 7 530 7 530 7L530.948 6.05196ZM530 13C532.527 12.9999 534.689 11.769 535.842 10C535.481 9.44626 535.021 8.94525 534.482 8.51821L535.194 7.80682C535.944 8.42019 536.561 9.16455 537 10C535.757 12.3649 533.09 14 530 14C529.679 14 529.363 13.9824 529.052 13.9481L530 13Z" fill="black"/>
|
|
||||||
<path id="Vector 169" d="M525 15L535 5" stroke="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="hide-password_2">
|
|
||||||
<path id="Subtract_2" fill-rule="evenodd" clip-rule="evenodd" d="M530.948 26.052C530.638 26.0177 530.321 26 530 26C526.91 26 524.243 27.6351 523 30C523.439 30.8356 524.056 31.5801 524.807 32.1935L525.518 31.4821C524.979 31.055 524.519 30.5539 524.158 30C525.311 28.2309 527.473 27 530 27C530 27 530 27 530 27L530.948 26.052ZM530 33C532.527 32.9999 534.689 31.769 535.842 30C535.481 29.4463 535.021 28.9453 534.482 28.5182L535.194 27.8068C535.944 28.4202 536.561 29.1646 537 30C535.757 32.3649 533.09 34 530 34C529.679 34 529.363 33.9824 529.052 33.9481L530 33Z" fill="white"/>
|
|
||||||
<path id="Vector 169_2" d="M525 35L535 25" stroke="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-up">
|
|
||||||
<path id="Union_4" fill-rule="evenodd" clip-rule="evenodd" d="M550 6.29297L550.354 6.64652L555.854 12.1465L555.146 12.8536L550 7.70718L544.854 12.8536L544.146 12.1465L549.646 6.64652L550 6.29297Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-up_2">
|
|
||||||
<path id="Union_3" fill-rule="evenodd" clip-rule="evenodd" d="M550 26.293L550.354 26.6465L555.854 32.1465L555.146 32.8536L550 27.7072L544.854 32.8536L544.146 32.1465L549.646 26.6465L550 26.293Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-down">
|
|
||||||
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M570 13.7071L570.354 13.3536L575.854 7.85359L575.146 7.14648L570 12.2929L564.854 7.14648L564.146 7.85359L569.646 13.3536L570 13.7071Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-down_2">
|
|
||||||
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M570 33.7071L570.354 33.3536L575.854 27.8536L575.146 27.1465L570 32.2929L564.854 27.1465L564.146 27.8536L569.646 33.3536L570 33.7071Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 12 KiB |
|
|
@ -1,4 +1 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="85" height="20" fill="none">
|
<svg id="Layer_2" xmlns="http://www.w3.org/2000/svg" viewBox="-4 23 100 24"><style>.st0{fill:#5B5B5B;} .st1{fill:#3A3A3A;} .st2{opacity:0.42;fill:#8C8C8C;enable-background:new ;} .st3{opacity:0.72;fill:#9B9B9B;enable-background:new ;} .st4{fill:#9B9B9B;}</style><path class="st0" d="M21.3 35.5c0-1.5.4-2.7 1.3-3.5.9-.8 1.9-1.2 3.1-1.2 1.2 0 2.2.4 3.1 1.2.9.8 1.3 1.9 1.3 3.5 0 1.5-.4 2.7-1.3 3.5-.9.8-1.9 1.2-3.1 1.2-1.2 0-2.2-.4-3.1-1.2-.8-.8-1.3-2-1.3-3.5zm1.9 0c0 1.1.2 1.8.6 2.3.4.5.8.8 1.3.9.1 0 .2 0 .3.1h.6c.1 0 .2 0 .3-.1.5-.1.9-.4 1.3-.9s.6-1.3.6-2.3c0-1-.2-1.8-.6-2.3-.4-.5-.8-.8-1.3-.9-.1 0-.2-.1-.3-.1h-.6c-.1 0-.2 0-.3.1-.5.1-.9.4-1.3.9s-.6 1.2-.6 2.3zm7.8-4.4h2.4l3.1 5.6.5 1.2v-6.8h1.8V40h-2.3l-3.2-5.9-.4-1h-.1l.1 1.6V40H31zm9.3 0h1.9v7.4h3.6V40h-5.5zm4.4 0h2.1l1.8 3 .2.7h.1l.3-.7 1.8-3h2l-3.3 5.2V40H48v-3.7z"/><path class="st1" d="M53.1 35.5c0-1.5.4-2.7 1.3-3.5.9-.8 1.9-1.2 3.1-1.2s2.2.4 3.1 1.2c.9.8 1.3 1.9 1.3 3.5 0 1.5-.4 2.7-1.3 3.5-.9.8-1.9 1.2-3.1 1.2-1.2 0-2.2-.4-3.1-1.2-.9-.8-1.3-2-1.3-3.5zm1.9 0c0 1.1.2 1.8.6 2.3.4.5.8.8 1.3.9.1 0 .2 0 .3.1h.6c.1 0 .2 0 .3-.1.5-.1.9-.4 1.3-.9s.6-1.3.6-2.3c0-1-.2-1.8-.6-2.3s-.8-.8-1.3-.9c-.1 0-.2-.1-.3-.1h-.6s-.2 0-.3.1c-.5.1-.9.4-1.3.9s-.6 1.2-.6 2.3zm7.8-4.4h5v1.5h-3.2v2.1h3.1v1.5h-3.1V40h-1.8zm6.1 0h5v1.5h-3.2v2.1h3v1.5h-3V40h-1.8zm6 8.9v-8.9h1.9V40zM85 31.3v1.6c-.3-.1-.6-.2-1-.3s-.7-.1-1.1-.1c-1 0-1.7.3-2.2.9-.5.6-.8 1.3-.8 2.2s.2 1.6.7 2.2c.5.6 1.2.9 2.1.9.3 0 .7 0 1-.1.4 0 .8-.2 1.2-.3l.1 1.5c-.1 0-.1.1-.2.1s-.2.1-.4.1h-.8c-.3 0-.7.1-1.1.1h-.4c-1-.1-2-.5-2.9-1.2-.9-.7-1.3-1.8-1.3-3.4 0-1.5.4-2.6 1.3-3.5.9-.8 2-1.2 3.4-1.2h1c.3 0 .6.1.9.2.1 0 .1 0 .2.1s.2.1.3.2zm1.1-.2h5.5v1.4H88v2.1h3.2V36H88v2.6h3.6V40h-5.5z"/><path class="st2" d="M7.4 43.1l-7.7-3.7c-.7-.3-.7-.8 0-1.1L2.3 37l5.1 2.4c.7.3 1.7.3 2.4 0l5.1-2.4 2.7 1.3c.7.3.7.8 0 1.1l-7.7 3.7c-.7.3-1.8.3-2.5 0z"/><path class="st3" d="M7.4 38.7L-.3 35c-.7-.3-.7-.8 0-1.1l2.7-1.3L7.5 35c.7.3 1.7.3 2.4 0l5.2-2.4 2.7 1.2c.7.3.7.8 0 1.1L10 38.6c-.8.4-1.9.4-2.6.1z"/><path class="st4" d="M7.4 34.3l-7.7-3.7c-.7-.3-.7-.8 0-1.1l7.7-3.7c.7-.3 1.7-.3 2.4 0l7.7 3.7c.7.3.7.8 0 1.1l-7.7 3.7c-.6.3-1.7.3-2.4 0z"/></svg>
|
||||||
<g fill-rule="evenodd" fill="#444"><path d="M20.211 7.003C19.395 7.655 19 8.658 19 9.987s.395 2.332 1.21 3.009S21.947 14 23.026 14c1.053 0 2-.326 2.79-1.003.79-.652 1.184-1.655 1.184-2.984 0-1.354-.395-2.332-1.184-3.009S24.105 6 23.026 6 21 6.326 20.211 7.003zm1.053 4.991c-.342-.426-.526-1.078-.526-2.006 0-.903.184-1.555.526-1.956.368-.426.763-.702 1.184-.803h0c.105-.025.211-.05.289-.05.079-.025.158-.025.263-.025h0a1.03 1.03 0 0 1 .145.013l.145.013c.079 0 .184.025.289.05.421.1.816.376 1.158.803s.526 1.103.526 1.981-.184 1.555-.526 1.981-.737.702-1.158.803l-.052.013c-.081.02-.15.037-.237.037-.105.025-.184.025-.29.025-.04 0-.085-.006-.132-.013h0l-.132-.013c-.087 0-.156-.017-.237-.037h0 0l-.052-.013c-.421-.1-.816-.376-1.184-.803zM30.134 6H28v8h1.639V9.282l-.026-1.41h.026l.416.897L32.866 14H35V6h-1.639v4.718l.026 1.41h-.026l-.416-1.077L30.134 6zm6.186 0H38v6.641h3.5V14h-5.18V6zm5.687 0H40l3.161 4.744V14h1.732v-3.256L48 6h-1.842l-1.787 2.821-.275.538h-.055l-.275-.538L42.007 6zM48 9.987c0-1.329.395-2.332 1.211-2.984C50 6.326 50.947 6 52.026 6s2 .326 2.79 1.003S56 8.658 56 10.013c0 1.329-.395 2.332-1.184 2.984-.79.677-1.737 1.003-2.79 1.003-1.079 0-2-.326-2.816-1.003C48.421 12.32 48 11.317 48 9.987zm1.737 0c0 .928.184 1.58.526 2.006.368.426.737.702 1.184.803.105.025.21.05.289.05.039 0 .086.006.132.013l.132.013c.105 0 .184 0 .289-.025.087 0 .156-.017.237-.037l.038-.009.014-.003c.421-.1.816-.376 1.158-.803s.526-1.103.526-1.981-.184-1.555-.526-1.981-.737-.702-1.158-.803c-.105-.025-.21-.05-.289-.05-.053 0-.099-.006-.145-.013L52 7.154c-.105 0-.184 0-.263.025-.079 0-.184.025-.289.05-.421.1-.816.376-1.184.803-.342.401-.526 1.053-.526 1.956zM62 6h-4.63v8H59v-3.359h2.871V9.282H59V7.359h3V6zm1.37 0H68v1.359h-3v1.923h2.871v1.359H65V14h-1.63V6zm6.13 0v8h1.638V6H69.5zm9 .202v1.363c-.273-.101-.546-.177-.843-.227a5.79 5.79 0 0 0-.967-.076c-.818 0-1.438.252-1.884.782-.446.505-.669 1.161-.669 1.943 0 .757.198 1.388.62 1.893s1.016.782 1.785.782c.236 0 .471-.019.739-.04h0l.129-.01c.322-.05.645-.126.992-.278l.099 1.338c-.05.025-.124.05-.198.076l-.322.076a4.65 4.65 0 0 1-.446.08h0l-.297.046-.917.05h-.248c-.893-.05-1.711-.404-2.455-1.009-.744-.631-1.116-1.615-1.116-2.927 0-1.287.372-2.297 1.091-3.003S75.302 6 76.517 6l.868.025c.236.022.454.063.684.106l.109.02c.025.013.056.019.087.025a.35.35 0 0 1 .087.025c.015-.016.04-.012.074-.007.021.003.046.007.074.007zM85 6h-5v8h5v-1.256h-3.336v-2.231h2.885V9.256h-2.885v-2H85V6z"/><path opacity=".5" d="M1.605 12.508l4.958 2.318c.503.229 1.348.229 1.874 0l4.936-2.307 1.188.557c.525.252.525.641 0 .87l-6.169 2.883c-.48.229-1.325.229-1.828 0L.394 13.945c-.526-.252-.526-.641 0-.87l1.21-.568z"/><path opacity=".75" d="M1.555 8.985l5.008 2.341c.503.229 1.348.229 1.874 0l5.008-2.341 1.161.544c.526.252.526.641 0 .87l-6.169 2.883c-.526.252-1.371.252-1.874 0L.394 10.398c-.526-.252-.526-.641 0-.87l1.161-.543z"/><path d="M6.563 9.825L.394 6.942c-.526-.252-.526-.641 0-.87l6.169-2.883c.525-.252 1.371-.252 1.874 0l6.169 2.883c.525.252.525.641 0 .87L8.437 9.825c-.526.229-1.371.229-1.874 0z"/>
|
|
||||||
</g><defs />
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
|
@ -99,13 +99,13 @@
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
||||||
&.top {
|
&.top {
|
||||||
top: 28px;
|
top: 48px;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.bottom {
|
&.bottom {
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 28px;
|
bottom: 46px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,7 +126,7 @@
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 28px;
|
height: 48px;
|
||||||
|
|
||||||
-webkit-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor;
|
-webkit-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor;
|
||||||
//-moz-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor;
|
//-moz-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor;
|
||||||
|
|
@ -137,7 +137,7 @@
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 28px;
|
height: 46px;
|
||||||
|
|
||||||
-webkit-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor;
|
-webkit-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor;
|
||||||
//-moz-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor;
|
//-moz-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor;
|
||||||
|
|
@ -225,12 +225,6 @@
|
||||||
.margin-right-large {
|
.margin-right-large {
|
||||||
margin-right: 12px;
|
margin-right: 12px;
|
||||||
}
|
}
|
||||||
.margin-left-small {
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
.margin-left-large {
|
|
||||||
margin-left: 12px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logo
|
// Logo
|
||||||
|
|
@ -238,8 +232,8 @@
|
||||||
.brand-logo {
|
.brand-logo {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 20px;
|
height: 24px;
|
||||||
background: url(../../../../common/embed/resources/img/logo.svg) no-repeat;
|
background: data-uri('../../../../common/embed/resources/img/logo.svg') no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Control buttons
|
// Control buttons
|
||||||
|
|
@ -503,7 +497,7 @@
|
||||||
@icon-height: 20px;
|
@icon-height: 20px;
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
background: data-uri('../../../../common/embed/resources/img/icon-menu-sprite.svg') no-repeat;
|
background: data-uri('../../../../common/embed/resources/img/icon-menu-sprite.svg') no-repeat;
|
||||||
background-size: @icon-width*29 @icon-height*2;
|
background-size: @icon-width*19 @icon-height*2;
|
||||||
|
|
||||||
&.download {
|
&.download {
|
||||||
background-position: -@icon-width 0;
|
background-position: -@icon-width 0;
|
||||||
|
|
@ -557,18 +551,6 @@
|
||||||
&.more-vertical {
|
&.more-vertical {
|
||||||
background-position: -@icon-width*14 0;
|
background-position: -@icon-width*14 0;
|
||||||
}
|
}
|
||||||
&.search-close {
|
|
||||||
background-position: -@icon-width*18 0;
|
|
||||||
}
|
|
||||||
&.search {
|
|
||||||
background-position: -@icon-width*24 0;
|
|
||||||
}
|
|
||||||
&.search-arrow-up {
|
|
||||||
background-position: -@icon-width*27 0;
|
|
||||||
}
|
|
||||||
&.search-arrow-down {
|
|
||||||
background-position: -@icon-width*28 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mi-icon {
|
.mi-icon {
|
||||||
|
|
@ -705,7 +687,6 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
box-shadow: 0 6px 12px rgba(0,0,0,0.175);
|
box-shadow: 0 6px 12px rgba(0,0,0,0.175);
|
||||||
max-width: 350px;
|
|
||||||
|
|
||||||
padding: 5px 12px;
|
padding: 5px 12px;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
|
@ -798,72 +779,3 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#id-search {
|
|
||||||
button.active {
|
|
||||||
background-color: @btnActiveColor !important;
|
|
||||||
background-position: -@icon-width*19 -@icon-height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-window {
|
|
||||||
width: 301px;
|
|
||||||
height: 54px;
|
|
||||||
z-index: 50;
|
|
||||||
position: fixed;
|
|
||||||
|
|
||||||
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
|
|
||||||
border-radius: 5px;
|
|
||||||
border: solid 1px #CBCBCB;
|
|
||||||
|
|
||||||
.body {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
display: flex;
|
|
||||||
padding: 16px;
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 192px;
|
|
||||||
height: 22px;
|
|
||||||
border-radius: 2px;
|
|
||||||
box-shadow: none;
|
|
||||||
border: solid 1px #CFCFCF;
|
|
||||||
padding: 1px 3px;
|
|
||||||
color: #444444;
|
|
||||||
font-size: 11px;
|
|
||||||
|
|
||||||
&::placeholder {
|
|
||||||
color: #CFCFCF;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
border-color: #848484;
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tools {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
button {
|
|
||||||
border: none;
|
|
||||||
margin-left: 7px;
|
|
||||||
cursor: pointer;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
opacity: 0.8;
|
|
||||||
|
|
||||||
&:hover:not(:disabled) {
|
|
||||||
background-color: #d8dadc;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:disabled {
|
|
||||||
opacity: 0.4;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,225 +0,0 @@
|
||||||
|
|
||||||
!window.Common && (window.Common = {});
|
|
||||||
!Common.Views && (Common.Views = {});
|
|
||||||
|
|
||||||
define([
|
|
||||||
'common/main/lib/component/Window',
|
|
||||||
'common/main/lib/component/MetricSpinner',
|
|
||||||
'common/main/lib/component/TextareaField'
|
|
||||||
], function () { 'use strict';
|
|
||||||
|
|
||||||
Common.Views.EmbedDialog = Common.UI.Window.extend(_.extend({
|
|
||||||
options: {
|
|
||||||
width: 300,
|
|
||||||
header: true,
|
|
||||||
style: 'min-width: 300px;',
|
|
||||||
cls: 'modal-dlg',
|
|
||||||
buttons: null
|
|
||||||
},
|
|
||||||
|
|
||||||
initialize : function(options) {
|
|
||||||
_.extend(this.options, {
|
|
||||||
title: this.textTitle
|
|
||||||
}, options || {});
|
|
||||||
|
|
||||||
this.template = [
|
|
||||||
'<div class="box" style="height: 110px;">',
|
|
||||||
'<table cols="2" style="width: 100%;">',
|
|
||||||
'<tr>',
|
|
||||||
'<td style="padding-right: 10px;">',
|
|
||||||
'<label class="input-label">' + this.textWidth + ':</label>',
|
|
||||||
'<div id="embed-size-spin-width" style="display: inline-block;margin-left: 5px;"></div>',
|
|
||||||
'</td>',
|
|
||||||
'<td style="float:right;">',
|
|
||||||
'<label class="input-label">' + this.textHeight + ':</label>',
|
|
||||||
'<div id="embed-size-spin-height" style="display: inline-block;margin-left: 5px;"></div>',
|
|
||||||
'</td>',
|
|
||||||
'</tr>',
|
|
||||||
'<tr>',
|
|
||||||
'<td colspan="2">',
|
|
||||||
'<div id="embed-textarea" style="margin-top: 15px;"></div>',
|
|
||||||
'</td>',
|
|
||||||
'</tr>',
|
|
||||||
'</table>',
|
|
||||||
'</div>',
|
|
||||||
'<div class="separator horizontal"></div>',
|
|
||||||
'<div class="footer center">',
|
|
||||||
'<button class="btn normal primary dlg-btn" style="min-width: 86px;width: auto;">' + this.txtCopy + '</button>',
|
|
||||||
'</div>'
|
|
||||||
].join('');
|
|
||||||
|
|
||||||
this.options.tpl = _.template(this.template)(this.options);
|
|
||||||
this.embedConfig = this.options.embedConfig;
|
|
||||||
this.embedCode = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="{0}" width="{1}" height="{2}"></iframe>';
|
|
||||||
|
|
||||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
|
||||||
Common.UI.Window.prototype.render.call(this);
|
|
||||||
|
|
||||||
this.spnWidth = new Common.UI.MetricSpinner({
|
|
||||||
el: $('#embed-size-spin-width'),
|
|
||||||
step: 1,
|
|
||||||
width: 70,
|
|
||||||
defaultUnit : "px",
|
|
||||||
value: '400 px',
|
|
||||||
minValue: 400,
|
|
||||||
maxValue: 10000
|
|
||||||
});
|
|
||||||
this.spnWidth.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
|
||||||
this.updateEmbedCode();
|
|
||||||
}, this));
|
|
||||||
|
|
||||||
this.spnHeight = new Common.UI.MetricSpinner({
|
|
||||||
el: $('#embed-size-spin-height'),
|
|
||||||
step: 1,
|
|
||||||
width: 70,
|
|
||||||
defaultUnit : "px",
|
|
||||||
value: '600 px',
|
|
||||||
minValue: 600,
|
|
||||||
maxValue: 10000
|
|
||||||
});
|
|
||||||
this.spnHeight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
|
||||||
this.updateEmbedCode();
|
|
||||||
}, this));
|
|
||||||
|
|
||||||
this.textareaInput = new Common.UI.TextareaField({
|
|
||||||
el : $('#embed-textarea'),
|
|
||||||
style : 'width: 100%; height: 65px;',
|
|
||||||
value : ''
|
|
||||||
});
|
|
||||||
this.textareaInput._input.attr('readonly', true);
|
|
||||||
this.updateEmbedCode();
|
|
||||||
|
|
||||||
this.getChild().find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
|
||||||
},
|
|
||||||
|
|
||||||
getFocusedComponents: function() {
|
|
||||||
return [this.spnWidth, this.spnHeight, this.textareaInput];
|
|
||||||
},
|
|
||||||
|
|
||||||
getDefaultFocusableComponent: function () {
|
|
||||||
return this.textareaInput;
|
|
||||||
},
|
|
||||||
|
|
||||||
onBtnClick: function(event) {
|
|
||||||
this.textareaInput._input.select();
|
|
||||||
if ( !document.execCommand('copy') ) {
|
|
||||||
Common.UI.warning({
|
|
||||||
msg: this.warnCopy,
|
|
||||||
buttons: ['ok']
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
updateEmbedCode: function() {
|
|
||||||
this.textareaInput.setValue(Common.Utils.String.format(this.embedCode, this.embedConfig.embedUrl, this.spnWidth.getNumberValue(), this.spnHeight.getNumberValue()));
|
|
||||||
},
|
|
||||||
|
|
||||||
textTitle: 'Embed',
|
|
||||||
textWidth: 'Width',
|
|
||||||
textHeight: 'Height',
|
|
||||||
txtCopy: 'Copy to clipboard',
|
|
||||||
warnCopy: 'Browser\'s error! Use keyboard shortcut [Ctrl] + [C]'
|
|
||||||
}, Common.Views.EmbedDialog || {}));
|
|
||||||
|
|
||||||
Common.Views.ShareDialog = Common.UI.Window.extend(_.extend({
|
|
||||||
options: {
|
|
||||||
width: 300,
|
|
||||||
header: true,
|
|
||||||
style: 'min-width: 300px;',
|
|
||||||
cls: 'modal-dlg',
|
|
||||||
buttons: null
|
|
||||||
},
|
|
||||||
|
|
||||||
initialize : function(options) {
|
|
||||||
_.extend(this.options, {
|
|
||||||
title: this.textTitle
|
|
||||||
}, options || {});
|
|
||||||
|
|
||||||
this.template = [
|
|
||||||
'<div class="box" style="height: 100px;">',
|
|
||||||
'<table cols="1" style="width: 100%;">',
|
|
||||||
'<tr>',
|
|
||||||
'<td>',
|
|
||||||
'<div id="share-link-txt"></div>',
|
|
||||||
'</td>',
|
|
||||||
'</tr>',
|
|
||||||
'<tr>',
|
|
||||||
'<td>',
|
|
||||||
'<div class="share-buttons" style="margin-top: 15px;">',
|
|
||||||
'<span class="svg big-facebook" data-name="facebook"></span>',
|
|
||||||
'<span class="svg big-twitter" data-name="twitter"></span>',
|
|
||||||
'<span class="svg big-email" data-name="email"></span>',
|
|
||||||
'<div class="autotest" id="email" style="display: none"></div>',
|
|
||||||
'</div>',
|
|
||||||
'</td>',
|
|
||||||
'</tr>',
|
|
||||||
'</table>',
|
|
||||||
'</div>',
|
|
||||||
'<div class="separator horizontal"></div>',
|
|
||||||
'<div class="footer center">',
|
|
||||||
'<button class="btn normal primary dlg-btn" style="min-width: 86px;width: auto;">' + this.txtCopy + '</button>',
|
|
||||||
'</div>'
|
|
||||||
].join('');
|
|
||||||
|
|
||||||
this.options.tpl = _.template(this.template)(this.options);
|
|
||||||
this.embedConfig = this.options.embedConfig;
|
|
||||||
|
|
||||||
Common.UI.Window.prototype.initialize.call(this, this.options);
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
|
||||||
Common.UI.Window.prototype.render.call(this);
|
|
||||||
|
|
||||||
this.textUrl = new Common.UI.InputField({
|
|
||||||
el : $('#share-link-txt'),
|
|
||||||
editable : false,
|
|
||||||
value: this.embedConfig.shareUrl || ''
|
|
||||||
});
|
|
||||||
this.updateShareCode();
|
|
||||||
|
|
||||||
this.getChild().find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
|
||||||
},
|
|
||||||
|
|
||||||
onBtnClick: function(event) {
|
|
||||||
this.textUrl._input.select();
|
|
||||||
if ( !document.execCommand('copy') ) {
|
|
||||||
Common.UI.warning({
|
|
||||||
msg: this.warnCopy,
|
|
||||||
buttons: ['ok']
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
updateShareCode: function() {
|
|
||||||
var me = this,
|
|
||||||
_encoded = encodeURIComponent(this.embedConfig.shareUrl),
|
|
||||||
docTitle = this.embedConfig.docTitle || '',
|
|
||||||
_mailto = 'mailto:?subject=I have shared a document with you: ' + docTitle + '&body=I have shared a document with you: ' + _encoded;
|
|
||||||
|
|
||||||
this.getChild().find('.share-buttons > span').on('click', function(e){
|
|
||||||
var _url;
|
|
||||||
switch ($(e.target).attr('data-name')) {
|
|
||||||
case 'facebook':
|
|
||||||
_url = 'https://www.facebook.com/sharer/sharer.php?u=' + me.embedConfig.shareUrl + '&t=' + encodeURI(docTitle);
|
|
||||||
window.open(_url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');
|
|
||||||
break;
|
|
||||||
case 'twitter':
|
|
||||||
_url = 'https://twitter.com/share?url='+ _encoded;
|
|
||||||
!!docTitle && (_url += encodeURIComponent('&text=' + docTitle));
|
|
||||||
window.open(_url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');
|
|
||||||
break;
|
|
||||||
case 'email':
|
|
||||||
window.open(_mailto, '_self');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
textTitle: 'Share Link',
|
|
||||||
txtCopy: 'Copy to clipboard',
|
|
||||||
warnCopy: 'Browser\'s error! Use keyboard shortcut [Ctrl] + [C]'
|
|
||||||
}, Common.Views.ShareDialog || {}))
|
|
||||||
});
|
|
||||||
|
|
@ -1,220 +0,0 @@
|
||||||
<svg width="580" height="40" viewBox="0 0 580 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<g id="icon-menu-sprite Embedded Viewer">
|
|
||||||
<g id="view-settings">
|
|
||||||
<path id="Vector" d="M17 26H3V27H17V26Z" fill="white"/>
|
|
||||||
<path id="Vector_2" d="M17 30H3V31H17V30Z" fill="white"/>
|
|
||||||
<path id="Vector_3" d="M17 34H3V35H17V34Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="download">
|
|
||||||
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M31 22H30V33.2929L25.3536 28.6464L24.6465 29.3536L30.1465 34.8536L30.5 35.2071L30.8536 34.8536L36.3536 29.3536L35.6465 28.6464L31 33.2929V22Z" fill="white"/>
|
|
||||||
<rect id="Rectangle 88" x="24" y="36" width="13" height="1" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="share">
|
|
||||||
<path id="share_2" d="M56 25C56 26.1046 55.1046 27 54 27C53.4663 27 52.9815 26.791 52.6229 26.4503L47.9076 29.3974C47.9676 29.5875 48 29.79 48 30C48 30.21 47.9676 30.4125 47.9076 30.6026L52.6229 33.5497C52.9815 33.209 53.4663 33 54 33C55.1046 33 56 33.8954 56 35C56 36.1046 55.1046 37 54 37C52.8954 37 52 36.1046 52 35C52 34.79 52.0324 34.5875 52.0924 34.3974L47.3771 31.4503C47.0185 31.791 46.5337 32 46 32C44.8954 32 44 31.1046 44 30C44 28.8954 44.8954 28 46 28C46.5337 28 47.0185 28.209 47.3771 28.5497L52.0924 25.6026C52.0324 25.4125 52 25.21 52 25C52 23.8954 52.8954 23 54 23C55.1046 23 56 23.8954 56 25Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="embed ">
|
|
||||||
<g id="embed _2">
|
|
||||||
<path d="M67.8536 25.3536L67.1465 24.6465L62.293 29.5L67.1465 34.3536L67.8536 33.6465L63.7072 29.5L67.8536 25.3536Z" fill="white"/>
|
|
||||||
<path d="M72.1465 25.3536L72.8536 24.6465L77.7072 29.5L72.8536 34.3536L72.1465 33.6465L76.293 29.5L72.1465 25.3536Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g id="full-screen">
|
|
||||||
<path id="Rectangle 81 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M93 27H87V33H93V27ZM86 26V34H94V26H86Z" fill="white"/>
|
|
||||||
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M86 23H83V26H84V24H86V23Z" fill="white"/>
|
|
||||||
<path id="Subtract_2" fill-rule="evenodd" clip-rule="evenodd" d="M97 26L97 23L94 23L94 24L96 24L96 26L97 26Z" fill="white"/>
|
|
||||||
<path id="Subtract_3" fill-rule="evenodd" clip-rule="evenodd" d="M94 37L97 37L97 34L96 34L96 36L94 36L94 37Z" fill="white"/>
|
|
||||||
<path id="Subtract_4" fill-rule="evenodd" clip-rule="evenodd" d="M83 34L83 37L86 37L86 36L84 36L84 34L83 34Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="zoom-in">
|
|
||||||
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M111 25H110V30H105V31H110V36H111V31H116V30H111V25Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="zoom-out">
|
|
||||||
<rect id="Rectangle 44.8" x="135" y="30" width="1" height="10" transform="rotate(90 135 30)" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="scroll-to-first-sheet">
|
|
||||||
<path id="Vector 13 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M155 25L147 30L155 35V25Z" fill="white"/>
|
|
||||||
<path id="Rectangle 225" d="M145 25H146V35H145V25Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="scroll-to-last-sheet">
|
|
||||||
<path id="Vector 13 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M165 35L173 30L165 25V35Z" fill="white"/>
|
|
||||||
<path id="Rectangle 225 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M174 35H175V25H174V35Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="play">
|
|
||||||
<path id="Vector 8 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M185 23L198 30L185 37V23Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="pause">
|
|
||||||
<path id="Rectangle 81 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M205 25V35H209V25H205Z" fill="white"/>
|
|
||||||
<path id="Rectangle 81.1 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M211 25V35H215V25H211Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id=" print">
|
|
||||||
<path id="Union_3" fill-rule="evenodd" clip-rule="evenodd" d="M226 24H234V26H226V24ZM225 26V24C225 23.4477 225.448 23 226 23H234C234.552 23 235 23.4477 235 24V26H237C237.552 26 238 26.4477 238 27V33C238 33.5523 237.552 34 237 34H235V36C235 36.5523 234.552 37 234 37H226C225.448 37 225 36.5523 225 36V34H223C222.448 34 222 33.5523 222 33V27C222 26.4477 222.448 26 223 26H225ZM225 33V31C225 30.4477 225.448 30 226 30H234C234.552 30 235 30.4477 235 31V33H237V27H234H226H223V33H225ZM225 28H224V29H225V28ZM234 31H226V36H234V31ZM227 32H233V33H227V32ZM233 34H227V35H233V34Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="clear-style">
|
|
||||||
<path id="Union_4" fill-rule="evenodd" clip-rule="evenodd" d="M253.268 24.5608C252.291 23.5845 250.708 23.5845 249.732 24.5608L243.561 30.7324C242.584 31.7087 242.584 33.2916 243.561 34.268L245.146 35.8537L245.293 36.0002L245.5 36.0002H249.5L249.707 36.0002L255 36.0002V35.0002H250.707L255.439 30.268C256.416 29.2916 256.416 27.7087 255.439 26.7324L253.268 24.5608ZM249.293 35.0002L252.793 31.5002L248.5 27.2073L244.268 31.4395C243.682 32.0253 243.682 32.9751 244.268 33.5609L245.707 35.0002L249.293 35.0002ZM249.207 26.5002L253.5 30.7931L254.732 29.5608C255.318 28.9751 255.318 28.0253 254.732 27.4395L252.561 25.268C251.975 24.6822 251.025 24.6822 250.439 25.268L249.207 26.5002Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="view-settings_2">
|
|
||||||
<path id="Vector_4" d="M17 6H3V7H17V6Z" fill="black"/>
|
|
||||||
<path id="Vector_5" d="M17 10H3V11H17V10Z" fill="black"/>
|
|
||||||
<path id="Vector_6" d="M17 14H3V15H17V14Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="download_2">
|
|
||||||
<path id="Union_5" fill-rule="evenodd" clip-rule="evenodd" d="M31 2H30V13.2929L25.3536 8.64645L24.6465 9.35355L30.1465 14.8536L30.5 15.2071L30.8536 14.8536L36.3536 9.35355L35.6465 8.64645L31 13.2929V2Z" fill="black"/>
|
|
||||||
<rect id="Rectangle 88_2" x="24" y="16" width="13" height="1" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="share_3">
|
|
||||||
<path id="share_4" d="M56 5C56 6.10457 55.1046 7 54 7C53.4663 7 52.9815 6.79098 52.6229 6.45034L47.9076 9.39737C47.9676 9.58754 48 9.78999 48 10C48 10.21 47.9676 10.4125 47.9076 10.6026L52.6229 13.5497C52.9815 13.209 53.4663 13 54 13C55.1046 13 56 13.8954 56 15C56 16.1046 55.1046 17 54 17C52.8954 17 52 16.1046 52 15C52 14.79 52.0324 14.5875 52.0924 14.3974L47.3771 11.4503C47.0185 11.791 46.5337 12 46 12C44.8954 12 44 11.1046 44 10C44 8.89543 44.8954 8 46 8C46.5337 8 47.0185 8.20902 47.3771 8.54966L52.0924 5.60264C52.0324 5.41246 52 5.21001 52 5C52 3.89543 52.8954 3 54 3C55.1046 3 56 3.89543 56 5Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="embed _3">
|
|
||||||
<g id="embed _4">
|
|
||||||
<path d="M67.8536 5.35359L67.1465 4.64648L62.293 9.50004L67.1465 14.3536L67.8536 13.6465L63.7072 9.50004L67.8536 5.35359Z" fill="black"/>
|
|
||||||
<path d="M72.1465 5.35359L72.8536 4.64648L77.7072 9.50004L72.8536 14.3536L72.1465 13.6465L76.293 9.50004L72.1465 5.35359Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g id="full-screen_2">
|
|
||||||
<path id="Rectangle 81 (Stroke)_3" fill-rule="evenodd" clip-rule="evenodd" d="M93 7H87V13H93V7ZM86 6V14H94V6H86Z" fill="black"/>
|
|
||||||
<path id="Subtract_5" fill-rule="evenodd" clip-rule="evenodd" d="M86 3H83V6H84V4H86V3Z" fill="black"/>
|
|
||||||
<path id="Subtract_6" fill-rule="evenodd" clip-rule="evenodd" d="M97 6L97 3L94 3L94 4L96 4L96 6L97 6Z" fill="black"/>
|
|
||||||
<path id="Subtract_7" fill-rule="evenodd" clip-rule="evenodd" d="M94 17L97 17L97 14L96 14L96 16L94 16L94 17Z" fill="black"/>
|
|
||||||
<path id="Subtract_8" fill-rule="evenodd" clip-rule="evenodd" d="M83 14L83 17L86 17L86 16L84 16L84 14L83 14Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="zoom-in_2">
|
|
||||||
<path id="Union_6" fill-rule="evenodd" clip-rule="evenodd" d="M111 5H110V10H105V11H110V16H111V11H116V10H111V5Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="zoom-out_2">
|
|
||||||
<rect id="Rectangle 44.8_2" x="135" y="10" width="1" height="10" transform="rotate(90 135 10)" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="scroll-to-first-sheet_2">
|
|
||||||
<path id="Vector 13 (Stroke)_3" fill-rule="evenodd" clip-rule="evenodd" d="M155 5L147 10L155 15V5Z" fill="black"/>
|
|
||||||
<path id="Rectangle 225_2" d="M145 5H146V15H145V5Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="scroll-to-last-sheet_2">
|
|
||||||
<path id="Vector 13 (Stroke)_4" fill-rule="evenodd" clip-rule="evenodd" d="M165 15L173 10L165 5V15Z" fill="black"/>
|
|
||||||
<path id="Rectangle 225 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M174 15H175V5H174V15Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="play_2">
|
|
||||||
<path id="Vector 8 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M185 3L198 10L185 17V3Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="pause_2">
|
|
||||||
<path id="Rectangle 81 (Stroke)_4" fill-rule="evenodd" clip-rule="evenodd" d="M205 5V15H209V5H205Z" fill="black"/>
|
|
||||||
<path id="Rectangle 81.1 (Stroke)_2" fill-rule="evenodd" clip-rule="evenodd" d="M211 5V15H215V5H211Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id=" print_2">
|
|
||||||
<path id="Union_7" fill-rule="evenodd" clip-rule="evenodd" d="M226 4H234V6H226V4ZM225 6V4C225 3.44772 225.448 3 226 3H234C234.552 3 235 3.44772 235 4V6H237C237.552 6 238 6.44772 238 7V13C238 13.5523 237.552 14 237 14H235V16C235 16.5523 234.552 17 234 17H226C225.448 17 225 16.5523 225 16V14H223C222.448 14 222 13.5523 222 13V7C222 6.44772 222.448 6 223 6H225ZM225 13V11C225 10.4477 225.448 10 226 10H234C234.552 10 235 10.4477 235 11V13H237V7H234H226H223V13H225ZM225 8H224V9H225V8ZM234 11H226V16H234V11ZM227 12H233V13H227V12ZM233 14H227V15H233V14Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="clear-style_2">
|
|
||||||
<path id="Union_8" fill-rule="evenodd" clip-rule="evenodd" d="M253.268 4.56085C252.291 3.58454 250.708 3.58453 249.732 4.56085L243.561 10.7324C242.584 11.7087 242.584 13.2916 243.561 14.268L245.146 15.8537L245.293 16.0002L245.5 16.0002H249.5L249.707 16.0002L255 16.0002V15.0002H250.707L255.439 10.268C256.416 9.29164 256.416 7.70873 255.439 6.73242L253.268 4.56085ZM249.293 15.0002L252.793 11.5002L248.5 7.20729L244.268 11.4395C243.682 12.0253 243.682 12.9751 244.268 13.5609L245.707 15.0002L249.293 15.0002ZM249.207 6.50019L253.5 10.7931L254.732 9.56085C255.318 8.97506 255.318 8.02531 254.732 7.43953L252.561 5.26795C251.975 4.68217 251.025 4.68217 250.439 5.26795L249.207 6.50019Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="edit">
|
|
||||||
<path id="Vector_7" d="M263 34V37H266L274 29L271 26L263 34Z" fill="white"/>
|
|
||||||
<path id="Vector 2" d="M275 28L272 25L274 23H275L277 25V26L275 28Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="more-vertical">
|
|
||||||
<circle id="Ellipse" cx="290" cy="26" r="1" transform="rotate(90 290 26)" fill="white"/>
|
|
||||||
<circle id="Ellipse_2" cx="290" cy="30" r="1" transform="rotate(90 290 30)" fill="white"/>
|
|
||||||
<circle id="Ellipse_3" cx="290" cy="34" r="1" transform="rotate(90 290 34)" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="go-to-location">
|
|
||||||
<path id="Vector_8" d="M317 26H311V25C311 24.45 310.55 24 310 24H303C302.45 24 302 24.45 302 25V36C302 36.55 302.45 37 303 37H317C317.55 37 318 36.55 318 36V27C318 26.45 317.55 26 317 26ZM317 36H303V25H310V27H317V36Z" fill="white"/>
|
|
||||||
<path id="Union_9" fill-rule="evenodd" clip-rule="evenodd" d="M309.646 33.6465L310.354 34.3536L313.207 31.5L310.354 28.6465L309.646 29.3536L311.268 30.9747H306V31.9747H311.318L309.646 33.6465Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-down">
|
|
||||||
<path id="Union_10" fill-rule="evenodd" clip-rule="evenodd" d="M331 23H330V34.2929L325.354 29.6464L324.646 30.3536L330.146 35.8536L330.5 36.2071L330.854 35.8536L336.354 30.3536L335.646 29.6464L331 34.2929V23Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="edit_2">
|
|
||||||
<path id="Vector_9" d="M263 14V17H266L274 9L271 6L263 14Z" fill="black"/>
|
|
||||||
<path id="Vector 2_2" d="M275 8L272 5L274 3H275L277 5V6L275 8Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="more-vertical_2">
|
|
||||||
<circle id="Ellipse_4" cx="290" cy="6" r="1" transform="rotate(90 290 6)" fill="black"/>
|
|
||||||
<circle id="Ellipse_5" cx="290" cy="10" r="1" transform="rotate(90 290 10)" fill="black"/>
|
|
||||||
<circle id="Ellipse_6" cx="290" cy="14" r="1" transform="rotate(90 290 14)" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="go-to-location_2">
|
|
||||||
<path id="Vector_10" d="M317 6H311V5C311 4.45 310.55 4 310 4H303C302.45 4 302 4.45 302 5V16C302 16.55 302.45 17 303 17H317C317.55 17 318 16.55 318 16V7C318 6.45 317.55 6 317 6ZM317 16H303V5H310V7H317V16Z" fill="black"/>
|
|
||||||
<path id="Union_11" fill-rule="evenodd" clip-rule="evenodd" d="M309.646 13.6465L310.354 14.3536L313.207 11.5L310.354 8.64648L309.646 9.35359L311.268 10.9747H306V11.9747H311.318L309.646 13.6465Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-down_2">
|
|
||||||
<path id="Union_12" fill-rule="evenodd" clip-rule="evenodd" d="M331 3H330V14.2929L325.354 9.64645L324.646 10.3536L330.146 15.8536L330.5 16.2071L330.854 15.8536L336.354 10.3536L335.646 9.64645L331 14.2929V3Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-up">
|
|
||||||
<path id="Union_13" fill-rule="evenodd" clip-rule="evenodd" d="M350 36.207L351 36.207L351 24.9141L355.646 29.5606L356.354 28.8535L350.854 23.3535L350.5 22.9999L350.146 23.3535L344.646 28.8535L345.354 29.5606L350 24.9141L350 36.207Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-up_2">
|
|
||||||
<path id="Union_14" fill-rule="evenodd" clip-rule="evenodd" d="M350 16.207L351 16.207L351 4.91414L355.646 9.56059L356.354 8.85348L350.854 3.35348L350.5 2.99993L350.146 3.35348L344.646 8.85348L345.354 9.56059L350 4.91414L350 16.207Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="close">
|
|
||||||
<path id="Vector 73" d="M366 25L375 34M375 25L366 34" stroke="white" stroke-width="1.5"/>
|
|
||||||
</g>
|
|
||||||
<g id="close_2">
|
|
||||||
<path id="Vector 73_2" d="M366 5L375 14M375 5L366 14" stroke="black" stroke-width="1.5"/>
|
|
||||||
</g>
|
|
||||||
<g id="сut">
|
|
||||||
<circle id="Ellipse 103" cx="385.5" cy="13.5" r="2" stroke="black"/>
|
|
||||||
<circle id="Ellipse 104" cx="385.5" cy="6.5" r="2" stroke="black"/>
|
|
||||||
<path id="Rectangle 1552" d="M387.188 7.56689L398.446 14.0669V14.0669C398.17 14.5452 397.559 14.7091 397.08 14.4329L386.688 8.43292L387.188 7.56689Z" fill="black"/>
|
|
||||||
<path id="Rectangle 1553" d="M386.688 11.5669L397.08 5.56689C397.558 5.29075 398.17 5.45463 398.446 5.93292V5.93292L387.188 12.4329L386.688 11.5669Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="сut_2">
|
|
||||||
<circle id="Ellipse 103_2" cx="385.5" cy="33.5" r="2" stroke="white"/>
|
|
||||||
<circle id="Ellipse 104_2" cx="385.5" cy="26.5" r="2" stroke="white"/>
|
|
||||||
<path id="Rectangle 1552_2" d="M387.188 27.5669L398.446 34.0669V34.0669C398.17 34.5452 397.559 34.7091 397.08 34.4329L386.688 28.4329L387.188 27.5669Z" fill="white"/>
|
|
||||||
<path id="Rectangle 1553_2" d="M386.688 31.5669L397.08 25.5669C397.558 25.2908 398.17 25.4546 398.446 25.9329V25.9329L387.188 32.4329L386.688 31.5669Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="copy">
|
|
||||||
<path id="Union_27" fill-rule="evenodd" clip-rule="evenodd" d="M404 5H412V7H413V5C413 4.44772 412.552 4 412 4H404C403.448 4 403 4.44772 403 5V12C403 12.5523 403.448 13 404 13H406V12H404V5ZM411 6H405V7H411V6ZM408 9V16H416V9H408ZM408 8C407.448 8 407 8.44772 407 9V16C407 16.5523 407.448 17 408 17H416C416.552 17 417 16.5523 417 16V9C417 8.44772 416.552 8 416 8H408ZM406 8H405V9H406V8ZM405 10H406V11H405V10ZM415 11V10H409V11H415ZM415 12V13H409V12H415ZM415 15V14H409V15H415Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="copy_2">
|
|
||||||
<path id="Union_28" fill-rule="evenodd" clip-rule="evenodd" d="M404 25H412V27H413V25C413 24.4477 412.552 24 412 24H404C403.448 24 403 24.4477 403 25V32C403 32.5523 403.448 33 404 33H406V32H404V25ZM411 26H405V27H411V26ZM408 29V36H416V29H408ZM408 28C407.448 28 407 28.4477 407 29V36C407 36.5523 407.448 37 408 37H416C416.552 37 417 36.5523 417 36V29C417 28.4477 416.552 28 416 28H408ZM406 28H405V29H406V28ZM405 30H406V31H405V30ZM415 31V30H409V31H415ZM415 32V33H409V32H415ZM415 35V34H409V35H415Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="paste">
|
|
||||||
<path id="Union_29" fill-rule="evenodd" clip-rule="evenodd" d="M426 3H432V4H434C434.552 4 435 4.44772 435 5V7H434V5H432V6H426V5H424V12H426V13H424C423.448 13 423 12.5523 423 12V5C423 4.44772 423.448 4 424 4H426V3ZM436 16V9H428V16H436ZM428 8C427.448 8 427 8.44772 427 9V16C427 16.5523 427.448 17 428 17H436C436.552 17 437 16.5523 437 16V9C437 8.44772 436.552 8 436 8H428ZM429 11V10H435V11H429ZM435 12H429V13H435V12ZM429 15V14H435V15H429Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="paste_2">
|
|
||||||
<path id="Union_30" fill-rule="evenodd" clip-rule="evenodd" d="M426 23H432V24H434C434.552 24 435 24.4477 435 25V27H434V25H432V26H426V25H424V32H426V33H424C423.448 33 423 32.5523 423 32V25C423 24.4477 423.448 24 424 24H426V23ZM436 36V29H428V36H436ZM428 28C427.448 28 427 28.4477 427 29V36C427 36.5523 427.448 37 428 37H436C436.552 37 437 36.5523 437 36V29C437 28.4477 436.552 28 436 28H428ZM429 31V30H435V31H429ZM435 32H429V33H435V32ZM429 35V34H435V35H429Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="redo">
|
|
||||||
<path id="Vector" d="M469.1 7C471.1 7 473.2 8.3 474.5 9.5L477 7V14H470L472.5 11.5C471.7 10.2 469.9 9.1 468.2 9.1C465.7 9.1 462.8 10.8 462.5 13.2C462.9 9.7 465.5 7 469.1 7Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="redo_2">
|
|
||||||
<path id="Vector_2" d="M469.1 27C471.1 27 473.2 28.3 474.5 29.5L477 27V34H470L472.5 31.5C471.7 30.2 469.9 29.1 468.2 29.1C465.7 29.1 462.8 30.8 462.5 33.2C462.9 29.7 465.5 27 469.1 27Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="undo">
|
|
||||||
<path id="Vector_3" d="M450.9 7C448.9 7 446.8 8.3 445.5 9.5L443 7V14H450L447.5 11.5C448.3 10.2 450.1 9.1 451.8 9.1C454.3 9.1 457.2 10.8 457.5 13.2C457.1 9.7 454.5 7 450.9 7Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="undo_2">
|
|
||||||
<path id="Vector_4" d="M450.9 27C448.9 27 446.8 28.3 445.5 29.5L443 27V34H450L447.5 31.5C448.3 30.2 450.1 29.1 451.8 29.1C454.3 29.1 457.2 30.8 457.5 33.2C457.1 29.7 454.5 27 450.9 27Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="search">
|
|
||||||
<path id="Union_31" fill-rule="evenodd" clip-rule="evenodd" d="M493 8.5C493 10.9853 490.985 13 488.5 13C486.015 13 484 10.9853 484 8.5C484 6.01472 486.015 4 488.5 4C490.985 4 493 6.01472 493 8.5ZM492.02 12.7266C491.066 13.5217 489.839 14 488.5 14C485.462 14 483 11.5376 483 8.5C483 5.46243 485.462 3 488.5 3C491.538 3 494 5.46243 494 8.5C494 9.83875 493.522 11.0658 492.727 12.0195L496.854 16.1465L496.146 16.8536L492.02 12.7266Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="search_2">
|
|
||||||
<path id="Union_32" fill-rule="evenodd" clip-rule="evenodd" d="M493 28.5C493 30.9853 490.985 33 488.5 33C486.015 33 484 30.9853 484 28.5C484 26.0147 486.015 24 488.5 24C490.985 24 493 26.0147 493 28.5ZM492.02 32.7266C491.066 33.5217 489.839 34 488.5 34C485.462 34 483 31.5376 483 28.5C483 25.4624 485.462 23 488.5 23C491.538 23 494 25.4624 494 28.5C494 29.8387 493.522 31.0658 492.727 32.0195L496.854 36.1465L496.146 36.8536L492.02 32.7266Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="btn-sheet-view">
|
|
||||||
<path id="Union_33" fill-rule="evenodd" clip-rule="evenodd" d="M509.93 13C507.552 13 505.45 11.8151 504.184 10C505.45 8.18485 507.552 7 509.93 7C512.307 7 514.409 8.18486 515.675 10C514.409 11.8151 512.307 13 509.93 13ZM509.93 6C512.891 6 515.476 7.6088 516.859 10C515.476 12.3912 512.891 14 509.93 14C506.969 14 504.383 12.3912 503 10C504.383 7.60879 506.969 6 509.93 6ZM509.93 12C511.034 12 511.93 11.1046 511.93 10C511.93 8.89543 511.034 8 509.93 8C508.825 8 507.93 8.89543 507.93 10C507.93 11.1046 508.825 12 509.93 12Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="btn-sheet-view_2">
|
|
||||||
<path id="Union_34" fill-rule="evenodd" clip-rule="evenodd" d="M509.93 33C507.552 33 505.45 31.8151 504.184 30C505.45 28.1849 507.552 27 509.93 27C512.307 27 514.409 28.1849 515.675 30C514.409 31.8151 512.307 33 509.93 33ZM509.93 26C512.891 26 515.476 27.6088 516.859 30C515.476 32.3912 512.891 34 509.93 34C506.969 34 504.383 32.3912 503 30C504.383 27.6088 506.969 26 509.93 26ZM509.93 32C511.034 32 511.93 31.1046 511.93 30C511.93 28.8954 511.034 28 509.93 28C508.825 28 507.93 28.8954 507.93 30C507.93 31.1046 508.825 32 509.93 32Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="hide-password">
|
|
||||||
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M530.948 6.05196C530.638 6.01766 530.321 6 530 6C526.91 6 524.243 7.63505 523 10C523.439 10.8356 524.056 11.5801 524.807 12.1935L525.518 11.4821C524.979 11.055 524.519 10.5539 524.158 10C525.311 8.23092 527.473 7 530 7C530 7 530 7 530 7L530.948 6.05196ZM530 13C532.527 12.9999 534.689 11.769 535.842 10C535.481 9.44626 535.021 8.94525 534.482 8.51821L535.194 7.80682C535.944 8.42019 536.561 9.16455 537 10C535.757 12.3649 533.09 14 530 14C529.679 14 529.363 13.9824 529.052 13.9481L530 13Z" fill="black"/>
|
|
||||||
<path id="Vector 169" d="M525 15L535 5" stroke="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="hide-password_2">
|
|
||||||
<path id="Subtract_2" fill-rule="evenodd" clip-rule="evenodd" d="M530.948 26.052C530.638 26.0177 530.321 26 530 26C526.91 26 524.243 27.6351 523 30C523.439 30.8356 524.056 31.5801 524.807 32.1935L525.518 31.4821C524.979 31.055 524.519 30.5539 524.158 30C525.311 28.2309 527.473 27 530 27C530 27 530 27 530 27L530.948 26.052ZM530 33C532.527 32.9999 534.689 31.769 535.842 30C535.481 29.4463 535.021 28.9453 534.482 28.5182L535.194 27.8068C535.944 28.4202 536.561 29.1646 537 30C535.757 32.3649 533.09 34 530 34C529.679 34 529.363 33.9824 529.052 33.9481L530 33Z" fill="white"/>
|
|
||||||
<path id="Vector 169_2" d="M525 35L535 25" stroke="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-up">
|
|
||||||
<path id="Union_4" fill-rule="evenodd" clip-rule="evenodd" d="M550 6.29297L550.354 6.64652L555.854 12.1465L555.146 12.8536L550 7.70718L544.854 12.8536L544.146 12.1465L549.646 6.64652L550 6.29297Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-up_2">
|
|
||||||
<path id="Union_3" fill-rule="evenodd" clip-rule="evenodd" d="M550 26.293L550.354 26.6465L555.854 32.1465L555.146 32.8536L550 27.7072L544.854 32.8536L544.146 32.1465L549.646 26.6465L550 26.293Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-down">
|
|
||||||
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M570 13.7071L570.354 13.3536L575.854 7.85359L575.146 7.14648L570 12.2929L564.854 7.14648L564.146 7.85359L569.646 13.3536L570 13.7071Z" fill="black"/>
|
|
||||||
</g>
|
|
||||||
<g id="arrow-down_2">
|
|
||||||
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M570 33.7071L570.354 33.3536L575.854 27.8536L575.146 27.1465L570 32.2929L564.854 27.1465L564.146 27.8536L569.646 33.3536L570 33.7071Z" fill="white"/>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 20 KiB |
|
|
@ -1 +0,0 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 152 76"><defs><path id="a" d="M144.9 0h-23.8c-3.9 0-7.1 3.2-7.1 7.1v23.7c0 3.9 3.2 7.1 7.1 7.1h23.8c3.9 0 7.1-3.2 7.1-7.1V7.1c0-3.9-3.2-7.1-7.1-7.1zm1.8 28.3c0 1.3-1.1 2.4-2.4 2.4h-22.4c-1.3 0-2.4-1.1-2.4-2.4V9.7c0-1.3 1.1-2.4 2.4-2.4h22.4c1.3 0 2.4 1.1 2.4 2.4v18.6zM68.9 0H45.1C41.2 0 38 3.2 38 7.1v23.7c0 3.9 3.2 7.1 7.1 7.1h23.7c3.9 0 7.1-3.2 7.1-7.1V7.1c.1-3.9-3.1-7.1-7-7.1zm-1.8 14.6v.7c0 6.9-5.2 14.8-14.8 14.8-2.9 0-5.7-.9-8-2.3.4 0 .8.1 1.2.1 2.4 0 4.7-.8 6.5-2.2-2.3 0-4.2-1.6-4.8-3.6.3 0 .6.1 1 .1.5 0 .8-.1 1.3-.2-2.4-.5-4.3-2.6-4.3-5.1.8.4 1.6.6 2.5.6-1.4-.9-2.3-2.5-2.3-4.3 0-.9.3-1.9.7-2.6 2.6 3.2 6.4 5.2 10.7 5.4-.1-.4-.1-.8-.1-1.2 0-2.9 2.3-5.2 5.2-5.2 1.5 0 2.8.6 3.8 1.6 1.2-.2 2.3-.7 3.3-1.3-.4 1.2-1.2 2.3-2.3 2.9 1.1-.1 2.1-.4 3-.8-.7 1-1.6 1.9-2.6 2.6zM30.9 0H7.1C3.2 0 0 3.2 0 7.1v23.7c0 4 3.2 7.2 7.1 7.2h11.7V26.8h-5.3v-5.7h5.3V17c0-4.8 3.2-7.5 7.9-7.5 2.2 0 4.2.1 4.7.2v5.1h-3.2c-2.6 0-3.1 1.1-3.1 2.7v3.6h6.1l-.8 5.7h-5.3V38h5.7c3.9 0 7.1-3.2 7.1-7.1V7.1c.1-3.9-3.1-7.1-7-7.1zm105.9 20.6c-1.1.9-2.4 2-3.8 2-1.5 0-2.8-1.1-3.8-2l-6-4.8c-.4-.3-.7-.6-1-.9v12.6c0 .2.2.5.4.5h20.7c.2 0 .4-.2.4-.5V14.9c-.3.3-.6.6-1 .9-1.9 1.6-3.9 3.2-5.9 4.8zM106.9 0H83.1C79.2 0 76 3.2 76 7.1v23.7c0 3.9 3.2 7.1 7.1 7.1h23.8c3.9 0 7.1-3.2 7.1-7.1V7.1c0-3.9-3.2-7.1-7.1-7.1zM89.6 28.5c-5.3 0-9.5-4.3-9.5-9.5s4.2-9.5 9.5-9.5c2.5 0 4.7.9 6.4 2.5l-2.6 2.5c-.7-.7-2-1.5-3.8-1.5-3.3 0-5.9 2.7-5.9 6s2.6 6 5.9 6c3.8 0 5.2-2.7 5.4-4.1h-5.4v-3.3h9c.1.5.1 1 .1 1.6 0 5.4-3.7 9.3-9.1 9.3zm20.3-8.1h-2.7v2.7h-2.7v-2.7h-2.7v-2.7h2.7V15h2.7v2.7h2.7v2.7zM143.3 10h-20.7c-.2 0-.4.2-.4.5 0 1.6.8 3 2.1 4 1.9 1.5 3.8 3 5.6 4.5.7.6 2.1 1.9 3.1 1.9s2.3-1.3 3.1-1.9c1.9-1.5 3.7-3 5.6-4.5.9-.7 2.1-2.3 2.1-3.5 0-.4.1-1-.5-1z"/></defs><use xlink:href="#a" fill="#999"/><use xlink:href="#a" fill="#666" y="38"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.9 KiB |
|
|
@ -1 +0,0 @@
|
||||||
<svg id="Layer_2" xmlns="http://www.w3.org/2000/svg" viewBox="-4 23 100 24"><style>.st0{fill:#5B5B5B;} .st1{fill:#3A3A3A;} .st2{opacity:0.42;fill:#8C8C8C;enable-background:new ;} .st3{opacity:0.72;fill:#9B9B9B;enable-background:new ;} .st4{fill:#9B9B9B;}</style><path class="st0" d="M21.3 35.5c0-1.5.4-2.7 1.3-3.5.9-.8 1.9-1.2 3.1-1.2 1.2 0 2.2.4 3.1 1.2.9.8 1.3 1.9 1.3 3.5 0 1.5-.4 2.7-1.3 3.5-.9.8-1.9 1.2-3.1 1.2-1.2 0-2.2-.4-3.1-1.2-.8-.8-1.3-2-1.3-3.5zm1.9 0c0 1.1.2 1.8.6 2.3.4.5.8.8 1.3.9.1 0 .2 0 .3.1h.6c.1 0 .2 0 .3-.1.5-.1.9-.4 1.3-.9s.6-1.3.6-2.3c0-1-.2-1.8-.6-2.3-.4-.5-.8-.8-1.3-.9-.1 0-.2-.1-.3-.1h-.6c-.1 0-.2 0-.3.1-.5.1-.9.4-1.3.9s-.6 1.2-.6 2.3zm7.8-4.4h2.4l3.1 5.6.5 1.2v-6.8h1.8V40h-2.3l-3.2-5.9-.4-1h-.1l.1 1.6V40H31zm9.3 0h1.9v7.4h3.6V40h-5.5zm4.4 0h2.1l1.8 3 .2.7h.1l.3-.7 1.8-3h2l-3.3 5.2V40H48v-3.7z"/><path class="st1" d="M53.1 35.5c0-1.5.4-2.7 1.3-3.5.9-.8 1.9-1.2 3.1-1.2s2.2.4 3.1 1.2c.9.8 1.3 1.9 1.3 3.5 0 1.5-.4 2.7-1.3 3.5-.9.8-1.9 1.2-3.1 1.2-1.2 0-2.2-.4-3.1-1.2-.9-.8-1.3-2-1.3-3.5zm1.9 0c0 1.1.2 1.8.6 2.3.4.5.8.8 1.3.9.1 0 .2 0 .3.1h.6c.1 0 .2 0 .3-.1.5-.1.9-.4 1.3-.9s.6-1.3.6-2.3c0-1-.2-1.8-.6-2.3s-.8-.8-1.3-.9c-.1 0-.2-.1-.3-.1h-.6s-.2 0-.3.1c-.5.1-.9.4-1.3.9s-.6 1.2-.6 2.3zm7.8-4.4h5v1.5h-3.2v2.1h3.1v1.5h-3.1V40h-1.8zm6.1 0h5v1.5h-3.2v2.1h3v1.5h-3V40h-1.8zm6 8.9v-8.9h1.9V40zM85 31.3v1.6c-.3-.1-.6-.2-1-.3s-.7-.1-1.1-.1c-1 0-1.7.3-2.2.9-.5.6-.8 1.3-.8 2.2s.2 1.6.7 2.2c.5.6 1.2.9 2.1.9.3 0 .7 0 1-.1.4 0 .8-.2 1.2-.3l.1 1.5c-.1 0-.1.1-.2.1s-.2.1-.4.1h-.8c-.3 0-.7.1-1.1.1h-.4c-1-.1-2-.5-2.9-1.2-.9-.7-1.3-1.8-1.3-3.4 0-1.5.4-2.6 1.3-3.5.9-.8 2-1.2 3.4-1.2h1c.3 0 .6.1.9.2.1 0 .1 0 .2.1s.2.1.3.2zm1.1-.2h5.5v1.4H88v2.1h3.2V36H88v2.6h3.6V40h-5.5z"/><path class="st2" d="M7.4 43.1l-7.7-3.7c-.7-.3-.7-.8 0-1.1L2.3 37l5.1 2.4c.7.3 1.7.3 2.4 0l5.1-2.4 2.7 1.3c.7.3.7.8 0 1.1l-7.7 3.7c-.7.3-1.8.3-2.5 0z"/><path class="st3" d="M7.4 38.7L-.3 35c-.7-.3-.7-.8 0-1.1l2.7-1.3L7.5 35c.7.3 1.7.3 2.4 0l5.2-2.4 2.7 1.2c.7.3.7.8 0 1.1L10 38.6c-.8.4-1.9.4-2.6.1z"/><path class="st4" d="M7.4 34.3l-7.7-3.7c-.7-.3-.7-.8 0-1.1l7.7-3.7c.7-.3 1.7-.3 2.4 0l7.7 3.7c.7.3.7.8 0 1.1l-7.7 3.7c-.6.3-1.7.3-2.4 0z"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 323 B |
|
Before Width: | Height: | Size: 323 B |
|
|
@ -1,702 +0,0 @@
|
||||||
@import "../../../../common/main/resources/less/asc-mixins.less";
|
|
||||||
|
|
||||||
// Bootstrap overwrite
|
|
||||||
@import "../../../../common/main/resources/less/variables.less";
|
|
||||||
@import "../../../../common/main/resources/less/colors-table.less";
|
|
||||||
@import "../../../../common/main/resources/less/colors-table-classic.less";
|
|
||||||
@import "../../../../common/main/resources/less/colors-table-dark.less";
|
|
||||||
@import "../../../../common/main/resources/less/colors-table-dark-contrast.less";
|
|
||||||
|
|
||||||
// Core variables and mixins
|
|
||||||
//@import "../../../../../vendor/bootstrap/less/variables.less";
|
|
||||||
|
|
||||||
@icon-font-path: "../../../../../vendor/bootstrap/dist/fonts/";
|
|
||||||
|
|
||||||
@import "../../../../../vendor/bootstrap/less/mixins.less";
|
|
||||||
|
|
||||||
// Reset
|
|
||||||
@import "../../../../../vendor/bootstrap/less/normalize.less";
|
|
||||||
//@import "../../../../../vendor/bootstrap/less/print.less";
|
|
||||||
|
|
||||||
// Core CSS
|
|
||||||
@import "../../../../../vendor/bootstrap/less/scaffolding.less";
|
|
||||||
@import "../../../../../vendor/bootstrap/less/type.less";
|
|
||||||
//@import "code.less";
|
|
||||||
//@import "grid.less";
|
|
||||||
//@import "tables.less";
|
|
||||||
@import "../../../../../vendor/bootstrap/less/forms.less";
|
|
||||||
@import "../../../../../vendor/bootstrap/less/buttons.less";
|
|
||||||
|
|
||||||
// Components
|
|
||||||
@import "../../../../../vendor/bootstrap/less/component-animations.less";
|
|
||||||
//@import "../../../../../vendor/bootstrap/less/glyphicons.less";
|
|
||||||
//@import "dropdowns.less";
|
|
||||||
//@import "button-groups.less";
|
|
||||||
//@import "input-groups.less";
|
|
||||||
//@import "navs.less";
|
|
||||||
//@import "navbar.less";
|
|
||||||
//@import "breadcrumbs.less";
|
|
||||||
//@import "pagination.less";
|
|
||||||
//@import "pager.less";
|
|
||||||
//@import "../../../../../vendor/bootstrap/less/labels.less";
|
|
||||||
//@import "badges.less";
|
|
||||||
//@import "jumbotron.less";
|
|
||||||
//@import "thumbnails.less";
|
|
||||||
//@import "../../../../../vendor/bootstrap/less/alerts.less";
|
|
||||||
//@import "progress-bars.less";
|
|
||||||
//@import "media.less";
|
|
||||||
//@import "list-group.less";
|
|
||||||
//@import "panels.less";
|
|
||||||
//@import "wells.less";
|
|
||||||
//@import "../../../../../vendor/bootstrap/less/close.less";
|
|
||||||
|
|
||||||
// Components w/ JavaScript
|
|
||||||
//@import "../../../../../vendor/bootstrap/less/modals.less";
|
|
||||||
@import "../../../../../vendor/bootstrap/less/tooltip.less";
|
|
||||||
//@import "../../../../../vendor/bootstrap/less/popovers.less";
|
|
||||||
@import "../../../../../vendor/bootstrap/less/dropdowns.less";
|
|
||||||
@import "../../../../../vendor/bootstrap/less/button-groups.less";
|
|
||||||
@import "../../../../../vendor/bootstrap/less/input-groups.less";
|
|
||||||
//@import "carousel.less";
|
|
||||||
|
|
||||||
// Utility classes
|
|
||||||
@import "../../../../../vendor/bootstrap/less/utilities.less";
|
|
||||||
@import "../../../../../vendor/bootstrap/less/responsive-utilities.less";
|
|
||||||
|
|
||||||
@import "../../../../common/main/resources/less/buttons.less";
|
|
||||||
@import "../../../../common/main/resources/less/dropdown-menu.less";
|
|
||||||
@import "../../../../common/main/resources/less/dropdown-submenu.less";
|
|
||||||
@import "../../../../common/main/resources/less/separator.less";
|
|
||||||
@import "../../../../common/main/resources/less/input.less";
|
|
||||||
@import "../../../../common/main/resources/less/combobox.less";
|
|
||||||
@import "../../../../common/main/resources/less/window.less";
|
|
||||||
@import "../../../../common/main/resources/less/loadmask.less";
|
|
||||||
@import "../../../../common/main/resources/less/dataview.less";
|
|
||||||
@import "../../../../common/main/resources/less/tooltip.less";
|
|
||||||
@import "../../../../common/main/resources/less/scroller.less";
|
|
||||||
@import "../../../../common/main/resources/less/synchronize-tip.less";
|
|
||||||
@import "../../../../common/main/resources/less/common.less";
|
|
||||||
@import "../../../../common/main/resources/less/winxp_fix.less";
|
|
||||||
@import "../../../../common/main/resources/less/calendar.less";
|
|
||||||
@import "../../../../common/main/resources/less/spinner.less";
|
|
||||||
@import "../../../../common/main/resources/less/checkbox.less";
|
|
||||||
@import "../../../../common/main/resources/less/opendialog.less";
|
|
||||||
@import "../../../../common/main/resources/less/advanced-settings-window.less";
|
|
||||||
@import "../../../../common/main/resources/less/searchdialog.less";
|
|
||||||
|
|
||||||
@toolbarBorderColor: @border-toolbar-ie;
|
|
||||||
@toolbarBorderColor: @border-toolbar;
|
|
||||||
@toolbarTopColor: @background-toolbar-ie;
|
|
||||||
@toolbarTopColor: @background-toolbar;
|
|
||||||
@toolbarFontSize: 12px;
|
|
||||||
|
|
||||||
@iconSpriteCommonPath: "../../../../common/forms/resources/img/glyphicons.png";
|
|
||||||
@icon-socnet-size: 40px;
|
|
||||||
|
|
||||||
@loadmask-zindex: 10000;
|
|
||||||
|
|
||||||
.embed-body {
|
|
||||||
-moz-user-select: -moz-none;
|
|
||||||
-khtml-user-select: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
|
|
||||||
font-size: @toolbarFontSize;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
color: @text-normal-ie;
|
|
||||||
color: @text-normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Document Viewer
|
|
||||||
// -------------------------
|
|
||||||
.viewer {
|
|
||||||
position: absolute;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
|
|
||||||
&.top {
|
|
||||||
top: 40px;
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.bottom {
|
|
||||||
top: 0;
|
|
||||||
bottom: 46px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Toolbar
|
|
||||||
// -------------------------
|
|
||||||
.toolbar {
|
|
||||||
position: fixed;
|
|
||||||
font-size: @toolbarFontSize;
|
|
||||||
min-width: 340px;
|
|
||||||
z-index: 100;
|
|
||||||
background-color: @toolbarTopColor;
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
&.top {
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
|
|
||||||
.box-inner-shadow(0 -1px 0 @toolbarBorderColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.group {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
input {
|
|
||||||
font-size: inherit;
|
|
||||||
padding: 0;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text {
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.left {
|
|
||||||
left: 0;
|
|
||||||
padding-left: 10px;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
& > div {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.right {
|
|
||||||
right: 0;
|
|
||||||
padding-right: 10px;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.center {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
flex-grow: 1;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 0 20px;
|
|
||||||
|
|
||||||
#title-doc-name {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.margin-right-small {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
.margin-right-large {
|
|
||||||
margin-right: 12px;
|
|
||||||
}
|
|
||||||
.margin-left-small {
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
.margin-left-large {
|
|
||||||
margin-left: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Logo
|
|
||||||
// -------------------------
|
|
||||||
.brand-logo {
|
|
||||||
display: block;
|
|
||||||
width: 100px;
|
|
||||||
height: 20px;
|
|
||||||
background: data-uri('../../../../common/main/resources/img/header/dark-logo_s.svg') no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
.theme-type-dark {
|
|
||||||
.brand-logo {
|
|
||||||
background: data-uri('../../../../common/main/resources/img/header/header-logo_s.svg') no-repeat;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-text-default {
|
|
||||||
width: auto;
|
|
||||||
&.colored {
|
|
||||||
padding: 0 16px;
|
|
||||||
height: 28px;
|
|
||||||
background-color: @background-accent-button-ie;
|
|
||||||
background-color: @background-accent-button;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
border-radius: 3px;
|
|
||||||
color: @text-contrast-background-ie !important;
|
|
||||||
color: @text-contrast-background !important;
|
|
||||||
font-weight: 700;
|
|
||||||
|
|
||||||
&:hover:not(.disabled),
|
|
||||||
.over:not(.disabled) {
|
|
||||||
background-color: @highlight-accent-button-hover-ie !important;
|
|
||||||
background-color: @highlight-accent-button-hover !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active:not(.disabled),
|
|
||||||
&.active:not(.disabled) {
|
|
||||||
background-color: @highlight-accent-button-pressed-ie !important;
|
|
||||||
background-color: @highlight-accent-button-pressed !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Overlay control
|
|
||||||
// -------------------------
|
|
||||||
.overlay-controls {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 55px;
|
|
||||||
z-index: 10;
|
|
||||||
left: 50%;
|
|
||||||
|
|
||||||
ul {
|
|
||||||
padding: 0;
|
|
||||||
list-style-type: none;
|
|
||||||
margin: 0 auto;
|
|
||||||
|
|
||||||
li {
|
|
||||||
display: inline-block;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlay {
|
|
||||||
width: 32px;
|
|
||||||
height: 32px;
|
|
||||||
|
|
||||||
display: inline-block;
|
|
||||||
cursor: pointer;
|
|
||||||
background-color: black;
|
|
||||||
border: 5px solid black;
|
|
||||||
border-radius: 50%;
|
|
||||||
outline: none;
|
|
||||||
opacity: 0.3;
|
|
||||||
|
|
||||||
background-origin: content-box;
|
|
||||||
padding: 1px 0 0 1px;
|
|
||||||
|
|
||||||
.box-shadow(0 0 0 2px rgba(255,255,255,0.3));
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
opacity: .6;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active, &:active {
|
|
||||||
opacity: .8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Error mask
|
|
||||||
// -------------------------
|
|
||||||
.errormask {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
border: none;
|
|
||||||
background-color: #f4f4f4;
|
|
||||||
z-index: 30002;
|
|
||||||
|
|
||||||
.error-body {
|
|
||||||
position: relative;
|
|
||||||
top: 40%;
|
|
||||||
width: 400px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 20px;
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
border: 1px solid #C0C0C0;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1.6em;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modals
|
|
||||||
// -------------------------
|
|
||||||
.share-buttons {
|
|
||||||
ul {
|
|
||||||
width: 244px;
|
|
||||||
//height: 25px;
|
|
||||||
list-style-type: none;
|
|
||||||
margin: 5px 0 0;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
li {
|
|
||||||
display: inline-block;
|
|
||||||
float: left;
|
|
||||||
margin: 1px 5px 0 0;
|
|
||||||
vertical-align: middle;
|
|
||||||
|
|
||||||
&.share-mail {
|
|
||||||
float: right;
|
|
||||||
padding-right: 1px;
|
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
a {
|
|
||||||
min-width: 64px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.glyphicon {
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.share-twitter {
|
|
||||||
max-width: 93px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.size-manual {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
|
|
||||||
.right {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
margin-top: 2px;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 1em;
|
|
||||||
padding: 0 4px;
|
|
||||||
//border-radius: 0;
|
|
||||||
margin: 0;
|
|
||||||
margin-top: -1px;
|
|
||||||
|
|
||||||
&.input-xs {
|
|
||||||
width: 50px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.socnet-btn(@index) {
|
|
||||||
background-position: -@icon-socnet-size*@index 0;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-position: -@icon-socnet-size*@index -@icon-socnet-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.svg {
|
|
||||||
background: data-uri('../../../../common/forms/resources/img/icon-social-sprite.svg');
|
|
||||||
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
background-size: @icon-socnet-size*4 @icon-socnet-size*2;
|
|
||||||
|
|
||||||
&.big-facebook:hover {
|
|
||||||
background-position: 0 -@icon-socnet-size;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.big-twitter { .socnet-btn(1); }
|
|
||||||
&.big-gplus { .socnet-btn(2); }
|
|
||||||
&.big-email { .socnet-btn(3); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@icon-width: 20px;
|
|
||||||
@icon-height: 20px;
|
|
||||||
|
|
||||||
.theme-type-dark {
|
|
||||||
@neg-value: -@icon-height;
|
|
||||||
--icon-normal-top: @neg-value;
|
|
||||||
}
|
|
||||||
@icon-normal-top: var(--icon-normal-top, 0);
|
|
||||||
|
|
||||||
.svg-icon {
|
|
||||||
background: data-uri('../../../../common/forms/resources/img/icon-menu-sprite.svg') no-repeat;
|
|
||||||
background-size: @icon-width*29 @icon-height*2;
|
|
||||||
|
|
||||||
&.download {
|
|
||||||
background-position: -@icon-width 0;
|
|
||||||
background-position: -@icon-width @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.share {
|
|
||||||
background-position: -@icon-width*2 0;
|
|
||||||
background-position: -@icon-width*2 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.embed {
|
|
||||||
background-position: -@icon-width*3 0;
|
|
||||||
background-position: -@icon-width*3 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.fullscr {
|
|
||||||
background-position: -@icon-width*4 0;
|
|
||||||
background-position: -@icon-width*4 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.zoom-in {
|
|
||||||
background-position: -@icon-width*5 0;
|
|
||||||
background-position: -@icon-width*5 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.zoom-out {
|
|
||||||
background-position: -@icon-width*6 0;
|
|
||||||
background-position: -@icon-width*6 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.zoom-up {
|
|
||||||
background-position: -@icon-width*5 -@icon-height;
|
|
||||||
}
|
|
||||||
&.zoom-down {
|
|
||||||
background-position: -@icon-width*6 -@icon-height;
|
|
||||||
}
|
|
||||||
&.slide-prev {
|
|
||||||
background-position: -@icon-width*7 -@icon-height;
|
|
||||||
}
|
|
||||||
&.slide-next {
|
|
||||||
background-position: -@icon-width*8 -@icon-height;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.play {
|
|
||||||
background-position: -@icon-width*9 -@icon-height;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.pause {
|
|
||||||
background-position: -@icon-width*10 -@icon-height;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.print {
|
|
||||||
background-position: -@icon-width*11 0;
|
|
||||||
background-position: -@icon-width*11 @icon-normal-top;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.arrow-up {
|
|
||||||
background-position: -@icon-width*17 0;
|
|
||||||
background-position: -@icon-width*17 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.arrow-down {
|
|
||||||
background-position: -@icon-width*16 0;
|
|
||||||
background-position: -@icon-width*16 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.clear-style {
|
|
||||||
background-position: -@icon-width*12 0;
|
|
||||||
background-position: -@icon-width*12 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.go-to-location {
|
|
||||||
background-position: -@icon-width*15 0;
|
|
||||||
background-position: -@icon-width*15 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.more-vertical {
|
|
||||||
background-position: -@icon-width*14 0;
|
|
||||||
background-position: -@icon-width*14 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.cut {
|
|
||||||
background-position: -@icon-width*19 0;
|
|
||||||
background-position: -@icon-width*19 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.copy {
|
|
||||||
background-position: -@icon-width*20 0;
|
|
||||||
background-position: -@icon-width*20 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.paste {
|
|
||||||
background-position: -@icon-width*21 0;
|
|
||||||
background-position: -@icon-width*21 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.undo {
|
|
||||||
background-position: -@icon-width*22 0;
|
|
||||||
background-position: -@icon-width*22 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.redo {
|
|
||||||
background-position: -@icon-width*23 0;
|
|
||||||
background-position: -@icon-width*23 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.search {
|
|
||||||
background-position: -@icon-width*24 0;
|
|
||||||
background-position: -@icon-width*24 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.btn-sheet-view {
|
|
||||||
background-position: -@icon-width*25 0;
|
|
||||||
background-position: -@icon-width*25 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.hide-password {
|
|
||||||
background-position: -@icon-width*26 0;
|
|
||||||
background-position: -@icon-width*26 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.search-close {
|
|
||||||
background-position: -@icon-width*18 0;
|
|
||||||
background-position: -@icon-width*18 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.search-arrow-up {
|
|
||||||
background-position: -@icon-width*27 0;
|
|
||||||
background-position: -@icon-width*27 @icon-normal-top;
|
|
||||||
}
|
|
||||||
&.search-arrow-down {
|
|
||||||
background-position: -@icon-width*28 0;
|
|
||||||
background-position: -@icon-width*28 @icon-normal-top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
&.active, &:active {
|
|
||||||
&:not(:disabled):not(.disabled) {
|
|
||||||
.icon {
|
|
||||||
@btn-active-icon-offset: -20px;
|
|
||||||
background-position-y: @btn-active-icon-offset;
|
|
||||||
background-position-y: var(--button-small-active-icon-offset-x, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mi-icon {
|
|
||||||
width: @icon-width;
|
|
||||||
height: @icon-height;
|
|
||||||
float: left;
|
|
||||||
margin: -3px 4px 0 -24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-dlg {
|
|
||||||
textarea {
|
|
||||||
.user-select(text);
|
|
||||||
width: 100%;
|
|
||||||
resize: none;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
border: @scaled-one-px-value-ie solid @border-regular-control-ie;
|
|
||||||
border: @scaled-one-px-value solid @border-regular-control;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
&.disabled {
|
|
||||||
opacity: @component-disabled-opacity;
|
|
||||||
cursor: default !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
label {
|
|
||||||
.font-size-normal();
|
|
||||||
font-weight: normal;
|
|
||||||
|
|
||||||
&.input-label{
|
|
||||||
margin-bottom: 0;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.header {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-control[readonly] {
|
|
||||||
cursor: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.share-buttons {
|
|
||||||
height: 40px;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
span {
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0 7px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.masked {
|
|
||||||
background-color: transparent;
|
|
||||||
border-color: transparent;
|
|
||||||
.box-shadow(none);
|
|
||||||
}
|
|
||||||
|
|
||||||
#pages {
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
line-height: 22px;
|
|
||||||
padding: 0 0 0 3px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
#page-number {
|
|
||||||
.masked {
|
|
||||||
cursor: pointer;
|
|
||||||
line-height: 22px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.submit-tooltip {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 1000;
|
|
||||||
top: 58px;
|
|
||||||
right: 15px;
|
|
||||||
|
|
||||||
padding: 7px 15px;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: @background-notification-popover-ie;
|
|
||||||
background-color: @background-notification-popover;
|
|
||||||
.box-shadow(0 4px 15px -2px rgba(0, 0, 0, 0.5));
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-zoom {
|
|
||||||
line-height: @line-height-base;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
padding: 5px 5px 5px 28px;
|
|
||||||
float: left;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 11px;
|
|
||||||
margin: 0px;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.zoom {
|
|
||||||
padding: 5px 3px;
|
|
||||||
float: right;
|
|
||||||
min-width: 40px;
|
|
||||||
text-align: center;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 11px;
|
|
||||||
padding-bottom: 0px;
|
|
||||||
}
|
|
||||||
.mi-icon {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-size-small {
|
|
||||||
.fontsize(@font-size-small);
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-size-normal {
|
|
||||||
.fontsize(@font-size-base);
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-size-large {
|
|
||||||
.fontsize(@font-size-large);
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-bar {
|
|
||||||
z-index: 50;
|
|
||||||
}
|
|
||||||
|
|
@ -40,8 +40,7 @@ Common.Locale = new(function() {
|
||||||
var loadcallback,
|
var loadcallback,
|
||||||
apply = false,
|
apply = false,
|
||||||
defLang = '{{DEFAULT_LANG}}',
|
defLang = '{{DEFAULT_LANG}}',
|
||||||
currentLang = defLang,
|
currentLang = defLang;
|
||||||
_4letterLangs = ['pt-pt', 'zh-tw'];
|
|
||||||
|
|
||||||
var _applyLocalization = function(callback) {
|
var _applyLocalization = function(callback) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -88,10 +87,6 @@ Common.Locale = new(function() {
|
||||||
return currentLang;
|
return currentLang;
|
||||||
};
|
};
|
||||||
|
|
||||||
var _getDefaultLanguage = function() {
|
|
||||||
return defLang;
|
|
||||||
};
|
|
||||||
|
|
||||||
var _getLoadedLanguage = function() {
|
var _getLoadedLanguage = function() {
|
||||||
return loadedLang;
|
return loadedLang;
|
||||||
};
|
};
|
||||||
|
|
@ -103,18 +98,12 @@ Common.Locale = new(function() {
|
||||||
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
||||||
};
|
};
|
||||||
|
|
||||||
var _requireLang = function (l) {
|
var _requireLang = function () {
|
||||||
typeof l != 'string' && (l = null);
|
var lang = (_getUrlParameterByName('lang') || defLang).split(/[\-_]/)[0];
|
||||||
var lang = (l || _getUrlParameterByName('lang') || defLang);
|
|
||||||
var idx4Letters = _4letterLangs.indexOf(lang.replace('_', '-').toLowerCase()); // try to load 4 letters language
|
|
||||||
lang = (idx4Letters<0) ? lang.split(/[\-_]/)[0] : _4letterLangs[idx4Letters];
|
|
||||||
currentLang = lang;
|
currentLang = lang;
|
||||||
fetch('locale/' + lang + '.json')
|
fetch('locale/' + lang + '.json')
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
if (idx4Letters>=0) { // try to load 2-letters language
|
|
||||||
throw new Error('4letters error');
|
|
||||||
}
|
|
||||||
currentLang = defLang;
|
currentLang = defLang;
|
||||||
if (lang != defLang)
|
if (lang != defLang)
|
||||||
/* load default lang if fetch failed */
|
/* load default lang if fetch failed */
|
||||||
|
|
@ -138,18 +127,6 @@ Common.Locale = new(function() {
|
||||||
l10n = json || {};
|
l10n = json || {};
|
||||||
apply && _applyLocalization();
|
apply && _applyLocalization();
|
||||||
}).catch(function(e) {
|
}).catch(function(e) {
|
||||||
if ( /4letters/.test(e) ) {
|
|
||||||
return setTimeout(function(){
|
|
||||||
_requireLang(lang.split(/[\-_]/)[0]);
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !/loaded/.test(e) && currentLang != defLang && defLang && defLang.length < 3 ) {
|
|
||||||
return setTimeout(function(){
|
|
||||||
_requireLang(defLang)
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
l10n = l10n || {};
|
l10n = l10n || {};
|
||||||
apply && _applyLocalization();
|
apply && _applyLocalization();
|
||||||
if ( e.message == 'loaded' ) {
|
if ( e.message == 'loaded' ) {
|
||||||
|
|
@ -174,8 +151,7 @@ Common.Locale = new(function() {
|
||||||
return {
|
return {
|
||||||
apply: _applyLocalization,
|
apply: _applyLocalization,
|
||||||
get: _get,
|
get: _get,
|
||||||
getCurrentLanguage: _getCurrentLanguage,
|
getCurrentLanguage: _getCurrentLanguage
|
||||||
getDefaultLanguage: _getDefaultLanguage
|
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,12 @@ define([
|
||||||
'common/main/lib/model/Font'
|
'common/main/lib/model/Font'
|
||||||
], function(Backbone){ 'use strict';
|
], function(Backbone){ 'use strict';
|
||||||
Common.Collections.Fonts = Backbone.Collection.extend({
|
Common.Collections.Fonts = Backbone.Collection.extend({
|
||||||
model: Common.Models.Font
|
model: Common.Models.Font,
|
||||||
|
comparator: function(item1, item2) {
|
||||||
|
var n1 = item1.get('name').toLowerCase(),
|
||||||
|
n2 = item2.get('name').toLowerCase();
|
||||||
|
if (n1==n2) return 0;
|
||||||
|
return (n1<n2) ? -1 : 1;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -64,18 +64,10 @@ define([
|
||||||
return this.filter(function(item){return item.get('online') && !item.get('view')}).length;
|
return this.filter(function(item){return item.get('online') && !item.get('view')}).length;
|
||||||
},
|
},
|
||||||
|
|
||||||
getVisibleEditingCount: function() {
|
|
||||||
return this.filter(function(item){return item.get('online') && !item.get('view') && !item.get('hidden')}).length;
|
|
||||||
},
|
|
||||||
|
|
||||||
getEditingOriginalCount: function() {
|
getEditingOriginalCount: function() {
|
||||||
return this.chain().filter(function(item){return item.get('online') && !item.get('view')}).groupBy(function(item) {return item.get('idOriginal');}).size().value();
|
return this.chain().filter(function(item){return item.get('online') && !item.get('view')}).groupBy(function(item) {return item.get('idOriginal');}).size().value();
|
||||||
},
|
},
|
||||||
|
|
||||||
getVisibleEditingOriginalCount: function() {
|
|
||||||
return this.chain().filter(function(item){return item.get('online') && !item.get('view') && !item.get('hidden')}).groupBy(function(item) {return item.get('idOriginal');}).size().value();
|
|
||||||
},
|
|
||||||
|
|
||||||
findUser: function(id) {
|
findUser: function(id) {
|
||||||
return this.find(
|
return this.find(
|
||||||
function(model){
|
function(model){
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ define([
|
||||||
'<% } %>';
|
'<% } %>';
|
||||||
|
|
||||||
var templateHugeCaption =
|
var templateHugeCaption =
|
||||||
'<button type="button" class="btn <%= cls %>" id="<%= id %>" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>> ' +
|
'<button type="button" class="btn <%= cls %>" id="<%= id %>" > ' +
|
||||||
'<div class="inner-box-icon">' +
|
'<div class="inner-box-icon">' +
|
||||||
templateBtnIcon +
|
templateBtnIcon +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
|
|
@ -205,15 +205,13 @@ define([
|
||||||
|
|
||||||
var templateHugeMenuCaption =
|
var templateHugeMenuCaption =
|
||||||
'<div class="btn-group icon-top" id="<%= id %>" style="<%= style %>">' +
|
'<div class="btn-group icon-top" id="<%= id %>" style="<%= style %>">' +
|
||||||
'<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>>' +
|
'<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown">' +
|
||||||
'<div class="inner-box-icon">' +
|
'<div class="inner-box-icon">' +
|
||||||
templateBtnIcon +
|
templateBtnIcon +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="inner-box-caption">' +
|
'<div class="inner-box-caption">' +
|
||||||
'<span class="caption"><%= caption %>' +
|
'<span class="caption"><%= caption %></span>' +
|
||||||
'<i class="caret"></i>' +
|
'<i class="caret"></i>' +
|
||||||
'</span>' +
|
|
||||||
'<i class="caret compact-caret"></i>' +
|
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</button>' +
|
'</button>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
|
|
@ -225,40 +223,14 @@ define([
|
||||||
templateBtnIcon +
|
templateBtnIcon +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'</button>' +
|
'</button>' +
|
||||||
'<button type="button" class="btn <%= cls %> inner-box-caption dropdown-toggle" data-toggle="dropdown" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>>' +
|
'<button type="button" class="btn <%= cls %> inner-box-caption dropdown-toggle" data-toggle="dropdown">' +
|
||||||
'<span class="btn-fixflex-vcenter">' +
|
'<span class="btn-fixflex-vcenter">' +
|
||||||
'<span class="caption"><%= caption %>' +
|
'<span class="caption"><%= caption %></span>' +
|
||||||
'<i class="caret"></i>' +
|
'<i class="caret"></i>' +
|
||||||
'</span>' +
|
|
||||||
'<i class="caret compact-caret"></i>' +
|
|
||||||
'</span>' +
|
'</span>' +
|
||||||
'</button>' +
|
'</button>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
|
|
||||||
var getWidthOfCaption = function (txt) {
|
|
||||||
var el = document.createElement('span');
|
|
||||||
el.style.fontSize = '11px';
|
|
||||||
el.style.fontFamily = 'Arial, Helvetica, "Helvetica Neue", sans-serif';
|
|
||||||
el.style.position = "absolute";
|
|
||||||
el.style.top = '-1000px';
|
|
||||||
el.style.left = '-1000px';
|
|
||||||
el.innerHTML = txt;
|
|
||||||
document.body.appendChild(el);
|
|
||||||
var result = el.offsetWidth;
|
|
||||||
document.body.removeChild(el);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
var getShortText = function (txt, max) {
|
|
||||||
var lastIndex = txt.length - 1,
|
|
||||||
word = txt;
|
|
||||||
while (getWidthOfCaption(word) > max) {
|
|
||||||
word = txt.slice(0, lastIndex).trim() + '...';
|
|
||||||
lastIndex--;
|
|
||||||
}
|
|
||||||
return word;
|
|
||||||
};
|
|
||||||
|
|
||||||
Common.UI.Button = Common.UI.BaseView.extend({
|
Common.UI.Button = Common.UI.BaseView.extend({
|
||||||
options : {
|
options : {
|
||||||
id : null,
|
id : null,
|
||||||
|
|
@ -273,10 +245,7 @@ define([
|
||||||
disabled : false,
|
disabled : false,
|
||||||
pressed : false,
|
pressed : false,
|
||||||
split : false,
|
split : false,
|
||||||
visible : true,
|
visible : true
|
||||||
dataHint : '',
|
|
||||||
dataHintDirection: '',
|
|
||||||
dataHintOffset: '0, 0'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
template: _.template([
|
template: _.template([
|
||||||
|
|
@ -292,13 +261,13 @@ define([
|
||||||
'}} %>',
|
'}} %>',
|
||||||
'<% } %>',
|
'<% } %>',
|
||||||
'<% if ( !menu ) { %>',
|
'<% if ( !menu ) { %>',
|
||||||
'<button type="button" class="btn <%= cls %>" id="<%= id %>" style="<%= style %>" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>>',
|
'<button type="button" class="btn <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
||||||
'<% applyicon() %>',
|
'<% applyicon() %>',
|
||||||
'<span class="caption"><%= caption %></span>',
|
'<span class="caption"><%= caption %></span>',
|
||||||
'</button>',
|
'</button>',
|
||||||
'<% } else if (split == false) {%>',
|
'<% } else if (split == false) {%>',
|
||||||
'<div class="btn-group" id="<%= id %>" style="<%= style %>">',
|
'<div class="btn-group" id="<%= id %>" style="<%= style %>">',
|
||||||
'<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>>',
|
'<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown">',
|
||||||
'<% applyicon() %>',
|
'<% applyicon() %>',
|
||||||
'<span class="caption"><%= caption %></span>',
|
'<span class="caption"><%= caption %></span>',
|
||||||
'<span class="inner-box-caret">' +
|
'<span class="inner-box-caret">' +
|
||||||
|
|
@ -312,7 +281,7 @@ define([
|
||||||
'<% applyicon() %>',
|
'<% applyicon() %>',
|
||||||
'<span class="caption"><%= caption %></span>',
|
'<span class="caption"><%= caption %></span>',
|
||||||
'</button>',
|
'</button>',
|
||||||
'<button type="button" class="btn <%= cls %> dropdown-toggle" data-toggle="dropdown" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>" <% if (dataHintTitle) { %> data-hint-title="<%= dataHintTitle %>" <% } %>>',
|
'<button type="button" class="btn <%= cls %> dropdown-toggle" data-toggle="dropdown">',
|
||||||
'<i class="caret"></i>',
|
'<i class="caret"></i>',
|
||||||
'<span class="sr-only"></span>',
|
'<span class="sr-only"></span>',
|
||||||
'</button>',
|
'</button>',
|
||||||
|
|
@ -348,37 +317,6 @@ define([
|
||||||
me.render(me.options.parentEl);
|
me.render(me.options.parentEl);
|
||||||
},
|
},
|
||||||
|
|
||||||
getCaptionWithBreaks: function (caption) {
|
|
||||||
var words = caption.split(' '),
|
|
||||||
newCaption = null,
|
|
||||||
maxWidth = 85 - 4;
|
|
||||||
if (words.length > 1) {
|
|
||||||
maxWidth = !!this.menu || this.split === true ? maxWidth - 10 : maxWidth;
|
|
||||||
if (words.length < 3) {
|
|
||||||
words[1] = getShortText(words[1], maxWidth);
|
|
||||||
newCaption = words[0] + '<br>' + words[1];
|
|
||||||
} else {
|
|
||||||
if (getWidthOfCaption(words[0] + ' ' + words[1]) < maxWidth) { // first and second words in first line
|
|
||||||
words[2] = getShortText(words[2], maxWidth);
|
|
||||||
newCaption = words[0] + ' ' + words[1] + '<br>' + words[2];
|
|
||||||
} else if (getWidthOfCaption(words[1] + ' ' + words[2]) < maxWidth) { // second and third words in second line
|
|
||||||
words[2] = getShortText(words[2], maxWidth);
|
|
||||||
newCaption = words[0] + '<br>' + words[1] + ' ' + words[2];
|
|
||||||
} else {
|
|
||||||
words[1] = getShortText(words[1] + ' ' + words[2], maxWidth);
|
|
||||||
newCaption = words[0] + '<br>' + words[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var width = getWidthOfCaption(caption);
|
|
||||||
newCaption = width < maxWidth ? caption : getShortText(caption, maxWidth);
|
|
||||||
if (!!this.menu || this.split === true) {
|
|
||||||
newCaption += '<br>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return newCaption;
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function(parentEl) {
|
render: function(parentEl) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
|
@ -400,10 +338,6 @@ define([
|
||||||
} else {
|
} else {
|
||||||
this.template = _.template(templateHugeCaption);
|
this.template = _.template(templateHugeCaption);
|
||||||
}
|
}
|
||||||
var newCaption = this.getCaptionWithBreaks(this.caption);
|
|
||||||
if (newCaption) {
|
|
||||||
me.caption = newCaption;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
me.cmpEl = $(this.template({
|
me.cmpEl = $(this.template({
|
||||||
|
|
@ -416,11 +350,7 @@ define([
|
||||||
disabled : me.disabled,
|
disabled : me.disabled,
|
||||||
pressed : me.pressed,
|
pressed : me.pressed,
|
||||||
caption : me.caption,
|
caption : me.caption,
|
||||||
style : me.style,
|
style : me.style
|
||||||
dataHint : me.options.dataHint,
|
|
||||||
dataHintDirection: me.options.dataHintDirection,
|
|
||||||
dataHintOffset: me.options.dataHintOffset,
|
|
||||||
dataHintTitle: me.options.dataHintTitle
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (me.menu && _.isObject(me.menu) && _.isFunction(me.menu.render))
|
if (me.menu && _.isObject(me.menu) && _.isFunction(me.menu.render))
|
||||||
|
|
@ -811,19 +741,15 @@ define([
|
||||||
|
|
||||||
setCaption: function(caption) {
|
setCaption: function(caption) {
|
||||||
if (this.caption != caption) {
|
if (this.caption != caption) {
|
||||||
if ( /icon-top/.test(this.cls) && !!this.caption && /huge/.test(this.cls) ) {
|
this.caption = caption;
|
||||||
var newCaption = this.getCaptionWithBreaks(caption);
|
|
||||||
this.caption = newCaption || caption;
|
|
||||||
} else
|
|
||||||
this.caption = caption;
|
|
||||||
|
|
||||||
if (this.rendered) {
|
if (this.rendered) {
|
||||||
var captionNode = this.cmpEl.find('.caption');
|
var captionNode = this.cmpEl.find('.caption');
|
||||||
|
|
||||||
if (captionNode.length > 0) {
|
if (captionNode.length > 0) {
|
||||||
captionNode.html(this.caption);
|
captionNode.text(caption);
|
||||||
} else {
|
} else {
|
||||||
this.cmpEl.find('button:first').addBack().filter('button').html(this.caption);
|
this.cmpEl.find('button:first').addBack().filter('button').text(caption);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -456,13 +456,6 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
focus: function () {
|
|
||||||
var me = this;
|
|
||||||
me.enableKeyEvents && me.monthPicker && _.delay(function() {
|
|
||||||
me.monthPicker.focus();
|
|
||||||
}, 10);
|
|
||||||
},
|
|
||||||
|
|
||||||
textJanuary: 'January',
|
textJanuary: 'January',
|
||||||
textFebruary: 'February',
|
textFebruary: 'February',
|
||||||
textMarch: 'March',
|
textMarch: 'March',
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ define([
|
||||||
value : 'unchecked',
|
value : 'unchecked',
|
||||||
|
|
||||||
template : _.template('<label class="checkbox-indeterminate"><input id="<%= id %>" type="checkbox" class="checkbox__native">' +
|
template : _.template('<label class="checkbox-indeterminate"><input id="<%= id %>" type="checkbox" class="checkbox__native">' +
|
||||||
'<label for="<%= id %>" class="checkbox__shape" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>"></label><span></span></label>'),
|
'<label for="<%= id %>" class="checkbox__shape"></label><span></span></label>'),
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize : function(options) {
|
||||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||||
|
|
@ -108,10 +108,7 @@ define([
|
||||||
var me = this;
|
var me = this;
|
||||||
if (!me.rendered) {
|
if (!me.rendered) {
|
||||||
var elem = this.template({
|
var elem = this.template({
|
||||||
id: Common.UI.getId('chb-'),
|
id: Common.UI.getId('chb-')
|
||||||
dataHint: me.options.dataHint,
|
|
||||||
dataHintDirection: me.options.dataHintDirection,
|
|
||||||
dataHintOffset: me.options.dataHintOffset
|
|
||||||
});
|
});
|
||||||
if (parentEl) {
|
if (parentEl) {
|
||||||
this.setElement(parentEl, false);
|
this.setElement(parentEl, false);
|
||||||
|
|
|
||||||
|
|
@ -39,166 +39,7 @@ define([
|
||||||
], function () {
|
], function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
Common.UI.ButtonColored = Common.UI.Button.extend(_.extend({
|
Common.UI.ColorButton = Common.UI.Button.extend(_.extend({
|
||||||
render: function(parentEl) {
|
|
||||||
Common.UI.Button.prototype.render.call(this, parentEl);
|
|
||||||
|
|
||||||
$('button:first-child', this.cmpEl).append( $('<div class="btn-color-value-line"></div>'));
|
|
||||||
this.colorEl = this.cmpEl.find('.btn-color-value-line');
|
|
||||||
|
|
||||||
if (this.options.auto)
|
|
||||||
this.autocolor = (typeof this.options.auto == 'object') ? this.options.auto.color || '000000' : '000000';
|
|
||||||
|
|
||||||
if (this.options.color!==undefined)
|
|
||||||
this.setColor(this.options.color);
|
|
||||||
},
|
|
||||||
|
|
||||||
getPicker: function(color, colors) {
|
|
||||||
if (!this.colorPicker) {
|
|
||||||
var config = {
|
|
||||||
el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
|
|
||||||
value: color,
|
|
||||||
colors: colors
|
|
||||||
};
|
|
||||||
(this.options.transparent!==undefined) && (config['transparent'] = this.options.transparent);
|
|
||||||
(this.options.hideEmptyColors!==undefined) && (config['hideEmptyColors'] = this.options.hideEmptyColors);
|
|
||||||
|
|
||||||
this.colorPicker = new Common.UI.ThemeColorPalette(config);
|
|
||||||
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
|
|
||||||
this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this));
|
|
||||||
if (this.options.auto) {
|
|
||||||
this.cmpEl.find('#' + this.menu.id + '-color-auto').on('click', _.bind(this.onAutoColorSelect, this));
|
|
||||||
this.colorAuto = this.cmpEl.find('#' + this.menu.id + '-color-auto > a');
|
|
||||||
(color == 'auto') && this.setAutoColor(true);
|
|
||||||
}
|
|
||||||
this.initInnerMenu();
|
|
||||||
}
|
|
||||||
return this.colorPicker;
|
|
||||||
},
|
|
||||||
|
|
||||||
setPicker: function(picker) {
|
|
||||||
this.colorPicker = picker;
|
|
||||||
},
|
|
||||||
|
|
||||||
getMenu: function(options) {
|
|
||||||
if (typeof this.menu !== 'object') {
|
|
||||||
options = options || this.options;
|
|
||||||
var height = options.paletteHeight ? options.paletteHeight + 'px' : 'auto',
|
|
||||||
id = Common.UI.getId(),
|
|
||||||
auto = [];
|
|
||||||
if (options.auto) {
|
|
||||||
this.autocolor = (typeof options.auto == 'object') ? options.auto.color || '000000' : '000000';
|
|
||||||
auto.push({
|
|
||||||
id: id + '-color-auto',
|
|
||||||
caption: (typeof options.auto == 'object') ? options.auto.caption || this.textAutoColor : this.textAutoColor,
|
|
||||||
template: _.template('<a tabindex="-1" type="menuitem"><span class="menu-item-icon color-auto" style="background-image: none; width: 12px; height: 12px; margin: 1px 7px 0 1px; background-color: #' + this.autocolor + ';"></span><%= caption %></a>')
|
|
||||||
});
|
|
||||||
auto.push({caption: '--'});
|
|
||||||
}
|
|
||||||
|
|
||||||
var menu = new Common.UI.Menu({
|
|
||||||
id: id,
|
|
||||||
cls: 'shifted-left',
|
|
||||||
additionalAlign: options.additionalAlign,
|
|
||||||
items: (options.additionalItems ? options.additionalItems : []).concat(auto).concat([
|
|
||||||
{ template: _.template('<div id="' + id + '-color-menu" style="width: 164px; height:' + height + '; display: inline-block;"></div>') },
|
|
||||||
{caption: '--'},
|
|
||||||
{
|
|
||||||
id: id + '-color-new',
|
|
||||||
template: _.template('<a tabindex="-1" type="menuitem" style="">' + this.textNewColor + '</a>')
|
|
||||||
}
|
|
||||||
])
|
|
||||||
});
|
|
||||||
this.initInnerMenu();
|
|
||||||
var me = this;
|
|
||||||
menu.on('keydown:before', _.bind(this.onBeforeKeyDown, this));
|
|
||||||
menu.on('show:after', function(menu) {
|
|
||||||
me.colorPicker && _.delay(function() {
|
|
||||||
me.colorPicker.showLastSelected();
|
|
||||||
!(options.additionalItems || options.auto) && me.colorPicker.focus();
|
|
||||||
}, 10);
|
|
||||||
}).on('hide:after', function() {
|
|
||||||
if (me.options.takeFocusOnClose) {
|
|
||||||
setTimeout(function(){me.focus();}, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return menu;
|
|
||||||
}
|
|
||||||
return this.menu;
|
|
||||||
},
|
|
||||||
|
|
||||||
initInnerMenu: function() {
|
|
||||||
if (!this.colorPicker || typeof this.menu !== 'object') return;
|
|
||||||
|
|
||||||
var index = (this.options.additionalItems || []).length + (this.options.auto ? 2 : 0);
|
|
||||||
this.colorPicker.outerMenu = {menu: this.menu, index: index};
|
|
||||||
this.menu.setInnerMenu([{menu: this.colorPicker, index: index}]);
|
|
||||||
},
|
|
||||||
|
|
||||||
setMenu: function (m) {
|
|
||||||
m = m || this.getMenu();
|
|
||||||
Common.UI.Button.prototype.setMenu.call(this, m);
|
|
||||||
this.getPicker(this.options.color, this.options.colors);
|
|
||||||
},
|
|
||||||
|
|
||||||
onColorSelect: function(picker, color) {
|
|
||||||
this.setColor(color);
|
|
||||||
this.setAutoColor(false);
|
|
||||||
this.trigger('color:select', this, color);
|
|
||||||
},
|
|
||||||
|
|
||||||
setColor: function(color) {
|
|
||||||
if (color == 'auto' && this.options.auto)
|
|
||||||
color = this.autocolor;
|
|
||||||
this.color = color;
|
|
||||||
|
|
||||||
if (this.colorEl) {
|
|
||||||
this.colorEl.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
|
|
||||||
this.colorEl.toggleClass('bordered', color=='transparent');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setAutoColor: function(selected) {
|
|
||||||
if (!this.colorAuto) return;
|
|
||||||
if (selected && !this.colorAuto.hasClass('selected'))
|
|
||||||
this.colorAuto.addClass('selected');
|
|
||||||
else if (!selected && this.colorAuto.hasClass('selected'))
|
|
||||||
this.colorAuto.removeClass('selected');
|
|
||||||
},
|
|
||||||
|
|
||||||
isAutoColor: function() {
|
|
||||||
return this.colorAuto && this.colorAuto.hasClass('selected');
|
|
||||||
},
|
|
||||||
|
|
||||||
onAutoColorSelect: function() {
|
|
||||||
this.setColor('auto');
|
|
||||||
this.setAutoColor(true);
|
|
||||||
this.colorPicker && this.colorPicker.clearSelection();
|
|
||||||
this.trigger('auto:select', this, this.autocolor);
|
|
||||||
},
|
|
||||||
|
|
||||||
addNewColor: function() {
|
|
||||||
this.colorPicker && this.colorPicker.addNewColor((typeof(this.color) == 'object') ? this.color.color : this.color);
|
|
||||||
},
|
|
||||||
|
|
||||||
onBeforeKeyDown: function(menu, e) {
|
|
||||||
if ((e.keyCode == Common.UI.Keys.DOWN || e.keyCode == Common.UI.Keys.SPACE) && !this.isMenuOpen()) {
|
|
||||||
$('button', this.cmpEl).click();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
isMenuOpen: function() {
|
|
||||||
return this.cmpEl.hasClass('open');
|
|
||||||
},
|
|
||||||
|
|
||||||
textNewColor: 'Add New Custom Color',
|
|
||||||
textAutoColor: 'Automatic'
|
|
||||||
|
|
||||||
}, Common.UI.ButtonColored || {}));
|
|
||||||
|
|
||||||
|
|
||||||
Common.UI.ColorButton = Common.UI.ButtonColored.extend(_.extend({
|
|
||||||
options : {
|
options : {
|
||||||
id : null,
|
id : null,
|
||||||
hint : false,
|
hint : false,
|
||||||
|
|
@ -217,7 +58,7 @@ define([
|
||||||
|
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<div class="btn-group" id="<%= id %>">',
|
'<div class="btn-group" id="<%= id %>">',
|
||||||
'<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">',
|
'<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">',
|
||||||
'<span> </span>',
|
'<span> </span>',
|
||||||
'<span class="inner-box-caret">',
|
'<span class="inner-box-caret">',
|
||||||
'<i class="caret"></i>',
|
'<i class="caret"></i>',
|
||||||
|
|
@ -249,6 +90,12 @@ define([
|
||||||
this.setColor(this.options.color);
|
this.setColor(this.options.color);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onColorSelect: function(picker, color) {
|
||||||
|
this.setColor(color);
|
||||||
|
this.setAutoColor(false);
|
||||||
|
this.trigger('color:select', this, color);
|
||||||
|
},
|
||||||
|
|
||||||
setColor: function(color) {
|
setColor: function(color) {
|
||||||
if (color == 'auto' && this.options.auto)
|
if (color == 'auto' && this.options.auto)
|
||||||
color = this.autocolor;
|
color = this.autocolor;
|
||||||
|
|
@ -259,9 +106,105 @@ define([
|
||||||
span.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
|
span.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
|
||||||
},
|
},
|
||||||
|
|
||||||
focus: function() {
|
getPicker: function(color, colors) {
|
||||||
$('button', this.cmpEl).focus();
|
if (!this.colorPicker) {
|
||||||
}
|
this.colorPicker = new Common.UI.ThemeColorPalette({
|
||||||
|
el: this.cmpEl.find('#' + this.menu.id + '-color-menu'),
|
||||||
|
transparent: this.options.transparent,
|
||||||
|
value: color,
|
||||||
|
colors: colors
|
||||||
|
});
|
||||||
|
this.colorPicker.on('select', _.bind(this.onColorSelect, this));
|
||||||
|
this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this));
|
||||||
|
if (this.options.auto) {
|
||||||
|
this.cmpEl.find('#' + this.menu.id + '-color-auto').on('click', _.bind(this.onAutoColorSelect, this));
|
||||||
|
this.colorAuto = this.cmpEl.find('#' + this.menu.id + '-color-auto > a');
|
||||||
|
(color == 'auto') && this.setAutoColor(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this.colorPicker;
|
||||||
|
},
|
||||||
|
|
||||||
|
getMenu: function(options) {
|
||||||
|
if (typeof this.menu !== 'object') {
|
||||||
|
options = options || this.options;
|
||||||
|
var height = options.paletteHeight || 216,
|
||||||
|
id = Common.UI.getId(),
|
||||||
|
auto = [];
|
||||||
|
if (options.auto) {
|
||||||
|
this.autocolor = (typeof options.auto == 'object') ? options.auto.color || '000000' : '000000';
|
||||||
|
auto.push({
|
||||||
|
id: id + '-color-auto',
|
||||||
|
caption: (typeof options.auto == 'object') ? options.auto.caption || this.textAutoColor : this.textAutoColor,
|
||||||
|
template: _.template('<a tabindex="-1" type="menuitem"><span class="menu-item-icon color-auto" style="background-image: none; width: 12px; height: 12px; margin: 1px 7px 0 1px; background-color: #' + this.autocolor + ';"></span><%= caption %></a>')
|
||||||
|
});
|
||||||
|
auto.push({caption: '--'});
|
||||||
|
}
|
||||||
|
|
||||||
|
var menu = new Common.UI.Menu({
|
||||||
|
id: id,
|
||||||
|
cls: 'shifted-left',
|
||||||
|
additionalAlign: options.additionalAlign,
|
||||||
|
items: (options.additionalItems ? options.additionalItems : []).concat(auto).concat([
|
||||||
|
{ template: _.template('<div id="' + id + '-color-menu" style="width: 169px; height:' + height + 'px; margin: 10px;"></div>') },
|
||||||
|
{ template: _.template('<a id="' + id + '-color-new" style="">' + this.textNewColor + '</a>') }
|
||||||
|
])
|
||||||
|
});
|
||||||
|
return menu;
|
||||||
|
}
|
||||||
|
return this.menu;
|
||||||
|
},
|
||||||
|
|
||||||
|
setMenu: function (m) {
|
||||||
|
m = m || this.getMenu();
|
||||||
|
Common.UI.Button.prototype.setMenu.call(this, m);
|
||||||
|
this.getPicker(this.options.color, this.options.colors);
|
||||||
|
},
|
||||||
|
|
||||||
|
addNewColor: function() {
|
||||||
|
this.colorPicker && this.colorPicker.addNewColor((typeof(this.color) == 'object') ? this.color.color : this.color);
|
||||||
|
},
|
||||||
|
|
||||||
|
onAutoColorSelect: function() {
|
||||||
|
this.setColor('auto');
|
||||||
|
this.setAutoColor(true);
|
||||||
|
this.colorPicker && this.colorPicker.clearSelection();
|
||||||
|
this.trigger('auto:select', this, this.autocolor);
|
||||||
|
},
|
||||||
|
|
||||||
|
setAutoColor: function(selected) {
|
||||||
|
if (!this.colorAuto) return;
|
||||||
|
if (selected && !this.colorAuto.hasClass('selected'))
|
||||||
|
this.colorAuto.addClass('selected');
|
||||||
|
else if (!selected && this.colorAuto.hasClass('selected'))
|
||||||
|
this.colorAuto.removeClass('selected');
|
||||||
|
},
|
||||||
|
|
||||||
|
isAutoColor: function() {
|
||||||
|
return this.colorAuto && this.colorAuto.hasClass('selected');
|
||||||
|
},
|
||||||
|
|
||||||
|
textNewColor: 'Add New Custom Color',
|
||||||
|
textAutoColor: 'Automatic'
|
||||||
|
|
||||||
}, Common.UI.ColorButton || {}));
|
}, Common.UI.ColorButton || {}));
|
||||||
|
|
||||||
|
|
||||||
|
Common.UI.ButtonColored = Common.UI.Button.extend(_.extend({
|
||||||
|
render: function(parentEl) {
|
||||||
|
Common.UI.Button.prototype.render.call(this, parentEl);
|
||||||
|
|
||||||
|
$('button:first-child', this.cmpEl).append( $('<div class="btn-color-value-line"></div>'));
|
||||||
|
this.colorEl = this.cmpEl.find('.btn-color-value-line');
|
||||||
|
},
|
||||||
|
|
||||||
|
setColor: function(color) {
|
||||||
|
if (this.colorEl) {
|
||||||
|
this.colorEl.css({'background-color': (color=='transparent') ? color : ((typeof(color) == 'object') ? '#'+color.color : '#'+color)});
|
||||||
|
this.colorEl.toggleClass('bordered', color=='transparent');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, Common.UI.ButtonColored || {}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -77,7 +77,7 @@ define([
|
||||||
Common.UI.ComboBorderSize = Common.UI.ComboBox.extend(_.extend({
|
Common.UI.ComboBorderSize = Common.UI.ComboBox.extend(_.extend({
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
'<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
||||||
'<div class="form-control" style="<%= style %>" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">',
|
'<div class="form-control" style="<%= style %>">',
|
||||||
'<i class="image"></i>',
|
'<i class="image"></i>',
|
||||||
'<span class="text"></span>',
|
'<span class="text"></span>',
|
||||||
'</div>',
|
'</div>',
|
||||||
|
|
@ -122,7 +122,6 @@ define([
|
||||||
|
|
||||||
render : function(parentEl) {
|
render : function(parentEl) {
|
||||||
Common.UI.ComboBox.prototype.render.call(this, parentEl);
|
Common.UI.ComboBox.prototype.render.call(this, parentEl);
|
||||||
this._formControl = this.cmpEl.find('.form-control');
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -173,17 +172,13 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
focus: function() {
|
|
||||||
this._formControl && this._formControl.focus();
|
|
||||||
},
|
|
||||||
|
|
||||||
txtNoBorders: 'No Borders'
|
txtNoBorders: 'No Borders'
|
||||||
}, Common.UI.ComboBorderSize || {}));
|
}, Common.UI.ComboBorderSize || {}));
|
||||||
|
|
||||||
Common.UI.ComboBorderSizeEditable = Common.UI.ComboBox.extend(_.extend({
|
Common.UI.ComboBorderSizeEditable = Common.UI.ComboBox.extend(_.extend({
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<span class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
'<span class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
||||||
'<input type="text" class="form-control text" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">',
|
'<input type="text" class="form-control text">',
|
||||||
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
|
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
|
||||||
'<span class="caret"></span>',
|
'<span class="caret"></span>',
|
||||||
'</button>',
|
'</button>',
|
||||||
|
|
@ -235,7 +230,7 @@ define([
|
||||||
Common.UI.ComboBorderType = Common.UI.ComboBorderSize.extend(_.extend({
|
Common.UI.ComboBorderType = Common.UI.ComboBorderSize.extend(_.extend({
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
'<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
||||||
'<div class="form-control" style="<%= style %>" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">',
|
'<div class="form-control" style="<%= style %>">',
|
||||||
'<i class="image"></i>',
|
'<i class="image"></i>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div style="display: table-cell;"></div>',
|
'<div style="display: table-cell;"></div>',
|
||||||
|
|
@ -277,24 +272,8 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
updateFormControl: function(record) {
|
updateFormControl: function(record) {
|
||||||
if (record)
|
$(this.el).find('.form-control > .image')
|
||||||
$(this.el).find('.form-control > .image')
|
.css('background-position', '10px -' + record.get('offsety') + 'px');
|
||||||
.css('background-position', '10px -' + record.get('offsety') + 'px').show();
|
|
||||||
else
|
|
||||||
$(this.el).find('.form-control > .image').hide();
|
|
||||||
},
|
|
||||||
|
|
||||||
setValue: function(value) {
|
|
||||||
this._selectedItem = (value===null || value===undefined) ? undefined : _.find(this.store.models, function(item) {
|
|
||||||
if ( value<item.attributes.value+0.01 && value>item.attributes.value-0.01) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.selected', $(this.el)).removeClass('selected');
|
|
||||||
|
|
||||||
this.updateFormControl(this._selectedItem);
|
|
||||||
this._selectedItem && $('#' + this._selectedItem.get('id'), $(this.el)).addClass('selected');
|
|
||||||
}
|
}
|
||||||
}, Common.UI.ComboBorderType || {}));
|
}, Common.UI.ComboBorderType || {}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,15 +87,12 @@ define([
|
||||||
valueField : 'value',
|
valueField : 'value',
|
||||||
search : false,
|
search : false,
|
||||||
scrollAlwaysVisible: false,
|
scrollAlwaysVisible: false,
|
||||||
takeFocusOnClose: false,
|
takeFocusOnClose: false
|
||||||
dataHint: '',
|
|
||||||
dataHintDirection: '',
|
|
||||||
dataHintOffset: ''
|
|
||||||
},
|
},
|
||||||
|
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<span class="input-group combobox <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
'<span class="input-group combobox <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
||||||
'<input type="text" class="form-control" spellcheck="false" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">',
|
'<input type="text" class="form-control" spellcheck="false">',
|
||||||
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
|
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">',
|
||||||
'<span class="caret"></span>',
|
'<span class="caret"></span>',
|
||||||
'</button>',
|
'</button>',
|
||||||
|
|
@ -150,10 +147,7 @@ define([
|
||||||
menuCls : this.menuCls,
|
menuCls : this.menuCls,
|
||||||
menuStyle : this.menuStyle,
|
menuStyle : this.menuStyle,
|
||||||
items : items,
|
items : items,
|
||||||
scope : me,
|
scope : me
|
||||||
dataHint : this.options.dataHint,
|
|
||||||
dataHintDirection: this.options.dataHintDirection,
|
|
||||||
dataHintOffset: this.options.dataHintOffset
|
|
||||||
}));
|
}));
|
||||||
if (this.itemsTemplate)
|
if (this.itemsTemplate)
|
||||||
this.cmpEl.find('ul').html(
|
this.cmpEl.find('ul').html(
|
||||||
|
|
@ -190,7 +184,6 @@ define([
|
||||||
el.on('click', '.form-control', _.bind(this.onInputClick, this));
|
el.on('click', '.form-control', _.bind(this.onInputClick, this));
|
||||||
this._input.attr('readonly', 'readonly');
|
this._input.attr('readonly', 'readonly');
|
||||||
this._input.attr('data-can-copy', false);
|
this._input.attr('data-can-copy', false);
|
||||||
this._input.on('mousedown',function (e){e.preventDefault();})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me.options.hint) {
|
if (me.options.hint) {
|
||||||
|
|
@ -358,9 +351,6 @@ define([
|
||||||
Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl);
|
Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl);
|
||||||
if (this.options.takeFocusOnClose) {
|
if (this.options.takeFocusOnClose) {
|
||||||
var me = this;
|
var me = this;
|
||||||
(me._input && me._input.length>0 && !me.editable) && (me._input[0].selectionStart===me._input[0].selectionEnd) && setTimeout(function() {
|
|
||||||
me._input[0].selectionStart = me._input[0].selectionEnd = 0;
|
|
||||||
},1);
|
|
||||||
setTimeout(function(){me.focus();}, 1);
|
setTimeout(function(){me.focus();}, 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -548,7 +538,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
setDisabled: function(disabled) {
|
||||||
disabled = !!disabled;
|
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
|
|
||||||
if (!this.rendered)
|
if (!this.rendered)
|
||||||
|
|
|
||||||
|
|
@ -49,29 +49,24 @@ define([
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
Common.UI.ComboBoxFonts = Common.UI.ComboBox.extend((function() {
|
Common.UI.ComboBoxFonts = Common.UI.ComboBox.extend((function() {
|
||||||
var iconWidth = 300,
|
var iconWidth = 302,
|
||||||
iconHeight = Asc.FONT_THUMBNAIL_HEIGHT || 28,
|
iconHeight = Asc.FONT_THUMBNAIL_HEIGHT || 26,
|
||||||
thumbCanvas = document.createElement('canvas'),
|
thumbCanvas = document.createElement('canvas'),
|
||||||
thumbContext = thumbCanvas.getContext('2d'),
|
thumbContext = thumbCanvas.getContext('2d'),
|
||||||
postfix = (/^(zh|ja|ko)$/i.test(Common.Locale.getCurrentLanguage())) ? '_ea' : '',
|
|
||||||
thumbs = [
|
thumbs = [
|
||||||
{ratio: 1, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '.png', width: iconWidth, height: iconHeight},
|
{ratio: 1, path: '../../../../sdkjs/common/Images/fonts_thumbnail.png', width: iconWidth, height: iconHeight},
|
||||||
{ratio: 1.25, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@1.25x.png', width: iconWidth * 1.25, height: iconHeight * 1.25},
|
{ratio: 1.5, path: '../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: iconWidth * 1.5, height: iconHeight * 1.5},
|
||||||
{ratio: 1.5, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@1.5x.png', width: iconWidth * 1.5, height: iconHeight * 1.5},
|
{ratio: 2, path: '../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: iconWidth * 2, height: iconHeight * 2}
|
||||||
{ratio: 1.75, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@1.75x.png', width: iconWidth * 1.75, height: iconHeight * 1.75},
|
|
||||||
{ratio: 2, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@2x.png', width: iconWidth * 2, height: iconHeight * 2}
|
|
||||||
],
|
],
|
||||||
thumbIdx = 0,
|
thumbIdx = 0,
|
||||||
listItemHeight = 28,
|
listItemHeight = 26,
|
||||||
spriteCols = 1,
|
spriteCols = 1,
|
||||||
applicationPixelRatio = Common.Utils.applicationPixelRatio();
|
applicationPixelRatio = Common.Utils.applicationPixelRatio();
|
||||||
|
|
||||||
if ( Common.Controllers.Desktop.isActive() ) {
|
if (typeof window['AscDesktopEditor'] === 'object') {
|
||||||
thumbs[0].path = Common.Controllers.Desktop.call('getFontsSprite');
|
thumbs[0].path = window['AscDesktopEditor'].getFontsSprite('');
|
||||||
thumbs[1].path = Common.Controllers.Desktop.call('getFontsSprite', '@1.25x');
|
thumbs[1].path = window['AscDesktopEditor'].getFontsSprite('@1.5x');
|
||||||
thumbs[2].path = Common.Controllers.Desktop.call('getFontsSprite', '@1.5x');
|
thumbs[2].path = window['AscDesktopEditor'].getFontsSprite('@2x');
|
||||||
thumbs[3].path = Common.Controllers.Desktop.call('getFontsSprite', '@1.75x');
|
|
||||||
thumbs[4].path = Common.Controllers.Desktop.call('getFontsSprite', '@2x');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var bestDistance = Math.abs(applicationPixelRatio-thumbs[0].ratio);
|
var bestDistance = Math.abs(applicationPixelRatio-thumbs[0].ratio);
|
||||||
|
|
@ -88,205 +83,10 @@ define([
|
||||||
thumbCanvas.height = thumbs[thumbIdx].height;
|
thumbCanvas.height = thumbs[thumbIdx].height;
|
||||||
thumbCanvas.width = thumbs[thumbIdx].width;
|
thumbCanvas.width = thumbs[thumbIdx].width;
|
||||||
|
|
||||||
function CThumbnailLoader() {
|
|
||||||
this.supportBinaryFormat = !(Common.Controllers.Desktop.isActive() && !Common.Controllers.Desktop.isFeatureAvailable('isSupportBinaryFontsSprite'));
|
|
||||||
// наш формат - альфамаска с сжатием типа rle для полностью прозрачных пикселов
|
|
||||||
|
|
||||||
this.image = null;
|
|
||||||
this.binaryFormat = null;
|
|
||||||
this.data = null;
|
|
||||||
this.width = 0;
|
|
||||||
this.height = 0;
|
|
||||||
this.heightOne = 0;
|
|
||||||
this.count = 0;
|
|
||||||
this.offsets = null;
|
|
||||||
|
|
||||||
this.load = function(url, callback) {
|
|
||||||
if (!callback)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!this.supportBinaryFormat) {
|
|
||||||
this.width = thumbs[thumbIdx].width;
|
|
||||||
this.heightOne = thumbs[thumbIdx].height;
|
|
||||||
|
|
||||||
this.image = new Image();
|
|
||||||
this.image.onload = callback;
|
|
||||||
this.image.src = thumbs[thumbIdx].path;
|
|
||||||
} else {
|
|
||||||
var me = this;
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('GET', url + ".bin", true);
|
|
||||||
xhr.responseType = 'arraybuffer';
|
|
||||||
|
|
||||||
if (xhr.overrideMimeType)
|
|
||||||
xhr.overrideMimeType('text/plain; charset=x-user-defined');
|
|
||||||
else
|
|
||||||
xhr.setRequestHeader('Accept-Charset', 'x-user-defined');
|
|
||||||
|
|
||||||
xhr.onload = function() {
|
|
||||||
// TODO: check errors
|
|
||||||
me.binaryFormat = new Uint8Array(this.response);
|
|
||||||
callback();
|
|
||||||
};
|
|
||||||
|
|
||||||
xhr.send(null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.openBinary = function(arrayBuffer) {
|
|
||||||
//var t1 = performance.now();
|
|
||||||
|
|
||||||
var binaryAlpha = this.binaryFormat;
|
|
||||||
this.width = (binaryAlpha[0] << 24) | (binaryAlpha[1] << 16) | (binaryAlpha[2] << 8) | (binaryAlpha[3] << 0);
|
|
||||||
this.heightOne = (binaryAlpha[4] << 24) | (binaryAlpha[5] << 16) | (binaryAlpha[6] << 8) | (binaryAlpha[7] << 0);
|
|
||||||
this.count = (binaryAlpha[8] << 24) | (binaryAlpha[9] << 16) | (binaryAlpha[10] << 8) | (binaryAlpha[11] << 0);
|
|
||||||
this.height = this.count * this.heightOne;
|
|
||||||
|
|
||||||
var MAX_MEMORY_SIZE = 50000000;
|
|
||||||
var memorySize = 4 * this.width * this.height;
|
|
||||||
var isOffsets = (memorySize > MAX_MEMORY_SIZE) ? true : false;
|
|
||||||
|
|
||||||
if (!isOffsets)
|
|
||||||
this.data = new Uint8ClampedArray(memorySize);
|
|
||||||
else
|
|
||||||
this.offsets = new Array(this.count);
|
|
||||||
|
|
||||||
var binaryIndex = 12;
|
|
||||||
var binaryLen = binaryAlpha.length;
|
|
||||||
var index = 0;
|
|
||||||
|
|
||||||
var len0 = 0;
|
|
||||||
var tmpValue = 0;
|
|
||||||
|
|
||||||
if (!isOffsets) {
|
|
||||||
var imagePixels = this.data;
|
|
||||||
while (binaryIndex < binaryLen) {
|
|
||||||
tmpValue = binaryAlpha[binaryIndex++];
|
|
||||||
if (0 == tmpValue) {
|
|
||||||
len0 = binaryAlpha[binaryIndex++];
|
|
||||||
while (len0 > 0) {
|
|
||||||
len0--;
|
|
||||||
imagePixels[index] = imagePixels[index + 1] = imagePixels[index + 2] = 255;
|
|
||||||
imagePixels[index + 3] = 0; // this value is already 0.
|
|
||||||
index += 4;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
imagePixels[index] = imagePixels[index + 1] = imagePixels[index + 2] = 255 - tmpValue;
|
|
||||||
imagePixels[index + 3] = tmpValue;
|
|
||||||
index += 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var module = this.width * this.heightOne;
|
|
||||||
var moduleCur = module - 1;
|
|
||||||
while (binaryIndex < binaryLen) {
|
|
||||||
tmpValue = binaryAlpha[binaryIndex++];
|
|
||||||
if (0 == tmpValue) {
|
|
||||||
len0 = binaryAlpha[binaryIndex++];
|
|
||||||
while (len0 > 0) {
|
|
||||||
len0--;
|
|
||||||
moduleCur++;
|
|
||||||
if (moduleCur === module) {
|
|
||||||
this.offsets[index++] = { pos : binaryIndex, len : len0 + 1 };
|
|
||||||
moduleCur = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
moduleCur++;
|
|
||||||
if (moduleCur === module) {
|
|
||||||
this.offsets[index++] = { pos : binaryIndex - 1, len : -1 };
|
|
||||||
moduleCur = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.offsets)
|
|
||||||
delete this.binaryFormat;
|
|
||||||
|
|
||||||
//var t2 = performance.now();
|
|
||||||
//console.log(t2 - t1);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getImage = function(index, canvas, ctx) {
|
|
||||||
|
|
||||||
//var t1 = performance.now();
|
|
||||||
if (!canvas)
|
|
||||||
{
|
|
||||||
canvas = document.createElement("canvas");
|
|
||||||
canvas.width = this.width;
|
|
||||||
canvas.height = this.heightOne;
|
|
||||||
canvas.style.width = iconWidth + "px";
|
|
||||||
canvas.style.height = iconHeight + "px";
|
|
||||||
|
|
||||||
ctx = canvas.getContext("2d");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.supportBinaryFormat) {
|
|
||||||
if (!this.data && !this.offsets) {
|
|
||||||
this.openBinary(this.binaryFormat);
|
|
||||||
}
|
|
||||||
|
|
||||||
var dataTmp = ctx.createImageData(this.width, this.heightOne);
|
|
||||||
var sizeImage = 4 * this.width * this.heightOne;
|
|
||||||
|
|
||||||
if (!this.offsets) {
|
|
||||||
dataTmp.data.set(new Uint8ClampedArray(this.data.buffer, index * sizeImage, sizeImage));
|
|
||||||
} else {
|
|
||||||
var binaryAlpha = this.binaryFormat;
|
|
||||||
var binaryIndex = this.offsets[index].pos;
|
|
||||||
var alphaChannel = 0;
|
|
||||||
var pixelsCount = this.width * this.heightOne;
|
|
||||||
var tmpValue = 0, len0 = 0;
|
|
||||||
var imagePixels = dataTmp.data;
|
|
||||||
if (-1 != this.offsets[index].len) {
|
|
||||||
/*
|
|
||||||
// this values is already 0.
|
|
||||||
for (var i = 0; i < this.offsets[index].len; i++) {
|
|
||||||
pixels[alphaChannel] = 0;
|
|
||||||
alphaChannel += 4;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
alphaChannel += 4 * this.offsets[index].len;
|
|
||||||
}
|
|
||||||
while (pixelsCount > 0) {
|
|
||||||
tmpValue = binaryAlpha[binaryIndex++];
|
|
||||||
if (0 == tmpValue) {
|
|
||||||
len0 = binaryAlpha[binaryIndex++];
|
|
||||||
if (len0 > pixelsCount)
|
|
||||||
len0 = pixelsCount;
|
|
||||||
while (len0 > 0) {
|
|
||||||
len0--;
|
|
||||||
imagePixels[alphaChannel] = imagePixels[alphaChannel + 1] = imagePixels[alphaChannel + 2] = 255;
|
|
||||||
imagePixels[alphaChannel + 3] = 0; // this value is already 0.
|
|
||||||
alphaChannel += 4;
|
|
||||||
pixelsCount--;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
imagePixels[alphaChannel] = imagePixels[alphaChannel + 1] = imagePixels[alphaChannel + 2] = 255 - tmpValue;
|
|
||||||
imagePixels[alphaChannel + 3] = tmpValue;
|
|
||||||
alphaChannel += 4;
|
|
||||||
pixelsCount--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ctx.putImageData(dataTmp, 0, 0);
|
|
||||||
} else {
|
|
||||||
ctx.clearRect(0, 0, this.width, this.heightOne);
|
|
||||||
ctx.drawImage(this.image, 0, -this.heightOne * index);
|
|
||||||
}
|
|
||||||
|
|
||||||
//var t2 = performance.now();
|
|
||||||
//console.log(t2 - t1);
|
|
||||||
|
|
||||||
return canvas;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<div class="input-group combobox fonts <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
'<div class="input-group combobox fonts <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
||||||
'<input type="text" class="form-control" spellcheck="false" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>"> ',
|
'<input type="text" class="form-control" spellcheck="false"> ',
|
||||||
'<div style="display: table-cell;"></div>',
|
'<div style="display: table-cell;"></div>',
|
||||||
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>',
|
'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>',
|
||||||
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
|
'<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',
|
||||||
|
|
@ -377,7 +177,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onInputKeyUp: function(e) {
|
onInputKeyUp: function(e) {
|
||||||
if (!this._isKeyDown) return;
|
|
||||||
if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode !== Common.UI.Keys.SHIFT &&
|
if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode !== Common.UI.Keys.SHIFT &&
|
||||||
e.keyCode !== Common.UI.Keys.CTRL && e.keyCode !== Common.UI.Keys.ALT &&
|
e.keyCode !== Common.UI.Keys.CTRL && e.keyCode !== Common.UI.Keys.ALT &&
|
||||||
e.keyCode !== Common.UI.Keys.LEFT && e.keyCode !== Common.UI.Keys.RIGHT &&
|
e.keyCode !== Common.UI.Keys.LEFT && e.keyCode !== Common.UI.Keys.RIGHT &&
|
||||||
|
|
@ -409,11 +208,9 @@ define([
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._isKeyDown = false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onInputKeyDown: function(e) {
|
onInputKeyDown: function(e) {
|
||||||
this._isKeyDown = true;
|
|
||||||
this._inInputKeyDown = (new Date());
|
this._inInputKeyDown = (new Date());
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
|
@ -424,10 +221,8 @@ define([
|
||||||
me.onAfterHideMenu(e);
|
me.onAfterHideMenu(e);
|
||||||
}, 10);
|
}, 10);
|
||||||
} else if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode != Common.UI.Keys.CTRL && e.keyCode != Common.UI.Keys.SHIFT && e.keyCode != Common.UI.Keys.ALT && e.keyCode != Common.UI.Keys.TAB){
|
} else if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode != Common.UI.Keys.CTRL && e.keyCode != Common.UI.Keys.SHIFT && e.keyCode != Common.UI.Keys.ALT && e.keyCode != Common.UI.Keys.TAB){
|
||||||
if (!this.isMenuOpen() && !e.ctrlKey) {
|
if (!this.isMenuOpen() && !e.ctrlKey)
|
||||||
this.openMenu();
|
this.openMenu();
|
||||||
(this.recent > 0) && this.flushVisibleFontsTiles();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) {
|
if (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) {
|
||||||
_.delay(function() {
|
_.delay(function() {
|
||||||
|
|
@ -500,8 +295,10 @@ define([
|
||||||
return img != null ? img[0].src : undefined;
|
return img != null ? img[0].src : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
var index = Math.floor(opts.imgidx/spriteCols);
|
thumbContext.clearRect(0, 0, thumbs[thumbIdx].width, thumbs[thumbIdx].height);
|
||||||
return this.spriteThumbs.getImage(index, thumbCanvas, thumbContext).toDataURL();
|
thumbContext.drawImage(this.spriteThumbs, 0, -thumbs[thumbIdx].height * Math.floor(opts.imgidx/spriteCols));
|
||||||
|
|
||||||
|
return thumbCanvas.toDataURL();
|
||||||
},
|
},
|
||||||
|
|
||||||
getImageWidth: function() {
|
getImageWidth: function() {
|
||||||
|
|
@ -517,8 +314,11 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
loadSprite: function(callback) {
|
loadSprite: function(callback) {
|
||||||
this.spriteThumbs = new CThumbnailLoader();
|
if (callback) {
|
||||||
this.spriteThumbs.load(thumbs[thumbIdx].path, callback);
|
this.spriteThumbs = new Image();
|
||||||
|
this.spriteThumbs.onload = callback;
|
||||||
|
this.spriteThumbs.src = thumbs[thumbIdx].path;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
fillFonts: function(store, select) {
|
fillFonts: function(store, select) {
|
||||||
|
|
@ -647,7 +447,6 @@ define([
|
||||||
this.trigger('show:after', this, e);
|
this.trigger('show:after', this, e);
|
||||||
this.flushVisibleFontsTiles();
|
this.flushVisibleFontsTiles();
|
||||||
this.updateVisibleFontsTiles(null, 0);
|
this.updateVisibleFontsTiles(null, 0);
|
||||||
Common.Utils.isGecko && this.scroller && this.scroller.update();
|
|
||||||
} else {
|
} else {
|
||||||
Common.UI.ComboBox.prototype.onAfterShowMenu.apply(this, arguments);
|
Common.UI.ComboBox.prototype.onAfterShowMenu.apply(this, arguments);
|
||||||
}
|
}
|
||||||
|
|
@ -744,8 +543,19 @@ define([
|
||||||
for (j = 0; j < storeCount; ++j) {
|
for (j = 0; j < storeCount; ++j) {
|
||||||
if (from <= j && j < to) {
|
if (from <= j && j < to) {
|
||||||
if (null === me.tiles[j]) {
|
if (null === me.tiles[j]) {
|
||||||
|
var fontImage = document.createElement('canvas');
|
||||||
|
var context = fontImage.getContext('2d');
|
||||||
|
|
||||||
|
fontImage.height = thumbs[thumbIdx].height;
|
||||||
|
fontImage.width = thumbs[thumbIdx].width;
|
||||||
|
|
||||||
|
fontImage.style.width = iconWidth + 'px';
|
||||||
|
fontImage.style.height = iconHeight + 'px';
|
||||||
|
|
||||||
index = Math.floor(me.store.at(j).get('imgidx')/spriteCols);
|
index = Math.floor(me.store.at(j).get('imgidx')/spriteCols);
|
||||||
var fontImage = me.spriteThumbs.getImage(index);
|
|
||||||
|
context.clearRect(0, 0, thumbs[thumbIdx].width, thumbs[thumbIdx].height);
|
||||||
|
context.drawImage(me.spriteThumbs, 0, -thumbs[thumbIdx].height * index);
|
||||||
|
|
||||||
me.tiles[j] = fontImage;
|
me.tiles[j] = fontImage;
|
||||||
$(listItems[j]).get(0).appendChild(fontImage);
|
$(listItems[j]).get(0).appendChild(fontImage);
|
||||||
|
|
|
||||||
|
|
@ -60,10 +60,7 @@ define([
|
||||||
beforeOpenHandler : null,
|
beforeOpenHandler : null,
|
||||||
additionalMenuItems : null,
|
additionalMenuItems : null,
|
||||||
showLast: true,
|
showLast: true,
|
||||||
minWidth: -1,
|
minWidth: -1
|
||||||
dataHint: '',
|
|
||||||
dataHintDirection: '',
|
|
||||||
dataHintOffset: ''
|
|
||||||
},
|
},
|
||||||
|
|
||||||
template: _.template([
|
template: _.template([
|
||||||
|
|
@ -81,7 +78,6 @@ define([
|
||||||
this.style = this.options.style;
|
this.style = this.options.style;
|
||||||
this.hint = this.options.hint;
|
this.hint = this.options.hint;
|
||||||
this.store = this.options.store || new Common.UI.DataViewStore();
|
this.store = this.options.store || new Common.UI.DataViewStore();
|
||||||
this.groups = this.options.groups;
|
|
||||||
this.itemWidth = this.options.itemWidth;
|
this.itemWidth = this.options.itemWidth;
|
||||||
this.itemHeight = this.options.itemHeight;
|
this.itemHeight = this.options.itemHeight;
|
||||||
this.menuMaxHeight = this.options.menuMaxHeight;
|
this.menuMaxHeight = this.options.menuMaxHeight;
|
||||||
|
|
@ -92,21 +88,18 @@ define([
|
||||||
this.rendered = false;
|
this.rendered = false;
|
||||||
this.needFillComboView = false;
|
this.needFillComboView = false;
|
||||||
this.minWidth = this.options.minWidth;
|
this.minWidth = this.options.minWidth;
|
||||||
this.delayRenderTips = this.options.delayRenderTips || false;
|
|
||||||
this.itemTemplate = this.options.itemTemplate || _.template([
|
|
||||||
'<div class="style" id="<%= id %>">',
|
|
||||||
'<img src="<%= imageUrl %>" width="' + this.itemWidth + '" height="' + this.itemHeight + '" + <% if(typeof imageUrl === "undefined" || imageUrl===null || imageUrl==="") { %> style="visibility: hidden;" <% } %>/>',
|
|
||||||
'<% if (typeof title !== "undefined") {%>',
|
|
||||||
'<span class="title"><%= title %></span>',
|
|
||||||
'<% } %>',
|
|
||||||
'</div>'
|
|
||||||
].join(''));
|
|
||||||
|
|
||||||
this.fieldPicker = new Common.UI.DataView({
|
this.fieldPicker = new Common.UI.DataView({
|
||||||
cls: 'field-picker',
|
cls: 'field-picker',
|
||||||
allowScrollbar: false,
|
allowScrollbar: false,
|
||||||
itemTemplate : this.itemTemplate,
|
itemTemplate : _.template([
|
||||||
delayRenderTips: this.delayRenderTips
|
'<div class="style" id="<%= id %>">',
|
||||||
|
'<img src="<%= imageUrl %>" width="' + this.itemWidth + '" height="' + this.itemHeight + '"/>',
|
||||||
|
'<% if (typeof title !== "undefined") {%>',
|
||||||
|
'<span class="title"><%= title %></span>',
|
||||||
|
'<% } %>',
|
||||||
|
'</div>'
|
||||||
|
].join(''))
|
||||||
});
|
});
|
||||||
|
|
||||||
this.openButton = new Common.UI.Button({
|
this.openButton = new Common.UI.Button({
|
||||||
|
|
@ -116,30 +109,31 @@ define([
|
||||||
offset: [0, 3],
|
offset: [0, 3],
|
||||||
items: [
|
items: [
|
||||||
{template: _.template('<div class="menu-picker-container"></div>')}
|
{template: _.template('<div class="menu-picker-container"></div>')}
|
||||||
].concat(this.options.additionalMenuItems != null ? this.options.additionalMenuItems : [])
|
]
|
||||||
}),
|
})
|
||||||
dataHint: this.options.dataHint,
|
|
||||||
dataHintDirection: this.options.dataHintDirection,
|
|
||||||
dataHintOffset: this.options.dataHintOffset
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.options.additionalMenuItems != null) {
|
||||||
|
this.openButton.menu.items = this.openButton.menu.items.concat(this.options.additionalMenuItems)
|
||||||
|
}
|
||||||
|
|
||||||
this.menuPicker = new Common.UI.DataView({
|
this.menuPicker = new Common.UI.DataView({
|
||||||
cls: 'menu-picker',
|
cls: 'menu-picker',
|
||||||
parentMenu: this.openButton.menu,
|
parentMenu: this.openButton.menu,
|
||||||
outerMenu: this.options.additionalMenuItems ? {menu: this.openButton.menu, index: 0} : undefined,
|
|
||||||
restoreHeight: this.menuMaxHeight,
|
restoreHeight: this.menuMaxHeight,
|
||||||
style: 'max-height: '+this.menuMaxHeight+'px;',
|
style: 'max-height: '+this.menuMaxHeight+'px;',
|
||||||
enableKeyEvents: this.options.enableKeyEvents,
|
enableKeyEvents: this.options.enableKeyEvents,
|
||||||
groups: this.groups,
|
|
||||||
store: this.store,
|
store: this.store,
|
||||||
itemTemplate : this.itemTemplate,
|
itemTemplate : _.template([
|
||||||
delayRenderTips: this.delayRenderTips
|
'<div class="style" id="<%= id %>">',
|
||||||
|
'<img src="<%= imageUrl %>" width="' + this.itemWidth + '" height="' + this.itemHeight + '"/>',
|
||||||
|
'<% if (typeof title !== "undefined") {%>',
|
||||||
|
'<span class="title"><%= title %></span>',
|
||||||
|
'<% } %>',
|
||||||
|
'</div>'
|
||||||
|
].join(''))
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.options.additionalMenuItems != null) {
|
|
||||||
this.openButton.menu.setInnerMenu([{menu: this.menuPicker, index: 0}]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle resize
|
// Handle resize
|
||||||
setInterval(_.bind(this.checkSize, this), 500);
|
setInterval(_.bind(this.checkSize, this), 500);
|
||||||
|
|
||||||
|
|
@ -214,9 +208,6 @@ define([
|
||||||
|
|
||||||
me.trigger('render:after', me);
|
me.trigger('render:after', me);
|
||||||
}
|
}
|
||||||
if (this.disabled) {
|
|
||||||
this.setDisabled(!!this.disabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
@ -244,10 +235,9 @@ define([
|
||||||
onResize: function() {
|
onResize: function() {
|
||||||
if (this.openButton) {
|
if (this.openButton) {
|
||||||
var button = $('button', this.openButton.cmpEl);
|
var button = $('button', this.openButton.cmpEl);
|
||||||
var cntButton = $('.button', this.cmpEl);
|
button && button.css({
|
||||||
button && cntButton.width() > 0 && button.css({
|
width : $('.button', this.cmpEl).width(),
|
||||||
width : cntButton.width(),
|
height: $('.button', this.cmpEl).height()
|
||||||
height: cntButton.height()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.openButton.menu.hide();
|
this.openButton.menu.hide();
|
||||||
|
|
@ -255,7 +245,6 @@ define([
|
||||||
var picker = this.menuPicker;
|
var picker = this.menuPicker;
|
||||||
if (picker) {
|
if (picker) {
|
||||||
var record = picker.getSelectedRec();
|
var record = picker.getSelectedRec();
|
||||||
this.itemMarginLeft = undefined;
|
|
||||||
this.fillComboView(record || picker.store.at(0), !!record, true);
|
this.fillComboView(record || picker.store.at(0), !!record, true);
|
||||||
|
|
||||||
picker.onResize();
|
picker.onResize();
|
||||||
|
|
@ -381,7 +370,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
setDisabled: function(disabled) {
|
||||||
disabled = !!disabled;
|
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
|
|
||||||
if (!this.rendered)
|
if (!this.rendered)
|
||||||
|
|
@ -416,9 +404,6 @@ define([
|
||||||
if (forceFill || !me.fieldPicker.store.findWhere({'id': record.get('id')})){
|
if (forceFill || !me.fieldPicker.store.findWhere({'id': record.get('id')})){
|
||||||
if (me.itemMarginLeft===undefined) {
|
if (me.itemMarginLeft===undefined) {
|
||||||
var div = $($(this.menuPicker.el).find('.inner > div:not(.grouped-data):not(.ps-scrollbar-x-rail):not(.ps-scrollbar-y-rail)')[0]);
|
var div = $($(this.menuPicker.el).find('.inner > div:not(.grouped-data):not(.ps-scrollbar-x-rail):not(.ps-scrollbar-y-rail)')[0]);
|
||||||
if (!div || div.length<1) { // try to find items in groups
|
|
||||||
div = $($(this.menuPicker.el).find('.inner .group-items-container > div:not(.grouped-data):not(.ps-scrollbar-x-rail):not(.ps-scrollbar-y-rail)')[0]);
|
|
||||||
}
|
|
||||||
if (div.length > 0) {
|
if (div.length > 0) {
|
||||||
me.itemMarginLeft = parseInt(div.css('margin-left'));
|
me.itemMarginLeft = parseInt(div.css('margin-left'));
|
||||||
me.itemMarginRight = parseInt(div.css('margin-right'));
|
me.itemMarginRight = parseInt(div.css('margin-right'));
|
||||||
|
|
@ -459,7 +444,6 @@ define([
|
||||||
me.resumeEvents();
|
me.resumeEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return me.fieldPicker.store.models; // return list of visible items
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,490 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* (c) Copyright Ascensio System SIA 2010-2019
|
|
||||||
*
|
|
||||||
* This program is a free software product. You can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
|
||||||
* version 3 as published by the Free Software Foundation. In accordance with
|
|
||||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
|
||||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
|
||||||
* of any third-party rights.
|
|
||||||
*
|
|
||||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
|
||||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
|
||||||
*
|
|
||||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
|
||||||
* street, Riga, Latvia, EU, LV-1050.
|
|
||||||
*
|
|
||||||
* The interactive user interfaces in modified source and object code versions
|
|
||||||
* of the Program must display Appropriate Legal Notices, as required under
|
|
||||||
* Section 5 of the GNU AGPL version 3.
|
|
||||||
*
|
|
||||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
|
||||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
|
||||||
* grant you any rights under trademark law for use of our trademarks.
|
|
||||||
*
|
|
||||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
|
||||||
* well as technical writing content are licensed under the terms of the
|
|
||||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
|
||||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* ComboDataView.js
|
|
||||||
*
|
|
||||||
* Created by Julia Svinareva on 6/10/21
|
|
||||||
* Copyright (c) 2021 Ascensio System SIA. All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (Common === undefined)
|
|
||||||
var Common = {};
|
|
||||||
|
|
||||||
define([
|
|
||||||
'common/main/lib/component/BaseView',
|
|
||||||
'common/main/lib/component/DataView'
|
|
||||||
], function () {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
Common.UI.ComboDataViewShape = Common.UI.BaseView.extend({
|
|
||||||
options : {
|
|
||||||
id : null,
|
|
||||||
cls : '',
|
|
||||||
style : '',
|
|
||||||
hint : false,
|
|
||||||
itemWidth : 80,
|
|
||||||
itemHeight : 40,
|
|
||||||
menuMaxHeight : 300,
|
|
||||||
enableKeyEvents : false,
|
|
||||||
additionalMenuItems : null,
|
|
||||||
minWidth: -1,
|
|
||||||
dataHint: '',
|
|
||||||
dataHintDirection: '',
|
|
||||||
dataHintOffset: ''
|
|
||||||
},
|
|
||||||
|
|
||||||
template: _.template([
|
|
||||||
'<div id="<%= id %>" class="combo-dataview <%= cls %>" style="<%= style %>">',
|
|
||||||
'<div class="view"></div> ',
|
|
||||||
'<div class="button"></div> ',
|
|
||||||
'</div>'
|
|
||||||
].join('')),
|
|
||||||
|
|
||||||
initialize : function(options) {
|
|
||||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
|
||||||
|
|
||||||
var filter = Common.localStorage.getKeysFilter();
|
|
||||||
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
|
||||||
|
|
||||||
this.id = this.options.id || Common.UI.getId();
|
|
||||||
this.cls = this.options.cls;
|
|
||||||
this.style = this.options.style;
|
|
||||||
this.hint = this.options.hint;
|
|
||||||
this.store = this.options.store || new Common.UI.DataViewStore();
|
|
||||||
this.itemWidth = this.options.itemWidth;
|
|
||||||
this.itemHeight = this.options.itemHeight;
|
|
||||||
this.menuMaxHeight = this.options.menuMaxHeight;
|
|
||||||
this.menuWidth = this.options.menuWidth;
|
|
||||||
this.rootWidth = 0;
|
|
||||||
this.rootHeight = 0;
|
|
||||||
this.rendered = false;
|
|
||||||
this.needFillComboView = false;
|
|
||||||
this.minWidth = this.options.minWidth;
|
|
||||||
this.delayRenderTips = this.options.delayRenderTips || false;
|
|
||||||
|
|
||||||
this.fieldPicker = new Common.UI.DataView({
|
|
||||||
cls: 'field-picker',
|
|
||||||
allowScrollbar: false,
|
|
||||||
itemTemplate: _.template('<div class="item-shape" id="<%= id %>" data-shape="<%= data.shapeType %>"><svg width="20" height="20" class=\"icon\"><use xlink:href=\"#svg-icon-<%= data.shapeType %>\"></use></svg></div>'),
|
|
||||||
delayRenderTips: this.delayRenderTips
|
|
||||||
});
|
|
||||||
|
|
||||||
this.openButton = new Common.UI.Button({
|
|
||||||
cls: 'open-menu',
|
|
||||||
menu: new Common.UI.Menu({
|
|
||||||
cls: 'menu-insert-shape',
|
|
||||||
menuAlign: 'tl-tl',
|
|
||||||
offset: [0, 3],
|
|
||||||
items: [
|
|
||||||
{template: _.template('<div class="menu-picker-container"></div>')}
|
|
||||||
]
|
|
||||||
}),
|
|
||||||
dataHint: this.options.dataHint,
|
|
||||||
dataHintDirection: this.options.dataHintDirection,
|
|
||||||
dataHintOffset: this.options.dataHintOffset
|
|
||||||
});
|
|
||||||
|
|
||||||
// Handle resize
|
|
||||||
setInterval(_.bind(this.checkSize, this), 500);
|
|
||||||
|
|
||||||
if (this.options.el) {
|
|
||||||
this.render();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
fillComboView: function (collection) {
|
|
||||||
var groups = collection.toJSON(),
|
|
||||||
recents = Common.localStorage.getItem(this.appPrefix + 'recent-shapes');
|
|
||||||
recents = recents ? JSON.parse(recents) : [];
|
|
||||||
|
|
||||||
// check lang
|
|
||||||
if (recents.length > 0) {
|
|
||||||
var isTranslated = _.findWhere(groups, {groupName: recents[0].groupName});
|
|
||||||
if (!isTranslated) {
|
|
||||||
for (var r = 0; r < recents.length; r++) {
|
|
||||||
var type = recents[r].data.shapeType,
|
|
||||||
record;
|
|
||||||
for (var g = 0; g < groups.length; g++) {
|
|
||||||
var store = groups[g].groupStore,
|
|
||||||
groupName = groups[g].groupName;
|
|
||||||
for (var i = 0; i < store.length; i++) {
|
|
||||||
if (store.at(i).get('data').shapeType === type) {
|
|
||||||
record = store.at(i).toJSON();
|
|
||||||
recents[r] = {
|
|
||||||
data: record.data,
|
|
||||||
tip: record.tip,
|
|
||||||
allowSelected: record.allowSelected,
|
|
||||||
selected: false,
|
|
||||||
groupName: groupName
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (record) {
|
|
||||||
record = undefined;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(recents));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (recents.length < 12) {
|
|
||||||
var count = 12 - recents.length;
|
|
||||||
|
|
||||||
var addItem = function (rec) {
|
|
||||||
var item = rec.toJSON(),
|
|
||||||
model = {
|
|
||||||
data: item.data,
|
|
||||||
tip: item.tip,
|
|
||||||
allowSelected: item.allowSelected,
|
|
||||||
selected: false
|
|
||||||
};
|
|
||||||
recents.push(model);
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var j = 0; j < groups.length && count > 0; j++) {
|
|
||||||
var groupStore = groups[j].groupStore;
|
|
||||||
if (j === 0) {
|
|
||||||
addItem(groupStore.at(1));
|
|
||||||
count--;
|
|
||||||
if (count > 0) {
|
|
||||||
addItem(groupStore.at(2));
|
|
||||||
count--;
|
|
||||||
}
|
|
||||||
} else if (j !== 3 && j !== 6 && j !== 7) {
|
|
||||||
addItem(groupStore.at(0));
|
|
||||||
count--;
|
|
||||||
if (count > 0) {
|
|
||||||
addItem(groupStore.at(1));
|
|
||||||
count--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.fieldPicker.store.reset(recents);
|
|
||||||
|
|
||||||
this.fieldPicker.on('item:select', _.bind(this.onFieldPickerSelect, this));
|
|
||||||
this.fieldPicker.on('item:click', _.bind(this.onFieldPickerClick, this));
|
|
||||||
this.fieldPicker.on('item:contextmenu', _.bind(this.onPickerItemContextMenu, this));
|
|
||||||
this.fieldPicker.el.addEventListener('contextmenu', _.bind(this.onPickerComboContextMenu, this), false);
|
|
||||||
},
|
|
||||||
|
|
||||||
setMenuPicker: function (collection, recent, text) {
|
|
||||||
this.menuPicker = new Common.UI.DataViewShape({
|
|
||||||
el: this.cmpEl.find('.menu-picker-container'),
|
|
||||||
cls: 'menu-picker',
|
|
||||||
parentMenu: this.openButton.menu,
|
|
||||||
restoreHeight: this.menuMaxHeight,
|
|
||||||
style: 'max-height: '+this.menuMaxHeight+'px;',
|
|
||||||
itemTemplate : _.template('<div class="item-shape" id="<%= id %>"><svg width="20" height="20" class=\"icon\"><use xlink:href=\"#svg-icon-<%= data.shapeType %>\"></use></svg></div>'),
|
|
||||||
groups: collection,
|
|
||||||
textRecentlyUsed: text,
|
|
||||||
recentShapes: recent
|
|
||||||
});
|
|
||||||
|
|
||||||
this.menuPicker.on('item:select', _.bind(this.onMenuPickerSelect, this));
|
|
||||||
this.menuPicker.on('item:click', _.bind(this.onMenuPickerClick, this));
|
|
||||||
this.menuPicker.on('item:contextmenu', _.bind(this.onPickerItemContextMenu, this));
|
|
||||||
this.menuPicker.el.addEventListener('contextmenu', _.bind(this.onPickerComboContextMenu, this), false);
|
|
||||||
|
|
||||||
this.onResize();
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function(parentEl) {
|
|
||||||
if (!this.rendered) {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
me.trigger('render:before', me);
|
|
||||||
|
|
||||||
me.cmpEl = me.$el || $(me.el);
|
|
||||||
|
|
||||||
var templateEl = me.template({
|
|
||||||
id : me.id,
|
|
||||||
cls : me.cls,
|
|
||||||
style : me.style
|
|
||||||
});
|
|
||||||
|
|
||||||
if (parentEl) {
|
|
||||||
me.setElement(parentEl, false);
|
|
||||||
|
|
||||||
me.cmpEl = $(templateEl);
|
|
||||||
|
|
||||||
parentEl.html(me.cmpEl);
|
|
||||||
} else {
|
|
||||||
me.cmpEl.html(templateEl);
|
|
||||||
}
|
|
||||||
|
|
||||||
me.rootWidth = me.cmpEl.width();
|
|
||||||
me.rootHeight = me.cmpEl.height();
|
|
||||||
|
|
||||||
me.fieldPicker.render($('.view', me.cmpEl));
|
|
||||||
me.openButton.render($('.button', me.cmpEl));
|
|
||||||
//me.menuPicker.render($('.menu-picker-container', me.cmpEl));
|
|
||||||
|
|
||||||
if (me.openButton.menu.cmpEl) {
|
|
||||||
if (me.openButton.menu.cmpEl) {
|
|
||||||
me.openButton.menu.menuAlignEl = me.cmpEl;
|
|
||||||
me.openButton.menu.cmpEl.css('min-width', me.itemWidth);
|
|
||||||
me.openButton.menu.on('show:before', _.bind(me.onBeforeShowMenu, me));
|
|
||||||
me.openButton.menu.on('show:after', _.bind(me.onAfterShowMenu, me));
|
|
||||||
me.openButton.cmpEl.on('hide.bs.dropdown', _.bind(me.onBeforeHideMenu, me));
|
|
||||||
me.openButton.cmpEl.on('hidden.bs.dropdown', _.bind(me.onAfterHideMenu, me));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (me.options.hint) {
|
|
||||||
me.cmpEl.attr('data-toggle', 'tooltip');
|
|
||||||
me.cmpEl.tooltip({
|
|
||||||
title : me.options.hint,
|
|
||||||
placement : me.options.hintAnchor || 'cursor'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//me.onResize();
|
|
||||||
|
|
||||||
me.rendered = true;
|
|
||||||
|
|
||||||
me.trigger('render:after', me);
|
|
||||||
}
|
|
||||||
if (this.disabled) {
|
|
||||||
this.setDisabled(!!this.disabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
|
|
||||||
updateComboView: function (record) {
|
|
||||||
var store = this.fieldPicker.store,
|
|
||||||
type = record.get('data').shapeType,
|
|
||||||
model = null;
|
|
||||||
for (var i = 0; i < store.length; i++) {
|
|
||||||
if (store.at(i).get('data').shapeType === type) {
|
|
||||||
model = store.at(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!model) {
|
|
||||||
store.pop();
|
|
||||||
store.unshift([record]);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
activateRecord: function (record) {
|
|
||||||
var type = record.get('data').shapeType;
|
|
||||||
if (this.isRecordActive)
|
|
||||||
this.deactivateRecords();
|
|
||||||
$(this.cmpEl.find("[data-shape='" + type + "']")).parent().addClass('active');
|
|
||||||
this.isRecordActive = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
deactivateRecords: function () {
|
|
||||||
$(this.cmpEl.find('.field-picker .item')).removeClass('active');
|
|
||||||
},
|
|
||||||
|
|
||||||
isComboViewRecActive: function () {
|
|
||||||
return this.isRecordActive;
|
|
||||||
},
|
|
||||||
|
|
||||||
checkSize: function() {
|
|
||||||
if (this.cmpEl && this.cmpEl.is(':visible')) {
|
|
||||||
var me = this,
|
|
||||||
width = this.cmpEl.width(),
|
|
||||||
height = this.cmpEl.height();
|
|
||||||
|
|
||||||
if (width < this.minWidth) return;
|
|
||||||
|
|
||||||
if (this.rootWidth != width || this.rootHeight != height) {
|
|
||||||
this.rootWidth = width;
|
|
||||||
this.rootHeight = height;
|
|
||||||
setTimeout(function() {
|
|
||||||
me.openButton.menu.cmpEl.outerWidth();
|
|
||||||
me.rootWidth = me.cmpEl.width();
|
|
||||||
}, 10);
|
|
||||||
this.onResize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onResize: function() {
|
|
||||||
if (this.openButton) {
|
|
||||||
var button = $('button', this.openButton.cmpEl);
|
|
||||||
var cntButton = $('.button', this.cmpEl);
|
|
||||||
button && cntButton.width() > 0 && button.css({
|
|
||||||
width : cntButton.width(),
|
|
||||||
height: cntButton.height()
|
|
||||||
});
|
|
||||||
|
|
||||||
this.openButton.menu.hide();
|
|
||||||
|
|
||||||
/*var picker = this.menuPicker;
|
|
||||||
if (picker) {
|
|
||||||
var record = picker.getSelectedRec();
|
|
||||||
this.fillComboView(record || picker.store.at(0), !!record, true);
|
|
||||||
|
|
||||||
picker.onResize();
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.isSuspendEvents)
|
|
||||||
this.trigger('resize', this);
|
|
||||||
},
|
|
||||||
|
|
||||||
onBeforeShowMenu: function(e) {
|
|
||||||
var menu = this.openButton.menu;
|
|
||||||
if (menu.cmpEl) {
|
|
||||||
menu.menuAlignEl = this.cmpEl;
|
|
||||||
var offset = this.cmpEl.width() - this.openButton.$el.width() - this.menuWidth + 1;
|
|
||||||
menu.setOffset(Math.min(offset, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.options.hint) {
|
|
||||||
var tip = this.cmpEl.data('bs.tooltip');
|
|
||||||
if (tip) {
|
|
||||||
if (tip.dontShow===undefined)
|
|
||||||
tip.dontShow = true;
|
|
||||||
tip.hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onBeforeHideMenu: function(e) {
|
|
||||||
this.trigger('hide:before', this, e);
|
|
||||||
|
|
||||||
if (Common.UI.Scroller.isMouseCapture())
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
if (this.isStylesNotClosable)
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
onAfterShowMenu: function(e) {
|
|
||||||
var me = this;
|
|
||||||
if (me.menuPicker.scroller) {
|
|
||||||
me.menuPicker.scroller.update({
|
|
||||||
includePadding: true,
|
|
||||||
suppressScrollX: true,
|
|
||||||
alwaysVisibleY: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onAfterHideMenu: function(e, isFromInputControl) {
|
|
||||||
this.menuPicker.selectedBeforeHideRec = this.menuPicker.getSelectedRec(); // for DataView - onKeyDown - Return key
|
|
||||||
this.menuPicker.deselectAll();
|
|
||||||
this.trigger('hide:after', this, e, isFromInputControl);
|
|
||||||
},
|
|
||||||
|
|
||||||
onFieldPickerSelect: function(picker, item, record) {
|
|
||||||
//
|
|
||||||
},
|
|
||||||
|
|
||||||
onMenuPickerSelect: function(picker, item, record, fromKeyDown) {
|
|
||||||
this.needFillComboView = this.disabled;
|
|
||||||
if (this.disabled || fromKeyDown===true) return;
|
|
||||||
|
|
||||||
/*this.fillComboView(record, false);
|
|
||||||
if (record && !this.isSuspendEvents)
|
|
||||||
this.trigger('select', this, record);*/
|
|
||||||
},
|
|
||||||
|
|
||||||
onFieldPickerClick: function(dataView, item, record) {
|
|
||||||
if (this.disabled) return;
|
|
||||||
|
|
||||||
var isActive = item.$el.hasClass('active');
|
|
||||||
|
|
||||||
if (!this.isSuspendEvents)
|
|
||||||
this.trigger('click', this, record, isActive);
|
|
||||||
|
|
||||||
if (this.options.hint) {
|
|
||||||
var tip = this.cmpEl.data('bs.tooltip');
|
|
||||||
if (tip) {
|
|
||||||
if (tip.dontShow===undefined)
|
|
||||||
tip.dontShow = true;
|
|
||||||
tip.hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isActive) {
|
|
||||||
this.activateRecord(record);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onMenuPickerClick: function(dataView, itemView, record) {
|
|
||||||
if (this.disabled) return;
|
|
||||||
|
|
||||||
if (!this.isSuspendEvents)
|
|
||||||
this.trigger('click', this, record);
|
|
||||||
|
|
||||||
this.activateRecord(record);
|
|
||||||
},
|
|
||||||
|
|
||||||
onPickerItemContextMenu: function(dataView, itemView, record, e) {
|
|
||||||
if (this.disabled) return;
|
|
||||||
|
|
||||||
if (!this.isSuspendEvents) {
|
|
||||||
this.trigger('contextmenu', this, record, e);
|
|
||||||
}
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
onPickerComboContextMenu: function(mouseEvent) {
|
|
||||||
if (this.disabled) return;
|
|
||||||
|
|
||||||
if (!this.isSuspendEvents) {
|
|
||||||
this.trigger('contextmenu', this, undefined, mouseEvent);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
|
||||||
disabled = !!disabled;
|
|
||||||
this.disabled = disabled;
|
|
||||||
|
|
||||||
if (!this.rendered)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this.cmpEl.toggleClass('disabled', disabled);
|
|
||||||
$('button', this.openButton.cmpEl).toggleClass('disabled', disabled);
|
|
||||||
this.fieldPicker.setDisabled(disabled);
|
|
||||||
},
|
|
||||||
|
|
||||||
isDisabled: function() {
|
|
||||||
return this.disabled;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
@ -125,11 +125,8 @@ define([
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
me.template = me.options.template || me.template;
|
me.template = me.options.template || me.template;
|
||||||
me.dataHint = me.options.dataHint || '';
|
|
||||||
me.dataHintDirection = me.options.dataHintDirection || '';
|
|
||||||
me.dataHintOffset = me.options.dataHintOffset || '';
|
|
||||||
|
|
||||||
me.listenTo(me.model, 'change', this.model.get('skipRenderOnChange') ? me.onChange : me.render);
|
me.listenTo(me.model, 'change', me.render);
|
||||||
me.listenTo(me.model, 'change:selected', me.onSelectChange);
|
me.listenTo(me.model, 'change:selected', me.onSelectChange);
|
||||||
me.listenTo(me.model, 'remove', me.remove);
|
me.listenTo(me.model, 'remove', me.remove);
|
||||||
},
|
},
|
||||||
|
|
@ -143,15 +140,6 @@ define([
|
||||||
el.html(this.template(this.model.toJSON()));
|
el.html(this.template(this.model.toJSON()));
|
||||||
el.addClass('item');
|
el.addClass('item');
|
||||||
el.toggleClass('selected', this.model.get('selected') && this.model.get('allowSelected'));
|
el.toggleClass('selected', this.model.get('selected') && this.model.get('allowSelected'));
|
||||||
|
|
||||||
if (this.dataHint !== '') {
|
|
||||||
el.attr('data-hint', this.dataHint);
|
|
||||||
el.attr('data-hint-direction', this.dataHintDirection);
|
|
||||||
el.attr('data-hint-offset', this.dataHintOffset);
|
|
||||||
}
|
|
||||||
if (!_.isUndefined(this.model.get('contentTarget')))
|
|
||||||
el.attr('content-target', this.model.get('contentTarget'));
|
|
||||||
|
|
||||||
el.off('click dblclick contextmenu');
|
el.off('click dblclick contextmenu');
|
||||||
el.on({ 'click': _.bind(this.onClick, this),
|
el.on({ 'click': _.bind(this.onClick, this),
|
||||||
'dblclick': _.bind(this.onDblClick, this),
|
'dblclick': _.bind(this.onDblClick, this),
|
||||||
|
|
@ -197,18 +185,6 @@ define([
|
||||||
|
|
||||||
onSelectChange: function(model, selected) {
|
onSelectChange: function(model, selected) {
|
||||||
this.trigger('select', this, model, selected);
|
this.trigger('select', this, model, selected);
|
||||||
},
|
|
||||||
|
|
||||||
onChange: function () {
|
|
||||||
if (_.isUndefined(this.model.id))
|
|
||||||
return this;
|
|
||||||
var el = this.$el || $(this.el);
|
|
||||||
el.toggleClass('selected', this.model.get('selected') && this.model.get('allowSelected'));
|
|
||||||
el.toggleClass('disabled', !!this.model.get('disabled'));
|
|
||||||
|
|
||||||
this.trigger('change', this, this.model);
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -223,7 +199,6 @@ define([
|
||||||
listenStoreEvents: true,
|
listenStoreEvents: true,
|
||||||
allowScrollbar: true,
|
allowScrollbar: true,
|
||||||
scrollAlwaysVisible: false,
|
scrollAlwaysVisible: false,
|
||||||
minScrollbarLength: 40,
|
|
||||||
showLast: true,
|
showLast: true,
|
||||||
useBSKeydown: false,
|
useBSKeydown: false,
|
||||||
cls: ''
|
cls: ''
|
||||||
|
|
@ -257,13 +232,9 @@ define([
|
||||||
me.store = me.options.store || new Common.UI.DataViewStore();
|
me.store = me.options.store || new Common.UI.DataViewStore();
|
||||||
me.groups = me.options.groups || null;
|
me.groups = me.options.groups || null;
|
||||||
me.itemTemplate = me.options.itemTemplate || null;
|
me.itemTemplate = me.options.itemTemplate || null;
|
||||||
me.itemDataHint = me.options.itemDataHint || '';
|
|
||||||
me.itemDataHintDirection = me.options.itemDataHintDirection || '';
|
|
||||||
me.itemDataHintOffset = me.options.itemDataHintOffset || '';
|
|
||||||
me.multiSelect = me.options.multiSelect;
|
me.multiSelect = me.options.multiSelect;
|
||||||
me.handleSelect = me.options.handleSelect;
|
me.handleSelect = me.options.handleSelect;
|
||||||
me.parentMenu = me.options.parentMenu;
|
me.parentMenu = me.options.parentMenu;
|
||||||
me.outerMenu = me.options.outerMenu;
|
|
||||||
me.enableKeyEvents= me.options.enableKeyEvents;
|
me.enableKeyEvents= me.options.enableKeyEvents;
|
||||||
me.useBSKeydown = me.options.useBSKeydown; // only with enableKeyEvents && parentMenu
|
me.useBSKeydown = me.options.useBSKeydown; // only with enableKeyEvents && parentMenu
|
||||||
me.showLast = me.options.showLast;
|
me.showLast = me.options.showLast;
|
||||||
|
|
@ -273,12 +244,9 @@ define([
|
||||||
me.listenStoreEvents= (me.options.listenStoreEvents!==undefined) ? me.options.listenStoreEvents : true;
|
me.listenStoreEvents= (me.options.listenStoreEvents!==undefined) ? me.options.listenStoreEvents : true;
|
||||||
me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true;
|
me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true;
|
||||||
me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false;
|
me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false;
|
||||||
me.minScrollbarLength = me.options.minScrollbarLength || 40;
|
|
||||||
me.tabindex = me.options.tabindex || 0;
|
me.tabindex = me.options.tabindex || 0;
|
||||||
me.delayRenderTips = me.options.delayRenderTips || false;
|
|
||||||
if (me.parentMenu)
|
if (me.parentMenu)
|
||||||
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
|
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
|
||||||
me.delaySelect = me.options.delaySelect || false;
|
|
||||||
me.rendered = false;
|
me.rendered = false;
|
||||||
me.dataViewItems = [];
|
me.dataViewItems = [];
|
||||||
if (me.options.keyMoveDirection=='vertical')
|
if (me.options.keyMoveDirection=='vertical')
|
||||||
|
|
@ -302,8 +270,7 @@ define([
|
||||||
this.cmpEl = $(this.template({
|
this.cmpEl = $(this.template({
|
||||||
groups: me.groups ? me.groups.toJSON() : null,
|
groups: me.groups ? me.groups.toJSON() : null,
|
||||||
style: me.style,
|
style: me.style,
|
||||||
cls: me.cls,
|
cls: me.cls
|
||||||
options: me.options
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
parentEl.html(this.cmpEl);
|
parentEl.html(this.cmpEl);
|
||||||
|
|
@ -312,8 +279,7 @@ define([
|
||||||
this.cmpEl.html(this.template({
|
this.cmpEl.html(this.template({
|
||||||
groups: me.groups ? me.groups.toJSON() : null,
|
groups: me.groups ? me.groups.toJSON() : null,
|
||||||
style: me.style,
|
style: me.style,
|
||||||
cls: me.cls,
|
cls: me.cls
|
||||||
options: me.options
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -340,8 +306,7 @@ define([
|
||||||
if (this.enableKeyEvents && this.parentMenu && this.handleSelect) {
|
if (this.enableKeyEvents && this.parentMenu && this.handleSelect) {
|
||||||
if (!me.showLast)
|
if (!me.showLast)
|
||||||
this.parentMenu.on('show:before', function(menu) { me.deselectAll(); });
|
this.parentMenu.on('show:before', function(menu) { me.deselectAll(); });
|
||||||
this.parentMenu.on('show:after', function(menu, e) {
|
this.parentMenu.on('show:after', function(menu) {
|
||||||
if (e && (menu.el !== e.target)) return;
|
|
||||||
if (me.showLast) me.showLastSelected();
|
if (me.showLast) me.showLastSelected();
|
||||||
Common.NotificationCenter.trigger('dataview:focus');
|
Common.NotificationCenter.trigger('dataview:focus');
|
||||||
_.delay(function() {
|
_.delay(function() {
|
||||||
|
|
@ -357,7 +322,7 @@ define([
|
||||||
this.scroller = new Common.UI.Scroller({
|
this.scroller = new Common.UI.Scroller({
|
||||||
el: $(this.el).find('.inner').addBack().filter('.inner'),
|
el: $(this.el).find('.inner').addBack().filter('.inner'),
|
||||||
useKeyboard: this.enableKeyEvents && !this.handleSelect,
|
useKeyboard: this.enableKeyEvents && !this.handleSelect,
|
||||||
minScrollbarLength : this.minScrollbarLength,
|
minScrollbarLength : 40,
|
||||||
wheelSpeed: 10,
|
wheelSpeed: 10,
|
||||||
alwaysVisibleY: this.scrollAlwaysVisible
|
alwaysVisibleY: this.scrollAlwaysVisible
|
||||||
});
|
});
|
||||||
|
|
@ -398,9 +363,8 @@ define([
|
||||||
rec.set({selected: false});
|
rec.set({selected: false});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (record) {
|
if (record)
|
||||||
record.set({selected: true});
|
record.set({selected: true});
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (record)
|
if (record)
|
||||||
record.set({selected: !record.get('selected')});
|
record.set({selected: !record.get('selected')});
|
||||||
|
|
@ -436,10 +400,7 @@ define([
|
||||||
onAddItem: function(record, store, opts) {
|
onAddItem: function(record, store, opts) {
|
||||||
var view = new Common.UI.DataViewItem({
|
var view = new Common.UI.DataViewItem({
|
||||||
template: this.itemTemplate,
|
template: this.itemTemplate,
|
||||||
model: record,
|
model: record
|
||||||
dataHint: this.itemDataHint,
|
|
||||||
dataHintDirection: this.itemDataHintDirection,
|
|
||||||
dataHintOffset: this.itemDataHintOffset
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (view) {
|
if (view) {
|
||||||
|
|
@ -453,48 +414,23 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var idx = _.indexOf(this.store.models, record);
|
|
||||||
if (innerEl) {
|
if (innerEl) {
|
||||||
if (opts && (typeof opts.at==='number') && opts.at >= 0) {
|
if (opts && opts.at == 0)
|
||||||
if (opts.at == 0) {
|
innerEl.prepend(view.render().el); else
|
||||||
innerEl.prepend(view.render().el);
|
|
||||||
} else if (!(this.groups && this.groups.length > 0)) { // for dataview without groups
|
|
||||||
var innerDivs = innerEl.find('> div');
|
|
||||||
if (idx > 0)
|
|
||||||
$(innerDivs.get(idx - 1)).after(view.render().el);
|
|
||||||
else {
|
|
||||||
(innerDivs.length > 0) ? $(innerDivs[idx]).before(view.render().el) : innerEl.append(view.render().el);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
innerEl.append(view.render().el);
|
|
||||||
} else
|
|
||||||
innerEl.append(view.render().el);
|
innerEl.append(view.render().el);
|
||||||
|
|
||||||
(this.dataViewItems.length<1) && innerEl.find('.empty-text').remove();
|
(this.dataViewItems.length<1) && innerEl.find('.empty-text').remove();
|
||||||
|
var idx = _.indexOf(this.store.models, record);
|
||||||
this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx));
|
this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx));
|
||||||
|
|
||||||
var me = this,
|
if (record.get('tip')) {
|
||||||
view_el = $(view.el),
|
var view_el = $(view.el);
|
||||||
tip = record.get('tip');
|
view_el.attr('data-toggle', 'tooltip');
|
||||||
if (tip!==undefined && tip!==null) {
|
view_el.tooltip({
|
||||||
if (this.delayRenderTips)
|
title : record.get('tip'),
|
||||||
view_el.one('mouseenter', function(){ // hide tooltip when mouse is over menu
|
placement : 'cursor',
|
||||||
view_el.attr('data-toggle', 'tooltip');
|
zIndex : this.tipZIndex
|
||||||
view_el.tooltip({
|
});
|
||||||
title : record.get('tip'), // use actual tip, because it can be changed
|
|
||||||
placement : 'cursor',
|
|
||||||
zIndex : me.tipZIndex
|
|
||||||
});
|
|
||||||
view_el.mouseenter();
|
|
||||||
});
|
|
||||||
else {
|
|
||||||
view_el.attr('data-toggle', 'tooltip');
|
|
||||||
view_el.tooltip({
|
|
||||||
title : record.get('tip'), // use actual tip, because it can be changed
|
|
||||||
placement : 'cursor',
|
|
||||||
zIndex : me.tipZIndex
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.listenTo(view, 'change', this.onChangeItem);
|
this.listenTo(view, 'change', this.onChangeItem);
|
||||||
|
|
@ -523,8 +459,7 @@ define([
|
||||||
$(this.el).html(this.template({
|
$(this.el).html(this.template({
|
||||||
groups: this.groups ? this.groups.toJSON() : null,
|
groups: this.groups ? this.groups.toJSON() : null,
|
||||||
style: this.style,
|
style: this.style,
|
||||||
cls: this.cls,
|
cls: this.cls
|
||||||
options: this.options
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (!_.isUndefined(this.scroller)) {
|
if (!_.isUndefined(this.scroller)) {
|
||||||
|
|
@ -541,16 +476,13 @@ define([
|
||||||
}, this);
|
}, this);
|
||||||
this.dataViewItems = [];
|
this.dataViewItems = [];
|
||||||
|
|
||||||
var me = this;
|
this.store.each(this.onAddItem, this);
|
||||||
this.store.each(function(item){
|
|
||||||
me.onAddItem(item, me.store);
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
if (this.allowScrollbar) {
|
if (this.allowScrollbar) {
|
||||||
this.scroller = new Common.UI.Scroller({
|
this.scroller = new Common.UI.Scroller({
|
||||||
el: $(this.el).find('.inner').addBack().filter('.inner'),
|
el: $(this.el).find('.inner').addBack().filter('.inner'),
|
||||||
useKeyboard: this.enableKeyEvents && !this.handleSelect,
|
useKeyboard: this.enableKeyEvents && !this.handleSelect,
|
||||||
minScrollbarLength : this.minScrollbarLength,
|
minScrollbarLength : 40,
|
||||||
wheelSpeed: 10,
|
wheelSpeed: 10,
|
||||||
alwaysVisibleY: this.scrollAlwaysVisible
|
alwaysVisibleY: this.scrollAlwaysVisible
|
||||||
});
|
});
|
||||||
|
|
@ -603,30 +535,14 @@ define([
|
||||||
|
|
||||||
window._event = e; // for FireFox only
|
window._event = e; // for FireFox only
|
||||||
|
|
||||||
if (this.showLast) {
|
if (this.showLast) this.selectRecord(record);
|
||||||
if (!this.delaySelect) {
|
|
||||||
this.selectRecord(record);
|
|
||||||
} else {
|
|
||||||
_.each(this.store.where({selected: true}), function(rec){
|
|
||||||
rec.set({selected: false});
|
|
||||||
});
|
|
||||||
if (record) {
|
|
||||||
setTimeout(_.bind(function () {
|
|
||||||
record.set({selected: true});
|
|
||||||
this.trigger('item:click', this, view, record, e);
|
|
||||||
}, this), 300);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.lastSelectedRec = null;
|
this.lastSelectedRec = null;
|
||||||
|
|
||||||
var tip = view.$el.data('bs.tooltip');
|
var tip = view.$el.data('bs.tooltip');
|
||||||
if (tip) (tip.tip()).remove();
|
if (tip) (tip.tip()).remove();
|
||||||
|
|
||||||
if (!this.isSuspendEvents) {
|
if (!this.isSuspendEvents) {
|
||||||
if (!this.delaySelect) {
|
this.trigger('item:click', this, view, record, e);
|
||||||
this.trigger('item:click', this, view, record, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -733,27 +649,17 @@ define([
|
||||||
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
||||||
}
|
}
|
||||||
} else if (data.keyCode==Common.UI.Keys.UP) {
|
} else if (data.keyCode==Common.UI.Keys.UP) {
|
||||||
if (topIdx==0 && this.outerMenu && this.outerMenu.menu) {
|
while (idx===undefined) {
|
||||||
this.deselectAll(true);
|
topIdx--;
|
||||||
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
if (topIdx<0) topIdx = this._layoutParams.rows-1;
|
||||||
return;
|
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
||||||
} else
|
}
|
||||||
while (idx===undefined) {
|
|
||||||
topIdx--;
|
|
||||||
if (topIdx<0) topIdx = this._layoutParams.rows-1;
|
|
||||||
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (topIdx==this._layoutParams.rows-1 && this.outerMenu && this.outerMenu.menu) {
|
while (idx===undefined) {
|
||||||
this.deselectAll(true);
|
topIdx++;
|
||||||
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
if (topIdx>this._layoutParams.rows-1) topIdx = 0;
|
||||||
return;
|
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
||||||
} else
|
}
|
||||||
while (idx===undefined) {
|
|
||||||
topIdx++;
|
|
||||||
if (topIdx>this._layoutParams.rows-1) topIdx = 0;
|
|
||||||
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
|
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
|
||||||
|
|
@ -794,7 +700,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
setDisabled: function(disabled) {
|
||||||
disabled = !!disabled;
|
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
$(this.el).find('.inner').addBack().filter('.inner').toggleClass('disabled', disabled);
|
$(this.el).find('.inner').addBack().filter('.inner').toggleClass('disabled', disabled);
|
||||||
},
|
},
|
||||||
|
|
@ -805,12 +710,6 @@ define([
|
||||||
|
|
||||||
setEmptyText: function(emptyText) {
|
setEmptyText: function(emptyText) {
|
||||||
this.emptyText = emptyText;
|
this.emptyText = emptyText;
|
||||||
|
|
||||||
if (this.store.length < 1) {
|
|
||||||
var el = $(this.el).find('.inner').addBack().filter('.inner').find('.empty-text td');
|
|
||||||
if ( el.length>0 )
|
|
||||||
el.text(this.emptyText);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
alignPosition: function() {
|
alignPosition: function() {
|
||||||
|
|
@ -824,7 +723,7 @@ define([
|
||||||
paddings = parseInt(menuRoot.css('padding-top')) + parseInt(menuRoot.css('padding-bottom')),
|
paddings = parseInt(menuRoot.css('padding-top')) + parseInt(menuRoot.css('padding-bottom')),
|
||||||
menuH = menuRoot.outerHeight(),
|
menuH = menuRoot.outerHeight(),
|
||||||
top = parseInt(menuRoot.css('top')),
|
top = parseInt(menuRoot.css('top')),
|
||||||
props = {minScrollbarLength : this.minScrollbarLength};
|
props = {minScrollbarLength : 40};
|
||||||
this.scrollAlwaysVisible && (props.alwaysVisibleY = this.scrollAlwaysVisible);
|
this.scrollAlwaysVisible && (props.alwaysVisibleY = this.scrollAlwaysVisible);
|
||||||
|
|
||||||
if (top + menuH > docH ) {
|
if (top + menuH > docH ) {
|
||||||
|
|
@ -846,14 +745,14 @@ define([
|
||||||
};
|
};
|
||||||
|
|
||||||
var el = $(this.dataViewItems[0].el),
|
var el = $(this.dataViewItems[0].el),
|
||||||
itemW = el.outerWidth() + parseFloat(el.css('margin-left')) + parseFloat(el.css('margin-right')),
|
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
|
||||||
offsetLeft = this.$el.offset().left,
|
offsetLeft = this.$el.offset().left,
|
||||||
offsetTop = el.offset().top,
|
offsetTop = el.offset().top,
|
||||||
prevtop = -1, topIdx = 0, leftIdx = 0;
|
prevtop = -1, topIdx = 0, leftIdx = 0;
|
||||||
|
|
||||||
for (var i=0; i<this.dataViewItems.length; i++) {
|
for (var i=0; i<this.dataViewItems.length; i++) {
|
||||||
var top = $(this.dataViewItems[i].el).offset().top - offsetTop;
|
var top = $(this.dataViewItems[i].el).offset().top - offsetTop;
|
||||||
leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW + 0.01);
|
leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW);
|
||||||
if (top>prevtop) {
|
if (top>prevtop) {
|
||||||
prevtop = top;
|
prevtop = top;
|
||||||
this._layoutParams.itemsIndexes.push([]);
|
this._layoutParams.itemsIndexes.push([]);
|
||||||
|
|
@ -872,24 +771,8 @@ define([
|
||||||
this._layoutParams = undefined;
|
this._layoutParams = undefined;
|
||||||
},
|
},
|
||||||
|
|
||||||
focus: function(index) {
|
focus: function() {
|
||||||
$(this.el).find('.inner').addBack().filter('.inner').focus();
|
this.cmpEl && this.cmpEl.find('.dataview').focus();
|
||||||
var rec;
|
|
||||||
if (typeof index == 'string') {
|
|
||||||
if (index == 'first') {
|
|
||||||
rec = this.selectByIndex(0, true);
|
|
||||||
} else if (index == 'last') {
|
|
||||||
if (this._layoutParams === undefined)
|
|
||||||
this.fillIndexesArray();
|
|
||||||
rec = this.selectByIndex(this._layoutParams.itemsIndexes[this._layoutParams.rows-1][0], true);
|
|
||||||
}
|
|
||||||
} else if (index !== undefined)
|
|
||||||
rec = this.selectByIndex(index, true);
|
|
||||||
this.scrollToRecord(rec);
|
|
||||||
},
|
|
||||||
|
|
||||||
focusInner: function(e) {
|
|
||||||
this.focus(e.keyCode == Common.UI.Keys.DOWN ? 'first' : 'last');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -907,7 +790,7 @@ define([
|
||||||
'<div class="dataview inner" style="<%= style %>">',
|
'<div class="dataview inner" style="<%= style %>">',
|
||||||
'<% _.each(items, function(item) { %>',
|
'<% _.each(items, function(item) { %>',
|
||||||
'<% if (!item.id) item.id = Common.UI.getId(); %>',
|
'<% if (!item.id) item.id = Common.UI.getId(); %>',
|
||||||
'<div class="item" <% if(!!item.tip) { %> data-toggle="tooltip" <% } %> data-hint="<%= item.dataHint %>" data-hint-direction="<%= item.dataHintDirection %>" data-hint-offset="<%= item.dataHintOffset %>"><%= itemTemplate(item) %></div>',
|
'<div class="item" <% if(!!item.tip) { %> data-toggle="tooltip" <% } %> ><%= itemTemplate(item) %></div>',
|
||||||
'<% }) %>',
|
'<% }) %>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')),
|
].join('')),
|
||||||
|
|
@ -957,8 +840,7 @@ define([
|
||||||
this.cmpEl.html(this.template({
|
this.cmpEl.html(this.template({
|
||||||
items: me.store.toJSON(),
|
items: me.store.toJSON(),
|
||||||
itemTemplate: me.itemTemplate,
|
itemTemplate: me.itemTemplate,
|
||||||
style: me.style,
|
style: me.style
|
||||||
options: me.options
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
var modalParents = this.cmpEl.closest('.asc-window');
|
var modalParents = this.cmpEl.closest('.asc-window');
|
||||||
|
|
@ -995,7 +877,7 @@ define([
|
||||||
this.scroller = new Common.UI.Scroller({
|
this.scroller = new Common.UI.Scroller({
|
||||||
el: $(this.el).find('.inner').addBack().filter('.inner'),
|
el: $(this.el).find('.inner').addBack().filter('.inner'),
|
||||||
useKeyboard: this.enableKeyEvents && !this.handleSelect,
|
useKeyboard: this.enableKeyEvents && !this.handleSelect,
|
||||||
minScrollbarLength : this.minScrollbarLength,
|
minScrollbarLength : 40,
|
||||||
wheelSpeed: 10,
|
wheelSpeed: 10,
|
||||||
alwaysVisibleY: this.scrollAlwaysVisible
|
alwaysVisibleY: this.scrollAlwaysVisible
|
||||||
});
|
});
|
||||||
|
|
@ -1070,7 +952,7 @@ define([
|
||||||
var template = _.template([
|
var template = _.template([
|
||||||
'<% _.each(items, function(item) { %>',
|
'<% _.each(items, function(item) { %>',
|
||||||
'<% if (!item.id) item.id = Common.UI.getId(); %>',
|
'<% if (!item.id) item.id = Common.UI.getId(); %>',
|
||||||
'<div class="item" <% if(!!item.tip) { %> data-toggle="tooltip" <% } %> data-hint="<%= item.dataHint %>" data-hint-direction="<%= item.dataHintDirection %>" data-hint-offset="<%= item.dataHintOffset %>"><%= itemTemplate(item) %></div>',
|
'<div class="item" <% if(!!item.tip) { %> data-toggle="tooltip" <% } %> ><%= itemTemplate(item) %></div>',
|
||||||
'<% }) %>'
|
'<% }) %>'
|
||||||
].join(''));
|
].join(''));
|
||||||
this.cmpEl && this.cmpEl.find('.inner').html(template({
|
this.cmpEl && this.cmpEl.find('.inner').html(template({
|
||||||
|
|
@ -1087,7 +969,7 @@ define([
|
||||||
this.scroller = new Common.UI.Scroller({
|
this.scroller = new Common.UI.Scroller({
|
||||||
el: $(this.el).find('.inner').addBack().filter('.inner'),
|
el: $(this.el).find('.inner').addBack().filter('.inner'),
|
||||||
useKeyboard: this.enableKeyEvents && !this.handleSelect,
|
useKeyboard: this.enableKeyEvents && !this.handleSelect,
|
||||||
minScrollbarLength : this.minScrollbarLength,
|
minScrollbarLength : 40,
|
||||||
wheelSpeed: 10,
|
wheelSpeed: 10,
|
||||||
alwaysVisibleY: this.scrollAlwaysVisible
|
alwaysVisibleY: this.scrollAlwaysVisible
|
||||||
});
|
});
|
||||||
|
|
@ -1172,30 +1054,21 @@ define([
|
||||||
if (data.keyCode==Common.UI.Keys.RETURN) {
|
if (data.keyCode==Common.UI.Keys.RETURN) {
|
||||||
if (this.selectedBeforeHideRec) // only for ComboDataView menuPicker
|
if (this.selectedBeforeHideRec) // only for ComboDataView menuPicker
|
||||||
rec = this.selectedBeforeHideRec;
|
rec = this.selectedBeforeHideRec;
|
||||||
if (this.canAddRecents) // only for DaraViewShape
|
|
||||||
this.addRecentItem(rec);
|
|
||||||
this.trigger('item:click', this, this, rec, e);
|
this.trigger('item:click', this, this, rec, e);
|
||||||
if (this.parentMenu)
|
if (this.parentMenu)
|
||||||
this.parentMenu.hide();
|
this.parentMenu.hide();
|
||||||
} else {
|
} else {
|
||||||
var idx = _.indexOf(this.store.models, rec);
|
var idx = _.indexOf(this.store.models, rec);
|
||||||
if (idx<0) {
|
if (idx<0) {
|
||||||
function getFirstItemIndex() {
|
|
||||||
var first = 0;
|
|
||||||
while(!this.dataViewItems[first].el.is(':visible')) {
|
|
||||||
first++;
|
|
||||||
}
|
|
||||||
return first;
|
|
||||||
}
|
|
||||||
if (data.keyCode==Common.UI.Keys.LEFT) {
|
if (data.keyCode==Common.UI.Keys.LEFT) {
|
||||||
var target = $(e.target).closest('.dropdown-submenu.over');
|
var target = $(e.target).closest('.dropdown-submenu.over');
|
||||||
if (target.length>0) {
|
if (target.length>0) {
|
||||||
target.removeClass('over');
|
target.removeClass('over');
|
||||||
target.find('> a').focus();
|
target.find('> a').focus();
|
||||||
} else
|
} else
|
||||||
idx = getFirstItemIndex.call(this);
|
idx = 0;
|
||||||
} else
|
} else
|
||||||
idx = getFirstItemIndex.call(this);
|
idx = 0;
|
||||||
} else if (this.options.keyMoveDirection == 'both') {
|
} else if (this.options.keyMoveDirection == 'both') {
|
||||||
if (this._layoutParams === undefined)
|
if (this._layoutParams === undefined)
|
||||||
this.fillIndexesArray();
|
this.fillIndexesArray();
|
||||||
|
|
@ -1224,27 +1097,17 @@ define([
|
||||||
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
||||||
}
|
}
|
||||||
} else if (data.keyCode==Common.UI.Keys.UP) {
|
} else if (data.keyCode==Common.UI.Keys.UP) {
|
||||||
if (topIdx==0 && this.outerMenu && this.outerMenu.menu) {
|
while (idx===undefined) {
|
||||||
this.deselectAll(true);
|
topIdx--;
|
||||||
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
if (topIdx<0) topIdx = this._layoutParams.rows-1;
|
||||||
return;
|
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
||||||
} else
|
}
|
||||||
while (idx===undefined) {
|
|
||||||
topIdx--;
|
|
||||||
if (topIdx<0) topIdx = this._layoutParams.rows-1;
|
|
||||||
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (topIdx==this._layoutParams.rows-1 && this.outerMenu && this.outerMenu.menu) {
|
while (idx===undefined) {
|
||||||
this.deselectAll(true);
|
topIdx++;
|
||||||
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
if (topIdx>this._layoutParams.rows-1) topIdx = 0;
|
||||||
return;
|
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
||||||
} else
|
}
|
||||||
while (idx===undefined) {
|
|
||||||
topIdx++;
|
|
||||||
if (topIdx>this._layoutParams.rows-1) topIdx = 0;
|
|
||||||
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
|
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
|
||||||
|
|
@ -1275,7 +1138,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
setDisabled: function(disabled) {
|
||||||
disabled = !!disabled;
|
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
$(this.el).find('.inner').addBack().filter('.inner').toggleClass('disabled', disabled);
|
$(this.el).find('.inner').addBack().filter('.inner').toggleClass('disabled', disabled);
|
||||||
},
|
},
|
||||||
|
|
@ -1295,7 +1157,7 @@ define([
|
||||||
paddings = parseInt(menuRoot.css('padding-top')) + parseInt(menuRoot.css('padding-bottom')),
|
paddings = parseInt(menuRoot.css('padding-top')) + parseInt(menuRoot.css('padding-bottom')),
|
||||||
menuH = menuRoot.outerHeight(),
|
menuH = menuRoot.outerHeight(),
|
||||||
top = parseInt(menuRoot.css('top')),
|
top = parseInt(menuRoot.css('top')),
|
||||||
props = {minScrollbarLength : this.minScrollbarLength};
|
props = {minScrollbarLength : 40};
|
||||||
this.scrollAlwaysVisible && (props.alwaysVisibleY = this.scrollAlwaysVisible);
|
this.scrollAlwaysVisible && (props.alwaysVisibleY = this.scrollAlwaysVisible);
|
||||||
|
|
||||||
if (top + menuH > docH ) {
|
if (top + menuH > docH ) {
|
||||||
|
|
@ -1317,7 +1179,7 @@ define([
|
||||||
};
|
};
|
||||||
|
|
||||||
var el = this.dataViewItems[0].el,
|
var el = this.dataViewItems[0].el,
|
||||||
itemW = el.outerWidth() + parseFloat(el.css('margin-left')) + parseFloat(el.css('margin-right')),
|
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
|
||||||
offsetLeft = this.$el.offset().left,
|
offsetLeft = this.$el.offset().left,
|
||||||
offsetTop = el.offset().top,
|
offsetTop = el.offset().top,
|
||||||
prevtop = -1, topIdx = 0, leftIdx = 0;
|
prevtop = -1, topIdx = 0, leftIdx = 0;
|
||||||
|
|
@ -1361,397 +1223,4 @@ define([
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
Common.UI.DataViewShape = Common.UI.DataViewSimple.extend(_.extend({
|
|
||||||
template: _.template([
|
|
||||||
'<div class="dataview inner" style="<%= style %>">',
|
|
||||||
'<% _.each(options.groupsWithRecent, function(group, index) { %>',
|
|
||||||
'<div class="grouped-data <% if (index === 0) { %> recent-group <% } %> " id="<%= group.id %>" >',
|
|
||||||
'<% if (!_.isEmpty(group.groupName)) { %>',
|
|
||||||
'<div class="group-description">',
|
|
||||||
'<span><%= group.groupName %></span>',
|
|
||||||
'</div>',
|
|
||||||
'<% } %>',
|
|
||||||
'<div class="group-items-container <% if (index === 0) { %> recent-items <% } %>">',
|
|
||||||
'<% _.each(group.groupStore.toJSON(), function(item, index) { %>',
|
|
||||||
'<% if (!item.id) item.id = Common.UI.getId(); %>',
|
|
||||||
'<div class="item" data-index="<%= index %>"<% if(!!item.tip) { %> data-toggle="tooltip" <% } %> ><%= itemTemplate(item) %></div>',
|
|
||||||
'<% }); %>',
|
|
||||||
'</div>',
|
|
||||||
'</div>',
|
|
||||||
'<% }); %>',
|
|
||||||
'</div>'
|
|
||||||
].join('')),
|
|
||||||
initialize : function(options) {
|
|
||||||
var me = this;
|
|
||||||
this.canAddRecents = true;
|
|
||||||
|
|
||||||
this._state = {
|
|
||||||
hideTextRect: options.hideTextRect,
|
|
||||||
hideLines: options.hideLines
|
|
||||||
}
|
|
||||||
|
|
||||||
var filter = Common.localStorage.getKeysFilter();
|
|
||||||
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
|
||||||
|
|
||||||
me.groups = options.groups.toJSON();
|
|
||||||
|
|
||||||
// add recent shapes to store
|
|
||||||
var recentStore = new Common.UI.DataViewGroupStore,
|
|
||||||
recentArr = options.recentShapes || [],
|
|
||||||
cols = (recentArr.length) > 18 ? 7 : 6,
|
|
||||||
height = Math.ceil(recentArr.length/cols) * 35 + 3,
|
|
||||||
width = 30 * cols;
|
|
||||||
|
|
||||||
me.recentShapes = recentArr;
|
|
||||||
|
|
||||||
// check lang
|
|
||||||
if (me.recentShapes.length > 0) {
|
|
||||||
var isTranslated = _.findWhere(me.groups, {groupName: me.recentShapes[0].groupName});
|
|
||||||
if (!isTranslated) {
|
|
||||||
for (var r = 0; r < me.recentShapes.length; r++) {
|
|
||||||
var type = me.recentShapes[r].data.shapeType,
|
|
||||||
record;
|
|
||||||
for (var g = 0; g < me.groups.length; g++) {
|
|
||||||
var store = me.groups[g].groupStore,
|
|
||||||
groupName = me.groups[g].groupName;
|
|
||||||
for (var i = 0; i < store.length; i++) {
|
|
||||||
if (store.at(i).get('data').shapeType === type) {
|
|
||||||
record = store.at(i).toJSON();
|
|
||||||
me.recentShapes[r] = {
|
|
||||||
data: record.data,
|
|
||||||
tip: record.tip,
|
|
||||||
allowSelected: record.allowSelected,
|
|
||||||
selected: false,
|
|
||||||
groupName: groupName
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (record) {
|
|
||||||
record = undefined;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(me.recentShapes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add default recent
|
|
||||||
|
|
||||||
if (me.recentShapes.length < 12) {
|
|
||||||
var count = 12 - me.recentShapes.length,
|
|
||||||
defaultArr = [];
|
|
||||||
|
|
||||||
var addItem = function (rec, groupName) {
|
|
||||||
var item = rec.toJSON(),
|
|
||||||
model = {
|
|
||||||
data: item.data,
|
|
||||||
tip: item.tip,
|
|
||||||
allowSelected: item.allowSelected,
|
|
||||||
selected: false,
|
|
||||||
groupName: groupName
|
|
||||||
};
|
|
||||||
defaultArr.push(model);
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var i = 0; i < me.groups.length && count > 0; i++) {
|
|
||||||
var groupStore = me.groups[i].groupStore,
|
|
||||||
groupName = me.groups[i].groupName;
|
|
||||||
if (i === 0) {
|
|
||||||
addItem(groupStore.at(1), groupName);
|
|
||||||
count--;
|
|
||||||
if (count > 0) {
|
|
||||||
addItem(groupStore.at(2), groupName);
|
|
||||||
count--;
|
|
||||||
}
|
|
||||||
} else if (i !== 3 && i !== 6 && i !== 7) {
|
|
||||||
addItem(groupStore.at(0), groupName);
|
|
||||||
count--;
|
|
||||||
if (count > 0) {
|
|
||||||
addItem(groupStore.at(1), groupName);
|
|
||||||
count--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
me.recentShapes = me.recentShapes.concat(defaultArr);
|
|
||||||
}
|
|
||||||
|
|
||||||
recentStore.add(me.recentShapes);
|
|
||||||
me.groups.unshift({
|
|
||||||
groupName : options.textRecentlyUsed,
|
|
||||||
groupStore : recentStore,
|
|
||||||
groupWidth : width,
|
|
||||||
groupHeight : height
|
|
||||||
});
|
|
||||||
|
|
||||||
me.options.groupsWithRecent = me.groups;
|
|
||||||
|
|
||||||
var store = new Common.UI.DataViewStore();
|
|
||||||
|
|
||||||
_.each(me.groups, function (group, index) {
|
|
||||||
var models = group.groupStore.models;
|
|
||||||
if (index > 0) {
|
|
||||||
for (var i = 0; i < models.length; i++) {
|
|
||||||
models[i].set({groupName: group.groupName});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
store.add(models);
|
|
||||||
});
|
|
||||||
|
|
||||||
options.store = store;
|
|
||||||
|
|
||||||
Common.UI.DataViewSimple.prototype.initialize.call(this, options);
|
|
||||||
|
|
||||||
me.parentMenu.on('show:before', function() { me.updateRecents(); });
|
|
||||||
|
|
||||||
if (me._state.hideLines) {
|
|
||||||
me.hideLinesGroup();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onAfterShowMenu: function(e) {
|
|
||||||
var me = this,
|
|
||||||
updateHideRect = false;
|
|
||||||
if (!me.dataViewItems) {
|
|
||||||
me.dataViewItems = [];
|
|
||||||
_.each(me.cmpEl.find('div.grouped-data'), function (group, indexGroup) {
|
|
||||||
_.each($(group).find('div.item'), function (item, index) {
|
|
||||||
var $item = $(item),
|
|
||||||
rec = me.groups[indexGroup].groupStore.at(index);
|
|
||||||
me.dataViewItems.push({el: $item, groupIndex: indexGroup, index: index});
|
|
||||||
var tip = rec.get('tip');
|
|
||||||
if (tip) {
|
|
||||||
$item.one('mouseenter', function(){ // hide tooltip when mouse is over menu
|
|
||||||
$item.attr('data-toggle', 'tooltip');
|
|
||||||
$item.tooltip({
|
|
||||||
title : tip,
|
|
||||||
placement : 'cursor',
|
|
||||||
zIndex : me.tipZIndex
|
|
||||||
});
|
|
||||||
$item.mouseenter();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
updateHideRect = true;
|
|
||||||
}
|
|
||||||
if (me.updateDataViewItems && me.cmpEl.is(':visible')) {
|
|
||||||
// add recent item in dataViewItems
|
|
||||||
var recent = _.where(me.dataViewItems, {groupIndex: 0});
|
|
||||||
var len = recent ? recent.length : 0;
|
|
||||||
for (var i = 0; i < len; i++) {
|
|
||||||
var tip = me.dataViewItems[i].el.data('bs.tooltip');
|
|
||||||
if (tip) {
|
|
||||||
if (tip.dontShow===undefined)
|
|
||||||
tip.dontShow = true;
|
|
||||||
(tip.tip()).remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
me.dataViewItems = me.dataViewItems.slice(len);
|
|
||||||
var recentViewItems = [];
|
|
||||||
_.each(me.cmpEl.find('.recent-group div.item'), function (item, index) {
|
|
||||||
var $item = $(item),
|
|
||||||
rec = me.recentShapes[index];
|
|
||||||
recentViewItems.push({el: $item, groupIndex: 0, index: index});
|
|
||||||
var tip = rec.tip;
|
|
||||||
if (tip) {
|
|
||||||
$item.one('mouseenter', function(){ // hide tooltip when mouse is over menu
|
|
||||||
$item.attr('data-toggle', 'tooltip');
|
|
||||||
$item.tooltip({
|
|
||||||
title: tip,
|
|
||||||
placement: 'cursor',
|
|
||||||
zIndex : me.tipZIndex
|
|
||||||
});
|
|
||||||
$item.mouseenter();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
me.dataViewItems = recentViewItems.concat(me.dataViewItems);
|
|
||||||
|
|
||||||
if (me.recentShapes.length === 1) {
|
|
||||||
$('.recent-group').show();
|
|
||||||
}
|
|
||||||
me.updateDataViewItems = false;
|
|
||||||
|
|
||||||
updateHideRect = true;
|
|
||||||
}
|
|
||||||
if (this._state.hideLines) {
|
|
||||||
me.hideLines();
|
|
||||||
}
|
|
||||||
if (updateHideRect) {
|
|
||||||
me.hideTextRect(me._state.hideTextRect);
|
|
||||||
}
|
|
||||||
me.fillIndexesArray();
|
|
||||||
},
|
|
||||||
|
|
||||||
onClickItem: function(e) {
|
|
||||||
if ( this.disabled ) return;
|
|
||||||
|
|
||||||
window._event = e; // for FireFox only
|
|
||||||
|
|
||||||
var groupIndex = $(e.currentTarget).closest('div.grouped-data').index(),
|
|
||||||
itemIndex = $(e.currentTarget).closest('div.item').data('index');
|
|
||||||
var index = _.findIndex(this.dataViewItems, function (item) {
|
|
||||||
return (item.groupIndex === groupIndex && item.index === itemIndex);
|
|
||||||
});
|
|
||||||
var record = (index>=0) ? this.store.at(index) : null,
|
|
||||||
view = (index>=0) ? this.dataViewItems[index] : null;
|
|
||||||
if (!record || !view) return;
|
|
||||||
|
|
||||||
record.set({selected: true});
|
|
||||||
var tip = view.el.data('bs.tooltip');
|
|
||||||
if (tip) (tip.tip()).remove();
|
|
||||||
|
|
||||||
if (!this.isSuspendEvents) {
|
|
||||||
this.trigger('item:click', this, view.el, record, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addRecentItem(record);
|
|
||||||
},
|
|
||||||
addRecentItem: function (rec) {
|
|
||||||
var me = this,
|
|
||||||
exist = false,
|
|
||||||
type = rec.get('data').shapeType,
|
|
||||||
groupName = rec.get('groupName');
|
|
||||||
for (var i = 0; i < me.recentShapes.length; i++) {
|
|
||||||
if (me.recentShapes[i].data.shapeType === type) {
|
|
||||||
exist = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (exist) return;
|
|
||||||
|
|
||||||
var item = rec.toJSON(),
|
|
||||||
model = {
|
|
||||||
data: item.data,
|
|
||||||
tip: item.tip,
|
|
||||||
allowSelected: item.allowSelected,
|
|
||||||
selected: false,
|
|
||||||
groupName: groupName
|
|
||||||
};
|
|
||||||
var arr = [model].concat(me.recentShapes.slice(0, 11));
|
|
||||||
Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(arr));
|
|
||||||
me.recentShapes = undefined;
|
|
||||||
},
|
|
||||||
updateRecents: function () {
|
|
||||||
var me = this,
|
|
||||||
recents = Common.localStorage.getItem(this.appPrefix + 'recent-shapes');
|
|
||||||
recents = recents ? JSON.parse(recents) : [];
|
|
||||||
|
|
||||||
var diff = false;
|
|
||||||
if (me.recentShapes) {
|
|
||||||
for (var i = 0; i < recents.length; i++) {
|
|
||||||
if (!me.recentShapes[i] || (me.recentShapes[i] && recents[i].tip !== me.recentShapes[i].tip)) {
|
|
||||||
diff = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
diff = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (recents.length > 0 && diff) {
|
|
||||||
me.recentShapes = recents;
|
|
||||||
var resentsStore = new Common.UI.DataViewStore();
|
|
||||||
_.each(me.recentShapes, function (recent) {
|
|
||||||
var model = {
|
|
||||||
data: {shapeType: recent.data.shapeType},
|
|
||||||
tip: recent.tip,
|
|
||||||
allowSelected: recent.allowSelected,
|
|
||||||
selected: recent.selected,
|
|
||||||
groupName: recent.groupName
|
|
||||||
};
|
|
||||||
resentsStore.push(model);
|
|
||||||
});
|
|
||||||
me.groups[0].groupStore = resentsStore;
|
|
||||||
|
|
||||||
var store = new Common.UI.DataViewStore();
|
|
||||||
_.each(me.groups, function (group) {
|
|
||||||
store.add(group.groupStore.models);
|
|
||||||
});
|
|
||||||
me.store = store;
|
|
||||||
|
|
||||||
var template = _.template([
|
|
||||||
'<% _.each(items, function(item, index) { %>',
|
|
||||||
'<% if (!item.id) item.id = Common.UI.getId(); %>',
|
|
||||||
'<div class="item" data-index="<%= index %>"<% if(!!item.tip) { %> data-toggle="tooltip" <% } %> ><%= itemTemplate(item) %></div>',
|
|
||||||
'<% }) %>'
|
|
||||||
].join(''));
|
|
||||||
me.cmpEl && me.cmpEl.find('.recent-items').html(template({
|
|
||||||
items: me.recentShapes,
|
|
||||||
itemTemplate: this.itemTemplate,
|
|
||||||
style : this.style
|
|
||||||
}));
|
|
||||||
|
|
||||||
me.updateDataViewItems = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fillIndexesArray: function() {
|
|
||||||
if (this.dataViewItems.length<=0) return;
|
|
||||||
|
|
||||||
this._layoutParams = {
|
|
||||||
itemsIndexes: [],
|
|
||||||
columns: 0,
|
|
||||||
rows: 0
|
|
||||||
};
|
|
||||||
|
|
||||||
var el = this.dataViewItems[0].el,
|
|
||||||
first = 0;
|
|
||||||
while (!this.dataViewItems[first].el.is(":visible")) { // if first elem is hidden
|
|
||||||
first++;
|
|
||||||
el = this.dataViewItems[first].el;
|
|
||||||
}
|
|
||||||
|
|
||||||
var itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
|
|
||||||
offsetLeft = this.$el.offset().left,
|
|
||||||
offsetTop = el.offset().top,
|
|
||||||
prevtop = -1, topIdx = 0, leftIdx = first;
|
|
||||||
|
|
||||||
for (var i=0; i<this.dataViewItems.length; i++) {
|
|
||||||
var item = this.dataViewItems[i];
|
|
||||||
if (item.el.is(":visible")) {
|
|
||||||
var top = item.el.offset().top - offsetTop;
|
|
||||||
leftIdx = Math.floor((item.el.offset().left - offsetLeft) / itemW);
|
|
||||||
if (top > prevtop) {
|
|
||||||
prevtop = top;
|
|
||||||
this._layoutParams.itemsIndexes.push([]);
|
|
||||||
topIdx = this._layoutParams.itemsIndexes.length - 1;
|
|
||||||
}
|
|
||||||
this._layoutParams.itemsIndexes[topIdx][leftIdx] = i;
|
|
||||||
item.topIdx = topIdx;
|
|
||||||
item.leftIdx = leftIdx;
|
|
||||||
if (this._layoutParams.columns < leftIdx) this._layoutParams.columns = leftIdx;
|
|
||||||
} else {
|
|
||||||
item.topIdx = -1;
|
|
||||||
item.leftIdx = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this._layoutParams.rows = this._layoutParams.itemsIndexes.length;
|
|
||||||
this._layoutParams.columns++;
|
|
||||||
},
|
|
||||||
hideTextRect: function (hide) {
|
|
||||||
var me = this;
|
|
||||||
this.store.each(function(item, index){
|
|
||||||
if (item.get('data').shapeType === 'textRect') {
|
|
||||||
me.dataViewItems[index].el[hide ? 'addClass' : 'removeClass']('hidden');
|
|
||||||
}
|
|
||||||
}, this);
|
|
||||||
this._state.hideTextRect = hide;
|
|
||||||
},
|
|
||||||
hideLinesGroup: function () {
|
|
||||||
$(this.cmpEl.find('div.grouped-data')[9]).hide();
|
|
||||||
},
|
|
||||||
hideLines: function () {
|
|
||||||
var me = this;
|
|
||||||
this.store.each(function(item, index){
|
|
||||||
if (item.get('groupName') === 'Lines') {
|
|
||||||
var el = me.dataViewItems[index].el;
|
|
||||||
if (el.is(':visible')) {
|
|
||||||
el.addClass('hidden');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, this);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -49,7 +49,7 @@ define([
|
||||||
Common.UI.DimensionPicker = Common.UI.BaseView.extend((function(){
|
Common.UI.DimensionPicker = Common.UI.BaseView.extend((function(){
|
||||||
return {
|
return {
|
||||||
options: {
|
options: {
|
||||||
itemSize : 20,
|
itemSize : 18,
|
||||||
minRows : 5,
|
minRows : 5,
|
||||||
minColumns : 5,
|
minColumns : 5,
|
||||||
maxRows : 20,
|
maxRows : 20,
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ define([
|
||||||
'<% } %>'+
|
'<% } %>'+
|
||||||
'<div>'+
|
'<div>'+
|
||||||
'<div class="cnt-hb img-colorpicker">'+
|
'<div class="cnt-hb img-colorpicker">'+
|
||||||
'<div class="cnt-hb-arrow"></div>'+
|
'<div class="cnt-hb-arrow img-colorpicker"></div>'+
|
||||||
'</div>'+
|
'</div>'+
|
||||||
'<% if (this.changeSaturation) { %>'+
|
'<% if (this.changeSaturation) { %>'+
|
||||||
'<div class="cnt-root">'+
|
'<div class="cnt-root">'+
|
||||||
|
|
@ -106,7 +106,6 @@ define([
|
||||||
refreshUI();
|
refreshUI();
|
||||||
|
|
||||||
me.trigger('changecolor', me, me.color);
|
me.trigger('changecolor', me, me.color);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var refreshUI = function(){
|
var refreshUI = function(){
|
||||||
|
|
@ -126,7 +125,8 @@ define([
|
||||||
previewColorText[0].innerHTML = (me.color == 'transparent') ? me.textNoColor : me.color.toUpperCase();
|
previewColorText[0].innerHTML = (me.color == 'transparent') ? me.textNoColor : me.color.toUpperCase();
|
||||||
|
|
||||||
if (arrowSatBrightness.length>0 && arrowHue.length>0) {
|
if (arrowSatBrightness.length>0 && arrowHue.length>0) {
|
||||||
arrowSatBrightness.css({'left': saturationVal + '%', 'top': 100 - brightnessVal + '%', 'background-color' : me.color});
|
arrowSatBrightness.css('left', saturationVal + '%');
|
||||||
|
arrowSatBrightness.css('top', 100 - brightnessVal + '%');
|
||||||
arrowHue.css('top', parseInt(hueVal * 100 / 360.0) + '%');
|
arrowHue.css('top', parseInt(hueVal * 100 / 360.0) + '%');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -86,9 +86,7 @@ define([
|
||||||
'spellcheck="<%= spellcheck %>" ',
|
'spellcheck="<%= spellcheck %>" ',
|
||||||
'class="form-control <%= cls %>" ',
|
'class="form-control <%= cls %>" ',
|
||||||
'placeholder="<%= placeHolder %>" ',
|
'placeholder="<%= placeHolder %>" ',
|
||||||
'data-hint="<%= dataHint %>"',
|
'value="<%= value %>"',
|
||||||
'data-hint-direction="<%= dataHintDirection %>"',
|
|
||||||
'data-hint-offset="<%= dataHintOffset %>"',
|
|
||||||
'>',
|
'>',
|
||||||
'<span class="input-error"></span>',
|
'<span class="input-error"></span>',
|
||||||
'</div>'
|
'</div>'
|
||||||
|
|
@ -137,9 +135,6 @@ define([
|
||||||
name : this.name,
|
name : this.name,
|
||||||
placeHolder : this.placeHolder,
|
placeHolder : this.placeHolder,
|
||||||
spellcheck : this.spellcheck,
|
spellcheck : this.spellcheck,
|
||||||
dataHint : this.options.dataHint,
|
|
||||||
dataHintDirection: this.options.dataHintDirection,
|
|
||||||
dataHintOffset: this.options.dataHintOffset,
|
|
||||||
scope : me
|
scope : me
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
@ -182,9 +177,6 @@ define([
|
||||||
|
|
||||||
me.rendered = true;
|
me.rendered = true;
|
||||||
|
|
||||||
if (me.value)
|
|
||||||
me.setValue(me.value);
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -288,7 +280,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
setDisabled: function(disabled) {
|
||||||
disabled = !!disabled;
|
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
$(this.el).toggleClass('disabled', disabled);
|
$(this.el).toggleClass('disabled', disabled);
|
||||||
disabled
|
disabled
|
||||||
|
|
@ -418,25 +409,23 @@ define([
|
||||||
validateOnBlur: true,
|
validateOnBlur: true,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
editable: true,
|
editable: true,
|
||||||
iconCls: 'toolbar__icon btn-select-range',
|
iconCls: 'btn-select-range',
|
||||||
btnHint: ''
|
btnHint: ''
|
||||||
},
|
},
|
||||||
|
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<div class="input-field input-field-btn" style="<%= style %>">',
|
'<div class="input-field input-field-btn" style="<%= style %>">',
|
||||||
'<input ',
|
'<input ',
|
||||||
'type=<%= type %> ',
|
'type="<%= type %>" ',
|
||||||
'name="<%= name %>" ',
|
'name="<%= name %>" ',
|
||||||
'spellcheck="<%= spellcheck %>" ',
|
'spellcheck="<%= spellcheck %>" ',
|
||||||
'class="form-control <%= cls %>" ',
|
'class="form-control <%= cls %>" ',
|
||||||
'placeholder="<%= placeHolder %>" ',
|
'placeholder="<%= placeHolder %>" ',
|
||||||
'value="<%= value %>"',
|
'value="<%= value %>"',
|
||||||
'data-hint="<%= dataHint %>"',
|
|
||||||
'data-hint-offset="<%= dataHintOffset %>"',
|
|
||||||
'data-hint-direction="<%= dataHintDirection %>"',
|
|
||||||
'>',
|
'>',
|
||||||
'<span class="input-error"></span>',
|
'<span class="input-error"></span>',
|
||||||
'<div class="select-button">' +
|
'<div class="select-button">' +
|
||||||
|
'<button type="button" class="btn btn-toolbar"><i class="icon toolbar__icon <%= iconCls %>"></i></button>' +
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')),
|
].join('')),
|
||||||
|
|
@ -454,10 +443,8 @@ define([
|
||||||
name : this.name,
|
name : this.name,
|
||||||
placeHolder : this.placeHolder,
|
placeHolder : this.placeHolder,
|
||||||
spellcheck : this.spellcheck,
|
spellcheck : this.spellcheck,
|
||||||
scope : me,
|
iconCls : this.options.iconCls,
|
||||||
dataHint : this.options.dataHint,
|
scope : me
|
||||||
dataHintOffset: this.options.dataHintOffset,
|
|
||||||
dataHintDirection: this.options.dataHintDirection
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (parentEl) {
|
if (parentEl) {
|
||||||
|
|
@ -474,12 +461,9 @@ define([
|
||||||
var el = this.cmpEl;
|
var el = this.cmpEl;
|
||||||
|
|
||||||
this._button = new Common.UI.Button({
|
this._button = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar',
|
el: this.cmpEl.find('button'),
|
||||||
iconCls: this.options.iconCls,
|
hint: this.options.btnHint || ''
|
||||||
hint: this.options.btnHint || '',
|
|
||||||
menu: this.options.menu
|
|
||||||
});
|
});
|
||||||
this._button.render(this.cmpEl.find('.select-button'));
|
|
||||||
this._button.on('click', _.bind(this.onButtonClick, this));
|
this._button.on('click', _.bind(this.onButtonClick, this));
|
||||||
|
|
||||||
this._input = this.cmpEl.find('input').addBack().filter('input');
|
this._input = this.cmpEl.find('input').addBack().filter('input');
|
||||||
|
|
@ -508,8 +492,6 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
me.rendered = true;
|
me.rendered = true;
|
||||||
if (me.value)
|
|
||||||
me.setValue(me.value);
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
@ -519,7 +501,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
setDisabled: function(disabled) {
|
||||||
disabled = !!disabled;
|
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
$(this.el).toggleClass('disabled', disabled);
|
$(this.el).toggleClass('disabled', disabled);
|
||||||
disabled
|
disabled
|
||||||
|
|
@ -540,186 +521,4 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})());
|
})());
|
||||||
|
|
||||||
Common.UI.InputFieldBtnPassword = Common.UI.InputFieldBtn.extend(_.extend((function() {
|
|
||||||
return {
|
|
||||||
options: {
|
|
||||||
id: null,
|
|
||||||
cls: '',
|
|
||||||
style: '',
|
|
||||||
value: '',
|
|
||||||
name: '',
|
|
||||||
type: 'password',
|
|
||||||
validation: null,
|
|
||||||
allowBlank: true,
|
|
||||||
placeHolder: '',
|
|
||||||
blankError: null,
|
|
||||||
spellcheck: false,
|
|
||||||
maskExp: '',
|
|
||||||
validateOnChange: false,
|
|
||||||
validateOnBlur: true,
|
|
||||||
disabled: false,
|
|
||||||
editable: true,
|
|
||||||
showCls: 'toolbar__icon btn-sheet-view',
|
|
||||||
hideCls: 'toolbar__icon hide-password',
|
|
||||||
btnHint: '',
|
|
||||||
repeatInput: null,
|
|
||||||
showPwdOnClick: true
|
|
||||||
},
|
|
||||||
|
|
||||||
initialize : function(options) {
|
|
||||||
options = options || {};
|
|
||||||
options.btnHint = options.btnHint || this.textHintShowPwd;
|
|
||||||
options.iconCls = options.showCls || this.options.showCls;
|
|
||||||
|
|
||||||
Common.UI.InputFieldBtn.prototype.initialize.call(this, options);
|
|
||||||
|
|
||||||
this.hidePwd = true;
|
|
||||||
this.repeatInput= this.options.repeatInput;
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function (parentEl) {
|
|
||||||
Common.UI.InputFieldBtn.prototype.render.call(this, parentEl);
|
|
||||||
|
|
||||||
this._btnElm = this._button.$el;
|
|
||||||
if(this.options.showPwdOnClick)
|
|
||||||
this._button.on('click', _.bind(this.passwordClick, this));
|
|
||||||
else
|
|
||||||
this._btnElm.on('mousedown', _.bind(this.passwordShow, this));
|
|
||||||
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
|
|
||||||
passwordClick: function (e)
|
|
||||||
{
|
|
||||||
if(this.hidePwd) {
|
|
||||||
this.passwordShow(e);
|
|
||||||
this.hidePwd = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.passwordHide(e);
|
|
||||||
this.hidePwd = true;
|
|
||||||
}
|
|
||||||
var me = this;
|
|
||||||
var prevstart = me._input[0].selectionStart,
|
|
||||||
prevend = me._input[0].selectionEnd;
|
|
||||||
setTimeout(function () {
|
|
||||||
me.focus();
|
|
||||||
me._input[0].selectionStart = prevstart;
|
|
||||||
me._input[0].selectionEnd = prevend;
|
|
||||||
}, 1);
|
|
||||||
},
|
|
||||||
|
|
||||||
passwordShow: function (e) {
|
|
||||||
if (this.disabled) return;
|
|
||||||
this._button.setIconCls(this.options.hideCls);
|
|
||||||
this.type = 'text';
|
|
||||||
|
|
||||||
this._input.attr('type', this.type);
|
|
||||||
if(this.repeatInput) {
|
|
||||||
this.repeatInput.type = this.type;
|
|
||||||
this.repeatInput._input.attr('type', this.type);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.options.showPwdOnClick) {
|
|
||||||
this._button.updateHint(this.textHintHidePwd);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this._btnElm.on('mouseup', _.bind(this.passwordHide, this));
|
|
||||||
this._btnElm.on('mouseout', _.bind(this.passwordHide, this));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
passwordHide: function (e) {
|
|
||||||
this._button.setIconCls(this.options.showCls);
|
|
||||||
this.type = 'password';
|
|
||||||
|
|
||||||
this._input.attr('type', this.type);
|
|
||||||
if(this.repeatInput) {
|
|
||||||
this.repeatInput.type = this.type;
|
|
||||||
this.repeatInput._input.attr('type', this.type);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.options.showPwdOnClick) {
|
|
||||||
this._button.updateHint(this.textHintShowPwd);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this._btnElm.off('mouseup', this.passwordHide);
|
|
||||||
this._btnElm.off('mouseout', this.passwordHide);
|
|
||||||
var me = this;
|
|
||||||
var prevstart = me._input[0].selectionStart,
|
|
||||||
prevend = me._input[0].selectionEnd;
|
|
||||||
setTimeout(function () {
|
|
||||||
me.focus();
|
|
||||||
me._input[0].selectionStart = prevstart;
|
|
||||||
me._input[0].selectionEnd = prevend;
|
|
||||||
}, 1);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
textHintShowPwd: 'Show password',
|
|
||||||
textHintHidePwd: 'Hide password'
|
|
||||||
}
|
|
||||||
})(), Common.UI.InputFieldBtnPassword || {}));
|
|
||||||
|
|
||||||
Common.UI.InputFieldBtnCalendar = Common.UI.InputFieldBtn.extend((function (){
|
|
||||||
return {
|
|
||||||
options: {
|
|
||||||
id: null,
|
|
||||||
cls: '',
|
|
||||||
style: '',
|
|
||||||
value: '',
|
|
||||||
type: 'date',
|
|
||||||
name: '',
|
|
||||||
validation: null,
|
|
||||||
allowBlank: true,
|
|
||||||
placeHolder: '',
|
|
||||||
blankError: null,
|
|
||||||
spellcheck: false,
|
|
||||||
maskExp: '',
|
|
||||||
validateOnChange: false,
|
|
||||||
validateOnBlur: true,
|
|
||||||
disabled: false,
|
|
||||||
editable: true,
|
|
||||||
iconCls: 'toolbar__icon btn-datetime',
|
|
||||||
btnHint: '',
|
|
||||||
menu: true
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function (parentEl) {
|
|
||||||
var me = this;
|
|
||||||
Common.UI.InputFieldBtn.prototype.render.call(this, parentEl);
|
|
||||||
|
|
||||||
var id = 'id-' + Common.UI.getId() + 'input-field-datetime',
|
|
||||||
menu = new Common.UI.Menu({
|
|
||||||
menuAlign: 'tr-br',
|
|
||||||
style: 'border: none; padding: 0;',
|
|
||||||
items: [
|
|
||||||
{template: _.template('<div id="' + id + '" style=""></div>'), stopPropagation: true}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
$('button', this._button.cmpEl).addClass('no-caret');
|
|
||||||
this._button.setMenu(menu);
|
|
||||||
this._button.menu.on('show:after', function(menu) {
|
|
||||||
if (!me.cmpCalendar) {
|
|
||||||
me.cmpCalendar = new Common.UI.Calendar({
|
|
||||||
el: me.cmpEl.find('#' + id),
|
|
||||||
enableKeyEvents: true,
|
|
||||||
firstday: 1
|
|
||||||
});
|
|
||||||
me.cmpCalendar.on('date:click', function (cmp, date) {
|
|
||||||
me.trigger('date:click', me, date);
|
|
||||||
menu.hide();
|
|
||||||
});
|
|
||||||
menu.alignPosition();
|
|
||||||
}
|
|
||||||
me.cmpCalendar.focus();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
setDate: function(date) {
|
|
||||||
if (this.cmpCalendar && date && date instanceof Date && !isNaN(date))
|
|
||||||
this.cmpCalendar && this.cmpCalendar.setDate(date);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})());
|
|
||||||
});
|
});
|
||||||
|
|
@ -1,127 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* (c) Copyright Ascensio System SIA 2010-2022
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Label.js
|
|
||||||
*
|
|
||||||
* Created by Julia Radzhabova on 1/20/22
|
|
||||||
* Copyright (c) 2022 Ascensio System SIA. All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (Common === undefined)
|
|
||||||
var Common = {};
|
|
||||||
|
|
||||||
define([
|
|
||||||
'common/main/lib/component/BaseView',
|
|
||||||
'underscore'
|
|
||||||
], function (base, _) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
Common.UI.Label = Common.UI.BaseView.extend({
|
|
||||||
|
|
||||||
options : {
|
|
||||||
id : null,
|
|
||||||
disabled : false,
|
|
||||||
cls : '',
|
|
||||||
iconCls : '',
|
|
||||||
style : '',
|
|
||||||
caption : ''
|
|
||||||
},
|
|
||||||
|
|
||||||
template : _.template('<label class="label-cmp <%= cls %>" style="<%= style %>">' +
|
|
||||||
'<% if ( iconCls ) { %>' +
|
|
||||||
'<i class="icon <%= iconCls %>"></i>' +
|
|
||||||
'<% } %>' +
|
|
||||||
'<span class="caption"><%= caption %></span>' +
|
|
||||||
'</label>'),
|
|
||||||
|
|
||||||
initialize : function(options) {
|
|
||||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
|
||||||
|
|
||||||
this.id = this.options.id || Common.UI.getId();
|
|
||||||
this.cls = this.options.cls;
|
|
||||||
this.iconCls = this.options.iconCls;
|
|
||||||
this.style = this.options.style;
|
|
||||||
this.disabled = this.options.disabled;
|
|
||||||
this.caption = this.options.caption;
|
|
||||||
this.template = this.options.template || this.template;
|
|
||||||
this.rendered = false;
|
|
||||||
|
|
||||||
if (this.options.el)
|
|
||||||
this.render();
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function (parentEl) {
|
|
||||||
var me = this;
|
|
||||||
if (!me.rendered) {
|
|
||||||
var elem = this.template({
|
|
||||||
id : me.id,
|
|
||||||
cls : me.cls,
|
|
||||||
iconCls : me.iconCls,
|
|
||||||
style : me.style,
|
|
||||||
caption : me.caption
|
|
||||||
});
|
|
||||||
if (parentEl) {
|
|
||||||
this.setElement(parentEl, false);
|
|
||||||
parentEl.html(elem);
|
|
||||||
} else {
|
|
||||||
me.$el.html(elem);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$label = me.$el.find('.label-cmp');
|
|
||||||
this.rendered = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.disabled)
|
|
||||||
this.setDisabled(this.disabled);
|
|
||||||
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
|
||||||
if (!this.rendered)
|
|
||||||
return;
|
|
||||||
|
|
||||||
disabled = (disabled===true);
|
|
||||||
if (disabled !== this.disabled) {
|
|
||||||
this.$label.toggleClass('disabled', disabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.disabled = disabled;
|
|
||||||
},
|
|
||||||
|
|
||||||
isDisabled: function() {
|
|
||||||
return this.disabled;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
@ -59,7 +59,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<div class="listview inner <%= cls %>" <% if (options.dataHint) { %> data-hint="<%= options.dataHint %>" <% } if (options.dataHintDirection) { %> data-hint-direction="<%= options.dataHintDirection %>" <% } if (options.dataHintOffset) { %> data-hint-offset="<%= options.dataHintOffset %>" <% } %>></div>'
|
'<div class="listview inner <%= cls %>"></div>'
|
||||||
].join('')),
|
].join('')),
|
||||||
|
|
||||||
onResetItems : function() {
|
onResetItems : function() {
|
||||||
|
|
|
||||||
|
|
@ -104,44 +104,38 @@ define([
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
internalShowLoader: function() {
|
show: function(){
|
||||||
this.ownerEl.append(this.loaderEl);
|
// if (maskeEl || loaderEl)
|
||||||
this.loaderEl.css('min-width', $('.asc-loadmask-title', this.loaderEl).width() + 105);
|
// return;
|
||||||
|
|
||||||
if (this.ownerEl && this.ownerEl.closest('.asc-window.modal').length==0)
|
|
||||||
Common.util.Shortcuts.suspendEvents();
|
|
||||||
},
|
|
||||||
|
|
||||||
internalShowMask: function() {
|
|
||||||
if (!!this.ownerEl.ismasked) return;
|
|
||||||
|
|
||||||
this.ownerEl.ismasked = true;
|
|
||||||
this.ownerEl.append(this.maskeEl);
|
|
||||||
},
|
|
||||||
|
|
||||||
show: function(immediately){
|
|
||||||
this.internalShowMask();
|
|
||||||
|
|
||||||
// The owner is already masked
|
// The owner is already masked
|
||||||
if (!!this.ownerEl.hasloader)
|
var ownerEl = this.ownerEl,
|
||||||
|
loaderEl = this.loaderEl,
|
||||||
|
maskeEl = this.maskeEl;
|
||||||
|
if (!!ownerEl.ismasked)
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
this.ownerEl.hasloader = true;
|
ownerEl.ismasked = true;
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
if (me.title != me.options.title) {
|
if (me.title != me.options.title) {
|
||||||
me.options.title = me.title;
|
me.options.title = me.title;
|
||||||
$('.asc-loadmask-title', this.loaderEl).html(me.title);
|
$('.asc-loadmask-title', loaderEl).html(me.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (immediately) {
|
// show mask after 500 ms if it wont be hided
|
||||||
me.internalShowLoader();
|
me.timerId = setTimeout(function () {
|
||||||
} else if (!me.timerId) {
|
ownerEl.append(maskeEl);
|
||||||
// show mask after 500 ms if it wont be hided
|
ownerEl.append(loaderEl);
|
||||||
me.timerId = setTimeout(function () {
|
|
||||||
me.internalShowLoader();
|
// if (ownerEl.height()<1 || ownerEl.width()<1)
|
||||||
},500);
|
// loaderEl.css({visibility: 'hidden'});
|
||||||
}
|
|
||||||
|
loaderEl.css('min-width', $('.asc-loadmask-title', loaderEl).width() + 105);
|
||||||
|
|
||||||
|
if (ownerEl && ownerEl.closest('.asc-window.modal').length==0)
|
||||||
|
Common.util.Shortcuts.suspendEvents();
|
||||||
|
},500);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
@ -152,23 +146,20 @@ define([
|
||||||
clearTimeout(this.timerId);
|
clearTimeout(this.timerId);
|
||||||
this.timerId = 0;
|
this.timerId = 0;
|
||||||
}
|
}
|
||||||
|
if (ownerEl && ownerEl.ismasked) {
|
||||||
ownerEl && ownerEl.ismasked && this.maskeEl && this.maskeEl.remove();
|
|
||||||
delete ownerEl.ismasked;
|
|
||||||
|
|
||||||
if (ownerEl && ownerEl.hasloader) {
|
|
||||||
if (ownerEl.closest('.asc-window.modal').length==0 && !Common.Utils.ModalWindow.isVisible())
|
if (ownerEl.closest('.asc-window.modal').length==0 && !Common.Utils.ModalWindow.isVisible())
|
||||||
Common.util.Shortcuts.resumeEvents();
|
Common.util.Shortcuts.resumeEvents();
|
||||||
|
|
||||||
|
this.maskeEl && this.maskeEl.remove();
|
||||||
this.loaderEl && this.loaderEl.remove();
|
this.loaderEl && this.loaderEl.remove();
|
||||||
}
|
}
|
||||||
delete ownerEl.hasloader;
|
delete ownerEl.ismasked;
|
||||||
},
|
},
|
||||||
|
|
||||||
setTitle: function(title) {
|
setTitle: function(title) {
|
||||||
this.title = title;
|
this.title = title;
|
||||||
|
|
||||||
if (this.ownerEl && this.ownerEl.hasloader && this.loaderEl){
|
if (this.ownerEl && this.ownerEl.ismasked && this.loaderEl){
|
||||||
var el = $('.asc-loadmask-title', this.loaderEl);
|
var el = $('.asc-loadmask-title', this.loaderEl);
|
||||||
el.html(title);
|
el.html(title);
|
||||||
this.loaderEl.css('min-width', el.width() + 105);
|
this.loaderEl.css('min-width', el.width() + 105);
|
||||||
|
|
@ -182,7 +173,7 @@ define([
|
||||||
updatePosition: function() {
|
updatePosition: function() {
|
||||||
var ownerEl = this.ownerEl,
|
var ownerEl = this.ownerEl,
|
||||||
loaderEl = this.loaderEl;
|
loaderEl = this.loaderEl;
|
||||||
if (ownerEl && ownerEl.hasloader && loaderEl){
|
if (ownerEl && ownerEl.ismasked && loaderEl){
|
||||||
loaderEl.css({
|
loaderEl.css({
|
||||||
top : Math.round(ownerEl.height() / 2 - (loaderEl.height() + parseInt(loaderEl.css('padding-top')) + parseInt(loaderEl.css('padding-bottom'))) / 2) + 'px',
|
top : Math.round(ownerEl.height() / 2 - (loaderEl.height() + parseInt(loaderEl.css('padding-top')) + parseInt(loaderEl.css('padding-bottom'))) / 2) + 'px',
|
||||||
left: Math.round(ownerEl.width() / 2 - (loaderEl.width() + parseInt(loaderEl.css('padding-left')) + parseInt(loaderEl.css('padding-right'))) / 2) + 'px'
|
left: Math.round(ownerEl.width() / 2 - (loaderEl.width() + parseInt(loaderEl.css('padding-left')) + parseInt(loaderEl.css('padding-right'))) / 2) + 'px'
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,6 @@ define([
|
||||||
this.menuAlignEl = this.options.menuAlignEl;
|
this.menuAlignEl = this.options.menuAlignEl;
|
||||||
this.scrollAlwaysVisible = this.options.scrollAlwaysVisible;
|
this.scrollAlwaysVisible = this.options.scrollAlwaysVisible;
|
||||||
this.search = this.options.search;
|
this.search = this.options.search;
|
||||||
this.outerMenu = this.options.outerMenu;
|
|
||||||
|
|
||||||
if (this.options.restoreHeight) {
|
if (this.options.restoreHeight) {
|
||||||
this.options.restoreHeight = (typeof (this.options.restoreHeight) == "number") ? this.options.restoreHeight : (this.options.maxHeight ? this.options.maxHeight : 100000);
|
this.options.restoreHeight = (typeof (this.options.restoreHeight) == "number") ? this.options.restoreHeight : (this.options.maxHeight ? this.options.maxHeight : 100000);
|
||||||
|
|
@ -268,8 +267,6 @@ define([
|
||||||
this.parentEl.on('hide.bs.dropdown', _.bind(me.onBeforeHideMenu, me));
|
this.parentEl.on('hide.bs.dropdown', _.bind(me.onBeforeHideMenu, me));
|
||||||
this.parentEl.on('hidden.bs.dropdown', _.bind(me.onAfterHideMenu, me));
|
this.parentEl.on('hidden.bs.dropdown', _.bind(me.onAfterHideMenu, me));
|
||||||
this.parentEl.on('keydown.after.bs.dropdown', _.bind(me.onAfterKeydownMenu, me));
|
this.parentEl.on('keydown.after.bs.dropdown', _.bind(me.onAfterKeydownMenu, me));
|
||||||
this.parentEl.on('keydown.before.bs.dropdown', _.bind(me.onBeforeKeydownMenu, me));
|
|
||||||
this.options.innerMenus && this.on('keydown:before', _.bind(me.onBeforeKeyDown, me));
|
|
||||||
|
|
||||||
menuRoot.hover(
|
menuRoot.hover(
|
||||||
function(e) { me.isOver = true;},
|
function(e) { me.isOver = true;},
|
||||||
|
|
@ -377,12 +374,12 @@ define([
|
||||||
onBeforeShowMenu: function(e) {
|
onBeforeShowMenu: function(e) {
|
||||||
Common.NotificationCenter.trigger('menu:show');
|
Common.NotificationCenter.trigger('menu:show');
|
||||||
this.trigger('show:before', this, e);
|
this.trigger('show:before', this, e);
|
||||||
(e && e.target===e.currentTarget) && this.alignPosition();
|
this.alignPosition();
|
||||||
},
|
},
|
||||||
|
|
||||||
onAfterShowMenu: function(e) {
|
onAfterShowMenu: function(e) {
|
||||||
this.trigger('show:after', this, e);
|
this.trigger('show:after', this, e);
|
||||||
if (this.scroller && e && e.target===e.currentTarget) {
|
if (this.scroller) {
|
||||||
var menuRoot = this.menuRoot;
|
var menuRoot = this.menuRoot;
|
||||||
if (this.wheelSpeed===undefined) {
|
if (this.wheelSpeed===undefined) {
|
||||||
var item = menuRoot.find('> li:first'),
|
var item = menuRoot.find('> li:first'),
|
||||||
|
|
@ -456,21 +453,6 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onBeforeKeydownMenu: function(e) {
|
|
||||||
if (e.isDefaultPrevented() || !(this.outerMenu && this.outerMenu.menu))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) {
|
|
||||||
var $items = this.menuRoot.find('> li').find('> a'),
|
|
||||||
index = $items.index($items.filter(':focus'));
|
|
||||||
if (e.keyCode==Common.UI.Keys.UP && index==0 || e.keyCode == Common.UI.Keys.DOWN && index==$items.length-1) {
|
|
||||||
this.outerMenu.menu.focusOuter(e, this.outerMenu.index);
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
selectCandidate: function() {
|
selectCandidate: function() {
|
||||||
var index = this._search.index || 0,
|
var index = this._search.index || 0,
|
||||||
re = new RegExp('^' + ((this._search.full) ? this._search.text : this._search.char), 'i'),
|
re = new RegExp('^' + ((this._search.full) ? this._search.text : this._search.char), 'i'),
|
||||||
|
|
@ -509,85 +491,6 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onBeforeKeyDown: function(menu, e) {
|
|
||||||
if (e.keyCode == Common.UI.Keys.RETURN) {
|
|
||||||
var li = $(e.target).closest('li');
|
|
||||||
if (li.length>0) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
li.click();
|
|
||||||
}
|
|
||||||
Common.UI.Menu.Manager.hideAll();
|
|
||||||
} else if (e.namespace!=="after.bs.dropdown" && (e.keyCode == Common.UI.Keys.DOWN || e.keyCode == Common.UI.Keys.UP)) {
|
|
||||||
if ( this.menuRoot.length<1 || $(e.target).closest('ul[role=menu]').get(0) !== this.menuRoot.get(0)) return;
|
|
||||||
|
|
||||||
var innerMenu = this.findInnerMenu(e.keyCode);
|
|
||||||
if (innerMenu && innerMenu.focusInner) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
_.delay(function() {
|
|
||||||
innerMenu.focusInner(e);
|
|
||||||
}, 10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setInnerMenu: function(menus) {
|
|
||||||
if (this.options.innerMenus || !menus) return;
|
|
||||||
|
|
||||||
this.options.innerMenus = menus;
|
|
||||||
this.rendered && this.on('keydown:before', _.bind(this.onBeforeKeyDown, this));
|
|
||||||
},
|
|
||||||
|
|
||||||
findInnerMenu: function(direction, index, findOuter) {
|
|
||||||
if (!this.options.innerMenus) return;
|
|
||||||
|
|
||||||
var $allItems = $('> li', this.menuRoot),
|
|
||||||
$liItems = $('> li:not(.divider):not(.disabled):visible', this.menuRoot),
|
|
||||||
length = $liItems.length;
|
|
||||||
if (!length) return;
|
|
||||||
|
|
||||||
var step = 0;
|
|
||||||
while (step<length) {
|
|
||||||
var focusedIndex = (index!==undefined) ? $liItems.index($allItems.eq(index)) : $liItems.index($liItems.find('> a').filter(':focus').parent());
|
|
||||||
var checkedIndex = (direction == Common.UI.Keys.DOWN) ? (focusedIndex<length-1 ? focusedIndex+1 : 0) : (focusedIndex>0 ? focusedIndex-1 : length-1),
|
|
||||||
checkedItem = $liItems.eq(checkedIndex);
|
|
||||||
index = $allItems.index(checkedItem);
|
|
||||||
|
|
||||||
for (var i=0; i<this.options.innerMenus.length; i++) {
|
|
||||||
var item = this.options.innerMenus[i];
|
|
||||||
if (item && item.menu && item.index==index) {
|
|
||||||
return item.menu;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (checkedItem.find('> a').length>0)
|
|
||||||
return findOuter ? checkedItem : undefined;
|
|
||||||
step++;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
focusInner: function(e) {
|
|
||||||
if (e.keyCode == Common.UI.Keys.UP)
|
|
||||||
this.items[this.items.length-1].cmpEl.find('> a').focus();
|
|
||||||
else
|
|
||||||
this.items[0].cmpEl.find('> a').focus();
|
|
||||||
},
|
|
||||||
|
|
||||||
focusOuter: function(e, index) {
|
|
||||||
var innerMenu = this.findInnerMenu(e.keyCode, index, true);
|
|
||||||
if (innerMenu && innerMenu.focusInner) {
|
|
||||||
_.delay(function() {
|
|
||||||
innerMenu.focusInner(e);
|
|
||||||
}, 10);
|
|
||||||
} else if (innerMenu) {
|
|
||||||
innerMenu.find('> a').focus();
|
|
||||||
} else {
|
|
||||||
var $items = $('> li:not(.divider):not(.disabled):visible', this.menuRoot).find('> a'),
|
|
||||||
length = $items.length;
|
|
||||||
length && $items.eq(e.keyCode == Common.UI.Keys.UP ? (index<0 ? length-1 : index) : (index>=length-1 ? 0 : index+1)).focus();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onItemClick: function(item, e) {
|
onItemClick: function(item, e) {
|
||||||
if (!item.menu) this.isOver = false;
|
if (!item.menu) this.isOver = false;
|
||||||
if (item.options.stopPropagation) {
|
if (item.options.stopPropagation) {
|
||||||
|
|
@ -651,28 +554,7 @@ define([
|
||||||
if (left < 0)
|
if (left < 0)
|
||||||
left = 0;
|
left = 0;
|
||||||
|
|
||||||
if (this.options.restoreHeightAndTop) { // can change top position, if top<0 - then change menu height
|
if (this.options.restoreHeight) {
|
||||||
var cg = Common.Utils.croppedGeometry();
|
|
||||||
docH = cg.height - 10;
|
|
||||||
menuRoot.css('max-height', 'none');
|
|
||||||
menuH = menuRoot.outerHeight();
|
|
||||||
if (top + menuH > docH + cg.top) {
|
|
||||||
top = docH - menuH;
|
|
||||||
}
|
|
||||||
if (top < cg.top)
|
|
||||||
top = cg.top;
|
|
||||||
if (top + menuH > docH + cg.top) {
|
|
||||||
menuRoot.css('max-height', (docH - top) + 'px');
|
|
||||||
(!this.scroller) && (this.scroller = new Common.UI.Scroller({
|
|
||||||
el: this.$el.find('> .dropdown-menu '),
|
|
||||||
minScrollbarLength: 30,
|
|
||||||
suppressScrollX: true,
|
|
||||||
alwaysVisibleY: this.scrollAlwaysVisible
|
|
||||||
}));
|
|
||||||
this.wheelSpeed = undefined;
|
|
||||||
}
|
|
||||||
this.scroller && this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
|
|
||||||
} else if (this.options.restoreHeight) {
|
|
||||||
if (typeof (this.options.restoreHeight) == "number") {
|
if (typeof (this.options.restoreHeight) == "number") {
|
||||||
if (top + menuH > docH) {
|
if (top + menuH > docH) {
|
||||||
menuRoot.css('max-height', (docH - top) + 'px');
|
menuRoot.css('max-height', (docH - top) + 'px');
|
||||||
|
|
@ -706,7 +588,7 @@ define([
|
||||||
if (this.options.additionalAlign)
|
if (this.options.additionalAlign)
|
||||||
this.options.additionalAlign.call(this, menuRoot, left, top);
|
this.options.additionalAlign.call(this, menuRoot, left, top);
|
||||||
else {
|
else {
|
||||||
var _css = {left: left, top: top};
|
var _css = {left: Math.ceil(left), top: Math.ceil(top)};
|
||||||
if (!(menuH < docH)) _css['margin-top'] = 0;
|
if (!(menuH < docH)) _css['margin-top'] = 0;
|
||||||
|
|
||||||
menuRoot.css(_css);
|
menuRoot.css(_css);
|
||||||
|
|
@ -975,12 +857,12 @@ define([
|
||||||
onBeforeShowMenu: function(e) {
|
onBeforeShowMenu: function(e) {
|
||||||
Common.NotificationCenter.trigger('menu:show');
|
Common.NotificationCenter.trigger('menu:show');
|
||||||
this.trigger('show:before', this, e);
|
this.trigger('show:before', this, e);
|
||||||
(e && e.target===e.currentTarget) && this.alignPosition();
|
this.alignPosition();
|
||||||
},
|
},
|
||||||
|
|
||||||
onAfterShowMenu: function(e) {
|
onAfterShowMenu: function(e) {
|
||||||
this.trigger('show:after', this, e);
|
this.trigger('show:after', this, e);
|
||||||
if (this.scroller && e && e.target===e.currentTarget) {
|
if (this.scroller) {
|
||||||
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
|
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
|
||||||
var menuRoot = this.menuRoot,
|
var menuRoot = this.menuRoot,
|
||||||
$selected = menuRoot.find('> li .checked');
|
$selected = menuRoot.find('> li .checked');
|
||||||
|
|
|
||||||
|
|
@ -98,22 +98,17 @@ define([
|
||||||
checked : false,
|
checked : false,
|
||||||
allowDepress: false,
|
allowDepress: false,
|
||||||
disabled : false,
|
disabled : false,
|
||||||
visible : true,
|
|
||||||
value : null,
|
value : null,
|
||||||
toggleGroup : null,
|
toggleGroup : null,
|
||||||
iconCls : '',
|
iconCls : '',
|
||||||
menu : null,
|
menu : null,
|
||||||
canFocused : true,
|
canFocused : true
|
||||||
dataHint : '',
|
|
||||||
dataHintDirection: '',
|
|
||||||
dataHintOffset: '',
|
|
||||||
dataHintTitle: ''
|
|
||||||
},
|
},
|
||||||
|
|
||||||
tagName : 'li',
|
tagName : 'li',
|
||||||
|
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<a id="<%= id %>" style="<%= style %>" <% if(options.canFocused) { %> tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; if(!_.isUndefined(options.dataHint)) { %> data-hint="<%= options.dataHint %>" <% }; if(!_.isUndefined(options.dataHintDirection)) { %> data-hint-direction="<%= options.dataHintDirection %>" <% }; if(!_.isUndefined(options.dataHintOffset)) { %> data-hint-offset="<%= options.dataHintOffset %>" <% }; if(options.dataHintTitle) { %> data-hint-title="<%= options.dataHintTitle %>" <% }; %> >',
|
'<a id="<%= id %>" style="<%= style %>" <% if(options.canFocused) { %> tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; %> >',
|
||||||
'<% if (!_.isEmpty(iconCls)) { %>',
|
'<% if (!_.isEmpty(iconCls)) { %>',
|
||||||
'<span class="menu-item-icon <%= iconCls %>"></span>',
|
'<span class="menu-item-icon <%= iconCls %>"></span>',
|
||||||
'<% } %>',
|
'<% } %>',
|
||||||
|
|
@ -135,7 +130,6 @@ define([
|
||||||
this.checked = me.options.checked;
|
this.checked = me.options.checked;
|
||||||
me.allowDepress = me.options.allowDepress;
|
me.allowDepress = me.options.allowDepress;
|
||||||
this.disabled = me.options.disabled;
|
this.disabled = me.options.disabled;
|
||||||
this.visible = me.options.visible;
|
|
||||||
this.value = me.options.value;
|
this.value = me.options.value;
|
||||||
this.toggleGroup = me.options.toggleGroup;
|
this.toggleGroup = me.options.toggleGroup;
|
||||||
this.template = me.options.template || this.template;
|
this.template = me.options.template || this.template;
|
||||||
|
|
@ -219,9 +213,6 @@ define([
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.cls)
|
|
||||||
el.addClass(this.cls);
|
|
||||||
|
|
||||||
if (this.disabled)
|
if (this.disabled)
|
||||||
el.toggleClass('disabled', this.disabled);
|
el.toggleClass('disabled', this.disabled);
|
||||||
|
|
||||||
|
|
@ -231,8 +222,6 @@ define([
|
||||||
Common.UI.ToggleManager.register(me);
|
Common.UI.ToggleManager.register(me);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.visible)
|
|
||||||
this.setVisible(this.visible);
|
|
||||||
|
|
||||||
me.cmpEl = el;
|
me.cmpEl = el;
|
||||||
me.rendered = true;
|
me.rendered = true;
|
||||||
|
|
@ -301,7 +290,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onItemMouseDown: function(e) {
|
onItemMouseDown: function(e) {
|
||||||
Common.UI.HintManager && Common.UI.HintManager.clearHints();
|
|
||||||
if (e.which != 1) {
|
if (e.which != 1) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
|
||||||
|
|
@ -110,10 +110,7 @@ define([
|
||||||
hold : true,
|
hold : true,
|
||||||
speed : 'medium',
|
speed : 'medium',
|
||||||
width : 90,
|
width : 90,
|
||||||
allowDecimal: true,
|
allowDecimal: true
|
||||||
dataHint : '',
|
|
||||||
dataHintDirection: '',
|
|
||||||
dataHintOffset: ''
|
|
||||||
},
|
},
|
||||||
|
|
||||||
disabled : false,
|
disabled : false,
|
||||||
|
|
@ -121,7 +118,7 @@ define([
|
||||||
rendered : false,
|
rendered : false,
|
||||||
|
|
||||||
template :
|
template :
|
||||||
'<input type="text" class="form-control" spellcheck="false" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">' +
|
'<input type="text" class="form-control" spellcheck="false">' +
|
||||||
'<div class="spinner-buttons">' +
|
'<div class="spinner-buttons">' +
|
||||||
'<button type="button" class="spinner-up"><i class="arrow"></i></button>' +
|
'<button type="button" class="spinner-up"><i class="arrow"></i></button>' +
|
||||||
'<button type="button" class="spinner-down"><i class="arrow"></i></button>' +
|
'<button type="button" class="spinner-down"><i class="arrow"></i></button>' +
|
||||||
|
|
@ -147,13 +144,8 @@ define([
|
||||||
el.on('input', '.form-control', _.bind(this.onInput, this));
|
el.on('input', '.form-control', _.bind(this.onInput, this));
|
||||||
if (!this.options.allowDecimal)
|
if (!this.options.allowDecimal)
|
||||||
el.on('keypress', '.form-control', _.bind(this.onKeyPress, this));
|
el.on('keypress', '.form-control', _.bind(this.onKeyPress, this));
|
||||||
el.on('focus', 'input.form-control', function(e) {
|
el.on('focus', 'input.form-control', function() {
|
||||||
setTimeout(function(){
|
setTimeout(function(){me.$input && me.$input.select();}, 1);
|
||||||
if (me.$input) {
|
|
||||||
me.$input[0].selectionStart = 0;
|
|
||||||
me.$input[0].selectionEnd = me.$input.val().length;
|
|
||||||
}
|
|
||||||
}, 1);
|
|
||||||
});
|
});
|
||||||
Common.Utils.isGecko && el.on('blur', 'input.form-control', function() {
|
Common.Utils.isGecko && el.on('blur', 'input.form-control', function() {
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
|
|
@ -193,13 +185,7 @@ define([
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
var el = this.$el || $(this.el);
|
var el = this.$el || $(this.el);
|
||||||
|
el.html(this.template);
|
||||||
var template = _.template(this.template);
|
|
||||||
el.html($(template({
|
|
||||||
dataHint : this.options.dataHint,
|
|
||||||
dataHintDirection: this.options.dataHintDirection,
|
|
||||||
dataHintOffset : this.options.dataHintOffset
|
|
||||||
})));
|
|
||||||
|
|
||||||
this.$input = el.find('.form-control');
|
this.$input = el.find('.form-control');
|
||||||
this.rendered = true;
|
this.rendered = true;
|
||||||
|
|
@ -211,7 +197,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
setDisabled: function(disabled) {
|
||||||
disabled = !!disabled;
|
|
||||||
var el = this.$el || $(this.el);
|
var el = this.$el || $(this.el);
|
||||||
if (disabled !== this.disabled) {
|
if (disabled !== this.disabled) {
|
||||||
el.find('button').toggleClass('disabled', disabled);
|
el.find('button').toggleClass('disabled', disabled);
|
||||||
|
|
@ -248,14 +233,6 @@ define([
|
||||||
this.options.step = step;
|
this.options.step = step;
|
||||||
},
|
},
|
||||||
|
|
||||||
getMinValue: function(){
|
|
||||||
return this.options.minValue;
|
|
||||||
},
|
|
||||||
|
|
||||||
getMaxValue: function(){
|
|
||||||
return this.options.maxValue;
|
|
||||||
},
|
|
||||||
|
|
||||||
getNumberValue: function(){
|
getNumberValue: function(){
|
||||||
return this.checkAutoText(this.value) ? -1 : parseFloat(this.value);
|
return this.checkAutoText(this.value) ? -1 : parseFloat(this.value);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ define([
|
||||||
var $scrollL;
|
var $scrollL;
|
||||||
var optsFold = {timeout: 2000};
|
var optsFold = {timeout: 2000};
|
||||||
var config = {};
|
var config = {};
|
||||||
var btnsMore = [];
|
|
||||||
|
|
||||||
var onScrollTabs = function(opts, e) {
|
var onScrollTabs = function(opts, e) {
|
||||||
var sv = $boxTabs.scrollLeft();
|
var sv = $boxTabs.scrollLeft();
|
||||||
|
|
@ -94,20 +93,19 @@ define([
|
||||||
|
|
||||||
var _template_tabs =
|
var _template_tabs =
|
||||||
'<section class="tabs">' +
|
'<section class="tabs">' +
|
||||||
'<a class="scroll left" data-hint="0" data-hint-direction="bottom" data-hint-offset="-7, 0" data-hint-title="V"></a>' +
|
'<a class="scroll left"></a>' +
|
||||||
'<ul>' +
|
'<ul>' +
|
||||||
'<% for(var i in items) { %>' +
|
'<% for(var i in items) { %>' +
|
||||||
'<% if (typeof items[i] == "object") { %>' +
|
'<% if (typeof items[i] == "object") { %>' +
|
||||||
'<li class="ribtab' +
|
'<li class="ribtab' +
|
||||||
'<% if (items[i].haspanel===false) print(" x-lone") %>' +
|
'<% if (items[i].haspanel===false) print(" x-lone") %>' +
|
||||||
'<% if (items[i].extcls) print(\' \' + items[i].extcls) %>"' +
|
'<% if (items[i].extcls) print(\' \' + items[i].extcls) %>">' +
|
||||||
'<% if (typeof items[i].layoutname == "string") print(" data-layout-name=" + \' \' + items[i].layoutname) + \' \' %>>' +
|
'<a data-tab="<%= items[i].action %>" data-title="<%= items[i].caption %>"><%= items[i].caption %></a>' +
|
||||||
'<a data-tab="<%= items[i].action %>" data-title="<%= items[i].caption %>" data-hint="0" data-hint-direction="bottom" data-hint-offset="small" <% if (typeof items[i].dataHintTitle !== "undefined") { %> data-hint-title="<%= items[i].dataHintTitle %>" <% } %>><%= items[i].caption %></a>' +
|
|
||||||
'</li>' +
|
'</li>' +
|
||||||
'<% } %>' +
|
'<% } %>' +
|
||||||
'<% } %>' +
|
'<% } %>' +
|
||||||
'</ul>' +
|
'</ul>' +
|
||||||
'<a class="scroll right" data-hint="0" data-hint-direction="bottom" data-hint-offset="-7, 0" data-hint-title="R"></a>' +
|
'<a class="scroll right"></a>' +
|
||||||
'</section>';
|
'</section>';
|
||||||
|
|
||||||
this.$layout = $(options.template({
|
this.$layout = $(options.template({
|
||||||
|
|
@ -120,7 +118,6 @@ define([
|
||||||
Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
|
Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
|
||||||
this.setVisible(action, visible);
|
this.setVisible(action, visible);
|
||||||
}, this));
|
}, this));
|
||||||
Common.NotificationCenter.on('tab:resize', _.bind(this.onResizeTabs, this));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
afterRender: function() {
|
afterRender: function() {
|
||||||
|
|
@ -128,9 +125,7 @@ define([
|
||||||
|
|
||||||
$boxTabs = me.$('.tabs > ul');
|
$boxTabs = me.$('.tabs > ul');
|
||||||
me.$tabs = $boxTabs.find('> li');
|
me.$tabs = $boxTabs.find('> li');
|
||||||
me.$boxpanels = me.$('.box-panels');
|
me.$panels = me.$('.box-panels > .panel');
|
||||||
me.$panels = me.$boxpanels.find('> .panel');
|
|
||||||
|
|
||||||
optsFold.$bar = me.$('.toolbar');
|
optsFold.$bar = me.$('.toolbar');
|
||||||
var $scrollR = me.$('.tabs .scroll.right');
|
var $scrollR = me.$('.tabs .scroll.right');
|
||||||
$scrollL = me.$('.tabs .scroll.left');
|
$scrollL = me.$('.tabs .scroll.left');
|
||||||
|
|
@ -230,7 +225,7 @@ define([
|
||||||
// optsFold.timer = setTimeout(this.collapse, optsFold.timeout);
|
// optsFold.timer = setTimeout(this.collapse, optsFold.timeout);
|
||||||
},
|
},
|
||||||
|
|
||||||
onResizeTabs: function(e) {
|
onResize: function(e) {
|
||||||
if ( this.hasTabInvisible() ) {
|
if ( this.hasTabInvisible() ) {
|
||||||
if ( !$boxTabs.parent().hasClass('short') )
|
if ( !$boxTabs.parent().hasClass('short') )
|
||||||
$boxTabs.parent().addClass('short');
|
$boxTabs.parent().addClass('short');
|
||||||
|
|
@ -238,11 +233,7 @@ define([
|
||||||
if ( $boxTabs.parent().hasClass('short') ) {
|
if ( $boxTabs.parent().hasClass('short') ) {
|
||||||
$boxTabs.parent().removeClass('short');
|
$boxTabs.parent().removeClass('short');
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
onResize: function(e) {
|
|
||||||
this.onResizeTabs();
|
|
||||||
this.hideMoreBtns();
|
|
||||||
this.processPanelVisible();
|
this.processPanelVisible();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -269,7 +260,7 @@ define([
|
||||||
me._timerSetTab = false;
|
me._timerSetTab = false;
|
||||||
}, 500);
|
}, 500);
|
||||||
me.setTab(tab);
|
me.setTab(tab);
|
||||||
// me.processPanelVisible(null, true);
|
me.processPanelVisible(null, true);
|
||||||
if ( !me.isFolded ) {
|
if ( !me.isFolded ) {
|
||||||
if ( me.dblclick_timer ) clearTimeout(me.dblclick_timer);
|
if ( me.dblclick_timer ) clearTimeout(me.dblclick_timer);
|
||||||
me.dblclick_timer = setTimeout(function () {
|
me.dblclick_timer = setTimeout(function () {
|
||||||
|
|
@ -294,14 +285,11 @@ define([
|
||||||
if ( tab ) {
|
if ( tab ) {
|
||||||
me.$tabs.removeClass('active');
|
me.$tabs.removeClass('active');
|
||||||
me.$panels.removeClass('active');
|
me.$panels.removeClass('active');
|
||||||
me.hideMoreBtns();
|
|
||||||
|
|
||||||
var panel = this.$panels.filter('[data-tab=' + tab + ']');
|
var panel = this.$panels.filter('[data-tab=' + tab + ']');
|
||||||
if ( panel.length ) {
|
if ( panel.length ) {
|
||||||
this.lastPanel = tab;
|
this.lastPanel = tab;
|
||||||
panel.addClass('active');
|
panel.addClass('active');
|
||||||
me.setMoreButton(tab, panel);
|
|
||||||
me.processPanelVisible(null, true, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( panel.length ) {
|
if ( panel.length ) {
|
||||||
|
|
@ -328,7 +316,7 @@ define([
|
||||||
return config.tabs[index].action;
|
return config.tabs[index].action;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _tabTemplate = _.template('<li class="ribtab" style="display: none;" <% if (typeof layoutname == "string") print(" data-layout-name=" + \' \' + layoutname) + \' \' %>><a data-tab="<%= action %>" data-title="<%= caption %>" data-hint="0" data-hint-direction="bottom" data-hint-offset="small" <% if (typeof dataHintTitle !== "undefined") { %> data-hint-title="<%= dataHintTitle %>" <% } %> ><%= caption %></a></li>');
|
var _tabTemplate = _.template('<li class="ribtab" style="display: none;"><a data-tab="<%= action %>" data-title="<%= caption %>"><%= caption %></a></li>');
|
||||||
|
|
||||||
config.tabs[after + 1] = tab;
|
config.tabs[after + 1] = tab;
|
||||||
var _after_action = _get_tab_action(after);
|
var _after_action = _get_tab_action(after);
|
||||||
|
|
@ -386,7 +374,7 @@ define([
|
||||||
* hide button's caption to decrease panel width
|
* hide button's caption to decrease panel width
|
||||||
* ##adopt-panel-width
|
* ##adopt-panel-width
|
||||||
**/
|
**/
|
||||||
processPanelVisible: function(panel, now, force) {
|
processPanelVisible: function(panel, now) {
|
||||||
var me = this;
|
var me = this;
|
||||||
if ( me._timer_id ) clearTimeout(me._timer_id);
|
if ( me._timer_id ) clearTimeout(me._timer_id);
|
||||||
|
|
||||||
|
|
@ -398,7 +386,6 @@ define([
|
||||||
_rightedge = data.rightedge,
|
_rightedge = data.rightedge,
|
||||||
_btns = data.buttons,
|
_btns = data.buttons,
|
||||||
_flex = data.flex;
|
_flex = data.flex;
|
||||||
var more_section = $active.find('.more-box');
|
|
||||||
|
|
||||||
if ( !_rightedge ) {
|
if ( !_rightedge ) {
|
||||||
_rightedge = $active.get(0).getBoundingClientRect().right;
|
_rightedge = $active.get(0).getBoundingClientRect().right;
|
||||||
|
|
@ -419,53 +406,44 @@ define([
|
||||||
data.flex = _flex;
|
data.flex = _flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (_rightedge > _maxright)) {
|
if ( _rightedge > _maxright) {
|
||||||
if (!more_section.is(':visible') ) {
|
if (_flex.length>0) {
|
||||||
if (_flex.length>0) {
|
for (var i=0; i<_flex.length; i++) {
|
||||||
for (var i=0; i<_flex.length; i++) {
|
var item = _flex[i].el;
|
||||||
var item = _flex[i].el;
|
if (item.outerWidth() > parseInt(item.css('min-width')))
|
||||||
_rightedge = $active.get(0).getBoundingClientRect().right;
|
return;
|
||||||
if (item.outerWidth() > parseInt(item.css('min-width'))) {
|
else
|
||||||
data.rightedge = _rightedge;
|
item.css('width', item.css('min-width'));
|
||||||
return;
|
|
||||||
} else
|
|
||||||
item.css('width', item.css('min-width'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (var i=_btns.length-1; i>=0; i--) {
|
}
|
||||||
var btn = _btns[i];
|
for (var i=_btns.length-1; i>=0; i--) {
|
||||||
if ( !btn.hasClass('compactwidth') && !btn.hasClass('slot-btn-more')) {
|
var btn = _btns[i];
|
||||||
|
if ( !btn.hasClass('compactwidth') ) {
|
||||||
|
btn.addClass('compactwidth');
|
||||||
|
_rightedge = $active.get(0).getBoundingClientRect().right;
|
||||||
|
if (_rightedge <= _maxright)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.rightedge = _rightedge;
|
||||||
|
} else {
|
||||||
|
for (var i=0; i<_btns.length; i++) {
|
||||||
|
var btn = _btns[i];
|
||||||
|
if ( btn.hasClass('compactwidth') ) {
|
||||||
|
btn.removeClass('compactwidth');
|
||||||
|
_rightedge = $active.get(0).getBoundingClientRect().right;
|
||||||
|
if ( _rightedge > _maxright) {
|
||||||
btn.addClass('compactwidth');
|
btn.addClass('compactwidth');
|
||||||
_rightedge = $active.get(0).getBoundingClientRect().right;
|
_rightedge = $active.get(0).getBoundingClientRect().right;
|
||||||
if (_rightedge <= _maxright)
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.rightedge = _rightedge;
|
|
||||||
}
|
}
|
||||||
me.resizeToolbar(force);
|
data.rightedge = _rightedge;
|
||||||
} else {
|
if (_flex.length>0 && $active.find('.btn-slot.compactwidth').length<1) {
|
||||||
more_section.is(':visible') && me.resizeToolbar(force);
|
for (var i=0; i<_flex.length; i++) {
|
||||||
if (!more_section.is(':visible')) {
|
var item = _flex[i];
|
||||||
for (var i=0; i<_btns.length; i++) {
|
item.el.css('width', item.width);
|
||||||
var btn = _btns[i];
|
|
||||||
if ( btn.hasClass('compactwidth') ) {
|
|
||||||
btn.removeClass('compactwidth');
|
|
||||||
_rightedge = $active.get(0).getBoundingClientRect().right;
|
|
||||||
if ( _rightedge > _maxright) {
|
|
||||||
btn.addClass('compactwidth');
|
|
||||||
_rightedge = $active.get(0).getBoundingClientRect().right;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
data.rightedge = _rightedge;
|
|
||||||
if (_flex.length>0 && $active.find('.btn-slot.compactwidth').length<1) {
|
|
||||||
for (var i=0; i<_flex.length; i++) {
|
|
||||||
var item = _flex[i];
|
|
||||||
item.el.css('width', item.width);
|
|
||||||
data.rightedge = $active.get(0).getBoundingClientRect().right;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -498,303 +476,6 @@ define([
|
||||||
this.$tabs.find('> a[data-tab=' + tab + ']').parent().css('display', visible ? '' : 'none');
|
this.$tabs.find('> a[data-tab=' + tab + ']').parent().css('display', visible ? '' : 'none');
|
||||||
this.onResize();
|
this.onResize();
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
setMoreButton: function(tab, panel) {
|
|
||||||
var me = this;
|
|
||||||
if (!btnsMore[tab]) {
|
|
||||||
var top = panel.position().top;
|
|
||||||
var box = $('<div class="more-box" style="position: absolute;right: 0; top:'+ top +'px; padding-left: 12px;padding-right: 6px;display: none;">' +
|
|
||||||
'<div class="separator long" style="position: relative;display: table-cell;"></div>' +
|
|
||||||
'<div class="group" style=""><span class="btn-slot text x-huge slot-btn-more"></span></div>' +
|
|
||||||
'</div>');
|
|
||||||
panel.append(box);
|
|
||||||
btnsMore[tab] = new Common.UI.Button({
|
|
||||||
cls: 'btn-toolbar x-huge icon-top dropdown-manual',
|
|
||||||
caption: Common.Locale.get("textMoreButton",{name:"Common.Translation", default: "More"}),
|
|
||||||
iconCls: 'toolbar__icon btn-more',
|
|
||||||
enableToggle: true
|
|
||||||
});
|
|
||||||
btnsMore[tab].render(box.find('.slot-btn-more'));
|
|
||||||
btnsMore[tab].on('toggle', function(btn, state, e) {
|
|
||||||
(state) ? me.onMoreShow(btn, e) : me.onMoreHide(btn, e);
|
|
||||||
Common.NotificationCenter.trigger('more:toggle', btn, state);
|
|
||||||
});
|
|
||||||
var moreContainer = $('<div class="dropdown-menu more-container" data-tab="' + tab + '"><div style="display: inline;"></div></div>');
|
|
||||||
optsFold.$bar.append(moreContainer);
|
|
||||||
btnsMore[tab].panel = moreContainer.find('div');
|
|
||||||
}
|
|
||||||
this.$moreBar = btnsMore[tab].panel;
|
|
||||||
},
|
|
||||||
|
|
||||||
resizeToolbar: function(reset) {
|
|
||||||
var $active = this.$panels.filter('.active'),
|
|
||||||
more_section = $active.find('.more-box'),
|
|
||||||
more_section_width = parseInt(more_section.css('width')) || 0,
|
|
||||||
box_controls_width = $active.parents('.box-controls').width(),
|
|
||||||
_maxright = box_controls_width,
|
|
||||||
_rightedge = $active.get(0).getBoundingClientRect().right,
|
|
||||||
delta = (this._prevBoxWidth) ? (_maxright - this._prevBoxWidth) : -1,
|
|
||||||
hideAllMenus = false;
|
|
||||||
this._prevBoxWidth = _maxright;
|
|
||||||
more_section.is(':visible') && (_maxright -= more_section_width);
|
|
||||||
|
|
||||||
if (this.$moreBar && this.$moreBar.parent().is(':visible')) {
|
|
||||||
this.$moreBar.parent().css('max-width', Common.Utils.innerWidth());
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( (reset || delta<0) && (_rightedge > _maxright)) { // from toolbar to more section
|
|
||||||
if (!more_section.is(':visible') ) {
|
|
||||||
more_section.css('display', "");
|
|
||||||
_maxright -= parseInt(more_section.css('width'));
|
|
||||||
}
|
|
||||||
var last_separator = null,
|
|
||||||
last_group = null,
|
|
||||||
prevchild = this.$moreBar.children().filter("[data-hidden-tb-item!=true]");
|
|
||||||
if (prevchild.length>0) {
|
|
||||||
prevchild = $(prevchild[0]);
|
|
||||||
if (prevchild.hasClass('separator'))
|
|
||||||
last_separator = prevchild;
|
|
||||||
if (prevchild.hasClass('group') && prevchild.attr('group-state') == 'open')
|
|
||||||
last_group = prevchild;
|
|
||||||
}
|
|
||||||
var items = $active.find('> div:not(.more-box)');
|
|
||||||
var need_break = false;
|
|
||||||
for (var i=items.length-1; i>=0; i--) {
|
|
||||||
var item = $(items[i]);
|
|
||||||
if (!item.is(':visible') && !item.attr('hidden-on-resize')) { // move invisible items as is and set special attr
|
|
||||||
item.attr('data-hidden-tb-item', true);
|
|
||||||
this.$moreBar.prepend(item);
|
|
||||||
hideAllMenus = true;
|
|
||||||
} else if (item.hasClass('group')) {
|
|
||||||
_rightedge = $active.get(0).getBoundingClientRect().right;
|
|
||||||
if (_rightedge <= _maxright) // stop moving items
|
|
||||||
break;
|
|
||||||
|
|
||||||
var offset = item.offset(),
|
|
||||||
item_width = item.outerWidth(),
|
|
||||||
children = item.children();
|
|
||||||
if (!item.attr('inner-width') && item.attr('group-state') !== 'open') {
|
|
||||||
item.attr('inner-width', item_width);
|
|
||||||
for (var j=children.length-1; j>=0; j--) {
|
|
||||||
var child = $(children[j]);
|
|
||||||
child.attr('inner-width', child.outerWidth());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((offset.left > _maxright || children.length==1) && item.attr('group-state') != 'open') {
|
|
||||||
// move group
|
|
||||||
this.$moreBar.prepend(item);
|
|
||||||
if (last_separator) {
|
|
||||||
last_separator.css('display', '');
|
|
||||||
last_separator.removeAttr('hidden-on-resize');
|
|
||||||
}
|
|
||||||
hideAllMenus = true;
|
|
||||||
} else if ( offset.left+item_width > _maxright ) {
|
|
||||||
// move buttons from group
|
|
||||||
for (var j=children.length-1; j>=0; j--) {
|
|
||||||
var child = $(children[j]);
|
|
||||||
if (child.hasClass('elset')) {
|
|
||||||
this.$moreBar.prepend(item);
|
|
||||||
if (last_separator) {
|
|
||||||
last_separator.css('display', '');
|
|
||||||
last_separator.removeAttr('hidden-on-resize');
|
|
||||||
}
|
|
||||||
hideAllMenus = true;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
var child_offset = child.offset(),
|
|
||||||
child_width = child.outerWidth();
|
|
||||||
if (child_offset.left+child_width>_maxright) {
|
|
||||||
if (!last_group) {
|
|
||||||
last_group = $('<div></div>');
|
|
||||||
last_group.addClass(items[i].className);
|
|
||||||
var attrs = items[i].attributes;
|
|
||||||
for (var k = 0; k < attrs.length; k++) {
|
|
||||||
last_group.attr(attrs[k].name, attrs[k].value);
|
|
||||||
}
|
|
||||||
this.$moreBar.prepend(last_group);
|
|
||||||
if (last_separator) {
|
|
||||||
last_separator.css('display', '');
|
|
||||||
last_separator.removeAttr('hidden-on-resize');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
last_group.prepend(child);
|
|
||||||
hideAllMenus = true;
|
|
||||||
} else {
|
|
||||||
need_break = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.children().length<1) { // all buttons are moved
|
|
||||||
item.remove();
|
|
||||||
last_group && last_group.removeAttr('group-state').attr('inner-width', item.attr('inner-width'));
|
|
||||||
last_group = null;
|
|
||||||
} else {
|
|
||||||
last_group && last_group.attr('group-state', 'open') && item.attr('group-state', 'open');
|
|
||||||
}
|
|
||||||
if (need_break)
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
last_separator = null;
|
|
||||||
} else if (item.hasClass('separator')) {
|
|
||||||
this.$moreBar.prepend(item);
|
|
||||||
item.css('display', 'none');
|
|
||||||
item.attr('hidden-on-resize', true);
|
|
||||||
last_separator = item;
|
|
||||||
hideAllMenus = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if ((reset || delta>0) && more_section.is(':visible')) {
|
|
||||||
var last_separator = null,
|
|
||||||
last_group = null,
|
|
||||||
prevchild = $active.find('> div:not(.more-box)');
|
|
||||||
var last_width = 0;
|
|
||||||
if (prevchild.length>0) {
|
|
||||||
prevchild = $(prevchild[prevchild.length-1]);
|
|
||||||
if (prevchild.hasClass('separator')) {
|
|
||||||
last_separator = prevchild;
|
|
||||||
last_width = parseInt(last_separator.css('margin-left')) + parseInt(last_separator.css('margin-right')) + 1;
|
|
||||||
}
|
|
||||||
if (prevchild.hasClass('group') && prevchild.attr('group-state') == 'open')
|
|
||||||
last_group = prevchild;
|
|
||||||
}
|
|
||||||
|
|
||||||
var items = this.$moreBar.children();
|
|
||||||
if (items.length>0) {
|
|
||||||
// from more panel to toolbar
|
|
||||||
for (var i=0; i<items.length; i++) {
|
|
||||||
var item = $(items[i]);
|
|
||||||
_rightedge = $active.get(0).getBoundingClientRect().right;
|
|
||||||
if (!item.is(':visible') && item.attr('data-hidden-tb-item')) { // move invisible items as is
|
|
||||||
item.removeAttr('data-hidden-tb-item');
|
|
||||||
more_section.before(item);
|
|
||||||
if (this.$moreBar.children().filter('.group').length == 0) {
|
|
||||||
this.hideMoreBtns();
|
|
||||||
more_section.css('display', "none");
|
|
||||||
}
|
|
||||||
} else if (item.hasClass('group')) {
|
|
||||||
var islast = false;
|
|
||||||
if (this.$moreBar.children().filter('.group').length == 1) {
|
|
||||||
_maxright = box_controls_width; // try to move last group
|
|
||||||
islast = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var item_width = parseInt(item.attr('inner-width') || 0);
|
|
||||||
if (_rightedge + last_width + item_width < _maxright && item.attr('group-state') != 'open') {
|
|
||||||
// move group
|
|
||||||
more_section.before(item);
|
|
||||||
if (last_separator) {
|
|
||||||
last_separator.css('display', '');
|
|
||||||
last_separator.removeAttr('hidden-on-resize');
|
|
||||||
}
|
|
||||||
if (this.$moreBar.children().filter('.group').length == 0) {
|
|
||||||
this.hideMoreBtns();
|
|
||||||
more_section.css('display', "none");
|
|
||||||
}
|
|
||||||
hideAllMenus = true;
|
|
||||||
} else if ( _rightedge + last_width < _maxright) {
|
|
||||||
// move buttons from group
|
|
||||||
var children = item.children();
|
|
||||||
_maxright = box_controls_width - more_section_width;
|
|
||||||
for (var j=0; j<children.length; j++) {
|
|
||||||
if (islast && j==children.length-1)
|
|
||||||
_maxright = box_controls_width; // try to move last item from last group
|
|
||||||
_rightedge = $active.get(0).getBoundingClientRect().right;
|
|
||||||
var child = $(children[j]);
|
|
||||||
if (child.hasClass('elset')) { // don't add group - no enough space
|
|
||||||
need_break = true;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
var child_width = parseInt(child.attr('inner-width') || 0) + (!last_group ? parseInt(item.css('padding-left')) : 0); // if new group is started add left-padding
|
|
||||||
if (_rightedge+last_width+child_width < _maxright) {
|
|
||||||
if (!last_group) {
|
|
||||||
last_group = $('<div></div>');
|
|
||||||
last_group.addClass(items[i].className);
|
|
||||||
var attrs = items[i].attributes;
|
|
||||||
for (var k = 0; k < attrs.length; k++) {
|
|
||||||
last_group.attr(attrs[k].name, attrs[k].value);
|
|
||||||
}
|
|
||||||
if (last_group.hasClass('flex')) { // need to update flex groups list
|
|
||||||
$active.data().flex = null;
|
|
||||||
}
|
|
||||||
more_section.before(last_group);
|
|
||||||
if (last_separator) {
|
|
||||||
last_separator.css('display', '');
|
|
||||||
last_separator.removeAttr('hidden-on-resize');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
last_group.append(child);
|
|
||||||
hideAllMenus = true;
|
|
||||||
} else {
|
|
||||||
need_break = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.children().length<1) { // all buttons are moved
|
|
||||||
item.remove();
|
|
||||||
last_group && last_group.removeAttr('group-state').attr('inner-width', item.attr('inner-width'));
|
|
||||||
last_group = null;
|
|
||||||
if (this.$moreBar.children().filter('.group').length == 0) {
|
|
||||||
this.hideMoreBtns();
|
|
||||||
more_section.css('display', "none");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
last_group && last_group.attr('group-state', 'open') && item.attr('group-state', 'open');
|
|
||||||
}
|
|
||||||
if (need_break)
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
last_separator = null; last_width = 0;
|
|
||||||
} else if (item.hasClass('separator')) {
|
|
||||||
more_section.before(item);
|
|
||||||
item.css('display', 'none');
|
|
||||||
item.attr('hidden-on-resize', true);
|
|
||||||
last_separator = item;
|
|
||||||
last_width = parseInt(last_separator.css('margin-left')) + parseInt(last_separator.css('margin-right')) + 1;
|
|
||||||
hideAllMenus = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.hideMoreBtns();
|
|
||||||
more_section.css('display', "none");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
hideAllMenus && Common.UI.Menu.Manager.hideAll();
|
|
||||||
},
|
|
||||||
|
|
||||||
onMoreHide: function(btn, e) {
|
|
||||||
var moreContainer = btn.panel.parent();
|
|
||||||
if (btn.pressed) {
|
|
||||||
btn.toggle(false, true);
|
|
||||||
}
|
|
||||||
if (moreContainer.is(':visible')) {
|
|
||||||
moreContainer.hide();
|
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar, btn);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onMoreShow: function(btn, e) {
|
|
||||||
var moreContainer = btn.panel.parent(),
|
|
||||||
parentxy = moreContainer.parent().offset(),
|
|
||||||
target = btn.$el,
|
|
||||||
showxy = target.offset(),
|
|
||||||
right = Common.Utils.innerWidth() - (showxy.left - parentxy.left + target.width()),
|
|
||||||
top = showxy.top - parentxy.top + target.height() + 10;
|
|
||||||
|
|
||||||
moreContainer.css({right: right, left: 'auto', top : top, 'max-width': Common.Utils.innerWidth() + 'px'});
|
|
||||||
moreContainer.show();
|
|
||||||
},
|
|
||||||
|
|
||||||
hideMoreBtns: function() {
|
|
||||||
for (var btn in btnsMore) {
|
|
||||||
btnsMore[btn] && btnsMore[btn].toggle(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}()));
|
}()));
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,6 @@ define([
|
||||||
values: [0, 100],
|
values: [0, 100],
|
||||||
colorValues: ['#000000', '#ffffff'],
|
colorValues: ['#000000', '#ffffff'],
|
||||||
currentThumb: 0,
|
currentThumb: 0,
|
||||||
includeSnap: true,
|
|
||||||
intervalSnap: 5,
|
|
||||||
thumbTemplate: '<div class="thumb" style="">' +
|
thumbTemplate: '<div class="thumb" style="">' +
|
||||||
'<div class="thumb-top"><div class="thumb-top-inner"></div></div>' +
|
'<div class="thumb-top"><div class="thumb-top-inner"></div></div>' +
|
||||||
'<div class="thumb-bottom"><div class="thumb-bottom-inner"></div></div>' +
|
'<div class="thumb-bottom"><div class="thumb-bottom-inner"></div></div>' +
|
||||||
|
|
|
||||||
|
|
@ -71,21 +71,12 @@ define([
|
||||||
disabled : false,
|
disabled : false,
|
||||||
rendered : false,
|
rendered : false,
|
||||||
|
|
||||||
template : _.template('<div class="radiobox" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">' +
|
template : _.template('<label class="radiobox"><input type="radio" name="<%= name %>" id="<%= id %>" class="button__radiobox">' +
|
||||||
'<input type="radio" name="<%= name %>" id="<%= id %>" class="button__radiobox">' +
|
'<label for="<%= id %>" class="radiobox__shape"></label><span></span></label>'),
|
||||||
'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">' +
|
|
||||||
'<circle class="rb-circle" cx="8" cy="8" r="6.5" />' +
|
|
||||||
'<circle class="rb-check-mark" cx="8" cy="8" r="4" />' +
|
|
||||||
'</svg>' +
|
|
||||||
'<span></span></div>'),
|
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize : function(options) {
|
||||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||||
|
|
||||||
this.dataHint = options.dataHint;
|
|
||||||
this.dataHintDirection = options.dataHintDirection;
|
|
||||||
this.dataHintOffset = options.dataHintOffset;
|
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
this.name = this.options.name || Common.UI.getId();
|
this.name = this.options.name || Common.UI.getId();
|
||||||
|
|
@ -101,6 +92,7 @@ define([
|
||||||
this.setCaption(this.options.labelText);
|
this.setCaption(this.options.labelText);
|
||||||
|
|
||||||
// handle events
|
// handle events
|
||||||
|
this.$radio.on('click', _.bind(this.onItemCheck, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
|
|
@ -108,22 +100,13 @@ define([
|
||||||
el.html(this.template({
|
el.html(this.template({
|
||||||
labelText: this.options.labelText,
|
labelText: this.options.labelText,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
id: Common.UI.getId('rdb-'),
|
id: Common.UI.getId('rdb-')
|
||||||
dataHint: this.dataHint,
|
|
||||||
dataHintDirection: this.dataHintDirection,
|
|
||||||
dataHintOffset: this.dataHintOffset
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.$radio = el.find('input[type=radio]');
|
this.$radio = el.find('input[type=radio]');
|
||||||
this.$label = el.find('div.radiobox');
|
this.$label = el.find('label.radiobox');
|
||||||
this.$span = this.$label.find('span');
|
this.$span = this.$label.find('span');
|
||||||
this.$label.on({
|
this.$label.on('keydown', this.onKeyDown.bind(this));
|
||||||
'keydown': this.onKeyDown.bind(this),
|
|
||||||
'click': function(e){
|
|
||||||
if ( !this.disabled )
|
|
||||||
this.setValue(true);
|
|
||||||
}.bind(this),});
|
|
||||||
|
|
||||||
this.rendered = true;
|
this.rendered = true;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
@ -133,7 +116,6 @@ define([
|
||||||
if (!this.rendered)
|
if (!this.rendered)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
disabled = !!disabled;
|
|
||||||
if (disabled !== this.disabled) {
|
if (disabled !== this.disabled) {
|
||||||
this.$label.toggleClass('disabled', disabled);
|
this.$label.toggleClass('disabled', disabled);
|
||||||
this.$radio.toggleClass('disabled', disabled);
|
this.$radio.toggleClass('disabled', disabled);
|
||||||
|
|
@ -157,7 +139,7 @@ define([
|
||||||
|
|
||||||
setRawValue: function(value) {
|
setRawValue: function(value) {
|
||||||
var value = (value === true || value === 'true' || value === '1' || value === 1 );
|
var value = (value === true || value === 'true' || value === '1' || value === 1 );
|
||||||
value && $('input[type=radio][name=' + this.name + ']').removeClass('checked');
|
$('input[type=radio][name=' + this.name + ']').removeClass('checked');
|
||||||
this.$radio.toggleClass('checked', value);
|
this.$radio.toggleClass('checked', value);
|
||||||
this.$radio.prop('checked', value);
|
this.$radio.prop('checked', value);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -82,14 +82,13 @@ define([
|
||||||
maxValue: 100,
|
maxValue: 100,
|
||||||
step: 1,
|
step: 1,
|
||||||
value: 100,
|
value: 100,
|
||||||
enableKeyEvents: false,
|
enableKeyEvents: false
|
||||||
direction: 'horizontal' // 'vertical'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
|
||||||
template : _.template([
|
template : _.template([
|
||||||
'<div class="slider single-slider <% if (this.options.direction === \'vertical\') { %>vertical<% } %>" style="">',
|
'<div class="slider single-slider" style="">',
|
||||||
'<div class="track"></div>',
|
'<div class="track"></div>',
|
||||||
'<div class="thumb" style=""></div>',
|
'<div class="thumb" style=""></div>',
|
||||||
'<% if (this.options.enableKeyEvents) { %>',
|
'<% if (this.options.enableKeyEvents) { %>',
|
||||||
|
|
@ -108,7 +107,6 @@ define([
|
||||||
me.maxValue = me.options.maxValue;
|
me.maxValue = me.options.maxValue;
|
||||||
me.delta = 100/(me.maxValue - me.minValue);
|
me.delta = 100/(me.maxValue - me.minValue);
|
||||||
me.step = me.options.step;
|
me.step = me.options.step;
|
||||||
me.direction = me.options.direction;
|
|
||||||
|
|
||||||
if (me.options.el) {
|
if (me.options.el) {
|
||||||
me.render();
|
me.render();
|
||||||
|
|
@ -135,7 +133,7 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cmpEl.find('.track-center').width(me.options.width - 14);
|
this.cmpEl.find('.track-center').width(me.options.width - 14);
|
||||||
this.cmpEl[me.direction === 'vertical' ? 'height' : 'width'](me.options.width);
|
this.cmpEl.width(me.options.width);
|
||||||
|
|
||||||
this.thumb = this.cmpEl.find('.thumb');
|
this.thumb = this.cmpEl.find('.thumb');
|
||||||
|
|
||||||
|
|
@ -143,9 +141,7 @@ define([
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
var pos = Math.max(0, Math.min(100, (Math.round((
|
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left - me._dragstart) / me.width * 100))));
|
||||||
me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top) : (e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) - me._dragstart
|
|
||||||
) / me.width * 100))));
|
|
||||||
me.setThumbPosition(pos);
|
me.setThumbPosition(pos);
|
||||||
|
|
||||||
me.lastValue = me.value;
|
me.lastValue = me.value;
|
||||||
|
|
@ -166,9 +162,7 @@ define([
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
var pos = Math.max(0, Math.min(100, (Math.round((
|
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left - me._dragstart) / me.width * 100))));
|
||||||
me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top) : (e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) - me._dragstart
|
|
||||||
) / me.width * 100))));
|
|
||||||
me.setThumbPosition(pos);
|
me.setThumbPosition(pos);
|
||||||
|
|
||||||
me.lastValue = me.value;
|
me.lastValue = me.value;
|
||||||
|
|
@ -180,7 +174,7 @@ define([
|
||||||
|
|
||||||
var onMouseDown = function (e) {
|
var onMouseDown = function (e) {
|
||||||
if ( me.disabled ) return;
|
if ( me.disabled ) return;
|
||||||
me._dragstart = me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.thumb.offset().top) : (e.pageX*Common.Utils.zoom() - me.thumb.offset().left) - 7;
|
me._dragstart = e.pageX*Common.Utils.zoom() - me.thumb.offset().left - 7;
|
||||||
|
|
||||||
me.thumb.addClass('active');
|
me.thumb.addClass('active');
|
||||||
$(document).on('mouseup', onMouseUp);
|
$(document).on('mouseup', onMouseUp);
|
||||||
|
|
@ -193,9 +187,7 @@ define([
|
||||||
var onTrackMouseDown = function (e) {
|
var onTrackMouseDown = function (e) {
|
||||||
if ( me.disabled ) return;
|
if ( me.disabled ) return;
|
||||||
|
|
||||||
var pos = Math.max(0, Math.min(100, (Math.round((
|
var pos = Math.max(0, Math.min(100, (Math.round((e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left) / me.width * 100))));
|
||||||
me.direction === 'vertical' ? (e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top) : (e.pageX*Common.Utils.zoom() - me.cmpEl.offset().left)
|
|
||||||
) / me.width * 100))));
|
|
||||||
me.setThumbPosition(pos);
|
me.setThumbPosition(pos);
|
||||||
|
|
||||||
me.lastValue = me.value;
|
me.lastValue = me.value;
|
||||||
|
|
@ -253,12 +245,8 @@ define([
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
setThumbPosition: function(pos) {
|
setThumbPosition: function(x) {
|
||||||
if (this.direction === 'vertical') {
|
this.thumb.css({left: x + '%'});
|
||||||
this.thumb.css({top: pos + '%'});
|
|
||||||
} else {
|
|
||||||
this.thumb.css({left: pos + '%'});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setValue: function(value) {
|
setValue: function(value) {
|
||||||
|
|
@ -272,7 +260,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
setDisabled: function(disabled) {
|
||||||
disabled = !!disabled;
|
|
||||||
if (disabled !== this.disabled)
|
if (disabled !== this.disabled)
|
||||||
this.cmpEl.toggleClass('disabled', disabled);
|
this.cmpEl.toggleClass('disabled', disabled);
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
|
|
@ -286,8 +273,6 @@ define([
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
maxValue: 100,
|
maxValue: 100,
|
||||||
values: [0, 100],
|
values: [0, 100],
|
||||||
includeSnap: false,
|
|
||||||
intervalSnap: undefined,
|
|
||||||
thumbTemplate: '<div class="thumb" style=""></div>'
|
thumbTemplate: '<div class="thumb" style=""></div>'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -315,9 +300,8 @@ define([
|
||||||
me.minValue = me.options.minValue;
|
me.minValue = me.options.minValue;
|
||||||
me.maxValue = me.options.maxValue;
|
me.maxValue = me.options.maxValue;
|
||||||
me.delta = 100/(me.maxValue - me.minValue);
|
me.delta = 100/(me.maxValue - me.minValue);
|
||||||
me.includeSnap = me.options.includeSnap;
|
|
||||||
me.intervalSnap = me.options.intervalSnap;
|
|
||||||
me.thumbs = [];
|
me.thumbs = [];
|
||||||
|
|
||||||
if (me.options.el) {
|
if (me.options.el) {
|
||||||
me.render();
|
me.render();
|
||||||
}
|
}
|
||||||
|
|
@ -346,38 +330,9 @@ define([
|
||||||
el.find('.track-center').width(me.options.width - 14);
|
el.find('.track-center').width(me.options.width - 14);
|
||||||
el.width(me.options.width);
|
el.width(me.options.width);
|
||||||
|
|
||||||
var setCenters = function (index) {
|
|
||||||
if(!me.includeSnap) return;
|
|
||||||
var n = me.minValue;
|
|
||||||
|
|
||||||
var getX = function (position) {
|
|
||||||
return (0.01 * me.width * position + me.cmpEl.offset().left + me._dragstart)/Common.Utils.zoom();
|
|
||||||
};
|
|
||||||
|
|
||||||
me.centers = [];
|
|
||||||
_.each(me.thumbs, function (thumb, indexT) {
|
|
||||||
if ((indexT != index) && (n != thumb.position)) {
|
|
||||||
me.centers.push(getX((thumb.position - n) / 2 + n));
|
|
||||||
n = thumb.position;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(n != me.maxValue) me.centers.push(getX((me.maxValue - n) / 2 + n));
|
|
||||||
};
|
|
||||||
|
|
||||||
var resetPageX = function (e) {
|
|
||||||
if(!me.includeSnap) return;
|
|
||||||
_.each(me.centers, function (x) {
|
|
||||||
if((e.pageX <= x + me.intervalSnap) && (e.pageX >= x - me.intervalSnap)) {
|
|
||||||
e.pageX = x;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var onMouseUp = function (e) {
|
var onMouseUp = function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
resetPageX(e);
|
|
||||||
|
|
||||||
var index = e.data.index,
|
var index = e.data.index,
|
||||||
lastValue = me.thumbs[index].value,
|
lastValue = me.thumbs[index].value,
|
||||||
|
|
@ -388,10 +343,13 @@ define([
|
||||||
pos = Math.max(0, Math.min(100, position)),
|
pos = Math.max(0, Math.min(100, position)),
|
||||||
value = pos/me.delta + me.minValue;
|
value = pos/me.delta + me.minValue;
|
||||||
|
|
||||||
if (me.thumbs.length < 3)
|
|
||||||
me.isRemoveThumb = false;
|
|
||||||
|
|
||||||
if (me.isRemoveThumb) {
|
if (me.isRemoveThumb) {
|
||||||
|
if (me.thumbs.length < 3) {
|
||||||
|
$(document).off('mouseup', me.binding.onMouseUp);
|
||||||
|
$(document).off('mousemove', me.binding.onMouseMove);
|
||||||
|
me._dragstart = undefined;
|
||||||
|
return;
|
||||||
|
}
|
||||||
me.trigger('removethumb', me, _.findIndex(me.thumbs, {index: index}));
|
me.trigger('removethumb', me, _.findIndex(me.thumbs, {index: index}));
|
||||||
me.trigger('change', me, value, lastValue);
|
me.trigger('change', me, value, lastValue);
|
||||||
me.trigger('changecomplete', me, value, lastValue);
|
me.trigger('changecomplete', me, value, lastValue);
|
||||||
|
|
@ -405,6 +363,7 @@ define([
|
||||||
|
|
||||||
$(document).off('mouseup', me.binding.onMouseUp);
|
$(document).off('mouseup', me.binding.onMouseUp);
|
||||||
$(document).off('mousemove', me.binding.onMouseMove);
|
$(document).off('mousemove', me.binding.onMouseMove);
|
||||||
|
|
||||||
me._dragstart = undefined;
|
me._dragstart = undefined;
|
||||||
!me.isRemoveThumb && me.trigger('changecomplete', me, value, lastValue);
|
!me.isRemoveThumb && me.trigger('changecomplete', me, value, lastValue);
|
||||||
me.isRemoveThumb = undefined;
|
me.isRemoveThumb = undefined;
|
||||||
|
|
@ -416,7 +375,6 @@ define([
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
resetPageX(e);
|
|
||||||
|
|
||||||
var index = e.data.index,
|
var index = e.data.index,
|
||||||
lastValue = me.thumbs[index].value,
|
lastValue = me.thumbs[index].value,
|
||||||
|
|
@ -448,7 +406,6 @@ define([
|
||||||
thumb = me.thumbs[index].thumb;
|
thumb = me.thumbs[index].thumb;
|
||||||
|
|
||||||
me._dragstart = e.pageX*Common.Utils.zoom() - thumb.offset().left - thumb.width()/2;
|
me._dragstart = e.pageX*Common.Utils.zoom() - thumb.offset().left - thumb.width()/2;
|
||||||
setCenters(index);
|
|
||||||
me.setActiveThumb(index);
|
me.setActiveThumb(index);
|
||||||
|
|
||||||
_.each(me.thumbs, function (item, idx) {
|
_.each(me.thumbs, function (item, idx) {
|
||||||
|
|
@ -459,7 +416,6 @@ define([
|
||||||
$(document).on('mousemove', null, e.data, me.binding.onMouseMove);
|
$(document).on('mousemove', null, e.data, me.binding.onMouseMove);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var onTrackMouseUp = function (e) {
|
var onTrackMouseUp = function (e) {
|
||||||
if ( me.disabled || !_.isUndefined(me._dragstart) || me.thumbs.length > 9) return;
|
if ( me.disabled || !_.isUndefined(me._dragstart) || me.thumbs.length > 9) return;
|
||||||
|
|
||||||
|
|
@ -589,7 +545,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
setDisabled: function(disabled) {
|
||||||
disabled = !!disabled;
|
|
||||||
if (disabled !== this.disabled)
|
if (disabled !== this.disabled)
|
||||||
this.cmpEl.toggleClass('disabled', disabled);
|
this.cmpEl.toggleClass('disabled', disabled);
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
|
|
|
||||||
|
|
@ -44,27 +44,20 @@ define([
|
||||||
target : $(document.body),
|
target : $(document.body),
|
||||||
text : '',
|
text : '',
|
||||||
placement: 'right-bottom',
|
placement: 'right-bottom',
|
||||||
showLink: true,
|
showLink: true
|
||||||
showButton: false,
|
|
||||||
closable: true
|
|
||||||
},
|
},
|
||||||
|
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<div class="synch-tip-root <% if (!!scope.options.extCls) {print(scope.options.extCls + \" \");} %><%= scope.placement %>" style="<%= scope.style %>">',
|
'<div class="synch-tip-root <% if (!!scope.options.extCls) {print(scope.options.extCls + \" \");} %><%= scope.placement %>">',
|
||||||
'<div class="asc-synchronizetip">',
|
'<div class="asc-synchronizetip">',
|
||||||
'<div class="tip-arrow <%= scope.placement %>"></div>',
|
'<div class="tip-arrow <%= scope.placement %>"></div>',
|
||||||
'<div>',
|
'<div>',
|
||||||
'<div class="tip-text"><%= scope.text %></div>',
|
'<div class="tip-text"><%= scope.text %></div>',
|
||||||
'<% if ( scope.closable ) { %>',
|
|
||||||
'<div class="close"></div>',
|
'<div class="close"></div>',
|
||||||
'<% } %>',
|
|
||||||
'</div>',
|
'</div>',
|
||||||
'<% if ( scope.showLink ) { %>',
|
'<% if ( scope.showLink ) { %>',
|
||||||
'<div class="show-link"><label><%= scope.textLink %></label></div>',
|
'<div class="show-link"><label><%= scope.textLink %></label></div>',
|
||||||
'<% } %>',
|
'<% } %>',
|
||||||
'<% if ( scope.showButton ) { %>',
|
|
||||||
'<div class="btn-div"><%= scope.textButton %></div>',
|
|
||||||
'<% } %>',
|
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')),
|
].join('')),
|
||||||
|
|
@ -76,13 +69,8 @@ define([
|
||||||
this.target = this.options.target;
|
this.target = this.options.target;
|
||||||
this.text = !_.isEmpty(this.options.text) ? this.options.text : this.textSynchronize;
|
this.text = !_.isEmpty(this.options.text) ? this.options.text : this.textSynchronize;
|
||||||
this.textLink = !_.isEmpty(this.options.textLink) ? this.options.textLink : this.textDontShow;
|
this.textLink = !_.isEmpty(this.options.textLink) ? this.options.textLink : this.textDontShow;
|
||||||
this.placement = this.options.placement; // if placement='target' and position is undefined show in top,left position of target, also use for arrow position
|
this.placement = this.options.placement;
|
||||||
this.showLink = this.options.showLink;
|
this.showLink = this.options.showLink;
|
||||||
this.showButton = this.options.showButton;
|
|
||||||
this.closable = this.options.closable;
|
|
||||||
this.textButton = this.options.textButton || '';
|
|
||||||
this.position = this.options.position; // show in the position relative to target
|
|
||||||
this.style = this.options.style || '';
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|
@ -91,9 +79,6 @@ define([
|
||||||
$(document.body).append(this.cmpEl);
|
$(document.body).append(this.cmpEl);
|
||||||
this.cmpEl.find('.close').on('click', _.bind(function() { this.trigger('closeclick');}, this));
|
this.cmpEl.find('.close').on('click', _.bind(function() { this.trigger('closeclick');}, this));
|
||||||
this.cmpEl.find('.show-link label').on('click', _.bind(function() { this.trigger('dontshowclick');}, this));
|
this.cmpEl.find('.show-link label').on('click', _.bind(function() { this.trigger('dontshowclick');}, this));
|
||||||
this.cmpEl.find('.btn-div').on('click', _.bind(function() { this.trigger('buttonclick');}, this));
|
|
||||||
|
|
||||||
this.closable && this.cmpEl.addClass('closable');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.applyPlacement();
|
this.applyPlacement();
|
||||||
|
|
@ -119,28 +104,12 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
applyPlacement: function () {
|
applyPlacement: function () {
|
||||||
var target = this.target && this.target.length>0 ? this.target : $(document.body);
|
var showxy = this.target.offset();
|
||||||
var showxy = target.offset();
|
if (this.placement=='target') {
|
||||||
if (this.placement=='target' && !this.position) {
|
|
||||||
this.cmpEl.css({top : showxy.top + 5 + 'px', left: showxy.left + 5 + 'px'});
|
this.cmpEl.css({top : showxy.top + 5 + 'px', left: showxy.left + 5 + 'px'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.position && typeof this.position == 'object') {
|
|
||||||
var top = this.position.top, left = this.position.left, bottom = this.position.bottom, right = this.position.right;
|
|
||||||
if (bottom!==undefined || top!==undefined)
|
|
||||||
left = showxy.left + (target.width() - this.cmpEl.width())/2;
|
|
||||||
else
|
|
||||||
top = showxy.top + (target.height() - this.cmpEl.height())/2;
|
|
||||||
top = (top!==undefined) ? (top + 'px') : 'auto';
|
|
||||||
bottom = (bottom!==undefined) ? (bottom + 'px') : 'auto';
|
|
||||||
right = (right!==undefined) ? (right + 'px') : 'auto';
|
|
||||||
left = (left!==undefined) ? (left + 'px') : 'auto';
|
|
||||||
|
|
||||||
this.cmpEl.css({top : top, left: left, right: right, bottom: bottom});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var placement = this.placement.split('-');
|
var placement = this.placement.split('-');
|
||||||
if (placement.length>0) {
|
if (placement.length>0) {
|
||||||
var top, left, bottom, right;
|
var top, left, bottom, right;
|
||||||
|
|
@ -148,40 +117,34 @@ define([
|
||||||
if (pos=='top') {
|
if (pos=='top') {
|
||||||
bottom = Common.Utils.innerHeight() - showxy.top;
|
bottom = Common.Utils.innerHeight() - showxy.top;
|
||||||
} else if (pos == 'bottom') {
|
} else if (pos == 'bottom') {
|
||||||
top = showxy.top + target.height();
|
top = showxy.top + this.target.height();
|
||||||
} else if (pos == 'left') {
|
} else if (pos == 'left') {
|
||||||
right = Common.Utils.innerWidth() - showxy.left;
|
right = Common.Utils.innerWidth() - showxy.left;
|
||||||
} else if (pos == 'right') {
|
} else if (pos == 'right') {
|
||||||
left = showxy.left + target.width();
|
left = showxy.left + this.target.width();
|
||||||
}
|
}
|
||||||
pos = placement[1];
|
pos = placement[1];
|
||||||
if (pos=='top') {
|
if (pos=='top') {
|
||||||
bottom = Common.Utils.innerHeight() - showxy.top - target.height()/2;
|
bottom = Common.Utils.innerHeight() - showxy.top - this.target.height()/2;
|
||||||
} else if (pos == 'bottom') {
|
} else if (pos == 'bottom') {
|
||||||
top = showxy.top + target.height()/2;
|
top = showxy.top + this.target.height()/2;
|
||||||
var height = this.cmpEl.height();
|
var height = this.cmpEl.height();
|
||||||
if (top+height>Common.Utils.innerHeight())
|
if (top+height>Common.Utils.innerHeight())
|
||||||
top = Common.Utils.innerHeight() - height - 10;
|
top = Common.Utils.innerHeight() - height - 10;
|
||||||
} else if (pos == 'left') {
|
} else if (pos == 'left') {
|
||||||
right = Common.Utils.innerWidth() - showxy.left - target.width()/2;
|
right = Common.Utils.innerWidth() - showxy.left - this.target.width()/2;
|
||||||
} else if (pos == 'right') {
|
} else if (pos == 'right') {
|
||||||
left = showxy.left + target.width()/2;
|
left = showxy.left + this.target.width()/2;
|
||||||
} else {
|
} else {
|
||||||
if (bottom!==undefined || top!==undefined)
|
if (bottom!==undefined || top!==undefined)
|
||||||
left = showxy.left + (target.width() - this.cmpEl.width())/2;
|
left = showxy.left + (this.target.width() - this.cmpEl.width())/2;
|
||||||
else
|
else
|
||||||
top = showxy.top + (target.height() - this.cmpEl.height())/2;
|
top = showxy.top + (this.target.height() - this.cmpEl.height())/2;
|
||||||
}
|
}
|
||||||
top = (top!==undefined) ? (top + 'px') : 'auto';
|
top = (top!==undefined) ? (top + 'px') : 'auto';
|
||||||
bottom = (bottom!==undefined) ? (bottom + 'px') : 'auto';
|
bottom = (bottom!==undefined) ? (bottom + 'px') : 'auto';
|
||||||
|
left = (left!==undefined) ? (left + 'px') : 'auto';
|
||||||
right = (right!==undefined) ? (right + 'px') : 'auto';
|
right = (right!==undefined) ? (right + 'px') : 'auto';
|
||||||
if (left!==undefined) {
|
|
||||||
var width = this.cmpEl.width();
|
|
||||||
if (left+width>Common.Utils.innerWidth())
|
|
||||||
left = Common.Utils.innerWidth() - width - 10;
|
|
||||||
left = (left + 'px');
|
|
||||||
} else
|
|
||||||
left = 'auto';
|
|
||||||
this.cmpEl.css({top : top, left: left, right: right, bottom: bottom});
|
this.cmpEl.css({top : top, left: left, right: right, bottom: bottom});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,76 @@ define([
|
||||||
me.tabBarRight = me.bounds[length - 1].right;
|
me.tabBarRight = me.bounds[length - 1].right;
|
||||||
me.tabBarRight = Math.min(me.tabBarRight, barBounds.right - 1);
|
me.tabBarRight = Math.min(me.tabBarRight, barBounds.right - 1);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
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.bar.checkInvisible();
|
||||||
|
|
||||||
|
me.drag = undefined;
|
||||||
|
me.bar.trigger('tab:drop', this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
this.bar.trigger('tab:drag', this.bar.selectTabs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -170,25 +240,19 @@ define([
|
||||||
this.trigger('tab:contextmenu', this, this.tabs.indexOf(tab), tab, this.selectTabs);
|
this.trigger('tab:contextmenu', this, this.tabs.indexOf(tab), tab, this.selectTabs);
|
||||||
}, this.bar),
|
}, this.bar),
|
||||||
mousedown: $.proxy(function (e) {
|
mousedown: $.proxy(function (e) {
|
||||||
if ((3 !== e.which) && !e.shiftKey) {
|
if ((3 !== e.which) && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
|
||||||
var lockDrag = tab.isLockTheDrag;
|
var lockDrag = tab.isLockTheDrag;
|
||||||
this.bar.selectTabs.forEach(function (item) {
|
this.bar.selectTabs.forEach(function (item) {
|
||||||
if (item.isLockTheDrag) {
|
if (item.isLockTheDrag) {
|
||||||
lockDrag = true;
|
lockDrag = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (((this.bar.selectTabs.length === this.bar.tabs.length || this.bar.tabs.length === 1) && !(e.ctrlKey || (Common.Utils.isMac && e.altKey))) || this.bar.isEditFormula) {
|
if (this.bar.selectTabs.length === this.bar.tabs.length || this.bar.tabs.length === 1 || this.bar.isEditFormula) {
|
||||||
lockDrag = true;
|
lockDrag = true;
|
||||||
}
|
}
|
||||||
// move last selected sheet if all sheets are selected
|
|
||||||
if (this.bar.selectTabs.length === this.bar.tabs.length && this.bar.tabs.length > 1 && !e.ctrlKey && !(Common.Utils.isMac && e.altKey)) {
|
|
||||||
lockDrag = false;
|
|
||||||
this.bar.$el.find('ul > li.selected').removeClass('selected');
|
|
||||||
}
|
|
||||||
this.bar.$el.find('ul > li > span').attr('draggable', !lockDrag);
|
this.bar.$el.find('ul > li > span').attr('draggable', !lockDrag);
|
||||||
if (!lockDrag && !e.ctrlKey && !e.metaKey) {
|
if (!lockDrag)
|
||||||
tab.changeState();
|
tab.changeState();
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.bar.$el.find('ul > li > span').attr('draggable', 'false');
|
this.bar.$el.find('ul > li > span').attr('draggable', 'false');
|
||||||
}
|
}
|
||||||
|
|
@ -205,15 +269,15 @@ define([
|
||||||
tab.$el.children().on(
|
tab.$el.children().on(
|
||||||
{dragstart: $.proxy(function (e) {
|
{dragstart: $.proxy(function (e) {
|
||||||
var event = e.originalEvent;
|
var event = e.originalEvent;
|
||||||
if (!Common.Utils.isIE && !Common.Utils.isSafari) {
|
if (!Common.Utils.isIE) {
|
||||||
var img = document.createElement('div');
|
var img = document.createElement('div');
|
||||||
event.dataTransfer.setDragImage(img, 0, 0);
|
event.dataTransfer.setDragImage(img, 0, 0);
|
||||||
} else if (Common.Utils.isIE) {
|
} else {
|
||||||
this.bar.selectTabs.forEach(function (tab) {
|
this.bar.selectTabs.forEach(function (tab) {
|
||||||
tab.$el.find('span').prop('title', '');
|
tab.$el.find('span').prop('title', '');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
event.dataTransfer.effectAllowed = 'copyMove';
|
event.dataTransfer.effectAllowed = 'move';
|
||||||
this.bar.trigger('tab:dragstart', event.dataTransfer, this.bar.selectTabs);
|
this.bar.trigger('tab:dragstart', event.dataTransfer, this.bar.selectTabs);
|
||||||
}, this),
|
}, this),
|
||||||
dragenter: $.proxy(function (e) {
|
dragenter: $.proxy(function (e) {
|
||||||
|
|
@ -221,7 +285,14 @@ define([
|
||||||
if (!this.bar.isEditFormula) {
|
if (!this.bar.isEditFormula) {
|
||||||
this.bar.$el.find('.mousemove').removeClass('mousemove right');
|
this.bar.$el.find('.mousemove').removeClass('mousemove right');
|
||||||
$(e.currentTarget).parent().addClass('mousemove');
|
$(e.currentTarget).parent().addClass('mousemove');
|
||||||
event.dataTransfer.dropEffect = (event.ctrlKey || Common.Utils.isMac && event.altKey) ? 'copy' : 'move';
|
var data;
|
||||||
|
if (!Common.Utils.isIE) {
|
||||||
|
data = event.dataTransfer.getData('onlyoffice');
|
||||||
|
event.dataTransfer.dropEffect = data ? 'move' : 'none';
|
||||||
|
} else {
|
||||||
|
data = event.dataTransfer.getData('text');
|
||||||
|
event.dataTransfer.dropEffect = data === 'sheet' ? 'move' : 'none';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
event.dataTransfer.dropEffect = 'none';
|
event.dataTransfer.dropEffect = 'none';
|
||||||
}
|
}
|
||||||
|
|
@ -234,7 +305,6 @@ define([
|
||||||
if (!this.bar.isEditFormula) {
|
if (!this.bar.isEditFormula) {
|
||||||
this.bar.$el.find('.mousemove').removeClass('mousemove right');
|
this.bar.$el.find('.mousemove').removeClass('mousemove right');
|
||||||
$(e.currentTarget).parent().addClass('mousemove');
|
$(e.currentTarget).parent().addClass('mousemove');
|
||||||
event.dataTransfer.dropEffect = (event.ctrlKey || Common.Utils.isMac && event.altKey) ? 'copy' : 'move';
|
|
||||||
} else {
|
} else {
|
||||||
event.dataTransfer.dropEffect = 'none';
|
event.dataTransfer.dropEffect = 'none';
|
||||||
}
|
}
|
||||||
|
|
@ -244,11 +314,8 @@ define([
|
||||||
$(e.currentTarget).parent().removeClass('mousemove right');
|
$(e.currentTarget).parent().removeClass('mousemove right');
|
||||||
}, this),
|
}, this),
|
||||||
dragend: $.proxy(function (e) {
|
dragend: $.proxy(function (e) {
|
||||||
if (Common.Utils.isMac && e.altKey) { // don't show alt hints after copy by drag and drop
|
|
||||||
this.bar.isDragDrop = true;
|
|
||||||
}
|
|
||||||
var event = e.originalEvent;
|
var event = e.originalEvent;
|
||||||
if (event.dataTransfer.dropEffect === 'move' && !event.dataTransfer.mozUserCancelled) {
|
if (event.dataTransfer.dropEffect === 'move') {
|
||||||
this.bar.trigger('tab:dragend', true);
|
this.bar.trigger('tab:dragend', true);
|
||||||
} else {
|
} else {
|
||||||
this.bar.trigger('tab:dragend', false);
|
this.bar.trigger('tab:dragend', false);
|
||||||
|
|
@ -256,13 +323,10 @@ define([
|
||||||
this.bar.$el.find('.mousemove').removeClass('mousemove right');
|
this.bar.$el.find('.mousemove').removeClass('mousemove right');
|
||||||
}, this),
|
}, this),
|
||||||
drop: $.proxy(function (e) {
|
drop: $.proxy(function (e) {
|
||||||
if (Common.Utils.isMac && e.altKey) { // don't show alt hints after copy by drag and drop
|
|
||||||
this.bar.isDragDrop = true;
|
|
||||||
}
|
|
||||||
var event = e.originalEvent,
|
var event = e.originalEvent,
|
||||||
index = $(event.currentTarget).data('index');
|
index = $(event.currentTarget).data('index');
|
||||||
this.bar.$el.find('.mousemove').removeClass('mousemove right');
|
this.bar.$el.find('.mousemove').removeClass('mousemove right');
|
||||||
this.bar.trigger('tab:drop', event.dataTransfer, index, (event.ctrlKey || Common.Utils.isMac && event.altKey));
|
this.bar.trigger('tab:drop', event.dataTransfer, index);
|
||||||
this.bar.isDrop = true;
|
this.bar.isDrop = true;
|
||||||
}, this)
|
}, this)
|
||||||
});
|
});
|
||||||
|
|
@ -301,20 +365,23 @@ define([
|
||||||
var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel';
|
var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel';
|
||||||
addEvent(this.$bar[0], eventname, _.bind(this._onMouseWheel,this));
|
addEvent(this.$bar[0], eventname, _.bind(this._onMouseWheel,this));
|
||||||
addEvent(this.$bar[0], 'dragstart', _.bind(function (event) {
|
addEvent(this.$bar[0], 'dragstart', _.bind(function (event) {
|
||||||
event.dataTransfer.effectAllowed = 'copyMove';
|
event.dataTransfer.effectAllowed = 'move';
|
||||||
}, this));
|
}, this));
|
||||||
addEvent(this.$bar[0], 'dragenter', _.bind(function (event) {
|
addEvent(this.$bar[0], 'dragenter', _.bind(function (event) {
|
||||||
if (!this.isEditFormula) {
|
var data;
|
||||||
event.dataTransfer.dropEffect = (event.ctrlKey || Common.Utils.isMac && event.altKey) ? 'copy' : 'move';
|
if (!Common.Utils.isIE) {
|
||||||
|
data = event.dataTransfer.getData('onlyoffice');
|
||||||
|
event.dataTransfer.dropEffect = (!this.isEditFormula && data) ? 'move' : 'none';
|
||||||
} else {
|
} else {
|
||||||
event.dataTransfer.dropEffect = 'none';
|
data = event.dataTransfer.getData('text');
|
||||||
|
event.dataTransfer.dropEffect = (data === 'sheet' && !this.isEditFormula) ? 'move' : 'none';
|
||||||
}
|
}
|
||||||
}, this));
|
}, this));
|
||||||
addEvent(this.$bar[0], 'dragover', _.bind(function (event) {
|
addEvent(this.$bar[0], 'dragover', _.bind(function (event) {
|
||||||
if (event.preventDefault) {
|
if (event.preventDefault) {
|
||||||
event.preventDefault(); // Necessary. Allows us to drop.
|
event.preventDefault(); // Necessary. Allows us to drop.
|
||||||
}
|
}
|
||||||
event.dataTransfer.dropEffect = !this.isEditFormula ? ((event.ctrlKey || Common.Utils.isMac && event.altKey) ? 'copy' : 'move') : 'none';
|
event.dataTransfer.dropEffect = !this.isEditFormula ? 'move' : 'none';
|
||||||
!this.isEditFormula && this.tabs[this.tabs.length - 1].$el.addClass('mousemove right');
|
!this.isEditFormula && this.tabs[this.tabs.length - 1].$el.addClass('mousemove right');
|
||||||
return false;
|
return false;
|
||||||
}, this));
|
}, this));
|
||||||
|
|
@ -325,10 +392,7 @@ define([
|
||||||
addEvent(this.$bar[0], 'drop', _.bind(function (event) {
|
addEvent(this.$bar[0], 'drop', _.bind(function (event) {
|
||||||
this.$el.find('.mousemove').removeClass('mousemove right');
|
this.$el.find('.mousemove').removeClass('mousemove right');
|
||||||
if (this.isDrop === undefined) {
|
if (this.isDrop === undefined) {
|
||||||
if (Common.Utils.isMac && event.altKey) { // don't show alt hints after copy by drag and drop
|
this.trigger('tab:drop', event.dataTransfer, 'last');
|
||||||
this.isDragDrop = true;
|
|
||||||
}
|
|
||||||
this.trigger('tab:drop', event.dataTransfer, 'last', (event.ctrlKey || Common.Utils.isMac && event.altKey));
|
|
||||||
} else {
|
} else {
|
||||||
this.isDrop = undefined;
|
this.isDrop = undefined;
|
||||||
}
|
}
|
||||||
|
|
@ -359,7 +423,6 @@ define([
|
||||||
this.setTabVisible('backward');
|
this.setTabVisible('backward');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('hints:clear');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onProcessMouse: function(data) {
|
onProcessMouse: function(data) {
|
||||||
|
|
@ -513,10 +576,10 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setTabVisible: function(index, suppress) {
|
setTabVisible: function(index, suppress) {
|
||||||
if (index <= 0) {
|
if (index <= 0 || index == 'first') {
|
||||||
this.$bar.scrollLeft(0);
|
this.$bar.scrollLeft(0);
|
||||||
this.checkInvisible(suppress);
|
this.checkInvisible(suppress);
|
||||||
} else if ( index >= (this.tabs.length - 1)) {
|
} else if ( index >= (this.tabs.length - 1) || index == 'last') {
|
||||||
var tab = this.tabs[this.tabs.length-1].$el;
|
var tab = this.tabs[this.tabs.length-1].$el;
|
||||||
if (this.$bar.find('.separator-item').length === 0) {
|
if (this.$bar.find('.separator-item').length === 0) {
|
||||||
this.$bar.append('<li class="separator-item"><span></span></li>');
|
this.$bar.append('<li class="separator-item"><span></span></li>');
|
||||||
|
|
@ -608,29 +671,6 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
}
|
||||||
|
|
||||||
addDataHint: function (index, dataHint) { //Hint Manager
|
|
||||||
var oldHintTab = this.$bar.find('[data-hint]');
|
|
||||||
if (oldHintTab.length > 0) {
|
|
||||||
oldHintTab.removeAttr('data-hint');
|
|
||||||
oldHintTab.removeAttr('data-hint-direction');
|
|
||||||
oldHintTab.removeAttr('data-hint-offset');
|
|
||||||
oldHintTab.removeAttr('data-hint-title');
|
|
||||||
}
|
|
||||||
var newHintTab = this.tabs[index].$el;
|
|
||||||
newHintTab.attr('data-hint', dataHint || '0');
|
|
||||||
newHintTab.attr('data-hint-direction', 'top');
|
|
||||||
newHintTab.attr('data-hint-offset', 'medium');
|
|
||||||
newHintTab.attr('data-hint-title', 'M');
|
|
||||||
},
|
|
||||||
|
|
||||||
getWidth: function() {
|
|
||||||
var width = 21;
|
|
||||||
this.tabs.forEach(function(tab){
|
|
||||||
width += tab.$el.width();
|
|
||||||
});
|
|
||||||
return width;
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -370,8 +370,8 @@ define([
|
||||||
|
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<div id="<%=scope.id%>" class="table-styler" style="position: relative; width: <%=scope.width%>px; height:<%=scope.height%>px;">',
|
'<div id="<%=scope.id%>" class="table-styler" style="position: relative; width: <%=scope.width%>px; height:<%=scope.height%>px;">',
|
||||||
'<div class="ts-preview-box ts-preview-box--lt" style="left: 0; top: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;"></div>',
|
'<div style="position: absolute; left: 0; top: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-bottom: 1px dotted gray; border-right: 1px dotted gray;"></div>',
|
||||||
'<div class="ts-preview-box ts-preview-box--mt" style="left: <%=scope.tablePadding%>px; top: 0; right: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;">',
|
'<div style="position: absolute; left: <%=scope.tablePadding%>px; top: 0; right: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;">',
|
||||||
'<div id="<%=scope.id%>-table-top-border-selector" style="position: absolute; z-index: 1; height: <%=scope.tablePadding%>px; left: 0; right: 0; top: <%=scope.tablePadding * .5%>px;">',
|
'<div id="<%=scope.id%>-table-top-border-selector" style="position: absolute; z-index: 1; height: <%=scope.tablePadding%>px; left: 0; right: 0; top: <%=scope.tablePadding * .5%>px;">',
|
||||||
'<table width="100%" height="100%">',
|
'<table width="100%" height="100%">',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
|
|
@ -383,9 +383,9 @@ define([
|
||||||
'</table>',
|
'</table>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div class="ts-preview-box ts-preview-box--rt" style="top: 0; right: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;"></div>',
|
'<div style="position: absolute; top: 0; right: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-bottom: 1px dotted gray; border-left: 1px dotted gray;"></div>',
|
||||||
|
|
||||||
'<div class="ts-preview-box ts-preview-box--lm" style="left: 0; top: <%=scope.tablePadding%>px; width: <%=scope.tablePadding%>px; height: <%=scope.height - 2 * scope.tablePadding%>px;">',
|
'<div style="position: absolute; left: 0; top: <%=scope.tablePadding%>px; width: <%=scope.tablePadding%>px; height: <%=scope.height - 2 * scope.tablePadding%>px;">',
|
||||||
'<div id="<%=scope.id%>-table-left-border-selector" style="position: absolute; z-index: 1; left: <%=scope.tablePadding * .5%>px; top: 0; bottom: 0; width: <%=scope.tablePadding%>px;">',
|
'<div id="<%=scope.id%>-table-left-border-selector" style="position: absolute; z-index: 1; left: <%=scope.tablePadding * .5%>px; top: 0; bottom: 0; width: <%=scope.tablePadding%>px;">',
|
||||||
'<table width="100%" height="100%">',
|
'<table width="100%" height="100%">',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
|
|
@ -395,7 +395,7 @@ define([
|
||||||
'</table>',
|
'</table>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div class="ts-preview-box ts-preview-box--mm" style="left: <%=scope.tablePadding%>px; top: <%=scope.tablePadding%>px; right: <%=scope.tablePadding%>px; bottom: <%=scope.tablePadding%>px;">',
|
'<div style="position: absolute; left: <%=scope.tablePadding%>px; top: <%=scope.tablePadding%>px; right: <%=scope.tablePadding%>px; bottom: <%=scope.tablePadding%>px;">',
|
||||||
'<table id="<%=scope.id%>-table-content" cols="<%=scope.columns%>" width="100%" height="100%" style="border-collapse: inherit; border-spacing: <%= scope.spacingMode ? scope.cellPadding : 0 %>px;">',
|
'<table id="<%=scope.id%>-table-content" cols="<%=scope.columns%>" width="100%" height="100%" style="border-collapse: inherit; border-spacing: <%= scope.spacingMode ? scope.cellPadding : 0 %>px;">',
|
||||||
'<% for (var row = 0; row < scope.rows; row++) { %>',
|
'<% for (var row = 0; row < scope.rows; row++) { %>',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
|
|
@ -406,7 +406,7 @@ define([
|
||||||
'<% } %>',
|
'<% } %>',
|
||||||
'</table>',
|
'</table>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div class="ts-preview-box ts-preview-box--rm" style="right: 0; top: <%=scope.tablePadding%>px; width: <%=scope.tablePadding%>px; height: <%=scope.height - 2 * scope.tablePadding%>px;">',
|
'<div style="position: absolute; right: 0; top: <%=scope.tablePadding%>px; width: <%=scope.tablePadding%>px; height: <%=scope.height - 2 * scope.tablePadding%>px;">',
|
||||||
'<div id="<%=scope.id%>-table-right-border-selector" style="position: absolute; z-index: 1; right: <%=scope.tablePadding * .5%>px; top: 0; bottom: 0; width: <%=scope.tablePadding%>px;">',
|
'<div id="<%=scope.id%>-table-right-border-selector" style="position: absolute; z-index: 1; right: <%=scope.tablePadding * .5%>px; top: 0; bottom: 0; width: <%=scope.tablePadding%>px;">',
|
||||||
'<table width="100%" height="100%">',
|
'<table width="100%" height="100%">',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
|
|
@ -417,8 +417,8 @@ define([
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
|
|
||||||
'<div class="ts-preview-box ts-preview-box--lb" style="left: 0; bottom: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;"></div>',
|
'<div style="position: absolute; left: 0; bottom: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-top: 1px dotted gray; border-right: 1px dotted gray;"></div>',
|
||||||
'<div class="ts-preview-box ts-preview-box--mb" style="left: <%=scope.tablePadding%>px; bottom: 0; right: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;">',
|
'<div style="position: absolute; left: <%=scope.tablePadding%>px; bottom: 0; right: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;">',
|
||||||
'<div id="<%=scope.id%>-table-bottom-border-selector" style="position: absolute; z-index: 1; height: <%=scope.tablePadding%>px; left: 0; right: 0; bottom: <%=scope.tablePadding * .5%>px;">',
|
'<div id="<%=scope.id%>-table-bottom-border-selector" style="position: absolute; z-index: 1; height: <%=scope.tablePadding%>px; left: 0; right: 0; bottom: <%=scope.tablePadding * .5%>px;">',
|
||||||
'<table width="100%" height="100%">',
|
'<table width="100%" height="100%">',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
|
|
@ -430,7 +430,7 @@ define([
|
||||||
'</table>',
|
'</table>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div class="ts-preview-box ts-preview-box--rb" style="bottom: 0; right: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px;"></div>',
|
'<div style="position: absolute; bottom: 0; right: 0; width: <%=scope.tablePadding%>px; height: <%=scope.tablePadding%>px; border-top: 1px dotted gray; border-left: 1px dotted gray;"></div>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')),
|
].join('')),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,15 +65,6 @@ define([
|
||||||
'spellcheck="<%= spellcheck %>" ',
|
'spellcheck="<%= spellcheck %>" ',
|
||||||
'class="form-control <%= cls %>" ',
|
'class="form-control <%= cls %>" ',
|
||||||
'placeholder="<%= placeHolder %>" ',
|
'placeholder="<%= placeHolder %>" ',
|
||||||
'<% if (dataHint) {%>',
|
|
||||||
'data-hint="<%= dataHint %>" ',
|
|
||||||
'<% } %>',
|
|
||||||
'<% if (dataHintDirection) {%>',
|
|
||||||
'data-hint-direction="<%= dataHintDirection %>" ',
|
|
||||||
'<% } %>',
|
|
||||||
'<% if (dataHintOffset) {%>',
|
|
||||||
'data-hint-offset="<%= dataHintOffset %>" ',
|
|
||||||
'<% } %>',
|
|
||||||
'></textarea>',
|
'></textarea>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')),
|
].join('')),
|
||||||
|
|
@ -110,9 +101,6 @@ define([
|
||||||
style : this.style,
|
style : this.style,
|
||||||
placeHolder : this.placeHolder,
|
placeHolder : this.placeHolder,
|
||||||
spellcheck : this.spellcheck,
|
spellcheck : this.spellcheck,
|
||||||
dataHint : this.options.dataHint,
|
|
||||||
dataHintDirection: this.options.dataHintDirection,
|
|
||||||
dataHintOffset: this.options.dataHintOffset,
|
|
||||||
scope : me
|
scope : me
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
@ -183,7 +171,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setDisabled: function(disabled) {
|
setDisabled: function(disabled) {
|
||||||
disabled = !!disabled;
|
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
$(this.el).toggleClass('disabled', disabled);
|
$(this.el).toggleClass('disabled', disabled);
|
||||||
disabled
|
disabled
|
||||||
|
|
|
||||||
|
|
@ -52,36 +52,29 @@ define([
|
||||||
dynamiccolors: 10,
|
dynamiccolors: 10,
|
||||||
standardcolors: 10,
|
standardcolors: 10,
|
||||||
themecolors: 10,
|
themecolors: 10,
|
||||||
columns: 10,
|
|
||||||
effects: 5,
|
effects: 5,
|
||||||
hideEmptyColors: true,
|
|
||||||
allowReselect: true,
|
allowReselect: true,
|
||||||
transparent: false,
|
transparent: false,
|
||||||
value: '000000',
|
value: '000000'
|
||||||
enableKeyEvents: true,
|
|
||||||
keyMoveDirection: 'both' // 'vertical', 'horizontal'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
template :
|
template :
|
||||||
_.template(
|
_.template(
|
||||||
'<div style="padding: 4px 0 0 12px;">' +
|
'<div style="padding: 8px 12px 12px;">' +
|
||||||
'<% var me = this; var idx = 0; %>' +
|
'<% var me = this; %>' +
|
||||||
'<% $(colors).each(function(num, item) { %>' +
|
'<% $(colors).each(function(num, item) { %>' +
|
||||||
'<% if (me.isBlankSeparator(item)) { %> <div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div>' +
|
'<% if (me.isBlankSeparator(item)) { %> <div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div>' +
|
||||||
'<% } else if (me.isSeparator(item)) { %> </div><div class="divider" style="width:100%;float:left;"></div><div style="padding: 12px;">' +
|
'<% } else if (me.isSeparator(item)) { %> </div><div class="divider" style="width:100%;float:left;"></div><div style="padding: 12px;">' +
|
||||||
'<% } else if (me.isColor(item)) { %> ' +
|
'<% } else if (me.isColor(item)) { %> ' +
|
||||||
'<a class="palette-color color-<%=item%>" style="background:#<%=item%>" idx="<%=idx++%>">' +
|
'<a class="palette-color color-<%=item%>" style="background:#<%=item%>" hidefocus="on">' +
|
||||||
'<em><span style="background:#<%=item%>;" unselectable="on"> </span></em>' +
|
'<em><span style="background:#<%=item%>;" unselectable="on"> </span></em>' +
|
||||||
'</a>' +
|
'</a>' +
|
||||||
'<% } else if (me.isTransparent(item)) { %>' +
|
'<% } else if (me.isTransparent(item)) { %>' +
|
||||||
'<a class="color-<%=item%>" idx="<%=idx++%>">' +
|
'<a class="color-<%=item%>" hidefocus="on">' +
|
||||||
'<em><span unselectable="on"> </span></em>' +
|
'<em><span unselectable="on"> </span></em>' +
|
||||||
'</a>' +
|
'</a>' +
|
||||||
'<% } else if (me.isEffect(item)) { %>' +
|
'<% } else if (me.isEffect(item)) { %>' +
|
||||||
'<% if (idx>0 && me.columns>0 && idx%me.columns===0) { %> ' +
|
'<a effectid="<%=item.effectId%>" effectvalue="<%=item.effectValue%>" class="palette-color-effect color-<%=item.color%>" style="background:#<%=item.color%>" hidefocus="on">' +
|
||||||
'<div style="width:100%;height:0;float:left;"></div>' +
|
|
||||||
'<% } %>' +
|
|
||||||
'<a effectid="<%=item.effectId%>" effectvalue="<%=item.effectValue%>" class="palette-color-effect color-<%=item.color%>" style="background:#<%=item.color%>" idx="<%=idx++%>">' +
|
|
||||||
'<em><span style="background:#<%=item.color%>;" unselectable="on"> </span></em>' +
|
'<em><span style="background:#<%=item.color%>;" unselectable="on"> </span></em>' +
|
||||||
'</a>' +
|
'</a>' +
|
||||||
'<% } else if (me.isCaption(item)) { %>' +
|
'<% } else if (me.isCaption(item)) { %>' +
|
||||||
|
|
@ -90,11 +83,9 @@ define([
|
||||||
'<% }); %>' +
|
'<% }); %>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<% if (me.options.dynamiccolors!==undefined) { %>' +
|
'<% if (me.options.dynamiccolors!==undefined) { %>' +
|
||||||
'<div class="palette-color-dynamiccolors" style="padding: 4px 0 0 12px">' +
|
'<div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div><div style="padding: 12px;">' +
|
||||||
'<div class="palette-color-spacer" style="width:100%;height:8px;float:left;"></div>' +
|
|
||||||
'<div class="palette-color-caption" style="width:100%;float:left;font-size: 11px;"><%=me.textRecentColors%></div>' +
|
|
||||||
'<% for (var i=0; i<me.options.dynamiccolors; i++) { %>' +
|
'<% for (var i=0; i<me.options.dynamiccolors; i++) { %>' +
|
||||||
'<a class="color-dynamic-<%=i%> dynamic-empty-color <%= me.emptyColorsClass %>" color="" idx="<%=idx++%>">' +
|
'<a class="color-dynamic-<%=i%> dynamic-empty-color" style="background:#ffffff" color="" hidefocus="on">' +
|
||||||
'<em><span unselectable="on"> </span></em></a>' +
|
'<em><span unselectable="on"> </span></em></a>' +
|
||||||
'<% } %>' +
|
'<% } %>' +
|
||||||
'<% } %>' +
|
'<% } %>' +
|
||||||
|
|
@ -110,20 +101,6 @@ define([
|
||||||
el = me.$el || $(this.el);
|
el = me.$el || $(this.el);
|
||||||
|
|
||||||
this.colors = me.options.colors || this.generateColorData(me.options.themecolors, me.options.effects, me.options.standardcolors, me.options.transparent);
|
this.colors = me.options.colors || this.generateColorData(me.options.themecolors, me.options.effects, me.options.standardcolors, me.options.transparent);
|
||||||
this.columns = me.options.columns || 0;
|
|
||||||
this.enableKeyEvents= me.options.enableKeyEvents;
|
|
||||||
this.tabindex = me.options.tabindex || 0;
|
|
||||||
this.outerMenu = me.options.outerMenu;
|
|
||||||
this.lastSelectedIdx = -1;
|
|
||||||
this.emptyColorsClass = me.options.hideEmptyColors ? 'hidden' : '';
|
|
||||||
|
|
||||||
me.colorItems = [];
|
|
||||||
if (me.options.keyMoveDirection=='vertical')
|
|
||||||
me.moveKeys = [Common.UI.Keys.UP, Common.UI.Keys.DOWN];
|
|
||||||
else if (me.options.keyMoveDirection=='horizontal')
|
|
||||||
me.moveKeys = [Common.UI.Keys.LEFT, Common.UI.Keys.RIGHT];
|
|
||||||
else
|
|
||||||
me.moveKeys = [Common.UI.Keys.UP, Common.UI.Keys.DOWN, Common.UI.Keys.LEFT, Common.UI.Keys.RIGHT];
|
|
||||||
|
|
||||||
el.addClass('theme-colorpalette');
|
el.addClass('theme-colorpalette');
|
||||||
this.render();
|
this.render();
|
||||||
|
|
@ -132,15 +109,6 @@ define([
|
||||||
this.updateColors(this.options.updateColorsArr[0], this.options.updateColorsArr[1]);
|
this.updateColors(this.options.updateColorsArr[0], this.options.updateColorsArr[1]);
|
||||||
if (this.options.value)
|
if (this.options.value)
|
||||||
this.select(this.options.value, true);
|
this.select(this.options.value, true);
|
||||||
if (this.options.outerMenu && this.options.outerMenu.focusOnShow && this.options.outerMenu.menu) {
|
|
||||||
el.addClass('focused');
|
|
||||||
this.options.outerMenu.menu.on('show:after', function(menu) {
|
|
||||||
_.delay(function() {
|
|
||||||
me.showLastSelected();
|
|
||||||
me.focus();
|
|
||||||
}, 10);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.updateCustomColors();
|
this.updateCustomColors();
|
||||||
el.closest('.btn-group').on('show.bs.dropdown', _.bind(this.updateCustomColors, this));
|
el.closest('.btn-group').on('show.bs.dropdown', _.bind(this.updateCustomColors, this));
|
||||||
el.closest('.dropdown-submenu').on('show.bs.dropdown', _.bind(this.updateCustomColors, this));
|
el.closest('.dropdown-submenu').on('show.bs.dropdown', _.bind(this.updateCustomColors, this));
|
||||||
|
|
@ -149,12 +117,6 @@ define([
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
this.$el.html(this.template({colors: this.colors}));
|
this.$el.html(this.template({colors: this.colors}));
|
||||||
|
|
||||||
var me = this;
|
|
||||||
this.moveKeys && this.$el.find('a').each(function(num, item) {
|
|
||||||
me.colorItems.push({el: item, index: num});
|
|
||||||
});
|
|
||||||
this.attachKeyEvents();
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -184,43 +146,28 @@ define([
|
||||||
updateCustomColors: function() {
|
updateCustomColors: function() {
|
||||||
var el = this.$el || $(this.el);
|
var el = this.$el || $(this.el);
|
||||||
if (el) {
|
if (el) {
|
||||||
var selected = (this.lastSelectedIdx>=0) ? $(this.colorItems[this.lastSelectedIdx].el) : el.find('a.' + this.selectedCls),
|
var selected = el.find('a.' + this.selectedCls),
|
||||||
color = (selected.length>0 && /color-dynamic/.test(selected[0].className)) ? selected.attr('color') : undefined;
|
color = (selected.length>0 && /color-dynamic/.test(selected[0].className)) ? selected.attr('color') : undefined;
|
||||||
if (color) { // custom color was selected
|
if (color) { // custom color was selected
|
||||||
color = color.toUpperCase();
|
color = color.toUpperCase();
|
||||||
selected.removeClass(this.selectedCls);
|
selected.removeClass(this.selectedCls);
|
||||||
this.lastSelectedIdx = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var colors = Common.localStorage.getItem('asc.'+Common.localStorage.getId()+'.colors.custom');
|
var colors = Common.localStorage.getItem('asc.'+Common.localStorage.getId()+'.colors.custom');
|
||||||
colors = colors ? colors.split(',') : [];
|
colors = colors ? colors.split(',') : [];
|
||||||
|
|
||||||
var i = -1, colorEl, c = colors.length < this.options.dynamiccolors ? colors.length : this.options.dynamiccolors;
|
var i = -1, colorEl, c = colors.length < this.options.dynamiccolors ? colors.length : this.options.dynamiccolors;
|
||||||
if (this.options.hideEmptyColors && this._layoutParams && el.find('.dynamic-empty-color').length !== (this.options.dynamiccolors - c)) {// recalc indexed if change custom colors
|
|
||||||
this._layoutParams = undefined;
|
|
||||||
}
|
|
||||||
while (++i < c) {
|
while (++i < c) {
|
||||||
colorEl = el.find('.color-dynamic-'+ i);
|
colorEl = el.find('.color-dynamic-'+ i);
|
||||||
colorEl.removeClass('dynamic-empty-color').removeClass(this.emptyColorsClass).attr('color', colors[i]);
|
colorEl.removeClass('dynamic-empty-color').attr('color', colors[i]);
|
||||||
colorEl.find('span').css({
|
colorEl.find('span').css({
|
||||||
'background-color': '#'+colors[i]
|
'background-color': '#'+colors[i]
|
||||||
});
|
});
|
||||||
if (colors[i] == color) {
|
if (colors[i] == color) {
|
||||||
colorEl.addClass(this.selectedCls);
|
colorEl.addClass(this.selectedCls);
|
||||||
this.lastSelectedIdx = parseInt(colorEl.attr('idx'));
|
|
||||||
color = undefined; //select only first found color
|
color = undefined; //select only first found color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (i < this.options.dynamiccolors) {
|
|
||||||
colorEl = el.find('.color-dynamic-'+ i);
|
|
||||||
colorEl.removeAttr('color');
|
|
||||||
colorEl.addClass('dynamic-empty-color').addClass(this.emptyColorsClass);
|
|
||||||
colorEl.find('span').css({
|
|
||||||
'background-color': 'transparent'
|
|
||||||
});
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
el.find('.palette-color-dynamiccolors').toggleClass(this.emptyColorsClass, c===0);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -229,58 +176,45 @@ define([
|
||||||
var target = $(e.target).closest('a');
|
var target = $(e.target).closest('a');
|
||||||
var color, cmp;
|
var color, cmp;
|
||||||
|
|
||||||
if (target.length==0) return false;
|
if (target.length==0) return;
|
||||||
|
|
||||||
if (target.hasClass('color-transparent') ) {
|
if (target.hasClass('color-transparent') ) {
|
||||||
me.clearSelection(true);
|
$(me.el).find('a.' + me.selectedCls).removeClass(me.selectedCls);
|
||||||
target.addClass(me.selectedCls);
|
target.addClass(me.selectedCls);
|
||||||
if (!e.suppressEvent) {
|
me.value = 'transparent';
|
||||||
me.lastSelectedIdx = parseInt(target.attr('idx'));
|
me.trigger('select', me, 'transparent');
|
||||||
me.value = 'transparent';
|
|
||||||
me.trigger('select', me, 'transparent');
|
|
||||||
}
|
|
||||||
} else if ( !(target[0].className.search('color-dynamic')<0) ) {
|
} else if ( !(target[0].className.search('color-dynamic')<0) ) {
|
||||||
if (!/dynamic-empty-color/.test(target[0].className)) {
|
if (!/dynamic-empty-color/.test(target[0].className)) {
|
||||||
me.clearSelection(true);
|
$(me.el).find('a.' + me.selectedCls).removeClass(me.selectedCls);
|
||||||
target.addClass(me.selectedCls);
|
target.addClass(me.selectedCls);
|
||||||
if (!e.suppressEvent) {
|
color = target.attr('color');
|
||||||
me.lastSelectedIdx = parseInt(target.attr('idx'));
|
if (color) me.trigger('select', me, color);
|
||||||
color = target.attr('color');
|
|
||||||
me.trigger('select', me, color);
|
me.value = color.toUpperCase();
|
||||||
me.value = color.toUpperCase();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (e.suppressEvent) {
|
setTimeout(function(){
|
||||||
me.clearSelection(true);
|
me.addNewColor();
|
||||||
target.addClass(me.selectedCls);
|
}, 10);
|
||||||
} else
|
|
||||||
setTimeout(function(){
|
|
||||||
me.addNewColor();
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!/^[a-fA-F0-9]{6}$/.test(me.value) || _.indexOf(me.colors, me.value)<0 )
|
if (!/^[a-fA-F0-9]{6}$/.test(me.value) || _.indexOf(me.colors, me.value)<0 )
|
||||||
me.value = false;
|
me.value = false;
|
||||||
|
|
||||||
me.clearSelection(true);
|
$(me.el).find('a.' + me.selectedCls).removeClass(me.selectedCls);
|
||||||
target.addClass(me.selectedCls);
|
target.addClass(me.selectedCls);
|
||||||
|
|
||||||
color = target[0].className.match(me.colorRe)[1];
|
color = target[0].className.match(me.colorRe)[1];
|
||||||
if ( target.hasClass('palette-color-effect') ) {
|
if ( target.hasClass('palette-color-effect') ) {
|
||||||
var effectId = parseInt(target.attr('effectid'));
|
var effectId = parseInt(target.attr('effectid'));
|
||||||
if (color && !e.suppressEvent) {
|
if (color) {
|
||||||
me.value = color.toUpperCase();
|
me.value = color.toUpperCase();
|
||||||
me.trigger('select', me, {color: color, effectId: effectId});
|
me.trigger('select', me, {color: color, effectId: effectId});
|
||||||
me.lastSelectedIdx = parseInt(target.attr('idx'));
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (/#?[a-fA-F0-9]{6}/.test(color)) {
|
if (/#?[a-fA-F0-9]{6}/.test(color)) {
|
||||||
color = /#?([a-fA-F0-9]{6})/.exec(color)[1].toUpperCase();
|
color = /#?([a-fA-F0-9]{6})/.exec(color)[1].toUpperCase();
|
||||||
if (color && !e.suppressEvent) {
|
me.value = color;
|
||||||
me.value = color;
|
me.trigger('select', me, color);
|
||||||
me.trigger('select', me, color);
|
|
||||||
me.lastSelectedIdx = parseInt(target.attr('idx'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -291,22 +225,19 @@ define([
|
||||||
color = /#?([a-fA-F0-9]{6})/.exec(color);
|
color = /#?([a-fA-F0-9]{6})/.exec(color);
|
||||||
if (color) {
|
if (color) {
|
||||||
this.saveCustomColor(color[1]);
|
this.saveCustomColor(color[1]);
|
||||||
this.clearSelection(true);
|
|
||||||
|
el.find('a.' + this.selectedCls).removeClass(this.selectedCls);
|
||||||
|
|
||||||
var child = el.find('.dynamic-empty-color');
|
var child = el.find('.dynamic-empty-color');
|
||||||
if (child.length==0) {
|
if (child.length==0) {
|
||||||
this.updateCustomColors();
|
this.updateCustomColors();
|
||||||
child = el.find('.color-dynamic-' + (this.options.dynamiccolors - 1));
|
child = el.find('.color-dynamic-' + (this.options.dynamiccolors - 1));
|
||||||
} else {
|
|
||||||
if (this.options.hideEmptyColors && this._layoutParams) // recalc indexed
|
|
||||||
this._layoutParams = undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
child.first().removeClass('dynamic-empty-color').removeClass(this.emptyColorsClass).addClass(this.selectedCls).attr('color', color[1]);
|
child.first().removeClass('dynamic-empty-color').addClass(this.selectedCls).attr('color', color[1]);
|
||||||
child.first().find('span').css({
|
child.first().find('span').css({
|
||||||
'background-color': '#'+color[1]
|
'background-color': '#'+color[1]
|
||||||
});
|
});
|
||||||
el.find('.palette-color-dynamiccolors').removeClass(this.emptyColorsClass);
|
|
||||||
this.select(color[1], true);
|
this.select(color[1], true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -342,7 +273,7 @@ define([
|
||||||
|
|
||||||
select: function(color, suppressEvent) {
|
select: function(color, suppressEvent) {
|
||||||
var el = this.$el || $(this.el);
|
var el = this.$el || $(this.el);
|
||||||
this.clearSelection();
|
el.find('a.' + this.selectedCls).removeClass(this.selectedCls);
|
||||||
|
|
||||||
if (typeof(color) == 'object' ) {
|
if (typeof(color) == 'object' ) {
|
||||||
var effectEl;
|
var effectEl;
|
||||||
|
|
@ -350,7 +281,6 @@ define([
|
||||||
effectEl = el.find('a[effectid="'+color.effectId+'"]').first();
|
effectEl = el.find('a[effectid="'+color.effectId+'"]').first();
|
||||||
if (effectEl.length>0) {
|
if (effectEl.length>0) {
|
||||||
effectEl.addClass(this.selectedCls);
|
effectEl.addClass(this.selectedCls);
|
||||||
this.lastSelectedIdx = parseInt(effectEl.attr('idx'));
|
|
||||||
this.value = effectEl[0].className.match(this.colorRe)[1].toUpperCase();
|
this.value = effectEl[0].className.match(this.colorRe)[1].toUpperCase();
|
||||||
} else
|
} else
|
||||||
this.value = false;
|
this.value = false;
|
||||||
|
|
@ -358,7 +288,6 @@ define([
|
||||||
effectEl = el.find('a[effectvalue="'+color.effectValue+'"].color-' + color.color.toUpperCase()).first();
|
effectEl = el.find('a[effectvalue="'+color.effectValue+'"].color-' + color.color.toUpperCase()).first();
|
||||||
if (effectEl.length>0) {
|
if (effectEl.length>0) {
|
||||||
effectEl.addClass(this.selectedCls);
|
effectEl.addClass(this.selectedCls);
|
||||||
this.lastSelectedIdx = parseInt(effectEl.attr('idx'));
|
|
||||||
this.value = effectEl[0].className.match(this.colorRe)[1].toUpperCase();
|
this.value = effectEl[0].className.match(this.colorRe)[1].toUpperCase();
|
||||||
} else
|
} else
|
||||||
this.value = false;
|
this.value = false;
|
||||||
|
|
@ -373,9 +302,8 @@ define([
|
||||||
if (_.indexOf(this.colors, this.value)<0) this.value = false;
|
if (_.indexOf(this.colors, this.value)<0) this.value = false;
|
||||||
|
|
||||||
if (color != this.value || this.options.allowReselect) {
|
if (color != this.value || this.options.allowReselect) {
|
||||||
var co = (color == 'transparent') ? el.find('a.color-transparent').addClass(this.selectedCls) : el.find('a.palette-color.color-' + color).first().addClass(this.selectedCls);
|
(color == 'transparent') ? el.find('a.color-transparent').addClass(this.selectedCls) : el.find('a.palette-color.color-' + color).first().addClass(this.selectedCls);
|
||||||
this.value = color;
|
this.value = color;
|
||||||
this.lastSelectedIdx = parseInt(co.attr('idx'));
|
|
||||||
if (suppressEvent !== true) {
|
if (suppressEvent !== true) {
|
||||||
this.fireEvent('select', this, color);
|
this.fireEvent('select', this, color);
|
||||||
}
|
}
|
||||||
|
|
@ -386,7 +314,6 @@ define([
|
||||||
co = el.find('a[color="'+color+'"]').first();
|
co = el.find('a[color="'+color+'"]').first();
|
||||||
if (co.length>0) {
|
if (co.length>0) {
|
||||||
co.addClass(this.selectedCls);
|
co.addClass(this.selectedCls);
|
||||||
this.lastSelectedIdx = parseInt(co.attr('idx'));
|
|
||||||
this.value = color.toUpperCase();
|
this.value = color.toUpperCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -395,7 +322,7 @@ define([
|
||||||
|
|
||||||
selectByRGB: function(rgb, suppressEvent) {
|
selectByRGB: function(rgb, suppressEvent) {
|
||||||
var el = this.$el || $(this.el);
|
var el = this.$el || $(this.el);
|
||||||
this.clearSelection(true);
|
el.find('a.' + this.selectedCls).removeClass(this.selectedCls);
|
||||||
|
|
||||||
var color = (typeof(rgb) == 'object') ? rgb.color : rgb;
|
var color = (typeof(rgb) == 'object') ? rgb.color : rgb;
|
||||||
if (/#?[a-fA-F0-9]{6}/.test(color)) {
|
if (/#?[a-fA-F0-9]{6}/.test(color)) {
|
||||||
|
|
@ -411,7 +338,6 @@ define([
|
||||||
co = el.find('a[color="'+color+'"]').first();
|
co = el.find('a[color="'+color+'"]').first();
|
||||||
if (co.length>0) {
|
if (co.length>0) {
|
||||||
co.addClass(this.selectedCls);
|
co.addClass(this.selectedCls);
|
||||||
this.lastSelectedIdx = parseInt(co.attr('idx'));
|
|
||||||
this.value = color;
|
this.value = color;
|
||||||
}
|
}
|
||||||
if (suppressEvent !== true) {
|
if (suppressEvent !== true) {
|
||||||
|
|
@ -491,35 +417,14 @@ define([
|
||||||
|
|
||||||
clearSelection: function(suppressEvent) {
|
clearSelection: function(suppressEvent) {
|
||||||
this.$el.find('a.' + this.selectedCls).removeClass(this.selectedCls);
|
this.$el.find('a.' + this.selectedCls).removeClass(this.selectedCls);
|
||||||
if (!suppressEvent) {
|
this.value = undefined;
|
||||||
this.value = undefined;
|
|
||||||
this.lastSelectedIdx = -1;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
showLastSelected: function() {
|
|
||||||
this.selectByIndex(this.lastSelectedIdx, true);
|
|
||||||
},
|
|
||||||
|
|
||||||
getSelectedColor: function() {
|
|
||||||
var el = this.$el || $(this.el);
|
|
||||||
var idx = el.find('a.' + this.selectedCls).attr('idx');
|
|
||||||
return (idx!==undefined) ? this.colorItems[parseInt(idx)] : null;
|
|
||||||
},
|
|
||||||
|
|
||||||
selectByIndex: function(index, suppressEvent) {
|
|
||||||
this.clearSelection(true);
|
|
||||||
|
|
||||||
if (index>=0 && index<this.colorItems.length) {
|
|
||||||
this.handleClick({target: this.colorItems[index].el, suppressEvent: suppressEvent});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
generateColorData: function(themecolors, effects, standardcolors, transparent) {
|
generateColorData: function(themecolors, effects, standardcolors, transparent) {
|
||||||
var arr = [],
|
var arr = [],
|
||||||
len = (themecolors>0 && effects>0) ? themecolors * effects : 0;
|
len = (themecolors>0 && effects>0) ? themecolors * effects : 0;
|
||||||
if (themecolors>0) {
|
if (themecolors>0) {
|
||||||
arr = [this.textThemeColors];
|
arr = [this.textThemeColors, '-'];
|
||||||
for (var i=0; i<themecolors; i++)
|
for (var i=0; i<themecolors; i++)
|
||||||
arr.push({color: 'FFFFFF', effectId: 1});
|
arr.push({color: 'FFFFFF', effectId: 1});
|
||||||
|
|
||||||
|
|
@ -528,10 +433,10 @@ define([
|
||||||
arr.push({color: 'FFFFFF', effectId: 1});
|
arr.push({color: 'FFFFFF', effectId: 1});
|
||||||
|
|
||||||
if (standardcolors)
|
if (standardcolors)
|
||||||
arr.push('-');
|
arr.push('-', '--', '-');
|
||||||
}
|
}
|
||||||
if (standardcolors) {
|
if (standardcolors) {
|
||||||
arr.push(this.textStandartColors);
|
arr.push(this.textStandartColors, '-');
|
||||||
if (transparent) {
|
if (transparent) {
|
||||||
arr.push('transparent');
|
arr.push('transparent');
|
||||||
standardcolors--;
|
standardcolors--;
|
||||||
|
|
@ -539,142 +444,12 @@ define([
|
||||||
for (var i=0; i<standardcolors; i++)
|
for (var i=0; i<standardcolors; i++)
|
||||||
arr.push('FFFFFF');
|
arr.push('FFFFFF');
|
||||||
}
|
}
|
||||||
|
if (this.options.dynamiccolors && (themecolors || standardcolors))
|
||||||
|
arr.push('-', '--');
|
||||||
return arr;
|
return arr;
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeyDown: function (e, data) {
|
|
||||||
if (data===undefined) data = e;
|
|
||||||
if (_.indexOf(this.moveKeys, data.keyCode)>-1 || data.keyCode==Common.UI.Keys.RETURN) {
|
|
||||||
data.preventDefault();
|
|
||||||
data.stopPropagation();
|
|
||||||
var rec = this.getSelectedColor();
|
|
||||||
if (data.keyCode==Common.UI.Keys.RETURN) {
|
|
||||||
rec && this.selectByIndex(rec.index);
|
|
||||||
if (this.outerMenu && this.outerMenu.menu)
|
|
||||||
this.outerMenu.menu.hide();
|
|
||||||
} else {
|
|
||||||
var idx = rec ? rec.index : -1;
|
|
||||||
if (idx<0) {
|
|
||||||
idx = 0;
|
|
||||||
} else if (this.options.keyMoveDirection == 'both') {
|
|
||||||
if (this._layoutParams === undefined)
|
|
||||||
this.fillIndexesArray();
|
|
||||||
var topIdx = this.colorItems[idx].topIdx,
|
|
||||||
leftIdx = this.colorItems[idx].leftIdx;
|
|
||||||
|
|
||||||
idx = undefined;
|
|
||||||
if (data.keyCode==Common.UI.Keys.LEFT) {
|
|
||||||
while (idx===undefined) {
|
|
||||||
leftIdx--;
|
|
||||||
if (leftIdx<0) {
|
|
||||||
leftIdx = this._layoutParams.columns-1;
|
|
||||||
}
|
|
||||||
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
|
||||||
}
|
|
||||||
} else if (data.keyCode==Common.UI.Keys.RIGHT) {
|
|
||||||
while (idx===undefined) {
|
|
||||||
leftIdx++;
|
|
||||||
if (leftIdx>this._layoutParams.columns-1) leftIdx = 0;
|
|
||||||
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
|
||||||
}
|
|
||||||
} else if (data.keyCode==Common.UI.Keys.UP) {
|
|
||||||
if (topIdx==0 && this.outerMenu && this.outerMenu.menu) {
|
|
||||||
this.clearSelection(true);
|
|
||||||
this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
|
||||||
} else
|
|
||||||
while (idx===undefined) {
|
|
||||||
topIdx--;
|
|
||||||
if (topIdx<0) topIdx = this._layoutParams.rows-1;
|
|
||||||
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (topIdx==this._layoutParams.rows-1 && this.outerMenu && this.outerMenu.menu) {
|
|
||||||
this.clearSelection(true);
|
|
||||||
this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
|
||||||
} else
|
|
||||||
while (idx===undefined) {
|
|
||||||
topIdx++;
|
|
||||||
if (topIdx>this._layoutParams.rows-1) topIdx = 0;
|
|
||||||
idx = this._layoutParams.itemsIndexes[topIdx][leftIdx];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
|
|
||||||
? Math.max(0, idx-1)
|
|
||||||
: Math.min(this.colorItems.length - 1, idx + 1) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (idx !== undefined && idx>=0) {
|
|
||||||
this._fromKeyDown = true;
|
|
||||||
this.selectByIndex(idx, true);
|
|
||||||
this._fromKeyDown = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
fillIndexesArray: function() {
|
|
||||||
if (this.colorItems.length<=0) return;
|
|
||||||
|
|
||||||
this._layoutParams = {
|
|
||||||
itemsIndexes: [],
|
|
||||||
columns: 0,
|
|
||||||
rows: 0
|
|
||||||
};
|
|
||||||
|
|
||||||
var el = $(this.colorItems[0].el),
|
|
||||||
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
|
|
||||||
offsetLeft = this.$el.offset().left,
|
|
||||||
offsetTop = el.offset().top,
|
|
||||||
prevtop = -1, topIdx = 0, leftIdx = 0;
|
|
||||||
|
|
||||||
for (var i=0; i<this.colorItems.length; i++) {
|
|
||||||
var top = $(this.colorItems[i].el).offset().top - offsetTop;
|
|
||||||
leftIdx = Math.floor(($(this.colorItems[i].el).offset().left - offsetLeft)/itemW);
|
|
||||||
if (top>prevtop) {
|
|
||||||
prevtop = top;
|
|
||||||
this._layoutParams.itemsIndexes.push([]);
|
|
||||||
topIdx = this._layoutParams.itemsIndexes.length-1;
|
|
||||||
}
|
|
||||||
this._layoutParams.itemsIndexes[topIdx][leftIdx] = i;
|
|
||||||
this.colorItems[i].topIdx = topIdx;
|
|
||||||
this.colorItems[i].leftIdx = leftIdx;
|
|
||||||
if (this._layoutParams.columns<leftIdx) this._layoutParams.columns = leftIdx;
|
|
||||||
}
|
|
||||||
this._layoutParams.rows = this._layoutParams.itemsIndexes.length;
|
|
||||||
this._layoutParams.columns++;
|
|
||||||
},
|
|
||||||
|
|
||||||
attachKeyEvents: function() {
|
|
||||||
if (this.enableKeyEvents) {
|
|
||||||
var el = this.$el || $(this.el);
|
|
||||||
el.addClass('canfocused');
|
|
||||||
el.attr('tabindex', this.tabindex.toString());
|
|
||||||
el.on('keydown', _.bind(this.onKeyDown, this));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
focus: function(index) {
|
|
||||||
var el = this.$el || $(this.el);
|
|
||||||
el && el.focus();
|
|
||||||
if (typeof index == 'string') {
|
|
||||||
if (index == 'first') {
|
|
||||||
this.selectByIndex(0, true);
|
|
||||||
} else if (index == 'last') {
|
|
||||||
if (this._layoutParams === undefined)
|
|
||||||
this.fillIndexesArray();
|
|
||||||
this.selectByIndex(this._layoutParams.itemsIndexes[this._layoutParams.rows-1][0], true);
|
|
||||||
}
|
|
||||||
} else if (index !== undefined)
|
|
||||||
this.selectByIndex(index, true);
|
|
||||||
},
|
|
||||||
|
|
||||||
focusInner: function(e) {
|
|
||||||
this.focus(e.keyCode == Common.UI.Keys.DOWN ? 'first' : 'last');
|
|
||||||
},
|
|
||||||
|
|
||||||
textThemeColors : 'Theme Colors',
|
textThemeColors : 'Theme Colors',
|
||||||
textStandartColors : 'Standard Colors',
|
textStandartColors : 'Standart Colors'
|
||||||
textRecentColors : 'Recent Colors'
|
|
||||||
}, Common.UI.ThemeColorPalette || {}));
|
}, Common.UI.ThemeColorPalette || {}));
|
||||||
});
|
});
|
||||||
|
|
@ -104,17 +104,12 @@
|
||||||
offset : opts.offset,
|
offset : opts.offset,
|
||||||
cls : opts.cls,
|
cls : opts.cls,
|
||||||
html : opts.html,
|
html : opts.html,
|
||||||
hideonclick : opts.hideonclick,
|
hideonclick : opts.hideonclick
|
||||||
keepvisible: opts.keepvisible
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (opts.hideonclick) {
|
if (opts.hideonclick) {
|
||||||
var me = this;
|
|
||||||
var tip = this.$element.data('bs.tooltip');
|
var tip = this.$element.data('bs.tooltip');
|
||||||
if (tip) tip.tip().on('click', function() {
|
if (tip) tip.tip().on('click', function() {tip.hide();});
|
||||||
tip.hide();
|
|
||||||
me.trigger('tooltip:hideonclick', this);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$element.on('shown.bs.tooltip', _.bind(this.onTipShown, this));
|
this.$element.on('shown.bs.tooltip', _.bind(this.onTipShown, this));
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ define([
|
||||||
if (innerEl) {
|
if (innerEl) {
|
||||||
(this.dataViewItems.length<1) && innerEl.find('.empty-text').remove();
|
(this.dataViewItems.length<1) && innerEl.find('.empty-text').remove();
|
||||||
|
|
||||||
if (opts && (typeof opts.at==='number')) {
|
if (opts && opts.at!==undefined) {
|
||||||
var idx = opts.at;
|
var idx = opts.at;
|
||||||
var innerDivs = innerEl.find('> div');
|
var innerDivs = innerEl.find('> div');
|
||||||
if (idx > 0)
|
if (idx > 0)
|
||||||
|
|
@ -212,7 +212,19 @@ define([
|
||||||
this.dataViewItems.push(view);
|
this.dataViewItems.push(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateTip(view);
|
var name = record.get('name');
|
||||||
|
if (name.length > 37 - record.get('level')*2)
|
||||||
|
record.set('tip', name);
|
||||||
|
if (record.get('tip')) {
|
||||||
|
var view_el = $(view.el);
|
||||||
|
view_el.attr('data-toggle', 'tooltip');
|
||||||
|
view_el.tooltip({
|
||||||
|
title : record.get('tip'),
|
||||||
|
placement : 'cursor',
|
||||||
|
zIndex : this.tipZIndex
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.listenTo(view, 'change', this.onChangeItem);
|
this.listenTo(view, 'change', this.onChangeItem);
|
||||||
this.listenTo(view, 'remove', this.onRemoveItem);
|
this.listenTo(view, 'remove', this.onRemoveItem);
|
||||||
this.listenTo(view, 'click', this.onClickItem);
|
this.listenTo(view, 'click', this.onClickItem);
|
||||||
|
|
@ -235,31 +247,31 @@ define([
|
||||||
var isExpanded = !record.get('isExpanded');
|
var isExpanded = !record.get('isExpanded');
|
||||||
record.set('isExpanded', isExpanded);
|
record.set('isExpanded', isExpanded);
|
||||||
this.store[(isExpanded) ? 'expandSubItems' : 'collapseSubItems'](record);
|
this.store[(isExpanded) ? 'expandSubItems' : 'collapseSubItems'](record);
|
||||||
this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible});
|
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
|
||||||
} else
|
} else
|
||||||
Common.UI.DataView.prototype.onClickItem.call(this, view, record, e);
|
Common.UI.DataView.prototype.onClickItem.call(this, view, record, e);
|
||||||
},
|
},
|
||||||
|
|
||||||
expandAll: function() {
|
expandAll: function() {
|
||||||
this.store.expandAll();
|
this.store.expandAll();
|
||||||
this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible});
|
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
|
||||||
},
|
},
|
||||||
|
|
||||||
collapseAll: function() {
|
collapseAll: function() {
|
||||||
this.store.collapseAll();
|
this.store.collapseAll();
|
||||||
this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible});
|
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
|
||||||
},
|
},
|
||||||
|
|
||||||
expandToLevel: function(expandLevel) {
|
expandToLevel: function(expandLevel) {
|
||||||
this.store.expandToLevel(expandLevel);
|
this.store.expandToLevel(expandLevel);
|
||||||
this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible});
|
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
|
||||||
},
|
},
|
||||||
|
|
||||||
expandRecord: function(record) {
|
expandRecord: function(record) {
|
||||||
if (record) {
|
if (record) {
|
||||||
record.set('isExpanded', true);
|
record.set('isExpanded', true);
|
||||||
this.store.expandSubItems(record);
|
this.store.expandSubItems(record);
|
||||||
this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible});
|
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -267,7 +279,7 @@ define([
|
||||||
if (record) {
|
if (record) {
|
||||||
record.set('isExpanded', false);
|
record.set('isExpanded', false);
|
||||||
this.store.collapseSubItems(record);
|
this.store.collapseSubItems(record);
|
||||||
this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible});
|
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -349,51 +361,6 @@ define([
|
||||||
|
|
||||||
focus: function() {
|
focus: function() {
|
||||||
this.cmpEl && this.cmpEl.find('.treeview').focus();
|
this.cmpEl && this.cmpEl.find('.treeview').focus();
|
||||||
},
|
|
||||||
|
|
||||||
updateTip: function(item) {
|
|
||||||
var record = item.model,
|
|
||||||
name = record.get('name'),
|
|
||||||
me = this;
|
|
||||||
|
|
||||||
if (name.length > 37 - record.get('level')*2)
|
|
||||||
record.set('tip', name);
|
|
||||||
else
|
|
||||||
record.set('tip', '');
|
|
||||||
|
|
||||||
var el = item.$el || $(item.el);
|
|
||||||
var tip = el.data('bs.tooltip');
|
|
||||||
if (tip) {
|
|
||||||
if (tip.dontShow===undefined)
|
|
||||||
tip.dontShow = true;
|
|
||||||
el.removeData('bs.tooltip');
|
|
||||||
}
|
|
||||||
if (record.get('tip')) {
|
|
||||||
el.attr('data-toggle', 'tooltip');
|
|
||||||
el.tooltip({
|
|
||||||
title : record.get('tip'),
|
|
||||||
placement : 'cursor',
|
|
||||||
zIndex : this.tipZIndex
|
|
||||||
});
|
|
||||||
if (this.delayRenderTips)
|
|
||||||
el.one('mouseenter', function(){
|
|
||||||
el.attr('data-toggle', 'tooltip');
|
|
||||||
el.tooltip({
|
|
||||||
title : record.get('tip'),
|
|
||||||
placement : 'cursor',
|
|
||||||
zIndex : me.tipZIndex
|
|
||||||
});
|
|
||||||
el.mouseenter();
|
|
||||||
});
|
|
||||||
else {
|
|
||||||
el.attr('data-toggle', 'tooltip');
|
|
||||||
el.tooltip({
|
|
||||||
title : record.get('tip'),
|
|
||||||
placement : 'cursor',
|
|
||||||
zIndex : me.tipZIndex
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})());
|
})());
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
define([
|
define([
|
||||||
'common/main/lib/component/BaseView',
|
'common/main/lib/component/BaseView',
|
||||||
'common/main/lib/component/CheckBox',
|
'common/main/lib/component/CheckBox',
|
||||||
'common/main/lib/controller/FocusManager'
|
'common/main/lib/component/FocusManager'
|
||||||
], function () {
|
], function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
@ -241,7 +241,7 @@ define([
|
||||||
|
|
||||||
function _autoSize() {
|
function _autoSize() {
|
||||||
if (this.initConfig.height == 'auto') {
|
if (this.initConfig.height == 'auto') {
|
||||||
var height = Math.ceil(parseFloat(this.$window.find('> .body').css('height')));
|
var height = parseInt(this.$window.find('> .body').css('height'));
|
||||||
this.initConfig.header && (height += parseInt(this.$window.find('> .header').css('height')));
|
this.initConfig.header && (height += parseInt(this.$window.find('> .header').css('height')));
|
||||||
this.$window.height(height);
|
this.$window.height(height);
|
||||||
}
|
}
|
||||||
|
|
@ -455,7 +455,7 @@ define([
|
||||||
if (!options.width) options.width = 'auto';
|
if (!options.width) options.width = 'auto';
|
||||||
|
|
||||||
var template = '<div class="info-box">' +
|
var template = '<div class="info-box">' +
|
||||||
'<% if (typeof iconCls !== "undefined") { %><div class="icon <%= iconCls %>"></div><% } %>' +
|
'<% if (typeof iconCls !== "undefined") { %><div class="icon img-commonctrl img-colored <%= iconCls %>"></div><% } %>' +
|
||||||
'<div class="text" <% if (typeof iconCls == "undefined") { %> style="padding-left:10px;" <% } %>><span><%= msg %></span>' +
|
'<div class="text" <% if (typeof iconCls == "undefined") { %> style="padding-left:10px;" <% } %>><span><%= msg %></span>' +
|
||||||
'<% if (dontshow) { %><div class="dont-show-checkbox"></div><% } %>' +
|
'<% if (dontshow) { %><div class="dont-show-checkbox"></div><% } %>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
|
|
@ -490,8 +490,7 @@ define([
|
||||||
if (options.width=='auto') {
|
if (options.width=='auto') {
|
||||||
text_cnt.height(Math.max(text.height(), icon_height) + ((check.length>0) ? (check.height() + parseInt(check.css('margin-top'))) : 0));
|
text_cnt.height(Math.max(text.height(), icon_height) + ((check.length>0) ? (check.height() + parseInt(check.css('margin-top'))) : 0));
|
||||||
body.height(parseInt(text_cnt.css('height')) + parseInt(footer.css('height')));
|
body.height(parseInt(text_cnt.css('height')) + parseInt(footer.css('height')));
|
||||||
var span_el = check.find('span');
|
window.setSize(text.position().left + text.width() + parseInt(text_cnt.css('padding-right')),
|
||||||
window.setSize(Math.max(text.width(), span_el.length>0 ? span_el.position().left + span_el.width() : 0) + text.position().left + parseInt(text_cnt.css('padding-right')),
|
|
||||||
parseInt(body.css('height')) + parseInt(header.css('height')));
|
parseInt(body.css('height')) + parseInt(header.css('height')));
|
||||||
} else {
|
} else {
|
||||||
text.css('white-space', 'normal');
|
text.css('white-space', 'normal');
|
||||||
|
|
|
||||||
|
|
@ -85,25 +85,16 @@ define([
|
||||||
storeUsers: this.getApplication().getCollection('Common.Collections.Users'),
|
storeUsers: this.getApplication().getCollection('Common.Collections.Users'),
|
||||||
storeMessages: this.getApplication().getCollection('Common.Collections.ChatMessages')
|
storeMessages: this.getApplication().getCollection('Common.Collections.ChatMessages')
|
||||||
});
|
});
|
||||||
this.panelChat.on('render:after', _.bind(this.onAfterRender, this));
|
|
||||||
},
|
|
||||||
|
|
||||||
onAfterRender: function(panel) {
|
|
||||||
var viewport = this.getApplication().getController('Viewport').getView('Viewport');
|
|
||||||
viewport.hlayout.on('layout:resizedrag', _.bind(function () {
|
|
||||||
panel && panel.updateScrolls();
|
|
||||||
}, this));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setMode: function(mode) {
|
setMode: function(mode) {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.currentUserId = mode.user.id;
|
|
||||||
|
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
if (this.mode.canCoAuthoring && this.mode.canChat)
|
if (this.mode.canCoAuthoring && this.mode.canChat)
|
||||||
this.api.asc_registerCallback('asc_onCoAuthoringChatReceiveMessage', _.bind(this.onReceiveMessage, this));
|
this.api.asc_registerCallback('asc_onCoAuthoringChatReceiveMessage', _.bind(this.onReceiveMessage, this));
|
||||||
|
|
||||||
if ( !this.mode.isEditDiagram && !this.mode.isEditMailMerge && !this.mode.isEditOle ) {
|
if ( !this.mode.isEditDiagram && !this.mode.isEditMailMerge ) {
|
||||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onUsersChanged, this));
|
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onUsersChanged, this));
|
||||||
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
|
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
|
||||||
this.api.asc_coAuthoringGetUsers();
|
this.api.asc_coAuthoringGetUsers();
|
||||||
|
|
@ -151,8 +142,7 @@ define([
|
||||||
username : user.asc_getUserName(),
|
username : user.asc_getUserName(),
|
||||||
online : true,
|
online : true,
|
||||||
color : user.asc_getColor(),
|
color : user.asc_getColor(),
|
||||||
view : user.asc_getView(),
|
view : user.asc_getView()
|
||||||
hidden : !(user.asc_getIdOriginal()===this.currentUserId || AscCommon.UserInfoParser.isUserVisible(user.asc_getUserName()))
|
|
||||||
});
|
});
|
||||||
arrUsers[(user.asc_getId() == currentUserId ) ? 'unshift' : 'push'](usermodel);
|
arrUsers[(user.asc_getId() == currentUserId ) ? 'unshift' : 'push'](usermodel);
|
||||||
}
|
}
|
||||||
|
|
@ -175,8 +165,7 @@ define([
|
||||||
username : change.asc_getUserName(),
|
username : change.asc_getUserName(),
|
||||||
online : change.asc_getState(),
|
online : change.asc_getState(),
|
||||||
color : change.asc_getColor(),
|
color : change.asc_getColor(),
|
||||||
view : change.asc_getView(),
|
view : change.asc_getView()
|
||||||
hidden : !(change.asc_getIdOriginal()===this.currentUserId || AscCommon.UserInfoParser.isUserVisible(change.asc_getUserName()))
|
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
user.set({online: change.asc_getState()});
|
user.set({online: change.asc_getState()});
|
||||||
|
|
|
||||||
|
|
@ -102,9 +102,7 @@ define([
|
||||||
|
|
||||||
// work handlers
|
// work handlers
|
||||||
|
|
||||||
'comment:closeEditing': _.bind(this.closeEditing, this),
|
'comment:closeEditing': _.bind(this.closeEditing, this)
|
||||||
'comment:sort': _.bind(this.setComparator, this),
|
|
||||||
'comment:filtergroups': _.bind(this.setFilterGroups, this)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
'Common.Views.ReviewPopover': {
|
'Common.Views.ReviewPopover': {
|
||||||
|
|
@ -146,11 +144,10 @@ define([
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
var filter = Common.localStorage.getKeysFilter();
|
|
||||||
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
|
||||||
|
|
||||||
this.collection = this.getApplication().getCollection('Common.Collections.Comments');
|
this.collection = this.getApplication().getCollection('Common.Collections.Comments');
|
||||||
this.setComparator();
|
if (this.collection) {
|
||||||
|
this.collection.comparator = function (collection) { return -collection.get('time'); };
|
||||||
|
}
|
||||||
|
|
||||||
this.popoverComments = new Common.Collections.Comments();
|
this.popoverComments = new Common.Collections.Comments();
|
||||||
if (this.popoverComments) {
|
if (this.popoverComments) {
|
||||||
|
|
@ -158,7 +155,6 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.groupCollection = [];
|
this.groupCollection = [];
|
||||||
this.userGroups = []; // for filtering comments
|
|
||||||
|
|
||||||
this.view = this.createView('Common.Views.Comments', { store: this.collection });
|
this.view = this.createView('Common.Views.Comments', { store: this.collection });
|
||||||
this.view.render();
|
this.view.render();
|
||||||
|
|
@ -196,7 +192,6 @@ define([
|
||||||
this.api.asc_registerCallback('asc_onUpdateCommentPosition', _.bind(this.onApiUpdateCommentPosition, this));
|
this.api.asc_registerCallback('asc_onUpdateCommentPosition', _.bind(this.onApiUpdateCommentPosition, this));
|
||||||
this.api.asc_registerCallback('asc_onDocumentPlaceChanged', _.bind(this.onDocumentPlaceChanged, this));
|
this.api.asc_registerCallback('asc_onDocumentPlaceChanged', _.bind(this.onDocumentPlaceChanged, this));
|
||||||
this.api.asc_registerCallback('asc_onDeleteComment', _.bind(this.onDeleteComment, this)); // only for PE, when del or ctrl+x pressed
|
this.api.asc_registerCallback('asc_onDeleteComment', _.bind(this.onDeleteComment, this)); // only for PE, when del or ctrl+x pressed
|
||||||
this.api.asc_registerCallback('asc_onChangeCommentLogicalPosition', _.bind(this.onApiChangeCommentLogicalPosition, this)); // change comments position in document
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -209,42 +204,6 @@ define([
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
|
|
||||||
setComparator: function(type) {
|
|
||||||
if (this.collection) {
|
|
||||||
var sort = (type !== undefined);
|
|
||||||
if (type === undefined) {
|
|
||||||
type = Common.localStorage.getItem(this.appPrefix + "comments-sort") || 'date-desc';
|
|
||||||
}
|
|
||||||
Common.localStorage.setItem(this.appPrefix + "comments-sort", type);
|
|
||||||
Common.Utils.InternalSettings.set(this.appPrefix + "comments-sort", type);
|
|
||||||
|
|
||||||
if (type=='position-asc' || type=='position-desc') {
|
|
||||||
var direction = (type=='position-asc') ? 1 : -1;
|
|
||||||
this.collection.comparator = function (collection) {
|
|
||||||
return direction * collection.get('position');
|
|
||||||
};
|
|
||||||
} else if (type=='author-asc' || type=='author-desc') {
|
|
||||||
var direction = (type=='author-asc') ? 1 : -1;
|
|
||||||
this.collection.comparator = function(item1, item2) {
|
|
||||||
var n1 = item1.get('parsedName').toLowerCase(),
|
|
||||||
n2 = item2.get('parsedName').toLowerCase();
|
|
||||||
if (n1==n2) return 0;
|
|
||||||
return (n1<n2) ? -direction : direction;
|
|
||||||
};
|
|
||||||
} else { // date
|
|
||||||
var direction = (type=='date-asc') ? 1 : -1;
|
|
||||||
this.collection.comparator = function (collection) {
|
|
||||||
return direction * collection.get('time');
|
|
||||||
};
|
|
||||||
}
|
|
||||||
sort && this.updateComments(true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getComparator: function() {
|
|
||||||
return Common.Utils.InternalSettings.get(this.appPrefix + "comments-sort") || 'date';
|
|
||||||
},
|
|
||||||
|
|
||||||
onCreateComment: function (panel, commentVal, editMode, hidereply, documentFlag) {
|
onCreateComment: function (panel, commentVal, editMode, hidereply, documentFlag) {
|
||||||
if (this.api && commentVal && commentVal.length > 0) {
|
if (this.api && commentVal && commentVal.length > 0) {
|
||||||
var comment = buildCommentData(); // new asc_CCommentData(null);
|
var comment = buildCommentData(); // new asc_CCommentData(null);
|
||||||
|
|
@ -697,15 +656,14 @@ define([
|
||||||
|
|
||||||
var end = true;
|
var end = true;
|
||||||
for (var i = this.collection.length - 1; i >= 0; --i) {
|
for (var i = this.collection.length - 1; i >= 0; --i) {
|
||||||
var item = this.collection.at(i);
|
if (end) {
|
||||||
if (end && !item.get('hide') && !item.get('filtered')) {
|
this.collection.at(i).set('last', true, {silent: true});
|
||||||
item.set('last', true, {silent: true});
|
|
||||||
end = false;
|
|
||||||
} else {
|
} else {
|
||||||
if (item.get('last')) {
|
if (this.collection.at(i).get('last')) {
|
||||||
item.set('last', false, {silent: true});
|
this.collection.at(i).set('last', false, {silent: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
end = false;
|
||||||
}
|
}
|
||||||
this.view.render();
|
this.view.render();
|
||||||
this.view.update();
|
this.view.update();
|
||||||
|
|
@ -735,7 +693,7 @@ define([
|
||||||
} else
|
} else
|
||||||
this.collection.push(comment);
|
this.collection.push(comment);
|
||||||
|
|
||||||
this.updateComments(true, this.getComparator() === 'position-asc' || this.getComparator() === 'position-desc'); // don't sort by position
|
this.updateComments(true);
|
||||||
|
|
||||||
if (this.showPopover) {
|
if (this.showPopover) {
|
||||||
if (null !== data.asc_getQuoteText()) {
|
if (null !== data.asc_getQuoteText()) {
|
||||||
|
|
@ -755,7 +713,7 @@ define([
|
||||||
comment.get('groupName') ? this.addCommentToGroupCollection(comment) : this.collection.push(comment);
|
comment.get('groupName') ? this.addCommentToGroupCollection(comment) : this.collection.push(comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateComments(true, this.getComparator() === 'position-asc' || this.getComparator() === 'position-desc');
|
this.updateComments(true);
|
||||||
},
|
},
|
||||||
onApiRemoveComment: function (id, silentUpdate) {
|
onApiRemoveComment: function (id, silentUpdate) {
|
||||||
for (var name in this.groupCollection) {
|
for (var name in this.groupCollection) {
|
||||||
|
|
@ -818,12 +776,9 @@ define([
|
||||||
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
|
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
|
||||||
|
|
||||||
var user = this.userCollection.findOriginalUser(data.asc_getUserId());
|
var user = this.userCollection.findOriginalUser(data.asc_getUserId());
|
||||||
var needSort = (this.getComparator() == 'author-asc' || this.getComparator() == 'author-desc') && (data.asc_getUserName() !== comment.get('username'));
|
|
||||||
comment.set('comment', data.asc_getText());
|
comment.set('comment', data.asc_getText());
|
||||||
comment.set('userid', data.asc_getUserId());
|
comment.set('userid', data.asc_getUserId());
|
||||||
comment.set('username', data.asc_getUserName());
|
comment.set('username', data.asc_getUserName());
|
||||||
comment.set('parsedName', AscCommon.UserInfoParser.getParsedName(data.asc_getUserName()));
|
|
||||||
comment.set('parsedGroups', AscCommon.UserInfoParser.getParsedGroups(data.asc_getUserName()));
|
|
||||||
comment.set('usercolor', (user) ? user.get('color') : null);
|
comment.set('usercolor', (user) ? user.get('color') : null);
|
||||||
comment.set('resolved', data.asc_getSolved());
|
comment.set('resolved', data.asc_getSolved());
|
||||||
comment.set('quote', data.asc_getQuoteText());
|
comment.set('quote', data.asc_getQuoteText());
|
||||||
|
|
@ -834,14 +789,6 @@ define([
|
||||||
comment.set('removable', (t.mode.canDeleteComments || (data.asc_getUserId() == t.currentUserId)) && AscCommon.UserInfoParser.canDeleteComment(data.asc_getUserName()));
|
comment.set('removable', (t.mode.canDeleteComments || (data.asc_getUserId() == t.currentUserId)) && AscCommon.UserInfoParser.canDeleteComment(data.asc_getUserName()));
|
||||||
comment.set('hide', !AscCommon.UserInfoParser.canViewComment(data.asc_getUserName()));
|
comment.set('hide', !AscCommon.UserInfoParser.canViewComment(data.asc_getUserName()));
|
||||||
|
|
||||||
if (!comment.get('hide')) {
|
|
||||||
var usergroups = comment.get('parsedGroups');
|
|
||||||
t.fillUserGroups(usergroups);
|
|
||||||
var group = Common.Utils.InternalSettings.get(t.appPrefix + "comments-filtergroups");
|
|
||||||
var filter = !!group && (group!==-1) && (!usergroups || usergroups.length<1 || usergroups.indexOf(group)<0);
|
|
||||||
comment.set('filtered', filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
replies = _.clone(comment.get('replys'));
|
replies = _.clone(comment.get('replys'));
|
||||||
|
|
||||||
replies.length = 0;
|
replies.length = 0;
|
||||||
|
|
@ -857,7 +804,6 @@ define([
|
||||||
id : Common.UI.getId(),
|
id : Common.UI.getId(),
|
||||||
userid : data.asc_getReply(i).asc_getUserId(),
|
userid : data.asc_getReply(i).asc_getUserId(),
|
||||||
username : data.asc_getReply(i).asc_getUserName(),
|
username : data.asc_getReply(i).asc_getUserName(),
|
||||||
parsedName : AscCommon.UserInfoParser.getParsedName(data.asc_getReply(i).asc_getUserName()),
|
|
||||||
usercolor : (user) ? user.get('color') : null,
|
usercolor : (user) ? user.get('color') : null,
|
||||||
date : t.dateToLocaleTimeString(dateReply),
|
date : t.dateToLocaleTimeString(dateReply),
|
||||||
reply : data.asc_getReply(i).asc_getText(),
|
reply : data.asc_getReply(i).asc_getText(),
|
||||||
|
|
@ -879,7 +825,7 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!silentUpdate) {
|
if (!silentUpdate) {
|
||||||
this.updateComments(needSort, !needSort);
|
this.updateComments(false, true);
|
||||||
|
|
||||||
// if (this.getPopover() && this.getPopover().isVisible()) {
|
// if (this.getPopover() && this.getPopover().isVisible()) {
|
||||||
// this._dontScrollToComment = true;
|
// this._dontScrollToComment = true;
|
||||||
|
|
@ -920,6 +866,8 @@ define([
|
||||||
// хотим показать тот же коментарий что был и выбран
|
// хотим показать тот же коментарий что был и выбран
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.mode && !this.mode.canComments)
|
||||||
|
hint = true;
|
||||||
|
|
||||||
var popover = this.getPopover();
|
var popover = this.getPopover();
|
||||||
if (popover) {
|
if (popover) {
|
||||||
|
|
@ -1117,28 +1065,17 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiChangeCommentLogicalPosition: function (comments) {
|
|
||||||
for (var uid in comments) {
|
|
||||||
if (comments.hasOwnProperty(uid)) {
|
|
||||||
var comment = this.findComment(uid) || this.findCommentInGroup(uid);
|
|
||||||
comment && comment.set('position', comments[uid]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(this.getComparator() === 'position-asc' || this.getComparator() === 'position-desc') && this.updateComments(true);
|
|
||||||
},
|
|
||||||
|
|
||||||
// internal
|
// internal
|
||||||
|
|
||||||
updateComments: function (needRender, disableSort, loadText) {
|
updateComments: function (needRender, disableSort, loadText) {
|
||||||
var me = this;
|
var me = this;
|
||||||
me.updateCommentsTime = new Date();
|
me.updateCommentsTime = new Date();
|
||||||
me.disableSort = !!disableSort;
|
|
||||||
if (me.timerUpdateComments===undefined)
|
if (me.timerUpdateComments===undefined)
|
||||||
me.timerUpdateComments = setInterval(function(){
|
me.timerUpdateComments = setInterval(function(){
|
||||||
if ((new Date()) - me.updateCommentsTime>100) {
|
if ((new Date()) - me.updateCommentsTime>100) {
|
||||||
clearInterval(me.timerUpdateComments);
|
clearInterval(me.timerUpdateComments);
|
||||||
me.timerUpdateComments = undefined;
|
me.timerUpdateComments = undefined;
|
||||||
me.updateCommentsView(needRender, me.disableSort, loadText);
|
me.updateCommentsView(needRender, disableSort, loadText);
|
||||||
}
|
}
|
||||||
}, 25);
|
}, 25);
|
||||||
},
|
},
|
||||||
|
|
@ -1152,7 +1089,7 @@ define([
|
||||||
|
|
||||||
var i, end = true;
|
var i, end = true;
|
||||||
|
|
||||||
if (!disableSort) {
|
if (_.isUndefined(disableSort)) {
|
||||||
this.collection.sort();
|
this.collection.sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1160,15 +1097,14 @@ define([
|
||||||
this.onUpdateFilter(this.filter, true);
|
this.onUpdateFilter(this.filter, true);
|
||||||
|
|
||||||
for (i = this.collection.length - 1; i >= 0; --i) {
|
for (i = this.collection.length - 1; i >= 0; --i) {
|
||||||
var item = this.collection.at(i);
|
if (end) {
|
||||||
if (end && !item.get('hide') && !item.get('filtered')) {
|
this.collection.at(i).set('last', true, {silent: true});
|
||||||
item.set('last', true, {silent: true});
|
|
||||||
end = false;
|
|
||||||
} else {
|
} else {
|
||||||
if (item.get('last')) {
|
if (this.collection.at(i).get('last')) {
|
||||||
item.set('last', false, {silent: true});
|
this.collection.at(i).set('last', false, {silent: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
end = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.view.render();
|
this.view.render();
|
||||||
|
|
@ -1249,8 +1185,7 @@ define([
|
||||||
renderTo : this.sdkViewName,
|
renderTo : this.sdkViewName,
|
||||||
canRequestUsers: (this.mode) ? this.mode.canRequestUsers : undefined,
|
canRequestUsers: (this.mode) ? this.mode.canRequestUsers : undefined,
|
||||||
canRequestSendNotify: (this.mode) ? this.mode.canRequestSendNotify : undefined,
|
canRequestSendNotify: (this.mode) ? this.mode.canRequestSendNotify : undefined,
|
||||||
mentionShare: (this.mode) ? this.mode.mentionShare : true,
|
mentionShare: (this.mode) ? this.mode.mentionShare : true
|
||||||
api: this.api
|
|
||||||
});
|
});
|
||||||
this.popover.setCommentsStore(this.popoverComments);
|
this.popover.setCommentsStore(this.popoverComments);
|
||||||
}
|
}
|
||||||
|
|
@ -1318,8 +1253,6 @@ define([
|
||||||
guid : data.asc_getGuid(),
|
guid : data.asc_getGuid(),
|
||||||
userid : data.asc_getUserId(),
|
userid : data.asc_getUserId(),
|
||||||
username : data.asc_getUserName(),
|
username : data.asc_getUserName(),
|
||||||
parsedName : AscCommon.UserInfoParser.getParsedName(data.asc_getUserName()),
|
|
||||||
parsedGroups : AscCommon.UserInfoParser.getParsedGroups(data.asc_getUserName()),
|
|
||||||
usercolor : (user) ? user.get('color') : null,
|
usercolor : (user) ? user.get('color') : null,
|
||||||
date : this.dateToLocaleTimeString(date),
|
date : this.dateToLocaleTimeString(date),
|
||||||
quote : data.asc_getQuoteText(),
|
quote : data.asc_getQuoteText(),
|
||||||
|
|
@ -1343,13 +1276,6 @@ define([
|
||||||
groupName : (groupname && groupname.length>1) ? groupname[1] : null
|
groupName : (groupname && groupname.length>1) ? groupname[1] : null
|
||||||
});
|
});
|
||||||
if (comment) {
|
if (comment) {
|
||||||
if (!comment.get('hide')) {
|
|
||||||
var usergroups = comment.get('parsedGroups');
|
|
||||||
this.fillUserGroups(usergroups);
|
|
||||||
var group = Common.Utils.InternalSettings.get(this.appPrefix + "comments-filtergroups");
|
|
||||||
var filter = !!group && (group!==-1) && (!usergroups || usergroups.length<1 || usergroups.indexOf(group)<0);
|
|
||||||
comment.set('filtered', filter);
|
|
||||||
}
|
|
||||||
var replies = this.readSDKReplies(data);
|
var replies = this.readSDKReplies(data);
|
||||||
if (replies.length) {
|
if (replies.length) {
|
||||||
comment.set('replys', replies);
|
comment.set('replys', replies);
|
||||||
|
|
@ -1373,7 +1299,6 @@ define([
|
||||||
id : Common.UI.getId(),
|
id : Common.UI.getId(),
|
||||||
userid : data.asc_getReply(i).asc_getUserId(),
|
userid : data.asc_getReply(i).asc_getUserId(),
|
||||||
username : data.asc_getReply(i).asc_getUserName(),
|
username : data.asc_getReply(i).asc_getUserName(),
|
||||||
parsedName : AscCommon.UserInfoParser.getParsedName(data.asc_getReply(i).asc_getUserName()),
|
|
||||||
usercolor : (user) ? user.get('color') : null,
|
usercolor : (user) ? user.get('color') : null,
|
||||||
date : this.dateToLocaleTimeString(date),
|
date : this.dateToLocaleTimeString(date),
|
||||||
reply : data.asc_getReply(i).asc_getText(),
|
reply : data.asc_getReply(i).asc_getText(),
|
||||||
|
|
@ -1415,7 +1340,6 @@ define([
|
||||||
date: this.dateToLocaleTimeString(date),
|
date: this.dateToLocaleTimeString(date),
|
||||||
userid: this.currentUserId,
|
userid: this.currentUserId,
|
||||||
username: AscCommon.UserInfoParser.getCurrentName(),
|
username: AscCommon.UserInfoParser.getCurrentName(),
|
||||||
parsedName: AscCommon.UserInfoParser.getParsedName(AscCommon.UserInfoParser.getCurrentName()),
|
|
||||||
usercolor: (user) ? user.get('color') : null,
|
usercolor: (user) ? user.get('color') : null,
|
||||||
editTextInPopover: true,
|
editTextInPopover: true,
|
||||||
showReplyInPopover: false,
|
showReplyInPopover: false,
|
||||||
|
|
@ -1660,64 +1584,6 @@ define([
|
||||||
clearCollections: function() {
|
clearCollections: function() {
|
||||||
this.collection.reset();
|
this.collection.reset();
|
||||||
this.groupCollection = [];
|
this.groupCollection = [];
|
||||||
},
|
|
||||||
|
|
||||||
fillUserGroups: function(usergroups) {
|
|
||||||
if (!this.mode.canUseCommentPermissions) return;
|
|
||||||
|
|
||||||
var viewgroups = AscCommon.UserInfoParser.getCommentPermissions('view');
|
|
||||||
if (usergroups && usergroups.length>0) {
|
|
||||||
if (viewgroups)
|
|
||||||
usergroups = _.intersection(usergroups, viewgroups);
|
|
||||||
usergroups = _.uniq(this.userGroups.concat(usergroups));
|
|
||||||
}
|
|
||||||
if (this.view && this.view.buttonSort && _.difference(usergroups, this.userGroups).length>0) {
|
|
||||||
this.userGroups = usergroups;
|
|
||||||
var menu = this.view.buttonSort.menu;
|
|
||||||
menu.items[menu.items.length-1].setVisible(this.userGroups.length>0);
|
|
||||||
menu.items[menu.items.length-2].setVisible(this.userGroups.length>0);
|
|
||||||
menu = menu.items[menu.items.length-1].menu;
|
|
||||||
menu.removeAll();
|
|
||||||
|
|
||||||
var last = Common.Utils.InternalSettings.get(this.appPrefix + "comments-filtergroups");
|
|
||||||
menu.addItem(new Common.UI.MenuItem({
|
|
||||||
checkable: true,
|
|
||||||
checked: last===-1 || last===undefined,
|
|
||||||
toggleGroup: 'filtercomments',
|
|
||||||
caption: this.view.textAll,
|
|
||||||
value: -1
|
|
||||||
}));
|
|
||||||
this.userGroups.forEach(function(item){
|
|
||||||
menu.addItem(new Common.UI.MenuItem({
|
|
||||||
checkable: true,
|
|
||||||
checked: last === item,
|
|
||||||
toggleGroup: 'filtercomments',
|
|
||||||
caption: Common.Utils.String.htmlEncode(item),
|
|
||||||
value: item
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setFilterGroups: function (group) {
|
|
||||||
Common.Utils.InternalSettings.set(this.appPrefix + "comments-filtergroups", group);
|
|
||||||
var i, end = true;
|
|
||||||
for (i = this.collection.length - 1; i >= 0; --i) {
|
|
||||||
var item = this.collection.at(i);
|
|
||||||
if (!item.get('hide')) {
|
|
||||||
var usergroups = item.get('parsedGroups');
|
|
||||||
item.set('filtered', !!group && (group!==-1) && (!usergroups || usergroups.length<1 || usergroups.indexOf(group)<0), {silent: true});
|
|
||||||
}
|
|
||||||
if (end && !item.get('hide') && !item.get('filtered')) {
|
|
||||||
item.set('last', true, {silent: true});
|
|
||||||
end = false;
|
|
||||||
} else {
|
|
||||||
if (item.get('last')) {
|
|
||||||
item.set('last', false, {silent: true});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.updateComments(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, Common.Controllers.Comments || {}));
|
}, Common.Controllers.Comments || {}));
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,7 @@ define([
|
||||||
version: '{{PRODUCT_VERSION}}',
|
version: '{{PRODUCT_VERSION}}',
|
||||||
eventloading: true,
|
eventloading: true,
|
||||||
titlebuttons: true,
|
titlebuttons: true,
|
||||||
uithemes: true,
|
uithemes: true
|
||||||
quickprint: true,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var native = window.desktop || window.AscDesktopEditor;
|
var native = window.desktop || window.AscDesktopEditor;
|
||||||
|
|
@ -61,12 +60,8 @@ define([
|
||||||
'btn-save-coauth': 'coauth',
|
'btn-save-coauth': 'coauth',
|
||||||
'btn-synch': 'synch' };
|
'btn-synch': 'synch' };
|
||||||
|
|
||||||
var nativevars;
|
|
||||||
|
|
||||||
if ( !!native ) {
|
if ( !!native ) {
|
||||||
native.features = native.features || {};
|
|
||||||
nativevars = window.RendererProcessVariable;
|
|
||||||
|
|
||||||
window.on_native_message = function (cmd, param) {
|
window.on_native_message = function (cmd, param) {
|
||||||
if (/^style:change/.test(cmd)) {
|
if (/^style:change/.test(cmd)) {
|
||||||
var obj = JSON.parse(param);
|
var obj = JSON.parse(param);
|
||||||
|
|
@ -93,12 +88,7 @@ define([
|
||||||
Common.Utils.InternalSettings.set('window-inactive-area-top', obj.skiptoparea);
|
Common.Utils.InternalSettings.set('window-inactive-area-top', obj.skiptoparea);
|
||||||
} else
|
} else
|
||||||
if ( obj.lockthemes != undefined ) {
|
if ( obj.lockthemes != undefined ) {
|
||||||
// TODO: remove after 7.0.2. depricated. used is_win_xp variable instead
|
Common.UI.Themes.setAvailable(!obj.lockthemes);
|
||||||
// Common.UI.Themes.setAvailable(!obj.lockthemes);
|
|
||||||
}
|
|
||||||
if ( obj.singlewindow !== undefined ) {
|
|
||||||
$('#box-document-title .hedset')[obj.singlewindow ? 'hide' : 'show']();
|
|
||||||
native.features.singlewindow = obj.singlewindow;
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if (/editor:config/.test(cmd)) {
|
if (/editor:config/.test(cmd)) {
|
||||||
|
|
@ -140,10 +130,6 @@ define([
|
||||||
if (!!_mr[1]) $('#app-title').show();
|
if (!!_mr[1]) $('#app-title').show();
|
||||||
else if (!!_mr[2]) $('#app-title').hide();
|
else if (!!_mr[2]) $('#app-title').hide();
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
if (/althints:show/.test(cmd)) {
|
|
||||||
if ( /false|hide/.test(param) )
|
|
||||||
Common.NotificationCenter.trigger('hints:clear');
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -167,8 +153,7 @@ define([
|
||||||
action: action,
|
action: action,
|
||||||
icon: config.icon || undefined,
|
icon: config.icon || undefined,
|
||||||
hint: config.btn.options.hint,
|
hint: config.btn.options.hint,
|
||||||
disabled: config.btn.isDisabled(),
|
disabled: config.btn.isDisabled()
|
||||||
visible: config.visible,
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -195,56 +180,11 @@ define([
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var _onHintsShow = function (visible, level) {
|
|
||||||
let info = {
|
|
||||||
visible: visible && !(level > 0),
|
|
||||||
};
|
|
||||||
|
|
||||||
if ( !!titlebuttons ) {
|
|
||||||
info.hints = {};
|
|
||||||
!!titlebuttons['print'] && (info.hints['print'] = titlebuttons['print'].btn.btnEl.attr('data-hint-title'));
|
|
||||||
!!titlebuttons['quickprint'] && (info.hints['quickprint'] = titlebuttons['quickprint'].btn.btnEl.attr('data-hint-title'));
|
|
||||||
!!titlebuttons['undo'] && (info.hints['undo'] = titlebuttons['undo'].btn.btnEl.attr('data-hint-title'));
|
|
||||||
!!titlebuttons['redo'] && (info.hints['redo'] = titlebuttons['redo'].btn.btnEl.attr('data-hint-title'));
|
|
||||||
!!titlebuttons['save'] && (info.hints['save'] = titlebuttons['save'].btn.btnEl.attr('data-hint-title'));
|
|
||||||
}
|
|
||||||
|
|
||||||
native.execCommand('althints:show', JSON.stringify(info));
|
|
||||||
}
|
|
||||||
|
|
||||||
var _onKeyDown = function (e) {
|
|
||||||
if ( Common.UI.HintManager.isHintVisible() ) {
|
|
||||||
native.execCommand('althints:keydown', JSON.stringify({code:e.keyCode}));
|
|
||||||
console.log('hint keydown', e.keyCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const _onApplySettings = function (menu) {
|
|
||||||
if ( !!titlebuttons.quickprint ) {
|
|
||||||
const var_name = window.SSE ? 'sse-settings-quick-print-button' :
|
|
||||||
window.PE ? 'pe-settings-quick-print-button' : 'de-settings-quick-print-button';
|
|
||||||
const is_btn_visible = Common.localStorage.getBool(var_name, false);
|
|
||||||
|
|
||||||
if ( titlebuttons.quickprint.visible != is_btn_visible ) {
|
|
||||||
titlebuttons.quickprint.visible = is_btn_visible;
|
|
||||||
const obj = {
|
|
||||||
visible: {
|
|
||||||
quickprint: is_btn_visible,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
native.execCommand('title:button', JSON.stringify(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init: function (opts) {
|
init: function (opts) {
|
||||||
_.extend(config, opts);
|
_.extend(config, opts);
|
||||||
|
|
||||||
if ( config.isDesktopApp ) {
|
if ( config.isDesktopApp ) {
|
||||||
let is_win_xp = nativevars && nativevars.os === 'winxp';
|
|
||||||
|
|
||||||
Common.UI.Themes.setAvailable(!is_win_xp);
|
|
||||||
Common.NotificationCenter.on('app:ready', function (opts) {
|
Common.NotificationCenter.on('app:ready', function (opts) {
|
||||||
_.extend(config, opts);
|
_.extend(config, opts);
|
||||||
!!native && native.execCommand('doc:onready', '');
|
!!native && native.execCommand('doc:onready', '');
|
||||||
|
|
@ -254,45 +194,9 @@ define([
|
||||||
|
|
||||||
Common.NotificationCenter.on('document:ready', function () {
|
Common.NotificationCenter.on('document:ready', function () {
|
||||||
if ( config.isEdit ) {
|
if ( config.isEdit ) {
|
||||||
function get_locked_message (t) {
|
var maincontroller = webapp.getController('Main');
|
||||||
switch (t) {
|
if (maincontroller.api.asc_isReadOnly && maincontroller.api.asc_isReadOnly()) {
|
||||||
// case Asc.c_oAscLocalRestrictionType.Nosafe:
|
maincontroller.warningDocumentIsLocked();
|
||||||
case Asc.c_oAscLocalRestrictionType.ReadOnly:
|
|
||||||
return Common.Locale.get("tipFileReadOnly",{name:"Common.Translation", default: "Document is read only. You can make changes and save its local copy later."});
|
|
||||||
default: return Common.Locale.get("tipFileLocked",{name:"Common.Translation", default: "Document is locked for editing. You can make changes and save its local copy later."});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const header = webapp.getController('Viewport').getView('Common.Views.Header');
|
|
||||||
const api = webapp.getController('Main').api;
|
|
||||||
const locktype = api.asc_getLocalRestrictions ? api.asc_getLocalRestrictions() : Asc.c_oAscLocalRestrictionType.None;
|
|
||||||
if ( Asc.c_oAscLocalRestrictionType.None !== locktype ) {
|
|
||||||
features.readonly = true;
|
|
||||||
|
|
||||||
header.setDocumentReadOnly(true);
|
|
||||||
api.asc_setLocalRestrictions(Asc.c_oAscLocalRestrictionType.None);
|
|
||||||
|
|
||||||
(new Common.UI.SynchronizeTip({
|
|
||||||
extCls: 'no-arrow',
|
|
||||||
placement: 'bottom',
|
|
||||||
target: $('.toolbar'),
|
|
||||||
text: get_locked_message(locktype),
|
|
||||||
showLink: false,
|
|
||||||
})).on('closeclick', function () {
|
|
||||||
this.close();
|
|
||||||
}).show();
|
|
||||||
|
|
||||||
native.execCommand('webapps:features', JSON.stringify(features));
|
|
||||||
|
|
||||||
api.asc_registerCallback('asc_onDocumentName', function () {
|
|
||||||
if ( features.readonly ) {
|
|
||||||
if ( api.asc_getLocalRestrictions() == Asc.c_oAscLocalRestrictionType.None ) {
|
|
||||||
features.readonly = false;
|
|
||||||
header.setDocumentReadOnly(false);
|
|
||||||
native.execCommand('webapps:features', JSON.stringify(features));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -304,7 +208,7 @@ define([
|
||||||
|
|
||||||
titlebuttons = {};
|
titlebuttons = {};
|
||||||
if ( mode.isEdit ) {
|
if ( mode.isEdit ) {
|
||||||
const header = webapp.getController('Viewport').getView('Common.Views.Header');
|
var header = webapp.getController('Viewport').getView('Common.Views.Header');
|
||||||
if (!!header.btnSave) {
|
if (!!header.btnSave) {
|
||||||
titlebuttons['save'] = {btn: header.btnSave};
|
titlebuttons['save'] = {btn: header.btnSave};
|
||||||
|
|
||||||
|
|
@ -315,13 +219,6 @@ define([
|
||||||
if (!!header.btnPrint)
|
if (!!header.btnPrint)
|
||||||
titlebuttons['print'] = {btn: header.btnPrint};
|
titlebuttons['print'] = {btn: header.btnPrint};
|
||||||
|
|
||||||
if (!!header.btnPrintQuick) {
|
|
||||||
titlebuttons['quickprint'] = {
|
|
||||||
btn: header.btnPrintQuick,
|
|
||||||
visible: header.btnPrintQuick.isVisible(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!!header.btnUndo)
|
if (!!header.btnUndo)
|
||||||
titlebuttons['undo'] = {btn: header.btnUndo};
|
titlebuttons['undo'] = {btn: header.btnUndo};
|
||||||
|
|
||||||
|
|
@ -343,45 +240,17 @@ define([
|
||||||
config.callback_editorconfig();
|
config.callback_editorconfig();
|
||||||
delete config.callback_editorconfig;
|
delete config.callback_editorconfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( native.features.singlewindow !== undefined ) {
|
|
||||||
$('#box-document-title .hedset')[native.features.singlewindow ? 'hide' : 'show']();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Common.NotificationCenter.on({
|
Common.NotificationCenter.on({
|
||||||
'modal:show': _onModalDialog.bind(this, 'open'),
|
'modal:show': _onModalDialog.bind(this, 'open'),
|
||||||
'modal:close': _onModalDialog.bind(this, 'close'),
|
'modal:close': _onModalDialog.bind(this, 'close')
|
||||||
'modal:hide': _onModalDialog.bind(this, 'hide'),
|
, 'uitheme:changed' : function (name) {
|
||||||
'uitheme:changed' : function (name) {
|
var theme = Common.UI.Themes.get(name);
|
||||||
if (Common.localStorage.getBool('ui-theme-use-system', false)) {
|
if ( theme )
|
||||||
native.execCommand("uitheme:changed", JSON.stringify({name:'theme-system'}));
|
native.execCommand("uitheme:changed", JSON.stringify({name:name, type:theme.type}));
|
||||||
} else {
|
}
|
||||||
var theme = Common.UI.Themes.get(name);
|
|
||||||
if ( theme )
|
|
||||||
native.execCommand("uitheme:changed", JSON.stringify({name:name, type:theme.type}));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'hints:show': _onHintsShow.bind(this),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
webapp.addListeners({
|
|
||||||
'FileMenu': {
|
|
||||||
'item:click': function (menu, action, isopts) {
|
|
||||||
if ( action == 'file:exit' ) {
|
|
||||||
native.execCommand('editor:event', JSON.stringify({action: 'file:close'}));
|
|
||||||
menu.hide();
|
|
||||||
} else
|
|
||||||
if ( action == 'file:open' ) {
|
|
||||||
native.execCommand('editor:event', JSON.stringify({action: 'file:open'}));
|
|
||||||
menu.hide();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'settings:apply': _onApplySettings.bind(this),
|
|
||||||
},
|
|
||||||
}, {id: 'desktop'});
|
|
||||||
|
|
||||||
$(document).on('keydown', _onKeyDown.bind(this));
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
process: function (opts) {
|
process: function (opts) {
|
||||||
|
|
@ -407,38 +276,9 @@ define([
|
||||||
},
|
},
|
||||||
requestClose: function () {
|
requestClose: function () {
|
||||||
if ( config.isDesktopApp && !!native ) {
|
if ( config.isDesktopApp && !!native ) {
|
||||||
native.execCommand('editor:event', JSON.stringify({action:'file:close', url: config.customization.goback.url}));
|
native.execCommand('editor:event', JSON.stringify({action:'close', url: config.customization.goback.url}));
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
isActive: function () {
|
|
||||||
return !!native;
|
|
||||||
},
|
|
||||||
isOffline: function () {
|
|
||||||
// return webapp.getController('Main').api.asc_isOffline();
|
|
||||||
return webapp.getController('Main').appOptions.isOffline;
|
|
||||||
},
|
|
||||||
isFeatureAvailable: function (feature) {
|
|
||||||
return !!native && !!native[feature];
|
|
||||||
},
|
|
||||||
call: function (name) {
|
|
||||||
if ( native[name] ) {
|
|
||||||
let args = [].slice.call(arguments, 1);
|
|
||||||
// return native[name](...args);
|
|
||||||
return native[name].apply(this, args);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
helpUrl: function () {
|
|
||||||
if ( !!nativevars && nativevars.helpUrl ) {
|
|
||||||
var webapp = window.SSE ? 'spreadsheeteditor' :
|
|
||||||
window.PE ? 'presentationeditor' : 'documenteditor';
|
|
||||||
return nativevars.helpUrl + '/' + webapp + '/main/resources/help';
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
},
|
|
||||||
getDefaultPrinterName: function () {
|
|
||||||
return nativevars ? nativevars.defaultPrinterName : '';
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,6 @@ define([
|
||||||
setApi: function(api) {
|
setApi: function(api) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.api.asc_registerCallback('asc_onCloseChartEditor', _.bind(this.onDiagrammEditingDisabled, this));
|
this.api.asc_registerCallback('asc_onCloseChartEditor', _.bind(this.onDiagrammEditingDisabled, this));
|
||||||
this.api.asc_registerCallback('asc_sendFromGeneralToFrameEditor', _.bind(this.onSendFromGeneralToFrameEditor, this));
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -186,7 +185,7 @@ define([
|
||||||
iconCls: 'warn',
|
iconCls: 'warn',
|
||||||
buttons: ['ok'],
|
buttons: ['ok'],
|
||||||
callback: _.bind(function(btn){
|
callback: _.bind(function(btn){
|
||||||
this.diagramEditorView.setControlsDisabled(false);
|
this.setControlsDisabled(false);
|
||||||
this.diagramEditorView.hide();
|
this.diagramEditorView.hide();
|
||||||
}, this)
|
}, this)
|
||||||
});
|
});
|
||||||
|
|
@ -233,9 +232,6 @@ define([
|
||||||
y = parseInt(this.diagramEditorView.$window.css('top')) + eventData.data.pagey + 34;
|
y = parseInt(this.diagramEditorView.$window.css('top')) + eventData.data.pagey + 34;
|
||||||
this.diagramEditorView.binding.drag({pageX:x, pageY:y});
|
this.diagramEditorView.binding.drag({pageX:x, pageY:y});
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
if (eventData.type == "frameToGeneralData") {
|
|
||||||
this.api && this.api.asc_getInformationBetweenFrameAndGeneralEditor(eventData.data);
|
|
||||||
} else
|
} else
|
||||||
this.diagramEditorView.fireEvent('internalmessage', this.diagramEditorView, eventData);
|
this.diagramEditorView.fireEvent('internalmessage', this.diagramEditorView, eventData);
|
||||||
}
|
}
|
||||||
|
|
@ -247,8 +243,13 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onSendFromGeneralToFrameEditor: function(data) {
|
showExternalEditor: function () {
|
||||||
externalEditor && externalEditor.serviceCommand('generalToFrameData', data);
|
if ( externalEditor ) {
|
||||||
|
var value = Common.localStorage.getItem("ui-theme-id", "theme-light");
|
||||||
|
externalEditor.serviceCommand('theme:change', value);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.diagramEditorView.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
warningTitle: 'Warning',
|
warningTitle: 'Warning',
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,6 @@ define([
|
||||||
setApi: function(api) {
|
setApi: function(api) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.api.asc_registerCallback('asc_onCloseMergeEditor', _.bind(this.onMergeEditingDisabled, this));
|
this.api.asc_registerCallback('asc_onCloseMergeEditor', _.bind(this.onMergeEditingDisabled, this));
|
||||||
this.api.asc_registerCallback('asc_sendFromGeneralToFrameEditor', _.bind(this.onSendFromGeneralToFrameEditor, this));
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -171,7 +170,7 @@ define([
|
||||||
iconCls: 'warn',
|
iconCls: 'warn',
|
||||||
buttons: ['ok'],
|
buttons: ['ok'],
|
||||||
callback: _.bind(function(btn){
|
callback: _.bind(function(btn){
|
||||||
this.mergeEditorView.setControlsDisabled(false);
|
this.setControlsDisabled(false);
|
||||||
this.mergeEditorView.hide();
|
this.mergeEditorView.hide();
|
||||||
}, this)
|
}, this)
|
||||||
});
|
});
|
||||||
|
|
@ -217,9 +216,6 @@ define([
|
||||||
y = parseInt(this.mergeEditorView.$window.css('top')) + eventData.data.pagey + 34;
|
y = parseInt(this.mergeEditorView.$window.css('top')) + eventData.data.pagey + 34;
|
||||||
this.mergeEditorView.binding.drag({pageX:x, pageY:y});
|
this.mergeEditorView.binding.drag({pageX:x, pageY:y});
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
if (eventData.type == "frameToGeneralData") {
|
|
||||||
this.api && this.api.asc_getInformationBetweenFrameAndGeneralEditor(eventData.data);
|
|
||||||
} else
|
} else
|
||||||
this.mergeEditorView.fireEvent('internalmessage', this.mergeEditorView, eventData);
|
this.mergeEditorView.fireEvent('internalmessage', this.mergeEditorView, eventData);
|
||||||
}
|
}
|
||||||
|
|
@ -231,10 +227,6 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onSendFromGeneralToFrameEditor: function(data) {
|
|
||||||
externalEditor && externalEditor.serviceCommand('generalToFrameData', data);
|
|
||||||
},
|
|
||||||
|
|
||||||
warningTitle: 'Warning',
|
warningTitle: 'Warning',
|
||||||
warningText: 'The object is disabled because of editing by another user.',
|
warningText: 'The object is disabled because of editing by another user.',
|
||||||
textClose: 'Close',
|
textClose: 'Close',
|
||||||
|
|
|
||||||
|
|
@ -1,261 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* (c) Copyright Ascensio System SIA 2010-2022
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* ExternalOleEditor.js
|
|
||||||
*
|
|
||||||
* Created by Julia Radzhabova on 3/10/22
|
|
||||||
* Copyright (c) 2022 Ascensio System SIA. All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (Common === undefined)
|
|
||||||
var Common = {};
|
|
||||||
|
|
||||||
Common.Controllers = Common.Controllers || {};
|
|
||||||
|
|
||||||
define([
|
|
||||||
'core',
|
|
||||||
'common/main/lib/view/ExternalOleEditor'
|
|
||||||
], function () { 'use strict';
|
|
||||||
Common.Controllers.ExternalOleEditor = Backbone.Controller.extend(_.extend((function() {
|
|
||||||
var appLang = '{{DEFAULT_LANG}}',
|
|
||||||
customization = undefined,
|
|
||||||
targetApp = '',
|
|
||||||
externalEditor = null,
|
|
||||||
isAppFirstOpened = true;
|
|
||||||
|
|
||||||
|
|
||||||
var createExternalEditor = function() {
|
|
||||||
!!customization && (customization.uiTheme = Common.localStorage.getItem("ui-theme-id", "theme-light"));
|
|
||||||
externalEditor = new DocsAPI.DocEditor('id-ole-editor-placeholder', {
|
|
||||||
width : '100%',
|
|
||||||
height : '100%',
|
|
||||||
documentType: 'cell',
|
|
||||||
document : {
|
|
||||||
url : '_chart_',
|
|
||||||
permissions : {
|
|
||||||
edit : true,
|
|
||||||
download: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
editorConfig: {
|
|
||||||
mode : 'editole',
|
|
||||||
targetApp : targetApp,
|
|
||||||
lang : appLang,
|
|
||||||
canCoAuthoring : false,
|
|
||||||
canBackToFolder : false,
|
|
||||||
canCreateNew : false,
|
|
||||||
customization : customization,
|
|
||||||
user : {id: ('uid-'+Date.now())}
|
|
||||||
},
|
|
||||||
events: {
|
|
||||||
'onAppReady' : function() {},
|
|
||||||
'onDocumentStateChange' : function() {},
|
|
||||||
'onError' : function() {},
|
|
||||||
'onInternalMessage' : _.bind(this.onInternalMessage, this)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Common.Gateway.on('processmouse', _.bind(this.onProcessMouse, this));
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
views: ['Common.Views.ExternalOleEditor'],
|
|
||||||
|
|
||||||
initialize: function() {
|
|
||||||
this.addListeners({
|
|
||||||
'Common.Views.ExternalOleEditor': {
|
|
||||||
'setoledata': _.bind(this.setOleData, this),
|
|
||||||
'drag': _.bind(function(o, state){
|
|
||||||
externalEditor && externalEditor.serviceCommand('window:drag', state == 'start');
|
|
||||||
},this),
|
|
||||||
'show': _.bind(function(cmp){
|
|
||||||
var h = this.oleEditorView.getHeight(),
|
|
||||||
innerHeight = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top');
|
|
||||||
if (innerHeight>h && h<700 || innerHeight<h) {
|
|
||||||
h = Math.min(innerHeight, 700);
|
|
||||||
this.oleEditorView.setHeight(h);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (externalEditor) {
|
|
||||||
externalEditor.serviceCommand('setAppDisabled',false);
|
|
||||||
if (isAppFirstOpened && this.oleEditorView._isExternalDocReady) {
|
|
||||||
isAppFirstOpened = false;
|
|
||||||
this.oleEditorView._oleData && this.setOleData();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.needDisableEditing && this.oleEditorView._isExternalDocReady) {
|
|
||||||
this.onOleEditingDisabled();
|
|
||||||
}
|
|
||||||
externalEditor.attachMouseEvents();
|
|
||||||
} else {
|
|
||||||
createExternalEditor.apply(this);
|
|
||||||
}
|
|
||||||
this.isExternalEditorVisible = true;
|
|
||||||
this.isHandlerCalled = false;
|
|
||||||
}, this),
|
|
||||||
'hide': _.bind(function(cmp){
|
|
||||||
if (externalEditor) {
|
|
||||||
externalEditor.detachMouseEvents();
|
|
||||||
this.isExternalEditorVisible = false;
|
|
||||||
}
|
|
||||||
}, this)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
onLaunch: function() {
|
|
||||||
this.oleEditorView = this.createView('Common.Views.ExternalOleEditor', {handler: _.bind(this.handler, this)});
|
|
||||||
},
|
|
||||||
|
|
||||||
setApi: function(api) {
|
|
||||||
this.api = api;
|
|
||||||
this.api.asc_registerCallback('asc_onCloseOleEditor', _.bind(this.onOleEditingDisabled, this));
|
|
||||||
this.api.asc_registerCallback('asc_sendFromGeneralToFrameEditor', _.bind(this.onSendFromGeneralToFrameEditor, this));
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
|
|
||||||
handler: function(result, value) {
|
|
||||||
if (this.isHandlerCalled) return;
|
|
||||||
this.isHandlerCalled = true;
|
|
||||||
if (this.oleEditorView._isExternalDocReady)
|
|
||||||
externalEditor && externalEditor.serviceCommand('queryClose',{mr:result});
|
|
||||||
else {
|
|
||||||
this.oleEditorView.hide();
|
|
||||||
this.isHandlerCalled = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setOleData: function() {
|
|
||||||
if (!isAppFirstOpened) {
|
|
||||||
externalEditor && externalEditor.serviceCommand('setOleData', this.oleEditorView._oleData);
|
|
||||||
this.oleEditorView._oleData = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
loadConfig: function(data) {
|
|
||||||
if (data && data.config) {
|
|
||||||
if (data.config.lang) appLang = data.config.lang;
|
|
||||||
if (data.config.customization) customization = data.config.customization;
|
|
||||||
if (data.config.targetApp) targetApp = data.config.targetApp;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onOleEditingDisabled: function() {
|
|
||||||
if ( !this.oleEditorView.isVisible() || !this.oleEditorView._isExternalDocReady ) {
|
|
||||||
this.needDisableEditing = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.oleEditorView.setControlsDisabled(true);
|
|
||||||
|
|
||||||
Common.UI.alert({
|
|
||||||
title: this.warningTitle,
|
|
||||||
msg : this.warningText,
|
|
||||||
iconCls: 'warn',
|
|
||||||
buttons: ['ok'],
|
|
||||||
callback: _.bind(function(btn){
|
|
||||||
this.oleEditorView.setControlsDisabled(false);
|
|
||||||
this.oleEditorView.hide();
|
|
||||||
}, this)
|
|
||||||
});
|
|
||||||
|
|
||||||
this.needDisableEditing = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
onInternalMessage: function(data) {
|
|
||||||
var eventData = data.data;
|
|
||||||
|
|
||||||
if (this.oleEditorView) {
|
|
||||||
if (eventData.type == 'documentReady') {
|
|
||||||
this.oleEditorView._isExternalDocReady = true;
|
|
||||||
this.isExternalEditorVisible && (isAppFirstOpened = false);
|
|
||||||
this.oleEditorView._oleData && this.setOleData();
|
|
||||||
if (this.needDisableEditing) {
|
|
||||||
this.onOleEditingDisabled();
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
if (eventData.type == 'oleEditorReady') {
|
|
||||||
if (this.needDisableEditing===undefined)
|
|
||||||
this.oleEditorView.setControlsDisabled(false);
|
|
||||||
} else
|
|
||||||
if (eventData.type == "shortcut") {
|
|
||||||
if (eventData.data.key == 'escape')
|
|
||||||
this.oleEditorView.hide();
|
|
||||||
} else
|
|
||||||
if (eventData.type == "canClose") {
|
|
||||||
if (eventData.data.answer === true) {
|
|
||||||
if (externalEditor) {
|
|
||||||
externalEditor.serviceCommand('setAppDisabled',true);
|
|
||||||
if (eventData.data.mr == 'ok')
|
|
||||||
externalEditor.serviceCommand('getOleData');
|
|
||||||
}
|
|
||||||
this.oleEditorView.hide();
|
|
||||||
}
|
|
||||||
this.isHandlerCalled = false;
|
|
||||||
} else
|
|
||||||
if (eventData.type == "processMouse") {
|
|
||||||
if (eventData.data.event == 'mouse:up') {
|
|
||||||
this.oleEditorView.binding.dragStop();
|
|
||||||
} else
|
|
||||||
if (eventData.data.event == 'mouse:move') {
|
|
||||||
var x = parseInt(this.oleEditorView.$window.css('left')) + eventData.data.pagex,
|
|
||||||
y = parseInt(this.oleEditorView.$window.css('top')) + eventData.data.pagey + 34;
|
|
||||||
this.oleEditorView.binding.drag({pageX:x, pageY:y});
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
if (eventData.type == "frameToGeneralData") {
|
|
||||||
this.api && this.api.asc_getInformationBetweenFrameAndGeneralEditor(eventData.data);
|
|
||||||
} else
|
|
||||||
this.oleEditorView.fireEvent('internalmessage', this.oleEditorView, eventData);
|
|
||||||
}
|
|
||||||
} ,
|
|
||||||
|
|
||||||
onProcessMouse: function(data) {
|
|
||||||
if (data.type == 'mouseup' && this.isExternalEditorVisible) {
|
|
||||||
externalEditor && externalEditor.serviceCommand('processmouse', data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onSendFromGeneralToFrameEditor: function(data) {
|
|
||||||
externalEditor && externalEditor.serviceCommand('generalToFrameData', data);
|
|
||||||
},
|
|
||||||
|
|
||||||
warningTitle: 'Warning',
|
|
||||||
warningText: 'The object is disabled because of editing by another user.',
|
|
||||||
textClose: 'Close',
|
|
||||||
textAnonymous: 'Anonymous'
|
|
||||||
}
|
|
||||||
})(), Common.Controllers.ExternalOleEditor || {}));
|
|
||||||
});
|
|
||||||
|
|
@ -120,7 +120,11 @@ define([
|
||||||
});
|
});
|
||||||
|
|
||||||
var store = this.getCollection('Common.Collections.Fonts');
|
var store = this.getCollection('Common.Collections.Fonts');
|
||||||
store && store.add(fontsArray);
|
|
||||||
|
if (store) {
|
||||||
|
store.add(fontsArray);
|
||||||
|
store.sort();
|
||||||
|
}
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('fonts:load', store, select);
|
Common.NotificationCenter.trigger('fonts:load', store, select);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,704 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* (c) Copyright Ascensio System SIA 2010-2021
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* HintManager.js
|
|
||||||
*
|
|
||||||
* Created by Julia Radzhabova on 21.04.2021
|
|
||||||
* Copyright (c) 2021 Ascensio System SIA. All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example usage with simple items:
|
|
||||||
*
|
|
||||||
* <button ... data-hint="1" data-hint-direction="right" data-hint-offset="big" data-hint-title="B">...</button>
|
|
||||||
* <label ... data-hint="1" data-hint-direction="bottom" data-hint-offset="medium" data-hint-title="L">...</label>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Example usage with components:
|
|
||||||
*
|
|
||||||
* new Common.UI.Button({
|
|
||||||
* ...
|
|
||||||
* dataHint: '1', // '0' - tabs in toolbar, left and right menu, statusbar;
|
|
||||||
* // '1' - file menu, contents of toolbar tabs, contents of right and left panels
|
|
||||||
* dataHintDirection: 'bottom', // top, bottom, right, left, left-top
|
|
||||||
* dataHintOffset: 'small', // big - 6px, medium - 4px, small - 2px
|
|
||||||
* dataHintTitle : 'S'
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* new Common.UI.CheckBox({
|
|
||||||
* ...
|
|
||||||
* dataHint: '1',
|
|
||||||
* dataHintDirection: 'left',
|
|
||||||
* dataHintOffset: 'small'
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* new Common.UI.ComboBox({
|
|
||||||
* ...
|
|
||||||
* dataHint: '1',
|
|
||||||
* dataHintDirection: 'bottom',
|
|
||||||
* dataHintOffset: 'big'
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* new Common.UI.InputField({
|
|
||||||
* ...
|
|
||||||
* dataHint: '1',
|
|
||||||
* dataHintDirection: 'left',
|
|
||||||
* dataHintOffset: 'small'
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* new Common.UI.MetricSpinner({
|
|
||||||
* ...
|
|
||||||
* dataHint: '1',
|
|
||||||
* dataHintDirection: 'bottom',
|
|
||||||
* dataHintOffset: 'big'
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* new Common.UI.RadioBox({
|
|
||||||
* ...
|
|
||||||
* dataHint: '1',
|
|
||||||
* dataHintDirection: 'left',
|
|
||||||
* dataHintOffset: 'small'
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
if (Common === undefined)
|
|
||||||
var Common = {};
|
|
||||||
|
|
||||||
if (Common.UI === undefined) {
|
|
||||||
Common.UI = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
Common.UI.HintManager = new(function() {
|
|
||||||
var _lang = 'en',
|
|
||||||
_arrAlphabet = [],
|
|
||||||
_arrEnAlphabet = [],
|
|
||||||
_arrQwerty = [],
|
|
||||||
_arrEnQwerty = [],
|
|
||||||
_needShow = false,
|
|
||||||
_hintVisible = false,
|
|
||||||
_currentLevel = 0,
|
|
||||||
_currentSection = document,
|
|
||||||
_currentControls = [],
|
|
||||||
_currentHints = [],
|
|
||||||
_inputLetters = '',
|
|
||||||
_isComplete = false,
|
|
||||||
_isLockedKeyEvents = false,
|
|
||||||
_inputTimer,
|
|
||||||
_isDocReady = false,
|
|
||||||
_isEditDiagram = false,
|
|
||||||
_usedTitles = [],
|
|
||||||
_appPrefix,
|
|
||||||
_staticHints = { // for desktop buttons
|
|
||||||
"btnhome": 'K'
|
|
||||||
};
|
|
||||||
|
|
||||||
var _api;
|
|
||||||
|
|
||||||
var _setCurrentSection = function (btn, section) {
|
|
||||||
if (section) {
|
|
||||||
_currentSection = section;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (btn === 'esc') {
|
|
||||||
if (_currentLevel === 0) {
|
|
||||||
_currentSection = document;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (_isEditDiagram) {
|
|
||||||
_currentSection = [$(window.parent.document).find('.advanced-settings-dlg:visible')[0], window.document];
|
|
||||||
} else if ($('#file-menu-panel').is(':visible')) {
|
|
||||||
_currentSection = $('#file-menu-panel');
|
|
||||||
} else {
|
|
||||||
_currentSection = (btn && btn.closest('.hint-section')) || document;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var _lockedKeyEvents = function (isLocked) {
|
|
||||||
if (_api) {
|
|
||||||
_isLockedKeyEvents = isLocked;
|
|
||||||
_api.asc_enableKeyEvents(!isLocked);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var _showHints = function () {
|
|
||||||
_inputLetters = '';
|
|
||||||
if (_currentLevel === 0) {
|
|
||||||
Common.NotificationCenter.trigger('toolbar:collapse');
|
|
||||||
}
|
|
||||||
if (_currentHints.length === 0 || ($('#file-menu-panel').is(':visible' || _isEditDiagram) && _currentLevel === 1)) {
|
|
||||||
_getHints();
|
|
||||||
}
|
|
||||||
if (_currentHints.length > 0) {
|
|
||||||
!_isLockedKeyEvents && _lockedKeyEvents(true);
|
|
||||||
_hintVisible = true;
|
|
||||||
_currentHints.forEach(function(item) {
|
|
||||||
item.show();
|
|
||||||
});
|
|
||||||
_inputTimer = setInterval(function () {
|
|
||||||
if (_inputLetters.length > 0) {
|
|
||||||
_inputLetters = '';
|
|
||||||
}
|
|
||||||
}, 5000);
|
|
||||||
} else {
|
|
||||||
_hintVisible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('hints:show', _hintVisible, _currentLevel);
|
|
||||||
};
|
|
||||||
|
|
||||||
var _hideHints = function() {
|
|
||||||
_hintVisible = false;
|
|
||||||
_currentHints && _currentHints.forEach(function(item) {
|
|
||||||
item.remove()
|
|
||||||
});
|
|
||||||
clearInterval(_inputTimer);
|
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('hints:show', false);
|
|
||||||
};
|
|
||||||
|
|
||||||
var _nextLevel = function(level) {
|
|
||||||
_removeHints();
|
|
||||||
_currentHints.length = 0;
|
|
||||||
_currentControls.length = 0;
|
|
||||||
if (level !== undefined) {
|
|
||||||
_currentLevel = level;
|
|
||||||
} else {
|
|
||||||
_currentLevel++;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var _prevLevel = function() {
|
|
||||||
_removeHints();
|
|
||||||
_currentHints.length = 0;
|
|
||||||
_currentControls.length = 0;
|
|
||||||
_currentLevel--;
|
|
||||||
};
|
|
||||||
|
|
||||||
var _getLetters = function(countButtons) {
|
|
||||||
var arr = _arrAlphabet.slice(),
|
|
||||||
firstFreeLetter,
|
|
||||||
ind;
|
|
||||||
for (var i = 0; i < _arrAlphabet.length, !firstFreeLetter; i++) {
|
|
||||||
if (_usedTitles.indexOf(_arrAlphabet[i]) === -1) {
|
|
||||||
firstFreeLetter = _arrAlphabet[i];
|
|
||||||
ind = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
arr[ind] = firstFreeLetter + _arrAlphabet[0];
|
|
||||||
for (var i = 0; arr.length < countButtons; i++) {
|
|
||||||
var addTip = firstFreeLetter + _arrAlphabet[i];
|
|
||||||
if (addTip !== arr[ind]) {
|
|
||||||
arr.push(firstFreeLetter + _arrAlphabet[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
};
|
|
||||||
|
|
||||||
var _getLetterInUILanguage = function (letter) {
|
|
||||||
var l = letter;
|
|
||||||
if (_arrAlphabet.indexOf(l) === -1) {
|
|
||||||
var ind = _arrEnAlphabet.indexOf(l);
|
|
||||||
l = _arrAlphabet[ind];
|
|
||||||
}
|
|
||||||
return l;
|
|
||||||
};
|
|
||||||
|
|
||||||
var _isItemDisabled = function (item) {
|
|
||||||
return (item.hasClass('disabled') || item.parent().hasClass('disabled') || item.attr('disabled'));
|
|
||||||
};
|
|
||||||
|
|
||||||
var _getControls = function() {
|
|
||||||
_currentControls = [];
|
|
||||||
_usedTitles = [];
|
|
||||||
var arr = [],
|
|
||||||
arrItemsWithTitle = [];
|
|
||||||
if (_.isArray(_currentSection)) {
|
|
||||||
_currentSection.forEach(function (section) {
|
|
||||||
arr = arr.concat($(section).find('[data-hint=' + (_currentLevel) + ']').toArray());
|
|
||||||
arrItemsWithTitle = arrItemsWithTitle.concat($(section).find('[data-hint-title][data-hint=' + (_currentLevel) + ']').toArray());
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
arr = $(_currentSection).find('[data-hint=' + (_currentLevel) + ']').toArray();
|
|
||||||
arrItemsWithTitle = $(_currentSection).find('[data-hint-title][data-hint=' + (_currentLevel) + ']').toArray();
|
|
||||||
}
|
|
||||||
var visibleItems = arr.filter(function (item) {
|
|
||||||
return $(item).is(':visible');
|
|
||||||
});
|
|
||||||
var visibleItemsWithTitle = arrItemsWithTitle.filter(function (item) {
|
|
||||||
return $(item).is(':visible');
|
|
||||||
});
|
|
||||||
if (visibleItems.length === visibleItemsWithTitle.length) { // all buttons have data-hint-title
|
|
||||||
visibleItems.forEach(function (item) {
|
|
||||||
var el = $(item);
|
|
||||||
if (_lang !== 'en') {
|
|
||||||
var title = el.attr('data-hint-title').toLowerCase(),
|
|
||||||
firstLetter = title.substr(0, 1);
|
|
||||||
if (_arrAlphabet.indexOf(firstLetter) === -1) { // tip is in English
|
|
||||||
var newTip = '';
|
|
||||||
for (var i = 0; i < title.length; i++) {
|
|
||||||
var letter = title.substr(i, 1),
|
|
||||||
ind = _arrEnAlphabet.indexOf(letter);
|
|
||||||
newTip = newTip + _arrAlphabet[ind].toUpperCase();
|
|
||||||
}
|
|
||||||
el.attr('data-hint-title', newTip);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
_currentControls.push(el);
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var _arrLetters = [],
|
|
||||||
_usedLetters = [];
|
|
||||||
if (_currentLevel === 0) {
|
|
||||||
for (var key in _staticHints) {
|
|
||||||
var t = _staticHints[key].toLowerCase();
|
|
||||||
_usedTitles.push(t);
|
|
||||||
_usedLetters.push(_arrAlphabet.indexOf(t));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (visibleItems.length > _arrAlphabet.length) {
|
|
||||||
visibleItemsWithTitle.forEach(function (item) {
|
|
||||||
var t = $(item).data('hint-title').toLowerCase();
|
|
||||||
t = _getLetterInUILanguage(t);
|
|
||||||
_usedTitles.push(t);
|
|
||||||
});
|
|
||||||
_arrLetters = _getLetters(visibleItems.length + (_currentLevel === 0 ? _.size(_staticHints) : 0));
|
|
||||||
} else {
|
|
||||||
_arrLetters = _arrAlphabet.slice();
|
|
||||||
}
|
|
||||||
if (arrItemsWithTitle.length > 0) {
|
|
||||||
visibleItems.forEach(function (item) {
|
|
||||||
var el = $(item);
|
|
||||||
var title = el.attr('data-hint-title');
|
|
||||||
if (title) {
|
|
||||||
var ind = _arrEnAlphabet.indexOf(title.toLowerCase());
|
|
||||||
if (ind === -1) { // we have already changed
|
|
||||||
_usedLetters.push(_arrAlphabet.indexOf(title.toLowerCase()));
|
|
||||||
} else {
|
|
||||||
_usedLetters.push(ind);
|
|
||||||
if (_lang !== 'en') {
|
|
||||||
el.attr('data-hint-title', _arrLetters[ind].toUpperCase());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var index = 0;
|
|
||||||
visibleItems.forEach(function (item) {
|
|
||||||
var el = $(item);
|
|
||||||
while (_usedLetters.indexOf(index) !== -1) {
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
var title = el.attr('data-hint-title');
|
|
||||||
if (!title) {
|
|
||||||
el.attr('data-hint-title', _arrLetters[index].toUpperCase());
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
_currentControls.push(el);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var _getHints = function() {
|
|
||||||
var docH = _isEditDiagram ? (window.parent.innerHeight * Common.Utils.zoom()) : (Common.Utils.innerHeight() - 20),
|
|
||||||
docW = _isEditDiagram ? (window.parent.innerWidth * Common.Utils.zoom()) : (Common.Utils.innerWidth()),
|
|
||||||
section = _isEditDiagram ? _currentSection[0] : _currentSection,
|
|
||||||
topSection = _currentLevel !== 0 && $(section).length > 0 && !_isEditDiagram ? $(section).offset().top : 0,
|
|
||||||
bottomSection = _currentLevel !== 0 && $(section).length > 0 && !_isEditDiagram ? topSection + $(section).height() : docH;
|
|
||||||
if ($(section).prop('id') === 'toolbar' && $(section).outerHeight() < $(section).find('.box-controls').outerHeight()) {
|
|
||||||
bottomSection += $(section).find('.box-controls').outerHeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_currentControls.length === 0)
|
|
||||||
_getControls();
|
|
||||||
_currentControls.forEach(function(item, index) {
|
|
||||||
if (!_isItemDisabled(item)) {
|
|
||||||
var leftBorder = 0,
|
|
||||||
rightBorder = docW;
|
|
||||||
if (!_isEditDiagram && $(_currentSection).prop('id') === 'toolbar' && ($(_currentSection).find('.toolbar-mask').length > 0)
|
|
||||||
|| ($('#about-menu-panel').is(':visible') && item.closest('.hint-section').prop('id') === 'right-menu')) { // don't show right menu hints when about is visible
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (window.SSE && item.parent().prop('id') === 'statusbar_bottom') {
|
|
||||||
var $statusbar = item.parent();
|
|
||||||
if (item.offset().left > $statusbar.offset().left + $statusbar.width()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (_currentLevel === 0 && item.closest('.tabs.short').length > 0) {
|
|
||||||
var blockTabs = item.closest('.tabs.short');
|
|
||||||
leftBorder = blockTabs.offset().left;
|
|
||||||
rightBorder = leftBorder + blockTabs.width();
|
|
||||||
if (!item.hasClass('scroll')) {
|
|
||||||
leftBorder += 20;
|
|
||||||
rightBorder -= 20;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var hint = $('<div style="" class="hint-div">' + item.attr('data-hint-title') + '</div>');
|
|
||||||
var direction = item.attr('data-hint-direction');
|
|
||||||
// exceptions
|
|
||||||
if (window.SSE && !_isEditDiagram && _currentSection.nodeType !== 9 &&
|
|
||||||
_currentSection.prop('id') === 'toolbar' && item.closest('.panel').attr('data-tab') === 'data') {
|
|
||||||
if (item.parent().hasClass('slot-sortdesc') || item.parent().hasClass('slot-btn-setfilter')) {
|
|
||||||
direction = 'top';
|
|
||||||
item.attr('data-hint-direction', 'top');
|
|
||||||
} else if (item.parent().hasClass('slot-btn-clear-filter') || item.parent().hasClass('slot-sortasc')) {
|
|
||||||
direction = 'bottom';
|
|
||||||
item.attr('data-hint-direction', 'bottom');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var maxHeight = docH;
|
|
||||||
if ($('#file-menu-panel').is(':visible') && _currentLevel > 1 &&
|
|
||||||
($('.fms-flex-apply').is(':visible') || $('#fms-flex-apply').is(':visible')) &&
|
|
||||||
item.closest('.fms-flex-apply').length < 1 && item.closest('#fms-flex-apply').length < 1) {
|
|
||||||
maxHeight = docH - $('.fms-flex-apply').height();
|
|
||||||
}
|
|
||||||
var offsets = item.attr('data-hint-offset');
|
|
||||||
var applyOffset = offsets === 'big' ? 6 : (offsets === 'medium' ? 4 : (offsets === 'small' ? 2 : 0));
|
|
||||||
if (applyOffset) {
|
|
||||||
switch (direction) {
|
|
||||||
case 'bottom':
|
|
||||||
offsets = [-applyOffset, 0];
|
|
||||||
break;
|
|
||||||
case 'top':
|
|
||||||
offsets = [applyOffset, 0];
|
|
||||||
break;
|
|
||||||
case 'right':
|
|
||||||
offsets = [0, -applyOffset];
|
|
||||||
break;
|
|
||||||
case 'left':
|
|
||||||
offsets = [0, applyOffset];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
offsets = offsets ? item.attr('data-hint-offset').split(',').map(function (item) { return parseInt(item); }) : [0, 0];
|
|
||||||
}
|
|
||||||
var offset = item.offset();
|
|
||||||
var top, left;
|
|
||||||
if (direction === 'left-top') {
|
|
||||||
top = offset.top - 10 + offsets[0];
|
|
||||||
left = offset.left - 10 + offsets[1];
|
|
||||||
} else if (direction === 'top') {
|
|
||||||
top = offset.top - 18 + offsets[0];
|
|
||||||
left = offset.left + (item.outerWidth() - 18) / 2 + offsets[1];
|
|
||||||
} else if (direction === 'right') {
|
|
||||||
top = offset.top + (item.outerHeight() - 18) / 2 + offsets[0];
|
|
||||||
left = offset.left + item.outerWidth() + offsets[1];
|
|
||||||
} else if (direction === 'left') {
|
|
||||||
top = offset.top + (item.outerHeight() - 18) / 2 + offsets[0];
|
|
||||||
left = offset.left - 18 + offsets[1];
|
|
||||||
} else {
|
|
||||||
top = offset.top + item.outerHeight() + offsets[0];
|
|
||||||
left = offset.left + (item.outerWidth() - 18) / 2 + offsets[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (top < maxHeight && left < docW && top > topSection && top < bottomSection && left > leftBorder && left + 18 < rightBorder) {
|
|
||||||
hint.css({
|
|
||||||
top: top,
|
|
||||||
left: left
|
|
||||||
});
|
|
||||||
if (_isEditDiagram && index < 2) {
|
|
||||||
hint.css('z-index', '1060');
|
|
||||||
$(window.parent.document.body).append(hint);
|
|
||||||
} else {
|
|
||||||
$(document.body).append(hint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_currentHints.push(hint);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var _removeHints = function() {
|
|
||||||
_currentHints && _currentHints.forEach(function(item) {
|
|
||||||
item.remove()
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var _resetToDefault = function() {
|
|
||||||
_currentLevel = ($('#file-menu-panel').is(':visible') || _isEditDiagram) ? 1 : 0;
|
|
||||||
_setCurrentSection();
|
|
||||||
_currentHints.length = 0;
|
|
||||||
_currentControls.length = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
var _init = function(api) {
|
|
||||||
_api = api;
|
|
||||||
|
|
||||||
var filter = Common.localStorage.getKeysFilter();
|
|
||||||
_appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
|
||||||
|
|
||||||
Common.NotificationCenter.on({
|
|
||||||
'app:ready': function (mode) {
|
|
||||||
var lang = mode.lang ? mode.lang.toLowerCase() : 'en';
|
|
||||||
_getAlphabetLetters(lang);
|
|
||||||
_isDocReady = true;
|
|
||||||
},
|
|
||||||
'hints:clear': _clearHints,
|
|
||||||
'window:resize': _clearHints
|
|
||||||
});
|
|
||||||
$('#editor_sdk').on('click', function () {
|
|
||||||
_clearHints();
|
|
||||||
});
|
|
||||||
$(document).on('mousedown', function () {
|
|
||||||
_clearHints();
|
|
||||||
});
|
|
||||||
$(document).on('keyup', function(e) {
|
|
||||||
if (e.keyCode == Common.UI.Keys.ALT && _needShow && !(window.SSE && window.SSE.getController('Statusbar').getIsDragDrop())) {
|
|
||||||
e.preventDefault();
|
|
||||||
if (!_hintVisible) {
|
|
||||||
$('input:focus').blur(); // to change value in inputField
|
|
||||||
_currentLevel = ($('#file-menu-panel').is(':visible') || _isEditDiagram) ? 1 : 0;
|
|
||||||
_setCurrentSection();
|
|
||||||
_showHints();
|
|
||||||
} else {
|
|
||||||
_hideHints();
|
|
||||||
_resetToDefault();
|
|
||||||
if (_isLockedKeyEvents) {
|
|
||||||
_isLockedKeyEvents = false;
|
|
||||||
_api.asc_enableKeyEvents(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (_hintVisible) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
_needShow = false;
|
|
||||||
});
|
|
||||||
$(document).on('keydown', function(e) {
|
|
||||||
if (_hintVisible) {
|
|
||||||
e.preventDefault();
|
|
||||||
if (e.keyCode == Common.UI.Keys.ESC ) {
|
|
||||||
setTimeout(function () {
|
|
||||||
if (_currentLevel === 0) {
|
|
||||||
_hideHints();
|
|
||||||
_resetToDefault();
|
|
||||||
_lockedKeyEvents(false);
|
|
||||||
} else {
|
|
||||||
_prevLevel();
|
|
||||||
_setCurrentSection('esc');
|
|
||||||
_showHints();
|
|
||||||
}
|
|
||||||
}, 10);
|
|
||||||
} else {
|
|
||||||
var curLetter = null,
|
|
||||||
match = false;
|
|
||||||
var keyCode = e.keyCode;
|
|
||||||
if (keyCode !== 16 && keyCode !== 17 && keyCode !== 18 && keyCode !== 91) {
|
|
||||||
curLetter = _lang === 'en' ?
|
|
||||||
((keyCode > 47 && keyCode < 58 || keyCode > 64 && keyCode < 91) ? String.fromCharCode(e.keyCode) : null) :
|
|
||||||
(/[.*+?^${}()|[\]\\]/g.test(e.key) ? null : e.key);
|
|
||||||
}
|
|
||||||
if (curLetter) {
|
|
||||||
var curr;
|
|
||||||
if (_lang !== 'en' && _arrAlphabet.indexOf(curLetter.toLowerCase()) === -1) {
|
|
||||||
var ind = _arrEnQwerty.indexOf(curLetter.toLowerCase());
|
|
||||||
if (ind !== -1) {
|
|
||||||
curLetter = _arrQwerty[ind];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_inputLetters = _inputLetters + curLetter.toUpperCase();
|
|
||||||
for (var i = 0; i < _currentControls.length; i++) {
|
|
||||||
var item = _currentControls[i];
|
|
||||||
if (!_isItemDisabled(item)) {
|
|
||||||
var title = item.attr('data-hint-title'),
|
|
||||||
regExp = new RegExp('^' + _inputLetters + '');
|
|
||||||
if (regExp.test(title)) {
|
|
||||||
match = true;
|
|
||||||
}
|
|
||||||
if (title === _inputLetters) {
|
|
||||||
curr = item;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (curr) {
|
|
||||||
var tag = curr.prop("tagName").toLowerCase();
|
|
||||||
if (window.SSE && curr.parent().prop('id') === 'statusbar_bottom') {
|
|
||||||
_hideHints();
|
|
||||||
curr.contextmenu();
|
|
||||||
_resetToDefault();
|
|
||||||
} else if (tag === 'input' || tag === 'textarea') {
|
|
||||||
_hideHints();
|
|
||||||
curr.trigger(jQuery.Event('click', {which: 1}));
|
|
||||||
curr.focus();
|
|
||||||
_resetToDefault();
|
|
||||||
} else if (curr.hasClass('listview')) {
|
|
||||||
_hideHints();
|
|
||||||
curr.focus();
|
|
||||||
_resetToDefault();
|
|
||||||
} else {
|
|
||||||
_isComplete = false;
|
|
||||||
_hideHints();
|
|
||||||
if (!_isEditDiagram && $(_currentSection).prop('id') === 'toolbar' && ($(_currentSection).find('.toolbar-mask').length > 0)) {
|
|
||||||
_resetToDefault();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var needOpenPanel = (curr.attr('content-target') && !$('#' + curr.attr('content-target')).is(':visible') ||
|
|
||||||
(curr.parent().prop('id') === 'slot-btn-chat' && !$('#left-panel-chat').is(':visible')) ||
|
|
||||||
(curr.parent().hasClass('ribtab') && !$('#toolbar').children('.toolbar').hasClass('expanded')));
|
|
||||||
if ((!curr.attr('content-target') && curr.parent().prop('id') !== 'slot-btn-chat') || needOpenPanel) { // need to open panel
|
|
||||||
if (!($('#file-menu-panel').is(':visible') && (curr.parent().prop('id') === 'fm-btn-info' && $('#panel-info').is(':visible') ||
|
|
||||||
curr.parent().prop('id') === 'fm-btn-settings' && $('#panel-settings').is(':visible')))) {
|
|
||||||
if (curr.attr('for')) { // to trigger event in checkbox
|
|
||||||
$('#' + curr.attr('for')).trigger(jQuery.Event('click', {which: 1}));
|
|
||||||
} else {
|
|
||||||
curr.trigger(jQuery.Event('click', {which: 1}));
|
|
||||||
if (needOpenPanel)
|
|
||||||
_isComplete = false; // to show next level of hints
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (curr.prop('id') === 'btn-goback' || curr.closest('.btn-slot').prop('id') === 'slot-btn-options' ||
|
|
||||||
curr.closest('.btn-slot').prop('id') === 'slot-btn-mode' || curr.prop('id') === 'btn-favorite' || curr.parent().prop('id') === 'tlb-box-users' ||
|
|
||||||
curr.prop('id') === 'left-btn-thumbs' || curr.hasClass('scroll') || curr.prop('id') === 'left-btn-about' ||
|
|
||||||
curr.prop('id') === 'left-btn-support' || curr.closest('.btn-slot').prop('id') === 'slot-btn-search') {
|
|
||||||
_resetToDefault();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (curr.prop('id') === 'add-comment-doc') {
|
|
||||||
_removeHints();
|
|
||||||
_currentHints.length = 0;
|
|
||||||
_currentControls.length = 0;
|
|
||||||
_showHints();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!_isComplete) {
|
|
||||||
if (curr.parent().prop('id') === 'slot-btn-chat') {
|
|
||||||
_nextLevel(1);
|
|
||||||
_setCurrentSection(undefined, $('#left-menu.hint-section'));
|
|
||||||
} else if (curr.prop('id') === 'id-right-menu-signature') {
|
|
||||||
_nextLevel(2);
|
|
||||||
_setCurrentSection(curr);
|
|
||||||
} else {
|
|
||||||
_nextLevel();
|
|
||||||
_setCurrentSection(curr);
|
|
||||||
}
|
|
||||||
_showHints();
|
|
||||||
if (_currentHints.length < 1) {
|
|
||||||
_resetToDefault();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (!match) {
|
|
||||||
_inputLetters = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_needShow = (Common.Utils.InternalSettings.get(_appPrefix + "settings-show-alt-hints") && !e.shiftKey && e.keyCode == Common.UI.Keys.ALT &&
|
|
||||||
!Common.Utils.ModalWindow.isVisible() && _isDocReady && _arrAlphabet.length > 0 &&
|
|
||||||
!(window.PE && $('#pe-preview').is(':visible')));
|
|
||||||
if (Common.Utils.InternalSettings.get(_appPrefix + "settings-show-alt-hints") && e.altKey && e.keyCode !== 115) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var _getAlphabetLetters = function (lng) {
|
|
||||||
Common.Utils.loadConfig('../../common/main/resources/alphabetletters/alphabetletters.json', function (langsJson) {
|
|
||||||
_arrEnAlphabet = langsJson['en'];
|
|
||||||
var _setAlphabet = function (lang) {
|
|
||||||
_lang = lang;
|
|
||||||
_arrAlphabet = langsJson[lang];
|
|
||||||
return _arrAlphabet;
|
|
||||||
};
|
|
||||||
var loaded = !_setAlphabet(lng) ? (!_setAlphabet(lng.split(/[\-_]/)[0]) ? _setAlphabet('en') : true) : true;
|
|
||||||
if (loaded && _lang !== 'en') {
|
|
||||||
for (var key in _staticHints) {
|
|
||||||
var hint = _getLetterInUILanguage(_staticHints[key].toLowerCase());
|
|
||||||
if (hint) {
|
|
||||||
_staticHints[key] = hint.toUpperCase();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return loaded;
|
|
||||||
});
|
|
||||||
Common.Utils.loadConfig('../../common/main/resources/alphabetletters/qwertyletters.json', function (langsJson) {
|
|
||||||
_arrQwerty = langsJson[_lang];
|
|
||||||
if (_lang !== 'en') {
|
|
||||||
_arrEnQwerty = langsJson['en'];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var _needCloseFileMenu = function () {
|
|
||||||
return !(_hintVisible && _currentLevel > 1);
|
|
||||||
};
|
|
||||||
|
|
||||||
var _clearHints = function (isComplete) {
|
|
||||||
_hintVisible && _hideHints();
|
|
||||||
if (_currentHints.length > 0) {
|
|
||||||
_resetToDefault();
|
|
||||||
}
|
|
||||||
_isLockedKeyEvents && _lockedKeyEvents(false);
|
|
||||||
|
|
||||||
if (isComplete) {
|
|
||||||
_isComplete = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('.hint-div').length > 0) {
|
|
||||||
$('.hint-div').remove();
|
|
||||||
}
|
|
||||||
if ($('iframe').length > 0) {
|
|
||||||
try {
|
|
||||||
$('iframe').contents().find('.hint-div').remove();
|
|
||||||
} catch (e) {}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var _isHintVisible = function () {
|
|
||||||
return _hintVisible;
|
|
||||||
};
|
|
||||||
|
|
||||||
var _setMode = function (mode) {
|
|
||||||
_isEditDiagram = mode.isEditDiagram || mode.isEditMailMerge || mode.isEditOle;
|
|
||||||
};
|
|
||||||
|
|
||||||
var _getStaticHint = function (key) {
|
|
||||||
return _staticHints[key];
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
init: _init,
|
|
||||||
setMode: _setMode,
|
|
||||||
clearHints: _clearHints,
|
|
||||||
needCloseFileMenu: _needCloseFileMenu,
|
|
||||||
isHintVisible: _isHintVisible,
|
|
||||||
getStaticHint: _getStaticHint
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
@ -100,10 +100,9 @@ define([
|
||||||
this.panelHistory.$el.find('#history-list').css('padding-bottom', hasChanges ? '45px' : 0);
|
this.panelHistory.$el.find('#history-list').css('padding-bottom', hasChanges ? '45px' : 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
onDownloadUrl: function(url, fileType) {
|
onDownloadUrl: function(url) {
|
||||||
if (this.isFromSelectRevision !== undefined) {
|
if (this.isFromSelectRevision !== undefined)
|
||||||
Common.Gateway.requestRestore(this.isFromSelectRevision, url, fileType);
|
Common.Gateway.requestRestore(this.isFromSelectRevision, url);
|
||||||
}
|
|
||||||
this.isFromSelectRevision = undefined;
|
this.isFromSelectRevision = undefined;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -112,11 +111,10 @@ define([
|
||||||
var btn = $(e.target);
|
var btn = $(e.target);
|
||||||
if (btn && btn.hasClass('revision-restore')) {
|
if (btn && btn.hasClass('revision-restore')) {
|
||||||
if (record.get('isRevision'))
|
if (record.get('isRevision'))
|
||||||
Common.Gateway.requestRestore(record.get('revision'), undefined, record.get('fileType'));
|
Common.Gateway.requestRestore(record.get('revision'));
|
||||||
else {
|
else {
|
||||||
this.isFromSelectRevision = record.get('revision');
|
this.isFromSelectRevision = record.get('revision');
|
||||||
var fileType = Asc.c_oAscFileType[(record.get('fileType') || '').toUpperCase()] || Asc.c_oAscFileType.DOCX;
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX, true));
|
||||||
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(fileType, true));
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -137,15 +135,9 @@ define([
|
||||||
this.currentServerVersion = record.get('serverVersion');
|
this.currentServerVersion = record.get('serverVersion');
|
||||||
|
|
||||||
if ( _.isEmpty(url) || (urlGetTime - record.get('urlGetTime') > 5 * 60000)) {
|
if ( _.isEmpty(url) || (urlGetTime - record.get('urlGetTime') > 5 * 60000)) {
|
||||||
var me = this;
|
_.delay(function() {
|
||||||
if (!me.timerId) {
|
Common.Gateway.requestHistoryData(rev); // получаем url-ы для ревизий
|
||||||
me.timerId = setTimeout(function () {
|
}, 10);
|
||||||
me.timerId = 0;
|
|
||||||
},30000);
|
|
||||||
_.delay(function() {
|
|
||||||
Common.Gateway.requestHistoryData(rev); // получаем url-ы для ревизий
|
|
||||||
}, 10);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
||||||
if (commentsController) {
|
if (commentsController) {
|
||||||
|
|
@ -175,11 +167,6 @@ define([
|
||||||
onSetHistoryData: function(opts) {
|
onSetHistoryData: function(opts) {
|
||||||
if (!this.mode.canUseHistory) return;
|
if (!this.mode.canUseHistory) return;
|
||||||
|
|
||||||
if (this.timerId) {
|
|
||||||
clearTimeout(this.timerId);
|
|
||||||
this.timerId = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opts.data.error) {
|
if (opts.data.error) {
|
||||||
var config = {
|
var config = {
|
||||||
title: this.notcriticalErrorTitle,
|
title: this.notcriticalErrorTitle,
|
||||||
|
|
@ -202,7 +189,6 @@ define([
|
||||||
urlGetTime = new Date();
|
urlGetTime = new Date();
|
||||||
var diff = (!opts.data.previous || 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,
|
url = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.url : opts.data.url,
|
||||||
fileType = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.fileType : opts.data.fileType,
|
|
||||||
docId = opts.data.key ? opts.data.key : this.currentDocId,
|
docId = opts.data.key ? opts.data.key : this.currentDocId,
|
||||||
docIdPrev = opts.data.previous && opts.data.previous.key ? opts.data.previous.key : this.currentDocIdPrev,
|
docIdPrev = opts.data.previous && opts.data.previous.key ? opts.data.previous.key : this.currentDocIdPrev,
|
||||||
token = opts.data.token;
|
token = opts.data.token;
|
||||||
|
|
@ -218,7 +204,6 @@ define([
|
||||||
rev.set('docIdPrev', docIdPrev, {silent: true});
|
rev.set('docIdPrev', docIdPrev, {silent: true});
|
||||||
}
|
}
|
||||||
rev.set('token', token, {silent: true});
|
rev.set('token', token, {silent: true});
|
||||||
fileType && rev.set('fileType', fileType, {silent: true});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var hist = new Asc.asc_CVersionHistory();
|
var hist = new Asc.asc_CVersionHistory();
|
||||||
|
|
@ -231,7 +216,6 @@ define([
|
||||||
hist.asc_setIsRequested(true);
|
hist.asc_setIsRequested(true);
|
||||||
hist.asc_setServerVersion(this.currentServerVersion);
|
hist.asc_setServerVersion(this.currentServerVersion);
|
||||||
this.api.asc_showRevision(hist);
|
this.api.asc_showRevision(hist);
|
||||||
this.currentRev = data.version;
|
|
||||||
|
|
||||||
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
|
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
|
||||||
if (reviewController)
|
if (reviewController)
|
||||||
|
|
@ -262,7 +246,7 @@ define([
|
||||||
store.where({isRevision: false}).forEach(function(item){
|
store.where({isRevision: false}).forEach(function(item){
|
||||||
item.set('isVisible', needExpand);
|
item.set('isVisible', needExpand);
|
||||||
});
|
});
|
||||||
this.panelHistory.viewHistoryList.scroller.update({minScrollbarLength: this.panelHistory.viewHistoryList.minScrollbarLength});
|
this.panelHistory.viewHistoryList.scroller.update({minScrollbarLength: 40});
|
||||||
this.panelHistory.btnExpand.cmpEl.text(needExpand ? this.panelHistory.textHideAll : this.panelHistory.textShowAll);
|
this.panelHistory.btnExpand.cmpEl.text(needExpand ? this.panelHistory.textHideAll : this.panelHistory.textShowAll);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,146 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* (c) Copyright Ascensio System SIA 2010-2021
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* LayoutManager.js
|
|
||||||
*
|
|
||||||
* Created by Julia Radzhabova on 06.10.2021
|
|
||||||
* Copyright (c) 2021 Ascensio System SIA. All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
if (Common === undefined)
|
|
||||||
var Common = {};
|
|
||||||
|
|
||||||
if (Common.UI === undefined) {
|
|
||||||
Common.UI = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
Common.UI.LayoutManager = new(function() {
|
|
||||||
var _config;
|
|
||||||
var _init = function(config) {
|
|
||||||
_config = config;
|
|
||||||
};
|
|
||||||
|
|
||||||
var _applyCustomization = function(config, el, prefix) {
|
|
||||||
!config && (config = _config);
|
|
||||||
if (!config) return;
|
|
||||||
|
|
||||||
for (var name in config) {
|
|
||||||
if(config.hasOwnProperty(name)) {
|
|
||||||
if(typeof config[name] === 'object')
|
|
||||||
_applyCustomization(config[name], el, (prefix || '') + name + '-');
|
|
||||||
else if (config[name] === false) {
|
|
||||||
var selector = '[data-layout-name=' + (prefix || '') + name + ']',
|
|
||||||
cmp = el ? el.find(selector) : $(selector);
|
|
||||||
cmp && cmp.hide && cmp.hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var _isElementVisible = function(value, config, prefix) {
|
|
||||||
!config && (config = _config);
|
|
||||||
if (!config) return true;
|
|
||||||
|
|
||||||
var res = true;
|
|
||||||
for (var name in config) {
|
|
||||||
if(config.hasOwnProperty(name)) {
|
|
||||||
if(typeof config[name] === 'object')
|
|
||||||
res = _isElementVisible(value, config[name], (prefix || '') + name + '-');
|
|
||||||
else {
|
|
||||||
if (value === (prefix || '') + name) { // checked value is in config
|
|
||||||
res = config[name];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (res===false) return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
init: _init,
|
|
||||||
applyCustomization: _applyCustomization,
|
|
||||||
isElementVisible: _isElementVisible
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* features: {
|
|
||||||
* feature: { //can be object or init value
|
|
||||||
* mode: <init value> // value1 / value2 ...
|
|
||||||
* change: false/true // hide/show feature
|
|
||||||
* } / value1 / value2 ...
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
Common.UI.FeaturesManager = new(function() {
|
|
||||||
var _config,
|
|
||||||
_licensed;
|
|
||||||
var _init = function(config, licensed) {
|
|
||||||
_config = config;
|
|
||||||
_licensed = licensed;
|
|
||||||
};
|
|
||||||
|
|
||||||
var _canChange = function(name, force) {
|
|
||||||
return !((_licensed || force) && _config && typeof _config[name] === 'object' && _config[name] && _config[name].change===false);
|
|
||||||
};
|
|
||||||
|
|
||||||
var _getInitValue2 = function(name, defValue, force) {
|
|
||||||
if ((_licensed || force) && _config && _config[name] !== undefined ) {
|
|
||||||
if (typeof _config[name] === 'object' && _config[name]) { // object and not null
|
|
||||||
if (_config[name].mode!==undefined)
|
|
||||||
return _config[name].mode;
|
|
||||||
} else
|
|
||||||
return _config[name];
|
|
||||||
}
|
|
||||||
|
|
||||||
return defValue;
|
|
||||||
};
|
|
||||||
|
|
||||||
var _getInitValue = function(name, force) {
|
|
||||||
if ((_licensed || force) && _config && _config[name] !== undefined ) {
|
|
||||||
if (typeof _config[name] === 'object' && _config[name]) { // object and not null
|
|
||||||
if (_config[name].mode!==undefined)
|
|
||||||
return _config[name].mode;
|
|
||||||
} else
|
|
||||||
return _config[name];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
init: _init,
|
|
||||||
canChange: _canChange,
|
|
||||||
getInitValue: _getInitValue
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
@ -39,8 +39,7 @@
|
||||||
define([
|
define([
|
||||||
'core',
|
'core',
|
||||||
'common/main/lib/collection/Plugins',
|
'common/main/lib/collection/Plugins',
|
||||||
'common/main/lib/view/Plugins',
|
'common/main/lib/view/Plugins'
|
||||||
'common/main/lib/view/PluginDlg'
|
|
||||||
], function () {
|
], function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
@ -63,8 +62,8 @@ define([
|
||||||
'render:before' : function (toolbar) {
|
'render:before' : function (toolbar) {
|
||||||
var appOptions = me.getApplication().getController('Main').appOptions;
|
var appOptions = me.getApplication().getController('Main').appOptions;
|
||||||
|
|
||||||
if ( !appOptions.isEditMailMerge && !appOptions.isEditDiagram && !appOptions.isEditOle ) {
|
if ( !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) {
|
||||||
var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption, dataHintTitle: 'E', layoutname: 'toolbar-plugins'};
|
var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption};
|
||||||
me.$toolbarPanelPlugins = me.panelPlugins.getPanel();
|
me.$toolbarPanelPlugins = me.panelPlugins.getPanel();
|
||||||
|
|
||||||
toolbar.addTab(tab, me.$toolbarPanelPlugins, 10); // TODO: clear plugins list in left panel
|
toolbar.addTab(tab, me.$toolbarPanelPlugins, 10); // TODO: clear plugins list in left panel
|
||||||
|
|
@ -162,8 +161,6 @@ define([
|
||||||
this.api.asc_registerCallback("asc_onPluginMouseMove", _.bind(this.onPluginMouseMove, this));
|
this.api.asc_registerCallback("asc_onPluginMouseMove", _.bind(this.onPluginMouseMove, this));
|
||||||
this.api.asc_registerCallback('asc_onPluginsReset', _.bind(this.resetPluginsList, this));
|
this.api.asc_registerCallback('asc_onPluginsReset', _.bind(this.resetPluginsList, this));
|
||||||
this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.onPluginsInit, this));
|
this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.onPluginsInit, this));
|
||||||
this.api.asc_registerCallback('asc_onPluginShowButton', _.bind(this.onPluginShowButton, this));
|
|
||||||
this.api.asc_registerCallback('asc_onPluginHideButton', _.bind(this.onPluginHideButton, this));
|
|
||||||
|
|
||||||
this.loadPlugins();
|
this.loadPlugins();
|
||||||
}
|
}
|
||||||
|
|
@ -206,13 +203,44 @@ define([
|
||||||
arr = [];
|
arr = [];
|
||||||
storePlugins.each(function(item){
|
storePlugins.each(function(item){
|
||||||
var plugin = new Asc.CPlugin();
|
var plugin = new Asc.CPlugin();
|
||||||
plugin.deserialize(item.get('original'));
|
plugin.set_Name(item.get('name'));
|
||||||
|
plugin.set_Guid(item.get('guid'));
|
||||||
|
plugin.set_BaseUrl(item.get('baseUrl'));
|
||||||
|
plugin.set_MinVersion && plugin.set_MinVersion(item.get('minVersion'));
|
||||||
|
|
||||||
|
var variations = item.get('variations'),
|
||||||
|
variationsArr = [];
|
||||||
|
variations.forEach(function(itemVar){
|
||||||
|
var variation = new Asc.CPluginVariation();
|
||||||
|
variation.set_Description(itemVar.get('description'));
|
||||||
|
variation.set_Url(itemVar.get('url'));
|
||||||
|
variation.set_Icons(itemVar.get('icons'));
|
||||||
|
variation.set_Visual(itemVar.get('isVisual'));
|
||||||
|
variation.set_CustomWindow(itemVar.get('isCustomWindow'));
|
||||||
|
variation.set_System(itemVar.get('isSystem'));
|
||||||
|
variation.set_Viewer(itemVar.get('isViewer'));
|
||||||
|
variation.set_EditorsSupport(itemVar.get('EditorsSupport'));
|
||||||
|
variation.set_Modal(itemVar.get('isModal'));
|
||||||
|
variation.set_InsideMode(itemVar.get('isInsideMode'));
|
||||||
|
variation.set_InitDataType(itemVar.get('initDataType'));
|
||||||
|
variation.set_InitData(itemVar.get('initData'));
|
||||||
|
variation.set_UpdateOleOnResize(itemVar.get('isUpdateOleOnResize'));
|
||||||
|
variation.set_Buttons(itemVar.get('buttons'));
|
||||||
|
variation.set_Size(itemVar.get('size'));
|
||||||
|
variation.set_InitOnSelectionChanged(itemVar.get('initOnSelectionChanged'));
|
||||||
|
variation.set_Events(itemVar.get('events'));
|
||||||
|
variation.set_Help(itemVar.get('help'));
|
||||||
|
|
||||||
|
variationsArr.push(variation);
|
||||||
|
});
|
||||||
|
|
||||||
|
plugin.set_Variations(variationsArr);
|
||||||
item.set('pluginObj', plugin);
|
item.set('pluginObj', plugin);
|
||||||
arr.push(plugin);
|
arr.push(plugin);
|
||||||
});
|
});
|
||||||
this.api.asc_pluginsRegister('', arr);
|
this.api.asc_pluginsRegister('', arr);
|
||||||
if (storePlugins.hasVisible())
|
if (storePlugins.hasVisible())
|
||||||
Common.NotificationCenter.trigger('tab:visible', 'plugins', Common.UI.LayoutManager.isElementVisible('toolbar-plugins'));
|
Common.NotificationCenter.trigger('tab:visible', 'plugins', true);
|
||||||
Common.Gateway.pluginsReady();
|
Common.Gateway.pluginsReady();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -244,10 +272,6 @@ define([
|
||||||
$('<div class="separator long"></div>').appendTo(me.$toolbarPanelPlugins);
|
$('<div class="separator long"></div>').appendTo(me.$toolbarPanelPlugins);
|
||||||
_group = $('<div class="group"></div>');
|
_group = $('<div class="group"></div>');
|
||||||
rank_plugins = 0;
|
rank_plugins = 0;
|
||||||
} else {
|
|
||||||
_group.appendTo(me.$toolbarPanelPlugins);
|
|
||||||
$('<div class="separator long invisible"></div>').appendTo(me.$toolbarPanelPlugins);
|
|
||||||
_group = $('<div class="group" style="padding-left: 0;"></div>');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var btn = me.panelPlugins.createPluginButton(model);
|
var btn = me.panelPlugins.createPluginButton(model);
|
||||||
|
|
@ -383,7 +407,6 @@ define([
|
||||||
buttons: isCustomWindow ? undefined : newBtns,
|
buttons: isCustomWindow ? undefined : newBtns,
|
||||||
toolcallback: _.bind(this.onToolClose, this),
|
toolcallback: _.bind(this.onToolClose, this),
|
||||||
help: !!help,
|
help: !!help,
|
||||||
loader: plugin.get_Loader(),
|
|
||||||
modal: isModal!==undefined ? isModal : true
|
modal: isModal!==undefined ? isModal : true
|
||||||
});
|
});
|
||||||
me.pluginDlg.on({
|
me.pluginDlg.on({
|
||||||
|
|
@ -402,9 +425,6 @@ define([
|
||||||
},
|
},
|
||||||
'help': function(){
|
'help': function(){
|
||||||
help && window.open(help, '_blank');
|
help && window.open(help, '_blank');
|
||||||
},
|
|
||||||
'header:click': function(type){
|
|
||||||
me.api.asc_pluginButtonClick(type);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -464,14 +484,6 @@ define([
|
||||||
this.parsePlugins(pluginsdata)
|
this.parsePlugins(pluginsdata)
|
||||||
},
|
},
|
||||||
|
|
||||||
onPluginShowButton: function(id) {
|
|
||||||
this.pluginDlg && this.pluginDlg.showButton(id);
|
|
||||||
},
|
|
||||||
|
|
||||||
onPluginHideButton: function(id) {
|
|
||||||
this.pluginDlg && this.pluginDlg.hideButton(id);
|
|
||||||
},
|
|
||||||
|
|
||||||
runAutoStartPlugins: function() {
|
runAutoStartPlugins: function() {
|
||||||
if (this.autostart && this.autostart.length > 0) {
|
if (this.autostart && this.autostart.length > 0) {
|
||||||
this.api.asc_pluginRun(this.autostart.shift(), 0, '');
|
this.api.asc_pluginRun(this.autostart.shift(), 0, '');
|
||||||
|
|
@ -570,8 +582,7 @@ define([
|
||||||
visible: pluginVisible,
|
visible: pluginVisible,
|
||||||
groupName: (item.group) ? item.group.name : '',
|
groupName: (item.group) ? item.group.name : '',
|
||||||
groupRank: (item.group) ? item.group.rank : 0,
|
groupRank: (item.group) ? item.group.rank : 0,
|
||||||
minVersion: item.minVersion,
|
minVersion: item.minVersion
|
||||||
original: item
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,7 @@ define([
|
||||||
var me = this,
|
var me = this,
|
||||||
win = new Common.Views.PasswordDialog({
|
win = new Common.Views.PasswordDialog({
|
||||||
api: me.api,
|
api: me.api,
|
||||||
|
signType: 'invisible',
|
||||||
handler: function(result, props) {
|
handler: function(result, props) {
|
||||||
if (result == 'ok') {
|
if (result == 'ok') {
|
||||||
me.api.asc_setCurrentPassword(props);
|
me.api.asc_setCurrentPassword(props);
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,8 @@ define([
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
this.collection = this.getApplication().getCollection('Common.Collections.ReviewChanges');
|
this.collection = this.getApplication().getCollection('Common.Collections.ReviewChanges');
|
||||||
this.userCollection = this.getApplication().getCollection('Common.Collections.Users');
|
this.userCollection = this.getApplication().getCollection('Common.Collections.Users');
|
||||||
this.viewmode = false;
|
|
||||||
|
|
||||||
this._state = {posx: -1000, posy: -1000, popoverVisible: false, previewMode: false, compareSettings: null, wsLock: false, wsProps: []};
|
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('reviewchanges:turn', this.onTurnPreview.bind(this));
|
||||||
Common.NotificationCenter.on('spelling:turn', this.onTurnSpelling.bind(this));
|
Common.NotificationCenter.on('spelling:turn', this.onTurnSpelling.bind(this));
|
||||||
|
|
@ -110,7 +109,6 @@ define([
|
||||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||||
Common.NotificationCenter.on('collaboration:sharing', this.changeAccessRights.bind(this));
|
Common.NotificationCenter.on('collaboration:sharing', this.changeAccessRights.bind(this));
|
||||||
Common.NotificationCenter.on('collaboration:sharingdeny', this.onLostEditRights.bind(this));
|
Common.NotificationCenter.on('collaboration:sharingdeny', this.onLostEditRights.bind(this));
|
||||||
Common.NotificationCenter.on('protect:wslock', _.bind(this.onChangeProtectSheet, this));
|
|
||||||
|
|
||||||
this.userCollection.on('reset', _.bind(this.onUpdateUsers, this));
|
this.userCollection.on('reset', _.bind(this.onUpdateUsers, this));
|
||||||
this.userCollection.on('add', _.bind(this.onUpdateUsers, this));
|
this.userCollection.on('add', _.bind(this.onUpdateUsers, this));
|
||||||
|
|
@ -133,7 +131,6 @@ define([
|
||||||
this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, 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_onAuthParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
|
||||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
|
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this));
|
||||||
this.api.asc_registerCallback('asc_onChangeDisplayModeInReview', _.bind(this.onChangeDisplayModeInReview, this));
|
|
||||||
}
|
}
|
||||||
if (this.appConfig.canReview)
|
if (this.appConfig.canReview)
|
||||||
this.api.asc_registerCallback('asc_onOnTrackRevisionsChange', _.bind(this.onApiTrackRevisionsChange, this));
|
this.api.asc_registerCallback('asc_onOnTrackRevisionsChange', _.bind(this.onApiTrackRevisionsChange, this));
|
||||||
|
|
@ -161,23 +158,13 @@ define([
|
||||||
this.document = data.doc;
|
this.document = data.doc;
|
||||||
},
|
},
|
||||||
|
|
||||||
SetDisabled: function(state, reviewMode, fillFormMode) {
|
SetDisabled: function(state) {
|
||||||
if (this.dlgChanges)
|
if (this.dlgChanges)
|
||||||
this.dlgChanges.close();
|
this.dlgChanges.close();
|
||||||
if (reviewMode)
|
this.view && this.view.SetDisabled(state, this.langs);
|
||||||
this.lockToolbar(Common.enumLock.previewReviewMode, state);
|
|
||||||
else if (fillFormMode)
|
|
||||||
this.lockToolbar(Common.enumLock.viewFormMode, state);
|
|
||||||
else
|
|
||||||
this.lockToolbar(Common.enumLock.viewMode, state);
|
|
||||||
|
|
||||||
this.setPreviewMode(state);
|
this.setPreviewMode(state);
|
||||||
},
|
},
|
||||||
|
|
||||||
lockToolbar: function (causes, lock, opts) {
|
|
||||||
Common.Utils.lockControls(causes, lock, opts, this.view.getButtons());
|
|
||||||
},
|
|
||||||
|
|
||||||
setPreviewMode: function(mode) { //disable accept/reject in popover
|
setPreviewMode: function(mode) { //disable accept/reject in popover
|
||||||
if (this.viewmode === mode) return;
|
if (this.viewmode === mode) return;
|
||||||
this.viewmode = mode;
|
this.viewmode = mode;
|
||||||
|
|
@ -190,50 +177,20 @@ define([
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
isSelectedChangesLocked: function(changes, isShow) {
|
onApiShowChange: function (sdkchange) {
|
||||||
if (!changes || changes.length<1) return true;
|
|
||||||
|
|
||||||
if (isShow)
|
|
||||||
return changes[0].get('lock') || !changes[0].get('editable');
|
|
||||||
|
|
||||||
for (var i=0; i<changes.length; i++) {
|
|
||||||
var change = changes[i];
|
|
||||||
if (change.get('lock') || !change.get('editable'))
|
|
||||||
return true; // lock button if at least one change is locked
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
onApiShowChange: function (sdkchange, isShow) {
|
|
||||||
var btnlock = true,
|
|
||||||
changes;
|
|
||||||
if (this.appConfig.canReview && !this.appConfig.isReviewOnly) {
|
|
||||||
if (sdkchange && sdkchange.length>0) {
|
|
||||||
changes = this.readSDKChange(sdkchange);
|
|
||||||
btnlock = this.isSelectedChangesLocked(changes, isShow);
|
|
||||||
}
|
|
||||||
if (this._state.lock !== btnlock) {
|
|
||||||
Common.Utils.lockControls(Common.enumLock.reviewChangelock, btnlock, {array: [this.view.btnAccept, this.view.btnReject]});
|
|
||||||
if (this.dlgChanges) {
|
|
||||||
this.dlgChanges.btnAccept.setDisabled(btnlock);
|
|
||||||
this.dlgChanges.btnReject.setDisabled(btnlock);
|
|
||||||
}
|
|
||||||
this._state.lock = btnlock;
|
|
||||||
Common.Utils.InternalSettings.set(this.view.appPrefix + "accept-reject-lock", btnlock);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.getPopover()) {
|
if (this.getPopover()) {
|
||||||
if (!this.appConfig.reviewHoverMode && sdkchange && sdkchange.length>0 && isShow) { // show changes balloon only for current position, not selection
|
if (sdkchange && sdkchange.length>0) {
|
||||||
var i = 0,
|
var i = 0,
|
||||||
|
changes = this.readSDKChange(sdkchange),
|
||||||
posX = sdkchange[0].get_X(),
|
posX = sdkchange[0].get_X(),
|
||||||
posY = sdkchange[0].get_Y(),
|
posY = sdkchange[0].get_Y(),
|
||||||
animate = ( Math.abs(this._state.posx-posX)>0.001 || Math.abs(this._state.posy-posY)>0.001) || (sdkchange.length !== this._state.changes_length),
|
animate = ( Math.abs(this._state.posx-posX)>0.001 || Math.abs(this._state.posy-posY)>0.001) || (sdkchange.length !== this._state.changes_length),
|
||||||
lock = (sdkchange[0].get_LockUserId()!==null),
|
lock = (sdkchange[0].get_LockUserId()!==null),
|
||||||
lockUser = this.getUserName(sdkchange[0].get_LockUserId());
|
lockUser = this.getUserName(sdkchange[0].get_LockUserId()),
|
||||||
|
editable = changes[0].get('editable');
|
||||||
|
|
||||||
this.getPopover().hideTips();
|
this.getPopover().hideTips();
|
||||||
this.popoverChanges.reset(changes || this.readSDKChange(sdkchange));
|
this.popoverChanges.reset(changes);
|
||||||
|
|
||||||
if (animate) {
|
if (animate) {
|
||||||
if ( this.getPopover().isVisible() ) this.getPopover().hide();
|
if ( this.getPopover().isVisible() ) this.getPopover().hide();
|
||||||
|
|
@ -241,6 +198,17 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getPopover().showReview(animate, lock, lockUser);
|
this.getPopover().showReview(animate, lock, lockUser);
|
||||||
|
|
||||||
|
var btnlock = lock || !editable;
|
||||||
|
if (this.appConfig.canReview && !this.appConfig.isReviewOnly && this._state.lock !== btnlock) {
|
||||||
|
this.view.btnAccept.setDisabled(btnlock);
|
||||||
|
this.view.btnReject.setDisabled(btnlock);
|
||||||
|
if (this.dlgChanges) {
|
||||||
|
this.dlgChanges.btnAccept.setDisabled(btnlock);
|
||||||
|
this.dlgChanges.btnReject.setDisabled(btnlock);
|
||||||
|
}
|
||||||
|
this._state.lock = btnlock;
|
||||||
|
}
|
||||||
this._state.posx = posX;
|
this._state.posx = posX;
|
||||||
this._state.posy = posY;
|
this._state.posy = posY;
|
||||||
this._state.changes_length = sdkchange.length;
|
this._state.changes_length = sdkchange.length;
|
||||||
|
|
@ -286,11 +254,7 @@ define([
|
||||||
if ((this.appConfig.canReview || this.appConfig.canViewReview) && _.isUndefined(this.popover)) {
|
if ((this.appConfig.canReview || this.appConfig.canViewReview) && _.isUndefined(this.popover)) {
|
||||||
this.popover = Common.Views.ReviewPopover.prototype.getPopover({
|
this.popover = Common.Views.ReviewPopover.prototype.getPopover({
|
||||||
reviewStore : this.popoverChanges,
|
reviewStore : this.popoverChanges,
|
||||||
renderTo : this.sdkViewName,
|
renderTo : this.sdkViewName
|
||||||
canRequestUsers: (this.appConfig) ? this.appConfig.canRequestUsers : undefined,
|
|
||||||
canRequestSendNotify: (this.appConfig) ? this.appConfig.canRequestSendNotify : undefined,
|
|
||||||
mentionShare: (this.appConfig) ? this.appConfig.mentionShare : true,
|
|
||||||
api: this.api
|
|
||||||
});
|
});
|
||||||
this.popover.setReviewStore(this.popoverChanges);
|
this.popover.setReviewStore(this.popoverChanges);
|
||||||
}
|
}
|
||||||
|
|
@ -550,7 +514,7 @@ define([
|
||||||
if (item.value === 'all') {
|
if (item.value === 'all') {
|
||||||
this.api.asc_AcceptAllChanges();
|
this.api.asc_AcceptAllChanges();
|
||||||
} else {
|
} else {
|
||||||
this.api.asc_AcceptChangesBySelection(true); // accept and move to the next change
|
this.api.asc_AcceptChanges();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.api.asc_AcceptChanges(menu);
|
this.api.asc_AcceptChanges(menu);
|
||||||
|
|
@ -565,7 +529,7 @@ define([
|
||||||
if (item.value === 'all') {
|
if (item.value === 'all') {
|
||||||
this.api.asc_RejectAllChanges();
|
this.api.asc_RejectAllChanges();
|
||||||
} else {
|
} else {
|
||||||
this.api.asc_RejectChangesBySelection(true); // reject and move to the next change
|
this.api.asc_RejectChanges();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.api.asc_RejectChanges(menu);
|
this.api.asc_RejectChanges(menu);
|
||||||
|
|
@ -613,29 +577,23 @@ define([
|
||||||
this.view.turnChanges(state, global);
|
this.view.turnChanges(state, global);
|
||||||
if (userId && this.userCollection) {
|
if (userId && this.userCollection) {
|
||||||
var rec = this.userCollection.findOriginalUser(userId);
|
var rec = this.userCollection.findOriginalUser(userId);
|
||||||
rec && Common.NotificationCenter.trigger('showmessage', {msg: Common.Utils.String.format(globalFlag ? this.textOnGlobal : this.textOffGlobal, AscCommon.UserInfoParser.getParsedName(rec.get('username')))},
|
rec && this.showTips(Common.Utils.String.format(globalFlag ? this.textOnGlobal : this.textOffGlobal, AscCommon.UserInfoParser.getParsedName(rec.get('username'))));
|
||||||
{timeout: 5000, hideCloseTip: true});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onTurnSpelling: function (state, suspend) {
|
onTurnSpelling: function (state) {
|
||||||
state = (state == 'on');
|
state = (state == 'on');
|
||||||
this.view && this.view.turnSpelling(state);
|
this.view.turnSpelling(state);
|
||||||
|
|
||||||
if (Common.UI.FeaturesManager.canChange('spellcheck') && !suspend) {
|
Common.localStorage.setItem(this.view.appPrefix + "settings-spellcheck", state ? 1 : 0);
|
||||||
Common.localStorage.setItem(this.view.appPrefix + "settings-spellcheck", state ? 1 : 0);
|
this.api.asc_setSpellCheck(state);
|
||||||
this.api.asc_setSpellCheck(state);
|
Common.Utils.InternalSettings.set(this.view.appPrefix + "settings-spellcheck", state);
|
||||||
Common.Utils.InternalSettings.set(this.view.appPrefix + "settings-spellcheck", state);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onReviewViewClick: function(menu, item, e) {
|
onReviewViewClick: function(menu, item, e) {
|
||||||
this.turnDisplayMode(item.value);
|
this.turnDisplayMode(item.value);
|
||||||
if (!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit)
|
!this.appConfig.canReview && Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value);
|
||||||
Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value); // for viewer
|
|
||||||
else if (item.value=='markup' || item.value=='simple')
|
|
||||||
Common.localStorage.setItem(this.view.appPrefix + "review-mode-editor", item.value); // for editor save only markup modes
|
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -725,42 +683,17 @@ define([
|
||||||
|
|
||||||
turnDisplayMode: function(mode) {
|
turnDisplayMode: function(mode) {
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
var type = Asc.c_oAscDisplayModeInReview.Edit;
|
if (mode === 'final')
|
||||||
switch (mode) {
|
this.api.asc_BeginViewModeInReview(true);
|
||||||
case 'final':
|
else if (mode === 'original')
|
||||||
type = Asc.c_oAscDisplayModeInReview.Final;
|
this.api.asc_BeginViewModeInReview(false);
|
||||||
break;
|
else
|
||||||
case 'original':
|
this.api.asc_EndViewModeInReview();
|
||||||
type = Asc.c_oAscDisplayModeInReview.Original;
|
|
||||||
break;
|
|
||||||
case 'simple':
|
|
||||||
type = Asc.c_oAscDisplayModeInReview.Simple;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
this.api.asc_SetDisplayModeInReview(type);
|
|
||||||
}
|
}
|
||||||
this.disableEditing(mode == 'final' || mode == 'original');
|
this.disableEditing(mode == 'final' || mode == 'original');
|
||||||
this._state.previewMode = (mode == 'final' || mode == 'original');
|
this._state.previewMode = (mode == 'final' || mode == 'original');
|
||||||
},
|
},
|
||||||
|
|
||||||
onChangeDisplayModeInReview: function(type) {
|
|
||||||
this.disableEditing(type===Asc.c_oAscDisplayModeInReview.Final || type===Asc.c_oAscDisplayModeInReview.Original);
|
|
||||||
var mode = 'markup';
|
|
||||||
switch (type) {
|
|
||||||
case Asc.c_oAscDisplayModeInReview.Final:
|
|
||||||
mode = 'final';
|
|
||||||
break;
|
|
||||||
case Asc.c_oAscDisplayModeInReview.Original:
|
|
||||||
mode = 'original';
|
|
||||||
break;
|
|
||||||
case Asc.c_oAscDisplayModeInReview.Simple:
|
|
||||||
mode = 'simple';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
this.view && this.view.turnDisplayMode(mode);
|
|
||||||
this._state.previewMode = (type===Asc.c_oAscDisplayModeInReview.Final || type===Asc.c_oAscDisplayModeInReview.Original);
|
|
||||||
},
|
|
||||||
|
|
||||||
isPreviewChangesMode: function() {
|
isPreviewChangesMode: function() {
|
||||||
return this._state.previewMode;
|
return this._state.previewMode;
|
||||||
},
|
},
|
||||||
|
|
@ -798,24 +731,33 @@ define([
|
||||||
Common.NotificationCenter.trigger('editing:disable', disable, {
|
Common.NotificationCenter.trigger('editing:disable', disable, {
|
||||||
viewMode: false,
|
viewMode: false,
|
||||||
reviewMode: true,
|
reviewMode: true,
|
||||||
fillFormMode: false,
|
fillFormwMode: false,
|
||||||
allowMerge: false,
|
allowMerge: false,
|
||||||
allowSignature: false,
|
allowSignature: false,
|
||||||
allowProtect: false,
|
allowProtect: false,
|
||||||
rightMenu: {clear: disable, disable: true},
|
rightMenu: {clear: true, disable: true},
|
||||||
statusBar: true,
|
statusBar: true,
|
||||||
leftMenu: {disable: false, previewMode: true},
|
leftMenu: {disable: false, previewMode: true},
|
||||||
fileMenu: {protect: true},
|
fileMenu: {protect: true},
|
||||||
navigation: {disable: false, previewMode: true},
|
navigation: {disable: false, previewMode: true},
|
||||||
comments: {disable: false, previewMode: true},
|
comments: {disable: false, previewMode: true},
|
||||||
chat: false,
|
chat: false,
|
||||||
review: true,
|
review: false,
|
||||||
viewport: false,
|
viewport: false,
|
||||||
documentHolder: true,
|
documentHolder: true,
|
||||||
toolbar: true,
|
toolbar: true,
|
||||||
plugins: true,
|
plugins: true
|
||||||
protect: true
|
|
||||||
}, 'review');
|
}, 'review');
|
||||||
|
|
||||||
|
if (this.view) {
|
||||||
|
this.view.$el.find('.no-group-mask.review').css('opacity', 1);
|
||||||
|
|
||||||
|
this.view.btnsDocLang && this.view.btnsDocLang.forEach(function(button) {
|
||||||
|
if ( button ) {
|
||||||
|
button.setDisabled(disable || !this.langs || this.langs.length<1);
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
createToolbarPanel: function() {
|
createToolbarPanel: function() {
|
||||||
|
|
@ -829,6 +771,9 @@ define([
|
||||||
|
|
||||||
onAppReady: function (config) {
|
onAppReady: function (config) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
if ( me.view && Common.localStorage.getBool(me.view.appPrefix + "settings-spellcheck", !(config.customization && config.customization.spellcheck===false)))
|
||||||
|
me.view.turnSpelling(true);
|
||||||
|
|
||||||
if ( config.canReview ) {
|
if ( config.canReview ) {
|
||||||
(new Promise(function (resolve) {
|
(new Promise(function (resolve) {
|
||||||
resolve();
|
resolve();
|
||||||
|
|
@ -839,27 +784,16 @@ define([
|
||||||
// Common.Utils.InternalSettings.set(me.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0));
|
// Common.Utils.InternalSettings.set(me.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0));
|
||||||
// };
|
// };
|
||||||
|
|
||||||
var trackChanges = me.appConfig.customization && me.appConfig.customization.review ? me.appConfig.customization.review.trackChanges : undefined;
|
var trackChanges = typeof (me.appConfig.customization) == 'object' ? me.appConfig.customization.trackChanges : undefined;
|
||||||
(trackChanges===undefined) && (trackChanges = me.appConfig.customization ? me.appConfig.customization.trackChanges : undefined);
|
|
||||||
|
|
||||||
if (config.isReviewOnly || trackChanges!==undefined)
|
if (config.isReviewOnly || trackChanges!==undefined)
|
||||||
me.api.asc_SetLocalTrackRevisions(config.isReviewOnly || trackChanges===true);
|
me.api.asc_SetLocalTrackRevisions(config.isReviewOnly || trackChanges===true);
|
||||||
else
|
else
|
||||||
me.onApiTrackRevisionsChange(me.api.asc_GetLocalTrackRevisions(), me.api.asc_GetGlobalTrackRevisions());
|
me.onApiTrackRevisionsChange(me.api.asc_GetLocalTrackRevisions(), me.api.asc_GetGlobalTrackRevisions());
|
||||||
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
|
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
|
||||||
|
|
||||||
var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode-editor");
|
// _setReviewStatus(state, global);
|
||||||
if (val===null) {
|
|
||||||
val = me.appConfig.customization && me.appConfig.customization.review ? me.appConfig.customization.review.reviewDisplay : undefined;
|
|
||||||
!val && (val = me.appConfig.customization ? me.appConfig.customization.reviewDisplay : undefined);
|
|
||||||
val = /^(original|final|markup|simple)$/i.test(val) ? val.toLocaleLowerCase() : 'markup';
|
|
||||||
}
|
|
||||||
|
|
||||||
me.turnDisplayMode(val); // load display mode for all modes (viewer or editor)
|
if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.showReviewChanges==true) ) {
|
||||||
me.view.turnDisplayMode(val);
|
|
||||||
|
|
||||||
if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.review && me.appConfig.customization.review.showReviewChanges==true ||
|
|
||||||
(!me.appConfig.customization.review || me.appConfig.customization.review.showReviewChanges===undefined) && me.appConfig.customization.showReviewChanges==true) ) {
|
|
||||||
me.dlgChanges = (new Common.Views.ReviewChangesDialog({
|
me.dlgChanges = (new Common.Views.ReviewChangesDialog({
|
||||||
popoverChanges : me.popoverChanges,
|
popoverChanges : me.popoverChanges,
|
||||||
mode : me.appConfig
|
mode : me.appConfig
|
||||||
|
|
@ -872,14 +806,11 @@ define([
|
||||||
} else if (config.canViewReview) {
|
} else if (config.canViewReview) {
|
||||||
config.canViewReview = (config.isEdit || me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users
|
config.canViewReview = (config.isEdit || me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users
|
||||||
if (config.canViewReview) {
|
if (config.canViewReview) {
|
||||||
var val = Common.localStorage.getItem(me.view.appPrefix + (config.isEdit || config.isRestrictedEdit ? "review-mode-editor" : "review-mode"));
|
var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode");
|
||||||
if (val===null) {
|
if (val===null)
|
||||||
val = me.appConfig.customization && me.appConfig.customization.review ? me.appConfig.customization.review.reviewDisplay : undefined;
|
val = me.appConfig.customization && /^(original|final|markup)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : 'original';
|
||||||
!val && (val = me.appConfig.customization ? me.appConfig.customization.reviewDisplay : undefined);
|
me.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); // load display mode only in viewer
|
||||||
val = /^(original|final|markup|simple)$/i.test(val) ? val.toLocaleLowerCase() : (config.isEdit || config.isRestrictedEdit ? 'markup' : 'original');
|
me.view.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val);
|
||||||
}
|
|
||||||
me.turnDisplayMode(val);
|
|
||||||
me.view.turnDisplayMode(val);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -889,26 +820,50 @@ define([
|
||||||
me.view.turnChat(state);
|
me.view.turnChat(state);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
me.onChangeProtectSheet();
|
|
||||||
if (me.view) {
|
if (me.view) {
|
||||||
me.lockToolbar(Common.enumLock.hideComments, !Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true), {array: [me.view.btnCommentRemove, me.view.btnCommentResolve]});
|
me.view.btnCommentRemove && me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true));
|
||||||
me.lockToolbar(Common.enumLock['Objects'], !!this._state.wsProps['Objects'], {array: [me.view.btnCommentRemove, me.view.btnCommentResolve]});
|
me.view.btnCommentResolve && me.view.btnCommentResolve.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
showTips: function(strings) {
|
||||||
|
var me = this;
|
||||||
|
if (!strings.length) return;
|
||||||
|
if (typeof(strings)!='object') strings = [strings];
|
||||||
|
|
||||||
|
function showNextTip() {
|
||||||
|
var str_tip = strings.shift();
|
||||||
|
if (str_tip) {
|
||||||
|
me.tooltip.setTitle(str_tip);
|
||||||
|
me.tooltip.show();
|
||||||
|
me.tipTimeout = setTimeout(function () {
|
||||||
|
me.tooltip.hide();
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var val = Common.localStorage.getItem(me.view.appPrefix + "settings-review-hover-mode");
|
if (!this.tooltip) {
|
||||||
if (val === null) {
|
this.tooltip = new Common.UI.Tooltip({
|
||||||
val = me.appConfig.customization && me.appConfig.customization.review ? !!me.appConfig.customization.review.hoverMode : false;
|
owner: this.getApplication().getController('Toolbar').getView(),
|
||||||
} else
|
hideonclick: true,
|
||||||
val = !!parseInt(val);
|
placement: 'bottom',
|
||||||
Common.Utils.InternalSettings.set(me.view.appPrefix + "settings-review-hover-mode", val);
|
cls: 'main-info',
|
||||||
me.appConfig.reviewHoverMode = val;
|
offset: 30
|
||||||
|
});
|
||||||
|
this.tooltip.on('tooltip:hide', function(cmp){
|
||||||
|
if (cmp==me.tooltip) {
|
||||||
|
clearTimeout(me.tipTimeout);
|
||||||
|
setTimeout(showNextTip, 300);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
showNextTip();
|
||||||
},
|
},
|
||||||
|
|
||||||
applySettings: function(menu) {
|
applySettings: function(menu) {
|
||||||
this.view && this.view.turnSpelling( Common.localStorage.getBool(this.view.appPrefix + "settings-spellcheck", true) );
|
this.view && this.view.turnSpelling( Common.localStorage.getBool(this.view.appPrefix + "settings-spellcheck", true) );
|
||||||
this.view && this.view.turnCoAuthMode( Common.localStorage.getBool(this.view.appPrefix + "settings-coauthmode", true) );
|
this.view && this.view.turnCoAuthMode( Common.localStorage.getBool(this.view.appPrefix + "settings-coauthmode", true) );
|
||||||
if ((this.appConfig.canReview || this.appConfig.canViewReview) && this.appConfig.reviewHoverMode)
|
|
||||||
this.onApiShowChange();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
synchronizeChanges: function() {
|
synchronizeChanges: function() {
|
||||||
|
|
@ -919,7 +874,11 @@ define([
|
||||||
|
|
||||||
setLanguages: function (array) {
|
setLanguages: function (array) {
|
||||||
this.langs = array;
|
this.langs = array;
|
||||||
this.lockToolbar(Common.enumLock.noSpellcheckLangs, this.langs.length<1, {array: this.view.btnsDocLang});
|
this.view && this.view.btnsDocLang && this.view.btnsDocLang.forEach(function(button) {
|
||||||
|
if ( button ) {
|
||||||
|
button.setDisabled(this.langs.length<1);
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
onDocLanguage: function() {
|
onDocLanguage: function() {
|
||||||
|
|
@ -939,7 +898,6 @@ define([
|
||||||
onLostEditRights: function() {
|
onLostEditRights: function() {
|
||||||
this._readonlyRights = true;
|
this._readonlyRights = true;
|
||||||
this.view && this.view.onLostEditRights();
|
this.view && this.view.onLostEditRights();
|
||||||
this.view && this.lockToolbar(Common.enumLock.cantShare, true, {array: [this.view.btnSharing]});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
changeAccessRights: function(btn,event,opts) {
|
changeAccessRights: function(btn,event,opts) {
|
||||||
|
|
@ -971,7 +929,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onCoAuthoringDisconnect: function() {
|
onCoAuthoringDisconnect: function() {
|
||||||
this.lockToolbar(Common.enumLock.lostConnect, true)
|
this.SetDisabled(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
onUpdateUsers: function() {
|
onUpdateUsers: function() {
|
||||||
|
|
@ -989,26 +947,15 @@ define([
|
||||||
if (!item.asc_getView())
|
if (!item.asc_getView())
|
||||||
length++;
|
length++;
|
||||||
});
|
});
|
||||||
Common.Utils.lockControls(Common.enumLock.hasCoeditingUsers, length>1, {array: [this.view.btnCompare]});
|
this.view.btnCompare.setDisabled(length>1 || this.viewmode);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
commentsShowHide: function(mode) {
|
commentsShowHide: function(mode) {
|
||||||
if (!this.view) return;
|
if (!this.view) return;
|
||||||
var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment");
|
var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment");
|
||||||
(value!==undefined) && this.lockToolbar(Common.enumLock.hideComments, mode != 'show' && !value, {array: [this.view.btnCommentRemove, this.view.btnCommentResolve]});
|
(value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(mode != 'show' && !value);
|
||||||
},
|
(value!==undefined) && this.view.btnCommentResolve && this.view.btnCommentResolve.setDisabled(mode != 'show' && !value);
|
||||||
|
|
||||||
onChangeProtectSheet: function(props) {
|
|
||||||
if (!props) {
|
|
||||||
var wbprotect = this.getApplication().getController('WBProtection');
|
|
||||||
props = wbprotect ? wbprotect.getWSProps() : null;
|
|
||||||
}
|
|
||||||
this._state.wsProps = props ? props.wsProps : [];
|
|
||||||
this._state.wsLock = props ? props.wsLock : false;
|
|
||||||
|
|
||||||
if (!this.view) return;
|
|
||||||
this.lockToolbar(Common.enumLock['Objects'], !!this._state.wsProps['Objects'], {array: [this.view.btnCommentRemove, this.view.btnCommentResolve]});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
textInserted: '<b>Inserted:</b>',
|
textInserted: '<b>Inserted:</b>',
|
||||||
|
|
|
||||||
|
|
@ -11,16 +11,7 @@ define([
|
||||||
|
|
||||||
Common.UI.Themes = new (function(locale) {
|
Common.UI.Themes = new (function(locale) {
|
||||||
!locale && (locale = {});
|
!locale && (locale = {});
|
||||||
|
|
||||||
const THEME_TYPE_LIGHT = 'light';
|
|
||||||
const THEME_TYPE_DARK = 'dark';
|
|
||||||
const THEME_TYPE_SYSTEM = 'system';
|
|
||||||
var themes_map = {
|
var themes_map = {
|
||||||
'theme-system': {
|
|
||||||
text: locale.txtThemeSystem || 'Same as system',
|
|
||||||
type: THEME_TYPE_SYSTEM,
|
|
||||||
source: 'static',
|
|
||||||
},
|
|
||||||
'theme-light': {
|
'theme-light': {
|
||||||
text: locale.txtThemeLight || 'Light',
|
text: locale.txtThemeLight || 'Light',
|
||||||
type: 'light',
|
type: 'light',
|
||||||
|
|
@ -36,20 +27,13 @@ define([
|
||||||
type: 'dark',
|
type: 'dark',
|
||||||
source: 'static',
|
source: 'static',
|
||||||
},
|
},
|
||||||
'theme-contrast-dark': {
|
|
||||||
text: locale.txtThemeContrastDark || 'Dark Contrast',
|
|
||||||
type: 'dark',
|
|
||||||
source: 'static',
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !!window.currentLoaderTheme ) {
|
if ( !!window.currentLoaderTheme ) {
|
||||||
if ( !themes_map[currentLoaderTheme.id] )
|
themes_map[currentLoaderTheme.id] = {};
|
||||||
themes_map[currentLoaderTheme.id] = currentLoaderTheme;
|
|
||||||
window.currentLoaderTheme = undefined;
|
window.currentLoaderTheme = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
var is_dark_mode_allowed = true;
|
|
||||||
var id_default_light_theme = 'theme-classic-light',
|
var id_default_light_theme = 'theme-classic-light',
|
||||||
id_default_dark_theme = 'theme-dark';
|
id_default_dark_theme = 'theme-dark';
|
||||||
|
|
||||||
|
|
@ -58,10 +42,6 @@ define([
|
||||||
"toolbar-header-spreadsheet",
|
"toolbar-header-spreadsheet",
|
||||||
"toolbar-header-presentation",
|
"toolbar-header-presentation",
|
||||||
|
|
||||||
"text-toolbar-header-on-background-document",
|
|
||||||
"text-toolbar-header-on-background-spreadsheet",
|
|
||||||
"text-toolbar-header-on-background-presentation",
|
|
||||||
|
|
||||||
"background-normal",
|
"background-normal",
|
||||||
"background-toolbar",
|
"background-toolbar",
|
||||||
"background-toolbar-additional",
|
"background-toolbar-additional",
|
||||||
|
|
@ -71,9 +51,6 @@ define([
|
||||||
"background-notification-badge",
|
"background-notification-badge",
|
||||||
"background-scrim",
|
"background-scrim",
|
||||||
"background-loader",
|
"background-loader",
|
||||||
"background-accent-button",
|
|
||||||
"background-contrast-popover",
|
|
||||||
"shadow-contrast-popover",
|
|
||||||
|
|
||||||
"highlight-button-hover",
|
"highlight-button-hover",
|
||||||
"highlight-button-pressed",
|
"highlight-button-pressed",
|
||||||
|
|
@ -83,8 +60,6 @@ define([
|
||||||
"highlight-header-button-pressed",
|
"highlight-header-button-pressed",
|
||||||
"highlight-toolbar-tab-underline",
|
"highlight-toolbar-tab-underline",
|
||||||
"highlight-text-select",
|
"highlight-text-select",
|
||||||
"highlight-accent-button-hover",
|
|
||||||
"highlight-accent-button-pressed",
|
|
||||||
|
|
||||||
"border-toolbar",
|
"border-toolbar",
|
||||||
"border-divider",
|
"border-divider",
|
||||||
|
|
@ -95,7 +70,6 @@ define([
|
||||||
"border-control-focus",
|
"border-control-focus",
|
||||||
"border-color-shading",
|
"border-color-shading",
|
||||||
"border-error",
|
"border-error",
|
||||||
"border-contrast-popover",
|
|
||||||
|
|
||||||
"text-normal",
|
"text-normal",
|
||||||
"text-normal-pressed",
|
"text-normal-pressed",
|
||||||
|
|
@ -108,7 +82,6 @@ define([
|
||||||
"text-inverse",
|
"text-inverse",
|
||||||
"text-toolbar-header",
|
"text-toolbar-header",
|
||||||
"text-contrast-background",
|
"text-contrast-background",
|
||||||
"text-alt-key-hint",
|
|
||||||
|
|
||||||
"icon-normal",
|
"icon-normal",
|
||||||
"icon-normal-pressed",
|
"icon-normal-pressed",
|
||||||
|
|
@ -123,7 +96,6 @@ define([
|
||||||
"canvas-page-border",
|
"canvas-page-border",
|
||||||
|
|
||||||
"canvas-ruler-background",
|
"canvas-ruler-background",
|
||||||
"canvas-ruler-border",
|
|
||||||
"canvas-ruler-margins-background",
|
"canvas-ruler-margins-background",
|
||||||
"canvas-ruler-mark",
|
"canvas-ruler-mark",
|
||||||
"canvas-ruler-handle-border",
|
"canvas-ruler-handle-border",
|
||||||
|
|
@ -145,8 +117,6 @@ define([
|
||||||
"canvas-dark-cell-title-border",
|
"canvas-dark-cell-title-border",
|
||||||
"canvas-dark-cell-title-border-hover",
|
"canvas-dark-cell-title-border-hover",
|
||||||
"canvas-dark-cell-title-border-selected",
|
"canvas-dark-cell-title-border-selected",
|
||||||
"canvas-dark-content-background",
|
|
||||||
"canvas-dark-page-border",
|
|
||||||
|
|
||||||
"canvas-scroll-thumb",
|
"canvas-scroll-thumb",
|
||||||
"canvas-scroll-thumb-hover",
|
"canvas-scroll-thumb-hover",
|
||||||
|
|
@ -196,13 +166,10 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
var parse_themes_object = function (obj) {
|
var parse_themes_object = function (obj) {
|
||||||
var curr_lang = Common.Locale.getCurrentLanguage(),
|
|
||||||
theme_label;
|
|
||||||
if ( !!obj.themes && obj.themes instanceof Array ) {
|
if ( !!obj.themes && obj.themes instanceof Array ) {
|
||||||
obj.themes.forEach(function (item) {
|
obj.themes.forEach(function (item) {
|
||||||
if ( !!item.id ) {
|
if ( !!item.id ) {
|
||||||
theme_label = !item.l10n || !item.l10n[curr_lang] ? item.name : item.l10n[curr_lang];
|
themes_map[item.id] = {text: item.name, type: item.type};
|
||||||
themes_map[item.id] = {text: theme_label, type: item.type};
|
|
||||||
write_theme_css(create_colors_css(item.id, item.colors));
|
write_theme_css(create_colors_css(item.id, item.colors));
|
||||||
} else
|
} else
|
||||||
if ( typeof item == 'string' ) {
|
if ( typeof item == 'string' ) {
|
||||||
|
|
@ -211,12 +178,9 @@ define([
|
||||||
});
|
});
|
||||||
} else
|
} else
|
||||||
if ( obj.id ) {
|
if ( obj.id ) {
|
||||||
theme_label = !obj.l10n || !obj.l10n[curr_lang] ? obj.name : obj.l10n[curr_lang];
|
themes_map[obj.id] = {text: obj.name, type: obj.type};
|
||||||
themes_map[obj.id] = {text: theme_label, type: obj.type};
|
|
||||||
write_theme_css( create_colors_css(obj.id, obj.colors) );
|
write_theme_css( create_colors_css(obj.id, obj.colors) );
|
||||||
}
|
}
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('uitheme:countchanged');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var get_themes_config = function (url) {
|
var get_themes_config = function (url) {
|
||||||
|
|
@ -224,8 +188,6 @@ define([
|
||||||
function ( obj ) {
|
function ( obj ) {
|
||||||
if ( obj != 'error' ) {
|
if ( obj != 'error' ) {
|
||||||
parse_themes_object(obj);
|
parse_themes_object(obj);
|
||||||
} else {
|
|
||||||
console.warn('failed to load/parse themes.json');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -255,9 +217,7 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
var on_document_ready = function (el) {
|
var on_document_ready = function (el) {
|
||||||
// get_themes_config('../../common/main/resources/themes/themes.json');
|
get_themes_config('../../common/main/resources/themes/themes.json');
|
||||||
if ( !Common.Controllers.Desktop.isActive() || !Common.Controllers.Desktop.isOffline() )
|
|
||||||
get_themes_config('../../../../themes.json');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var get_ui_theme_name = function (objtheme) {
|
var get_ui_theme_name = function (objtheme) {
|
||||||
|
|
@ -273,65 +233,18 @@ define([
|
||||||
return objtheme;
|
return objtheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
var on_document_open = function (data) {
|
|
||||||
if ( !!this.api.asc_setContentDarkMode && this.isDarkTheme() ) {
|
|
||||||
this.api.asc_setContentDarkMode(this.isContentThemeDark());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const is_theme_type_system = function (id) { return themes_map[id].type == THEME_TYPE_SYSTEM; }
|
|
||||||
const get_system_theme_type = function () { return window.matchMedia('(prefers-color-scheme: dark)').matches ? THEME_TYPE_DARK : THEME_TYPE_LIGHT; }
|
|
||||||
const get_system_default_theme = function () {
|
|
||||||
const id = get_system_theme_type() == THEME_TYPE_DARK ?
|
|
||||||
id_default_dark_theme : id_default_light_theme;
|
|
||||||
|
|
||||||
return {id: id, info: themes_map[id]};
|
|
||||||
};
|
|
||||||
|
|
||||||
const on_system_theme_dark = function (mql) {
|
|
||||||
if (Common.localStorage.getBool('ui-theme-use-system', false)) {
|
|
||||||
this.setTheme('theme-system');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init: function (api) {
|
init: function (api) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
Common.Gateway.on('opendocument', on_document_open.bind(this));
|
|
||||||
$(window).on('storage', function (e) {
|
$(window).on('storage', function (e) {
|
||||||
if ( e.key == 'ui-theme' || e.key == 'ui-theme-id' ) {
|
if ( e.key == 'ui-theme' || e.key == 'ui-theme-id' ) {
|
||||||
if ( !!e.originalEvent.newValue ) {
|
me.setTheme(e.originalEvent.newValue, true);
|
||||||
if (Common.localStorage.getBool('ui-theme-use-system', false)) {
|
|
||||||
me.setTheme('theme-system');
|
|
||||||
} else me.setTheme(e.originalEvent.newValue, true);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
if ( e.key == 'content-theme' ) {
|
|
||||||
me.setContentTheme(e.originalEvent.newValue, true);
|
|
||||||
console.log('changed content', e.originalEvent.newValue);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.api = api;
|
this.api = api;
|
||||||
var theme_name = get_ui_theme_name(Common.localStorage.getItem('ui-theme'));
|
var theme_name = get_ui_theme_name(Common.localStorage.getItem('ui-theme'));
|
||||||
if ( !theme_name ) {
|
|
||||||
if ( !(Common.Utils.isIE10 || Common.Utils.isIE11) )
|
|
||||||
document.body.classList.forEach(function (classname, i, o) {
|
|
||||||
if ( !theme_name && classname.startsWith('theme-') &&
|
|
||||||
!classname.startsWith('theme-type-') && themes_map[classname] )
|
|
||||||
{
|
|
||||||
theme_name = classname;
|
|
||||||
var theme_obj = {
|
|
||||||
id: theme_name,
|
|
||||||
type: themes_map[theme_name].type
|
|
||||||
};
|
|
||||||
|
|
||||||
Common.localStorage.setItem('ui-theme', JSON.stringify(theme_obj));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !themes_map[theme_name] )
|
if ( !themes_map[theme_name] )
|
||||||
theme_name = id_default_light_theme;
|
theme_name = id_default_light_theme;
|
||||||
|
|
||||||
|
|
@ -348,8 +261,6 @@ define([
|
||||||
obj.name = theme_name;
|
obj.name = theme_name;
|
||||||
api.asc_setSkin(obj);
|
api.asc_setSkin(obj);
|
||||||
|
|
||||||
if ( !(Common.Utils.isIE10 || Common.Utils.isIE11) )
|
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', on_system_theme_dark.bind(this));
|
|
||||||
Common.NotificationCenter.on('document:ready', on_document_ready.bind(this));
|
Common.NotificationCenter.on('document:ready', on_document_ready.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -370,12 +281,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
currentThemeId: function () {
|
currentThemeId: function () {
|
||||||
if ( Common.localStorage.getBool('ui-theme-use-system', false) )
|
return get_ui_theme_name(Common.localStorage.getItem('ui-theme')) || id_default_light_theme;
|
||||||
return 'theme-system';
|
|
||||||
|
|
||||||
var t = Common.localStorage.getItem('ui-theme') || Common.localStorage.getItem('ui-theme-id');
|
|
||||||
var id = get_ui_theme_name(t);
|
|
||||||
return !!themes_map[id] ? id : id_default_light_theme;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
defaultThemeId: function (type) {
|
defaultThemeId: function (type) {
|
||||||
|
|
@ -386,86 +292,17 @@ define([
|
||||||
return themes_map[this.defaultThemeId(type)]
|
return themes_map[this.defaultThemeId(type)]
|
||||||
},
|
},
|
||||||
|
|
||||||
isDarkTheme: function (id) {
|
isDarkTheme: function () {
|
||||||
!id && (id = this.currentThemeId());
|
return themes_map[this.currentThemeId()].type == 'dark';
|
||||||
return (is_theme_type_system(id) ? get_system_default_theme().info.type : themes_map[id].type) == THEME_TYPE_DARK;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
isContentThemeDark: function () {
|
setTheme: function (obj, force) {
|
||||||
return Common.localStorage.getItem("content-theme") == 'dark';
|
var id = get_ui_theme_name(obj);
|
||||||
},
|
if ( (this.currentThemeId() != id || force) && !!themes_map[id] ) {
|
||||||
|
|
||||||
setContentTheme: function (mode, force) {
|
|
||||||
var set_dark = mode == 'dark';
|
|
||||||
if ( set_dark && !this.isDarkTheme() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( set_dark != this.isContentThemeDark() || force ) {
|
|
||||||
if ( this.api.asc_setContentDarkMode )
|
|
||||||
this.api.asc_setContentDarkMode(set_dark);
|
|
||||||
|
|
||||||
if ( Common.localStorage.getItem('content-theme') != mode )
|
|
||||||
Common.localStorage.setItem('content-theme', mode);
|
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('contenttheme:dark', set_dark);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
toggleContentTheme: function () {
|
|
||||||
var is_current_dark = this.isContentThemeDark();
|
|
||||||
is_current_dark ? Common.localStorage.setItem('content-theme', 'light') : Common.localStorage.setItem('content-theme', 'dark');
|
|
||||||
|
|
||||||
if ( this.api.asc_setContentDarkMode )
|
|
||||||
this.api.asc_setContentDarkMode(!is_current_dark);
|
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('contenttheme:dark', !is_current_dark);
|
|
||||||
},
|
|
||||||
|
|
||||||
setTheme: function (obj) {
|
|
||||||
if ( !obj ) return;
|
|
||||||
|
|
||||||
var id = get_ui_theme_name(obj),
|
|
||||||
refresh_only = arguments[1];
|
|
||||||
|
|
||||||
if ( !refresh_only && is_theme_type_system(this.currentThemeId()) ) {
|
|
||||||
// TODO: need refactoring. for bug 58801
|
|
||||||
if ( get_system_default_theme().id == id ) {
|
|
||||||
Common.localStorage.setBool('ui-theme-use-system', false);
|
|
||||||
Common.localStorage.setItem('ui-theme-id', '');
|
|
||||||
Common.localStorage.setItem('ui-theme-id', id);
|
|
||||||
Common.NotificationCenter.trigger('uitheme:changed', id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( is_theme_type_system(id) ) {
|
|
||||||
if ( get_system_default_theme().id == this.currentThemeId() ) {
|
|
||||||
Common.localStorage.setBool('ui-theme-use-system', true);
|
|
||||||
Common.localStorage.setItem('ui-theme-id', '');
|
|
||||||
Common.localStorage.setItem('ui-theme-id', id);
|
|
||||||
Common.NotificationCenter.trigger('uitheme:changed', id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Common.localStorage.setBool('ui-theme-use-system', true);
|
|
||||||
id = get_system_default_theme().id;
|
|
||||||
} else {
|
|
||||||
Common.localStorage.setBool('ui-theme-use-system', false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( (this.currentThemeId() != id || refresh_only) && !!themes_map[id] ) {
|
|
||||||
document.body.className = document.body.className.replace(/theme-[\w-]+\s?/gi, '').trim();
|
document.body.className = document.body.className.replace(/theme-[\w-]+\s?/gi, '').trim();
|
||||||
document.body.classList.add(id, 'theme-type-' + themes_map[id].type);
|
document.body.classList.add(id, 'theme-type-' + themes_map[id].type);
|
||||||
|
|
||||||
if ( this.api ) {
|
if ( this.api ) {
|
||||||
if ( this.api.asc_setContentDarkMode && is_dark_mode_allowed )
|
|
||||||
if ( themes_map[id].type == 'light' ) {
|
|
||||||
this.api.asc_setContentDarkMode(false);
|
|
||||||
} else {
|
|
||||||
this.api.asc_setContentDarkMode(this.isContentThemeDark());
|
|
||||||
Common.NotificationCenter.trigger('contenttheme:dark', this.isContentThemeDark());
|
|
||||||
}
|
|
||||||
|
|
||||||
var obj = get_current_theme_colors(name_colors);
|
var obj = get_current_theme_colors(name_colors);
|
||||||
obj.type = themes_map[id].type;
|
obj.type = themes_map[id].type;
|
||||||
obj.name = id;
|
obj.name = id;
|
||||||
|
|
@ -477,19 +314,16 @@ define([
|
||||||
var theme_obj = {
|
var theme_obj = {
|
||||||
id: id,
|
id: id,
|
||||||
type: obj.type,
|
type: obj.type,
|
||||||
text: themes_map[id].text,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( themes_map[id].source != 'static' ) {
|
if ( themes_map[id].source != 'static' ) {
|
||||||
theme_obj.colors = obj;
|
theme_obj.colors = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !refresh_only )
|
Common.localStorage.setItem('ui-theme', JSON.stringify(theme_obj));
|
||||||
Common.localStorage.setItem('ui-theme', JSON.stringify(theme_obj));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !refresh_only )
|
Common.localStorage.setItem('ui-theme-id', id);
|
||||||
Common.localStorage.setItem('ui-theme-id', id);
|
|
||||||
Common.NotificationCenter.trigger('uitheme:changed', id);
|
Common.NotificationCenter.trigger('uitheme:changed', id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,7 @@
|
||||||
return _MAP[x] || x.toUpperCase().charCodeAt(0);
|
return _MAP[x] || x.toUpperCase().charCodeAt(0);
|
||||||
},
|
},
|
||||||
_downKeys = [];
|
_downKeys = [];
|
||||||
var locked,
|
var locked;
|
||||||
propagate;
|
|
||||||
|
|
||||||
for(k=1;k<20;k++) _MAP['f'+k] = 111+k;
|
for(k=1;k<20;k++) _MAP['f'+k] = 111+k;
|
||||||
|
|
||||||
|
|
@ -72,14 +71,6 @@
|
||||||
var key, handler, k, i, modifiersMatch, scope;
|
var key, handler, k, i, modifiersMatch, scope;
|
||||||
key = event.keyCode;
|
key = event.keyCode;
|
||||||
|
|
||||||
if (Common.UI.HintManager && Common.UI.HintManager.isHintVisible()) {
|
|
||||||
if (key === 112) {
|
|
||||||
Common.UI.HintManager.clearHints();
|
|
||||||
} else if (key !== 27) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index(_downKeys, key) == -1) {
|
if (index(_downKeys, key) == -1) {
|
||||||
_downKeys.push(key);
|
_downKeys.push(key);
|
||||||
}
|
}
|
||||||
|
|
@ -117,8 +108,6 @@
|
||||||
// call the handler and stop the event if neccessary
|
// call the handler and stop the event if neccessary
|
||||||
if((handler.mods.length == 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91]) || modifiersMatch){
|
if((handler.mods.length == 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91]) || modifiersMatch){
|
||||||
if(locked===true || handler.locked || handler.method(event, handler)===false){
|
if(locked===true || handler.locked || handler.method(event, handler)===false){
|
||||||
if (locked===true && propagate || handler.locked && handler.propagate)
|
|
||||||
continue;
|
|
||||||
if(event.preventDefault) event.preventDefault();
|
if(event.preventDefault) event.preventDefault();
|
||||||
else event.returnValue = false;
|
else event.returnValue = false;
|
||||||
if(event.stopPropagation) event.stopPropagation();
|
if(event.stopPropagation) event.stopPropagation();
|
||||||
|
|
@ -191,8 +180,8 @@
|
||||||
|
|
||||||
if (keys.length > 1) {
|
if (keys.length > 1) {
|
||||||
mods = getMods(keys);
|
mods = getMods(keys);
|
||||||
|
key = keys[keys.length - 1];
|
||||||
}
|
}
|
||||||
(keys.length > 0) && (key = keys[keys.length - 1]);
|
|
||||||
|
|
||||||
key = code(key);
|
key = code(key);
|
||||||
|
|
||||||
|
|
@ -304,8 +293,8 @@
|
||||||
|
|
||||||
if (keys.length > 1) {
|
if (keys.length > 1) {
|
||||||
mods = getMods(keys);
|
mods = getMods(keys);
|
||||||
|
key = keys[keys.length - 1];
|
||||||
}
|
}
|
||||||
(keys.length > 0) && (key = keys[keys.length - 1]);
|
|
||||||
|
|
||||||
key = code(key);
|
key = code(key);
|
||||||
|
|
||||||
|
|
@ -323,23 +312,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function suspend(key, scope, pass) {
|
function suspend(key, scope) {
|
||||||
if (key) {
|
key ? setKeyOptions(key, scope, 'locked', true) : (locked = true);
|
||||||
setKeyOptions(key, scope, 'locked', true)
|
|
||||||
pass && setKeyOptions(key, scope, 'propagate', true)
|
|
||||||
} else {
|
|
||||||
locked = true;
|
|
||||||
pass && (propagate = true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resume(key, scope) {
|
function resume(key, scope) {
|
||||||
if (key) {
|
key ? setKeyOptions(key, scope, 'locked', false) : (locked = false);
|
||||||
setKeyOptions(key, scope, 'locked', false)
|
|
||||||
setKeyOptions(key, scope, 'propagate', false)
|
|
||||||
} else {
|
|
||||||
locked = propagate = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set window.key and window.key.set/get/deleteScope, and the default filter
|
// set window.key and window.key.set/get/deleteScope, and the default filter
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ function onDropDownKeyDown(e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ($this.hasClass('move-focus')) {
|
} else if ($this.hasClass('move-focus')) {
|
||||||
if (!((/^(13|9|32)/.test(e.keyCode) || e.keyCode===27 && !$parent.hasClass('open')) && !e.ctrlKey && !e.altKey)) {
|
if (!(/^(27|13|9|32)/.test(e.keyCode) && !e.ctrlKey && !e.altKey)) {
|
||||||
patchDropDownKeyDown.call(this, e);
|
patchDropDownKeyDown.call(this, e);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
@ -128,9 +128,8 @@ function patchDropDownKeyDown(e) {
|
||||||
var mnu = $('> [role=menu]', li),
|
var mnu = $('> [role=menu]', li),
|
||||||
$subitems = mnu.find('> li:not(.divider):not(.disabled):visible > a'),
|
$subitems = mnu.find('> li:not(.divider):not(.disabled):visible > a'),
|
||||||
$dataviews = mnu.find('> li:not(.divider):not(.disabled):visible .dataview'),
|
$dataviews = mnu.find('> li:not(.divider):not(.disabled):visible .dataview'),
|
||||||
$palette = mnu.find('> li:not(.divider):not(.disabled):visible .theme-colorpalette.focused'),
|
|
||||||
$internal_menu = mnu.find('> li:not(.divider):not(.disabled):visible ul.internal-menu');
|
$internal_menu = mnu.find('> li:not(.divider):not(.disabled):visible ul.internal-menu');
|
||||||
if ($subitems.length>0 && $dataviews.length<1 && $internal_menu.length<1 && $palette.length<1)
|
if ($subitems.length>0 && $dataviews.length<1 && $internal_menu.length<1)
|
||||||
($subitems.index($subitems.filter(':focus'))<0) && $subitems.eq(0).focus();
|
($subitems.index($subitems.filter(':focus'))<0) && $subitems.eq(0).focus();
|
||||||
}, 250);
|
}, 250);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,6 @@ define([
|
||||||
guid : '',
|
guid : '',
|
||||||
userid : 0,
|
userid : 0,
|
||||||
username : 'Guest',
|
username : 'Guest',
|
||||||
parsedName : 'Guest',
|
|
||||||
parsedGroups : undefined,
|
|
||||||
usercolor : null,
|
usercolor : null,
|
||||||
date : undefined,
|
date : undefined,
|
||||||
quote : '',
|
quote : '',
|
||||||
|
|
@ -67,7 +65,6 @@ define([
|
||||||
lockuserid : '',
|
lockuserid : '',
|
||||||
unattached : false,
|
unattached : false,
|
||||||
userdata : '',
|
userdata : '',
|
||||||
position : -1,
|
|
||||||
|
|
||||||
id : Common.UI.getId(), // internal
|
id : Common.UI.getId(), // internal
|
||||||
time : 0,
|
time : 0,
|
||||||
|
|
@ -80,7 +77,6 @@ define([
|
||||||
hideAddReply : false,
|
hideAddReply : false,
|
||||||
scope : null,
|
scope : null,
|
||||||
hide : false,
|
hide : false,
|
||||||
filtered : false,
|
|
||||||
hint : false,
|
hint : false,
|
||||||
dummy : undefined,
|
dummy : undefined,
|
||||||
editable : true,
|
editable : true,
|
||||||
|
|
@ -92,7 +88,6 @@ define([
|
||||||
time : 0, // acs
|
time : 0, // acs
|
||||||
userid : 0,
|
userid : 0,
|
||||||
username : 'Guest',
|
username : 'Guest',
|
||||||
parsedName : 'Guest',
|
|
||||||
usercolor : null,
|
usercolor : null,
|
||||||
reply : '',
|
reply : '',
|
||||||
date : undefined,
|
date : undefined,
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,7 @@ define([
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
allowSelected: true,
|
allowSelected: true,
|
||||||
selected: false,
|
selected: false,
|
||||||
serverVersion: 0,
|
serverVersion: 0
|
||||||
fileType: 'docx'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,7 @@ define([
|
||||||
color : '#fff',
|
color : '#fff',
|
||||||
colorval : null,
|
colorval : null,
|
||||||
online : false,
|
online : false,
|
||||||
view : false,
|
view : false
|
||||||
hidden : false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,6 @@
|
||||||
currentPageX;
|
currentPageX;
|
||||||
|
|
||||||
$scrollbarX.bind('mousedown' + eventClassName, function (e) {
|
$scrollbarX.bind('mousedown' + eventClassName, function (e) {
|
||||||
Common.NotificationCenter.trigger('hints:clear');
|
|
||||||
currentPageX = e.pageX;
|
currentPageX = e.pageX;
|
||||||
currentLeft = $scrollbarX.position().left;
|
currentLeft = $scrollbarX.position().left;
|
||||||
$scrollbarXRail.addClass('in-scrolling');
|
$scrollbarXRail.addClass('in-scrolling');
|
||||||
|
|
@ -241,7 +240,6 @@
|
||||||
currentPageY;
|
currentPageY;
|
||||||
|
|
||||||
$scrollbarY.bind('mousedown' + eventClassName, function (e) {
|
$scrollbarY.bind('mousedown' + eventClassName, function (e) {
|
||||||
Common.NotificationCenter.trigger('hints:clear');
|
|
||||||
currentPageY = e.pageY;
|
currentPageY = e.pageY;
|
||||||
currentTop = $scrollbarY.position().top;
|
currentTop = $scrollbarY.position().top;
|
||||||
$scrollbarYRail.addClass('in-scrolling');
|
$scrollbarYRail.addClass('in-scrolling');
|
||||||
|
|
@ -318,7 +316,6 @@
|
||||||
|
|
||||||
var shouldPrevent = false;
|
var shouldPrevent = false;
|
||||||
$this.bind('mousewheel' + eventClassName, function (e, deprecatedDelta, deprecatedDeltaX, deprecatedDeltaY) {
|
$this.bind('mousewheel' + eventClassName, function (e, deprecatedDelta, deprecatedDeltaX, deprecatedDeltaY) {
|
||||||
Common.NotificationCenter.trigger('hints:clear');
|
|
||||||
var deltaX = e.deltaX * e.deltaFactor || deprecatedDeltaX,
|
var deltaX = e.deltaX * e.deltaFactor || deprecatedDeltaX,
|
||||||
deltaY = e.deltaY * e.deltaFactor || deprecatedDeltaY;
|
deltaY = e.deltaY * e.deltaFactor || deprecatedDeltaY;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,18 +66,16 @@
|
||||||
<div class="padding-small">
|
<div class="padding-small">
|
||||||
<label class="header"><%= scope.textReplaceText %></label>
|
<label class="header"><%= scope.textReplaceText %></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="padding-small">
|
<div class="padding-large">
|
||||||
<div class="padding-small" id="id-autocorrect-dialog-chk-quotes"></div>
|
<div class="padding-small" id="id-autocorrect-dialog-chk-quotes"></div>
|
||||||
<div class="padding-small" id="id-autocorrect-dialog-chk-hyphens"></div>
|
<div id="id-autocorrect-dialog-chk-hyphens"></div>
|
||||||
<div class="padding-small" id="id-autocorrect-dialog-chk-hyperlink"></div>
|
|
||||||
<div class="padding-small" id="id-autocorrect-dialog-chk-double-space"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="padding-small">
|
<div class="padding-small">
|
||||||
<label class="header"><%= scope.textApplyText %></label>
|
<label class="header"><%= scope.textApplyText %></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="padding-small">
|
<div class="padding-large">
|
||||||
<div class="padding-small" id="id-autocorrect-dialog-chk-bulleted"></div>
|
<div class="padding-small" id="id-autocorrect-dialog-chk-bulleted"></div>
|
||||||
<div class="padding-small" id="id-autocorrect-dialog-chk-numbered"></div>
|
<div id="id-autocorrect-dialog-chk-numbered"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -86,24 +84,21 @@
|
||||||
<div class="padding-small">
|
<div class="padding-small">
|
||||||
<label class="header"><%= scope.textReplaceText %></label>
|
<label class="header"><%= scope.textReplaceText %></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="padding-small">
|
<div class="padding-large">
|
||||||
<div class="padding-small" id="id-autocorrect-dialog-chk-hyperlink"></div>
|
<div id="id-autocorrect-dialog-chk-hyperlink"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="padding-small">
|
<div class="padding-small">
|
||||||
<label class="header"><%= scope.textApplyAsWork %></label>
|
<label class="header"><%= scope.textApplyAsWork %></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="padding-small">
|
<div class="padding-large">
|
||||||
<div class="padding-small" id="id-autocorrect-dialog-chk-new-rows"></div>
|
<div id="id-autocorrect-dialog-chk-new-rows"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="id-autocorrect-dialog-settings-autocorrect" class="settings-panel">
|
<div id="id-autocorrect-dialog-settings-autocorrect" class="settings-panel">
|
||||||
<div class="inner-content" style="width: 100%;">
|
<div class="inner-content" style="width: 100%;">
|
||||||
<div class="padding-small">
|
<div class="padding-large">
|
||||||
<div id="id-autocorrect-dialog-chk-fl-sentence"></div>
|
<div id="id-autocorrect-dialog-chk-fl-sentence"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="padding-small">
|
|
||||||
<div id="id-autocorrect-dialog-chk-fl-cells"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="chat-options" class="layout-item">
|
<div id="chat-options" class="layout-item">
|
||||||
<div id="chat-options-ct">
|
<div id="chat-options-ct">
|
||||||
<textarea id="chat-msg-text" class="user-select textarea-control" maxlength="<%=maxMsgLength%>" data-hint="1" data-hint-direction="left-top"></textarea>
|
<textarea id="chat-msg-text" class="user-select textarea-control" maxlength="<%=maxMsgLength%>"></textarea>
|
||||||
<button id="chat-msg-btn-add" class="btn normal dlg-btn primary" data-hint="1" data-hint-direction="bottom" data-hint-offset="big"><%=scope.textSend%></button>
|
<button id="chat-msg-btn-add" class="btn normal dlg-btn primary"><%=scope.textSend%></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<% if (!hide && !filtered) { %>
|
<% if (!hide) { %>
|
||||||
<div id="<%= id %>" class="user-comment-item">
|
<div id="<%= id %>" class="user-comment-item">
|
||||||
|
|
||||||
<!-- comment block -->
|
<!-- comment block -->
|
||||||
|
|
||||||
<div class="user-name">
|
<div class="user-name">
|
||||||
<div class="color" style="display: inline-block; background-color: <% if (usercolor!==null) { %><%=usercolor%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getEncodedName(parsedName) %>
|
<div class="color" style="display: inline-block; background-color: <% if (usercolor!==null) { %><%=usercolor%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(username) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-date"><%=date%></div>
|
<div class="user-date"><%=date%></div>
|
||||||
<% if (quote!==null && quote!=='') { %>
|
<% if (quote!==null && quote!=='') { %>
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<div class="reply-item-ct" <% if (scope.viewmode && index==replys.length-1) { %>style="padding-bottom: 0;" <% } %>;>
|
<div class="reply-item-ct" <% if (scope.viewmode && index==replys.length-1) { %>style="padding-bottom: 0;" <% } %>;>
|
||||||
<div class="user-name">
|
<div class="user-name">
|
||||||
<div class="color" style="display: inline-block; background-color: <% if (item.get("usercolor")!==null) { %><%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getEncodedName(item.get("parsedName")) %>
|
<div class="color" style="display: inline-block; background-color: <% if (item.get("usercolor")!==null) { %><%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(item.get("username")) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-date"><%=item.get("date")%></div>
|
<div class="user-date"><%=item.get("date")%></div>
|
||||||
<% if (!item.get("editText")) { %>
|
<% if (!item.get("editText")) { %>
|
||||||
|
|
@ -70,20 +70,16 @@
|
||||||
|
|
||||||
<!-- edit buttons -->
|
<!-- edit buttons -->
|
||||||
|
|
||||||
<% if (!editText && !lock) { %>
|
<% if (!editText && !lock && !scope.viewmode) { %>
|
||||||
<div class="edit-ct">
|
<div class="edit-ct">
|
||||||
<% if (!scope.viewmode) { %>
|
<% if (editable) { %>
|
||||||
<% if (editable) { %>
|
<div class="btn-edit img-commonctrl"></div>
|
||||||
<div class="btn-edit img-commonctrl"></div>
|
|
||||||
<% } %>
|
|
||||||
<% if (removable) { %>
|
|
||||||
<div class="btn-delete img-commonctrl"></div>
|
|
||||||
<% } %>
|
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (editable && !scope.viewmode) { %>
|
<% if (removable) { %>
|
||||||
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
|
<div class="btn-delete img-commonctrl"></div>
|
||||||
<% } else if ((!editable || scope.viewmode) && resolved) { %>
|
<% } %>
|
||||||
<div class="icon-resolve i-comment-resolved" data-toggle="tooltip"></div>
|
<% if (editable) { %>
|
||||||
|
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,13 @@
|
||||||
<div id="comments-box" class="layout-ct vbox">
|
<div id="comments-box" class="layout-ct vbox">
|
||||||
<div class="layout-item messages-ct"></div>
|
<div class="layout-item messages-ct"></div>
|
||||||
<div class="layout-item add-link-ct">
|
<div class="layout-item add-link-ct">
|
||||||
<label id="add-comment-doc" class="btn new" data-hint="1" data-hint-direction="bottom" data-hint-offset="medium"><%=textAddCommentToDoc%></label>
|
<label class="btn new"><%=textAddCommentToDoc%></label>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: none;" class="layout-item new-comment-ct">
|
<div style="display: none;" class="layout-item new-comment-ct">
|
||||||
<div class="inner-ct">
|
<div class="inner-ct">
|
||||||
<textarea id="comment-msg-new" class="user-select textarea-control" placeholder="<%=textEnterCommentHint%>" maxlength="<%=maxCommLength%>" data-hint="1" data-hint-direction="left-top"></textarea>
|
<textarea id="comment-msg-new" class="user-select textarea-control" placeholder="<%=textEnterCommentHint%>" maxlength="<%=maxCommLength%>"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn add normal dlg-btn primary" data-hint="1" data-hint-direction="bottom" data-hint-offset="big" style="width: auto;min-width: 86px;"><%=textAddComment%></button>
|
<button class="btn add normal dlg-btn primary"><%=textAddComment%></button>
|
||||||
<button class="btn cancel normal dlg-btn" data-hint="1" data-hint-direction="bottom" data-hint-offset="big" style="width: auto;min-width: 86px;"><%=textCancel%></button>
|
<button class="btn cancel normal dlg-btn"><%=textCancel%></button>
|
||||||
</div>
|
|
||||||
<div id="comments-header" class="">
|
|
||||||
<label><%=textComments%></label>
|
|
||||||
<div id="comments-btn-close" style="float:right;margin-left: 4px;"></div>
|
|
||||||
<div id="comments-btn-sort" style="float:right;"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
<!-- comment block -->
|
<!-- comment block -->
|
||||||
|
|
||||||
<div class="user-name">
|
<div class="user-name">
|
||||||
<div class="color" style="display: inline-block; background-color: <% if (usercolor!==null) { %><%=usercolor%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getEncodedName(parsedName) %>
|
<div class="color" style="display: inline-block; background-color: <% if (usercolor!==null) { %><%=usercolor%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(username) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-date"><%=date%></div>
|
<div class="user-date"><%=date%></div>
|
||||||
<% if (!editTextInPopover || hint || scope.viewmode) { %>
|
<% if (!editTextInPopover || hint) { %>
|
||||||
<div oo_editor_input="true" tabindex="-1" class="user-message user-select"><%=scope.pickLink(comment)%></div>
|
<div oo_editor_input="true" tabindex="-1" class="user-message user-select"><%=scope.pickLink(comment)%></div>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<div class="inner-edit-ct">
|
<div class="inner-edit-ct">
|
||||||
|
|
@ -32,12 +32,12 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<div class="reply-item-ct">
|
<div class="reply-item-ct">
|
||||||
<div class="user-name">
|
<div class="user-name">
|
||||||
<div class="color" style="display: inline-block; background-color: <% if (item.get("usercolor")!==null) { %><%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getEncodedName(item.get("parsedName")) %>
|
<div class="color" style="display: inline-block; background-color: <% if (item.get("usercolor")!==null) { %><%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " ></div><%= scope.getUserName(item.get("username")) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-date"><%=item.get("date")%></div>
|
<div class="user-date"><%=item.get("date")%></div>
|
||||||
<% if (!item.get("editTextInPopover")) { %>
|
<% if (!item.get("editTextInPopover")) { %>
|
||||||
<div oo_editor_input="true" tabindex="-1" class="user-message user-select"><%=scope.pickLink(item.get("reply"))%></div>
|
<div oo_editor_input="true" tabindex="-1" class="user-message user-select"><%=scope.pickLink(item.get("reply"))%></div>
|
||||||
<% if (!hint && !scope.viewmode) { %>
|
<% if (!hint) { %>
|
||||||
<div class="btns-reply-ct">
|
<div class="btns-reply-ct">
|
||||||
<% if (item.get("editable")) { %>
|
<% if (item.get("editable")) { %>
|
||||||
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
|
|
||||||
<!-- add reply button -->
|
<!-- add reply button -->
|
||||||
|
|
||||||
<% if (!showReplyInPopover && !hideAddReply && !hint && !scope.viewmode) { %>
|
<% if (!showReplyInPopover && !hideAddReply && !hint) { %>
|
||||||
<% if (replys.length && !add_arrow) { %>
|
<% if (replys.length && !add_arrow) { %>
|
||||||
<label class="user-reply" style="margin-left: 20px; margin-top: 5px;" role="presentation" tabindex="-1">textAddReply</label>
|
<label class="user-reply" style="margin-left: 20px; margin-top: 5px;" role="presentation" tabindex="-1">textAddReply</label>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
|
|
@ -71,20 +71,16 @@
|
||||||
|
|
||||||
<!-- edit buttons -->
|
<!-- edit buttons -->
|
||||||
|
|
||||||
<% if (!editTextInPopover && !lock) { %>
|
<% if (!editTextInPopover && !lock && !hint) { %>
|
||||||
<div class="edit-ct">
|
<div class="edit-ct">
|
||||||
<% if (!hint && !scope.viewmode) { %>
|
<% if (editable) { %>
|
||||||
<% if (editable) { %>
|
<div class="btn-edit img-commonctrl"></div>
|
||||||
<div class="btn-edit img-commonctrl"></div>
|
|
||||||
<% } %>
|
|
||||||
<% if (removable) { %>
|
|
||||||
<div class="btn-delete img-commonctrl"></div>
|
|
||||||
<% } %>
|
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (editable && !hint && !scope.viewmode) { %>
|
<% if (removable) { %>
|
||||||
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
|
<div class="btn-delete img-commonctrl"></div>
|
||||||
<% } else if (!hint && (!editable || scope.viewmode) && resolved) { %>
|
<% } %>
|
||||||
<div class="icon-resolve i-comment-resolved" data-toggle="tooltip"></div>
|
<% if (editable) { %>
|
||||||
|
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@
|
||||||
<div class="btn-delete img-commonctrl"></div>
|
<div class="btn-delete img-commonctrl"></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } else if (editable) { %>
|
<% } else if (editable) { %>
|
||||||
<div class="btn-accept"></div>
|
<div class="btn-accept img-commonctrl"></div>
|
||||||
<div class="btn-reject tool "></div>
|
<div class="btn-reject img-commonctrl"></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
<div id="search-box" class="layout-ct vbox search-panel">
|
|
||||||
<div id="search-header">
|
|
||||||
<label id="search-adv-title"></label>
|
|
||||||
<div id="search-btn-close"></div>
|
|
||||||
</div>
|
|
||||||
<div id="search-adv-settings">
|
|
||||||
<table cols="1">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td class="padding-small"><div id="search-adv-text"></div></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="edit-setting">
|
|
||||||
<td class="padding-large"><div id="search-adv-replace-text"></div></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding-large">
|
|
||||||
<label id="search-adv-results-number" style="display: inline-block;">
|
|
||||||
<%= scope.textSearchResults %>
|
|
||||||
</label>
|
|
||||||
<div class="search-nav-btns">
|
|
||||||
<div id="search-adv-back"></div>
|
|
||||||
<div id="search-adv-next"></div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="edit-setting">
|
|
||||||
<td class="padding-large">
|
|
||||||
<button type="button" class="btn btn-text-default" id="search-adv-replace" data-hint="1" data-hint-direction="bottom" data-hint-offset="big"><%= scope.textReplace %></button>
|
|
||||||
<button type="button" class="btn btn-text-default" id="search-adv-replace-all" data-hint="1" data-hint-direction="bottom" data-hint-offset="big"><%= scope.textReplaceAll %></button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="search-options-block">
|
|
||||||
<td class="padding-large">
|
|
||||||
<div id="open-search-options" data-hint="1" data-hint-direction="left" data-hint-offset="0, -15">
|
|
||||||
<div class="search-options-caret img-commonctrl"></div>
|
|
||||||
<div class="search-options-txt"><%= scope.textSearchOptions %></div>
|
|
||||||
</div>
|
|
||||||
<div id="search-options">
|
|
||||||
<label class="input-label"><%= scope.textWithin %></label>
|
|
||||||
<div id="search-adv-cmb-within"></div>
|
|
||||||
<div id="search-adv-select-range"></div>
|
|
||||||
<label class="input-label"><%= scope.textSearch %></label>
|
|
||||||
<div id="search-adv-cmb-search"></div>
|
|
||||||
<label class="input-label"><%= scope.textLookIn %></label>
|
|
||||||
<div id="search-adv-cmb-look-in"></div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding-small"><div id="search-adv-case-sensitive"></div></td>
|
|
||||||
</tr>
|
|
||||||
<!---<tr>
|
|
||||||
<td class="padding-small"><div id="search-adv-use-regexp"></div></td>
|
|
||||||
</tr>-->
|
|
||||||
<tr>
|
|
||||||
<td class="padding-large"><div id="search-adv-match-word"></div></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div id="search-results" class="ps-container oo">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -52,13 +52,13 @@ define(['gateway'], function () {
|
||||||
Common.Gateway.on('internalcommand', ongetstore);
|
Common.Gateway.on('internalcommand', ongetstore);
|
||||||
|
|
||||||
var _refresh = function() {
|
var _refresh = function() {
|
||||||
// if (!_lsAllowed)
|
if (!_lsAllowed)
|
||||||
// Common.Gateway.internalMessage('localstorage', {cmd:'get', keys:_filter});
|
Common.Gateway.internalMessage('localstorage', {cmd:'get', keys:_filter});
|
||||||
};
|
};
|
||||||
|
|
||||||
var _save = function() {
|
var _save = function() {
|
||||||
// if (!_lsAllowed)
|
if (!_lsAllowed)
|
||||||
// Common.Gateway.internalMessage('localstorage', {cmd:'set', keys:_store});
|
Common.Gateway.internalMessage('localstorage', {cmd:'set', keys:_store});
|
||||||
};
|
};
|
||||||
|
|
||||||
var _setItem = function(name, value, just) {
|
var _setItem = function(name, value, just) {
|
||||||
|
|
@ -72,15 +72,14 @@ define(['gateway'], function () {
|
||||||
} else {
|
} else {
|
||||||
_store[name] = value;
|
_store[name] = value;
|
||||||
|
|
||||||
// if (just===true) {
|
if (just===true) {
|
||||||
// TDDO: remove after ver 7.2. using external local storage is depricated
|
Common.Gateway.internalMessage('localstorage', {
|
||||||
// Common.Gateway.internalMessage('localstorage', {
|
cmd:'set',
|
||||||
// cmd:'set',
|
keys: {
|
||||||
// keys: {
|
name: value
|
||||||
// name: value
|
}
|
||||||
// }
|
});
|
||||||
// });
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,8 +148,8 @@ Common.util = Common.util||{};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
suspendEvents: function(key,scope,propagate) {
|
suspendEvents: function(key,scope) {
|
||||||
window.key.suspend(key,scope,propagate);
|
window.key.suspend(key,scope);
|
||||||
},
|
},
|
||||||
|
|
||||||
resumeEvents: function(key,scope) {
|
resumeEvents: function(key,scope) {
|
||||||
|
|
|
||||||
|
|
@ -109,16 +109,13 @@
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
Common.NotificationCenter.on({'layout:changed': function(e){
|
Common.NotificationCenter.on({'layout:changed': function(e){
|
||||||
if (!me.options.keepvisible && !me.options.hideonclick && me.tip().is(':visible'))
|
if (!me.options.hideonclick && me.tip().is(':visible'))
|
||||||
me.hide();
|
me.hide();
|
||||||
}});
|
}});
|
||||||
this.isDesktopApp = Common.Controllers.Desktop.isActive();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mousemove: function (e) {
|
mousemove: function (e) {
|
||||||
var x = e.clientX*Common.Utils.zoom(),
|
this.targetXY = [e.clientX*Common.Utils.zoom(), e.clientY*Common.Utils.zoom()];
|
||||||
y = e.clientY*Common.Utils.zoom();
|
|
||||||
this.targetXY = [x, this.isDesktopApp ? Math.max(y, 14) : y];
|
|
||||||
},
|
},
|
||||||
|
|
||||||
leave: function(obj) {
|
leave: function(obj) {
|
||||||
|
|
|
||||||
|
|
@ -597,776 +597,4 @@ define(function(){ 'use strict';
|
||||||
textValue: 'Value is'
|
textValue: 'Value is'
|
||||||
}
|
}
|
||||||
})(), Common.define.conditionalData || {});
|
})(), Common.define.conditionalData || {});
|
||||||
|
|
||||||
Common.define.effectData = _.extend(new (function () {
|
|
||||||
return {
|
|
||||||
textEntrance: 'Entrance Effect',
|
|
||||||
textEmphasis: 'Emphasis Effect',
|
|
||||||
textExit: 'Exit Effect',
|
|
||||||
textPath: 'Motion Path',
|
|
||||||
textAppear: 'Appear',
|
|
||||||
textFade: 'Fade',
|
|
||||||
textFlyIn: 'Fly in',
|
|
||||||
textFloatIn: 'Float In',
|
|
||||||
textSplit: 'Split',
|
|
||||||
textWipe: 'Wipe',
|
|
||||||
textShape: 'Shape',
|
|
||||||
textWheel: 'Wheel',
|
|
||||||
textRandomBars: 'Random Bars ',
|
|
||||||
textGrowTurn: 'Grow & Turn',
|
|
||||||
textZoom: 'Zoom',
|
|
||||||
textSwivel: 'Swivel',
|
|
||||||
textBounce: 'Bounce',
|
|
||||||
textPulse: 'Pulse',
|
|
||||||
textColorPulse: 'Color Pulse',
|
|
||||||
textTeeter: 'Teeter',
|
|
||||||
textSpin: 'Spin',
|
|
||||||
textGrowShrink: 'Grow/Shrink',
|
|
||||||
textShrinkTurn: 'Shrink & Turn',
|
|
||||||
textDesaturate: 'Desaturate',
|
|
||||||
textDarken: 'Darken',
|
|
||||||
textLighten: 'Lighten',
|
|
||||||
textTransparency: 'Transparency',
|
|
||||||
textObjectColor: 'Object Color',
|
|
||||||
textComplementaryColor: 'Complementary Color',
|
|
||||||
textComplementaryColor2: 'Complementary Color 2',
|
|
||||||
textLineColor: 'Line Color',
|
|
||||||
textFillColor: 'Fill Color',
|
|
||||||
textBrushColor: 'Brush Color',
|
|
||||||
textFontColor: 'Font Color',
|
|
||||||
textUnderline: 'Underline',
|
|
||||||
textBoldFlash: 'Bold Flash',
|
|
||||||
textBoldReveal: 'Bold Reveal',
|
|
||||||
textWave: 'Wave',
|
|
||||||
textDisappear: 'Disappear',
|
|
||||||
textFlyOut: 'Fly Out',
|
|
||||||
textFloatOut: 'Float Out',
|
|
||||||
textBasic: 'Basic',
|
|
||||||
textSubtle: 'Subtle',
|
|
||||||
textModerate: 'Moderate',
|
|
||||||
textExciting: 'Exciting',
|
|
||||||
textLinesCurves: 'Lines Curves',
|
|
||||||
textSpecial: 'Special',
|
|
||||||
textBox: 'Box',
|
|
||||||
textCircle: 'Circle',
|
|
||||||
textPlus: 'Plus',
|
|
||||||
textDiamond: 'Diamond',
|
|
||||||
textDissolveIn: 'Dissolve In',
|
|
||||||
textBlinds: 'Blinds',
|
|
||||||
textCheckerboard: 'Checkerboard',
|
|
||||||
textPeekIn: 'Peek In',
|
|
||||||
textStrips: 'Strips',
|
|
||||||
textExpand: 'Expand',
|
|
||||||
textBasicZoom: 'Basic Zoom',
|
|
||||||
textCompress: 'Compress',
|
|
||||||
textFloatUp: 'Float Up',
|
|
||||||
textRiseUp: 'Rise Up',
|
|
||||||
textStretch: 'Stretch',
|
|
||||||
textCenterRevolve: 'Center Revolve',
|
|
||||||
textFloatDown: 'Float Down',
|
|
||||||
textSpinner: 'Spinner',
|
|
||||||
textBasicSwivel: 'Basic Swivel',
|
|
||||||
textBoomerang: 'Boomerang',
|
|
||||||
textCredits: 'Credits',
|
|
||||||
textCuverUp: 'Cuver Up',
|
|
||||||
textDrop: 'Drop',
|
|
||||||
textFloat: 'Float',
|
|
||||||
textPinwheel: 'Pinwheel',
|
|
||||||
textSpiralIn: 'Spiral In',
|
|
||||||
textWhip: 'Whip',
|
|
||||||
textGrowWithColor: 'Grow With Color',
|
|
||||||
textShimmer: 'Shimmer',
|
|
||||||
textBlink: 'Blink',
|
|
||||||
textDissolveOut: 'Dissolve Out',
|
|
||||||
textPeekOut: 'Peek Out',
|
|
||||||
textContrast: 'Contrast',
|
|
||||||
textCollapse: 'Collapse',
|
|
||||||
textSinkDown: 'Sink Down',
|
|
||||||
textCurveDown: 'CurveDown',
|
|
||||||
textSpiralOut: 'Spiral Out',
|
|
||||||
textContrastingColor: 'Contrasting Color',
|
|
||||||
textPointStar4: '4 Point Star',
|
|
||||||
textPointStar5: '5 Point Star',
|
|
||||||
textPointStar6: '6 Point Star',
|
|
||||||
textPointStar8: '8 Point Star',
|
|
||||||
textCrescentMoon: 'Crescent Moon',
|
|
||||||
textEqualTriangle: 'Equal Triangle',
|
|
||||||
textFootball: 'Football',
|
|
||||||
textHeart: 'Heart',
|
|
||||||
textHexagon: 'Hexagon',
|
|
||||||
textOctagon: 'Octagon',
|
|
||||||
textParallelogram: 'Parallelogram',
|
|
||||||
textPentagon: 'Pentagon',
|
|
||||||
textSquare: 'Square',
|
|
||||||
textTeardrop: 'Teardrop',
|
|
||||||
textTrapezoid: 'Trapezoid',
|
|
||||||
textArcDown: 'Arc Down',
|
|
||||||
textArcLeft: 'Arc Left',
|
|
||||||
textArcRight: 'Arc Right',
|
|
||||||
textArcUp: 'Arc Up',
|
|
||||||
textBounceLeft: 'Bounce Left',
|
|
||||||
textBounceRight: 'Bounce Right',
|
|
||||||
textCurvyLeft: 'Curvy Left',
|
|
||||||
textCurvyRight: 'Curvy Right',
|
|
||||||
textDecayingWave: 'Decaying Wave',
|
|
||||||
textDiagonalDownRight: 'Diagonal Down Right',
|
|
||||||
textDiagonalUpRight: 'Diagonal Up Right',
|
|
||||||
textDown: 'Down',
|
|
||||||
textFunnel: 'Funnel',
|
|
||||||
textHeartbeat: 'Heartbeat',
|
|
||||||
textLeft: 'Left',
|
|
||||||
textRight: 'Right',
|
|
||||||
textSCurve1: 'S Curve 1',
|
|
||||||
textSCurve2: 'S Curve 2',
|
|
||||||
textSineWave: 'Sine Wave',
|
|
||||||
textSpiralLeft: 'Spiral Left',
|
|
||||||
textSpiralRight: 'Spiral Right',
|
|
||||||
textSpring: 'Spring:',
|
|
||||||
textStairsDown: 'Stairs Down',
|
|
||||||
textTurnDown: 'Turn Down',
|
|
||||||
textTurnDownRight: 'Turn Down Right',
|
|
||||||
textTurnUp: 'Turn Up',
|
|
||||||
textTurnUpRight: 'Turn Up Right',
|
|
||||||
textUp: 'Up',
|
|
||||||
textZigzag: 'Zigzag',
|
|
||||||
textBean: 'Bean',
|
|
||||||
textCurvedSquare: 'CurvedSquare',
|
|
||||||
textCurvedX: 'Curved X',
|
|
||||||
textCurvyStar: 'Curvy Star',
|
|
||||||
textFigureFour: 'Figure 8 Four',
|
|
||||||
textHorizontalFigure: 'Horizontal Figure 8',
|
|
||||||
textInvertedSquare: 'Inverted Square',
|
|
||||||
textInvertedTriangle: 'Inverted Triangle',
|
|
||||||
textLoopDeLoop: 'Loop de Loop',
|
|
||||||
textNeutron: 'Neutron',
|
|
||||||
textPeanut: 'Peanut',
|
|
||||||
textPointStar: 'Point Star',
|
|
||||||
textSwoosh: 'Swoosh',
|
|
||||||
textVerticalFigure: 'Vertical Figure 8',
|
|
||||||
textRightTriangle: 'Right Triangle',
|
|
||||||
textAcross: 'Across',
|
|
||||||
textFromBottom: 'From Bottom',
|
|
||||||
textFromBottomLeft: 'From Bottom-Left',
|
|
||||||
textFromLeft: 'From Left',
|
|
||||||
textFromTopLeft: 'From Top-Left',
|
|
||||||
textFromTop: 'From Top',
|
|
||||||
textFromTopRight: 'From Top-Right',
|
|
||||||
textFromRight: 'From Right',
|
|
||||||
textFromBottomRight: 'From Bottom-Right',
|
|
||||||
textLeftDown: ' Left Down',
|
|
||||||
textLeftUp: ' Left Up',
|
|
||||||
textRightDown: ' Right Down',
|
|
||||||
textRightUp: ' Right Up',
|
|
||||||
textObjectCenter: 'Object Center',
|
|
||||||
textSlideCenter: 'Slide Center',
|
|
||||||
textInFromScreenCenter: 'In From Screen Center',
|
|
||||||
textOutFromScreenBottom: 'Out From Screen Bottom',
|
|
||||||
textInSlightly: 'In Slightly',
|
|
||||||
textInToScreenBottom: 'In To Screen Bottom',
|
|
||||||
textOutToScreenCenter: 'Out To Screen Center',
|
|
||||||
textOutSlightly: 'Out Slightly',
|
|
||||||
textToBottom: 'To Bottom',
|
|
||||||
textToBottomLeft: 'To Bottom-Left',
|
|
||||||
textToLeft: 'To Left',
|
|
||||||
textToTopLeft: 'To Top-Left',
|
|
||||||
textToTop: 'To Top',
|
|
||||||
textToTopRight: 'To Top-Right',
|
|
||||||
textToRight: 'To Right',
|
|
||||||
textToBottomRight: 'To Bottom-Right',
|
|
||||||
textSpoke1: '1 Spoke',
|
|
||||||
textSpoke2: '2 Spokes',
|
|
||||||
textSpoke3: '3 Spokes',
|
|
||||||
textSpoke4: '4 Spokes',
|
|
||||||
textSpoke8: '8 Spokes',
|
|
||||||
textCustomPath: 'Custom Path',
|
|
||||||
textHorizontalIn: 'Horizontal In',
|
|
||||||
textHorizontalOut: 'Horizontal Out',
|
|
||||||
textVerticalIn: 'Vertical In',
|
|
||||||
textVerticalOut: 'Vertical Out',
|
|
||||||
textVertical: 'Vertical',
|
|
||||||
textHorizontal: 'Horizontal',
|
|
||||||
textIn: 'In',
|
|
||||||
textOut: 'Out',
|
|
||||||
textWedge: 'Wedge',
|
|
||||||
textFlip: 'Flip',
|
|
||||||
textLines: 'Lines',
|
|
||||||
textArcs: 'Arcs',
|
|
||||||
textTurns: 'Turns',
|
|
||||||
textShapes: 'Shapes',
|
|
||||||
textLoops: 'Loops',
|
|
||||||
textPathCurve: 'Curve',
|
|
||||||
textPathLine: 'Line',
|
|
||||||
textPathScribble: 'Scribble',
|
|
||||||
|
|
||||||
getEffectGroupData: function () {
|
|
||||||
return [
|
|
||||||
{id: 'menu-effect-group-entrance', value: AscFormat.PRESET_CLASS_ENTR, caption: this.textEntrance, iconClsCustom: 'animation-entrance-custom'},
|
|
||||||
{id: 'menu-effect-group-emphasis', value: AscFormat.PRESET_CLASS_EMPH, caption: this.textEmphasis, iconClsCustom: 'animation-emphasis-custom'},
|
|
||||||
{id: 'menu-effect-group-exit', value: AscFormat.PRESET_CLASS_EXIT, caption: this.textExit, iconClsCustom: 'animation-exit-custom'},
|
|
||||||
{id: 'menu-effect-group-path', value: AscFormat.PRESET_CLASS_PATH, caption: this.textPath, iconClsCustom: 'animation-motion-paths-custom'}
|
|
||||||
];
|
|
||||||
},
|
|
||||||
|
|
||||||
getEffectData: function () {
|
|
||||||
return [
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_APPEAR, iconCls: 'animation-entrance-appear', displayValue: this.textAppear},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_FADE, iconCls: 'animation-entrance-fade', displayValue: this.textFade},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_FLY_IN_FROM, iconCls: 'animation-entrance-fly-in', displayValue: this.textFlyIn},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_FLOAT_UP, iconCls: 'animation-entrance-float-in', displayValue: this.textFloatIn, familyEffect: 'entrfloat'},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_SPLIT, iconCls: 'animation-entrance-split', displayValue: this.textSplit},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_WIPE_FROM, iconCls: 'animation-entrance-wipe', displayValue: this.textWipe},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_CIRCLE, iconCls: 'animation-entrance-shape', displayValue: this.textShape, familyEffect: 'entrshape'},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_WHEEL, iconCls: 'animation-entrance-wheel', displayValue: this.textWheel},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_RANDOM_BARS, iconCls: 'animation-entrance-random-bars', displayValue: this.textRandomBars},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_GROW_AND_TURN, iconCls: 'animation-entrance-grow-turn', displayValue: this.textGrowTurn},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_ZOOM, iconCls: 'animation-entrance-zoom', displayValue: this.textZoom},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_SWIVEL, iconCls: 'animation-entrance-swivel', displayValue: this.textSwivel},
|
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_BOUNCE, iconCls: 'animation-entrance-bounce', displayValue: this.textBounce},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_PULSE, iconCls: 'animation-emphasis-pulse', displayValue: this.textPulse},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_COLOR_PULSE, iconCls: 'animation-emphasis-color-pulse', displayValue: this.textColorPulse},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_TEETER, iconCls: 'animation-emphasis-teeter', displayValue: this.textTeeter},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_SPIN, iconCls: 'animation-emphasis-spin', displayValue: this.textSpin},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_GROW_SHRINK, iconCls: 'animation-emphasis-grow-or-shrink', displayValue: this.textGrowShrink},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_DESATURATE, iconCls: 'animation-emphasis-desaturate', displayValue: this.textDesaturate},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_CONTRASTING_DARKEN, iconCls: 'animation-emphasis-darken', displayValue: this.textDarken},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_LIGHTEN, iconCls: 'animation-emphasis-lighten', displayValue: this.textLighten},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_TRANSPARENCY, iconCls: 'animation-emphasis-transparency', displayValue: this.textTransparency},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_OBJECT_COLOR, iconCls: 'animation-emphasis-object-color', displayValue: this.textObjectColor},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_COMPLEMENTARY_COLOR, iconCls: 'animation-emphasis-complementary-color', displayValue: this.textComplementaryColor},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_LINE_COLOR, iconCls: 'animation-emphasis-line-color', displayValue: this.textLineColor},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_FILL_COLOR, iconCls: 'animation-emphasis-fill-color', displayValue: this.textFillColor},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_DISAPPEAR, iconCls: 'animation-exit-disappear', displayValue: this.textDisappear},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_FADE, iconCls: 'animation-exit-fade', displayValue: this.textFade},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_FLY_OUT_TO, iconCls: 'animation-exit-fly-out', displayValue: this.textFlyOut},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_FLOAT_DOWN, iconCls: 'animation-exit-float-out', displayValue: this.textFloatOut, familyEffect: 'exitfloat'},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_SPLIT, iconCls: 'animation-exit-split', displayValue: this.textSplit},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_WIPE_FROM, iconCls: 'animation-exit-wipe', displayValue: this.textWipe},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_CIRCLE, iconCls: 'animation-exit-shape', displayValue: this.textShape, familyEffect: 'shape'},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_WHEEL, iconCls: 'animation-exit-wheel', displayValue: this.textWheel},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_RANDOM_BARS, iconCls: 'animation-exit-random-bars', displayValue: this.textRandomBars},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_SHRINK_AND_TURN, iconCls: 'animation-exit-shrink-turn', displayValue: this.textShrinkTurn},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_ZOOM, iconCls: 'animation-exit-zoom', displayValue: this.textZoom},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_SWIVEL, iconCls: 'animation-exit-swivel', displayValue: this.textSwivel},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_BOUNCE, iconCls: 'animation-exit-bounce', displayValue: this.textBounce},
|
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_DOWN, iconCls: 'animation-motion-paths-lines', displayValue: this.textLines, familyEffect: 'pathlines'},
|
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_ARC_DOWN, iconCls: 'animation-motion-paths-arcs', displayValue: this.textArcs, familyEffect: 'patharcs'},
|
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_TURN_DOWN, iconCls: 'animation-motion-paths-turns', displayValue: this.textTurns, familyEffect: 'pathturns'},
|
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_CIRCLE, iconCls: 'animation-motion-paths-shapes', displayValue: this.textShapes, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, iconCls: 'animation-motion-paths-loops', displayValue: this.textLoops, familyEffect: 'pathloops'},
|
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_CUSTOM_PATH, iconCls: 'animation-motion-paths-custom-path', displayValue: this.textCustomPath}
|
|
||||||
];
|
|
||||||
},
|
|
||||||
|
|
||||||
getLevelEffect: function (isPath) {
|
|
||||||
|
|
||||||
if (!isPath)
|
|
||||||
return [
|
|
||||||
{id: 'menu-effect-level-basic', displayValue: this.textBasic},
|
|
||||||
{id: 'menu-effect-level-subtle', displayValue: this.textSubtle},
|
|
||||||
{id: 'menu-effect-level-moderate', displayValue: this.textModerate},
|
|
||||||
{id: 'menu-effect-level-exciting', displayValue: this.textExciting}
|
|
||||||
];
|
|
||||||
else
|
|
||||||
return [
|
|
||||||
{id: 'menu-effect-level-basic', displayValue: this.textBasic},
|
|
||||||
{id: 'menu-effect-level-lines_curves', displayValue: this.textSubtle},
|
|
||||||
{id: 'menu-effect-level-special', displayValue: this.textModerate}
|
|
||||||
];
|
|
||||||
},
|
|
||||||
|
|
||||||
getEffectFullData: function () {
|
|
||||||
return [
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_APPEAR, displayValue: this.textAppear},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_BLINDS, displayValue: this.textBlinds},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_BOX, displayValue: this.textBox, familyEffect: 'entrshape'},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_CHECKERBOARD, displayValue: this.textCheckerboard},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_CIRCLE, displayValue: this.textCircle, familyEffect: 'entrshape'},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_DIAMOND, displayValue: this.textDiamond, familyEffect: 'entrshape'},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_DISSOLVE_IN, displayValue: this.textDissolveIn},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_FLY_IN_FROM, displayValue: this.textFlyIn},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_PEEK_IN_FROM, displayValue: this.textPeekIn},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_PLUS, displayValue: this.textPlus, familyEffect: 'entrshape'},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_RANDOM_BARS, displayValue: this.textRandomBars},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_SPLIT, displayValue: this.textSplit},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_STRIPS, displayValue: this.textStrips},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_WEDGE, displayValue: this.textWedge},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_WHEEL, displayValue: this.textWheel},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-basic', value: AscFormat.ENTRANCE_WIPE_FROM, displayValue: this.textWipe},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-subtle', value: AscFormat.ENTRANCE_EXPAND, displayValue: this.textExpand},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-subtle', value: AscFormat.ENTRANCE_FADE, displayValue: this.textFade},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-subtle', value: AscFormat.ENTRANCE_SWIVEL, displayValue: this.textSwivel},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-subtle', value: AscFormat.ENTRANCE_ZOOM, displayValue: this.textZoom},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-moderate', value: AscFormat.ENTRANCE_BASIC_ZOOM, displayValue: this.textBasicZoom},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-moderate', value: AscFormat.ENTRANCE_CENTER_REVOLVE, displayValue: this.textCenterRevolve},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-moderate', value: AscFormat.ENTRANCE_CENTER_COMPRESS, displayValue: this.textCompress},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-moderate', value: AscFormat.ENTRANCE_FLOAT_DOWN, displayValue: this.textFloatDown, familyEffect: 'entrfloat'},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-moderate', value: AscFormat.ENTRANCE_FLOAT_UP, displayValue: this.textFloatUp, familyEffect: 'entrfloat'},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-moderate', value: AscFormat.ENTRANCE_GROW_AND_TURN, displayValue: this.textGrowTurn},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-moderate', value: AscFormat.ENTRANCE_RISE_UP, displayValue: this.textRiseUp},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-moderate', value: AscFormat.ENTRANCE_SPINNER, displayValue: this.textSpinner},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-moderate', value: AscFormat.ENTRANCE_STRETCH, displayValue: this.textStretch},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_BASIC_SWIVEL, displayValue: this.textBasicSwivel},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_BOOMERANG, displayValue: this.textBoomerang},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_BOUNCE, displayValue: this.textBounce},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_CREDITS, displayValue: this.textCredits},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_CURVE_UP, displayValue: this.textCuverUp},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_DROP, displayValue: this.textDrop},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_FLIP, displayValue: this.textFlip},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_FLOAT, displayValue: this.textFloat},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_PINWHEEL, displayValue: this.textPinwheel},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_SPIRAL_IN, displayValue: this.textSpiralIn},
|
|
||||||
{group: 'menu-effect-group-entrance', level: 'menu-effect-level-exciting', value: AscFormat.ENTRANCE_WHIP, displayValue: this.textWhip},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-basic', value: AscFormat.EMPHASIS_FILL_COLOR, displayValue: this.textFillColor},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-basic', value: AscFormat.EMPHASIS_GROW_SHRINK, displayValue: this.textGrowShrink},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-basic', value: AscFormat.EMPHASIS_FONT_COLOR, displayValue: this.textFontColor, notsupported: true},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-basic', value: AscFormat.EMPHASIS_LINE_COLOR, displayValue: this.textLineColor},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-basic', value: AscFormat.EMPHASIS_SPIN, displayValue: this.textSpin},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-basic', value: AscFormat.EMPHASIS_TRANSPARENCY, displayValue: this.textTransparency},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_BOLD_FLASH, displayValue: this.textBoldFlash, notsupported: true},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_COMPLEMENTARY_COLOR, displayValue: this.textComplementaryColor},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_COMPLEMENTARY_COLOR_2, displayValue: this.textComplementaryColor2},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_CONTRASTING_COLOR, displayValue: this.textContrastingColor},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_CONTRASTING_DARKEN, displayValue: this.textDarken},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_DESATURATE, displayValue: this.textDesaturate},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_LIGHTEN, displayValue: this.textLighten},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_OBJECT_COLOR, displayValue: this.textObjectColor},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_PULSE, displayValue: this.textPulse},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_UNDERLINE, displayValue: this.textUnderline, notsupported: true},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-subtle', value: AscFormat.EMPHASIS_BRUSH_COLOR, displayValue: this.textBrushColor, notsupported: true},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-moderate', value: AscFormat.EMPHASIS_COLOR_PULSE, displayValue: this.textColorPulse},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-moderate', value: AscFormat.EMPHASIS_GROW_WITH_COLOR, displayValue: this.textGrowWithColor},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-moderate', value: AscFormat.EMPHASIS_SHIMMER, displayValue: this.textShimmer},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-moderate', value: AscFormat.EMPHASIS_TEETER, displayValue: this.textTeeter},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-exciting', value: AscFormat.EMPHASIS_BLINK, displayValue: this.textBlink},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-exciting', value: AscFormat.EMPHASIS_BOLD_REVEAL, displayValue: this.textBoldReveal, notsupported: true},
|
|
||||||
{group: 'menu-effect-group-emphasis', level: 'menu-effect-level-exciting', value: AscFormat.EMPHASIS_WAVE, displayValue: this.textWave, notsupported: true},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_BLINDS, displayValue: this.textBlinds},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_BOX, displayValue: this.textBox, familyEffect: 'shape'},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_CHECKERBOARD, displayValue: this.textCheckerboard},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_CIRCLE, displayValue: this.textCircle, familyEffect: 'shape'},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_DIAMOND, displayValue: this.textDiamond, familyEffect: 'shape'},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_DISAPPEAR, displayValue: this.textDisappear},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_DISSOLVE_OUT, displayValue: this.textDissolveOut},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_FLY_OUT_TO, displayValue: this.textFlyOut},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_PEEK_OUT_TO, displayValue: this.textPeekOut},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_PLUS, displayValue: this.textPlus, familyEffect: 'shape'},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_RANDOM_BARS, displayValue: this.textRandomBars},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_SPLIT, displayValue: this.textSplit},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_STRIPS, displayValue: this.textStrips},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_WEDGE, displayValue: this.textWedge},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_WHEEL, displayValue: this.textWheel},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-basic', value: AscFormat.EXIT_WIPE_FROM, displayValue: this.textWipe},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-subtle', value: AscFormat.EXIT_CONTRACT, displayValue: this.textContrast},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-subtle', value: AscFormat.EXIT_FADE, displayValue: this.textFade},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-subtle', value: AscFormat.EXIT_SWIVEL, displayValue: this.textSwivel},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-subtle', value: AscFormat.EXIT_ZOOM, displayValue: this.textZoom},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-moderate', value: AscFormat.EXIT_BASIC_ZOOM, displayValue: this.textBasicZoom},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-moderate', value: AscFormat.EXIT_CENTER_REVOLVE, displayValue: this.textCenterRevolve},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-moderate', value: AscFormat.EXIT_COLLAPSE, displayValue: this.textCollapse},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-moderate', value: AscFormat.EXIT_FLOAT_DOWN, displayValue: this.textFloatDown, familyEffect: 'exitfloat'},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-moderate', value: AscFormat.EXIT_FLOAT_UP, displayValue: this.textFloatUp, familyEffect: 'exitfloat'},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-moderate', value: AscFormat.EXIT_SHRINK_AND_TURN, displayValue: this.textShrinkTurn},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-moderate', value: AscFormat.EXIT_SINK_DOWN, displayValue: this.textSinkDown},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-moderate', value: AscFormat.EXIT_SPINNER, displayValue: this.textSpinner},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-moderate', value: AscFormat.EXIT_STRETCHY, displayValue: this.textStretch},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_BASIC_SWIVEL, displayValue: this.textBasicSwivel},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_BOOMERANG, displayValue: this.textBoomerang},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_BOUNCE, displayValue: this.textBounce},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_CREDITS, displayValue: this.textCredits},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_CURVE_DOWN, displayValue: this.textCurveDown},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_DROP, displayValue: this.textDrop},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_FLIP, displayValue: this.textFlip},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_FLOAT, displayValue: this.textFloat},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_PINWHEEL, displayValue: this.textPinwheel},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_SPIRAL_OUT, displayValue: this.textSpiralOut},
|
|
||||||
{group: 'menu-effect-group-exit', level: 'menu-effect-level-exciting', value: AscFormat.EXIT_WHIP, displayValue: this.textWhip},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_PATH_4_POINT_STAR, displayValue: this.textPointStar4},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_PATH_5_POINT_STAR, displayValue: this.textPointStar5},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_PATH_6_POINT_STAR, displayValue: this.textPointStar6},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_PATH_8_POINT_STAR, displayValue: this.textPointStar8},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_CIRCLE, displayValue: this.textCircle, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_CRESCENT_MOON, displayValue: this.textCrescentMoon},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_DIAMOND, displayValue: this.textDiamond, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_EQUAL_TRIANGLE, displayValue: this.textEqualTriangle, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_FOOTBALL, displayValue: this.textFootball},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_HEART, displayValue: this.textHeart},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_HEXAGON, displayValue: this.textHexagon, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_OCTAGON, displayValue: this.textOctagon, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_PARALLELOGRAM, displayValue: this.textParallelogram, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_PENTAGON, displayValue: this.textPentagon, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_RIGHT_TRIANGLE, displayValue: this.textRightTriangle, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_SQUARE, displayValue: this.textSquare, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_TEARDROP, displayValue: this.textTeardrop},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-basic', value: AscFormat.MOTION_TRAPEZOID, displayValue: this.textTrapezoid, familyEffect: 'pathshapes'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_ARC_DOWN, displayValue: this.textArcDown, familyEffect: 'patharcs'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_ARC_LEFT, displayValue: this.textArcLeft, familyEffect: 'patharcs'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_ARC_RIGHT, displayValue: this.textArcRight, familyEffect: 'patharcs'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_ARC_UP, displayValue: this.textArcUp, familyEffect: 'patharcs'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_BOUNCE_LEFT, displayValue: this.textBounceLeft},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_BOUNCE_RIGHT, displayValue: this.textBounceRight},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_CURVY_LEFT, displayValue: this.textCurvyLeft},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_CURVY_RIGHT, displayValue: this.textCurvyRight},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_DECAYING_WAVE, displayValue: this.textDecayingWave},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_DIAGONAL_DOWN_RIGHT, displayValue: this.textDiagonalDownRight},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_DIAGONAL_UP_RIGHT, displayValue: this.textDiagonalUpRight},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_DOWN, displayValue: this.textDown, familyEffect: 'pathlines'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_FUNNEL, displayValue: this.textFunnel},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_HEARTBEAT, displayValue: this.textHeartbeat},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_LEFT, displayValue: this.textLeft, familyEffect: 'pathlines'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_RIGHT, displayValue: this.textRight, familyEffect: 'pathlines'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_S_CURVE_1, displayValue: this.textSCurve1},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_S_CURVE_2, displayValue: this.textSCurve2},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_SINE_WAVE, displayValue: this.textSineWave},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_SINE_SPIRAL_LEFT, displayValue: this.textSpiralLeft},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_SINE_SPIRAL_RIGHT, displayValue: this.textSpiralRight},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_SPRING, displayValue: this.textSpring},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_STAIRS_DOWN, displayValue: this.textStairsDown},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_TURN_DOWN, displayValue: this.textTurnDown, familyEffect: 'pathturns'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_TURN_DOWN_RIGHT, displayValue: this.textTurnDownRight, familyEffect: 'pathturns'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_TURN_UP, displayValue: this.textTurnUp, familyEffect: 'pathturns'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_TURN_UP_RIGHT, displayValue: this.textTurnUpRight, familyEffect: 'pathturns'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_UP, displayValue: this.textUp, familyEffect: 'pathlines'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_WAVE, displayValue: this.textWave},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-lines_curves', value: AscFormat.MOTION_ZIGZAG, displayValue: this.textZigzag},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_BEAN, displayValue: this.textBean},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_CURVED_SQUARE, displayValue: this.textCurvedSquare},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_CURVED_X, displayValue: this.textCurvedX},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_CURVY_STAR, displayValue: this.textCurvyStar},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_FIGURE_8_FOUR, displayValue: this.textFigureFour},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, displayValue: this.textHorizontalFigure, familyEffect: 'pathloops'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_INVERTED_SQUARE, displayValue: this.textInvertedSquare},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_INVERTED_TRIANGLE, displayValue: this.textInvertedTriangle},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_LOOP_DE_LOOP, displayValue: this.textLoopDeLoop, familyEffect: 'pathloops'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_NEUTRON, displayValue: this.textNeutron},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_PEANUT, displayValue: this.textPeanut},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_POINTY_STAR, displayValue: this.textPointStar},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_SWOOSH, displayValue: this.textSwoosh},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_VERTICAL_FIGURE_8, displayValue: this.textVerticalFigure, familyEffect: 'pathloops'},
|
|
||||||
{group: 'menu-effect-group-path', level: 'menu-effect-level-special', value: AscFormat.MOTION_CUSTOM_PATH, displayValue: this.textCustomPath, notsupported: true}
|
|
||||||
|
|
||||||
];
|
|
||||||
},
|
|
||||||
|
|
||||||
getEffectOptionsData: function (group, type) {
|
|
||||||
switch (group) {
|
|
||||||
case 'menu-effect-group-entrance':
|
|
||||||
switch (type) {
|
|
||||||
case AscFormat.ENTRANCE_BLINDS:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_BLINDS_HORIZONTAL, caption: this.textHorizontal, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_BLINDS_VERTICAL, caption: this.textVertical}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_BOX:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_BOX_IN, caption: this.textIn, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_BOX_OUT, caption: this.textOut}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_CHECKERBOARD:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_CHECKERBOARD_ACROSS, caption: this.textAcross, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_CHECKERBOARD_DOWN, caption: this.textDown}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_CIRCLE:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_CIRCLE_IN, caption: this.textIn, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_CIRCLE_OUT, caption: this.textOut}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_DIAMOND:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_DIAMOND_IN, caption: this.textIn, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_DIAMOND_OUT, caption: this.textOut}
|
|
||||||
];
|
|
||||||
|
|
||||||
case AscFormat.ENTRANCE_FLY_IN_FROM:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_FLY_IN_FROM_BOTTOM, caption: this.textFromBottom, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_FLY_IN_FROM_BOTTOM_LEFT, caption: this.textFromBottomLeft},
|
|
||||||
{value: AscFormat.ENTRANCE_FLY_IN_FROM_LEFT, caption: this.textFromLeft},
|
|
||||||
{value: AscFormat.ENTRANCE_FLY_IN_FROM_TOP_LEFT, caption: this.textFromTopLeft},
|
|
||||||
{value: AscFormat.ENTRANCE_FLY_IN_FROM_TOP, caption: this.textFromTop},
|
|
||||||
{value: AscFormat.ENTRANCE_FLY_IN_FROM_TOP_RIGHT, caption: this.textFromTopRight},
|
|
||||||
{value: AscFormat.ENTRANCE_FLY_IN_FROM_RIGHT, caption: this.textFromRight},
|
|
||||||
{value: AscFormat.ENTRANCE_FLY_IN_FROM_BOTTOM_RIGHT, caption: this.textFromBottomRight}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_PEEK_IN_FROM:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_PEEK_IN_FROM_BOTTOM, caption: this.textFromBottom, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_PEEK_IN_FROM_LEFT, caption: this.textFromLeft},
|
|
||||||
{value: AscFormat.ENTRANCE_PEEK_IN_FROM_RIGHT, caption: this.textFromRight},
|
|
||||||
{value: AscFormat.ENTRANCE_PEEK_IN_FROM_TOP, caption: this.textFromTop}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_PLUS:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_PLUS_IN, caption: this.textIn, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_PLUS_OUT, caption: this.textOut}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_RANDOM_BARS:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_RANDOM_BARS_HORIZONTAL, caption: this.textHorizontal, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_RANDOM_BARS_VERTICAL, caption: this.textVertical}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_SPLIT:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_SPLIT_HORIZONTAL_IN, caption: this.textHorizontalIn},
|
|
||||||
{value: AscFormat.ENTRANCE_SPLIT_HORIZONTAL_OUT, caption: this.textHorizontalOut},
|
|
||||||
{value: AscFormat.ENTRANCE_SPLIT_VERTICAL_IN, caption: this.textVerticalIn, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_SPLIT_VERTICAL_OUT, caption: this.textVerticalOut}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_STRIPS:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_STRIPS_LEFT_DOWN, caption: this.textLeftDown, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_STRIPS_LEFT_UP, caption: this.textLeftUp},
|
|
||||||
{value: AscFormat.ENTRANCE_STRIPS_RIGHT_DOWN, caption: this.textRightDown},
|
|
||||||
{value: AscFormat.ENTRANCE_STRIPS_RIGHT_UP, caption: this.textRightUp}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_WHEEL:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_WHEEL_1_SPOKE, caption: this.textSpoke1, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_WHEEL_2_SPOKES, caption: this.textSpoke2},
|
|
||||||
{value: AscFormat.ENTRANCE_WHEEL_3_SPOKES, caption: this.textSpoke3},
|
|
||||||
{value: AscFormat.ENTRANCE_WHEEL_4_SPOKES, caption: this.textSpoke4},
|
|
||||||
{value: AscFormat.ENTRANCE_WHEEL_8_SPOKES, caption: this.textSpoke8}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_WIPE_FROM:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_WIPE_FROM_BOTTOM, caption: this.textFromBottom, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_WIPE_FROM_LEFT, caption: this.textFromLeft},
|
|
||||||
{value: AscFormat.ENTRANCE_WIPE_FROM_RIGHT, caption: this.textFromRight},
|
|
||||||
{value: AscFormat.ENTRANCE_WIPE_FROM_TOP, caption: this.textFromTop}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_ZOOM:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_ZOOM_OBJECT_CENTER, caption: this.textObjectCenter, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_ZOOM_SLIDE_CENTER, caption: this.textSlideCenter}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_BASIC_ZOOM:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_BASIC_ZOOM_IN, caption: this.textIn, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_BASIC_ZOOM_IN_FROM_SCREEN_CENTER, caption: this.textInFromScreenCenter},
|
|
||||||
{value: AscFormat.ENTRANCE_BASIC_ZOOM_IN_SLIGHTLY, caption: this.textInSlightly},
|
|
||||||
{value: AscFormat.ENTRANCE_BASIC_ZOOM_OUT, caption: this.textOut},
|
|
||||||
{value: AscFormat.ENTRANCE_BASIC_ZOOM_OUT_FROM_SCREEN_BOTTOM, caption: this.textOutFromScreenBottom},
|
|
||||||
{value: AscFormat.ENTRANCE_BASIC_ZOOM_OUT_SLIGHTLY, caption: this.textOutSlightly}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_STRETCH:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_STRETCH_ACROSS, caption: this.textAcross, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_STRETCH_FROM_BOTTOM, caption: this.textFromBottom},
|
|
||||||
{value: AscFormat.ENTRANCE_STRETCH_FROM_LEFT, caption: this.textFromLeft},
|
|
||||||
{value: AscFormat.ENTRANCE_STRETCH_FROM_RIGHT, caption: this.textFromRight},
|
|
||||||
{value: AscFormat.ENTRANCE_STRETCH_FROM_TOP, caption: this.textFromTop}
|
|
||||||
];
|
|
||||||
case AscFormat.ENTRANCE_BASIC_SWIVEL:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_BASIC_SWIVEL_HORIZONTAL, caption: this.textHorizontal, defvalue: true},
|
|
||||||
{value: AscFormat.ENTRANCE_BASIC_SWIVEL_VERTICAL, caption: this.textVertical}
|
|
||||||
];
|
|
||||||
default:
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'menu-effect-group-exit':
|
|
||||||
switch (type){
|
|
||||||
case AscFormat.EXIT_BLINDS:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_BLINDS_HORIZONTAL, caption: this.textHorizontal, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_BLINDS_VERTICAL, caption: this.textVertical}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_BOX:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_BOX_IN, caption: this.textIn},
|
|
||||||
{value: AscFormat.EXIT_BOX_OUT, caption: this.textOut, defvalue: true}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_CHECKERBOARD:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_CHECKERBOARD_ACROSS, caption: this.textAcross, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_CIRCLE_OUT, caption: this.textUp}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_CIRCLE:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_CIRCLE_IN, caption: this.textIn},
|
|
||||||
{value: AscFormat.EXIT_CIRCLE_OUT, caption: this.textOut, defvalue: true}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_DIAMOND:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_DIAMOND_IN, caption: this.textIn},
|
|
||||||
{value: AscFormat.EXIT_DIAMOND_OUT, caption: this.textOut, defvalue: true}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_FLY_OUT_TO:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_FLY_OUT_TO_BOTTOM, caption: this.textToBottom, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_FLY_OUT_TO_BOTTOM_LEFT, caption: this.textToBottomLeft},
|
|
||||||
{value: AscFormat.EXIT_FLY_OUT_TO_LEFT, caption: this.textToLeft},
|
|
||||||
{value: AscFormat.EXIT_FLY_OUT_TO_TOP_LEFT, caption: this.textToTopLeft},
|
|
||||||
{value: AscFormat.EXIT_FLY_OUT_TO_TOP, caption: this.textToTop},
|
|
||||||
{value: AscFormat.EXIT_FLY_OUT_TO_TOP_RIGHT, caption: this.textToTopRight},
|
|
||||||
{value: AscFormat.EXIT_FLY_OUT_TO_RIGHT, caption: this.textToRight},
|
|
||||||
{value: AscFormat.EXIT_FLY_OUT_TO_BOTTOM_RIGHT, caption: this.textToBottomRight}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_PEEK_OUT_TO:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_PEEK_OUT_TO_BOTTOM, caption: this.textToBottom, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_PEEK_OUT_TO_LEFT, caption: this.textToLeft},
|
|
||||||
{value: AscFormat.EXIT_PEEK_OUT_TO_RIGHT, caption: this.textToRight},
|
|
||||||
{value: AscFormat.EXIT_PEEK_OUT_TO_TOP, caption: this.textToTop}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_PLUS:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_PLUS_IN, caption: this.textIn},
|
|
||||||
{value: AscFormat.EXIT_PLUS_OUT, caption: this.textOut, defvalue: true}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_RANDOM_BARS:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_RANDOM_BARS_HORIZONTAL, caption: this.textHorizontal, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_RANDOM_BARS_VERTICAL, caption: this.textVertical}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_SPLIT:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_SPLIT_HORIZONTAL_IN, caption: this.textHorizontalIn},
|
|
||||||
{value: AscFormat.EXIT_SPLIT_HORIZONTAL_OUT, caption: this.textHorizontalOut},
|
|
||||||
{value: AscFormat.EXIT_SPLIT_VERTICAL_IN, caption: this.textVerticalIn, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_SPLIT_VERTICAL_OUT, caption: this.textVerticalOut}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_STRIPS:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_STRIPS_LEFT_DOWN, caption: this.textLeftDown, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_STRIPS_LEFT_UP, caption: this.textLeftUp},
|
|
||||||
{value: AscFormat.EXIT_STRIPS_RIGHT_DOWN, caption: this.textRightDown},
|
|
||||||
{value: AscFormat.EXIT_STRIPS_RIGHT_UP, caption: this.textRightUp}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_WHEEL:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_WHEEL_1_SPOKE, caption: this.textSpoke1, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_WHEEL_2_SPOKES, caption: this.textSpoke2},
|
|
||||||
{value: AscFormat.EXIT_WHEEL_3_SPOKES, caption: this.textSpoke3},
|
|
||||||
{value: AscFormat.EXIT_WHEEL_4_SPOKES, caption: this.textSpoke4},
|
|
||||||
{value: AscFormat.EXIT_WHEEL_8_SPOKES, caption: this.textSpoke8}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_WIPE_FROM:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_WIPE_FROM_BOTTOM, caption: this.textFromBottom, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_WIPE_FROM_LEFT, caption: this.textFromLeft},
|
|
||||||
{value: AscFormat.EXIT_WIPE_FROM_RIGHT, caption: this.textFromRight},
|
|
||||||
{value: AscFormat.EXIT_WIPE_FROM_TOP, caption: this.textFromTop}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_ZOOM:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_ZOOM_OBJECT_CENTER, caption: this.textObjectCenter, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_ZOOM_SLIDE_CENTER, caption: this.textSlideCenter}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_BASIC_ZOOM:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_BASIC_ZOOM_OUT, caption: this.textOut, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_BASIC_ZOOM_OUT_TO_SCREEN_CENTER, caption: this.textOutToScreenCenter},
|
|
||||||
{value: AscFormat.EXIT_BASIC_ZOOM_OUT_SLIGHTLY, caption: this.textOutSlightly},
|
|
||||||
{value: AscFormat.EXIT_BASIC_ZOOM_IN, caption: this.textIn},
|
|
||||||
{value: AscFormat.EXIT_BASIC_ZOOM_IN_TO_SCREEN_BOTTOM, caption: this.textInToScreenBottom},
|
|
||||||
{value: AscFormat.EXIT_BASIC_ZOOM_IN_SLIGHTLY, caption: this.textInSlightly}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_COLLAPSE:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_COLLAPSE_ACROSS, caption: this.textAcross, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_COLLAPSE_TO_BOTTOM, caption: this.textToBottom},
|
|
||||||
{value: AscFormat.EXIT_COLLAPSE_TO_LEFT, caption: this.textToLeft},
|
|
||||||
{value: AscFormat.EXIT_COLLAPSE_TO_RIGHT, caption: this.textToRight},
|
|
||||||
{value: AscFormat.EXIT_COLLAPSE_TO_TOP, caption: this.textToTop}
|
|
||||||
];
|
|
||||||
case AscFormat.EXIT_BASIC_SWIVEL:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_BASIC_SWIVEL_HORIZONTAL, caption: this.textHorizontal, defvalue: true},
|
|
||||||
{value: AscFormat.EXIT_BASIC_SWIVEL_VERTICAL, caption: this.textVertical}
|
|
||||||
];
|
|
||||||
default:
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'menu-effect-group-path':
|
|
||||||
switch (type) {
|
|
||||||
case AscFormat.MOTION_CUSTOM_PATH:
|
|
||||||
return [
|
|
||||||
{value: AscFormat.MOTION_CUSTOM_PATH_CURVE, caption: this.textPathCurve, isCustom: true},
|
|
||||||
{value: AscFormat.MOTION_CUSTOM_PATH_LINE, caption: this.textPathLine, isCustom: true},
|
|
||||||
{value: AscFormat.MOTION_CUSTOM_PATH_SCRIBBLE, caption: this.textPathScribble, isCustom: true}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getSimilarEffectsArray: function (familyEffect) {
|
|
||||||
switch (familyEffect){
|
|
||||||
case 'shape':
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_CIRCLE, caption: this.textCircle},
|
|
||||||
{value: AscFormat.EXIT_BOX, caption: this.textBox},
|
|
||||||
{value: AscFormat.EXIT_DIAMOND, caption: this.textDiamond},
|
|
||||||
{value: AscFormat.EXIT_PLUS, caption: this.textPlus}
|
|
||||||
];
|
|
||||||
case 'entrshape':
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_CIRCLE, caption: this.textCircle},
|
|
||||||
{value: AscFormat.ENTRANCE_BOX, caption: this.textBox},
|
|
||||||
{value: AscFormat.ENTRANCE_DIAMOND, caption: this.textDiamond},
|
|
||||||
{value: AscFormat.ENTRANCE_PLUS, caption: this.textPlus}
|
|
||||||
];
|
|
||||||
case 'pathlines':
|
|
||||||
return[
|
|
||||||
{value: AscFormat.MOTION_DOWN, caption: this.textDown},
|
|
||||||
{value: AscFormat.MOTION_LEFT, caption: this.textLeft},
|
|
||||||
{value: AscFormat.MOTION_RIGHT, caption: this.textRight},
|
|
||||||
{value: AscFormat.MOTION_UP, caption: this.textUp}
|
|
||||||
];
|
|
||||||
case 'patharcs':
|
|
||||||
return [
|
|
||||||
{value: AscFormat.MOTION_ARC_DOWN, caption: this.textArcDown},
|
|
||||||
{value: AscFormat.MOTION_ARC_LEFT, caption: this.textArcLeft},
|
|
||||||
{value: AscFormat.MOTION_ARC_RIGHT, caption: this.textArcRight},
|
|
||||||
{value: AscFormat.MOTION_ARC_UP, caption: this.textArcUp}
|
|
||||||
];
|
|
||||||
case 'pathturns':
|
|
||||||
return [
|
|
||||||
{value: AscFormat.MOTION_TURN_DOWN, caption: this.textTurnDown},
|
|
||||||
{value: AscFormat.MOTION_TURN_DOWN_RIGHT, caption: this.textTurnDownRight},
|
|
||||||
{value: AscFormat.MOTION_TURN_UP, caption: this.textTurnUp},
|
|
||||||
{value: AscFormat.MOTION_TURN_UP_RIGHT, caption: this.textTurnUpRight}
|
|
||||||
];
|
|
||||||
case 'pathshapes':
|
|
||||||
return [
|
|
||||||
{value: AscFormat.MOTION_CIRCLE, caption: this.textCircle},
|
|
||||||
{value: AscFormat.MOTION_DIAMOND, caption: this.textDiamond},
|
|
||||||
{value: AscFormat.MOTION_EQUAL_TRIANGLE, caption: this.textEqualTriangle},
|
|
||||||
{value: AscFormat.MOTION_HEXAGON, caption: this.textHexagon},
|
|
||||||
{value: AscFormat.MOTION_OCTAGON, caption: this.textOctagon},
|
|
||||||
{value: AscFormat.MOTION_PARALLELOGRAM, caption: this.textParallelogram},
|
|
||||||
{value: AscFormat.MOTION_PENTAGON, caption: this.textPentagon},
|
|
||||||
{value: AscFormat.MOTION_RIGHT_TRIANGLE, caption: this.textRightTriangle},
|
|
||||||
{value: AscFormat.MOTION_SQUARE, caption: this.textSquare},
|
|
||||||
{value: AscFormat.MOTION_TRAPEZOID, caption: this.textTrapezoid}
|
|
||||||
|
|
||||||
];
|
|
||||||
case 'pathloops':
|
|
||||||
return [
|
|
||||||
{value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, caption: this.textHorizontalFigure},
|
|
||||||
{value: AscFormat.MOTION_VERTICAL_FIGURE_8, caption: this.textVerticalFigure},
|
|
||||||
{value: AscFormat.MOTION_LOOP_DE_LOOP, caption: this.textLoopDeLoop}
|
|
||||||
];
|
|
||||||
case 'entrfloat':
|
|
||||||
return [
|
|
||||||
{value: AscFormat.ENTRANCE_FLOAT_UP, caption: this.textFloatUp},
|
|
||||||
{value: AscFormat.ENTRANCE_FLOAT_DOWN, caption: this.textFloatDown}
|
|
||||||
];
|
|
||||||
case 'exitfloat':
|
|
||||||
return [
|
|
||||||
{value: AscFormat.EXIT_FLOAT_UP, caption: this.textFloatUp},
|
|
||||||
{value: AscFormat.EXIT_FLOAT_DOWN, caption: this.textFloatDown}
|
|
||||||
];
|
|
||||||
default:
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})(), Common.define.effectData || {});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
|
|
||||||
if ( window.AscDesktopEditor ) {
|
|
||||||
window.desktop = window.AscDesktopEditor;
|
|
||||||
desktop.features = {};
|
|
||||||
window.native_message_cmd = [];
|
|
||||||
|
|
||||||
window.on_native_message = function (cmd, param) {
|
|
||||||
if ( /window:features/.test(cmd) ) {
|
|
||||||
var obj = JSON.parse(param);
|
|
||||||
if ( obj.singlewindow !== undefined ) {
|
|
||||||
desktop.features.singlewindow = obj.singlewindow;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
window.native_message_cmd[cmd] = param;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !!window.RendererProcessVariable ) {
|
|
||||||
desktop.theme = window.RendererProcessVariable.theme;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.desktop.execCommand('webapps:entry', (window.features && JSON.stringify(window.features)) || '');
|
|
||||||
}
|
|
||||||
|
|
@ -31,10 +31,4 @@ if ( !window.fetch ) {
|
||||||
return target;
|
return target;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof Object.getOwnPropertySymbols != 'function') {
|
|
||||||
Object.getOwnPropertySymbols = function(target) {
|
|
||||||
return [];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,9 @@
|
||||||
|
|
||||||
function checkScaling() {
|
function checkScaling() {
|
||||||
var matches = {
|
var str_mq_150 = "screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), " +
|
||||||
'pixel-ratio__1_25': "screen and (-webkit-min-device-pixel-ratio: 1.25) and (-webkit-max-device-pixel-ratio: 1.49), " +
|
"screen and (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx)";
|
||||||
"screen and (min-resolution: 1.25dppx) and (max-resolution: 1.49dppx)",
|
if ( window.matchMedia(str_mq_150).matches ) {
|
||||||
'pixel-ratio__1_5': "screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.74), " +
|
document.body.classList.add('pixel-ratio__1_5');
|
||||||
"screen and (min-resolution: 1.5dppx) and (max-resolution: 1.74dppx)",
|
|
||||||
'pixel-ratio__1_75': "screen and (-webkit-min-device-pixel-ratio: 1.75) and (-webkit-max-device-pixel-ratio: 1.99), " +
|
|
||||||
"screen and (min-resolution: 1.75dppx) and (max-resolution: 1.99dppx)",
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var c in matches) {
|
|
||||||
if ( window.matchMedia(matches[c]).matches ) {
|
|
||||||
document.body.classList.add(c);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !window.matchMedia("screen and (-webkit-device-pixel-ratio: 1.5)," +
|
if ( !window.matchMedia("screen and (-webkit-device-pixel-ratio: 1.5)," +
|
||||||
|
|
@ -21,8 +11,8 @@ function checkScaling() {
|
||||||
"screen and (-webkit-device-pixel-ratio: 2)").matches )
|
"screen and (-webkit-device-pixel-ratio: 2)").matches )
|
||||||
{
|
{
|
||||||
// don't add zoom for mobile devices
|
// don't add zoom for mobile devices
|
||||||
// if (!(/android|avantgo|playbook|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)))
|
if (!(/android|avantgo|playbook|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)))
|
||||||
// document.getElementsByTagName('html')[0].setAttribute('style', 'zoom: ' + (1 / window.devicePixelRatio) + ';');
|
document.getElementsByTagName('html')[0].setAttribute('style', 'zoom: ' + (1 / window.devicePixelRatio) + ';');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,40 +32,7 @@ var params = (function() {
|
||||||
return urlParams;
|
return urlParams;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
var checkLocalStorage = (function () {
|
if ( !!params.uitheme && !localStorage.getItem("ui-theme-id") ) {
|
||||||
try {
|
|
||||||
var storage = window['localStorage'];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch(e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
if ( window.desktop ) {
|
|
||||||
var theme = desktop.theme
|
|
||||||
|
|
||||||
if ( theme ) {
|
|
||||||
if ( !theme.id && !!theme.type ) {
|
|
||||||
if ( theme.type == 'dark' ) theme.id = 'theme-dark'; else
|
|
||||||
if ( theme.type == 'light' ) theme.id = 'theme-classic-light';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( theme.id ) {
|
|
||||||
if ( theme.id == 'theme-system' ) {
|
|
||||||
localStorage.setItem("ui-theme-use-system", "1");
|
|
||||||
localStorage.removeItem("ui-theme-id");
|
|
||||||
delete params.uitheme;
|
|
||||||
} else {
|
|
||||||
localStorage.setItem("ui-theme-id", theme.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
localStorage.removeItem("ui-theme");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !!params.uitheme && checkLocalStorage && !localStorage.getItem("ui-theme-id") ) {
|
|
||||||
// const _t = params.uitheme.match(/([\w-]+)/g);
|
// const _t = params.uitheme.match(/([\w-]+)/g);
|
||||||
|
|
||||||
if ( params.uitheme == 'default-dark' )
|
if ( params.uitheme == 'default-dark' )
|
||||||
|
|
@ -84,30 +41,16 @@ if ( !!params.uitheme && checkLocalStorage && !localStorage.getItem("ui-theme-id
|
||||||
if ( params.uitheme == 'default-light' )
|
if ( params.uitheme == 'default-light' )
|
||||||
params.uitheme = 'theme-classic-light';
|
params.uitheme = 'theme-classic-light';
|
||||||
|
|
||||||
localStorage.removeItem("ui-theme");
|
localStorage.setItem("ui-theme-id", params.uitheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
var ui_theme_name = checkLocalStorage && localStorage.getItem("ui-theme-id") ? localStorage.getItem("ui-theme-id") : params.uitheme;
|
var ui_theme_name = localStorage.getItem("ui-theme-id");
|
||||||
var ui_theme_type;
|
|
||||||
if ( !ui_theme_name ) {
|
if ( !ui_theme_name ) {
|
||||||
if ( window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ) {
|
if ( window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ) {
|
||||||
ui_theme_name = 'theme-dark';
|
ui_theme_name = 'theme-dark';
|
||||||
ui_theme_type = 'dark';
|
localStorage.setItem("ui-theme-id", ui_theme_name);
|
||||||
checkLocalStorage && localStorage.removeItem("ui-theme");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !!ui_theme_name ) {
|
if ( !!ui_theme_name ) {
|
||||||
document.body.classList.add(ui_theme_name);
|
document.body.classList.add(ui_theme_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( checkLocalStorage ) {
|
|
||||||
let current_theme = localStorage.getItem("ui-theme");
|
|
||||||
if ( !!current_theme && /type":\s*"dark/.test(current_theme) || ui_theme_type == 'dark' ) {
|
|
||||||
document.body.classList.add("theme-type-dark");
|
|
||||||
|
|
||||||
let content_theme = localStorage.getItem("content-theme");
|
|
||||||
if ( content_theme == 'dark' ) {
|
|
||||||
document.body.classList.add("content-theme-dark");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
|
|
||||||
+function init_themes() {
|
+function init_themes() {
|
||||||
if ( localStorage.getItem("ui-theme-use-system") == '1' ) {
|
|
||||||
localStorage.removeItem("ui-theme-id");
|
|
||||||
}
|
|
||||||
|
|
||||||
var objtheme = localStorage.getItem("ui-theme");
|
var objtheme = localStorage.getItem("ui-theme");
|
||||||
if ( typeof(objtheme) == 'string' &&
|
if ( typeof(objtheme) == 'string' &&
|
||||||
objtheme.startsWith("{") && objtheme.endsWith("}") )
|
objtheme.startsWith("{") && objtheme.endsWith("}") )
|
||||||
|
|
|
||||||
|
|
@ -136,56 +136,29 @@ var utils = new(function() {
|
||||||
scale = window.AscCommon.checkDeviceScale();
|
scale = window.AscCommon.checkDeviceScale();
|
||||||
AscCommon.correctApplicationScale(scale);
|
AscCommon.correctApplicationScale(scale);
|
||||||
} else {
|
} else {
|
||||||
var str_mq_125 = "screen and (-webkit-min-device-pixel-ratio: 1.25) and (-webkit-max-device-pixel-ratio: 1.49), " +
|
var str_mq_150 = "screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), " +
|
||||||
"screen and (min-resolution: 1.25dppx) and (max-resolution: 1.49dppx)";
|
"screen and (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx)";
|
||||||
var str_mq_150 = "screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.74), " +
|
|
||||||
"screen and (min-resolution: 1.5dppx) and (max-resolution: 1.74dppx)";
|
|
||||||
var str_mq_175 = "screen and (-webkit-min-device-pixel-ratio: 1.75) and (-webkit-max-device-pixel-ratio: 1.99), " +
|
|
||||||
"screen and (min-resolution: 1.75dppx) and (max-resolution: 1.99dppx)";
|
|
||||||
var str_mq_200 = "screen and (-webkit-min-device-pixel-ratio: 2), " +
|
var str_mq_200 = "screen and (-webkit-min-device-pixel-ratio: 2), " +
|
||||||
"screen and (min-resolution: 2dppx), screen and (min-resolution: 192dpi)";
|
"screen and (min-resolution: 2dppx), screen and (min-resolution: 192dpi)";
|
||||||
|
|
||||||
if ( window.matchMedia(str_mq_125).matches ) {
|
|
||||||
scale.devicePixelRatio = 1.5;
|
|
||||||
} else
|
|
||||||
if ( window.matchMedia(str_mq_150).matches ) {
|
if ( window.matchMedia(str_mq_150).matches ) {
|
||||||
scale.devicePixelRatio = 1.5;
|
scale.devicePixelRatio = 1.5;
|
||||||
} else
|
} else
|
||||||
if ( window.matchMedia(str_mq_175).matches ) {
|
|
||||||
scale.devicePixelRatio = 1.75;
|
|
||||||
} else
|
|
||||||
if ( window.matchMedia(str_mq_200).matches )
|
if ( window.matchMedia(str_mq_200).matches )
|
||||||
scale.devicePixelRatio = 2;
|
scale.devicePixelRatio = 2;
|
||||||
else scale.devicePixelRatio = 1;
|
else scale.devicePixelRatio = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
var $root = $(document.body);
|
var $root = $(document.body);
|
||||||
var classes = document.body.className;
|
|
||||||
var clear_list = classes.replace(/pixel-ratio__[\w-]+/gi,'').trim();
|
|
||||||
if ( scale.devicePixelRatio < 1.25 ) {
|
|
||||||
if ( /pixel-ratio__/.test(classes) ) {
|
|
||||||
document.body.className = clear_list;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
if ( scale.devicePixelRatio < 1.5 ) {
|
if ( scale.devicePixelRatio < 1.5 ) {
|
||||||
if ( !/pixel-ratio__1_25/.test(classes) ) {
|
$root.removeClass('pixel-ratio__1_5 pixel-ratio__2');
|
||||||
document.body.className = clear_list + ' pixel-ratio__1_25';
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
if ( scale.devicePixelRatio < 1.75 ) {
|
if ( !(scale.devicePixelRatio < 1.5) && scale.devicePixelRatio < 2 ) {
|
||||||
if ( !/pixel-ratio__1_5/.test(classes) ) {
|
$root.removeClass('pixel-ratio__2');
|
||||||
document.body.className = clear_list + ' pixel-ratio__1_5';
|
$root.addClass('pixel-ratio__1_5');
|
||||||
}
|
|
||||||
} else
|
|
||||||
if ( !(scale.devicePixelRatio < 1.75) && scale.devicePixelRatio < 2 ) {
|
|
||||||
if ( !/pixel-ratio__1_75/.test(classes) ) {
|
|
||||||
document.body.className = clear_list + ' pixel-ratio__1_75';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$root.addClass('pixel-ratio__2');
|
$root.addClass('pixel-ratio__2');
|
||||||
if ( !/pixel-ratio__2/.test(classes) ) {
|
$root.removeClass('pixel-ratio__1_5');
|
||||||
document.body.className = clear_list + ' pixel-ratio__2';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
me.zoom = scale.correct ? scale.zoom : 1;
|
me.zoom = scale.correct ? scale.zoom : 1;
|
||||||
|
|
@ -193,18 +166,13 @@ var utils = new(function() {
|
||||||
me.innerHeight = window.innerHeight * me.zoom;
|
me.innerHeight = window.innerHeight * me.zoom;
|
||||||
me.applicationPixelRatio = scale.applicationPixelRatio || scale.devicePixelRatio;
|
me.applicationPixelRatio = scale.applicationPixelRatio || scale.devicePixelRatio;
|
||||||
};
|
};
|
||||||
checkSizeIE = function() {
|
|
||||||
me.innerWidth = window.innerWidth;
|
|
||||||
me.innerHeight = window.innerHeight;
|
|
||||||
};
|
|
||||||
me.zoom = 1;
|
me.zoom = 1;
|
||||||
me.applicationPixelRatio = 1;
|
me.applicationPixelRatio = 1;
|
||||||
me.innerWidth = window.innerWidth;
|
me.innerWidth = window.innerWidth;
|
||||||
me.innerHeight = window.innerHeight;
|
me.innerHeight = window.innerHeight;
|
||||||
if ( isIE ) {
|
if ( isIE )
|
||||||
$(document.body).addClass('ie');
|
$(document.body).addClass('ie');
|
||||||
$(window).on('resize', checkSizeIE);
|
else {
|
||||||
} else {
|
|
||||||
checkSize();
|
checkSize();
|
||||||
$(window).on('resize', checkSize);
|
$(window).on('resize', checkSize);
|
||||||
}
|
}
|
||||||
|
|
@ -411,10 +379,12 @@ var metrics = new(function() {
|
||||||
return me.defaultMetric;
|
return me.defaultMetric;
|
||||||
},
|
},
|
||||||
|
|
||||||
fnRecalcToMM: function(value) {
|
fnRecalcToMM: function(value, unit) {
|
||||||
// value in pt/cm/inch. need to convert to mm
|
// value in pt/cm/inch. need to convert to mm
|
||||||
|
if(unit===undefined)
|
||||||
|
unit=me.currentMetric;
|
||||||
if (value!==null && value!==undefined) {
|
if (value!==null && value!==undefined) {
|
||||||
switch (me.currentMetric) {
|
switch (unit) {
|
||||||
case me.c_MetricUnits.cm:
|
case me.c_MetricUnits.cm:
|
||||||
return value * 10;
|
return value * 10;
|
||||||
case me.c_MetricUnits.pt:
|
case me.c_MetricUnits.pt:
|
||||||
|
|
@ -426,9 +396,11 @@ var metrics = new(function() {
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
|
|
||||||
fnRecalcFromMM: function(value) {
|
fnRecalcFromMM: function(value, unit) {
|
||||||
// value in mm. need to convert to pt/cm/inch
|
// value in mm. need to convert to pt/cm/inch
|
||||||
switch (me.currentMetric) {
|
if(unit===undefined)
|
||||||
|
unit=me.currentMetric;
|
||||||
|
switch (unit) {
|
||||||
case me.c_MetricUnits.cm:
|
case me.c_MetricUnits.cm:
|
||||||
return parseFloat((value/10.).toFixed(4));
|
return parseFloat((value/10.).toFixed(4));
|
||||||
case me.c_MetricUnits.pt:
|
case me.c_MetricUnits.pt:
|
||||||
|
|
@ -441,7 +413,7 @@ var metrics = new(function() {
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
Common.Utils.Metric = _extend_object(metrics, Common.Utils.Metric);
|
Common.Utils.Metric = _extend_object(Common.Utils.Metric, metrics);
|
||||||
|
|
||||||
Common.Utils.RGBColor = function(colorString) {
|
Common.Utils.RGBColor = function(colorString) {
|
||||||
var r, g, b;
|
var r, g, b;
|
||||||
|
|
@ -608,12 +580,8 @@ Common.Utils.RGBColor = function(colorString) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var utilsString = new (function() {
|
Common.Utils.String = new (function() {
|
||||||
return {
|
return {
|
||||||
textCtrl: 'Ctrl',
|
|
||||||
textShift: 'Shift',
|
|
||||||
textAlt: 'Alt',
|
|
||||||
|
|
||||||
format: function(format) {
|
format: function(format) {
|
||||||
var args = _.toArray(arguments).slice(1);
|
var args = _.toArray(arguments).slice(1);
|
||||||
if (args.length && typeof args[0] == 'object')
|
if (args.length && typeof args[0] == 'object')
|
||||||
|
|
@ -657,7 +625,7 @@ var utilsString = new (function() {
|
||||||
return Common.Utils.String.format(template, string.replace(/\+(?=\S)/g, '').replace(/Ctrl|ctrl/g, '⌘').replace(/Alt|alt/g, '⌥').replace(/Shift|shift/g, '⇧'));
|
return Common.Utils.String.format(template, string.replace(/\+(?=\S)/g, '').replace(/Ctrl|ctrl/g, '⌘').replace(/Alt|alt/g, '⌥').replace(/Shift|shift/g, '⇧'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Common.Utils.String.format(template, string.replace(/Ctrl|ctrl/g, this.textCtrl).replace(/Alt|alt/g, this.textAlt).replace(/Shift|shift/g, this.textShift));
|
return Common.Utils.String.format(template, string);
|
||||||
},
|
},
|
||||||
|
|
||||||
parseFloat: function(string) {
|
parseFloat: function(string) {
|
||||||
|
|
@ -689,8 +657,6 @@ var utilsString = new (function() {
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
Common.Utils.String = _extend_object(utilsString, Common.Utils.String);
|
|
||||||
|
|
||||||
Common.Utils.isBrowserSupported = function() {
|
Common.Utils.isBrowserSupported = function() {
|
||||||
return !((Common.Utils.ieVersion != 0 && Common.Utils.ieVersion < 10.0) ||
|
return !((Common.Utils.ieVersion != 0 && Common.Utils.ieVersion < 10.0) ||
|
||||||
(Common.Utils.safariVersion != 0 && Common.Utils.safariVersion < 5.0) ||
|
(Common.Utils.safariVersion != 0 && Common.Utils.safariVersion < 5.0) ||
|
||||||
|
|
@ -892,7 +858,7 @@ Common.Utils.lockControls = function(causes, lock, opts, defControls) {
|
||||||
opts.merge && (controls = _.union(defControls,controls));
|
opts.merge && (controls = _.union(defControls,controls));
|
||||||
|
|
||||||
function doLock(cmp, cause) {
|
function doLock(cmp, cause) {
|
||||||
if ( cmp && cmp.options && _.contains(cmp.options.lock, cause) ) {
|
if ( cmp && _.contains(cmp.options.lock, cause) ) {
|
||||||
var index = cmp.keepState.indexOf(cause);
|
var index = cmp.keepState.indexOf(cause);
|
||||||
if (lock) {
|
if (lock) {
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
|
|
@ -924,7 +890,7 @@ Common.Utils.lockControls = function(causes, lock, opts, defControls) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split, menu, toggle, dataHint, dataHintDirection, dataHintOffset, dataHintTitle) {
|
Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split, menu, toggle) {
|
||||||
var btnsArr = createButtonSet();
|
var btnsArr = createButtonSet();
|
||||||
btnsArr.setDisabled(true);
|
btnsArr.setDisabled(true);
|
||||||
id = id || ("id-toolbar-" + iconCls);
|
id = id || ("id-toolbar-" + iconCls);
|
||||||
|
|
@ -942,11 +908,7 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split,
|
||||||
menu: menu || false,
|
menu: menu || false,
|
||||||
enableToggle: toggle || false,
|
enableToggle: toggle || false,
|
||||||
lock: lock,
|
lock: lock,
|
||||||
disabled: true,
|
disabled: true
|
||||||
dataHint: dataHint,
|
|
||||||
dataHintDirection: dataHintDirection,
|
|
||||||
dataHintOffset: dataHintOffset,
|
|
||||||
dataHintTitle: dataHintTitle
|
|
||||||
});
|
});
|
||||||
|
|
||||||
btnsArr.add(button);
|
btnsArr.add(button);
|
||||||
|
|
@ -979,7 +941,7 @@ Common.Utils.warningDocumentIsLocked = function (opts) {
|
||||||
callback: function(btn){
|
callback: function(btn){
|
||||||
if (btn == 'edit') {
|
if (btn == 'edit') {
|
||||||
if ( opts.disablefunc ) opts.disablefunc(false);
|
if ( opts.disablefunc ) opts.disablefunc(false);
|
||||||
app.getController('Main').api.asc_setLocalRestrictions(Asc.c_oAscLocalRestrictionType.None);
|
app.getController('Main').api.asc_setIsReadOnly(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -997,27 +959,23 @@ jQuery.fn.extend({
|
||||||
var _el = document.getElementById(id.substring(1));
|
var _el = document.getElementById(id.substring(1));
|
||||||
if ( !_el ) {
|
if ( !_el ) {
|
||||||
parent = parent || this;
|
parent = parent || this;
|
||||||
if ( parent && parent.length > 0 ) {
|
if ( parent instanceof jQuery ) {
|
||||||
parent.each(function (i, node) {
|
parent.each(function (i, node) {
|
||||||
if (node.querySelectorAll) {
|
_el = node.querySelectorAll(id);
|
||||||
_el = node.querySelectorAll(id);
|
if ( _el.length == 0 ) {
|
||||||
if ( _el.length == 0 ) {
|
if ( ('#' + node.id) == id ) {
|
||||||
if ( ('#' + node.id) == id ) {
|
_el = node;
|
||||||
_el = node;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
if ( _el.length ) {
|
|
||||||
_el = _el[0];
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
|
if ( _el.length ) {
|
||||||
|
_el = _el[0];
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (parent && parent.querySelectorAll) {
|
_el = parent.querySelectorAll(id);
|
||||||
_el = parent.querySelectorAll(id);
|
if ( _el && _el.length ) return _el[0];
|
||||||
if ( _el && _el.length ) return _el[0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1087,12 +1045,3 @@ Common.Utils.UserInfoParser = new(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
Common.Utils.getKeyByValue = function(obj, value) {
|
|
||||||
for(var prop in obj) {
|
|
||||||
if(obj.hasOwnProperty(prop)) {
|
|
||||||
if(obj[prop] === value)
|
|
||||||
return prop;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -55,10 +55,6 @@ define([
|
||||||
|
|
||||||
this.txtVersionNum = '{{PRODUCT_VERSION}}';
|
this.txtVersionNum = '{{PRODUCT_VERSION}}';
|
||||||
|
|
||||||
!(/\s$/.test(this.txtAddress)) && (this.txtAddress += " ");
|
|
||||||
!(/\s$/.test(this.txtMail)) && (this.txtMail += " ");
|
|
||||||
!(/\s$/.test(this.txtTel)) && (this.txtTel += " ");
|
|
||||||
|
|
||||||
this.template = _.template([
|
this.template = _.template([
|
||||||
'<table id="id-about-licensor-logo" cols="1" style="width: 100%; margin-top: 20px;">',
|
'<table id="id-about-licensor-logo" cols="1" style="width: 100%; margin-top: 20px;">',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
|
|
@ -126,12 +122,6 @@ define([
|
||||||
'<a href="mailto:" id="id-about-company-mail"></a>',
|
'<a href="mailto:" id="id-about-company-mail"></a>',
|
||||||
'</td>',
|
'</td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'<tr>',
|
|
||||||
'<td align="center" class="padding-small">',
|
|
||||||
'<label class="asc-about-desc-name">' + this.txtTel + '</label>',
|
|
||||||
'<label class="asc-about-desc" id="id-about-company-tel"></label>',
|
|
||||||
'</td>',
|
|
||||||
'</tr>',
|
|
||||||
'<tr>',
|
'<tr>',
|
||||||
'<td align="center" class="padding-small">',
|
'<td align="center" class="padding-small">',
|
||||||
'<a href="" target="_blank" id="id-about-company-url"></a>',
|
'<a href="" target="_blank" id="id-about-company-url"></a>',
|
||||||
|
|
@ -154,7 +144,7 @@ define([
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
'<td colspan="3" align="center">',
|
'<td colspan="3" align="center">',
|
||||||
'<a href="<%= publisherurl %>" target="_blank"><% print(publisherurl.replace(/https?:\\/{2}/, "").replace(/\\/$/,"")) %></a>',
|
'<label class="asc-about-desc"><% print(publisherurl.replace(/https?:\\/{2}/, "").replace(/\\/$/,"")) %></label>',
|
||||||
'</td>',
|
'</td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'</table>'
|
'</table>'
|
||||||
|
|
@ -183,7 +173,6 @@ define([
|
||||||
this.lblCompanyMail = _$l.findById('#id-about-company-mail');
|
this.lblCompanyMail = _$l.findById('#id-about-company-mail');
|
||||||
this.lblCompanyUrl = _$l.findById('#id-about-company-url');
|
this.lblCompanyUrl = _$l.findById('#id-about-company-url');
|
||||||
this.lblCompanyLic = _$l.findById('#id-about-company-lic');
|
this.lblCompanyLic = _$l.findById('#id-about-company-lic');
|
||||||
this.lblCompanyTel = _$l.findById('#id-about-company-tel');
|
|
||||||
|
|
||||||
this.$el.html(_$l);
|
this.$el.html(_$l);
|
||||||
this.$el.addClass('about-dlg');
|
this.$el.addClass('about-dlg');
|
||||||
|
|
@ -206,8 +195,7 @@ define([
|
||||||
if ( !this.rendered ) {
|
if ( !this.rendered ) {
|
||||||
this.licData = data || true;
|
this.licData = data || true;
|
||||||
} else {
|
} else {
|
||||||
if (data && typeof data == 'object' && data.customer && typeof(data.customer)=='object') {
|
if (data && typeof data == 'object' && typeof(data.customer)=='object') {
|
||||||
this.licData = data;
|
|
||||||
var customer = data.customer;
|
var customer = data.customer;
|
||||||
|
|
||||||
$('#id-about-licensor-logo').addClass('hidden');
|
$('#id-about-licensor-logo').addClass('hidden');
|
||||||
|
|
@ -231,11 +219,6 @@ define([
|
||||||
this.lblCompanyMail.attr('href', "mailto:"+value).text(value) :
|
this.lblCompanyMail.attr('href', "mailto:"+value).text(value) :
|
||||||
this.lblCompanyMail.parents('tr').addClass('hidden');
|
this.lblCompanyMail.parents('tr').addClass('hidden');
|
||||||
|
|
||||||
value = customer.phone;
|
|
||||||
value && value.length ?
|
|
||||||
this.lblCompanyTel.text(value) :
|
|
||||||
this.lblCompanyTel.parents('tr').addClass('hidden');
|
|
||||||
|
|
||||||
if ((value = customer.www) && value.length) {
|
if ((value = customer.www) && value.length) {
|
||||||
var http = !/^https?:\/{2}/i.test(value) ? "http:\/\/" : '';
|
var http = !/^https?:\/{2}/i.test(value) ? "http:\/\/" : '';
|
||||||
this.lblCompanyUrl.attr('href', http+value).text(value);
|
this.lblCompanyUrl.attr('href', http+value).text(value);
|
||||||
|
|
@ -246,11 +229,9 @@ define([
|
||||||
this.lblCompanyLic.text(value) :
|
this.lblCompanyLic.text(value) :
|
||||||
this.lblCompanyLic.parents('tr').addClass('hidden');
|
this.lblCompanyLic.parents('tr').addClass('hidden');
|
||||||
|
|
||||||
value = Common.UI.Themes.isDarkTheme() ? (customer.logoDark || customer.logo) : (customer.logo || customer.logoDark);
|
(value = customer.logo) && value.length ?
|
||||||
value && value.length ?
|
|
||||||
this.divCompanyLogo.html('<img src="'+value+'" style="max-width:216px; max-height: 35px;" />') :
|
this.divCompanyLogo.html('<img src="'+value+'" style="max-width:216px; max-height: 35px;" />') :
|
||||||
this.divCompanyLogo.parents('tr').addClass('hidden');
|
this.divCompanyLogo.parents('tr').addClass('hidden');
|
||||||
value && value.length && Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this));
|
|
||||||
} else {
|
} else {
|
||||||
this.cntLicenseeInfo.addClass('hidden');
|
this.cntLicenseeInfo.addClass('hidden');
|
||||||
this.cntLicensorInfo.addClass('margin-bottom');
|
this.cntLicensorInfo.addClass('margin-bottom');
|
||||||
|
|
@ -258,15 +239,6 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
changeLogo: function () {
|
|
||||||
if (!this.licData) return;
|
|
||||||
|
|
||||||
var customer = this.licData.customer;
|
|
||||||
if ( customer.logo && customer.logoDark && customer.logo !== customer.logoDark) {
|
|
||||||
this.divCompanyLogo.find('img').attr('src', Common.UI.Themes.isDarkTheme() ? (customer.logoDark || customer.logo) : (customer.logo || customer.logoDark));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
show: function () {
|
show: function () {
|
||||||
if ( !this.rendered ) this.render();
|
if ( !this.rendered ) this.render();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,11 +113,10 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
|
|
||||||
var $window = this.getChild();
|
var $window = this.getChild();
|
||||||
var me = this;
|
var me = this;
|
||||||
var panelAutoFormat = $window.find('#id-autocorrect-dialog-settings-' + (this.appPrefix=='pe-' ? 'de-' : this.appPrefix) + 'autoformat');
|
|
||||||
|
|
||||||
// Math correct
|
// Math correct
|
||||||
this.chReplaceType = new Common.UI.CheckBox({
|
this.chReplaceType = new Common.UI.CheckBox({
|
||||||
el: $window.find('#auto-correct-chb-replace-type'),
|
el: $window.findById('#auto-correct-chb-replace-type'),
|
||||||
labelText: this.textReplaceType,
|
labelText: this.textReplaceType,
|
||||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-math-correct-replace-type")
|
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-math-correct-replace-type")
|
||||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||||
|
|
@ -198,17 +197,17 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
// this.inputBy.cmpEl.find('input').css('font-size', '13px');
|
// this.inputBy.cmpEl.find('input').css('font-size', '13px');
|
||||||
|
|
||||||
this.btnReset = new Common.UI.Button({
|
this.btnReset = new Common.UI.Button({
|
||||||
el: $window.find('#auto-correct-btn-reset')
|
el: $('#auto-correct-btn-reset')
|
||||||
});
|
});
|
||||||
this.btnReset.on('click', _.bind(this.onResetToDefault, this));
|
this.btnReset.on('click', _.bind(this.onResetToDefault, this));
|
||||||
|
|
||||||
this.btnEdit = new Common.UI.Button({
|
this.btnEdit = new Common.UI.Button({
|
||||||
el: $window.find('#auto-correct-btn-edit')
|
el: $('#auto-correct-btn-edit')
|
||||||
});
|
});
|
||||||
this.btnEdit.on('click', _.bind(this.onEdit, this, false));
|
this.btnEdit.on('click', _.bind(this.onEdit, this, false));
|
||||||
|
|
||||||
this.btnDelete = new Common.UI.Button({
|
this.btnDelete = new Common.UI.Button({
|
||||||
el: $window.find('#auto-correct-btn-delete')
|
el: $('#auto-correct-btn-delete')
|
||||||
});
|
});
|
||||||
this.btnDelete.on('click', _.bind(this.onDelete, this, false));
|
this.btnDelete.on('click', _.bind(this.onDelete, this, false));
|
||||||
|
|
||||||
|
|
@ -270,23 +269,23 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
});
|
});
|
||||||
|
|
||||||
this.btnResetRec = new Common.UI.Button({
|
this.btnResetRec = new Common.UI.Button({
|
||||||
el: $window.find('#auto-correct-btn-rec-reset')
|
el: $('#auto-correct-btn-rec-reset')
|
||||||
});
|
});
|
||||||
this.btnResetRec.on('click', _.bind(this.onResetRecToDefault, this));
|
this.btnResetRec.on('click', _.bind(this.onResetRecToDefault, this));
|
||||||
|
|
||||||
this.btnAddRec = new Common.UI.Button({
|
this.btnAddRec = new Common.UI.Button({
|
||||||
el: $window.find('#auto-correct-btn-rec-edit')
|
el: $('#auto-correct-btn-rec-edit')
|
||||||
});
|
});
|
||||||
this.btnAddRec.on('click', _.bind(this.onAddRec, this, false));
|
this.btnAddRec.on('click', _.bind(this.onAddRec, this, false));
|
||||||
|
|
||||||
this.btnDeleteRec = new Common.UI.Button({
|
this.btnDeleteRec = new Common.UI.Button({
|
||||||
el: $window.find('#auto-correct-btn-rec-delete')
|
el: $('#auto-correct-btn-rec-delete')
|
||||||
});
|
});
|
||||||
this.btnDeleteRec.on('click', _.bind(this.onDeleteRec, this, false));
|
this.btnDeleteRec.on('click', _.bind(this.onDeleteRec, this, false));
|
||||||
|
|
||||||
if (this.appPrefix=='de-' || this.appPrefix=='pe-') {
|
if (this.appPrefix=='de-' || this.appPrefix=='pe-') {
|
||||||
this.chQuotes = new Common.UI.CheckBox({
|
this.chQuotes = new Common.UI.CheckBox({
|
||||||
el: $window.find('#id-autocorrect-dialog-chk-quotes'),
|
el: $('#id-autocorrect-dialog-chk-quotes'),
|
||||||
labelText: this.textQuotes,
|
labelText: this.textQuotes,
|
||||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-smart-quotes")
|
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-smart-quotes")
|
||||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||||
|
|
@ -296,7 +295,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
me.api.asc_SetAutoCorrectSmartQuotes(checked);
|
me.api.asc_SetAutoCorrectSmartQuotes(checked);
|
||||||
});
|
});
|
||||||
this.chHyphens = new Common.UI.CheckBox({
|
this.chHyphens = new Common.UI.CheckBox({
|
||||||
el: $window.find('#id-autocorrect-dialog-chk-hyphens'),
|
el: $('#id-autocorrect-dialog-chk-hyphens'),
|
||||||
labelText: this.textHyphens,
|
labelText: this.textHyphens,
|
||||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-hyphens")
|
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-hyphens")
|
||||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||||
|
|
@ -306,7 +305,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
me.api.asc_SetAutoCorrectHyphensWithDash(checked);
|
me.api.asc_SetAutoCorrectHyphensWithDash(checked);
|
||||||
});
|
});
|
||||||
this.chBulleted = new Common.UI.CheckBox({
|
this.chBulleted = new Common.UI.CheckBox({
|
||||||
el: $window.find('#id-autocorrect-dialog-chk-bulleted'),
|
el: $('#id-autocorrect-dialog-chk-bulleted'),
|
||||||
labelText: this.textBulleted,
|
labelText: this.textBulleted,
|
||||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-bulleted")
|
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-bulleted")
|
||||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||||
|
|
@ -316,7 +315,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
me.api.asc_SetAutomaticBulletedLists(checked);
|
me.api.asc_SetAutomaticBulletedLists(checked);
|
||||||
});
|
});
|
||||||
this.chNumbered = new Common.UI.CheckBox({
|
this.chNumbered = new Common.UI.CheckBox({
|
||||||
el: $window.find('#id-autocorrect-dialog-chk-numbered'),
|
el: $('#id-autocorrect-dialog-chk-numbered'),
|
||||||
labelText: this.textNumbered,
|
labelText: this.textNumbered,
|
||||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-numbered")
|
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-numbered")
|
||||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||||
|
|
@ -325,19 +324,9 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-numbered", checked);
|
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-numbered", checked);
|
||||||
me.api.asc_SetAutomaticNumberedLists(checked);
|
me.api.asc_SetAutomaticNumberedLists(checked);
|
||||||
});
|
});
|
||||||
this.chDoubleSpaces = new Common.UI.CheckBox({
|
|
||||||
el: panelAutoFormat.find('#id-autocorrect-dialog-chk-double-space'),
|
|
||||||
labelText: this.textDoubleSpaces,
|
|
||||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-double-space")
|
|
||||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
|
||||||
var checked = (field.getValue()==='checked');
|
|
||||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-double-space", checked);
|
|
||||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-double-space", checked);
|
|
||||||
me.api.asc_SetAutoCorrectDoubleSpaceWithPeriod(checked);
|
|
||||||
});
|
|
||||||
// AutoCorrect
|
// AutoCorrect
|
||||||
this.chFLSentence = new Common.UI.CheckBox({
|
this.chFLSentence = new Common.UI.CheckBox({
|
||||||
el: $window.find('#id-autocorrect-dialog-chk-fl-sentence'),
|
el: $('#id-autocorrect-dialog-chk-fl-sentence'),
|
||||||
labelText: this.textFLSentence,
|
labelText: this.textFLSentence,
|
||||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-fl-sentence")
|
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-fl-sentence")
|
||||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||||
|
|
@ -347,21 +336,10 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
me.api.asc_SetAutoCorrectFirstLetterOfSentences && me.api.asc_SetAutoCorrectFirstLetterOfSentences(checked);
|
me.api.asc_SetAutoCorrectFirstLetterOfSentences && me.api.asc_SetAutoCorrectFirstLetterOfSentences(checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.chFLCells = new Common.UI.CheckBox({
|
|
||||||
el: $window.find('#id-autocorrect-dialog-chk-fl-cells'),
|
|
||||||
labelText: this.textFLCells,
|
|
||||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-fl-cells")
|
|
||||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
|
||||||
var checked = (field.getValue()==='checked');
|
|
||||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-fl-cells", checked);
|
|
||||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-fl-cells", checked);
|
|
||||||
me.api.asc_SetAutoCorrectFirstLetterOfCells && me.api.asc_SetAutoCorrectFirstLetterOfCells(checked);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.btnsCategory[3].on('click', _.bind(this.onAutocorrectCategoryClick, this, false));
|
this.btnsCategory[3].on('click', _.bind(this.onAutocorrectCategoryClick, this, false));
|
||||||
} else if (this.appPrefix=='sse-') {
|
} else if (this.appPrefix=='sse-') {
|
||||||
this.chNewRows = new Common.UI.CheckBox({
|
this.chNewRows = new Common.UI.CheckBox({
|
||||||
el: $window.find('#id-autocorrect-dialog-chk-new-rows'),
|
el: $('#id-autocorrect-dialog-chk-new-rows'),
|
||||||
labelText: this.textNewRowCol,
|
labelText: this.textNewRowCol,
|
||||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-new-rows")
|
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-new-rows")
|
||||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||||
|
|
@ -370,17 +348,18 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-new-rows", checked);
|
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-new-rows", checked);
|
||||||
me.api.asc_setIncludeNewRowColTable(checked);
|
me.api.asc_setIncludeNewRowColTable(checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.chHyperlink = new Common.UI.CheckBox({
|
||||||
|
el: $('#id-autocorrect-dialog-chk-hyperlink'),
|
||||||
|
labelText: this.textHyperlink,
|
||||||
|
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-hyperlink")
|
||||||
|
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||||
|
var checked = (field.getValue()==='checked');
|
||||||
|
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-hyperlink", checked);
|
||||||
|
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-hyperlink", checked);
|
||||||
|
me.api.asc_setAutoCorrectHyperlinks(checked);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this.chHyperlink = new Common.UI.CheckBox({
|
|
||||||
el: panelAutoFormat.find('#id-autocorrect-dialog-chk-hyperlink'),
|
|
||||||
labelText: this.textHyperlink,
|
|
||||||
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-hyperlink")
|
|
||||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
|
||||||
var checked = (field.getValue()==='checked');
|
|
||||||
Common.localStorage.setBool(me.appPrefix + "settings-autoformat-hyperlink", checked);
|
|
||||||
Common.Utils.InternalSettings.set(me.appPrefix + "settings-autoformat-hyperlink", checked);
|
|
||||||
me.api.asc_SetAutoCorrectHyperlinks(checked);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.btnsCategory[0].on('click', _.bind(this.onMathCategoryClick, this, false));
|
this.btnsCategory[0].on('click', _.bind(this.onMathCategoryClick, this, false));
|
||||||
this.btnsCategory[1].on('click', _.bind(this.onRecCategoryClick, this, false));
|
this.btnsCategory[1].on('click', _.bind(this.onRecCategoryClick, this, false));
|
||||||
|
|
@ -402,10 +381,10 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
var arr = [
|
var arr = [
|
||||||
this.chReplaceType, this.inputReplace, this.inputBy, this.mathList, this.btnReset, this.btnEdit, this.btnDelete, // 0 tab
|
this.chReplaceType, this.inputReplace, this.inputBy, this.mathList, this.btnReset, this.btnEdit, this.btnDelete, // 0 tab
|
||||||
this.inputRecFind, this.mathRecList, this.btnResetRec, this.btnAddRec, this.btnDeleteRec, // 1 tab
|
this.inputRecFind, this.mathRecList, this.btnResetRec, this.btnAddRec, this.btnDeleteRec, // 1 tab
|
||||||
this.chHyperlink // 2 tab
|
this.chFLSentence // 3 tab
|
||||||
];
|
];
|
||||||
arr = arr.concat(this.chNewRows ? [this.chNewRows] : [this.chQuotes, this.chHyphens, this.chBulleted, this.chNumbered]);
|
arr = arr.concat(this.chNewRows ? [this.chHyperlink, this.chNewRows] : [this.chQuotes, this.chHyphens, this.chBulleted, this.chNumbered]);
|
||||||
arr = arr.concat(this.chFLSentence ? [this.chFLSentence, this.chFLCells] : []);
|
arr = arr.concat(this.chFLSentence ? [this.chFLSentence] : []);
|
||||||
return arr;
|
return arr;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -474,7 +453,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
onAutoformatCategoryClick: function(delay) {
|
onAutoformatCategoryClick: function(delay) {
|
||||||
var me = this;
|
var me = this;
|
||||||
_.delay(function(){
|
_.delay(function(){
|
||||||
(me.appPrefix=='sse-') ? me.chHyperlink.focus() : me.chQuotes.focus();
|
me.chHyperlink ? me.chHyperlink.focus() : me.chQuotes.focus();
|
||||||
},delay ? 50 : 0);
|
},delay ? 50 : 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -850,9 +829,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
|
||||||
textNewRowCol: 'Include new rows and columns in table',
|
textNewRowCol: 'Include new rows and columns in table',
|
||||||
textAutoCorrect: 'AutoCorrect',
|
textAutoCorrect: 'AutoCorrect',
|
||||||
textFLSentence: 'Capitalize first letter of sentences',
|
textFLSentence: 'Capitalize first letter of sentences',
|
||||||
textHyperlink: 'Internet and network paths with hyperlinks',
|
textHyperlink: 'Internet and network paths with hyperlinks'
|
||||||
textFLCells: 'Capitalize first letter of table cells',
|
|
||||||
textDoubleSpaces: 'Add period with double-space'
|
|
||||||
|
|
||||||
}, Common.Views.AutoCorrectDialog || {}))
|
}, Common.Views.AutoCorrectDialog || {}))
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ define([
|
||||||
this.txtMessage.on('keydown', _.bind(this._onKeyDown, this));
|
this.txtMessage.on('keydown', _.bind(this._onKeyDown, this));
|
||||||
|
|
||||||
this.setupLayout();
|
this.setupLayout();
|
||||||
this.trigger('render:after', this);
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -156,7 +156,7 @@ define([
|
||||||
this._onBtnAddMessage(event);
|
this._onBtnAddMessage(event);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if (event.keyCode == Common.UI.Keys.ESC && !Common.UI.HintManager.isHintVisible()) {
|
if (event.keyCode == Common.UI.Keys.ESC) {
|
||||||
this.hide();
|
this.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ define([
|
||||||
var view = this,
|
var view = this,
|
||||||
textBox = $(this.el).find('textarea'),
|
textBox = $(this.el).find('textarea'),
|
||||||
domTextBox = null,
|
domTextBox = null,
|
||||||
minHeight = 55,
|
minHeight = 50,
|
||||||
lineHeight = 0,
|
lineHeight = 0,
|
||||||
scrollPos = 0,
|
scrollPos = 0,
|
||||||
oldHeight = 0,
|
oldHeight = 0,
|
||||||
|
|
@ -293,9 +293,6 @@ define([
|
||||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||||
|
|
||||||
this.store = this.options.store;
|
this.store = this.options.store;
|
||||||
|
|
||||||
var filter = Common.localStorage.getKeysFilter();
|
|
||||||
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
|
|
@ -307,8 +304,7 @@ define([
|
||||||
textAddComment: me.textAddComment,
|
textAddComment: me.textAddComment,
|
||||||
textCancel: me.textCancel,
|
textCancel: me.textCancel,
|
||||||
textEnterCommentHint: me.textEnterCommentHint,
|
textEnterCommentHint: me.textEnterCommentHint,
|
||||||
maxCommLength: Asc.c_oAscMaxCellOrCommentLength,
|
maxCommLength: Asc.c_oAscMaxCellOrCommentLength
|
||||||
textComments: me.textComments
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.buttonAddCommentToDoc = new Common.UI.Button({
|
this.buttonAddCommentToDoc = new Common.UI.Button({
|
||||||
|
|
@ -325,90 +321,9 @@ define([
|
||||||
enableToggle: false
|
enableToggle: false
|
||||||
});
|
});
|
||||||
|
|
||||||
this.buttonSort = new Common.UI.Button({
|
|
||||||
parentEl: $('#comments-btn-sort', this.$el),
|
|
||||||
cls: 'btn-toolbar',
|
|
||||||
iconCls: 'toolbar__icon btn-sorting',
|
|
||||||
hint: this.textSort,
|
|
||||||
menu: new Common.UI.Menu({
|
|
||||||
menuAlign: 'tr-br',
|
|
||||||
style: 'min-width: auto;',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
caption: this.mniDateDesc,
|
|
||||||
value: 'date-desc',
|
|
||||||
checkable: true,
|
|
||||||
checked: (Common.localStorage.getItem(this.appPrefix + "comments-sort") || 'date-desc') === 'date-desc',
|
|
||||||
toggleGroup: 'sortcomments'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
caption: this.mniDateAsc,
|
|
||||||
value: 'date-asc',
|
|
||||||
checkable: true,
|
|
||||||
checked: (Common.localStorage.getItem(this.appPrefix + "comments-sort") || 'date-desc') === 'date-asc',
|
|
||||||
toggleGroup: 'sortcomments'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
caption: this.mniAuthorAsc,
|
|
||||||
value: 'author-asc',
|
|
||||||
checkable: true,
|
|
||||||
checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'author-asc',
|
|
||||||
toggleGroup: 'sortcomments'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
caption: this.mniAuthorDesc,
|
|
||||||
value: 'author-desc',
|
|
||||||
checkable: true,
|
|
||||||
checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'author-desc',
|
|
||||||
toggleGroup: 'sortcomments'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
caption: this.mniPositionAsc,
|
|
||||||
value: 'position-asc',
|
|
||||||
checkable: true,
|
|
||||||
visible: this.appPrefix==='de-',
|
|
||||||
checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'position-asc',
|
|
||||||
toggleGroup: 'sortcomments'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
caption: this.mniPositionDesc,
|
|
||||||
value: 'position-desc',
|
|
||||||
checkable: true,
|
|
||||||
visible: this.appPrefix==='de-',
|
|
||||||
checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'position-desc',
|
|
||||||
toggleGroup: 'sortcomments'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
caption: '--',
|
|
||||||
visible: false
|
|
||||||
},
|
|
||||||
this.menuFilterGroups = new Common.UI.MenuItem({
|
|
||||||
caption: this.mniFilterGroups,
|
|
||||||
checkable: false,
|
|
||||||
visible: false,
|
|
||||||
menu: new Common.UI.Menu({
|
|
||||||
menuAlign: 'tl-tr',
|
|
||||||
style: 'min-width: auto;',
|
|
||||||
items: []
|
|
||||||
})
|
|
||||||
})
|
|
||||||
]
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
this.buttonClose = new Common.UI.Button({
|
|
||||||
parentEl: $('#comments-btn-close', this.$el),
|
|
||||||
cls: 'btn-toolbar',
|
|
||||||
iconCls: 'toolbar__icon btn-close',
|
|
||||||
hint: this.textClosePanel
|
|
||||||
});
|
|
||||||
|
|
||||||
this.buttonAddCommentToDoc.on('click', _.bind(this.onClickShowBoxDocumentComment, this));
|
this.buttonAddCommentToDoc.on('click', _.bind(this.onClickShowBoxDocumentComment, this));
|
||||||
this.buttonAdd.on('click', _.bind(this.onClickAddDocumentComment, this));
|
this.buttonAdd.on('click', _.bind(this.onClickAddDocumentComment, this));
|
||||||
this.buttonCancel.on('click', _.bind(this.onClickCancelDocumentComment, this));
|
this.buttonCancel.on('click', _.bind(this.onClickCancelDocumentComment, this));
|
||||||
this.buttonClose.on('click', _.bind(this.onClickClosePanel, this));
|
|
||||||
this.buttonSort.menu.on('item:toggle', _.bind(this.onSortClick, this));
|
|
||||||
this.menuFilterGroups.menu.on('item:toggle', _.bind(this.onFilterGroupsClick, this));
|
|
||||||
|
|
||||||
this.txtComment = $('#comment-msg-new', this.el);
|
this.txtComment = $('#comment-msg-new', this.el);
|
||||||
this.txtComment.keydown(function (event) {
|
this.txtComment.keydown(function (event) {
|
||||||
|
|
@ -443,8 +358,7 @@ define([
|
||||||
textReply: me.textReply,
|
textReply: me.textReply,
|
||||||
textClose: me.textClose,
|
textClose: me.textClose,
|
||||||
maxCommLength: Asc.c_oAscMaxCellOrCommentLength
|
maxCommLength: Asc.c_oAscMaxCellOrCommentLength
|
||||||
})),
|
}))
|
||||||
emptyText: me.txtEmpty
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var addtooltip = function (dataview, view, record) {
|
var addtooltip = function (dataview, view, record) {
|
||||||
|
|
@ -465,11 +379,6 @@ define([
|
||||||
btns.each(function(idx, item){
|
btns.each(function(idx, item){
|
||||||
arr.push($(item).data('bs.tooltip').tip());
|
arr.push($(item).data('bs.tooltip').tip());
|
||||||
});
|
});
|
||||||
btns = $(view.el).find('.i-comment-resolved');
|
|
||||||
btns.tooltip({title: me.textViewResolved, placement: 'cursor'});
|
|
||||||
btns.each(function(idx, item){
|
|
||||||
arr.push($(item).data('bs.tooltip').tip());
|
|
||||||
});
|
|
||||||
view.tipsArray = arr;
|
view.tipsArray = arr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -493,7 +402,7 @@ define([
|
||||||
},
|
},
|
||||||
updateScrolls: function () {
|
updateScrolls: function () {
|
||||||
if (this.commentsView && this.commentsView.scroller) {
|
if (this.commentsView && this.commentsView.scroller) {
|
||||||
this.commentsView.scroller.update({minScrollbarLength: this.commentsView.minScrollbarLength, alwaysVisibleY: true});
|
this.commentsView.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -749,9 +658,6 @@ define([
|
||||||
getUserName: function (username) {
|
getUserName: function (username) {
|
||||||
return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
|
return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username));
|
||||||
},
|
},
|
||||||
getEncodedName: function (username) {
|
|
||||||
return Common.Utils.String.htmlEncode(username);
|
|
||||||
},
|
|
||||||
|
|
||||||
pickLink: function (message) {
|
pickLink: function (message) {
|
||||||
var arr = [], offset, len;
|
var arr = [], offset, len;
|
||||||
|
|
@ -807,7 +713,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
pickEMail: function (commentId, message) {
|
pickEMail: function (commentId, message) {
|
||||||
var arr = Common.Utils.String.htmlEncode(message).match(/\B[@+][A-Z0-9._%+-]+@[A-Z0-9._-]+\.[A-Z]+\b/gi);
|
var arr = Common.Utils.String.htmlEncode(message).match(/\B[@+][A-Z0-9._%+-]+@[A-Z0-9._]+\.[A-Z]+\b/gi);
|
||||||
arr = _.map(arr, function(str){
|
arr = _.map(arr, function(str){
|
||||||
return str.slice(1, str.length);
|
return str.slice(1, str.length);
|
||||||
});
|
});
|
||||||
|
|
@ -824,18 +730,6 @@ define([
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onSortClick: function(menu, item, state) {
|
|
||||||
state && this.fireEvent('comment:sort', [item.value]);
|
|
||||||
},
|
|
||||||
|
|
||||||
onFilterGroupsClick: function(menu, item, state) {
|
|
||||||
state && this.fireEvent('comment:filtergroups', [item.value]);
|
|
||||||
},
|
|
||||||
|
|
||||||
onClickClosePanel: function() {
|
|
||||||
Common.NotificationCenter.trigger('leftmenu:change', 'hide');
|
|
||||||
},
|
|
||||||
|
|
||||||
textComments : 'Comments',
|
textComments : 'Comments',
|
||||||
textAnonym : 'Guest',
|
textAnonym : 'Guest',
|
||||||
textAddCommentToDoc : 'Add Comment to Document',
|
textAddCommentToDoc : 'Add Comment to Document',
|
||||||
|
|
@ -850,18 +744,6 @@ define([
|
||||||
textEdit : 'Edit',
|
textEdit : 'Edit',
|
||||||
textAdd : "Add",
|
textAdd : "Add",
|
||||||
textOpenAgain : "Open Again",
|
textOpenAgain : "Open Again",
|
||||||
textHintAddComment : 'Add Comment',
|
textHintAddComment : 'Add Comment'
|
||||||
textSort: 'Sort comments',
|
|
||||||
mniPositionAsc: 'From top',
|
|
||||||
mniPositionDesc: 'From bottom',
|
|
||||||
mniAuthorAsc: 'Author A to Z',
|
|
||||||
mniAuthorDesc: 'Author Z to A',
|
|
||||||
mniDateDesc: 'Newest',
|
|
||||||
mniDateAsc: 'Oldest',
|
|
||||||
textClosePanel: 'Close comments',
|
|
||||||
textViewResolved: 'You have not permission for reopen comment',
|
|
||||||
mniFilterGroups: 'Filter by Group',
|
|
||||||
textAll: 'All',
|
|
||||||
txtEmpty: 'There are no comments in the document.'
|
|
||||||
}, Common.Views.Comments || {}))
|
}, Common.Views.Comments || {}))
|
||||||
});
|
});
|
||||||
|
|
@ -95,7 +95,7 @@ define([
|
||||||
labelText: this.textDontShow
|
labelText: this.textDontShow
|
||||||
});
|
});
|
||||||
|
|
||||||
this.getChild().find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
this.getChild().find('.btn').on('click', _.bind(this.onBtnClick, this));
|
||||||
this.autoSize();
|
this.autoSize();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -126,7 +126,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
textTitle : 'Copy, Cut and Paste Actions',
|
textTitle : 'Copy, Cut and Paste Actions',
|
||||||
textMsg : 'Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.<br><br>To copy or paste to or from applications outside the editor tab use the following keyboard combinations:',
|
textMsg : 'Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.<br><br>.To copy or paste to or from applications outside the editor tab use the following keyboard combinations:',
|
||||||
textToCopy : 'for Copy',
|
textToCopy : 'for Copy',
|
||||||
textToPaste : 'for Paste',
|
textToPaste : 'for Paste',
|
||||||
textToCut: 'for Cut',
|
textToCut: 'for Cut',
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ define([
|
||||||
me.inputLabel.setValue(this.options.value || '' );
|
me.inputLabel.setValue(this.options.value || '' );
|
||||||
|
|
||||||
var $window = this.getChild();
|
var $window = this.getChild();
|
||||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
$window.find('.btn').on('click', _.bind(this.onBtnClick, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
show: function() {
|
show: function() {
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,8 @@ define([
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div class="separator horizontal"></div>',
|
'<div class="separator horizontal"></div>',
|
||||||
'<div class="footer" style="text-align: center;">',
|
'<div class="footer" style="text-align: center;">',
|
||||||
'<button id="id-btn-diagram-editor-apply" class="btn normal dlg-btn primary custom" result="ok" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textSave + '</button>',
|
'<button id="id-btn-diagram-editor-apply" class="btn normal dlg-btn primary custom" result="ok">' + this.textSave + '</button>',
|
||||||
'<button id="id-btn-diagram-editor-cancel" class="btn normal dlg-btn" result="cancel" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textClose + '</button>',
|
'<button id="id-btn-diagram-editor-cancel" class="btn normal dlg-btn" result="cancel">' + this.textClose + '</button>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,8 @@ define([
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div class="separator horizontal"></div>',
|
'<div class="separator horizontal"></div>',
|
||||||
'<div class="footer" style="text-align: center;">',
|
'<div class="footer" style="text-align: center;">',
|
||||||
'<button id="id-btn-merge-editor-apply" class="btn normal dlg-btn primary custom" result="ok" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textSave + '</button>',
|
'<button id="id-btn-merge-editor-apply" class="btn normal dlg-btn primary custom" result="ok">' + this.textSave + '</button>',
|
||||||
'<button id="id-btn-merge-editor-cancel" class="btn normal dlg-btn" result="cancel" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textClose + '</button>',
|
'<button id="id-btn-merge-editor-cancel" class="btn normal dlg-btn disabled" result="cancel">' + this.textClose + '</button>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,164 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* (c) Copyright Ascensio System SIA 2010-2022
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* ExternalOleEditor.js
|
|
||||||
*
|
|
||||||
* Created by Julia Radzhabova on 3/10/22
|
|
||||||
* Copyright (c) 2022 Ascensio System SIA. All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
define([
|
|
||||||
'common/main/lib/component/Window'
|
|
||||||
], function () { 'use strict';
|
|
||||||
|
|
||||||
Common.Views.ExternalOleEditor = Common.UI.Window.extend(_.extend({
|
|
||||||
initialize : function(options) {
|
|
||||||
var _options = {};
|
|
||||||
var _inner_height = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top');
|
|
||||||
_.extend(_options, {
|
|
||||||
title: this.textTitle,
|
|
||||||
width: 910,
|
|
||||||
height: (_inner_height - 700)<0 ? _inner_height : 700,
|
|
||||||
cls: 'advanced-settings-dlg',
|
|
||||||
header: true,
|
|
||||||
toolclose: 'hide',
|
|
||||||
toolcallback: _.bind(this.onToolClose, this)
|
|
||||||
}, options);
|
|
||||||
|
|
||||||
this.template = [
|
|
||||||
'<div id="id-ole-editor-container" class="box" style="height:' + (_options.height-85) + 'px;">',
|
|
||||||
'<div id="id-ole-editor-placeholder" style="width: 100%;height: 100%;"></div>',
|
|
||||||
'</div>',
|
|
||||||
'<div class="separator horizontal"></div>',
|
|
||||||
'<div class="footer" style="text-align: center;">',
|
|
||||||
'<button id="id-btn-ole-editor-apply" class="btn normal dlg-btn primary custom" result="ok" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textSave + '</button>',
|
|
||||||
'<button id="id-btn-ole-editor-cancel" class="btn normal dlg-btn" result="cancel" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textClose + '</button>',
|
|
||||||
'</div>'
|
|
||||||
].join('');
|
|
||||||
|
|
||||||
_options.tpl = _.template(this.template)(_options);
|
|
||||||
|
|
||||||
this.handler = _options.handler;
|
|
||||||
this._oleData = null;
|
|
||||||
this._isNewOle = true;
|
|
||||||
Common.UI.Window.prototype.initialize.call(this, _options);
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
|
||||||
Common.UI.Window.prototype.render.call(this);
|
|
||||||
|
|
||||||
this.btnSave = new Common.UI.Button({
|
|
||||||
el: $('#id-btn-ole-editor-apply'),
|
|
||||||
disabled: true
|
|
||||||
});
|
|
||||||
this.btnCancel = new Common.UI.Button({
|
|
||||||
el: $('#id-btn-ole-editor-cancel')
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$window.find('.dlg-btn').on('click', _.bind(this.onDlgBtnClick, this));
|
|
||||||
},
|
|
||||||
|
|
||||||
show: function() {
|
|
||||||
this.setPlaceholder();
|
|
||||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
|
||||||
},
|
|
||||||
|
|
||||||
setOleData: function(data) {
|
|
||||||
this._oleData = data;
|
|
||||||
if (this._isExternalDocReady)
|
|
||||||
this.fireEvent('setoledata', this);
|
|
||||||
},
|
|
||||||
|
|
||||||
setEditMode: function(mode) {
|
|
||||||
this._isNewOle = !mode;
|
|
||||||
},
|
|
||||||
|
|
||||||
isEditMode: function() {
|
|
||||||
return !this._isNewOle;
|
|
||||||
},
|
|
||||||
|
|
||||||
setControlsDisabled: function(disable) {
|
|
||||||
this.btnSave.setDisabled(disable);
|
|
||||||
this.btnCancel.setDisabled(disable);
|
|
||||||
(disable) ? this.$window.find('.tool.close').addClass('disabled') : this.$window.find('.tool.close').removeClass('disabled');
|
|
||||||
},
|
|
||||||
|
|
||||||
onDlgBtnClick: function(event) {
|
|
||||||
if ( this.handler ) {
|
|
||||||
this.handler.call(this, event.currentTarget.attributes['result'].value);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.hide();
|
|
||||||
},
|
|
||||||
|
|
||||||
onToolClose: function() {
|
|
||||||
if ( this.handler ) {
|
|
||||||
this.handler.call(this, 'cancel');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.hide();
|
|
||||||
},
|
|
||||||
|
|
||||||
setHeight: function(height) {
|
|
||||||
if (height >= 0) {
|
|
||||||
var min = parseInt(this.$window.css('min-height'));
|
|
||||||
height < min && (height = min);
|
|
||||||
this.$window.height(height);
|
|
||||||
|
|
||||||
var header_height = (this.initConfig.header) ? parseInt(this.$window.find('> .header').css('height')) : 0;
|
|
||||||
|
|
||||||
this.$window.find('> .body').css('height', height-header_height);
|
|
||||||
this.$window.find('> .body > .box').css('height', height-85);
|
|
||||||
|
|
||||||
var top = (Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top') - parseInt(height)) / 2;
|
|
||||||
var left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2;
|
|
||||||
|
|
||||||
this.$window.css('left',left);
|
|
||||||
this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setPlaceholder: function(placeholder) {
|
|
||||||
this._placeholder = placeholder;
|
|
||||||
},
|
|
||||||
|
|
||||||
getPlaceholder: function() {
|
|
||||||
return this._placeholder;
|
|
||||||
},
|
|
||||||
|
|
||||||
textSave: 'Save & Exit',
|
|
||||||
textClose: 'Close',
|
|
||||||
textTitle: 'Spreadsheet Editor'
|
|
||||||
}, Common.Views.ExternalOleEditor || {}));
|
|
||||||
});
|
|
||||||