Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a code editor to a textarea via console/bookmarklet

I've run into an issue where I'm developing pages on a CMS which is out of my control, and I'm editing increasingly complex pages with nothing more than a textarea.

Initially I'm creating the pages in my code editor, then copying the HTML into the textarea. Keeping the local and CMS code in sync by hand.

This workflow sucks.

I'd like to have code highlighting, etc while I work within the CMS. Is there any way I can add a code editor like Ace or CodeMirror to the textarea via bookmarklet or console command? I've tried using the Ace Bookmarket Builder but I don't know if it's been designed to work on any page, or just github.

Edit: I don't think I was clear enough above. I'm just an end user on this CMS, I have no ability to change how it functions on the backend. I literally just need a bookmarklet that finds the textarea and applies a code editor to it.

like image 807
Fireflight Avatar asked Sep 09 '13 15:09

Fireflight


1 Answers

both tinymce and syntaxhighlighter are packages that are not tied to a CMS, so if yours is custom then you will want to try to use these together, I have heard of some success in this adventure in the Drupal (there is actually a project for it currently) arena but you may be looking at a bit of work to do so custom. there is chatter about this http://www.tinymce.com/forum/viewtopic.php?id=22901 <-here with even a plugin to tinymce :) hope this gets the ideas going!

like image 198
mechhfly Avatar answered Sep 26 '22 00:09

mechhfly