Can the Advanced Layer Popup function be called from an external file?
Can the Advanced Layer Popup function be called from an external source?
Answer:
Yes, Advanced Layer Popup function can be saved into an external file.
To accomplished this you have to modify the code that is generated by Advanced Layer Popup.
The following code should be placed into external js file (For example aplFunction.js)
function dmxAdvLayerPopup(sTitle,sURL,sPopupName,sContent,
sClass,nPositionLeft,nPositionRight,nWidth,nHeight,nAutoCloseTime,
bDragable,bResizable,bOverlay,nOverlayOpacity,sIncomingEffect,sIncomingEffectEasing,
nIncomingEffectDuration,bFadeIn,sOutgoingEffect,sOutgoingEffectEasing,
nOutgoingEffectDuration,bFadeOut,sSlideEffect,nEffectTime,nSlideTime,bClosable,
bWireframe,bgContentColor)
{ // v1.05
var aURL, aSlides = sURL.split('|');
if (aSlides && aSlides.length > 1) {
aURL = [];
for (var si="0;si<aSlides.length;si++") {
var cf="aSlides"[si],nW='',nH='',nS='';
if (cf.substr(cf.length-1,1)==']') {
var bd="cf.lastIndexOf"('[');
if(bd>0){
var di="cf.substring"(bd+1,cf.length-1);
var da="di.split"('x');
nw="da"[0];nH=da[1];
if (da.length==3) ns="da"[2];
cf="cf.substring"(0,bd)
}
}
aURL[si] = new Object();
aURL[si].src = cf;
aURL[si].nWidth = (nW!=''?nW:nWidth);
aURL[si].nHeight = (nH!=''?nH:nHeight);
aURL[si].nDelay = (nS!=''?nS:nSlideTime);
}
} else aURL = sURL;
if (!cDMXPopupWindow) {
alert('The Advanced Layer Popup script is missing on your website!\nPlease upload the file ScriptLibrary/advLayerPopup.js to your live server.');
} else {
if (sClass == 'OS_Look') sClass = (navigator.userAgent.toLowerCase().indexOf('mac')!=-1?'dmxOSX':'dmxXP');
cDMXPopupWindow.buildWindow({sTitle: sTitle, sURL: aURL, sPopupName: sPopupName, sContent: sContent, sClass: sClass, aPosition: [nPositionLeft,nPositionRight], aSize: [nWidth,nHeight], nCloseDelay: nAutoCloseTime, bDragable: bDragable, bResizable: bResizable, bOverlay: bOverlay, nOverlayOpacity: nOverlayOpacity, sStartPosition: sIncomingEffect, sStartShowEffect: sIncomingEffectEasing, nIncomingEffectDuration: nIncomingEffectDuration, bFadeIn: bFadeIn, sEndPosition: sOutgoingEffect, sEndShowEffect: sOutgoingEffectEasing, nOutgoingEffectDuration: nOutgoingEffectDuration, bFadeOut: bFadeOut, sSlideEffect: sSlideEffect, nEffectTime: nEffectTime, nSlideTime: nSlideTime, bClosable: bClosable, bWireframe: bWireframe, sContentBgColor: bgContentColor });
}
document.MM_returnValue = false;
}
And the script tags should be replaced with a reference of the new file:
<script src="ScriptLibrary/alpFunction.js" type="text/javascript"></script>
DISCLAIMER:
This is extra complimentary content which purpose is to show additional usage that is not part of the product, i.e. it suggests tips for extending the functionality of the product by the users themselves.
It is provided "as is", without warranty of any kind, express or
implied , including but not limited to the warranties of
merchantability, fitness for a particular purpose and nonfringement of
third party rights.
DMXzone does not take responsibility to
support the suggested content to be fully compatible and working as
intended and does not provide support for extended functionality which
is not included in the current release of the extension.
It is highly recommended that only more advanced developers use it.
Comments
Be the first to write a comment
You must me logged in to write a comment.