1318 |
alexandre_ |
1 |
/*
|
|
|
2 |
Copyright (c) 2004-2006, The Dojo Foundation
|
|
|
3 |
All Rights Reserved.
|
|
|
4 |
|
|
|
5 |
Licensed under the Academic Free License version 2.1 or above OR the
|
|
|
6 |
modified BSD license. For more information on Dojo licensing, see:
|
|
|
7 |
|
|
|
8 |
http://dojotoolkit.org/community/licensing.shtml
|
|
|
9 |
*/
|
|
|
10 |
|
1422 |
alexandre_ |
11 |
|
|
|
12 |
|
1318 |
alexandre_ |
13 |
dojo.provide("dojo.widget.demoEngine.SourcePane");
|
|
|
14 |
dojo.require("dojo.widget.*");
|
|
|
15 |
dojo.require("dojo.widget.HtmlWidget");
|
|
|
16 |
dojo.require("dojo.io.*");
|
|
|
17 |
dojo.widget.defineWidget("my.widget.demoEngine.SourcePane", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<textarea dojoAttachPoint=\"sourceNode\" rows=\"100%\"></textarea>\n</div>\n", templateCssString:".sourcePane {\n\twidth: 100%;\n\theight: 100%;\n\tpadding: 0px;\n\tmargin: 0px;\n\toverflow: hidden;\n}\n\n.sourcePane textarea{\n\twidth: 100%;\n\theight: 100%;\n\tborder: 0px;\n\toverflow: auto;\n\tpadding: 0px;\n\tmargin:0px;\n}\n\n* html .sourcePane {\n\toverflow: auto;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/SourcePane.css"), postCreate:function () {
|
|
|
18 |
dojo.html.addClass(this.domNode, this.domNodeClass);
|
|
|
19 |
dojo.debug("PostCreate");
|
|
|
20 |
}, getSource:function () {
|
|
|
21 |
if (this.href) {
|
|
|
22 |
dojo.io.bind({url:this.href, load:dojo.lang.hitch(this, "fillInSource"), mimetype:"text/plain"});
|
|
|
23 |
}
|
|
|
24 |
}, fillInSource:function (type, source, e) {
|
|
|
25 |
this.sourceNode.value = source;
|
|
|
26 |
}, setHref:function (url) {
|
|
|
27 |
this.href = url;
|
|
|
28 |
this.getSource();
|
|
|
29 |
}}, "", function () {
|
|
|
30 |
dojo.debug("SourcePane Init");
|
|
|
31 |
this.domNodeClass = "sourcePane";
|
|
|
32 |
this.sourceNode = "";
|
|
|
33 |
this.href = "";
|
|
|
34 |
});
|
|
|
35 |
|