onLoadDFrame.html

<HTML>

<HEAD>

<script>var dFrameFilePath = '../../../../../dFrame/'</script>

<script language="Javascript" src="../../../../../dFrame/dFrame/lib/DFrameAPI.js"></script>

 

<script language="Javascript">

     //Style

     DFrameAPI.include('dFrame/styles/blue/styleBlue.js')          )

 

     DFrameAPI.onLoad = function(){   

          var dFrame = new DFrame([10, 10, 90, 90], 'onLoadDFrame.html', dFrameStyle)

          dFrame.addButton('Open a dFrame with a document', 'createDFrame("./onLoadDFrame/document.html")')

          dFrame.addButton('Open a dFrame with a form', 'createDFrame("./onLoadDFrame/form.html")')

          dFrame.addText([5, 5], 'The onLoadDFrame function of each inserted page will set a background color<br>depending on the existance of a form.')

          dFrame.show()

     }

     function createDFrame(url) {

          dFrameStyle.setIndentX(40)

          dFrameStyle.setIndentY(40)

         

          var dFrame = new DFrame([30, 30, 70, 70], 'Test for onLoadDFrame', dFrameStyle)

          dFrame.setURL(url)

     }

</script>

</HEAD>

</HTML>

document.html

<HTML>

<HEAD>

<script>

     function onLoadDFrame() {

          if (thisDFrame.getEditMode()) {

              alert('onLoadDFrame function:\nFound a form in the page\nGoing to set a red background.')

              thisDFrame.setContentBgColor('red')

              thisDFrame.setTitle('Document')

          } else {

              alert('onLoadDFrame function:\nDid not found form in the page\nGoing to set a blue background.')

              thisDFrame.setContentBgColor('blue')

              thisDFrame.setTitle('Form') 

          }

     }

</script>

</HEAD>

<BODY>

This is a document

</BODY>

</HEAD>

</HTML>

form.html

<HTML>

<HEAD>

<script>

     function onLoadDFrame() {

          if (thisDFrame.getEditMode()) {

              alert('onLoadDFrame function:\nFound a form in the page.\nGoing to set a red background.')

              thisDFrame.setContentBgColor('red')

              thisDFrame.setTitle('Document')

          } else {

              alert('onLoadDFrame function:\nDid not found form in the page.\nGoing to set a blue background.')

              thisDFrame.setContentBgColor('blue')

              thisDFrame.setTitle('Form') 

          }

     }

</script>

</HEAD>

<BODY BGCOLOR=BLUE>

<form Method=post Action="null action for this form"><input type=text value="This is a form"></form>

</BODY>

</HEAD>

</HTML>