Wednesday, May 11, 2011

My answer to "Code Editor is here"

This is my answer to a Question on Support site for LampCMS project


I think I fixed it. Testing - first html code, then php then css


<div class="someclass">My text</div>


now some php:


if(2>1 && $ok){
        run($ok);
} else {
        exit(1);
}



now css:

table {
        border-collapse: collapse;
        border-spacing: 0;
}

Tuesday, May 10, 2011

Code Editor is here

My Question on Support site for LampCMS project

OK, ready for this? I made some improvements to the RTEEditor. Resizing widget is gone but Link insertion is working much better and there is an Image insertion widget now.

I have also added a Code style highlighter to the editor. This is something I added to the YUI Editor myself. It is actually fairly complicated thing to add. It's a 3 part process: 1) adding the working drop down menu that would wrap the selected text in special tag that will later be used to format the code.
2) Some changes on the server to make sure it is parsed correctly by html parser
3) Adding couple of extra js files to page to do the actual code highlighting. I used an existing JS code highlighter code from http://www.dreamprojections.com/syntaxhighlighter/

Of cause I modified it to work the way I want it to.

And there is also a small step 4 - admin can enable this in !config.ini file by setting
ENABLE_CODE_EDITOR = true

It's false by default as for most non-programming sites this "Code style" tool will cause more confusion.


I think it beats code style editor/highlighter used on StackOverflow hands down. You can select the programming language, even CSS or HTML code as different programming codes are highlighted differently.

I'm sure StackOverflow is a great site, I use it all the time, that's where the crowd is. But they would be so much better if they use RTE from Lampcms instead of their Lame-o MarkDown editor.

Enjoy. And feel free to post some code just to try it out. It's OK.

My phpcode


if(2>1){
        run($nice);
} else {
        exit(1);
}



Click here to post your reply


Code Editor is here

My Question on Support site for LampCMS project

OK, ready for this? I made some improvements to the RTEEditor. Resizing widget is gone but Link insertion is working much better and there is an Image insertion widget now.

I have also added a Code style highlighter to the editor. This is something I added to the YUI Editor myself. It is actually fairly complicated thing to add. It's a 3 part process: 1) adding the working drop down menu that would wrap the selected text in special tag that will later be used to format the code.
2) Some changes on the server to make sure it is parsed correctly by html parser
3) Adding couple of extra js files to page to do the actual code highlighting. I used an existing JS code highlighter code from http://www.dreamprojections.com/syntaxhighlighter/

Of cause I modified it to work the way I want it to.

And there is also a small step 4 - admin can enable this in !config.ini file by setting
ENABLE_CODE_EDITOR = true

It's false by default as for most non-programming sites this "Code style" tool will cause more confusion.


I think it beats code style editor/highlighter than on StackOverflow hands down. You can select the programming language, even CSS or HTML code as different programming codes are highlighted differently.

I'm sure StackOverflow is a great site, I use it all the time, that's where the crowd is. But they would be so much better if they use RTE from Lampcms instead of their Lame-o MarkDown editor.

Enjoy. And feel free to post some code just to try it out. It's OK.

My phpcode


if(2>1){
        run($nice);
} else {
        exit(1);
}



Click here to post your reply


Monday, May 9, 2011

Should we use simpler Link and Image tool in Editor?

My Question on Support site for LampCMS project

I know that adding link in Editor brings up a form that is somewhat messed-up, some times more messed up than others. I found that the Editor resize utility, while is kind-of cool and I like it, cases the problem with the link form and also with image form (we don't have image tool right now but I tested it)

So the solution would be to either get rid of resize utility in Editor or use simple prompts to enter url for link and url for image.

The Editor will still be auto-resizable, meaning when you keep typing longer posts and need more height, the Editor will just auto-expand.

You can also see examples of simple Link and Image tools here on YUI demo page: http://developer.yahoo.com/yui/examples/editor/simple_adv_editor.html

I am leaning more towards getting rid of resize and keeping advanced link and image options, but this is still open for discussion.

Click here to post your reply


Sunday, May 8, 2011

Added Blogger API support

My Question on Support site for LampCMS project

We now have an option to post Question or Answer to user's blog on Blogger via bloggerAPI.
Just like our Tumblr module it uses OAuth authentication.

Use can "connect" blogger blog from their profile page or from the "Ask" or "Answer" form when they click the "Post to blogger" check box and their account is not yet connected to Blogger.

More social features means more traffic for your site. Imagine a user with popular blog decides to share a question on a blog. That would mean a lot more new visitors to your Q&A site.

In the future we may also be able to monitor that post on blogger an any comments made on blogger will be imported as comments to that question or answer.

Also comments added to Question or Answer or an answer to a question made on the site may be posted to blogger's post as comments. This of cause is pretty dangerous feature because if someone posts a spam on your site we sure don't want to propagate that spam to someone else's blog.

Click here to post your reply


My answer to "Is there any way to include images in my post?"

This is my answer to a Question on Support site for LampCMS project


There are some posts with images on this site. I am not sure how they did it. There is no support to actually save an image to the server but there is a way to just include an img tag that points to image hosted somewhere else. 

Saturday, May 7, 2011

Tumblr support added

My question on Support site for LampCMS project

I finished the TumblrAPI module.
User can now send Question or Answer to their Tumblr blog at the time of posting.

It uses OAuth authentication, just like Twitter API.

So source is on github.

I will work on few minor changes next like not including deleted items in views even for administrators
Instead there will be a separate controller to view deleted items and only administrator will be able to use it.

Click here to post your reply