function make( what ) { var newText; switch ( what ) { case 'chapter': newText = '
'+prompt('naslov poglavja','')+'
'; break; case 'bold': newText = ''+prompt('krepka pisava','')+''; break; case 'italic': newText = ''+prompt('nagnjena pisava','')+''; break; case 'underline': newText = ''+prompt('podčrtano','')+''; break; case 'left': newText = '
'+prompt('leva poravnava','')+'
'; break; case 'center': newText = '
'+prompt('sredinska poravnava','')+'
'; break; case 'right': newText = '
'+prompt('desna poravnava','')+'
'; break; case 'pre': newText = '\n\r
\n\r\n\r\n\r
\n\r'; break; case 'hr': newText = '\n\r
\n\r'; break; case 'list': var alineje = prompt('Število alinej','1'); if ( alineje > 0 ) { newText = '\r'; } else newText = ''; break; case 'url': newText = ''+prompt('Tekst','')+''; break; case 'email': newText = ''+prompt('Tekst','')+''; break; case 'img': newText = ''+prompt('Alternativni tekst','slika')+''; break; case 'user': var user = prompt('Vzdevek uporabnika','negdo'); newText = ''+user+''; break; } if ( newText && document.form.contents.createTextRange && document.form.contents.caretPos ) { var position = document.form.contents.caretPos; position.text = position.text.charAt(position.text.length - 1) == ' ' ? newText + ' ' : newText; } else document.form.contents.value += newText; document.form.contents.focus(); } function storeCaret(text) { if (text.createTextRange) text.caretPos = document.selection.createRange().duplicate(); } function smile(name) { var newText; switch( name ) { case '1': newText = " [:)]"; break; case '2': newText = " [:D]"; break; case '4': newText = " [norec]"; break; case '5': newText = " [:(]"; break; case '6': newText = " [cmera]"; break; case '7': newText = " [cudno]"; break; case '8': newText = " [kiman]"; break; case '9': newText = " [nezavavest]"; break; case '10': newText = " [zadrzano]"; break; case '11': newText = " [zajec]"; break; case '12': newText = " [:P]"; break; case '13': newText = " [jeza]"; break; case '14': newText = " [zaba]"; break; case '15': newText = " [hmmm]"; break; case '16': newText = " [agresija]"; break; case '17': newText = " [:))]"; break; case '18': newText = " [ufo]"; break; case '19': newText = " [gravz]"; break; case '20': newText = " [negativ]"; break; } newText = ''+newText+''; if ( newText && document.form.contents.createTextRange && document.form.contents.caretPos ) { var position = document.form.contents.caretPos; position.text = position.text.charAt(position.text.length - 1) == ' ' ? newText + ' ' : newText; } else document.form.contents.value += newText; document.form.contents.focus(); }