1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-22 18:15:47 +02:00

Add extendFunction and refactor window.TD in code.js

This commit is contained in:
chylex 2016-04-24 14:04:52 +02:00
parent 82a3cd8df2
commit 82a1e17b1d

View File

@ -1,4 +1,4 @@
(function($,$TD){
(function($,$TD,TD){
//
// Constant: List of valid font size classes.
//
@ -58,11 +58,11 @@
})();
// Force popup notification settings
window.TD.controller.notifications.hasNotifications = function(){
TD.controller.notifications.hasNotifications = function(){
return true;
};
window.TD.controller.notifications.isPermissionGranted = function(){
TD.controller.notifications.isPermissionGranted = function(){
return true;
};
@ -70,6 +70,17 @@
isInitialized = true;
};
//
// Function: Appends code at the end of a function.
//
var extendFunction = function(func, extension){
return function(){
var res = func.apply(this,arguments);
extension.apply(this,arguments);
return res;
};
};
//
// Function: Registers an observer to a TweetDeck column, which reports new tweets.
//
@ -249,4 +260,4 @@
e.preventDefault();
}
});
})($,$TD);
})($,$TD,TD);