mirror of
https://github.com/gurnec/removeddit.git
synced 2026-03-11 08:54:27 +00:00
Removed some unused functions
This commit is contained in:
parent
d21b314aca
commit
f882169e2a
2 changed files with 17 additions and 11 deletions
|
|
@ -31,6 +31,7 @@ return {
|
|||
// Check browser support
|
||||
var isSupported = self.fetch && self._ && self.Promise;
|
||||
|
||||
// If not supported show error
|
||||
if(!isSupported) {
|
||||
(function() {
|
||||
var isMissing = [];
|
||||
|
|
@ -39,6 +40,7 @@ if(!isSupported) {
|
|||
if(!self.Promise) isMissing.push("promise");
|
||||
if(!self._) isMissing.push("lodash");
|
||||
|
||||
// And a link with an error report to reddit... maybe not best way but its something
|
||||
var url = "https://www.reddit.com/message/compose/?to=Jubbeart";
|
||||
url += "&subject="+encodeURIComponent("Missing dependencies: " + isMissing.join(" "));
|
||||
url += "&message="+encodeURIComponent("Comment (optional): ");
|
||||
|
|
@ -112,6 +114,7 @@ return {
|
|||
}
|
||||
}})();
|
||||
|
||||
|
||||
var URLs = (function(){
|
||||
var reddit = "https://oauth.reddit.com";
|
||||
var pushshift = "https://api.pushshift.io";
|
||||
|
|
@ -147,6 +150,7 @@ return {
|
|||
})();
|
||||
|
||||
|
||||
// UTC time handling, very usefull when dealing with elasticsearch
|
||||
var Time = (function(){
|
||||
return {
|
||||
utc: function() {
|
||||
|
|
@ -161,11 +165,11 @@ return {
|
|||
times = _.parseInt(parts[0]);
|
||||
}
|
||||
|
||||
if(_.includes(timeString, "hour")) return times * 3600;
|
||||
if(_.includes(timeString, "day")) return times * 86400;
|
||||
if(_.includes(timeString, "week")) return times * 604800;
|
||||
if(_.includes(timeString, "month")) return times * 2592000;
|
||||
if(_.includes(timeString, "year")) return times * 31536000;
|
||||
if(_.includes(timeString, "hour")) return times * 3600;
|
||||
if(_.includes(timeString, "day")) return times * 86400;
|
||||
if(_.includes(timeString, "week")) return times * 604800;
|
||||
if(_.includes(timeString, "month")) return times * 2592000;
|
||||
if(_.includes(timeString, "year")) return times * 31536000;
|
||||
|
||||
return Time.utc();
|
||||
},
|
||||
|
|
@ -176,6 +180,7 @@ return {
|
|||
};
|
||||
})();
|
||||
|
||||
// The get variables used in the url
|
||||
var GetVars = (function(){
|
||||
return {
|
||||
get: function(variable) {
|
||||
|
|
@ -195,10 +200,6 @@ return {
|
|||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
|
||||
set: function(variable, value) {
|
||||
window.location.href = window.location.href.split("?")[0] + "?"+variable+"="+value;
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
// Change this to your own client ID: https://www.reddit.com/prefs/apps
|
||||
// The app NEEDS TO BE an installed app and NOT a web apps
|
||||
var clientID = "";
|
||||
// Guide about it here: https://github.com/JubbeArt/removeddit#the-i-just-want-to-get-this-shit-running-guide
|
||||
// NOTE: The app NEEDS TO BE an installed app and NOT a web apps
|
||||
var clientID = "";
|
||||
|
||||
if(clientID === "") {
|
||||
alert("Missing client-ID for Reddit API. See the file \"static/js/id.js\"");
|
||||
}
|
||||
Loading…
Reference in a new issue