1 of 10
1
Textile Editor Helper (TEH) extension
Posted: 15 June 2007 04:47 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  138
Joined  12-29-2004

After coming across the very cool Textile Editor Helper plugin for Slate via this forum post a while back, I’ve been kicking around the idea of trying an extension for it. So I just did and thought I’d see if anyone finds it useful, or has any feedback on on my additions.

If anyone’s interested in trying it out I’ve attached it here, and an image to give you the idea. The original version didn’t have link or email buttons, so I added those as well, though one of the Slate guys told me they’d be adding that in the next version so hopefully their implementation will be nicer. I didn’t add the preview as I thought it would compete with EE’s own preview area and be confusing. Though a live preview could be cool, if perhaps overkill.

I’d love to hear what people think of this idea (as well as anything I could do to improve the extension itself of course).

——-

update: 1.2 - New version requires jQuery for the Control Panel extension (bundled with EE 1.6.6+ or available here)

Link and Email custom buttons bugfixes:
-IE7+ selection handling fixed (no more duplicating text)
-Fixed selection handling in all other browsers (text stays selected instead of moving cursor to end of field)

Now available for download at Github (click the download button, then choose zip or gzip) ... or attached right here for people having trouble with Github.

update: 1.1- New version using jQuery instead of Prototype. Simplified extension settings. Added option to use EE encode tag pMcode for email links so they get encoded.
Upgrade note: I suggest disabling and completely removing the old version first before installing 1.1.

current version: 1.2.0 (build 20090331)

Image Attachments
teh.pngteh-settings.png
Click thumbnail to see full-size image
File Attachments
TextileEditorHelper_1.2.zip  (File Size: 34KB - Downloads: 233)
 Signature 

imagehat studio
EE Pro | Textile Editor Helper | All EE Add-Ons

Profile
 
 
Posted: 15 June 2007 05:03 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  40207
Joined  05-14-2004

That’s very nice, simple too.  Would you consider making a plugin for comments, too, similar to the HTML buttons plugin?

I’d also like to encourage you to submit this to our Add-on Library.

 Signature 
Profile
MSG
 
 
Posted: 15 June 2007 05:06 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  281
Joined  12-09-2006

I just installed it, uploaded the files to the right places and activated it but I don’t see anything. Have missed a step?

Looks like this could be a great extension.

Profile
 
 
Posted: 15 June 2007 05:16 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
RankRank
Total Posts:  281
Joined  12-09-2006

Hmm. It appears on already published article but not new ones until I save them.

Profile
 
 
Posted: 15 June 2007 05:17 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  138
Joined  12-29-2004

@Lisa: Thanks, I’m hoping this fits the bill for me an my clients between having to resort to tinymce or fck (yikes!) and just sending them to an external documentation page and telling them Textile (or Markdown for that matter) is “good for them”. Plugin wouldn’t be that hard I’d guess, I may take a look. And I think I’ll kick the tires a bit before I submit it though…

@textdriven: I’ve tried it on a couple EE installs without issue. Can you check in the settings and make sure the paths area all correct adn save the settings again? I default them based on where I think they should go, but that would be my first guess. And thanks for giving it a whirl!

 Signature 

imagehat studio
EE Pro | Textile Editor Helper | All EE Add-Ons

Profile
 
 
Posted: 15 June 2007 05:19 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  138
Joined  12-29-2004

@textdriven: oops took too long to respond. It checks for fields that are set to (and saved or defaulted) as Textile. So if the default is something else and you select Textile as the formating I think it’s not updating. I’ll have to think of a way to live update that maybe…

 Signature 

imagehat studio
EE Pro | Textile Editor Helper | All EE Add-Ons

Profile
 
 
Posted: 15 June 2007 10:05 PM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

I’m a big fan of Textile, and using it with EE, so thanks for this. I look forward to trying it out when I get a chance.

I put together a live preview (in the comments area of a previous site) build utilizing Textile (from some scripts I found online). That never got used, but I know I have the markup/code around.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 19 June 2007 09:20 AM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

I just tried installing this on a relatively new install and it’s not putting the editing buttons in, and it is also throwing a couple things at the top of the page like so:

Notice: Undefined variable: EXT in /home/site/public_html/system/extensions/ext.textile_editor.php on line 56

Notice
: Undefined variable: EXT in /home/site/public_html/system/extensions/ext.textile_editor.php on line 58

So I went in and changed line 54 from

global $DB, $IN, $PREFS;
to
global $DB, $IN, $PREFS, $EXT;

Looks like I had to add the $EXT there - is that the correct fix? Everything seems to be working OK now.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 19 June 2007 09:44 AM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  138
Joined  12-29-2004

Ah yes that is correct. Sorry about that, I forgot I added the “last_call” check to make sure this wouldn’t interfere with any other extensions using the same extension hook and forgot to add the global. I’ll fix that and also should be posting an update (hopefully later today) as I’ve got toggling working for fields that show the format select list (xhtml, br, none, etc.) to initialize or destroy the toolbar when you change the formatting selection. Also got some tips from the Slate guys who created the toolbar on a cleaner way of adding the custom buttons.

 Signature 

imagehat studio
EE Pro | Textile Editor Helper | All EE Add-Ons

Profile
 
 
Posted: 19 June 2007 09:48 AM   [ Ignore ]   [ # 9 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

This seems to be working quite well, and I’m already looking forward to your update. Would it be easy to update with more buttons, beyond the default set?

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 21 June 2007 11:15 PM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  138
Joined  12-29-2004

I’ve updated the extension so it now toggles the toolbar when you change the formatting pulldown for your text area. Also cleaned a few things up and fixed the errors. Grab 1.0.2 up top.


@mdesign: If you’re just looking to add simple open/close tags that *don’t* require a dialog prompt or anything special it’s pretty simple to add your own buttons. If you look in /teh/javascripts/textile-helper-config.js you’ll see the first several lines are the default buttons and it’s fairly easy to duplicate one of those lines and replace a few things. Below that you’ll see where I added the custom link button code that required a new callback function to handle the user prompts - it’s a bit more complex but still pretty simple. And the images are all just the ever popular FamFam Silk icons.

Let me know if you’ve got particular buttons in mind I’m happy to help or maybe add them into the next version. An image button was my next idea.

...off to play with 1.6 some more…

 Signature 

imagehat studio
EE Pro | Textile Editor Helper | All EE Add-Ons

Profile
 
 
Posted: 22 June 2007 09:26 AM   [ Ignore ]   [ # 11 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

I can’t get this new extension (1.0.2) to work. I did a fresh install on a new site where I want to use it. I do get a light gray bar where the buttons should go, and it does disappear/reappear when I change the field formatting. I’ll try monkeying with it a little bit more, and seeing if there might be a conflict with another extension or something. Or heck, I might have not put something in the right place!

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 22 June 2007 09:39 AM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  138
Joined  12-29-2004

Can you check the settings and make sure the paths are right? I know in the first version I had mixed up writing the “default” settings automatically when the extension gets installed… that may have crept back in…

 Signature 

imagehat studio
EE Pro | Textile Editor Helper | All EE Add-Ons

Profile
 
 
Posted: 22 June 2007 10:10 AM   [ Ignore ]   [ # 13 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

The setting are correct, as far as I can tell (see attached pic). I have the ‘teh’ folder in the root of my site. Maybe some path in in the extension got tweaked inadvertently?

Image Attachments
teh_admin.png
Click thumbnail to see full-size image
 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 22 June 2007 10:18 AM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  138
Joined  12-29-2004

Oops - I see the problem - the “Config file URL” has the wrong extension - should be ....textile-editor-config.js (not .css). I think that’s some bad cutting and pasting on my part in the install function. Sorry about that.

 Signature 

imagehat studio
EE Pro | Textile Editor Helper | All EE Add-Ons

Profile
 
 
Posted: 22 June 2007 10:29 AM   [ Ignore ]   [ # 15 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

Agggh, I should have caught that myself. Thanks!

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 22 June 2007 10:31 AM   [ Ignore ]   [ # 16 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  138
Joined  12-29-2004

Good deal. I updated the download, so if you’re going to install it new somewhere else you may as well grab a fresh copy so the paths start out right. (That’s the only change so no need to reinstall where it’s working). Thanks for helping me knock the bugs out here!

 Signature 

imagehat studio
EE Pro | Textile Editor Helper | All EE Add-Ons

Profile
 
 
Posted: 22 June 2007 11:53 AM   [ Ignore ]   [ # 17 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

It is working now, after that change, but I’ll download the newest version.

One thing I did note is that it seems to conflict with “Textarea Resizer”, which I use on almost every site. I don’t know enough about extensions to know where the fault lies there, but I thought I’d bring it to your attention!

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 22 June 2007 12:00 PM   [ Ignore ]   [ # 18 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

May I add that it might be handy to throw a link to the right of, or below, the Textile buttons that says something like “View Textile Formatting Guide” - which could (maybe) open in a new window and lead the user to either the Textile Reference at Hobix or The Textile Reference Manual at Threshold State.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
   
1 of 10
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120489 Total Logged-in Users: 56
Total Topics: 126559 Total Anonymous Users: 25
Total Replies: 665417 Total Guests: 280
Total Posts: 791976    
Members ( View Memberlist )