document updated 19 years ago, on Nov 25, 2005
drag_and_rename (506 characters)
// Upload the HTML associated with the selection to a CGI script.
// At 506 bytes, this works. A few more additions and it breaks...
//
void(q = '');
void(l = '');
// When no frames
f = document.frames;
if (f.length == 0)
{
q = document.selection.createRange().htmlText;
l = document.location;
}
// When there are frames
for (i=0; i<f.length; i++)
{
d = f[i].document;
q = d.selection.createRange().htmlText;
l = d.location;
if (q != '')
break;
}
// Display the results
if (q)
{
//alert(q);
d = window.open('', '').document;
//d.write(q);
d.writeln('<FORM METHOD=POST ACTION=http://68k.org/cgi-bin/cgiwrap/interiot/receive_img>'
+ '<INPUT TYPE=HIDDEN NAME=content>'
+ '<INPUT TYPE=HIDDEN NAME=base_href></FORM>');
d.forms[0][0].value = q;
d.forms[0][1].value = l;
d.forms[0].submit();
}