Add back old OO
After Width: | Height: | Size: 363 B |
After Width: | Height: | Size: 672 B |
After Width: | Height: | Size: 358 B |
After Width: | Height: | Size: 650 B |
@ -0,0 +1,17 @@
|
||||
plus.png
|
||||
x:6 y:6
|
||||
|
||||
plus_2x.png
|
||||
x:12 y:12
|
||||
|
||||
plus_copy.png
|
||||
x:6 y:12
|
||||
|
||||
plus_copy_2x.png
|
||||
x:12 y:25
|
||||
|
||||
text_copy.png
|
||||
x:2 y:11
|
||||
|
||||
text_copy_2x.png
|
||||
x:5 y:23
|
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 132 B |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 161 B |
After Width: | Height: | Size: 902 B |
After Width: | Height: | Size: 176 B |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 201 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 502 B |
After Width: | Height: | Size: 110 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 149 B |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 107 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 145 B |
After Width: | Height: | Size: 530 B |
After Width: | Height: | Size: 107 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 141 B |
After Width: | Height: | Size: 118 B |
After Width: | Height: | Size: 166 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 131 B |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 200 B |
After Width: | Height: | Size: 131 KiB |
After Width: | Height: | Size: 163 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 540 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 384 KiB |
After Width: | Height: | Size: 128 KiB |
After Width: | Height: | Size: 362 KiB |
After Width: | Height: | Size: 704 B |
After Width: | Height: | Size: 837 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1001 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 870 B |
@ -0,0 +1,736 @@
|
||||
/**
|
||||
* Copyright (c) Ascensio System SIA 2013. All rights reserved
|
||||
*
|
||||
* http://www.onlyoffice.com
|
||||
*/
|
||||
|
||||
;(function(DocsAPI, window, document, undefined) {
|
||||
|
||||
/*
|
||||
|
||||
# Full #
|
||||
|
||||
config = {
|
||||
type: 'desktop or mobile',
|
||||
width: '100% by default',
|
||||
height: '100% by default',
|
||||
documentType: 'text' | 'spreadsheet' | 'presentation',
|
||||
document: {
|
||||
title: 'document title',
|
||||
url: 'document url'
|
||||
fileType: 'document file type',
|
||||
options: <advanced options>,
|
||||
key: 'key',
|
||||
vkey: 'vkey',
|
||||
info: {
|
||||
author: 'author name',
|
||||
folder: 'path to document',
|
||||
created: '<creation date>',
|
||||
sharingSettings: [
|
||||
{
|
||||
user: 'user name',
|
||||
permissions: '<permissions>',
|
||||
isLink: false
|
||||
},
|
||||
...
|
||||
]
|
||||
},
|
||||
permissions: {
|
||||
edit: <can edit>, // default = true
|
||||
download: <can download>, // default = true
|
||||
reader: <can view in readable mode>,
|
||||
review: <can review>, // default = edit
|
||||
print: <can print>, // default = true
|
||||
rename: <can rename>, // default = false
|
||||
changeHistory: <can change history>, // default = false
|
||||
comment: <can comment in view mode> // default = edit
|
||||
}
|
||||
},
|
||||
editorConfig: {
|
||||
mode: 'view or edit',
|
||||
lang: <language code>,
|
||||
location: <location>,
|
||||
canCoAuthoring: <can coauthoring documents>,
|
||||
canBackToFolder: <can return to folder> - deprecated. use "customization.goback" parameter,
|
||||
createUrl: 'create document url',
|
||||
sharingSettingsUrl: 'document sharing settings url',
|
||||
fileChoiceUrl: 'mail merge sources url',
|
||||
callbackUrl: <url for connection between sdk and portal>,
|
||||
mergeFolderUrl: 'folder for saving merged file',
|
||||
licenseUrl: <url for license>,
|
||||
customerId: <customer id>,
|
||||
|
||||
user: {
|
||||
id: 'user id',
|
||||
name: 'user name'
|
||||
},
|
||||
recent: [
|
||||
{
|
||||
title: 'document title',
|
||||
url: 'document url',
|
||||
folder: 'path to document'
|
||||
},
|
||||
...
|
||||
],
|
||||
templates: [
|
||||
{
|
||||
name: 'template name',
|
||||
icon: 'template icon url',
|
||||
url: 'http://...'
|
||||
},
|
||||
...
|
||||
],
|
||||
customization: {
|
||||
logo: {
|
||||
image: url,
|
||||
imageEmbedded: url,
|
||||
url: http://...
|
||||
},
|
||||
backgroundColor: 'header background color',
|
||||
textColor: 'header text color',
|
||||
customer: {
|
||||
name: 'SuperPuper',
|
||||
address: 'New-York, 125f-25',
|
||||
mail: 'support@gmail.com',
|
||||
www: 'www.superpuper.com',
|
||||
info: 'Some info',
|
||||
logo: ''
|
||||
},
|
||||
about: true,
|
||||
feedback: {
|
||||
visible: false,
|
||||
url: http://...
|
||||
},
|
||||
goback: {
|
||||
url: 'http://...',
|
||||
text: 'Go to London'
|
||||
},
|
||||
chat: true,
|
||||
comments: true,
|
||||
zoom: 100,
|
||||
compactToolbar: false,
|
||||
leftMenu: true,
|
||||
rightMenu: true,
|
||||
toolbar: true,
|
||||
header: true,
|
||||
statusBar: true,
|
||||
autosave: true,
|
||||
forcesave: false,
|
||||
commentAuthorOnly: false,
|
||||
showReviewChanges: false
|
||||
},
|
||||
plugins: {
|
||||
autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}',
|
||||
url: '../../../../sdkjs-plugins/',
|
||||
pluginsData: [
|
||||
"helloworld/config.json",
|
||||
"chess/config.json",
|
||||
"speech/config.json",
|
||||
"clipart/config.json",
|
||||
]
|
||||
}
|
||||
},
|
||||
events: {
|
||||
'onReady': <application ready callback>, // deprecated
|
||||
'onAppReady': <application ready callback>,
|
||||
'onBack': <back to folder callback>,
|
||||
'onDocumentStateChange': <document state changed callback>
|
||||
'onDocumentReady': <document ready callback>
|
||||
}
|
||||
}
|
||||
|
||||
# Embedded #
|
||||
|
||||
config = {
|
||||
type: 'embedded',
|
||||
width: '100% by default',
|
||||
height: '100% by default',
|
||||
documentType: 'text' | 'spreadsheet' | 'presentation',
|
||||
document: {
|
||||
title: 'document title',
|
||||
url: 'document url',
|
||||
fileType: 'document file type',
|
||||
key: 'key',
|
||||
vkey: 'vkey'
|
||||
},
|
||||
editorConfig: {
|
||||
licenseUrl: <url for license>,
|
||||
customerId: <customer id>,
|
||||
autostart: 'document', // action for app's autostart. for presentations default value is 'player'
|
||||
embedded: {
|
||||
embedUrl: 'url',
|
||||
fullscreenUrl: 'url',
|
||||
saveUrl: 'url',
|
||||
shareUrl: 'url',
|
||||
toolbarDocked: 'top or bottom'
|
||||
}
|
||||
},
|
||||
events: {
|
||||
'onReady': <application ready callback>, // deprecated
|
||||
'onAppReady': <application ready callback>,
|
||||
'onBack': <back to folder callback>,
|
||||
'onError': <error callback>,
|
||||
'onDocumentReady': <document ready callback>
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// TODO: allow several instances on one page simultaneously
|
||||
|
||||
DocsAPI.DocEditor = function(placeholderId, config) {
|
||||
var _self = this,
|
||||
_config = config || {};
|
||||
|
||||
extend(_config, DocsAPI.DocEditor.defaultConfig);
|
||||
_config.editorConfig.canUseHistory = _config.events && !!_config.events.onRequestHistory;
|
||||
_config.editorConfig.canHistoryClose = _config.events && !!_config.events.onRequestHistoryClose;
|
||||
_config.editorConfig.canHistoryRestore = _config.events && !!_config.events.onRequestRestore;
|
||||
_config.editorConfig.canSendEmailAddresses = _config.events && !!_config.events.onRequestEmailAddresses;
|
||||
_config.editorConfig.canRequestEditRights = _config.events && !!_config.events.onRequestEditRights;
|
||||
_config.frameEditorId = placeholderId;
|
||||
|
||||
_config.events && !!_config.events.onReady && console.log("Obsolete: The onReady event is deprecated. Please use onAppReady instead.");
|
||||
_config.events && (_config.events.onAppReady = _config.events.onAppReady || _config.events.onReady);
|
||||
|
||||
var onMouseUp = function (evt) {
|
||||
_processMouse(evt);
|
||||
};
|
||||
|
||||
var _attachMouseEvents = function() {
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("mouseup", onMouseUp, false)
|
||||
} else if (window.attachEvent) {
|
||||
window.attachEvent("onmouseup", onMouseUp);
|
||||
}
|
||||
};
|
||||
|
||||
var _detachMouseEvents = function() {
|
||||
if (window.removeEventListener) {
|
||||
window.removeEventListener("mouseup", onMouseUp, false)
|
||||
} else if (window.detachEvent) {
|
||||
window.detachEvent("onmouseup", onMouseUp);
|
||||
}
|
||||
};
|
||||
|
||||
var _onAppReady = function() {
|
||||
if (_config.type === 'mobile') {
|
||||
document.body.onfocus = function(e) {
|
||||
setTimeout(function(){
|
||||
iframe.contentWindow.focus();
|
||||
|
||||
_sendCommand({
|
||||
command: 'resetFocus',
|
||||
data: {}
|
||||
})
|
||||
}, 10);
|
||||
};
|
||||
}
|
||||
|
||||
_attachMouseEvents();
|
||||
|
||||
if (_config.editorConfig) {
|
||||
_init(_config.editorConfig);
|
||||
}
|
||||
|
||||
if (_config.document) {
|
||||
_openDocument(_config.document);
|
||||
}
|
||||
};
|
||||
|
||||
var _callLocalStorage = function(data) {
|
||||
if (data.cmd == 'get') {
|
||||
if (data.keys && data.keys.length) {
|
||||
var af = data.keys.split(','), re = af[0];
|
||||
for (i = 0; ++i < af.length;)
|
||||
re += '|' + af[i];
|
||||
|
||||
re = new RegExp(re); k = {};
|
||||
for (i in localStorage)
|
||||
if (re.test(i)) k[i] = localStorage[i];
|
||||
} else {
|
||||
k = localStorage;
|
||||
}
|
||||
|
||||
_sendCommand({
|
||||
command: 'internalCommand',
|
||||
data: {
|
||||
type: 'localstorage',
|
||||
keys: k
|
||||
}
|
||||
});
|
||||
} else
|
||||
if (data.cmd == 'set') {
|
||||
var k = data.keys, i;
|
||||
for (i in k) {
|
||||
localStorage.setItem(i, k[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var _onMessage = function(msg) {
|
||||
if ( msg ) {
|
||||
if ( msg.type === "onExternalPluginMessage" ) {
|
||||
_sendCommand(msg);
|
||||
} else
|
||||
if ( msg.frameEditorId == placeholderId ) {
|
||||
var events = _config.events || {},
|
||||
handler = events[msg.event],
|
||||
res;
|
||||
|
||||
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 === 'onAppReady') {
|
||||
_onAppReady();
|
||||
}
|
||||
|
||||
if (handler && typeof handler == "function") {
|
||||
res = handler.call(_self, {target: _self, data: msg.data});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var _checkConfigParams = function() {
|
||||
if (_config.document) {
|
||||
if (!_config.document.url || ((typeof _config.document.fileType !== 'string' || _config.document.fileType=='') &&
|
||||
(typeof _config.documentType !== 'string' || _config.documentType==''))) {
|
||||
window.alert("One or more required parameter for the config object is not set");
|
||||
return false;
|
||||
}
|
||||
|
||||
var appMap = {
|
||||
'text': 'docx',
|
||||
'text-pdf': 'pdf',
|
||||
'spreadsheet': 'xlsx',
|
||||
'presentation': 'pptx'
|
||||
}, app;
|
||||
|
||||
if (typeof _config.documentType === 'string' && _config.documentType != '') {
|
||||
app = appMap[_config.documentType.toLowerCase()];
|
||||
if (!app) {
|
||||
window.alert("The \"documentType\" parameter for the config object is invalid. Please correct it.");
|
||||
return false;
|
||||
} else if (typeof _config.document.fileType !== 'string' || _config.document.fileType == '') {
|
||||
_config.document.fileType = app;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
|
||||
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott))$/
|
||||
.exec(_config.document.fileType);
|
||||
if (!type) {
|
||||
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
|
||||
return false;
|
||||
} else if (typeof _config.documentType !== 'string' || _config.documentType == ''){
|
||||
if (typeof type[1] === 'string') _config.documentType = 'spreadsheet'; else
|
||||
if (typeof type[2] === 'string') _config.documentType = 'presentation'; else
|
||||
if (typeof type[3] === 'string') _config.documentType = 'text';
|
||||
}
|
||||
}
|
||||
|
||||
var type = /^(?:(pdf|djvu|xps))$/.exec(_config.document.fileType);
|
||||
if (type && typeof type[1] === 'string') {
|
||||
_config.editorConfig.canUseHistory = false;
|
||||
}
|
||||
|
||||
if (!_config.document.title || _config.document.title=='')
|
||||
_config.document.title = 'Unnamed.' + _config.document.fileType;
|
||||
|
||||
if (!_config.document.key) {
|
||||
_config.document.key = 'xxxxxxxxxxxxxxxxxxxx'.replace(/[x]/g, function (c) {var r = Math.random() * 16 | 0; return r.toString(16);});
|
||||
} else if (typeof _config.document.key !== 'string') {
|
||||
window.alert("The \"document.key\" parameter for the config object must be string. Please correct it.");
|
||||
return false;
|
||||
}
|
||||
|
||||
_config.document.token = _config.token;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
(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;
|
||||
_config.editorConfig.canUseHistory = false;
|
||||
if (!_config.editorConfig.customization) _config.editorConfig.customization = {};
|
||||
_config.editorConfig.customization.about = false;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
var target = document.getElementById(placeholderId),
|
||||
iframe;
|
||||
|
||||
if (target && _checkConfigParams()) {
|
||||
iframe = createIframe(_config);
|
||||
target.parentNode && target.parentNode.replaceChild(iframe, target);
|
||||
var _msgDispatcher = new MessageDispatcher(_onMessage, this);
|
||||
}
|
||||
|
||||
/*
|
||||
cmd = {
|
||||
command: 'commandName',
|
||||
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);
|
||||
};
|
||||
|
||||
var _init = function(editorConfig) {
|
||||
_sendCommand({
|
||||
command: 'init',
|
||||
data: {
|
||||
config: editorConfig
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _openDocument = function(doc) {
|
||||
_sendCommand({
|
||||
command: 'openDocument',
|
||||
data: {
|
||||
doc: doc
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _showMessage = function(title, msg) {
|
||||
msg = msg || title;
|
||||
_sendCommand({
|
||||
command: 'showMessage',
|
||||
data: {
|
||||
msg: msg
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _applyEditRights = function(allowed, message) {
|
||||
_sendCommand({
|
||||
command: 'applyEditRights',
|
||||
data: {
|
||||
allowed: allowed,
|
||||
message: message
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _processSaveResult = function(result, message) {
|
||||
_sendCommand({
|
||||
command: 'processSaveResult',
|
||||
data: {
|
||||
result: result,
|
||||
message: message
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// TODO: remove processRightsChange, use denyEditingRights
|
||||
var _processRightsChange = function(enabled, message) {
|
||||
_sendCommand({
|
||||
command: 'processRightsChange',
|
||||
data: {
|
||||
enabled: enabled,
|
||||
message: message
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _denyEditingRights = function(message) {
|
||||
_sendCommand({
|
||||
command: 'processRightsChange',
|
||||
data: {
|
||||
enabled: false,
|
||||
message: message
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
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 _setEmailAddresses = function(data) {
|
||||
_sendCommand({
|
||||
command: 'setEmailAddresses',
|
||||
data: {
|
||||
data: data
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _processMailMerge = function(enabled, message) {
|
||||
_sendCommand({
|
||||
command: 'processMailMerge',
|
||||
data: {
|
||||
enabled: enabled,
|
||||
message: message
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _downloadAs = function() {
|
||||
_sendCommand({
|
||||
command: 'downloadAs'
|
||||
});
|
||||
};
|
||||
|
||||
var _processMouse = function(evt) {
|
||||
var r = iframe.getBoundingClientRect();
|
||||
var data = {
|
||||
type: evt.type,
|
||||
x: evt.x - r.left,
|
||||
y: evt.y - r.top,
|
||||
event: evt
|
||||
};
|
||||
|
||||
_sendCommand({
|
||||
command: 'processMouse',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
var _serviceCommand = function(command, data) {
|
||||
_sendCommand({
|
||||
command: 'internalCommand',
|
||||
data: {
|
||||
command: command,
|
||||
data: data
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
showMessage : _showMessage,
|
||||
processSaveResult : _processSaveResult,
|
||||
processRightsChange : _processRightsChange,
|
||||
denyEditingRights : _denyEditingRights,
|
||||
refreshHistory : _refreshHistory,
|
||||
setHistoryData : _setHistoryData,
|
||||
setEmailAddresses : _setEmailAddresses,
|
||||
processMailMerge : _processMailMerge,
|
||||
downloadAs : _downloadAs,
|
||||
serviceCommand : _serviceCommand,
|
||||
attachMouseEvents : _attachMouseEvents,
|
||||
detachMouseEvents : _detachMouseEvents,
|
||||
destroyEditor : _destroyEditor
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
DocsAPI.DocEditor.defaultConfig = {
|
||||
type: 'desktop',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
editorConfig: {
|
||||
lang: 'en',
|
||||
canCoAuthoring: true,
|
||||
customization: {
|
||||
about: true,
|
||||
feedback: false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
DocsAPI.DocEditor.version = function() {
|
||||
return '0.0.0';
|
||||
};
|
||||
|
||||
MessageDispatcher = function(fn, scope) {
|
||||
var _fn = fn,
|
||||
_scope = scope || window,
|
||||
eventFn = function(msg) {
|
||||
_onMessage(msg);
|
||||
};
|
||||
|
||||
var _bindEvents = function() {
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("message", eventFn, false)
|
||||
}
|
||||
else if (window.attachEvent) {
|
||||
window.attachEvent("onmessage", eventFn);
|
||||
}
|
||||
};
|
||||
|
||||
var _unbindEvents = function() {
|
||||
if (window.removeEventListener) {
|
||||
window.removeEventListener("message", eventFn, false)
|
||||
}
|
||||
else if (window.detachEvent) {
|
||||
window.detachEvent("onmessage", eventFn);
|
||||
}
|
||||
};
|
||||
|
||||
var _onMessage = function(msg) {
|
||||
// TODO: check message origin
|
||||
if (msg && window.JSON) {
|
||||
|
||||
try {
|
||||
var msg = window.JSON.parse(msg.data);
|
||||
if (_fn) {
|
||||
_fn.call(_scope, msg);
|
||||
}
|
||||
} catch(e) {}
|
||||
}
|
||||
};
|
||||
|
||||
_bindEvents.call(this);
|
||||
|
||||
return {
|
||||
unbindEvents: _unbindEvents
|
||||
}
|
||||
};
|
||||
|
||||
function getBasePath() {
|
||||
var scripts = document.getElementsByTagName('script'),
|
||||
match;
|
||||
|
||||
for (var i = scripts.length - 1; i >= 0; i--) {
|
||||
match = scripts[i].src.match(/(.*)api\/documents\/api.js/i);
|
||||
if (match) {
|
||||
return match[1];
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function getExtensionPath() {
|
||||
if ("undefined" == typeof(extensionParams) || null == extensionParams["url"])
|
||||
return null;
|
||||
return extensionParams["url"] + "apps/";
|
||||
}
|
||||
|
||||
function getAppPath(config) {
|
||||
var extensionPath = getExtensionPath(),
|
||||
path = extensionPath ? extensionPath : getBasePath(),
|
||||
appMap = {
|
||||
'text': 'documenteditor',
|
||||
'text-pdf': 'documenteditor',
|
||||
'spreadsheet': 'spreadsheeteditor',
|
||||
'presentation': 'presentationeditor'
|
||||
},
|
||||
app = appMap['text'];
|
||||
|
||||
if (typeof config.documentType === 'string') {
|
||||
app = appMap[config.documentType.toLowerCase()];
|
||||
} else
|
||||
if (!!config.document && typeof config.document.fileType === 'string') {
|
||||
var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm))$/
|
||||
.exec(config.document.fileType);
|
||||
if (type) {
|
||||
if (typeof type[1] === 'string') app = appMap['spreadsheet']; else
|
||||
if (typeof type[2] === 'string') app = appMap['presentation'];
|
||||
}
|
||||
}
|
||||
|
||||
path += app + "/";
|
||||
path += config.type === "mobile"
|
||||
? "mobile"
|
||||
: config.type === "embedded"
|
||||
? "embed"
|
||||
: "main";
|
||||
path += "/index.html";
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
function getAppParameters(config) {
|
||||
var params = "?_dc=0";
|
||||
|
||||
if (config.editorConfig && config.editorConfig.lang)
|
||||
params += "&lang=" + config.editorConfig.lang;
|
||||
|
||||
if (config.editorConfig && config.editorConfig.targetApp!=='desktop') {
|
||||
if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.loaderName) {
|
||||
if (config.editorConfig.customization.loaderName !== 'none') params += "&customer=" + config.editorConfig.customization.loaderName;
|
||||
} else
|
||||
params += "&customer=ONLYOFFICE";
|
||||
if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.loaderLogo) {
|
||||
if (config.editorConfig.customization.loaderLogo !== '') params += "&logo=" + config.editorConfig.customization.loaderLogo;
|
||||
}
|
||||
}
|
||||
|
||||
if (config.frameEditorId)
|
||||
params += "&frameEditorId=" + config.frameEditorId;
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
function createIframe(config) {
|
||||
var iframe = document.createElement("iframe");
|
||||
|
||||
iframe.src = getAppPath(config) + getAppParameters(config);
|
||||
iframe.width = config.width;
|
||||
iframe.height = config.height;
|
||||
iframe.align = "top";
|
||||
iframe.frameBorder = 0;
|
||||
iframe.name = "frameEditor";
|
||||
iframe.allowFullscreen = true;
|
||||
iframe.setAttribute("allowfullscreen",""); // for IE11
|
||||
iframe.setAttribute("onmousewheel",""); // for Safari on Mac
|
||||
return iframe;
|
||||
}
|
||||
|
||||
function postMessage(wnd, msg) {
|
||||
if (wnd && wnd.postMessage && window.JSON) {
|
||||
// TODO: specify explicit origin
|
||||
wnd.postMessage(window.JSON.stringify(msg), "*");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function extend(dest, src) {
|
||||
for (var prop in src) {
|
||||
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;
|
||||
}
|
||||
|
||||
})(window.DocsAPI = window.DocsAPI || {}, window, document);
|
||||
|
@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>ONLYOFFICE Documents</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="description" content="" />
|
||||
<meta name="keywords" content="" />
|
||||
<style type="text/css"></style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/sockjs/sockjs.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/xregexp/xregexp-all-min.js"></script>
|
||||
<script type="text/javascript" src="../../../../sdkjs/common/AllFonts.js"></script>
|
||||
<script type="text/javascript" src="../../../../sdkjs/word/sdk-all-min.js"></script>
|
||||
<script type="text/javascript" src="../../../../sdkjs/word/sdk-all.js"></script>
|
||||
<div id="editor_sdk">
|
||||
<script type="text/javascript">
|
||||
window['AscNotLoadAllScript'] = true;
|
||||
var editor = new Asc.asc_docs_api({
|
||||
'id-view' : 'editor_sdk'
|
||||
});
|
||||
editor.LoadFontsFromServer();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,346 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>ONLYOFFICE Documents</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=IE8"/>
|
||||
<meta name="description" content="" />
|
||||
<meta name="keywords" content="" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-touch-fullscreen" content="yes">
|
||||
|
||||
<style type="text/css">
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#wrap {
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<div id="placeholder"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="api.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
// Url parameters
|
||||
|
||||
var urlParams = getUrlParams(),
|
||||
cfg = getEditorConfig(urlParams),
|
||||
doc = getDocumentData(urlParams);
|
||||
|
||||
// Document Editor
|
||||
|
||||
var docEditor = new DocsAPI.DocEditor('placeholder', {
|
||||
type: urlParams['type'],
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
documentType: urlParams['doctype'] || 'text',
|
||||
document: doc,
|
||||
editorConfig: cfg,
|
||||
events: {
|
||||
'onReady': onDocEditorReady,
|
||||
'onDocumentStateChange': onDocumentStateChange,
|
||||
'onRequestEditRights': onRequestEditRights,
|
||||
'onRequestHistory': onRequestHistory,
|
||||
'onRequestHistoryData': onRequestHistoryData,
|
||||
'onRequestEmailAddresses': onRequestEmailAddresses,
|
||||
'onRequestStartMailMerge': onRequestStartMailMerge,
|
||||
'onRequestHistoryClose': onRequestHistoryClose,
|
||||
'onError': onError
|
||||
}
|
||||
});
|
||||
|
||||
// Document Editor event handlers
|
||||
|
||||
function onRequestEmailAddresses() {
|
||||
docEditor.setEmailAddresses({emailAddresses: ['aaa@mail.ru'], createEmailAccountUrl: 'http://ya.ru'});
|
||||
}
|
||||
|
||||
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,
|
||||
'versionGroup': 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': {
|
||||
'id': '8952d4ee-e8a5-42bf-11f0-6cd77801ec15',
|
||||
'name': 'Александр Трофимов'
|
||||
},
|
||||
'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,
|
||||
'versionGroup': 1,
|
||||
'key': 'wyX9AwRq_677SWKjhfk='
|
||||
},
|
||||
{
|
||||
'user': {
|
||||
id: '895255ee-e8a5-42bf-86f0-6cd77801ec15',
|
||||
name: 'Me'
|
||||
},
|
||||
'changes': null,
|
||||
'created': '2/21/2015 6:38 PM',
|
||||
'version': 3,
|
||||
'versionGroup': 2,
|
||||
'key': 'wyX9AwRq_677SWKjhfk='
|
||||
},
|
||||
{
|
||||
'user': {
|
||||
id: '8952d4ee-e8a5-42bf-11f0-6cd77801ec15',
|
||||
name: 'Александр Трофимов'
|
||||
},
|
||||
'changes': null,
|
||||
'created': '2/22/2015 6:37 PM',
|
||||
'version': 4,
|
||||
'versionGroup': 3,
|
||||
'key': 'wyX9AwRq_677SWKjhfk='
|
||||
},
|
||||
{
|
||||
'user': {
|
||||
id: '8952d4ee-e8a5-42bf-11f0-6cd33801ec15',
|
||||
name: 'Леонид Орлов'
|
||||
},
|
||||
'changes': null,
|
||||
'created': '2/24/2015 6:29 PM',
|
||||
'version': 5,
|
||||
'versionGroup': 3,
|
||||
'key': 'wyX9AwRq_677SWKjhfk='
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
function onRequestHistoryData(revision) {
|
||||
docEditor.setHistoryData(
|
||||
{
|
||||
'version': revision.data,
|
||||
'url': 'http://isa2',
|
||||
'urlDiff': 'http://isa2',
|
||||
'changesUrl': 'http://isa2'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function onRequestStartMailMerge() {
|
||||
docEditor.processMailMerge(true, 'some error message');
|
||||
}
|
||||
|
||||
function onRequestHistoryClose() {
|
||||
// reload page
|
||||
}
|
||||
|
||||
function onDocEditorReady(event) {
|
||||
if (event.target) {
|
||||
//console.log('Ready! Editor: ', event.target);
|
||||
}
|
||||
}
|
||||
|
||||
function onDocumentStateChange(event) {
|
||||
var isModified = event.data;
|
||||
//console.log(isModified);
|
||||
}
|
||||
|
||||
function onRequestEditRights(event) {
|
||||
// occurs whenever the user tryes to enter edit mode
|
||||
docEditor.applyEditRights(true, "Someone is editing this document right now. Please try again later.");
|
||||
}
|
||||
|
||||
function onError(event) {
|
||||
// critical error happened
|
||||
// examine event.data.errorCode and event.data.errorDescription for details
|
||||
}
|
||||
|
||||
function onDownloadAs(event) {
|
||||
// return url of downloaded doc
|
||||
// console.log(event.data);
|
||||
}
|
||||
|
||||
|
||||
// helpers
|
||||
|
||||
function getUrlParams() {
|
||||
var e,
|
||||
a = /\+/g, // Regex for replacing addition symbol with a space
|
||||
r = /([^&=]+)=?([^&]*)/g,
|
||||
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
|
||||
q = window.location.search.substring(1),
|
||||
urlParams = {};
|
||||
|
||||
while (e = r.exec(q))
|
||||
urlParams[d(e[1])] = d(e[2]);
|
||||
|
||||
return urlParams;
|
||||
}
|
||||
|
||||
function getDocumentData(urlParams) {
|
||||
return {
|
||||
key: urlParams["key"],
|
||||
url: urlParams["url"] || '_offline_',
|
||||
title: urlParams["title"],
|
||||
fileType: urlParams["filetype"],
|
||||
vkey: urlParams["vkey"],
|
||||
permissions: {
|
||||
edit: true,
|
||||
download: true,
|
||||
reader: true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function getEditorConfig(urlParams) {
|
||||
return {
|
||||
mode : urlParams["mode"] || 'edit',
|
||||
lang : urlParams["lang"] || 'en',
|
||||
canCoAuthoring : true,
|
||||
createUrl : 'http://www.example.com/create',
|
||||
|
||||
user: {
|
||||
id: urlParams["userid"] || 'uid-901', firstname: urlParams["userfname"] || 'Mitchell', lastname: urlParams["userlname"] || 'Hamish'
|
||||
},
|
||||
recent : [
|
||||
{title: 'Memory.docx', url: 'http://onlyoffice.com', folder: 'Document Editor'},
|
||||
{title: 'Description.doc', url: 'http://onlyoffice.com', folder: 'Document Editor'},
|
||||
{title: 'DocEditor_right.xsl', url: 'http://onlyoffice.com', folder: 'Spreadsheet Editor'},
|
||||
{title: 'api.rtf', url: 'http://onlyoffice.com', folder: 'Unnamed folder'}
|
||||
],
|
||||
// templates : [
|
||||
// {name: 'Contracts', icon: '../../api/documents/resources/templates/contracts.png', url: 'http://...'},
|
||||
// {name: 'Letter', icon: '../../api/documents/resources/templates/letter.png', url: 'http://...'},
|
||||
// {name: 'List', icon: '../../api/documents/resources/templates/list.png', url: 'http://...'},
|
||||
// {name: 'Plan', icon: '../../api/documents/resources/templates/plan.png', url: 'http://...'}
|
||||
// ],
|
||||
embedded : {
|
||||
embedUrl : 'http://onlyoffice.com/embed',
|
||||
fullscreenUrl : 'http://onlyoffice.com/fullscreen',
|
||||
saveUrl : 'http://onlyoffice.com/download',
|
||||
shareUrl : 'http://tl.com/72b4la97',
|
||||
toolbarDocked : 'top'
|
||||
}
|
||||
,customization: {
|
||||
// logo: {
|
||||
// image: 'https://dylnrgbh910l3.cloudfront.net/studio/tag/i8.8.237/skins/default/images/onlyoffice_logo/editor_logo_general.png', // default size 86 x 20
|
||||
// imageEmbedded: 'https://d2hw9csky753gb.cloudfront.net/studio/tag/i8.8.237/skins/default/images/onlyoffice_logo/editor_embedded_logo.png', // default size 124 x 20
|
||||
// url: 'http://...'
|
||||
// },
|
||||
// backgroundColor: '#ffffff',
|
||||
// textColor: '#ff0000',
|
||||
// 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' // default size 216 x 35
|
||||
// },
|
||||
// goback: {text: 'Go To London', url: 'http://...'},
|
||||
about: true,
|
||||
feedback: true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Mobile version
|
||||
|
||||
function isMobile(){
|
||||
var prefixes = {
|
||||
ios: 'i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS ',
|
||||
android: '(Android |HTC_|Silk/)',
|
||||
blackberry: 'BlackBerry(?:.*)Version\/',
|
||||
rimTablet: 'RIM Tablet OS ',
|
||||
webos: '(?:webOS|hpwOS)\/',
|
||||
bada: 'Bada\/'
|
||||
},
|
||||
i, prefix, match;
|
||||
|
||||
for (i in prefixes){
|
||||
if (prefixes.hasOwnProperty(i)) {
|
||||
prefix = prefixes[i];
|
||||
|
||||
if (navigator.userAgent.match(new RegExp('(?:'+prefix+')([^\\s;]+)')))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var fixSize = function() {
|
||||
var wrapEl = document.getElementById('wrap');
|
||||
if (wrapEl){
|
||||
wrapEl.style.height = screen.availHeight + 'px';
|
||||
window.scrollTo(0, -1);
|
||||
wrapEl.style.height = window.innerHeight + 'px';
|
||||
}
|
||||
};
|
||||
|
||||
var fixIpadLandscapeIos7 = function() {
|
||||
if (navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i)) {
|
||||
var wrapEl = document.getElementById('wrap');
|
||||
if (wrapEl){
|
||||
wrapEl.style.position = "fixed";
|
||||
wrapEl.style.bottom = 0;
|
||||
wrapEl.style.width = "100%";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (isMobile()){
|
||||
window.addEventListener('load', fixSize);
|
||||
window.addEventListener('resize', fixSize);
|
||||
|
||||
fixIpadLandscapeIos7();
|
||||
}
|
||||
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.6 KiB |
@ -0,0 +1,290 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>ONLYOFFICE Document Editor</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=IE8"/>
|
||||
<meta name="description" content="" />
|
||||
<meta name="keywords" content="" />
|
||||
<link rel="icon" href="resources/img/favicon.ico" type="image/x-icon" />
|
||||
|
||||
<!-- splash -->
|
||||
|
||||
<style type="text/css">
|
||||
.loadmask {
|
||||
left: 0;
|
||||
top: 0;
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
background-color: #f4f4f4;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.loader-page {
|
||||
width: 100%;
|
||||
height: 170px;
|
||||
bottom: 42%;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
line-height: 10px;
|
||||
}
|
||||
|
||||
.loader-logo {
|
||||
max-height: 160px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.loader-page-romb {
|
||||
width: 40px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.loader-page-text {
|
||||
width: 100%;
|
||||
bottom: 42%;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
color: #888;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.loader-page-text-loading {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.loader-page-text-customer {
|
||||
font-size: 16px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.romb {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
-webkit-transform: rotate(135deg) skew(20deg, 20deg);
|
||||
-moz-transform: rotate(135deg) skew(20deg, 20deg);
|
||||
-ms-transform: rotate(135deg) skew(20deg, 20deg);
|
||||
-o-transform: rotate(135deg) skew(20deg, 20deg);
|
||||
position: absolute;
|
||||
background: red;
|
||||
border-radius: 6px;
|
||||
-webkit-animation: movedown 3s infinite ease;
|
||||
-moz-animation: movedown 3s infinite ease;
|
||||
-ms-animation: movedown 3s infinite ease;
|
||||
-o-animation: movedown 3s infinite ease;
|
||||
animation: movedown 3s infinite ease;
|
||||
}
|
||||
|
||||
#blue {
|
||||
z-index: 3;
|
||||
background: #55bce6;
|
||||
-webkit-animation-name: blue;
|
||||
-moz-animation-name: blue;
|
||||
-ms-animation-name: blue;
|
||||
-o-animation-name: blue;
|
||||
animation-name: blue;
|
||||
}
|
||||
|
||||
#red {
|
||||
z-index:1;
|
||||
background: #de7a59;
|
||||
-webkit-animation-name: red;
|
||||
-moz-animation-name: red;
|
||||
-ms-animation-name: red;
|
||||
-o-animation-name: red;
|
||||
animation-name: red;
|
||||
}
|
||||
|
||||
#green {
|
||||
z-index: 2;
|
||||
background: #a1cb5c;
|
||||
-webkit-animation-name: green;
|
||||
-moz-animation-name: green;
|
||||
-ms-animation-name: green;
|
||||
-o-animation-name: green;
|
||||
animation-name: green;
|
||||
}
|
||||
|
||||
@-webkit-keyframes red {
|
||||
0% { top:120px; background: #de7a59; }
|
||||
10% { top:120px; background: #F2CBBF; }
|
||||
14% { background: #f4f4f4; top:120px; }
|
||||
15% { background: #f4f4f4; top:0;}
|
||||
20% { background: #E6E4E4; }
|
||||
30% { background: #D2D2D2; }
|
||||
40% { top:120px; }
|
||||
100% { top:120px; background: #de7a59; }
|
||||
}
|
||||
|
||||
@keyframes red {
|
||||
0% { top:120px; background: #de7a59; }
|
||||
10% { top:120px; background: #F2CBBF; }
|
||||
14% { background: #f4f4f4; top:120px; }
|
||||
15% { background: #f4f4f4; top:0; }
|
||||
20% { background: #E6E4E4; }
|
||||
30% { background: #D2D2D2; }
|
||||
40% { top:120px; }
|
||||
100% { top:120px; background: #de7a59; }
|
||||
}
|
||||
|
||||
@-webkit-keyframes green {
|
||||
0% { top:110px; background: #a1cb5c; opacity:1; }
|
||||
10% { top:110px; background: #CBE0AC; opacity:1; }
|
||||
14% { background: #f4f4f4; top:110px; opacity:1; }
|
||||
15% { background: #f4f4f4; top:0; opacity:1; }
|
||||
20% { background: #f4f4f4; top:0; opacity:0; }
|
||||
25% { background: #EFEFEF; top:0; opacity:1; }
|
||||
30% { background:#E6E4E4; }
|
||||
70% { top:110px; }
|
||||
100% { top:110px; background: #a1cb5c; }
|
||||
}
|
||||
|
||||
@keyframes green {
|
||||
0% { top:110px; background: #a1cb5c; opacity:1; }
|
||||
10% { top:110px; background: #CBE0AC; opacity:1; }
|
||||
14% { background: #f4f4f4; top:110px; opacity:1; }
|
||||
15% { background: #f4f4f4; top:0; opacity:1; }
|
||||
20% { background: #f4f4f4; top:0; opacity:0; }
|
||||
25% { background: #EFEFEF; top:0; opacity:1; }
|
||||
30% { background:#E6E4E4; }
|
||||
70% { top:110px; }
|
||||
100% { top:110px; background: #a1cb5c; }
|
||||
}
|
||||
|
||||
@-webkit-keyframes blue {
|
||||
0% { top:100px; background: #55bce6; opacity:1; }
|
||||
10% { top:100px; background: #BFE8F8; opacity:1; }
|
||||
14% { background: #f4f4f4; top:100px; opacity:1; }
|
||||
15% { background: #f4f4f4; top:0; opacity:1; }
|
||||
20% { background: #f4f4f4; top:0; opacity:0; }
|
||||
25% { background: #f4f4f4; top:0; opacity:0; }
|
||||
45% { background: #EFEFEF; top:0; opacity:0,2; }
|
||||
100% { top:100px; background: #55bce6; }
|
||||
}
|
||||
|
||||
@keyframes blue {
|
||||
0% { top:100px; background: #55bce6; opacity:1; }
|
||||
10% { top:100px; background: #BFE8F8; opacity:1; }
|
||||
14% { background: #f4f4f4; top:100px; opacity:1; }
|
||||
15% { background: #f4f4f4; top:0; opacity:1; }
|
||||
20% { background: #f4f4f4; top:0; opacity:0; }
|
||||
25% { background: #f4f4f4; top:0; opacity:0; }
|
||||
45% { background: #EFEFEF; top:0; opacity:0,2; }
|
||||
100% { top:100px; background: #55bce6; }
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
var userAgent = navigator.userAgent.toLowerCase(),
|
||||
check = function(regex){ return regex.test(userAgent); },
|
||||
stopLoading = false;
|
||||
if (!check(/opera/) && (check(/msie/) || check(/trident/))) {
|
||||
var m = /msie (\d+\.\d+)/.exec(userAgent);
|
||||
if (m && parseFloat(m[1]) < 9.0) {
|
||||
document.write('<div class="app-error-panel">' +
|
||||
'<div class="message-block">' +
|
||||
'<div class="message-inner">' +
|
||||
'<div class="title">Your browser is not supported.</div>' +
|
||||
'<div class="text">Sorry, Document Editor is currently only supported in the latest versions of the Chrome, Firefox, Safari or Internet Explorer web browsers.</div>' +
|
||||
'</div>' +
|
||||
'</div></div>');
|
||||
stopLoading = true;
|
||||
}
|
||||
}
|
||||
|
||||
function getUrlParams() {
|
||||
var e,
|
||||
a = /\+/g, // Regex for replacing addition symbol with a space
|
||||
r = /([^&=]+)=?([^&]*)/g,
|
||||
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
|
||||
q = window.location.search.substring(1),
|
||||
urlParams = {};
|
||||
|
||||
while (e = r.exec(q))
|
||||
urlParams[d(e[1])] = d(e[2]);
|
||||
|
||||
return urlParams;
|
||||
}
|
||||
|
||||
function encodeUrlParam(str) {
|
||||
return str.replace(/&/g, '&')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
logo = params["logo"] ? ((params["logo"] !== 'none') ? ('<img src="' + encodeUrlParam(params["logo"]) + '" class="loader-logo" />') : '') : null;
|
||||
|
||||
window.frameEditorId = params["frameEditorId"];
|
||||
|
||||
if ( lang == 'de') loading = 'Ladevorgang...';
|
||||
else if ( lang == 'es') loading = 'Cargando...';
|
||||
else if ( lang == 'fr') loading = 'Chargement en cours...';
|
||||
else if ( lang == 'it') loading = 'Caricamento in corso...';
|
||||
else if ( lang == 'pt') loading = 'Carregando...';
|
||||
else if ( lang == 'ru') loading = 'Загрузка...';
|
||||
else if ( lang == 'sl') loading = 'Nalaganje...';
|
||||
else if ( lang == 'tr') loading = 'Yükleniyor...';
|
||||
|
||||
if ( !stopLoading )
|
||||
document.write(
|
||||
'<div id="loading-mask" class="loadmask">' +
|
||||
'<div class="loader-page" style="margin-bottom: ' + margin + 'px;' + ((logo!==null) ? 'height: auto;' : '') + '">' +
|
||||
((logo!==null) ? logo :
|
||||
'<div class="loader-page-romb">' +
|
||||
'<div class="romb" id="blue"></div>' +
|
||||
'<div class="romb" id="green"></div>' +
|
||||
'<div class="romb" id="red"></div>' +
|
||||
'</div>') +
|
||||
'</div>' +
|
||||
'<div class="loader-page-text">' + customer +
|
||||
'<div class="loader-page-text-loading">' + loading + '</div>' +
|
||||
'</div>' +
|
||||
'</div>');
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../../apps/documenteditor/main/resources/css/app.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script>
|
||||
window.requireTimeourError = function(){
|
||||
var reqerr;
|
||||
|
||||
if ( lang == 'de') reqerr = 'Die Verbindung ist zu langsam, einige Komponenten konnten nicht geladen werden. Aktualisieren Sie bitte die Seite.';
|
||||
else if ( lang == 'es') reqerr = 'La conexión es muy lenta, algunos de los componentes no han podido cargar. Por favor recargue la página.';
|
||||
else if ( lang == 'fr') reqerr = 'La connexion est trop lente, certains des composants n\'ons pas pu être chargé. Veuillez recharger la page.';
|
||||
else if ( lang == 'ru') reqerr = 'Слишком медленное соединение, не удается загрузить некоторые компоненты. Пожалуйста, обновите страницу.';
|
||||
else reqerr = 'The connection is too slow, some of the components could not be loaded. Please reload the page.';
|
||||
|
||||
return reqerr;
|
||||
};
|
||||
|
||||
var requireTimeoutID = setTimeout(function(){
|
||||
window.alert(window.requireTimeourError());
|
||||
window.location.reload();
|
||||
}, 30000);
|
||||
|
||||
var require = {
|
||||
waitSeconds: 30,
|
||||
callback: function(){
|
||||
clearTimeout(requireTimeoutID);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<div id="viewport"></div>
|
||||
<script data-main="app" src="../../../vendor/requirejs/require.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|