<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>API: composable-plugin BaseEditor.js (YUI Library)</title>
<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
<link rel="stylesheet" type="text/css" href="assets/api.css" />
<script type="text/javascript" src="assets/api-js"></script>
<script type="text/javascript" src="assets/ac-js"></script>
</head>
<body id="yahoo-com">
<div id="doc3" class="yui-t2">
<div id="hd">
<h1><a href="http://neyric.github.com/wireit" title="WireItLibrary">WireItLibrary</a></h1>
<h3>composable-plugin <span class="subtitle">0.6.0</span></h3>
<a href="./index.html" title="WireItLibrary">WireItLibrary</a>
> <a href="./module_composable-plugin.html" title="composable-plugin">composable-plugin</a>
> BaseEditor.js (source view)
<form onsubmit="return false">
<div id="propertysearch">
Search: <input autocomplete="off" id="searchinput" />
<div id="searchresults">
</div>
</div>
</form>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
<fieldset>
<legend>Filters</legend>
<span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
<span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
<span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
</fieldset>
</form>
<div id="srcout">
<style>
#doc3 .classopts { display:none; }
</style>
<div class="highlight"><pre><span class="c">/**</span>
<span class="c"> * WireIt editor</span>
<span class="c"> * @module editor-plugin</span>
<span class="c"> */</span>
<span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">util</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="o">,</span><span class="nx">lang</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="o">;</span>
<span class="kd">var</span> <span class="nx">Event</span> <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="o">,</span> <span class="nx">Dom</span> <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="o">,</span> <span class="nx">Connect</span> <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nx">Connect</span><span class="o">,</span><span class="nx">JSON</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">JSON</span><span class="o">,</span><span class="nx">widget</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="o">;</span>
<span class="c">/**</span>
<span class="c"> * The BaseEditor class provides a full page interface </span>
<span class="c"> * @class BaseEditor </span>
<span class="c"> * @namespace WireIt</span>
<span class="c"> * @constructor</span>
<span class="c"> * @param {Object} options (layoutOptions,propertiesFields,accordionViewParams)</span>
<span class="c"> */</span>
<span class="nx">WireIt</span><span class="p">.</span><span class="nx">BaseEditor</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">options</span><span class="p">)</span> <span class="p">{</span>
<span class="c">/**</span>
<span class="c"> * Container DOM element</span>
<span class="c"> * @property el</span>
<span class="c"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">parentEl</span><span class="p">);</span>
<span class="c">// set the default options</span>
<span class="k">this</span><span class="p">.</span><span class="nx">setOptions</span><span class="p">(</span><span class="nx">options</span><span class="p">);</span>
<span class="c">// Rendering</span>
<span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
<span class="p">};</span>
<span class="c">/**</span>
<span class="c"> * Default options for the BaseEditor</span>
<span class="c"> */</span>
<span class="nx">WireIt</span><span class="p">.</span><span class="nx">BaseEditor</span><span class="p">.</span><span class="nx">defaultOptions</span> <span class="o">=</span> <span class="p">{</span>
<span class="nx">layoutOptions</span><span class="o">:</span> <span class="p">{</span>
<span class="nx">units</span><span class="o">:</span> <span class="p">[</span>
<span class="p">{</span> <span class="nx">position</span><span class="o">:</span> <span class="s1">'top'</span><span class="o">,</span> <span class="nx">height</span><span class="o">:</span> <span class="mi">57</span><span class="o">,</span> <span class="nx">body</span><span class="o">:</span> <span class="s1">'top'</span><span class="p">}</span><span class="o">,</span>
<span class="p">{</span> <span class="nx">position</span><span class="o">:</span> <span class="s1">'left'</span><span class="o">,</span> <span class="nx">width</span><span class="o">:</span> <span class="mi">200</span><span class="o">,</span> <span class="nx">resize</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span> <span class="nx">body</span><span class="o">:</span> <span class="s1">'left'</span><span class="o">,</span> <span class="nx">gutter</span><span class="o">:</span> <span class="s1">'5px'</span><span class="o">,</span> <span class="nx">collapse</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
<span class="nx">collapseSize</span><span class="o">:</span> <span class="mi">25</span><span class="o">,</span> <span class="nx">header</span><span class="o">:</span> <span class="s1">'Modules'</span><span class="o">,</span> <span class="nx">scroll</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span> <span class="nx">animate</span><span class="o">:</span> <span class="kc">true</span> <span class="p">}</span><span class="o">,</span>
<span class="p">{</span> <span class="nx">position</span><span class="o">:</span> <span class="s1">'center'</span><span class="o">,</span> <span class="nx">body</span><span class="o">:</span> <span class="s1">'center'</span><span class="o">,</span> <span class="nx">gutter</span><span class="o">:</span> <span class="s1">'5px'</span> <span class="p">}</span><span class="o">,</span>
<span class="p">{</span> <span class="nx">position</span><span class="o">:</span> <span class="s1">'right'</span><span class="o">,</span> <span class="nx">width</span><span class="o">:</span> <span class="mi">320</span><span class="o">,</span> <span class="nx">resize</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span> <span class="nx">body</span><span class="o">:</span> <span class="s1">'right'</span><span class="o">,</span> <span class="nx">gutter</span><span class="o">:</span> <span class="s1">'5px'</span><span class="o">,</span> <span class="nx">collapse</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
<span class="nx">collapseSize</span><span class="o">:</span> <span class="mi">25</span><span class="o">,</span> <span class="c">/*header: 'Properties', scroll: true,*/</span> <span class="nx">animate</span><span class="o">:</span> <span class="kc">true</span> <span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span><span class="o">,</span>
<span class="nx">propertiesFields</span><span class="o">:</span> <span class="p">[</span>
<span class="p">{</span><span class="s2">"type"</span><span class="o">:</span> <span class="s2">"string"</span><span class="o">,</span> <span class="s2">"name"</span><span class="o">:</span> <span class="s2">"name"</span><span class="o">,</span> <span class="kd">label</span><span class="o">:</span> <span class="s2">"Title"</span><span class="o">,</span> <span class="nx">typeInvite</span><span class="o">:</span> <span class="s2">"Enter a title"</span> <span class="p">}</span><span class="o">,</span>
<span class="p">{</span><span class="s2">"type"</span><span class="o">:</span> <span class="s2">"text"</span><span class="o">,</span> <span class="s2">"name"</span><span class="o">:</span> <span class="s2">"description"</span><span class="o">,</span> <span class="kd">label</span><span class="o">:</span> <span class="s2">"Description"</span><span class="o">,</span> <span class="nx">cols</span><span class="o">:</span> <span class="mi">30</span><span class="o">,</span> <span class="nx">rows</span><span class="o">:</span> <span class="mi">4</span><span class="p">}</span>
<span class="p">]</span><span class="o">,</span>
<span class="nx">accordionViewParams</span><span class="o">:</span> <span class="p">{</span>
<span class="nx">collapsible</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
<span class="nx">expandable</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span> <span class="c">// remove this parameter to open only one panel at a time</span>
<span class="nx">width</span><span class="o">:</span> <span class="s1">'auto'</span><span class="o">,</span>
<span class="nx">expandItem</span><span class="o">:</span> <span class="mi">0</span><span class="o">,</span>
<span class="nx">animationSpeed</span><span class="o">:</span> <span class="s1">'0.3'</span><span class="o">,</span>
<span class="nx">animate</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
<span class="nx">effect</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Easing</span><span class="p">.</span><span class="nx">easeBothStrong</span>
<span class="p">}</span>
<span class="p">};</span>
<span class="nx">WireIt</span><span class="p">.</span><span class="nx">BaseEditor</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="p">{</span>
<span class="c">/**</span>
<span class="c"> * @method setOptions</span>
<span class="c"> * @param {Object} options</span>
<span class="c"> */</span>
<span class="nx">setOptions</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">options</span><span class="p">)</span> <span class="p">{</span>
<span class="c">/**</span>
<span class="c"> * @property options</span>
<span class="c"> * @type {Object}</span>
<span class="c"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">options</span> <span class="o">=</span> <span class="p">{};</span>
<span class="c">// inputEx configuration of fields in the properties panel</span>
<span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">propertiesFields</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">propertiesFields</span> <span class="o">||</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">BaseEditor</span><span class="p">.</span><span class="nx">defaultOptions</span><span class="p">.</span><span class="nx">propertiesFields</span><span class="o">;</span>
<span class="c">// YUI layout options</span>
<span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">layoutOptions</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">layoutOptions</span> <span class="o">||</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">BaseEditor</span><span class="p">.</span><span class="nx">defaultOptions</span><span class="p">.</span><span class="nx">layoutOptions</span><span class="o">;</span>
<span class="c">// AccordionView</span>
<span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">accordionViewParams</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">accordionViewParams</span> <span class="o">||</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">BaseEditor</span><span class="p">.</span><span class="nx">defaultOptions</span><span class="p">.</span><span class="nx">accordionViewParams</span><span class="o">;</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Render the layout & panels</span>
<span class="c"> */</span>
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c">// Render the help panel</span>
<span class="k">this</span><span class="p">.</span><span class="nx">renderHelpPanel</span><span class="p">();</span>
<span class="c">/**</span>
<span class="c"> * @property layout</span>
<span class="c"> * @type {YAHOO.widget.Layout}</span>
<span class="c"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">layout</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Layout</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">el</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">layoutOptions</span><span class="p">);</span>
<span class="k">this</span><span class="p">.</span><span class="nx">layout</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
<span class="c">// Right accordion</span>
<span class="k">this</span><span class="p">.</span><span class="nx">renderPropertiesAccordion</span><span class="p">();</span>
<span class="c">// Render buttons</span>
<span class="k">this</span><span class="p">.</span><span class="nx">renderButtons</span><span class="p">();</span>
<span class="c">// Saved status</span>
<span class="k">this</span><span class="p">.</span><span class="nx">renderSavedStatus</span><span class="p">();</span>
<span class="c">// Properties Form</span>
<span class="k">this</span><span class="p">.</span><span class="nx">renderPropertiesForm</span><span class="p">();</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Render the help dialog</span>
<span class="c"> */</span>
<span class="nx">renderHelpPanel</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c">/**</span>
<span class="c"> * @property helpPanel</span>
<span class="c"> * @type {YAHOO.widget.Panel}</span>
<span class="c"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">helpPanel</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Panel</span><span class="p">(</span><span class="s1">'helpPanel'</span><span class="o">,</span> <span class="p">{</span>
<span class="nx">fixedcenter</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
<span class="nx">draggable</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
<span class="nx">modal</span><span class="o">:</span> <span class="kc">true</span>
<span class="p">});</span>
<span class="k">this</span><span class="p">.</span><span class="nx">helpPanel</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Render the alert panel</span>
<span class="c"> */</span>
<span class="nx">renderAlertPanel</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c">/**</span>
<span class="c"> * @property alertPanel</span>
<span class="c"> * @type {YAHOO.widget.Panel}</span>
<span class="c"> */</span>
<span class="k">this</span><span class="p">.</span><span class="nx">alertPanel</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Panel</span><span class="p">(</span><span class="s1">'WiringEditor-alertPanel'</span><span class="o">,</span> <span class="p">{</span>
<span class="nx">fixedcenter</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
<span class="nx">draggable</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
<span class="nx">width</span><span class="o">:</span> <span class="s1">'500px'</span><span class="o">,</span>
<span class="nx">visible</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
<span class="nx">modal</span><span class="o">:</span> <span class="kc">true</span>
<span class="p">});</span>
<span class="k">this</span><span class="p">.</span><span class="nx">alertPanel</span><span class="p">.</span><span class="nx">setHeader</span><span class="p">(</span><span class="s2">"Message"</span><span class="p">);</span>
<span class="k">this</span><span class="p">.</span><span class="nx">alertPanel</span><span class="p">.</span><span class="nx">setBody</span><span class="p">(</span><span class="s2">"<div id='alertPanelBody'></div><button id='alertPanelButton'>Ok</button>"</span><span class="p">);</span>
<span class="k">this</span><span class="p">.</span><span class="nx">alertPanel</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">);</span>
<span class="nx">Event</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="s1">'alertPanelButton'</span><span class="o">,</span><span class="s1">'click'</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">alertPanel</span><span class="p">.</span><span class="nx">hide</span><span class="p">();</span>
<span class="p">}</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Toolbar</span>
<span class="c"> * @method renderButtons</span>
<span class="c"> */</span>
<span class="nx">renderButtons</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">toolbar</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">'toolbar'</span><span class="p">);</span>
<span class="c">// Buttons :</span>
<span class="kd">var</span> <span class="nx">newButton</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">({</span> <span class="kd">label</span><span class="o">:</span><span class="s2">"New"</span><span class="o">,</span> <span class="nx">id</span><span class="o">:</span><span class="s2">"WiringEditor-newButton"</span><span class="o">,</span> <span class="nx">container</span><span class="o">:</span> <span class="nx">toolbar</span> <span class="p">});</span>
<span class="nx">newButton</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"click"</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">onNew</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">loadButton</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">({</span> <span class="kd">label</span><span class="o">:</span><span class="s2">"Load"</span><span class="o">,</span> <span class="nx">id</span><span class="o">:</span><span class="s2">"WiringEditor-loadButton"</span><span class="o">,</span> <span class="nx">container</span><span class="o">:</span> <span class="nx">toolbar</span> <span class="p">});</span>
<span class="nx">loadButton</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"click"</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">load</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">saveButton</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">({</span> <span class="kd">label</span><span class="o">:</span><span class="s2">"Save"</span><span class="o">,</span> <span class="nx">id</span><span class="o">:</span><span class="s2">"WiringEditor-saveButton"</span><span class="o">,</span> <span class="nx">container</span><span class="o">:</span> <span class="nx">toolbar</span> <span class="p">});</span>
<span class="nx">saveButton</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"click"</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">onSave</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">deleteButton</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">({</span> <span class="kd">label</span><span class="o">:</span><span class="s2">"Delete"</span><span class="o">,</span> <span class="nx">id</span><span class="o">:</span><span class="s2">"WiringEditor-deleteButton"</span><span class="o">,</span> <span class="nx">container</span><span class="o">:</span> <span class="nx">toolbar</span> <span class="p">});</span>
<span class="nx">deleteButton</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"click"</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">onDelete</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">helpButton</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">({</span> <span class="kd">label</span><span class="o">:</span><span class="s2">"Help"</span><span class="o">,</span> <span class="nx">id</span><span class="o">:</span><span class="s2">"WiringEditor-helpButton"</span><span class="o">,</span> <span class="nx">container</span><span class="o">:</span> <span class="nx">toolbar</span> <span class="p">});</span>
<span class="nx">helpButton</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"click"</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">onHelp</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * @method renderSavedStatus</span>
<span class="c"> */</span>
<span class="nx">renderSavedStatus</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">savedStatusEl</span> <span class="o">=</span> <span class="nx">WireIt</span><span class="p">.</span><span class="nx">cn</span><span class="p">(</span><span class="s1">'div'</span><span class="o">,</span> <span class="p">{</span><span class="nx">className</span><span class="o">:</span> <span class="s1">'savedStatus'</span><span class="o">,</span> <span class="nx">title</span><span class="o">:</span> <span class="s1">'Not saved'</span><span class="p">}</span><span class="o">,</span> <span class="p">{</span><span class="nx">display</span><span class="o">:</span> <span class="s1">'none'</span><span class="p">}</span><span class="o">,</span> <span class="s2">"*"</span><span class="p">);</span>
<span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">'toolbar'</span><span class="p">).</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">savedStatusEl</span><span class="p">);</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * @method onSave</span>
<span class="c"> */</span>
<span class="nx">onSave</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">save</span><span class="p">();</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Save method (empty)</span>
<span class="c"> */</span>
<span class="nx">save</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c">// override</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Displays a message</span>
<span class="c"> */</span>
<span class="nx">alert</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">txt</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">alertPanel</span><span class="p">){</span> <span class="k">this</span><span class="p">.</span><span class="nx">renderAlertPanel</span><span class="p">();</span> <span class="p">}</span>
<span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">'alertPanelBody'</span><span class="p">).</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">txt</span><span class="o">;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">alertPanel</span><span class="p">.</span><span class="nx">show</span><span class="p">();</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Create a help panel</span>
<span class="c"> * @method onHelp</span>
<span class="c"> */</span>
<span class="nx">onHelp</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">helpPanel</span><span class="p">.</span><span class="nx">show</span><span class="p">();</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Render the accordion using yui-accordion</span>
<span class="c"> */</span>
<span class="nx">renderPropertiesAccordion</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">accordionView</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">AccordionView</span><span class="p">(</span><span class="s1">'accordionView'</span><span class="o">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">accordionViewParams</span><span class="p">);</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Render the properties form</span>
<span class="c"> * @method renderPropertiesForm</span>
<span class="c"> */</span>
<span class="nx">renderPropertiesForm</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">propertiesForm</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">inputEx</span><span class="p">.</span><span class="nx">Group</span><span class="p">({</span>
<span class="nx">parentEl</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">'propertiesForm'</span><span class="p">)</span><span class="o">,</span>
<span class="nx">fields</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">propertiesFields</span>
<span class="p">});</span>
<span class="k">this</span><span class="p">.</span><span class="nx">propertiesForm</span><span class="p">.</span><span class="nx">updatedEvt</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">markUnsaved</span><span class="p">();</span>
<span class="p">}</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/** </span>
<span class="c"> * Hide the save indicator</span>
<span class="c"> */</span>
<span class="nx">markSaved</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">savedStatusEl</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">'none'</span><span class="o">;</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/** </span>
<span class="c"> * Show the save indicator</span>
<span class="c"> */</span>
<span class="nx">markUnsaved</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">savedStatusEl</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">''</span><span class="o">;</span>
<span class="p">}</span><span class="o">,</span>
<span class="c">/** </span>
<span class="c"> * Is saved ?</span>
<span class="c"> */</span>
<span class="nx">isSaved</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">savedStatusEl</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">==</span> <span class="s1">'none'</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">};</span>
<span class="p">})();</span>
</pre></div>
</div>
</div>
</div>
<div class="yui-b">
<div class="nav">
<div id="moduleList" class="module">
<h4>Modules</h4>
<ul class="content">
<li class=""><a href="module_animations-plugin.html" title="animations-plugin">animations-plugin</a></li>
<li class="selected"><a href="module_composable-plugin.html" title="composable-plugin">composable-plugin</a></li>
<li class=""><a href="module_editor-plugin.html" title="editor-plugin">editor-plugin</a></li>
<li class=""><a href="module_inputex-plugin.html" title="inputex-plugin">inputex-plugin</a></li>
<li class=""><a href="module_layout-plugin.html" title="layout-plugin">layout-plugin</a></li>
<li class=""><a href="module_wireit.html" title="WireIt">WireIt</a></li>
</ul>
</div>
<div id="classList" class="module">
<h4>Classes</h4>
<ul class="content">
<li class=""><a href="WireIt.util.ComposableWiringEditor.html" title="WireIt.util.ComposableWiringEditor">WireIt.util.ComposableWiringEditor</a></li>
<li class=""><a href="WireIt.util.ComposedContainer.html" title="WireIt.util.ComposedContainer">WireIt.util.ComposedContainer</a></li>
</ul>
</div>
<div id="fileList" class="module">
<h4>Files</h4>
<ul class="content">
<li class="selected"><a href="BaseEditor.js.html" title="BaseEditor.js">BaseEditor.js</a></li>
<li class=""><a href="ComposedContainer.js.html" title="ComposedContainer.js">ComposedContainer.js</a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright © 2010 Eric Abouaf All rights reserved.
</div>
</div>
<script type="text/javascript">
var ALL_YUI_PROPS = [{"url": "WireIt.util.ComposableWiringEditor.html#property_composedCategory", "access": "", "host": "WireIt.util.ComposableWiringEditor", "type": "property", "name": "composedCategory"}, {"url": "WireIt.util.ComposableWiringEditor.html#property_modules", "access": "", "host": "WireIt.util.ComposableWiringEditor", "type": "property", "name": "modules"}, {"url": "WireIt.util.ComposableWiringEditor.html#method_onLoadSuccess", "access": "", "host": "WireIt.util.ComposableWiringEditor", "type": "method", "name": "onLoadSuccess"}, {"url": "WireIt.util.ComposableWiringEditor.html#method_updateComposedModuleList", "access": "", "host": "WireIt.util.ComposableWiringEditor", "type": "method", "name": "updateComposedModuleList"}];
</script>
</body>
</html>