bug fix
This commit is contained in:
@@ -68,16 +68,30 @@
|
||||
},
|
||||
...
|
||||
],
|
||||
branding: {
|
||||
customization: {
|
||||
logoUrl: 'header logo url', // default size 88 x 30
|
||||
logoUrlEmbedded: 'header logo url', // default size 88 x 30
|
||||
backgroundColor: 'header background color',
|
||||
textColor: 'header text color',
|
||||
customer: 'SuperPuper',
|
||||
customerAddr: 'New-York, 125f-25',
|
||||
customerMail: 'support@gmail.com',
|
||||
customerWww: 'www.superpuper.com',
|
||||
customerInfo: 'Some info',
|
||||
customerLogo: ''
|
||||
customer: {
|
||||
name: 'SuperPuper',
|
||||
address: 'New-York, 125f-25',
|
||||
mail: 'support@gmail.com',
|
||||
www: 'www.superpuper.com',
|
||||
info: 'Some info',
|
||||
logo: ''
|
||||
},
|
||||
about: false,
|
||||
feedback: {
|
||||
visible: false,
|
||||
url: http://...
|
||||
},
|
||||
goback: {
|
||||
visible: false,
|
||||
text: 'Go to London'
|
||||
},
|
||||
chat: false,
|
||||
comments: false
|
||||
}
|
||||
},
|
||||
events: {
|
||||
@@ -126,8 +140,8 @@
|
||||
_config = config || {};
|
||||
|
||||
extend(_config, DocsAPI.DocEditor.defaultConfig);
|
||||
extend(_config.editorConfig, DocsAPI.DocEditor.defaultConfig.editorConfig);
|
||||
_config.editorConfig.canBackToFolder = !!_config.events.onBack;
|
||||
_config.editorConfig.canBackToFolder = _config.events && !!_config.events.onBack;
|
||||
_config.editorConfig.canUseHistory = !!_config.events.onRequestHistory;
|
||||
|
||||
var onMouseUp = function (evt) {
|
||||
_processMouse(evt);
|
||||
@@ -286,6 +300,26 @@
|
||||
});
|
||||
};
|
||||
|
||||
var _refreshHistory = function(data, message) {
|
||||
_sendCommand({
|
||||
command: 'refreshHistory',
|
||||
data: {
|
||||
data: data,
|
||||
message: message
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _setHistoryData = function(data, message) {
|
||||
_sendCommand({
|
||||
command: 'setHistoryData',
|
||||
data: {
|
||||
data: data,
|
||||
message: message
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _processMouse = function(evt) {
|
||||
var r = iframe.getBoundingClientRect();
|
||||
var data = {
|
||||
@@ -310,12 +344,24 @@
|
||||
});
|
||||
};
|
||||
|
||||
(function() {
|
||||
var result = /[\?\&]placement=(\w+)&?/.exec(window.location.search);
|
||||
if (!!result && result.length) {
|
||||
if (result[1] == 'desktop') {
|
||||
_config.editorConfig.targetApp = result[1];
|
||||
_config.editorConfig.canBackToFolder = false;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
return {
|
||||
showError : _showError,
|
||||
showMessage : _showMessage,
|
||||
applyEditRights : _applyEditRights,
|
||||
processSaveResult : _processSaveResult,
|
||||
processRightsChange : _processRightsChange,
|
||||
refreshHistory : _refreshHistory,
|
||||
setHistoryData : _setHistoryData,
|
||||
serviceCommand : _serviceCommand,
|
||||
attachMouseEvents : _attachMouseEvents,
|
||||
detachMouseEvents : _detachMouseEvents
|
||||
@@ -329,12 +375,16 @@
|
||||
height: '100%',
|
||||
editorConfig: {
|
||||
lang: 'en',
|
||||
canCoAuthoring: true
|
||||
canCoAuthoring: true,
|
||||
customization: {
|
||||
about: false,
|
||||
feedback: false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
DocsAPI.DocEditor.version = function() {
|
||||
return '3.0b';
|
||||
return '3.0b##BN#';
|
||||
};
|
||||
|
||||
MessageDispatcher = function(fn, scope) {
|
||||
@@ -441,6 +491,7 @@
|
||||
iframe.height = config.height;
|
||||
iframe.align = "top";
|
||||
iframe.frameBorder = 0;
|
||||
iframe.name = "frameEditor";
|
||||
|
||||
return iframe;
|
||||
}
|
||||
@@ -455,8 +506,14 @@
|
||||
|
||||
function extend(dest, src) {
|
||||
for (var prop in src) {
|
||||
if (src.hasOwnProperty(prop) && typeof dest[prop] === 'undefined') {
|
||||
dest[prop] = src[prop];
|
||||
if (src.hasOwnProperty(prop)) {
|
||||
if (typeof dest[prop] === 'undefined') {
|
||||
dest[prop] = src[prop];
|
||||
} else
|
||||
if (typeof dest[prop] === 'object' &&
|
||||
typeof src[prop] === 'object') {
|
||||
extend(dest[prop], src[prop])
|
||||
}
|
||||
}
|
||||
}
|
||||
return dest;
|
||||
|
||||
@@ -62,12 +62,112 @@
|
||||
'onBack': onBack,
|
||||
'onDocumentStateChange': onDocumentStateChange,
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
// 'onRequestHistory': onRequestHistory,
|
||||
// 'onRequestHistoryData': onRequestHistoryData,
|
||||
// 'onRequestHistoryClose': onRequestHistoryClose,
|
||||
'onSave': onDocumentSave,
|
||||
'onError': onError
|
||||
}
|
||||
});
|
||||
|
||||
// Document Editor event handlers
|
||||
function onRequestHistory() {
|
||||
docEditor.refreshHistory({
|
||||
'currentVersion': 3,
|
||||
'history': [
|
||||
{
|
||||
'user': {
|
||||
id: '8952d4ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||
name: 'Татьяна Щербакова'
|
||||
},
|
||||
'changes': null,
|
||||
'created': '1/18/2015 6:38 PM',
|
||||
'version': 1,
|
||||
'version_group': 1,
|
||||
'key': 'wyX9AwRq_677SWKjhfk='
|
||||
},
|
||||
{
|
||||
'user': {
|
||||
id: '8952d4ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||
name: 'Татьяна Щербакова'
|
||||
},
|
||||
'changes': [
|
||||
{
|
||||
'user': {
|
||||
id: '8952d4ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||
name: 'Татьяна Щербакова'
|
||||
},
|
||||
'created': '1/19/2015 6:30 PM'
|
||||
},
|
||||
{
|
||||
'user': {
|
||||
'userid': '8952d4ee-e8a5-42bf-11f0-6cd77801ec15',
|
||||
'username': 'Александр Трофимов'
|
||||
},
|
||||
'created': '1/19/2015 6:32 PM'
|
||||
},
|
||||
{
|
||||
'user': {
|
||||
id: '8952d4ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||
name: 'Татьяна Щербакова'
|
||||
},
|
||||
'created': '1/19/2015 6:38 PM'
|
||||
}
|
||||
],
|
||||
'created': '2/19/2015 6:38 PM',
|
||||
'version': 2,
|
||||
'version_group': 1,
|
||||
'key': 'wyX9AwRq_677SWKjhfk='
|
||||
},
|
||||
{
|
||||
'user': {
|
||||
id: '895255ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||
name: 'Me'
|
||||
},
|
||||
'changes': null,
|
||||
'created': '2/21/2015 6:38 PM',
|
||||
'version': 3,
|
||||
'version_group': 2,
|
||||
'key': 'wyX9AwRq_677SWKjhfk='
|
||||
},
|
||||
{
|
||||
'user': {
|
||||
id: '8952d4ee-e8a5-42bf-11f0-6cd77801ec15',
|
||||
name: 'Александр Трофимов'
|
||||
},
|
||||
'changes': null,
|
||||
'created': '2/22/2015 6:37 PM',
|
||||
'version': 4,
|
||||
'version_group': 3,
|
||||
'key': 'wyX9AwRq_677SWKjhfk='
|
||||
},
|
||||
{
|
||||
'user': {
|
||||
id: '8952d4ee-e8a5-42bf-11f0-6cd33801ec15',
|
||||
name: 'Леонид Орлов'
|
||||
},
|
||||
'changes': null,
|
||||
'created': '2/24/2015 6:29 PM',
|
||||
'version': 5,
|
||||
'version_group': 3,
|
||||
'key': 'wyX9AwRq_677SWKjhfk='
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
function onRequestHistoryData(revision) {
|
||||
docEditor.setHistoryData(
|
||||
{
|
||||
'version': revision.data,
|
||||
'url': 'http://isa2',
|
||||
'urlDiff': 'http://isa2'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function onRequestHistoryClose() {
|
||||
// reload page
|
||||
}
|
||||
|
||||
function onDocEditorReady(event) {
|
||||
if (event.target) {
|
||||
@@ -163,17 +263,23 @@
|
||||
shareUrl : 'http://tl.com/72b4la97',
|
||||
toolbarDocked : 'top'
|
||||
}
|
||||
// ,branding: {
|
||||
,customization: {
|
||||
// logoUrl: 'header logo url', // default size 88 x 30
|
||||
// logoUrlEmbedded: 'header logo url', // default size 88 x 30
|
||||
// backgroundColor: '#ffffff',
|
||||
// textColor: '#ff0000',
|
||||
// customer: 'SuperPuper',
|
||||
// customerAddr: 'New-York, 125f-25',
|
||||
// customerMail: 'support@gmail.com',
|
||||
// customerWww: 'www.superpuper.com',
|
||||
// customerInfo: 'Some info',
|
||||
// customerLogo: 'https://img.imgsmail.ru/r/default/portal/0.1.29/logo.png'
|
||||
// }
|
||||
// customer: {
|
||||
// name: 'SuperPuper',
|
||||
// address: 'New-York, 125f-25',
|
||||
// mail: 'support@gmail.com',
|
||||
// www: 'www.superpuper.com',
|
||||
// info: 'Some info',
|
||||
// logo: 'https://img.imgsmail.ru/r/default/portal/0.1.29/logo.png'
|
||||
// },
|
||||
// goback: {text: 'Go To London'}
|
||||
about: true,
|
||||
feedback: true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user