mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 14:47:56 +01:00
- Clean webpack and babel configuration
- Babel configure to jsmodule
This commit is contained in:
parent
69054fcd9c
commit
cd2236eca1
@ -6,13 +6,10 @@
|
||||
"corejs": "3.15",
|
||||
"useBuiltIns": "usage",
|
||||
"targets": {
|
||||
"browsers": [
|
||||
"last 5 versions",
|
||||
"ie >= 8"
|
||||
]
|
||||
"esmodules": true
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"sourceType": "unambiguous"
|
||||
}
|
||||
}
|
@ -6,10 +6,7 @@
|
||||
"corejs": "3.15",
|
||||
"useBuiltIns": "usage",
|
||||
"targets": {
|
||||
"browsers": [
|
||||
"last 5 versions",
|
||||
"ie >= 8"
|
||||
]
|
||||
"esmodules": true
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -4,14 +4,7 @@
|
||||
"module": "commonjs",
|
||||
"paths": {
|
||||
"@libraries/*": ["../../libraries/*"],
|
||||
"@commands/*": ["./src/components/commands/*"],
|
||||
"@layout/*": ["./src/components/layout/*"],
|
||||
"@libs/*": ["./src/components/libraries/*"],
|
||||
"@model/*": ["./src/components/model/*"],
|
||||
"@persistence/*": ["./src/components/persistence/*"],
|
||||
"@util/*": ["./src/components/util/*"],
|
||||
"@widget/*": ["./src/components/widget/*"],
|
||||
"@components/*": ["./src/components/*"]
|
||||
"@wisemapping/web2d": ["../web2d/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
|
@ -20,10 +20,6 @@ import Topic from './Topic';
|
||||
import Shape from './util/Shape';
|
||||
|
||||
class CentralTopic extends Topic {
|
||||
constructor(model, options) {
|
||||
super(model, options);
|
||||
}
|
||||
|
||||
_registerEvents() {
|
||||
super._registerEvents();
|
||||
|
||||
|
@ -135,7 +135,7 @@ const RootedTreeSet = new Class(
|
||||
},
|
||||
|
||||
_find(id, parent) {
|
||||
if (parent.getId() == id) {
|
||||
if (parent.getId() === id) {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ const RootedTreeSet = new Class(
|
||||
if (!$defined(node._parent)) {
|
||||
return [];
|
||||
}
|
||||
const siblings = node._parent._children.filter((child) => child != node);
|
||||
const siblings = node._parent._children.filter((child) => child !== node);
|
||||
return siblings;
|
||||
},
|
||||
|
||||
@ -220,18 +220,18 @@ const RootedTreeSet = new Class(
|
||||
_hasSinglePathToSingleLeaf(node) {
|
||||
const children = this.getChildren(node);
|
||||
|
||||
if (children.length == 1) {
|
||||
if (children.length === 1) {
|
||||
return this._hasSinglePathToSingleLeaf(children[0]);
|
||||
}
|
||||
|
||||
return children.length == 0;
|
||||
return children.length === 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param node
|
||||
* @return {Boolean} whether the node is the start of a subbranch */
|
||||
isStartOfSubBranch(node) {
|
||||
return this.getSiblings(node).length > 0 && this.getChildren(node).length == 1;
|
||||
return this.getSiblings(node).length > 0 && this.getChildren(node).length === 1;
|
||||
},
|
||||
|
||||
/**
|
||||
@ -241,7 +241,7 @@ const RootedTreeSet = new Class(
|
||||
*/
|
||||
isLeaf(node) {
|
||||
$assert(node, 'node cannot be null');
|
||||
return this.getChildren(node).length == 0;
|
||||
return this.getChildren(node).length === 0;
|
||||
},
|
||||
|
||||
/**
|
||||
@ -375,7 +375,7 @@ const RootedTreeSet = new Class(
|
||||
|
||||
const children = this.getChildren(node);
|
||||
const me = this;
|
||||
children.forEach( (child) => {
|
||||
children.forEach((child) => {
|
||||
me.shiftBranchPosition(child, xOffset, yOffset);
|
||||
});
|
||||
},
|
||||
@ -397,10 +397,10 @@ const RootedTreeSet = new Class(
|
||||
},
|
||||
|
||||
/**
|
||||
* @param node
|
||||
* @param yOffset
|
||||
* @return siblings in the offset (vertical) direction, i.e. with lower or higher order, respectively
|
||||
*/
|
||||
* @param node
|
||||
* @param yOffset
|
||||
* @return siblings in the offset (vertical) direction, i.e. with lower or higher order, respectively
|
||||
*/
|
||||
getSiblingsInVerticalDirection(node, yOffset) {
|
||||
// siblings with lower or higher order, depending on the direction of the offset and on the same side as their parent
|
||||
const parent = this.getParent(node);
|
||||
@ -431,9 +431,9 @@ const RootedTreeSet = new Class(
|
||||
// direct descendants of the root that do not contain the node and are on the same side
|
||||
// and on the direction of the offset
|
||||
const rootNode = this.getRootNode(node);
|
||||
const branches = this.getChildren(rootNode).filter(function (child) {
|
||||
const branches = this.getChildren(rootNode).filter(((child) => {
|
||||
return this._find(node.getId(), child);
|
||||
}, this);
|
||||
}).bind(this));
|
||||
|
||||
const branch = branches[0];
|
||||
const rootDescendants = this.getSiblings(branch).filter((sibling) => {
|
||||
|
@ -35,12 +35,12 @@ class IconPanel extends ToolbarPaneItem {
|
||||
const familyIcons = ImageIcon.prototype.ICON_FAMILIES[i].icons;
|
||||
for (let j = 0; j < familyIcons.length; j += 1) {
|
||||
// Separate icons by line ...
|
||||
var familyContent;
|
||||
let familyContent;
|
||||
if ((count % 12) == 0) {
|
||||
familyContent = $('<div></div>');
|
||||
content.append(familyContent);
|
||||
}
|
||||
|
||||
|
||||
const iconId = familyIcons[j];
|
||||
const img = $('<img>')
|
||||
.attr('id', iconId)
|
||||
@ -51,10 +51,10 @@ class IconPanel extends ToolbarPaneItem {
|
||||
|
||||
const panel = this;
|
||||
const model = this.getModel();
|
||||
img.on('click', function (event) {
|
||||
img.on('click', ((event) => {
|
||||
model.setValue($(this).attr('id'));
|
||||
panel.hide();
|
||||
});
|
||||
}).bind(this));
|
||||
|
||||
count += 1;
|
||||
}
|
||||
|
@ -15,20 +15,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import jQuery from 'jquery';
|
||||
import BootstrapDialog from '../libraries/bootstrap/BootstrapDialog';
|
||||
|
||||
class NoteEditor extends BootstrapDialog{
|
||||
class NoteEditor extends BootstrapDialog {
|
||||
constructor(model) {
|
||||
$assert(model, 'model can not be null');
|
||||
this._model = model;
|
||||
super($msg('Note'), {
|
||||
cancelButton: true,
|
||||
closeButton: true,
|
||||
acceptButton: true,
|
||||
removeButton: typeof model.getValue() !== 'undefined',
|
||||
onEventData: { model: this._model }
|
||||
onEventData: { model: model },
|
||||
});
|
||||
this._model = model;
|
||||
this.css({ margin: '150px auto' });
|
||||
const panel = this._buildPanel(model);
|
||||
this.setContent(panel);
|
||||
|
@ -19,7 +19,6 @@ module.exports = {
|
||||
exclude: [
|
||||
/node_modules/,
|
||||
path.resolve(__dirname, '../../libraries/mootools-core-1.4.5'),
|
||||
path.resolve(__dirname, '../../libraries/underscore-min'),
|
||||
],
|
||||
},
|
||||
],
|
||||
@ -28,6 +27,7 @@ module.exports = {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@libraries': path.resolve(__dirname, '../../libraries/'),
|
||||
'@wisemapping/web2d': path.resolve(__dirname, '../web2d/'),
|
||||
},
|
||||
extensions: ['.js', '.json'],
|
||||
},
|
||||
|
@ -35,7 +35,6 @@ module.exports = {
|
||||
exclude: [
|
||||
/node_modules/,
|
||||
path.resolve(__dirname, '../../libraries/mootools-core-1.4.5'),
|
||||
path.resolve(__dirname, '../../libraries/underscore-min'),
|
||||
/lib\/raphael/ig,
|
||||
],
|
||||
},
|
||||
|
@ -6,10 +6,7 @@
|
||||
"corejs": "3.15",
|
||||
"useBuiltIns": "usage",
|
||||
"targets": {
|
||||
"browsers": [
|
||||
"last 5 versions",
|
||||
"ie >= 8"
|
||||
]
|
||||
"esmodules": true
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -2,9 +2,6 @@
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"module": "commonjs",
|
||||
"paths": {
|
||||
"@libraries/*": ["../../libraries/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user