JSL zum Schreiben von HTML.
@cbaril hat ein Foliendeck für die JMP-Tipp-des-Tages-Artikel zur Ausführung im Kioskmodus angefordert . Die Tipps werden in einem JMP-Installationsverzeichnis als HTML-Dateien gespeichert, die in einem Browser angezeigt werden. Hier ist eine JSL, die eine index.html-Datei erstellt, um die Tipps in einer Schleife abzuspielen. Hier gibt es wirklich nicht viel JSL: Laden Sie die Dateinamen und fügen Sie sie in eine HTML-/JavaScript-Vorlage ein, schreiben Sie das Ergebnis auf die Festplatte und öffnen Sie es in einem Browser. Der größte Teil der Magie liegt im CSS und JavaScript; Google war mein Freund. Sie müssen das Verzeichnis „Tipp des Tages“ für Ihren Computer anpassen. Ich habe es nur mit FireFox und einigen anderen Browsern getestet. Sie können den 1,5-s-Übergang (zwei Stellen) und die 10-s-Verzögerung (eine Stelle, 10000 ms) ändern.
If( JMP Version() < "16", Throw( "This JSL needs JMP 16 or greater" ) );
todd = Match( Left( JMP Version(), 2 ),
"16", "C:\Program Files\SAS\JMP\16\Tip of the Day\",
"17", "C:\Program Files\SAS\JMP\17\Tip of the Day\",
"18", "C:\Program Files\JMP\JMPEA\18\Tip of the Day\",
Throw( "open the jsl and add the tip file location for JMP " || JMP Version() )
);
If( !Directory Exists( todd ), Throw( "Can't find " || todd ) );
todd = Substitute( todd, "\", "/" );
filelist = Filter Each( {f}, Files In Directory( todd ), Ends With( f, ".htm" ) );
filelist = Transform Each( {f}, filelist, "'file://" || todd || f || "'" );
html = Save Text File(
"$temp/index.html",
Eval Insert(
"
<STYLE>
.container_row{
display: grid;
}
.layerVisible, .layerHidden{
grid-column: 1;
grid-row: 1;
}
.layerVisible {
opacity: 1.0;
transition: opacity 1.5s ease-in-out;
}
.layerHidden {
opacity: 0.0;
transition: opacity 1.5s ease-in-out;
}
</STYLE>
<TITLE>JMP ^left(jmpversion(),2)^ Tipps</TITLE>
<DIV class="container_row">
<DIV class="layerVisible">
<IFRAME id="if_1" src="https://community.jmp.com/" style="width: 2500px;height: 2000px;float: left;margin: 20px;"></IFRAME>
</DIV>
<DIV class="layerHidden">
<IFRAME id="if_2" src="https://community.jmp.com/" style="width: 2500px;height: 2000px;float: left;margin: 20px;"></IFRAME>
</DIV>
</DIV>
<SCRIPT type="text/javascript">
/*
http://www.dynamicdrive.com/forums/showthread.php?73827-Java-Script-for-cycling-through-pages
https://stackoverflow.com/questions/59940969/looking-to-do-transitions-between-iframes-using-javascript
https://stackoverflow.com/questions/6780614/css-how-to-position-two-elements-on-top-of-each-other-without-specifying-a-hei
https://stackoverflow.com/questions/507138/how-to-add-a-class-to-a-given-element
(and others for css transition opacity)
*/
var pages = [
^concatitems(filelist,\!",\!")^
];
var p = 0;
var if_front = document.getElementById('if_1');
var if_back = document.getElementById('if_2');
function loadIframe() {
var page = pages[p];
p = (p+1) % pages.length;
var a = document.createElement('a');
a.href = page;
if_front.src=a;
if_front.parentNode.classList.add('layerVisible');
if_front.parentNode.classList.remove('layerHidden');
if_back.parentNode.classList.add('layerHidden');
if_back.parentNode.classList.remove('layerVisible');
var temp = if_front;
if_front = if_back;
if_back = temp;
setTimeout(loadIframe, 10000); // 1/1000 seconds
}
loadIframe();
</SCRIPT>
"
)
);
Web( html );