> hello,
>
> i saw your post on the DQSQ-Devel archives and have been using your
anypop function. I have a few questions if i may:
>
> 1- why are graphics and links not working within a website that is
loaded in? i suspect it has to do with the base URL..in which case the
function woudl have to be modified to add the head html..correct?
It was really just the result of a musing. Instead of piping the result of
a SOAP/Webservice query as in DictionaryPop to the popup function I
downloaded a website and had it display the XML/XHTML code. I don't
remember the details and don't have the code handy on this machine but I
don't think it would be an easy feature to add.
> 2- is there anyway to get the popup window to stay open even when it looses
> focus when clickign on the desktop or another program? id like to implement
> a minibrowser..but it will only load local html documents.
Shouldn't be to hard, glancing over the original defer_tools.js file's
displayPopupMessage. Just mess with the dqsdMessagePopup.hide() method.
(Oops, evidently not, see other message by Shawn.)
> 3- is there anyway to resize the popup window? using the users drag of
the sides and top,etc.
Sure that's easy, dqsdMessagePopup.show(x, y, Width, Height,
document.body) is the function and parameters you want, I think. Double
check params though.
I have a newer version, much improved, still alpha quality, I just grabbed
from my other pc and it is attached. It's hacky but kind of neat and
useful for quick stuff besides that. Note you *NEED* to explicitly use a
flag to do anything otherwise it errs. Aliases were my way of using it. I
don't remember what issues I was having fixing that bug but I just coded
all the URLs I wanted into the javascript, not too hard to decipher that
much, take a look. It's been over a year since I've touched it so a few of
the decisions are sort of blurry and I have no idea what I've improved
since the listserv version, a few some major bugs for sure though.
Enjoy,
Thad Kerosky
<search function="anypop">
<name>AnyPop</name>
<description><strong>ALPHA 2, HACK</strong>. Load any website and pop it up in a window from the taskbar.<br/>
<div class="helpboxDescLabels">Usage:</div>
<table class="helpboxDescTable">
<tr><td>anypop [{/dic | /af | /ors |/news | /gg | /conv | /as}]</td></tr>
</table>
</description>
<category>Functions</category>
<contributor>Thad Kerosky</contributor>8:00 AM 9/30/2002
<dqsd_version>
<majorhi>3</majorhi>
<majorlo>0</majorlo>
<minorhi>0</minorhi>
<minorlo>25</minorlo>
</dqsd_version>
<script><![CDATA[
function anypop(q)
{
var apURL;
var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
if( nullArgs("anypop", q) )
var doNothing; //hmm
else
{
var args = parseArgs(q, "as, af, news, gg, dic, atm, conv, ors, task");
if( args.switches.length == 1 )
{
switch( args.switches[0].name )
{
case "as":
apURL = "http://www.alterslash.org";
break;
case 'af':
apURL = "http://www.acronymfinder.com/af-query.asp?String=exact&Acronym=" + args.q;
break;
case 'conv':
apURL = "http://www.convertit.com/Go/Entisoft/Measurement/Converter.ASP?From=" + args.q;
break;
case 'ors':
apURL = "http://www.oreillynet.com/search/?sp-k=articles&sp-q=" + args.q;
break;
case "news":
apURL = "http://news.google.com";
break;
case "gg":
apURL = "http://www.google.com/search?q=" + args.q;
break;
case "dic":
apURL = "http://www.askoxford.com/dictionary/"+ args.q;
break;
}
}
else
apURL = q;
}
xmlHttp.open( "GET", apURL, false );
//xmlHttp.setRequestHeader("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20021001 Phoenix/0.5");
xmlHttp.send();
var response = xmlHttp.responseText;
if ( response != '' )
{
// response = response.replace( /\n/g, '' ) // get rid of newlines
// .replace( /<script.*<\/script>/i, '' ) // get rid of SCRIPT tags
//.replace( /<img.*>+/g, '' ) // get rid of SCRIPT tags
}
//alert(response);
displayPopupHTML(response);
}
function displayPopupHTML( html)
{
var dqsdMessagePopup = window.createPopup();
var windowW = 610;
var dqsdMessagePopup = window.createPopup();
var dqsdMessagePopupBody = dqsdMessagePopup.document.body;
dqsdMessagePopupBody.innerHTML = html;
dqsdMessagePopup.document.body.style.border="outset 2px";
//dqsdMessagePopup.document.body.style.background='menu';
dqsdMessagePopup.document.body.style.overflowY='auto';
// Temporatily show the popup to determine the proper final
// height for the popup.
dqsdMessagePopup.show(0, 0, windowW, 0);
var windowH = 800//dqsdMessagePopupBody.scrollHeight + 40;
dqsdMessagePopup.hide();
// Put a cap on the popup height
windowH = windowH > window.screen.height-100 ? window.screen.height-100 : windowH;
dqsdMessagePopup.show((buttonalign == "left" ? 0 : document.body.clientWidth - windowW), -windowH, windowW, windowH, document.body);
}
]]></script>
</search>