# HG changeset patch # User Pascal Bellard # Date 1475588029 -7200 # Node ID 7a16da2c93b9970e2a9eed3be1cecc098a615978 # Parent 3ee81b3a3fba66e6062e3dd289cb0a678d22e1b9 zerobin: add download button diff -r 3ee81b3a3fba -r 7a16da2c93b9 syslinux/stuff/iso2exe/boot.c --- a/syslinux/stuff/iso2exe/boot.c Sun Oct 02 19:36:14 2016 +0100 +++ b/syslinux/stuff/iso2exe/boot.c Tue Oct 04 15:33:49 2016 +0200 @@ -154,9 +154,12 @@ initrd = NULL; cmdline = "auto"; if (argc > 1) { - if (argv[1][0] == '@') - cmdfile = argv[1] + 1; - else { + switch (argv[1][0]) { + case '-' : case '/' : case '?' : + usage(argv[0]); break; + case '@' : + cmdfile = argv[1] + 1; break; + default : cmdfile = NULL; copycmdline(args); } diff -r 3ee81b3a3fba -r 7a16da2c93b9 syslinux/stuff/iso2exe/bootiso.S --- a/syslinux/stuff/iso2exe/bootiso.S Sun Oct 02 19:36:14 2016 +0100 +++ b/syslinux/stuff/iso2exe/bootiso.S Tue Oct 04 15:33:49 2016 +0200 @@ -135,7 +135,8 @@ je abort int $0x21 // get DOS version addb $-3, %al - movw $0x1000+EXESTR(noDOS3), %ax + movw $0xF000+EXESTR(noDOS3), %ax + movw $0x100, %di jc tst386 abort: jmp *%bp @@ -144,16 +145,14 @@ pushfw // save flags // bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 // flags 0 NT IOPL OF DF IF TF SF ZF 0 AF 0 PF 1 CF - // movb $0x10, %ah + // movb $0xF0, %ah pushw %ax popfw // < 286 : flags[12..15] are forced 1 pushfw // = 286 : flags[12..15] are forced 0 popw %bx // > 286 : only flags[15] is forced 0 popfw // restore flags (IOPL) addb %ah, %bh // test F0 and 00 cases - cmpb %ah, %bh - movw $0x100, %di - jbe is86 // C=8086/80186, Z=80286 + js is86 // NS=386+, NC=286 is386: smsww %ax // not privileged andb $1, %al @@ -203,7 +202,7 @@ lodsw popw %ds jne NoVCPI - xorb $0x58, %al // X(XX0) + xorw $0x5858, %ax // XX(X0) call ScanVCPI CmdVCPI: .byte 0x40 // status @@ -234,7 +233,7 @@ .ascii "?" .byte EXESTR(eol) help: - .ascii "SliTaz iso boot" // SliTaz iso boot + .ascii "SliTaz iso boot." // SliTaz iso boot. eol: .ascii "\r\n" .byte 1 // puts will return diff -r 3ee81b3a3fba -r 7a16da2c93b9 zerobin/stuff/zerobin.u --- a/zerobin/stuff/zerobin.u Sun Oct 02 19:36:14 2016 +0100 +++ b/zerobin/stuff/zerobin.u Tue Oct 04 15:33:49 2016 +0200 @@ -14,7 +14,7 @@ // trafic_limiter : Make sure the IP address makes at most 1 request every 10 seconds. // Will return false if IP address made a call less than 10 seconds ago. function trafic_limiter_canPass($ip) -@@ -144,7 +151,7 @@ +@@ -157,7 +164,7 @@ } // Make sure last paste from the IP address was more than 10 seconds ago. @@ -23,7 +23,7 @@ { echo json_encode(array('status'=>1,'message'=>'Please wait 10 seconds between each post.')); exit; } // Make sure content is not too big. -@@ -216,7 +223,7 @@ +@@ -229,7 +236,7 @@ // (We assume that if the user did not enter a nickname, he/she wants // to be anonymous and we will not generate the vizhash.) $vz = new vizhash16x16(); @@ -49,3 +49,44 @@ var cipherdata = zeroCipher(randomkey, $('textarea#message').val()); var data_to_send = { data: cipherdata, expire: $('select#pasteExpiration').val(), +@@ -416,6 +416,7 @@ + $('button#sendbutton').show(); + $('button#clonebutton').hide(); + $('button#rawtextbutton').hide(); ++ $('button#downloadbutton').hide(); + $('div#expiration').show(); + $('div#remainingtime').hide(); + $('div#burnafterreadingoption').show(); +@@ -444,6 +445,7 @@ + $('button#clonebutton').show(); + } + $('button#rawtextbutton').show(); ++ $('button#downloadbutton').show(); + + $('div#expiration').hide(); + $('div#burnafterreadingoption').hide(); +@@ -463,6 +465,14 @@ + var newDoc = document.open('text/html', 'replace'); + newDoc.write('
'+paste+'
'); + newDoc.close(); ++} ++ ++/** Download raw text ++ */ ++function downLoad() ++{ ++ var paste = $('div#cleartext').html(); ++ document.location = 'data:Application/octet-stream,' + encodeURIComponent(paste); + } + + /** +--- tpl/page.html ++++ tpl/page.html +@@ -47,6 +47,7 @@ + + + ++ +