This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
810efc0
commit ecf1664
Showing
6 changed files
with
3,610 additions
and
811 deletions.
There are no files selected for viewing
2,691 changes: 2,691 additions & 0 deletions
2,691
website-scripts/weather-display-templates/my-website-saratoga/ajaxWDwx3.js
Large diffs are not rendered by default.
Oops, something went wrong.
109 changes: 109 additions & 0 deletions
109
website-scripts/weather-display-templates/my-website-saratoga/ajaxgizmo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
// <![CDATA[ | ||
// ---------------------------------------------------------------------- | ||
// Rotate content display -- Ken True -- saratoga-weather.org | ||
// This script is for use with the ajaxwx.js to create a rotating gizmo | ||
// display of AJAX conditions marked with <span class="contentN" style="display: none"></span> | ||
// where N=0..8 | ||
// | ||
// Version 1.00 - initial release | ||
// Version 1.01 - changed to look for class="ajaxcontentN" to prevent interference with buoy-data.php | ||
// Version 1.02 - fixed rotation for Internet Explorer 8 | ||
// | ||
// | ||
// --------- begom settomgs --------------------------------------------------------------- | ||
var ajaxrotatedelay=4000; // Rotate display every 4 secs (= 4000 ms) | ||
var showUV = false ; // set to false if you don't have a Davis VP UV sensor | ||
// --------- emd settomgs ----------------------------------------------------------------- | ||
// | ||
// you shouldn't need to change things below this line | ||
// | ||
var ie4=document.all; | ||
var browser = navigator.appName; | ||
var ie8 = false; | ||
if (ie4 && /MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x; | ||
var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number | ||
if (ieversion>=8) { | ||
ie4=false; | ||
ie8=true; | ||
} | ||
} | ||
var ajaxcurindex = 0; | ||
var ajaxtotalcontent = 0; | ||
var ajaxrunrotation = 1; | ||
var browser = navigator.appName; | ||
|
||
function get_content_tags ( tag ) { | ||
// search all the span tags and return the list with class=tag | ||
// | ||
if (ie4 && browser != "Opera" && ! ie8) { | ||
var elem = document.getElementsByTagName('span'); | ||
var lookfor = 'className'; | ||
} else { | ||
var elem = document.getElementsByTagName('span'); | ||
var lookfor = 'class'; | ||
} | ||
var arr = new Array(); | ||
var i = 0; | ||
var iarr = 0; | ||
|
||
for(i = 0; i < elem.length; i++) { | ||
var att = elem[i].getAttribute(lookfor); | ||
if(att == tag) { | ||
arr[iarr] = elem[i]; | ||
iarr++; | ||
} | ||
} | ||
|
||
return arr; | ||
} | ||
|
||
|
||
function ajax_get_total() { | ||
ajaxtotalcontent = 8; // content0 .. content7 | ||
if (showUV) { ajaxtotalcontent++ ; } // UV display is in last content area | ||
} | ||
|
||
function ajax_contract_all() { | ||
for (var y=0;y<ajaxtotalcontent;y++) { | ||
var elements = get_content_tags("ajaxcontent"+y); | ||
var numelements = elements.length; | ||
// alert("ajax_contract_all: content"+y+" numelements="+numelements); | ||
for (var index=0;index!=numelements;index++) { | ||
var element = elements[index]; | ||
element.style.display="none"; | ||
} | ||
} | ||
} | ||
|
||
function ajax_expand_one(which) { | ||
ajax_contract_all(); | ||
var elements = get_content_tags("ajaxcontent"+which); | ||
var numelements = elements.length; | ||
for (var index=0;index!=numelements;index++) { | ||
var element = elements[index]; | ||
element.style.display="inline"; | ||
} | ||
} | ||
function ajax_step_content() { | ||
ajax_get_total(); | ||
ajax_contract_all(); | ||
ajaxcurindex=(ajaxcurindex<ajaxtotalcontent-1)? ajaxcurindex+1: 0; | ||
ajax_expand_one(ajaxcurindex); | ||
} | ||
function ajax_set_run(val) { | ||
ajaxrunrotation = val; | ||
ajax_rotate_content(); | ||
} | ||
function ajax_rotate_content() { | ||
if (ajaxrunrotation) { | ||
ajax_get_total(); | ||
ajax_contract_all(); | ||
ajax_expand_one(ajaxcurindex); | ||
ajaxcurindex=(ajaxcurindex<ajaxtotalcontent-1)? ajaxcurindex+1: 0; | ||
setTimeout("ajax_rotate_content()",ajaxrotatedelay); | ||
} | ||
} | ||
|
||
ajax_rotate_content(); | ||
|
||
// ]]> |
Binary file modified
BIN
+23.9 KB
(410%)
...ite-scripts/weather-display-templates/my-website-saratoga/forecasticonmetar.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
website-scripts/weather-display-templates/my-website-saratoga/forecasticonnew.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.7 KB
website-scripts/weather-display-templates/my-website-saratoga/forecasticonnew.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.