Skip to content
Open

B1 #5

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/JSDocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: JSDocs
on: [push,pull_request]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build
uses: andstor/jsdoc-action@v1
with:
source_dir: ./
recurse: true
output_dir: ./jsdocs

- name: fecth
run: git fetch origin main

- name: branch check
run: git branch


- name: config b2wu
run: git config --global user.name "QE"
- name: config email
run: git config --global user.email "[email protected]"


- name: upload to repor
working-directory: ./
run: git add jsdocs/
- name: commit to repor
run: git commit -m 'jsodcs updatge'
- name: push to repor
run: git push origin HEAD:main

- name: config run
working-directory: ./jsdocs
run: ls

Binary file added jsdocs/fonts/OpenSans-Bold-webfont.eot
Binary file not shown.
1,830 changes: 1,830 additions & 0 deletions jsdocs/fonts/OpenSans-Bold-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jsdocs/fonts/OpenSans-Bold-webfont.woff
Binary file not shown.
Binary file added jsdocs/fonts/OpenSans-BoldItalic-webfont.eot
Binary file not shown.
1,830 changes: 1,830 additions & 0 deletions jsdocs/fonts/OpenSans-BoldItalic-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jsdocs/fonts/OpenSans-BoldItalic-webfont.woff
Binary file not shown.
Binary file added jsdocs/fonts/OpenSans-Italic-webfont.eot
Binary file not shown.
1,830 changes: 1,830 additions & 0 deletions jsdocs/fonts/OpenSans-Italic-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jsdocs/fonts/OpenSans-Italic-webfont.woff
Binary file not shown.
Binary file added jsdocs/fonts/OpenSans-Light-webfont.eot
Binary file not shown.
1,831 changes: 1,831 additions & 0 deletions jsdocs/fonts/OpenSans-Light-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jsdocs/fonts/OpenSans-Light-webfont.woff
Binary file not shown.
Binary file added jsdocs/fonts/OpenSans-LightItalic-webfont.eot
Binary file not shown.
1,835 changes: 1,835 additions & 0 deletions jsdocs/fonts/OpenSans-LightItalic-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jsdocs/fonts/OpenSans-LightItalic-webfont.woff
Binary file not shown.
Binary file added jsdocs/fonts/OpenSans-Regular-webfont.eot
Binary file not shown.
1,831 changes: 1,831 additions & 0 deletions jsdocs/fonts/OpenSans-Regular-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jsdocs/fonts/OpenSans-Regular-webfont.woff
Binary file not shown.
65 changes: 65 additions & 0 deletions jsdocs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Home</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

<h1 class="page-title">Home</h1>








<h3> </h3>




















</div>

<nav>
<h2><a href="index.html">Home</a></h2>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Tue May 25 2021 00:06:50 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
1 change: 1 addition & 0 deletions jsdocs/js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

121 changes: 121 additions & 0 deletions jsdocs/router.js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: router.js</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

<h1 class="page-title">Source: router.js</h1>






<section>
<article>
<pre class="prettyprint source linenums"><code>// router.js

export const router = {};

/**
* Changes the "page" (state) that your SPA app is currently set to
*/
router.setState = function(state, flag) {
/**
* - There are three states that your SPA app will have
* 1. The home page
* 2. The entry page (showing one individual entry)
* 3. The settings page (currently blank, no actual settings here, just a placeholder where a real settings page would go)
*
* - If you look at the CSS, we have 2 classes you can add to the body element to help change states, "settings" and "single-entry"
* - Changing states will require more than just changing these classes, for example the settings page requires you to change the title to "Settings"
* - And each individual entry the title changes to "Entry #" based on it's number in the entry order
*
* - When changing states, make sure the back and forward buttons work. You can use hash URLs (e.g. https://someurl.com/#settings) when changing states
* to make things easier.
* - Similarly, when viewing an individual entry, a hashed URL might look like https://someurl.com/#entry3
*
* - Some tips:
* 1. Push a new state object to the history object using history.pushState()
* 2. look up the documentation for how to use pushState() when you try it
* 3. look up the documentation for the "popstate" event listener (fires only on back button), useful in your script.js file
* 4. For each &lt;journal-entry> element, you can grab the JSON version of its info with .entry (e.g. someJournalEntryElement.entry)
* a. This is useful when viewing a single entry. You may notice an &lt;entry-page> element in the HTML, this is the element that is displayed when the
* .single-entry class is applied to the body. You can populate this element by using .entry similarly. So if I wanted to grab a specific &lt;journal-entry>
* and populate it's info into the &lt;entry-page>, I would simply use an assignment of newEntryElement.entry = journalEntryElement.entry
* b. Clearing the &lt;entry-page> element of its previous data can be a bit tricky, it might be useful to just delete it and insert a new blank one
* in the same spot each time. Just a thought.
*
* - Answers to some questions you may have:
* 1. You may add as many helper functions in this file as you like
* 2. You may modify the parameters of setState() as much as you like
*/
let body = document.querySelector("body");
let title = document.querySelector("h1");

if(state.name == 'main') {
title.innerText = 'Jounral Entries';
body.classList.remove('settings');
body.classList.remove('single-entry');
if(!flag){
history.pushState(state,'', location.origin);
}
}
else if(state.name == 'settings'){
title.innerText = 'Settings';
body.className = 'settings';
if(!flag){
history.pushState(state, '', '#settings');
}
}
else if(state.name == 'entry'){
let id = state.id;
title.innerText= 'Entry' + id;
body.className = 'single-entry';
let newEntry = document.querySelector('entry-page');
newEntry.remove();
newEntry = document.createElement('entry-page');
newEntry.entry = document.getElementById(id).entry;
body.appendChild(newEntry);
if(!flag){
history.pushState(state,'', '#entry' + id);
}
}

}
</code></pre>
</article>
</section>




</div>

<nav>
<h2><a href="index.html">Home</a></h2>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Tue May 25 2021 00:06:50 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
25 changes: 25 additions & 0 deletions jsdocs/scripts/linenumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*global document */
(() => {
const source = document.getElementsByClassName('prettyprint source linenums');
let i = 0;
let lineNumber = 0;
let lineId;
let lines;
let totalLines;
let anchorHash;

if (source && source[0]) {
anchorHash = document.location.hash.substring(1);
lines = source[0].getElementsByTagName('li');
totalLines = lines.length;

for (; i < totalLines; i++) {
lineNumber++;
lineId = `line${lineNumber}`;
lines[i].id = lineId;
if (lineId === anchorHash) {
lines[i].className += ' selected';
}
}
}
})();
Loading