So I’m testing my comment form, click on my dictionary button in my newly installed quicktags for comments. When I click on cancel in the pop-up though, I’m still taken to dictionary.com.
What’s up with that? I’ve tried it on another person’s blog and the same thing happens.
Well, in some functions a “die” statement exists – happens if you cancel an action (like you are saying above) or in some circs if a function doesn’t find what it’s looking for. In the file will be a “die” statement which will output what should happen when the cancel or not found circumstance occurs.
So a die statement for your cancel action in the popup isn’t calling the proper redirect or close action it sounds like.
Thanks for clarifying, vkaryl. 🙂
I guess what’s confusing to me is that that the dictionary function is found in the wp-admin/quicktags.js file, so this would have to be happening to everybody, but I couldn’t find a mention of it anywhere here.
I have modified that file before to add some buttons, but I was careful to not touch anything else. I’ve been wrong before, but I’m stumped on this one. I suppose I could just hide that button, but that wouldn’t solve the problem.
I really do appreciate your help on this. Any more ideas?
Well, if you want to email me the relevant code, I’ll look at it to see if there’s anything wonky that hits me between the eyes [[keep FIRMLY in mind that I am NOT a code-jockey, much LESS any kind of programmer, okay?]]
sylvermoon (at) gmail (dot) com – try to keep it under a half meg….
What needs to be happening is a check for null returned from the prompt function. Also, it would be smart to do a simple regex test on the string to make sure it’s at least a bunch of letters. Without looking at the code I can tell you it has to look something like this:
var strAnswer = '';
if ((strAnswer = prompt("Enter the word that you wish to lookup.")) !== null
&& /^\w[\w ]*$/.test(strAnswer))
// open new window to dictionary.com
// (else do nothing)
Has anyone filed a bug for this?
Can anyone assign this bug? It’s a rather simple fix that could be checked in without much worry.
Added another patch to the bug to make the regex less restrictive.
- The topic ‘“Dictionary” quicktag button not cancelling’ is closed to new replies.