raymundgoyer / ext-ux-htmleditor-plugins

Automatically exported from code.google.com/p/ext-ux-htmleditor-plugins
0 stars 0 forks source link

Tooltip and gettext #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When the latest SVN checkout of the htmleditor is used with ExtJs 3.1.1 
loading the plugins will fail due to a problem with the Tooltip.

Attached patch fixes this problem using the following pattern:
Old code:
  tooltip: {
      title: 'Find/Replace'
  },
New code:
  tooltip: 'Find/Replace'

The second update in this patch is the application of gettext. I am working 
on a project which must use gettext for the translations of the strings. To 
apply gettext the following pattern is applied:
Old code:
   overflowText: 'Find/Replace'
New code:
   overflowText: _('Find/Replace')

Alternatively it might be an option to make the strings configurable, which 
adds even more flexibility. :)

Original issue reported on code.google.com by IvDo...@gmail.com on 17 Mar 2010 at 1:39

GoogleCodeExporter commented 8 years ago
The patch was incorrect, I'll send an updated one within a few moments.
That version will make the strings configurable, so each project can decide how 
the 
strings should be translated.

Original comment by IvDo...@gmail.com on 17 Mar 2010 at 1:57

GoogleCodeExporter commented 8 years ago
This version should work better.
It makes the tooltip change as previously mentioned.
Also it pushes all translation strings into the constructor. All plugins 
without a 
translation string have been updated accordingly as well.

Original comment by IvDo...@gmail.com on 17 Mar 2010 at 2:57

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for pushing translation strings into the constructor, that one has been 
on my
list for a while now, so I appreciate your work.

I need to look into the tooltip problem further, because it should be able to 
accept
an object.

Original comment by justar...@gmail.com on 17 Mar 2010 at 3:32

GoogleCodeExporter commented 8 years ago
Added some of these changes in r30

still looking into others.

Original comment by justar...@gmail.com on 2 Apr 2010 at 5:33

GoogleCodeExporter commented 8 years ago
Here are another round of fixes.

Patch [1]: Because no init() or constructor() functions were used to assign 
midasBtns, the creation of the buttons failed completely because tooltip and 
overflowText remained undefined. Not sure why this was actually the case, but 
since
the plugins which did not use midasBtns did their work in onRender(), I just 
moved everything into init().

Patch [2]: The Link button still didn't have an overflowText, but this was 
because it was never assigned.

Patch [3]: I removed the '|' dividers inside some of the button combinations 
(undo/redo, indent/outdent, etc). It is much cleaner if the developer can 
determine if he wants a divider or not. I did update the Plugins structure to 
add the divider manually where I removed it from the midas button. That way 
users of the Plugins structure will not notice the difference.

Patch [4]: I have added translation strings for all midas buttons which were 
still lacking them,

Please note that the tooltip problem still occurs, so on my project I still use
tooltip : this.langTitle
rather than
tooltip : { this.langTitle }

Original comment by IvDo...@gmail.com on 6 Jul 2010 at 2:50

Attachments:

GoogleCodeExporter commented 8 years ago
patch one seem to have been ignored.. :S

Original comment by IvDo...@gmail.com on 6 Jul 2010 at 2:51

Attachments:

GoogleCodeExporter commented 8 years ago
This patch fixed the width of the findAndReplace dialog. It currently is set to 
a width which far exceeds the screen. Only by resizing, do the buttons appear 
to close the dialog.

This patch sets the width of the dialog to 300, which seems to match the way 
the dialog contents is sized. Although it would be nice when the input fields 
width would resize according to the dialog.. ;)

This patch is on top of the other patches.

Original comment by IvDo...@gmail.com on 21 Jul 2010 at 10:01

Attachments:

GoogleCodeExporter commented 8 years ago
I was just working on further implementing the plugins into my project, and 
thought of a method to fix the Tooltip issue.

At the moment, it is very hard to override a piece of a plugin. I mean I cannot 
control how the dialog looks like without completely rewriting the plugin. 
Perhaps the code should be broken up into smaller functions. This way it is 
easier for implementations to override how the Tooltip, Dialog, Button, or any 
other UI Component ovent handler.

Original comment by IvDo...@gmail.com on 28 Jul 2010 at 7:34

GoogleCodeExporter commented 8 years ago
I seem to have fixed the tooltip problem. Rather then an object with only the 
text, I passed the objects as:

{
        title: _('Insert Special Character'),
        text: _('Insert Special Character at the current cursor position'),
        cls: 'x-html-editor-tip'
}

After this, the tooltip is working, but only when my parent dialog (which 
contains the HtmlEditor) is an Ext.Window. When I make it a real pop-up window 
then I still
fails with error:

Uncaught TypeError: Cannot read property 'register' of undefined
ext-all-debug.js:49305

This corresponds to:

Ext.QuickTips = function(){
<..snip..>
        /**
         * Configures a new quick tip instance and assigns it to a target element.  See
         * {@link Ext.QuickTip#register} for details.
         * @param {Object} config The config object
         */
        register : function(){
            tip.register.apply(tip, arguments);
        },
<..snip..>
}

Original comment by IvDo...@gmail.com on 28 Jul 2010 at 3:12

GoogleCodeExporter commented 8 years ago
Any updates?
Did you review the above patches (or nr6 from 
http://code.google.com/p/ext-ux-htmleditor-plugins/issues/detail?id=8)?

Original comment by IvDo...@gmail.com on 2 Oct 2010 at 11:42

GoogleCodeExporter commented 8 years ago
The QuickTip problem is probably due to the missing Ext.QuickTip.init() call, 
and for the External window there seems to be a problem with calling that 
function. So that is unrelated to the plugins.

Original comment by IvDo...@gmail.com on 27 Feb 2011 at 11:56