mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-13 15:27:16 +03:00
Fix comment formatting
This commit is contained in:
parent
1d4479e5d2
commit
b73bc1a395
@ -16,8 +16,8 @@ var STATE = (function(){
|
||||
};
|
||||
|
||||
/*
|
||||
* Resets the state to default values.
|
||||
*/
|
||||
* Resets the state to default values.
|
||||
*/
|
||||
resetState(){
|
||||
this._savefile = null;
|
||||
this._isTracking = false;
|
||||
@ -26,8 +26,8 @@ var STATE = (function(){
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the savefile object, creates a new one if needed.
|
||||
*/
|
||||
* Returns the savefile object, creates a new one if needed.
|
||||
*/
|
||||
getSavefile(){
|
||||
if (!this._savefile){
|
||||
this._savefile = new SAVEFILE();
|
||||
@ -37,15 +37,15 @@ var STATE = (function(){
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if the database file contains any data.
|
||||
*/
|
||||
* Returns true if the database file contains any data.
|
||||
*/
|
||||
hasSavedData(){
|
||||
return this._savefile != null;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if currently tracking message.
|
||||
*/
|
||||
* Returns true if currently tracking message.
|
||||
*/
|
||||
isTracking(){
|
||||
return this._isTracking;
|
||||
}
|
||||
@ -59,8 +59,8 @@ var STATE = (function(){
|
||||
}
|
||||
|
||||
/*
|
||||
* Combines current savefile with the provided one.
|
||||
*/
|
||||
* Combines current savefile with the provided one.
|
||||
*/
|
||||
uploadSavefile(fileName, fileObject){
|
||||
this._lastFileName = fileName;
|
||||
this.getSavefile().combineWith(fileObject);
|
||||
@ -68,8 +68,8 @@ var STATE = (function(){
|
||||
}
|
||||
|
||||
/*
|
||||
* Triggers a savefile download, if available.
|
||||
*/
|
||||
* Triggers a savefile download, if available.
|
||||
*/
|
||||
downloadSavefile(){
|
||||
if (this.hasSavedData()){
|
||||
DOM.downloadTextFile(this._lastFileName || "dht.txt", this._savefile.toJson());
|
||||
@ -77,8 +77,8 @@ var STATE = (function(){
|
||||
}
|
||||
|
||||
/*
|
||||
* Registers a Discord server and channel.
|
||||
*/
|
||||
* Registers a Discord server and channel.
|
||||
*/
|
||||
addDiscordChannel(serverName, serverType, channelId, channelName){
|
||||
var serverIndex = this.getSavefile().findOrRegisterServer(serverName, serverType);
|
||||
|
||||
@ -88,8 +88,8 @@ var STATE = (function(){
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds all messages from the array to the specified channel. Returns true if the savefile was updated.
|
||||
*/
|
||||
* Adds all messages from the array to the specified channel. Returns true if the savefile was updated.
|
||||
*/
|
||||
addDiscordMessages(channelId, discordMessageArray){
|
||||
if (this.getSavefile().addMessagesFromDiscord(channelId, discordMessageArray)){
|
||||
triggerStateChanged("data", "messages");
|
||||
@ -101,15 +101,15 @@ var STATE = (function(){
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if the message was added during this session.
|
||||
*/
|
||||
* Returns true if the message was added during this session.
|
||||
*/
|
||||
isMessageFresh(id){
|
||||
return this.getSavefile().isMessageFresh(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a listener that is called whenever the state changes. The callback is a function that takes subject (generic type) and detail (specific type or data).
|
||||
*/
|
||||
* Adds a listener that is called whenever the state changes. The callback is a function that takes subject (generic type) and detail (specific type or data).
|
||||
*/
|
||||
onStateChanged(callback){
|
||||
stateChangedEvents.push(callback);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user