steveathon / bootstrap-wysiwyg

Tiny bootstrap-compatible WYSIWYG rich text editor
MIT License
661 stars 1.71k forks source link

When defining hot keys it is impossible to write text (at all) #10

Closed mattan closed 9 years ago

mattan commented 9 years ago

I don't want to fork for minor change but pay attention that the line "bindHotkeys(options.hotKeys);" should be "bindHotkeys(options.hotkeys);"

noamho commented 9 years ago

@mattan, on your last comment, I don't see the difference between the two lines.

mattan commented 9 years ago

the letter k.

noamho commented 9 years ago

Now I see.

steveathon commented 9 years ago

Hi @mattan

It looks like hotKeys is the right variable set in the code. bootstrap-wysiwyg.js#L310 has

$.fn.wysiwyg.defaults = {
    hotKeys: { }
    };

This is used later, as

bindHotkeys(options.hotKeys);

Which makes sense in this context. I think.

Thanks for the spot though, it did make me go through and double check that everything was referenced right. What it does highlight, is a need to change the naming to be a little clearer by not repeating keywords.

mattan commented 9 years ago

It is still reproducible if you have at least one hotkey, can you please take a look:

here it works correct, but with this version it works incorrect

steveathon commented 9 years ago

So, I can see that those examples are different. I'm trying to replicate it on the example HTML but I am struggling to do so.

I did a clean clone and loaded it on a clean host - the examples are working aok?

mattan commented 9 years ago

the only different is the line: getScript('http://mindmup.github.io/bootstrap-wysiwyg/bootstrap-wysiwyg.js'

anyway are you able to write any text in a text box with hotkeys? if so - you can close the bug. this is not example specific - on my machine I can't withe a text no matter what hot key i define and no matter hoe the HTML looks like.

steveathon commented 9 years ago

No you are right - those examples work and do not work respectively. The problem was, the code reference you are using is incorrect. If you replace the JS with:

getScript('https://raw.githubusercontent.com/steveathon/bootstrap-wysiwyg/master/src/bootstrap-wysiwyg.js')

It works.

mattan commented 9 years ago

I replaced the JS here it still reproducible (see the link)

(In the link i am using https://raw.githubusercontent.com/steveathon/bootstrap-wysiwyg/master/src/bootstrap-wysiwyg.js)

steveathon commented 9 years ago

Ok, I was finally able to replicate that. It is Google Chrome. Latest version and probably others. I will check tomorrow to see if it is related to the other chrome issue or if it's new.

Thanks for the spot!! I thought I was going batty for a minute there.

mattan commented 9 years ago

Thanks! (by the way it is also reproducible on IE)