Skip to content

Commit

Permalink
Removed txt3 class because it does not exist, css used id reference.
Browse files Browse the repository at this point in the history
Removed display hide because js does that now in switch.
Removed a selector with commented out body.

Changed documentation to jsdoc format.

Small edits to login.js (Aspine#305)

* Simplified the login.js file. Reduced logic to single switch.

* Removed txt3 class because it does not exist, css used id reference.

* Removed display hide because js does that now in switch.
Removed a selector with commented out body.
  • Loading branch information
notrodes authored and notrodes committed Jul 24, 2021
1 parent 5450a98 commit 584c0d0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 25 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions public/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ textarea {
border: none;
}

textarea:focus, input:focus {
/*border-color: transparent !important;*/
}

input:focus::-webkit-input-placeholder { color:transparent; }
input:focus:-moz-placeholder { color:transparent; }
input:focus::-moz-placeholder { color:transparent; }
Expand Down Expand Up @@ -235,7 +231,6 @@ iframe {

#error {
color: red;
display: none;
}

#bottom-text {
Expand Down
41 changes: 22 additions & 19 deletions public/js/snackbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,30 @@ class Snackbar {
static SHOWN = 2

/**
* text is the main requirement, and it's just text
* color: String - string reference to a color or a variable, sets the background color
* textColor: String - string reference to a color or a variable, sets the text color
* buttonText: String - Sets the button text, both it and buttonClick have to be defined for the button to show
* buttonClick: Function - Sets the button's onclick logic, both it and buttonText have to be defined for the button to show
* destroyWhenButtonClicked : Boolean - Whether or not it should destroy itself when the button is clicked, defaults to true
* bodyClick: Function - Sets the body's onclick logic
* destroyWhenBodyClicked : Boolean - Whether or not it should destroy itself when the body is clicked, defaults to true
* timeout: Int - Time in ms
* timeoutFunction: Function - What to run on timeout (doesn't run if hidden or destroyed)
* timeoutMode: can be "destroy", "hide", "none" or empty. Determines what to do on timeout, destroys by default
* @constructor
* @param {string} text - Text is the main requirement, and it's just text
* @param {Object} options
* @param {string} options.color - reference to a color or a variable, sets the background color
* @param {string} options.textColor - reference to a color or a variable, sets the text color
* @param {string} options.buttonText - Sets the button text, both it and buttonClick have to be defined for the button to show
* @param {buttonCallback} options.buttonClick - Sets the button's onclick logic, both it and buttonText have to be defined for the button to show
* @param {boolean} [options.destroyWhenButtonClicked=true] - Whether or not it should destroy itself when the button is clicked, defaults to true
* @param {bodyCallback} options.bodyClick - Sets the body's onclick logic
* @param {boolean} [options.destroyWhenBodyClicked=true] - Whether or not it should destroy itself when the body is clicked, defaults to true
* @param {number} options.timeout - Time in ms
* @param {timeoutCallback} options.timeoutFunction - What to run on timeout (doesn't run if hidden or destroyed)
* @param {string} options.timeoutMode - can be "destroy", "hide", "none" or empty. Determines what to do on timeout, destroys by default
*/
constructor(text, options = {}) {
constructor(text, options = {destroyWhenButtonClicked: true, destroyWhenBodyClicked: true}) {
debugger;
this.text = text;
this.color = options["color"];
this.textColor = options["textColor"];
this.buttonText = options["buttonText"];
this.buttonClick = options["buttonClick"];
this.destroyWhenButtonClicked = options["destroyWhenButtonClicked"] || true;
this.bodyClick = options["bodyClick"];
this.destroyWhenBodyClicked = options["destroyWhenBodyClicked"] || true;
this.color = options.color;
this.textColor = options.textColor;
this.buttonText = options.buttonText;
this.buttonClick = options.buttonClick;
this.destroyWhenButtonClicked = options.destroyWhenButtonClicked;
this.bodyClick = options.bodyClick;
this.destroyWhenBodyClicked = options.destroyWhenBodyClicked;

//timeout logic
this.timeoutFunction = options["timeoutFunction"] !== undefined ? options["timeoutFunction"] : () => {};
Expand Down
2 changes: 1 addition & 1 deletion public/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
Enter Aspen credentials or leave blank to import data
</span>
<br/>
<span id="error" class="txt3"></span>
<span id="error"></span>
</div>
<!-- Username Input -->
<div class="wrap-input100">
Expand Down

0 comments on commit 584c0d0

Please sign in to comment.