vihanb / PPCG-Design

A redesign of the PPCG website
codegolf.stackexchange.com
35 stars 14 forks source link

jQuery has left the userscript #114

Closed ETHproductions closed 7 years ago

ETHproductions commented 7 years ago

The userscript has stopped working sometime in the last few days. I checked my browser console (in Firefox) and found that any time a PPCG page is loaded, this error message occurs:

ReferenceError: $ is not defined

Unless I'm mistaken, we can no longer directly use jQuery... So what should we do?

vihanb commented 7 years ago

I believe there's a way to expose window to greasemonkey I did it for sandbox viewer

ETHproductions commented 7 years ago

OK, after reading this post I think what we need to do is

// @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js

(That's the jQuery version that SE uses, we might choose to use a different one)

ConorOBrien-Foxx commented 7 years ago

Or, you know, you could try getting rid of jQuery. Just sayin'.

RikerW commented 7 years ago

but jquery is great and does all things

ETHproductions commented 7 years ago

@ConorOBrien-Foxx I'm sure that's possible, but we call jQuery 190 times throughout the userscript, many of which aren't for simple DOM manipulation tasks. It won't be anywhere close to easy, but if you'd like to try, go ahead... :P

ConorOBrien-Foxx commented 7 years ago

@ETHproductions Hrmph. Oh well.

vihanb commented 7 years ago

Can we make a library that takes jquery code and converts it to sane JS

somebody1234 commented 7 years ago

Yes definitely, but I want it to also turn insane JS into sane JS