HTML to BBCode JavaScript Help

Здраво

Client
Регистрация
11.07.2011
Сообщения
99
Реакции
45
Баллы
18
I'm trying to figure out how to make this but with no luck so far, I'm not that good with JS anyway.

Basically it should work like this http://www.seabreezecomputers.com/html2bbcode/ you just insert your html links and it auto convert it to bb code. At the moment I'm doing this with macro replace, but it require to many steps, I figure it would be better to do it in only one step. I would really appreciate someone good with JS to look at in the script provided at that page and convert it to fit JS in Zenno Poster all community would benefit of this, I'm sure of it.

THanks
 
Why don't you just use this form?)
Paste code there and convert :huh:
 
Yeah, looks quite simple to automate without JS
 
you guys are joking right?

2012-08-09_1636.png

Not to mention its equal amount of steps require to use that web site vs use replace. Using JS withing ZP its one step, and no need for calling third party resource. Thanks for trying to help though!
 
Simplicity and result.
Are the only things I care when I create projects :)
I don't mind about count of steps personally :)
I care about the time I spend on recording them)

We are all different :)
 
Dunno if this is what you mean, but if so...it shouldn't be difficult, even when you don't know js that good.
You only have to use the replace function...

HTML:
Развернуть Свернуть Копировать
var html='<a href="http://www.test.com">test</a>';
var convert1=html.replace('<a href="','[url=');
var convert2=convert1.replace('">',']');
var bbcode=convert2.replace('</a>','[/url]');

The reason I would use JS instead of the form on that site, is that otherwise your backlinking template would be dependent on that conversion site to be online. Depending on a third party can be simple, but the result is not guaranteed.
 
That's exactly what I was looking for, thanks you man you're awesome!
Dunno if this is what you mean, but if so...it shouldn't be difficult, even when you don't know js that good.
You only have to use the replace function...

HTML:
Развернуть Свернуть Копировать
var html='<a href="http://www.test.com">test</a>';
var convert1=html.replace('<a href="','[url=');
var convert2=convert1.replace('">',']');
var bbcode=convert2.replace('</a>','[/url]');

The reason I would use JS instead of the form on that site, is that otherwise your backlinking template would be dependent on that conversion site to be online. Depending on a third party can be simple, but the result is not guaranteed.
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)