March 2017. wsurveyShowAlert: wSurvey javascript functions to show alerts in popup containers; and to show status messages in popup containers. Note: several of these functions work much better if a is specified (at the top of the html document). For example: June 2020: consider using ws_showContent instead -- it is more flexible. :::::: Summary of functions ::::::::::: init_showStuff(maxmove,clearEsc,noMin,noWindow,escList) -- intialize containers, and click handlers used by showAlertOnTop and showStatusMessage showAlertOnTop(amess,aopts,doAppend,dofade,cancelFade,dofunc) -- display a message in an "alert box" hideAlertOnTop() -- hide an alert box minimizeAlertOnTop(aid) -- minimize alert box maximizeAlertOnTop(this) -- maximize alert box resizeAlertOnTop(specs) -- resize & reposition alert on top showAlertBoxMoveStart(evt) -- handler used to enable move & resize of alert box showAlertMessageInNewWindow(aid,atitle,cssFiles,windowName) -- copy contents of alert box to a new browser window getAlertMessage(aid) -- return string containing content of showAlertBox. aid is optional (default is alertBoxMessage) showMessageHistory(viewName) -- open new window with list of messages written showAlertOnTop_doEsc(evt,akey) -- enable ESC key (to close showAlertOnTop box showStatusMessage(amess,aduration,dohold,boxnum) -- display a message in a status box. writeStatusMessage is a synonym. showStatusMessage2(amess,aduration,dohold,boxnum) -- display a message in a status box :::::::::::::: Details :::::::::::::::: init_showStuff(maxmove,clearEsc,noMin,noWindow,escList) -- intialize containers, and click handlers used by showAlertOnTop and showStatusMessage showStatusMessage and showAlertOnTop require containers (such as
s) with specific ids. They also work best when click handlers are assigned to them. init_showStuff will create these containers (if they do not exist). And it will assign appropriate click handlers. And it will create a few necessary classes. THUS: if you use init_showStuff -- you should NOT specify the containers (init_showStuff will do it for you). Maxmove is optional. If specified, it should be an integer. It specifies the maximum pixel move -- anything bigger causes a "move" or "resize" to close. This is to deal with a March 2016 Firefox bug: rapid movements can break the "mouseup" and "mousedown" event handlers (causing the box to keep moving or resizing even after you take your hand off of the mouse!) Alternatively: do not specify, or specify a '0', and a non-visible