root / trunk / tests / widget / test_ContentPane_executeScripts.html

Revision 5896, 2.2 kB (checked in by mumme, 2 years ago)

Fix #1412, fix typos, revert back event object to .text instead of ._text
rename addOnUnLoad to addOnUnload, my english sucks, deprecated the old addOnUnLoad, debug message instead of alerts in case of errors, fix for infinite recursion onContentError, global eval of scripts.

This patch have been waiting review and now passed by Bill, therefore the late checkin.

  • Property svn:eol-style set to native
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3<head>
4
5<title>ContentPane executeScripts Test</title>
6
7<script type="text/javascript">
8        var djConfig = {isDebug: true};
9</script>
10<script type="text/javascript" src="../../dojo.js"></script>
11<script language="JavaScript" type="text/javascript">
12        dojo.require("dojo.widget.LayoutContainer");
13        dojo.require("dojo.widget.LinkPane");
14        dojo.require("dojo.widget.ContentPane");
15        dojo.require("dojo.widget.FloatingPane");
16
17        // the floatingpane in this page tests global scripts
18        var str = "<scr"+"ipt>"
19                +"var testGlobalString = 'success!';"
20                +"function globalFunc(){"
21                +"      alert(testGlobalString);"
22                +"};"
23                +"</scr"+"ipt>"
24                +"<h3>scriptSeparation=false</h3>"
25                +"by setting this flag we eval scripts in global, "
26                +"please note that we loose all separation between scripts "
27                +"(one var with the same name will overwrite the other) "
28                +"and we loose the _container_ variable as that cant be unique for our script<br/>"
29                +"<a href='#' onclick='alert(testGlobalString);'>global var</a><br/>"
30                +"<a href='#' onclick='globalFunc();'>global function</a><br/>"
31                +"<a href='javascript:alert(testGlobalString);'>global var</a><br/>"
32        dojo.addOnLoad(function(){
33                dojo.widget.byType('floatingpane')[0].setContent(str);
34        });
35</script>
36
37</head>
38<body>
39This is a test for ContentPanes executeScripts, all the controll scripts are evaled contained in linkPane's scriptScope property
40<p>HTML before</p>
41<p>HTML before</p>
42<p>HTML before</p>
43
44<div dojoType="LayoutContainer"
45        layoutChildPriority='none'
46        style="border: 2px solid black; width: 90%; height: 300px; padding: 10px;">
47        <div dojoType="LinkPane" id='linkPane' layoutAlign="left" style="background-color: #b39b86; height: 250px; width: 200px;" executeScripts="true" href="scriptScope.html">
48        </div>
49        <div dojoType="ContentPane" id="docpane" layoutAlign="client" style="background-color: beige;" executeScripts="true">
50
51        </div>
52</div>
53
54<div dojoType="FloatingPane" style="width: 300px; height: 300px;"
55        title="Scripts evaled in global"  executeScripts="true" scriptSeparation="false"></div>
56
57<p>HTML after</p>
58<p>HTML after</p>
59<p>HTML after</p>
60
61</body>
62</html>
Note: See TracBrowser for help on using the browser.