krisis32 Posted February 12, 2011 Report Share Posted February 12, 2011 Vajadzētu uztaisīt custom bbcode paneli. Uzspied pimēram ikonu <b>, atveras logs, ieraksti tekstu un spied pievienot. Ievadītais teksts parādas textarea. Zinu ka ir tie editori, bet gribētos kautko tādu kā aprakstiju, jo citreiz ar roku ievadu <b>teksts</b>. Tādā gadijumā ja nemaldos tie editori vienkārši parāda to "<b>teksts</b>" nevis "teksts" . Quote Link to comment Share on other sites More sharing options...
0 Kemito Posted February 12, 2011 Report Share Posted February 12, 2011 Vispār jau teksts [b]Teksts[/b] Cik esi gatavs samaksāt ? Quote Link to comment Share on other sites More sharing options...
0 krisis32 Posted February 12, 2011 Author Report Share Posted February 12, 2011 Pasaki cenu, tad pateikšu vai esmu gatavs! Quote Link to comment Share on other sites More sharing options...
0 Grey_Wolf Posted February 12, 2011 Report Share Posted February 12, 2011 Pasaki cenu, tad pateikšu vai esmu gatavs! No tevis paris alinji, par to ka samekleju savos arhiivos ;) <html> <body> <script> function codeinsert(tag,elementa_id) { var elem = document.getElementById(elementa_id); elem.focus(); if (typeof document.selection != "undefined") { var range = document.selection.createRange(); range.text = "[" + tag + "]" + (tag=="URL"||tag=="IMG"?"http://":"") + range.text + "[/" + tag + "]"; range.move("character", -tag.length-3); range.select(); } else if (typeof elem.selectionStart != "undefined") { var startPos = elem.selectionStart; var endPos = elem.selectionEnd; var myValue = "[" + tag + "]" + (tag=="URL"||tag=="IMG"?"http://":"") + elem.value.substring(startPos ,endPos) + "[/" + tag + "]"; elem.value = elem.value.substring(0, startPos) + myValue + elem.value.substring(endPos, elem.value.length); var x = startPos + myValue.length - tag.length - 3; elem.setSelectionRange(x, x); } else { elem.value += "[" + tag + "]" + (tag=="URL"||tag=="IMG"?"http://":"") + "[/" + tag + "]"; } } </script> <a href="JavaScript:void(0)" onclick="codeinsert('i','apraksts') ;return false;">I</a> <a href="JavaScript:void(0)" onclick="codeinsert('b','apraksts') ;return false;">B</a> <a href="JavaScript:void(0)" onclick="codeinsert('URL','apraksts') ;return false;">URL</a> <br> <textarea name="apraksts" id="apraksts"></textarea> tagus pats sliksi kadus vajadzees ... P.S. sen atpaklj JS dalju samekleju sheit pat foruma. Quote Link to comment Share on other sites More sharing options...
0 Kemito Posted February 12, 2011 Report Share Posted February 12, 2011 Pelēkais vilks (facepalm), nedari cita vietā visu :// Quote Link to comment Share on other sites More sharing options...
0 krisis32 Posted February 12, 2011 Author Report Share Posted February 12, 2011 paldies tev, parakajos pa googli un atradu šo te <script language="javascript" type="text/javascript"> function addText(Text,Message) { var obj = document.form.message; obj.focus(); if (document.selection && document.selection.createRange) // Internet Explorer { sel = document.selection.createRange(); if (sel.parentElement() == obj) sel.text = Text; } else if (typeof(obj) != "undefined") // Firefox { var longueur = parseInt(obj.value.length); var selStart = obj.selectionStart; var selEnd = obj.selectionEnd; obj.value = obj.value.substring(0,selStart) + Text + obj.value.substring(selEnd,longueur); } else obj.value += Text; obj.focus(); } function addTags(Tag,fTag,Message) { var obj = document.form.message; obj.focus(); if (document.selection && document.selection.createRange) // Internet Explorer { sel = document.selection.createRange(); if (sel.parentElement() == obj) sel.text = Tag + sel.text + fTag; } else if (typeof(obj) != "undefined") // Firefox { var longueur = parseInt(obj.value.length); var selStart = obj.selectionStart; var selEnd = obj.selectionEnd; obj.value = obj.value.substring(0,selStart) + Tag + obj.value.substring(selStart,selEnd) + fTag + obj.value.substring(selEnd,longueur); } else obj.value += Tag + fTag; obj.focus(); } </script> <form method="post" name="form" action="..."> <!-- Bold fonts --> <a title="Bold : <b></b>" onmousedown="addTags('<b>','</b>')" style="background-color:#F7F7F7; font-size:10pt; border: outset white 1px;"> <b>B</b> </a> <a title="Bold : <b></b>" onmousedown="addTags('<a href=','</a>')" style="background-color:#F7F7F7; font-size:10pt; border: outset white 1px;"> <b>Link</b> </a> <br> <!--textarea --> <textarea wrap="VIRTUAL" name="message" cols="50" rows="10"></textarea> </form> Lieta tāda, ka nezinu kā lai ielieku onmousedown="addTags('<a href=','</a>')" šo daļu pareizi, ka href="links kad uzmet tagu">NAME</a> Quote Link to comment Share on other sites More sharing options...
0 marrtins Posted February 13, 2011 Report Share Posted February 13, 2011 nopūšas... :/ tagad slikts garīgais. Quote Link to comment Share on other sites More sharing options...
Question
krisis32
Vajadzētu uztaisīt custom bbcode paneli.
Uzspied pimēram ikonu <b>, atveras logs, ieraksti tekstu un spied pievienot. Ievadītais teksts parādas textarea.
Zinu ka ir tie editori, bet gribētos kautko tādu kā aprakstiju, jo citreiz ar roku ievadu <b>teksts</b>.
Tādā gadijumā ja nemaldos tie editori vienkārši parāda to "<b>teksts</b>" nevis "teksts" .
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.