yaoguo22 / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

Some editors commands have no associated plugins (eg: TABLE, LINK, UNLINK) #97

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The editor's built-in commands are listed in
closure/goog/editor/command.js. For most of these commands a plugin exists
(located in the closure/goog/editor/plugins/ folder). The plugin can be
determined by checking if the isSupportedCommand() function returns true
for a given command. However, several commands have no plugin.

A partial list of commands that are missing plugins:

* goog.editor.Command.TABLE
* goog.editor.Command.LINK
* goog.editor.Command.UNLINK

I believe that either plugins should be added for the above commands, or
these commands should be removed from the closure/goog/editor/command.js
file. Can you comment on the status of the above commands?

I am looking at the r26 version of the source.

Thanks.

Original issue reported on code.google.com by hochh...@gmail.com on 22 Dec 2009 at 5:05

GoogleCodeExporter commented 9 years ago
r132 should have the goog.editor.plugins.TableEditor and 
goog.editor.plugins.LinkDialogPlugin.

there was never an UNLINK plugin. i think there's a comment on this in the code.

Original comment by Nicholas.J.Santos on 14 Apr 2010 at 7:16

GoogleCodeExporter commented 9 years ago
Thanks! The TableEditor plugin is excellent.

Also thanks for the pointer on the UNLINK plugin comment.

Original comment by ahochh...@samegoal.com on 24 Apr 2010 at 8:37

GoogleCodeExporter commented 9 years ago

Original comment by Nicholas.J.Santos on 25 Apr 2010 at 10:52

GoogleCodeExporter commented 9 years ago
Hi Nick,

I noticed that a few commands are still missing implementations. Is it possible 
for 
the bug to be reopened until the corresponding plugins are released?

goog.editor.Command.EMOTICON 
goog.editor.Command.IMAGE
goog.editor.Command.EDIT_HTML

Thanks.

Original comment by sg.ahoch...@gmail.com on 26 Apr 2010 at 2:02

GoogleCodeExporter commented 9 years ago
sure.

For what it's worth, the Emoticons plugin is in closure-library.

The Image and Edit Html plugins are tricky. If you look at other Google 
products, you 
may have noticed that there are several different Image plugins, customized to 
different use cases. I don't know if there are plans to put any of them in 
closure-
library, but someone on the closure-library-discuss list might know.

Original comment by Nicholas.J.Santos on 26 Apr 2010 at 2:38

GoogleCodeExporter commented 9 years ago
> For what it's worth, the Emoticons plugin is in closure-library.

Thanks. I see it now. :)

> I don't know if there are plans to put any of them in closure-
> library, but someone on the closure-library-discuss list might know.

Sounds good, the enhancement label is fitting then. I'll ask on closure-library-
discuss.

Original comment by ahochh...@samegoal.com on 26 Apr 2010 at 3:07

GoogleCodeExporter commented 9 years ago
For future readers, Julie from closure-library-discuss has confirmed that plans 
do
exist to release the IMAGE and EDIT_HTML plugins however no exact time line is
currently known.

http://groups.google.com/group/closure-library-discuss/browse_thread/thread/3951
b412cad8a6c6

Original comment by ahochh...@samegoal.com on 27 Apr 2010 at 11:31

GoogleCodeExporter commented 9 years ago
IMAGE and EDIT_HTML plugins would be amazing! Thanks! 

Original comment by michaele...@gmail.com on 25 Nov 2010 at 9:26

GoogleCodeExporter commented 9 years ago

Original comment by pall...@google.com on 15 Jul 2011 at 1:24

GoogleCodeExporter commented 9 years ago
Hello! Does the situation with non-existed EDIT_HTML plugin changed somehow? 
There is button goog.editor.Command.EDIT_HTML but it do nothing.

Original comment by antoniok...@gmail.com on 21 Dec 2012 at 12:51

GoogleCodeExporter commented 9 years ago
To the best of my knowledge, an EDIT_HTML plugin is still not part of 
closure-library proper. However, writing one isn't too bad. To help get you 
started:

/**
 * Plugin to convert an editable field into an html editor.
 * @constructor
 * @extends {goog.editor.Plugin}
 */
example.EditHtmlPlugin = function() {
  goog.base(this);
};
goog.inherits(example.EditHtmlPlugin, goog.editor.Plugin);

/** @override */
example.EditHtmlPlugin.prototype.getTrogClassId = function() {
  return 'EditHtml';
};

/**
 * @enum {string}
 */
example.EditHtmlPlugin.COMMAND = {
  EDIT_HTML: 'editHtml'
};

/** @override */
example.EditHtmlPlugin.prototype.isSupportedCommand = function(command) {
  return command == example.EditHtmlPlugin.COMMAND.EDIT_HTML;
};

/**
 * @param {*} e Event.
 */
example.EditHtmlPlugin.prototype.dialog_event = function(e) {
  if (e.key == 'change') {
    this.getFieldObject().setHtml(false, /* NOTE: get HTML here */);
  }
};

/**
 * @param {string} command Command to execute.
 */
example.EditHtmlPlugin.prototype.execCommandInternal = function(command) {
  var orig_html = this.getFieldObject().getCleanContents();

  // NOTE: Present UI for user to edit HTML
};

Original comment by ahochh...@samegoal.com on 21 Dec 2012 at 4:34

GoogleCodeExporter commented 9 years ago
Hi,

I know that Image Plugin for Closure Editor is released and its working fine 
for me.

Is EDIT_HTML plugin is released for the same?

If so, please direct me as to how to use it.

If not, is there any way to get the requirements as to how to write a plugin 
code for the same?

Thanks.

Original comment by ananthak...@a-cti.com on 27 Sep 2013 at 10:11

GoogleCodeExporter commented 9 years ago
To the best of my knowledge, EDIT_HTML has still not been released. If you are 
interested in writing your own I recommend section 9.3 (Extending the Editor: 
The Plugin System) of "Closure The Definitive Guide" by Michael Bolin. Also the 
sample code I provided in comment #11 might be helpful to look at.

https://code.google.com/p/closure-library/issues/detail?id=97#c11

Goodluck!

Original comment by ahochh...@samegoal.com on 27 Sep 2013 at 3:40