Merge branch 'release/v4.3.0'

This commit is contained in:
Alexey Golubev 2017-04-03 13:00:31 +03:00
commit 4faf90cbf7
4006 changed files with 206261 additions and 382381 deletions

5
.gitignore vendored
View file

@ -18,3 +18,8 @@ apps/presentationeditor/mobile/document
apps/spreadsheeteditor/embed/offlinedocs
apps/spreadsheeteditor/main/offlinedocs
apps/spreadsheeteditor/mobile/offlinedocs
# tests
selenium-debug.log
**/test/bin
**/test/reports

View file

@ -50,7 +50,6 @@
lang: <language code>,
location: <location>,
canCoAuthoring: <can coauthoring documents>,
canAutosave: <can autosave documents>,
canBackToFolder: <can return to folder> - deprecated. use "customization.goback" parameter,
createUrl: 'create document url',
sharingSettingsUrl: 'document sharing settings url',
@ -105,15 +104,18 @@
url: 'http://...',
text: 'Go to London'
},
chat: false,
comments: false,
chat: true,
comments: true,
zoom: 100,
compactToolbar: false,
leftMenu: true,
rightMenu: true,
toolbar: true,
header: true,
autosave: true
statusBar: true,
autosave: true,
forcesave: false,
commentAuthorOnly: false
},
plugins: {
autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}',
@ -129,8 +131,7 @@
events: {
'onReady': <document ready callback>,
'onBack': <back to folder callback>,
'onDocumentStateChange': <document state changed callback>,
'onSave': <save request callback>
'onDocumentStateChange': <document state changed callback>
}
}
@ -258,25 +259,26 @@
};
var _onMessage = function(msg) {
if (msg && msg.frameEditorId == placeholderId) {
var events = _config.events || {},
handler = events[msg.event],
res;
if (msg.event === 'onRequestEditRights' && !handler) {
_applyEditRights(false, 'handler is\'n defined');
if ( msg ) {
if ( msg.type === "onExternalPluginMessage" ) {
_sendCommand(msg);
} else
if (msg.event === 'onInternalMessage' && msg.data && msg.data.type == 'localstorage') {
_callLocalStorage(msg.data.data);
} else {
if (msg.event === 'onReady') {
_onReady();
}
if ( msg.frameEditorId == placeholderId ) {
var events = _config.events || {},
handler = events[msg.event],
res;
if (handler) {
res = handler.call(_self, { target: _self, data: msg.data });
if (msg.event === 'onSave' && res !== false) {
_processSaveResult(true);
if (msg.event === 'onRequestEditRights' && !handler) {
_applyEditRights(false, 'handler isn\'t defined');
} else if (msg.event === 'onInternalMessage' && msg.data && msg.data.type == 'localstorage') {
_callLocalStorage(msg.data.data);
} else {
if (msg.event === 'onReady') {
_onReady();
}
if (handler) {
res = handler.call(_self, {target: _self, data: msg.data});
}
}
}
@ -363,7 +365,7 @@
if (target && _checkConfigParams()) {
iframe = createIframe(_config);
target.parentNode && target.parentNode.replaceChild(iframe, target);
this._msgDispatcher = new MessageDispatcher(_onMessage, this);
var _msgDispatcher = new MessageDispatcher(_onMessage, this);
}
/*
@ -372,6 +374,18 @@
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) {
if (iframe && iframe.contentWindow)
postMessage(iframe.contentWindow, cmd);
@ -505,7 +519,8 @@
var data = {
type: evt.type,
x: evt.x - r.left,
y: evt.y - r.top
y: evt.y - r.top,
event: evt
};
_sendCommand({
@ -527,7 +542,6 @@
return {
showError : _showError,
showMessage : _showMessage,
applyEditRights : _applyEditRights,
processSaveResult : _processSaveResult,
processRightsChange : _processRightsChange,
denyEditingRights : _denyEditingRights,
@ -538,7 +552,8 @@
downloadAs : _downloadAs,
serviceCommand : _serviceCommand,
attachMouseEvents : _attachMouseEvents,
detachMouseEvents : _detachMouseEvents
detachMouseEvents : _detachMouseEvents,
destroyEditor : _destroyEditor
}
};
@ -558,23 +573,31 @@
};
DocsAPI.DocEditor.version = function() {
return '4.2.7';
return '{{PRODUCT_VERSION}}';
};
MessageDispatcher = function(fn, scope) {
var _fn = fn,
_scope = scope || window;
_scope = scope || window,
eventFn = function(msg) {
_onMessage(msg);
};
var _bindEvents = function() {
if (window.addEventListener) {
window.addEventListener("message", function(msg) {
_onMessage(msg);
}, false)
window.addEventListener("message", eventFn, false)
}
else if (window.attachEvent) {
window.attachEvent("onmessage", function(msg) {
_onMessage(msg);
});
window.attachEvent("onmessage", eventFn);
}
};
var _unbindEvents = function() {
if (window.removeEventListener) {
window.removeEventListener("message", eventFn, false)
}
else if (window.detachEvent) {
window.detachEvent("onmessage", eventFn);
}
};
@ -592,6 +615,10 @@
};
_bindEvents.call(this);
return {
unbindEvents: _unbindEvents
}
};
function getBasePath() {

View file

@ -65,7 +65,6 @@
'onRequestEmailAddresses': onRequestEmailAddresses,
'onRequestStartMailMerge': onRequestStartMailMerge,
'onRequestHistoryClose': onRequestHistoryClose,
'onSave': onDocumentSave,
'onError': onError
}
});
@ -195,12 +194,6 @@
docEditor.applyEditRights(true, "Someone is editing this document right now. Please try again later.");
}
function onDocumentSave(event) {
var url = event.data;
// if you want to async save process return false
// and call api.processSaveResult when ready
}
function onError(event) {
// critical error happened
// examine event.data.errorCode and event.data.errorDescription for details

View file

@ -94,7 +94,7 @@
mode : urlParams["mode"] || 'edit',
lang : urlParams["lang"] || 'en',
user: {
id: urlParams["userid"], firstname: urlParams["userfname"], lastname: urlParams["userlname"]
id: urlParams["userid"] || 'uid-901', name: urlParams["username"] || 'Chuk.Gek'
}
};
}

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -35,22 +35,22 @@ if (Common === undefined)
Common.component = Common.component || {};
Common.Analytics = Common.component.Analytics = new(function() {
var _category;
Common.Analytics = Common.component.Analytics = new(function() {
var _category;
return {
initialize: function(id, category) {
return {
initialize: function(id, category) {
if (typeof id === 'undefined')
throw 'Analytics: invalid id.';
if (typeof id === 'undefined')
throw 'Analytics: invalid id.';
if (typeof category === 'undefined' || Object.prototype.toString.apply(category) !== '[object String]')
throw 'Analytics: invalid category type.';
if (typeof category === 'undefined' || Object.prototype.toString.apply(category) !== '[object String]')
throw 'Analytics: invalid category type.';
_category = category;
_category = category;
$('head').append(
'<script type="text/javascript">' +
$('head').append(
'<script type="text/javascript">' +
'var _gaq = _gaq || [];' +
'_gaq.push(["_setAccount", "' + id + '"]);' +
'_gaq.push(["_trackPageview"]);' +
@ -60,27 +60,27 @@ Common.Analytics = Common.component.Analytics = new(function() {
'var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);' +
'})();' +
'</script>'
);
},
);
},
trackEvent: function(action, label, value) {
trackEvent: function(action, label, value) {
if (typeof action !== 'undefined' && Object.prototype.toString.apply(action) !== '[object String]')
throw 'Analytics: invalid action type.';
if (typeof action !== 'undefined' && Object.prototype.toString.apply(action) !== '[object String]')
throw 'Analytics: invalid action type.';
if (typeof label !== 'undefined' && Object.prototype.toString.apply(label) !== '[object String]')
throw 'Analytics: invalid label type.';
if (typeof label !== 'undefined' && Object.prototype.toString.apply(label) !== '[object String]')
throw 'Analytics: invalid label type.';
if (typeof value !== 'undefined' && !(Object.prototype.toString.apply(value) === '[object Number]' && isFinite(value)))
throw 'Analytics: invalid value type.';
if (typeof value !== 'undefined' && !(Object.prototype.toString.apply(value) === '[object Number]' && isFinite(value)))
throw 'Analytics: invalid value type.';
if (typeof _gaq === 'undefined')
return;
if (typeof _gaq === 'undefined')
return;
if (_category === 'undefined')
throw 'Analytics is not initialized.';
if (_category === 'undefined')
throw 'Analytics is not initialized.';
_gaq.push(['_trackEvent', _category, action, label, value]);
_gaq.push(['_trackEvent', _category, action, label, value]);
}
}
}
})();
})();

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -30,225 +30,219 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
if (Common === undefined) {
var Common = {};
}
Common.Gateway = new(function() {
var me = this,
$me = $(me);
Common.Gateway = new(function() {
var me = this,
$me = $(me);
var commandMap = {
'init': function(data) {
$me.trigger('init', data);
},
var commandMap = {
'init': function(data) {
$me.trigger('init', data);
},
'openDocument': function(data) {
$me.trigger('opendocument', data);
},
'openDocument': function(data) {
$me.trigger('opendocument', data);
},
'showMessage': function(data) {
$me.trigger('showmessage', data);
},
'showMessage': function(data) {
$me.trigger('showmessage', data);
},
'applyEditRights': function(data) {
$me.trigger('applyeditrights', data);
},
'applyEditRights': function(data) {
$me.trigger('applyeditrights', data);
},
'processSaveResult': function(data) {
$me.trigger('processsaveresult', data);
},
'processSaveResult': function(data) {
$me.trigger('processsaveresult', data);
},
'processRightsChange': function(data) {
$me.trigger('processrightschange', data);
},
'processRightsChange': function(data) {
$me.trigger('processrightschange', data);
},
'refreshHistory': function(data) {
$me.trigger('refreshhistory', data);
},
'refreshHistory': function(data) {
$me.trigger('refreshhistory', data);
},
'setHistoryData': function(data) {
$me.trigger('sethistorydata', data);
},
'setHistoryData': function(data) {
$me.trigger('sethistorydata', data);
},
'setEmailAddresses': function(data) {
$me.trigger('setemailaddresses', data);
},
'setEmailAddresses': function(data) {
$me.trigger('setemailaddresses', data);
},
'processMailMerge': function(data) {
$me.trigger('processmailmerge', data);
},
'processMailMerge': function(data) {
$me.trigger('processmailmerge', data);
},
'downloadAs': function() {
$me.trigger('downloadas');
},
'downloadAs': function() {
$me.trigger('downloadas');
},
'processMouse': function(data) {
$me.trigger('processmouse', data);
},
'processMouse': function(data) {
$me.trigger('processmouse', data);
},
'internalCommand': function(data) {
$me.trigger('internalcommand', data);
},
'internalCommand': function(data) {
$me.trigger('internalcommand', data);
},
'resetFocus': function(data) {
$me.trigger('resetfocus', data);
}
};
'resetFocus': function(data) {
$me.trigger('resetfocus', data);
}
};
var _postMessage = function(msg) {
// TODO: specify explicit origin
if (window.parent && window.JSON) {
msg.frameEditorId = window.frameEditorId;
window.parent.postMessage(window.JSON.stringify(msg), "*");
}
};
var _postMessage = function(msg) {
// TODO: specify explicit origin
if (window.parent && window.JSON) {
msg.frameEditorId = window.frameEditorId;
window.parent.postMessage(window.JSON.stringify(msg), "*");
}
};
var _onMessage = function(msg) {
// TODO: check message origin
var data = msg.data;
if (Object.prototype.toString.apply(data) !== '[object String]' || !window.JSON) {
return;
var _onMessage = function(msg) {
// TODO: check message origin
var data = msg.data;
if (Object.prototype.toString.apply(data) !== '[object String]' || !window.JSON) {
return;
}
var cmd, handler;
try {
cmd = window.JSON.parse(data)
} catch(e) {
cmd = '';
}
if (cmd) {
handler = commandMap[cmd.command];
if (handler) {
handler.call(this, cmd.data);
}
}
};
var fn = function(e) { _onMessage(e); };
if (window.attachEvent) {
window.attachEvent('onmessage', fn);
} else {
window.addEventListener('message', fn, false);
}
var cmd, handler;
return {
try {
cmd = window.JSON.parse(data)
} catch(e) {
cmd = '';
}
ready: function() {
_postMessage({ event: 'onReady' });
},
if (cmd) {
handler = commandMap[cmd.command];
if (handler) {
handler.call(this, cmd.data);
requestEditRights: function() {
_postMessage({ event: 'onRequestEditRights' });
},
requestHistory: function() {
_postMessage({ event: 'onRequestHistory' });
},
requestHistoryData: function(revision) {
_postMessage({
event: 'onRequestHistoryData',
data: revision
});
},
requestRestore: function(version, url) {
_postMessage({
event: 'onRequestRestore',
data: {
version: version,
url: url
}
});
},
requestEmailAddresses: function() {
_postMessage({ event: 'onRequestEmailAddresses' });
},
requestStartMailMerge: function() {
_postMessage({event: 'onRequestStartMailMerge'});
},
requestHistoryClose: function(revision) {
_postMessage({event: 'onRequestHistoryClose'});
},
reportError: function(code, description) {
_postMessage({
event: 'onError',
data: {
errorCode: code,
errorDescription: description
}
});
},
sendInfo: function(info) {
_postMessage({
event: 'onInfo',
data: info
});
},
setDocumentModified: function(modified) {
_postMessage({
event: 'onDocumentStateChange',
data: modified
});
},
internalMessage: function(type, data) {
_postMessage({
event: 'onInternalMessage',
data: {
type: type,
data: data
}
});
},
updateVersion: function() {
_postMessage({ event: 'onOutdatedVersion' });
},
downloadAs: function(url) {
_postMessage({
event: 'onDownloadAs',
data: url
});
},
collaborativeChanges: function() {
_postMessage({event: 'onCollaborativeChanges'});
},
requestRename: function(title) {
_postMessage({event: 'onRequestRename', data: title});
},
metaChange: function(meta) {
_postMessage({event: 'onMetaChange', data: meta});
},
on: function(event, handler){
var localHandler = function(event, data){
handler.call(me, data)
};
$me.on(event, localHandler);
}
}
};
var fn = function(e) { _onMessage(e); };
if (window.attachEvent) {
window.attachEvent('onmessage', fn);
} else {
window.addEventListener('message', fn, false);
}
return {
ready: function() {
_postMessage({ event: 'onReady' });
},
save: function(url) {
_postMessage({
event: 'onSave',
data: url
});
},
requestEditRights: function() {
_postMessage({ event: 'onRequestEditRights' });
},
requestHistory: function() {
_postMessage({ event: 'onRequestHistory' });
},
requestHistoryData: function(revision) {
_postMessage({
event: 'onRequestHistoryData',
data: revision
});
},
requestRestore: function(version, url) {
_postMessage({
event: 'onRequestRestore',
data: {
version: version,
url: url
}
});
},
requestEmailAddresses: function() {
_postMessage({ event: 'onRequestEmailAddresses' });
},
requestStartMailMerge: function() {
_postMessage({event: 'onRequestStartMailMerge'});
},
requestHistoryClose: function(revision) {
_postMessage({event: 'onRequestHistoryClose'});
},
reportError: function(code, description) {
_postMessage({
event: 'onError',
data: {
errorCode: code,
errorDescription: description
}
});
},
sendInfo: function(info) {
_postMessage({
event: 'onInfo',
data: info
});
},
setDocumentModified: function(modified) {
_postMessage({
event: 'onDocumentStateChange',
data: modified
});
},
internalMessage: function(type, data) {
_postMessage({
event: 'onInternalMessage',
data: {
type: type,
data: data
}
});
},
updateVersion: function() {
_postMessage({ event: 'onOutdatedVersion' });
},
downloadAs: function(url) {
_postMessage({
event: 'onDownloadAs',
data: url
});
},
collaborativeChanges: function() {
_postMessage({event: 'onCollaborativeChanges'});
},
requestRename: function(title) {
_postMessage({event: 'onRequestRename', data: title});
},
metaChange: function(meta) {
_postMessage({event: 'onMetaChange', data: meta});
},
on: function(event, handler){
var localHandler = function(event, data){
handler.call(me, data)
};
$me.on(event, localHandler);
}
}
})();
})();

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -53,7 +53,7 @@
$dlgShare = common.view.modals.create('share');
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('.share-buttons > span').on('click', function(e){

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -331,7 +331,7 @@ define([
$(document).off('mouseup', onMouseUp);
};
var onAfterHideMenu = function(e) {
var onAfterHideMenu = function(e, isFromInputControl) {
me.cmpEl.find('.dropdown-toggle').blur();
if (me.cmpEl.hasClass('active') !== me.pressed)
me.cmpEl.trigger('button.internal.active', [me.pressed]);
@ -416,24 +416,27 @@ define([
setDisabled: function(disabled) {
if (this.rendered && this.disabled != disabled) {
var el = this.cmpEl,
isGroup = el.hasClass('btn-group');
isGroup = el.hasClass('btn-group'),
me = this;
disabled = (disabled===true);
if (disabled !== el.hasClass('disabled')) {
var decorateBtn = function(button) {
button.toggleClass('disabled', disabled);
(disabled) ? button.attr({disabled: disabled}) : button.removeAttr('disabled');
if (!me.options.allowMouseEventsOnDisabled)
(disabled) ? button.attr({disabled: disabled}) : button.removeAttr('disabled');
};
decorateBtn(el);
isGroup && decorateBtn(el.children('button'));
}
if (disabled) {
if (disabled || !Common.Utils.isGecko) {
var tip = this.cmpEl.data('bs.tooltip');
if (tip) {
tip.hide();
disabled && tip.hide();
!Common.Utils.isGecko && (tip.enabled = !disabled);
}
}
}
@ -466,8 +469,10 @@ define([
var cmpEl = this.cmpEl,
modalParents = cmpEl.closest('.asc-window');
if (cmpEl.data('bs.tooltip'))
cmpEl.removeData('bs.tooltip');
cmpEl.attr('data-toggle', 'tooltip');
cmpEl.tooltip('destroy').tooltip({
cmpEl.tooltip({
title : hint,
placement : this.options.hintAnchor || 'cursor'
});

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -112,6 +112,7 @@ define([
this.menuCls = me.options.menuCls;
this.menuStyle = me.options.menuStyle;
this.template = me.options.template || me.template;
this.itemsTemplate = me.options.itemsTemplate;
this.hint = me.options.hint;
this.editable = me.options.editable;
this.disabled = me.options.disabled;
@ -134,15 +135,22 @@ define([
var me = this;
if (!me.rendered) {
var items = this.store.toJSON();
this.cmpEl = $(this.template({
id : this.id,
cls : this.cls,
style : this.style,
menuCls : this.menuCls,
menuStyle : this.menuStyle,
items : this.store.toJSON(),
items : items,
scope : me
}));
if (this.itemsTemplate)
this.cmpEl.find('ul').append(
$(this.itemsTemplate({
items : items,
scope : me
})));
if (parentEl) {
this.setElement(parentEl, false);
@ -274,7 +282,7 @@ define([
}
if (this.scroller)
this.scroller.update();
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
this.trigger('show:after', this, e);
},
@ -286,10 +294,10 @@ define([
e.preventDefault();
},
onAfterHideMenu: function(e) {
onAfterHideMenu: function(e, isFromInputControl) {
this.cmpEl.find('.dropdown-toggle').blur();
this.trigger('hide:after', this, e);
Common.NotificationCenter.trigger('menu:hide');
this.trigger('hide:after', this, e, isFromInputControl);
Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl);
},
onAfterKeydownMenu: function(e) {
@ -441,7 +449,7 @@ define([
return this.rendered ? this._input.val() : null;
},
setValue: function(value) {
setValue: function(value, defValue) {
if (!this.rendered)
return;
@ -454,7 +462,7 @@ define([
this.setRawValue(this._selectedItem.get(this.displayField));
$('#' + this._selectedItem.get('id'), $(this.el)).addClass('selected');
} else {
this.setRawValue(value);
this.setRawValue((defValue!==undefined) ? defValue : value);
}
},
@ -529,14 +537,21 @@ define([
},
onResetItems: function() {
$(this.el).find('ul').html(_.template([
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>',
'<% }); %>'
].join(''), {
items: this.store.toJSON(),
scope: this
}));
if (this.itemsTemplate) {
$(this.el).find('ul').html( $(this.itemsTemplate({
items: this.store.toJSON(),
scope: this
})));
} else {
$(this.el).find('ul').html(_.template([
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>',
'<% }); %>'
].join(''), {
items: this.store.toJSON(),
scope: this
}));
}
if (!_.isUndefined(this.scroller)) {
this.scroller.destroy();

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -193,7 +193,7 @@ define([
me.onAfterHideMenu(e);
}, 10);
} else if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode != Common.UI.Keys.CTRL && e.keyCode != Common.UI.Keys.SHIFT && e.keyCode != Common.UI.Keys.ALT){
if (!this.isMenuOpen())
if (!this.isMenuOpen() && !e.ctrlKey)
this.openMenu();
if (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) {

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -85,6 +85,7 @@ define([
this.rootWidth = 0;
this.rootHeight = 0;
this.rendered = false;
this.needFillComboView = false;
this.fieldPicker = new Common.UI.DataView({
cls: 'field-picker',
@ -209,7 +210,7 @@ define([
},
checkSize: function() {
if (this.cmpEl) {
if (this.cmpEl && this.cmpEl.is(':visible')) {
var me = this,
width = this.cmpEl.width(),
height = this.cmpEl.height();
@ -304,10 +305,10 @@ define([
}
},
onAfterHideMenu: function(e) {
onAfterHideMenu: function(e, isFromInputControl) {
this.menuPicker.selectedBeforeHideRec = this.menuPicker.getSelectedRec()[0]; // for DataView - onKeyDown - Return key
(this.showLast) ? this.menuPicker.showLastSelected() : this.menuPicker.deselectAll();
this.trigger('hide:after', this, e);
this.trigger('hide:after', this, e, isFromInputControl);
},
onFieldPickerSelect: function(picker, item, record) {
@ -315,6 +316,7 @@ define([
},
onMenuPickerSelect: function(picker, item, record, fromKeyDown) {
this.needFillComboView = this.disabled;
if (this.disabled || fromKeyDown===true) return;
this.fillComboView(record, false);
@ -375,6 +377,17 @@ define([
this.cmpEl.toggleClass('disabled', disabled);
$('button', this.openButton.cmpEl).toggleClass('disabled', disabled);
this.fieldPicker.setDisabled(disabled);
if (this.needFillComboView && !disabled) {
var picker = this.menuPicker;
if (picker) {
var record = picker.getSelectedRec();
if (record) {
record = record[0];
this.fillComboView(record || picker.store.at(0), false);
}
}
}
},
isDisabled: function() {
@ -383,6 +396,8 @@ define([
fillComboView: function(record, forceSelect, forceFill) {
if (!_.isUndefined(record) && record instanceof Backbone.Model){
this.needFillComboView = false;
var me = this,
store = me.menuPicker.store,
fieldPickerEl = $(me.fieldPicker.el);

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -84,7 +84,9 @@ define([
defaults: function() {
return {
id: Common.UI.getId(),
caption: ''
caption: '',
inline: false,
headername: undefined
}
}
});
@ -99,7 +101,8 @@ define([
id: Common.UI.getId(),
selected: false,
allowSelected: true,
value: null
value: null,
disabled: false
}
}
});
@ -140,6 +143,7 @@ define([
el.off('click').on('click', _.bind(this.onClick, this));
el.off('dblclick').on('dblclick', _.bind(this.onDblClick, this));
el.off('contextmenu').on('contextmenu', _.bind(this.onContextMenu, this));
el.toggleClass('disabled', this.model.get('disabled'));
if (!_.isUndefined(this.model.get('cls')))
el.addClass(this.model.get('cls'));
@ -157,10 +161,14 @@ define([
},
onClick: function(e) {
if (this.model.get('disabled')) return false;
this.trigger('click', this, this.model, e);
},
onDblClick: function(e) {
if (this.model.get('disabled')) return false;
this.trigger('dblclick', this, this.model, e);
},
@ -190,10 +198,15 @@ define([
template: _.template([
'<div class="dataview inner" style="<%= style %>">',
'<% _.each(groups, function(group) { %>',
'<div class="grouped-data" id="<%= group.id %>">',
'<div class="group-description">',
'<span><b><%= group.caption %></b></span>',
'</div>',
'<% 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">',
'<span><%= group.caption %></span>',
'</div>',
'<% } %>',
'<div class="group-items-container">',
'</div>',
'</div>',
@ -696,39 +709,29 @@ define([
fillIndexesArray: function() {
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 = {
itemsIndexes: [],
columns: 0,
rows: 0
};
if (this.groups && this.groups.length > 0) {
var group_desc = this.cmpEl.find('.group-description:first');
if (group_desc.length>0)
offsetLeft += group_desc.width();
}
var el = $(this.dataViewItems[0].el),
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
offsetLeft = this.$el.offset().left,
prevtop = -1, topIdx = 0, leftIdx = 0;
for (var i=0; i<this.dataViewItems.length; i++) {
top = Math.floor(($(this.dataViewItems[i].el).offset().top - offsetTop)/itemH) + idxOffset;
left = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW);
if (top<0) {
idxOffset = -top;
top += idxOffset;
}
if (top > this._layoutParams.itemsIndexes.length-1) {
var top = $(this.dataViewItems[i].el).offset().top;
leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW);
if (top>prevtop) {
prevtop = top;
this._layoutParams.itemsIndexes.push([]);
topIdx = this._layoutParams.itemsIndexes.length-1;
}
this._layoutParams.itemsIndexes[top][left] = i;
this.dataViewItems[i].topIdx = top;
this.dataViewItems[i].leftIdx = left;
if (this._layoutParams.columns<left) this._layoutParams.columns = left;
this._layoutParams.itemsIndexes[topIdx][leftIdx] = i;
this.dataViewItems[i].topIdx = topIdx;
this.dataViewItems[i].leftIdx = leftIdx;
if (this._layoutParams.columns<leftIdx) this._layoutParams.columns = leftIdx;
}
this._layoutParams.rows = this._layoutParams.itemsIndexes.length;
this._layoutParams.columns++;

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -439,9 +439,9 @@ define([
e.preventDefault();
},
onAfterHideMenu: function(e) {
this.trigger('hide:after', this, e);
Common.NotificationCenter.trigger('menu:hide', this);
onAfterHideMenu: function(e, isFromInputControl) {
this.trigger('hide:after', this, e, isFromInputControl);
Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl);
},
onAfterKeydownMenu: function(e) {

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* 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);
},
getRawValue: function () {
return this.$input.val();
},
setValue: function(value, suspendchange) {
var showError = false;
this._fromKeyDown = false;
@ -290,6 +294,10 @@ define([
}
},
setMask: function(value) {
this.options.maskExp = value;
},
onMouseDown: function (type, e) {
if ( this.disabled ) return;
@ -336,10 +344,10 @@ define([
}
} else if (e.keyCode==Common.UI.Keys.RETURN) {
if (this.options.defaultUnit && this.options.defaultUnit.length) {
var value = this.$input.val();
var value = this.getRawValue();
if (this.value != value) {
this.onEnterValue();
return false;
return (this.value == value);
}
} else {
this.onEnterValue();
@ -384,7 +392,7 @@ define([
onEnterValue: function() {
if (this.$input) {
var val = this.$input.val();
var val = this.getRawValue();
this.setValue((val==='') ? this.value : val );
this.trigger('entervalue', this);
}
@ -392,7 +400,7 @@ define([
onBlur: function(e){
if (this.$input) {
var val = this.$input.val();
var val = this.getRawValue();
this.setValue((val==='') ? this.value : val );
if (this.options.hold && this.switches.fromKeyDown)
this._stopSpin();
@ -430,7 +438,7 @@ define([
if (!me.readOnly) {
var val = me.options.step;
if (me._fromKeyDown) {
val = this.$input.val();
val = this.getRawValue();
val = _.isEmpty(val) ? me.oldValue : parseFloat(val);
} else if(me.getValue() !== '') {
if (me.options.allowAuto && me.getValue()==me.options.autoText) {
@ -451,7 +459,7 @@ define([
if (!me.readOnly) {
var val = me.options.step;
if (me._fromKeyDown) {
val = this.$input.val();
val = this.getRawValue();
val = _.isEmpty(val) ? me.oldValue : parseFloat(val);
} else if(me.getValue() !== '') {
if (me.options.allowAuto && me.getValue()==me.options.autoText) {
@ -520,4 +528,22 @@ define([
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 || {}));
});

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -63,7 +63,10 @@ define([
'<div class="slider multi-slider-gradient">',
'<div class="track"></div>',
'<% _.each(items, function(item) { %>',
'<div class="thumb img-commonctrl" style=""></div>',
'<div class="thumb img-commonctrl" style="">',
'<div class="thumb-top"></div>',
'<div class="thumb-bottom"></div>',
'</div>',
'<% }); %>',
'</div>'
].join('')),
@ -98,6 +101,7 @@ define([
me.thumbs[i].thumb.on('dblclick', null, function() {
me.trigger('thumbdblclick', me);
});
me.thumbs[i].thumbcolor = me.thumbs[i].thumb.find('> div');
}
if (me.styleStr!=='') {
@ -118,6 +122,7 @@ define([
setColorValue: function(color, index) {
var ind = (index!==undefined) ? index : this.currentThumb;
this.colorValues[ind] = color;
this.thumbs[ind].thumbcolor.css('background-color', color);
this.changeGradientStyle();
},

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -120,8 +120,8 @@
this.getBSTip().show(at);
},
hide: function() {
this.getBSTip().hide();
hide: function(callback) {
this.getBSTip().hide(callback);
},
setTitle: function(title) {

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -404,8 +404,8 @@ define([
if (!options.width) options.width = 'auto';
var template = '<div class="info-box">' +
'<div class="icon img-commonctrl <%= iconCls %>" />' +
'<div class="text"><span><%= msg %></span>' +
'<% if (typeof iconCls !== "undefined") { %><div class="icon img-commonctrl <%= iconCls %>" /><% } %>' +
'<div class="text" <% if (typeof iconCls == "undefined") { %> style="padding-left:10px;" <% } %>><span><%= msg %></span>' +
'<% if (dontshow) { %><div class="dont-show-checkbox"></div><% } %>' +
'</div>' +
'</div>' +
@ -454,6 +454,8 @@ define([
body.height(parseInt(text_cnt.css('height')) + parseInt(footer.css('height')));
window.setHeight(parseInt(body.css('height')) + parseInt(header.css('height')));
}
if (text.height() < icon.height()-10)
text.css({'vertical-align': 'baseline', 'line-height': icon.height()+'px'});
}
function onBtnClick(event) {

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -692,7 +692,8 @@ define([
editText : false,
editTextInPopover : false,
showReplyInPopover : false,
scope : t.view
scope : t.view,
editable : t.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)
}));
}
@ -1041,7 +1042,8 @@ define([
editTextInPopover : (this.editPopover ? true : false),
showReplyInPopover : false,
hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false),
scope : this.view
scope : this.view,
editable : this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId)
});
if (comment) {
var replies = this.readSDKReplies(data);
@ -1072,7 +1074,8 @@ define([
editText : false,
editTextInPopover : false,
showReplyInPopover : false,
scope : this.view
scope : this.view,
editable : this.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)
}));
}
@ -1223,7 +1226,7 @@ define([
for (i = 0; i < comments.length; ++i) {
comment = this.findComment(comments[i].asc_getId());
if (comment) {
comment.set('editTextInPopover', true);
comment.set('editTextInPopover', t.mode.canEditComments);// dont't edit comment when customization->commentAuthorOnly is true
comment.set('hint', false);
this.popoverComments.push(comment);
}

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -114,6 +114,7 @@ define([
createExternalEditor.apply(this);
}
this.isExternalEditorVisible = true;
this.isHandlerCalled = false;
}, this),
'hide': _.bind(function(cmp){
if (externalEditor) {
@ -138,6 +139,8 @@ define([
},
handler: function(result, value) {
if (this.isHandlerCalled) return;
this.isHandlerCalled = true;
externalEditor && externalEditor.serviceCommand('queryClose',{mr:result});
return true;
},

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -57,6 +57,7 @@ define([
this.currentArrColors = [];
this.currentDocId = '';
this.currentDocIdPrev = '';
this.currentRev = 0;
},
events: {
@ -74,6 +75,7 @@ define([
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
this.api.asc_registerCallback('asc_onExpiredToken', _.bind(this.onExpiredToken, this));
return this;
},
@ -127,6 +129,7 @@ define([
this.currentArrColors = record.get('arrColors');
this.currentDocId = record.get('docId');
this.currentDocIdPrev = record.get('docIdPrev');
this.currentRev = rev;
if ( _.isEmpty(url) || (urlGetTime - record.get('urlGetTime') > 5 * 60000)) {
_.delay(function() {
@ -134,12 +137,15 @@ define([
}, 10);
} else {
var urlDiff = record.get('urlDiff'),
token = record.get('token'),
hist = new Asc.asc_CVersionHistory();
hist.asc_setDocId(_.isEmpty(urlDiff) ? this.currentDocId : this.currentDocIdPrev);
hist.asc_setUrl(url);
hist.asc_setUrlChanges(urlDiff);
hist.asc_setCurrentChangeId(this.currentChangeId);
hist.asc_setArrColors(this.currentArrColors);
hist.asc_setToken(token);
hist.asc_setIsRequested(false);
this.api.asc_showRevision(hist);
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
@ -166,7 +172,8 @@ define([
var diff = (this.currentChangeId===undefined) ? null : opts.data.changesUrl, // if revision has changes, but serverVersion !== app.buildVersion -> hide revision changes
url = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.url : opts.data.url,
docId = opts.data.key ? opts.data.key : this.currentDocId,
docIdPrev = opts.data.previous && opts.data.previous.key ? opts.data.previous.key : this.currentDocIdPrev;
docIdPrev = opts.data.previous && opts.data.previous.key ? opts.data.previous.key : this.currentDocIdPrev,
token = opts.data.token;
if (revisions && revisions.length>0) {
for(var i=0; i<revisions.length; i++) {
@ -178,6 +185,7 @@ define([
rev.set('docId', docId, {silent: true});
rev.set('docIdPrev', docIdPrev, {silent: true});
}
rev.set('token', token, {silent: true});
}
}
var hist = new Asc.asc_CVersionHistory();
@ -186,6 +194,8 @@ define([
hist.asc_setDocId(_.isEmpty(diff) ? docId : docIdPrev);
hist.asc_setCurrentChangeId(this.currentChangeId);
hist.asc_setArrColors(this.currentArrColors);
hist.asc_setToken(token);
hist.asc_setIsRequested(true);
this.api.asc_showRevision(hist);
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
@ -194,6 +204,13 @@ define([
}
},
onExpiredToken: function() {
var me = this;
_.delay(function() {
Common.Gateway.requestHistoryData(me.currentRev); // получаем url-ы для ревизий
}, 10);
},
onClickBackToDocument: function () {
// reload editor
Common.Gateway.requestHistoryClose();

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -84,7 +84,6 @@ define([
setMode: function(mode) {
if (mode.canPlugins) {
this.panelPlugins.pluginsPath = mode.pluginsPath;
this.updatePluginsList();
}
},
@ -143,7 +142,7 @@ define([
item.set('pluginObj', plugin);
arr.push(plugin);
});
this.api.asc_pluginsRegister(this.panelPlugins.pluginsPath, arr);
this.api.asc_pluginsRegister('', arr);
},
onSelectPlugin: function(picker, item, record, e){
@ -205,7 +204,7 @@ define([
menuContainer.css({left: showPoint[0], top: showPoint[1]});
menu.menuAlignEl = currentTarget;
menu.setOffset(-11, -currentTarget.height()/2 + 2);
menu.setOffset(-20, -currentTarget.height()/2 - 3);
menu.show();
_.delay(function() {
menu.cmpEl.focus();
@ -220,8 +219,7 @@ define([
var variation = plugin.get_Variations()[variationIndex];
if (variation.get_Visual()) {
var url = variation.get_Url();
if (!/(^https?:\/\/)/i.test(url) && !/(^www.)/i.test(url))
url = ((plugin.get_BaseUrl().length == 0) ? this.panelPlugins.pluginsPath : plugin.get_BaseUrl()) + url;
url = ((plugin.get_BaseUrl().length == 0) ? url : plugin.get_BaseUrl()) + url;
if (variation.get_InsideMode()) {
if (!this.panelPlugins.openInsideMode(plugin.get_Name(), url))

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -186,13 +186,13 @@ function getParent($this) {
return $parent && $parent.length ? $parent : $this.parent();
}
function clearMenus() {
function clearMenus(isFromInputControl) {
$('.dropdown-toggle').each(function (e) {
var $parent = ($(this)).parent();
if (!$parent.hasClass('open')) return;
$parent.trigger(e = $.Event('hide.bs.dropdown'));
if (e.isDefaultPrevented()) return;
$parent.removeClass('open').trigger('hidden.bs.dropdown');
$parent.removeClass('open').trigger('hidden.bs.dropdown', isFromInputControl);
})
}
@ -217,7 +217,7 @@ $(document)
function onDropDownClick(e) {
if (e.which == 1 || e.which == undefined)
clearMenus();
clearMenus(/form-control/.test(e.target.className));
}
if (!!clickDefHandler) {

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -75,7 +75,8 @@ define([
scope : null,
hide : false,
hint : false,
dummy : undefined
dummy : undefined,
editable : true
}
});
Common.Models.Reply = Backbone.Model.extend({
@ -89,7 +90,8 @@ define([
id : Common.UI.getId(), // internal
editText : false,
editTextInPopover : false,
scope : null
scope : null,
editable : true
}
});
});

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -64,6 +64,7 @@ define([
urlGetTime : '',
docId: '',
docIdPrev: '',
token: '',
arrColors: [], // array of user colors for all changes of current version
markedAsVersion: false,
canRestore: false,

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -65,8 +65,7 @@ define([
isUpdateOleOnResize: false,
buttons: [],
size: [800, 600],
initOnSelectionChanged: false,
isRelativeUrl: true
initOnSelectionChanged: false
}
}
});

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -29,7 +29,9 @@
<% if (!item.get("editText")) { %>
<div class="user-message" data-can-copy="true"><%=scope.pickLink(item.get("reply"))%></div>
<div class="btns-reply-ct">
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<% if (item.get("editable")) { %>
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<% } %>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
</div>
<% } else { %>
@ -57,7 +59,9 @@
<% if (!editText && !lock) { %>
<div class="edit-ct">
<div class="btn-edit img-commonctrl"></div>
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% } %>
<div class="btn-delete img-commonctrl"></div>
<% if (resolved) { %>
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>

View file

@ -30,7 +30,9 @@
<div class="user-message"><%=scope.pickLink(item.get("reply"))%></div>
<% if (!hint) { %>
<div class="btns-reply-ct">
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<% if (item.get("editable")) { %>
<div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>
<%}%>
<div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>
</div>
<%}%>
@ -60,7 +62,9 @@
<% if (!editTextInPopover && !lock && !hint) { %>
<div class="edit-ct">
<div class="btn-edit img-commonctrl"></div>
<% if (editable) { %>
<div class="btn-edit img-commonctrl"></div>
<% } %>
<div class="btn-delete img-commonctrl"></div>
<% if (resolved) { %>
<div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>

View file

@ -1,7 +1,6 @@
<div id="header-container">
<div id="header-logo"></div>
<div id="header-caption"><div><%= headerCaption %></div></div>
<div id="header-developer" class="hidden"><div><%= headerDeveloper %></div></div>
<div id="header-documentcaption"><div><%= documentCaption %></div></div>
<div id="header-back" style="display: <%= canBack ? 'table-cell' : 'none' %>;"><div><%= textBack %></div></div>
</div>

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -100,6 +100,7 @@ Common.util.LanguageInfo = new(function() {
0x0402 : ["bg-BG", "Български (България)"],
0x0003 : ["ca", "Català"],
0x0403 : ["ca-ES", "Català (Català)"],
0x0803 : ["ca-ES-valencia", "Català (Valencià)"],
0x7804 : ["zh", "中文"],
0x0004 : ["zh-Hans", "中文(简体)"],
0x0804 : ["zh-CN", "中文(中华人民共和国)"],
@ -315,7 +316,7 @@ Common.util.LanguageInfo = new(function() {
0x181A : ["sr-Latn-BA", "Srpski (Bosna i Hercegovina)"],
0x2C1A : ["sr-Latn-ME", "Srpski (Crna Gora)"],
0x081A : ["sr-Latn-CS", "Srpski (Srbija i Crna Gora (Prethodno))"],
0x241A : ["sr-Latn-RS", "Srpski (Srbija)"],
0x241A : ["sr-Latn-RS", "Srpski (Srbija, Latinica)"],
0x006C : ["nso", "Sesotho sa Leboa"],
0x046C : ["nso-ZA", "Sesotho sa Leboa (Afrika Borwa)"],
0x0032 : ["tn", "Setswana"],

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -38,71 +38,73 @@
*
*/
Common.localStorage = new (function() {
var _storeName, _filter;
var _store = {};
define(['gateway'], function () {
Common.localStorage = new (function() {
var _storeName, _filter;
var _store = {};
var ongetstore = function(data) {
if (data.type == 'localstorage') {
_store = data.keys;
}
};
Common.Gateway.on('internalcommand', ongetstore);
var _refresh = function() {
if (!_lsAllowed)
Common.Gateway.internalMessage('localstorage', {cmd:'get', keys:_filter});
};
var _save = function() {
if (!_lsAllowed)
Common.Gateway.internalMessage('localstorage', {cmd:'set', keys:_store});
};
var _setItem = function(name, value, just) {
if (_lsAllowed) {
localStorage.setItem(name, value);
} else {
_store[name] = value;
if (just===true) {
Common.Gateway.internalMessage('localstorage', {
cmd:'set',
keys: {
name: value
}
});
var ongetstore = function(data) {
if (data.type == 'localstorage') {
_store = data.keys;
}
};
Common.Gateway.on('internalcommand', ongetstore);
var _refresh = function() {
if (!_lsAllowed)
Common.Gateway.internalMessage('localstorage', {cmd:'get', keys:_filter});
};
var _save = function() {
if (!_lsAllowed)
Common.Gateway.internalMessage('localstorage', {cmd:'set', keys:_store});
};
var _setItem = function(name, value, just) {
if (_lsAllowed) {
localStorage.setItem(name, value);
} else {
_store[name] = value;
if (just===true) {
Common.Gateway.internalMessage('localstorage', {
cmd:'set',
keys: {
name: value
}
});
}
}
};
var _getItem = function(name) {
if (_lsAllowed)
return localStorage.getItem(name);
else
return _store[name]===undefined ? null : _store[name];
};
try {
var _lsAllowed = !!window.localStorage;
} catch (e) {
_lsAllowed = false;
}
};
var _getItem = function(name) {
if (_lsAllowed)
return localStorage.getItem(name);
else
return _store[name]===undefined ? null : _store[name];
};
try {
var _lsAllowed = !!window.localStorage;
} catch (e) {
_lsAllowed = false;
}
return {
getId: function() {
return _storeName;
},
setId: function(name) {
_storeName = name;
},
getItem: _getItem,
setItem: _setItem,
setKeysFilter: function(value) {
_filter = value;
},
sync: _refresh,
save: _save
};
})();
return {
getId: function() {
return _storeName;
},
setId: function(name) {
_storeName = name;
},
getItem: _getItem,
setItem: _setItem,
setKeysFilter: function(value) {
_filter = value;
},
sync: _refresh,
save: _save
};
})();
});

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* 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),
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,
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,
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,
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,
hostnameStrongRe = /((((https?)|(ftps?)):\/\/([\-\wа-яё]*:?[\-\wа-яё]*@)?)|(([\-\wа-яё]*:?[\-\wа-яё]*@)?www\.))((([\-\wа-яё]+\.)+[\wа-яё\-]{2,}|([\-\wа-яё]+))(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?)/ig,
@ -102,57 +102,33 @@ Common.Utils = _.extend(new(function() {
Chart : 7,
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,
checkSize = function() {
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;
// считаем: window.devicePixelRatio >= 2 => _devicePixelRatio = 2; zoom = window.devicePixelRatio / _devicePixelRatio;
if (window.devicePixelRatio > 0.1)
{
if (window.devicePixelRatio < 1.99)
{
var _devicePixelRatio = 1;
me.zoom = window.devicePixelRatio / _devicePixelRatio;
}
else
{
var _devicePixelRatio = 2;
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
document.firstElementChild.style.zoom = "normal";
}
// делаем простую проверку
// считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio;
// считаем: window.devicePixelRatio >= 2 => _devicePixelRatio = 2; zoom = window.devicePixelRatio / _devicePixelRatio;
if (window.devicePixelRatio > 0.1)
{
if (window.devicePixelRatio < 1.99)
{
var _devicePixelRatio = 1;
me.zoom = window.devicePixelRatio / _devicePixelRatio;
}
else
{
var _devicePixelRatio = 2;
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
document.firstElementChild.style.zoom = "normal";
}
me.innerWidth = window.innerWidth * me.zoom;
me.innerHeight = window.innerHeight * me.zoom;

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -52,7 +52,7 @@ define([
initialize: function(options) {
Common.UI.BaseView.prototype.initialize.call(this,arguments);
this.txtVersionNum = '4.2';
this.txtVersionNum = '{{PRODUCT_VERSION}}';
this.txtAscMail = 'support@onlyoffice.com';
this.txtAscTelNum = '+371 660-16425';
this.txtAscUrl = 'www.onlyoffice.com';
@ -147,7 +147,7 @@ define([
'</tr>',
'<tr>',
'<td colspan="3" align="center">',
'<a href="http:\/\/'+ this.txtAscUrl +'" target="_blank">' + this.txtAscUrl + '</a>',
'<label class="asc-about-desc">' + this.txtAscUrl + '</label>',
'</td>',
'</tr>',
'</table>'

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -54,7 +54,6 @@ define([
options : {
branding: {},
headerCaption: 'Default Caption',
headerDeveloper: 'DEVELOPER MODE',
documentCaption: '',
canBack: false
},
@ -79,16 +78,15 @@ define([
this.options = this.options ? _({}).extend(this.options, options) : options;
this.headerCaption = this.options.headerCaption;
this.headerDeveloper = this.txtHeaderDeveloper;
this.documentCaption = this.options.documentCaption;
this.canBack = this.options.canBack;
this.branding = this.options.customization;
this.isModified = false;
},
render: function () {
$(this.el).html(this.template({
headerCaption : this.headerCaption,
headerDeveloper : this.headerDeveloper,
documentCaption : Common.Utils.String.htmlEncode(this.documentCaption),
canBack : this.canBack,
textBack : this.textBack
@ -158,14 +156,18 @@ define([
return this.headerCaption;
},
setDocumentCaption: function(value, applyOnly) {
if (_.isUndefined(applyOnly)) {
this.documentCaption = value;
}
setDocumentCaption: function(value, isModified) {
if (isModified !== undefined)
this.isModified = isModified;
this.documentCaption = value;
if (!value)
value = '';
if (this.isModified)
value = value + '*';
var dc = $('#header-documentcaption div');
if (dc)
dc.html(Common.Utils.String.htmlEncode(value));
@ -223,10 +225,6 @@ define([
}
},
setDeveloperMode: function(mode) {
$('#header-developer').toggleClass('hidden', !mode);
},
setCanRename: function(rename) {
var dc = $('#header-documentcaption div');
if (rename) {
@ -257,7 +255,6 @@ define([
textBack: 'Go to Documents',
openNewTabText: 'Open in New Tab',
txtHeaderDeveloper: 'DEVELOPER MODE',
txtRename: 'Rename'
}, Common.Views.Header || {}))
});

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -72,7 +72,6 @@ define([
initialize: function(options) {
_.extend(this, options);
this.pluginsPath = '../../../../sdkjs-plugins/';
this._locked = false;
this._state = {
DisabledControls: true
@ -92,7 +91,7 @@ define([
enableKeyEvents: false,
itemTemplate: _.template([
'<div id="<%= id %>" class="item-plugins" style="display: block;">',
'<div class="plugin-icon" style="background-image: url(' + '<% if (variations[currentVariation].get("isRelativeUrl")) { if (baseUrl !=="") { %>' + '<%= baseUrl %>' + '<% } else { %>' + this.pluginsPath + '<% } } %>' + '<%= variations[currentVariation].get("icons")[(window.devicePixelRatio > 1) ? 1 : 0] %>);"></div>',
'<div class="plugin-icon" style="background-image: url(' + '<%= baseUrl %>' + '<%= variations[currentVariation].get("icons")[(window.devicePixelRatio > 1) ? 1 : 0] %>);"></div>',
'<% if (variations.length>1) { %>',
'<div class="plugin-caret img-commonctrl"></div>',
'<% } %>',

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -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
* modify it under the terms of the GNU Affero General Public License (AGPL)

View file

@ -295,7 +295,7 @@
height: 20px;
line-height: @line-height-base;
background-color: #EE3525;
margin: 18px 25px;
margin: 10px 18px;
padding: 2px 10px;
color: #fff;
overflow: hidden;

View file

@ -31,26 +31,43 @@
clear: left;
overflow: hidden;
& > div {
&.inline {
display: inline-block;
&.margin .group-items-container {
margin-right: 20px;
}
}
.group-items-container {
overflow: hidden;
margin-bottom: 5px;
& > div {
display: inline-block;
float: left;
margin: 4px;
cursor: pointer;
margin: 2px 4px 4px;
&:not(.disabled) {
cursor: pointer;
}
&.disabled {
opacity: 0.5;
}
.box-shadow(0 0 0 1px @gray);
&:hover,
&.selected {
&:hover:not(.disabled),
&.selected:not(.disabled) {
.box-shadow(0 0 0 2px @primary);
}
}
}
}
.header-name {
padding: 10px 2px 12px 4px;
font-weight: bold;
cursor: default;
}
}

View file

@ -46,34 +46,6 @@
}
}
#header-developer {
background-color: #ffb400;
padding-left: 15px + @app-header-height / 3;
& > div {
position: relative;
background-color: #ffb400;
color: #6e4e00 !important;
padding-right: 15px;
cursor: default;
z-index: 1;
white-space: nowrap;
height: @app-header-height;
line-height: @app-header-height;
&:after {
content: '';
position: absolute;
top: 0;
right: -@app-header-height / 2;
width: @app-header-height / 2;
height: @app-header-height;
border-top: @app-header-height / 2 solid transparent;
border-left: @app-header-height / 3 solid #ffb400;
border-bottom: @app-header-height / 2 solid transparent;
}
}
}
#header-documentcaption {
width: 100%;
max-width: 100px;

Some files were not shown because too many files have changed in this diff Show more