Michael Morris
01-12-2007, 05:33 PM
I recently released this mod.
https://vborg.vbsupport.ru/showthread.php?t=136161
This thread is to discuss things that can be done with the library the plugin uses outside the scope of the plugin itself. I wrote a small transition library for this mod that others can feel free to use. This thread is to discuss the use of that library. Note that nothing here functions without the mod first being installed.
This is a javascript library so using it will involve template edits only.
function Scriptaculous_init()
This executes a fade the screen in effect, provided you wrapped the whole page in a primary_window div. If you don't want this effect remove the "display: none;" property from the primary_window div and omit this line in the footer. However, note that in future versions of the vb/scriptalicious library this will have more things to do. First among them is I plan on writting an extension that will allow the user to set the fade times in the admincp. For these to have an effect they'll need to be parsed out of an external javascript (putting the vars inline in a template is doable but clumsy).
function scriptaculous_log_out()
This fades the main screen to 50% opacity and launches a dialog for the user to log out with. Called from the navbar logout onclick property.
function dialogLaunch(ObjectId)
This fades the window, then pops up the specified element. To work you need to pass the id name to this function.
Consider the following example code.
<a href="#top" onClick="dialogLaunch('goingson');">Pop up What's Going On</a>
When the link is clicked the script finds the element (usually a div) with the id "goingson" and makes it appear. The layer would look like this.
<div id="goingson" style="display:none; position: absolute;">Text to show<a href="#top" onclick="dialogClose('goingson');">Close this popup</a></div>
As you can see above, you need to provide a button or link on the pop-up window to allow the user to close the popup-window once it is launched.
function dialogOpen(ObjectId)
Opens a dialog without the fade effect. This isn't meant to be called directly - it exists because dialogLaunch needs to call this in a setTimeout() function call.
function dialogClose(ObjectId)
Close the dialog and fade the main window back in.
function restoreMain()
Restores the main window back to 100% opacity. Called by dialogClose - this isn't meant to be directly called.
The above is provided in the hopes that it will prove useful. I started this as a separate thread from the module itself so that questions, answers and comments on the API won't get lost among the support questions in the mod thread itself.
https://vborg.vbsupport.ru/showthread.php?t=136161
This thread is to discuss things that can be done with the library the plugin uses outside the scope of the plugin itself. I wrote a small transition library for this mod that others can feel free to use. This thread is to discuss the use of that library. Note that nothing here functions without the mod first being installed.
This is a javascript library so using it will involve template edits only.
function Scriptaculous_init()
This executes a fade the screen in effect, provided you wrapped the whole page in a primary_window div. If you don't want this effect remove the "display: none;" property from the primary_window div and omit this line in the footer. However, note that in future versions of the vb/scriptalicious library this will have more things to do. First among them is I plan on writting an extension that will allow the user to set the fade times in the admincp. For these to have an effect they'll need to be parsed out of an external javascript (putting the vars inline in a template is doable but clumsy).
function scriptaculous_log_out()
This fades the main screen to 50% opacity and launches a dialog for the user to log out with. Called from the navbar logout onclick property.
function dialogLaunch(ObjectId)
This fades the window, then pops up the specified element. To work you need to pass the id name to this function.
Consider the following example code.
<a href="#top" onClick="dialogLaunch('goingson');">Pop up What's Going On</a>
When the link is clicked the script finds the element (usually a div) with the id "goingson" and makes it appear. The layer would look like this.
<div id="goingson" style="display:none; position: absolute;">Text to show<a href="#top" onclick="dialogClose('goingson');">Close this popup</a></div>
As you can see above, you need to provide a button or link on the pop-up window to allow the user to close the popup-window once it is launched.
function dialogOpen(ObjectId)
Opens a dialog without the fade effect. This isn't meant to be called directly - it exists because dialogLaunch needs to call this in a setTimeout() function call.
function dialogClose(ObjectId)
Close the dialog and fade the main window back in.
function restoreMain()
Restores the main window back to 100% opacity. Called by dialogClose - this isn't meant to be directly called.
The above is provided in the hopes that it will prove useful. I started this as a separate thread from the module itself so that questions, answers and comments on the API won't get lost among the support questions in the mod thread itself.