Skip to content

Commit 7b609c1

Browse files
committed
合并前端静态打包资源
1 parent ae6767e commit 7b609c1

File tree

6 files changed

+97
-29
lines changed

6 files changed

+97
-29
lines changed

src/main/resources/static/page/excel.html

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
-moz-border-radius: 2px;
115115
-webkit-border-radius: 2px;
116116
}
117+
117118
</style>
118119
</head>
119120

@@ -206,7 +207,7 @@
206207
.loadData(data ? data : {}) // load data
207208
.change(data => {
208209
// save data to db
209-
console.log(JSON.stringify(data));
210+
// console.log(JSON.stringify(data));
210211
});
211212

212213
// data validation
@@ -329,6 +330,38 @@
329330
}
330331
});
331332

333+
window.addEventListener && window.addEventListener('message', (evt) => {
334+
335+
if (evt.origin != window.location.origin) return;
336+
337+
if (evt.data.source != 'blogClose') return;
338+
339+
if (evt.data.action == 'isUpdated') {
340+
341+
var updated = false;
342+
343+
var title = $('#title').val();
344+
var content = JSON.stringify(excel.getData());
345+
346+
if (blog) {
347+
updated = (blog.title != $.trim(title)) || (blog.content != $.trim(content));
348+
} else {
349+
updated = !!$.trim(title) || (!!$.trim(content) && content !=
350+
`[{"name":"sheet2","freeze":"A1","styles":[],"merges":[],"rows":{"len":100},"cols":{"len":26},"validations":[],"autofilter":{}}]`
351+
);
352+
}
353+
354+
(window.parent && window.parent.postMessage) && (window.parent
355+
.postMessage({
356+
action: 'isUpdated',
357+
source: 'blogCloseAck',
358+
item: evt.data.item,
359+
updated: updated
360+
}, window.location.origin));
361+
}
362+
363+
}, false);
364+
332365
$('#save').click(function (event) {
333366

334367
var title = $('#title').val();
@@ -468,6 +501,7 @@
468501
});
469502

470503
});
504+
471505
</script>
472506
</body>
473507

src/main/resources/static/page/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<script src="cdn/dragula.min.js"></script>
2323
<script src="cdn/sortable.min.js"></script>
2424
<script src="cdn/xlsx.full.min.js"></script>
25-
<script src="scripts/vendor-bundle-a18de83830.a163242e.1586268.js" data-main="aurelia-bootstrapper"></script>
25+
<script src="scripts/vendor-bundle-a18de83830.317da279.1586268.js" data-main="aurelia-bootstrapper"></script>
2626
</body>
2727

2828
</html>

src/main/resources/static/page/mind.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
-moz-border-radius: 2px;
105105
-webkit-border-radius: 2px;
106106
}
107+
107108
</style>
108109
</head>
109110

@@ -285,6 +286,38 @@
285286
}
286287
});
287288

289+
window.addEventListener && window.addEventListener('message', (evt) => {
290+
291+
if (evt.origin != window.location.origin) return;
292+
293+
if (evt.data.source != 'blogClose') return;
294+
295+
if (evt.data.action == 'isUpdated') {
296+
297+
var updated = false;
298+
299+
var title = $('#title').val();
300+
var content = mind.getAllDataString();
301+
302+
if (blog) {
303+
updated = (blog.title != $.trim(title)) || (blog.content != $.trim(content));
304+
} else {
305+
updated = !!$.trim(title) || (!!$.trim(content) && content !=
306+
`{"nodeData":{"id":"root","topic":"新主题","root":true,"children":[]},"linkData":{}}`
307+
);
308+
}
309+
310+
(window.parent && window.parent.postMessage) && (window.parent
311+
.postMessage({
312+
action: 'isUpdated',
313+
source: 'blogCloseAck',
314+
item: evt.data.item,
315+
updated: updated
316+
}, window.location.origin));
317+
}
318+
319+
}, false);
320+
288321
$('#save').click(function (event) {
289322

290323
var title = $('#title').val();
@@ -424,6 +457,7 @@
424457
});
425458

426459
});
460+
427461
</script>
428462
</body>
429463

src/main/resources/static/page/scripts/app-bundle-aa0c5b6e6f.js renamed to src/main/resources/static/page/scripts/app-bundle-4bb9d5b973.js

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

src/main/resources/static/page/scripts/vendor-bundle-a18de83830.a163242e.1586268.js renamed to src/main/resources/static/page/scripts/vendor-bundle-a18de83830.317da279.1586268.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/static/page/scripts/vendor-bundle-a18de83830.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)