Merge remote-tracking branch 'origin/staging' into staging
|
@ -8,6 +8,7 @@ www/common/jquery-ui/
|
|||
www/common/onlyoffice/sdkjs
|
||||
www/common/onlyoffice/web-apps
|
||||
www/common/onlyoffice/x2t
|
||||
www/common/onlyoffice/v1
|
||||
|
||||
server.js
|
||||
www/common/old-media-tag.js
|
||||
|
|
|
@ -55,6 +55,7 @@ define([
|
|||
|
||||
var CHECKPOINT_INTERVAL = 50;
|
||||
var DISPLAY_RESTORE_BUTTON = false;
|
||||
var NEW_VERSION = 2;
|
||||
|
||||
var debug = function (x) {
|
||||
if (!window.CP_DEV_MODE) { return; }
|
||||
|
@ -79,7 +80,8 @@ define([
|
|||
var content = {
|
||||
hashes: {},
|
||||
ids: {},
|
||||
mediasSources: {}
|
||||
mediasSources: {},
|
||||
version: NEW_VERSION
|
||||
};
|
||||
var oldHashes = {};
|
||||
var oldIds = {};
|
||||
|
@ -270,11 +272,23 @@ define([
|
|||
};
|
||||
oldHashes = JSON.parse(JSON.stringify(content.hashes));
|
||||
content.saveLock = undefined;
|
||||
// If this is a migration, set the new version
|
||||
if (APP.migrate) {
|
||||
delete content.migration;
|
||||
content.version = NEW_VERSION;
|
||||
}
|
||||
APP.onLocal();
|
||||
APP.realtime.onSettle(function () {
|
||||
fixSheets();
|
||||
UI.log(Messages.saved);
|
||||
APP.realtime.onSettle(function () {
|
||||
if (APP.migrate) {
|
||||
UI.removeModals();
|
||||
UI.alert(Messages.oo_sheetMigration_complete, function () {
|
||||
common.gotoURL();
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (ev.callback) {
|
||||
return void ev.callback();
|
||||
}
|
||||
|
@ -313,6 +327,7 @@ define([
|
|||
APP.FM.handleFile(blob, data);
|
||||
};
|
||||
var makeCheckpoint = function (force) {
|
||||
if (!common.isLoggedIn()) { return; }
|
||||
var locked = content.saveLock;
|
||||
if (!locked || !isUserOnline(locked) || force) {
|
||||
content.saveLock = myOOId;
|
||||
|
@ -520,6 +535,16 @@ define([
|
|||
type: "documentOpen",
|
||||
data: {"type":"open","status":"ok","data":{"Editor.bin":obj.openCmd.url}}
|
||||
});
|
||||
if (APP.migrate && !readOnly) {
|
||||
var div = h('div.cp-oo-x2tXls', [
|
||||
h('span.fa.fa-spin.fa-spinner'),
|
||||
h('span', Messages.oo_sheetMigration_loading)
|
||||
]);
|
||||
UI.openCustomModal(UI.dialog.customModal(div, {buttons: []}));
|
||||
setTimeout(function () {
|
||||
makeCheckpoint(true);
|
||||
}, 1000);
|
||||
}
|
||||
// Update current index
|
||||
var last = ooChannel.queue.pop();
|
||||
if (last) { ooChannel.lastHash = last.hash; }
|
||||
|
@ -696,7 +721,7 @@ define([
|
|||
var startOO = function (blob, file) {
|
||||
if (APP.ooconfig) { return void console.error('already started'); }
|
||||
var url = URL.createObjectURL(blob);
|
||||
var lock = readOnly;// || !common.isLoggedIn();
|
||||
var lock = readOnly || APP.migrate;
|
||||
|
||||
// Config
|
||||
APP.ooconfig = {
|
||||
|
@ -748,7 +773,13 @@ define([
|
|||
'#file-menu-panel { top: 28px !important; }' + // Position of the "File" menu
|
||||
'#left-btn-spellcheck, #left-btn-about { display: none !important; }'+
|
||||
'div.btn-users.dropdown-toggle { display: none; !important }';
|
||||
if (readOnly) {
|
||||
css += '#toolbar { display: none !important; }';
|
||||
}
|
||||
$('<style>').text(css).appendTo($tb);
|
||||
setTimeout(function () {
|
||||
$(window).trigger('resize');
|
||||
});
|
||||
if (UI.findOKButton().length) {
|
||||
UI.findOKButton().on('focusout', function () {
|
||||
window.setTimeout(function () { UI.findOKButton().focus(); });
|
||||
|
@ -1360,7 +1391,7 @@ define([
|
|||
});
|
||||
$rightside.append($forget);
|
||||
|
||||
var helpMenu = common.createHelpMenu(['beta', 'oo']);
|
||||
var helpMenu = APP.helpMenu = common.createHelpMenu(['beta', 'oo']);
|
||||
$('#cp-app-oo-editor').prepend(common.getBurnAfterReadingWarning());
|
||||
$('#cp-app-oo-editor').prepend(helpMenu.menu);
|
||||
toolbar.$drawer.append(helpMenu.button);
|
||||
|
@ -1402,6 +1433,28 @@ define([
|
|||
Title.updateTitle(Title.defaultTitle);
|
||||
}
|
||||
|
||||
var version = '';
|
||||
// Old version detected: use the old OO and start the migration if we can
|
||||
if (content && !content.version) {
|
||||
version = 'v1/';
|
||||
APP.migrate = true;
|
||||
// Registedred users can start the migration
|
||||
if (common.isLoggedIn()) {
|
||||
content.migration = true;
|
||||
APP.onLocal();
|
||||
} else {
|
||||
var msg = h('div.alert.alert-warning.cp-burn-after-reading', Messages.oo_sheetMigration_anonymousEditor);
|
||||
$(APP.helpMenu.menu).after(msg);
|
||||
readOnly = true;
|
||||
}
|
||||
}
|
||||
|
||||
var s = h('script', {
|
||||
type:'text/javascript',
|
||||
src: '/common/onlyoffice/'+version+'web-apps/apps/api/documents/api.js'
|
||||
});
|
||||
$('#cp-app-oo-editor').append(s);
|
||||
|
||||
if (metadataMgr.getPrivateData().burnAfterReading && content && content.channel) {
|
||||
sframeChan.event('EV_BURN_PAD', content.channel);
|
||||
}
|
||||
|
@ -1423,6 +1476,7 @@ define([
|
|||
});
|
||||
};
|
||||
|
||||
var reloadPopup = false;
|
||||
config.onRemote = function () {
|
||||
if (initializing) { return; }
|
||||
var userDoc = APP.realtime.getUserDoc();
|
||||
|
@ -1430,6 +1484,9 @@ define([
|
|||
if (json.metadata) {
|
||||
metadataMgr.updateMetadata(json.metadata);
|
||||
}
|
||||
|
||||
var wasMigrating = content.migration;
|
||||
|
||||
content = json.content;
|
||||
if (content.hashes) {
|
||||
var latest = getLastCp(true);
|
||||
|
@ -1451,6 +1508,15 @@ define([
|
|||
handleNewLocks(oldLocks, content.locks);
|
||||
oldLocks = JSON.parse(JSON.stringify(content.locks));
|
||||
}
|
||||
if (content.migration) {
|
||||
setEditable(false);
|
||||
}
|
||||
if (wasMigrating && !content.migration && !reloadPopup) {
|
||||
reloadPopup = true;
|
||||
UI.alert(Messages.oo_sheetMigration_complete, function () {
|
||||
common.gotoURL();
|
||||
});
|
||||
}
|
||||
pinImages();
|
||||
};
|
||||
|
||||
|
|
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 102 KiB |
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1,110 @@
|
|||
@charset "UTF-8";
|
||||
|
||||
/*
|
||||
* Worksheet canvas
|
||||
* --------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ws-canvas-outer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#ws-canvas {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#ws-canvas-overlay, #ws-canvas-graphic, #ws-canvas-graphic-overlay {
|
||||
border: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Worksheet scroll bars
|
||||
* --------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ws-v-scrollbar {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
width: 19px;
|
||||
top: -1px;
|
||||
bottom: 18px;
|
||||
overflow: hidden;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
#ws-v-scroll-helper {
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
#ws-h-scrollbar {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
height: 19px;
|
||||
left: 0;
|
||||
right: 18px;
|
||||
overflow: hidden;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
#ws-h-scroll-helper {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
#ws-scrollbar-corner {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-color: #DCE2E8;
|
||||
border: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* Scrollbars common */
|
||||
|
||||
#ws-v-scrollbar .jspVerticalBar,
|
||||
#ws-h-scrollbar .jspHorizontalBar,
|
||||
#ws-v-scrollbar .jspTrack,
|
||||
#ws-h-scrollbar .jspTrack {
|
||||
background-color: #DCE2E8;
|
||||
}
|
||||
|
||||
#ws-v-scrollbar .jspDrag,
|
||||
#ws-h-scrollbar .jspDrag {
|
||||
background-color: #C0C0C0;
|
||||
}
|
||||
#ws-v-scrollbar .jspDrag.jspHover,
|
||||
#ws-v-scrollbar .jspDrag.jspActive,
|
||||
#ws-h-scrollbar .jspDrag.jspHover,
|
||||
#ws-h-scrollbar .jspDrag.jspActive {
|
||||
background-color: #808080;
|
||||
}
|
||||
|
||||
/* Vertical scrollbar */
|
||||
|
||||
#ws-v-scrollbar .jspVerticalBar {
|
||||
width: 7px;
|
||||
border-left: 1px solid #C1C6CC;
|
||||
}
|
||||
#ws-v-scrollbar .jspTrack {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
/* Horizontal scrollbar */
|
||||
|
||||
#ws-h-scrollbar .jspHorizontalBar {
|
||||
height: 7px;
|
||||
border-top: 1px solid #C1C6CC;
|
||||
}
|
||||
#ws-h-scrollbar .jspTrack {
|
||||
height: 8px;
|
||||
}
|
|
@ -0,0 +1,156 @@
|
|||
@charset "UTF-8";
|
||||
|
||||
/*
|
||||
* Worksheet canvas
|
||||
* --------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ws-canvas-outer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 14px;
|
||||
bottom: 14px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#ws-canvas {
|
||||
border: 0;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
#ws-canvas-overlay, #ws-canvas-graphic, #ws-canvas-graphic-overlay {
|
||||
-webkit-user-select: none;
|
||||
border: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Worksheet scroll bars
|
||||
* --------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ws-v-scrollbar {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
width: 14px;
|
||||
top: 0px;
|
||||
bottom: 14px;
|
||||
overflow: hidden;
|
||||
z-index: 10;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
#ws-v-scroll-helper {
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
#ws-h-scrollbar {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
height: 14px;
|
||||
left: 0px;
|
||||
right: 14px;
|
||||
overflow: hidden;
|
||||
z-index: 10;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
#ws-h-scroll-helper {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
#ws-scrollbar-corner {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background-color: #F4F4F4;
|
||||
border: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* Scrollbars common */
|
||||
|
||||
#ws-v-scrollbar .jspVerticalBar,
|
||||
#ws-h-scrollbar .jspHorizontalBar,
|
||||
#ws-v-scrollbar .jspTrack,
|
||||
#ws-h-scrollbar .jspTrack {
|
||||
background-color: #DCE2E8;
|
||||
}
|
||||
|
||||
#ws-v-scrollbar .jspDrag,
|
||||
#ws-h-scrollbar .jspDrag {
|
||||
background-color: #C0C0C0;
|
||||
}
|
||||
#ws-v-scrollbar .jspDrag.jspHover,
|
||||
#ws-v-scrollbar .jspDrag.jspActive,
|
||||
#ws-h-scrollbar .jspDrag.jspHover,
|
||||
#ws-h-scrollbar .jspDrag.jspActive {
|
||||
background-color: #808080;
|
||||
}
|
||||
|
||||
/* Vertical scrollbar */
|
||||
|
||||
#ws-v-scrollbar .jspVerticalBar {
|
||||
width: 7px;
|
||||
border-left: 1px solid #C1C6CC;
|
||||
}
|
||||
#ws-v-scrollbar .jspTrack {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
/* Horizontal scrollbar */
|
||||
|
||||
#ws-h-scrollbar .jspHorizontalBar {
|
||||
height: 7px;
|
||||
border-top: 1px solid #C1C6CC;
|
||||
}
|
||||
#ws-h-scrollbar .jspTrack {
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Cell editor
|
||||
* --------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ce-canvas-outer {
|
||||
position: absolute;
|
||||
border: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#ce-canvas,
|
||||
#ce-canvas-overlay {
|
||||
border: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
#ce-cursor {
|
||||
position: absolute;
|
||||
background-color: #000;
|
||||
width: 1px;
|
||||
height: 11pt;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
#apiPopUpSelector {
|
||||
position: absolute;
|
||||
}
|
||||
#apiPopUpList {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-height: 210px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
#apiPopUpList li {
|
||||
max-width: 500px;
|
||||
}
|
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 |