Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-08-09 07:38:09

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 228
Website

kuo_ace: syntax highlighter for Textpattern

Screenshot:

kuo_ace activates Ace for Textpattern’s Articles, Sections, Forms, Styles and Commets — if you want to. This initial release has Ace’s default colour scheme and it uses html syntax highlighting in Sections and Forms, and css for Styles section. Tested with Textpattern 4.5.5.

If someone would like build a specific Textpattern “mode” (read more), please let me know about it — it’d be great to include that for the next version of this plugin.

Download

Last edited by kuopassa (2016-03-03 04:44:02)

Offline

#2 2014-08-09 09:47:07

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: kuo_ace: syntax highlighter for Textpattern

It does work … but does it realy need all 9,3 MB (9.335.564 bytes) .js files?

Offline

#3 2014-08-09 10:17:20

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 228
Website

Re: kuo_ace: syntax highlighter for Textpattern

No, I suppose you are right. :-) There could be some extra JavaScript included. I’ll try to figure out what files are the minimum requirements for this plugin.

Offline

#4 2014-08-09 12:36:35

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: kuo_ace: syntax highlighter for Textpattern

I see that Ace also supports Textile.

mode-textile.js

It would be cool if there was a way to use it on Content forms.

Offline

#5 2014-08-09 12:57:51

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: kuo_ace: syntax highlighter for Textpattern

michaelkpate wrote #282767:

It would be cool if there was a way to use it on Content forms.

+1

Offline

#6 2014-08-09 20:11:58

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: kuo_ace: syntax highlighter for Textpattern

Sorry for the question, maybe I seem to be an ignorant, but, what is a “content form”?

Offline

#7 2014-08-09 20:46:32

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: kuo_ace: syntax highlighter for Textpattern

GugUser wrote #282775:

Sorry for the question, maybe I seem to be an ignorant, but, what is a “content form”?

I was thinking of the Body and Excerpt Fields on the Write Tab. “Content form” probably isn’t the best way to describe them. :)

Offline

#8 2014-08-09 22:11:51

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: kuo_ace: syntax highlighter for Textpattern

Oh, yes.

Offline

#9 2014-08-10 09:00:18

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: kuo_ace: syntax highlighter for Textpattern

Thanks, usefull plugin !

+1 for the textile mode, and maybee a Textpattern mode based on HTML.

I try it on HIVE, on 4.6, last nightly build, and there is a problem with the with of the textarea (100% of all the screen, and not the same with of the replaced textarea)

Offline

#10 2014-08-10 09:34:28

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: kuo_ace: syntax highlighter for Textpattern

It’s possible to lighten the .js load on your own server by outsourcing to a CDN, perhaps:

cdnjs.com/libraries/ace
www.jsdelivr.com/#!ace

Online

#11 2014-08-11 03:45:32

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 228
Website

Re: kuo_ace: syntax highlighter for Textpattern

Thanks everyone! It’s nice to get so much valuable feedback. :-) The next version has more features based on your ideas and observations. The download link is the same. Here’s a new screenshot of the settings page where you can switch theme, select which sections use Ace and what font size the editor has:

gaekwad: Exactly! It’s now fetched from CDN (jsDelvr), so users can put this plugin at work simply by activating it. No need for 9.3 megabytes of JavaScript files. :-)

jpdupont: Thanks for informing about that. Similar problem is with nightly build of 4.6 with all the admin themes, it seems. I coded a fix for that, which should activate automagically when Textpattern’s version number is higher than 4.5.5. Currently it looks like nightly build for 4.6 has actually version number 4.5.4 under the hood, so this fix doesn’t work just yet.

Last edited by kuopassa (2014-08-11 03:46:22)

Offline

#12 2014-08-11 14:10:42

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: kuo_ace: syntax highlighter for Textpattern

Update: As I suspected, disabling and reenabling solved the issue.

Installed the upgrade and got the the error below when I went to the extensions tab http://…/textpattern/index.php?event=kuo_ace

Internal error "Table 'dredr9xe.kuo_ace' doesn't exist"
in /home/.../...textpattern/lib/txplib_db.php at line 95.

adminErrorHandler()
textpattern/lib/txplib_db.php:95 trigger_error()
textpattern/lib/txplib_db.php:296 safe_query()
textpattern/lib/txplib_db.php:235 getRow()
textpattern/lib/txplib_misc.php(812) : eval()'d code:226 safe_row()

I’m sorry. I’m afraid I can’t do that; kuo_ace is an unsafe operation.

Offline

Board footer

Powered by FluxBB