Nicedit

Post Reply
jetshack
Posts: 10
Joined: Wed May 30, 2012 8:47 pm

Nicedit

Post by jetshack »

I've been messing with this for the better part of a day.

I've looked at about 30 wysiwyg editors focusing on the smallest footprint possible.

I've found nicedit.

I think this would absolutely rock as they allow the script to be run either from your site OR FROM THEIR SITE...

If you run it from their site that means theoretically you'd add a total of two lines of code to the base wondercms install thus only adding about .01k to the cms download.

If you include the entire package in the download it comes in at less than 23k.

I can't get it to recognize the textarea's in the edit in place editor. So far I've either managed to get it to do nothing (about 5 different ways I've tried) or I've managed to get it not to open up the edit in place function (2 different ways).

For someone knowing what they're doing this would probably take about 2 minutes. So I'm going to leave it here and hope someone else can figure it out.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Nicedit

Post by wiz »

Thanks for the great find.

Glad you gave it a try, I'm going to try this, (if xss doesn't do it sooner (or better)). Externally isn't the best idea since they rely on their servers up-time. A good solution would be on the users server and downloading this as a plugin.
Hope to find a solution to this soon.
jetshack
Posts: 10
Joined: Wed May 30, 2012 8:47 pm

Re: Nicedit

Post by jetshack »

rob wrote: Externally isn't the best idea since they rely on their servers up-time.
Normally I'd agree with you on this except, this is being hosted on MIT's servers and has been in place for over 5 years.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Nicedit

Post by wiz »

I had no idea, but downtime is always possible, no matter who the host is. With some it's just unnoticeable, I'm really glad if they're one of them.
I believe users have more downtime than the MIT's servers, I just think they mind more if the downtime is caused by someone else. They also wouldn't blame WonderCMS for it (the downtime or the CMS itself being dysfunctional).

I guess we would have two options, hosting it on their servers or the option for them to download it and expand WonderCMS by those couple KB's.

I'm yet to test this out as soon as possible.
jetshack
Posts: 10
Joined: Wed May 30, 2012 8:47 pm

Re: Nicedit

Post by jetshack »

rob wrote:I guess we would have two options, hosting it on their servers or the option for them to download it and expand WonderCMS by those couple KB's.
That was my thought also.
jetshack
Posts: 10
Joined: Wed May 30, 2012 8:47 pm

Re: Nicedit

Post by jetshack »

I've managed to get nicedit to work in a simple textarea element by adding these two lines:

Code: Select all

<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>
The Edit in Place file (editinplace.js) section which I think is where the inclusion would need to be worked in looks like this:

Code: Select all

//edit field created
function editBox(actual) {
//alert(actual.nodeName+' '+changing);
if(!changing){
width = widthEl(actual.id) + 20;
height =heightEl(actual.id) + 2;
str = actual.innerHTML;
actual.innerHTML = str.replace(/<br>/gi, "");

actual.innerHTML = "<textarea name=\"textarea\" id=\""+ actual.id +"_field\" style=\"width: "+width+"px; height: "+height+"px;\" onfocus=\"highLight(this);\" onblur=\"noLight(this); return fieldBlur(this,'" + actual.id + "');\">" + actual.innerHTML + "</textarea>";
changing = true;
}

actual.firstChild.focus();
}
I just can't get the two to play together... I'm sure I'm missing a ' or " or some such, but for the life of me a I can't figure it out.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Nicedit

Post by wiz »

Jetshack, thank you very much for making it work, even if not fully, this means a lot to everyone who has contributed to WonderCMS.
I'm going to try this as soon as possible, but I've been so busy lately I didn't even manage to reply.

Thank you again, you're an excellent contributor.
I also updated the list of donors on my personal website.
Deckard
Posts: 2
Joined: Sat Apr 06, 2013 2:10 am

Re: Nicedit

Post by Deckard »

Has anyone gotten Nicedit to work with WonderCMS yet?
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Nicedit

Post by wiz »

Deckard wrote:Has anyone gotten Nicedit to work with WonderCMS yet?
Maybe someone has, but hasn't posted the solution yet. We're planning on integrating a WYSIWYG editor that will work by the end of the summer.
User avatar
turboblack
Posts: 198
Joined: Fri Sep 19, 2014 1:53 pm

Re: Nicedit

Post by turboblack »

HI jetshack

I recently ran into this problem, try your addon, but it does not work on version 0.6

tell me how to fix this?
http://old.net.eu.org/ Get ready to hamsterization! 8-) code takes less than a kilobyte! shock!
https://github.com/turboblack/HamsterCMS new version for PHP 8 with new templates
Post Reply