Merge branch 'soon' into staging

pull/1/head
yflory 3 years ago
commit c92092c662

@ -27,7 +27,6 @@
"marked": "1.1.0", "marked": "1.1.0",
"rangy": "rangy-release#~1.3.0", "rangy": "rangy-release#~1.3.0",
"json.sortify": "~2.1.0", "json.sortify": "~2.1.0",
"secure-fabric.js": "secure-v1.7.9",
"hyperjson": "~1.4.0", "hyperjson": "~1.4.0",
"chainpad-crypto": "^0.2.0", "chainpad-crypto": "^0.2.0",
"chainpad-listmap": "^1.0.0", "chainpad-listmap": "^1.0.0",

@ -2,6 +2,19 @@ define([
'cm/lib/codemirror', 'cm/lib/codemirror',
'cm/addon/mode/simple' 'cm/addon/mode/simple'
], function (CodeMirror) { ], function (CodeMirror) {
// Hack to avoid breaking a document with ```__proto__ codeblock
CodeMirror.defineSimpleMode("__proto__", {
start: [ {regex: /.*/, token: "comment"} ],
env: [ {regex: /.*/, token: "comment"} ]
});
CodeMirror.registerHelper("fold", "__proto__", function(cm, start) {
return {
from: CodeMirror.Pos(0,0),
to: CodeMirror.Pos(0,0)
};
});
CodeMirror.__mode = 'orgmode'; CodeMirror.__mode = 'orgmode';
var isEmpty = function (el, idx) { var isEmpty = function (el, idx) {

@ -1599,10 +1599,6 @@ define([
var $tb = $iframe.find('head'); var $tb = $iframe.find('head');
var css = // Old OO var css = // Old OO
//'#id-toolbar-full .toolbar-group:nth-child(2), #id-toolbar-full .separator:nth-child(3) { display: none; }' + //'#id-toolbar-full .toolbar-group:nth-child(2), #id-toolbar-full .separator:nth-child(3) { display: none; }' +
'#slot-btn-inschart { display: none !important; }' + // XXX XXX
'#slot-btn-insertchart { display: none !important; }' + // XXX XXX
'#slot-btn-instable { display: none !important; }' + // XXX XXX
'#slot-btn-inserttable { display: none !important; }' + // XXX XXX
//'#fm-btn-save { display: none !important; }' + //'#fm-btn-save { display: none !important; }' +
//'#panel-settings-general tr.autosave { display: none !important; }' + //'#panel-settings-general tr.autosave { display: none !important; }' +
//'#panel-settings-general tr.coauth { display: none !important; }' + //'#panel-settings-general tr.coauth { display: none !important; }' +
@ -1647,29 +1643,6 @@ define([
} }
}, },
"onDocumentReady": function () { "onDocumentReady": function () {
// XXX remove the following block
try {
var app = common.getMetadataMgr().getPrivateData().ooType;
var d, hasChart;
if (app === 'doc') {
d = getEditor().GetDocument();
hasChart = d.GetAllCharts().length || d.Document.Content.some(function (obj) {
return obj instanceof getWindow().AscCommonWord.CTable;
});
if (hasChart) { Feedback.send('OO_DOC_CHART', true); }
} else if (app === 'presentation') {
d = getEditor().GetPresentation().Presentation;
hasChart = d.Slides.some(function (slide) {
return slide.getDrawingObjects().some(function (obj) {
return obj instanceof getWindow().AscFormat.CChartSpace || obj instanceof getWindow().AscFormat.CGraphicFrame;
});
});
if (hasChart) { Feedback.send('OO_SLIDE_CHART', true); }
}
} catch (e) {}
evOnSync.fire(); evOnSync.fire();
var onMigrateRdy = Util.mkEvent(); var onMigrateRdy = Util.mkEvent();
onMigrateRdy.reg(function () { onMigrateRdy.reg(function () {

@ -9,3 +9,5 @@ This file is intended to be used as a log of what third-party source we have ven
* [jquery.ui 1.12.1](https://jqueryui.com/) for its 'autocomplete' extension which is used for our tag picker * [jquery.ui 1.12.1](https://jqueryui.com/) for its 'autocomplete' extension which is used for our tag picker
* [pdfjs](https://mozilla.github.io/pdf.js/) with some minor modifications to prevent CSP errors * [pdfjs](https://mozilla.github.io/pdf.js/) with some minor modifications to prevent CSP errors
* [mermaidjs 8.4.8](https://mermaid-js.github.io/mermaid/#/) extends our markdown integration to support a variety of diagram types * [mermaidjs 8.4.8](https://mermaid-js.github.io/mermaid/#/) extends our markdown integration to support a variety of diagram types
* [Fabricjs 4.6.0](https://github.com/fabricjs/fabric.js) and [Fabric-history](https://github.com/lyzerk/fabric-history) for the whiteboard app

File diff suppressed because one or more lines are too long

@ -14,7 +14,7 @@ define([
'/customize/application_config.js', '/customize/application_config.js',
'/bower_components/chainpad/chainpad.dist.js', '/bower_components/chainpad/chainpad.dist.js',
'/bower_components/secure-fabric.js/dist/fabric.min.js', '/lib/fabric.min.js',
'less!/whiteboard/app-whiteboard.less' 'less!/whiteboard/app-whiteboard.less'
], function ( ], function (
$, $,
@ -123,7 +123,7 @@ define([
APP.draw = true; APP.draw = true;
$brush.click(function () { $brush.click(function () {
if (APP.draw) { return; } if (APP.draw) { return; }
canvas.deactivateAll().renderAll(); canvas.discardActiveObject().renderAll();
APP.draw = true; APP.draw = true;
canvas.isDrawingMode = APP.draw; canvas.isDrawingMode = APP.draw;
$type.find('button').removeClass('btn-primary'); $type.find('button').removeClass('btn-primary');
@ -132,7 +132,7 @@ define([
}); });
$move.click(function () { $move.click(function () {
if (!APP.draw) { return; } if (!APP.draw) { return; }
canvas.deactivateAll().renderAll(); canvas.discardActiveObject().renderAll();
APP.draw = false; APP.draw = false;
canvas.isDrawingMode = APP.draw; canvas.isDrawingMode = APP.draw;
$type.find('button').removeClass('btn-primary'); $type.find('button').removeClass('btn-primary');
@ -171,14 +171,15 @@ define([
var deleteSelection = function () { var deleteSelection = function () {
if (APP.draw) { return; } if (APP.draw) { return; }
/*
if (canvas.getActiveObject()) { if (canvas.getActiveObject()) {
canvas.getActiveObject().remove(); canvas.getActiveObject().remove();
} }*/
if (canvas.getActiveGroup()) { if (canvas.getActiveObjects()) {
canvas.getActiveGroup()._objects.forEach(function (el) { canvas.getActiveObjects().forEach(function (el) {
el.remove(); APP.canvas.remove(el);
}); });
canvas.discardActiveGroup(); canvas.discardActiveObject();
} }
canvas.renderAll(); canvas.renderAll();
APP.onLocal(); APP.onLocal();
@ -342,7 +343,7 @@ define([
canvas.isDrawingMode = bool ? APP.draw : false; canvas.isDrawingMode = bool ? APP.draw : false;
if (!bool) { if (!bool) {
canvas.deactivateAll(); canvas.discardActiveObject();
canvas.renderAll(); canvas.renderAll();
} }
canvas.forEachObject(function (object) { canvas.forEachObject(function (object) {
@ -367,7 +368,7 @@ define([
APP.FM = framework._.sfCommon.createFileManager({}); APP.FM = framework._.sfCommon.createFileManager({});
APP.upload = function (title) { APP.upload = function (title) {
var canvas = $canvas[0]; var canvas = $canvas[0];
APP.canvas.deactivateAll().renderAll(); APP.canvas.discardActiveObject().renderAll();
canvas.toBlob(function (blob) { canvas.toBlob(function (blob) {
blob.name = title; blob.name = title;
APP.FM.handleFile(blob); APP.FM.handleFile(blob);

Loading…
Cancel
Save