The exStartSlideShow.ss script starts a slide show that
rotates through selected WebView pages in kiosk view every few seconds.
/*
* This file contains example script that uses the
* Application_UserChanged application event to run a
* slide show when the <slideshow> user logs in.
*
* If you want to customize this function, make a copy
* of this file and add your code to the copy. Do not
* edit the original, as your changes will be destroyed
* when you update the application.
*/
/*
function Application_UserChanged(userName)
{
// In V10, userName includes the organization
// name, e.g., "Local/slideshow"
if (userName == "slideshow")
{
WV.ExecuteCommand("EnterRunMode", true);
WV.ExecuteCommand("ToggleKioskView", true);
WV.ExecuteCommand("ToggleScriptDebugWindow", false);
var pages = new List<|string|>();
pages.Add("Common/Cogent/Circular Gauges");
pages.Add("Common/Cogent/Trend Charts");
pages.Add("Common/Cogent/Water Treatment");
wvSlideShow.EmitDebugMessages = false;
// Start the slide show, advancing every 15 seconds.
wvSlideShow.Start(pages, 15);
}
}
*/
You can make a copy of this script to your user content file location, uncomment the function code, and edit the user name, pages, and number of seconds as needed. Here are some additional tips:
It’s a good idea to create a DataHub
user in DataHub
Security that is specific to your purpose, i.e., don’t use your
slideshowadmin user.
The userName parameter is case-sensitive. If you want a
name with upper-case characters, like
, you can
change this line of the code: SlideShow
if (username == "slideshow")
To this:
if (username.ToLower() == "slideshow")
You can modify the script to access any of your own web pages that are
listed in the WebView My Pages drop-down list by editing a
pages.Add() line in the code, like this:
pages.Add("Users/username/Pages/pagename");That path can be modified for other page locations, if necessary.
The slide show functionality implemented by the
wvSlideShow object in the script is defined in
Scripts/Cogent/wvSlideShow.ss. You can review that
file to understand more about this script.