You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.6 KiB
70 lines
1.6 KiB
<!DOCTYPE html> |
|
<html lang="jp"> |
|
<head> |
|
<title>Editor Test</title> |
|
<meta http-equiv="Content-Type" content="text/html; charset=Shift-JIS"/> |
|
|
|
<script type="text/javascript" src="../boilerplate.js"></script> |
|
|
|
<script type="text/javascript"> |
|
require([ |
|
"doh/runner", |
|
"dojo/parser", |
|
"dijit/registry", |
|
"dijit/Editor", |
|
"dojo/domReady!" |
|
], function(doh, parser, registry){ |
|
|
|
doh.register("parse", function(){ |
|
parser.parse(); |
|
}); |
|
|
|
|
|
doh.register("test value", [ |
|
{ |
|
name: "test value", |
|
timeout: 10000, |
|
runTest: function(){ |
|
var d = new doh.Deferred(); |
|
|
|
|
|
setTimeout(d.getTestCallback(function(){ |
|
var value = registry.byId('editor').get('value'); |
|
doh.is("日本語", value ); |
|
|
|
registry.byId('editor').set('value', 'こんにちは'); |
|
value = registry.byId('editor').get('value'); |
|
doh.is("こんにちは", value ); |
|
|
|
registry.byId('editor').set('value', '日本語'); |
|
}), 2000); |
|
|
|
return d; |
|
} |
|
} |
|
]); |
|
|
|
doh.run(); |
|
}); |
|
</script> |
|
</head> |
|
<body class="claro" role="main"> |
|
<script type="dojo/require"> |
|
registry: "dijit/registry" |
|
</script> |
|
<form method="get"> |
|
<p> |
|
Plain text: 日本語 |
|
</p> |
|
|
|
<p> |
|
Same text should show up in the Editor: |
|
</p> |
|
<div id="editor" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor", name:"field"'>日本語</div> |
|
<input type="submit" value="Save" /> |
|
<button type=button onclick="console.log(registry.byId('editor').get('value'))">getValue</button> |
|
<button type=button onclick="registry.byId('editor').set('value', 'こんにちは')">set value to こんにちは</button> |
|
|
|
</form> |
|
</body> |
|
</html>
|
|
|