| Index
» Projekty
» phpMyEdit
» Fórum
» BBcode buttons in the help column |
 |
phirschybar
Založený: 18.09.2003
Príspevky: 43
Zaslal: 2004-01-02 00:49
Návrat hore
Odpovedať s citátom
|
I have generated a new feature which displays BBcode buttons in the help column along side of a textarea in the CHANGE and ADD modes. It allows you to generate tags around selected text in the neighboring textarea.
For those of you not familiar with BBcode, it is the tags like "[b], [/u], etc" similar to HTML tags which are generated by the buttons that you see to the left of a message box when submitting on this forum.
I will post the feature soon but I am having one problem:
The buttons are working beautifully, wrapping the tags around the selected text, no problem. However, frequently but not ALWAYS, when I add tags and click SAVE, my browser CRASHES (IE6/WIndows XP). I havent a clue why this is happenning.
For the code, just click 'reply to this post' and do a 'view source'. I am using the EXACT same javascript functions you see there. Also, I altered the core class to include the storeCaret(this) function on textarea tags. Plus, the actual buttons are written in HTML directly in the 'help' array.
From all this, can anyone diagnose the reason for this crash. As soon as this gets sorted out, I'll add a BBcode option in the phpMyEdit API post the Patch here so everyone can use it. This will be a great new feature so please help me determine the cause of the crashing.
Ben
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-02 09:01
Návrat hore
Odpovedať s citátom
|
Hi,
I'm not javascript specialist at all, but this is probably caused by a loop or js memory leak.
1. Is your MSIE Browser uptodate with MS Windows update ?
2. Have you this problem with others versions of MSIE ?
3. With Opera/Mozilla ?
Note that Mozilla is good for debugging js (its js console/debugger is well featured)
| phirschybar Napísal: |
The buttons are working beautifully, wrapping the tags around the selected text, no problem. However, frequently but not ALWAYS, when I add tags and click SAVE, my browser CRASHES (IE6/WIndows XP). I havent a clue why this is happenning.
Ben |
|
phirschybar
Založený: 18.09.2003
Príspevky: 43
Zaslal: 2004-01-02 17:47
Návrat hore
Odpovedať s citátom
|
I'm not a javascript expert either which kills me at a time like this, but I know actionscript well and the syntax of the two is very similar.
I do regularly update IE and I made sure I had the newest version so the browser really wasn't the issue. You are most likely correct about it being a javascript loop or leak issue.
I think I have solved my problem for now. I removed the storeCarot() function from the texarea tags in the core class. I'm not exactly sure why this caused the crashing. StoreCarot() returns textrange values to determine where the cursor is within the textbox. So, now I cant click a BBcode button WITHOUT HAVING HIGHLIGHTED THE TEXT. For my purposes, this is just fine though.
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|