JS Quicktags
I’ve released the JavaScript Quicktags used in Tasks Pro™, Tasks and WordPress under the LGPL license.
This is a set of buttons that allow you to insert HTML tags into a content area. The tags are cursor aware – placed around a selection or at the cursor position. This is also an example of how to get the cursor position with JavaScript.
Example Page
A sample insertAtCursor function:
function insertAtCursor(myField, myValue) { //IE support if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = myValue; } //MOZILLA/NETSCAPE support else if (myField.selectionStart || myField.selectionStart == '0') { var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); } else { myField.value += myValue; } } // calling the function insertAtCursor(document.formName.fieldName, 'this value');
Thanx!
[…] classic text buttons, just like we know them from WordPress. Of course, it’s all based on quicktags by Alex […]
you are a very cool dude.
[…] die den WYSIWYG-Editor verschmähen lieben ihre Quicktags. Mal schnell jemanden zitiert, ein fettes Wort geschrieben oder Codeschnipsel eingefügt. Leute […]
[…] für das Kommentieren“: Blogger die den WYSIWYG-Editor verschmähen lieben ihre Quicktags. Mal schnell jemanden zitiert, ein fettes Wort geschrieben oder Codeschnipsel […]
[…] für das Kommentieren“: Blogger die den WYSIWYG-Editor verschmähen lieben ihre Quicktags. Mal schnell jemanden zitiert, ein fettes Wort geschrieben oder Codeschnipsel […]
THIS EXSAMPLE IS SUPER!!!!!!!!!!!!!!!!!!!!!!!!
THANK YOU!!!!!!!!!!
That ‘close tags’ feature is pristine!
As usual, Alex is the King.
wanted it, saw it, got it! thanks Alex…excellent
[…] Quicktags : permettant d’ajouter des contrôles au formulaire de commentaire. […]
Thank you very much!!!
From Russia =) JS Quicktags – rulezzzzz!
[…] JS Quicktags. This is a set of buttons that allow you to insert HTML tags into a content area. The tags are cursor aware – placed around a selection or at the cursor position. That ‘close tags’ feature is pristine! As usual, Alex is the King. […]
[…] muss ich das Quicktags-Modul nehmen, oder – wenn das nicht taugt – ein Modul für Alex Kings JS Quicktags Editor schreiben, weil der einfach zu verdammt arsch handlich […]
[…] Tags,JS Quicktags,Math Comment Spam Protection,Subscribe to […]
[…] eklentisi yazılara Ek özellikler katan (kalın,italik,link,alıntı,kod) etiket menüsü JS Quicktags Script eklendi bu uygulamayı kendi temanızda kullanmak isterseniz Buraya […]
[…] ë¼ì´ì„¼ìŠ¤ì˜ js-quicktags.js를 ê°€ì§€ê³ í¬ìŠ¤íŒ… ì°½ì—ì„œ html tag를 ë„£ì„ ìˆ˜ 있ë„ë¡ […]
[…] eklentisi yazılara Ek özellikler katan (kalın,italik,link,alıntı,kod) etiket menüsü JS Quicktags Script eklendi bu uygulamayı kendi temanızda kullanmak isterseniz Buraya […]
[…] tiny_mce plugin and then realized that the code tab in WordPress actually switches the editor to a quicktags editor. I set about creating the needed buttons and found the source of the switchEditor function […]
It is possible to have a deleteatcursor function ?
[…] new version of my JS Quicktags is now available. This release adds a very nice feature, the ability to attach the Quicktags to […]
[…] Tags,JS Quicktags,Math Comment Spam Protection,Subscribe to […]
[…] pushed a new version of my JS Quicktags out. This is a bug fix release the catches two spots I missed that needed to be tweaked to support […]
Excellent script, thanks for saving me hours!
hi,
i use this beatiful script on my coppermine gallery, it’s really work,
and we still disscuss on this script at forum.copperm[...]picseen.html
thx
dugunum
[…] El mejor ejemplo que podrán conseguir lo pueden ver en esta misma página, en la parte Dejar un comentario. Pueden encontrar otro ejemplo igual de bueno en la página de Alex King. […]
[…] pomocy skryptu z alexking.org wzbogaciÅ‚em formularz komentowania o funkcjÄ™ wstawiania elementów Textile za […]
[…] du solche Quicktags auch bei anderen Projekten als in deinem Blog verwenden möchtest, empfehle ich JS Quicktags von Alex […]
[…] I’m not the only one. Replacing quicktags.js in ~/wp-includes/ with a version downloaded from Alex King’s website cured the problem for me. I’m not sure whether there are any other implications from doing […]
Hello, I have looked through various posts of yours tracing back this “insertAtCursor” function to see if there is any mention of this working or not working in IE6? I have practically copied this as is into a page of mine, and IE6 is always inserting the text at the very beginning of the textarea. Firefox is working great. Thank you for your help!
Hello again, sorry I posted too hastily, and have been troubleshooting this IE6 scenario and it seems that it works great if your cursor was last in the textarea you want to insert to. However, if you focus to another textfield or textarea, the original textarea in IE6 seems to forget where its cursor position was. Thus, trying to insert to a textarea that was not the last field of focus in IE6 is not working. I shall try experimenting with providing IE6 with a “reminder” via an onBlur event and see if that works. Thanks again!
Very helpful, thank you.
[…] 官方主页 | JS 下载 | […]
[…] xiaorszåŒå¦æŠŠQuicktag利用JQueryéšè—在一个“Bâ€å—ä¸ï¼ŒåŽŸå› æ˜¯â€œå› ä¸ºä¸€ç›´æ²¡æœ‰æ‰¾åˆ°å¥½ä¸€ç‚¹çš„å›¾ç‰‡ï¼Œå°±å…ˆç”¨è¿™ä¸ªäº†ï¼Œå…¶å®žä¸æ€Žä¹ˆå–œæ¬¢ï¼â€åœ¨æ¤å€Ÿç”¨ä¸€ä¸‹ä»–的截图: […]
[…] już wspomniaÅ‚em, jest to modyfikacja skryptu JS QuickTags Alexa Kinga. Kilka moich poprawek wystarczyÅ‚o, by ten niewielki kawaÅ‚ek kodu zaczÄ…Å‚ generować znaczniki […]
november cursor textarea function editor
for its contents. This is a safe-cache copy of the original web site.