Zend Framework

dijit.Editor plugins should generate dojo.require statements

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.0
  • Fix Version/s: 1.9.5
  • Component/s: Zend_Dojo
  • Labels:
    None

Description

Currently, when adding Editor plugins via the addPlugin() method of Zend_Dojo_Form_Element_Editor, you have to manually do the dojo()->requireModule() statements that correspond to the plugin module. In most cases, the plugin will correspond to dijit._editor.plugins.<pluginName>, and thus we can generate the dojo.require statement automatically.

  1. zf-4461.patch
    25/Feb/09 6:37 AM
    2 kB
    Giorgio Sironi
  2. zf-4461-2.patch
    15/May/09 12:01 AM
    2 kB
    Giorgio Sironi
  3. zf-4461-test.patch
    26/Feb/09 2:55 AM
    0.8 kB
    Giorgio Sironi

Activity

Hide
Giorgio Sironi added a comment -

However, most plugins are builtin in the editor (such as bold, italic, etc.), and does not require a dojo.require call; unfortunately the kick-ass buttons like LinkDialog are implemented as external plugins. I'll try to write a patch today.

Show
Giorgio Sironi added a comment - However, most plugins are builtin in the editor (such as bold, italic, etc.), and does not require a dojo.require call; unfortunately the kick-ass buttons like LinkDialog are implemented as external plugins. I'll try to write a patch today.
Hide
Giorgio Sironi added a comment -

This is a patch for Zend_Dojo as included in 1.7.5.
Beautiful editor commands included: createLink, fontName, fontSize, formatBlock, foreColor, hiliteColor. Specify it in plugins to include in editor:
$this->addElement('Editor', 'richtext', array(
plugins => array('bold', 'italic', 'underline', 'createLink', 'foreColor', 'hiliteColor')
));
Hope to see this in next minor version (1.7.6 I think).

Show
Giorgio Sironi added a comment - This is a patch for Zend_Dojo as included in 1.7.5. Beautiful editor commands included: createLink, fontName, fontSize, formatBlock, foreColor, hiliteColor. Specify it in plugins to include in editor: $this->addElement('Editor', 'richtext', array( plugins => array('bold', 'italic', 'underline', 'createLink', 'foreColor', 'hiliteColor') )); Hope to see this in next minor version (1.7.6 I think).
Hide
Matthew Weier O'Phinney added a comment -

Patch looks good – but if you could also provide unit tests, it will make it that much easier for me to apply.

BTW, since it adds new functionality, it cannot be released until the next minor release, 1.8.0 (1.7.6 would be the next mini release, and is happening on Monday).

Show
Matthew Weier O'Phinney added a comment - Patch looks good – but if you could also provide unit tests, it will make it that much easier for me to apply. BTW, since it adds new functionality, it cannot be released until the next minor release, 1.8.0 (1.7.6 would be the next mini release, and is happening on Monday).
Hide
Giorgio Sironi added a comment -

Patch for EditorTest.php that make it fail in 1.7.5 and not fail in 1.7.5 after applying zf-4461.patch.
Good.. 1.8 will be fine..

Show
Giorgio Sironi added a comment - Patch for EditorTest.php that make it fail in 1.7.5 and not fail in 1.7.5 after applying zf-4461.patch. Good.. 1.8 will be fine..
Hide
Giorgio Sironi added a comment -

New patch against 1.8 that adds also insertImage plugin. I recommend the inclusion in this branch.

Show
Giorgio Sironi added a comment - New patch against 1.8 that adds also insertImage plugin. I recommend the inclusion in this branch.
Hide
Matthew Weier O'Phinney added a comment -

Patch applied against trunk and 1.9 release branch; I added a unit test to verify the behavior as well.

Show
Matthew Weier O'Phinney added a comment - Patch applied against trunk and 1.9 release branch; I added a unit test to verify the behavior as well.

People

Vote (3)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: