Merge branch 'develop' into hotfix/v4.2.7
This commit is contained in:
		
						commit
						1fdf278df6
					
				
							
								
								
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -18,3 +18,8 @@ apps/presentationeditor/mobile/document
 | 
				
			||||||
apps/spreadsheeteditor/embed/offlinedocs
 | 
					apps/spreadsheeteditor/embed/offlinedocs
 | 
				
			||||||
apps/spreadsheeteditor/main/offlinedocs
 | 
					apps/spreadsheeteditor/main/offlinedocs
 | 
				
			||||||
apps/spreadsheeteditor/mobile/offlinedocs
 | 
					apps/spreadsheeteditor/mobile/offlinedocs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# tests
 | 
				
			||||||
 | 
					selenium-debug.log
 | 
				
			||||||
 | 
					**/test/bin
 | 
				
			||||||
 | 
					**/test/reports
 | 
				
			||||||
| 
						 | 
					@ -363,7 +363,7 @@
 | 
				
			||||||
        if (target && _checkConfigParams()) {
 | 
					        if (target && _checkConfigParams()) {
 | 
				
			||||||
            iframe = createIframe(_config);
 | 
					            iframe = createIframe(_config);
 | 
				
			||||||
            target.parentNode && target.parentNode.replaceChild(iframe, target);
 | 
					            target.parentNode && target.parentNode.replaceChild(iframe, target);
 | 
				
			||||||
            this._msgDispatcher = new MessageDispatcher(_onMessage, this);
 | 
					            var _msgDispatcher = new MessageDispatcher(_onMessage, this);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /*
 | 
					        /*
 | 
				
			||||||
| 
						 | 
					@ -372,6 +372,18 @@
 | 
				
			||||||
         data: <command specific data>
 | 
					         data: <command specific data>
 | 
				
			||||||
         }
 | 
					         }
 | 
				
			||||||
         */
 | 
					         */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        var _destroyEditor = function(cmd) {
 | 
				
			||||||
 | 
					            var target = document.createElement("div");
 | 
				
			||||||
 | 
					            target.setAttribute('id', placeholderId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (iframe) {
 | 
				
			||||||
 | 
					                _msgDispatcher && _msgDispatcher.unbindEvents();
 | 
				
			||||||
 | 
					                _detachMouseEvents();
 | 
				
			||||||
 | 
					                iframe.parentNode && iframe.parentNode.replaceChild(target, iframe);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var _sendCommand = function(cmd) {
 | 
					        var _sendCommand = function(cmd) {
 | 
				
			||||||
            if (iframe && iframe.contentWindow)
 | 
					            if (iframe && iframe.contentWindow)
 | 
				
			||||||
                postMessage(iframe.contentWindow, cmd);
 | 
					                postMessage(iframe.contentWindow, cmd);
 | 
				
			||||||
| 
						 | 
					@ -538,7 +550,8 @@
 | 
				
			||||||
            downloadAs          : _downloadAs,
 | 
					            downloadAs          : _downloadAs,
 | 
				
			||||||
            serviceCommand      : _serviceCommand,
 | 
					            serviceCommand      : _serviceCommand,
 | 
				
			||||||
            attachMouseEvents   : _attachMouseEvents,
 | 
					            attachMouseEvents   : _attachMouseEvents,
 | 
				
			||||||
            detachMouseEvents   : _detachMouseEvents
 | 
					            detachMouseEvents   : _detachMouseEvents,
 | 
				
			||||||
 | 
					            destroyEditor       : _destroyEditor
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -558,23 +571,31 @@
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    DocsAPI.DocEditor.version = function() {
 | 
					    DocsAPI.DocEditor.version = function() {
 | 
				
			||||||
        return '4.2.7';
 | 
					        return '{{PRODUCT_VERSION}}';
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    MessageDispatcher = function(fn, scope) {
 | 
					    MessageDispatcher = function(fn, scope) {
 | 
				
			||||||
        var _fn     = fn,
 | 
					        var _fn     = fn,
 | 
				
			||||||
            _scope  = scope || window;
 | 
					            _scope  = scope || window,
 | 
				
			||||||
 | 
					            eventFn = function(msg) {
 | 
				
			||||||
 | 
					                _onMessage(msg);
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var _bindEvents = function() {
 | 
					        var _bindEvents = function() {
 | 
				
			||||||
            if (window.addEventListener) {
 | 
					            if (window.addEventListener) {
 | 
				
			||||||
                window.addEventListener("message", function(msg) {
 | 
					                window.addEventListener("message", eventFn, false)
 | 
				
			||||||
                    _onMessage(msg);
 | 
					 | 
				
			||||||
                }, false)
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (window.attachEvent) {
 | 
					            else if (window.attachEvent) {
 | 
				
			||||||
                window.attachEvent("onmessage", function(msg) {
 | 
					                window.attachEvent("onmessage", eventFn);
 | 
				
			||||||
                    _onMessage(msg);
 | 
					            }
 | 
				
			||||||
                });
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        var _unbindEvents = function() {
 | 
				
			||||||
 | 
					            if (window.removeEventListener) {
 | 
				
			||||||
 | 
					                window.removeEventListener("message", eventFn, false)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else if (window.detachEvent) {
 | 
				
			||||||
 | 
					                window.detachEvent("onmessage", eventFn);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -592,6 +613,10 @@
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        _bindEvents.call(this);
 | 
					        _bindEvents.call(this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            unbindEvents: _unbindEvents
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function getBasePath() {
 | 
					    function getBasePath() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -94,7 +94,7 @@
 | 
				
			||||||
                    mode            : urlParams["mode"] || 'edit',
 | 
					                    mode            : urlParams["mode"] || 'edit',
 | 
				
			||||||
                    lang            : urlParams["lang"] || 'en',
 | 
					                    lang            : urlParams["lang"] || 'en',
 | 
				
			||||||
                    user: {
 | 
					                    user: {
 | 
				
			||||||
                        id: urlParams["userid"], firstname: urlParams["userfname"], lastname: urlParams["userlname"]
 | 
					                        id: urlParams["userid"] || 'uid-901', name: urlParams["username"] || 'Chuk.Gek'
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                };
 | 
					                };
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					@ -30,6 +30,7 @@
 | 
				
			||||||
 * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
 | 
					 * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (Common === undefined) {
 | 
					if (Common === undefined) {
 | 
				
			||||||
    var Common = {};
 | 
					    var Common = {};
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					@ -53,7 +53,7 @@
 | 
				
			||||||
            $dlgShare = common.view.modals.create('share');
 | 
					            $dlgShare = common.view.modals.create('share');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var _encoded = encodeURIComponent(appConfig.shareUrl);
 | 
					            var _encoded = encodeURIComponent(appConfig.shareUrl);
 | 
				
			||||||
            var _mailto = 'mailto:?subject=I have shared a document with you: ' + appConfig.docTitle + '&body=I have shared a document with you: ' + _encoded + '"';
 | 
					            var _mailto = 'mailto:?subject=I have shared a document with you: ' + appConfig.docTitle + '&body=I have shared a document with you: ' + _encoded;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $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){
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					@ -430,10 +430,11 @@ define([
 | 
				
			||||||
                    isGroup && decorateBtn(el.children('button'));
 | 
					                    isGroup && decorateBtn(el.children('button'));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (disabled) {
 | 
					                if (disabled || !Common.Utils.isGecko) {
 | 
				
			||||||
                    var tip = this.cmpEl.data('bs.tooltip');
 | 
					                    var tip = this.cmpEl.data('bs.tooltip');
 | 
				
			||||||
                    if (tip) {
 | 
					                    if (tip) {
 | 
				
			||||||
                        tip.hide();
 | 
					                        disabled && tip.hide();
 | 
				
			||||||
 | 
					                        !Common.Utils.isGecko && (tip.enabled = !disabled);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -466,8 +467,10 @@ define([
 | 
				
			||||||
            var cmpEl = this.cmpEl,
 | 
					            var cmpEl = this.cmpEl,
 | 
				
			||||||
                modalParents = cmpEl.closest('.asc-window');
 | 
					                modalParents = cmpEl.closest('.asc-window');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (cmpEl.data('bs.tooltip'))
 | 
				
			||||||
 | 
					                cmpEl.removeData('bs.tooltip');
 | 
				
			||||||
            cmpEl.attr('data-toggle', 'tooltip');
 | 
					            cmpEl.attr('data-toggle', 'tooltip');
 | 
				
			||||||
            cmpEl.tooltip('destroy').tooltip({
 | 
					            cmpEl.tooltip({
 | 
				
			||||||
                title       : hint,
 | 
					                title       : hint,
 | 
				
			||||||
                placement   : this.options.hintAnchor || 'cursor'
 | 
					                placement   : this.options.hintAnchor || 'cursor'
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					@ -112,6 +112,7 @@ define([
 | 
				
			||||||
                this.menuCls        = me.options.menuCls;
 | 
					                this.menuCls        = me.options.menuCls;
 | 
				
			||||||
                this.menuStyle      = me.options.menuStyle;
 | 
					                this.menuStyle      = me.options.menuStyle;
 | 
				
			||||||
                this.template       = me.options.template || me.template;
 | 
					                this.template       = me.options.template || me.template;
 | 
				
			||||||
 | 
					                this.itemsTemplate  = me.options.itemsTemplate;
 | 
				
			||||||
                this.hint           = me.options.hint;
 | 
					                this.hint           = me.options.hint;
 | 
				
			||||||
                this.editable       = me.options.editable;
 | 
					                this.editable       = me.options.editable;
 | 
				
			||||||
                this.disabled       = me.options.disabled;
 | 
					                this.disabled       = me.options.disabled;
 | 
				
			||||||
| 
						 | 
					@ -134,15 +135,22 @@ define([
 | 
				
			||||||
                var me = this;
 | 
					                var me = this;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (!me.rendered) {
 | 
					                if (!me.rendered) {
 | 
				
			||||||
 | 
					                    var items = this.store.toJSON();
 | 
				
			||||||
                    this.cmpEl = $(this.template({
 | 
					                    this.cmpEl = $(this.template({
 | 
				
			||||||
                        id          : this.id,
 | 
					                        id          : this.id,
 | 
				
			||||||
                        cls         : this.cls,
 | 
					                        cls         : this.cls,
 | 
				
			||||||
                        style       : this.style,
 | 
					                        style       : this.style,
 | 
				
			||||||
                        menuCls     : this.menuCls,
 | 
					                        menuCls     : this.menuCls,
 | 
				
			||||||
                        menuStyle   : this.menuStyle,
 | 
					                        menuStyle   : this.menuStyle,
 | 
				
			||||||
                        items       : this.store.toJSON(),
 | 
					                        items       : items,
 | 
				
			||||||
                        scope       : me
 | 
					                        scope       : me
 | 
				
			||||||
                    }));
 | 
					                    }));
 | 
				
			||||||
 | 
					                    if (this.itemsTemplate)
 | 
				
			||||||
 | 
					                        this.cmpEl.find('ul').append(
 | 
				
			||||||
 | 
					                            $(this.itemsTemplate({
 | 
				
			||||||
 | 
					                                items       : items,
 | 
				
			||||||
 | 
					                                scope       : me
 | 
				
			||||||
 | 
					                            })));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (parentEl) {
 | 
					                    if (parentEl) {
 | 
				
			||||||
                        this.setElement(parentEl, false);
 | 
					                        this.setElement(parentEl, false);
 | 
				
			||||||
| 
						 | 
					@ -274,7 +282,7 @@ define([
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (this.scroller)
 | 
					                if (this.scroller)
 | 
				
			||||||
                    this.scroller.update();
 | 
					                    this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                this.trigger('show:after', this, e);
 | 
					                this.trigger('show:after', this, e);
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
| 
						 | 
					@ -441,7 +449,7 @@ define([
 | 
				
			||||||
                return this.rendered ? this._input.val() : null;
 | 
					                return this.rendered ? this._input.val() : null;
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            setValue: function(value) {
 | 
					            setValue: function(value, defValue) {
 | 
				
			||||||
                if (!this.rendered)
 | 
					                if (!this.rendered)
 | 
				
			||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -454,7 +462,7 @@ define([
 | 
				
			||||||
                    this.setRawValue(this._selectedItem.get(this.displayField));
 | 
					                    this.setRawValue(this._selectedItem.get(this.displayField));
 | 
				
			||||||
                    $('#' + this._selectedItem.get('id'), $(this.el)).addClass('selected');
 | 
					                    $('#' + this._selectedItem.get('id'), $(this.el)).addClass('selected');
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    this.setRawValue(value);
 | 
					                    this.setRawValue((defValue!==undefined) ? defValue : value);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -529,6 +537,12 @@ define([
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            onResetItems: function() {
 | 
					            onResetItems: function() {
 | 
				
			||||||
 | 
					                if (this.itemsTemplate) {
 | 
				
			||||||
 | 
					                    $(this.el).find('ul').html( $(this.itemsTemplate({
 | 
				
			||||||
 | 
					                        items: this.store.toJSON(),
 | 
				
			||||||
 | 
					                        scope: this
 | 
				
			||||||
 | 
					                    })));
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
                    $(this.el).find('ul').html(_.template([
 | 
					                    $(this.el).find('ul').html(_.template([
 | 
				
			||||||
                        '<% _.each(items, function(item) { %>',
 | 
					                        '<% _.each(items, function(item) { %>',
 | 
				
			||||||
                           '<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>',
 | 
					                           '<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>',
 | 
				
			||||||
| 
						 | 
					@ -537,6 +551,7 @@ define([
 | 
				
			||||||
                        items: this.store.toJSON(),
 | 
					                        items: this.store.toJSON(),
 | 
				
			||||||
                        scope: this
 | 
					                        scope: this
 | 
				
			||||||
                    }));
 | 
					                    }));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (!_.isUndefined(this.scroller)) {
 | 
					                if (!_.isUndefined(this.scroller)) {
 | 
				
			||||||
                    this.scroller.destroy();
 | 
					                    this.scroller.destroy();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					@ -84,7 +84,9 @@ define([
 | 
				
			||||||
        defaults: function() {
 | 
					        defaults: function() {
 | 
				
			||||||
            return {
 | 
					            return {
 | 
				
			||||||
                id: Common.UI.getId(),
 | 
					                id: Common.UI.getId(),
 | 
				
			||||||
                caption: ''
 | 
					                caption: '',
 | 
				
			||||||
 | 
					                inline: false,
 | 
				
			||||||
 | 
					                headername: undefined
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
| 
						 | 
					@ -99,7 +101,8 @@ define([
 | 
				
			||||||
                id: Common.UI.getId(),
 | 
					                id: Common.UI.getId(),
 | 
				
			||||||
                selected: false,
 | 
					                selected: false,
 | 
				
			||||||
                allowSelected: true,
 | 
					                allowSelected: true,
 | 
				
			||||||
                value: null
 | 
					                value: null,
 | 
				
			||||||
 | 
					                disabled: false
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
| 
						 | 
					@ -140,6 +143,7 @@ define([
 | 
				
			||||||
            el.off('click').on('click', _.bind(this.onClick, this));
 | 
					            el.off('click').on('click', _.bind(this.onClick, this));
 | 
				
			||||||
            el.off('dblclick').on('dblclick', _.bind(this.onDblClick, this));
 | 
					            el.off('dblclick').on('dblclick', _.bind(this.onDblClick, this));
 | 
				
			||||||
            el.off('contextmenu').on('contextmenu', _.bind(this.onContextMenu, this));
 | 
					            el.off('contextmenu').on('contextmenu', _.bind(this.onContextMenu, this));
 | 
				
			||||||
 | 
					            el.toggleClass('disabled', this.model.get('disabled'));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!_.isUndefined(this.model.get('cls')))
 | 
					            if (!_.isUndefined(this.model.get('cls')))
 | 
				
			||||||
                el.addClass(this.model.get('cls'));
 | 
					                el.addClass(this.model.get('cls'));
 | 
				
			||||||
| 
						 | 
					@ -157,10 +161,14 @@ define([
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        onClick: function(e) {
 | 
					        onClick: function(e) {
 | 
				
			||||||
 | 
					            if (this.model.get('disabled')) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.trigger('click', this, this.model, e);
 | 
					            this.trigger('click', this, this.model, e);
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        onDblClick: function(e) {
 | 
					        onDblClick: function(e) {
 | 
				
			||||||
 | 
					            if (this.model.get('disabled')) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.trigger('dblclick', this, this.model, e);
 | 
					            this.trigger('dblclick', this, this.model, e);
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -190,10 +198,15 @@ define([
 | 
				
			||||||
        template: _.template([
 | 
					        template: _.template([
 | 
				
			||||||
            '<div class="dataview inner" style="<%= style %>">',
 | 
					            '<div class="dataview inner" style="<%= style %>">',
 | 
				
			||||||
                '<% _.each(groups, function(group) { %>',
 | 
					                '<% _.each(groups, function(group) { %>',
 | 
				
			||||||
                    '<div class="grouped-data" id="<%= group.id %>">',
 | 
					                    '<% if (group.headername !== undefined) { %>',
 | 
				
			||||||
 | 
					                        '<div class="header-name"><%= group.headername %></div>',
 | 
				
			||||||
 | 
					                    '<% } %>',
 | 
				
			||||||
 | 
					                    '<div class="grouped-data <% if (group.inline) { %> inline <% } %> <% if (!_.isEmpty(group.caption)) { %> margin <% } %>" id="<%= group.id %>">',
 | 
				
			||||||
 | 
					                        '<% if (!_.isEmpty(group.caption)) { %>',
 | 
				
			||||||
                            '<div class="group-description">',
 | 
					                            '<div class="group-description">',
 | 
				
			||||||
                            '<span><b><%= group.caption %></b></span>',
 | 
					                                '<span><%= group.caption %></span>',
 | 
				
			||||||
                            '</div>',
 | 
					                            '</div>',
 | 
				
			||||||
 | 
					                        '<% } %>',
 | 
				
			||||||
                        '<div class="group-items-container">',
 | 
					                        '<div class="group-items-container">',
 | 
				
			||||||
                        '</div>',
 | 
					                        '</div>',
 | 
				
			||||||
                    '</div>',
 | 
					                    '</div>',
 | 
				
			||||||
| 
						 | 
					@ -696,39 +709,29 @@ define([
 | 
				
			||||||
        fillIndexesArray: function() {
 | 
					        fillIndexesArray: function() {
 | 
				
			||||||
            if (this.dataViewItems.length<=0) return;
 | 
					            if (this.dataViewItems.length<=0) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var top, left,
 | 
					 | 
				
			||||||
                el = $(this.dataViewItems[0].el),
 | 
					 | 
				
			||||||
                itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
 | 
					 | 
				
			||||||
                itemH = el.outerHeight() + parseInt(el.css('margin-top')) + parseInt(el.css('margin-bottom')),
 | 
					 | 
				
			||||||
                offsetLeft = this.$el.offset().left,
 | 
					 | 
				
			||||||
                offsetTop = this.$el.offset().top,
 | 
					 | 
				
			||||||
                idxOffset = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            this._layoutParams = {
 | 
					            this._layoutParams = {
 | 
				
			||||||
                itemsIndexes:   [],
 | 
					                itemsIndexes:   [],
 | 
				
			||||||
                columns:        0,
 | 
					                columns:        0,
 | 
				
			||||||
                rows:           0
 | 
					                rows:           0
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (this.groups && this.groups.length > 0) {
 | 
					            var el = $(this.dataViewItems[0].el),
 | 
				
			||||||
                var group_desc = this.cmpEl.find('.group-description:first');
 | 
					                itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
 | 
				
			||||||
                if (group_desc.length>0)
 | 
					                offsetLeft = this.$el.offset().left,
 | 
				
			||||||
                    offsetLeft += group_desc.width();
 | 
					                prevtop = -1, topIdx = 0, leftIdx = 0;
 | 
				
			||||||
            }
 | 
					
 | 
				
			||||||
            for (var i=0; i<this.dataViewItems.length; i++) {
 | 
					            for (var i=0; i<this.dataViewItems.length; i++) {
 | 
				
			||||||
                top = Math.floor(($(this.dataViewItems[i].el).offset().top - offsetTop)/itemH) + idxOffset;
 | 
					                var top = $(this.dataViewItems[i].el).offset().top;
 | 
				
			||||||
                left = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW);
 | 
					                leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW);
 | 
				
			||||||
                if (top<0) {
 | 
					                if (top>prevtop) {
 | 
				
			||||||
                    idxOffset = -top;
 | 
					                    prevtop = top;
 | 
				
			||||||
                    top += idxOffset;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                if (top > this._layoutParams.itemsIndexes.length-1) {
 | 
					 | 
				
			||||||
                    this._layoutParams.itemsIndexes.push([]);
 | 
					                    this._layoutParams.itemsIndexes.push([]);
 | 
				
			||||||
 | 
					                    topIdx = this._layoutParams.itemsIndexes.length-1;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                this._layoutParams.itemsIndexes[top][left] = i;
 | 
					                this._layoutParams.itemsIndexes[topIdx][leftIdx] = i;
 | 
				
			||||||
                this.dataViewItems[i].topIdx = top;
 | 
					                this.dataViewItems[i].topIdx = topIdx;
 | 
				
			||||||
                this.dataViewItems[i].leftIdx = left;
 | 
					                this.dataViewItems[i].leftIdx = leftIdx;
 | 
				
			||||||
                if (this._layoutParams.columns<left) this._layoutParams.columns = left;
 | 
					                if (this._layoutParams.columns<leftIdx) this._layoutParams.columns = leftIdx;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            this._layoutParams.rows = this._layoutParams.itemsIndexes.length;
 | 
					            this._layoutParams.rows = this._layoutParams.itemsIndexes.length;
 | 
				
			||||||
            this._layoutParams.columns++;
 | 
					            this._layoutParams.columns++;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					@ -244,6 +244,10 @@ define([
 | 
				
			||||||
            if (this.$input) this.$input.val(value);
 | 
					            if (this.$input) this.$input.val(value);
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        getRawValue: function () {
 | 
				
			||||||
 | 
					            return this.$input.val();
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        setValue: function(value, suspendchange) {
 | 
					        setValue: function(value, suspendchange) {
 | 
				
			||||||
            var showError = false;
 | 
					            var showError = false;
 | 
				
			||||||
            this._fromKeyDown = false;
 | 
					            this._fromKeyDown = false;
 | 
				
			||||||
| 
						 | 
					@ -290,6 +294,10 @@ define([
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        setMask: function(value) {
 | 
				
			||||||
 | 
					            this.options.maskExp = value;
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        onMouseDown: function (type, e) {
 | 
					        onMouseDown: function (type, e) {
 | 
				
			||||||
            if ( this.disabled ) return;
 | 
					            if ( this.disabled ) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -336,7 +344,7 @@ define([
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            } else if (e.keyCode==Common.UI.Keys.RETURN) {
 | 
					            } else if (e.keyCode==Common.UI.Keys.RETURN) {
 | 
				
			||||||
                if (this.options.defaultUnit && this.options.defaultUnit.length) {
 | 
					                if (this.options.defaultUnit && this.options.defaultUnit.length) {
 | 
				
			||||||
                    var value = this.$input.val();
 | 
					                    var value = this.getRawValue();
 | 
				
			||||||
                    if (this.value != value) {
 | 
					                    if (this.value != value) {
 | 
				
			||||||
                        this.onEnterValue();
 | 
					                        this.onEnterValue();
 | 
				
			||||||
                        return false;
 | 
					                        return false;
 | 
				
			||||||
| 
						 | 
					@ -384,7 +392,7 @@ define([
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        onEnterValue: function() {
 | 
					        onEnterValue: function() {
 | 
				
			||||||
            if (this.$input) {
 | 
					            if (this.$input) {
 | 
				
			||||||
                var val = this.$input.val();
 | 
					                var val = this.getRawValue();
 | 
				
			||||||
                this.setValue((val==='') ? this.value : val );
 | 
					                this.setValue((val==='') ? this.value : val );
 | 
				
			||||||
                this.trigger('entervalue', this);
 | 
					                this.trigger('entervalue', this);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -392,7 +400,7 @@ define([
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        onBlur: function(e){
 | 
					        onBlur: function(e){
 | 
				
			||||||
            if (this.$input) {
 | 
					            if (this.$input) {
 | 
				
			||||||
                var val = this.$input.val();
 | 
					                var val = this.getRawValue();
 | 
				
			||||||
                this.setValue((val==='') ? this.value : val );
 | 
					                this.setValue((val==='') ? this.value : val );
 | 
				
			||||||
                if (this.options.hold && this.switches.fromKeyDown)
 | 
					                if (this.options.hold && this.switches.fromKeyDown)
 | 
				
			||||||
                    this._stopSpin();
 | 
					                    this._stopSpin();
 | 
				
			||||||
| 
						 | 
					@ -430,7 +438,7 @@ define([
 | 
				
			||||||
            if (!me.readOnly) {
 | 
					            if (!me.readOnly) {
 | 
				
			||||||
                var val = me.options.step;
 | 
					                var val = me.options.step;
 | 
				
			||||||
                if (me._fromKeyDown) {
 | 
					                if (me._fromKeyDown) {
 | 
				
			||||||
                    val = this.$input.val();
 | 
					                    val = this.getRawValue();
 | 
				
			||||||
                    val = _.isEmpty(val) ? me.oldValue : parseFloat(val);
 | 
					                    val = _.isEmpty(val) ? me.oldValue : parseFloat(val);
 | 
				
			||||||
                } else if(me.getValue() !== '') {
 | 
					                } else if(me.getValue() !== '') {
 | 
				
			||||||
                    if (me.options.allowAuto && me.getValue()==me.options.autoText) {
 | 
					                    if (me.options.allowAuto && me.getValue()==me.options.autoText) {
 | 
				
			||||||
| 
						 | 
					@ -451,7 +459,7 @@ define([
 | 
				
			||||||
            if (!me.readOnly) {
 | 
					            if (!me.readOnly) {
 | 
				
			||||||
                var val = me.options.step;
 | 
					                var val = me.options.step;
 | 
				
			||||||
                if (me._fromKeyDown) {
 | 
					                if (me._fromKeyDown) {
 | 
				
			||||||
                    val = this.$input.val();
 | 
					                    val = this.getRawValue();
 | 
				
			||||||
                    val = _.isEmpty(val) ? me.oldValue : parseFloat(val);
 | 
					                    val = _.isEmpty(val) ? me.oldValue : parseFloat(val);
 | 
				
			||||||
                } else if(me.getValue() !== '') {
 | 
					                } else if(me.getValue() !== '') {
 | 
				
			||||||
                    if (me.options.allowAuto && me.getValue()==me.options.autoText) {
 | 
					                    if (me.options.allowAuto && me.getValue()==me.options.autoText) {
 | 
				
			||||||
| 
						 | 
					@ -520,4 +528,22 @@ define([
 | 
				
			||||||
            return v_out;
 | 
					            return v_out;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Common.UI.CustomSpinner = Common.UI.MetricSpinner.extend(_.extend({
 | 
				
			||||||
 | 
					        initialize : function(options) {
 | 
				
			||||||
 | 
					            this.options.toCustomFormat = (options.toCustomFormat) ? options.toCustomFormat : function(value) { return value; };
 | 
				
			||||||
 | 
					            this.options.fromCustomFormat = (options.fromCustomFormat) ? options.fromCustomFormat : function(value) { return value; };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            Common.UI.MetricSpinner.prototype.initialize.call(this, options);
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        setRawValue: function (value) {
 | 
				
			||||||
 | 
					            if (this.$input) this.$input.val(this.options.toCustomFormat(value));
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        getRawValue: function () {
 | 
				
			||||||
 | 
					            return this.options.fromCustomFormat(this.$input.val());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }, Common.UI.CustomSpinner || {}));
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					@ -120,8 +120,8 @@
 | 
				
			||||||
            this.getBSTip().show(at);
 | 
					            this.getBSTip().show(at);
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        hide: function() {
 | 
					        hide: function(callback) {
 | 
				
			||||||
            this.getBSTip().hide();
 | 
					            this.getBSTip().hide(callback);
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        setTitle: function(title) {
 | 
					        setTitle: function(title) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					@ -38,6 +38,7 @@
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					define(['gateway'], function () {
 | 
				
			||||||
    Common.localStorage = new (function() {
 | 
					    Common.localStorage = new (function() {
 | 
				
			||||||
        var _storeName, _filter;
 | 
					        var _storeName, _filter;
 | 
				
			||||||
        var _store = {};
 | 
					        var _store = {};
 | 
				
			||||||
| 
						 | 
					@ -106,3 +107,4 @@ Common.localStorage = new (function() {
 | 
				
			||||||
            save: _save
 | 
					            save: _save
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    })();
 | 
					    })();
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					@ -86,8 +86,8 @@ Common.Utils = _.extend(new(function() {
 | 
				
			||||||
        isSecure = /^https/i.test(window.location.protocol),
 | 
					        isSecure = /^https/i.test(window.location.protocol),
 | 
				
			||||||
        emailRe = /^(mailto:)?([a-z0-9'\._-]+@[a-z0-9\.-]+\.[a-z0-9]{2,4})([a-яё0-9\._%+-=\? :&]*)/i,
 | 
					        emailRe = /^(mailto:)?([a-z0-9'\._-]+@[a-z0-9\.-]+\.[a-z0-9]{2,4})([a-яё0-9\._%+-=\? :&]*)/i,
 | 
				
			||||||
        ipRe = /^(((https?)|(ftps?)):\/\/)?([\-\wа-яё]*:?[\-\wа-яё]*@)?(((1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9])\.){3}(1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9]))(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?/i,
 | 
					        ipRe = /^(((https?)|(ftps?)):\/\/)?([\-\wа-яё]*:?[\-\wа-яё]*@)?(((1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9])\.){3}(1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9]))(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?/i,
 | 
				
			||||||
        hostnameRe = /^(((https?)|(ftps?)):\/\/)?([\-\wа-яё]*:?[\-\wа-яё]*@)?(([\-\wа-яё]+\.)+[\wа-яё\-]{2,}(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?)/i,
 | 
					        hostnameRe = /^(((https?)|(ftps?)):\/\/)?([\-\wа-яё]*:?[\-\wа-яё]*@)?(([\-\wа-яё]+\.)+[\wа-яё\-]{2,}(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`'~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?)/i,
 | 
				
			||||||
        localRe = /^(((https?)|(ftps?)):\/\/)([\-\wа-яё]*:?[\-\wа-яё]*@)?(([\-\wа-яё]+)(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?)/i,
 | 
					        localRe = /^(((https?)|(ftps?)):\/\/)([\-\wа-яё]*:?[\-\wа-яё]*@)?(([\-\wа-яё]+)(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`'~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?)/i,
 | 
				
			||||||
        emailStrongRe = /(mailto:)?([a-z0-9'\._-]+@[a-z0-9\.-]+\.[a-z0-9]{2,4})([a-яё0-9\._%+-=\?:&]*)/ig,
 | 
					        emailStrongRe = /(mailto:)?([a-z0-9'\._-]+@[a-z0-9\.-]+\.[a-z0-9]{2,4})([a-яё0-9\._%+-=\?:&]*)/ig,
 | 
				
			||||||
        ipStrongRe = /(((https?)|(ftps?)):\/\/([\-\wа-яё]*:?[\-\wа-яё]*@)?)(((1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9])\.){3}(1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9]))(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?/ig,
 | 
					        ipStrongRe = /(((https?)|(ftps?)):\/\/([\-\wа-яё]*:?[\-\wа-яё]*@)?)(((1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9])\.){3}(1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9]))(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?/ig,
 | 
				
			||||||
        hostnameStrongRe = /((((https?)|(ftps?)):\/\/([\-\wа-яё]*:?[\-\wа-яё]*@)?)|(([\-\wа-яё]*:?[\-\wа-яё]*@)?www\.))((([\-\wа-яё]+\.)+[\wа-яё\-]{2,}|([\-\wа-яё]+))(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?)/ig,
 | 
					        hostnameStrongRe = /((((https?)|(ftps?)):\/\/([\-\wа-яё]*:?[\-\wа-яё]*@)?)|(([\-\wа-яё]*:?[\-\wа-яё]*@)?www\.))((([\-\wа-яё]+\.)+[\wа-яё\-]{2,}|([\-\wа-яё]+))(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?)/ig,
 | 
				
			||||||
| 
						 | 
					@ -102,34 +102,11 @@ Common.Utils = _.extend(new(function() {
 | 
				
			||||||
            Chart      : 7,
 | 
					            Chart      : 7,
 | 
				
			||||||
            MailMerge  : 8
 | 
					            MailMerge  : 8
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					        isMobile = /android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera),
 | 
				
			||||||
        me = this,
 | 
					        me = this,
 | 
				
			||||||
        checkSize = function() {
 | 
					        checkSize = function() {
 | 
				
			||||||
			me.zoom = 1;
 | 
								me.zoom = 1;
 | 
				
			||||||
			if (isChrome && !isOpera && document && document.firstElementChild && document.body)
 | 
								if (isChrome && !isOpera && !isMobile && document && document.firstElementChild && document.body)
 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				if (false)
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					// этот код - рабочий, но только если этот ифрейм открыт на весь размер браузера
 | 
					 | 
				
			||||||
					// (window.outerWidth и window.innerWidth зависимы)
 | 
					 | 
				
			||||||
					if (window.innerWidth > 300)
 | 
					 | 
				
			||||||
						me.zoom = window.outerWidth / window.innerWidth;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					if (Math.abs(me.zoom - 1) < 0.1)
 | 
					 | 
				
			||||||
						me.zoom = 1;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					me.zoom = window.outerWidth / window.innerWidth;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					var _devicePixelRatio = window.devicePixelRatio / me.zoom;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					// device pixel ratio: кратно 0.5
 | 
					 | 
				
			||||||
					_devicePixelRatio = (5 * (((2.5 + 10 * _devicePixelRatio) / 5) >> 0)) / 10;
 | 
					 | 
				
			||||||
					me.zoom = window.devicePixelRatio / _devicePixelRatio;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					// chrome 54.x: zoom = "reset" - clear retina zoom (windows)
 | 
					 | 
				
			||||||
					//document.firstElementChild.style.zoom = "reset";
 | 
					 | 
				
			||||||
					document.firstElementChild.style.zoom = 1.0 / me.zoom;
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				else
 | 
					 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
                // делаем простую проверку
 | 
					                // делаем простую проверку
 | 
				
			||||||
                // считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio;
 | 
					                // считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio;
 | 
				
			||||||
| 
						 | 
					@ -153,7 +130,6 @@ Common.Utils = _.extend(new(function() {
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                    document.firstElementChild.style.zoom = "normal";
 | 
					                    document.firstElementChild.style.zoom = "normal";
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
            me.innerWidth = window.innerWidth * me.zoom;
 | 
					            me.innerWidth = window.innerWidth * me.zoom;
 | 
				
			||||||
            me.innerHeight = window.innerHeight * me.zoom;
 | 
					            me.innerHeight = window.innerHeight * me.zoom;
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
| 
						 | 
					@ -648,6 +624,48 @@ Common.Utils.applyCustomization = function(config, elmap) {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Common.Utils.applyCustomizationPlugins = function(plugins) {
 | 
				
			||||||
 | 
					    if (!plugins || plugins.length<1) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    var _createXMLHTTPObject = function() {
 | 
				
			||||||
 | 
					        var xmlhttp;
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        catch (e) {
 | 
				
			||||||
 | 
					            try {
 | 
				
			||||||
 | 
					                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch (E) {
 | 
				
			||||||
 | 
					                xmlhttp = false;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
 | 
				
			||||||
 | 
					            xmlhttp = new XMLHttpRequest();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return xmlhttp;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    var _getPluginCode = function(url) {
 | 
				
			||||||
 | 
					        if (!url) return '';
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            var xhrObj = _createXMLHTTPObject();
 | 
				
			||||||
 | 
					            if (xhrObj && url) {
 | 
				
			||||||
 | 
					                xhrObj.open('GET', url, false);
 | 
				
			||||||
 | 
					                xhrObj.send('');
 | 
				
			||||||
 | 
					                if (xhrObj.status == 200)
 | 
				
			||||||
 | 
					                    eval(xhrObj.responseText);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        catch (e) {}
 | 
				
			||||||
 | 
					        return null;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    plugins.forEach(function(url){
 | 
				
			||||||
 | 
					        if (url) _getPluginCode(url);
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Common.Utils.fillUserInfo = function(info, lang, defname) {
 | 
					Common.Utils.fillUserInfo = function(info, lang, defname) {
 | 
				
			||||||
    var _user = info || {};
 | 
					    var _user = info || {};
 | 
				
			||||||
    !_user.id && (_user.id = ('uid-' + Date.now()));
 | 
					    !_user.id && (_user.id = ('uid-' + Date.now()));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					@ -52,7 +52,7 @@ define([
 | 
				
			||||||
        initialize: function(options) {
 | 
					        initialize: function(options) {
 | 
				
			||||||
            Common.UI.BaseView.prototype.initialize.call(this,arguments);
 | 
					            Common.UI.BaseView.prototype.initialize.call(this,arguments);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            this.txtVersionNum = '4.2';
 | 
					            this.txtVersionNum = '{{PRODUCT_VERSION}}';
 | 
				
			||||||
            this.txtAscMail = 'support@onlyoffice.com';
 | 
					            this.txtAscMail = 'support@onlyoffice.com';
 | 
				
			||||||
            this.txtAscTelNum = '+371 660-16425';
 | 
					            this.txtAscTelNum = '+371 660-16425';
 | 
				
			||||||
            this.txtAscUrl = 'www.onlyoffice.com';
 | 
					            this.txtAscUrl = 'www.onlyoffice.com';
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 * (c) Copyright Ascensio System Limited 2010-2017
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is a free software product. You can redistribute it and/or
 | 
					 * 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)
 | 
					 * modify it under the terms of the GNU Affero General Public License (AGPL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,26 +31,43 @@
 | 
				
			||||||
        clear: left;
 | 
					        clear: left;
 | 
				
			||||||
        overflow: hidden;
 | 
					        overflow: hidden;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        & > div {
 | 
					        &.inline {
 | 
				
			||||||
            display: inline-block;
 | 
					            display: inline-block;
 | 
				
			||||||
 | 
					            &.margin .group-items-container {
 | 
				
			||||||
 | 
					                margin-right: 20px;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        .group-items-container {
 | 
					        .group-items-container {
 | 
				
			||||||
            overflow: hidden;
 | 
					            overflow: hidden;
 | 
				
			||||||
 | 
					            margin-bottom: 5px;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            & > div {
 | 
					            & > div {
 | 
				
			||||||
                display: inline-block;
 | 
					                display: inline-block;
 | 
				
			||||||
                float: left;
 | 
					                float: left;
 | 
				
			||||||
                margin: 4px;
 | 
					                margin: 2px 4px 4px;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                &:not(.disabled) {
 | 
				
			||||||
                    cursor: pointer;
 | 
					                    cursor: pointer;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                &.disabled {
 | 
				
			||||||
 | 
					                    opacity: 0.5;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                .box-shadow(0 0 0 1px @gray);
 | 
					                .box-shadow(0 0 0 1px @gray);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                &:hover,
 | 
					                &:hover:not(.disabled),
 | 
				
			||||||
                &.selected {
 | 
					                &.selected:not(.disabled) {
 | 
				
			||||||
                    .box-shadow(0 0 0 2px @primary);
 | 
					                    .box-shadow(0 0 0 2px @primary);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    .header-name {
 | 
				
			||||||
 | 
					        padding: 10px 2px 12px 4px;
 | 
				
			||||||
 | 
					        font-weight: bold;
 | 
				
			||||||
 | 
					        cursor: default;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
    background: @gray-light;
 | 
					    background: @gray-light;
 | 
				
			||||||
    border: 1px solid @gray-dark;
 | 
					    border: 1px solid @gray-dark;
 | 
				
			||||||
    height: 35px;
 | 
					    height: 35px;
 | 
				
			||||||
    z-index: 1000;
 | 
					    z-index: @zindex-dropdown - 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .review-group {
 | 
					    .review-group {
 | 
				
			||||||
        display: inline-block;
 | 
					        display: inline-block;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -50,3 +50,7 @@
 | 
				
			||||||
    word-wrap: break-word;
 | 
					    word-wrap: break-word;
 | 
				
			||||||
    max-width: 300px;
 | 
					    max-width: 300px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.link-tooltip .tooltip-inner {
 | 
				
			||||||
 | 
					    max-width: 500px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,88 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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 Lubanas st. 125a-25, Riga, Latvia,
 | 
					 | 
				
			||||||
 * EU, LV-1021.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
Ext.define('Common.component.PlanarSpinner', {
 | 
					 | 
				
			||||||
    extend: 'Ext.field.Spinner',
 | 
					 | 
				
			||||||
    xtype: 'planarspinnerfield',
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    config: {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    constructor: function() {
 | 
					 | 
				
			||||||
        var me = this;
 | 
					 | 
				
			||||||
        me.callParent(arguments);
 | 
					 | 
				
			||||||
        me.addCls('planar-spinner');
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    updateComponent: function(newComponent) {
 | 
					 | 
				
			||||||
        this.callParent(arguments);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        var innerElement = this.innerElement,
 | 
					 | 
				
			||||||
            cls = this.getCls();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (newComponent) {
 | 
					 | 
				
			||||||
            this.spinDownButton = Ext.widget('button', {
 | 
					 | 
				
			||||||
                cls     : 'x-button x-button-base ' + cls + '-button ' + cls + '-button-down',
 | 
					 | 
				
			||||||
                iconCls : 'spinner-down'
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            this.spinUpButton = Ext.widget('button', {
 | 
					 | 
				
			||||||
                cls     : 'x-button x-button-base ' + cls + '-button ' + cls + '-button-up',
 | 
					 | 
				
			||||||
                iconCls : 'spinner-up'
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            this.downRepeater = this.createRepeater(this.spinDownButton.element, this.onSpinDown);
 | 
					 | 
				
			||||||
            this.upRepeater = this.createRepeater(this.spinUpButton.element,     this.onSpinUp);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    updateGroupButtons: function(newGroupButtons, oldGroupButtons) {
 | 
					 | 
				
			||||||
        var me = this,
 | 
					 | 
				
			||||||
            innerElement = me.innerElement,
 | 
					 | 
				
			||||||
            cls = me.getBaseCls() + '-grouped-buttons';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        me.getComponent();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (newGroupButtons != oldGroupButtons) {
 | 
					 | 
				
			||||||
            if (newGroupButtons) {
 | 
					 | 
				
			||||||
                this.addCls(cls);
 | 
					 | 
				
			||||||
                innerElement.insertFirst(me.spinDownButton.element);
 | 
					 | 
				
			||||||
                innerElement.appendChild(me.spinUpButton.element);
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
                this.removeCls(cls);
 | 
					 | 
				
			||||||
                innerElement.insertFirst(me.spinDownButton.element);
 | 
					 | 
				
			||||||
                innerElement.appendChild(me.spinUpButton.element);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,96 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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 Lubanas st. 125a-25, Riga, Latvia,
 | 
					 | 
				
			||||||
 * EU, LV-1021.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
Ext.define('Common.component.RepeatableButton', {
 | 
					 | 
				
			||||||
    extend: 'Ext.Button',
 | 
					 | 
				
			||||||
    xtype: 'repeatablebutton',
 | 
					 | 
				
			||||||
    requires: ['Ext.util.TapRepeater'],
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    initialize: function() {
 | 
					 | 
				
			||||||
        this.callParent(arguments);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        this.repeater = this.createRepeater(this.element, this.onRepeatTap);
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // @private
 | 
					 | 
				
			||||||
    destroy: function() {
 | 
					 | 
				
			||||||
        var me = this;
 | 
					 | 
				
			||||||
        Ext.destroy(me.repeater);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        me.callParent(arguments);
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // @private
 | 
					 | 
				
			||||||
    createRepeater: function(el, fn) {
 | 
					 | 
				
			||||||
        var me = this,
 | 
					 | 
				
			||||||
            repeater = Ext.create('Ext.util.TapRepeater', {
 | 
					 | 
				
			||||||
                el          : el,
 | 
					 | 
				
			||||||
                accelerate  : true,
 | 
					 | 
				
			||||||
                delay       : 500
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        repeater.on({
 | 
					 | 
				
			||||||
            tap         : fn,
 | 
					 | 
				
			||||||
            touchstart  : 'onTouchStart',
 | 
					 | 
				
			||||||
            touchend    : 'onTouchEnd',
 | 
					 | 
				
			||||||
            scope       : me
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return repeater;
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // @private
 | 
					 | 
				
			||||||
    onRepeatTap: function(e) {
 | 
					 | 
				
			||||||
        this.fireAction('tap', [this, e, true], 'doTap');
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // @private
 | 
					 | 
				
			||||||
    doTap: function(me, e, handle) {
 | 
					 | 
				
			||||||
        if (Ext.isBoolean(handle) && handle) {
 | 
					 | 
				
			||||||
            this.callParent(arguments);
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // @private
 | 
					 | 
				
			||||||
    onTouchStart: function(repeater) {
 | 
					 | 
				
			||||||
        if (!this.getDisabled()) {
 | 
					 | 
				
			||||||
            this.element.addCls(Ext.baseCSSPrefix + 'button-pressing');
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // @private
 | 
					 | 
				
			||||||
    onTouchEnd: function(repeater) {
 | 
					 | 
				
			||||||
        this.element.removeCls(Ext.baseCSSPrefix + 'button-pressing');
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,67 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * (c) Copyright Ascensio System Limited 2010-2016
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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 Lubanas st. 125a-25, Riga, Latvia,
 | 
					 | 
				
			||||||
 * EU, LV-1021.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
Ext.define('Common.component.SettingsList', {
 | 
					 | 
				
			||||||
    extend: 'Ext.List',
 | 
					 | 
				
			||||||
    alias: 'widget.settingslist',
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    config: {
 | 
					 | 
				
			||||||
        disableSelection: true,
 | 
					 | 
				
			||||||
        pinHeaders      : false,
 | 
					 | 
				
			||||||
        grouped         : true,
 | 
					 | 
				
			||||||
        cls             : 'settings',
 | 
					 | 
				
			||||||
        ui              : 'round',
 | 
					 | 
				
			||||||
        itemTpl         : Ext.create('Ext.XTemplate',
 | 
					 | 
				
			||||||
            '<tpl for=".">',
 | 
					 | 
				
			||||||
                '<tpl if="this.hasIcon(icon)">',
 | 
					 | 
				
			||||||
                    '<span class="list-icon {icon}"></span>',
 | 
					 | 
				
			||||||
                '</tpl>',
 | 
					 | 
				
			||||||
                '<tpl if="this.hasIcon(icon)">',
 | 
					 | 
				
			||||||
                    '<strong class="icon-offset">{setting}</strong>',
 | 
					 | 
				
			||||||
                '<tpl else>',
 | 
					 | 
				
			||||||
                    '<strong>{setting}</strong>',
 | 
					 | 
				
			||||||
                '</tpl>',
 | 
					 | 
				
			||||||
                '<tpl if="this.hasChild(child)">',
 | 
					 | 
				
			||||||
                    '<span class="list-icon disclosure"></span>',
 | 
					 | 
				
			||||||
                '</tpl>',
 | 
					 | 
				
			||||||
            '</tpl>',
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                hasIcon: function(icon){
 | 
					 | 
				
			||||||
                    return !Ext.isEmpty(icon);
 | 
					 | 
				
			||||||
                },
 | 
					 | 
				
			||||||
                hasChild: function(child){
 | 
					 | 
				
			||||||
                    return !Ext.isEmpty(child);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
							
								
								
									
										209
									
								
								apps/common/mobile/lib/component/ThemeColorPalette.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										209
									
								
								apps/common/mobile/lib/component/ThemeColorPalette.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,209 @@
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * (c) Copyright Ascensio System Limited 2010-2016
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * 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 Lubanas st. 125a-25, Riga, Latvia,
 | 
				
			||||||
 | 
					 * EU, LV-1021.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * 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
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 *  ThemeColorPalette.js
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *  Created by Alexander Yuzhin on 10/27/16
 | 
				
			||||||
 | 
					 *  Copyright (c) 2016 Ascensio System SIA. All rights reserved.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if (Common === undefined)
 | 
				
			||||||
 | 
					    var Common = {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Common.UI = Common.UI || {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					define([
 | 
				
			||||||
 | 
					    'jquery',
 | 
				
			||||||
 | 
					    'underscore',
 | 
				
			||||||
 | 
					    'backbone'
 | 
				
			||||||
 | 
					], function ($, _, Backbone) {
 | 
				
			||||||
 | 
					    'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Common.UI.ThemeColorPalette = Backbone.View.extend(_.extend({
 | 
				
			||||||
 | 
					        options: {
 | 
				
			||||||
 | 
					            dynamiccolors: 10,
 | 
				
			||||||
 | 
					            standardcolors: 10,
 | 
				
			||||||
 | 
					            themecolors: 10,
 | 
				
			||||||
 | 
					            effects: 5,
 | 
				
			||||||
 | 
					            allowReselect: true,
 | 
				
			||||||
 | 
					            transparent: false,
 | 
				
			||||||
 | 
					            value: '000000',
 | 
				
			||||||
 | 
					            cls: '',
 | 
				
			||||||
 | 
					            style: ''
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        template: _.template([
 | 
				
			||||||
 | 
					            '<% var me = this; %>',
 | 
				
			||||||
 | 
					            '<div class="list-block color-palette <%= me.options.cls %>" style="<%= me.options.style %>">',
 | 
				
			||||||
 | 
					                '<ul>',
 | 
				
			||||||
 | 
					                    '<li class="theme-colors">',
 | 
				
			||||||
 | 
					                        '<div style="padding: 15px 0 0 15px;"><%= me.textThemeColors %></div>',
 | 
				
			||||||
 | 
					                        '<div class="item-content">',
 | 
				
			||||||
 | 
					                            '<div class="item-inner">',
 | 
				
			||||||
 | 
					                            '<% _.each(themeColors, function(row) { %>',
 | 
				
			||||||
 | 
					                                '<div class="row">',
 | 
				
			||||||
 | 
					                                    '<% _.each(row, function(effect) { %>',
 | 
				
			||||||
 | 
					                                        '<a data-effectid="<%=effect.effectId%>" data-effectvalue="<%=effect.effectValue%>" data-color="<%=effect.color%>" style="background:#<%=effect.color%>"></a>',
 | 
				
			||||||
 | 
					                                    '<% }); %>',
 | 
				
			||||||
 | 
					                                '</div>',
 | 
				
			||||||
 | 
					                            '<% }); %>',
 | 
				
			||||||
 | 
					                            '</div>',
 | 
				
			||||||
 | 
					                        '</div>',
 | 
				
			||||||
 | 
					                    '</li>',
 | 
				
			||||||
 | 
					                    '<li class="standart-colors">',
 | 
				
			||||||
 | 
					                        '<div style="padding: 15px 0 0 15px;"><%= me.textStandartColors %></div>',
 | 
				
			||||||
 | 
					                        '<div class="item-content">',
 | 
				
			||||||
 | 
					                            '<div class="item-inner">',
 | 
				
			||||||
 | 
					                                '<% _.each(standartColors, function(color, index) { %>',
 | 
				
			||||||
 | 
					                                    '<% if (0 == index && me.options.transparent) { %>',
 | 
				
			||||||
 | 
					                                    '<a data-color="transparent" class="transparent"></a>',
 | 
				
			||||||
 | 
					                                    '<% } else { %>',
 | 
				
			||||||
 | 
					                                    '<a data-color="<%=color%>" style="background:#<%=color%>"></a>',
 | 
				
			||||||
 | 
					                                    '<% } %>',
 | 
				
			||||||
 | 
					                                '<% }); %>',
 | 
				
			||||||
 | 
					                            '</div>',
 | 
				
			||||||
 | 
					                        '</div>',
 | 
				
			||||||
 | 
					                    '</li>',
 | 
				
			||||||
 | 
					                '</ul>',
 | 
				
			||||||
 | 
					            '</div>'
 | 
				
			||||||
 | 
					        ].join('')),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // colorRe: /(?:^|\s)color-(.{6})(?:\s|$)/,
 | 
				
			||||||
 | 
					        // selectedCls: 'selected',
 | 
				
			||||||
 | 
					        //
 | 
				
			||||||
 | 
					        initialize : function(options) {
 | 
				
			||||||
 | 
					            var me = this,
 | 
				
			||||||
 | 
					                el = $(me.el);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            me.options = _({}).extend(me.options, options);
 | 
				
			||||||
 | 
					            me.render();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            el.find('.color-palette a').on('click', _.bind(me.onColorClick, me));
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        render: function () {
 | 
				
			||||||
 | 
					            var me = this,
 | 
				
			||||||
 | 
					                themeColors = [],
 | 
				
			||||||
 | 
					                row = -1,
 | 
				
			||||||
 | 
					                standartColors = Common.Utils.ThemeColor.getStandartColors();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            _.each(Common.Utils.ThemeColor.getEffectColors(), function(effect, index) {
 | 
				
			||||||
 | 
					                if (0 == index % me.options.themecolors) {
 | 
				
			||||||
 | 
					                    themeColors.push([]);
 | 
				
			||||||
 | 
					                    row++
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                themeColors[row].push(effect);
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $(me.el).append(me.template({
 | 
				
			||||||
 | 
					                themeColors: themeColors,
 | 
				
			||||||
 | 
					                standartColors: standartColors
 | 
				
			||||||
 | 
					            }));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return me;
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        isColor: function(val) {
 | 
				
			||||||
 | 
					            return typeof(val) == 'string' && (/[0-9A-Fa-f]{6}/).test(val);
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        isTransparent: function(val) {
 | 
				
			||||||
 | 
					            return typeof(val) == 'string' && (val=='transparent');
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        isEffect: function(val) {
 | 
				
			||||||
 | 
					            return (typeof(val) == 'object' && val.effectId !== undefined);
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        onColorClick:function (e) {
 | 
				
			||||||
 | 
					            var me = this,
 | 
				
			||||||
 | 
					                el = $(me.el),
 | 
				
			||||||
 | 
					                $target = $(e.currentTarget);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            el.find('.color-palette a').removeClass('active');
 | 
				
			||||||
 | 
					            $target.addClass('active');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            var color = $target.data('color').toString(),
 | 
				
			||||||
 | 
					                effectId = $target.data('effectid');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            me.currentColor = color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (effectId) {
 | 
				
			||||||
 | 
					                me.currentColor = {color: color, effectId: effectId};
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            me.trigger('select', me, me.currentColor);
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        select: function(color) {
 | 
				
			||||||
 | 
					            var me = this,
 | 
				
			||||||
 | 
					                el = $(me.el);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (color == me.currentColor) {
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            me.currentColor = color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            me.clearSelection();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (_.isObject(color)) {
 | 
				
			||||||
 | 
					                if (! _.isUndefined(color.effectId)) {
 | 
				
			||||||
 | 
					                    el.find('a[data-effectid=' + color.effectId + ']').addClass('active');
 | 
				
			||||||
 | 
					                } else if (! _.isUndefined(color.effectValue)) {
 | 
				
			||||||
 | 
					                    el.find('a[data-effectvalue=' + color.effectValue + '][data-color=' + color.color + ']').addClass('active');
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                if (/#?[a-fA-F0-9]{6}/.test(color)) {
 | 
				
			||||||
 | 
					                    color = /#?([a-fA-F0-9]{6})/.exec(color)[1];
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (/^[a-fA-F0-9]{6}|transparent$/.test(color) || _.indexOf(Common.Utils.ThemeColor.getStandartColors(), color) > -1) {
 | 
				
			||||||
 | 
					                    el.find('.standart-colors a[data-color=' + color + ']').addClass('active');
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                    el.find('.custom-colors a[data-color=' + color + ']').addClass('active');
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        clearSelection: function() {
 | 
				
			||||||
 | 
					            $(this.el).find('.color-palette a').removeClass('active');
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        textThemeColors: 'Theme Colors',
 | 
				
			||||||
 | 
					        textStandartColors: 'Standard Colors'
 | 
				
			||||||
 | 
					    }, Common.UI.ThemeColorPalette || {}));
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
Some files were not shown because too many files have changed in this diff Show more
		Loading…
	
		Reference in a new issue