[sailwave] Re: Scroll results for individual fleets

Richard.

I’m assuming you don’t want to be random and don’t want to scroll between series.

On that basis here is a js script that’ll do the job. Pop it in your html directory and call it scroller.js

Edit the classes (var bookmarks = to list all your classes you might want)

Edit the delay to be appropriate.

Now go to your C:\Program Files\Sailwave\Templates and edit Results.htm and under

add:

Save it.

Publish your file as normal but now access it by typing:

yourdomain/yourfile.html?scroll=true

If you don’t want to scroll just don’t add the ?scroll=true and it behaves like normal.

From here down is the JS File:

// Set some variables that are needed to define the operation of the script
var delay = 5000; //milli-seconds

// List of bookmarks to be followed
var bookmarks = [
#wayfarer”,
#topper”,
#dart”,
#dolphin
];

setTimeout(“scroller()”, delay);

function getUrlVars() {

var vars = {};

 var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&#]*)/gi, function(m,key,value) {
    vars[key] = value;

});

return vars;

}

function scroller() {
// Identify if scrolling enabled

var scroll = getUrlVars()[“scroll”];

if (scroll == “true”) {

// Carry out the reloading phase
// Identify the url of the calling page (without the bookmark)
var currentURL = window.location.href;

// Identify the current bookmark
var hash = window.location.hash ;

  for(var i=0; i
        if (bookmarks[i] == hash) { break; }
  }

// Identify the next bookmark
if (i < bookmarks.length -1) {
    i = i + 1 ;
} else {
    i = 0 ;
    }

window.location.hash=bookmarks[i];
window.location.reload();

} else {
// Do not reload the page

return;
}
}

Cool! I think you might have left out the line to put into the Sailwave results template as that seems to be blank.

Question re Javascript - on Richard's "live.html" page, when I "view source" in Firefox all I see is the HTML file that has the Javascript. I cannot figure out how to view the page source for what is actually shown on my screen. Is there an easy way to do that (I know I can edit my address bar to go to the page the Javascript says to call but I figured there should be some way to see the source for what my screen shows).

Art

···

On 5/7/2011 2:56 PM, Calum Polwart wrote:

Richard.

I'm assuming you don't want to be random and don't want to
scroll between series.

On that basis here is a js script that'll do the
job. Pop it in your html directory and call it scroller.js

Edit the
classes (var bookmarks = to list all your classes you might want)

Edit
the delay to be appropriate.

Now go to your C:Program
FilesSailwaveTemplates and edit Results.htm and under

add:

Save it.

Publish your file as normal but now access it by typing:

yourdomain/yourfile.html?scroll=true

If you don't want to scroll just
don't add the ?scroll=true and it behaves like normal.

From here down is

the JS File:

// Set some variables that are needed to define the
operation of the script
var delay = 5000; //milli-seconds

// List of
bookmarks to be followed
var bookmarks = [
  "#wayfarer",
  "#topper",

"#dart",
  "#dolphin"
  ];

setTimeout("scroller()", delay);

function
getUrlVars() {

  var vars = {};

  var parts =
window.location.href.replace(/[?&]+([^=&]+)=([^

  });

  return
vars;

}

function scroller() {
// Identify if scrolling enabled

var
scroll = getUrlVars()["scroll"];

if (scroll == "true") {

  // Carry out
the reloading phase
  // Identify the url of the calling page (without the
bookmark)
  var currentURL = window.location.href;

  // Identify the current
bookmark
  var hash = window.location.hash ;

  for(var i=0; i
  if
(bookmarks[i] == hash) { break; }
  }

  // Identify the next bookmark
  if
(i< bookmarks.length -1) {
  i = i + 1 ;
  } else {
  i = 0 ;

}

window.location.hash=bookmarks[i];
window.location.reload();

} else {

// Do not reload the page

return;
}

Looks like some tag parsing has stripped the line to add to the file. (makes sense or I could have injected some nasty into everyone’s email with it!)

So it should read under the section

insert:

(hopefully that gets through the tag parsing. BUT beware if you copy it over with cut n paste you may get “& lt” and “& gt” instead of left and right arrows to open and close the tag).

Calum

···

On Sat, 07 May 2011 15:39:38 -0700, Art Engel artengel123@earthlink.net wrote:

Cool! I think you might have left out the line to put into the Sailwave
results template as that seems to be blank.

Question re Javascript - on Richard’s “live.html” page, when I “view
source” in Firefox all I see is the HTML file that has the Javascript. I
cannot figure out how to view the page source for what is actually shown
on my screen. Is there an easy way to do that (I know I can edit my
address bar to go to the page the Javascript says to call but I figured
there should be some way to see the source for what my screen shows).

Art

On 5/7/2011 2:56 PM, Calum Polwart wrote:

Richard.

I’m assuming you don’t want to be random and don’t want to
scroll between series.

On that basis here is a js script that’ll do the
job. Pop it in your html directory and call it scroller.js

Edit the
classes (var bookmarks = to list all your classes you might want)

Edit
the delay to be appropriate.

Now go to your C:Program
FilesSailwaveTemplates and edit Results.htm and under

add:

Save it.

Publish your file as normal but now access it by typing:

yourdomain/yourfile.html?scroll=true

If you don’t want to scroll just
don’t add the ?scroll=true and it behaves like normal.

From here down is
the JS File:

// Set some variables that are needed to define the
operation of the script
var delay = 5000; //milli-seconds

// List of
bookmarks to be followed
var bookmarks = [
#wayfarer”,
#topper”,

#dart”,
#dolphin
];

setTimeout(“scroller()”, delay);

function
getUrlVars() {

var vars = {};

var parts =
window.location.href.replace(/[?&]+([^=&]+)=([^

});

return
vars;

}

function scroller() {
// Identify if scrolling enabled

var
scroll = getUrlVars()[“scroll”];

if (scroll == “true”) {

// Carry out
the reloading phase
// Identify the url of the calling page (without the
bookmark)
var currentURL = window.location.href;

// Identify the current
bookmark
var hash = window.location.hash ;

for(var i=0; i
if
(bookmarks[i] == hash) { break; }
}

// Identify the next bookmark
if
(i< bookmarks.length -1) {
i = i + 1 ;
} else {
i = 0 ;

}

window.location.hash=bookmarks[i];
window.location.reload();

} else {

// Do not reload the page

return;
}
}

Question re Javascript - on Richard’s “live.html” page, when I “view
source” in Firefox all I see is the HTML file that has the Javascript. I
cannot figure out how to view the page source for what is actually shown
on my screen. Is there an easy way to do that (I know I can edit my
address bar to go to the page the Javascript says to call but I figured
there should be some way to see the source for what my screen shows).

Not easily - the javascript is updating the content of with the new body. But it does it in the browser’s memory not the source file so you don’t see any source content… quite typical for ajax stuff…

You could write some js - to let you see the content of the body in memory as code rather than marked up but why go to the effort?

Calum