Skip to content

Commit 46ddff1

Browse files
save file
1 parent a02aece commit 46ddff1

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

blog/26-04-16/node-gyp-always-on-top/node-gyp-always-on-top.html

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,18 @@
4545

4646
var project;
4747
var min;
48+
var cpp;
49+
var js;
50+
var gyp;
4851

4952

5053
async function ready(){
5154
debug('ready');
5255
project = mod['project'];
5356
min = mod['min-project'];
57+
cpp = mod['cpp'];
58+
js = mod['js'];
59+
gyp = mod['gyp'];
5460

5561
initdom(document.body);
5662

@@ -94,6 +100,9 @@
94100
web-editor
95101
{border:1px solid lightgray;border-radius:5px;margin:20px 0;padding:10px}
96102

103+
[value=download]
104+
{margin-left:50px}
105+
97106
</style>
98107

99108

@@ -197,6 +206,7 @@ <h1 slot=title>
197206

198207
<div class=blog-hdr>
199208
Source Code
209+
<input value=download type=button>
200210
</div>
201211

202212
<p>
@@ -536,15 +546,38 @@ <h1 slot=title>
536546
<script>
537547

538548

549+
var create_archive;
550+
539551
var btn = {};
540552

541553

542554
function initdom(rootnode){
543555

544-
556+
$('[value=download]').onclick = btn.download;
557+
545558
}//initdom
546559

547560

561+
btn.download = async function(){
562+
563+
if(!create_archive){
564+
({create_archive} = await import('https://libs.ext-code.com/js/io/create-archive/create-archive.m.js'));
565+
}
566+
567+
var zip = {
568+
'alway-on-top' :{directory:{
569+
'always-on-top.cpp' : cpp.get(),
570+
'always-on-top.js' : js.get(),
571+
'binding.gyp' : gyp.get(),
572+
'node_modules' : {directory:{}}
573+
}}
574+
};
575+
create_archive(zip,{download:'always-on-top.zip',df:true});
576+
577+
}//download
578+
579+
580+
548581

549582

550583
</script>

0 commit comments

Comments
 (0)