Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>tracing into nicEdit code I found that buttons actually appear on the screen when setPanel() API function is being called.</p> <p><em>setPanel()</em> draws standard buttons, then it passes <em>'panel'</em> event to <em>fireEvent()</em> API function which then invokes <em>loadPanel()</em>, which in turn calls <em>addButton()</em>, which tests button.type by evaluating it:</p> <pre><code>addButton : function(buttonName,options,noOrder) { var button = options.buttons[buttonName]; var type = (button['type']) ? eval('(typeof('+button['type']+') == "undefined") ? null : '+button['type']+';') : nicEditorButton; // &lt;== here type is null, cause I defined button['type'] as local variable in separate file var hasButton = bkLib.inArray(this.buttonList,buttonName); if(type &amp;&amp; (hasButton || this.ne.options.fullPanel)) { this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne)); if(!hasButton) { this.buttonList.push(buttonName); } } }, </code></pre> <p>in the snippet above the code <code>eval('(typeof('+button['type']+') == "undefined")</code> returnes true as I defined the button type as a local variable: </p> <pre><code>var nicEditorExampleButton = nicEditorButton.extend({ mouseClick : function() { alert('The example save button icon has been clicked!'); } }); </code></pre> <p>The button appeared as soon as I defined the button type as global:</p> <pre><code>nicEditorExampleButton = nicEditorButton.extend({ mouseClick : function() { alert('The example save button icon has been clicked!'); } }); </code></pre> <p>I think type existance which nicEdit does should perform more clear and reliable way to prevent global namespace pollution, maybe as of <code>(typeof(button['type']) == "undefined")</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload