Skip to content

Commit 359a4f1

Browse files
committed
continue
1 parent 21d2ab3 commit 359a4f1

File tree

7 files changed

+62
-10
lines changed

7 files changed

+62
-10
lines changed

core-test.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
<meta charset=utf8>
55
<title>RXEditor Core-Test</title>
66
<link rel="stylesheet" href="vendor/bootstrap-4.4.1-dist/css/bootstrap.min.css" >
7-
<link href="vendor/fontawesome-free-5.11/css/all.min.css" rel="stylesheet">
7+
<link href="vendor/fontawesome-free-5.11.2-web/css/all.min.css" rel="stylesheet">
88
</head>
99
<body style="width:100%; height: 100%;">
10-
<div id='rxeditor' ></div>
10+
<div id='canvas' ></div>
1111
</body>
1212
</html>
13-
<script src="dist/core.js"></script>
13+
<script src="dist/core.js"></script>
14+
<script>
15+
rxEditor.hangOn('canvas');
16+
</script>

dist/core.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,23 @@
9090
/*!*********************!*\
9191
!*** ./src/core.js ***!
9292
\*********************/
93-
/*! no static exports found */
94-
/***/ (function(module, exports) {
93+
/*! no exports provided */
94+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
9595

96-
eval("\n\n//# sourceURL=webpack:///./src/core.js?");
96+
"use strict";
97+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ruxin_rxeditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ruxin/rxeditor */ \"./src/ruxin/rxeditor.js\");\n\r\n\r\nwindow.rxEditor = new _ruxin_rxeditor__WEBPACK_IMPORTED_MODULE_0__[\"RXEditor\"]\r\n\n\n//# sourceURL=webpack:///./src/core.js?");
98+
99+
/***/ }),
100+
101+
/***/ "./src/ruxin/rxeditor.js":
102+
/*!*******************************!*\
103+
!*** ./src/ruxin/rxeditor.js ***!
104+
\*******************************/
105+
/*! exports provided: RXEditor */
106+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
107+
108+
"use strict";
109+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RXEditor\", function() { return RXEditor; });\nclass RXEditor{\r\n constructor() {\r\n this.innerHTML = `\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"column\"> test </div>\r\n <h2>Heading</h2>\r\n </div>\r\n </div>\r\n `\r\n }\r\n\r\n hangOn(id){\r\n this.workspace = document.getElementById(id)\r\n this.workspace.innerHTML = this.innerHTML\r\n //console.log(this.workspace.children)\r\n this.paraseNode(this.workspace)\r\n //this.workspace.childNodes.forEach(child=>{\r\n // console.log(child)\r\n //})\r\n }\r\n\r\n paraseNode(node){\r\n for(var i = 0; i < node.children.length; i++){\r\n let child = node.children[i]\r\n console.log(child, child.nodeName, child.nodeType)\r\n this.paraseNode(child)\r\n }\r\n }\r\n}\r\n\r\n\n\n//# sourceURL=webpack:///./src/ruxin/rxeditor.js?");
97110

98111
/***/ })
99112

dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {RXEditor} from "./ruxin/rxeditor"
2+
3+
window.rxEditor = new RXEditor

src/core/rxeditor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {NodeLabel} from "./node-label"
66
import {NodeToolbar} from "./node-toolbar"
77
import {MiniEditbar} from "./mini-editbar"
88
import {load, loadOneNode} from "./load"
9+
import {RXEditorCommandProxy} from "./rxeditor-command-proxy"
910

1011
export class RXEditor{
1112
constructor() {
@@ -37,7 +38,8 @@ export class RXEditor{
3738
this.miniEditbar = new MiniEditbar
3839
}
3940

40-
hangOn(id, commandProxy){
41+
hangOn(id){
42+
let commandProxy = new RXEditorCommandProxy
4143
this.workspace = document.getElementById(id)
4244
this.activedLabel.render(this.workspace)
4345
this.focusedLabel.render(this.workspace)

src/ruxin/rxeditor.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
export class RXEditor{
2+
constructor() {
3+
this.innerHTML = `
4+
<div class="container">
5+
<div class="row">
6+
<div class="column"> test </div>
7+
<h2>Heading</h2>
8+
</div>
9+
</div>
10+
`
11+
}
12+
13+
hangOn(id){
14+
this.workspace = document.getElementById(id)
15+
this.workspace.innerHTML = this.innerHTML
16+
//console.log(this.workspace.children)
17+
this.paraseNode(this.workspace)
18+
//this.workspace.childNodes.forEach(child=>{
19+
// console.log(child)
20+
//})
21+
}
22+
23+
paraseNode(node){
24+
for(var i = 0; i < node.children.length; i++){
25+
let child = node.children[i]
26+
console.log(child, child.nodeName, child.nodeType)
27+
this.paraseNode(child)
28+
}
29+
}
30+
}
31+

src/shell/workspace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class Workspace extends RXComponent{
4949
<script type="text/javascript" src="${this.config.mainJs}"></script>
5050
<script>
5151
creatEditorCore()
52-
rxEditor.hangOn('canvas', new RXEditorCommandProxy);
52+
rxEditor.hangOn('canvas');
5353
</script>
5454
</body>
5555
</html>

0 commit comments

Comments
 (0)