hyphen
05-28-2005, 03:12 AM
Hi
I'm trying to create a bloging bookmarklet for use with my geeklog site.
I have it functioning with a popup window that shows the content to send and allows for modifications, and there is a submit button that sends it to the blogs php script. The php script accepts the data and your left at the preview story screen, essentially the same thing as the popup i'm triggering.
I would like to remove the first "verification" stage, and just have the form autosubmit and popup the php script in a new window.
this is what i'm using now unwrapped...to do the bookmarklet it has to be one continuous line of code, to make things easier to view I formated it here
javascript:
u=document.location.href;
var t=document.title;
sr=window.getSelection();
var f='width=600,height=600,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=1,resizable =1';
var s=window.open('','Title',f);with(s.document){write('
<html><title>geekloglette</title>
<body style=margin: 0px 0px 0px 0px;background-color:#FFCC00>
<form action=%22http://SITE.URL/PATH_TO_GEEKLOG_ROOT/submit.php%22 method=%22post%22>
<table border=%220%22 cellspacing=%220%22 cellpadding=%223%22>
<tr>
<td align=%22right%22>
<b>Title:</b>
</td>
<td>
<input type=%22text%22 size=%2236%22 maxlength=%2296%22 name=%22title%22 value='+t+'>
</td>
</tr>
<tr>
<td align=%22right%22>
<b>Topic:</b>
</td>
<td>
<select name=tid>
<option value=%22TOPIC1%22>TOPIC1</option>
<option value=%22TOPIC2%22>TOPIC2</option>
<option value=%22TOPIC3%22>TOPIC3</option>
</select>
</td>
</tr>
<tr valign=%22top%22>
<td align=%22right%22>
<b>Story:</b>
</td>
<td>
<textarea name=%22introtext%22 cols=%2245%22 rows=%2212%22 wrap=%22virtual%22>'+sr+'<BR><a href=%22'+u+'%22 target=_blank>'+t+'</a>
</textarea>
</td>
</tr>
<tr valign=%22top%22>
<td align=%22right%22>
<b>Post Mode:</b>
</td>
<td>
<select name=%22postmode%22>
<option value=%22html%22 selected=%22selected%22>HTML </option>
</select>
<br>
</td>
</tr>
<tr>
<td align=%22center%22 colspan=%222%22>
<input type=%22hidden%22 name=%22type%22 value=story>
<input type=%22hidden%22 name=%22uid%22 value=%222%22>
<input type=%22hidden%22 name=%22date%22 value=%22%22>
<input name=%22mode%22 type=%22submit%22 value=%22Preview%22>
</td>
</tr>
</table>
</form>
</body>
</html>');
void(close())}
i've tried naming the form "form" and adding this function
function submitForm(){
document.form.submit();
}
and calling it from the body with onload=
and i've tried reading in the data before the body call with a function like this
function autoSubmit ()
{
document.Form.title.value = '+t+';
document.Form.introtext.value = '+sr+';
document.Form.submit();
}
<body onLoad="autoSubmit();">
<form name="Form" action="site.url/submit.php">
<input type="title" value= "" />
<input type="introtextt" value= "" />
</form>
</body>
neither of these worked...the first one had no effect at all, and the second one doesn't seem to peform the action call.
any ideas?
i'm kinda stuck....
I'm trying to create a bloging bookmarklet for use with my geeklog site.
I have it functioning with a popup window that shows the content to send and allows for modifications, and there is a submit button that sends it to the blogs php script. The php script accepts the data and your left at the preview story screen, essentially the same thing as the popup i'm triggering.
I would like to remove the first "verification" stage, and just have the form autosubmit and popup the php script in a new window.
this is what i'm using now unwrapped...to do the bookmarklet it has to be one continuous line of code, to make things easier to view I formated it here
javascript:
u=document.location.href;
var t=document.title;
sr=window.getSelection();
var f='width=600,height=600,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=1,resizable =1';
var s=window.open('','Title',f);with(s.document){write('
<html><title>geekloglette</title>
<body style=margin: 0px 0px 0px 0px;background-color:#FFCC00>
<form action=%22http://SITE.URL/PATH_TO_GEEKLOG_ROOT/submit.php%22 method=%22post%22>
<table border=%220%22 cellspacing=%220%22 cellpadding=%223%22>
<tr>
<td align=%22right%22>
<b>Title:</b>
</td>
<td>
<input type=%22text%22 size=%2236%22 maxlength=%2296%22 name=%22title%22 value='+t+'>
</td>
</tr>
<tr>
<td align=%22right%22>
<b>Topic:</b>
</td>
<td>
<select name=tid>
<option value=%22TOPIC1%22>TOPIC1</option>
<option value=%22TOPIC2%22>TOPIC2</option>
<option value=%22TOPIC3%22>TOPIC3</option>
</select>
</td>
</tr>
<tr valign=%22top%22>
<td align=%22right%22>
<b>Story:</b>
</td>
<td>
<textarea name=%22introtext%22 cols=%2245%22 rows=%2212%22 wrap=%22virtual%22>'+sr+'<BR><a href=%22'+u+'%22 target=_blank>'+t+'</a>
</textarea>
</td>
</tr>
<tr valign=%22top%22>
<td align=%22right%22>
<b>Post Mode:</b>
</td>
<td>
<select name=%22postmode%22>
<option value=%22html%22 selected=%22selected%22>HTML </option>
</select>
<br>
</td>
</tr>
<tr>
<td align=%22center%22 colspan=%222%22>
<input type=%22hidden%22 name=%22type%22 value=story>
<input type=%22hidden%22 name=%22uid%22 value=%222%22>
<input type=%22hidden%22 name=%22date%22 value=%22%22>
<input name=%22mode%22 type=%22submit%22 value=%22Preview%22>
</td>
</tr>
</table>
</form>
</body>
</html>');
void(close())}
i've tried naming the form "form" and adding this function
function submitForm(){
document.form.submit();
}
and calling it from the body with onload=
and i've tried reading in the data before the body call with a function like this
function autoSubmit ()
{
document.Form.title.value = '+t+';
document.Form.introtext.value = '+sr+';
document.Form.submit();
}
<body onLoad="autoSubmit();">
<form name="Form" action="site.url/submit.php">
<input type="title" value= "" />
<input type="introtextt" value= "" />
</form>
</body>
neither of these worked...the first one had no effect at all, and the second one doesn't seem to peform the action call.
any ideas?
i'm kinda stuck....