wok-6.x rev 19435

zerobin: add download button
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Oct 04 15:33:49 2016 +0200 (2016-10-04)
parents 3ee81b3a3fba
children 8fd5d4c953f6
files syslinux/stuff/iso2exe/boot.c syslinux/stuff/iso2exe/bootiso.S zerobin/stuff/zerobin.u
line diff
     1.1 --- a/syslinux/stuff/iso2exe/boot.c	Sun Oct 02 19:36:14 2016 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/boot.c	Tue Oct 04 15:33:49 2016 +0200
     1.3 @@ -154,9 +154,12 @@
     1.4  	initrd  = NULL;
     1.5  	cmdline = "auto";
     1.6  	if (argc > 1) {
     1.7 -		if (argv[1][0] == '@')
     1.8 -			cmdfile = argv[1] + 1;
     1.9 -		else {
    1.10 +		switch (argv[1][0]) {
    1.11 +		case '-' : case '/' : case '?' :
    1.12 +			usage(argv[0]); break;
    1.13 +		case '@' :
    1.14 +			cmdfile = argv[1] + 1; break;
    1.15 +		default :
    1.16  			cmdfile = NULL;
    1.17  			copycmdline(args);
    1.18  		}
     2.1 --- a/syslinux/stuff/iso2exe/bootiso.S	Sun Oct 02 19:36:14 2016 +0100
     2.2 +++ b/syslinux/stuff/iso2exe/bootiso.S	Tue Oct 04 15:33:49 2016 +0200
     2.3 @@ -135,7 +135,8 @@
     2.4  	je	abort
     2.5  	int	$0x21			// get DOS version
     2.6  	addb	$-3, %al
     2.7 -	movw	$0x1000+EXESTR(noDOS3), %ax
     2.8 +	movw	$0xF000+EXESTR(noDOS3), %ax
     2.9 +	movw	$0x100, %di
    2.10  	jc	tst386
    2.11  abort:
    2.12  	jmp	*%bp
    2.13 @@ -144,16 +145,14 @@
    2.14  	pushfw				// save flags
    2.15  		// bits  15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
    2.16  		// flags  0 NT  IOPL OF DF IF TF SF ZF  0 AF  0 PF  1 CF
    2.17 -	// movb	$0x10, %ah
    2.18 +	// movb	$0xF0, %ah
    2.19  	pushw	%ax
    2.20  	popfw				// < 286 : flags[12..15] are forced 1
    2.21  	pushfw				// = 286 : flags[12..15] are forced 0
    2.22  	popw	%bx			// > 286 : only flags[15] is forced 0
    2.23  	popfw				// restore flags (IOPL)
    2.24  	addb	%ah, %bh		// test F0 and 00 cases
    2.25 -	cmpb	%ah, %bh
    2.26 -	movw	$0x100, %di
    2.27 -	jbe	is86			// C=8086/80186, Z=80286
    2.28 +	js	is86			// NS=386+, NC=286
    2.29  is386:
    2.30  	smsww	%ax			// not privileged
    2.31  	andb	$1, %al
    2.32 @@ -203,7 +202,7 @@
    2.33  	lodsw
    2.34  	popw	%ds
    2.35  	jne	NoVCPI
    2.36 -	xorb	$0x58, %al		// X(XX0)
    2.37 +	xorw	$0x5858, %ax		// XX(X0)
    2.38  	call	ScanVCPI
    2.39  CmdVCPI:
    2.40  	.byte	0x40			// status
    2.41 @@ -234,7 +233,7 @@
    2.42  	.ascii	"?"
    2.43  	.byte	EXESTR(eol)
    2.44  help:
    2.45 -	.ascii	"SliTaz iso boot"	// SliTaz iso boot
    2.46 +	.ascii	"SliTaz iso boot."	// SliTaz iso boot.
    2.47  eol:
    2.48  	.ascii	"\r\n"
    2.49  	.byte	1			// puts will return
     3.1 --- a/zerobin/stuff/zerobin.u	Sun Oct 02 19:36:14 2016 +0100
     3.2 +++ b/zerobin/stuff/zerobin.u	Tue Oct 04 15:33:49 2016 +0200
     3.3 @@ -14,7 +14,7 @@
     3.4   // trafic_limiter : Make sure the IP address makes at most 1 request every 10 seconds.
     3.5   // Will return false if IP address made a call less than 10 seconds ago.
     3.6   function trafic_limiter_canPass($ip)
     3.7 -@@ -144,7 +151,7 @@
     3.8 +@@ -157,7 +164,7 @@
     3.9       }
    3.10   
    3.11       // Make sure last paste from the IP address was more than 10 seconds ago.
    3.12 @@ -23,7 +23,7 @@
    3.13           { echo json_encode(array('status'=>1,'message'=>'Please wait 10 seconds between each post.')); exit; }
    3.14   
    3.15       // Make sure content is not too big.
    3.16 -@@ -216,7 +223,7 @@
    3.17 +@@ -229,7 +236,7 @@
    3.18               // (We assume that if the user did not enter a nickname, he/she wants
    3.19               // to be anonymous and we will not generate the vizhash.)
    3.20               $vz = new vizhash16x16();
    3.21 @@ -49,3 +49,44 @@
    3.22       var cipherdata = zeroCipher(randomkey, $('textarea#message').val());
    3.23       var data_to_send = { data:           cipherdata,
    3.24                            expire:         $('select#pasteExpiration').val(),
    3.25 +@@ -416,6 +416,7 @@
    3.26 +     $('button#sendbutton').show();
    3.27 +     $('button#clonebutton').hide();
    3.28 +     $('button#rawtextbutton').hide();
    3.29 ++    $('button#downloadbutton').hide();
    3.30 +     $('div#expiration').show();
    3.31 +     $('div#remainingtime').hide();
    3.32 +     $('div#burnafterreadingoption').show();
    3.33 +@@ -444,6 +445,7 @@
    3.34 +         $('button#clonebutton').show();
    3.35 +     }
    3.36 +     $('button#rawtextbutton').show();
    3.37 ++    $('button#downloadbutton').show();
    3.38 + 
    3.39 +     $('div#expiration').hide();
    3.40 +     $('div#burnafterreadingoption').hide();
    3.41 +@@ -463,6 +465,14 @@
    3.42 +     var newDoc = document.open('text/html', 'replace');
    3.43 +     newDoc.write('<pre>'+paste+'</pre>');
    3.44 +     newDoc.close();
    3.45 ++}
    3.46 ++
    3.47 ++/** Download raw text
    3.48 ++  */
    3.49 ++function downLoad()
    3.50 ++{
    3.51 ++    var paste = $('div#cleartext').html();
    3.52 ++    document.location = 'data:Application/octet-stream,' + encodeURIComponent(paste);
    3.53 + }
    3.54 + 
    3.55 + /**
    3.56 +--- tpl/page.html
    3.57 ++++ tpl/page.html
    3.58 +@@ -47,6 +47,7 @@
    3.59 +     <button id="sendbutton" onclick="send_data();return false;" style="display:none;"><img src="img/icon_send.png#" width="18" height="15" />Send</button>
    3.60 +     <button id="clonebutton" onclick="clonePaste();return false;" style="display:none;"><img src="img/icon_clone.png#" width="15" height="17" />Clone</button>
    3.61 +     <button id="rawtextbutton" onclick="rawText();return false;" style="display:none; "><img src="img/icon_raw.png#" width="15" height="15" style="padding:1px 0px 1px 0px;"/>Raw text</button>
    3.62 ++    <button id="downloadbutton" onclick="downLoad();return false;" style="display:none; "><img src="img/icon_new.png#" width="11" height="15" style="padding:1px 0px 1px 0px;"/>Download</button>
    3.63 +       <div id="expiration" style="display:none;">Expires: 
    3.64 +       <select id="pasteExpiration" name="pasteExpiration">
    3.65 +         <option value="5min">5 minutes</option>