On Aug 18, 12:26 pm, "Edward K. Ream" <[email protected]> wrote:

> It would be good to determine the minimum files needed to host a
> screenbook.
>
> Here is sbook1.css:

And here is http://www.3dtree.com/ev/e/sbooks/leo/sbook.js:

// Scripts copyright 2000 JSL www.jserv.com
// Reuse permitted as long as credit is given to source.

//navigate to two side-by-side windows
function twogo(slidenum) {


   var iColl = document.images;
   var imgsrc;

   if (slidenum < 0) {
     for (i = 0; i < iColl.length; i++) {
       imgsrc = iColl[i].src;
       if (imgsrc.indexOf('redtri.gif', 0) != -1) {
          slidenum = i + 3 + slidenum;
          break;
       } else {
       }
     }
   }

   if (slidenum > iColl.length) {slidenum = iColl.length}
   if (slidenum < 1) {slidenum = 1}

   var root = 'slide';
   if (slidenum < 10) root = root + '0';
   parent.left.location = root + slidenum + '.htm';
   parent.right.location = 'final/' + root + slidenum + '.htm';

   for (i = 0; i < iColl.length; i++) {
      if (i == slidenum - 1) {
         iColl[i].src = '../../../../redtri.gif';
      } else {
         iColl[i].src = '../../../../whitetri.gif';
      }
   }

}

function hilite(me) {


   //hilite selected toc item.
   var aColl = document.getElementsByTagName("A");

   for (i = 0; i < aColl.length; i++) {
      a = aColl[i];
      a.parentNode.className = 'level4';
   }
   me.parentNode.className = 'hilite1';

}

function relocateNoFrame(URL) {
  //if (self != top) top.location = self.location;
}

// for the frames menu
function sync() {

  //sync toc
  var url, s, ss;
  if (window == top) return 0;
  s = parent.location;
  url = s.toString();
  i = url.indexOf('?vernum');
  if (i != -1) return 0;
  ss = url.split("?");
  if (ss.length == 1) return 0;
  s = ss[1];
  var path = ss[0];
  var b = path.lastIndexOf("/");
  path = path.substr(0,b);
  path += "/";
  ss = s.split("=");
  s = ss[1];
  var folder;
  if (s[0] == 'f') {
     folder = ss[1];
  }
  folder = path + ss[1];
  var firstpage = path + "slide01.htm";
  parent.mainFrame.location.href = folder;
  firstpage = firstpage.toLowerCase();

  //scroll menu
  var a;
  var aColl = document.getElementsByTagName("A");
  for (i = 0; i < aColl.length; i++) {

     //a = aColl[i];
     //url = a.href;
     //url = url.toLowerCase();
     //re = /javascript:select_ie\('/;
     //url = url.replace(re, "");
     //re = /'\)/;
     //url = url.replace(re, "");
     if (firstpage.indexOf(url, 0) != -1) {
       location.href = a.name;
       a.parentNode.className = 'hilite1';
     } else {
     }

  }
  return 1;
}
// for the bookmarking function, hilite the toc entry
function sync2() {

  var a;
        if (location.href.match(/sb_slide/)) {
    var sb_slide = location.href.match(/\?sb_slide=(.*)/)[1];
  } else {
        return;
  }
  var aColl = document.getElementsByTagName("A");
  var url;
  for (i = 0; i < aColl.length; i++) {
     a = aColl[i];
     url = a.href;
     if (url.indexOf(sb_slide, 0) != -1) {
       a.parentNode.className = 'hilite1';
     }

  }
  //alert("A bookmarkable URL has been created for this page. \nPress
Ctl-D to add this page to your bookmarks.");
  return 1;
}

function setPicWidth(w) {
  SetCookie('sbPicWidth', w, expiry);
}

function setFont(font) {
   SetCookie('sbFont', font, expiry);
}

function setFontSize(fontSize) {
  SetCookie('sbFontSize', fontSize, expiry);
}


function keystrokes(e) {

        try {

        var key = window.event ? window.event.keyCode : e.which;

  if (key == 39) { // right arrow
        navIndex ++;
        if (navIndex > 7) navIndex = 7;
        (navLinks[navIndex].focus());
        return;
  }
  if (key == 37) { // left arrow
        navIndex --;
        if (navIndex < 0) navIndex = 0;
        (navLinks[navIndex].focus());
        return;
  }
  if (key == 13) {return true;}


        newIndex = 0;
        if (key == 32 ) { // space key
                newIndex = myIndex++;
        }
        if (key == 33 ) { // page up
                newIndex = myIndex++;
        }
        if (key == 34 ) { // page down
                myIndex--;
        }
        if (key == 8 ) { // back space
                myIndex--;
        }
        if (key == 36 ) { // home
                myIndex = 1;
        }
        if (key == 35 ) { // end
                myIndex = lastIndex
        }
  if (key == 9) { // tab
        parent.leftFrame.focus();
  }


  if (myIndex > lastIndex) {myIndex = lastIndex; return;}
  if (myIndex < 1) {myIndex = 1; return;}

  if (myIndex < 10) {myIndex = "0" + myIndex;}
        document.location.href = "slide" + myIndex + ".htm";
        return false;

} catch (e) {}

}

myIndex = 1;
lastIndex = 1;
navLinks = null;
navIndex = -1;

function slideLoad() {
   navIndex = -1;
   var divs = document.getElementsByTagName('DIV');
   var pageIndexes;
   for (i = 0; i < divs.length; i++) {
          if (divs[i].className == 'pageCount') {
                pageIndexes = divs[i].innerHTML;
      }
   }
   try {
           myIndex = pageIndexes.match(/(\d+)\sof\s(\d+)/)[1];
           lastIndex = pageIndexes.match(/(\d+)\sof\s(\d+)/)[2];
           navLinks = document.getElementsByTagName('A');
   } catch (e) {}
}

function init2() {

   document.onkeydown = keystrokes;
   window.onload = slideLoad;

   var f = GetCookie('sbFont');
   if (f == null) return 0;
   var s = GetCookie('sbFontSize');

//   document.write("<style type='text/css'>.cp {font-family:" + f + "}
</style>");
   document.write("<style type='text/css'>p {font-size:" + s + "pt;
font-family:" + f + "}</style>");
   document.write("<style type='text/css'>li {font-size:" + s + "pt;
font-family:" + f + "}</style>");
   document.write("<style type='text/css'>ul {font-size:" + s + "pt;
font-family:" + f + "}</style>");
   return 1;

}

//ie only, not currently in use
function init() {

   var f = GetCookie('sbFont');
   var s = GetCookie('sbFontSize');

   var obj = document.all.item("pagetext");
   if (obj != null) {
        obj.style.fontFamily = f;
        obj.style.fontSize = s + "pt";
   } else {
   }

}


// cookies.js
// Derived from the Bill Dortch code at http://www.hidaho.com/cookies/cookie.txt

var today = new Date();
var expiry = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);

function getCookieVal (offset) {
        var endstr = document.cookie.indexOf (";", offset);
        if (endstr == -1) { endstr = document.cookie.length; }
        return unescape(document.cookie.substring(offset, endstr));
        }

function GetCookie (name) {
        var arg = name + "=";
        var alen = arg.length;
        var clen = document.cookie.length;
        var i = 0;
        while (i < clen) {
                var j = i + alen;
                if (document.cookie.substring(i, j) == arg) {
                        return getCookieVal (j);
                        }
                i = document.cookie.indexOf(" ", i) + 1;
                if (i == 0) break;
                }
        return null;
        }

function DeleteCookie (name,path,domain) {
        if (GetCookie(name)) {
                document.cookie = name + "=" +
                ((path) ? "; path=" + path : "") +
                ((domain) ? "; domain=" + domain : "") +
                "; expires=Thu, 01-Jan-70 00:00:01 GMT";
                }
        }

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function sb_bookmark (me) {

  var myUrl = me.window.location.href;
  var pageNum = myUrl.match(/.*(\d\d)\.htm/)[1];

  var folders = myUrl.split(/\//);
  var length = (folders.length);
  var partialUrl = folders[length-5];
  for (i = length - 4; i < length; i++) {partialUrl += "/" +
folders[i]}
  var topUrl = top.location.href;

  if (topUrl.match(/sb_slide/)) {
        topUrl = topUrl.replace(/[\?&]sb_slide.*/,'');
  }
  var bookmarkableUrl = "";
  if (topUrl.match(/\?/)) {
    bookmarkableUrl = topUrl + "&sb_slide=" + partialUrl;
  } else {
        bookmarkableUrl = topUrl + "?sb_slide=" + partialUrl;
  }
  top.location.href = bookmarkableUrl;
  title = (document.title.match(/(.*)\:/)[1]) + " Page " + pageNum;
  setBookmark(bookmarkableUrl, title);
}

function setBookmark(url,str){
  if(str=='')str=url;

  if ((document.all)) {
          window.external.AddFavorite(url,str);
  }else {
          alert('Your browser does not support auto bookmarking, however a
bookmarkable URL will now be created. \nPress CTRL - D to add this URL
to your bookmarks as soon as the new URL appears in your browser\'s
address bar.');
  }

}

EKR

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to