Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Western to Cyrilic character conversion help in advanced editor

Quote Reply
Western to Cyrilic character conversion help in advanced editor
Hi,

I'm new on GForum and still enjoying the wonderful features of the product.
GT staff thank you Cool


And here is my problem we trying to force the people to use native language for writing on our forum not using the phonetic transcription and i use this addition to post_write.html so users can convert their posts to cyrillic characters before submit posts.

In basic editor everything works fine. But in Advanced editor won't. Frown

I think the problem is in red parts of code ... i don't know how to get the message field in Advanced editor.

Can anybody or GT staff give a clue, what is the form name and how can i access it? I looked in the files but has been totally confused Crazy

Code:
<script language="JavaScript" type="text/javascript">
<!--
// Define the forum markup tags
<%GForum::Markup::list_tags%>
markup_tags = new Array(
<%loop markup_loop%>
'[<%tag%>]'<%if has_closing%>,'[<%closing_tag%>]'<%endif%><%if first or inner%>,<%endif%>
<%endloop%>
);

// New BEGIN (CYR MOD)
var EN = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~[]{|}";
var BG = "";
var expr = new RegExp();
var forum_markup = ''+markup_tags.join(' ');
markupEN = forum_markup.split(' ');
for(i=0; i<EN.length-5;i++) forum_markup = forum_markup.replace(expr.compile(EN.charAt(i), "g"), BG.charAt(i));
for(; i<EN.length;i++) forum_markup = forum_markup.replace(expr.compile("\\"+EN.charAt(i), "g"), BG.charAt(i));
forum_markup = forum_markup.replace(/\\/g, "");
markupBG = forum_markup.replace(/\)/g, "\\)").replace(/\(/g, "\\(").replace(/\?/g, "\\?").split(' ');

function decodeCyrillize() {
var post_msg = document.post.post_message.value;
for(i=0; i<EN.length-5;i++) post_msg = post_msg.replace(expr.compile(EN.charAt(i), "g"), BG.charAt(i));
for(; i<EN.length;i++) post_msg = post_msg.replace(expr.compile("\\"+EN.charAt(i), "g"), BG.charAt(i));
post_msg=post_msg.replace(/\\/g, "");

for(c=0; c<markupBG.length;c++) post_msg = post_msg.replace(expr.compile(markupBG[c], "g"), markupEN[c]);

document.post.post_message.value = post_msg;
}
// New END (CYR MOD)
//-->
</script>

p.s. Sorry for my english Frown

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins

Last edited by:

eupos: Jul 21, 2005, 8:08 AM
Quote Reply
Re: [eupos] Western to Cyrilic character conversion help in advanced editor In reply to
No one? UnsurePirateFrown

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins