saguaroib / saguaro

saguaro imgboard software
14 stars 5 forks source link

jQuery suite conversion, minor refactor #189

Closed Apogate closed 8 years ago

Apogate commented 8 years ago

WELCOME TO THE NEW AGE

This sets the suite down a neat path. This is more for me to learn on the go as I break things, but these changes just shortens some suite labeling.

This also introduces neat admin functionality, loading extra js scripts upon logging into the panel. This can eventually be used for moving certain admin tools right into the index. Since actions are validated server-side anyway, it won't hurt if some moron loads up the admin script. This also saves bandwith as admin js functions don't need to be sent via main.js anymore blah blah etc

In the future, main.js might have to be built by test.php since js files don't accept php config values like SITE_ROOT, and every site will have a different path to set that leads to admin.js.

@RePod don't look, i'm destroying your last safe space in the repo. if i'm doing some evil thing by removing your name, i'll change it back.

next time on saguaroZ:

RePod commented 8 years ago

I'd prefer if everybody would just leave my name where it is.

However it's not just there for no reason, it's within my namespace as an object.

Instead of having a bunch of objects/functions/etc. polluting the top-level namespace it's all under repod which is enough attribution I'm content with.

Something that would be ImageExpand.function() is repod.image_expansion.function() or wherever it is placed. Same for everything else that happened to be using repod.

It also has the indirect benefit of less chances to conflict with something, like another ImageExpand object which may or may not exist in the future.

RePod commented 8 years ago

I'll just say I don't really like any of the changes to my files, either wait (...) until I work on them or replace them completely with new code (which is what I would have eventually done).

I wrote them with flexibility in mind to be replaced and still integrated via the settings menu, there should be very little that actually needs to be modified in contrast to what could be added by just making a new file.

I would like to think the settings are the most functionality polished to allow things that hook into it to get the results they want.

Apogate commented 8 years ago

I'll stop bastardizing your work and wait until you get around to it then. In the meantime, I'll try to cobble something unholy together to possibly substitute. That's a threat.

RePod commented 8 years ago

I'm not stopping you. I just think it would be better instead of modifying the old code to write your own interpretation of a solution from scratch where you see fit.

There's no problem with having multiple combinations of suite-supported "extensions" working in conjunction.

But for instance, aside from a few specific cases a majority of the existing suite is fine and doesn't need to be touched while others could be replaced entirely. For instance apogate.thread_hider.

Even then, new additions don't have to follow the namespace guideline. I just prefer my files to, as it's part of my coding style.

Apogate commented 8 years ago

Eh, it's alright, I can work admin.js into a sizeable separate project while I still get a handle on js/jquery, then come back and better understand what I'm doing here. None of my changes are functional anywho, more pointless formatting and stylistic changes.

¯(ツ)/¯ no harm done. the work continues.