-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5baa1b2
commit 9186bdb
Showing
16 changed files
with
180 additions
and
14 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters