tag:blogger.com,1999:blog-1373414015686195986.post1378864217030387797..comments2023-04-01T08:46:14.992-04:00Comments on Another Web Development Blog: Adding a Custom Toolbar Item to Dojo Rich Text EditCarl Dominguehttp://www.blogger.com/profile/02941990420640564181noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-1373414015686195986.post-42979816610421811362012-08-01T06:09:47.135-04:002012-08-01T06:09:47.135-04:00I have been looking to extend the toolbar to add i...I have been looking to extend the toolbar to add in the create link plugin for a short time now.Leon Victorhttps://www.blogger.com/profile/05722364604299872542noreply@blogger.comtag:blogger.com,1999:blog-1373414015686195986.post-4056662090412862412012-05-09T06:51:55.987-04:002012-05-09T06:51:55.987-04:00I'm not sure exactly why but I think you need ...I'm not sure exactly why but I think you need to set the variable <br /><br /> useDefaultCommand: false,<br /><br />Which tells the editor that this is not a default command as described in the IBM article. Otherwise the button does not appear (working in dojo 1.6)<br /><br />My working code:<br /><br />dojo.declare("my.widgets.LoadQuery", dijit._editor._Plugin, {<br /><br /> // When you click the command button, you show a toolbar, <br /> // instead of executing some editor commands.<br /> useDefaultCommand: false,<br /><br /> _initButton: function () {<br /> // summary:<br /> // This is the button that will appear on the toolbar<br /> this.button = new dijit.form.Button({<br /> label: "This",<br /> showLabel: false,<br /> iconClass: this.iconClassPrefix + " " + this.iconClassPrefix + "CreateLink",<br /> tabIndex: "-1",<br /> onClick: dojo.hitch(this, function () {<br /> alert('click');<br /> })<br /> });<br /> }<br />});<br /><br />// Register this plug-in so it can construct itself when the editor publishes a topic.<br />dojo.subscribe(dijit._scopeName + ".Editor.getPlugin", null, function (o) {<br /> if (!o.plugin && o.args.name.toLowerCase() === "loadquery") {<br /> o.plugin = new my.widgets.LoadQuery();<br /> }<br />});Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1373414015686195986.post-88272056824525292362012-03-21T07:28:58.175-04:002012-03-21T07:28:58.175-04:00I have tried this code to develop Dojo Rich Text E...I have tried this code to develop Dojo Rich Text Edit toolbar but I can't get it. Can you explain by video?Custom Toolbar Developmenthttp://www.customtoolbardevelopment.com/noreply@blogger.comtag:blogger.com,1999:blog-1373414015686195986.post-41912732913061170632011-11-14T11:31:03.486-05:002011-11-14T11:31:03.486-05:00Any chance you can post a working example of this ...Any chance you can post a working example of this because I can't seem to get it working :(Sevenearthshttps://www.blogger.com/profile/12972754095754330890noreply@blogger.comtag:blogger.com,1999:blog-1373414015686195986.post-63030212827960538812011-05-10T11:26:09.890-04:002011-05-10T11:26:09.890-04:00Ah - I'm going to take a guess that you had an...Ah - I'm going to take a guess that you had an indirect reference like <br /><br />label: strings["newPage"]<br /><br />where I have <br /><br />label: "Search and add content"<br /><br />I'm glad I was able to help.Carl Dominguehttps://www.blogger.com/profile/02941990420640564181noreply@blogger.comtag:blogger.com,1999:blog-1373414015686195986.post-20212632447660964692011-05-10T11:00:34.034-04:002011-05-10T11:00:34.034-04:00Welp, I've figured it out. I had to add my &qu...Welp, I've figured it out. I had to add my "commandName" to the commands.js file in dijit/_editor/nls. <br /><br />Thanks again for your help and for the tutorial.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1373414015686195986.post-15429941247313398112011-05-10T10:13:35.788-04:002011-05-10T10:13:35.788-04:00Yeah, it's very strange. Dojo runs each plugin...Yeah, it's very strange. Dojo runs each plugin through a piece of code which tries to enable/disable the plugin. <br /><br />Here is the piece that's telling the plugin to be disabled, it comes from RichText.js:<br /><br /> try{<br /> return elem.queryCommandEnabled(command);<br /> }catch(e){<br /> //Squelch, occurs if editor is hidden on FF 3 (and maybe others.)<br /> return false;<br /> }Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1373414015686195986.post-10251551296271358102011-05-09T21:02:20.827-04:002011-05-09T21:02:20.827-04:00I haven't had any issues with the button being...I haven't had any issues with the button being disabled. I took a quick look at isFocusable() in dijit._form._FormWidget.js and there seems to be some other code that could cause that symptom. Try stepping through it with chrome's debugger.....Carl Dominguehttps://www.blogger.com/profile/02941990420640564181noreply@blogger.comtag:blogger.com,1999:blog-1373414015686195986.post-78483405776704619472011-05-09T15:33:17.619-04:002011-05-09T15:33:17.619-04:00This tutorial is spot on, except when I try to add...This tutorial is spot on, except when I try to add this plugin the button is "disabled" by the toolbar. Have you noticed this behavior?Anonymousnoreply@blogger.com