Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-05-26 13:35:25

spiffin
Plugin Author
From: London, UK
Registered: 2004-06-08
Posts: 95
Website

spf_codemirror - syntax-highlighting and code-completion admin plugin

CodeMirror syntax-highlighting and Emmet code-completion plugin for Textpattern admin.

Edit pages, forms, css, javascript (and more) full-screen, in your browser, with a choice of syntax-highlighting and code-completion.

Customisable via preferences: choose a theme, font-size and full-screen hot-keys.

Thanks to Marijn (CodeMirror), Sergey (Zen Coding) and Dale (mrd_codeMirror).

Instructions and screenshot.

Note: when upgrading please delete your old ‘codemirror’ directory and upload a new one (and obviously replace the plugin).

New version 1.0 requires CodeMirror 5.0.

For new features and instructions please see the README on GitHub

Emmet is pretty smart.

NetTuts screencast

Cheatsheet

It even works with (opening and closing) Textpattern tags — try typing txp:if_section and then hitting TAB.

Version history

1.0 – March 2015

  • Changes for CodeMirror 5.0
  • Added support for Plugin Composer (add a commented PHP tag: //<?php at start to enable)
  • Removed Minify support
  • Enable or disable Emmet (for speed)

0.9 – October 2014

  • Changes for CodeMirror 4.6

0.8 – January 2013

  • Changes for CodeMirror 3.01 & Emmet 1.3.3
  • Added match-highlighter feature for Pages, Forms & Javascript.
  • Fixed search in full-screen mode.

0.7 – November 2012

0.6 – November 2012

  • Re-written for Textpattern 4.5.x (still works in 4.4.x).
  • Upgraded to CodeMirror 2.35 and Emmet.
  • Full-screen support – hit F5 (and Esc to exit).
  • Basic preferences via Admin > Preferences > Advanced.
  • CodeMirror folder structure now mirrors standard CodeMirror for easy upgrades.
  • Automatic Minify support.

0.5 – May 2012

  • CSS support for Zen Coding within style tags.

0.4 – May 2012

  • Added code block indicators: spf_codemirror START/END.
  • Code cleanup.

0.3 – May 2012

  • Added Zen Coding code completion to Pages and Forms (HTML).
  • Upgraded to CodeMirror 2.25.

0.2 – May 2012

  • Changed load order (to allow interaction with other plugins).

0.1 – May 2012

  • first release.

Last edited by spiffin (2015-03-18 19:02:09)

Offline

#2 2012-05-26 16:31:00

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: spf_codemirror - syntax-highlighting and code-completion admin plugin

Thanks for all your work on this Simon. It’s a great hike up in functionality for the TXP back end.

Offline

#3 2012-05-26 23:36:24

spiffin
Plugin Author
From: London, UK
Registered: 2004-06-08
Posts: 95
Website

Re: spf_codemirror - syntax-highlighting and code-completion admin plugin

joebaich wrote:

Thanks for all your work on this Simon. It’s a great hike up in functionality for the TXP back end.

You’re welcome Joe.

Offline

#4 2012-05-27 11:24:59

Szorstki
Member
From: Poland
Registered: 2012-05-27
Posts: 20

Re: spf_codemirror - syntax-highlighting and code-completion admin plugin

Hi, I’ve put “codemirror” folder in my Xampp project directory ( X:\Xampp\htdocs\txp\ ) but there’s no syntax-highlighting and changing themes in presentation forms/pages/styles/js don’t work. I’ve tried to put “codemirror” in txp\textpattern, but nothing changed. What is wrong? Probably I misunderstood install instructions :/
I am using Win7, TXP 4.4.1, Xampp 1.7.7. Plugin spf_codemirror is enabled.

Offline

#5 2012-05-27 13:00:08

spiffin
Plugin Author
From: London, UK
Registered: 2004-06-08
Posts: 95
Website

Re: spf_codemirror - syntax-highlighting and code-completion admin plugin

Szorstki wrote:

I’ve tried to put “codemirror” in txp\textpattern, but nothing changed. What is wrong?

Hello

The ‘codemirror’ directory goes in the your root web directory (not inside the textpattern directory) and files should be accessible via e.g. :

[DocumentRoot]/codemirror/cm_combined_min.css

So, if your root URL is http://example.com, you should see the above css file in your browser at http://example.com/codemirror/cm_combined_min.css

.. and, if your root URL is ‘localhost’, you should see it at http://localhost/codemirror/cm_combined_min.css

If not:

- try the latest version (I just made a small tweak which might help you);

- check permissions on the ‘codemirror’ directory;

- check your Xampp DocumentRoot setting.

Simon

Last edited by spiffin (2012-06-09 23:01:13)

Offline

#6 2012-05-27 13:32:38

Szorstki
Member
From: Poland
Registered: 2012-05-27
Posts: 20

Re: spf_codemirror - syntax-highlighting and code-completion admin plugin

Ok, X:\Xampp\htdocs\codemirror works, thanks a lot.

Offline

#7 2012-05-27 18:06:23

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,201
Website

Re: spf_codemirror - syntax-highlighting and code-completion admin plugin

Way to make my work 100 times better inside a month. this is zackly what I was looking for {oh, the shame ;) }

[ mrdale starts uninstallling all instances of mrd_codemirror, installing spf_codemirror ]

Offline

#8 2012-05-29 16:43:33

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,201
Website

Re: spf_codemirror - syntax-highlighting and code-completion admin plugin

zencoding for css?

Offline

#9 2012-05-29 16:51:50

spiffin
Plugin Author
From: London, UK
Registered: 2004-06-08
Posts: 95
Website

Re: spf_codemirror - syntax-highlighting and code-completion admin plugin

mrdale wrote:

zencoding for css?

Hi Dale

It doesn’t work at present with CodeMirror .. it might if I separated them .. but I don’t have time to fiddle this week.

See Zen Coding downloads — and compare ‘Zen Coding for CodeMirror2’ with ‘Zen Coding for textarea’.

Simon

Last edited by spiffin (2012-05-29 19:01:36)

Offline

#10 2012-05-29 18:41:30

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,201
Website

Re: spf_codemirror - syntax-highlighting and code-completion admin plugin

just curious really. so nice to have codemirror + zen regardless of css support.

Offline

Board footer

Powered by FluxBB