Works like a charm.
Thank you for posting.
Printable View
Works like a charm.
Thank you for posting.
I implemented codemirror in TYPO3 with ExtJS and built a fileeditor which highlights all kinds of files. Integrated jslint, versioning, and much more.
It works great with latest codemirror. If you are interested here is the main file:
http://forge.typo3.org/projects/typo...js/em_files.js
and it looks like this:
http://forge.typo3.org/attachments/download/5450
this won't work. parser is the class name of the parser you use and included.
Also raw phpParser won't work because the <? let's break the parsing.
This way it will work:
Code:parser: 'PHPHTMLMixedParser',
parserfile: [
"parsexml.js",
"parsecss.js",
"tokenizejavascript.js",
"parsejavascript.js",
"../contrib/php/js/tokenizephp.js",
"../contrib/php/js/parsephp.js",
"../contrib/php/js/parsephphtmlmixed.js",
"../contrib/sql/js/parsesql.js"
],
What do You mean with won't work? It will work if You don't use <?php, so for plain php it's working correctly. If You want to use it combined mode for php and html, there is already mixed class defined and it works like a charm :) But be aware then in this case if You don't use <?php it won't highlight! So in general it depends on every other user case ;) Here are the samples:
Attachment 24661
Attachment 24662
Attachment 24663
Attachment 24664
Hi,
yes, exactly this is the problem with the parser that it depends of having php tag or not ;)
I wrote this because i had errors using PHPParser with <?php ...
I wondered about parser: 'php', as i always use the correct classnames:
PHPParser, PHPHTMLMixedParser
With my debugs, all other declarations didn't worked. Unfortunally there is no try/catch, so wrong parser name direct throws js error.
btw - the author works on codemirror2 which is a complete rewrite with much cleaner code, i'm looking forward. Existing codemirror has some weakness.
Hi!
Yes, already gave some hands over first beta :) BTW wanted to say the same \:D/ Let's keep fingers crossed! =;
I havent created a UX for this yet, since, i only used this for just 1 window.. but, this is what i did...
Code:
var form = new Ext.form.FormPanel({
...
items: [{
xtype: 'textarea',
name: 'addjson'
...
}]
...
});
var textarea = form.getForm().findField('addjson');
jsonfield = CodeMirror.fromTextArea(textarea.el.dom, {
height: textarea.getHeight() + 'px',
content: textarea.getValue(),
parserfile: ["tokenizejavascript.js", "parsejavascript.js"],
stylesheet: __baseurl + "lib/codemirror/css/jscolors.css",
path: __baseurl + "lib/codemirror/js/",
autoMatchParens: true,
textWrapping: false,
width: textarea.getWidth(),
parserConfig: {
json: true
}
});
// Just to remove the invalid marker
//
jsonfield.frame.contentWindow.addEventListener('keydown', function(e){
jsonfield.wrapping.className = 'x-form-text x-form-field no-margin-field';
});
jsonfield.wrapping.className = 'x-form-text x-form-field no-margin-field';
Hello @qulys,
good work and keep your development for nice application ^^!
1. Question: Can you update with preview?
I give a nice suggestion for preview per html site and support with javascript frameworks like Extjs or Qooxdoo and any frameworks of js to preview...
2. Question: Paint-able function like xur framework or any function with css-style?
Example: I create an shape quadrat with border than i save new image / sprite into local drive.
Do you believe posible via paint function without flash application only JS-Framework?
Thanks for new component, awesome! ^^
i know it is early yet but is there an ExtJS v4 version in the works?
Hi,
I have made a port to ExjJS 4.0 and CodeMirror 2.0, hope someone can use it.
Attachment 26301