I said no thanks and he immediately responded with “well for the right person we can go up to (95% of my base)” but still my TC is like 30-40% on top of that I can’t just give that away at a job that requires very little of me right? IDK.
Somewhere in the last few years I’ve put in like zero effort beyond just normal work, not sure what happened. 4 years ago I was working a mid-paying job for the role and at 3pm every day would “clock out” and start working on my board game site side project, now I can’t even be assed to do anything on it or any other out of work coding. Blah.
function navDropdown() {
document.getElementById("myDropdown").classList.toggle("show");
}
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
$(document).ready(function(event) {
if (checkCookie("hiddenSidebar")) {
$("#sidebar").show();
}
})
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
}
return "";
}
function checkCookie(cname) {
return cval = getCookie(cname) || false;
}
function hideSidebar() {
if (Discourse.User.current() !== null){
var cname = "hiddenSidebar";
var cdays = 120;
}
else {
var cname = "hiddenSidebar";
var cdays = 1;
}
$("#sidebar").hide();
setCookie(cname, true, cdays);
setTimeout(location.reload(), 2000);
}
Thanks, I just tested with a couple of other js libraries and was able to use them. I don’t know how I can test with jQuery until Discourse removes it but will assume your solution will work and deal with it if then it doesn’t. If I add <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> to the head now I get errors, but I’ll assume that’s because jQuety is already included with Discourse.
I was trying to see if anything on this site will possibly break in future versions of discourse. Since I am worthless with JS/front end stuff, I asked greg, and he dug up this post:
That’s the guy that created this software. Now, it’s probably nothing to worry about any time soon, but me and greg’s knowledge of JS is pretty limited to what we can just google, I think.
If they mean “removed from ember” in the sense jquery no longer is supported in ember - then will importing it work? Or do you think “removed from ember” means it will just stop natively supporting it?
sorry if this post is sounding really ignorant, because it is.
function wideScreen() {
setCookie('useWide', 'true', 120);
}
^^^(all good here no jquery)^^^
Vanilla:
domReady(function(event) {
if (checkCookie("hiddenSidebar")) {
document.getElementById("sidebar").style.display = 'block';
}
})
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
}
return "";
}
function checkCookie(cname) {
return cval = getCookie(cname) || false;
}
function hideSidebar() {
if (Discourse.User.current() !== null){
var cname = "hiddenSidebar";
var cdays = 120;
}
else {
var cname = "hiddenSidebar";
var cdays = 1;
}
document.getElementById("sidebar").style.display = 'none';
setCookie(cname, true, cdays);
setTimeout(location.reload(), 2000);
}
function domReady(fn) {
// If we're early to the party
document.addEventListener("DOMContentLoaded", fn);
// If late; I mean on time.
if (document.readyState === "interactive" ||
document.readyState === "complete" ) {
fn();
}
}
domReady(() => console.log("DOM is ready, come and get it!"));
The reference for $(document).ready is here:
As usual with SO the best answer is the 3rd or 4th one down and the massively upvoted first answer is trash.
I asked on the discourse board if, once jQuery is removed from Ember/Discourse, I’ll be able to import jQuery in a script tag in the <head> section and continue to use existing jQuery.
So I should probably just rewrite it because it’s just a couple dozens lines I’d have to change, but if I don’t get around to it in time it’s good to know there’s a quick fix
Redux people, do you use the same folder structure and conventions as the redux todo list example? And do you use the actionTypes.js file that just defines constants?