Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No non-jQuery version #28

Open
LoganDark opened this issue Jul 23, 2018 · 8 comments
Open

No non-jQuery version #28

LoganDark opened this issue Jul 23, 2018 · 8 comments

Comments

@LoganDark
Copy link

For some sites, jQuery is too big a dependency.

@LoganDark LoganDark changed the title Non-jQuery version No non-jQuery version Jul 23, 2018
@MattX
Copy link

MattX commented Feb 8, 2019

I've made a no-jQuery, pure-JS fork: https://github.com/MattX/highlight-within-textarea. Please let me know if you have any issues!

@lonekorean
Copy link
Owner

Very cool MattX! I haven't had much time to maintain this project but I'll take a closer look this weekend.

When I first started this project, jQuery was an obvious choice, but the web has moved on. I'm not thrilled about the jQuery dependency.

@MattX
Copy link

MattX commented Feb 9, 2019

Thanks! I made this fork assuming you weren't interested in merging it (if nothing else, because it changes the API), so I changed the package info / demo page to reduce confusion. Let me know if you want me to revert that and open a PR.

@RobbieTheWagner
Copy link

@MattX your version seems to be missing destroy so there is no way to remove it, right?

@brunoocasali
Copy link

@MattX you will publish your version to npm?!

@MattX
Copy link

MattX commented Jul 20, 2020

@rwwagner90—that's correct, I didn't port the destroy part because I didn't really need it... If you want to submit a PR to add that I'll be happy to merge it in.

@brunoocasali—good idea, I'll publish it this week!

@RobbieTheWagner
Copy link

@MattX I definitely think adding destroy and releasing basically a 1:1 version that doesn't need jQuery would be great. @lonekorean any chance you would want to merge the fork in here and make the official version not need jQuery?

@TehGoodLivin
Copy link

@MattX I definitely think adding destroy and releasing basically a 1:1 version that doesn't need jQuery would be great. @lonekorean any chance you would want to merge the fork in here and make the official version not need jQuery?

Should just be as easy as adding this to the highlight js. You just need to revert everything back to the original state that you had it and remove the events that were attached to your textarea.
destroy: function() { this.backdrop.remove(); this.el.className = this.el.className.replace(/ID + '-text ' + ID + '-input'/, ""); this.container.insertAdjacentElement('afterend', this.el) this.container.remove(); this.el.replaceWith(this.el.cloneNode(true)); },

@MattX correct me if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants