Skip to content

Commit

Permalink
合并前端静态打包资源
Browse files Browse the repository at this point in the history
  • Loading branch information
xiweicheng committed Jul 4, 2020
1 parent ae6767e commit 7b609c1
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 29 deletions.
36 changes: 35 additions & 1 deletion src/main/resources/static/page/excel.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
}

</style>
</head>

Expand Down Expand Up @@ -206,7 +207,7 @@
.loadData(data ? data : {}) // load data
.change(data => {
// save data to db
console.log(JSON.stringify(data));
// console.log(JSON.stringify(data));
});

// data validation
Expand Down Expand Up @@ -329,6 +330,38 @@
}
});

window.addEventListener && window.addEventListener('message', (evt) => {

if (evt.origin != window.location.origin) return;

if (evt.data.source != 'blogClose') return;

if (evt.data.action == 'isUpdated') {

var updated = false;

var title = $('#title').val();
var content = JSON.stringify(excel.getData());

if (blog) {
updated = (blog.title != $.trim(title)) || (blog.content != $.trim(content));
} else {
updated = !!$.trim(title) || (!!$.trim(content) && content !=
`[{"name":"sheet2","freeze":"A1","styles":[],"merges":[],"rows":{"len":100},"cols":{"len":26},"validations":[],"autofilter":{}}]`
);
}

(window.parent && window.parent.postMessage) && (window.parent
.postMessage({
action: 'isUpdated',
source: 'blogCloseAck',
item: evt.data.item,
updated: updated
}, window.location.origin));
}

}, false);

$('#save').click(function (event) {

var title = $('#title').val();
Expand Down Expand Up @@ -468,6 +501,7 @@
});

});

</script>
</body>

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/page/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<script src="cdn/dragula.min.js"></script>
<script src="cdn/sortable.min.js"></script>
<script src="cdn/xlsx.full.min.js"></script>
<script src="scripts/vendor-bundle-a18de83830.a163242e.1586268.js" data-main="aurelia-bootstrapper"></script>
<script src="scripts/vendor-bundle-a18de83830.317da279.1586268.js" data-main="aurelia-bootstrapper"></script>
</body>

</html>
34 changes: 34 additions & 0 deletions src/main/resources/static/page/mind.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
}

</style>
</head>

Expand Down Expand Up @@ -285,6 +286,38 @@
}
});

window.addEventListener && window.addEventListener('message', (evt) => {

if (evt.origin != window.location.origin) return;

if (evt.data.source != 'blogClose') return;

if (evt.data.action == 'isUpdated') {

var updated = false;

var title = $('#title').val();
var content = mind.getAllDataString();

if (blog) {
updated = (blog.title != $.trim(title)) || (blog.content != $.trim(content));
} else {
updated = !!$.trim(title) || (!!$.trim(content) && content !=
`{"nodeData":{"id":"root","topic":"新主题","root":true,"children":[]},"linkData":{}}`
);
}

(window.parent && window.parent.postMessage) && (window.parent
.postMessage({
action: 'isUpdated',
source: 'blogCloseAck',
item: evt.data.item,
updated: updated
}, window.location.origin));
}

}, false);

$('#save').click(function (event) {

var title = $('#title').val();
Expand Down Expand Up @@ -424,6 +457,7 @@
});

});

</script>
</body>

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 7b609c1

Please sign in to comment.