Skip to content

Commit

Permalink
Release v3.17; update gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
aopell committed Aug 16, 2018
1 parent 8cbe330 commit a610ff6
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 167 deletions.
154 changes: 78 additions & 76 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,76 +1,78 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# VSCode data
.vscode
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# VSCode data
.vscode

SchoologyPlus.zip
180 changes: 90 additions & 90 deletions js/all-idle.js
Original file line number Diff line number Diff line change
@@ -1,91 +1,91 @@
// patch for arrow menu in Firefox
(function () {
let arrow = document.getElementById("primary-settings");
let content = arrow.innerHTML;
arrow.innerHTML = "";
arrow.innerHTML = content;
let arrowMenu = document.querySelector("#primary-settings>a");
let dropdown = document.getElementById("settings-menu-dropdown");
arrowMenu.removeAttribute("href");
arrowMenu.style.cursor = "pointer";
arrowMenu.addEventListener("click", function (event) {
if (isVisible(dropdown)) {
dropdown.style.display = "none";
arrowMenu.classList.remove("active");
} else {
dropdown.style.display = "block";
arrowMenu.classList.add("active");
}
});
document.body.addEventListener("click", function (event) {
if (getParents(event.target, "#primary-settings").length == 0) {
dropdown.style.display = "none";
arrowMenu.classList.remove("active");
}
});
})();

// theme loading, with course icon overriding
(function () {
let themesList = document.getElementById("themes-list");
if (storage.themes) {
for (let t of storage.themes) {
let closeButton = createElement("a", ["close-button"], { textContent: "×", href: "#", title: "Delete Theme", onclick: (event) => deleteTheme(event.target.dataset.themeName) });
closeButton.dataset.themeName = t.name;
let exportButton = createElement("a", ["export-button"], { textContent: "↗", href: "#", title: "Export Theme", onclick: () => alert("Copied to clipboard") });
exportButton.dataset.clipboardText = JSON.stringify(t, null, 4);
themesList.appendChild(createElement("h3", ["setting-description"], {}, [
closeButton,
exportButton,
createElement("span", [], { textContent: " " + t.name })
]));
}
}

if (!storage.themes || storage.themes.length === 0) {
themesList.appendChild(createElement("h3", ["close-button"], { textContent: "No themes installed" }));
}

new Clipboard(".export-button");

if (storage.courseIcons != "disabled") {

Theme.setProfilePictures();

let resetIconsOnMutate = function (target, predicate) {
// slight hack: if predicate defined, be broader about observation
// allows the course dashboard junk to work
let config = { childList: true, subtree: !!predicate };
let observer = new MutationObserver(() => 0);

let callback = (mutationsList) => {
if (predicate && !predicate(mutationsList)) {
// predicate is defined, but returns false
// not yet
return;
}

Theme.setProfilePictures();
observer.disconnect();
};

observer = new MutationObserver(callback);
observer.observe(target, config);
};

// courses dropdown (all pages)
let target = document.querySelector(".sections-list");
if (target) {
// TODO why might this be null?
resetIconsOnMutate(target);
}
// course dashboard
let mainInner = document.getElementById("main-inner");

if (mainInner && window.location.pathname == "/home/course-dashboard") {
resetIconsOnMutate(mainInner, function (mutationsList) {
return !!mainInner.querySelector(".course-dashboard .sgy-card-lens");
});
}
}
// patch for arrow menu in Firefox
(function () {
let arrow = document.getElementById("primary-settings");
let content = arrow.innerHTML;
arrow.innerHTML = "";
arrow.innerHTML = content;
let arrowMenu = document.querySelector("#primary-settings>a");
let dropdown = document.getElementById("settings-menu-dropdown");
arrowMenu.removeAttribute("href");
arrowMenu.style.cursor = "pointer";
arrowMenu.addEventListener("click", function (event) {
if (isVisible(dropdown)) {
dropdown.style.display = "none";
arrowMenu.classList.remove("active");
} else {
dropdown.style.display = "block";
arrowMenu.classList.add("active");
}
});
document.body.addEventListener("click", function (event) {
if (getParents(event.target, "#primary-settings").length == 0) {
dropdown.style.display = "none";
arrowMenu.classList.remove("active");
}
});
})();

// theme loading, with course icon overriding
(function () {
let themesList = document.getElementById("themes-list");
if (storage.themes) {
for (let t of storage.themes) {
let closeButton = createElement("a", ["close-button"], { textContent: "×", href: "#", title: "Delete Theme", onclick: (event) => deleteTheme(event.target.dataset.themeName) });
closeButton.dataset.themeName = t.name;
let exportButton = createElement("a", ["export-button"], { textContent: "↗", href: "#", title: "Export Theme", onclick: () => alert("Copied to clipboard") });
exportButton.dataset.clipboardText = JSON.stringify(t, null, 4);
themesList.appendChild(createElement("h3", ["setting-description"], {}, [
closeButton,
exportButton,
createElement("span", [], { textContent: " " + t.name })
]));
}
}

if (!storage.themes || storage.themes.length === 0) {
themesList.appendChild(createElement("h3", ["close-button"], { textContent: "No themes installed" }));
}

new Clipboard(".export-button");

if (storage.courseIcons != "disabled") {

Theme.setProfilePictures();

let resetIconsOnMutate = function (target, predicate) {
// slight hack: if predicate defined, be broader about observation
// allows the course dashboard junk to work
let config = { childList: true, subtree: !!predicate };
let observer = new MutationObserver(() => 0);

let callback = (mutationsList) => {
if (predicate && !predicate(mutationsList)) {
// predicate is defined, but returns false
// not yet
return;
}

Theme.setProfilePictures();
observer.disconnect();
};

observer = new MutationObserver(callback);
observer.observe(target, config);
};

// courses dropdown (all pages)
let target = document.querySelector(".sections-list");
if (target) {
// TODO why might this be null?
resetIconsOnMutate(target);
}
// course dashboard
let mainInner = document.getElementById("main-inner");

if (mainInner && window.location.pathname == "/home/course-dashboard") {
resetIconsOnMutate(mainInner, function (mutationsList) {
return !!mainInner.querySelector(".course-dashboard .sgy-card-lens");
});
}
}
})();
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"update_url": "https://gist.githubusercontent.com/aopell/82a6f5c409dc0af7e97d2ebaf88c84f6/raw/update.json"
}
},
"version": "3.16",
"version": "3.17",
"icons": {
"128": "imgs/[email protected]",
"64": "imgs/[email protected]",
Expand Down

0 comments on commit a610ff6

Please sign in to comment.