fuck it push it
This commit is contained in:
@@ -11,16 +11,20 @@
|
||||
* - window.quotes_initialize();
|
||||
* - use window.quote_new() to get a new quote. */
|
||||
|
||||
/* firefox doesn't support import assertions yet (2022-02-20; fx 97.0) */
|
||||
window.quotes = [ ["Couldn't get quotes array.", "quotes.js"] ];
|
||||
window.QUOTES_FILE_LOCATION = "/js/quotes.json";
|
||||
window.QUOTES_L_QUOTE_MARK = '"';
|
||||
window.QUOTES_R_QUOTE_MARK = '"';
|
||||
window.QUOTES_QUOTE_AUTHOR_ID = "quote_author";
|
||||
window.QUOTES_QUOTE_AUTHOR_PREFIX = "~ ";
|
||||
window.QUOTES_QUOTE_VALUE_ID = "quote_value";
|
||||
|
||||
window.quotes_initialize = function(){
|
||||
var defaults = {
|
||||
quotes: [ ["Couldn't get quotes array.", "quotes.js"] ],
|
||||
QUOTES_FILE_LOCATION: "/js/quotes.json",
|
||||
QUOTES_L_QUOTE_MARK: '"',
|
||||
QUOTES_R_QUOTE_MARK: '"',
|
||||
QUOTES_QUOTE_AUTHOR_ID: "quote_author",
|
||||
QUOTES_QUOTE_AUTHOR_PREFIX: "~ ",
|
||||
QUOTES_QUOTE_VALUE_ID: "quote_value"
|
||||
};
|
||||
var i;
|
||||
for(i = 0; i < Object.keys(defaults).length; ++i)
|
||||
if(Object.keys(window).indexOf(Object.keys(defaults)[i]) == -1)
|
||||
window[Object.keys(defaults)[i]] = Object.values(defaults)[i];
|
||||
/* Weird JavaScript web voodoo. */
|
||||
fetch(window.QUOTES_FILE_LOCATION)
|
||||
.then(response => {return response.json();})
|
||||
|
||||
Reference in New Issue
Block a user