Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectBarks committed Feb 8, 2016
1 parent 5baa1b2 commit 9186bdb
Show file tree
Hide file tree
Showing 16 changed files with 180 additions and 14 deletions.
Binary file added branding/screenshot 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added branding/screenshot 1.xcf
Binary file not shown.
Binary file added branding/screenshot 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added branding/screenshot 2.xcf
Binary file not shown.
Binary file added branding/screenshot 3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added branding/screenshot 3.xcf
Binary file not shown.
Binary file added branding/screenshot 4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added branding/screenshot 4.xcf
Binary file not shown.
2 changes: 1 addition & 1 deletion extension/libs/background.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
chrome.webRequest.onBeforeRequest.addListener(function (details) {
return {cancel: details.url.indexOf("/sites/all/themes/schoology_theme/school_themes/style.css.php?theme=") != -1};
}, {urls: ["<all_urls>"]}, ['blocking']);
}, {urls: ["<all_urls>"]}, ['blocking']);
3 changes: 3 additions & 0 deletions extension/libs/init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
$(function () {
if ($("#copyright").text().toLowerCase().indexOf("schoology") <= -1) {
return;
}
console.log("Initializing boostogy...");

function executeRunnables(runnables) {
Expand Down
36 changes: 33 additions & 3 deletions extension/libs/modules/misc/hide-overdue.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
/**
* Created by brandon on 2/7/16.
*/
app.onInit(function () {
files.injectCSS("resources/css/overdue.css");

var overdueRoot = $(".overdue-submissions");
overdueRoot.addClass("overdue-toggle");

function updateOverdue(hideOverdue) {
overdueRoot.removeClass(hideOverdue ? "overdue-show" : "overdue-hide");
overdueRoot.addClass(hideOverdue ? "overdue-hide" : "overdue-show");
}

var toggle = $("<div class=\"toggle\" />");

overdueRoot.click(function() {
cache.get("hide_overdue", true, function (hideOverdue) {
cache.set("hide_overdue", !hideOverdue);
updateOverdue(!hideOverdue);
});
});


var refreshId = setInterval(function() {
var results = overdueRoot.find("h3");
if (results.length > 0) {
results.append(toggle);
clearInterval(refreshId);
}
}, 10);

cache.get("hide_overdue", true, function (hideOverdue) {
updateOverdue(hideOverdue);
});
});
16 changes: 7 additions & 9 deletions extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Boostogy",
"version": "2.0.1",
"version": "2.1.0",
"manifest_version": 2,
"description": "Boostogy updates schoology to be more user friendly and intuitive!",
"icons": {
Expand All @@ -15,9 +15,6 @@
"persistent": true
},
"permissions": [
"clipboardRead",
"clipboardWrite",
"contextMenus",
"storage",
"webRequest",
"webRequestBlocking",
Expand All @@ -26,8 +23,10 @@
"content_scripts": [
{
"matches": [
"*://app.schoology.com/*",
"*://schoology.dasd.org/*"
"<all_urls>"
],
"include_globs": [
"*schoology*"
],
"js": [
"vendor/jquery/jquery.js",
Expand All @@ -53,13 +52,12 @@
"libs/modules/misc/autoload.js",
"libs/modules/misc/popup-scroll-lock.js",
"libs/modules/misc/settings-dropdown.js",
"libs/modules/misc/hide-overdue.js",
"libs/modules/profile/squarer.js",
"libs/modules/profile/circlizer.js",
"libs/init.js"
],
"css": [
"resources/css/style.css"
]
"css": []
}
],
"web_accessible_resources": [
Expand Down
27 changes: 27 additions & 0 deletions extension/resources/css/overdue.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.overdue-toggle > h3 > .toggle {
float: right;
margin-top: 10px;
margin-right: 5px;
}

.overdue-toggle.overdue-show > h3 > .toggle {
width: 10px;
height: 2px;
background: #333;
}

.overdue-toggle > h3 {
cursor: pointer;
}

.overdue-toggle.overdue-hide > h3 > .toggle {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid;
}

.overdue-toggle.overdue-hide > .upcoming-list {
display: none;
}
107 changes: 107 additions & 0 deletions extension/vendor/bind-first/jquery.bind-first.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
(function($) {
var splitVersion = $.fn.jquery.split(".");
var major = parseInt(splitVersion[0]);
var minor = parseInt(splitVersion[1]);

var JQ_LT_17 = (major < 1) || (major == 1 && minor < 7);

function eventsData($el) {
return JQ_LT_17 ? $el.data('events') : $._data($el[0]).events;
}

function moveHandlerToTop($el, eventName, isDelegated) {
var data = eventsData($el);
var events = data[eventName];

if (!JQ_LT_17) {
var handler = isDelegated ? events.splice(events.delegateCount - 1, 1)[0] : events.pop();
events.splice(isDelegated ? 0 : (events.delegateCount || 0), 0, handler);

return;
}

if (isDelegated) {
data.live.unshift(data.live.pop());
} else {
events.unshift(events.pop());
}
}

function moveEventHandlers($elems, eventsString, isDelegate) {
var events = eventsString.split(/\s+/);
$elems.each(function() {
for (var i = 0; i < events.length; ++i) {
var pureEventName = $.trim(events[i]).match(/[^\.]+/i)[0];
moveHandlerToTop($(this), pureEventName, isDelegate);
}
});
}

function makeMethod(methodName) {
$.fn[methodName + 'First'] = function() {
var args = $.makeArray(arguments);
var eventsString = args.shift();

if (eventsString) {
$.fn[methodName].apply(this, arguments);
moveEventHandlers(this, eventsString);
}

return this;
}
}

// bind
makeMethod('bind');

// one
makeMethod('one');

// delegate
$.fn.delegateFirst = function() {
var args = $.makeArray(arguments);
var eventsString = args[1];

if (eventsString) {
args.splice(0, 2);
$.fn.delegate.apply(this, arguments);
moveEventHandlers(this, eventsString, true);
}

return this;
};

// live
$.fn.liveFirst = function() {
var args = $.makeArray(arguments);

// live = delegate to the document
args.unshift(this.selector);
$.fn.delegateFirst.apply($(document), args);

return this;
};

// on (jquery >= 1.7)
if (!JQ_LT_17) {
$.fn.onFirst = function(types, selector) {
var $el = $(this);
var isDelegated = typeof selector === 'string';

$.fn.on.apply($el, arguments);

// events map
if (typeof types === 'object') {
for (type in types)
if (types.hasOwnProperty(type)) {
moveEventHandlers($el, type, isDelegated);
}
} else if (typeof types === 'string') {
moveEventHandlers($el, types, isDelegated);
}

return $el;
};
}

})(jQuery);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Boostogy",
"version": "2.0.1",
"version": "2.1.0",
"repository": {
"type": "git",
"url": "https://github.com/ProjectBarks/boostogy.git"
Expand Down
1 change: 1 addition & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
rm extension.zip
version=`cat package.json | json version`
cat extension/manifest.json | json -j -e "this.version = \"$version\"" > extension/manifest_new.json
rm extension/manifest.json
Expand Down

0 comments on commit 9186bdb

Please sign in to comment.