February 2002
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28  
Jan   Mar
 Find out about the XML feeds of this site  
21:23 03/06/02
#sidebar.txt
on now () { kernel (clock.now)}3/15/2002; 3:34:06 PM

 

Sporadic notes about working with radio No Simpler than this Radio:

Saturday, February 23, 2002

# 19:58  Radio 
an include-based sidebar. it handles #file's.  
 Asc Mo
on max.wl.sidebar.get(bgcolor="green", filename="",pta=html.getPageTableAddress()) {
 if filename=="" {
  if defined(pta^.radioResponder.atts.sidebar) {
   filename=pta^.radioResponder.atts.sidebar}
  else {
   return("")}};
 local {
  s=string (file.readwholefile (filename))};
 if string.length(s)>0 {
  s=html.processMacros(s,adrPageTable:pta);
  «bundle //format box
  s="<!--***SIDEBAR***-->\n<tr><td valign=top bgcolor=\""+bgcolor+"">n"+s+"\n</td></tr>\n<!--***/SIDEBAR***-->"};
 return(s)}

 

<#> 17:18  Radio 
from the 'yikes!' dept.  
 Asc Mo
another interesting thing to NOT DO is to open copied database. copies have roots with the same names as other roots you already know about :)  i've confused myself for several hours the other day before i came accros (finally!) a page describing CTRL-; .. a mini-script window. take that with msg(@wherever.you.think.you.should.be) and bingo! un-confusion. save yourself some time:

if you need to copy and paste from a copy of your data.. exit radio afterwards. do not count on you or it knowing which version of the data will be used by any other scripts you may want to run by hand - even if they are in that database.

(if you read the previous post you'll know i had a hard time with 'subtable not found' while working out the localized preferences thing) :)

# 17:03  Radio 
first notes on the integration of pop-out windows  
 Asc Mo
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!

# 16:03  Radio 
radio template consolidation and switchable 'functionality'  
 Asc Mo
radio desktopwebsite usability update

i've been ignoring css for layout and in my tinkering unified my template to each be just 19 lines long. #template is identical to #hometemplate. the desktopwebsite temple is a little longer at 26 lines and now contains a couple of usability tweaks.

two weeks or so ago i added a couple of if-statements to the desktopwebsite to make it respond to /?e, /?r, /?c by rendering the edit-box, the recent-posts, and cloud-info respectively. these work in combination too but i just bookmarked the simple versions. i mostly use http://127.0.0.1:5335/?e to add new posts, http://127.0.0.1:5335/?r to see only recent posts. i have a fast machine. this is just for 'focus', when i want it.

using my render-callback-tweak i replace the editlink with one created by the function i worked out just now. its what this post is about :)

my t^.editlink now conditionally opens a new window. I have editlinks on all locally rendered pages. if i edit from these i get a perfectly sized pop-up window that closes after the post while updating the page i started from.

to make this magic happen i made my template page-headers and sidebars conditional. they now disappear from popout edit-windows.. and they disappear from /?e and /?itemToEdit - new and edit post - windows as well. this is a good thing.

@ 15:34 03/15/02
© Michael Ax, 2002