more usability notes.. news-aggregator modified to link to popup-windows when posting new items.
this lets me pop-open multiple candidates for posting and/or surfing. so far it rocks. had to figure out how to clear the aggregator's cache first.. then to modify my pop-up's javascript to optionally NOT refresh the window that opened it. it makes no sense to refresh the news-aggregator.. but it usually makes sense to refresh after you edit an older post. that said..
let me tell you about this javascript object model page. It brought to an end totally fruitless attempts at reading internet explorer settings. i'm no big expert in js but i went down so many wrong tracks until finally settling on the referrer-string to identify where i was.. on the first view of the page.. or the reload after posting. .. i suppose i didn't want it to be that simple: there's no way to see if the menubar is active in the ie browser. not from js. forget it. use the referrer.
anyhow, i want to take up a little more space about how i've structured this inside of radio.
first, for this to work i need to patch and track at least radio.html.viewNewsItems. I changed the end of the "bundle //add EDIT button, checkmark" to read:
«local(lnk="<a href=\"" + url + "" title="Add this story to your weblog.">" + postbuttonimg + "</a>")
local(lnk=max.wl.desktopwebsite.newspostlink.get(postbuttonimg,url));
add ("<td class=\"dwsTableCell" valign="top"><center>" +lnk+ checkmark + enclosure + "</center></td>")
this is a paste of the database node containing the function:
max.wl.desktopwebsite.newspostlink:
get script: (see below)
flPopOut boolean: true
params string: &popout
WindowOpenParams string: width=590, height=590, scrollbars=no, toolbar=no, directories=no, location=no, menubar=no, status=no
this is the function:
max.wl.desktopwebsite.newspostlink.get:
on get(linktext="",url="",title="Add this story to the weblog.")
{ with max.wl.desktopwebsite.newspostlink
{ if flPopOut
{ return max.link.popout(linktext,url+params,title,WindowOpenParams)
else { return max.link.href(linktext,url,title)}}}
by using a few more nodes i've structured this extension to mostly contain the things i dont want to tweak.. and to mostly expose the things i want to tweak. i dont even want to give this way of organizing my extensions and their settings any object type of name. its charming, its messy and it works to keep things simple for me. ok, i'll leave you with the .js included in pop-out pages:
<script>
<!--
var s="";
var n=0;
document.write('<script>s="'+document.referrer+'"</script>');
n=
s.indexOf("popout");
if (n>=0) {
n=
s.indexOf("reload");
if (n>=0) {
window.opener.history.go();
window.opener.status="Reloading...";}
window.close();}
-->
</script>
and my desktop template:
<%max.wl.head.get()%>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor=LIGHTGOLDENRODYELLOW>
<%if max.wl.desktopwebsite.IsPopOutPage(){return("")} else
{return(max.wl.GetRadioMenuBar("turquoise","black"))}%>
<!--***MAINTABLE***-->
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<%if !max.wl.desktopwebsite.IsPopOutPage(){return("")} else
{return(max.scripts.get("ClosePopupAfterPost"))}%>
<%if max.wl.desktopwebsite.IsItemEditPage() {return("")} else
{return(max.wl.leftcolumn.get(calendarUrlPrefix))}%>
<td valign="top" width=85%>
<!--***MAIN***-->
<%if max.wl.desktopwebsite.IsItemEditPage() {return("")} else
{return(
"<p align=\"right"><font size="+1"><i>"+description+"</i></a></font>"
+"<a href=\""+radio.weblog.getUrl()+""><font size="+2"><b>"+siteName+"</b></a>: </font></p>"
)}%>
<!--***BODYTEXT***-->
<%max.wl.desktopwebsite.get()%>
<!--***/BODYTEXT***-->
<!--***FOOTER***-->
</td></tr></table>
<!--***/MAINTABLE***-->
<%max.wl.copyright.get()%>
</body>
</html>
fwiw, this makes the popout and href links:
on popout(linktext="",url="",title="",params="", name="") {
local(s="");
if string.length(title)==0 {
s=s+" title=\""+title+"""};
s="<a"+s+" href=\"#" onclick="window.open('"+url+"','"+name+"','"+params+"'); return false">"+linktext+"</a>";
return(s)}
on href(linktext="",url="",title="") {
local(s="");
if string.length(title)==0 {
s=s+" title=\""+title+"""};
return "<a"+s+" href=\"" + url + "">" + linktext + "</a>"}
i'd love to hear your thoughts on this and the prior post. thanks!